Mercurial > emacs
comparison src/w32term.c @ 83530:46b1096093f5
Merged from emacs@sv.gnu.org.
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-294
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-295
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-296
Update from CVS: admin/FOR-RELEASE: Update refcard section.
* emacs@sv.gnu.org/emacs--devo--0--patch-297
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-298
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-299
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-300
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-301
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-302
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-303
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-304
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-103
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-104
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-570
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 12 Jun 2006 07:27:12 +0000 |
parents | 966a40e7fb54 4a38eb2f741d |
children | b19aaf4ab0ee |
comparison
equal
deleted
inserted
replaced
83529:0d9e16eab053 | 83530:46b1096093f5 |
---|---|
143 | 143 |
144 DWORD dwWindowsThreadId = 0; | 144 DWORD dwWindowsThreadId = 0; |
145 HANDLE hWindowsThread = NULL; | 145 HANDLE hWindowsThread = NULL; |
146 DWORD dwMainThreadId = 0; | 146 DWORD dwMainThreadId = 0; |
147 HANDLE hMainThread = NULL; | 147 HANDLE hMainThread = NULL; |
148 | |
149 #ifndef SIF_ALL | |
150 /* These definitions are new with Windows 95. */ | |
151 #define SIF_RANGE 0x0001 | |
152 #define SIF_PAGE 0x0002 | |
153 #define SIF_POS 0x0004 | |
154 #define SIF_DISABLENOSCROLL 0x0008 | |
155 #define SIF_TRACKPOS 0x0010 | |
156 #define SIF_ALL (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS) | |
157 | |
158 typedef struct tagSCROLLINFO | |
159 { | |
160 UINT cbSize; | |
161 UINT fMask; | |
162 int nMin; | |
163 int nMax; | |
164 UINT nPage; | |
165 int nPos; | |
166 int nTrackPos; | |
167 } SCROLLINFO, FAR *LPSCROLLINFO; | |
168 typedef SCROLLINFO CONST FAR *LPCSCROLLINFO; | |
169 #endif /* SIF_ALL */ | |
170 | |
171 /* Dynamic linking to new proportional scroll bar functions. */ | |
172 int (PASCAL *pfnSetScrollInfo) (HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL fRedraw); | |
173 BOOL (PASCAL *pfnGetScrollInfo) (HWND hwnd, int fnBar, LPSCROLLINFO lpsi); | |
174 | 148 |
175 int vertical_scroll_bar_min_handle; | 149 int vertical_scroll_bar_min_handle; |
176 int vertical_scroll_bar_top_border; | 150 int vertical_scroll_bar_top_border; |
177 int vertical_scroll_bar_bottom_border; | 151 int vertical_scroll_bar_bottom_border; |
178 | 152 |
2387 if (s->hl == DRAW_CURSOR | 2361 if (s->hl == DRAW_CURSOR |
2388 && !x_stretch_cursor_p) | 2362 && !x_stretch_cursor_p) |
2389 { | 2363 { |
2390 /* If `x-stretch-block-cursor' is nil, don't draw a block cursor | 2364 /* If `x-stretch-block-cursor' is nil, don't draw a block cursor |
2391 as wide as the stretch glyph. */ | 2365 as wide as the stretch glyph. */ |
2392 int width = min (FRAME_COLUMN_WIDTH (s->f), s->background_width); | 2366 int width, background_width = s->background_width; |
2367 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); | |
2368 | |
2369 if (x < left_x) | |
2370 { | |
2371 background_width -= left_x - x; | |
2372 x = left_x; | |
2373 } | |
2374 width = min (FRAME_COLUMN_WIDTH (s->f), background_width); | |
2393 | 2375 |
2394 /* Draw cursor. */ | 2376 /* Draw cursor. */ |
2395 x_draw_glyph_string_bg_rect (s, s->x, s->y, width, s->height); | 2377 x_draw_glyph_string_bg_rect (s, x, s->y, width, s->height); |
2396 | 2378 |
2397 /* Clear rest using the GC of the original non-cursor face. */ | 2379 /* Clear rest using the GC of the original non-cursor face. */ |
2398 if (width < s->background_width) | 2380 if (width < background_width) |
2399 { | 2381 { |
2400 XGCValues *gc = s->face->gc; | 2382 XGCValues *gc = s->face->gc; |
2401 int x = s->x + width, y = s->y; | 2383 int y = s->y; |
2402 int w = s->background_width - width, h = s->height; | 2384 int w = background_width - width, h = s->height; |
2403 RECT r; | 2385 RECT r; |
2404 HDC hdc = s->hdc; | 2386 HDC hdc = s->hdc; |
2405 | 2387 |
2388 x += width; | |
2406 if (s->row->mouse_face_p | 2389 if (s->row->mouse_face_p |
2407 && cursor_in_mouse_face_p (s->w)) | 2390 && cursor_in_mouse_face_p (s->w)) |
2408 { | 2391 { |
2409 x_set_mouse_face_gc (s); | 2392 x_set_mouse_face_gc (s); |
2410 gc = s->gc; | 2393 gc = s->gc; |
2429 w32_fill_area (s->f, s->hdc, gc->background, x, y, w, h); | 2412 w32_fill_area (s->f, s->hdc, gc->background, x, y, w, h); |
2430 } | 2413 } |
2431 } | 2414 } |
2432 } | 2415 } |
2433 else if (!s->background_filled_p) | 2416 else if (!s->background_filled_p) |
2434 x_draw_glyph_string_bg_rect (s, s->x, s->y, s->background_width, | 2417 { |
2435 s->height); | 2418 int background_width = s->background_width; |
2419 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); | |
2420 | |
2421 if (x < left_x) | |
2422 { | |
2423 background_width -= left_x - x; | |
2424 x = left_x; | |
2425 } | |
2426 if (background_width > 0) | |
2427 x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height); | |
2428 } | |
2436 | 2429 |
2437 s->background_filled_p = 1; | 2430 s->background_filled_p = 1; |
2438 } | 2431 } |
2439 | 2432 |
2440 | 2433 |
3466 { | 3459 { |
3467 Window w = SCROLL_BAR_W32_WINDOW (bar); | 3460 Window w = SCROLL_BAR_W32_WINDOW (bar); |
3468 double range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); | 3461 double range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
3469 int sb_page, sb_pos; | 3462 int sb_page, sb_pos; |
3470 BOOL draggingp = !NILP (bar->dragging) ? TRUE : FALSE; | 3463 BOOL draggingp = !NILP (bar->dragging) ? TRUE : FALSE; |
3464 SCROLLINFO si; | |
3471 | 3465 |
3472 if (whole) | 3466 if (whole) |
3473 { | 3467 { |
3474 /* Position scroll bar at rock bottom if the bottom of the | 3468 /* Position scroll bar at rock bottom if the bottom of the |
3475 buffer is visible. This avoids shinking the thumb away | 3469 buffer is visible. This avoids shinking the thumb away |
3490 sb_pos = 0; | 3484 sb_pos = 0; |
3491 } | 3485 } |
3492 | 3486 |
3493 BLOCK_INPUT; | 3487 BLOCK_INPUT; |
3494 | 3488 |
3495 if (pfnSetScrollInfo) | 3489 si.cbSize = sizeof (si); |
3496 { | 3490 /* Only update page size if currently dragging, to reduce |
3497 SCROLLINFO si; | 3491 flicker effects. */ |
3498 | 3492 if (draggingp) |
3499 si.cbSize = sizeof (si); | 3493 si.fMask = SIF_PAGE; |
3500 /* Only update page size if currently dragging, to reduce | |
3501 flicker effects. */ | |
3502 if (draggingp) | |
3503 si.fMask = SIF_PAGE; | |
3504 else | |
3505 si.fMask = SIF_PAGE | SIF_POS; | |
3506 si.nPage = sb_page; | |
3507 si.nPos = sb_pos; | |
3508 | |
3509 pfnSetScrollInfo (w, SB_CTL, &si, !draggingp); | |
3510 } | |
3511 else | 3494 else |
3512 SetScrollPos (w, SB_CTL, sb_pos, !draggingp); | 3495 si.fMask = SIF_PAGE | SIF_POS; |
3496 si.nPage = sb_page; | |
3497 si.nPos = sb_pos; | |
3498 | |
3499 SetScrollInfo (w, SB_CTL, &si, !draggingp); | |
3513 | 3500 |
3514 UNBLOCK_INPUT; | 3501 UNBLOCK_INPUT; |
3515 } | 3502 } |
3516 | 3503 |
3517 | 3504 |
3596 struct window *w; | 3583 struct window *w; |
3597 int top, left, width, height; | 3584 int top, left, width, height; |
3598 { | 3585 { |
3599 struct frame *f = XFRAME (WINDOW_FRAME (w)); | 3586 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
3600 HWND hwnd; | 3587 HWND hwnd; |
3588 SCROLLINFO si; | |
3601 struct scroll_bar *bar | 3589 struct scroll_bar *bar |
3602 = XSCROLL_BAR (Fmake_vector (make_number (SCROLL_BAR_VEC_SIZE), Qnil)); | 3590 = XSCROLL_BAR (Fmake_vector (make_number (SCROLL_BAR_VEC_SIZE), Qnil)); |
3603 | 3591 |
3604 BLOCK_INPUT; | 3592 BLOCK_INPUT; |
3605 | 3593 |
3614 | 3602 |
3615 /* Requires geometry to be set before call to create the real window */ | 3603 /* Requires geometry to be set before call to create the real window */ |
3616 | 3604 |
3617 hwnd = my_create_scrollbar (f, bar); | 3605 hwnd = my_create_scrollbar (f, bar); |
3618 | 3606 |
3619 if (pfnSetScrollInfo) | 3607 si.cbSize = sizeof (si); |
3620 { | 3608 si.fMask = SIF_ALL; |
3621 SCROLLINFO si; | 3609 si.nMin = 0; |
3622 | 3610 si.nMax = VERTICAL_SCROLL_BAR_TOP_RANGE (f, height) |
3623 si.cbSize = sizeof (si); | 3611 + VERTICAL_SCROLL_BAR_MIN_HANDLE; |
3624 si.fMask = SIF_ALL; | 3612 si.nPage = si.nMax; |
3625 si.nMin = 0; | 3613 si.nPos = 0; |
3626 si.nMax = VERTICAL_SCROLL_BAR_TOP_RANGE (f, height) | 3614 |
3627 + VERTICAL_SCROLL_BAR_MIN_HANDLE; | 3615 SetScrollInfo (hwnd, SB_CTL, &si, FALSE); |
3628 si.nPage = si.nMax; | |
3629 si.nPos = 0; | |
3630 | |
3631 pfnSetScrollInfo (hwnd, SB_CTL, &si, FALSE); | |
3632 } | |
3633 else | |
3634 { | |
3635 SetScrollRange (hwnd, SB_CTL, 0, | |
3636 VERTICAL_SCROLL_BAR_TOP_RANGE (f, height), FALSE); | |
3637 SetScrollPos (hwnd, SB_CTL, 0, FALSE); | |
3638 } | |
3639 | 3616 |
3640 SET_SCROLL_BAR_W32_WINDOW (bar, hwnd); | 3617 SET_SCROLL_BAR_W32_WINDOW (bar, hwnd); |
3641 | 3618 |
3642 /* Add bar to its frame's list of scroll bars. */ | 3619 /* Add bar to its frame's list of scroll bars. */ |
3643 bar->next = FRAME_SCROLL_BARS (f); | 3620 bar->next = FRAME_SCROLL_BARS (f); |
3742 InvalidateRect (hwnd, NULL, FALSE); | 3719 InvalidateRect (hwnd, NULL, FALSE); |
3743 } | 3720 } |
3744 else | 3721 else |
3745 { | 3722 { |
3746 HDC hdc; | 3723 HDC hdc; |
3724 SCROLLINFO si; | |
3725 | |
3747 BLOCK_INPUT; | 3726 BLOCK_INPUT; |
3748 if (width && height) | 3727 if (width && height) |
3749 { | 3728 { |
3750 hdc = get_frame_dc (f); | 3729 hdc = get_frame_dc (f); |
3751 /* Since Windows scroll bars are smaller than the space reserved | 3730 /* Since Windows scroll bars are smaller than the space reserved |
3761 area of the parent window now exposed will be refreshed. */ | 3740 area of the parent window now exposed will be refreshed. */ |
3762 my_show_window (f, hwnd, SW_HIDE); | 3741 my_show_window (f, hwnd, SW_HIDE); |
3763 MoveWindow (hwnd, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, | 3742 MoveWindow (hwnd, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, |
3764 top, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, | 3743 top, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, |
3765 max (height, 1), TRUE); | 3744 max (height, 1), TRUE); |
3766 if (pfnSetScrollInfo) | 3745 |
3767 { | 3746 si.cbSize = sizeof (si); |
3768 SCROLLINFO si; | 3747 si.fMask = SIF_RANGE; |
3769 | 3748 si.nMin = 0; |
3770 si.cbSize = sizeof (si); | 3749 si.nMax = VERTICAL_SCROLL_BAR_TOP_RANGE (f, height) |
3771 si.fMask = SIF_RANGE; | 3750 + VERTICAL_SCROLL_BAR_MIN_HANDLE; |
3772 si.nMin = 0; | 3751 |
3773 si.nMax = VERTICAL_SCROLL_BAR_TOP_RANGE (f, height) | 3752 SetScrollInfo (hwnd, SB_CTL, &si, FALSE); |
3774 + VERTICAL_SCROLL_BAR_MIN_HANDLE; | 3753 |
3775 | |
3776 pfnSetScrollInfo (hwnd, SB_CTL, &si, FALSE); | |
3777 } | |
3778 else | |
3779 SetScrollRange (hwnd, SB_CTL, 0, | |
3780 VERTICAL_SCROLL_BAR_TOP_RANGE (f, height), FALSE); | |
3781 my_show_window (f, hwnd, SW_NORMAL); | 3754 my_show_window (f, hwnd, SW_NORMAL); |
3782 /* InvalidateRect (w, NULL, FALSE); */ | 3755 /* InvalidateRect (w, NULL, FALSE); */ |
3783 | 3756 |
3784 /* Remember new settings. */ | 3757 /* Remember new settings. */ |
3785 XSETINT (bar->left, sb_left); | 3758 XSETINT (bar->left, sb_left); |
3927 | 3900 |
3928 { | 3901 { |
3929 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); | 3902 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
3930 int y; | 3903 int y; |
3931 int dragging = !NILP (bar->dragging); | 3904 int dragging = !NILP (bar->dragging); |
3932 | 3905 SCROLLINFO si; |
3933 if (pfnGetScrollInfo) | 3906 |
3934 { | 3907 si.cbSize = sizeof (si); |
3935 SCROLLINFO si; | 3908 si.fMask = SIF_POS; |
3936 | 3909 |
3937 si.cbSize = sizeof (si); | 3910 GetScrollInfo ((HWND) msg->msg.lParam, SB_CTL, &si); |
3938 si.fMask = SIF_POS; | 3911 y = si.nPos; |
3939 | |
3940 pfnGetScrollInfo ((HWND) msg->msg.lParam, SB_CTL, &si); | |
3941 y = si.nPos; | |
3942 } | |
3943 else | |
3944 y = GetScrollPos ((HWND) msg->msg.lParam, SB_CTL); | |
3945 | 3912 |
3946 bar->dragging = Qnil; | 3913 bar->dragging = Qnil; |
3947 | 3914 |
3948 | 3915 |
3949 last_mouse_scroll_bar_pos = msg->msg.wParam; | 3916 last_mouse_scroll_bar_pos = msg->msg.wParam; |
3976 y = HIWORD (msg->msg.wParam); | 3943 y = HIWORD (msg->msg.wParam); |
3977 bar->dragging = Qt; | 3944 bar->dragging = Qt; |
3978 emacs_event->part = scroll_bar_handle; | 3945 emacs_event->part = scroll_bar_handle; |
3979 | 3946 |
3980 /* "Silently" update current position. */ | 3947 /* "Silently" update current position. */ |
3981 if (pfnSetScrollInfo) | 3948 { |
3982 { | 3949 SCROLLINFO si; |
3983 SCROLLINFO si; | 3950 |
3984 | 3951 si.cbSize = sizeof (si); |
3985 si.cbSize = sizeof (si); | 3952 si.fMask = SIF_POS; |
3986 si.fMask = SIF_POS; | 3953 si.nPos = y; |
3987 si.nPos = y; | 3954 /* Remember apparent position (we actually lag behind the real |
3988 /* Remember apparent position (we actually lag behind the real | 3955 position, so don't set that directly. */ |
3989 position, so don't set that directly. */ | 3956 last_scroll_bar_drag_pos = y; |
3990 last_scroll_bar_drag_pos = y; | 3957 |
3991 | 3958 SetScrollInfo (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, &si, FALSE); |
3992 pfnSetScrollInfo (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, &si, FALSE); | 3959 } |
3993 } | |
3994 else | |
3995 SetScrollPos (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, y, FALSE); | |
3996 break; | 3960 break; |
3997 case SB_ENDSCROLL: | 3961 case SB_ENDSCROLL: |
3998 /* If this is the end of a drag sequence, then reset the scroll | 3962 /* If this is the end of a drag sequence, then reset the scroll |
3999 handle size to normal and do a final redraw. Otherwise do | 3963 handle size to normal and do a final redraw. Otherwise do |
4000 nothing. */ | 3964 nothing. */ |
4001 if (dragging) | 3965 if (dragging) |
4002 { | 3966 { |
4003 if (pfnSetScrollInfo) | 3967 SCROLLINFO si; |
4004 { | 3968 int start = XINT (bar->start); |
4005 SCROLLINFO si; | 3969 int end = XINT (bar->end); |
4006 int start = XINT (bar->start); | 3970 |
4007 int end = XINT (bar->end); | 3971 si.cbSize = sizeof (si); |
4008 | 3972 si.fMask = SIF_PAGE | SIF_POS; |
4009 si.cbSize = sizeof (si); | 3973 si.nPage = end - start + VERTICAL_SCROLL_BAR_MIN_HANDLE; |
4010 si.fMask = SIF_PAGE | SIF_POS; | 3974 si.nPos = last_scroll_bar_drag_pos; |
4011 si.nPage = end - start + VERTICAL_SCROLL_BAR_MIN_HANDLE; | 3975 SetScrollInfo (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, &si, TRUE); |
4012 si.nPos = last_scroll_bar_drag_pos; | |
4013 pfnSetScrollInfo (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, &si, TRUE); | |
4014 } | |
4015 else | |
4016 SetScrollPos (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, y, TRUE); | |
4017 } | 3976 } |
4018 /* fall through */ | 3977 /* fall through */ |
4019 default: | 3978 default: |
4020 emacs_event->kind = NO_EVENT; | 3979 emacs_event->kind = NO_EVENT; |
4021 return FALSE; | 3980 return FALSE; |
4042 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); | 4001 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); |
4043 Window w = SCROLL_BAR_W32_WINDOW (bar); | 4002 Window w = SCROLL_BAR_W32_WINDOW (bar); |
4044 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); | 4003 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
4045 int pos; | 4004 int pos; |
4046 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); | 4005 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
4006 SCROLLINFO si; | |
4047 | 4007 |
4048 BLOCK_INPUT; | 4008 BLOCK_INPUT; |
4049 | 4009 |
4050 *fp = f; | 4010 *fp = f; |
4051 *bar_window = bar->window; | 4011 *bar_window = bar->window; |
4052 | 4012 |
4053 if (pfnGetScrollInfo) | 4013 si.cbSize = sizeof (si); |
4054 { | 4014 si.fMask = SIF_POS | SIF_PAGE | SIF_RANGE; |
4055 SCROLLINFO si; | 4015 |
4056 | 4016 GetScrollInfo (w, SB_CTL, &si); |
4057 si.cbSize = sizeof (si); | 4017 pos = si.nPos; |
4058 si.fMask = SIF_POS | SIF_PAGE | SIF_RANGE; | 4018 top_range = si.nMax - si.nPage + 1; |
4059 | |
4060 pfnGetScrollInfo (w, SB_CTL, &si); | |
4061 pos = si.nPos; | |
4062 top_range = si.nMax - si.nPage + 1; | |
4063 } | |
4064 else | |
4065 pos = GetScrollPos (w, SB_CTL); | |
4066 | 4019 |
4067 switch (LOWORD (last_mouse_scroll_bar_pos)) | 4020 switch (LOWORD (last_mouse_scroll_bar_pos)) |
4068 { | 4021 { |
4069 case SB_THUMBPOSITION: | 4022 case SB_THUMBPOSITION: |
4070 case SB_THUMBTRACK: | 4023 case SB_THUMBTRACK: |
4929 struct glyph_row *row; | 4882 struct glyph_row *row; |
4930 { | 4883 { |
4931 struct frame *f = XFRAME (WINDOW_FRAME (w)); | 4884 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
4932 HDC hdc; | 4885 HDC hdc; |
4933 RECT rect; | 4886 RECT rect; |
4934 int h; | 4887 int left, top, h; |
4935 struct glyph *cursor_glyph; | 4888 struct glyph *cursor_glyph; |
4936 HBRUSH hb = CreateSolidBrush (f->output_data.w32->cursor_pixel); | 4889 HBRUSH hb = CreateSolidBrush (f->output_data.w32->cursor_pixel); |
4937 | 4890 |
4938 /* Get the glyph the cursor is on. If we can't tell because | 4891 /* Get the glyph the cursor is on. If we can't tell because |
4939 the current matrix is invalid or such, give up. */ | 4892 the current matrix is invalid or such, give up. */ |
4940 cursor_glyph = get_phys_cursor_glyph (w); | 4893 cursor_glyph = get_phys_cursor_glyph (w); |
4941 if (cursor_glyph == NULL) | 4894 if (cursor_glyph == NULL) |
4942 return; | 4895 return; |
4943 | 4896 |
4944 /* Compute frame-relative coordinates for phys cursor. */ | 4897 /* Compute frame-relative coordinates for phys cursor. */ |
4945 rect.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); | 4898 get_phys_cursor_geometry (w, row, cursor_glyph, &left, &top, &h); |
4946 rect.top = get_phys_cursor_geometry (w, row, cursor_glyph, &h); | 4899 rect.left = left; |
4900 rect.top = top; | |
4947 rect.bottom = rect.top + h; | 4901 rect.bottom = rect.top + h; |
4948 rect.right = rect.left + w->phys_cursor_width; | 4902 rect.right = rect.left + w->phys_cursor_width; |
4949 | 4903 |
4950 hdc = get_frame_dc (f); | 4904 hdc = get_frame_dc (f); |
4951 /* Set clipping, draw the rectangle, and reset clipping again. */ | 4905 /* Set clipping, draw the rectangle, and reset clipping again. */ |
6388 window state. */ | 6342 window state. */ |
6389 #ifdef ATTACH_THREADS | 6343 #ifdef ATTACH_THREADS |
6390 AttachThreadInput (dwMainThreadId, dwWindowsThreadId, TRUE); | 6344 AttachThreadInput (dwMainThreadId, dwWindowsThreadId, TRUE); |
6391 #endif | 6345 #endif |
6392 | 6346 |
6393 /* Dynamically link to optional system components. */ | 6347 /* Load system settings. */ |
6394 { | 6348 { |
6395 HANDLE user_lib = LoadLibrary ("user32.dll"); | |
6396 UINT smoothing_type; | 6349 UINT smoothing_type; |
6397 BOOL smoothing_enabled; | 6350 BOOL smoothing_enabled; |
6398 | 6351 |
6399 #define LOAD_PROC(fn) pfn##fn = (void *) GetProcAddress (user_lib, #fn) | |
6400 | |
6401 /* New proportional scroll bar functions. */ | |
6402 LOAD_PROC (SetScrollInfo); | |
6403 LOAD_PROC (GetScrollInfo); | |
6404 | |
6405 #undef LOAD_PROC | |
6406 | |
6407 FreeLibrary (user_lib); | |
6408 | |
6409 /* If using proportional scroll bars, ensure handle is at least 5 pixels; | 6352 /* If using proportional scroll bars, ensure handle is at least 5 pixels; |
6410 otherwise use the fixed height. */ | 6353 otherwise use the fixed height. */ |
6411 vertical_scroll_bar_min_handle = (pfnSetScrollInfo != NULL) ? 5 : | 6354 vertical_scroll_bar_min_handle = 5; |
6412 GetSystemMetrics (SM_CYVTHUMB); | |
6413 | 6355 |
6414 /* For either kind of scroll bar, take account of the arrows; these | 6356 /* For either kind of scroll bar, take account of the arrows; these |
6415 effectively form the border of the main scroll bar range. */ | 6357 effectively form the border of the main scroll bar range. */ |
6416 vertical_scroll_bar_top_border = vertical_scroll_bar_bottom_border | 6358 vertical_scroll_bar_top_border = vertical_scroll_bar_bottom_border |
6417 = GetSystemMetrics (SM_CYVSCROLL); | 6359 = GetSystemMetrics (SM_CYVSCROLL); |