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" );
861 run->
para->nFlags &= ~MEPF_COMPLEX;
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;
964 tp->member.para.nFlags &= ~MEPF_REWRAP;
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 void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static void * heap_realloc(void *mem, size_t len)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void ls(int argc, const char *argv[])
void ME_DestroyContext(ME_Context *c)
void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC)
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)
HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItems, const SCRIPT_CONTROL *psControl, const SCRIPT_STATE *psState, SCRIPT_ITEM *pItems, int *pcItems)
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)
HRESULT WINAPI ScriptLayout(int runs, const BYTE *level, int *vistolog, int *logtovis)
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
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
int align(int length, int align)
void ME_JoinRuns(ME_TextEditor *editor, ME_DisplayItem *p) DECLSPEC_HIDDEN
int ME_PointFromCharContext(ME_Context *c, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
#define ITextHost_TxInvalidateRect(This, a, b)
void ME_CheckCharOffsets(ME_TextEditor *editor) DECLSPEC_HIDDEN
int ME_CharFromPointContext(ME_Context *c, int cx, ME_Run *run, BOOL closest, BOOL visual_order) DECLSPEC_HIDDEN
int get_total_width(ME_TextEditor *editor) DECLSPEC_HIDDEN
void ME_DestroyDisplayItem(ME_DisplayItem *item) DECLSPEC_HIDDEN
int ME_GetParaBorderWidth(const ME_Context *c, int flags) DECLSPEC_HIDDEN
int ME_twips2pointsY(const ME_Context *c, int y) 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_SplitRunSimple(ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN
#define ITextHost_TxNotify(This, a, b)
ME_DisplayItem * ME_GetOuterParagraph(ME_DisplayItem *para) DECLSPEC_HIDDEN
SIZE ME_GetRunSizeCommon(ME_Context *c, const ME_Paragraph *para, ME_Run *run, int nLen, int startx, int *pAscent, int *pDescent) DECLSPEC_HIDDEN
#define ITextHost_TxGetClientRect(This, a)
void remove_marked_para(ME_TextEditor *editor, ME_DisplayItem *para) DECLSPEC_HIDDEN
#define ITextHost_TxGetDC(This)
void para_num_init(ME_Context *c, ME_Paragraph *para) DECLSPEC_HIDDEN
static int ME_IsWSpace(WCHAR ch)
void ME_Remove(ME_DisplayItem *diWhere) DECLSPEC_HIDDEN
void ME_InsertBefore(ME_DisplayItem *diWhere, ME_DisplayItem *diWhat) 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_CanJoinRuns(const ME_Run *run1, const ME_Run *run2) DECLSPEC_HIDDEN
static const char * debugstr_run(const ME_Run *run)
void ME_UpdateRunFlags(ME_TextEditor *editor, ME_Run *run) DECLSPEC_HIDDEN
ME_DisplayItem * ME_GetTableRowEnd(ME_DisplayItem *para) DECLSPEC_HIDDEN
GLint GLint GLsizei GLsizei GLsizei GLint border
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLenum GLuint GLenum GLsizei const GLchar * buf
GLboolean GLboolean GLboolean GLboolean a
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
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
#define ENM_REQUESTRESIZE
struct tagME_DisplayItem * prev_cell
struct tagME_DisplayItem * next_cell
union tagME_DisplayItem::@535 member
struct tagME_DisplayItem * prev
struct tagME_DisplayItem * next
struct tagME_DisplayItem * next_para
struct tagME_DisplayItem * pCell
SCRIPT_VISATTR * vis_attrs
struct tagME_Paragraph * para
SCRIPT_ANALYSIS script_analysis
SCRIPT_CACHE script_cache
ME_DisplayItem * first_marked_para
ME_DisplayItem * pLastSplittableRun
ME_DisplayItem * pRowStart
#define LANG_USER_DEFAULT
static int ME_GetParaLineSpace(ME_Context *c, ME_Paragraph *para)
static void calc_run_extent(ME_Context *c, const ME_Paragraph *para, int startx, ME_Run *run)
static void ME_WrapSizeRun(ME_WrapContext *wc, ME_DisplayItem *p)
static ME_DisplayItem * ME_SplitByBacktracking(ME_WrapContext *wc, ME_DisplayItem *p, int loc)
static void adjust_para_y(ME_DisplayItem *item, ME_Context *c, ME_DisplayItem *repaint_start, ME_DisplayItem *repaint_end)
static int reverse_find_whitespace(const WCHAR *s, int start)
static int reverse_find_non_whitespace(const WCHAR *s, int start)
static ME_DisplayItem * ME_MaximizeSplit(ME_WrapContext *wc, ME_DisplayItem *p, int i)
static void ME_WrapEndParagraph(ME_WrapContext *wc, ME_DisplayItem *p)
BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
static HRESULT itemize_para(ME_Context *c, ME_DisplayItem *p)
void ME_SendRequestResize(ME_TextEditor *editor, BOOL force)
static void ME_PrepareParagraphForWrapping(ME_TextEditor *editor, ME_Context *c, ME_DisplayItem *tp)
static HRESULT shape_run(ME_Context *c, ME_Run *run)
static BOOL get_run_glyph_buffers(ME_Run *run)
static ME_DisplayItem * split_run_extents(ME_WrapContext *wc, ME_DisplayItem *item, int nVChar)
static HRESULT shape_para(ME_Context *c, ME_DisplayItem *p)
static void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd)
static ME_DisplayItem * ME_MakeRow(int height, int baseline, int width)
void ME_InvalidateParagraphRange(ME_TextEditor *editor, ME_DisplayItem *start_para, ME_DisplayItem *last_para)
static void ME_MarkRepaintEnd(ME_DisplayItem *para, ME_DisplayItem **repaint_start, ME_DisplayItem **repaint_end)
static void layout_row(ME_DisplayItem *start, const ME_DisplayItem *end)
static ME_DisplayItem * ME_WrapHandleRun(ME_WrapContext *wc, ME_DisplayItem *p)
struct tagME_WrapContext ME_WrapContext
static int find_non_whitespace(const WCHAR *s, int len, int start)
static void ME_BeginRow(ME_WrapContext *wc)
static int find_split_point(ME_Context *c, int cx, ME_Run *run)
static void ME_WrapTextParagraph(ME_TextEditor *editor, ME_Context *c, ME_DisplayItem *tp)