52 #include "wine/unicode.h" 58 #define BUFLIMIT_INITIAL 30000 60 #define ROUND_TO_GROW(size) (((size) + (GROWLENGTH - 1)) & ~(GROWLENGTH - 1)) 61 #define HSCROLL_FRACTION 3 66 #define EF_MODIFIED 0x0001 67 #define EF_FOCUSED 0x0002 68 #define EF_UPDATE 0x0004 69 #define EF_VSCROLL_TRACK 0x0008 70 #define EF_HSCROLL_TRACK 0x0010 71 #define EF_AFTER_WRAP 0x0080 73 #define EF_USE_SOFTBRK 0x0100 74 #define EF_DIALOGMODE 0x0200 76 #define ID_CB_LISTBOX 1000 157 #define SWAP_UINT32(x,y) do { UINT temp = (UINT)(x); (x) = (UINT)(y); (y) = temp; } while(0) 158 #define ORDER_UINT(x,y) do { if ((UINT)(y) < (UINT)(x)) SWAP_UINT32((x),(y)); } while(0) 161 #define EDIT_NOTIFY_PARENT(es, wNotifyCode) \ 164 TRACE("notification " #wNotifyCode " sent to hwnd=%p\n", es->hwndParent); \ 165 SendMessageW(es->hwndParent, WM_COMMAND, \ 166 MAKEWPARAM(GetWindowLongPtrW((es->hwndSelf),GWLP_ID), wNotifyCode), \ 167 (LPARAM)(es->hwndSelf)); \ 179 return (
es->undo_insert_count ||
strlenW(
es->undo_text));
190 es->undo_insert_count = 0;
191 *
es->undo_text =
'\0';
214 if(
es->text_length == (
UINT)-1)
216 return es->text_length;
270 ERR(
"unknown action code, please report !\n");
294 if (
es->word_break_proc)
317 line_def = line_def->
next;
355 WARN(
"ScriptStringAnalyse failed (%x)\n",
hr);
365 return line_def->
ssa;
386 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);
388 ScriptStringAnalyse(udc,
es->text,
length, (1.5*
length+16), -1,
SSA_LINK|
SSA_FALLBACK|
SSA_GLYPHS, -1,
NULL,
NULL,
NULL,
NULL,
NULL, &
es->ssa);
399 line_def =
es->first_line_def;
400 while (line_def &&
line)
402 line_def = line_def->
next;
412 INT vlc = (
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
432 INT line_index = 0, nstart_line, nstart_index;
433 INT line_count =
es->line_count;
438 if (istart == iend && delta == 0)
441 previous_line =
NULL;
442 current_line =
es->first_line_def;
447 if (istart < current_line->
index + current_line->
length ||
451 previous_line = current_line;
452 current_line = current_line->
next;
454 }
while (current_line);
458 FIXME(
" modification occurred outside buffer\n");
463 nstart_line = line_index;
464 nstart_index = current_line->
index;
471 current_line = previous_line;
473 start_line = current_line;
475 fw =
es->format_rect.right -
es->format_rect.left;
476 current_position =
es->text + current_line->
index;
479 if (current_line != start_line)
481 if (!current_line || current_line->
index + delta > current_position -
es->text)
485 LINEDEF *new_line = heap_alloc_zero(
sizeof(*new_line));
486 new_line->
next = previous_line->
next;
487 previous_line->
next = new_line;
488 current_line = new_line;
491 else if (current_line->
index + delta < current_position - es->
text)
494 previous_line->
next = current_line->
next;
496 current_line = previous_line->
next;
502 if (current_position -
es->text > iend)
508 current_line->
index = current_position -
es->text;
512 cp = current_position;
514 if (*
cp ==
'\n')
break;
515 if ((*
cp ==
'\r') && (*(
cp + 1) ==
'\n'))
524 }
else if ((
cp > current_position) && (*(
cp - 1) ==
'\r')) {
527 }
else if (*
cp ==
'\n') {
540 if (current_line->
ssa)
548 else current_line->
width = 0;
555 if (current_line->
width > fw && fw >
es->char_width) {
565 if (
d > 1.2
f)
d -= 0.2f;
574 if (current_line->
ssa)
582 }
while (prev && current_line->
width > fw);
592 if (current_line->
ssa)
600 current_line->
width -= piDx[prev];
602 }
while ( prev > 0 && current_line->
width > fw);
608 prev = (fw /
es->char_width);
613 if (current_line->
index == nstart_index && istart > current_line->
index + prev)
614 istart = current_line->
index + prev;
617 else if (current_line == start_line &&
618 current_line->
index != nstart_index && orig_net_length < prev)
622 nstart_line = line_index;
623 nstart_index = current_line->
index;
624 istart = current_line->
index + orig_net_length;
633 if (current_line->
ssa)
639 current_line->
width = 0;
641 else current_line->
width = 0;
643 else if (current_line == start_line &&
644 current_line->
index != nstart_index &&
649 nstart_line = line_index;
650 nstart_index = current_line->
index;
651 istart = current_line->
index + orig_net_length;
657 switch (current_line->
ending) {
672 es->text_width =
max(
es->text_width, current_line->
width);
673 current_position += current_line->
length;
674 previous_line = current_line;
677 if ((line_index < es->y_offset) || (line_index >
es->y_offset + vlc))
680 current_line = current_line->
next;
692 pnext = current_line->
next;
695 current_line = pnext;
703 current_line->
index += delta;
704 current_line = current_line->
next;
717 rc.
top =
es->format_rect.top + nstart_line *
es->line_height -
718 (
es->y_offset *
es->line_height);
721 rc.
left =
es->format_rect.left;
728 rc.
right =
es->format_rect.right;
732 rc.
left =
es->format_rect.left;
733 rc.
right =
es->format_rect.right;
738 if (line_count < es->line_count)
740 else if (line_count >
es->line_count)
741 rc.
bottom = line_count *
es->line_height;
743 rc.
bottom = line_index *
es->line_height;
745 rc.
bottom -= (
es->y_offset *
es->line_height);
764 es->text_width =
size->cx;
786 INT line = (
y -
es->format_rect.top) /
es->line_height +
es->y_offset;
790 while ((
line > 0) && line_def->next) {
791 line_index += line_def->length;
792 line_def = line_def->next;
796 x +=
es->x_offset -
es->format_rect.left;
798 x -= (
es->format_rect.right -
es->format_rect.left) - line_def->width;
800 x -= ((
es->format_rect.right -
es->format_rect.left) - line_def->width) / 2;
801 if (
x >= line_def->width) {
803 *after_wrap = (line_def->ending ==
END_WRAP);
804 return line_index + line_def->net_length;
813 if (trailing)
index++;
816 *after_wrap = ((
index == line_index + line_def->net_length) &&
823 x -=
es->format_rect.left;
829 INT indent = (
es->format_rect.right -
es->format_rect.left) -
es->text_width;
854 if (
x + xoff > 0 || !
es->ssa)
857 if (trailing)
index++;
871 else if (
x >
size->cx)
876 if (trailing)
index++;
899 *
x =
min(
max(*
x,
es->format_rect.left),
es->format_rect.right - 1);
900 *
y =
min(
max(*
y,
es->format_rect.top),
es->format_rect.bottom - 1);
917 return es->line_count - 1;
922 line_def =
es->first_line_def;
926 line_def = line_def->
next;
945 if (
line >=
es->line_count)
949 line_def =
es->first_line_def;
953 line_index += line_def->
length;
954 line_def = line_def->
next;
959 line_index += line_def->
length;
960 line_def = line_def->
next;
994 line_def =
es->first_line_def;
997 line_def = line_def->
next;
1025 y = (
l -
es->y_offset) *
es->line_height;
1027 if (after_wrap && (li ==
index) &&
l) {
1029 line_def =
es->first_line_def;
1031 line_def = line_def->
next;
1036 y -=
es->line_height;
1041 line_def =
es->first_line_def;
1042 while (line_def->
index != li)
1043 line_def = line_def->
next;
1045 lw = line_def->
width;
1046 w =
es->format_rect.right -
es->format_rect.left;
1054 x = (lw > 0 ?
es->x_offset :
x -
es->x_offset);
1082 xoff +=
es->char_width * leftover;
1113 w =
es->format_rect.right -
es->format_rect.left;
1114 if (
w >
es->text_width)
1117 x +=
w -
es->text_width;
1119 x += (
w -
es->text_width) / 2;
1125 x +=
es->format_rect.left;
1126 y +=
es->format_rect.top;
1148 rc->
top =
es->format_rect.top + (
line -
es->y_offset) *
es->line_height;
1152 line_def =
es->first_line_def;
1155 while ((
index >= 0) && line_def->
next) {
1156 line_index += line_def->
length;
1157 line_def = line_def->
next;
1162 line_index += line_def->
length;
1163 line_def = line_def->
next;
1172 rc->
top =
es->format_rect.top;
1182 pt3+=
es->format_rect.left;
1192 es->text_length = (
UINT)-1;
1227 WARN(
"edit hwnd %p already destroyed\n",
es->hwndSelf);
1231 if (!
es->lock_count)
1233 ERR(
"lock_count == 0 ... please report\n");
1239 ERR(
"es->text == 0 ... please report\n");
1243 if (force || (
es->lock_count == 1))
1252 ERR(
"no buffer ... please report\n");
1275 TRACE(
"trying to ReAlloc to %d+1 characters\n",
size);
1283 TRACE(
"Old 32 bit handle %p, new handle %p\n",
es->hloc32W, hNew32W);
1284 es->hloc32W = hNew32W;
1291 if (
es->buffer_size <
size) {
1292 WARN(
"FAILED ! We now have %d+1\n",
es->buffer_size);
1296 TRACE(
"We now have %d+1\n",
es->buffer_size);
1316 TRACE(
"trying to ReAlloc to %d+1\n",
size);
1320 es->undo_buffer_size = alloc_size/
sizeof(
WCHAR) - 1;
1325 WARN(
"FAILED ! We now have %d+1\n",
es->undo_buffer_size);
1399 if ((el < es->y_offset) || (sl >
es->y_offset + vlc))
1404 if (sl < es->y_offset) {
1408 if (el >
es->y_offset + vlc) {
1409 el =
es->y_offset + vlc;
1425 for (
l = sl + 1 ;
l < el ;
l++) {
1483 UINT old_start =
es->selection_start;
1484 UINT old_end =
es->selection_end;
1487 if (
start == old_start &&
end == old_end)
1492 end =
es->selection_end;
1498 es->selection_end =
end;
1520 if (
end != old_start)
1530 if (old_start >
end )
1560 si.
nMax =
es->line_count - 1;
1561 si.
nPage = (
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
1563 TRACE(
"SB_VERT, nMin=%d, nMax=%d, nPage=%d, nPos=%d\n",
1574 si.
nMax =
es->text_width - 1;
1575 si.
nPage =
es->format_rect.right -
es->format_rect.left;
1577 TRACE(
"SB_HORZ, nMin=%d, nMax=%d, nPage=%d, nPos=%d\n",
1596 INT x_offset_in_pixels;
1597 INT lines_per_page = (
es->format_rect.bottom -
es->format_rect.top) /
1602 x_offset_in_pixels =
es->x_offset;
1610 if (-
dx > x_offset_in_pixels)
1611 dx = -x_offset_in_pixels;
1612 if (
dx >
es->text_width - x_offset_in_pixels)
1613 dx =
es->text_width - x_offset_in_pixels;
1614 nyoff =
max(0,
es->y_offset +
dy);
1615 if (nyoff >=
es->line_count - lines_per_page)
1616 nyoff =
max(0,
es->line_count - lines_per_page);
1617 dy = (
es->y_offset - nyoff) *
es->line_height;
1622 es->y_offset = nyoff;
1626 es->x_offset +=
dx /
es->char_width;
1654 dx *=
es->char_width;
1679 if (
es->y_offset <
es->line_count - 1)
1684 dy = -(
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
1687 if (
es->y_offset <
es->line_count - 1)
1688 dy = (
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
1696 if(
es->y_offset +
dy >
es->line_count - vlc)
1697 dy =
max(
es->line_count - vlc, 0) -
es->y_offset;
1735 INT cw =
es->char_width;
1743 if (
l >=
es->y_offset + vlc)
1744 dy =
l - vlc + 1 -
es->y_offset;
1745 if (l < es->y_offset)
1746 dy =
l -
es->y_offset;
1747 ww =
es->format_rect.right -
es->format_rect.left;
1750 if (
x >
es->format_rect.right)
1752 if (
dy ||
dx || (
es->y_offset && (
es->line_count -
es->y_offset < vlc)))
1755 if(
es->x_offset +
dx + ww >
es->text_width)
1756 dx =
es->text_width - ww -
es->x_offset;
1757 if(
dx ||
dy || (
es->y_offset && (
es->line_count -
es->y_offset < vlc)))
1766 format_width =
es->format_rect.right -
es->format_rect.left;
1772 }
while ((
x < goal) &&
es->x_offset);
1775 }
else if (
x >
es->format_rect.right) {
1783 }
while ((
x > goal) && (x_last >
es->format_rect.right));
1801 INT e =
es->selection_end;
1806 (
es->text[
e - 1] ==
'\r') && (
es->text[
e] ==
'\n')) {
1808 if (
e && (
es->text[
e - 1] ==
'\r'))
1828 INT s =
es->selection_start;
1829 INT e =
es->selection_end;
1871 INT e =
es->selection_end;
1876 if (
es->text[
e] ==
'\n')
1878 else if ((
es->text[
e] ==
'\r') && (
es->text[
e + 1] ==
'\n'))
1920 INT s =
es->selection_start;
1921 INT e =
es->selection_end;
1928 y + (
es->format_rect.bottom -
es->format_rect.top),
1948 INT s =
es->selection_start;
1949 INT e =
es->selection_end;
1956 y - (
es->format_rect.bottom -
es->format_rect.top),
1976 INT s =
es->selection_start;
1977 INT e =
es->selection_end;
1998 INT s =
es->selection_start;
1999 INT e =
es->selection_end;
2029 INT s =
es->selection_start;
2030 INT e =
es->selection_end;
2062 HFONT hUnderline = 0;
2075 if (
es->composition_len == 0)
2093 es->tabs_count,
es->tabs,
es->format_rect.left -
es->x_offset));
2100 if (
es->composition_len == 0)
2151 int line_idx =
line;
2158 while (line_def && line_idx)
2160 line_def = line_def->
next;
2163 w =
es->format_rect.right -
es->format_rect.left;
2164 lw = line_def->
width;
2171 x +=
es->format_rect.left;
2178 s =
min(
es->selection_start,
es->selection_end);
2179 e =
max(
es->selection_start,
es->selection_end);
2186 else if (
rev && (
s !=
e) &&
2208 es->format_rect.right =
max(
es->format_rect.right,
es->format_rect.left +
es->char_width);
2211 INT fw, vlc, max_x_offset, max_y_offset;
2214 es->format_rect.bottom =
es->format_rect.top + vlc *
es->line_height;
2217 fw =
es->format_rect.right -
es->format_rect.left;
2218 max_x_offset =
es->text_width - fw;
2219 if(max_x_offset < 0) max_x_offset = 0;
2220 if(
es->x_offset > max_x_offset)
2221 es->x_offset = max_x_offset;
2224 max_y_offset =
es->line_count - vlc;
2225 if(max_y_offset < 0) max_y_offset = 0;
2226 if(
es->y_offset > max_y_offset)
2227 es->y_offset = max_y_offset;
2234 es->format_rect.bottom =
es->format_rect.top +
es->line_height;
2238 es->format_rect.bottom =
min(
es->format_rect.bottom, ClientRect.
bottom);
2264 es->format_rect.left++;
2265 es->format_rect.right--;
2267 if (
es->format_rect.bottom -
es->format_rect.top
2268 >=
es->line_height + 2)
2270 es->format_rect.top++;
2271 es->format_rect.bottom--;
2278 if (
es->format_rect.bottom -
es->format_rect.top >=
es->line_height + 2 * bh)
2282 es->format_rect.left +=
es->left_margin;
2283 es->format_rect.right -=
es->right_margin;
2332 FIXME(
"soft break enabled, not implemented\n");
2357 es->hlocapp =
es->hloc32W;
2371 INT line_len, dst_len;
2377 if (
line >=
es->line_count)
2388 if (dst_len <= line_len)
2429 BOOL send_update,
BOOL honor_limit)
2442 TRACE(
"%s, can_undo %d, send_update %d\n",
2443 debugstr_wn(lpsz_replace, strl), can_undo, send_update);
2445 s =
es->selection_start;
2446 e =
es->selection_end;
2449 if ((
s ==
e) && !strl)
2454 size = tl - (
e -
s) + strl;
2460 if ((honor_limit) && (
size >
es->buffer_limit)) {
2463 if (
es->buffer_limit < (tl - (
e-
s)))
2466 strl =
min(strl,
es->buffer_limit - (tl - (
e-
s)));
2474 TRACE(
"deleting stuff.\n");
2488 for (
p =
es->text + tl ;
p >=
es->text +
s ;
p--)
2490 for (
i = 0 ,
p =
es->text +
s ;
i < strl ;
i++)
2491 p[
i] = lpsz_replace[
i];
2500 INT st =
min(
es->selection_start,
es->selection_end);
2505 strl -
abs(
es->selection_end -
es->selection_start),
hrgn);
2511 for (
i = 0 ,
p =
es->text ;
i <
e -
s ;
i++)
2515 abs(
es->selection_end -
es->selection_start) - strl,
hrgn);
2523 INT fw =
es->format_rect.right -
es->format_rect.left;
2528 while ((
es->text_width > fw) &&
s + strl >=
s) {
2531 es->text_length = -1;
2543 if (!
es->undo_insert_count && (*
es->undo_text && (
s ==
es->undo_position))) {
2547 (
es->undo_text + utl)[
e -
s] = 0;
2548 }
else if (!
es->undo_insert_count && (*
es->undo_text && (
e ==
es->undo_position))) {
2551 for (
p =
es->undo_text + utl ;
p >=
es->undo_text ;
p--)
2553 for (
i = 0 ,
p =
es->undo_text ;
i <
e -
s ;
i++)
2555 es->undo_position =
s;
2560 es->undo_text[
e -
s] = 0;
2561 es->undo_position =
s;
2564 es->undo_insert_count = 0;
2570 if ((
s ==
es->undo_position) ||
2571 ((
es->undo_insert_count) &&
2572 (
s ==
es->undo_position +
es->undo_insert_count)))
2577 es->undo_insert_count += strl;
2580 es->undo_position =
s;
2581 es->undo_insert_count = strl;
2583 *
es->undo_text =
'\0';
2596 INT delta = strl -
abs(
es->selection_end -
es->selection_start);
2598 if (delta < 0 && es->x_offset)
2600 if (
abs(delta) >
es->x_offset)
2603 es->x_offset += delta;
2659 es->x_offset =
es->y_offset = 0;
2660 es->selection_start =
es->selection_end = 0;
2719 INT default_left_margin = 0;
2720 INT default_right_margin = 0;
2732 default_left_margin =
width / 2;
2733 default_right_margin =
width / 2;
2738 default_left_margin =
es->left_margin;
2739 default_right_margin =
es->right_margin;
2743 default_left_margin =
width / 2;
2744 default_right_margin =
width / 2;
2752 es->format_rect.left -=
es->left_margin;
2756 es->left_margin = default_left_margin;
2757 es->format_rect.left +=
es->left_margin;
2761 es->format_rect.right +=
es->right_margin;
2765 es->right_margin = default_right_margin;
2766 es->format_rect.right -=
es->right_margin;
2774 TRACE(
"left=%d, right=%d\n",
es->left_margin,
es->right_margin);
2790 if (
es->password_char ==
c)
2794 es->password_char =
c;
2836 if (
es->word_break_proc == wbp)
2839 es->word_break_proc = wbp;
2869 TRACE(
"before UNDO:insertion length = %d, deletion buffer = %s\n",
2881 TRACE(
"after UNDO:insertion length = %d, deletion buffer = %s\n",
2943 INT s =
min(
es->selection_start,
es->selection_end);
2944 INT e =
max(
es->selection_start,
es->selection_end);
3018 static const WCHAR cr_lfW[] = {
'\r',
'\n'};
3026 static const WCHAR tabW[] = {
'\t'};
3034 if (
es->selection_start !=
es->selection_end)
3101 ERR(
"unknown menu item, please report\n");
3150 if (
pt.x == -1 &&
pt.y == -1)
3195 HWND hLBox =
es->hwndListBox;
3207 TRACE(
"[%p]: handling msg %x (%x)\n",
es->hwndSelf,
msg,
key);
3314 if (
es->selection_start !=
es->selection_end) {
3325 }
else if (control) {
3404 es->wheelDeltaRemainder = 0;
3424 INT e =
es->selection_end;
3429 es->bCaptureState =
TRUE;
3439 es->region_posx =
es->region_posy = 0;
3455 es->bCaptureState =
TRUE;
3461 es->region_posx =
es->region_posy = 0;
3478 if (
es->bCaptureState) {
3522 es->region_posx = (prex <
x) ? -1 : ((prex >
x) ? 1 : 0);
3523 es->region_posy = (prey <
y) ? -1 : ((prey >
y) ? 1 : 0);
3591 es->format_rect.top,
3592 es->format_rect.right,
3593 es->format_rect.bottom);
3601 if (!
es->bEnableState)
3606 for (
i =
es->y_offset ;
i <=
min(
es->y_offset + vlc,
es->y_offset +
es->line_count - 1) ;
i++) {
3629 HRGN cliprgn = region;
3652 r.right - cxEdge,
r.bottom - cyEdge);
3653 if (region != (HRGN)1)
3728 es->line_height =
tm.tmHeight;
3729 es->char_width =
tm.tmAveCharWidth;
3773 ERR(
"SetSel may generate UPDATE message whose handler may reset " 3847 DWORD style_change_mask;
3857 new_style =
style->styleNew & style_change_mask;
3869 es->style = (
es->style & ~style_change_mask) | new_style;
3873 WARN (
"Invalid style change %ld\n",
which);
3886 if ((
key ==
VK_BACK) && (key_data & 0x2000)) {
3905 if (
es->region_posx < 0) {
3907 }
else if (
es->region_posx > 0) {
3933 fw =
es->format_rect.right -
es->format_rect.left;
3936 TRACE(
"SB_LINELEFT\n");
3938 dx = -
es->char_width;
3941 TRACE(
"SB_LINERIGHT\n");
3942 if (
es->x_offset <
es->text_width)
3943 dx =
es->char_width;
3946 TRACE(
"SB_PAGELEFT\n");
3951 TRACE(
"SB_PAGERIGHT\n");
3952 if (
es->x_offset <
es->text_width)
3961 TRACE(
"SB_RIGHT\n");
3962 if (
es->x_offset <
es->text_width)
3963 dx =
es->text_width -
es->x_offset;
3974 if(pos < 0 || pos > 100)
return 0;
3976 fw =
es->format_rect.right -
es->format_rect.left;
3977 new_x =
pos * (
es->text_width - fw) / 100;
3978 dx =
es->text_width ? (new_x -
es->x_offset) : 0;
3982 TRACE(
"SB_THUMBPOSITION %d\n",
pos);
3990 if(pos < 0 || pos > 100)
return 0;
3992 fw =
es->format_rect.right -
es->format_rect.left;
3993 new_x =
pos * (
es->text_width - fw) / 100;
3994 dx =
es->text_width ? (new_x -
es->x_offset) : 0;
4003 TRACE(
"SB_ENDSCROLL\n");
4019 INT fw =
es->format_rect.right -
es->format_rect.left;
4020 ret =
es->text_width ?
es->x_offset * 100 / (
es->text_width - fw) : 0;
4022 TRACE(
"EM_GETTHUMB: returning %ld\n",
ret);
4026 TRACE(
"EM_LINESCROLL16\n");
4031 ERR(
"undocumented WM_HSCROLL action %d (0x%04x), please report\n",
4037 INT fw =
es->format_rect.right -
es->format_rect.left;
4039 if(
es->x_offset +
dx + fw >
es->text_width)
4040 dx =
es->text_width - fw -
es->x_offset;
4080 TRACE(
"SB_BOTTOM\n");
4081 dy =
es->line_count - 1 -
es->y_offset;
4093 if(pos < 0 || pos > 100)
return 0;
4095 new_y =
pos * (
es->line_count - vlc) / 100;
4096 dy =
es->line_count ? (new_y -
es->y_offset) : 0;
4097 TRACE(
"line_count=%d, y_offset=%d, pos=%d, dy = %d\n",
4102 TRACE(
"SB_THUMBPOSITION %d\n",
pos);
4111 if(pos < 0 || pos > 100)
return 0;
4113 new_y =
pos * (
es->line_count - vlc) / 100;
4114 dy =
es->line_count ? (new_y -
es->y_offset) : 0;
4115 TRACE(
"line_count=%d, y_offset=%d, pos=%d, dy = %d\n",
4126 TRACE(
"SB_ENDSCROLL\n");
4143 ret =
es->line_count ?
es->y_offset * 100 / (
es->line_count - vlc) : 0;
4145 TRACE(
"EM_GETTHUMB: returning %ld\n",
ret);
4154 ERR(
"undocumented WM_VSCROLL action %d (0x%04x), please report\n",