176 int ofs = 0, ofsp = 0;
181 TRACE_(richedit_check)(
"Checking begin\n");
184 TRACE_(richedit_lists)(
"---\n");
191 TRACE_(richedit_check)(
"tend, real ofsp = %d, counted = %d\n",
p->member.para.nCharOfs, ofsp+ofs);
192 assert(ofsp+ofs ==
p->member.para.nCharOfs);
193 TRACE_(richedit_check)(
"Checking finished\n");
196 TRACE_(richedit_check)(
"para, real ofsp = %d, counted = %d\n",
p->member.para.nCharOfs, ofsp+ofs);
197 assert(ofsp+ofs ==
p->member.para.nCharOfs);
198 ofsp =
p->member.para.nCharOfs;
202 TRACE_(richedit_check)(
"run, real ofs = %d (+ofsp = %d), counted = %d, len = %d, txt = %s, flags=%08x, fx&mask = %08x\n",
203 p->member.run.nCharOfs,
p->member.run.nCharOfs+ofsp, ofsp+ofs,
205 p->member.run.nFlags,
206 p->member.run.style->fmt.dwMask &
p->member.run.style->fmt.dwEffects);
207 assert(ofs ==
p->member.run.nCharOfs);
209 ofs +=
p->member.run.len;
212 TRACE_(richedit_check)(
"cell\n");
218 TRACE_(richedit_check)(
"Checking finished\n");
265 cursor->nOffset = char_ofs;
309 int nOffset =
cursor->nOffset;
314 new_run->nCharOfs = run->
nCharOfs + nOffset;
315 new_run->len = run->
len - nOffset;
316 new_run->para = run->
para;
382 if (
cursor->nOffset == insert_before->
len)
385 if (!insert_before) insert_before =
cursor->run;
390 insert_before =
cursor->run;
397 run->nCharOfs = insert_before->
nCharOfs;
399 run->para = insert_before->
para;
436 if (found_ink)
return TRUE;
469 run->
nFlags &= ~MERF_HIDDEN;
474 run->
nFlags &= ~MERF_SPLITTABLE;
482 run->
nFlags &= ~MERF_WHITESPACE;
487 run->
nFlags &= ~MERF_STARTWHITE;
492 run->
nFlags &= ~MERF_ENDWHITE;
517 if (!run->
len ||
cx <= 0)
522 if (!closest || cx < run->nWidth / 2)
return 0;
530 if (!closest ||
cx < sz.
cx / 2)
return 0;
546 if (
c->editor->password_char)
557 if (closest && fit != run->
len)
561 if (
cx >= (sz2.
cx+sz3.
cx)/2)
631 if (
c->editor->password_char)
670 int startx,
int *pAscent,
int *pDescent)
674 nLen =
min( nLen, run->
len );
678 nLen =
min( nLen, 1 );
685 else if (
c->editor->password_char)
697 size.cy = *pAscent + *pDescent;
704 if (
c->editor->bEmulateVersion10 &&
709 if (i < pFmt->cTabCount)
723 if (ppos > startx + run->
pt.
x) {
724 size.cx = ppos - startx - run->
pt.
x;
728 size.cy = *pAscent + *pDescent;
734 if (
size.cy > *pAscent)
786 else if (
start->nOffset)
790 int split_offset =
start->nOffset;
792 start_run =
start->run;
793 if (
end &&
end->run == split_run)
796 end->nOffset -= split_offset;
802 if (
end->nOffset ==
end->run->len)
819 run->
style = new_style;
874 ME_Run *run, *run_end, *prev_run;
881 if (!
from->nOffset && (prev_run =
run_prev( run ))) run = prev_run;
891 if (run == run_end)
return;
900 memset( &tmp, 0,
sizeof(tmp) );
911 fmt->dwMask &= ~CFM_FACE;
914 fmt->dwMask &= ~CFM_FACE;
923 fmt->dwMask &= ~CFM_COLOR;
930 }
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)
ME_Paragraph * editor_first_para(ME_TextEditor *editor)
ME_Run * run_next(ME_Run *run)
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)
static BOOL run_is_splittable(const ME_Run *run)
int run_char_ofs(ME_Run *run, int ofs)
BOOL cursor_next_run(ME_Cursor *cursor, BOOL all_para)
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)
void run_join(ME_TextEditor *editor, ME_Run *run)
void ME_GetCharFormat(ME_TextEditor *editor, const ME_Cursor *from, const ME_Cursor *to, CHARFORMAT2W *fmt)
void ME_UpdateRunFlags(ME_TextEditor *editor, ME_Run *run)
static void run_copy_char_fmt(ME_Run *run, CHARFORMAT2W *fmt)
static BOOL run_is_entirely_ws(const ME_Run *run)
ME_Run * run_prev_all_paras(ME_Run *run)
int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visual_order)
ME_Run * run_create(ME_Style *s, int flags)
SIZE ME_GetRunSizeCommon(ME_Context *c, const ME_Paragraph *para, ME_Run *run, int nLen, int startx, int *pAscent, int *pDescent)
void editor_propagate_char_ofs(ME_Paragraph *para, ME_Run *run, int shift)
BOOL cursor_prev_run(ME_Cursor *cursor, BOOL all_para)
BOOL ME_CanJoinRuns(const ME_Run *run1, const ME_Run *run2)
void cursor_from_char_ofs(ME_TextEditor *editor, int char_ofs, ME_Cursor *cursor)
void ME_SetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt)
void ME_SetCharFormat(ME_TextEditor *editor, ME_Cursor *start, ME_Cursor *end, CHARFORMAT2W *fmt)
ME_Run * run_split(ME_TextEditor *editor, ME_Cursor *cursor)
void ME_GetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt)
void ME_CheckCharOffsets(ME_TextEditor *editor)
ME_Run * run_next_all_paras(ME_Run *run)
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
void ME_AddRefStyle(ME_Style *item) DECLSPEC_HIDDEN
ME_Run * para_first_run(ME_Paragraph *para) DECLSPEC_HIDDEN
BOOL add_undo_set_char_fmt(ME_TextEditor *, int pos, int len, const CHARFORMAT2W *fmt) 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
void select_style(ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN
ME_Style * style_get_insert_style(ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN
void para_mark_rewrap(ME_TextEditor *editor, ME_Paragraph *para) DECLSPEC_HIDDEN
ME_Paragraph * para_next(ME_Paragraph *para) DECLSPEC_HIDDEN
static ME_DisplayItem * run_get_di(ME_Run *run)
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
#define ITextHost_TxReleaseDC(This, a)
void ME_Remove(ME_DisplayItem *diWhere) 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 unsigned __int64 next
#define CFM_UNDERLINETYPE
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
struct tagME_DisplayItem * prev
struct tagME_DisplayItem * next
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)