2005-03-05 11:19:14 +00: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 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-03-05 11:19:14 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __EDITSTR_H
|
|
|
|
#define __EDITSTR_H
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2009-08-12 13:05:51 +00:00
|
|
|
#include <limits.h>
|
2005-03-05 11:19:14 +00:00
|
|
|
|
2006-02-22 18:56:11 +00:00
|
|
|
#define COBJMACROS
|
|
|
|
|
2005-03-05 11:19:14 +00: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 12:05:40 +00:00
|
|
|
#include <ole2.h>
|
|
|
|
#include <richole.h>
|
2009-01-20 06:41:25 +00:00
|
|
|
#include "imm.h"
|
|
|
|
#include <textserv.h>
|
2014-01-15 13:06:43 +00:00
|
|
|
#include "usp10.h"
|
2005-03-05 11:19:14 +00:00
|
|
|
|
2020-05-03 12:09:42 +00:00
|
|
|
#include "wine/asm.h"
|
2005-03-05 11:19:14 +00:00
|
|
|
#include "wine/debug.h"
|
2018-02-03 22:59:45 +00:00
|
|
|
#include "wine/heap.h"
|
2013-01-29 13:41:48 +00:00
|
|
|
#include "wine/list.h"
|
2020-10-09 11:59:20 +00:00
|
|
|
#include "wine/rbtree.h"
|
2005-03-05 11:19:14 +00:00
|
|
|
|
|
|
|
typedef struct tagME_String
|
|
|
|
{
|
|
|
|
WCHAR *szData;
|
|
|
|
int nLen, nBuffer;
|
2016-10-07 09:49:33 +00:00
|
|
|
void (*free)(struct tagME_String *);
|
2005-03-05 11:19:14 +00:00
|
|
|
} ME_String;
|
|
|
|
|
2015-11-09 16:11:41 +00:00
|
|
|
typedef struct tagME_FontCacheItem
|
|
|
|
{
|
|
|
|
LOGFONTW lfSpecs;
|
|
|
|
HFONT hFont;
|
|
|
|
int nRefs;
|
|
|
|
int nAge;
|
|
|
|
} ME_FontCacheItem;
|
|
|
|
|
|
|
|
#define HFONT_CACHE_SIZE 10
|
|
|
|
|
2005-03-05 11:19:14 +00:00
|
|
|
typedef struct tagME_Style
|
|
|
|
{
|
|
|
|
CHARFORMAT2W fmt;
|
|
|
|
|
2015-11-09 16:11:41 +00:00
|
|
|
ME_FontCacheItem *font_cache; /* cached font for the style */
|
2005-03-05 11:19:14 +00:00
|
|
|
TEXTMETRICW tm; /* cached font metrics for the style */
|
|
|
|
int nRefs; /* reference count */
|
2014-01-15 13:06:43 +00:00
|
|
|
SCRIPT_CACHE script_cache;
|
2015-11-09 16:11:43 +00:00
|
|
|
struct list entry;
|
2005-03-05 11:19:14 +00:00
|
|
|
} ME_Style;
|
|
|
|
|
|
|
|
typedef enum {
|
2006-08-07 15:27:16 +00:00
|
|
|
diInvalid,
|
2005-03-05 11:19:14 +00:00
|
|
|
diTextStart, /* start of the text buffer */
|
|
|
|
diParagraph, /* paragraph start */
|
2008-08-07 16:31:41 +00:00
|
|
|
diCell, /* cell start */
|
2005-03-05 11:19:14 +00: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 16:31:41 +00:00
|
|
|
diStartRowOrParagraph, /* 7 */
|
2005-03-05 11:19:14 +00:00
|
|
|
diStartRowOrParagraphOrEnd,
|
|
|
|
diRunOrParagraph,
|
|
|
|
diRunOrStartRow,
|
|
|
|
diParagraphOrEnd,
|
2008-08-07 16:31:41 +00:00
|
|
|
diRunOrParagraphOrEnd, /* 12 */
|
2005-03-05 11:19:14 +00:00
|
|
|
} ME_DIType;
|
|
|
|
|
2008-12-18 06:56:49 +00:00
|
|
|
#define SELECTIONBAR_WIDTH 8
|
2008-07-04 20:02:47 +00:00
|
|
|
|
2005-03-05 11:19:14 +00:00
|
|
|
/******************************** run flags *************************/
|
|
|
|
#define MERF_STYLEFLAGS 0x0FFF
|
|
|
|
/* run contains non-text content, which has its own rules for wrapping, sizing etc */
|
2008-03-16 20:46:36 +00:00
|
|
|
#define MERF_GRAPHICS 0x001
|
2005-04-16 10:48:35 +00:00
|
|
|
/* run is a tab (or, in future, any kind of content whose size is dependent on run position) */
|
2008-03-16 20:46:36 +00:00
|
|
|
#define MERF_TAB 0x002
|
2008-08-07 16:31:41 +00:00
|
|
|
/* run is a cell boundary */
|
|
|
|
#define MERF_ENDCELL 0x004 /* v4.1 */
|
2006-02-04 16:01:01 +00:00
|
|
|
|
2008-08-07 16:31:41 +00:00
|
|
|
#define MERF_NONTEXT (MERF_GRAPHICS | MERF_TAB | MERF_ENDCELL)
|
2005-03-05 11:19:14 +00: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 20:46:36 +00:00
|
|
|
/* forcing the "end of row" run, contains 1 character */
|
|
|
|
#define MERF_ENDROW 0x200000
|
2006-01-31 12:01:26 +00:00
|
|
|
/* run is hidden */
|
2008-03-16 20:46:36 +00:00
|
|
|
#define MERF_HIDDEN 0x400000
|
2008-08-07 16:31:41 +00:00
|
|
|
/* start of a table row has an empty paragraph that should be skipped over. */
|
|
|
|
#define MERF_TABLESTART 0x800000 /* v4.1 */
|
2005-03-05 11:19:14 +00:00
|
|
|
|
2005-04-16 10:48:35 +00:00
|
|
|
/* runs with any of these flags set cannot be joined */
|
2008-03-16 20:46:36 +00:00
|
|
|
#define MERF_NOJOIN (MERF_GRAPHICS|MERF_TAB|MERF_ENDPARA|MERF_ENDROW)
|
2005-04-16 10:48:35 +00:00
|
|
|
/* runs that don't contain real text */
|
2008-03-16 20:46:36 +00:00
|
|
|
#define MERF_NOTEXT (MERF_GRAPHICS|MERF_TAB|MERF_ENDPARA|MERF_ENDROW)
|
2005-04-16 10:48:35 +00:00
|
|
|
|
2005-03-05 11:19:14 +00: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 16:31:41 +00: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 13:06:43 +00:00
|
|
|
#define MEPF_COMPLEX 0x20 /* Use uniscribe */
|
2005-03-05 11:19:14 +00:00
|
|
|
|
|
|
|
/******************************** structures *************************/
|
|
|
|
|
|
|
|
struct tagME_DisplayItem;
|
|
|
|
|
2018-04-13 07:56:54 +00:00
|
|
|
struct re_object
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
REOBJECT obj;
|
|
|
|
};
|
|
|
|
|
2005-03-05 11:19:14 +00:00
|
|
|
typedef struct tagME_Run
|
|
|
|
{
|
|
|
|
ME_Style *style;
|
2013-01-30 15:10:18 +00:00
|
|
|
struct tagME_Paragraph *para; /* ptr to the run's paragraph */
|
2005-03-05 11:19:14 +00:00
|
|
|
int nCharOfs; /* relative to para's offset */
|
2013-01-31 13:48:00 +00:00
|
|
|
int len; /* length of run's text */
|
2005-03-05 11:19:14 +00: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 07:56:54 +00:00
|
|
|
struct re_object *reobj; /* FIXME: should be a union with strText (at least) */
|
2014-01-15 13:06:43 +00: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 11:19:14 +00:00
|
|
|
} ME_Run;
|
|
|
|
|
2008-08-13 03:15:36 +00:00
|
|
|
typedef struct tagME_Border
|
|
|
|
{
|
|
|
|
int width;
|
2008-08-13 03:15:40 +00:00
|
|
|
COLORREF colorRef;
|
2008-08-13 03:15:36 +00:00
|
|
|
} ME_Border;
|
|
|
|
|
|
|
|
typedef struct tagME_BorderRect
|
|
|
|
{
|
|
|
|
ME_Border top;
|
|
|
|
ME_Border left;
|
|
|
|
ME_Border bottom;
|
|
|
|
ME_Border right;
|
|
|
|
} ME_BorderRect;
|
|
|
|
|
2016-10-07 09:49:35 +00:00
|
|
|
struct para_num
|
|
|
|
{
|
|
|
|
ME_Style *style;
|
|
|
|
ME_String *text;
|
|
|
|
INT width;
|
|
|
|
POINT pt;
|
|
|
|
};
|
|
|
|
|
2005-03-05 11:19:14 +00:00
|
|
|
typedef struct tagME_Paragraph
|
|
|
|
{
|
2016-09-29 09:13:11 +00:00
|
|
|
PARAFORMAT2 fmt;
|
2013-02-05 13:19:41 +00:00
|
|
|
ME_String *text;
|
2008-07-08 17:38:54 +00:00
|
|
|
|
2020-11-06 08:32:22 +00:00
|
|
|
struct tagME_Cell *cell; /* v4.1 */
|
2008-08-13 03:15:40 +00:00
|
|
|
ME_BorderRect border;
|
2008-08-07 16:31:41 +00:00
|
|
|
|
2005-03-05 11:19:14 +00:00
|
|
|
int nCharOfs;
|
|
|
|
int nFlags;
|
2008-08-07 16:31:41 +00:00
|
|
|
POINT pt;
|
2009-01-14 18:24:02 +00:00
|
|
|
int nHeight, nWidth;
|
2005-06-30 18:10:22 +00:00
|
|
|
int nRows;
|
2016-10-07 09:49:35 +00:00
|
|
|
struct para_num para_num;
|
2016-10-07 09:49:34 +00:00
|
|
|
ME_Run *eop_run; /* ptr to the end-of-para run */
|
2009-02-16 18:50:26 +00:00
|
|
|
struct tagME_DisplayItem *prev_para, *next_para;
|
2020-10-09 11:59:20 +00:00
|
|
|
struct wine_rb_entry marked_entry;
|
2005-03-05 11:19:14 +00:00
|
|
|
} ME_Paragraph;
|
|
|
|
|
2008-08-07 16:31:41 +00:00
|
|
|
typedef struct tagME_Cell /* v4.1 */
|
|
|
|
{
|
|
|
|
int nNestingLevel; /* 0 for normal cells, and greater for nested cells */
|
|
|
|
int nRightBoundary;
|
2008-08-13 03:15:36 +00:00
|
|
|
ME_BorderRect border;
|
2008-08-07 16:31:41 +00:00
|
|
|
POINT pt;
|
|
|
|
int nHeight, nWidth;
|
2008-08-13 03:15:36 +00:00
|
|
|
int yTextOffset; /* The text offset is caused by the largest top border. */
|
2020-11-06 08:32:22 +00:00
|
|
|
struct tagME_Cell *prev_cell, *next_cell, *parent_cell;
|
2008-08-07 16:31:41 +00:00
|
|
|
} ME_Cell;
|
|
|
|
|
2005-03-05 11:19:14 +00:00
|
|
|
typedef struct tagME_Row
|
|
|
|
{
|
|
|
|
int nHeight;
|
|
|
|
int nBaseline;
|
|
|
|
int nWidth;
|
|
|
|
int nLMargin;
|
|
|
|
int nRMargin;
|
2008-08-07 16:31:41 +00:00
|
|
|
POINT pt;
|
2005-03-05 11:19:14 +00:00
|
|
|
} ME_Row;
|
|
|
|
|
2005-09-29 10:30:50 +00: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 11:19:14 +00:00
|
|
|
typedef struct tagME_DisplayItem
|
|
|
|
{
|
|
|
|
ME_DIType type;
|
|
|
|
struct tagME_DisplayItem *prev, *next;
|
|
|
|
union {
|
|
|
|
ME_Run run;
|
|
|
|
ME_Row row;
|
2008-08-07 16:31:41 +00:00
|
|
|
ME_Cell cell;
|
2005-03-05 11:19:14 +00: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
|
|
|
|
{
|
2020-11-06 08:32:24 +00:00
|
|
|
ME_Paragraph *para;
|
|
|
|
ME_Run *run;
|
2005-03-05 11:19:14 +00:00
|
|
|
int nOffset;
|
|
|
|
} ME_Cursor;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
umAddToUndo,
|
|
|
|
umAddToRedo,
|
|
|
|
umIgnore,
|
|
|
|
umAddBackToUndo
|
|
|
|
} ME_UndoMode;
|
|
|
|
|
2013-01-29 13:41:48 +00: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 15:03:53 +00:00
|
|
|
typedef enum {
|
|
|
|
stPosition = 0,
|
|
|
|
stWord,
|
2008-07-07 15:03:59 +00:00
|
|
|
stLine,
|
2008-07-07 15:04:02 +00:00
|
|
|
stParagraph,
|
|
|
|
stDocument
|
2008-07-07 15:03:53 +00:00
|
|
|
} ME_SelectionType;
|
|
|
|
|
2005-03-14 21:41:16 +00:00
|
|
|
typedef struct tagME_FontTableItem {
|
|
|
|
BYTE bCharSet;
|
|
|
|
WCHAR *szFaceName;
|
|
|
|
} ME_FontTableItem;
|
|
|
|
|
2005-04-13 11:11:03 +00:00
|
|
|
|
|
|
|
#define STREAMIN_BUFFER_SIZE 4096 /* M$ compatibility */
|
|
|
|
|
|
|
|
struct tagME_InStream {
|
|
|
|
EDITSTREAM *editstream;
|
|
|
|
DWORD dwSize;
|
|
|
|
DWORD dwUsed;
|
2005-09-12 20:30:37 +00:00
|
|
|
char buffer[STREAMIN_BUFFER_SIZE];
|
2005-04-13 11:11:03 +00:00
|
|
|
};
|
|
|
|
typedef struct tagME_InStream ME_InStream;
|
|
|
|
|
2005-03-05 11:19:14 +00:00
|
|
|
typedef struct tagME_TextEditor
|
|
|
|
{
|
2009-09-30 14:46:37 +00:00
|
|
|
HWND hWnd, hwndParent;
|
2009-01-20 06:41:25 +00:00
|
|
|
ITextHost *texthost;
|
2019-01-30 21:03:20 +00:00
|
|
|
IUnknown *reOle;
|
2021-03-22 08:55:49 +00:00
|
|
|
unsigned int bEmulateVersion10 : 1;
|
|
|
|
unsigned int in_place_active : 1;
|
2005-03-05 11:19:14 +00:00
|
|
|
ME_TextBuffer *pBuffer;
|
|
|
|
ME_Cursor *pCursors;
|
2021-03-16 08:22:45 +00:00
|
|
|
DWORD props;
|
2021-03-16 08:22:46 +00:00
|
|
|
DWORD scrollbars;
|
2005-03-05 11:19:14 +00:00
|
|
|
int nCursors;
|
|
|
|
SIZE sizeWindow;
|
2005-03-09 18:43:18 +00:00
|
|
|
int nTotalLength, nLastTotalLength;
|
2009-01-14 18:24:02 +00:00
|
|
|
int nTotalWidth, nLastTotalWidth;
|
2009-02-02 06:32:20 +00:00
|
|
|
int nAvailWidth; /* 0 = wrap to client area, else wrap width in twips */
|
2005-03-05 11:19:14 +00:00
|
|
|
int nUDArrowX;
|
2018-11-29 13:44:54 +00:00
|
|
|
int total_rows;
|
2005-03-05 11:19:14 +00:00
|
|
|
int nEventMask;
|
|
|
|
int nModifyStep;
|
2013-01-29 13:41:48 +00:00
|
|
|
struct list undo_stack;
|
|
|
|
struct list redo_stack;
|
2006-05-15 18:00:15 +00:00
|
|
|
int nUndoStackSize;
|
|
|
|
int nUndoLimit;
|
2005-03-05 11:19:14 +00:00
|
|
|
ME_UndoMode nUndoMode;
|
|
|
|
int nParagraphs;
|
2005-03-09 11:48:59 +00:00
|
|
|
int nLastSelStart, nLastSelEnd;
|
2020-10-28 08:43:49 +00:00
|
|
|
ME_Paragraph *last_sel_start_para, *last_sel_end_para;
|
2005-03-08 16:26:23 +00:00
|
|
|
ME_FontCacheItem pFontCache[HFONT_CACHE_SIZE];
|
2005-07-24 16:17:43 +00:00
|
|
|
int nZoomNumerator, nZoomDenominator;
|
2005-08-15 09:47:14 +00:00
|
|
|
RECT rcFormat;
|
2008-03-16 20:48:05 +00:00
|
|
|
BOOL bWordWrap;
|
2006-08-09 19:33:42 +00:00
|
|
|
int nTextLimit;
|
2006-01-12 10:54:57 +00:00
|
|
|
EDITWORDBREAKPROCW pfnWordBreak;
|
2006-02-01 12:05:40 +00:00
|
|
|
LPRICHEDITOLECALLBACK lpOleCallback;
|
2006-02-19 06:32:24 +00: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 21:31:25 +00:00
|
|
|
BOOL bHideSelection;
|
2006-03-01 10:49:42 +00:00
|
|
|
BOOL AutoURLDetect_bEnable;
|
2021-03-18 08:30:07 +00:00
|
|
|
WCHAR password_char;
|
2007-06-05 12:56:55 +00:00
|
|
|
BOOL bHaveFocus;
|
2007-06-27 12:57:51 +00:00
|
|
|
/*for IME */
|
|
|
|
int imeStartIndex;
|
2008-07-07 15:03:53 +00:00
|
|
|
DWORD selofs; /* The size of the selection bar on the left side of control */
|
|
|
|
ME_SelectionType nSelectionType;
|
2008-04-27 18:08:55 +00:00
|
|
|
|
|
|
|
/* Track previous notified selection */
|
|
|
|
CHARRANGE notified_cr;
|
2008-07-20 16:29:19 +00:00
|
|
|
|
2009-01-14 18:24:02 +00:00
|
|
|
/* Cache previously set scrollbar info */
|
|
|
|
SCROLLINFO vert_si, horz_si;
|
2021-03-19 09:14:15 +00:00
|
|
|
unsigned int vert_sb_enabled : 1;
|
|
|
|
unsigned int horz_sb_enabled : 1;
|
2009-01-11 07:59:20 +00:00
|
|
|
|
2019-04-03 13:23:04 +00:00
|
|
|
int caret_height;
|
|
|
|
BOOL caret_hidden;
|
2009-01-11 07:59:20 +00:00
|
|
|
BOOL bMouseCaptured;
|
2014-03-31 13:09:42 +00:00
|
|
|
int wheel_remain;
|
2021-03-25 09:10:26 +00:00
|
|
|
TXTBACKSTYLE back_style;
|
2015-11-09 16:11:43 +00:00
|
|
|
struct list style_list;
|
2018-04-13 07:56:54 +00:00
|
|
|
struct list reobj_list;
|
2020-10-09 11:59:20 +00:00
|
|
|
struct wine_rb_tree marked_paras;
|
2005-03-05 11:19:14 +00:00
|
|
|
} ME_TextEditor;
|
|
|
|
|
|
|
|
typedef struct tagME_Context
|
|
|
|
{
|
|
|
|
HDC hDC;
|
|
|
|
POINT pt;
|
|
|
|
RECT rcView;
|
2008-01-01 21:05:33 +00:00
|
|
|
SIZE dpi;
|
2009-02-02 06:32:20 +00:00
|
|
|
int nAvailWidth;
|
2019-08-19 09:55:28 +00:00
|
|
|
ME_Style *current_style;
|
|
|
|
HFONT orig_font;
|
2005-03-05 11:19:14 +00:00
|
|
|
|
|
|
|
/* those are valid inside ME_WrapTextParagraph and related */
|
|
|
|
ME_TextEditor *editor;
|
|
|
|
} ME_Context;
|
|
|
|
|
|
|
|
#endif
|