diff options
| author | Dmitry Antipov | 2013-08-13 19:29:25 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-08-13 19:29:25 +0400 |
| commit | c8ae93b0890e61c5fbc151216d9169968e532f30 (patch) | |
| tree | 537c00d521356f4b18ef6a9f5d10d222c966fcdd /src/w32term.c | |
| parent | 53b64418c20b6288e0e3a589b61db47861a575b6 (diff) | |
| download | emacs-c8ae93b0890e61c5fbc151216d9169968e532f30.tar.gz emacs-c8ae93b0890e61c5fbc151216d9169968e532f30.zip | |
* window.h (WINDOW_FRINGE_EXTENDED_P): New macro.
* nsterm.m (ns_set_vertical_scroll_bar): Use it. Use convenient
bool instead of BOOL.
* w32term.h (struct scroll_bar): Convert fringe_extended_p
from Lisp_Object to bitfield. Adjust comment.
* w32term.c (x_scroll_bar_create): Adjust user.
Use WINDOW_FRINGE_EXTENDED_P and bool for boolean.
* xterm.c (XTset_vertical_scroll_bar): Likewise.
Use bool for boolean.
* xterm.h (struct scroll_bar): Prefer commonly used `unsigned'
to `unsigned int' when defining a bitfield.
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/w32term.c b/src/w32term.c index 15812f93ff5..2b30673c75d 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -3770,7 +3770,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height) | |||
| 3770 | XSETINT (bar->start, 0); | 3770 | XSETINT (bar->start, 0); |
| 3771 | XSETINT (bar->end, 0); | 3771 | XSETINT (bar->end, 0); |
| 3772 | bar->dragging = Qnil; | 3772 | bar->dragging = Qnil; |
| 3773 | bar->fringe_extended_p = Qnil; | 3773 | bar->fringe_extended_p = 0; |
| 3774 | 3774 | ||
| 3775 | /* Requires geometry to be set before call to create the real window */ | 3775 | /* Requires geometry to be set before call to create the real window */ |
| 3776 | 3776 | ||
| @@ -3834,7 +3834,7 @@ w32_set_vertical_scroll_bar (struct window *w, | |||
| 3834 | struct scroll_bar *bar; | 3834 | struct scroll_bar *bar; |
| 3835 | int top, height, left, sb_left, width, sb_width; | 3835 | int top, height, left, sb_left, width, sb_width; |
| 3836 | int window_y, window_height; | 3836 | int window_y, window_height; |
| 3837 | int fringe_extended_p; | 3837 | bool fringe_extended_p; |
| 3838 | 3838 | ||
| 3839 | /* Get window dimensions. */ | 3839 | /* Get window dimensions. */ |
| 3840 | window_box (w, -1, 0, &window_y, 0, &window_height); | 3840 | window_box (w, -1, 0, &window_y, 0, &window_height); |
| @@ -3858,16 +3858,7 @@ w32_set_vertical_scroll_bar (struct window *w, | |||
| 3858 | else | 3858 | else |
| 3859 | sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width); | 3859 | sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width); |
| 3860 | 3860 | ||
| 3861 | if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) | 3861 | fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w); |
| 3862 | fringe_extended_p = (WINDOW_LEFTMOST_P (w) | ||
| 3863 | && WINDOW_LEFT_FRINGE_WIDTH (w) | ||
| 3864 | && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) | ||
| 3865 | || WINDOW_LEFT_MARGIN_COLS (w) == 0)); | ||
| 3866 | else | ||
| 3867 | fringe_extended_p = (WINDOW_RIGHTMOST_P (w) | ||
| 3868 | && WINDOW_RIGHT_FRINGE_WIDTH (w) | ||
| 3869 | && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) | ||
| 3870 | || WINDOW_RIGHT_MARGIN_COLS (w) == 0)); | ||
| 3871 | 3862 | ||
| 3872 | /* Does the scroll bar exist yet? */ | 3863 | /* Does the scroll bar exist yet? */ |
| 3873 | if (NILP (w->vertical_scroll_bar)) | 3864 | if (NILP (w->vertical_scroll_bar)) |
| @@ -3896,11 +3887,11 @@ w32_set_vertical_scroll_bar (struct window *w, | |||
| 3896 | hwnd = SCROLL_BAR_W32_WINDOW (bar); | 3887 | hwnd = SCROLL_BAR_W32_WINDOW (bar); |
| 3897 | 3888 | ||
| 3898 | /* If already correctly positioned, do nothing. */ | 3889 | /* If already correctly positioned, do nothing. */ |
| 3899 | if ( XINT (bar->left) == sb_left | 3890 | if (XINT (bar->left) == sb_left |
| 3900 | && XINT (bar->top) == top | 3891 | && XINT (bar->top) == top |
| 3901 | && XINT (bar->width) == sb_width | 3892 | && XINT (bar->width) == sb_width |
| 3902 | && XINT (bar->height) == height | 3893 | && XINT (bar->height) == height |
| 3903 | && !NILP (bar->fringe_extended_p) == fringe_extended_p ) | 3894 | && bar->fringe_extended_p == fringe_extended_p) |
| 3904 | { | 3895 | { |
| 3905 | /* Redraw after clear_frame. */ | 3896 | /* Redraw after clear_frame. */ |
| 3906 | if (!my_show_window (f, hwnd, SW_NORMAL)) | 3897 | if (!my_show_window (f, hwnd, SW_NORMAL)) |
| @@ -3950,7 +3941,7 @@ w32_set_vertical_scroll_bar (struct window *w, | |||
| 3950 | unblock_input (); | 3941 | unblock_input (); |
| 3951 | } | 3942 | } |
| 3952 | } | 3943 | } |
| 3953 | bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil; | 3944 | bar->fringe_extended_p = fringe_extended_p; |
| 3954 | 3945 | ||
| 3955 | w32_set_scroll_bar_thumb (bar, portion, position, whole); | 3946 | w32_set_scroll_bar_thumb (bar, portion, position, whole); |
| 3956 | XSETVECTOR (barobj, bar); | 3947 | XSETVECTOR (barobj, bar); |