56 ys =
c.pt.y +
item->member.para.pt.y;
57 if (
item->member.para.pCell
58 !=
item->member.para.next_para->member.para.pCell)
64 ye = ys +
item->member.para.nHeight;
67 item->member.para.pCell !=
item->member.para.prev_para->member.para.pCell)
70 ys -=
item->member.para.pCell->member.cell.yTextOffset;
74 if (ys < rcUpdate->
bottom && ye > rcUpdate->
top)
83 rc.
left =
c.rcView.left;
111 FIXME(
"ME_Repaint had to call ME_WrapMarkedParagraphs\n");
119 BOOL wrappedParagraphs;
122 if (wrappedParagraphs)
155 if (
c->editor->nZoomNumerator == 0)
156 return x *
c->dpi.cx / 1440;
158 return x *
c->dpi.cx *
c->editor->nZoomNumerator / 1440 /
c->editor->nZoomDenominator;
163 if (
c->editor->nZoomNumerator == 0)
164 return y *
c->dpi.cy / 1440;
166 return y *
c->dpi.cy *
c->editor->nZoomNumerator / 1440 /
c->editor->nZoomDenominator;
172 int offs = 0, twips = 0;
175 twips =
style->fmt.yOffset;
227 switch (
style->fmt.bUnderlineType)
236 FIXME(
"Unknown underline type (%u)\n",
style->fmt.bUnderlineType );
279 if (
c->editor->bHideSelection || (!
c->editor->bHaveFocus &&
281 if (
c->editor->bEmulateVersion10)
315 if (old_style_selected)
342 if (
c->editor->cPasswordMask)
349 if (paint_bg) old_back =
SetBkColor(
c->hDC, back_color );
369 int nSelFrom,
int nSelTo,
int ymin,
int cy)
374 && nSelFrom < nSelTo && !
c->editor->bHideSelection &&
375 (
c->editor->bHaveFocus || (
c->editor->styleFlags &
ES_NOHIDESEL)));
387 if (
c->editor->bEmulateVersion10)
389 old_style_selected =
TRUE;
429 if (old_style_selected)
448 int nSelFrom, nSelTo;
459 if (runofs >= nSelFrom && runofs < nSelTo)
462 c->pt.y + para->
pt.
y +
start->member.row.pt.y,
463 start->member.row.nHeight );
473 c->pt.y + para->
pt.
y +
start->member.row.pt.y,
474 start->member.row.nHeight );
479 ME_DrawOLE(
c,
x,
y, run, (runofs >= nSelFrom) && (runofs < nSelTo));
484 start->member.row.nHeight);
506 RGB(0x00, 0x00, 0x00),
RGB(0x00, 0x00, 0xFF),
507 RGB(0x00, 0xFF, 0xFF),
RGB(0x00, 0xFF, 0x00),
508 RGB(0xFF, 0x00, 0xFF),
RGB(0xFF, 0x00, 0x00),
509 RGB(0xFF, 0xFF, 0x00),
RGB(0xFF, 0xFF, 0xFF),
510 RGB(0x00, 0x00, 0x80),
RGB(0x00, 0x80, 0x80),
511 RGB(0x00, 0x80, 0x80),
RGB(0x80, 0x00, 0x80),
512 RGB(0x80, 0x00, 0x00),
RGB(0x80, 0x80, 0x00),
513 RGB(0x80, 0x80, 0x80),
RGB(0xc0, 0xc0, 0xc0),
523 if (
c->editor->nZoomNumerator != 0)
536 FIXME(
"Unsupported border value %d\n",
idx);
546 int idx, border_width, top_border, bottom_border;
553 border_width = top_border = bottom_border = 0;
555 hasParaBorder = (!(
c->editor->bEmulateVersion10 &&
590 if (para->
fmt.
wBorders & 4) top_border = border_width;
591 if (para->
fmt.
wBorders & 8) bottom_border = border_width;
596 rc.
left =
c->rcView.left;
597 rc.
right =
c->rcView.right;
606 rc.
left =
c->rcView.left;
607 rc.
right =
c->rcView.right;
617 int pen_width, rightEdge;
628 rightEdge =
c->pt.x +
max(
c->editor->sizeWindow.cx,
629 c->editor->nTotalWidth);
639#define DD(x) ((para->fmt.wBorders & (x)) ? (pen_width + 1) : 0)
646 rc.
left =
c->pt.x + 1;
654 bounds->
left += border_width;
661 rc.
left = rightEdge - pen_width - 1;
669 bounds->
right += border_width;
677 LineTo(
c->hDC, rightEdge -
DD(2),
y + bounds->
top + pen_width + 1);
679 bounds->
top += border_width;
689 bounds->
bottom += border_width;
702 if (!
c->editor->bEmulateVersion10)
717 int top =
c->pt.y + (atTop ? cell->
pt.
y : para->
pt.
y);
779 int oldLeft = rc.
left;
811 if (!cell->
next_cell->member.cell.next_cell &&
840 int i, firstX, startX, endX, rowY, rowBottom, nHeight;
853 rowY =
c->pt.y + para->
pt.
y;
857 rowBottom = rowY + nHeight;
864 pNextFmt = ¶->
next_para->member.para.fmt;
874 LineTo(
c->hDC, endX, rowBottom);
879 LineTo(
c->hDC, firstX, rowBottom);
882 int rightBoundary = para->
fmt.
rgxTabs[
i] & 0x00ffffff;
885 LineTo(
c->hDC, endX, rowBottom);
927 rc.
right =
c->rcView.right;
950 +
max(
c->editor->sizeWindow.cx,
951 c->editor->nTotalWidth));
966 rc.
bottom =
y +
p->member.row.nHeight;
977 after_bdr.
right =
c->rcView.right;
984 static const WCHAR wszRowDebug[] = {
'r',
'o',
'w',
'[',
'%',
'd',
']',0};
992 height =
p->member.row.nHeight;
993 baseline =
p->member.row.nBaseline;
997 run = &
p->member.run;
1009 c->pt.y + para->
pt.
y + run->
pt.
y + baseline,
p, para);
1012 static const WCHAR wszRunDebug[] = {
'[',
'%',
'd',
':',
'%',
'x',
']',
' ',
'%',
'l',
's',0};
1015 pt.x =
c->pt.x + run->
pt.
x;
1016 pt.y =
c->pt.y + para->
pt.
y + run->
pt.
y;
1027 rc.
bottom =
c->pt.y +
p->member.cell.pt.y +
p->member.cell.nHeight;
1045 BOOL bScrollBarIsVisible, bScrollBarWillBeVisible;
1046 int scrollX = 0, scrollY = 0;
1082 bScrollBarIsVisible = (winStyle &
WS_HSCROLL) != 0;
1086 if (bScrollBarIsVisible != bScrollBarWillBeVisible)
1088 bScrollBarWillBeVisible);
1093 bScrollBarIsVisible = (winStyle &
WS_VSCROLL) != 0;
1098 if (bScrollBarIsVisible != bScrollBarWillBeVisible)
1100 bScrollBarWillBeVisible);
1154 BOOL bScrollBarWasVisible, bScrollBarWillBeVisible;
1157 FIXME(
"ME_UpdateScrollBar had to call ME_WrapMarkedParagraphs\n");
1168 if (editor->
horz_si.
nPos && !bScrollBarWillBeVisible)
1186 if ((bScrollBarWillBeVisible || bScrollBarWasVisible) &&
1189 if (si.
nMax > 0xFFFF)
1209 bScrollBarWillBeVisible =
TRUE;
1211 bScrollBarWillBeVisible =
FALSE;
1214 if (bScrollBarWasVisible != bScrollBarWillBeVisible)
1223 if (editor->
vert_si.
nPos && !bScrollBarWillBeVisible)
1241 if ((bScrollBarWillBeVisible || bScrollBarWasVisible) &&
1244 if (si.
nMax > 0xFFFF)
1264 bScrollBarWillBeVisible =
TRUE;
1266 bScrollBarWillBeVisible =
FALSE;
1269 if (bScrollBarWasVisible != bScrollBarWillBeVisible)
1271 bScrollBarWillBeVisible);
1283 if (!pRow || !pPara)
1312 if (y < editor->vert_si.nPos)
1345 if (nStart < editor->nLastSelStart) {
1346 repaint_start = sel_start;
1350 repaint_end = sel_start;
1354 if (nEnd < editor->nLastSelEnd) {
1355 if (!repaint_start) repaint_start = sel_end;
1359 repaint_end = sel_end;
1377 if (numerator == 0 && denominator == 0)
1382 if (numerator <= 0 || denominator <= 0)
1384 if (numerator * 64 <= denominator || numerator / denominator >= 64)
static const char * wine_dbgstr_rect(const RECT *prc)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static char selected[MAX_PATH+1]
static WCHAR no[MAX_STRING_RESOURCE_LEN]
void ME_SendSelChange(ME_TextEditor *editor)
int ME_GetSelectionOfs(ME_TextEditor *editor, int *from, int *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_SendOldNotify(ME_TextEditor *editor, int nCode)
void ME_InvalidateSelection(ME_TextEditor *editor)
void ME_RewrapRepaint(ME_TextEditor *editor)
static void ME_DebugWrite(HDC hDC, const POINT *pt, LPCWSTR szText)
int ME_twips2pointsY(const ME_Context *c, int y)
void ME_ScrollRight(ME_TextEditor *editor, int cx)
void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor)
static int ME_GetBorderPenWidth(const ME_Context *c, int idx)
void ME_ScrollLeft(ME_TextEditor *editor, int cx)
static COLORREF get_back_color(ME_Context *c, ME_Style *style, BOOL highlight)
int ME_GetParaBorderWidth(const ME_Context *c, int flags)
void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate)
void ME_ScrollAbs(ME_TextEditor *editor, int x, int y)
BOOL ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator)
static COLORREF get_text_color(ME_Context *c, ME_Style *style, BOOL highlight)
static void draw_space(ME_Context *c, ME_Run *run, int x, int y, BOOL selected, BOOL actually_draw, int ymin, int cy)
static void get_selection_rect(ME_Context *c, ME_Run *run, int from, int to, int cy, RECT *r)
void ME_UpdateScrollBar(ME_TextEditor *editor)
void ME_Repaint(ME_TextEditor *editor)
static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Paragraph *para)
void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now)
int ME_twips2pointsX(const ME_Context *c, int x)
static const COLORREF pen_colors[16]
void ME_ScrollDown(ME_TextEditor *editor, int cy)
static void ME_DrawTextWithStyle(ME_Context *c, ME_Run *run, int x, int y, int nSelFrom, int nSelTo, int ymin, int cy)
static void draw_para_number(ME_Context *c, ME_DisplayItem *p)
static void ME_DrawParaDecoration(ME_Context *c, ME_Paragraph *para, int y, RECT *bounds)
void ME_HScrollAbs(ME_TextEditor *editor, int x)
static void ME_DrawTableBorders(ME_Context *c, ME_DisplayItem *paragraph)
static int calc_y_offset(const ME_Context *c, ME_Style *style)
static void draw_text(ME_Context *c, ME_Run *run, int x, int y, BOOL selected, RECT *sel_rect)
static HPEN get_underline_pen(ME_Style *style, COLORREF color)
static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph)
void ME_ScrollUp(ME_TextEditor *editor, int cy)
static void draw_underline(ME_Context *c, ME_Run *run, int x, int y, COLORREF color)
static const struct @537 border_details[]
static BOOL ME_PostSetScrollRangeVisibility(SCROLLINFO *si)
void ME_VScrollAbs(ME_TextEditor *editor, int y)
HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UINT fuOptions, const RECT *lprc, const SCRIPT_ANALYSIS *psa, const WCHAR *pwcReserved, int iReserved, const WORD *pwGlyphs, int cGlyphs, const int *piAdvance, const int *piJustify, const GOFFSET *pGoffset)
int align(int length, int align)
#define ITextHost_TxShowScrollBar(This, a, b)
#define ITextHost_TxSetScrollRange(This, a, b, c, d)
void ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayItem **para_end) DECLSPEC_HIDDEN
void ME_InvalidateParagraphRange(ME_TextEditor *editor, ME_DisplayItem *start_para, ME_DisplayItem *last_para) DECLSPEC_HIDDEN
int ME_PointFromCharContext(ME_Context *c, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) DECLSPEC_HIDDEN
#define ITextHost_TxInvalidateRect(This, a, b)
void ME_SendRequestResize(ME_TextEditor *editor, BOOL force) 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
#define ITextHost_TxSetScrollPos(This, a, b, c)
void ME_DrawOLE(ME_Context *c, int x, int y, ME_Run *run, BOOL selected) DECLSPEC_HIDDEN
#define ITextHost_TxGetSysColor(This, a)
#define ITextHost_TxViewChange(This, a)
void ME_DestroyString(ME_String *s) DECLSPEC_HIDDEN
#define ITextHost_TxScrollWindowEx(This, a, b, c, d, e, f, g)
static WCHAR * get_text(const ME_Run *run, int offset)
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
void ME_MarkAllForWrapping(ME_TextEditor *editor) DECLSPEC_HIDDEN
ME_String * ME_MakeStringR(WCHAR cRepeat, int nMaxChars) DECLSPEC_HIDDEN
ME_DisplayItem * ME_GetTableRowEnd(ME_DisplayItem *para) DECLSPEC_HIDDEN
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLdouble GLdouble GLdouble GLdouble top
GLenum GLuint GLenum GLsizei const GLchar * buf
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
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
_Out_opt_ int _Out_opt_ int * cy
#define CFU_UNDERLINEDOUBLE
#define CFU_UNDERLINEWORD
#define ES_DISABLENOSCROLL
#define CFE_AUTOBACKCOLOR
#define CFU_UNDERLINENONE
#define CFU_UNDERLINEDOTTED
struct tagME_DisplayItem * next_cell
union tagME_DisplayItem::@535 member
struct tagME_DisplayItem * next
struct tagME_DisplayItem * next_para
struct tagME_DisplayItem * prev_para
struct tagME_DisplayItem * pCell
struct tagME_Paragraph * para
SCRIPT_ANALYSIS script_analysis
SCRIPT_CACHE script_cache
ME_DisplayItem * pLastSelEndPara
ME_DisplayItem * pLastSelStartPara
HGDIOBJ WINAPI GetStockObject(_In_ int)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
HPEN WINAPI ExtCreatePen(_In_ DWORD iPenStyle, _In_ DWORD cWidth, _In_ const LOGBRUSH *plbrush, _In_ DWORD cStyle, _In_reads_opt_(cStyle) const DWORD *pstyle)
UINT WINAPI SetTextAlign(_In_ HDC, _In_ UINT)
BOOL WINAPI RectVisible(_In_ HDC, _In_ LPCRECT)
int WINAPI IntersectClipRect(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
int WINAPI GetClipRgn(_In_ HDC, _In_ HRGN)
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
HRGN WINAPI CreateRectRgnIndirect(_In_ LPCRECT)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
int WINAPI ExtSelectClipRgn(_In_ HDC, _In_opt_ HRGN, _In_ int)
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
#define SIF_DISABLENOSCROLL
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define COLOR_HIGHLIGHTTEXT
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)