46 #define WIN32_LEAN_AND_MEAN 53 #define BUFLIMIT_INITIAL 30000 55 #define ROUND_TO_GROW(size) (((size) + (GROWLENGTH - 1)) & ~(GROWLENGTH - 1)) 56 #define HSCROLL_FRACTION 3 61 #define EF_MODIFIED 0x0001 62 #define EF_FOCUSED 0x0002 63 #define EF_UPDATE 0x0004 64 #define EF_VSCROLL_TRACK 0x0008 65 #define EF_HSCROLL_TRACK 0x0010 66 #define EF_AFTER_WRAP 0x0080 68 #define EF_USE_SOFTBRK 0x0100 69 #define EF_DIALOGMODE 0x0200 104 INT undo_insert_count;
107 UINT undo_buffer_size;
128 INT wheelDeltaRemainder;
143 UINT composition_len;
144 int composition_start;
153 #define SWAP_UINT32(x,y) do { UINT temp = (UINT)(x); (x) = (UINT)(y); (y) = temp; } while(0) 154 #define ORDER_UINT(x,y) do { if ((UINT)(y) < (UINT)(x)) SWAP_UINT32((x),(y)); } while(0) 157 #define EDIT_NOTIFY_PARENT(es, wNotifyCode) \ 160 TRACE("notification " #wNotifyCode " sent to hwnd=%p\n", es->hwndParent); \ 161 SendMessageW(es->hwndParent, WM_COMMAND, \ 162 MAKEWPARAM(GetWindowLongPtrW((es->hwndSelf),GWLP_ID), wNotifyCode), \ 163 (LPARAM)(es->hwndSelf)); \ 176 return (
es->undo_insert_count ||
strlenW(
es->undo_text));
187 es->undo_insert_count = 0;
188 *
es->undo_text =
'\0';
213 DWORD dwEmulatedVersion;
222 version = dwProcVersion < dwEmulatedVersion ? dwProcVersion : dwEmulatedVersion;
252 if(
es->text_length == (
UINT)-1)
254 return es->text_length;
308 ERR(
"unknown action code, please report !\n");
332 if (
es->word_break_proc)
338 TRACE_(relay)(
"(UNICODE wordbrk=%p,str=%s,idx=%d,cnt=%d,act=%d)\n",
355 TRACE_(relay)(
"(ANSI wordbrk=%p,str=%s,idx=%d,cnt=%d,act=%d)\n",
382 line_def = line_def->
next;
425 WARN(
"ScriptStringAnalyse failed (%x)\n",
hr);
435 return line_def->
ssa;
458 ScriptStringAnalyse(udc, &
es->password_char,
length, (3*
length/2+16), -1,
SSA_LINK|
SSA_FALLBACK|
SSA_GLYPHS|
SSA_PASSWORD, -1,
NULL,
NULL,
NULL,
NULL,
NULL, &
es->ssa);
460 ScriptStringAnalyse(udc, &
es->password_char,
length, (1.5*
length+16), -1,
SSA_LINK|
SSA_FALLBACK|
SSA_GLYPHS|
SSA_PASSWORD, -1,
NULL,
NULL,
NULL,
NULL,
NULL, &
es->ssa);
465 ScriptStringAnalyse(udc,
es->text,
length, (3*
length/2+16), -1,
SSA_LINK|
SSA_FALLBACK|
SSA_GLYPHS, -1,
NULL,
NULL,
NULL,
NULL,
NULL, &
es->ssa);
467 ScriptStringAnalyse(udc,
es->text,
length, (1.5*
length+16), -1,
SSA_LINK|
SSA_FALLBACK|
SSA_GLYPHS, -1,
NULL,
NULL,
NULL,
NULL,
NULL, &
es->ssa);
479 line_def =
es->first_line_def;
480 while (line_def &&
line)
482 line_def = line_def->
next;
492 INT vlc = (
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
512 INT line_index = 0, nstart_line, nstart_index;
513 INT line_count =
es->line_count;
518 if (istart == iend && delta == 0)
521 previous_line =
NULL;
522 current_line =
es->first_line_def;
527 if (istart < current_line->
index + current_line->
length ||
531 previous_line = current_line;
532 current_line = current_line->
next;
534 }
while (current_line);
538 FIXME(
" modification occurred outside buffer\n");
543 nstart_line = line_index;
544 nstart_index = current_line->
index;
551 current_line = previous_line;
553 start_line = current_line;
555 fw =
es->format_rect.right -
es->format_rect.left;
556 current_position =
es->text + current_line->
index;
559 if (current_line != start_line)
561 if (!current_line || current_line->
index + delta > current_position -
es->text)
568 if (new_line ==
NULL)
571 new_line->
next = previous_line->
next;
572 previous_line->
next = new_line;
573 current_line = new_line;
576 else if (current_line->
index + delta < current_position - es->
text)
579 previous_line->
next = current_line->
next;
581 current_line = previous_line->
next;
587 if (current_position -
es->text > iend)
593 current_line->
index = current_position -
es->text;
597 cp = current_position;
599 if (*
cp ==
'\n')
break;
600 if ((*
cp ==
'\r') && (*(
cp + 1) ==
'\n'))
609 }
else if ((
cp > current_position) && (*(
cp - 1) ==
'\r')) {
612 }
else if (*
cp ==
'\n') {
625 if (current_line->
ssa)
633 else current_line->
width = 0;
640 if (current_line->
width > fw && fw >
es->char_width) {
650 if (
d > 1.2
f)
d -= 0.2f;
659 if (current_line->
ssa)
667 }
while (prev && current_line->
width > fw);
677 if (current_line->
ssa)
685 current_line->
width -= piDx[prev];
687 }
while ( prev > 0 && current_line->
width > fw);
693 prev = (fw /
es->char_width);
698 if (current_line->
index == nstart_index && istart > current_line->
index + prev)
699 istart = current_line->
index + prev;
702 else if (current_line == start_line &&
703 current_line->
index != nstart_index && orig_net_length < prev)
707 nstart_line = line_index;
708 nstart_index = current_line->
index;
709 istart = current_line->
index + orig_net_length;
718 if (current_line->
ssa)
724 current_line->
width = 0;
726 else current_line->
width = 0;
728 else if (current_line == start_line &&
729 current_line->
index != nstart_index &&
734 nstart_line = line_index;
735 nstart_index = current_line->
index;
736 istart = current_line->
index + orig_net_length;
742 switch (current_line->
ending) {
757 es->text_width =
max(
es->text_width, current_line->
width);
758 current_position += current_line->
length;
759 previous_line = current_line;
762 if ((line_index < es->y_offset) || (line_index >
es->y_offset + vlc))
765 current_line = current_line->
next;
777 pnext = current_line->
next;
780 current_line = pnext;
788 current_line->
index += delta;
789 current_line = current_line->
next;
802 rc.
top =
es->format_rect.top + nstart_line *
es->line_height -
803 (
es->y_offset *
es->line_height);
806 rc.
left =
es->format_rect.left;
813 rc.
right =
es->format_rect.right;
817 rc.
left =
es->format_rect.left;
818 rc.
right =
es->format_rect.right;
823 if (line_count < es->line_count)
825 else if (line_count >
es->line_count)
826 rc.
bottom = line_count *
es->line_height;
828 rc.
bottom = line_index *
es->line_height;
830 rc.
bottom -= (
es->y_offset *
es->line_height);
849 es->text_width =
size->cx;
871 INT line = (
y -
es->format_rect.top) /
es->line_height +
es->y_offset;
875 while ((
line > 0) && line_def->next) {
876 line_index += line_def->length;
877 line_def = line_def->next;
881 x +=
es->x_offset -
es->format_rect.left;
883 x -= (
es->format_rect.right -
es->format_rect.left) - line_def->width;
885 x -= ((
es->format_rect.right -
es->format_rect.left) - line_def->width) / 2;
886 if (
x >= line_def->width) {
888 *after_wrap = (line_def->ending ==
END_WRAP);
889 return line_index + line_def->net_length;
898 if (trailing)
index++;
901 *after_wrap = ((
index == line_index + line_def->net_length) &&
908 x -=
es->format_rect.left;
914 INT indent = (
es->format_rect.right -
es->format_rect.left) -
es->text_width;
939 if (
x + xoff > 0 || !
es->ssa)
942 if (trailing)
index++;
956 else if (
x >
size->cx)
961 if (trailing)
index++;
984 *
x =
min(
max(*
x,
es->format_rect.left),
es->format_rect.right - 1);
985 *
y =
min(
max(*
y,
es->format_rect.top),
es->format_rect.bottom - 1);
1002 return es->line_count - 1;
1007 line_def =
es->first_line_def;
1009 while ((
index >= 0) && line_def->
next) {
1011 line_def = line_def->
next;
1030 if (
line >=
es->line_count)
1034 line_def =
es->first_line_def;
1037 while ((
index >= 0) && line_def->
next) {
1038 line_index += line_def->
length;
1039 line_def = line_def->
next;
1044 line_index += line_def->
length;
1045 line_def = line_def->
next;
1079 line_def =
es->first_line_def;
1081 while ((
index >= 0) && line_def->
next) {
1082 line_def = line_def->
next;
1110 y = (
l -
es->y_offset) *
es->line_height;
1112 if (after_wrap && (
li ==
index) &&
l) {
1114 line_def =
es->first_line_def;
1116 line_def = line_def->
next;
1121 y -=
es->line_height;
1126 line_def =
es->first_line_def;
1128 line_def = line_def->
next;
1130 lw = line_def->
width;
1131 w =
es->format_rect.right -
es->format_rect.left;
1139 x = (lw > 0 ?
es->x_offset :
x -
es->x_offset);
1167 xoff +=
es->char_width * leftover;
1198 w =
es->format_rect.right -
es->format_rect.left;
1199 if (
w >
es->text_width)
1202 x +=
w -
es->text_width;
1204 x += (
w -
es->text_width) / 2;
1210 x +=
es->format_rect.left;
1211 y +=
es->format_rect.top;
1233 rc->
top =
es->format_rect.top + (
line -
es->y_offset) *
es->line_height;
1237 line_def =
es->first_line_def;
1240 while ((
index >= 0) && line_def->
next) {
1241 line_index += line_def->
length;
1242 line_def = line_def->
next;
1247 line_index += line_def->
length;
1248 line_def = line_def->
next;
1257 rc->
top =
es->format_rect.top;
1267 pt3+=
es->format_rect.left;
1277 es->text_length = (
UINT)-1;
1290 if (
es->hlocapp)
return;
1303 TRACE(
"Synchronizing with 32-bit ANSI buffer\n");
1309 ERR(
"no buffer ... please report\n");
1316 if(!
es->hloc32W)
return;
1324 if(countW_new >
es->buffer_size + 1)
1327 TRACE(
"Resizing 32-bit UNICODE buffer from %d+1 to %d WCHARs\n",
es->buffer_size, countW_new);
1331 es->hloc32W = hloc32W_new;
1333 TRACE(
"Real new size %d+1 WCHARs\n",
es->buffer_size);
1336 WARN(
"FAILED! Will synchronize partially\n");
1355 if (
es->hlocapp)
return;
1360 WARN(
"edit hwnd %p already destroyed\n",
es->hwndSelf);
1364 if (!
es->lock_count) {
1365 ERR(
"lock_count == 0 ... please report\n");
1369 ERR(
"es->text == 0 ... please report\n");
1373 if (force || (
es->lock_count == 1)) {
1381 TRACE(
"Synchronizing with 32-bit ANSI buffer\n");
1382 TRACE(
"%d WCHARs translated to %d bytes\n", countW, countA_new);
1384 if(countA_new > countA)
1388 TRACE(
"Resizing 32-bit ANSI buffer from %d to %d bytes\n", countA, alloc_size);
1392 es->hloc32A = hloc32A_new;
1394 TRACE(
"Real new size %d bytes\n", countA);
1397 WARN(
"FAILED! Will synchronize partially\n");
1408 ERR(
"no buffer ... please report\n");
1429 TRACE(
"trying to ReAlloc to %d+1 characters\n",
size);
1437 TRACE(
"Old 32 bit handle %p, new handle %p\n",
es->hloc32W, hNew32W);
1438 es->hloc32W = hNew32W;
1445 if (
es->buffer_size <
size) {
1446 WARN(
"FAILED ! We now have %d+1\n",
es->buffer_size);
1450 TRACE(
"We now have %d+1\n",
es->buffer_size);
1470 TRACE(
"trying to ReAlloc to %d+1\n",
size);
1474 es->undo_buffer_size = alloc_size/
sizeof(
WCHAR) - 1;
1479 WARN(
"FAILED ! We now have %d+1\n",
es->undo_buffer_size);
1553 if ((el < es->y_offset) || (sl >
es->y_offset + vlc))
1558 if (sl < es->y_offset) {
1562 if (el >
es->y_offset + vlc) {
1563 el =
es->y_offset + vlc;
1579 for (
l = sl + 1 ;
l < el ;
l++) {
1637 UINT old_start =
es->selection_start;
1638 UINT old_end =
es->selection_end;
1643 end =
es->selection_end;
1649 es->selection_end =
end;
1671 if (
end != old_start)
1681 if (old_start >
end )
1709 si.
nMax =
es->line_count - 1;
1710 si.
nPage = (
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
1712 TRACE(
"SB_VERT, nMin=%d, nMax=%d, nPage=%d, nPos=%d\n",
1723 si.
nMax =
es->text_width - 1;
1724 si.
nPage =
es->format_rect.right -
es->format_rect.left;
1726 TRACE(
"SB_HORZ, nMin=%d, nMax=%d, nPage=%d, nPos=%d\n",
1745 INT x_offset_in_pixels;
1746 INT lines_per_page = (
es->format_rect.bottom -
es->format_rect.top) /
1751 x_offset_in_pixels =
es->x_offset;
1759 if (-
dx > x_offset_in_pixels)
1760 dx = -x_offset_in_pixels;
1761 if (
dx >
es->text_width - x_offset_in_pixels)
1762 dx =
es->text_width - x_offset_in_pixels;
1763 nyoff =
max(0,
es->y_offset +
dy);
1764 if (nyoff >=
es->line_count - lines_per_page)
1765 nyoff =
max(0,
es->line_count - lines_per_page);
1766 dy = (
es->y_offset - nyoff) *
es->line_height;
1771 es->y_offset = nyoff;
1775 es->x_offset +=
dx /
es->char_width;
1803 dx *=
es->char_width;
1828 if (
es->y_offset <
es->line_count - 1)
1833 dy = -(
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
1836 if (
es->y_offset <
es->line_count - 1)
1837 dy = (
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
1845 if(
es->y_offset +
dy >
es->line_count - vlc)
1846 dy =
max(
es->line_count - vlc, 0) -
es->y_offset;
1884 INT cw =
es->char_width;
1892 if (
l >=
es->y_offset + vlc)
1893 dy =
l - vlc + 1 -
es->y_offset;
1894 if (l < es->y_offset)
1895 dy =
l -
es->y_offset;
1896 ww =
es->format_rect.right -
es->format_rect.left;
1899 if (
x >
es->format_rect.right)
1901 if (
dy ||
dx || (
es->y_offset && (
es->line_count -
es->y_offset < vlc)))
1904 if(
es->x_offset +
dx + ww >
es->text_width)
1905 dx =
es->text_width - ww -
es->x_offset;
1906 if(
dx ||
dy || (
es->y_offset && (
es->line_count -
es->y_offset < vlc)))
1915 format_width =
es->format_rect.right -
es->format_rect.left;
1921 }
while ((
x < goal) &&
es->x_offset);
1924 }
else if (
x >
es->format_rect.right) {
1932 }
while ((
x > goal) && (x_last >
es->format_rect.right));
1950 INT e =
es->selection_end;
1955 (
es->text[
e - 1] ==
'\r') && (
es->text[
e] ==
'\n')) {
1957 if (
e && (
es->text[
e - 1] ==
'\r'))
1977 INT s =
es->selection_start;
1978 INT e =
es->selection_end;
2020 INT e =
es->selection_end;
2025 if (
es->text[
e] ==
'\n')
2027 else if ((
es->text[
e] ==
'\r') && (
es->text[
e + 1] ==
'\n'))
2069 INT s =
es->selection_start;
2070 INT e =
es->selection_end;
2077 y + (
es->format_rect.bottom -
es->format_rect.top),
2097 INT s =
es->selection_start;
2098 INT e =
es->selection_end;
2105 y - (
es->format_rect.bottom -
es->format_rect.top),
2125 INT s =
es->selection_start;
2126 INT e =
es->selection_end;
2147 INT s =
es->selection_start;
2148 INT e =
es->selection_end;
2178 INT s =
es->selection_start;
2179 INT e =
es->selection_end;
2211 HFONT hUnderline = 0;
2224 if (
es->composition_len == 0)
2242 es->tabs_count,
es->tabs,
es->format_rect.left -
es->x_offset));
2249 if (
es->composition_len == 0)
2300 int line_idx =
line;
2307 while (line_def && line_idx)
2309 line_def = line_def->
next;
2312 w =
es->format_rect.right -
es->format_rect.left;
2313 lw = line_def->
width;
2320 x +=
es->format_rect.left;
2327 s =
min(
es->selection_start,
es->selection_end);
2328 e =
max(
es->selection_start,
es->selection_end);
2335 else if (
rev && (
s !=
e) &&
2357 es->format_rect.right =
max(
es->format_rect.right,
es->format_rect.left +
es->char_width);
2360 INT fw, vlc, max_x_offset, max_y_offset;
2363 es->format_rect.bottom =
es->format_rect.top + vlc *
es->line_height;
2366 fw =
es->format_rect.right -
es->format_rect.left;
2367 max_x_offset =
es->text_width - fw;
2368 if(max_x_offset < 0) max_x_offset = 0;
2369 if(
es->x_offset > max_x_offset)
2370 es->x_offset = max_x_offset;
2373 max_y_offset =
es->line_count - vlc;
2374 if(max_y_offset < 0) max_y_offset = 0;
2375 if(
es->y_offset > max_y_offset)
2376 es->y_offset = max_y_offset;
2383 es->format_rect.bottom =
es->format_rect.top +
es->line_height;
2387 es->format_rect.bottom =
min(
es->format_rect.bottom, ClientRect.
bottom);
2413 es->format_rect.left++;
2414 es->format_rect.right--;
2416 if (
es->format_rect.bottom -
es->format_rect.top
2417 >=
es->line_height + 2)
2419 es->format_rect.top++;
2420 es->format_rect.bottom--;
2426 es->format_rect.left +=
bw;
2427 es->format_rect.right -=
bw;
2428 if (
es->format_rect.bottom -
es->format_rect.top
2429 >=
es->line_height + 2 * bh)
2431 es->format_rect.top += bh;
2432 es->format_rect.bottom -= bh;
2436 es->format_rect.left +=
es->left_margin;
2437 es->format_rect.right -=
es->right_margin;
2486 FIXME(
"soft break enabled, not implemented\n");
2511 hLocal =
es->hloc32W;
2517 UINT countA, alloc_size;
2518 TRACE(
"Allocating 32-bit ANSI alias buffer\n");
2523 ERR(
"Could not allocate %d bytes for 32-bit ANSI alias buffer\n", alloc_size);
2530 hLocal =
es->hloc32A;
2536 es->hlocapp = hLocal;
2538 TRACE(
"Returning %p, LocalSize() = %ld\n", hLocal,
LocalSize(hLocal));
2551 INT line_len, dst_len;
2555 if (
line >=
es->line_count)
2565 if(dst_len <= line_len)
2580 if(!
ret && line_len)
2629 TRACE(
"%s, can_undo %d, send_update %d\n",
2630 debugstr_w(lpsz_replace), can_undo, send_update);
2632 s =
es->selection_start;
2633 e =
es->selection_end;
2636 if ((
s ==
e) && !strl)
2641 size = tl - (
e -
s) + strl;
2647 if ((honor_limit) && (
size >
es->buffer_limit)) {
2650 if (
es->buffer_limit < (tl - (
e-
s)))
2653 strl =
min(strl,
es->buffer_limit - (tl - (
e-
s)));
2661 TRACE(
"deleting stuff.\n");
2675 for (
p =
es->text + tl ;
p >=
es->text +
s ;
p--)
2677 for (
i = 0 ,
p =
es->text +
s ;
i < strl ;
i++)
2678 p[
i] = lpsz_replace[
i];
2687 INT st =
min(
es->selection_start,
es->selection_end);
2692 strl -
abs(
es->selection_end -
es->selection_start),
hrgn);
2698 for (
i = 0 ,
p =
es->text ;
i <
e -
s ;
i++)
2702 abs(
es->selection_end -
es->selection_start) - strl,
hrgn);
2710 INT fw =
es->format_rect.right -
es->format_rect.left;
2715 while ((
es->text_width > fw) &&
s + strl >=
s) {
2718 es->text_length = -1;
2730 if (!
es->undo_insert_count && (*
es->undo_text && (
s ==
es->undo_position))) {
2734 (
es->undo_text + utl)[
e -
s] = 0;
2735 }
else if (!
es->undo_insert_count && (*
es->undo_text && (
e ==
es->undo_position))) {
2738 for (
p =
es->undo_text + utl ;
p >=
es->undo_text ;
p--)
2740 for (
i = 0 ,
p =
es->undo_text ;
i <
e -
s ;
i++)
2742 es->undo_position =
s;
2747 es->undo_text[
e -
s] = 0;
2748 es->undo_position =
s;
2751 es->undo_insert_count = 0;
2757 if ((
s ==
es->undo_position) ||
2758 ((
es->undo_insert_count) &&
2759 (
s ==
es->undo_position +
es->undo_insert_count)))
2764 es->undo_insert_count += strl;
2767 es->undo_position =
s;
2768 es->undo_insert_count = strl;
2770 *
es->undo_text =
'\0';
2783 INT delta = strl -
abs(
es->selection_end -
es->selection_start);
2785 if (delta < 0 && es->x_offset)
2787 if (
abs(delta) >
es->x_offset)
2790 es->x_offset += delta;
2833 WARN(
"called with NULL handle\n");
2860 ERR(
"Could not allocate new unicode buffer\n");
2871 es->hloc32W = hloc32W_new;
2883 es->x_offset =
es->y_offset = 0;
2884 es->selection_start =
es->selection_end = 0;
2943 INT default_left_margin = 0;
2944 INT default_right_margin = 0;
2956 default_left_margin =
width / 2;
2957 default_right_margin =
width / 2;
2962 default_left_margin =
es->left_margin;
2963 default_right_margin =
es->right_margin;
2967 default_left_margin =
width / 2;
2968 default_right_margin =
width / 2;
2976 es->format_rect.left -=
es->left_margin;
2980 es->left_margin = default_left_margin;
2981 es->format_rect.left +=
es->left_margin;
2985 es->format_rect.right +=
es->right_margin;
2989 es->right_margin = default_right_margin;
2990 es->format_rect.right -=
es->right_margin;
2998 TRACE(
"left=%d, right=%d\n",
es->left_margin,
es->right_margin);
3014 if (
es->password_char ==
c)
3018 es->password_char =
c;
3068 if (
es->word_break_proc == wbp)
3071 es->word_break_proc = wbp;
3106 TRACE(
"before UNDO:insertion length = %d, deletion buffer = %s\n",
3118 TRACE(
"after UNDO:insertion length = %d, deletion buffer = %s\n",
3172 INT s =
min(
es->selection_start,
es->selection_end);
3173 INT e =
max(
es->selection_start,
es->selection_end);
3247 static const WCHAR cr_lfW[] = {
'\r',
'\n',0};
3255 static const WCHAR tabW[] = {
'\t',0};
3263 if (
es->selection_start !=
es->selection_end)
3334 ERR(
"unknown menu item, please report\n");
3379 if (
x == -1 &&
y == -1)
3388 WIN_GetRectangles(
es->hwndSelf, COORDS_SCREEN,
NULL, &rc );
3390 x = rc.left + (rc.right - rc.left) / 2;
3391 y = rc.top + (rc.bottom - rc.top) / 2;
3414 if(!
count)
return 0;
3437 HWND hLBox =
es->hwndListBox;
3449 TRACE_(combo)(
"[%p]: handling msg %x (%x)\n",
es->hwndSelf,
msg,
key);
3556 if (
es->selection_start !=
es->selection_end) {
3567 }
else if (control) {
3621 FIXME(
"Ctrl+Backspace\n");
3647 es->wheelDeltaRemainder = 0;
3649 if (
es->hwndListBox ==
NULL)
3665 es->wheelDeltaRemainder = 0;
3681 INT e =
es->selection_end;
3686 es->bCaptureState =
TRUE;
3696 es->region_posx =
es->region_posy = 0;
3712 es->bCaptureState =
TRUE;
3718 es->region_posx =
es->region_posy = 0;
3735 if (
es->bCaptureState) {
3779 es->region_posx = (prex <
x) ? -1 : ((prex >
x) ? 1 : 0);
3780 es->region_posy = (prey <
y) ? -1 : ((prey >
y) ? 1 : 0);
3848 es->format_rect.top,
3849 es->format_rect.right,
3850 es->format_rect.bottom);
3858 if (!
es->bEnableState)
3863 for (
i =
es->y_offset ;
i <=
min(
es->y_offset + vlc,
es->y_offset +
es->line_count - 1) ;
i++) {
3933 es->line_height =
tm.tmHeight;
3934 es->char_width =
tm.tmAveCharWidth;
3977 if (!unicode &&
text)
3989 ERR(
"SetSel may generate UPDATE message whose handler may reset " 4065 DWORD style_change_mask;
4075 new_style =
style->styleNew & style_change_mask;
4087 es->style = (
es->style & ~style_change_mask) | new_style;
4091 WARN (
"Invalid style change %ld\n",
which);
4104 if ((
key ==
VK_BACK) && (key_data & 0x2000)) {
4123 if (
es->region_posx < 0) {
4125 }
else if (
es->region_posx > 0) {
4151 fw =
es->format_rect.right -
es->format_rect.left;
4154 TRACE(
"SB_LINELEFT\n");
4156 dx = -
es->char_width;
4159 TRACE(
"SB_LINERIGHT\n");
4160 if (
es->x_offset <
es->text_width)
4161 dx =
es->char_width;
4164 TRACE(
"SB_PAGELEFT\n");
4169 TRACE(
"SB_PAGERIGHT\n");
4170 if (
es->x_offset <
es->text_width)
4179 TRACE(
"SB_RIGHT\n");
4180 if (
es->x_offset <
es->text_width)
4181 dx =
es->text_width -
es->x_offset;
<