Mercurial > hg > xemacs-beta
comparison src/toolbar-common.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 | 02339d4ebed4 |
children | 943eaba38521 |
comparison
equal
deleted
inserted
replaced
743:968a715e8c6f | 744:8ae895c67ce7 |
---|---|
63 #define __INTERNAL_FLUSH(f) abort() | 63 #define __INTERNAL_FLUSH(f) abort() |
64 #endif | 64 #endif |
65 | 65 |
66 #include "toolbar-common.h" | 66 #include "toolbar-common.h" |
67 | 67 |
68 extern Lisp_Object Vtoolbar_shadow_thickness; | |
69 | |
68 static void __prepare_button_area (struct frame *f, | 70 static void __prepare_button_area (struct frame *f, |
69 struct toolbar_button *tb) | 71 struct toolbar_button *tb) |
70 { | 72 { |
71 int sx = tb->x; | 73 int sx = tb->x; |
72 int sy = tb->y; | 74 int sy = tb->y; |
75 int border_width = tb->border_width; | 77 int border_width = tb->border_width; |
76 int x_adj, width_adj, y_adj, height_adj; | 78 int x_adj, width_adj, y_adj, height_adj; |
77 struct device *d = XDEVICE (f->device); | 79 struct device *d = XDEVICE (f->device); |
78 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); | 80 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); |
79 struct window *w = XWINDOW (window); | 81 struct window *w = XWINDOW (window); |
80 int shadow_thickness = 2; | 82 int shadow_thickness; |
83 int def_shadow_thickness = XINT (Fspecifier_instance(Vtoolbar_shadow_thickness, window, Qnil, Qnil)); | |
81 face_index toolbar_findex; | 84 face_index toolbar_findex; |
82 | 85 |
83 if (tb->vertical) | 86 if (tb->vertical) |
84 { | 87 { |
85 x_adj = border_width; | 88 x_adj = border_width; |
100 ** | 103 ** |
101 ** Real toolbar buttons will check tb->enabled && tb->down | 104 ** Real toolbar buttons will check tb->enabled && tb->down |
102 */ | 105 */ |
103 if (EQ (Qt, tb->up_glyph)) | 106 if (EQ (Qt, tb->up_glyph)) |
104 { | 107 { |
105 shadow_thickness = 2; | 108 shadow_thickness = def_shadow_thickness; |
106 } | 109 } |
107 else if (NILP (tb->up_glyph)) | 110 else if (NILP (tb->up_glyph)) |
108 { | 111 { |
109 shadow_thickness = 0; | 112 shadow_thickness = 0; |
110 } | 113 } |
111 else | 114 else |
112 { | 115 { |
113 if (tb->enabled) | 116 if (tb->enabled) |
114 { | 117 { |
115 if (tb->down) | 118 if (tb->down) |
116 shadow_thickness = -2; | 119 shadow_thickness = -def_shadow_thickness; |
117 else | 120 else |
118 shadow_thickness = 2; | 121 shadow_thickness = def_shadow_thickness; |
119 } | 122 } |
120 else | 123 else |
121 { | 124 { |
122 shadow_thickness = 0; | 125 shadow_thickness = 0; |
123 } | 126 } |
696 /* There are certain startup paths that lead to update_EmacsFrame in | 699 /* There are certain startup paths that lead to update_EmacsFrame in |
697 faces.c being called before a new frame is fully initialized. In | 700 faces.c being called before a new frame is fully initialized. In |
698 particular before we have actually mapped it. That routine can | 701 particular before we have actually mapped it. That routine can |
699 call this one. So, we need to make sure that the frame is | 702 call this one. So, we need to make sure that the frame is |
700 actually ready before we try and draw all over it. */ | 703 actually ready before we try and draw all over it. */ |
701 | |
702 if (__INTERNAL_MAPPED_P(f)) | 704 if (__INTERNAL_MAPPED_P(f)) |
703 common_redraw_exposed_toolbars (f, 0, 0, FRAME_PIXWIDTH (f), | 705 common_redraw_exposed_toolbars (f, 0, 0, FRAME_PIXWIDTH (f), |
704 FRAME_PIXHEIGHT (f)); | 706 FRAME_PIXHEIGHT (f)); |
705 } | 707 } |