Index: lisp/gutter-items.el =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/Attic/gutter-items.el,v retrieving revision 1.1.2.28 diff -u -r1.1.2.28 gutter-items.el --- lisp/gutter-items.el 2000/02/17 14:16:35 1.1.2.28 +++ lisp/gutter-items.el 2000/02/23 22:26:07 @@ -251,6 +251,12 @@ (make-glyph (vector 'tab-control :descriptor "Buffers" :face buffers-tab-face :orientation gutter-buffers-tab-orientation + (if (or (eq gutter-buffers-tab-orientation 'top) + (eq gutter-buffers-tab-orientation 'bottom)) + :pixel-width :pixel-height) + (if (or (eq gutter-buffers-tab-orientation 'top) + (eq gutter-buffers-tab-orientation 'bottom)) + '(gutter-pixel-width) '(gutter-pixel-height)) :properties (list :items (buffers-tab-items)))))) ;; This looks better than a 3d border (mapcar '(lambda (x) Index: src/glyphs-widget.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/glyphs-widget.c,v retrieving revision 1.1.2.30 diff -u -r1.1.2.30 glyphs-widget.c --- src/glyphs-widget.c 2000/02/21 21:53:27 1.1.2.30 +++ src/glyphs-widget.c 2000/02/23 22:26:17 @@ -149,6 +149,13 @@ } static void +check_valid_int_or_function (Lisp_Object data) +{ + if (!INTP (data) && !CONSP (data)) + signal_simple_error ("must be an integer or expresssion", data); +} + +static void check_valid_symbol (Lisp_Object data) { CHECK_SYMBOL (data); @@ -360,6 +367,8 @@ { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); struct image_instantiator_methods* meths; + Lisp_Object dynamic_width = Qnil; + Lisp_Object dynamic_height = Qnil; /* First just set up what we already have. */ if (width) *width = IMAGE_INSTANCE_WIDTH (ii); @@ -402,6 +411,19 @@ *height = h + 2 * WIDGET_BORDER_HEIGHT; } } + /* Finish off with dynamic sizing. */ + if (!NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii))) + { + dynamic_width = Feval (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)); + if (INTP (dynamic_width)) + *width = XINT (dynamic_width); + } + if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii))) + { + dynamic_height = Feval (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)); + if (INTP (dynamic_height)) + *height = XINT (dynamic_height); + } } } @@ -484,6 +506,8 @@ IMAGE_INSTANCE_WIDGET_PROPS (ii) = Qnil; SET_IMAGE_INSTANCE_WIDGET_FACE (ii, Qnil); IMAGE_INSTANCE_WIDGET_ITEMS (ii) = allocate_gui_item (); + IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii) = Qnil; + IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii) = Qnil; IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 1; IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 1; IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = 0; @@ -618,8 +642,13 @@ geometry gets called. */ if (!NILP (pixwidth)) /* pixwidth takes precendent */ { - pw = XINT (pixwidth); - IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0; + if (!INTP (pixwidth)) + IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii) = pixwidth; + else + { + pw = XINT (pixwidth); + IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0; + } } else if (!NILP (width)) { @@ -629,8 +658,13 @@ if (!NILP (pixheight)) { - ph = XINT (pixheight); - IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0; + if (!INTP (pixwidth)) + IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii) = pixheight; + else + { + ph = XINT (pixheight); + IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0; + } } else if (!NILP (height) && XINT (height) > 1) { @@ -1099,8 +1133,8 @@ #define VALID_WIDGET_KEYWORDS(type) do { \ IIFORMAT_VALID_KEYWORD (type, Q_width, check_valid_int); \ IIFORMAT_VALID_KEYWORD (type, Q_height, check_valid_int); \ - IIFORMAT_VALID_KEYWORD (type, Q_pixel_width, check_valid_int); \ - IIFORMAT_VALID_KEYWORD (type, Q_pixel_height, check_valid_int); \ + IIFORMAT_VALID_KEYWORD (type, Q_pixel_width, check_valid_int_or_function);\ + IIFORMAT_VALID_KEYWORD (type, Q_pixel_height, check_valid_int_or_function);\ IIFORMAT_VALID_KEYWORD (type, Q_face, check_valid_face); \ } while (0) @@ -1146,7 +1180,7 @@ IIFORMAT_VALID_KEYWORD (combo_box, Q_width, check_valid_int); IIFORMAT_VALID_KEYWORD (combo_box, Q_height, check_valid_int); - IIFORMAT_VALID_KEYWORD (combo_box, Q_pixel_width, check_valid_int); + IIFORMAT_VALID_KEYWORD (combo_box, Q_pixel_width, check_valid_int_or_function); IIFORMAT_VALID_KEYWORD (combo_box, Q_face, check_valid_face); IIFORMAT_VALID_KEYWORD (combo_box, Q_properties, check_valid_item_list); } @@ -1159,8 +1193,8 @@ IIFORMAT_HAS_SHARED_METHOD (scrollbar, instantiate, widget); VALID_GUI_KEYWORDS (scrollbar); - IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_width, check_valid_int); - IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_height, check_valid_int); + IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_width, check_valid_int_or_function); + IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_height, check_valid_int_or_function); IIFORMAT_VALID_KEYWORD (scrollbar, Q_face, check_valid_face); } @@ -1218,8 +1252,8 @@ IIFORMAT_HAS_METHOD (layout, normalize); IIFORMAT_HAS_METHOD (layout, query_geometry); IIFORMAT_HAS_METHOD (layout, layout); - IIFORMAT_VALID_KEYWORD (layout, Q_pixel_width, check_valid_int); - IIFORMAT_VALID_KEYWORD (layout, Q_pixel_height, check_valid_int); + IIFORMAT_VALID_KEYWORD (layout, Q_pixel_width, check_valid_int_or_function); + IIFORMAT_VALID_KEYWORD (layout, Q_pixel_height, check_valid_int_or_function); IIFORMAT_VALID_KEYWORD (layout, Q_orientation, check_valid_orientation); IIFORMAT_VALID_KEYWORD (layout, Q_justify, check_valid_justification); IIFORMAT_VALID_KEYWORD (layout, Q_border, check_valid_border); Index: src/glyphs.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.c,v retrieving revision 1.23.2.53 diff -u -r1.23.2.53 glyphs.c --- src/glyphs.c 2000/02/21 23:07:15 1.23.2.53 +++ src/glyphs.c 2000/02/23 22:26:31 @@ -660,6 +660,8 @@ mark_object (IMAGE_INSTANCE_WIDGET_PROPS (i)); mark_object (IMAGE_INSTANCE_WIDGET_FACE (i)); mark_object (IMAGE_INSTANCE_WIDGET_ITEMS (i)); + mark_object (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (i)); + mark_object (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (i)); case IMAGE_SUBWINDOW: mark_object (IMAGE_INSTANCE_SUBWINDOW_FRAME (i)); break; @@ -903,6 +905,12 @@ && internal_equal (IMAGE_INSTANCE_WIDGET_PROPS (i1), IMAGE_INSTANCE_WIDGET_PROPS (i2), depth + 1) + && internal_equal (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (i1), + IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (i2), + depth + 1) + && internal_equal (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (i1), + IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (i2), + depth + 1) )) return 0; break; @@ -4435,26 +4443,25 @@ actually really dumb now that we have dynamic geometry calculations. What should really happen is that the subwindow should query its child for an appropriate geometry. */ - if (NILP (width)) - IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = 20; - else + if (INTP (width)) { int w = 1; - CHECK_INT (width); if (XINT (width) > 1) w = XINT (width); IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = w; } - if (NILP (height)) - IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = 20; else + IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = 20; + + if (INTP (height)) { int h = 1; - CHECK_INT (height); if (XINT (height) > 1) h = XINT (height); IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = h; } + else + IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = 20; } DEFUN ("subwindowp", Fsubwindowp, 1, 1, 0, /* Index: src/glyphs.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.h,v retrieving revision 1.18.2.35 diff -u -r1.18.2.35 glyphs.h --- src/glyphs.h 2000/02/16 02:07:28 1.18.2.35 +++ src/glyphs.h 2000/02/23 22:26:34 @@ -531,6 +531,8 @@ Lisp_Object type; Lisp_Object props; /* properties or border*/ Lisp_Object items; /* a list of gui_items or children */ + Lisp_Object width; /* dynamic width spec. */ + Lisp_Object height; /* dynamic height spec. */ /* Change flags to augment dirty. */ unsigned int face_changed : 1; unsigned int items_changed : 1; @@ -632,6 +634,8 @@ IMAGE_INSTANCE_WIDTH(i) #define IMAGE_INSTANCE_WIDGET_HEIGHT(i) \ IMAGE_INSTANCE_HEIGHT(i) +#define IMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) ((i)->u.subwindow.width) +#define IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) ((i)->u.subwindow.height) #define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.type) #define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.props) #define SET_IMAGE_INSTANCE_WIDGET_FACE(i,f) \ @@ -718,6 +722,10 @@ IMAGE_INSTANCE_WIDGET_WIDTH (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_HEIGHT(i) \ IMAGE_INSTANCE_WIDGET_HEIGHT (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) \ + IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) \ + IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_TYPE(i) \ IMAGE_INSTANCE_WIDGET_TYPE (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDGET_PROPS(i) \ Index: src/gutter.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/gutter.h,v retrieving revision 1.1.2.7 diff -u -r1.1.2.7 gutter.h --- src/gutter.h 2000/02/17 14:16:46 1.1.2.7 +++ src/gutter.h 2000/02/23 22:26:34 @@ -64,11 +64,11 @@ void reset_gutter_display_lines (struct frame* f); #define WINDOW_GUTTER_BORDER_WIDTH(w, pos) \ -(NILP ((w)->gutter_border_width[pos]) ? 0 : XINT ((w)->gutter_border_width[pos])) +(INTP ((w)->gutter_border_width[pos]) ? XINT ((w)->gutter_border_width[pos]) : 0) #define WINDOW_GUTTER_SIZE(w, pos) \ -(NILP ((w)->gutter_size[pos]) ? 0 : XINT ((w)->gutter_size[pos])) +(INTP ((w)->gutter_size[pos]) ? XINT ((w)->gutter_size[pos]) : 0) #define WINDOW_GUTTER_SIZE_INTERNAL(w, pos) \ -(NILP ((w)->real_gutter_size[pos]) ? 0 : XINT ((w)->real_gutter_size[pos])) +(INTP ((w)->real_gutter_size[pos]) ? XINT ((w)->real_gutter_size[pos]) : 0) #define WINDOW_GUTTER_VISIBLE(w, pos) \ ((w)->gutter_visible_p[pos]) #define WINDOW_GUTTER(w, pos) \ Index: src/redisplay-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-msw.c,v retrieving revision 1.28.2.18 diff -u -r1.28.2.18 redisplay-msw.c --- src/redisplay-msw.c 2000/02/16 02:07:33 1.28.2.18 +++ src/redisplay-msw.c 2000/02/23 22:26:39 @@ -204,7 +204,7 @@ * Given F, retrieve device context. F can be a display frame, or * a print job. */ -INLINE HDC +static HDC get_frame_dc (struct frame *f) { if (FRAME_MSWINDOWS_P (f)) @@ -221,7 +221,7 @@ * Given F, retrieve compatible device context. F can be a display * frame, or a print job. */ -INLINE HDC +static HDC get_frame_compdc (struct frame *f) { if (FRAME_MSWINDOWS_P (f)) Index: src/redisplay.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay.h,v retrieving revision 1.7.2.20 diff -u -r1.7.2.20 redisplay.h --- src/redisplay.h 2000/02/17 14:16:48 1.7.2.20 +++ src/redisplay.h 2000/02/23 22:26:42 @@ -550,7 +550,6 @@ buffers_changed = 0; \ clip_changed = 0; \ extents_changed = 0; \ - faces_changed = 0; \ frame_changed = 0; \ icon_changed = 0; \ menubar_changed = 0; \