38 cursor->nOffset = final_eop ?
cursor->pRun->member.run.len : 0;
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))
256 pSizeRun = run = tmp;
361 int nChars,
BOOL bForce)
366 int totalChars = nChars;
371 nChars =
min(nChars, text_len - nOfs);
372 if (nChars == text_len) delete_all =
TRUE;
373 start_para =
c.pPara;
387 nOfs+nChars == (
c.pRun->member.run.nCharOfs
388 +
c.pPara->member.para.nCharOfs))
393 c.nOffset =
c.pRun->member.run.len;
395 run = &
c.pRun->member.run;
397 int eollen =
c.pRun->member.run.
len;
398 BOOL keepFirstParaFormat;
404 keepFirstParaFormat = (totalChars == nChars && nChars <= eollen &&
413 if (this_para == start_para &&
422 nChars -= (eollen < nChars) ? eollen : nChars;
425 keepFirstParaFormat =
TRUE;
431 nChars -= (eollen < nChars) ? eollen : nChars;
437 int nCharsToDelete =
min(nChars,
c.nOffset);
440 c.nOffset -= nCharsToDelete;
448 nChars -= nCharsToDelete;
449 shift -= nCharsToDelete;
450 TRACE(
"Deleting %d (remaining %d) chars at %d in %s (%d)\n",
451 nCharsToDelete, nChars,
c.nOffset,
459 run->
len -= nCharsToDelete;
466 if (
i == -1) pThisCur = &
c;
472 pThisCur->
nOffset -= nCharsToDelete;
492 if (!
cursor.pRun->member.run.len)
494 TRACE(
"Removing empty run\n");
512 assert(nCursor>=0 && nCursor<editor->nCursors);
539 WARN(
"Fail to allocate re_object.\n");
615 assert(nCursor>=0 && nCursor<editor->nCursors);
633 }
else if (*
pos ==
'\t') {
648 if (
len > 1 &&
pos[1] ==
'\n')
650 else if (
len > 2 &&
pos[1] ==
'\r' &&
pos[2] ==
'\n')
666 const WCHAR cr =
'\r', *eol_str =
str;
676 if (
p->nOffset ==
p->pRun->member.run.len)
679 if (!run) run =
p->pRun;
722 cursor->nOffset += nRelOfs;
731 }
while (
cursor->nOffset <
cursor->pRun->member.run.nCharOfs);
740 nRelOfs -=
cursor->nOffset;
748 }
while (
cursor->nOffset <
cursor->pPara->member.para.nCharOfs);
752 while (
cursor->nOffset <
cursor->pRun->member.run.nCharOfs) {
756 }
else if (
cursor->nOffset >=
cursor->pRun->member.run.len) {
761 next_para =
cursor->pPara->member.para.next_para;
762 if (new_offset < next_para->
member.para.nCharOfs)
768 }
while (
cursor->nOffset >=
cursor->pRun->member.run.len);
782 cursor->pPara = next_para;
786 cursor->nOffset = new_offset -
cursor->pPara->member.para.nCharOfs;
803 int nOffset =
cursor->nOffset;
815 if (pOtherRun->type ==
diRun)
818 pOtherRun->member.run.len,
819 pOtherRun->member.run.len - 1,
861 if (nOffset < pRun->
member.run.len)
864 if (pOtherRun->type ==
diRun)
875 if (
cursor->pRun == pRun) {
893 cursor->nOffset = nOffset;
908 switch(selectionType)
959 return cursor->pPara->member.para.nCharOfs
974 if (x < next_cell->
member.cell.pt.x)
1016 if (pbCaretAtEnd) *pbCaretAtEnd =
FALSE;
1022 if (
x >= run_x &&
x < run_x+
width)
1036 if (pbCaretAtEnd) *pbCaretAtEnd =
TRUE;
1071 if (y < p->
member.para.pt.y +
p->member.para.nHeight)
1075 y -=
p->member.para.pt.y;
1087 if (y < p->
member.row.pt.y +
p->member.row.nHeight)
break;
1130 if (isExact) *isExact =
FALSE;
1136 if (isExact) *isExact = bResult;
1155 int curOfs, anchorStartOfs, anchorEndOfs;
1165 if (curOfs < anchorStartOfs)
1182 else if (curOfs >= anchorEndOfs)
1230 }
else if (clickNum % 2 == 0) {
1241 else if (!is_selection)
1255 }
else if (clickNum % 2 == 0 || is_shift) {
1434 y = yp +
p->member.row.pt.y;
1446 if (
p->member.para.prev_para ==
NULL)
1448 yp =
p->member.para.prev_para->member.para.pt.y;
1451 y = yp +
p->member.row.pt.y;
1491 y = yp +
p->member.row.pt.y;
1506 yp =
p->member.para.pt.y;
1509 y = yp +
p->member.row.pt.y;
1533 pCursor->
pRun = pRun;
1559 pCursor->
pRun = pRun;
1588 int nEndCursor = nStartCursor ^ 1;
1620 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)
BOOL ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, int nChars)
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_ArrowHome(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)
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)
static void ME_ArrowPageUp(ME_TextEditor *editor, ME_Cursor *pCursor)
static void ME_MoveCursorLines(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs, BOOL extend)
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)
static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *result, BOOL *is_eol, BOOL final_eop)
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)
static ME_DisplayItem * ME_FindPixelPosInTableRow(int x, int y, ME_DisplayItem *para)
void ME_SendSelChange(ME_TextEditor *editor)
int set_selection_cursors(ME_TextEditor *editor, int from, int to)
int ME_GetSelectionOfs(ME_TextEditor *editor, int *from, int *to)
BOOL ME_ArrowKey(ME_TextEditor *editor, int nVKey, BOOL extend, BOOL ctrl)
static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *pCursor)
static void ME_SetCursorToEnd(ME_TextEditor *editor, ME_Cursor *cursor, BOOL final_eop)
void create_caret(ME_TextEditor *editor)
static BOOL ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pRow, int x, ME_Cursor *cursor, BOOL *pbCaretAtEnd)
int ME_GetTextLength(ME_TextEditor *editor)
void ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, int *x, int *y, int *height)
void show_caret(ME_TextEditor *editor)
static void ME_ArrowEnd(ME_TextEditor *editor, ME_Cursor *pCursor)
static ME_DisplayItem * ME_InternalInsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style, int flags)
void update_caret(ME_TextEditor *editor)
static void ME_ArrowCtrlHome(ME_TextEditor *editor, ME_Cursor *pCursor)
ME_Style * ME_GetSelectionInsertStyle(ME_TextEditor *editor)
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)
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
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
void ME_ReleaseStyle(ME_Style *item) DECLSPEC_HIDDEN
ME_Style * ME_GetInsertStyle(ME_TextEditor *editor, int nCursor) DECLSPEC_HIDDEN
int ME_PointFromCharContext(ME_Context *c, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
BOOL add_undo_insert_run(ME_TextEditor *, int pos, const WCHAR *str, int len, int flags, ME_Style *style) DECLSPEC_HIDDEN
ME_DisplayItem * ME_InsertRunAtCursor(ME_TextEditor *editor, ME_Cursor *cursor, ME_Style *style, const WCHAR *str, int len, int flags) DECLSPEC_HIDDEN
void mark_para_rewrap(ME_TextEditor *editor, ME_DisplayItem *para) DECLSPEC_HIDDEN
void ME_CursorFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_Cursor *pCursor) DECLSPEC_HIDDEN
void ME_CheckCharOffsets(ME_TextEditor *editor) DECLSPEC_HIDDEN
#define ITextHost_TxCreateCaret(This, a, b, c)
void ME_DestroyDisplayItem(ME_DisplayItem *item) DECLSPEC_HIDDEN
ME_DisplayItem * ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
void ME_PropagateCharOffset(ME_DisplayItem *p, int shift) DECLSPEC_HIDDEN
void ME_ProtectPartialTableDeletion(ME_TextEditor *editor, ME_Cursor *c, int *nChars) DECLSPEC_HIDDEN
ME_DisplayItem * ME_SplitRunSimple(ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN
#define ITextHost_TxNotify(This, a, b)
#define ITextHost_TxSetCaretPos(This, a, b)
void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor) DECLSPEC_HIDDEN
ME_DisplayItem * ME_GetParagraph(ME_DisplayItem *run) DECLSPEC_HIDDEN
void ME_SetDefaultParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN
int ME_CallWordBreakProc(ME_TextEditor *editor, WCHAR *str, INT len, INT start, INT code) DECLSPEC_HIDDEN
ME_DisplayItem * ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp, BOOL keepFirstParaFormat) DECLSPEC_HIDDEN
#define ITextHost_TxGetClientRect(This, a)
#define ITextHost_TxGetDC(This)
void ME_ScrollUp(ME_TextEditor *editor, int cy) DECLSPEC_HIDDEN
void ME_InvalidateSelection(ME_TextEditor *editor) DECLSPEC_HIDDEN
ME_DisplayItem * ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style, const WCHAR *eol_str, int eol_len, int paraFlags) DECLSPEC_HIDDEN
void ME_GetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN
void ME_CopyReObject(REOBJECT *dst, const REOBJECT *src, DWORD flags) DECLSPEC_HIDDEN
void ME_Remove(ME_DisplayItem *diWhere) DECLSPEC_HIDDEN
void ME_SkipAndPropagateCharOffset(ME_DisplayItem *p, int shift) DECLSPEC_HIDDEN
ME_DisplayItem * ME_GetTableRowStart(ME_DisplayItem *para) DECLSPEC_HIDDEN
void ME_ClearTempStyle(ME_TextEditor *editor) DECLSPEC_HIDDEN
void ME_StrDeleteV(ME_String *s, int nVChar, int nChars) DECLSPEC_HIDDEN
void ME_Repaint(ME_TextEditor *editor) DECLSPEC_HIDDEN
static WCHAR * get_text(const ME_Run *run, int offset)
void ME_ScrollDown(ME_TextEditor *editor, int cy) DECLSPEC_HIDDEN
ME_DisplayItem * ME_FindItemFwd(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
#define ITextHost_TxShowCaret(This, a)
BOOL ME_PrevRun(ME_DisplayItem **para, ME_DisplayItem **run, BOOL all_para) DECLSPEC_HIDDEN
static const char * debugstr_run(const ME_Run *run)
int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run, BOOL closest, BOOL visual_order) DECLSPEC_HIDDEN
ME_DisplayItem * ME_GetTableRowEnd(ME_DisplayItem *para) DECLSPEC_HIDDEN
@ diStartRowOrParagraphOrEnd
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
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
static __inline int is_eol(struct parser *parser, const CHAR *ptr)
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_DisplayItem * prev_cell
struct tagME_DisplayItem * next_cell
union tagME_DisplayItem::@536 member
struct tagME_DisplayItem * next_para
struct tagME_DisplayItem * prev_para
struct tagME_DisplayItem * pCell
struct tagME_Paragraph * para
ME_SelectionType nSelectionType
#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)