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");
532 if (reo->
cp == REO_CP_SELECTION)
537 cursor = &cursor_from_ofs;
554 reobj_prev = prev->
reobj;
617 else if (*
pos ==
'\t')
636 if (
len > 1 &&
pos[1] ==
'\n')
638 else if (
len > 2 &&
pos[1] ==
'\r' &&
pos[2] ==
'\n')
658 const WCHAR cr =
'\r', *eol_str =
str;
711 cursor->nOffset += nRelOfs;
729 nRelOfs -=
cursor->nOffset;
752 if (new_offset < next_para->nCharOfs)
774 }
while (new_offset >= next_para->
nCharOfs);
793 int nOffset =
cursor->nOffset;
811 nOffset = other_run->len;
840 if (nOffset < run->
len)
break;
869 cursor->nOffset = nOffset;
884 switch(selectionType)
940 if (x < next_cell->
pt.x)
984 if (
x >=
run->pt.x && x < run->
pt.x +
run->nWidth)
1041 if (y < row->
pt.y +
row->nHeight)
break;
1043 if (!next_row)
break;
1091 int curOfs, anchorStartOfs, anchorEndOfs;
1101 if (curOfs < anchorStartOfs)
1127 else if (curOfs >= anchorEndOfs)
1182 }
else if (clickNum % 2 == 0) {
1193 else if (!is_selection)
1207 }
else if (clickNum % 2 == 0 || is_shift) {
1286 if (!new_para)
return;
1429 int nEndCursor = nStartCursor ^ 1;
1461 TRACE(
"cpMin=%ld cpMax=%ld seltyp=%d (%s %s)\n",
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
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_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum)
int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how)
BOOL cursor_from_coords(ME_TextEditor *editor, int x, int y, ME_Cursor *cursor)
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)
HRESULT editor_insert_oleobj(ME_TextEditor *editor, const REOBJECT *reo)
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, LONG *from, LONG *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 struct re_object * create_re_object(const REOBJECT *reo, ME_Run *run)
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)
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_InvalidateSelection(ME_TextEditor *editor)
ME_Row * para_first_row(ME_Paragraph *para)
ME_Run * run_next(ME_Run *run)
void editor_set_default_para_fmt(ME_TextEditor *editor, PARAFORMAT2 *pFmt)
void ME_Remove(ME_DisplayItem *diWhere)
ME_Style * style_get_insert_style(ME_TextEditor *editor, ME_Cursor *cursor)
ME_Cell * table_row_end_cell(ME_Paragraph *para)
int ME_PointFromCharContext(ME_Context *c, ME_Run *pRun, int nOffset, BOOL visual_order)
ME_Paragraph * cell_first_para(ME_Cell *cell)
ME_Cell * cell_next(ME_Cell *cell)
void ME_ReleaseStyle(ME_Style *item)
ME_Cell * cell_prev(ME_Cell *cell)
ME_Row * row_from_cursor(ME_Cursor *cursor)
#define ITextHost_TxCreateCaret(This, a, b, c)
void editor_propagate_char_ofs(ME_TextEditor *editor, ME_Paragraph *para, ME_Run *run, int shift)
ME_Paragraph * row_para(ME_Row *row)
ME_Row * para_end_row(ME_Paragraph *para)
void ME_Repaint(ME_TextEditor *editor)
ME_Run * run_insert(ME_TextEditor *editor, ME_Cursor *cursor, ME_Style *style, const WCHAR *str, int len, int flags)
ME_Run * run_prev(ME_Run *run)
ME_Paragraph * para_split(ME_TextEditor *editor, ME_Run *run, ME_Style *style, const WCHAR *eol_str, int eol_len, int paraFlags)
void ME_CopyReObject(REOBJECT *dst, const REOBJECT *src, DWORD flags)
void row_first_cursor(ME_Row *row, ME_Cursor *cursor)
#define ITextHost_TxNotify(This, a, b)
ME_Run * para_end_run(ME_Paragraph *para)
void ME_ScrollDown(ME_TextEditor *editor, int cy)
#define ITextHost_TxSetCaretPos(This, a, b)
ME_Cell * table_row_first_cell(ME_Paragraph *para)
ME_Cell * para_cell(ME_Paragraph *para)
static ME_DisplayItem * run_get_di(ME_Run *run)
ME_Paragraph * table_row_end(ME_Paragraph *para)
#define ITextHost_TxGetDC(This)
ME_Run * row_first_run(ME_Row *row)
ME_Run * run_prev_all_paras(ME_Run *run)
ME_Paragraph * para_join(ME_TextEditor *editor, ME_Paragraph *para, BOOL use_first_fmt)
ME_Row * row_prev_all_paras(ME_Row *row)
void table_protect_partial_deletion(ME_TextEditor *editor, ME_Cursor *c, int *num_chars)
int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visual_order)
void row_end_cursor(ME_Row *row, ME_Cursor *cursor, BOOL include_eop)
ME_Run * row_next_run(ME_Row *row, ME_Run *run)
#define ITextHost_TxReleaseDC(This, a)
void ME_StrDeleteV(ME_String *s, int nVChar, int nChars)
ME_Row * row_next_all_paras(ME_Row *row)
void para_mark_rewrap(ME_TextEditor *editor, ME_Paragraph *para)
ME_Run * para_first_run(ME_Paragraph *para)
ME_Paragraph * table_row_start(ME_Paragraph *para)
void cursor_from_char_ofs(ME_TextEditor *editor, int char_ofs, ME_Cursor *cursor)
ME_Paragraph * para_prev(ME_Paragraph *para)
void ME_ClearTempStyle(ME_TextEditor *editor)
ME_Row * row_next(ME_Row *row)
int ME_CallWordBreakProc(ME_TextEditor *editor, WCHAR *str, INT len, INT start, INT code)
void ME_ScrollUp(ME_TextEditor *editor, int cy)
BOOL add_undo_insert_run(ME_TextEditor *, int pos, const WCHAR *str, int len, int flags, ME_Style *style)
ME_Paragraph * cell_end_para(ME_Cell *cell)
ME_Run * run_split(ME_TextEditor *editor, ME_Cursor *cursor)
static WCHAR * get_text(const ME_Run *run, int offset)
void ME_GetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt)
void ME_DestroyDisplayItem(ME_DisplayItem *item)
void ME_CheckCharOffsets(ME_TextEditor *editor)
ME_Paragraph * para_next(ME_Paragraph *para)
#define ITextHost_TxShowCaret(This, a)
void editor_ensure_visible(ME_TextEditor *editor, ME_Cursor *cursor)
int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run, BOOL closest, BOOL visual_order)
static const char * debugstr_run(const ME_Run *run)
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
BOOL WINAPI ImmSetCompositionFontW(_In_ HIMC hIMC, _In_ LPLOGFONTW lplf)
BOOL WINAPI ImmSetCompositionWindow(_In_ HIMC hIMC, _In_ LPCOMPOSITIONFORM lpCompForm)
HIMC WINAPI ImmGetContext(_In_ HWND hWnd)
BOOL WINAPI ImmReleaseContext(_In_ HWND hWnd, _In_ HIMC hIMC)
BOOL WINAPI ImmIsIME(_In_ HKL hKL)
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
LPRICHEDITOLECALLBACK lpOleCallback
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)