ReactOS 0.4.16-dev-1288-g7ec3a7e
paint.c
Go to the documentation of this file.
1/*
2 * RichEdit - painting functions
3 *
4 * Copyright 2004 by Krzysztof Foltman
5 * Copyright 2005 by Phil Krylov
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include "editor.h"
23
25
26static void draw_paragraph( ME_Context *c, ME_Paragraph *para );
27
28static inline BOOL editor_opaque( ME_TextEditor *editor )
29{
30 return editor->back_style != TXTBACK_TRANSPARENT;
31}
32
33void editor_draw( ME_TextEditor *editor, HDC hDC, const RECT *update )
34{
35 ME_Paragraph *para;
37 ME_Cell *cell;
38 int ys, ye;
39 HRGN oldRgn;
40 RECT rc, client;
42
43 ME_InitContext( &c, editor, hDC );
44 if (!update)
45 {
46 client = c.rcView;
47 client.left -= editor->selofs;
48 update = &client;
49 }
50
51 oldRgn = CreateRectRgn(0, 0, 0, 0);
52 if (!GetClipRgn(hDC, oldRgn))
53 {
54 DeleteObject(oldRgn);
55 oldRgn = NULL;
56 }
57 IntersectClipRect( hDC, update->left, update->top, update->right, update->bottom );
58
59 brush = SelectObject( hDC, brush );
61
62 para = editor_first_para( editor );
63 /* This context point is an offset for the paragraph positions stored
64 * during wrapping. It shouldn't be modified during painting. */
65 c.pt.x = c.rcView.left - editor->horz_si.nPos;
66 c.pt.y = c.rcView.top - editor->vert_si.nPos;
67 while (para_next( para ))
68 {
69 ys = c.pt.y + para->pt.y;
70 cell = para_cell( para );
71 if (cell && para == cell_end_para( cell ))
72 ye = c.pt.y + cell->pt.y + cell->nHeight;
73 else ye = ys + para->nHeight;
74
75 if (cell && !(para->nFlags & MEPF_ROWEND) && para == cell_first_para( cell ))
76 {
77 /* the border shifts the text down */
78 ys -= para_cell( para )->yTextOffset;
79 }
80
81 /* Draw the paragraph if any of the paragraph is in the update region. */
82 if (ys < update->bottom && ye > update->top)
83 draw_paragraph( &c, para );
84 para = para_next( para );
85 }
86 if (editor_opaque( editor ))
87 {
88 if (c.pt.y + editor->nTotalLength < c.rcView.bottom)
89 { /* space after the end of the text */
90 rc.top = c.pt.y + editor->nTotalLength;
91 rc.left = c.rcView.left;
92 rc.bottom = c.rcView.bottom;
93 rc.right = c.rcView.right;
94 if (IntersectRect( &rc, &rc, update ))
95 PatBlt(hDC, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY);
96 }
97 if (editor->selofs)
98 { /* selection bar */
99 rc.left = c.rcView.left - editor->selofs;
100 rc.top = c.rcView.top;
101 rc.right = c.rcView.left;
102 rc.bottom = c.rcView.bottom;
103 if (IntersectRect( &rc, &rc, update ))
104 PatBlt( hDC, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY );
105 }
106 }
107
108 DeleteObject( SelectObject( hDC, brush ) );
109 SelectClipRgn( hDC, oldRgn );
110 if (oldRgn) DeleteObject( oldRgn );
112
113 if (editor->in_place_active) {
114 if (editor->nTotalLength != editor->nLastTotalLength || editor->nTotalWidth != editor->nLastTotalWidth)
116 editor->nLastTotalLength = editor->nTotalLength;
117 editor->nLastTotalWidth = editor->nTotalWidth;
118 }
119}
120
122{
123 if (ME_WrapMarkedParagraphs(editor))
124 {
125 ME_UpdateScrollBar(editor);
126 FIXME("ME_Repaint had to call ME_WrapMarkedParagraphs\n");
127 }
128 if (!editor->freeze_count)
130}
131
132void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now)
133{
134 /* Should be called whenever the contents of the control have changed */
135 BOOL wrappedParagraphs;
136
137 wrappedParagraphs = ME_WrapMarkedParagraphs(editor);
138 if (wrappedParagraphs)
139 ME_UpdateScrollBar(editor);
140
141 /* Ensure that the cursor is visible */
142 editor_ensure_visible( editor, &editor->pCursors[0] );
143
144 update_caret( editor );
145
146 if (!editor->freeze_count)
147 ITextHost_TxViewChange(editor->texthost, update_now);
148
149 ME_SendSelChange(editor);
150
151 if(editor->nEventMask & ENM_CHANGE)
152 {
153 editor->nEventMask &= ~ENM_CHANGE;
155 editor->nEventMask |= ENM_CHANGE;
156 }
157}
158
159void
161{
162 /* RewrapRepaint should be called whenever the control has changed in
163 * looks, but not content. Like resizing. */
164
165 editor_mark_rewrap_all( editor );
167 ME_UpdateScrollBar(editor);
168 ME_Repaint(editor);
169}
170
172{
173 if (c->editor->nZoomNumerator == 0)
174 return x * c->dpi.cx / 1440;
175 else
176 return x * c->dpi.cx * c->editor->nZoomNumerator / 1440 / c->editor->nZoomDenominator;
177}
178
180{
181 if (c->editor->nZoomNumerator == 0)
182 return y * c->dpi.cy / 1440;
183 else
184 return y * c->dpi.cy * c->editor->nZoomNumerator / 1440 / c->editor->nZoomDenominator;
185}
186
187
189{
190 int offs = 0, twips = 0;
191
192 if ((style->fmt.dwMask & style->fmt.dwEffects) & CFM_OFFSET)
193 twips = style->fmt.yOffset;
194
195 if ((style->fmt.dwMask & style->fmt.dwEffects) & (CFM_SUPERSCRIPT | CFM_SUBSCRIPT))
196 {
197 if (style->fmt.dwEffects & CFE_SUPERSCRIPT) twips = style->fmt.yHeight/3;
198 if (style->fmt.dwEffects & CFE_SUBSCRIPT) twips = -style->fmt.yHeight/12;
199 }
200
201 if (twips) offs = ME_twips2pointsY( c, twips );
202
203 return offs;
204}
205
207{
209
210 if (highlight)
211 color = ITextHost_TxGetSysColor( c->editor->texthost, COLOR_HIGHLIGHTTEXT );
212 else if ((style->fmt.dwMask & CFM_LINK) && (style->fmt.dwEffects & CFE_LINK))
213 color = RGB(0,0,255);
214 else if ((style->fmt.dwMask & CFM_COLOR) && (style->fmt.dwEffects & CFE_AUTOCOLOR))
215 color = ITextHost_TxGetSysColor( c->editor->texthost, COLOR_WINDOWTEXT );
216 else
217 color = style->fmt.crTextColor;
218
219 return color;
220}
221
223{
225
226 if (highlight)
227 color = ITextHost_TxGetSysColor( c->editor->texthost, COLOR_HIGHLIGHT );
228 else if ( (style->fmt.dwMask & CFM_BACKCOLOR)
229 && !(style->fmt.dwEffects & CFE_AUTOBACKCOLOR) )
230 color = style->fmt.crBackColor;
231 else
232 color = ITextHost_TxGetSysColor( c->editor->texthost, COLOR_WINDOW );
233
234 return color;
235}
236
238{
239 if (style->fmt.dwEffects & CFE_LINK)
240 return CreatePen( PS_SOLID, 1, color );
241
242 /* Choose the pen type for underlining the text. */
243 if (style->fmt.dwEffects & CFE_UNDERLINE)
244 {
245 switch (style->fmt.bUnderlineType)
246 {
247 case CFU_UNDERLINE:
248 case CFU_UNDERLINEWORD: /* native seems to map it to simple underline (MSDN) */
249 case CFU_UNDERLINEDOUBLE: /* native seems to map it to simple underline (MSDN) */
250 return CreatePen( PS_SOLID, 1, color );
252 return CreatePen( PS_DOT, 1, color );
253 default:
254 FIXME( "Unknown underline type (%u)\n", style->fmt.bUnderlineType );
255 /* fall through */
256 case CFU_CF1UNDERLINE: /* this type is supported in the font, do nothing */
258 break;
259 }
260 }
261 return NULL;
262}
263
264static void draw_underline( ME_Context *c, ME_Run *run, int x, int y, COLORREF color )
265{
266 HPEN pen;
267
268 pen = get_underline_pen( run->style, color );
269 if (pen)
270 {
271 HPEN old_pen = SelectObject( c->hDC, pen );
272 MoveToEx( c->hDC, x, y + 1, NULL );
273 LineTo( c->hDC, x + run->nWidth, y + 1 );
274 SelectObject( c->hDC, old_pen );
275 DeleteObject( pen );
276 }
277 return;
278}
279
280/*********************************************************************
281 * draw_space
282 *
283 * Draw the end-of-paragraph or tab space.
284 *
285 * If actually_draw is TRUE then ensure any underline is drawn.
286 */
287static void draw_space( ME_Context *c, ME_Run *run, int x, int y,
288 BOOL selected, BOOL actually_draw, int ymin, int cy )
289{
290 HDC hdc = c->hDC;
291 BOOL old_style_selected = FALSE;
292 RECT rect;
293 COLORREF back_color = 0;
294
295 SetRect( &rect, x, ymin, x + run->nWidth, ymin + cy );
296
297 if (c->editor->bHideSelection || (!c->editor->bHaveFocus && (c->editor->props & TXTBIT_HIDESELECTION)))
298 selected = FALSE;
299 if (c->editor->bEmulateVersion10)
300 {
301 old_style_selected = selected;
302 selected = FALSE;
303 }
304
305 if (selected)
306 back_color = ITextHost_TxGetSysColor( c->editor->texthost, COLOR_HIGHLIGHT );
307
308 if (actually_draw)
309 {
310 COLORREF text_color = get_text_color( c, run->style, selected );
311 COLORREF old_text, old_back;
312 int y_offset = calc_y_offset( c, run->style );
313 static const WCHAR space[1] = {' '};
314
315 select_style( c, run->style );
316 old_text = SetTextColor( hdc, text_color );
317 if (selected) old_back = SetBkColor( hdc, back_color );
318
319 ExtTextOutW( hdc, x, y - y_offset, selected ? ETO_OPAQUE : 0, &rect, space, 1, &run->nWidth );
320
321 if (selected) SetBkColor( hdc, old_back );
322 SetTextColor( hdc, old_text );
323
324 draw_underline( c, run, x, y - y_offset, text_color );
325 }
326 else if (selected)
327 {
328 HBRUSH brush = CreateSolidBrush( back_color );
329 FillRect( hdc, &rect, brush );
330 DeleteObject( brush );
331 }
332
333 if (old_style_selected)
334 PatBlt( hdc, x, ymin, run->nWidth, cy, DSTINVERT );
335}
336
337static void get_selection_rect( ME_Context *c, ME_Run *run, int from, int to, int cy, RECT *r )
338{
339 from = max( 0, from );
340 to = min( run->len, to );
341 r->left = ME_PointFromCharContext( c, run, from, TRUE );
342 r->top = 0;
343 r->right = ME_PointFromCharContext( c, run, to, TRUE );
344 r->bottom = cy;
345 return;
346}
347
348static void draw_text( ME_Context *c, ME_Run *run, int x, int y, BOOL selected, RECT *sel_rect )
349{
350 COLORREF text_color = get_text_color( c, run->style, selected );
351 COLORREF back_color = get_back_color( c, run->style, selected );
352 COLORREF old_text, old_back = 0;
353 const WCHAR *text = get_text( run, 0 );
354 ME_String *masked = NULL;
355 const BOOL paint_bg = ( selected
356 || ( ( run->style->fmt.dwMask & CFM_BACKCOLOR )
357 && !(CFE_AUTOBACKCOLOR & run->style->fmt.dwEffects) )
358 );
359
360 if (c->editor->password_char)
361 {
362 masked = ME_MakeStringR( c->editor->password_char, run->len );
363 text = masked->szData;
364 }
365
366 old_text = SetTextColor( c->hDC, text_color );
367 if (paint_bg) old_back = SetBkColor( c->hDC, back_color );
368
369 if (run->para->nFlags & MEPF_COMPLEX)
370 ScriptTextOut( c->hDC, &run->style->script_cache, x, y, paint_bg ? ETO_OPAQUE : 0, sel_rect,
371 &run->script_analysis, NULL, 0, run->glyphs, run->num_glyphs, run->advances,
372 NULL, run->offsets );
373 else
374 ExtTextOutW( c->hDC, x, y, paint_bg ? ETO_OPAQUE : 0, sel_rect, text, run->len, NULL );
375
376 if (paint_bg) SetBkColor( c->hDC, old_back );
377 SetTextColor( c->hDC, old_text );
378
379 draw_underline( c, run, x, y, text_color );
380
381 ME_DestroyString( masked );
382 return;
383}
384
385
386static void draw_text_with_style( ME_Context *c, ME_Run *run, int x, int y,
387 int nSelFrom, int nSelTo, int ymin, int cy )
388{
389 HDC hDC = c->hDC;
390 int yOffset = 0;
391 BOOL selected = (nSelFrom < run->len && nSelTo >= 0
392 && nSelFrom < nSelTo && !c->editor->bHideSelection &&
393 (c->editor->bHaveFocus || !(c->editor->props & TXTBIT_HIDESELECTION)));
394 BOOL old_style_selected = FALSE;
395 RECT sel_rect;
396 HRGN clip = NULL, sel_rgn = NULL;
397
398 yOffset = calc_y_offset( c, run->style );
399
400 if (selected)
401 {
402 get_selection_rect( c, run, nSelFrom, nSelTo, cy, &sel_rect );
403 OffsetRect( &sel_rect, x, ymin );
404
405 if (c->editor->bEmulateVersion10)
406 {
407 old_style_selected = TRUE;
408 selected = FALSE;
409 }
410 else
411 {
412 sel_rgn = CreateRectRgnIndirect( &sel_rect );
413 clip = CreateRectRgn( 0, 0, 0, 0 );
414 if (GetClipRgn( hDC, clip ) != 1)
415 {
416 DeleteObject( clip );
417 clip = NULL;
418 }
419 }
420 }
421
422 select_style( c, run->style );
423
424 if (sel_rgn) ExtSelectClipRgn( hDC, sel_rgn, RGN_DIFF );
425
426 if (!(run->style->fmt.dwEffects & CFE_AUTOBACKCOLOR)
427 && (run->style->fmt.dwMask & CFM_BACKCOLOR) )
428 {
429 RECT tmp_rect;
430 get_selection_rect( c, run, 0, run->len, cy, &tmp_rect );
431 OffsetRect( &tmp_rect, x, ymin );
432 draw_text( c, run, x, y - yOffset, FALSE, &tmp_rect );
433 }
434 else
435 draw_text( c, run, x, y - yOffset, FALSE, NULL );
436
437 if (sel_rgn)
438 {
439 ExtSelectClipRgn( hDC, clip, RGN_COPY );
440 ExtSelectClipRgn( hDC, sel_rgn, RGN_AND );
441 draw_text( c, run, x, y - yOffset, TRUE, &sel_rect );
442 ExtSelectClipRgn( hDC, clip, RGN_COPY );
443 if (clip) DeleteObject( clip );
444 DeleteObject( sel_rgn );
445 }
446
447 if (old_style_selected)
448 PatBlt( hDC, sel_rect.left, ymin, sel_rect.right - sel_rect.left, cy, DSTINVERT );
449}
450
451static void ME_DebugWrite(HDC hDC, const POINT *pt, LPCWSTR szText) {
454 COLORREF color = SetTextColor(hDC, RGB(128,128,128));
455 TextOutW(hDC, pt->x, pt->y, szText, lstrlenW(szText));
459}
460
461static void draw_run( ME_Context *c, int x, int y, ME_Cursor *cursor )
462{
463 ME_Row *row;
464 ME_Run *run = cursor->run;
465 int runofs = run_char_ofs( run, cursor->nOffset );
466 LONG nSelFrom, nSelTo;
467
468 if (run->nFlags & MERF_HIDDEN) return;
469
471 ME_GetSelectionOfs(c->editor, &nSelFrom, &nSelTo);
472
473 /* Draw selected end-of-paragraph mark */
474 if (run->nFlags & MERF_ENDPARA)
475 {
476 if (runofs >= nSelFrom && runofs < nSelTo)
477 {
478 draw_space( c, run, x, y, TRUE, FALSE,
479 c->pt.y + run->para->pt.y + row->pt.y, row->nHeight );
480 }
481 return;
482 }
483
484 if (run->nFlags & (MERF_TAB | MERF_ENDCELL))
485 {
486 BOOL selected = runofs >= nSelFrom && runofs < nSelTo;
487
488 draw_space( c, run, x, y, selected, TRUE,
489 c->pt.y + run->para->pt.y + row->pt.y, row->nHeight );
490 return;
491 }
492
493 if (run->nFlags & MERF_GRAPHICS)
494 draw_ole( c, x, y, run, (runofs >= nSelFrom) && (runofs < nSelTo) );
495 else
496 draw_text_with_style( c, run, x, y, nSelFrom - runofs, nSelTo - runofs,
497 c->pt.y + run->para->pt.y + row->pt.y, row->nHeight );
498}
499
500/* The documented widths are in points (72 dpi), but converting them to
501 * 96 dpi (standard display resolution) avoids dealing with fractions. */
502static const struct {unsigned width : 8, pen_style : 4, dble : 1;} border_details[] = {
503 /* none */ {0, PS_SOLID, FALSE},
504 /* 3/4 */ {1, PS_SOLID, FALSE},
505 /* 1 1/2 */ {2, PS_SOLID, FALSE},
506 /* 2 1/4 */ {3, PS_SOLID, FALSE},
507 /* 3 */ {4, PS_SOLID, FALSE},
508 /* 4 1/2 */ {6, PS_SOLID, FALSE},
509 /* 6 */ {8, PS_SOLID, FALSE},
510 /* 3/4 double */ {1, PS_SOLID, TRUE},
511 /* 1 1/2 double */ {2, PS_SOLID, TRUE},
512 /* 2 1/4 double */ {3, PS_SOLID, TRUE},
513 /* 3/4 gray */ {1, PS_DOT /* FIXME */, FALSE},
514 /* 1 1/2 dashed */ {2, PS_DASH, FALSE},
516
517static const COLORREF pen_colors[16] = {
518 /* Black */ RGB(0x00, 0x00, 0x00), /* Blue */ RGB(0x00, 0x00, 0xFF),
519 /* Cyan */ RGB(0x00, 0xFF, 0xFF), /* Green */ RGB(0x00, 0xFF, 0x00),
520 /* Magenta */ RGB(0xFF, 0x00, 0xFF), /* Red */ RGB(0xFF, 0x00, 0x00),
521 /* Yellow */ RGB(0xFF, 0xFF, 0x00), /* White */ RGB(0xFF, 0xFF, 0xFF),
522 /* Dark blue */ RGB(0x00, 0x00, 0x80), /* Dark cyan */ RGB(0x00, 0x80, 0x80),
523 /* Dark green */ RGB(0x00, 0x80, 0x80), /* Dark magenta */ RGB(0x80, 0x00, 0x80),
524 /* Dark red */ RGB(0x80, 0x00, 0x00), /* Dark yellow */ RGB(0x80, 0x80, 0x00),
525 /* Dark gray */ RGB(0x80, 0x80, 0x80), /* Light gray */ RGB(0xc0, 0xc0, 0xc0),
526};
527
528static int ME_GetBorderPenWidth(const ME_Context* c, int idx)
529{
530 int width = border_details[idx].width;
531
532 if (c->dpi.cx != 96)
533 width = MulDiv(width, c->dpi.cx, 96);
534
535 if (c->editor->nZoomNumerator != 0)
536 width = MulDiv(width, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
537
538 return width;
539}
540
542{
543 int idx = (flags >> 8) & 0xF;
544 int width;
545
547 {
548 FIXME("Unsupported border value %d\n", idx);
549 return 0;
550 }
552 if (border_details[idx].dble) width = width * 2 + 1;
553 return width;
554}
555
556static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT* bounds)
557{
558 int idx, border_width, top_border, bottom_border;
559 RECT rc;
560 BOOL hasParaBorder;
561
562 SetRectEmpty(bounds);
563 if (!(para->fmt.dwMask & (PFM_BORDER | PFM_SPACEBEFORE | PFM_SPACEAFTER))) return;
564
565 border_width = top_border = bottom_border = 0;
566 idx = (para->fmt.wBorders >> 8) & 0xF;
567 hasParaBorder = (!(c->editor->bEmulateVersion10 &&
568 para->fmt.dwMask & PFM_TABLE &&
569 para->fmt.wEffects & PFE_TABLE) &&
570 (para->fmt.dwMask & PFM_BORDER) &&
571 idx != 0 &&
572 (para->fmt.wBorders & 0xF));
573 if (hasParaBorder)
574 {
575 /* FIXME: wBorders is not stored as MSDN says in v1.0 - 4.1 of richedit
576 * controls. It actually stores the paragraph or row border style. Although
577 * the value isn't used for drawing, it is used for streaming out rich text.
578 *
579 * wBorders stores the border style for each side (top, left, bottom, right)
580 * using nibble (4 bits) to store each border style. The rich text format
581 * control words, and their associated value are the following:
582 * \brdrdash 0
583 * \brdrdashsm 1
584 * \brdrdb 2
585 * \brdrdot 3
586 * \brdrhair 4
587 * \brdrs 5
588 * \brdrth 6
589 * \brdrtriple 7
590 *
591 * The order of the sides stored actually differs from v1.0 to 3.0 and v4.1.
592 * The mask corresponding to each side for the version are the following:
593 * mask v1.0-3.0 v4.1
594 * 0x000F top left
595 * 0x00F0 left top
596 * 0x0F00 bottom right
597 * 0xF000 right bottom
598 */
599 if (para->fmt.wBorders & 0x00B0)
600 FIXME("Unsupported border flags %x\n", para->fmt.wBorders);
601 border_width = ME_GetParaBorderWidth(c, para->fmt.wBorders);
602 if (para->fmt.wBorders & 4) top_border = border_width;
603 if (para->fmt.wBorders & 8) bottom_border = border_width;
604 }
605
606 if (para->fmt.dwMask & PFM_SPACEBEFORE)
607 {
608 bounds->top = ME_twips2pointsY(c, para->fmt.dySpaceBefore);
609 if (editor_opaque( c->editor ))
610 {
611 rc.left = c->rcView.left;
612 rc.right = c->rcView.right;
613 rc.top = y;
614 rc.bottom = y + bounds->top + top_border;
615 PatBlt(c->hDC, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY);
616 }
617 }
618
619 if (para->fmt.dwMask & PFM_SPACEAFTER)
620 {
621 bounds->bottom = ME_twips2pointsY(c, para->fmt.dySpaceAfter);
622 if (editor_opaque( c->editor ))
623 {
624 rc.left = c->rcView.left;
625 rc.right = c->rcView.right;
626 rc.bottom = y + para->nHeight;
627 rc.top = rc.bottom - bounds->bottom - bottom_border;
628 PatBlt(c->hDC, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY);
629 }
630 }
631
632 /* Native richedit doesn't support paragraph borders in v1.0 - 4.1,
633 * but might support it in later versions. */
634 if (hasParaBorder) {
635 int pen_width, rightEdge;
636 COLORREF pencr;
637 HPEN pen = NULL, oldpen = NULL;
638 POINT pt;
639
640 if (para->fmt.wBorders & 64) /* autocolor */
641 pencr = ITextHost_TxGetSysColor(c->editor->texthost,
643 else
644 pencr = pen_colors[(para->fmt.wBorders >> 12) & 0xF];
645
646 rightEdge = c->pt.x + max(c->editor->sizeWindow.cx,
647 c->editor->nTotalWidth);
648
649 pen_width = ME_GetBorderPenWidth(c, idx);
650 pen = CreatePen(border_details[idx].pen_style, pen_width, pencr);
651 oldpen = SelectObject(c->hDC, pen);
652 MoveToEx(c->hDC, 0, 0, &pt);
653
654 /* before & after spaces are not included in border */
655
656 /* helper to draw the double lines in case of corner */
657#define DD(x) ((para->fmt.wBorders & (x)) ? (pen_width + 1) : 0)
658
659 if (para->fmt.wBorders & 1)
660 {
661 MoveToEx(c->hDC, c->pt.x, y + bounds->top, NULL);
662 LineTo(c->hDC, c->pt.x, y + para->nHeight - bounds->bottom);
663 if (border_details[idx].dble) {
664 rc.left = c->pt.x + 1;
665 rc.right = rc.left + border_width;
666 rc.top = y + bounds->top;
667 rc.bottom = y + para->nHeight - bounds->bottom;
668 PatBlt(c->hDC, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY);
669 MoveToEx(c->hDC, c->pt.x + pen_width + 1, y + bounds->top + DD(4), NULL);
670 LineTo(c->hDC, c->pt.x + pen_width + 1, y + para->nHeight - bounds->bottom - DD(8));
671 }
672 bounds->left += border_width;
673 }
674 if (para->fmt.wBorders & 2)
675 {
676 MoveToEx(c->hDC, rightEdge - 1, y + bounds->top, NULL);
677 LineTo(c->hDC, rightEdge - 1, y + para->nHeight - bounds->bottom);
678 if (border_details[idx].dble) {
679 rc.left = rightEdge - pen_width - 1;
680 rc.right = rc.left + pen_width;
681 rc.top = y + bounds->top;
682 rc.bottom = y + para->nHeight - bounds->bottom;
683 PatBlt(c->hDC, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY);
684 MoveToEx(c->hDC, rightEdge - 1 - pen_width - 1, y + bounds->top + DD(4), NULL);
685 LineTo(c->hDC, rightEdge - 1 - pen_width - 1, y + para->nHeight - bounds->bottom - DD(8));
686 }
687 bounds->right += border_width;
688 }
689 if (para->fmt.wBorders & 4)
690 {
691 MoveToEx(c->hDC, c->pt.x, y + bounds->top, NULL);
692 LineTo(c->hDC, rightEdge, y + bounds->top);
693 if (border_details[idx].dble) {
694 MoveToEx(c->hDC, c->pt.x + DD(1), y + bounds->top + pen_width + 1, NULL);
695 LineTo(c->hDC, rightEdge - DD(2), y + bounds->top + pen_width + 1);
696 }
697 bounds->top += border_width;
698 }
699 if (para->fmt.wBorders & 8)
700 {
701 MoveToEx(c->hDC, c->pt.x, y + para->nHeight - bounds->bottom - 1, NULL);
702 LineTo(c->hDC, rightEdge, y + para->nHeight - bounds->bottom - 1);
703 if (border_details[idx].dble) {
704 MoveToEx(c->hDC, c->pt.x + DD(1), y + para->nHeight - bounds->bottom - 1 - pen_width - 1, NULL);
705 LineTo(c->hDC, rightEdge - DD(2), y + para->nHeight - bounds->bottom - 1 - pen_width - 1);
706 }
707 bounds->bottom += border_width;
708 }
709#undef DD
710
711 MoveToEx(c->hDC, pt.x, pt.y, NULL);
712 SelectObject(c->hDC, oldpen);
713 DeleteObject(pen);
714 }
715}
716
718{
719 if (!c->editor->bEmulateVersion10) /* v4.1 */
720 {
721 if (para_cell( para ))
722 {
723 RECT rc;
724 ME_Cell *cell = para_cell( para );
725 ME_Paragraph *after_row;
726 HPEN pen, oldPen;
727 LOGBRUSH logBrush;
728 HBRUSH brush;
730 POINT oldPt;
731 int width;
732 BOOL atTop = (para == cell_first_para( cell ));
733 BOOL atBottom = (para == cell_end_para( cell ));
734 int top = c->pt.y + (atTop ? cell->pt.y : para->pt.y);
735 int bottom = (atBottom ?
736 c->pt.y + cell->pt.y + cell->nHeight :
737 top + para->nHeight + (atTop ? cell->yTextOffset : 0));
738 rc.left = c->pt.x + cell->pt.x;
739 rc.right = rc.left + cell->nWidth;
740 if (atTop)
741 {
742 /* Erase gap before text if not all borders are the same height. */
743 width = max(ME_twips2pointsY(c, cell->border.top.width), 1);
744 rc.top = top + width;
745 width = cell->yTextOffset - width;
746 rc.bottom = rc.top + width;
747 if (width && editor_opaque( c->editor ))
748 PatBlt(c->hDC, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY);
749 }
750 /* Draw cell borders.
751 * The order borders are draw in is left, top, bottom, right in order
752 * to be consistent with native richedit. This is noticeable from the
753 * overlap of borders of different colours. */
754 if (!(para->nFlags & MEPF_ROWEND))
755 {
756 rc.top = top;
757 rc.bottom = bottom;
758 if (cell->border.left.width > 0)
759 {
760 color = cell->border.left.colorRef;
762 }
763 else
764 {
765 color = RGB(192,192,192);
766 width = 1;
767 }
768 logBrush.lbStyle = BS_SOLID;
769 logBrush.lbColor = color;
770 logBrush.lbHatch = 0;
772 width, &logBrush, 0, NULL);
773 oldPen = SelectObject(c->hDC, pen);
774 MoveToEx(c->hDC, rc.left, rc.top, &oldPt);
775 LineTo(c->hDC, rc.left, rc.bottom);
776 SelectObject(c->hDC, oldPen);
777 DeleteObject(pen);
778 MoveToEx(c->hDC, oldPt.x, oldPt.y, NULL);
779 }
780
781 if (atTop)
782 {
783 if (cell->border.top.width > 0)
784 {
785 brush = CreateSolidBrush(cell->border.top.colorRef);
786 width = max(ME_twips2pointsY(c, cell->border.top.width), 1);
787 }
788 else
789 {
791 width = 1;
792 }
793 rc.top = top;
794 rc.bottom = rc.top + width;
795 FillRect(c->hDC, &rc, brush);
796 if (cell->border.top.width > 0)
797 DeleteObject(brush);
798 }
799
800 /* Draw the bottom border if at the last paragraph in the cell, and when
801 * in the last row of the table. */
802 if (atBottom)
803 {
804 int oldLeft = rc.left;
806 after_row = para_next( table_row_end( para ) );
807 if (after_row->nFlags & MEPF_ROWSTART)
808 {
809 ME_Cell *next_end;
810 next_end = table_row_end_cell( after_row );
811 assert( next_end && !cell_next( next_end ) );
812 rc.left = c->pt.x + next_end->pt.x;
813 }
814 if (rc.left < rc.right)
815 {
816 if (cell->border.bottom.width > 0)
817 brush = CreateSolidBrush(cell->border.bottom.colorRef);
818 else
820 rc.bottom = bottom;
821 rc.top = rc.bottom - width;
822 FillRect(c->hDC, &rc, brush);
823 if (cell->border.bottom.width > 0)
824 DeleteObject(brush);
825 }
826 rc.left = oldLeft;
827 }
828
829 /* Right border only drawn if at the end of the table row. */
830 if (!cell_next( cell_next( cell ) ) && !(para->nFlags & MEPF_ROWSTART))
831 {
832 rc.top = top;
833 rc.bottom = bottom;
834 if (cell->border.right.width > 0)
835 {
836 color = cell->border.right.colorRef;
838 }
839 else
840 {
841 color = RGB(192,192,192);
842 width = 1;
843 }
844 logBrush.lbStyle = BS_SOLID;
845 logBrush.lbColor = color;
846 logBrush.lbHatch = 0;
848 width, &logBrush, 0, NULL);
849 oldPen = SelectObject(c->hDC, pen);
850 MoveToEx(c->hDC, rc.right - 1, rc.top, &oldPt);
851 LineTo(c->hDC, rc.right - 1, rc.bottom);
852 SelectObject(c->hDC, oldPen);
853 DeleteObject(pen);
854 MoveToEx(c->hDC, oldPt.x, oldPt.y, NULL);
855 }
856 }
857 }
858 else /* v1.0 - 3.0 */
859 {
860 /* Draw simple table border */
861 if (para_in_table( para ))
862 {
863 HPEN pen = NULL, oldpen = NULL;
864 int i, firstX, startX, endX, rowY, rowBottom, nHeight;
865 POINT oldPt;
866
867 pen = CreatePen(PS_SOLID, 0, para->border.top.colorRef);
868 oldpen = SelectObject(c->hDC, pen);
869
870 /* Find the start relative to the text */
871 firstX = c->pt.x + para_first_run( para )->pt.x;
872 /* Go back by the horizontal gap, which is stored in dxOffset */
873 firstX -= ME_twips2pointsX(c, para->fmt.dxOffset);
874 /* The left edge, stored in dxStartIndent affected just the first edge */
875 startX = firstX - ME_twips2pointsX(c, para->fmt.dxStartIndent);
876 rowY = c->pt.y + para->pt.y;
877 if (para->fmt.dwMask & PFM_SPACEBEFORE)
878 rowY += ME_twips2pointsY(c, para->fmt.dySpaceBefore);
879 nHeight = para_first_row( para )->nHeight;
880 rowBottom = rowY + nHeight;
881
882 /* Draw horizontal lines */
883 MoveToEx(c->hDC, firstX, rowY, &oldPt);
884 i = para->fmt.cTabCount - 1;
885 endX = startX + ME_twips2pointsX(c, para->fmt.rgxTabs[i] & 0x00ffffff) + 1;
886 LineTo(c->hDC, endX, rowY);
887 /* The bottom of the row only needs to be drawn if the next row is
888 * not a table. */
889 if (!(para_next( para ) && para_in_table( para_next( para ) ) && para->nRows == 1))
890 {
891 /* Decrement rowBottom to draw the bottom line within the row, and
892 * to not draw over this line when drawing the vertical lines. */
893 rowBottom--;
894 MoveToEx(c->hDC, firstX, rowBottom, NULL);
895 LineTo(c->hDC, endX, rowBottom);
896 }
897
898 /* Draw vertical lines */
899 MoveToEx(c->hDC, firstX, rowY, NULL);
900 LineTo(c->hDC, firstX, rowBottom);
901 for (i = 0; i < para->fmt.cTabCount; i++)
902 {
903 int rightBoundary = para->fmt.rgxTabs[i] & 0x00ffffff;
904 endX = startX + ME_twips2pointsX(c, rightBoundary);
905 MoveToEx(c->hDC, endX, rowY, NULL);
906 LineTo(c->hDC, endX, rowBottom);
907 }
908
909 MoveToEx(c->hDC, oldPt.x, oldPt.y, NULL);
910 SelectObject(c->hDC, oldpen);
911 DeleteObject(pen);
912 }
913 }
914}
915
917{
918 int x, y;
919 COLORREF old_text;
920
921 if (para->fmt.wNumbering)
922 {
923 select_style( c, para->para_num.style );
924 old_text = SetTextColor( c->hDC, get_text_color( c, para->para_num.style, FALSE ) );
925
926 x = c->pt.x + para->para_num.pt.x;
927 y = c->pt.y + para->pt.y + para->para_num.pt.y;
928
929 ExtTextOutW( c->hDC, x, y, 0, NULL, para->para_num.text->szData, para->para_num.text->nLen, NULL );
930
931 SetTextColor( c->hDC, old_text );
932 }
933}
934
936{
937 int align = SetTextAlign(c->hDC, TA_BASELINE);
939 ME_Cell *cell;
940 ME_Run *run;
941 RECT rc, bounds;
942 int y;
943 int height = 0, baseline = 0, no=0;
944 BOOL visible = FALSE;
945
946 rc.left = c->pt.x;
947 rc.right = c->rcView.right;
948
949 y = c->pt.y + para->pt.y;
950 if ((cell = para_cell( para )))
951 {
952 rc.left = c->pt.x + cell->pt.x;
953 rc.right = rc.left + cell->nWidth;
954 }
955 if (para->nFlags & MEPF_ROWSTART)
956 {
957 cell = table_row_first_cell( para );
958 rc.right = c->pt.x + cell->pt.x;
959 }
960 else if (para->nFlags & MEPF_ROWEND)
961 {
962 cell = table_row_end_cell( para );
963 rc.left = c->pt.x + cell->pt.x + cell->nWidth;
964 }
965 ME_DrawParaDecoration(c, para, y, &bounds);
966 y += bounds.top;
967 if (bounds.left || bounds.right)
968 {
969 rc.left = max(rc.left, c->pt.x + bounds.left);
970 rc.right = min(rc.right, c->pt.x - bounds.right
971 + max(c->editor->sizeWindow.cx,
972 c->editor->nTotalWidth));
973 }
974
975 for (p = para_get_di( para )->next; p != para_get_di( para_next( para ) ); p = p->next)
976 {
977 switch(p->type) {
978 case diParagraph:
979 assert(FALSE);
980 break;
981 case diStartRow:
982 y += height;
983 rc.top = y;
984 if (para->nFlags & (MEPF_ROWSTART|MEPF_ROWEND)) {
985 rc.bottom = y + para->nHeight;
986 } else {
987 rc.bottom = y + p->member.row.nHeight;
988 }
989 visible = RectVisible(c->hDC, &rc);
990 if (editor_opaque( c->editor ) && visible)
991 PatBlt(c->hDC, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY);
992 if (bounds.right)
993 {
994 /* If scrolled to the right past the end of the text, then
995 * there may be space to the right of the paragraph border. */
996 RECT after_bdr = rc;
997 after_bdr.left = rc.right + bounds.right;
998 after_bdr.right = c->rcView.right;
999 if (editor_opaque( c->editor ) && RectVisible( c->hDC, &after_bdr ))
1000 PatBlt(c->hDC, after_bdr.left, after_bdr.top, after_bdr.right - after_bdr.left,
1001 after_bdr.bottom - after_bdr.top, PATCOPY);
1002 }
1003 if (me_debug)
1004 {
1005 WCHAR buf[128];
1006 POINT pt = c->pt;
1007 wsprintfW( buf, L"row[%d]", no );
1008 pt.y = 12+y;
1009 ME_DebugWrite(c->hDC, &pt, buf);
1010 }
1011
1012 height = p->member.row.nHeight;
1013 baseline = p->member.row.nBaseline;
1014 break;
1015 case diRun:
1016 assert(para);
1017 run = &p->member.run;
1018 if (visible && me_debug) {
1019 RECT rc;
1020 rc.left = c->pt.x + run->pt.x;
1021 rc.right = rc.left + run->nWidth;
1022 rc.top = c->pt.y + para->pt.y + run->pt.y;
1023 rc.bottom = rc.top + height;
1024 TRACE("rc = %s\n", wine_dbgstr_rect(&rc));
1026 }
1027 if (visible)
1028 {
1030
1031 cursor.run = run;
1032 cursor.para = para;
1033 cursor.nOffset = 0;
1034 draw_run( c, c->pt.x + run->pt.x, c->pt.y + para->pt.y + run->pt.y + baseline, &cursor );
1035 }
1036 if (me_debug)
1037 {
1038 WCHAR buf[2560];
1039 POINT pt;
1040 pt.x = c->pt.x + run->pt.x;
1041 pt.y = c->pt.y + para->pt.y + run->pt.y;
1042 wsprintfW( buf, L"[%d:%x] %ls", no, p->member.run.nFlags, get_text( &p->member.run, 0 ));
1043 ME_DebugWrite(c->hDC, &pt, buf);
1044 }
1045 break;
1046 default:
1047 break;
1048 }
1049 no++;
1050 }
1051
1052 if (editor_opaque( c->editor ) && para_cell( para ))
1053 {
1054 /* Clear any space at the bottom of the cell after the text. */
1055 rc.top = c->pt.y + para->pt.y + para->nHeight;
1056 rc.bottom = c->pt.y + cell->pt.y + cell->nHeight;
1057 PatBlt( c->hDC, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY );
1058 }
1059
1060 draw_table_borders( c, para );
1061 draw_para_number( c, para );
1062
1063 SetTextAlign( c->hDC, align );
1064}
1065
1067{
1068 if (enable || editor->scrollbars & ES_DISABLENOSCROLL)
1070 if (!(editor->scrollbars & ES_DISABLENOSCROLL))
1072}
1073
1075{
1076 LONG max_pos = info->nMax, pos = info->nPos;
1077
1078 /* Scale the scrollbar info to 16-bit values. */
1079 if (max_pos > 0xffff)
1080 {
1081 pos = MulDiv( pos, 0xffff, max_pos );
1082 max_pos = 0xffff;
1083 }
1084 if (set_range) ITextHost_TxSetScrollRange( editor->texthost, bar, 0, max_pos, FALSE );
1086
1087 if (notify && editor->nEventMask & ENM_SCROLL)
1089}
1090
1091void scroll_abs( ME_TextEditor *editor, int x, int y, BOOL notify )
1092{
1093 int scrollX = 0, scrollY = 0;
1094
1095 if (editor->horz_si.nPos != x) {
1096 x = min(x, editor->horz_si.nMax);
1097 x = max(x, editor->horz_si.nMin);
1098 scrollX = editor->horz_si.nPos - x;
1099 editor->horz_si.nPos = x;
1100 set_scroll_range_pos( editor, SB_HORZ, &editor->horz_si, FALSE, notify );
1101 }
1102
1103 if (editor->vert_si.nPos != y) {
1104 y = min(y, editor->vert_si.nMax - (int)editor->vert_si.nPage);
1105 y = max(y, editor->vert_si.nMin);
1106 scrollY = editor->vert_si.nPos - y;
1107 editor->vert_si.nPos = y;
1108 set_scroll_range_pos( editor, SB_VERT, &editor->vert_si, FALSE, notify );
1109 }
1110
1111 if (abs(scrollX) > editor->sizeWindow.cx || abs(scrollY) > editor->sizeWindow.cy)
1113 else
1114 ITextHost_TxScrollWindowEx(editor->texthost, scrollX, scrollY,
1115 &editor->rcFormat, &editor->rcFormat,
1117 ME_UpdateScrollBar(editor);
1118 ME_Repaint(editor);
1119}
1120
1122{
1123 scroll_abs( editor, x, editor->vert_si.nPos, notify );
1124}
1125
1127{
1128 scroll_abs( editor, editor->horz_si.nPos, y, notify );
1129}
1130
1131void ME_ScrollUp(ME_TextEditor *editor, int cy)
1132{
1133 scroll_v_abs( editor, editor->vert_si.nPos - cy, TRUE );
1134}
1135
1137{
1138 scroll_v_abs( editor, editor->vert_si.nPos + cy, TRUE );
1139}
1140
1142{
1143 scroll_h_abs( editor, editor->horz_si.nPos - cx, TRUE );
1144}
1145
1147{
1148 scroll_h_abs( editor, editor->horz_si.nPos + cx, TRUE );
1149}
1150
1152{
1153 /* Note that this is the only function that should ever call
1154 * SetScrollInfo with SIF_PAGE or SIF_RANGE. */
1155 BOOL enable;
1156
1157 if (ME_WrapMarkedParagraphs(editor))
1158 FIXME("ME_UpdateScrollBar had to call ME_WrapMarkedParagraphs\n");
1159
1160 /* Update horizontal scrollbar */
1161 enable = editor->nTotalWidth > editor->sizeWindow.cx;
1162 if (editor->horz_si.nPos && !enable)
1163 {
1164 scroll_h_abs( editor, 0, TRUE );
1165 /* ME_HScrollAbs will call this function, so nothing else needs to be done here. */
1166 return;
1167 }
1168
1169 if (editor->scrollbars & WS_HSCROLL && !enable ^ !editor->horz_sb_enabled)
1170 {
1171 editor->horz_sb_enabled = enable;
1173 }
1174
1175 if (editor->horz_si.nMax != editor->nTotalWidth || editor->horz_si.nPage != editor->sizeWindow.cx)
1176 {
1177 editor->horz_si.nMax = editor->nTotalWidth;
1178 editor->horz_si.nPage = editor->sizeWindow.cx;
1179 TRACE( "min = %d max = %d page = %d\n", editor->horz_si.nMin, editor->horz_si.nMax, editor->horz_si.nPage );
1180 if ((enable || editor->horz_sb_enabled) && editor->scrollbars & WS_HSCROLL)
1181 set_scroll_range_pos( editor, SB_HORZ, &editor->horz_si, TRUE, TRUE );
1182 }
1183
1184 /* Update vertical scrollbar */
1185 enable = editor->nTotalLength > editor->sizeWindow.cy && (editor->props & TXTBIT_MULTILINE);
1186
1187 if (editor->vert_si.nPos && !enable)
1188 {
1189 scroll_v_abs( editor, 0, TRUE );
1190 /* ME_VScrollAbs will call this function, so nothing else needs to be done here. */
1191 return;
1192 }
1193
1194 if (editor->scrollbars & WS_VSCROLL && !enable ^ !editor->vert_sb_enabled)
1195 {
1196 editor->vert_sb_enabled = enable;
1198 }
1199
1200 if (editor->vert_si.nMax != editor->nTotalLength || editor->vert_si.nPage != editor->sizeWindow.cy)
1201 {
1202 editor->vert_si.nMax = editor->nTotalLength;
1203 editor->vert_si.nPage = editor->sizeWindow.cy;
1204 TRACE( "min = %d max = %d page = %d\n", editor->vert_si.nMin, editor->vert_si.nMax, editor->vert_si.nPage );
1205 if ((enable || editor->vert_sb_enabled) && editor->scrollbars & WS_VSCROLL)
1206 set_scroll_range_pos( editor, SB_VERT, &editor->vert_si, TRUE, TRUE );
1207 }
1208}
1209
1211{
1212 ME_Run *run = cursor->run;
1214 ME_Paragraph *para = cursor->para;
1215 int x, y, yheight;
1216
1217 if (!editor->in_place_active)
1218 return;
1219
1220 if (editor->scrollbars & ES_AUTOHSCROLL)
1221 {
1222 x = run->pt.x + ME_PointFromChar( editor, run, cursor->nOffset, TRUE );
1223 if (x > editor->horz_si.nPos + editor->sizeWindow.cx)
1224 x = x + 1 - editor->sizeWindow.cx;
1225 else if (x > editor->horz_si.nPos)
1226 x = editor->horz_si.nPos;
1227
1228 if (~editor->scrollbars & ES_AUTOVSCROLL)
1229 {
1230 scroll_h_abs( editor, x, TRUE );
1231 return;
1232 }
1233 }
1234 else
1235 {
1236 if (~editor->scrollbars & ES_AUTOVSCROLL) return;
1237 x = editor->horz_si.nPos;
1238 }
1239
1240 y = para->pt.y + row->pt.y;
1241 yheight = row->nHeight;
1242
1243 if (y < editor->vert_si.nPos)
1244 scroll_abs( editor, x, y, TRUE );
1245 else if (y + yheight > editor->vert_si.nPos + editor->sizeWindow.cy)
1246 scroll_abs( editor, x, y + yheight - editor->sizeWindow.cy, TRUE );
1247 else if (x != editor->horz_si.nPos)
1248 scroll_abs( editor, x, editor->vert_si.nPos, TRUE );
1249}
1250
1251
1252void
1254{
1255 ME_Paragraph *sel_start, *sel_end;
1256 ME_Paragraph *repaint_start = NULL, *repaint_end = NULL;
1257 LONG nStart, nEnd;
1258 int len = ME_GetTextLength(editor);
1259
1260 ME_GetSelectionOfs(editor, &nStart, &nEnd);
1261 /* if both old and new selection are 0-char (= caret only), then
1262 there's no (inverted) area to be repainted, neither old nor new */
1263 if (nStart == nEnd && editor->nLastSelStart == editor->nLastSelEnd)
1264 return;
1266 editor_get_selection_paras( editor, &sel_start, &sel_end );
1267
1268 /* last selection markers aren't always updated, which means
1269 * they can point past the end of the document */
1270 if (editor->nLastSelStart > len || editor->nLastSelEnd > len)
1271 {
1272 repaint_start = editor_first_para( editor );
1273 repaint_end = para_prev( editor_end_para( editor ) );
1274 }
1275 else
1276 {
1277 /* if the start part of selection is being expanded or contracted... */
1278 if (nStart < editor->nLastSelStart)
1279 {
1280 repaint_start = sel_start;
1281 repaint_end = editor->last_sel_start_para;
1282 }
1283 else if (nStart > editor->nLastSelStart)
1284 {
1285 repaint_start = editor->last_sel_start_para;
1286 repaint_end = sel_start;
1287 }
1288
1289 /* if the end part of selection is being contracted or expanded... */
1290 if (nEnd < editor->nLastSelEnd)
1291 {
1292 if (!repaint_start) repaint_start = sel_end;
1293 repaint_end = editor->last_sel_end_para;
1294 }
1295 else if (nEnd > editor->nLastSelEnd)
1296 {
1297 if (!repaint_start) repaint_start = editor->last_sel_end_para;
1298 repaint_end = sel_end;
1299 }
1300 }
1301
1302 if (repaint_start)
1303 para_range_invalidate( editor, repaint_start, repaint_end );
1304 /* remember the last invalidated position */
1305 ME_GetSelectionOfs(editor, &editor->nLastSelStart, &editor->nLastSelEnd);
1307}
1308
1309BOOL
1310ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator)
1311{
1312 /* TODO: Zoom images and objects */
1313
1314 if (numerator == 0 && denominator == 0)
1315 {
1316 editor->nZoomNumerator = editor->nZoomDenominator = 0;
1317 return TRUE;
1318 }
1319 if (numerator <= 0 || denominator <= 0)
1320 return FALSE;
1321 if (numerator * 64 <= denominator || numerator / denominator >= 64)
1322 return FALSE;
1323
1324 editor->nZoomNumerator = numerator;
1325 editor->nZoomDenominator = denominator;
1326
1327 ME_RewrapRepaint(editor);
1328 return TRUE;
1329}
static HDC hDC
Definition: 3dtext.c:33
Arabic default style
Definition: afstyles.h:94
int yOffset
Definition: appswitch.c:58
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
HFONT hFont
Definition: main.c:53
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
static char selected[MAX_PATH+1]
Definition: dirdlg.c:7
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
static WCHAR no[MAX_STRING_RESOURCE_LEN]
Definition: object.c:2340
#define lstrlenW
Definition: compat.h:750
const WCHAR * text
Definition: package.c:1794
void ME_SendSelChange(ME_TextEditor *editor)
Definition: caret.c:1439
int ME_GetSelectionOfs(ME_TextEditor *editor, LONG *from, LONG *to)
Definition: caret.c:42
int ME_GetTextLength(ME_TextEditor *editor)
Definition: caret.c:83
void update_caret(ME_TextEditor *editor)
Definition: caret.c:277
void ME_DestroyContext(ME_Context *c)
Definition: context.c:44
void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC)
Definition: context.c:23
ME_Paragraph * editor_first_para(ME_TextEditor *editor)
Definition: editor.c:276
BOOL me_debug
Definition: editor.c:254
ME_Paragraph * editor_end_para(ME_TextEditor *editor)
Definition: editor.c:282
void ME_InvalidateSelection(ME_TextEditor *editor)
Definition: paint.c:1253
void ME_RewrapRepaint(ME_TextEditor *editor)
Definition: paint.c:160
static void ME_DebugWrite(HDC hDC, const POINT *pt, LPCWSTR szText)
Definition: paint.c:451
int ME_twips2pointsY(const ME_Context *c, int y)
Definition: paint.c:179
void ME_ScrollRight(ME_TextEditor *editor, int cx)
Definition: paint.c:1146
void editor_draw(ME_TextEditor *editor, HDC hDC, const RECT *update)
Definition: paint.c:33
unsigned pen_style
Definition: paint.c:502
static int ME_GetBorderPenWidth(const ME_Context *c, int idx)
Definition: paint.c:528
void ME_ScrollLeft(ME_TextEditor *editor, int cx)
Definition: paint.c:1141
static COLORREF get_back_color(ME_Context *c, ME_Style *style, BOOL highlight)
Definition: paint.c:222
int ME_GetParaBorderWidth(const ME_Context *c, int flags)
Definition: paint.c:541
BOOL ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator)
Definition: paint.c:1310
static COLORREF get_text_color(ME_Context *c, ME_Style *style, BOOL highlight)
Definition: paint.c:206
static const struct @597 border_details[]
static void draw_space(ME_Context *c, ME_Run *run, int x, int y, BOOL selected, BOOL actually_draw, int ymin, int cy)
Definition: paint.c:287
static void get_selection_rect(ME_Context *c, ME_Run *run, int from, int to, int cy, RECT *r)
Definition: paint.c:337
void ME_UpdateScrollBar(ME_TextEditor *editor)
Definition: paint.c:1151
static void draw_text_with_style(ME_Context *c, ME_Run *run, int x, int y, int nSelFrom, int nSelTo, int ymin, int cy)
Definition: paint.c:386
void ME_Repaint(ME_TextEditor *editor)
Definition: paint.c:121
void scroll_h_abs(ME_TextEditor *editor, int x, BOOL notify)
Definition: paint.c:1121
void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now)
Definition: paint.c:132
int ME_twips2pointsX(const ME_Context *c, int x)
Definition: paint.c:171
static const COLORREF pen_colors[16]
Definition: paint.c:517
void ME_ScrollDown(ME_TextEditor *editor, int cy)
Definition: paint.c:1136
static void draw_paragraph(ME_Context *c, ME_Paragraph *para)
Definition: paint.c:935
static BOOL editor_opaque(ME_TextEditor *editor)
Definition: paint.c:28
static void draw_para_number(ME_Context *c, ME_Paragraph *para)
Definition: paint.c:916
static void draw_run(ME_Context *c, int x, int y, ME_Cursor *cursor)
Definition: paint.c:461
unsigned width
Definition: paint.c:502
void scroll_v_abs(ME_TextEditor *editor, int y, BOOL notify)
Definition: paint.c:1126
static void ME_DrawParaDecoration(ME_Context *c, ME_Paragraph *para, int y, RECT *bounds)
Definition: paint.c:556
static void draw_table_borders(ME_Context *c, ME_Paragraph *para)
Definition: paint.c:717
static void enable_show_scrollbar(ME_TextEditor *editor, INT bar, BOOL enable)
Definition: paint.c:1066
static int calc_y_offset(const ME_Context *c, ME_Style *style)
Definition: paint.c:188
static void draw_text(ME_Context *c, ME_Run *run, int x, int y, BOOL selected, RECT *sel_rect)
Definition: paint.c:348
static HPEN get_underline_pen(ME_Style *style, COLORREF color)
Definition: paint.c:237
static void set_scroll_range_pos(ME_TextEditor *editor, INT bar, SCROLLINFO *info, BOOL set_range, BOOL notify)
Definition: paint.c:1074
void ME_ScrollUp(ME_TextEditor *editor, int cy)
Definition: paint.c:1131
void scroll_abs(ME_TextEditor *editor, int x, int y, BOOL notify)
Definition: paint.c:1091
static void draw_underline(ME_Context *c, ME_Run *run, int x, int y, COLORREF color)
Definition: paint.c:264
#define DD(x)
void editor_ensure_visible(ME_TextEditor *editor, ME_Cursor *cursor)
Definition: paint.c:1210
unsigned dble
Definition: paint.c:502
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)
Definition: usp10.c:3616
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
Definition: typeof.h:78
#define assert(x)
Definition: debug.h:53
#define pt(x, y)
Definition: drawing.c:79
#define RGB(r, g, b)
Definition: precomp.h:71
int align(int length, int align)
Definition: dsound8.c:36
#define ITextHost_TxShowScrollBar(This, a, b)
Definition: editor.h:334
#define ITextHost_TxSetScrollRange(This, a, b, c, d)
Definition: editor.h:336
ME_Row * para_first_row(ME_Paragraph *para)
Definition: para.c:132
ME_Cell * table_row_end_cell(ME_Paragraph *para)
Definition: table.c:178
int ME_PointFromCharContext(ME_Context *c, ME_Run *pRun, int nOffset, BOOL visual_order)
Definition: run.c:613
#define ITextHost_TxInvalidateRect(This, a, b)
Definition: editor.h:338
ME_Paragraph * cell_first_para(ME_Cell *cell)
Definition: table.c:202
ME_Cell * cell_next(ME_Cell *cell)
Definition: table.c:192
void ME_DestroyString(ME_String *s)
Definition: string.c:96
int run_char_ofs(ME_Run *run, int ofs)
Definition: run.c:233
ME_Row * row_from_cursor(ME_Cursor *cursor)
Definition: row.c:74
static ME_DisplayItem * para_get_di(ME_Paragraph *para)
Definition: editor.h:236
BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
Definition: wrap.c:1103
#define ITextHost_TxSetScrollPos(This, a, b, c)
Definition: editor.h:337
#define ITextHost_TxGetSysColor(This, a)
Definition: editor.h:357
#define ITextHost_TxNotify(This, a, b)
Definition: editor.h:367
void ME_SendRequestResize(ME_TextEditor *editor, BOOL force)
Definition: wrap.c:1137
void draw_ole(ME_Context *c, int x, int y, ME_Run *run, BOOL selected)
Definition: richole.c:5785
ME_Cell * table_row_first_cell(ME_Paragraph *para)
Definition: table.c:170
ME_Cell * para_cell(ME_Paragraph *para)
Definition: para.c:127
ME_Paragraph * table_row_end(ME_Paragraph *para)
Definition: table.c:127
void editor_get_selection_paras(ME_TextEditor *editor, ME_Paragraph **para, ME_Paragraph **para_end)
Definition: para.c:848
#define ITextHost_TxViewChange(This, a)
Definition: editor.h:339
BOOL para_in_table(ME_Paragraph *para)
Definition: para.c:122
int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visual_order)
Definition: run.c:654
void editor_mark_rewrap_all(ME_TextEditor *editor)
Definition: para.c:235
void para_range_invalidate(ME_TextEditor *editor, ME_Paragraph *start_para, ME_Paragraph *last_para)
Definition: wrap.c:1111
#define ITextHost_TxEnableScrollBar(This, a, b)
Definition: editor.h:335
void select_style(ME_Context *c, ME_Style *s)
Definition: style.c:369
ME_Run * para_first_run(ME_Paragraph *para)
Definition: para.c:104
ME_Paragraph * para_prev(ME_Paragraph *para)
Definition: para.c:63
ME_String * ME_MakeStringR(WCHAR cRepeat, int nMaxChars)
Definition: string.c:85
ME_Paragraph * cell_end_para(ME_Cell *cell)
Definition: table.c:207
#define ITextHost_TxScrollWindowEx(This, a, b, c, d, e, f, g)
Definition: editor.h:345
static WCHAR * get_text(const ME_Run *run, int offset)
Definition: editor.h:41
ME_Paragraph * para_next(ME_Paragraph *para)
Definition: para.c:57
#define MERF_TAB
Definition: editstr.h:105
#define MERF_ENDPARA
Definition: editstr.h:120
#define MERF_HIDDEN
Definition: editstr.h:124
#define MERF_ENDCELL
Definition: editstr.h:107
#define MERF_GRAPHICS
Definition: editstr.h:103
#define MEPF_ROWSTART
Definition: editstr.h:142
#define MEPF_ROWEND
Definition: editstr.h:143
#define MEPF_COMPLEX
Definition: editstr.h:144
@ diStartRow
Definition: editstr.h:86
@ diRun
Definition: editstr.h:85
@ diParagraph
Definition: editstr.h:83
void bar()
Definition: ehthrow.cxx:142
#define abs(i)
Definition: fconv.c:206
unsigned int BOOL
Definition: ntddk_ex.h:94
pKey DeleteObject()
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLint GLint GLsizei width
Definition: gl.h:1546
GLuint color
Definition: glext.h:6243
const GLubyte * c
Definition: glext.h:8905
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLint GLint bottom
Definition: glext.h:7726
GLfloat GLfloat p
Definition: glext.h:8902
GLboolean enable
Definition: glext.h:11120
GLenum GLsizei len
Definition: glext.h:6722
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
Definition: glfuncs.h:248
const char cursor[]
Definition: icontest.c:13
#define c
Definition: ke_i.h:80
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
#define min(a, b)
Definition: monoChain.cc:55
int notify
Definition: msacm.c:1366
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
#define L(x)
Definition: ntvdm.h:50
#define ES_AUTOVSCROLL
Definition: pedump.c:671
#define WS_VSCROLL
Definition: pedump.c:627
#define ES_AUTOHSCROLL
Definition: pedump.c:672
long LONG
Definition: pedump.c:60
#define WS_HSCROLL
Definition: pedump.c:628
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
static unsigned __int64 next
Definition: rand_nt.c:6
#define PFM_SPACEBEFORE
Definition: richedit.h:847
#define ENM_CHANGE
Definition: richedit.h:468
#define CFU_UNDERLINEDOUBLE
Definition: richedit.h:430
#define ENM_SCROLL
Definition: richedit.h:470
#define CFE_AUTOCOLOR
Definition: richedit.h:414
#define CFU_UNDERLINEWORD
Definition: richedit.h:429
#define CFM_OFFSET
Definition: richedit.h:359
#define CFE_SUPERSCRIPT
Definition: richedit.h:413
#define CFM_SUBSCRIPT
Definition: richedit.h:348
#define CFE_UNDERLINE
Definition: richedit.h:408
#define CFM_BACKCOLOR
Definition: richedit.h:357
#define CFE_SUBSCRIPT
Definition: richedit.h:412
#define PFM_TABLE
Definition: richedit.h:870
#define ES_DISABLENOSCROLL
Definition: richedit.h:224
#define CFU_UNDERLINE
Definition: richedit.h:428
#define CFE_LINK
Definition: richedit.h:411
#define CFM_LINK
Definition: richedit.h:337
#define PFE_TABLE
Definition: richedit.h:944
#define PFM_BORDER
Definition: richedit.h:851
#define CFE_AUTOBACKCOLOR
Definition: richedit.h:425
#define CFU_CF1UNDERLINE
Definition: richedit.h:447
#define CFU_UNDERLINENONE
Definition: richedit.h:427
#define PFM_SPACEAFTER
Definition: richedit.h:848
#define CFU_UNDERLINEDOTTED
Definition: richedit.h:431
#define CFM_COLOR
Definition: richedit.h:361
#define CFM_SUPERSCRIPT
Definition: richedit.h:349
static FILE * client
Definition: client.c:41
#define TRACE(s)
Definition: solgame.cpp:4
CardRegion * from
Definition: spigame.cpp:19
& rect
Definition: startmenu.cpp:1413
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
DWORD dwMask
Definition: richedit.h:306
DWORD dwEffects
Definition: richedit.h:307
LONG dySpaceBefore
Definition: richedit.h:676
DWORD dwMask
Definition: richedit.h:667
LONG dySpaceAfter
Definition: richedit.h:676
LONG dxOffset
Definition: richedit.h:672
WORD wBorders
Definition: richedit.h:681
LONG rgxTabs[MAX_TAB_STOPS]
Definition: richedit.h:675
WORD wNumbering
Definition: richedit.h:668
SHORT cTabCount
Definition: richedit.h:674
WORD wEffects
Definition: richedit.h:669
LONG dxStartIndent
Definition: richedit.h:670
UINT lbStyle
Definition: wingdi.h:1747
ULONG_PTR lbHatch
Definition: wingdi.h:1749
COLORREF lbColor
Definition: wingdi.h:1748
ME_Border bottom
Definition: editstr.h:190
ME_Border right
Definition: editstr.h:191
ME_Border left
Definition: editstr.h:189
ME_Border top
Definition: editstr.h:188
COLORREF colorRef
Definition: editstr.h:183
POINT pt
Definition: editstr.h:226
int nHeight
Definition: editstr.h:227
ME_BorderRect border
Definition: editstr.h:225
int yTextOffset
Definition: editstr.h:228
int nWidth
Definition: editstr.h:227
struct para_num para_num
Definition: editstr.h:215
ME_BorderRect border
Definition: editstr.h:208
PARAFORMAT2 fmt
Definition: editstr.h:204
int nHeight
Definition: editstr.h:234
int num_glyphs
Definition: editstr.h:171
POINT pt
Definition: editstr.h:167
GOFFSET * offsets
Definition: editstr.h:175
struct tagME_Paragraph * para
Definition: editstr.h:161
int * advances
Definition: editstr.h:174
WORD * glyphs
Definition: editstr.h:172
ME_Style * style
Definition: editstr.h:160
SCRIPT_ANALYSIS script_analysis
Definition: editstr.h:170
int nWidth
Definition: editstr.h:164
int nFlags
Definition: editstr.h:165
int len
Definition: editstr.h:163
WCHAR * szData
Definition: editstr.h:54
CHARFORMAT2W fmt
Definition: editstr.h:71
SCRIPT_CACHE script_cache
Definition: editstr.h:76
unsigned int horz_sb_enabled
Definition: editstr.h:451
int nZoomNumerator
Definition: editstr.h:421
unsigned int vert_sb_enabled
Definition: editstr.h:450
SCROLLINFO vert_si
Definition: editstr.h:449
ME_Paragraph * last_sel_end_para
Definition: editstr.h:419
int nLastTotalWidth
Definition: editstr.h:405
DWORD scrollbars
Definition: editstr.h:401
ITextHost2 * texthost
Definition: editstr.h:391
TXTBACKSTYLE back_style
Definition: editstr.h:457
DWORD freeze_count
Definition: editstr.h:437
ME_Paragraph * last_sel_start_para
Definition: editstr.h:419
ME_Cursor * pCursors
Definition: editstr.h:396
LONG nLastSelEnd
Definition: editstr.h:418
SCROLLINFO horz_si
Definition: editstr.h:449
int nZoomDenominator
Definition: editstr.h:421
LONG nLastSelStart
Definition: editstr.h:418
unsigned int in_place_active
Definition: editstr.h:393
int nLastTotalLength
Definition: editstr.h:404
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define max(a, b)
Definition: svc.c:63
#define TXTBIT_MULTILINE
Definition: textserv.h:186
@ TXTBACK_TRANSPARENT
Definition: textserv.h:164
#define TXTBIT_HIDESELECTION
Definition: textserv.h:190
int32_t INT
Definition: typedefs.h:58
DWORD COLORREF
Definition: windef.h:300
#define PS_DASH
Definition: wingdi.h:587
HGDIOBJ WINAPI GetStockObject(_In_ int)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
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)
#define LTGRAY_BRUSH
Definition: wingdi.h:900
#define RGN_DIFF
Definition: wingdi.h:358
#define PS_DOT
Definition: wingdi.h:588
UINT WINAPI SetTextAlign(_In_ HDC, _In_ UINT)
Definition: text.c:882
BOOL WINAPI RectVisible(_In_ HDC, _In_ LPCRECT)
int WINAPI IntersectClipRect(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define TA_LEFT
Definition: wingdi.h:932
#define PS_GEOMETRIC
Definition: wingdi.h:583
int WINAPI GetClipRgn(_In_ HDC, _In_ HRGN)
#define TRANSPARENT
Definition: wingdi.h:950
#define RGN_COPY
Definition: wingdi.h:357
#define RGN_AND
Definition: wingdi.h:356
#define PATCOPY
Definition: wingdi.h:335
#define DSTINVERT
Definition: wingdi.h:327
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)
#define ETO_OPAQUE
Definition: wingdi.h:647
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
#define TA_TOP
Definition: wingdi.h:930
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
#define TA_BASELINE
Definition: wingdi.h:928
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:917
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)
#define PS_JOIN_MITER
Definition: wingdi.h:598
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
#define BS_SOLID
Definition: wingdi.h:1086
#define PS_SOLID
Definition: wingdi.h:586
int WINAPI ExtSelectClipRgn(_In_ HDC, _In_opt_ HRGN, _In_ int)
#define PS_ENDCAP_FLAT
Definition: wingdi.h:596
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)
#define COLOR_GRAYTEXT
Definition: winuser.h:943
#define COLOR_WINDOW
Definition: winuser.h:929
#define COLOR_WINDOWTEXT
Definition: winuser.h:932
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define COLOR_HIGHLIGHT
Definition: winuser.h:937
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define SB_VERT
Definition: winuser.h:553
#define ESB_DISABLE_BOTH
Definition: winuser.h:556
#define SW_INVALIDATE
Definition: winuser.h:2598
#define EN_HSCROLL
Definition: winuser.h:2043
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:938
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define EN_VSCROLL
Definition: winuser.h:2048
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define SB_HORZ
Definition: winuser.h:552
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define EN_CHANGE
Definition: winuser.h:2041
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185