comparison src/toolbar.c @ 744:8ae895c67ce7

[xemacs-hg @ 2002-02-04 15:44:37 by wmperry] Enable generic toolbar support for X11. Added new toolbar-shadow-thickness specifier.
author wmperry
date Mon, 04 Feb 2002 15:44:52 +0000
parents 190b164ddcac
children e38acbeb1cae
comparison
equal deleted inserted replaced
743:968a715e8c6f 744:8ae895c67ce7
43 Lisp_Object Vtoolbar_border_width[4]; 43 Lisp_Object Vtoolbar_border_width[4];
44 44
45 Lisp_Object Vdefault_toolbar, Vdefault_toolbar_visible_p; 45 Lisp_Object Vdefault_toolbar, Vdefault_toolbar_visible_p;
46 Lisp_Object Vdefault_toolbar_width, Vdefault_toolbar_height; 46 Lisp_Object Vdefault_toolbar_width, Vdefault_toolbar_height;
47 Lisp_Object Vdefault_toolbar_border_width; 47 Lisp_Object Vdefault_toolbar_border_width;
48 Lisp_Object Vtoolbar_shadow_thickness;
48 49
49 Lisp_Object Vdefault_toolbar_position; 50 Lisp_Object Vdefault_toolbar_position;
50 Lisp_Object Vtoolbar_buttons_captioned_p; 51 Lisp_Object Vtoolbar_buttons_captioned_p;
51 52
52 Lisp_Object Qtoolbar_buttonp; 53 Lisp_Object Qtoolbar_buttonp;
1246 noticeable difference given the infrequency with which this is 1247 noticeable difference given the infrequency with which this is
1247 probably going to be called. */ 1248 probably going to be called. */
1248 MARK_TOOLBAR_CHANGED; 1249 MARK_TOOLBAR_CHANGED;
1249 } 1250 }
1250 1251
1252 static void
1253 toolbar_shadows_changed (Lisp_Object specifier, struct window *w,
1254 Lisp_Object oldval)
1255 {
1256 struct frame *f = XFRAME (w->frame);
1257
1258 if (!f->frame_data)
1259 {
1260 /* If there is not frame data yet, we need to get the hell out
1261 ** of here. This can happen when the initial frame is being
1262 ** created and we set our specifiers internally.
1263 */
1264 return;
1265 }
1266 MAYBE_DEVMETH (XDEVICE (f->device), redraw_frame_toolbars, (f));
1267 }
1268
1251 1269
1252 void 1270 void
1253 syms_of_toolbar (void) 1271 syms_of_toolbar (void)
1254 { 1272 {
1255 INIT_LRECORD_IMPLEMENTATION (toolbar_button); 1273 INIT_LRECORD_IMPLEMENTATION (toolbar_button);
1604 set_specifier_caching (Vtoolbar_size[RIGHT_TOOLBAR], 1622 set_specifier_caching (Vtoolbar_size[RIGHT_TOOLBAR],
1605 offsetof (struct window, toolbar_size[RIGHT_TOOLBAR]), 1623 offsetof (struct window, toolbar_size[RIGHT_TOOLBAR]),
1606 toolbar_geometry_changed_in_window, 1624 toolbar_geometry_changed_in_window,
1607 offsetof (struct frame, toolbar_size[RIGHT_TOOLBAR]), 1625 offsetof (struct frame, toolbar_size[RIGHT_TOOLBAR]),
1608 frame_size_slipped, 0); 1626 frame_size_slipped, 0);
1627
1628 DEFVAR_SPECIFIER ("toolbar-shadow-thickness",
1629 &Vtoolbar_shadow_thickness /*
1630 *Width of shadows around toolbar buttons.
1631 This is a specifier; use `set-specifier' to change it.
1632 */ );
1633 Vtoolbar_shadow_thickness = Fmake_specifier (Qnatnum);
1634 set_specifier_caching(Vtoolbar_shadow_thickness,
1635 offsetof (struct window, toolbar_shadow_thickness),
1636 toolbar_shadows_changed,
1637 0,0, 0);
1638
1639 fb = Qnil;
1640
1641 #ifdef HAVE_TTY
1642 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
1643 #endif
1644 #ifdef HAVE_GTK
1645 fb = Fcons (Fcons (list1 (Qgtk), make_int (2)), fb);
1646 #endif
1647 #ifdef HAVE_X_WINDOWS
1648 fb = Fcons (Fcons (list1 (Qx), make_int (2)), fb);
1649 #endif
1650 #ifdef HAVE_MS_WINDOWS
1651 fb = Fcons (Fcons (list1 (Qmswindows), make_int (2)), fb);
1652 #endif
1653
1654 if (!NILP (fb))
1655 set_specifier_fallback (Vtoolbar_shadow_thickness, fb);
1609 1656
1610 fb = Qnil; 1657 fb = Qnil;
1611 #ifdef HAVE_TTY 1658 #ifdef HAVE_TTY
1612 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); 1659 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
1613 #endif 1660 #endif