diff src/xterm.h @ 86161:3408ab8b4152

* xterm.h (struct scroll_bar): Only use Lisp_Object for lisp data. Turn integer fields into `int'. Merge x_window_low and x_window_high. (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK, SCROLL_BAR_X_WINDOW) (SET_SCROLL_BAR_X_WINDOW): Remove. (SCROLL_BAR_X_WIDGET, SET_SCROLL_BAR_X_WIDGET): Access the new x_window field directly. * xterm.c (x_scroll_bar_create): Use a pseudovector. Don't wrap/unwrap integers into Lisp_Objects. (XTset_vertical_scroll_bar, x_scroll_bar_handle_click) (x_scroll_bar_report_motion): Don't wrap/unwrap integers into Lisp_Objects. (x_term_init): Use SDATA. (x_window_to_scroll_bar, x_create_toolkit_scroll_bar) (x_scroll_bar_set_handle, x_scroll_bar_remove) (XTset_vertical_scroll_bar, x_scroll_bar_expose) (x_scroll_bar_report_motion, x_scroll_bar_clear): * xfns.c (x_set_background_color): * gtkutil.c (xg_create_scroll_bar, xg_set_toolkit_scroll_bar_thumb): Access the new x_window field directly.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 16 Nov 2007 21:04:30 +0000
parents 719d22550d12
children 107ccd98fa12 53108e6cea98
line wrap: on
line diff
--- a/src/xterm.h	Fri Nov 16 20:36:34 2007 +0000
+++ b/src/xterm.h	Fri Nov 16 21:04:30 2007 +0000
@@ -746,13 +746,14 @@
   /* The next and previous in the chain of scroll bars in this frame.  */
   Lisp_Object next, prev;
 
-  /* The X window representing this scroll bar.  Since this is a full
-     32-bit quantity, we store it split into two 32-bit values.  */
-  Lisp_Object x_window_low, x_window_high;
+  /* Fields from `x_window' down will not be traced by the GC.  */
+
+  /* The X window representing this scroll bar.  */
+  Window x_window;
 
   /* The position and size of the scroll bar in pixels, relative to the
      frame.  */
-  Lisp_Object top, left, width, height;
+  int top, left, width, height;
 
   /* The starting and ending positions of the handle, relative to the
      handle area (i.e. zero is the top position, not
@@ -765,7 +766,7 @@
      drawing handle bottoms VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below
      where they would be normally; the bottom and top are in a
      different co-ordinate system.  */
-  Lisp_Object start, end;
+  int start, end;
 
   /* If the scroll bar handle is currently being dragged by the user,
      this is the number of pixels from the top of the handle to the
@@ -773,11 +774,9 @@
      being dragged, this is Qnil.  */
   Lisp_Object dragging;
 
-#ifdef USE_TOOLKIT_SCROLL_BARS
-  /* t if the background of the fringe that is adjacent to a scroll
+  /* 1 if the background of the fringe that is adjacent to a scroll
      bar is extended to the gap between the fringe and the bar.  */
-  Lisp_Object fringe_extended_p;
-#endif
+  unsigned int fringe_extended_p : 1;
 };
 
 /* The number of elements a vector holding a struct scroll_bar needs.  */
@@ -790,36 +789,19 @@
 #define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec))
 
 
-/* Building a 32-bit C integer from two 16-bit lisp integers.  */
-#define SCROLL_BAR_PACK(low, high) (XINT (high) << 16 | XINT (low))
-
-/* Setting two lisp integers to the low and high words of a 32-bit C int.  */
-#define SCROLL_BAR_UNPACK(low, high, int32) \
-  (XSETINT ((low),   (int32)        & 0xffff), \
-   XSETINT ((high), ((int32) >> 16) & 0xffff))
-
-
-/* Extract the X window id of the scroll bar from a struct scroll_bar.  */
-#define SCROLL_BAR_X_WINDOW(ptr) \
-  ((Window) SCROLL_BAR_PACK ((ptr)->x_window_low, (ptr)->x_window_high))
-
-/* Store a window id in a struct scroll_bar.  */
-#define SET_SCROLL_BAR_X_WINDOW(ptr, id) \
-  (SCROLL_BAR_UNPACK ((ptr)->x_window_low, (ptr)->x_window_high, (int) id))
-
 /* Extract the X widget of the scroll bar from a struct scroll_bar.
    XtWindowToWidget should be fast enough since Xt uses a hash table
    to map windows to widgets.  */
 
 #define SCROLL_BAR_X_WIDGET(dpy, ptr) \
-  XtWindowToWidget (dpy, SCROLL_BAR_X_WINDOW (ptr))
+  XtWindowToWidget (dpy, ptr->x_window)
 
 /* Store a widget id in a struct scroll_bar.  */
 
 #define SET_SCROLL_BAR_X_WIDGET(ptr, w)		\
   do {						\
     Window window = XtWindow (w);		\
-    SET_SCROLL_BAR_X_WINDOW (ptr, window);	\
+    ptr->x_window = window;			\
 } while (0)