changeset 16251:ec1b1ae37295

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.
author Richard M. Stallman <rms@gnu.org>
date Sat, 21 Sep 1996 00:57:20 +0000
parents aaa0ecdc4772
children 41c962c84de5
files src/xterm.c
diffstat 1 files changed, 24 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Fri Sep 20 18:56:36 1996 +0000
+++ b/src/xterm.c	Sat Sep 21 00:57:20 1996 +0000
@@ -835,6 +835,8 @@
   if (first_unused >= f->width)
     first_unused = f->width;
 
+  first_unused += FRAME_LEFT_SCROLL_BAR_WIDTH (f);
+
   BLOCK_INPUT;
 
   do_line_dance ();
@@ -1301,7 +1303,7 @@
     abort ();
 
   ht = f->height;
-  intborder = f->output_data.x->internal_border_width;
+  intborder = CHAR_TO_PIXEL_COL (f, FRAME_LEFT_SCROLL_BAR_WIDTH (f));
 
   x_update_cursor (updating_frame, 0);
 
@@ -1389,8 +1391,8 @@
     left = 0;
   if (top < 0)
     top = 0;
-  if (right > f->width)
-    right = f->width;
+  if (right > FRAME_WINDOW_WIDTH (f))
+    right = FRAME_WINDOW_WIDTH (f);
   if (bottom > f->height)
     bottom = f->height;
 
@@ -2072,7 +2074,7 @@
   FRAME_PTR f = XFRAME (WINDOW_FRAME (w));
   int i;
   int row = 0;
-  int left = w->left;
+  int left = WINDOW_LEFT_MARGIN (w);
   int top = w->top;
   int height = XFASTINT (w->height) - ! MINI_WINDOW_P (w);
   int width = window_internal_width (w);
@@ -2149,10 +2151,10 @@
     {
       int column = (i == FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_row
 		    ? FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_col
-		    : w->left);
+		    : WINDOW_LEFT_MARGIN (w));
       int endcolumn = (i == FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row
 		       ? FRAME_X_DISPLAY_INFO (f)->mouse_face_end_col
-		       : w->left + width);
+		       : WINDOW_LEFT_MARGIN (w) + width);
       endcolumn = min (endcolumn, FRAME_CURRENT_GLYPHS (f)->used[i]);
 
       /* If the cursor's in the text we are about to rewrite,
@@ -2538,9 +2540,9 @@
   BLOCK_INPUT;
 
   {
-    int inside_width = VERTICAL_SCROLL_BAR_INSIDE_WIDTH (XINT (bar->width));
-    int inside_height = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height));
-    int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height));
+    int inside_width = VERTICAL_SCROLL_BAR_INSIDE_WIDTH (f, XINT (bar->width));
+    int inside_height = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, XINT (bar->height));
+    int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height));
 
     /* Make sure the values are reasonable, and try to preserve
        the distance between start and end.  */
@@ -2707,7 +2709,7 @@
      dragged.  */
   if (NILP (bar->dragging))
     {
-      int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (pixel_height);
+      int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, pixel_height);
 
       if (whole == 0)
 	x_scroll_bar_set_handle (bar, 0, top_range, 0);
@@ -2841,6 +2843,9 @@
   Window w = SCROLL_BAR_X_WINDOW (bar);
   FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
   GC gc = f->output_data.x->normal_gc;
+  int width_trim = (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)
+		    ? LEFT_VERTICAL_SCROLL_BAR_WIDTH_TRIM
+		    : 0);
 
   BLOCK_INPUT;
 
@@ -2850,8 +2855,10 @@
   XDrawRectangle (FRAME_X_DISPLAY (f), w, gc,
 
 		  /* x, y, width, height */
-		  0, 0, XINT (bar->width) - 1, XINT (bar->height) - 1);
-
+		  0, 0,
+		  XINT (bar->width) - 1 - width_trim,
+		  XINT (bar->height) - 1);
+    
   UNBLOCK_INPUT;
 }
 
@@ -2881,10 +2888,11 @@
   emacs_event->frame_or_window = bar->window;
   emacs_event->timestamp = event->xbutton.time;
   {
+    FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
     int internal_height
-      = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height));
+      = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, XINT (bar->height));
     int top_range
-      = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height));
+      = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height));
     int y = event->xbutton.y - VERTICAL_SCROLL_BAR_TOP_BORDER;
 
     if (y < 0) y = 0;
@@ -3003,9 +3011,9 @@
   else
     {
       int inside_height
-	= VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height));
+	= VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, XINT (bar->height));
       int top_range
-	= VERTICAL_SCROLL_BAR_TOP_RANGE     (XINT (bar->height));
+	= VERTICAL_SCROLL_BAR_TOP_RANGE     (f, XINT (bar->height));
 
       win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER;