101 for (
i = 0, run->
nWidth = 0; i < run->num_glyphs;
i++)
141 run = &
item->member.run;
148 run2 = &
cursor.pRun->member.run;
160 TRACE(
"After split: %s(%d, %d), %s(%d, %d)\n",
176 if (!run->
len ||
cx <= 0)
return 0;
185 item->member.row.nBaseline = baseline;
241 int *vis_to_log =
buf, *log_to_vis, *widths, *
pos;
250 if (found_black) num_runs++;
254 TRACE(
"%d runs\n", num_runs);
255 if (!num_runs)
return;
258 vis_to_log =
heap_alloc( num_runs *
sizeof(
int) * 5 );
260 log_to_vis = vis_to_log + num_runs;
261 widths = vis_to_log + 2 * num_runs;
262 pos = vis_to_log + 3 * num_runs;
265 for (
i = 0,
p =
start;
i < num_runs;
p =
p->next)
269 levels[
i] =
p->member.run.script_analysis.s.uBidiLevel;
270 widths[
i] =
p->member.run.nWidth;
278 pos[0] =
start->member.run.para->pt.x;
279 for (
i = 1;
i < num_runs;
i++)
280 pos[
i] =
pos[
i - 1] + widths[ vis_to_log[
i - 1 ] ];
282 for (
i = 0,
p =
start;
i < num_runs;
p =
p->next)
286 p->member.run.pt.x =
pos[ log_to_vis[
i ] ];
287 TRACE(
"%d: x = %d\n",
i,
p->member.run.pt.x );
305 ascent = para->
para_num.style->tm.tmAscent;
306 descent = para->
para_num.style->tm.tmDescent;
313 if (
p->member.run.nAscent>ascent)
314 ascent =
p->member.run.nAscent;
315 if (
p->member.run.nDescent>descent)
316 descent =
p->member.run.nDescent;
321 int len =
p->member.run.len;
326 while (
len && *(
text--) ==
' ')
330 if (
len ==
p->member.run.len)
331 width +=
p->member.run.nWidth;
335 bSkippingSpaces = !
len;
337 width +=
p->member.run.nWidth;
350 row->member.row.nHeight += 2;
352 row->member.row.pt = wc->
pt;
364 row->member.row.pt.x =
row->member.row.nLMargin +
shift;
368 p->member.run.pt.x +=
row->member.row.nLMargin+
shift;
380 wc->
pt.
y +=
row->member.row.nHeight;
544 assert(0 ==
"Splittable, but no whitespaces");
586 run = &
p->member.run;
716 case 0:
sp =
ls;
break;
717 case 1:
sp = (3 *
ls) / 2;
break;
718 case 2:
sp = 2 *
ls;
break;
724 if (
c->editor->nZoomNumerator == 0)
727 return sp *
c->editor->nZoomNumerator /
c->editor->nZoomDenominator;
733 tp->member.para.nWidth = 0;
737 tp->member.para.nRows = 0;
738 for (
p =
tp->next;
p !=
tp->member.para.next_para;
p =
p->next) {
747 for (
p =
tp->next;
p !=
tp->member.para.next_para;
p =
p->next) {
750 while (
p->next->type ==
diRun &&
767 SCRIPT_STATE state = { 0,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE, 0, 0 };
773 state.uBidiLevel = 1;
775 TRACE(
"Base embedding level %d\n",
state.uBidiLevel );
782 if (items_passed > para->
text->
nLen + 1)
break;
794 TRACE(
"got items:\n" );
795 for (cur_item = 0; cur_item < num_items; cur_item++)
797 TRACE(
"\t%d - %d RTL %d bidi level %d\n",
items[cur_item].iCharPos,
items[cur_item+1].iCharPos - 1,
798 items[cur_item].
a.fRTL,
items[cur_item].a.s.uBidiLevel );
801 TRACE(
"before splitting runs into ranges\n" );
831 TRACE(
"after splitting into ranges\n" );
885 if (!
c->editor->cPasswordMask
892 pFmt = &
tp->member.para.fmt;
903 if (
tp->member.para.pCell) {
912 tp->member.para.para_num.width );
922 if (
c->editor->bEmulateVersion10 &&
948 for (
p =
tp->next;
p!=
tp->member.para.next_para; ) {
955 wc.
pt.
y += linespace;
965 tp->member.para.nHeight = wc.
pt.
y;
966 tp->member.para.nRows = wc.
nRow;
975 *repaint_start = para;
1003 c->pt.y += borderWidth;
1017 int prevHeight, nHeight, bottomBorder = 0;
1035 item->member.para.nHeight = nHeight;
1048 if (prevHeight < nHeight)
1061 else if (
item->member.para.pCell &&
1062 item->member.para.pCell !=
item->member.para.next_para->member.para.pCell)
1065 ME_Cell *cell = &
item->member.para.pCell->member.cell;
1074 c->pt.y = cell->
pt.
y;
1081 if (
item->member.para.pCell)
1084 c->pt.x =
item->member.para.pCell->member.cell.pt.x;
1089 c->pt.y +=
item->member.para.nHeight;
1097 int totalWidth = editor->
nTotalWidth, diff = 0, prev_width;
1107 c.pt =
item->member.para.pt;
1112 prev_width =
item->member.para.nWidth;
1114 if (prev_width == totalWidth &&
item->member.para.nWidth < totalWidth)
1117 totalWidth =
max(totalWidth,
item->member.para.nWidth);
1119 if (!
item->member.para.nCharOfs)
1124 if (
item->member.para.next_para)
1126 diff =
c.pt.y -
item->member.para.next_para->member.para.pt.y;
1129 para = &
item->member.para;
1130 while (para->
next_para && para != &
item->member.para.next_marked->member.para &&
1140 if (
item->member.para.next_marked)
1143 item =
item->member.para.next_marked;
1151 c.pt.y =
item->member.para.pt.y;
1165 return !!repaint_start;
1211 info.nmhdr.idFrom = 0;
static int find_split_point(ME_Context *c, int cx, ME_Run *run)
#define ITextHost_TxInvalidateRect(This, a, b)
GLint GLint GLsizei width
void ME_CheckCharOffsets(ME_TextEditor *editor) DECLSPEC_HIDDEN
ME_DisplayItem * pLastSplittableRun
static void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd)
static ME_DisplayItem * ME_SplitByBacktracking(ME_WrapContext *wc, ME_DisplayItem *p, int loc)
ME_DisplayItem * ME_GetOuterParagraph(ME_DisplayItem *para) DECLSPEC_HIDDEN
static int reverse_find_whitespace(const WCHAR *s, int start)
static int reverse_find_non_whitespace(const WCHAR *s, int start)
SIZE ME_GetRunSizeCommon(ME_Context *c, const ME_Paragraph *para, ME_Run *run, int nLen, int startx, int *pAscent, int *pDescent) DECLSPEC_HIDDEN
struct tagME_DisplayItem * pCell
struct tagME_Paragraph * para
static HRESULT itemize_para(ME_Context *c, ME_DisplayItem *p)
HRESULT WINAPI ScriptLayout(int runs, const BYTE *level, int *vistolog, int *logtovis)
ME_DisplayItem * ME_SplitRunSimple(ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN
static int ME_GetParaLineSpace(ME_Context *c, ME_Paragraph *para)
ME_DisplayItem * ME_GetTableRowEnd(ME_DisplayItem *para) DECLSPEC_HIDDEN
int align(int length, int align)
#define ITextHost_TxGetClientRect(This, a)
static HRESULT shape_para(ME_Context *c, ME_DisplayItem *p)
void ME_JoinRuns(ME_TextEditor *editor, ME_DisplayItem *p) DECLSPEC_HIDDEN
static void ME_PrepareParagraphForWrapping(ME_TextEditor *editor, ME_Context *c, ME_DisplayItem *tp)
#define ITextHost_TxNotify(This, a, b)
static void * heap_realloc(void *mem, size_t len)
static void layout_row(ME_DisplayItem *start, const ME_DisplayItem *end)
static void * heap_alloc(size_t len)
static BOOL get_run_glyph_buffers(ME_Run *run)
static ME_DisplayItem * ME_MakeRow(int height, int baseline, int width)
ME_DisplayItem * ME_MakeDI(ME_DIType type) DECLSPEC_HIDDEN
void ls(int argc, const char *argv[])
GLenum GLuint GLenum GLsizei const GLchar * buf
static void calc_run_extent(ME_Context *c, const ME_Paragraph *para, int startx, ME_Run *run)
static const char * debugstr_run(const ME_Run *run)
static void ME_WrapEndParagraph(ME_WrapContext *wc, ME_DisplayItem *p)
struct tagME_DisplayItem * next
union tagME_DisplayItem::@523 member
void select_style(ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN
static void adjust_para_y(ME_DisplayItem *item, ME_Context *c, ME_DisplayItem *repaint_start, ME_DisplayItem *repaint_end)
void para_num_init(ME_Context *c, ME_Paragraph *para) DECLSPEC_HIDDEN
static struct _test_info info[]
void ME_DestroyDisplayItem(ME_DisplayItem *item) DECLSPEC_HIDDEN
HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs, int cGlyphs, const SCRIPT_VISATTR *psva, SCRIPT_ANALYSIS *psa, int *piAdvance, GOFFSET *pGoffset, ABC *pABC)
void remove_marked_para(ME_TextEditor *editor, ME_DisplayItem *para) DECLSPEC_HIDDEN
void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC)
static int find_non_whitespace(const WCHAR *s, int len, int start)
#define ITextHost_TxGetDC(This)
static void ME_WrapSizeRun(ME_WrapContext *wc, ME_DisplayItem *p)
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 GLint GLint j
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
void ME_InvalidateParagraphRange(ME_TextEditor *editor, ME_DisplayItem *start_para, ME_DisplayItem *last_para)
void ME_SendRequestResize(ME_TextEditor *editor, BOOL force)
int ME_GetParaBorderWidth(const ME_Context *c, int flags) DECLSPEC_HIDDEN
static void ME_BeginRow(ME_WrapContext *wc)
WINE_DEFAULT_DEBUG_CHANNEL(richedit)
void ME_InsertBefore(ME_DisplayItem *diWhere, ME_DisplayItem *diWhat) DECLSPEC_HIDDEN
GLint GLint GLsizei GLsizei GLsizei GLint border
static HRESULT shape_run(ME_Context *c, ME_Run *run)
BOOL ME_CanJoinRuns(const ME_Run *run1, const ME_Run *run2) DECLSPEC_HIDDEN
void ME_Remove(ME_DisplayItem *diWhere) DECLSPEC_HIDDEN
void ME_DestroyContext(ME_Context *c)
HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItems, const SCRIPT_CONTROL *psControl, const SCRIPT_STATE *psState, SCRIPT_ITEM *pItems, int *pcItems)
static WCHAR * get_text(const ME_Run *run, int offset)
static ME_DisplayItem * ME_WrapHandleRun(ME_WrapContext *wc, ME_DisplayItem *p)
int get_total_width(ME_TextEditor *editor) DECLSPEC_HIDDEN
SCRIPT_CACHE script_cache
GLint GLint GLsizei GLsizei height
BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
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 void ME_WrapTextParagraph(ME_TextEditor *editor, ME_Context *c, ME_DisplayItem *tp)
static int ME_IsWSpace(WCHAR ch)
static void ME_MarkRepaintEnd(ME_DisplayItem *para, ME_DisplayItem **repaint_start, ME_DisplayItem **repaint_end)
static ME_DisplayItem * split_run_extents(ME_WrapContext *wc, ME_DisplayItem *item, int nVChar)
ME_DisplayItem * pRowStart
#define ENM_REQUESTRESIZE
HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, int cChars, int cMaxGlyphs, SCRIPT_ANALYSIS *psa, WORD *pwOutGlyphs, WORD *pwLogClust, SCRIPT_VISATTR *psva, int *pcGlyphs)
struct tagME_DisplayItem * next_para
int ME_twips2pointsY(const ME_Context *c, int y) DECLSPEC_HIDDEN
void ME_UpdateRunFlags(ME_TextEditor *editor, ME_Run *run) DECLSPEC_HIDDEN
SCRIPT_ANALYSIS script_analysis
static ME_DisplayItem * ME_MaximizeSplit(ME_WrapContext *wc, ME_DisplayItem *p, int i)
ME_DisplayItem * first_marked_para
struct tagME_DisplayItem * next_cell
ME_DisplayItem * ME_FindItemFwd(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
int ME_PointFromCharContext(ME_Context *c, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
struct tagME_WrapContext ME_WrapContext
GLboolean GLboolean GLboolean GLboolean a
SCRIPT_VISATTR * vis_attrs
struct tagME_DisplayItem * prev
ME_DisplayItem * ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass) DECLSPEC_HIDDEN
#define LANG_USER_DEFAULT
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
static BOOL heap_free(void *mem)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
int ME_CharFromPointContext(ME_Context *c, int cx, ME_Run *run, BOOL closest, BOOL visual_order) DECLSPEC_HIDDEN
struct tagME_DisplayItem * prev_cell
int ME_twips2pointsX(const ME_Context *c, int x) DECLSPEC_HIDDEN