63 if (from_ofs == to_ofs)
116 FIXME(
"GTL_PRECISE flag unsupported. Using GTL_CLOSE\n");
134 int selectionEnd = 0;
144 if (
from == 0 && to == -1)
153 if ((
from == to) && (to < 0 || to >
len))
227 ME_Run *size_run = run, *prev;
238 if (!
cursor->nOffset && (prev =
run_prev( run ))) size_run = prev;
244 *
y =
c.rcView.top + para->
pt.
y +
row->nBaseline
340 int nChars,
BOOL bForce)
345 int totalChars = nChars;
350 nChars =
min(nChars, text_len - nOfs);
351 if (nChars == text_len) delete_all =
TRUE;
357 if (nChars == 0)
return FALSE;
369 c.para =
c.run->para;
370 c.nOffset =
c.run->len;
375 int eollen =
c.run->
len;
376 BOOL keepFirstParaFormat;
380 keepFirstParaFormat = (totalChars == nChars && nChars <= eollen &&
398 nChars -= (eollen < nChars) ? eollen : nChars;
401 keepFirstParaFormat =
TRUE;
404 para_join( editor,
c.para, keepFirstParaFormat );
407 nChars -= (eollen < nChars) ? eollen : nChars;
413 int nCharsToDelete =
min(nChars,
c.nOffset);
416 c.nOffset -= nCharsToDelete;
424 nChars -= nCharsToDelete;
425 shift -= nCharsToDelete;
426 TRACE(
"Deleting %d (remaining %d) chars at %d in %s (%d)\n",
427 nCharsToDelete, nChars,
c.nOffset,
435 run->
len -= nCharsToDelete;
442 if (
i == -1) pThisCur = &
c;
448 pThisCur->
nOffset -= nCharsToDelete;
468 TRACE(
"Removing empty run\n");
483 assert(nCursor>=0 && nCursor<editor->nCursors);
496 WARN(
"Fail to allocate re_object.\n");
524 reobj_prev = prev->
reobj;
586 else if (*
pos ==
'\t')
594 ME_Run *end_run, *run, *prev;
605 if (
len > 1 &&
pos[1] ==
'\n')
607 else if (
len > 2 &&
pos[1] ==
'\r' &&
pos[2] ==
'\n')
627 const WCHAR cr =
'\r', *eol_str =
str;
638 if (!run) run =
cursor->run;
680 cursor->nOffset += nRelOfs;
698 nRelOfs -=
cursor->nOffset;
721 if (new_offset < next_para->nCharOfs)
743 }
while (new_offset >= next_para->
nCharOfs);
762 int nOffset =
cursor->nOffset;
780 nOffset = other_run->
len;
809 if (nOffset < run->
len)
break;
835 cursor->nOffset = nOffset;
850 switch(selectionType)
906 if (x < next_cell->
pt.x)
1007 if (y < row->
pt.y +
row->nHeight)
break;
1009 if (!next_row)
break;
1047 if (isExact) *isExact =
FALSE;
1053 if (isExact) *isExact = bResult;
1072 int curOfs, anchorStartOfs, anchorEndOfs;
1082 if (curOfs < anchorStartOfs)
1108 else if (curOfs >= anchorEndOfs)
1163 }
else if (clickNum % 2 == 0) {
1174 else if (!is_selection)
1188 }
else if (clickNum % 2 == 0 || is_shift) {
1267 if (!new_para)
return;
1410 int nEndCursor = nStartCursor ^ 1;
1442 TRACE(
"cpMin=%d cpMax=%d seltyp=%d (%s %s)\n",
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
static void * heap_alloc(size_t len)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
BOOL WINAPI ImmIsIME(HKL hKL)
BOOL WINAPI ImmSetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
HIMC WINAPI ImmGetContext(HWND hWnd)
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
BOOL WINAPI GetCPInfo(UINT codepage, LPCPINFO cpinfo)
void ME_InsertEndRowFromCursor(ME_TextEditor *editor, int nCursor)
void ME_SetCursorToStart(ME_TextEditor *editor, ME_Cursor *cursor)
static void cursor_move_line(ME_TextEditor *editor, ME_Cursor *cursor, BOOL up, BOOL extend)
BOOL ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, int nChars)
static void ME_ArrowHome(ME_TextEditor *editor, ME_Cursor *cursor)
BOOL ME_IsSelection(ME_TextEditor *editor)
void ME_DeleteSelection(ME_TextEditor *editor)
static int ME_GetXForArrow(ME_TextEditor *editor, ME_Cursor *pCursor)
static void ME_ExtendAnchorSelection(ME_TextEditor *editor)
int ME_GetCursorOfs(const ME_Cursor *cursor)
void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style)
int ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs, BOOL final_eop)
static BOOL row_cursor(ME_TextEditor *editor, ME_Row *row, int x, ME_Cursor *cursor)
static ME_Paragraph * pixel_pos_in_table_row(int x, int y, ME_Paragraph *para)
BOOL ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs)
void ME_InsertOLEFromCursor(ME_TextEditor *editor, const REOBJECT *reo, int nCursor)
void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum)
int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how)
int ME_GetSelection(ME_TextEditor *editor, ME_Cursor **from, ME_Cursor **to)
BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start, int nChars, BOOL bForce)
void hide_caret(ME_TextEditor *editor)
static void ME_SelectByType(ME_TextEditor *editor, ME_SelectionType selectionType)
static void ME_ArrowCtrlEnd(ME_TextEditor *editor, ME_Cursor *pCursor)
void ME_MouseMove(ME_TextEditor *editor, int x, int y)
BOOL ME_CharFromPos(ME_TextEditor *editor, int x, int y, ME_Cursor *cursor, BOOL *isExact)
void ME_SendSelChange(ME_TextEditor *editor)
int set_selection_cursors(ME_TextEditor *editor, int from, int to)
void cursor_coords(ME_TextEditor *editor, ME_Cursor *cursor, int *x, int *y, int *height)
int ME_GetSelectionOfs(ME_TextEditor *editor, int *from, int *to)
BOOL ME_ArrowKey(ME_TextEditor *editor, int nVKey, BOOL extend, BOOL ctrl)
static BOOL cursor_from_virtual_coords(ME_TextEditor *editor, int x, int y, ME_Cursor *result, BOOL final_eop)
static void ME_SetCursorToEnd(ME_TextEditor *editor, ME_Cursor *cursor, BOOL final_eop)
void create_caret(ME_TextEditor *editor)
int ME_GetTextLength(ME_TextEditor *editor)
void show_caret(ME_TextEditor *editor)
static void ME_ArrowPageUp(ME_TextEditor *editor, ME_Cursor *cursor)
static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *cursor)
void update_caret(ME_TextEditor *editor)
static void ME_ArrowCtrlHome(ME_TextEditor *editor, ME_Cursor *pCursor)
ME_Style * ME_GetSelectionInsertStyle(ME_TextEditor *editor)
static void ME_ArrowEnd(ME_TextEditor *editor, ME_Cursor *cursor)
static struct re_object * create_re_object(const REOBJECT *reo)
void ME_DestroyContext(ME_Context *c)
void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC)
ME_Paragraph * editor_first_para(ME_TextEditor *editor)
ME_Paragraph * editor_end_para(ME_TextEditor *editor)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
void ME_ReleaseStyle(ME_Style *item) DECLSPEC_HIDDEN
ME_Paragraph * cell_end_para(ME_Cell *cell) DECLSPEC_HIDDEN
int ME_PointFromCharContext(ME_Context *c, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
ME_Run * para_first_run(ME_Paragraph *para) DECLSPEC_HIDDEN
BOOL add_undo_insert_run(ME_TextEditor *, int pos, const WCHAR *str, int len, int flags, ME_Style *style) DECLSPEC_HIDDEN
void row_first_cursor(ME_Row *row, ME_Cursor *cursor) DECLSPEC_HIDDEN
ME_Paragraph * para_join(ME_TextEditor *editor, ME_Paragraph *para, BOOL use_first_fmt) DECLSPEC_HIDDEN
void ME_CheckCharOffsets(ME_TextEditor *editor) DECLSPEC_HIDDEN
ME_Cell * para_cell(ME_Paragraph *para) DECLSPEC_HIDDEN
void table_protect_partial_deletion(ME_TextEditor *editor, ME_Cursor *c, int *num_chars) DECLSPEC_HIDDEN
void editor_propagate_char_ofs(ME_Paragraph *para, ME_Run *run, int shift) DECLSPEC_HIDDEN
void cursor_from_char_ofs(ME_TextEditor *editor, int char_ofs, ME_Cursor *cursor) DECLSPEC_HIDDEN
#define ITextHost_TxCreateCaret(This, a, b, c)
ME_Row * para_first_row(ME_Paragraph *para) DECLSPEC_HIDDEN
void ME_DestroyDisplayItem(ME_DisplayItem *item) DECLSPEC_HIDDEN
ME_Row * para_end_row(ME_Paragraph *para) DECLSPEC_HIDDEN
ME_Style * style_get_insert_style(ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN
ME_Run * row_next_run(ME_Row *row, ME_Run *run) DECLSPEC_HIDDEN
#define ITextHost_TxNotify(This, a, b)
ME_Paragraph * table_row_start(ME_Paragraph *para) DECLSPEC_HIDDEN
ME_Row * row_next(ME_Row *row) DECLSPEC_HIDDEN
void para_mark_rewrap(ME_TextEditor *editor, ME_Paragraph *para) DECLSPEC_HIDDEN
ME_Run * run_prev_all_paras(ME_Run *run) DECLSPEC_HIDDEN
#define ITextHost_TxSetCaretPos(This, a, b)
ME_Paragraph * para_next(ME_Paragraph *para) DECLSPEC_HIDDEN
void editor_set_default_para_fmt(ME_TextEditor *editor, PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN
static ME_DisplayItem * run_get_di(ME_Run *run)
int ME_CallWordBreakProc(ME_TextEditor *editor, WCHAR *str, INT len, INT start, INT code) DECLSPEC_HIDDEN
ME_Row * row_from_cursor(ME_Cursor *cursor) DECLSPEC_HIDDEN
#define ITextHost_TxGetClientRect(This, a)
ME_Run * run_next(ME_Run *run) DECLSPEC_HIDDEN
#define ITextHost_TxGetDC(This)
ME_Cell * table_row_first_cell(ME_Paragraph *para) DECLSPEC_HIDDEN
void ME_ScrollUp(ME_TextEditor *editor, int cy) DECLSPEC_HIDDEN
void ME_InvalidateSelection(ME_TextEditor *editor) DECLSPEC_HIDDEN
ME_Paragraph * cell_first_para(ME_Cell *cell) DECLSPEC_HIDDEN
void ME_GetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN
void ME_CopyReObject(REOBJECT *dst, const REOBJECT *src, DWORD flags) DECLSPEC_HIDDEN
ME_Row * row_next_all_paras(ME_Row *row) DECLSPEC_HIDDEN
ME_Cell * cell_next(ME_Cell *cell) DECLSPEC_HIDDEN
#define ITextHost_TxReleaseDC(This, a)
void ME_Remove(ME_DisplayItem *diWhere) DECLSPEC_HIDDEN
ME_Paragraph * para_split(ME_TextEditor *editor, ME_Run *run, ME_Style *style, const WCHAR *eol_str, int eol_len, int paraFlags) DECLSPEC_HIDDEN
void editor_ensure_visible(ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN
ME_Paragraph * para_prev(ME_Paragraph *para) DECLSPEC_HIDDEN
ME_Run * run_prev(ME_Run *run) DECLSPEC_HIDDEN
void ME_ClearTempStyle(ME_TextEditor *editor) DECLSPEC_HIDDEN
ME_Cell * table_row_end_cell(ME_Paragraph *para) DECLSPEC_HIDDEN
void ME_StrDeleteV(ME_String *s, int nVChar, int nChars) DECLSPEC_HIDDEN
void ME_Repaint(ME_TextEditor *editor) DECLSPEC_HIDDEN
ME_Run * run_split(ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN
ME_Run * para_end_run(ME_Paragraph *para) DECLSPEC_HIDDEN
ME_Cell * cell_prev(ME_Cell *cell) DECLSPEC_HIDDEN
ME_Row * row_prev_all_paras(ME_Row *row) DECLSPEC_HIDDEN
void row_end_cursor(ME_Row *row, ME_Cursor *cursor, BOOL include_eop) DECLSPEC_HIDDEN
static WCHAR * get_text(const ME_Run *run, int offset)
void ME_ScrollDown(ME_TextEditor *editor, int cy) DECLSPEC_HIDDEN
ME_Run * row_first_run(ME_Row *row) DECLSPEC_HIDDEN
int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
ME_Run * run_insert(ME_TextEditor *editor, ME_Cursor *cursor, ME_Style *style, const WCHAR *str, int len, int flags) DECLSPEC_HIDDEN
#define ITextHost_TxShowCaret(This, a)
ME_Paragraph * table_row_end(ME_Paragraph *para) DECLSPEC_HIDDEN
static const char * debugstr_run(const ME_Run *run)
ME_Paragraph * row_para(ME_Row *row) DECLSPEC_HIDDEN
int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run, BOOL closest, BOOL visual_order) DECLSPEC_HIDDEN
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
#define PFM_TABLEROWDELIMITER
#define PFE_TABLEROWDELIMITER
__WINE_SERVER_LIST_INLINE void list_add_after(struct list *elem, struct list *to_add)
WCHAR lfFaceName[LF_FACESIZE]
struct tagME_Paragraph * para
ME_SelectionType nSelectionType
unsigned int bEmulateVersion10
static struct wctab tab[]
#define success(from, fromstr, to, tostr)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI DeleteDC(_In_ HDC)
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
SHORT WINAPI GetKeyState(_In_ int)