aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-11-19 00:28:46 +0000
committerGerd Moellmann2000-11-19 00:28:46 +0000
commitae4a31d9c4c705074f6a179146053b76bb1ed95c (patch)
treedd5ac04e91ef120708b8a261c926c63369c151a2 /src
parent6d950f4cb0638638cdcd3c6f60ec96058499015c (diff)
downloademacs-ae4a31d9c4c705074f6a179146053b76bb1ed95c.tar.gz
emacs-ae4a31d9c4c705074f6a179146053b76bb1ed95c.zip
(struct scroll_bar): Members x_widget_low, x_widget_high
removed. (SCROLL_BAR_X_WIDGET): Get the widget via XtWindowToWidget. Take the X display as additional argument. (SET_SCROLL_BAR_X_WIDGET): Store the window of the widget, since `Widget' is a pointer type that's not easily stored in Lisp_Object form in a portable way.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/xterm.h b/src/xterm.h
index aaf14700ac3..f2294c558b8 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1,5 +1,6 @@
1/* Definitions and headers for communication with X protocol. 1/* Definitions and headers for communication with X protocol.
2 Copyright (C) 1989, 1993, 1994, 1998, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000
3 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -690,8 +691,8 @@ struct x_output
690 We use struct scroll_bar as a template for accessing fields of the 691 We use struct scroll_bar as a template for accessing fields of the
691 vector. */ 692 vector. */
692 693
693struct scroll_bar { 694struct scroll_bar
694 695{
695 /* These fields are shared by all vectors. */ 696 /* These fields are shared by all vectors. */
696 EMACS_INT size_from_Lisp_Vector_struct; 697 EMACS_INT size_from_Lisp_Vector_struct;
697 struct Lisp_Vector *next_from_Lisp_Vector_struct; 698 struct Lisp_Vector *next_from_Lisp_Vector_struct;
@@ -706,9 +707,6 @@ struct scroll_bar {
706 32-bit quantity, we store it split into two 32-bit values. */ 707 32-bit quantity, we store it split into two 32-bit values. */
707 Lisp_Object x_window_low, x_window_high; 708 Lisp_Object x_window_low, x_window_high;
708 709
709 /* Same as above for the widget. */
710 Lisp_Object x_widget_low, x_widget_high;
711
712 /* The position and size of the scroll bar in pixels, relative to the 710 /* The position and size of the scroll bar in pixels, relative to the
713 frame. */ 711 frame. */
714 Lisp_Object top, left, width, height; 712 Lisp_Object top, left, width, height;
@@ -760,13 +758,20 @@ struct scroll_bar {
760#define SET_SCROLL_BAR_X_WINDOW(ptr, id) \ 758#define SET_SCROLL_BAR_X_WINDOW(ptr, id) \
761 (SCROLL_BAR_UNPACK ((ptr)->x_window_low, (ptr)->x_window_high, (int) id)) 759 (SCROLL_BAR_UNPACK ((ptr)->x_window_low, (ptr)->x_window_high, (int) id))
762 760
763/* Extract the X widget of the scroll bar from a struct scroll_bar. */ 761/* Extract the X widget of the scroll bar from a struct scroll_bar.
764#define SCROLL_BAR_X_WIDGET(ptr) \ 762 XtWindowToWidget should be fast enough since Xt uses a hash table
765 ((Widget) SCROLL_BAR_PACK ((ptr)->x_widget_low, (ptr)->x_widget_high)) 763 to map windows to widgets. */
764
765#define SCROLL_BAR_X_WIDGET(dpy, ptr) \
766 XtWindowToWidget (dpy, SCROLL_BAR_X_WINDOW (ptr))
766 767
767/* Store a widget id in a struct scroll_bar. */ 768/* Store a widget id in a struct scroll_bar. */
768#define SET_SCROLL_BAR_X_WIDGET(ptr, w) \ 769
769 (SCROLL_BAR_UNPACK ((ptr)->x_widget_low, (ptr)->x_widget_high, (int) w)) 770#define SET_SCROLL_BAR_X_WIDGET(ptr, w) \
771 do { \
772 Window window = XtWindow (w); \
773 SET_SCROLL_BAR_X_WINDOW (ptr, window); \
774} while (0)
770 775
771 776
772/* Return the inside width of a vertical scroll bar, given the outside 777/* Return the inside width of a vertical scroll bar, given the outside