69 ys =
c.pt.y + para->
pt.
y;
82 if (ys < update->
bottom && ye > update->
top)
91 rc.
left =
c.rcView.left;
100 rc.
top =
c.rcView.top;
124 FIXME(
"ME_Repaint had to call ME_WrapMarkedParagraphs\n");
132 BOOL wrappedParagraphs;
135 if (wrappedParagraphs)
169 if (
c->editor->nZoomNumerator == 0)
170 return x *
c->dpi.cx / 1440;
172 return x *
c->dpi.cx *
c->editor->nZoomNumerator / 1440 /
c->editor->nZoomDenominator;
177 if (
c->editor->nZoomNumerator == 0)
178 return y *
c->dpi.cy / 1440;
180 return y *
c->dpi.cy *
c->editor->nZoomNumerator / 1440 /
c->editor->nZoomDenominator;
186 int offs = 0, twips = 0;
189 twips =
style->fmt.yOffset;
241 switch (
style->fmt.bUnderlineType)
250 FIXME(
"Unknown underline type (%u)\n",
style->fmt.bUnderlineType );
295 if (
c->editor->bEmulateVersion10)
329 if (old_style_selected)
356 if (
c->editor->password_char)
363 if (paint_bg) old_back =
SetBkColor(
c->hDC, back_color );
383 int nSelFrom,
int nSelTo,
int ymin,
int cy )
388 && nSelFrom < nSelTo && !
c->editor->bHideSelection &&
401 if (
c->editor->bEmulateVersion10)
403 old_style_selected =
TRUE;
443 if (old_style_selected)
462 int nSelFrom, nSelTo;
472 if (runofs >= nSelFrom && runofs < nSelTo)
475 c->pt.y + run->
para->pt.y +
row->pt.y,
row->nHeight );
485 c->pt.y + run->
para->pt.y +
row->pt.y,
row->nHeight );
490 draw_ole(
c,
x,
y, run, (runofs >= nSelFrom) && (runofs < nSelTo) );
514 RGB(0x00, 0x00, 0x00),
RGB(0x00, 0x00, 0xFF),
515 RGB(0x00, 0xFF, 0xFF),
RGB(0x00, 0xFF, 0x00),
516 RGB(0xFF, 0x00, 0xFF),
RGB(0xFF, 0x00, 0x00),
517 RGB(0xFF, 0xFF, 0x00),
RGB(0xFF, 0xFF, 0xFF),
518 RGB(0x00, 0x00, 0x80),
RGB(0x00, 0x80, 0x80),
519 RGB(0x00, 0x80, 0x80),
RGB(0x80, 0x00, 0x80),
520 RGB(0x80, 0x00, 0x00),
RGB(0x80, 0x80, 0x00),
521 RGB(0x80, 0x80, 0x80),
RGB(0xc0, 0xc0, 0xc0),
531 if (
c->editor->nZoomNumerator != 0)
544 FIXME(
"Unsupported border value %d\n",
idx);
554 int idx, border_width, top_border, bottom_border;
561 border_width = top_border = bottom_border = 0;
563 hasParaBorder = (!(
c->editor->bEmulateVersion10 &&
598 if (para->
fmt.
wBorders & 4) top_border = border_width;
599 if (para->
fmt.
wBorders & 8) bottom_border = border_width;
607 rc.
left =
c->rcView.left;
608 rc.
right =
c->rcView.right;
620 rc.
left =
c->rcView.left;
621 rc.
right =
c->rcView.right;
631 int pen_width, rightEdge;
642 rightEdge =
c->pt.x +
max(
c->editor->sizeWindow.cx,
643 c->editor->nTotalWidth);
653#define DD(x) ((para->fmt.wBorders & (x)) ? (pen_width + 1) : 0)
660 rc.
left =
c->pt.x + 1;
668 bounds->
left += border_width;
675 rc.
left = rightEdge - pen_width - 1;
683 bounds->
right += border_width;
691 LineTo(
c->hDC, rightEdge -
DD(2),
y + bounds->
top + pen_width + 1);
693 bounds->
top += border_width;
703 bounds->
bottom += border_width;
715 if (!
c->editor->bEmulateVersion10)
730 int top =
c->pt.y + (atTop ? cell->
pt.
y : para->
pt.
y);
800 int oldLeft = rc.
left;
860 int i, firstX, startX, endX, rowY, rowBottom, nHeight;
872 rowY =
c->pt.y + para->
pt.
y;
876 rowBottom = rowY + nHeight;
891 LineTo(
c->hDC, endX, rowBottom);
896 LineTo(
c->hDC, firstX, rowBottom);
899 int rightBoundary = para->
fmt.
rgxTabs[
i] & 0x00ffffff;
902 LineTo(
c->hDC, endX, rowBottom);
943 rc.
right =
c->rcView.right;
945 y =
c->pt.y + para->
pt.
y;
967 +
max(
c->editor->sizeWindow.cx,
968 c->editor->nTotalWidth));
983 rc.
bottom =
y +
p->member.row.nHeight;
994 after_bdr.
right =
c->rcView.right;
1008 height =
p->member.row.nHeight;
1009 baseline =
p->member.row.nBaseline;
1013 run = &
p->member.run;
1036 pt.x =
c->pt.x + run->
pt.
x;
1037 pt.y =
c->pt.y + para->
pt.
y + run->
pt.
y;
1075 if (max_pos > 0xffff)
1089 int scrollX = 0, scrollY = 0;
1154 FIXME(
"ME_UpdateScrollBar had to call ME_WrapMarkedParagraphs\n");
1235 yheight =
row->nHeight;
1237 if (y < editor->vert_si.nPos)
1272 if (nStart < editor->nLastSelStart)
1274 repaint_start = sel_start;
1280 repaint_end = sel_start;
1284 if (nEnd < editor->nLastSelEnd)
1286 if (!repaint_start) repaint_start = sel_end;
1292 repaint_end = sel_end;
1308 if (numerator == 0 && denominator == 0)
1313 if (numerator <= 0 || denominator <= 0)
1315 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 update_caret(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_Paragraph * editor_end_para(ME_TextEditor *editor)
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 editor_draw(ME_TextEditor *editor, HDC hDC, const RECT *update)
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)
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)
static void draw_text_with_style(ME_Context *c, ME_Run *run, int x, int y, int nSelFrom, int nSelTo, int ymin, int cy)
void ME_Repaint(ME_TextEditor *editor)
static const struct @562 border_details[]
void scroll_h_abs(ME_TextEditor *editor, int x, BOOL notify)
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 draw_paragraph(ME_Context *c, ME_Paragraph *para)
static BOOL editor_opaque(ME_TextEditor *editor)
static void draw_para_number(ME_Context *c, ME_Paragraph *para)
static void draw_run(ME_Context *c, int x, int y, ME_Cursor *cursor)
void scroll_v_abs(ME_TextEditor *editor, int y, BOOL notify)
static void ME_DrawParaDecoration(ME_Context *c, ME_Paragraph *para, int y, RECT *bounds)
static void draw_table_borders(ME_Context *c, ME_Paragraph *para)
static void enable_show_scrollbar(ME_TextEditor *editor, INT bar, BOOL enable)
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 set_scroll_range_pos(ME_TextEditor *editor, INT bar, SCROLLINFO *info, BOOL set_range, BOOL notify)
void ME_ScrollUp(ME_TextEditor *editor, int cy)
void scroll_abs(ME_TextEditor *editor, int x, int y, BOOL notify)
static void draw_underline(ME_Context *c, ME_Run *run, int x, int y, COLORREF color)
void editor_ensure_visible(ME_TextEditor *editor, ME_Cursor *cursor)
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)
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
int align(int length, int align)
#define ITextHost_TxShowScrollBar(This, a, b)
#define ITextHost_TxSetScrollRange(This, a, b, c, d)
ME_Paragraph * cell_end_para(ME_Cell *cell) DECLSPEC_HIDDEN
int ME_PointFromCharContext(ME_Context *c, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
ME_Run * para_first_run(ME_Paragraph *para) DECLSPEC_HIDDEN
BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) DECLSPEC_HIDDEN
#define ITextHost_TxInvalidateRect(This, a, b)
void editor_mark_rewrap_all(ME_TextEditor *editor) DECLSPEC_HIDDEN
ME_Cell * para_cell(ME_Paragraph *para) DECLSPEC_HIDDEN
static ME_DisplayItem * para_get_di(ME_Paragraph *para)
BOOL para_in_table(ME_Paragraph *para) DECLSPEC_HIDDEN
ME_Row * para_first_row(ME_Paragraph *para) DECLSPEC_HIDDEN
void ME_SendRequestResize(ME_TextEditor *editor, BOOL force) DECLSPEC_HIDDEN
void select_style(ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN
int run_char_ofs(ME_Run *run, int ofs) DECLSPEC_HIDDEN
#define ITextHost_TxSetScrollPos(This, a, b, c)
#define ITextHost_TxGetSysColor(This, a)
#define ITextHost_TxNotify(This, a, b)
ME_Paragraph * para_next(ME_Paragraph *para) DECLSPEC_HIDDEN
void para_range_invalidate(ME_TextEditor *editor, ME_Paragraph *start_para, ME_Paragraph *last_para) DECLSPEC_HIDDEN
ME_Row * row_from_cursor(ME_Cursor *cursor) DECLSPEC_HIDDEN
ME_Cell * table_row_first_cell(ME_Paragraph *para) DECLSPEC_HIDDEN
#define ITextHost_TxViewChange(This, a)
ME_Paragraph * cell_first_para(ME_Cell *cell) DECLSPEC_HIDDEN
void draw_ole(ME_Context *c, int x, int y, ME_Run *run, BOOL selected) DECLSPEC_HIDDEN
ME_Cell * cell_next(ME_Cell *cell) DECLSPEC_HIDDEN
ME_Paragraph * para_prev(ME_Paragraph *para) DECLSPEC_HIDDEN
#define ITextHost_TxEnableScrollBar(This, a, b)
ME_Cell * table_row_end_cell(ME_Paragraph *para) DECLSPEC_HIDDEN
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)
void editor_get_selection_paras(ME_TextEditor *editor, ME_Paragraph **para, ME_Paragraph **para_end) DECLSPEC_HIDDEN
int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visual_order) DECLSPEC_HIDDEN
ME_Paragraph * table_row_end(ME_Paragraph *para) DECLSPEC_HIDDEN
ME_String * ME_MakeStringR(WCHAR cRepeat, int nMaxChars) 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
static unsigned __int64 next
#define CFU_UNDERLINEDOUBLE
#define CFU_UNDERLINEWORD
#define ES_DISABLENOSCROLL
#define CFE_AUTOBACKCOLOR
#define CFU_UNDERLINENONE
#define CFU_UNDERLINEDOTTED
struct tagME_Paragraph * para
SCRIPT_ANALYSIS script_analysis
SCRIPT_CACHE script_cache
unsigned int horz_sb_enabled
unsigned int vert_sb_enabled
ME_Paragraph * last_sel_end_para
ME_Paragraph * last_sel_start_para
#define TXTBIT_HIDESELECTION
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)
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)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)