2005-03-05 12:19:14 +01:00
|
|
|
/*
|
|
|
|
* RichEdit - structures and constant
|
|
|
|
*
|
|
|
|
* Copyright 2004 by Krzysztof Foltman
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-03-05 12:19:14 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __EDITSTR_H
|
|
|
|
#define __EDITSTR_H
|
|
|
|
|
|
|
|
#ifndef _WIN32_IE
|
|
|
|
#define _WIN32_IE 0x0400
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2009-08-12 15:05:51 +02:00
|
|
|
#include <limits.h>
|
2005-03-05 12:19:14 +01:00
|
|
|
|
2006-02-22 19:56:11 +01:00
|
|
|
#define COBJMACROS
|
|
|
|
|
2005-03-05 12:19:14 +01:00
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
|
|
|
#include <winnls.h>
|
|
|
|
#include <winnt.h>
|
|
|
|
#include <wingdi.h>
|
|
|
|
#include <winuser.h>
|
|
|
|
#include <richedit.h>
|
|
|
|
#include <commctrl.h>
|
2006-02-01 13:05:40 +01:00
|
|
|
#include <ole2.h>
|
|
|
|
#include <richole.h>
|
2009-01-20 07:41:25 +01:00
|
|
|
#include "imm.h"
|
|
|
|
#include <textserv.h>
|
2014-01-15 14:06:43 +01:00
|
|
|
#include "usp10.h"
|
2005-03-05 12:19:14 +01:00
|
|
|
|
|
|
|
#include "wine/debug.h"
|
2018-02-03 23:59:45 +01:00
|
|
|
#include "wine/heap.h"
|
2013-01-29 14:41:48 +01:00
|
|
|
#include "wine/list.h"
|
2005-03-05 12:19:14 +01:00
|
|
|
|
2019-05-16 13:53:33 +02:00
|
|
|
#if defined(__i386__) && !defined(__MINGW32__)
|
2015-03-26 15:30:34 +01:00
|
|
|
extern const struct ITextHostVtbl itextHostStdcallVtbl DECLSPEC_HIDDEN;
|
2009-01-20 07:41:25 +01:00
|
|
|
#endif /* __i386__ */
|
|
|
|
|
2005-03-05 12:19:14 +01:00
|
|
|
typedef struct tagME_String
|
|
|
|
{
|
|
|
|
WCHAR *szData;
|
|
|
|
int nLen, nBuffer;
|
2016-10-07 11:49:33 +02:00
|
|
|
void (*free)(struct tagME_String *);
|
2005-03-05 12:19:14 +01:00
|
|
|
} ME_String;
|
|
|
|
|
2015-11-09 17:11:41 +01:00
|
|
|
typedef struct tagME_FontCacheItem
|
|
|
|
{
|
|
|
|
LOGFONTW lfSpecs;
|
|
|
|
HFONT hFont;
|
|
|
|
int nRefs;
|
|
|
|
int nAge;
|
|
|
|
} ME_FontCacheItem;
|
|
|
|
|
|
|
|
#define HFONT_CACHE_SIZE 10
|
|
|
|
|
2005-03-05 12:19:14 +01:00
|
|
|
typedef struct tagME_Style
|
|
|
|
{
|
|
|
|
CHARFORMAT2W fmt;
|
|
|
|
|
2015-11-09 17:11:41 +01:00
|
|
|
ME_FontCacheItem *font_cache; /* cached font for the style */
|
2005-03-05 12:19:14 +01:00
|
|
|
TEXTMETRICW tm; /* cached font metrics for the style */
|
|
|
|
int nRefs; /* reference count */
|
2014-01-15 14:06:43 +01:00
|
|
|
SCRIPT_CACHE script_cache;
|
2015-11-09 17:11:43 +01:00
|
|
|
struct list entry;
|
2005-03-05 12:19:14 +01:00
|
|
|
} ME_Style;
|
|
|
|
|
|
|
|
typedef enum {
|
2006-08-07 17:27:16 +02:00
|
|
|
diInvalid,
|
2005-03-05 12:19:14 +01:00
|
|
|
diTextStart, /* start of the text buffer */
|
|
|
|
diParagraph, /* paragraph start */
|
2008-08-07 18:31:41 +02:00
|
|
|
diCell, /* cell start */
|
2005-03-05 12:19:14 +01:00
|
|
|
diRun, /* run (sequence of chars with the same character format) */
|
|
|
|
diStartRow, /* start of the row (line of text on the screen) */
|
|
|
|
diTextEnd, /* end of the text buffer */
|
|
|
|
|
|
|
|
/********************* these below are meant for finding only *********************/
|
2008-08-07 18:31:41 +02:00
|
|
|
diStartRowOrParagraph, /* 7 */
|
2005-03-05 12:19:14 +01:00
|
|
|
diStartRowOrParagraphOrEnd,
|
|
|
|
diRunOrParagraph,
|
|
|
|
diRunOrStartRow,
|
|
|
|
diParagraphOrEnd,
|
2008-08-07 18:31:41 +02:00
|
|
|
diRunOrParagraphOrEnd, /* 12 */
|
2005-03-05 12:19:14 +01:00
|
|
|
} ME_DIType;
|
|
|
|
|
2008-12-18 07:56:49 +01:00
|
|
|
#define SELECTIONBAR_WIDTH 8
|
2008-07-04 22:02:47 +02:00
|
|
|
|
2005-03-05 12:19:14 +01:00
|
|
|
/******************************** run flags *************************/
|
|
|
|
#define MERF_STYLEFLAGS 0x0FFF
|
|
|
|
/* run contains non-text content, which has its own rules for wrapping, sizing etc */
|
2008-03-16 21:46:36 +01:00
|
|
|
#define MERF_GRAPHICS 0x001
|
2005-04-16 12:48:35 +02:00
|
|
|
/* run is a tab (or, in future, any kind of content whose size is dependent on run position) */
|
2008-03-16 21:46:36 +01:00
|
|
|
#define MERF_TAB 0x002
|
2008-08-07 18:31:41 +02:00
|
|
|
/* run is a cell boundary */
|
|
|
|
#define MERF_ENDCELL 0x004 /* v4.1 */
|
2006-02-04 17:01:01 +01:00
|
|
|
|
2008-08-07 18:31:41 +02:00
|
|
|
#define MERF_NONTEXT (MERF_GRAPHICS | MERF_TAB | MERF_ENDCELL)
|
2005-03-05 12:19:14 +01:00
|
|
|
|
|
|
|
/* run is splittable (contains white spaces in the middle or end) */
|
|
|
|
#define MERF_SPLITTABLE 0x001000
|
|
|
|
/* run starts with whitespaces */
|
|
|
|
#define MERF_STARTWHITE 0x002000
|
|
|
|
/* run ends with whitespaces */
|
|
|
|
#define MERF_ENDWHITE 0x004000
|
|
|
|
/* run is completely made of whitespaces */
|
|
|
|
#define MERF_WHITESPACE 0x008000
|
|
|
|
/* the "end of paragraph" run, contains 1 character */
|
|
|
|
#define MERF_ENDPARA 0x100000
|
2008-03-16 21:46:36 +01:00
|
|
|
/* forcing the "end of row" run, contains 1 character */
|
|
|
|
#define MERF_ENDROW 0x200000
|
2006-01-31 13:01:26 +01:00
|
|
|
/* run is hidden */
|
2008-03-16 21:46:36 +01:00
|
|
|
#define MERF_HIDDEN 0x400000
|
2008-08-07 18:31:41 +02:00
|
|
|
/* start of a table row has an empty paragraph that should be skipped over. */
|
|
|
|
#define MERF_TABLESTART 0x800000 /* v4.1 */
|
2005-03-05 12:19:14 +01:00
|
|
|
|
2005-04-16 12:48:35 +02:00
|
|
|
/* runs with any of these flags set cannot be joined */
|
2008-03-16 21:46:36 +01:00
|
|
|
#define MERF_NOJOIN (MERF_GRAPHICS|MERF_TAB|MERF_ENDPARA|MERF_ENDROW)
|
2005-04-16 12:48:35 +02:00
|
|
|
/* runs that don't contain real text */
|
2008-03-16 21:46:36 +01:00
|
|
|
#define MERF_NOTEXT (MERF_GRAPHICS|MERF_TAB|MERF_ENDPARA|MERF_ENDROW)
|
2005-04-16 12:48:35 +02:00
|
|
|
|
2005-03-05 12:19:14 +01:00
|
|
|
/* those flags are kept when the row is split */
|
|
|
|
#define MERF_SPLITMASK (~(0))
|
|
|
|
|
|
|
|
/******************************** para flags *************************/
|
|
|
|
|
|
|
|
/* this paragraph was already wrapped and hasn't changed, every change resets that flag */
|
2008-08-07 18:31:41 +02:00
|
|
|
#define MEPF_REWRAP 0x01
|
|
|
|
/* v4.1 */
|
|
|
|
#define MEPF_CELL 0x04 /* The paragraph is nested in a cell */
|
|
|
|
#define MEPF_ROWSTART 0x08 /* Hidden empty paragraph at the start of the row */
|
|
|
|
#define MEPF_ROWEND 0x10 /* Visible empty paragraph at the end of the row */
|
2014-01-15 14:06:43 +01:00
|
|
|
#define MEPF_COMPLEX 0x20 /* Use uniscribe */
|
2005-03-05 12:19:14 +01:00
|
|
|
|
|
|
|
/******************************** structures *************************/
|
|
|
|
|
|
|
|
struct tagME_DisplayItem;
|
|
|
|
|
2018-04-13 09:56:54 +02:00
|
|
|
struct re_object
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
REOBJECT obj;
|
|
|
|
};
|
|
|
|
|
2005-03-05 12:19:14 +01:00
|
|
|
typedef struct tagME_Run
|
|
|
|
{
|
|
|
|
ME_Style *style;
|
2013-01-30 16:10:18 +01:00
|
|
|
struct tagME_Paragraph *para; /* ptr to the run's paragraph */
|
2005-03-05 12:19:14 +01:00
|
|
|
int nCharOfs; /* relative to para's offset */
|
2013-01-31 14:48:00 +01:00
|
|
|
int len; /* length of run's text */
|
2005-03-05 12:19:14 +01:00
|
|
|
int nWidth; /* width of full run, width of leading&trailing ws */
|
|
|
|
int nFlags;
|
|
|
|
int nAscent, nDescent; /* pixels above/below baseline */
|
|
|
|
POINT pt; /* relative to para's position */
|
2018-04-13 09:56:54 +02:00
|
|
|
struct re_object *reobj; /* FIXME: should be a union with strText (at least) */
|
2014-01-15 14:06:43 +01:00
|
|
|
|
|
|
|
SCRIPT_ANALYSIS script_analysis;
|
|
|
|
int num_glyphs, max_glyphs;
|
|
|
|
WORD *glyphs;
|
|
|
|
SCRIPT_VISATTR *vis_attrs;
|
|
|
|
int *advances;
|
|
|
|
GOFFSET *offsets;
|
|
|
|
int max_clusters;
|
|
|
|
WORD *clusters;
|
2005-03-05 12:19:14 +01:00
|
|
|
} ME_Run;
|
|
|
|
|
2008-08-13 05:15:36 +02:00
|
|
|
typedef struct tagME_Border
|
|
|
|
{
|
|
|
|
int width;
|
2008-08-13 05:15:40 +02:00
|
|
|
COLORREF colorRef;
|
2008-08-13 05:15:36 +02:00
|
|
|
} ME_Border;
|
|
|
|
|
|
|
|
typedef struct tagME_BorderRect
|
|
|
|
{
|
|
|
|
ME_Border top;
|
|
|
|
ME_Border left;
|
|
|
|
ME_Border bottom;
|
|
|
|
ME_Border right;
|
|
|
|
} ME_BorderRect;
|
|
|
|
|
2016-10-07 11:49:35 +02:00
|
|
|
struct para_num
|
|
|
|
{
|
|
|
|
ME_Style *style;
|
|
|
|
ME_String *text;
|
|
|
|
INT width;
|
|
|
|
POINT pt;
|
|
|
|
};
|
|
|
|
|
2005-03-05 12:19:14 +01:00
|
|
|
typedef struct tagME_Paragraph
|
|
|
|
{
|
2016-09-29 11:13:11 +02:00
|
|
|
PARAFORMAT2 fmt;
|
2013-02-05 14:19:41 +01:00
|
|
|
ME_String *text;
|
2008-07-08 19:38:54 +02:00
|
|
|
|
2008-08-07 18:31:41 +02:00
|
|
|
struct tagME_DisplayItem *pCell; /* v4.1 */
|
2008-08-13 05:15:40 +02:00
|
|
|
ME_BorderRect border;
|
2008-08-07 18:31:41 +02:00
|
|
|
|
2005-03-05 12:19:14 +01:00
|
|
|
int nCharOfs;
|
|
|
|
int nFlags;
|
2008-08-07 18:31:41 +02:00
|
|
|
POINT pt;
|
2009-01-14 19:24:02 +01:00
|
|
|
int nHeight, nWidth;
|
2005-06-30 20:10:22 +02:00
|
|
|
int nRows;
|
2016-10-07 11:49:35 +02:00
|
|
|
struct para_num para_num;
|
2016-10-07 11:49:34 +02:00
|
|
|
ME_Run *eop_run; /* ptr to the end-of-para run */
|
2009-02-16 19:50:26 +01:00
|
|
|
struct tagME_DisplayItem *prev_para, *next_para;
|
2018-11-29 14:44:53 +01:00
|
|
|
struct tagME_DisplayItem *prev_marked, *next_marked;
|
2005-03-05 12:19:14 +01:00
|
|
|
} ME_Paragraph;
|
|
|
|
|
2008-08-07 18:31:41 +02:00
|
|
|
typedef struct tagME_Cell /* v4.1 */
|
|
|
|
{
|
|
|
|
int nNestingLevel; /* 0 for normal cells, and greater for nested cells */
|
|
|
|
int nRightBoundary;
|
2008-08-13 05:15:36 +02:00
|
|
|
ME_BorderRect border;
|
2008-08-07 18:31:41 +02:00
|
|
|
POINT pt;
|
|
|
|
int nHeight, nWidth;
|
2008-08-13 05:15:36 +02:00
|
|
|
int yTextOffset; /* The text offset is caused by the largest top border. */
|
2008-08-07 18:31:41 +02:00
|
|
|
struct tagME_DisplayItem *prev_cell, *next_cell, *parent_cell;
|
|
|
|
} ME_Cell;
|
|
|
|
|
2005-03-05 12:19:14 +01:00
|
|
|
typedef struct tagME_Row
|
|
|
|
{
|
|
|
|
int nHeight;
|
|
|
|
int nBaseline;
|
|
|
|
int nWidth;
|
|
|
|
int nLMargin;
|
|
|
|
int nRMargin;
|
2008-08-07 18:31:41 +02:00
|
|
|
POINT pt;
|
2005-03-05 12:19:14 +01:00
|
|
|
} ME_Row;
|
|
|
|
|
2005-09-29 12:30:50 +02:00
|
|
|
/* the display item list layout is like this:
|
|
|
|
* - the document consists of paragraphs
|
|
|
|
* - each paragraph contains at least one run, the last run in the paragraph
|
|
|
|
* is an end-of-paragraph run
|
|
|
|
* - each formatted paragraph contains at least one row, which corresponds
|
|
|
|
* to a screen line (that's why there are no rows in an unformatted
|
|
|
|
* paragraph
|
|
|
|
* - the paragraphs contain "shortcut" pointers to the previous and the next
|
|
|
|
* paragraph, that makes iteration over paragraphs faster
|
|
|
|
* - the list starts with diTextStart and ends with diTextEnd
|
|
|
|
*/
|
|
|
|
|
2005-03-05 12:19:14 +01:00
|
|
|
typedef struct tagME_DisplayItem
|
|
|
|
{
|
|
|
|
ME_DIType type;
|
|
|
|
struct tagME_DisplayItem *prev, *next;
|
|
|
|
union {
|
|
|
|
ME_Run run;
|
|
|
|
ME_Row row;
|
2008-08-07 18:31:41 +02:00
|
|
|
ME_Cell cell;
|
2005-03-05 12:19:14 +01:00
|
|
|
ME_Paragraph para;
|
|
|
|
} member;
|
|
|
|
} ME_DisplayItem;
|
|
|
|
|
|
|
|
typedef struct tagME_TextBuffer
|
|
|
|
{
|
|
|
|
ME_DisplayItem *pFirst, *pLast;
|
|
|
|
ME_Style *pCharStyle;
|
|
|
|
ME_Style *pDefaultStyle;
|
|
|
|
} ME_TextBuffer;
|
|
|
|
|
|
|
|
typedef struct tagME_Cursor
|
|
|
|
{
|
2009-02-09 18:01:35 +01:00
|
|
|
ME_DisplayItem *pPara;
|
2005-03-05 12:19:14 +01:00
|
|
|
ME_DisplayItem *pRun;
|
|
|
|
int nOffset;
|
|
|
|
} ME_Cursor;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
umAddToUndo,
|
|
|
|
umAddToRedo,
|
|
|
|
umIgnore,
|
|
|
|
umAddBackToUndo
|
|
|
|
} ME_UndoMode;
|
|
|
|
|
2013-01-29 14:41:48 +01:00
|
|
|
enum undo_type
|
|
|
|
{
|
|
|
|
undo_insert_run,
|
|
|
|
undo_delete_run,
|
|
|
|
undo_join_paras,
|
|
|
|
undo_split_para,
|
|
|
|
undo_set_para_fmt,
|
|
|
|
undo_set_char_fmt,
|
|
|
|
undo_end_transaction, /* marks the end of a group of changes for undo */
|
|
|
|
undo_potential_end_transaction /* allows grouping typed chars for undo */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct insert_run_item
|
|
|
|
{
|
|
|
|
int pos, len;
|
|
|
|
WCHAR *str;
|
|
|
|
ME_Style *style;
|
|
|
|
DWORD flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct delete_run_item
|
|
|
|
{
|
|
|
|
int pos, len;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct join_paras_item
|
|
|
|
{
|
|
|
|
int pos;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct split_para_item
|
|
|
|
{
|
|
|
|
int pos;
|
|
|
|
PARAFORMAT2 fmt;
|
|
|
|
ME_BorderRect border;
|
|
|
|
ME_String *eol_str;
|
|
|
|
DWORD flags;
|
|
|
|
ME_BorderRect cell_border;
|
|
|
|
int cell_right_boundary;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct set_para_fmt_item
|
|
|
|
{
|
|
|
|
int pos;
|
|
|
|
PARAFORMAT2 fmt;
|
|
|
|
ME_BorderRect border;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct set_char_fmt_item
|
|
|
|
{
|
|
|
|
int pos, len;
|
|
|
|
CHARFORMAT2W fmt;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct undo_item
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
enum undo_type type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct insert_run_item insert_run;
|
|
|
|
struct delete_run_item delete_run;
|
|
|
|
struct join_paras_item join_paras;
|
|
|
|
struct split_para_item split_para;
|
|
|
|
struct set_para_fmt_item set_para_fmt;
|
|
|
|
struct set_char_fmt_item set_char_fmt;
|
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
2008-07-07 17:03:53 +02:00
|
|
|
typedef enum {
|
|
|
|
stPosition = 0,
|
|
|
|
stWord,
|
2008-07-07 17:03:59 +02:00
|
|
|
stLine,
|
2008-07-07 17:04:02 +02:00
|
|
|
stParagraph,
|
|
|
|
stDocument
|
2008-07-07 17:03:53 +02:00
|
|
|
} ME_SelectionType;
|
|
|
|
|
2005-03-14 22:41:16 +01:00
|
|
|
typedef struct tagME_FontTableItem {
|
|
|
|
BYTE bCharSet;
|
|
|
|
WCHAR *szFaceName;
|
|
|
|
} ME_FontTableItem;
|
|
|
|
|
2005-04-13 13:11:03 +02:00
|
|
|
|
|
|
|
#define STREAMIN_BUFFER_SIZE 4096 /* M$ compatibility */
|
|
|
|
|
|
|
|
struct tagME_InStream {
|
|
|
|
EDITSTREAM *editstream;
|
|
|
|
DWORD dwSize;
|
|
|
|
DWORD dwUsed;
|
2005-09-12 22:30:37 +02:00
|
|
|
char buffer[STREAMIN_BUFFER_SIZE];
|
2005-04-13 13:11:03 +02:00
|
|
|
};
|
|
|
|
typedef struct tagME_InStream ME_InStream;
|
|
|
|
|
2005-03-05 12:19:14 +01:00
|
|
|
typedef struct tagME_TextEditor
|
|
|
|
{
|
2009-09-30 16:46:37 +02:00
|
|
|
HWND hWnd, hwndParent;
|
2009-01-20 07:41:25 +01:00
|
|
|
ITextHost *texthost;
|
2019-01-30 22:03:20 +01:00
|
|
|
IUnknown *reOle;
|
2005-07-21 12:33:32 +02:00
|
|
|
BOOL bEmulateVersion10;
|
2005-03-05 12:19:14 +01:00
|
|
|
ME_TextBuffer *pBuffer;
|
|
|
|
ME_Cursor *pCursors;
|
2009-01-15 20:46:25 +01:00
|
|
|
DWORD styleFlags;
|
2009-01-20 07:41:36 +01:00
|
|
|
DWORD exStyleFlags;
|
2005-03-05 12:19:14 +01:00
|
|
|
int nCursors;
|
|
|
|
SIZE sizeWindow;
|
2005-03-09 19:43:18 +01:00
|
|
|
int nTotalLength, nLastTotalLength;
|
2009-01-14 19:24:02 +01:00
|
|
|
int nTotalWidth, nLastTotalWidth;
|
2009-02-02 07:32:20 +01:00
|
|
|
int nAvailWidth; /* 0 = wrap to client area, else wrap width in twips */
|
2005-03-05 12:19:14 +01:00
|
|
|
int nUDArrowX;
|
2018-11-29 14:44:54 +01:00
|
|
|
int total_rows;
|
2005-03-05 12:19:14 +01:00
|
|
|
COLORREF rgbBackColor;
|
2005-11-03 12:33:24 +01:00
|
|
|
HBRUSH hbrBackground;
|
2005-03-05 12:19:14 +01:00
|
|
|
BOOL bCaretAtEnd;
|
|
|
|
int nEventMask;
|
|
|
|
int nModifyStep;
|
2013-01-29 14:41:48 +01:00
|
|
|
struct list undo_stack;
|
|
|
|
struct list redo_stack;
|
2006-05-15 20:00:15 +02:00
|
|
|
int nUndoStackSize;
|
|
|
|
int nUndoLimit;
|
2005-03-05 12:19:14 +01:00
|
|
|
ME_UndoMode nUndoMode;
|
|
|
|
int nParagraphs;
|
2005-03-09 12:48:59 +01:00
|
|
|
int nLastSelStart, nLastSelEnd;
|
2006-08-07 17:27:16 +02:00
|
|
|
ME_DisplayItem *pLastSelStartPara, *pLastSelEndPara;
|
2005-03-08 17:26:23 +01:00
|
|
|
ME_FontCacheItem pFontCache[HFONT_CACHE_SIZE];
|
2005-07-24 18:17:43 +02:00
|
|
|
int nZoomNumerator, nZoomDenominator;
|
2008-12-18 07:56:49 +01:00
|
|
|
RECT prevClientRect;
|
2005-08-15 11:47:14 +02:00
|
|
|
RECT rcFormat;
|
2008-12-18 07:56:49 +01:00
|
|
|
BOOL bDefaultFormatRect;
|
2008-03-16 21:48:05 +01:00
|
|
|
BOOL bWordWrap;
|
2006-08-09 21:33:42 +02:00
|
|
|
int nTextLimit;
|
2006-01-12 11:54:57 +01:00
|
|
|
EDITWORDBREAKPROCW pfnWordBreak;
|
2006-02-01 13:05:40 +01:00
|
|
|
LPRICHEDITOLECALLBACK lpOleCallback;
|
2006-02-19 07:32:24 +01:00
|
|
|
/*TEXTMODE variable; contains only one of each of the following options:
|
|
|
|
*TM_RICHTEXT or TM_PLAINTEXT
|
|
|
|
*TM_SINGLELEVELUNDO or TM_MULTILEVELUNDO
|
|
|
|
*TM_SINGLECODEPAGE or TM_MULTICODEPAGE*/
|
|
|
|
int mode;
|
2006-02-24 22:31:25 +01:00
|
|
|
BOOL bHideSelection;
|
2006-03-01 11:49:42 +01:00
|
|
|
BOOL AutoURLDetect_bEnable;
|
2006-08-04 21:47:44 +02:00
|
|
|
WCHAR cPasswordMask;
|
2007-06-05 14:56:55 +02:00
|
|
|
BOOL bHaveFocus;
|
2009-10-04 20:41:48 +02:00
|
|
|
BOOL bDialogMode; /* Indicates that we are inside a dialog window */
|
2007-06-27 14:57:51 +02:00
|
|
|
/*for IME */
|
|
|
|
int imeStartIndex;
|
2008-07-07 17:03:53 +02:00
|
|
|
DWORD selofs; /* The size of the selection bar on the left side of control */
|
|
|
|
ME_SelectionType nSelectionType;
|
2018-11-29 14:44:53 +01:00
|
|
|
ME_DisplayItem *first_marked_para;
|
2008-04-27 20:08:55 +02:00
|
|
|
|
|
|
|
/* Track previous notified selection */
|
|
|
|
CHARRANGE notified_cr;
|
2008-07-20 18:29:19 +02:00
|
|
|
|
2009-01-14 19:24:02 +01:00
|
|
|
/* Cache previously set scrollbar info */
|
|
|
|
SCROLLINFO vert_si, horz_si;
|
2009-01-11 08:59:20 +01:00
|
|
|
|
2019-04-03 15:23:04 +02:00
|
|
|
int caret_height;
|
|
|
|
BOOL caret_hidden;
|
2009-01-11 08:59:20 +01:00
|
|
|
BOOL bMouseCaptured;
|
2014-03-31 15:09:42 +02:00
|
|
|
int wheel_remain;
|
2015-11-09 17:11:43 +01:00
|
|
|
struct list style_list;
|
2018-04-13 09:56:54 +02:00
|
|
|
struct list reobj_list;
|
2005-03-05 12:19:14 +01:00
|
|
|
} ME_TextEditor;
|
|
|
|
|
|
|
|
typedef struct tagME_Context
|
|
|
|
{
|
|
|
|
HDC hDC;
|
|
|
|
POINT pt;
|
|
|
|
RECT rcView;
|
2008-01-01 22:05:33 +01:00
|
|
|
SIZE dpi;
|
2009-02-02 07:32:20 +01:00
|
|
|
int nAvailWidth;
|
2019-08-19 11:55:28 +02:00
|
|
|
ME_Style *current_style;
|
|
|
|
HFONT orig_font;
|
2005-03-05 12:19:14 +01:00
|
|
|
|
|
|
|
/* those are valid inside ME_WrapTextParagraph and related */
|
|
|
|
ME_TextEditor *editor;
|
|
|
|
} ME_Context;
|
|
|
|
|
|
|
|
#endif
|