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 | |
| 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')
| -rw-r--r-- | src/ChangeLog | 14 | ||||
| -rw-r--r-- | src/nsterm.m | 13 | ||||
| -rw-r--r-- | src/w32term.c | 27 | ||||
| -rw-r--r-- | src/w32term.h | 4 | ||||
| -rw-r--r-- | src/window.h | 26 | ||||
| -rw-r--r-- | src/xterm.c | 13 | ||||
| -rw-r--r-- | src/xterm.h | 2 |
7 files changed, 49 insertions, 50 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0c8de046034..34ec9e971fe 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2013-08-13 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * window.h (WINDOW_FRINGE_EXTENDED_P): New macro. | ||
| 4 | * nsterm.m (ns_set_vertical_scroll_bar): Use it. Use convenient | ||
| 5 | bool instead of BOOL. | ||
| 6 | * w32term.h (struct scroll_bar): Convert fringe_extended_p | ||
| 7 | from Lisp_Object to bitfield. Adjust comment. | ||
| 8 | * w32term.c (x_scroll_bar_create): Adjust user. | ||
| 9 | Use WINDOW_FRINGE_EXTENDED_P and bool for boolean. | ||
| 10 | * xterm.c (XTset_vertical_scroll_bar): Likewise. | ||
| 11 | Use bool for boolean. | ||
| 12 | * xterm.h (struct scroll_bar): Prefer commonly used `unsigned' | ||
| 13 | to `unsigned int' when defining a bitfield. | ||
| 14 | |||
| 1 | 2013-08-13 Paul Eggert <eggert@cs.ucla.edu> | 15 | 2013-08-13 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 16 | ||
| 3 | * decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'. | 17 | * decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'. |
diff --git a/src/nsterm.m b/src/nsterm.m index e519244ac99..e1a60028ffc 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -3703,7 +3703,7 @@ ns_set_vertical_scroll_bar (struct window *window, | |||
| 3703 | int window_y, window_height; | 3703 | int window_y, window_height; |
| 3704 | int top, left, height, width, sb_width, sb_left; | 3704 | int top, left, height, width, sb_width, sb_left; |
| 3705 | EmacsScroller *bar; | 3705 | EmacsScroller *bar; |
| 3706 | BOOL fringe_extended_p; | 3706 | bool fringe_extended_p; |
| 3707 | 3707 | ||
| 3708 | /* optimization; display engine sends WAY too many of these.. */ | 3708 | /* optimization; display engine sends WAY too many of these.. */ |
| 3709 | if (!NILP (window->vertical_scroll_bar)) | 3709 | if (!NILP (window->vertical_scroll_bar)) |
| @@ -3740,16 +3740,7 @@ ns_set_vertical_scroll_bar (struct window *window, | |||
| 3740 | v = [view frame]; | 3740 | v = [view frame]; |
| 3741 | r.origin.y = (v.size.height - r.size.height - r.origin.y); | 3741 | r.origin.y = (v.size.height - r.size.height - r.origin.y); |
| 3742 | 3742 | ||
| 3743 | if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (window)) | 3743 | fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w); |
| 3744 | fringe_extended_p = (WINDOW_LEFTMOST_P (window) | ||
| 3745 | && WINDOW_LEFT_FRINGE_WIDTH (window) | ||
| 3746 | && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (window) | ||
| 3747 | || WINDOW_LEFT_MARGIN_COLS (window) == 0)); | ||
| 3748 | else | ||
| 3749 | fringe_extended_p = (WINDOW_RIGHTMOST_P (window) | ||
| 3750 | && WINDOW_RIGHT_FRINGE_WIDTH (window) | ||
| 3751 | && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (window) | ||
| 3752 | || WINDOW_RIGHT_MARGIN_COLS (window) == 0)); | ||
| 3753 | 3744 | ||
| 3754 | XSETWINDOW (win, window); | 3745 | XSETWINDOW (win, window); |
| 3755 | block_input (); | 3746 | block_input (); |
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); |
diff --git a/src/w32term.h b/src/w32term.h index 3c9cce35221..8a1bbd11766 100644 --- a/src/w32term.h +++ b/src/w32term.h | |||
| @@ -451,9 +451,9 @@ struct scroll_bar { | |||
| 451 | being dragged, this is Qnil. */ | 451 | being dragged, this is Qnil. */ |
| 452 | Lisp_Object dragging; | 452 | Lisp_Object dragging; |
| 453 | 453 | ||
| 454 | /* t if the background of the fringe that is adjacent to a scroll | 454 | /* 1 if the background of the fringe that is adjacent to a scroll |
| 455 | bar is extended to the gap between the fringe and the bar. */ | 455 | bar is extended to the gap between the fringe and the bar. */ |
| 456 | Lisp_Object fringe_extended_p; | 456 | unsigned fringe_extended_p : 1; |
| 457 | }; | 457 | }; |
| 458 | 458 | ||
| 459 | /* Turning a lisp vector value into a pointer to a struct scroll_bar. */ | 459 | /* Turning a lisp vector value into a pointer to a struct scroll_bar. */ |
diff --git a/src/window.h b/src/window.h index a9afbc7f4a3..9d41a14cd23 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -828,13 +828,25 @@ wset_next_buffers (struct window *w, Lisp_Object val) | |||
| 828 | #define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \ | 828 | #define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \ |
| 829 | (window_box_left ((W), TEXT_AREA) + (X)) | 829 | (window_box_left ((W), TEXT_AREA) + (X)) |
| 830 | 830 | ||
| 831 | /* This is the window in which the terminal's cursor should | 831 | /* Nonzero if the background of the window W's fringe that is adjacent to |
| 832 | be left when nothing is being done with it. This must | 832 | a scroll bar is extended to the gap between the fringe and the bar. */ |
| 833 | always be a leaf window, and its buffer is selected by | 833 | |
| 834 | the top level editing loop at the end of each command. | 834 | #define WINDOW_FRINGE_EXTENDED_P(w) \ |
| 835 | 835 | (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ | |
| 836 | This value is always the same as | 836 | ? (WINDOW_LEFTMOST_P (w) \ |
| 837 | FRAME_SELECTED_WINDOW (selected_frame). */ | 837 | && WINDOW_LEFT_FRINGE_WIDTH (w) \ |
| 838 | && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) \ | ||
| 839 | || WINDOW_LEFT_MARGIN_COLS (w) == 0)) \ | ||
| 840 | : (WINDOW_RIGHTMOST_P (w) \ | ||
| 841 | && WINDOW_RIGHT_FRINGE_WIDTH (w) \ | ||
| 842 | && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) \ | ||
| 843 | || WINDOW_RIGHT_MARGIN_COLS (w) == 0))) | ||
| 844 | |||
| 845 | /* This is the window in which the terminal's cursor should be left when | ||
| 846 | nothing is being done with it. This must always be a leaf window, and its | ||
| 847 | buffer is selected by the top level editing loop at the end of each command. | ||
| 848 | |||
| 849 | This value is always the same as FRAME_SELECTED_WINDOW (selected_frame). */ | ||
| 838 | 850 | ||
| 839 | extern Lisp_Object selected_window; | 851 | extern Lisp_Object selected_window; |
| 840 | 852 | ||
diff --git a/src/xterm.c b/src/xterm.c index 6f57836c9aa..15ad3bdf851 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -5155,7 +5155,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio | |||
| 5155 | int top, height, left, sb_left, width, sb_width; | 5155 | int top, height, left, sb_left, width, sb_width; |
| 5156 | int window_y, window_height; | 5156 | int window_y, window_height; |
| 5157 | #ifdef USE_TOOLKIT_SCROLL_BARS | 5157 | #ifdef USE_TOOLKIT_SCROLL_BARS |
| 5158 | int fringe_extended_p; | 5158 | bool fringe_extended_p; |
| 5159 | #endif | 5159 | #endif |
| 5160 | 5160 | ||
| 5161 | /* Get window dimensions. */ | 5161 | /* Get window dimensions. */ |
| @@ -5188,16 +5188,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio | |||
| 5188 | #endif | 5188 | #endif |
| 5189 | 5189 | ||
| 5190 | #ifdef USE_TOOLKIT_SCROLL_BARS | 5190 | #ifdef USE_TOOLKIT_SCROLL_BARS |
| 5191 | if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) | 5191 | fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w); |
| 5192 | fringe_extended_p = (WINDOW_LEFTMOST_P (w) | ||
| 5193 | && WINDOW_LEFT_FRINGE_WIDTH (w) | ||
| 5194 | && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) | ||
| 5195 | || WINDOW_LEFT_MARGIN_COLS (w) == 0)); | ||
| 5196 | else | ||
| 5197 | fringe_extended_p = (WINDOW_RIGHTMOST_P (w) | ||
| 5198 | && WINDOW_RIGHT_FRINGE_WIDTH (w) | ||
| 5199 | && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) | ||
| 5200 | || WINDOW_RIGHT_MARGIN_COLS (w) == 0)); | ||
| 5201 | #endif | 5192 | #endif |
| 5202 | 5193 | ||
| 5203 | /* Does the scroll bar exist yet? */ | 5194 | /* Does the scroll bar exist yet? */ |
diff --git a/src/xterm.h b/src/xterm.h index 5324ef628e7..fbc2f05a375 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -815,7 +815,7 @@ struct scroll_bar | |||
| 815 | 815 | ||
| 816 | /* 1 if the background of the fringe that is adjacent to a scroll | 816 | /* 1 if the background of the fringe that is adjacent to a scroll |
| 817 | bar is extended to the gap between the fringe and the bar. */ | 817 | bar is extended to the gap between the fringe and the bar. */ |
| 818 | unsigned int fringe_extended_p : 1; | 818 | unsigned fringe_extended_p : 1; |
| 819 | }; | 819 | }; |
| 820 | 820 | ||
| 821 | /* Turning a lisp vector value into a pointer to a struct scroll_bar. */ | 821 | /* Turning a lisp vector value into a pointer to a struct scroll_bar. */ |