diff options
| author | Richard M. Stallman | 1996-09-21 00:57:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-09-21 00:57:20 +0000 |
| commit | d9cdbb3d95e89d5334a21936d48a7ba18ba83940 (patch) | |
| tree | f48b84ab59664f2934a114986eec733acbcb8a66 /src | |
| parent | f55d65a166427bb7716853957e2543901224611d (diff) | |
| download | emacs-d9cdbb3d95e89d5334a21936d48a7ba18ba83940.tar.gz emacs-d9cdbb3d95e89d5334a21936d48a7ba18ba83940.zip | |
Pass frame arg in calls to VERTICAL_SCROLL_BAR_INSIDE_HEIGHT
and VERTICAL_SCROLL_BAR_TOP_RANGE.
(XTclear_end_of_line): Shift end-of-line when there is a
left-side scroll bar by FRAME_LEFT_SCROLL_BAR_WIDTH.
(do_line_dance): Take into account the width of a left-side scroll bar.
(dumprectangle): Trim at FRAME_EXTERNAL_WIDTH instead of FRAME_WIDTH.
(fast_find_position): Use new macro WINDOW_LEFT_MARGIN.
(show_mouse_face): Likewise.
(x_scroll_bar_set_handle): VERTICAL_SCROLL_BAR_INSIDE_WIDTH now
requires the frame as an argument.
(x_scroll_bar_expose): Narrow the box slightly for a left-side scroll bar.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/src/xterm.c b/src/xterm.c index d1aa2d4e26e..99a302b6f72 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -835,6 +835,8 @@ XTclear_end_of_line (first_unused) | |||
| 835 | if (first_unused >= f->width) | 835 | if (first_unused >= f->width) |
| 836 | first_unused = f->width; | 836 | first_unused = f->width; |
| 837 | 837 | ||
| 838 | first_unused += FRAME_LEFT_SCROLL_BAR_WIDTH (f); | ||
| 839 | |||
| 838 | BLOCK_INPUT; | 840 | BLOCK_INPUT; |
| 839 | 841 | ||
| 840 | do_line_dance (); | 842 | do_line_dance (); |
| @@ -1301,7 +1303,7 @@ do_line_dance () | |||
| 1301 | abort (); | 1303 | abort (); |
| 1302 | 1304 | ||
| 1303 | ht = f->height; | 1305 | ht = f->height; |
| 1304 | intborder = f->output_data.x->internal_border_width; | 1306 | intborder = CHAR_TO_PIXEL_COL (f, FRAME_LEFT_SCROLL_BAR_WIDTH (f)); |
| 1305 | 1307 | ||
| 1306 | x_update_cursor (updating_frame, 0); | 1308 | x_update_cursor (updating_frame, 0); |
| 1307 | 1309 | ||
| @@ -1389,8 +1391,8 @@ dumprectangle (f, left, top, cols, rows) | |||
| 1389 | left = 0; | 1391 | left = 0; |
| 1390 | if (top < 0) | 1392 | if (top < 0) |
| 1391 | top = 0; | 1393 | top = 0; |
| 1392 | if (right > f->width) | 1394 | if (right > FRAME_WINDOW_WIDTH (f)) |
| 1393 | right = f->width; | 1395 | right = FRAME_WINDOW_WIDTH (f); |
| 1394 | if (bottom > f->height) | 1396 | if (bottom > f->height) |
| 1395 | bottom = f->height; | 1397 | bottom = f->height; |
| 1396 | 1398 | ||
| @@ -2072,7 +2074,7 @@ fast_find_position (window, pos, columnp, rowp) | |||
| 2072 | FRAME_PTR f = XFRAME (WINDOW_FRAME (w)); | 2074 | FRAME_PTR f = XFRAME (WINDOW_FRAME (w)); |
| 2073 | int i; | 2075 | int i; |
| 2074 | int row = 0; | 2076 | int row = 0; |
| 2075 | int left = w->left; | 2077 | int left = WINDOW_LEFT_MARGIN (w); |
| 2076 | int top = w->top; | 2078 | int top = w->top; |
| 2077 | int height = XFASTINT (w->height) - ! MINI_WINDOW_P (w); | 2079 | int height = XFASTINT (w->height) - ! MINI_WINDOW_P (w); |
| 2078 | int width = window_internal_width (w); | 2080 | int width = window_internal_width (w); |
| @@ -2149,10 +2151,10 @@ show_mouse_face (dpyinfo, hl) | |||
| 2149 | { | 2151 | { |
| 2150 | int column = (i == FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_row | 2152 | int column = (i == FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_row |
| 2151 | ? FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_col | 2153 | ? FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_col |
| 2152 | : w->left); | 2154 | : WINDOW_LEFT_MARGIN (w)); |
| 2153 | int endcolumn = (i == FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row | 2155 | int endcolumn = (i == FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row |
| 2154 | ? FRAME_X_DISPLAY_INFO (f)->mouse_face_end_col | 2156 | ? FRAME_X_DISPLAY_INFO (f)->mouse_face_end_col |
| 2155 | : w->left + width); | 2157 | : WINDOW_LEFT_MARGIN (w) + width); |
| 2156 | endcolumn = min (endcolumn, FRAME_CURRENT_GLYPHS (f)->used[i]); | 2158 | endcolumn = min (endcolumn, FRAME_CURRENT_GLYPHS (f)->used[i]); |
| 2157 | 2159 | ||
| 2158 | /* If the cursor's in the text we are about to rewrite, | 2160 | /* If the cursor's in the text we are about to rewrite, |
| @@ -2538,9 +2540,9 @@ x_scroll_bar_set_handle (bar, start, end, rebuild) | |||
| 2538 | BLOCK_INPUT; | 2540 | BLOCK_INPUT; |
| 2539 | 2541 | ||
| 2540 | { | 2542 | { |
| 2541 | int inside_width = VERTICAL_SCROLL_BAR_INSIDE_WIDTH (XINT (bar->width)); | 2543 | int inside_width = VERTICAL_SCROLL_BAR_INSIDE_WIDTH (f, XINT (bar->width)); |
| 2542 | int inside_height = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height)); | 2544 | int inside_height = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, XINT (bar->height)); |
| 2543 | int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)); | 2545 | int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
| 2544 | 2546 | ||
| 2545 | /* Make sure the values are reasonable, and try to preserve | 2547 | /* Make sure the values are reasonable, and try to preserve |
| 2546 | the distance between start and end. */ | 2548 | the distance between start and end. */ |
| @@ -2707,7 +2709,7 @@ XTset_vertical_scroll_bar (window, portion, whole, position) | |||
| 2707 | dragged. */ | 2709 | dragged. */ |
| 2708 | if (NILP (bar->dragging)) | 2710 | if (NILP (bar->dragging)) |
| 2709 | { | 2711 | { |
| 2710 | int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (pixel_height); | 2712 | int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, pixel_height); |
| 2711 | 2713 | ||
| 2712 | if (whole == 0) | 2714 | if (whole == 0) |
| 2713 | x_scroll_bar_set_handle (bar, 0, top_range, 0); | 2715 | x_scroll_bar_set_handle (bar, 0, top_range, 0); |
| @@ -2841,6 +2843,9 @@ x_scroll_bar_expose (bar, event) | |||
| 2841 | Window w = SCROLL_BAR_X_WINDOW (bar); | 2843 | Window w = SCROLL_BAR_X_WINDOW (bar); |
| 2842 | FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); | 2844 | FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
| 2843 | GC gc = f->output_data.x->normal_gc; | 2845 | GC gc = f->output_data.x->normal_gc; |
| 2846 | int width_trim = (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) | ||
| 2847 | ? LEFT_VERTICAL_SCROLL_BAR_WIDTH_TRIM | ||
| 2848 | : 0); | ||
| 2844 | 2849 | ||
| 2845 | BLOCK_INPUT; | 2850 | BLOCK_INPUT; |
| 2846 | 2851 | ||
| @@ -2850,8 +2855,10 @@ x_scroll_bar_expose (bar, event) | |||
| 2850 | XDrawRectangle (FRAME_X_DISPLAY (f), w, gc, | 2855 | XDrawRectangle (FRAME_X_DISPLAY (f), w, gc, |
| 2851 | 2856 | ||
| 2852 | /* x, y, width, height */ | 2857 | /* x, y, width, height */ |
| 2853 | 0, 0, XINT (bar->width) - 1, XINT (bar->height) - 1); | 2858 | 0, 0, |
| 2854 | 2859 | XINT (bar->width) - 1 - width_trim, | |
| 2860 | XINT (bar->height) - 1); | ||
| 2861 | |||
| 2855 | UNBLOCK_INPUT; | 2862 | UNBLOCK_INPUT; |
| 2856 | } | 2863 | } |
| 2857 | 2864 | ||
| @@ -2881,10 +2888,11 @@ x_scroll_bar_handle_click (bar, event, emacs_event) | |||
| 2881 | emacs_event->frame_or_window = bar->window; | 2888 | emacs_event->frame_or_window = bar->window; |
| 2882 | emacs_event->timestamp = event->xbutton.time; | 2889 | emacs_event->timestamp = event->xbutton.time; |
| 2883 | { | 2890 | { |
| 2891 | FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); | ||
| 2884 | int internal_height | 2892 | int internal_height |
| 2885 | = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height)); | 2893 | = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, XINT (bar->height)); |
| 2886 | int top_range | 2894 | int top_range |
| 2887 | = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)); | 2895 | = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
| 2888 | int y = event->xbutton.y - VERTICAL_SCROLL_BAR_TOP_BORDER; | 2896 | int y = event->xbutton.y - VERTICAL_SCROLL_BAR_TOP_BORDER; |
| 2889 | 2897 | ||
| 2890 | if (y < 0) y = 0; | 2898 | if (y < 0) y = 0; |
| @@ -3003,9 +3011,9 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) | |||
| 3003 | else | 3011 | else |
| 3004 | { | 3012 | { |
| 3005 | int inside_height | 3013 | int inside_height |
| 3006 | = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height)); | 3014 | = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, XINT (bar->height)); |
| 3007 | int top_range | 3015 | int top_range |
| 3008 | = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)); | 3016 | = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
| 3009 | 3017 | ||
| 3010 | win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER; | 3018 | win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER; |
| 3011 | 3019 | ||