69 p->member.run.nCharOfs +=
shift;
70 assert(
p->member.run.nCharOfs >= 0);
81 p->member.para.nCharOfs +=
shift;
82 assert(
p->member.para.nCharOfs >= 0);
83 p =
p->member.para.next_para;
91 p->member.para.nCharOfs +=
shift;
92 assert(
p->member.para.nCharOfs >= 0);
104 int ofs = 0, ofsp = 0;
109 TRACE_(richedit_check)(
"Checking begin\n");
112 TRACE_(richedit_lists)(
"---\n");
119 TRACE_(richedit_check)(
"tend, real ofsp = %d, counted = %d\n",
p->member.para.nCharOfs, ofsp+ofs);
120 assert(ofsp+ofs ==
p->member.para.nCharOfs);
121 TRACE_(richedit_check)(
"Checking finished\n");
124 TRACE_(richedit_check)(
"para, real ofsp = %d, counted = %d\n",
p->member.para.nCharOfs, ofsp+ofs);
125 assert(ofsp+ofs ==
p->member.para.nCharOfs);
126 ofsp =
p->member.para.nCharOfs;
130 TRACE_(richedit_check)(
"run, real ofs = %d (+ofsp = %d), counted = %d, len = %d, txt = %s, flags=%08x, fx&mask = %08x\n",
131 p->member.run.nCharOfs,
p->member.run.nCharOfs+ofsp, ofsp+ofs,
133 p->member.run.nFlags,
134 p->member.run.style->fmt.dwMask &
p->member.run.style->fmt.dwEffects);
135 assert(ofs ==
p->member.run.nCharOfs);
137 ofs +=
p->member.run.len;
140 TRACE_(richedit_check)(
"cell\n");
146 TRACE_(richedit_check)(
"Checking finished\n");
193 nCharOfs =
max(nCharOfs, 0);
194 nCharOfs =
min(nCharOfs,
len);
200 next_item =
item->member.para.next_para;
203 nCharOfs -=
item->member.para.nCharOfs;
204 if (ppPara) *ppPara =
item;
214 nCharOfs -=
item->member.run.nCharOfs;
216 if (ppRun) *ppRun =
item;
219 *pOfs = (*ppRun)->member.run.len;
220 else *pOfs = nCharOfs;
234 assert(
p->member.run.nCharOfs != -1);
263 int nOffset =
cursor->nOffset;
299 item->member.run.style =
s;
301 item->member.run.nFlags = nFlags;
302 item->member.run.nCharOfs = -1;
303 item->member.run.len = 0;
305 item->member.run.num_glyphs = 0;
306 item->member.run.max_glyphs = 0;
311 item->member.run.max_clusters = 0;
335 if (!insert_before) insert_before =
cursor->pRun;
340 insert_before =
cursor->pRun;
387 if (found_ink)
return TRUE;
420 run->
nFlags &= ~MERF_HIDDEN;
425 run->
nFlags &= ~MERF_SPLITTABLE;
433 run->
nFlags &= ~MERF_WHITESPACE;
438 run->
nFlags &= ~MERF_STARTWHITE;
443 run->
nFlags &= ~MERF_ENDWHITE;
468 if (!run->
len ||
cx <= 0)
473 if (!closest || cx < run->nWidth / 2)
return 0;
481 if (!closest ||
cx < sz.
cx / 2)
return 0;
492 TRACE(
"x %d cp %d trailing %d (run width %d) rtl %d log order %d\n",
cx,
cp, trailing, run->
nWidth,
494 return closest ?
cp + trailing :
cp;
497 if (
c->editor->cPasswordMask)
508 if (closest && fit != run->
len)
512 if (
cx >= (sz2.
cx+sz3.
cx)/2)
580 if (
c->editor->cPasswordMask)
617 int startx,
int *pAscent,
int *pDescent)
622 nLen =
min( nLen, run->
len );
626 nLen =
min( nLen, 1 );
633 else if (
c->editor->cPasswordMask)
645 size.cy = *pAscent + *pDescent;
652 if (
c->editor->bEmulateVersion10 &&
657 if (i < pFmt->cTabCount)
671 if (ppos > startx + run->
pt.
x) {
672 size.cx = ppos - startx - run->
pt.
x;
676 size.cy = *pAscent + *pDescent;
682 if (
size.cy > *pAscent)
732 if (
start->nOffset ==
start->pRun->member.run.len)
734 else if (
start->nOffset)
738 int split_offset =
start->nOffset;
740 start_run =
start->pRun;
741 if (
end &&
end->pRun == split_run)
744 end->nOffset -= split_offset;
750 if (
end->nOffset ==
end->pRun->member.run.len)
847 if (run == run_end)
return;
864 pFmt->
dwMask &= ~CFM_SIZE;
868 pFmt->
dwMask &= ~CFM_FACE;
871 pFmt->
dwMask &= ~CFM_FACE;
874 pFmt->
dwMask &= ~CFM_SIZE;
876 pFmt->
dwMask &= ~CFM_UNDERLINETYPE;
882 pFmt->
dwMask &= ~CFM_COLOR;
889 }
while(run != run_end);
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define WINE_DECLARE_DEBUG_CHANNEL(x)
BOOL ME_IsSelection(ME_TextEditor *editor)
int ME_GetSelection(ME_TextEditor *editor, ME_Cursor **from, ME_Cursor **to)
int ME_GetTextLength(ME_TextEditor *editor)
void ME_DestroyContext(ME_Context *c)
void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC)
void ME_CursorFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_Cursor *pCursor)
void ME_SkipAndPropagateCharOffset(ME_DisplayItem *p, int shift)
int ME_PointFromCharContext(ME_Context *c, ME_Run *pRun, int nOffset, BOOL visual_order)
static void ME_GetTextExtent(ME_Context *c, LPCWSTR szText, int nChars, ME_Style *s, SIZE *size)
int ME_CharFromPointContext(ME_Context *c, int cx, ME_Run *run, BOOL closest, BOOL visual_order)
ME_DisplayItem * ME_InsertRunAtCursor(ME_TextEditor *editor, ME_Cursor *cursor, ME_Style *style, const WCHAR *str, int len, int flags)
void ME_SetCharFormat(ME_TextEditor *editor, ME_Cursor *start, ME_Cursor *end, CHARFORMAT2W *pFmt)
static BOOL run_is_splittable(const ME_Run *run)
ME_DisplayItem * ME_SplitRunSimple(ME_TextEditor *editor, ME_Cursor *cursor)
void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem **ppPara, ME_DisplayItem **ppRun, int *pOfs)
void ME_UpdateRunFlags(ME_TextEditor *editor, ME_Run *run)
void ME_GetCharFormat(ME_TextEditor *editor, const ME_Cursor *from, const ME_Cursor *to, CHARFORMAT2W *pFmt)
void ME_PropagateCharOffset(ME_DisplayItem *p, int shift)
static void ME_GetRunCharFormat(ME_TextEditor *editor, ME_DisplayItem *run, CHARFORMAT2W *pFmt)
static BOOL run_is_entirely_ws(const ME_Run *run)
int ME_CharOfsFromRunOfs(ME_TextEditor *editor, const ME_DisplayItem *pPara, const ME_DisplayItem *pRun, int nOfs)
int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visual_order)
ME_DisplayItem * ME_MakeRun(ME_Style *s, int nFlags)
SIZE ME_GetRunSizeCommon(ME_Context *c, const ME_Paragraph *para, ME_Run *run, int nLen, int startx, int *pAscent, int *pDescent)
BOOL ME_CanJoinRuns(const ME_Run *run1, const ME_Run *run2)
void ME_JoinRuns(ME_TextEditor *editor, ME_DisplayItem *p)
void ME_SetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt)
void ME_GetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt)
void ME_CheckCharOffsets(ME_TextEditor *editor)
int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run, BOOL closest, BOOL visual_order)
void ME_GetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt)
HRESULT WINAPI ScriptXtoCP(int iX, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva, const int *piAdvance, const SCRIPT_ANALYSIS *psa, int *piCP, int *piTrailing)
HRESULT WINAPI ScriptCPtoX(int iCP, BOOL fTrailing, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva, const int *piAdvance, const SCRIPT_ANALYSIS *psa, int *piX)
void ME_ReleaseStyle(ME_Style *item) DECLSPEC_HIDDEN
ME_Style * ME_GetInsertStyle(ME_TextEditor *editor, int nCursor) DECLSPEC_HIDDEN
void ME_AddRefStyle(ME_Style *item) DECLSPEC_HIDDEN
BOOL add_undo_set_char_fmt(ME_TextEditor *, int pos, int len, const CHARFORMAT2W *fmt) DECLSPEC_HIDDEN
void mark_para_rewrap(ME_TextEditor *editor, ME_DisplayItem *para) DECLSPEC_HIDDEN
ME_Style * ME_ApplyStyle(ME_TextEditor *ed, ME_Style *sSrc, CHARFORMAT2W *style) DECLSPEC_HIDDEN
void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize) DECLSPEC_HIDDEN
void ME_DestroyDisplayItem(ME_DisplayItem *item) DECLSPEC_HIDDEN
int ME_twips2pointsX(const ME_Context *c, int x) DECLSPEC_HIDDEN
ME_DisplayItem * ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
void select_style(ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN
ME_DisplayItem * ME_GetParagraph(ME_DisplayItem *run) DECLSPEC_HIDDEN
void ME_DumpDocument(ME_TextBuffer *buffer) DECLSPEC_HIDDEN
#define ITextHost_TxGetDC(This)
static int ME_IsWSpace(WCHAR ch)
BOOL add_undo_delete_run(ME_TextEditor *, int pos, int len) DECLSPEC_HIDDEN
void ME_Remove(ME_DisplayItem *diWhere) DECLSPEC_HIDDEN
ME_DisplayItem * get_di_from_para(ME_Paragraph *para) DECLSPEC_HIDDEN
void ME_InsertBefore(ME_DisplayItem *diWhere, ME_DisplayItem *diWhat) DECLSPEC_HIDDEN
#define RUN_IS_HIDDEN(run)
void ME_CopyCharFormat(CHARFORMAT2W *pDest, const CHARFORMAT2W *pSrc) DECLSPEC_HIDDEN
void ME_DestroyString(ME_String *s) DECLSPEC_HIDDEN
ME_DisplayItem * ME_MakeDI(ME_DIType type) DECLSPEC_HIDDEN
static WCHAR * get_text(const ME_Run *run, int offset)
ME_DisplayItem * ME_FindItemFwd(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
BOOL ME_InsertString(ME_String *s, int ofs, const WCHAR *insert, int len) DECLSPEC_HIDDEN
static const char * debugstr_run(const ME_Run *run)
ME_String * ME_MakeStringR(WCHAR cRepeat, int nMaxChars) DECLSPEC_HIDDEN
GLint GLint GLint GLint GLint x
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 const WCHAR spaceW[]
#define CFM_UNDERLINETYPE
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
union tagME_DisplayItem::@535 member
struct tagME_DisplayItem * next
struct tagME_DisplayItem * next_para
SCRIPT_VISATTR * vis_attrs
struct tagME_Paragraph * para
SCRIPT_ANALYSIS script_analysis
BOOL WINAPI GetTextExtentExPointW(_In_ HDC hdc, _In_reads_(cchString) LPCWSTR lpszString, _In_ int cchString, _In_ int nMaxExtent, _Out_opt_ LPINT lpnFit, _Out_writes_to_opt_(cchString, *lpnFit) LPINT lpnDx, _Out_ LPSIZE lpSize)
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)