428
|
1 /* Generic toolbar implementation.
|
|
2 Copyright (C) 1995 Board of Trustees, University of Illinois.
|
|
3 Copyright (C) 1995 Sun Microsystems, Inc.
|
1318
|
4 Copyright (C) 1995, 1996, 2003 Ben Wing.
|
428
|
5 Copyright (C) 1996 Chuck Thompson.
|
|
6
|
|
7 This file is part of XEmacs.
|
|
8
|
|
9 XEmacs is free software; you can redistribute it and/or modify it
|
|
10 under the terms of the GNU General Public License as published by the
|
|
11 Free Software Foundation; either version 2, or (at your option) any
|
|
12 later version.
|
|
13
|
|
14 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
17 for more details.
|
|
18
|
|
19 You should have received a copy of the GNU General Public License
|
|
20 along with XEmacs; see the file COPYING. If not, write to
|
|
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
22 Boston, MA 02111-1307, USA. */
|
|
23
|
|
24 /* Synched up with: Not in FSF. */
|
|
25
|
|
26 /* Original implementation by Chuck Thompson for 19.12.
|
|
27 Default-toolbar-position and specifier-related stuff by Ben Wing. */
|
|
28
|
|
29 #include <config.h>
|
|
30 #include "lisp.h"
|
|
31
|
|
32 #include "buffer.h"
|
872
|
33 #include "frame-impl.h"
|
|
34 #include "device-impl.h"
|
428
|
35 #include "glyphs.h"
|
|
36 #include "redisplay.h"
|
|
37 #include "toolbar.h"
|
|
38 #include "window.h"
|
|
39
|
|
40 Lisp_Object Vtoolbar[4];
|
|
41 Lisp_Object Vtoolbar_size[4];
|
|
42 Lisp_Object Vtoolbar_visible_p[4];
|
|
43 Lisp_Object Vtoolbar_border_width[4];
|
|
44
|
|
45 Lisp_Object Vdefault_toolbar, Vdefault_toolbar_visible_p;
|
|
46 Lisp_Object Vdefault_toolbar_width, Vdefault_toolbar_height;
|
|
47 Lisp_Object Vdefault_toolbar_border_width;
|
744
|
48 Lisp_Object Vtoolbar_shadow_thickness;
|
428
|
49
|
|
50 Lisp_Object Vdefault_toolbar_position;
|
|
51 Lisp_Object Vtoolbar_buttons_captioned_p;
|
|
52
|
|
53 Lisp_Object Qtoolbar_buttonp;
|
|
54 Lisp_Object Q2D, Q3D, Q2d, Q3d;
|
|
55 Lisp_Object Q_size;
|
|
56
|
|
57 Lisp_Object Qinit_toolbar_from_resources;
|
|
58
|
1204
|
59 static const struct memory_description toolbar_button_description [] = {
|
934
|
60 { XD_LISP_OBJECT, offsetof (struct toolbar_button, next) },
|
|
61 { XD_LISP_OBJECT, offsetof (struct toolbar_button, frame) },
|
|
62 { XD_LISP_OBJECT, offsetof (struct toolbar_button, up_glyph) },
|
|
63 { XD_LISP_OBJECT, offsetof (struct toolbar_button, down_glyph) },
|
|
64 { XD_LISP_OBJECT, offsetof (struct toolbar_button, disabled_glyph) },
|
|
65 { XD_LISP_OBJECT, offsetof (struct toolbar_button, cap_up_glyph) },
|
|
66 { XD_LISP_OBJECT, offsetof (struct toolbar_button, cap_down_glyph) },
|
|
67 { XD_LISP_OBJECT, offsetof (struct toolbar_button, cap_disabled_glyph) },
|
|
68 { XD_LISP_OBJECT, offsetof (struct toolbar_button, callback) },
|
|
69 { XD_LISP_OBJECT, offsetof (struct toolbar_button, enabled_p) },
|
|
70 { XD_LISP_OBJECT, offsetof (struct toolbar_button, help_string) },
|
|
71 { XD_END }
|
|
72 };
|
428
|
73
|
|
74 static Lisp_Object
|
|
75 mark_toolbar_button (Lisp_Object obj)
|
|
76 {
|
|
77 struct toolbar_button *data = XTOOLBAR_BUTTON (obj);
|
|
78 mark_object (data->next);
|
|
79 mark_object (data->frame);
|
|
80 mark_object (data->up_glyph);
|
|
81 mark_object (data->down_glyph);
|
|
82 mark_object (data->disabled_glyph);
|
|
83 mark_object (data->cap_up_glyph);
|
|
84 mark_object (data->cap_down_glyph);
|
|
85 mark_object (data->cap_disabled_glyph);
|
|
86 mark_object (data->callback);
|
|
87 mark_object (data->enabled_p);
|
|
88 return data->help_string;
|
|
89 }
|
|
90
|
934
|
91 DEFINE_LRECORD_IMPLEMENTATION ("toolbar-button", toolbar_button,
|
|
92 0, /*dumpable-flag*/
|
|
93 mark_toolbar_button, 0, 0, 0, 0,
|
|
94 toolbar_button_description,
|
|
95 struct toolbar_button);
|
428
|
96
|
|
97 DEFUN ("toolbar-button-p", Ftoolbar_button_p, 1, 1, 0, /*
|
|
98 Return non-nil if OBJECT is a toolbar button.
|
|
99 */
|
|
100 (object))
|
|
101 {
|
|
102 return TOOLBAR_BUTTONP (object) ? Qt : Qnil;
|
|
103 }
|
|
104
|
|
105 /* Only query functions are provided for toolbar buttons. They are
|
|
106 generated and updated from a toolbar description list. Any
|
|
107 directly made changes would be wiped out the first time the toolbar
|
|
108 was marked as dirty and was regenerated. The exception to this is
|
|
109 set-toolbar-button-down-flag. Having this allows us to control the
|
|
110 toolbar from elisp. Since we only trigger the button callbacks on
|
|
111 up-mouse events and we reset the flag first, there shouldn't be any
|
|
112 way for this to get us in trouble (like if someone decides to
|
|
113 change the toolbar from a toolbar callback). */
|
|
114
|
|
115 DEFUN ("toolbar-button-callback", Ftoolbar_button_callback, 1, 1, 0, /*
|
|
116 Return the callback function associated with the toolbar BUTTON.
|
|
117 */
|
|
118 (button))
|
|
119 {
|
|
120 CHECK_TOOLBAR_BUTTON (button);
|
|
121
|
|
122 return XTOOLBAR_BUTTON (button)->callback;
|
|
123 }
|
|
124
|
|
125 DEFUN ("toolbar-button-help-string", Ftoolbar_button_help_string, 1, 1, 0, /*
|
|
126 Return the help string function associated with the toolbar BUTTON.
|
|
127 */
|
|
128 (button))
|
|
129 {
|
|
130 CHECK_TOOLBAR_BUTTON (button);
|
|
131
|
|
132 return XTOOLBAR_BUTTON (button)->help_string;
|
|
133 }
|
|
134
|
|
135 DEFUN ("toolbar-button-enabled-p", Ftoolbar_button_enabled_p, 1, 1, 0, /*
|
|
136 Return t if BUTTON is active.
|
|
137 */
|
|
138 (button))
|
|
139 {
|
|
140 CHECK_TOOLBAR_BUTTON (button);
|
|
141
|
|
142 return XTOOLBAR_BUTTON (button)->enabled ? Qt : Qnil;
|
|
143 }
|
|
144
|
|
145 DEFUN ("set-toolbar-button-down-flag", Fset_toolbar_button_down_flag, 2, 2, 0, /*
|
|
146 Don't touch.
|
|
147 */
|
|
148 (button, flag))
|
|
149 {
|
|
150 struct toolbar_button *tb;
|
|
151 char old_flag;
|
|
152
|
|
153 CHECK_TOOLBAR_BUTTON (button);
|
|
154 tb = XTOOLBAR_BUTTON (button);
|
|
155 old_flag = tb->down;
|
|
156
|
|
157 /* If the button is ignored, don't do anything. */
|
|
158 if (!tb->enabled)
|
|
159 return Qnil;
|
|
160
|
|
161 /* If flag is nil, unset the down flag, otherwise set it to true.
|
|
162 This also triggers an immediate redraw of the button if the flag
|
|
163 does change. */
|
|
164
|
|
165 if (NILP (flag))
|
|
166 tb->down = 0;
|
|
167 else
|
|
168 tb->down = 1;
|
|
169
|
|
170 if (tb->down != old_flag)
|
|
171 {
|
|
172 struct frame *f = XFRAME (tb->frame);
|
|
173 struct device *d;
|
|
174
|
|
175 if (DEVICEP (f->device))
|
|
176 {
|
|
177 d = XDEVICE (f->device);
|
|
178
|
|
179 if (DEVICE_LIVE_P (XDEVICE (f->device)))
|
|
180 {
|
|
181 tb->dirty = 1;
|
|
182 MAYBE_DEVMETH (d, output_toolbar_button, (f, button));
|
|
183 }
|
|
184 }
|
|
185 }
|
|
186
|
|
187 return Qnil;
|
|
188 }
|
|
189
|
|
190 Lisp_Object
|
|
191 get_toolbar_button_glyph (struct window *w, struct toolbar_button *tb)
|
|
192 {
|
|
193 Lisp_Object glyph = Qnil;
|
|
194
|
|
195 /* The selected glyph logic:
|
|
196
|
|
197 UP: up
|
|
198 DOWN: down -> up
|
|
199 DISABLED: disabled -> up
|
|
200 CAP-UP: cap-up -> up
|
|
201 CAP-DOWN: cap-down -> cap-up -> down -> up
|
|
202 CAP-DISABLED: cap-disabled -> cap-up -> disabled -> up
|
|
203 */
|
|
204
|
|
205 if (!NILP (w->toolbar_buttons_captioned_p))
|
|
206 {
|
|
207 if (tb->enabled && tb->down)
|
|
208 glyph = tb->cap_down_glyph;
|
|
209 else if (!tb->enabled)
|
|
210 glyph = tb->cap_disabled_glyph;
|
|
211
|
|
212 if (NILP (glyph))
|
|
213 glyph = tb->cap_up_glyph;
|
|
214 }
|
|
215
|
|
216 if (NILP (glyph))
|
|
217 {
|
|
218 if (tb->enabled && tb->down)
|
|
219 glyph = tb->down_glyph;
|
|
220 else if (!tb->enabled)
|
|
221 glyph = tb->disabled_glyph;
|
|
222 }
|
|
223
|
|
224 /* The non-captioned up button is the ultimate fallback. It is
|
|
225 the only one we guarantee exists. */
|
|
226 if (NILP (glyph))
|
|
227 glyph = tb->up_glyph;
|
|
228
|
|
229 return glyph;
|
|
230 }
|
|
231
|
|
232
|
|
233 static enum toolbar_pos
|
|
234 decode_toolbar_position (Lisp_Object position)
|
|
235 {
|
|
236 if (EQ (position, Qtop)) return TOP_TOOLBAR;
|
|
237 if (EQ (position, Qbottom)) return BOTTOM_TOOLBAR;
|
|
238 if (EQ (position, Qleft)) return LEFT_TOOLBAR;
|
|
239 if (EQ (position, Qright)) return RIGHT_TOOLBAR;
|
563
|
240 invalid_constant ("Invalid toolbar position", position);
|
428
|
241
|
1204
|
242 RETURN_NOT_REACHED (TOP_TOOLBAR);
|
428
|
243 }
|
|
244
|
|
245 DEFUN ("set-default-toolbar-position", Fset_default_toolbar_position, 1, 1, 0, /*
|
|
246 Set the position that the `default-toolbar' will be displayed at.
|
|
247 Valid positions are 'top, 'bottom, 'left and 'right.
|
|
248 See `default-toolbar-position'.
|
|
249 */
|
|
250 (position))
|
|
251 {
|
|
252 enum toolbar_pos cur = decode_toolbar_position (Vdefault_toolbar_position);
|
|
253 enum toolbar_pos new = decode_toolbar_position (position);
|
|
254
|
|
255 if (cur != new)
|
|
256 {
|
|
257 /* The following calls will automatically cause the dirty
|
|
258 flags to be set; we delay frame size changes to avoid
|
|
259 lots of frame flickering. */
|
1318
|
260 int depth = begin_hold_frame_size_changes ();
|
428
|
261 set_specifier_fallback (Vtoolbar[cur], list1 (Fcons (Qnil, Qnil)));
|
|
262 set_specifier_fallback (Vtoolbar[new], Vdefault_toolbar);
|
|
263 set_specifier_fallback (Vtoolbar_size[cur], list1 (Fcons (Qnil, Qzero)));
|
|
264 set_specifier_fallback (Vtoolbar_size[new],
|
|
265 new == TOP_TOOLBAR || new == BOTTOM_TOOLBAR
|
|
266 ? Vdefault_toolbar_height
|
|
267 : Vdefault_toolbar_width);
|
|
268 set_specifier_fallback (Vtoolbar_border_width[cur],
|
|
269 list1 (Fcons (Qnil, Qzero)));
|
|
270 set_specifier_fallback (Vtoolbar_border_width[new],
|
|
271 Vdefault_toolbar_border_width);
|
|
272 set_specifier_fallback (Vtoolbar_visible_p[cur],
|
|
273 list1 (Fcons (Qnil, Qt)));
|
|
274 set_specifier_fallback (Vtoolbar_visible_p[new],
|
|
275 Vdefault_toolbar_visible_p);
|
|
276 Vdefault_toolbar_position = position;
|
1318
|
277 unbind_to (depth);
|
428
|
278 }
|
|
279
|
|
280 return position;
|
|
281 }
|
|
282
|
|
283 DEFUN ("default-toolbar-position", Fdefault_toolbar_position, 0, 0, 0, /*
|
|
284 Return the position that the `default-toolbar' will be displayed at.
|
|
285 The `default-toolbar' will only be displayed here if the corresponding
|
|
286 position-specific toolbar specifier does not provide a value.
|
|
287 */
|
|
288 ())
|
|
289 {
|
|
290 return Vdefault_toolbar_position;
|
|
291 }
|
|
292
|
|
293
|
|
294 static Lisp_Object
|
|
295 update_toolbar_button (struct frame *f, struct toolbar_button *tb,
|
|
296 Lisp_Object desc, int pushright)
|
|
297 {
|
|
298 Lisp_Object *elt, glyphs, retval, buffer;
|
|
299 struct gcpro gcpro1, gcpro2;
|
|
300
|
|
301 elt = XVECTOR_DATA (desc);
|
|
302 buffer = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer;
|
|
303
|
|
304 if (!tb)
|
|
305 {
|
|
306 tb = alloc_lcrecord_type (struct toolbar_button, &lrecord_toolbar_button);
|
|
307 tb->next = Qnil;
|
793
|
308 tb->frame = wrap_frame (f);
|
428
|
309 tb->up_glyph = Qnil;
|
|
310 tb->down_glyph = Qnil;
|
|
311 tb->disabled_glyph = Qnil;
|
|
312 tb->cap_up_glyph = Qnil;
|
|
313 tb->cap_down_glyph = Qnil;
|
|
314 tb->cap_disabled_glyph = Qnil;
|
|
315 tb->callback = Qnil;
|
|
316 tb->enabled_p = Qnil;
|
|
317 tb->help_string = Qnil;
|
|
318
|
|
319 tb->enabled = 0;
|
|
320 tb->down = 0;
|
|
321 tb->pushright = pushright;
|
|
322 tb->blank = 0;
|
|
323 tb->x = tb->y = tb->width = tb->height = -1;
|
|
324 tb->dirty = 1;
|
|
325 }
|
793
|
326 retval = wrap_toolbar_button (tb);
|
428
|
327
|
|
328 /* Let's make sure nothing gets mucked up by the potential call to
|
|
329 eval farther down. */
|
|
330 GCPRO2 (retval, desc);
|
|
331
|
|
332 glyphs = (CONSP (elt[0]) ? elt[0] : symbol_value_in_buffer (elt[0], buffer));
|
|
333
|
|
334 /* If this is true we have a blank, otherwise it is an actual
|
|
335 button. */
|
|
336 if (KEYWORDP (glyphs))
|
|
337 {
|
|
338 int pos;
|
|
339 int style_seen = 0;
|
|
340 int size_seen = 0;
|
|
341 int len = XVECTOR_LENGTH (desc);
|
|
342
|
|
343 if (!tb->blank)
|
|
344 {
|
|
345 tb->blank = 1;
|
|
346 tb->dirty = 1;
|
|
347 }
|
|
348
|
|
349 for (pos = 0; pos < len; pos += 2)
|
|
350 {
|
|
351 Lisp_Object key = elt[pos];
|
|
352 Lisp_Object val = elt[pos + 1];
|
|
353
|
|
354 if (EQ (key, Q_style))
|
|
355 {
|
|
356 style_seen = 1;
|
|
357
|
|
358 if (EQ (val, Q2D) || EQ (val, Q2d))
|
|
359 {
|
|
360 if (!EQ (Qnil, tb->up_glyph) || !EQ (Qt, tb->disabled_glyph))
|
|
361 {
|
|
362 tb->up_glyph = Qnil;
|
|
363 tb->disabled_glyph = Qt;
|
|
364 tb->dirty = 1;
|
|
365 }
|
|
366 }
|
|
367 else if (EQ (val, Q3D) || (EQ (val, Q3d)))
|
|
368 {
|
|
369 if (!EQ (Qt, tb->up_glyph) || !EQ (Qnil, tb->disabled_glyph))
|
|
370 {
|
|
371 tb->up_glyph = Qt;
|
|
372 tb->disabled_glyph = Qnil;
|
|
373 tb->dirty = 1;
|
|
374 }
|
|
375 }
|
|
376 }
|
|
377 else if (EQ (key, Q_size))
|
|
378 {
|
|
379 size_seen = 1;
|
|
380
|
|
381 if (!EQ (val, tb->down_glyph))
|
|
382 {
|
|
383 tb->down_glyph = val;
|
|
384 tb->dirty = 1;
|
|
385 }
|
|
386 }
|
|
387 }
|
|
388
|
|
389 if (!style_seen)
|
|
390 {
|
|
391 /* The default style is 3D. */
|
|
392 if (!EQ (Qt, tb->up_glyph) || !EQ (Qnil, tb->disabled_glyph))
|
|
393 {
|
|
394 tb->up_glyph = Qt;
|
|
395 tb->disabled_glyph = Qnil;
|
|
396 tb->dirty = 1;
|
|
397 }
|
|
398 }
|
|
399
|
|
400 if (!size_seen)
|
|
401 {
|
|
402 /* The default width is set to nil. The device specific
|
|
403 code will fill it in at its discretion. */
|
|
404 if (!NILP (tb->down_glyph))
|
|
405 {
|
|
406 tb->down_glyph = Qnil;
|
|
407 tb->dirty = 1;
|
|
408 }
|
|
409 }
|
|
410
|
|
411 /* The rest of these fields are not used by blanks. We make
|
|
412 sure they are nulled out in case this button object formerly
|
|
413 represented a real button. */
|
|
414 if (!NILP (tb->callback)
|
|
415 || !NILP (tb->enabled_p)
|
|
416 || !NILP (tb->help_string))
|
|
417 {
|
|
418 tb->cap_up_glyph = Qnil;
|
|
419 tb->cap_down_glyph = Qnil;
|
|
420 tb->cap_disabled_glyph = Qnil;
|
|
421 tb->callback = Qnil;
|
|
422 tb->enabled_p = Qnil;
|
|
423 tb->help_string = Qnil;
|
|
424 tb->dirty = 1;
|
|
425 }
|
|
426 }
|
|
427 else
|
|
428 {
|
|
429 if (tb->blank)
|
|
430 {
|
|
431 tb->blank = 0;
|
|
432 tb->dirty = 1;
|
|
433 }
|
|
434
|
|
435 /* We know that we at least have an up_glyph. Well, no, we
|
|
436 don't. The user may have changed the button glyph on us. */
|
|
437 if (CONSP (glyphs))
|
|
438 {
|
|
439 if (!EQ (XCAR (glyphs), tb->up_glyph))
|
|
440 {
|
|
441 tb->up_glyph = XCAR (glyphs);
|
|
442 tb->dirty = 1;
|
|
443 }
|
|
444 glyphs = XCDR (glyphs);
|
|
445 }
|
|
446 else
|
|
447 tb->up_glyph = Qnil;
|
|
448
|
|
449 /* We might have a down_glyph. */
|
|
450 if (CONSP (glyphs))
|
|
451 {
|
|
452 if (!EQ (XCAR (glyphs), tb->down_glyph))
|
|
453 {
|
|
454 tb->down_glyph = XCAR (glyphs);
|
|
455 tb->dirty = 1;
|
|
456 }
|
|
457 glyphs = XCDR (glyphs);
|
|
458 }
|
|
459 else
|
|
460 tb->down_glyph = Qnil;
|
|
461
|
|
462 /* We might have a disabled_glyph. */
|
|
463 if (CONSP (glyphs))
|
|
464 {
|
|
465 if (!EQ (XCAR (glyphs), tb->disabled_glyph))
|
|
466 {
|
|
467 tb->disabled_glyph = XCAR (glyphs);
|
|
468 tb->dirty = 1;
|
|
469 }
|
|
470 glyphs = XCDR (glyphs);
|
|
471 }
|
|
472 else
|
|
473 tb->disabled_glyph = Qnil;
|
|
474
|
|
475 /* We might have a cap_up_glyph. */
|
|
476 if (CONSP (glyphs))
|
|
477 {
|
|
478 if (!EQ (XCAR (glyphs), tb->cap_up_glyph))
|
|
479 {
|
|
480 tb->cap_up_glyph = XCAR (glyphs);
|
|
481 tb->dirty = 1;
|
|
482 }
|
|
483 glyphs = XCDR (glyphs);
|
|
484 }
|
|
485 else
|
|
486 tb->cap_up_glyph = Qnil;
|
|
487
|
|
488 /* We might have a cap_down_glyph. */
|
|
489 if (CONSP (glyphs))
|
|
490 {
|
|
491 if (!EQ (XCAR (glyphs), tb->cap_down_glyph))
|
|
492 {
|
|
493 tb->cap_down_glyph = XCAR (glyphs);
|
|
494 tb->dirty = 1;
|
|
495 }
|
|
496 glyphs = XCDR (glyphs);
|
|
497 }
|
|
498 else
|
|
499 tb->cap_down_glyph = Qnil;
|
|
500
|
|
501 /* We might have a cap_disabled_glyph. */
|
|
502 if (CONSP (glyphs))
|
|
503 {
|
|
504 if (!EQ (XCAR (glyphs), tb->cap_disabled_glyph))
|
|
505 {
|
|
506 tb->cap_disabled_glyph = XCAR (glyphs);
|
|
507 tb->dirty = 1;
|
|
508 }
|
|
509 }
|
|
510 else
|
|
511 tb->cap_disabled_glyph = Qnil;
|
|
512
|
|
513 /* Update the callback. */
|
|
514 if (!EQ (tb->callback, elt[1]))
|
|
515 {
|
|
516 tb->callback = elt[1];
|
|
517 /* This does not have an impact on the display properties of the
|
|
518 button so we do not mark it as dirty if it has changed. */
|
|
519 }
|
|
520
|
|
521 /* Update the enabled field. */
|
|
522 if (!EQ (tb->enabled_p, elt[2]))
|
|
523 {
|
|
524 tb->enabled_p = elt[2];
|
|
525 tb->dirty = 1;
|
|
526 }
|
|
527
|
|
528 /* We always do the following because if the enabled status is
|
|
529 determined by a function its decision may change without us being
|
|
530 able to detect it. */
|
|
531 {
|
|
532 int old_enabled = tb->enabled;
|
|
533
|
|
534 if (NILP (tb->enabled_p))
|
|
535 tb->enabled = 0;
|
|
536 else if (EQ (tb->enabled_p, Qt))
|
|
537 tb->enabled = 1;
|
|
538 else
|
|
539 {
|
|
540 if (NILP (tb->enabled_p) || EQ (tb->enabled_p, Qt))
|
|
541 /* short-circuit the common case for speed */
|
|
542 tb->enabled = !NILP (tb->enabled_p);
|
|
543 else
|
|
544 {
|
853
|
545 /* #### do we really need to protect this call? */
|
428
|
546 Lisp_Object result =
|
853
|
547 eval_in_buffer_trapping_problems
|
428
|
548 ("Error in toolbar enabled-p form",
|
|
549 XBUFFER
|
|
550 (WINDOW_BUFFER
|
|
551 (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)))),
|
853
|
552 tb->enabled_p, 0);
|
428
|
553 if (UNBOUNDP (result))
|
|
554 /* #### if there was an error in the enabled-p
|
|
555 form, should we pretend like it's enabled
|
|
556 or disabled? */
|
|
557 tb->enabled = 0;
|
|
558 else
|
|
559 tb->enabled = !NILP (result);
|
|
560 }
|
|
561 }
|
|
562
|
|
563 if (old_enabled != tb->enabled)
|
|
564 tb->dirty = 1;
|
|
565 }
|
|
566
|
|
567 /* Update the help echo string. */
|
|
568 if (!EQ (tb->help_string, elt[3]))
|
|
569 {
|
|
570 tb->help_string = elt[3];
|
|
571 /* This does not have an impact on the display properties of the
|
|
572 button so we do not mark it as dirty if it has changed. */
|
|
573 }
|
|
574 }
|
|
575
|
|
576 /* If this flag changes, the position is changing for sure unless
|
|
577 some very unlikely geometry occurs. */
|
|
578 if (tb->pushright != pushright)
|
|
579 {
|
|
580 tb->pushright = pushright;
|
|
581 tb->dirty = 1;
|
|
582 }
|
|
583
|
|
584 /* The position and size fields are only manipulated in the
|
|
585 device-dependent code. */
|
|
586 UNGCPRO;
|
|
587 return retval;
|
|
588 }
|
|
589
|
|
590 void
|
|
591 mark_frame_toolbar_buttons_dirty (struct frame *f, enum toolbar_pos pos)
|
|
592 {
|
|
593 Lisp_Object button = FRAME_TOOLBAR_BUTTONS (f, pos);
|
|
594
|
|
595 while (!NILP (button))
|
|
596 {
|
|
597 struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
|
|
598 tb->dirty = 1;
|
|
599 button = tb->next;
|
|
600 }
|
|
601 return;
|
|
602 }
|
|
603
|
|
604 static Lisp_Object
|
|
605 compute_frame_toolbar_buttons (struct frame *f, enum toolbar_pos pos,
|
|
606 Lisp_Object toolbar)
|
|
607 {
|
|
608 Lisp_Object buttons, prev_button, first_button;
|
|
609 Lisp_Object orig_toolbar = toolbar;
|
|
610 int pushright_seen = 0;
|
|
611 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
|
|
612
|
|
613 first_button = FRAME_TOOLBAR_BUTTONS (f, pos);
|
|
614 buttons = prev_button = first_button;
|
|
615
|
|
616 /* Yes, we're being paranoid. */
|
|
617 GCPRO5 (toolbar, buttons, prev_button, first_button, orig_toolbar);
|
|
618
|
|
619 if (NILP (toolbar))
|
|
620 {
|
|
621 /* The output mechanisms will take care of clearing the former
|
|
622 toolbar. */
|
|
623 UNGCPRO;
|
|
624 return Qnil;
|
|
625 }
|
|
626
|
|
627 if (!CONSP (toolbar))
|
563
|
628 sferror ("toolbar description must be a list", toolbar);
|
428
|
629
|
|
630 /* First synchronize any existing buttons. */
|
|
631 while (!NILP (toolbar) && !NILP (buttons))
|
|
632 {
|
|
633 struct toolbar_button *tb;
|
|
634
|
|
635 if (NILP (XCAR (toolbar)))
|
|
636 {
|
|
637 if (pushright_seen)
|
563
|
638 sferror
|
428
|
639 ("more than one partition (nil) in toolbar description",
|
|
640 orig_toolbar);
|
|
641 else
|
|
642 pushright_seen = 1;
|
|
643 }
|
|
644 else
|
|
645 {
|
|
646 tb = XTOOLBAR_BUTTON (buttons);
|
|
647 update_toolbar_button (f, tb, XCAR (toolbar), pushright_seen);
|
|
648 prev_button = buttons;
|
|
649 buttons = tb->next;
|
|
650 }
|
|
651
|
|
652 toolbar = XCDR (toolbar);
|
|
653 }
|
|
654
|
|
655 /* If we hit the end of the toolbar, then clean up any excess
|
|
656 buttons and return. */
|
|
657 if (NILP (toolbar))
|
|
658 {
|
|
659 if (!NILP (buttons))
|
|
660 {
|
|
661 /* If this is the case the only thing we saw was a
|
|
662 pushright marker. */
|
|
663 if (EQ (buttons, first_button))
|
|
664 {
|
|
665 UNGCPRO;
|
|
666 return Qnil;
|
|
667 }
|
|
668 else
|
|
669 XTOOLBAR_BUTTON (prev_button)->next = Qnil;
|
|
670 }
|
|
671 UNGCPRO;
|
|
672 return first_button;
|
|
673 }
|
|
674
|
|
675 /* At this point there are more buttons on the toolbar than we
|
|
676 actually have in existence. */
|
|
677 while (!NILP (toolbar))
|
|
678 {
|
|
679 Lisp_Object new_button;
|
|
680
|
|
681 if (NILP (XCAR (toolbar)))
|
|
682 {
|
|
683 if (pushright_seen)
|
563
|
684 sferror
|
428
|
685 ("more than one partition (nil) in toolbar description",
|
|
686 orig_toolbar);
|
|
687 else
|
|
688 pushright_seen = 1;
|
|
689 }
|
|
690 else
|
|
691 {
|
|
692 new_button = update_toolbar_button (f, NULL, XCAR (toolbar),
|
|
693 pushright_seen);
|
|
694
|
|
695 if (NILP (first_button))
|
|
696 {
|
|
697 first_button = prev_button = new_button;
|
|
698 }
|
|
699 else
|
|
700 {
|
|
701 XTOOLBAR_BUTTON (prev_button)->next = new_button;
|
|
702 prev_button = new_button;
|
|
703 }
|
|
704 }
|
|
705
|
|
706 toolbar = XCDR (toolbar);
|
|
707 }
|
|
708
|
|
709 UNGCPRO;
|
|
710 return first_button;
|
|
711 }
|
|
712
|
|
713 static void
|
|
714 set_frame_toolbar (struct frame *f, enum toolbar_pos pos)
|
|
715 {
|
|
716 struct window *w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f));
|
|
717 Lisp_Object toolbar = w->toolbar[pos];
|
|
718 f->toolbar_buttons[pos] = (FRAME_REAL_TOOLBAR_VISIBLE (f, pos)
|
|
719 ? compute_frame_toolbar_buttons (f, pos, toolbar)
|
|
720 : Qnil);
|
|
721 }
|
|
722
|
|
723 static void
|
|
724 compute_frame_toolbars_data (struct frame *f)
|
|
725 {
|
442
|
726 set_frame_toolbar (f, TOP_TOOLBAR);
|
|
727 set_frame_toolbar (f, BOTTOM_TOOLBAR);
|
|
728 set_frame_toolbar (f, LEFT_TOOLBAR);
|
|
729 set_frame_toolbar (f, RIGHT_TOOLBAR);
|
428
|
730 }
|
|
731
|
905
|
732 /* Update the toolbar geometry separately from actually displaying the
|
|
733 toolbar. This is necessary because both the gutter and the toolbar
|
|
734 are competing for redisplay cycles and, unfortunately, gutter
|
|
735 updates happen late in the game. Firstly they are done inside of
|
|
736 redisplay proper and secondly subcontrols may not get moved until
|
|
737 the next screen refresh. Only after subcontrols have been moved to
|
|
738 their final destinations can we be certain of updating the
|
|
739 toolbar. Under X this probably is exacerbated by the toolbar button
|
|
740 dirty flags which prevent updates happening when they possibly
|
|
741 should. */
|
428
|
742 void
|
905
|
743 update_frame_toolbars_geometry (struct frame *f)
|
428
|
744 {
|
|
745 struct device *d = XDEVICE (f->device);
|
|
746
|
|
747 if (DEVICE_SUPPORTS_TOOLBARS_P (d)
|
905
|
748 && (f->toolbar_changed
|
|
749 || f->frame_layout_changed
|
|
750 || f->frame_changed
|
|
751 || f->clear))
|
428
|
752 {
|
|
753 int pos;
|
442
|
754
|
428
|
755 /* We're not officially "in redisplay", so we still have a
|
|
756 chance to re-layout toolbars and windows. This is done here,
|
|
757 because toolbar is the only thing which currently might
|
|
758 necessitate this layout, as it is outside any windows. We
|
|
759 take care not to change size if toolbar geometry is really
|
|
760 unchanged, as it will hose windows whose pixsizes are not
|
|
761 multiple of character sizes. */
|
|
762
|
|
763 for (pos = 0; pos < 4; pos++)
|
|
764 if (FRAME_REAL_TOOLBAR_SIZE (f, pos)
|
|
765 != FRAME_CURRENT_TOOLBAR_SIZE (f, pos))
|
|
766 {
|
|
767 int width, height;
|
|
768 pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f),
|
|
769 &width, &height);
|
|
770 change_frame_size (f, height, width, 0);
|
905
|
771 MARK_FRAME_LAYOUT_CHANGED (f);
|
428
|
772 break;
|
|
773 }
|
|
774
|
905
|
775 for (pos = 0; pos < 4; pos++) {
|
428
|
776 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos);
|
905
|
777 }
|
428
|
778
|
|
779 /* Removed the check for the minibuffer here. We handle this
|
|
780 more correctly now by consistently using
|
|
781 FRAME_LAST_NONMINIBUF_WINDOW instead of FRAME_SELECTED_WINDOW
|
|
782 throughout the toolbar code. */
|
|
783 compute_frame_toolbars_data (f);
|
905
|
784
|
|
785 /* Clear the previous toolbar locations. If we do it later
|
|
786 (after redisplay) we end up clearing what we have just
|
|
787 displayed. */
|
|
788 MAYBE_DEVMETH (d, clear_frame_toolbars, (f));
|
|
789 }
|
|
790 }
|
428
|
791
|
905
|
792 /* Actually redisplay the toolbar buttons. */
|
|
793 void
|
|
794 update_frame_toolbars (struct frame *f)
|
|
795 {
|
|
796 struct device *d = XDEVICE (f->device);
|
|
797
|
|
798 if (DEVICE_SUPPORTS_TOOLBARS_P (d)
|
|
799 && (f->toolbar_changed
|
|
800 || f->frame_layout_changed
|
|
801 || f->frame_changed
|
|
802 || f->clear))
|
|
803 {
|
428
|
804 DEVMETH (d, output_frame_toolbars, (f));
|
|
805 }
|
|
806
|
|
807 f->toolbar_changed = 0;
|
|
808 }
|
|
809
|
|
810 void
|
|
811 init_frame_toolbars (struct frame *f)
|
|
812 {
|
|
813 struct device *d = XDEVICE (f->device);
|
|
814
|
|
815 if (DEVICE_SUPPORTS_TOOLBARS_P (d))
|
|
816 {
|
|
817 Lisp_Object frame;
|
|
818 int pos;
|
|
819
|
|
820 compute_frame_toolbars_data (f);
|
793
|
821 frame = wrap_frame (f);
|
428
|
822 call_critical_lisp_code (XDEVICE (FRAME_DEVICE (f)),
|
|
823 Qinit_toolbar_from_resources,
|
|
824 frame);
|
|
825 MAYBE_DEVMETH (d, initialize_frame_toolbars, (f));
|
|
826
|
|
827 /* We are here as far in frame creation so cached specifiers are
|
|
828 already recomputed, and possibly modified by resource
|
|
829 initialization. Remember current toolbar geometry so next
|
|
830 redisplay will not needlessly relayout toolbars. */
|
|
831 for (pos = 0; pos < 4; pos++)
|
|
832 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos);
|
|
833 }
|
|
834 }
|
|
835
|
|
836 void
|
|
837 init_device_toolbars (struct device *d)
|
|
838 {
|
793
|
839 Lisp_Object device = wrap_device (d);
|
428
|
840
|
|
841 if (DEVICE_SUPPORTS_TOOLBARS_P (d))
|
|
842 call_critical_lisp_code (d,
|
|
843 Qinit_toolbar_from_resources,
|
|
844 device);
|
|
845 }
|
|
846
|
|
847 void
|
|
848 init_global_toolbars (struct device *d)
|
|
849 {
|
|
850 if (DEVICE_SUPPORTS_TOOLBARS_P (d))
|
|
851 call_critical_lisp_code (d,
|
|
852 Qinit_toolbar_from_resources,
|
|
853 Qglobal);
|
|
854 }
|
|
855
|
|
856 void
|
|
857 free_frame_toolbars (struct frame *f)
|
|
858 {
|
|
859 /* If we had directly allocated any memory for the toolbars instead
|
|
860 of using all Lisp_Objects this is where we would now free it. */
|
|
861
|
|
862 MAYBE_FRAMEMETH (f, free_frame_toolbars, (f));
|
|
863 }
|
|
864
|
|
865 void
|
|
866 get_toolbar_coords (struct frame *f, enum toolbar_pos pos, int *x, int *y,
|
|
867 int *width, int *height, int *vert, int for_layout)
|
|
868 {
|
|
869 int visible_top_toolbar_height, visible_bottom_toolbar_height;
|
|
870 int adjust = (for_layout ? 1 : 0);
|
|
871
|
|
872 /* The top and bottom toolbars take precedence over the left and
|
|
873 right. */
|
|
874 visible_top_toolbar_height = (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)
|
|
875 ? FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) +
|
|
876 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f)
|
|
877 : 0);
|
|
878 visible_bottom_toolbar_height = (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)
|
|
879 ? FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) +
|
|
880 2 *
|
|
881 FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)
|
|
882 : 0);
|
|
883
|
|
884 /* We adjust the width and height by one to give us a narrow border
|
|
885 at the outside edges. However, when we are simply determining
|
|
886 toolbar location we don't want to do that. */
|
|
887
|
|
888 switch (pos)
|
|
889 {
|
|
890 case TOP_TOOLBAR:
|
|
891 *x = 1;
|
|
892 *y = 0; /* #### should be 1 if no menubar */
|
|
893 *width = FRAME_PIXWIDTH (f) - 2;
|
|
894 *height = FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) +
|
|
895 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f) - adjust;
|
|
896 *vert = 0;
|
|
897 break;
|
|
898 case BOTTOM_TOOLBAR:
|
|
899 *x = 1;
|
|
900 *y = FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) -
|
|
901 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f);
|
|
902 *width = FRAME_PIXWIDTH (f) - 2;
|
|
903 *height = FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) +
|
|
904 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f) - adjust;
|
|
905 *vert = 0;
|
|
906 break;
|
|
907 case LEFT_TOOLBAR:
|
|
908 *x = 1;
|
|
909 *y = visible_top_toolbar_height;
|
|
910 *width = FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) +
|
|
911 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f) - adjust;
|
|
912 *height = (FRAME_PIXHEIGHT (f) - visible_top_toolbar_height -
|
|
913 visible_bottom_toolbar_height - 1);
|
|
914 *vert = 1;
|
|
915 break;
|
|
916 case RIGHT_TOOLBAR:
|
|
917 *x = FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) -
|
|
918 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f);
|
|
919 *y = visible_top_toolbar_height;
|
|
920 *width = FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) +
|
|
921 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f) - adjust;
|
|
922 *height = (FRAME_PIXHEIGHT (f) - visible_top_toolbar_height -
|
|
923 visible_bottom_toolbar_height);
|
|
924 *vert = 1;
|
|
925 break;
|
|
926 default:
|
|
927 abort ();
|
|
928 }
|
|
929 }
|
|
930
|
|
931 #define CHECK_TOOLBAR(pos) do { \
|
|
932 if (FRAME_REAL_##pos##_VISIBLE (f)) \
|
|
933 { \
|
|
934 int x, y, width, height, vert; \
|
|
935 \
|
|
936 get_toolbar_coords (f, pos, &x, &y, &width, &height, &vert, 0); \
|
|
937 if ((x_coord >= x) && (x_coord < (x + width))) \
|
|
938 { \
|
|
939 if ((y_coord >= y) && (y_coord < (y + height))) \
|
|
940 return FRAME_TOOLBAR_BUTTONS (f, pos); \
|
|
941 } \
|
|
942 } \
|
|
943 } while (0)
|
|
944
|
|
945 static Lisp_Object
|
|
946 toolbar_buttons_at_pixpos (struct frame *f, int x_coord, int y_coord)
|
|
947 {
|
|
948 CHECK_TOOLBAR (TOP_TOOLBAR);
|
|
949 CHECK_TOOLBAR (BOTTOM_TOOLBAR);
|
|
950 CHECK_TOOLBAR (LEFT_TOOLBAR);
|
|
951 CHECK_TOOLBAR (RIGHT_TOOLBAR);
|
|
952
|
|
953 return Qnil;
|
|
954 }
|
|
955 #undef CHECK_TOOLBAR
|
|
956
|
|
957 /* The device dependent code actually does the work of positioning the
|
|
958 buttons, but we are free to access that information at this
|
|
959 level. */
|
|
960 Lisp_Object
|
|
961 toolbar_button_at_pixpos (struct frame *f, int x_coord, int y_coord)
|
|
962 {
|
|
963 Lisp_Object buttons = toolbar_buttons_at_pixpos (f, x_coord, y_coord);
|
|
964
|
|
965 while (!NILP (buttons))
|
|
966 {
|
|
967 struct toolbar_button *tb = XTOOLBAR_BUTTON (buttons);
|
|
968
|
|
969 if ((x_coord >= tb->x) && (x_coord < (tb->x + tb->width)))
|
|
970 {
|
|
971 if ((y_coord >= tb->y) && (y_coord < (tb->y + tb->height)))
|
|
972 {
|
|
973 /* If we are over a blank, return nil. */
|
|
974 if (tb->blank)
|
|
975 return Qnil;
|
|
976 else
|
|
977 return buttons;
|
|
978 }
|
|
979 }
|
|
980
|
|
981 buttons = tb->next;
|
|
982 }
|
|
983
|
|
984 /* We are not over a toolbar or we are over a blank in the toolbar. */
|
|
985 return Qnil;
|
|
986 }
|
|
987
|
|
988
|
|
989 /************************************************************************/
|
|
990 /* Toolbar specifier type */
|
|
991 /************************************************************************/
|
|
992
|
|
993 DEFINE_SPECIFIER_TYPE (toolbar);
|
|
994
|
563
|
995 #define CTB_ERROR(msg) do { \
|
|
996 maybe_signal_error (Qinvalid_argument, msg, button, Qtoolbar, errb); \
|
|
997 RETURN_SANS_WARNINGS Qnil; \
|
428
|
998 } while (0)
|
|
999
|
|
1000 /* Returns Q_style if key was :style, Qt if ok otherwise, Qnil if error. */
|
|
1001 static Lisp_Object
|
|
1002 check_toolbar_button_keywords (Lisp_Object button, Lisp_Object key,
|
578
|
1003 Lisp_Object val, Error_Behavior errb)
|
428
|
1004 {
|
|
1005 if (!KEYWORDP (key))
|
|
1006 {
|
563
|
1007 maybe_signal_error_2 (Qinvalid_argument, "Not a keyword", key, button,
|
|
1008 Qtoolbar, errb);
|
428
|
1009 return Qnil;
|
|
1010 }
|
|
1011
|
|
1012 if (EQ (key, Q_style))
|
|
1013 {
|
|
1014 if (!EQ (val, Q2D)
|
|
1015 && !EQ (val, Q3D)
|
|
1016 && !EQ (val, Q2d)
|
|
1017 && !EQ (val, Q3d))
|
|
1018 CTB_ERROR ("Unrecognized toolbar blank style");
|
|
1019
|
|
1020 return Q_style;
|
|
1021 }
|
|
1022 else if (EQ (key, Q_size))
|
|
1023 {
|
|
1024 if (!NATNUMP (val))
|
|
1025 CTB_ERROR ("invalid toolbar blank size");
|
|
1026 }
|
|
1027 else
|
|
1028 {
|
|
1029 CTB_ERROR ("invalid toolbar blank keyword");
|
|
1030 }
|
|
1031
|
|
1032 return Qt;
|
|
1033 }
|
|
1034
|
|
1035 /* toolbar button spec is [pixmap-pair function enabled-p help]
|
|
1036 or [:style 2d-or-3d :size width-or-height] */
|
|
1037
|
|
1038 DEFUN ("check-toolbar-button-syntax", Fcheck_toolbar_button_syntax, 1, 2, 0, /*
|
|
1039 Verify the syntax of entry BUTTON in a toolbar description list.
|
|
1040 If you want to verify the syntax of a toolbar description list as a
|
|
1041 whole, use `check-valid-instantiator' with a specifier type of 'toolbar.
|
|
1042 */
|
444
|
1043 (button, noerror))
|
428
|
1044 {
|
|
1045 Lisp_Object *elt, glyphs, value;
|
|
1046 int len;
|
578
|
1047 Error_Behavior errb = decode_error_behavior_flag (noerror);
|
428
|
1048
|
|
1049 if (!VECTORP (button))
|
|
1050 CTB_ERROR ("toolbar button descriptors must be vectors");
|
|
1051 elt = XVECTOR_DATA (button);
|
|
1052
|
|
1053 if (XVECTOR_LENGTH (button) == 2)
|
|
1054 {
|
|
1055 if (!EQ (Q_style, check_toolbar_button_keywords (button, elt[0],
|
|
1056 elt[1], errb)))
|
|
1057 CTB_ERROR ("must specify toolbar blank style");
|
|
1058
|
|
1059 return Qt;
|
|
1060 }
|
|
1061
|
|
1062 if (XVECTOR_LENGTH (button) != 4)
|
|
1063 CTB_ERROR ("toolbar button descriptors must be 2 or 4 long");
|
|
1064
|
|
1065 /* The first element must be a list of glyphs of length 1-6. The
|
|
1066 first entry is the pixmap for the up state, the second for the
|
|
1067 down state, the third for the disabled state, the fourth for the
|
|
1068 captioned up state, the fifth for the captioned down state and
|
|
1069 the sixth for the captioned disabled state. Only the up state is
|
|
1070 mandatory. */
|
|
1071 if (!CONSP (elt[0]))
|
|
1072 {
|
|
1073 /* We can't check the buffer-local here because we don't know
|
442
|
1074 which buffer to check in. #### I think this is a bad thing.
|
|
1075 See if we can't get enough information to this function so
|
|
1076 that it can check.
|
428
|
1077
|
|
1078 #### Wrong. We shouldn't be checking the value at all here.
|
|
1079 The user might set or change the value at any time. */
|
|
1080 value = Fsymbol_value (elt[0]);
|
|
1081
|
|
1082 if (!CONSP (value))
|
|
1083 {
|
|
1084 if (KEYWORDP (elt[0]))
|
|
1085 {
|
|
1086 int fsty = 0;
|
|
1087
|
|
1088 if (EQ (Q_style, check_toolbar_button_keywords (button, elt[0],
|
|
1089 elt[1],
|
|
1090 errb)))
|
|
1091 fsty++;
|
|
1092
|
|
1093 if (EQ (Q_style, check_toolbar_button_keywords (button, elt[2],
|
|
1094 elt[3],
|
|
1095 errb)))
|
|
1096 fsty++;
|
|
1097
|
|
1098 if (!fsty)
|
|
1099 CTB_ERROR ("must specify toolbar blank style");
|
|
1100 else if (EQ (elt[0], elt[2]))
|
|
1101 CTB_ERROR
|
|
1102 ("duplicate keywords in toolbar button blank description");
|
|
1103
|
|
1104 return Qt;
|
|
1105 }
|
|
1106 else
|
|
1107 CTB_ERROR ("first element of button must be a list (of glyphs)");
|
|
1108 }
|
|
1109 }
|
|
1110 else
|
|
1111 value = elt[0];
|
|
1112
|
|
1113 len = XINT (Flength (value));
|
|
1114 if (len < 1)
|
|
1115 CTB_ERROR ("toolbar button glyph list must have at least 1 entry");
|
|
1116
|
|
1117 if (len > 6)
|
|
1118 CTB_ERROR ("toolbar button glyph list can have at most 6 entries");
|
|
1119
|
|
1120 glyphs = value;
|
|
1121 while (!NILP (glyphs))
|
|
1122 {
|
|
1123 if (!GLYPHP (XCAR (glyphs)))
|
|
1124 {
|
|
1125 /* We allow nil for the down and disabled glyphs but not for
|
|
1126 the up glyph. */
|
|
1127 if (EQ (glyphs, value) || !NILP (XCAR (glyphs)))
|
|
1128 {
|
|
1129 CTB_ERROR
|
|
1130 ("all elements of toolbar button glyph list must be glyphs.");
|
|
1131 }
|
|
1132 }
|
|
1133 glyphs = XCDR (glyphs);
|
|
1134 }
|
|
1135
|
|
1136 /* The second element is the function to run when the button is
|
|
1137 activated. We do not do any checking on it because it is legal
|
|
1138 for the function to not be defined until after the toolbar is.
|
|
1139 It is the user's problem to get this right.
|
|
1140
|
|
1141 The third element is either a boolean indicating the enabled
|
|
1142 status or a function used to determine it. Again, it is the
|
|
1143 user's problem if this is wrong.
|
|
1144
|
|
1145 The fourth element, if not nil, must be a string which will be
|
|
1146 displayed as the help echo. */
|
|
1147
|
|
1148 /* #### This should be allowed to be a function returning a string
|
|
1149 as well as just a string. */
|
|
1150 if (!NILP (elt[3]) && !STRINGP (elt[3]))
|
|
1151 CTB_ERROR ("toolbar button help echo string must be a string");
|
|
1152
|
|
1153 return Qt;
|
|
1154 }
|
|
1155 #undef CTB_ERROR
|
|
1156
|
|
1157 static void
|
|
1158 toolbar_validate (Lisp_Object instantiator)
|
|
1159 {
|
|
1160 int pushright_seen = 0;
|
|
1161 Lisp_Object rest;
|
|
1162
|
|
1163 if (NILP (instantiator))
|
|
1164 return;
|
|
1165
|
|
1166 if (!CONSP (instantiator))
|
563
|
1167 sferror ("Toolbar spec must be list or nil", instantiator);
|
428
|
1168
|
|
1169 for (rest = instantiator; !NILP (rest); rest = XCDR (rest))
|
|
1170 {
|
|
1171 if (!CONSP (rest))
|
563
|
1172 sferror ("Bad list in toolbar spec", instantiator);
|
428
|
1173
|
|
1174 if (NILP (XCAR (rest)))
|
|
1175 {
|
|
1176 if (pushright_seen)
|
563
|
1177 sferror
|
|
1178 ("More than one partition (nil) in instantiator description",
|
|
1179 instantiator);
|
428
|
1180 else
|
|
1181 pushright_seen = 1;
|
|
1182 }
|
|
1183 else
|
|
1184 Fcheck_toolbar_button_syntax (XCAR (rest), Qnil);
|
|
1185 }
|
|
1186 }
|
|
1187
|
|
1188 static void
|
|
1189 toolbar_after_change (Lisp_Object specifier, Lisp_Object locale)
|
|
1190 {
|
|
1191 /* #### This is overkill. I really need to rethink the after-change
|
|
1192 functions to make them easier to use. */
|
|
1193 MARK_TOOLBAR_CHANGED;
|
|
1194 }
|
|
1195
|
|
1196 DEFUN ("toolbar-specifier-p", Ftoolbar_specifier_p, 1, 1, 0, /*
|
|
1197 Return non-nil if OBJECT is a toolbar specifier.
|
|
1198
|
442
|
1199 See `make-toolbar-specifier' for a description of possible toolbar
|
|
1200 instantiators.
|
428
|
1201 */
|
|
1202 (object))
|
|
1203 {
|
|
1204 return TOOLBAR_SPECIFIERP (object) ? Qt : Qnil;
|
|
1205 }
|
|
1206
|
|
1207
|
|
1208 /*
|
|
1209 Helper for invalidating the real specifier when default
|
|
1210 specifier caching changes
|
|
1211 */
|
|
1212 static void
|
|
1213 recompute_overlaying_specifier (Lisp_Object real_one[4])
|
|
1214 {
|
|
1215 enum toolbar_pos pos = decode_toolbar_position (Vdefault_toolbar_position);
|
|
1216 Fset_specifier_dirty_flag (real_one[pos]);
|
|
1217 }
|
|
1218
|
|
1219 static void
|
|
1220 toolbar_specs_changed (Lisp_Object specifier, struct window *w,
|
|
1221 Lisp_Object oldval)
|
|
1222 {
|
|
1223 /* This could be smarter but I doubt that it would make any
|
|
1224 noticeable difference given the infrequency with which this is
|
|
1225 probably going to be called.
|
|
1226 */
|
|
1227 MARK_TOOLBAR_CHANGED;
|
|
1228 }
|
|
1229
|
|
1230 static void
|
|
1231 default_toolbar_specs_changed (Lisp_Object specifier, struct window *w,
|
|
1232 Lisp_Object oldval)
|
|
1233 {
|
|
1234 recompute_overlaying_specifier (Vtoolbar);
|
|
1235 }
|
|
1236
|
|
1237 static void
|
|
1238 default_toolbar_size_changed_in_frame (Lisp_Object specifier, struct frame *f,
|
|
1239 Lisp_Object oldval)
|
|
1240 {
|
|
1241 recompute_overlaying_specifier (Vtoolbar_size);
|
|
1242 }
|
|
1243
|
|
1244 static void
|
|
1245 default_toolbar_border_width_changed_in_frame (Lisp_Object specifier,
|
|
1246 struct frame *f,
|
|
1247 Lisp_Object oldval)
|
|
1248 {
|
|
1249 recompute_overlaying_specifier (Vtoolbar_border_width);
|
|
1250 }
|
|
1251
|
|
1252 static void
|
|
1253 default_toolbar_visible_p_changed_in_frame (Lisp_Object specifier,
|
|
1254 struct frame *f,
|
|
1255 Lisp_Object oldval)
|
|
1256 {
|
|
1257 recompute_overlaying_specifier (Vtoolbar_visible_p);
|
|
1258 }
|
|
1259
|
|
1260 static void
|
|
1261 toolbar_geometry_changed_in_window (Lisp_Object specifier, struct window *w,
|
|
1262 Lisp_Object oldval)
|
|
1263 {
|
|
1264 MARK_TOOLBAR_CHANGED;
|
|
1265 MARK_WINDOWS_CHANGED (w);
|
|
1266 }
|
|
1267
|
|
1268 static void
|
|
1269 default_toolbar_size_changed_in_window (Lisp_Object specifier, struct window *w,
|
|
1270 Lisp_Object oldval)
|
|
1271 {
|
|
1272 recompute_overlaying_specifier (Vtoolbar_size);
|
|
1273 }
|
|
1274
|
|
1275 static void
|
|
1276 default_toolbar_border_width_changed_in_window (Lisp_Object specifier,
|
|
1277 struct window *w,
|
|
1278 Lisp_Object oldval)
|
|
1279 {
|
|
1280 recompute_overlaying_specifier (Vtoolbar_border_width);
|
|
1281 }
|
|
1282
|
|
1283 static void
|
|
1284 default_toolbar_visible_p_changed_in_window (Lisp_Object specifier,
|
|
1285 struct window *w,
|
|
1286 Lisp_Object oldval)
|
|
1287 {
|
|
1288 recompute_overlaying_specifier (Vtoolbar_visible_p);
|
|
1289 }
|
|
1290
|
|
1291 static void
|
|
1292 toolbar_buttons_captioned_p_changed (Lisp_Object specifier, struct window *w,
|
|
1293 Lisp_Object oldval)
|
|
1294 {
|
|
1295 /* This could be smarter but I doubt that it would make any
|
|
1296 noticeable difference given the infrequency with which this is
|
|
1297 probably going to be called. */
|
|
1298 MARK_TOOLBAR_CHANGED;
|
|
1299 }
|
|
1300
|
744
|
1301 static void
|
|
1302 toolbar_shadows_changed (Lisp_Object specifier, struct window *w,
|
|
1303 Lisp_Object oldval)
|
|
1304 {
|
|
1305 struct frame *f = XFRAME (w->frame);
|
|
1306
|
|
1307 if (!f->frame_data)
|
|
1308 {
|
|
1309 /* If there is not frame data yet, we need to get the hell out
|
|
1310 ** of here. This can happen when the initial frame is being
|
|
1311 ** created and we set our specifiers internally.
|
|
1312 */
|
|
1313 return;
|
|
1314 }
|
|
1315 MAYBE_DEVMETH (XDEVICE (f->device), redraw_frame_toolbars, (f));
|
|
1316 }
|
|
1317
|
428
|
1318
|
|
1319 void
|
|
1320 syms_of_toolbar (void)
|
|
1321 {
|
442
|
1322 INIT_LRECORD_IMPLEMENTATION (toolbar_button);
|
|
1323
|
563
|
1324 DEFSYMBOL_MULTIWORD_PREDICATE (Qtoolbar_buttonp);
|
|
1325 DEFSYMBOL (Q2D);
|
|
1326 DEFSYMBOL (Q3D);
|
|
1327 DEFSYMBOL (Q2d);
|
|
1328 DEFSYMBOL (Q3d);
|
|
1329 DEFKEYWORD (Q_size);
|
428
|
1330
|
563
|
1331 DEFSYMBOL (Qinit_toolbar_from_resources);
|
428
|
1332 DEFSUBR (Ftoolbar_button_p);
|
|
1333 DEFSUBR (Ftoolbar_button_callback);
|
|
1334 DEFSUBR (Ftoolbar_button_help_string);
|
|
1335 DEFSUBR (Ftoolbar_button_enabled_p);
|
|
1336 DEFSUBR (Fset_toolbar_button_down_flag);
|
|
1337 DEFSUBR (Fcheck_toolbar_button_syntax);
|
|
1338 DEFSUBR (Fset_default_toolbar_position);
|
|
1339 DEFSUBR (Fdefault_toolbar_position);
|
|
1340 DEFSUBR (Ftoolbar_specifier_p);
|
|
1341 }
|
|
1342
|
|
1343 void
|
|
1344 vars_of_toolbar (void)
|
|
1345 {
|
|
1346 staticpro (&Vdefault_toolbar_position);
|
|
1347 Vdefault_toolbar_position = Qtop;
|
|
1348
|
|
1349 #ifdef HAVE_WINDOW_SYSTEM
|
|
1350 Fprovide (Qtoolbar);
|
|
1351 #endif
|
|
1352 }
|
|
1353
|
|
1354 void
|
|
1355 specifier_type_create_toolbar (void)
|
|
1356 {
|
|
1357 INITIALIZE_SPECIFIER_TYPE (toolbar, "toolbar", "toolbar-specifier-p");
|
|
1358
|
|
1359 SPECIFIER_HAS_METHOD (toolbar, validate);
|
|
1360 SPECIFIER_HAS_METHOD (toolbar, after_change);
|
|
1361 }
|
|
1362
|
|
1363 void
|
|
1364 reinit_specifier_type_create_toolbar (void)
|
|
1365 {
|
|
1366 REINITIALIZE_SPECIFIER_TYPE (toolbar);
|
|
1367 }
|
|
1368
|
|
1369 void
|
|
1370 specifier_vars_of_toolbar (void)
|
|
1371 {
|
|
1372 Lisp_Object fb;
|
|
1373
|
|
1374 DEFVAR_SPECIFIER ("default-toolbar", &Vdefault_toolbar /*
|
|
1375 Specifier for a fallback toolbar.
|
|
1376 Use `set-specifier' to change this.
|
|
1377
|
|
1378 The position of this toolbar is specified in the function
|
|
1379 `default-toolbar-position'. If the corresponding position-specific
|
|
1380 toolbar (e.g. `top-toolbar' if `default-toolbar-position' is 'top)
|
|
1381 does not specify a toolbar in a particular domain (usually a window),
|
|
1382 then the value of `default-toolbar' in that domain, if any, will be
|
|
1383 used instead.
|
|
1384
|
|
1385 Note that the toolbar at any particular position will not be
|
|
1386 displayed unless its visibility flag is true and its thickness
|
|
1387 \(width or height, depending on orientation) is non-zero. The
|
|
1388 visibility is controlled by the specifiers `top-toolbar-visible-p',
|
|
1389 `bottom-toolbar-visible-p', `left-toolbar-visible-p', and
|
|
1390 `right-toolbar-visible-p', and the thickness is controlled by the
|
|
1391 specifiers `top-toolbar-height', `bottom-toolbar-height',
|
|
1392 `left-toolbar-width', and `right-toolbar-width'.
|
|
1393
|
|
1394 Note that one of the four visibility specifiers inherits from
|
|
1395 `default-toolbar-visibility' and one of the four thickness
|
|
1396 specifiers inherits from either `default-toolbar-width' or
|
|
1397 `default-toolbar-height' (depending on orientation), just
|
|
1398 like for the toolbar description specifiers (e.g. `top-toolbar')
|
|
1399 mentioned above.
|
|
1400
|
|
1401 Therefore, if you are setting `default-toolbar', you should control
|
|
1402 the visibility and thickness using `default-toolbar-visible-p',
|
|
1403 `default-toolbar-width', and `default-toolbar-height', rather than
|
|
1404 using position-specific specifiers. That way, you will get sane
|
|
1405 behavior if the user changes the default toolbar position.
|
|
1406
|
|
1407 The format of the instantiator for a toolbar is a list of
|
|
1408 toolbar-button-descriptors. Each toolbar-button-descriptor
|
|
1409 is a vector in one of the following formats:
|
|
1410
|
|
1411 [GLYPH-LIST FUNCTION ENABLED-P HELP] or
|
|
1412 [:style 2D-OR-3D] or
|
|
1413 [:style 2D-OR-3D :size WIDTH-OR-HEIGHT] or
|
|
1414 [:size WIDTH-OR-HEIGHT :style 2D-OR-3D]
|
|
1415
|
|
1416 Optionally, one of the toolbar-button-descriptors may be nil
|
|
1417 instead of a vector; this signifies the division between
|
|
1418 the toolbar buttons that are to be displayed flush-left,
|
|
1419 and the buttons to be displayed flush-right.
|
|
1420
|
|
1421 The first vector format above specifies a normal toolbar button;
|
|
1422 the others specify blank areas in the toolbar.
|
|
1423
|
|
1424 For the first vector format:
|
|
1425
|
|
1426 -- GLYPH-LIST should be a list of one to six glyphs (as created by
|
|
1427 `make-glyph') or a symbol whose value is such a list. The first
|
|
1428 glyph, which must be provided, is the glyph used to display the
|
|
1429 toolbar button when it is in the "up" (not pressed) state. The
|
|
1430 optional second glyph is for displaying the button when it is in
|
|
1431 the "down" (pressed) state. The optional third glyph is for when
|
|
1432 the button is disabled. The optional fourth, fifth and sixth glyphs
|
|
1433 are used to specify captioned versions for the up, down and disabled
|
|
1434 states respectively. The function `toolbar-make-button-list' is
|
|
1435 useful in creating these glyph lists. The specifier variable
|
|
1436 `toolbar-buttons-captioned-p' controls which glyphs are actually used.
|
|
1437
|
|
1438 -- Even if you do not provide separate down-state and disabled-state
|
|
1439 glyphs, the user will still get visual feedback to indicate which
|
|
1440 state the button is in. Buttons in the up-state are displayed
|
|
1441 with a shadowed border that gives a raised appearance to the
|
|
1442 button. Buttons in the down-state are displayed with shadows that
|
|
1443 give a recessed appearance. Buttons in the disabled state are
|
|
1444 displayed with no shadows, giving a 2-d effect.
|
|
1445
|
|
1446 -- If some of the toolbar glyphs are not provided, they inherit as follows:
|
|
1447
|
|
1448 UP: up
|
|
1449 DOWN: down -> up
|
|
1450 DISABLED: disabled -> up
|
|
1451 CAP-UP: cap-up -> up
|
|
1452 CAP-DOWN: cap-down -> cap-up -> down -> up
|
|
1453 CAP-DISABLED: cap-disabled -> cap-up -> disabled -> up
|
|
1454
|
|
1455 -- The second element FUNCTION is a function to be called when the
|
|
1456 toolbar button is activated (i.e. when the mouse is released over
|
|
1457 the toolbar button, if the press occurred in the toolbar). It
|
|
1458 can be any form accepted by `call-interactively', since this is
|
|
1459 how it is invoked.
|
|
1460
|
|
1461 -- The third element ENABLED-P specifies whether the toolbar button
|
|
1462 is enabled (disabled buttons do nothing when they are activated,
|
|
1463 and are displayed differently; see above). It should be either
|
|
1464 a boolean or a form that evaluates to a boolean.
|
|
1465
|
|
1466 -- The fourth element HELP, if non-nil, should be a string. This
|
|
1467 string is displayed in the echo area when the mouse passes over
|
|
1468 the toolbar button.
|
|
1469
|
|
1470 For the other vector formats (specifying blank areas of the toolbar):
|
|
1471
|
|
1472 -- 2D-OR-3D should be one of the symbols '2d or '3d, indicating
|
|
1473 whether the area is displayed with shadows (giving it a raised,
|
|
1474 3-d appearance) or without shadows (giving it a flat appearance).
|
|
1475
|
|
1476 -- WIDTH-OR-HEIGHT specifies the length, in pixels, of the blank
|
|
1477 area. If omitted, it defaults to a device-specific value
|
|
1478 (8 pixels for X devices).
|
|
1479 */ );
|
|
1480
|
|
1481 Vdefault_toolbar = Fmake_specifier (Qtoolbar);
|
|
1482 /* #### It would be even nicer if the specifier caching
|
|
1483 automatically knew about specifier fallbacks, so we didn't
|
|
1484 have to do it ourselves. */
|
|
1485 set_specifier_caching (Vdefault_toolbar,
|
438
|
1486 offsetof (struct window, default_toolbar),
|
428
|
1487 default_toolbar_specs_changed,
|
444
|
1488 0, 0, 0);
|
428
|
1489
|
|
1490 DEFVAR_SPECIFIER ("top-toolbar",
|
|
1491 &Vtoolbar[TOP_TOOLBAR] /*
|
|
1492 Specifier for the toolbar at the top of the frame.
|
|
1493 Use `set-specifier' to change this.
|
|
1494 See `default-toolbar' for a description of a valid toolbar instantiator.
|
|
1495 */ );
|
|
1496 Vtoolbar[TOP_TOOLBAR] = Fmake_specifier (Qtoolbar);
|
|
1497 set_specifier_caching (Vtoolbar[TOP_TOOLBAR],
|
438
|
1498 offsetof (struct window, toolbar[TOP_TOOLBAR]),
|
428
|
1499 toolbar_specs_changed,
|
444
|
1500 0, 0, 0);
|
428
|
1501
|
|
1502 DEFVAR_SPECIFIER ("bottom-toolbar",
|
|
1503 &Vtoolbar[BOTTOM_TOOLBAR] /*
|
|
1504 Specifier for the toolbar at the bottom of the frame.
|
|
1505 Use `set-specifier' to change this.
|
|
1506 See `default-toolbar' for a description of a valid toolbar instantiator.
|
|
1507
|
|
1508 Note that, unless the `default-toolbar-position' is `bottom', by
|
|
1509 default the height of the bottom toolbar (controlled by
|
|
1510 `bottom-toolbar-height') is 0; thus, a bottom toolbar will not be
|
|
1511 displayed even if you provide a value for `bottom-toolbar'.
|
|
1512 */ );
|
|
1513 Vtoolbar[BOTTOM_TOOLBAR] = Fmake_specifier (Qtoolbar);
|
|
1514 set_specifier_caching (Vtoolbar[BOTTOM_TOOLBAR],
|
438
|
1515 offsetof (struct window, toolbar[BOTTOM_TOOLBAR]),
|
428
|
1516 toolbar_specs_changed,
|
444
|
1517 0, 0, 0);
|
428
|
1518
|
|
1519 DEFVAR_SPECIFIER ("left-toolbar",
|
|
1520 &Vtoolbar[LEFT_TOOLBAR] /*
|
|
1521 Specifier for the toolbar at the left edge of the frame.
|
|
1522 Use `set-specifier' to change this.
|
|
1523 See `default-toolbar' for a description of a valid toolbar instantiator.
|
|
1524
|
|
1525 Note that, unless the `default-toolbar-position' is `left', by
|
|
1526 default the height of the left toolbar (controlled by
|
|
1527 `left-toolbar-width') is 0; thus, a left toolbar will not be
|
|
1528 displayed even if you provide a value for `left-toolbar'.
|
|
1529 */ );
|
|
1530 Vtoolbar[LEFT_TOOLBAR] = Fmake_specifier (Qtoolbar);
|
|
1531 set_specifier_caching (Vtoolbar[LEFT_TOOLBAR],
|
438
|
1532 offsetof (struct window, toolbar[LEFT_TOOLBAR]),
|
428
|
1533 toolbar_specs_changed,
|
444
|
1534 0, 0, 0);
|
428
|
1535
|
|
1536 DEFVAR_SPECIFIER ("right-toolbar",
|
|
1537 &Vtoolbar[RIGHT_TOOLBAR] /*
|
|
1538 Specifier for the toolbar at the right edge of the frame.
|
|
1539 Use `set-specifier' to change this.
|
|
1540 See `default-toolbar' for a description of a valid toolbar instantiator.
|
|
1541
|
|
1542 Note that, unless the `default-toolbar-position' is `right', by
|
|
1543 default the height of the right toolbar (controlled by
|
|
1544 `right-toolbar-width') is 0; thus, a right toolbar will not be
|
|
1545 displayed even if you provide a value for `right-toolbar'.
|
|
1546 */ );
|
|
1547 Vtoolbar[RIGHT_TOOLBAR] = Fmake_specifier (Qtoolbar);
|
|
1548 set_specifier_caching (Vtoolbar[RIGHT_TOOLBAR],
|
438
|
1549 offsetof (struct window, toolbar[RIGHT_TOOLBAR]),
|
428
|
1550 toolbar_specs_changed,
|
444
|
1551 0, 0, 0);
|
428
|
1552
|
|
1553 /* initially, top inherits from default; this can be
|
|
1554 changed with `set-default-toolbar-position'. */
|
|
1555 fb = list1 (Fcons (Qnil, Qnil));
|
|
1556 set_specifier_fallback (Vdefault_toolbar, fb);
|
|
1557 set_specifier_fallback (Vtoolbar[TOP_TOOLBAR], Vdefault_toolbar);
|
|
1558 set_specifier_fallback (Vtoolbar[BOTTOM_TOOLBAR], fb);
|
|
1559 set_specifier_fallback (Vtoolbar[LEFT_TOOLBAR], fb);
|
|
1560 set_specifier_fallback (Vtoolbar[RIGHT_TOOLBAR], fb);
|
|
1561
|
|
1562 DEFVAR_SPECIFIER ("default-toolbar-height", &Vdefault_toolbar_height /*
|
|
1563 *Height of the default toolbar, if it's oriented horizontally.
|
|
1564 This is a specifier; use `set-specifier' to change it.
|
|
1565
|
|
1566 The position of the default toolbar is specified by the function
|
|
1567 `set-default-toolbar-position'. If the corresponding position-specific
|
|
1568 toolbar thickness specifier (e.g. `top-toolbar-height' if
|
|
1569 `default-toolbar-position' is 'top) does not specify a thickness in a
|
|
1570 particular domain (a window or a frame), then the value of
|
|
1571 `default-toolbar-height' or `default-toolbar-width' (depending on the
|
|
1572 toolbar orientation) in that domain, if any, will be used instead.
|
|
1573
|
|
1574 Note that `default-toolbar-height' is only used when
|
|
1575 `default-toolbar-position' is 'top or 'bottom, and `default-toolbar-width'
|
|
1576 is only used when `default-toolbar-position' is 'left or 'right.
|
|
1577
|
|
1578 Note that all of the position-specific toolbar thickness specifiers
|
|
1579 have a fallback value of zero when they do not correspond to the
|
|
1580 default toolbar. Therefore, you will have to set a non-zero thickness
|
|
1581 value if you want a position-specific toolbar to be displayed.
|
|
1582
|
|
1583 Internally, toolbar thickness specifiers are instantiated in both
|
|
1584 window and frame domains, for different purposes. The value in the
|
|
1585 domain of a frame's selected window specifies the actual toolbar
|
|
1586 thickness that you will see in that frame. The value in the domain of
|
|
1587 a frame itself specifies the toolbar thickness that is used in frame
|
|
1588 geometry calculations.
|
|
1589
|
|
1590 Thus, for example, if you set the frame width to 80 characters and the
|
|
1591 left toolbar width for that frame to 68 pixels, then the frame will
|
|
1592 be sized to fit 80 characters plus a 68-pixel left toolbar. If you
|
|
1593 then set the left toolbar width to 0 for a particular buffer (or if
|
|
1594 that buffer does not specify a left toolbar or has a nil value
|
|
1595 specified for `left-toolbar-visible-p'), you will find that, when
|
|
1596 that buffer is displayed in the selected window, the window will have
|
|
1597 a width of 86 or 87 characters -- the frame is sized for a 68-pixel
|
|
1598 left toolbar but the selected window specifies that the left toolbar
|
|
1599 is not visible, so it is expanded to take up the slack.
|
|
1600 */ );
|
|
1601 Vdefault_toolbar_height = Fmake_specifier (Qnatnum);
|
|
1602 set_specifier_caching (Vdefault_toolbar_height,
|
438
|
1603 offsetof (struct window, default_toolbar_height),
|
428
|
1604 default_toolbar_size_changed_in_window,
|
438
|
1605 offsetof (struct frame, default_toolbar_height),
|
444
|
1606 default_toolbar_size_changed_in_frame, 0);
|
428
|
1607
|
|
1608 DEFVAR_SPECIFIER ("default-toolbar-width", &Vdefault_toolbar_width /*
|
|
1609 *Width of the default toolbar, if it's oriented vertically.
|
|
1610 This is a specifier; use `set-specifier' to change it.
|
|
1611
|
|
1612 See `default-toolbar-height' for more information.
|
|
1613 */ );
|
|
1614 Vdefault_toolbar_width = Fmake_specifier (Qnatnum);
|
|
1615 set_specifier_caching (Vdefault_toolbar_width,
|
438
|
1616 offsetof (struct window, default_toolbar_width),
|
428
|
1617 default_toolbar_size_changed_in_window,
|
438
|
1618 offsetof (struct frame, default_toolbar_width),
|
444
|
1619 default_toolbar_size_changed_in_frame, 0);
|
428
|
1620
|
|
1621 DEFVAR_SPECIFIER ("top-toolbar-height",
|
|
1622 &Vtoolbar_size[TOP_TOOLBAR] /*
|
|
1623 *Height of the top toolbar.
|
|
1624 This is a specifier; use `set-specifier' to change it.
|
|
1625
|
|
1626 See `default-toolbar-height' for more information.
|
|
1627 */ );
|
|
1628 Vtoolbar_size[TOP_TOOLBAR] = Fmake_specifier (Qnatnum);
|
|
1629 set_specifier_caching (Vtoolbar_size[TOP_TOOLBAR],
|
438
|
1630 offsetof (struct window, toolbar_size[TOP_TOOLBAR]),
|
428
|
1631 toolbar_geometry_changed_in_window,
|
438
|
1632 offsetof (struct frame, toolbar_size[TOP_TOOLBAR]),
|
444
|
1633 frame_size_slipped, 0);
|
428
|
1634
|
|
1635 DEFVAR_SPECIFIER ("bottom-toolbar-height",
|
|
1636 &Vtoolbar_size[BOTTOM_TOOLBAR] /*
|
|
1637 *Height of the bottom toolbar.
|
|
1638 This is a specifier; use `set-specifier' to change it.
|
|
1639
|
|
1640 See `default-toolbar-height' for more information.
|
|
1641 */ );
|
|
1642 Vtoolbar_size[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum);
|
|
1643 set_specifier_caching (Vtoolbar_size[BOTTOM_TOOLBAR],
|
438
|
1644 offsetof (struct window, toolbar_size[BOTTOM_TOOLBAR]),
|
428
|
1645 toolbar_geometry_changed_in_window,
|
438
|
1646 offsetof (struct frame, toolbar_size[BOTTOM_TOOLBAR]),
|
444
|
1647 frame_size_slipped, 0);
|
428
|
1648
|
|
1649 DEFVAR_SPECIFIER ("left-toolbar-width",
|
|
1650 &Vtoolbar_size[LEFT_TOOLBAR] /*
|
|
1651 *Width of left toolbar.
|
|
1652 This is a specifier; use `set-specifier' to change it.
|
|
1653
|
|
1654 See `default-toolbar-height' for more information.
|
|
1655 */ );
|
|
1656 Vtoolbar_size[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum);
|
|
1657 set_specifier_caching (Vtoolbar_size[LEFT_TOOLBAR],
|
438
|
1658 offsetof (struct window, toolbar_size[LEFT_TOOLBAR]),
|
428
|
1659 toolbar_geometry_changed_in_window,
|
438
|
1660 offsetof (struct frame, toolbar_size[LEFT_TOOLBAR]),
|
444
|
1661 frame_size_slipped, 0);
|
428
|
1662
|
|
1663 DEFVAR_SPECIFIER ("right-toolbar-width",
|
|
1664 &Vtoolbar_size[RIGHT_TOOLBAR] /*
|
|
1665 *Width of right toolbar.
|
|
1666 This is a specifier; use `set-specifier' to change it.
|
|
1667
|
|
1668 See `default-toolbar-height' for more information.
|
|
1669 */ );
|
|
1670 Vtoolbar_size[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum);
|
|
1671 set_specifier_caching (Vtoolbar_size[RIGHT_TOOLBAR],
|
438
|
1672 offsetof (struct window, toolbar_size[RIGHT_TOOLBAR]),
|
428
|
1673 toolbar_geometry_changed_in_window,
|
438
|
1674 offsetof (struct frame, toolbar_size[RIGHT_TOOLBAR]),
|
444
|
1675 frame_size_slipped, 0);
|
428
|
1676
|
744
|
1677 DEFVAR_SPECIFIER ("toolbar-shadow-thickness",
|
|
1678 &Vtoolbar_shadow_thickness /*
|
|
1679 *Width of shadows around toolbar buttons.
|
|
1680 This is a specifier; use `set-specifier' to change it.
|
|
1681 */ );
|
|
1682 Vtoolbar_shadow_thickness = Fmake_specifier (Qnatnum);
|
|
1683 set_specifier_caching(Vtoolbar_shadow_thickness,
|
|
1684 offsetof (struct window, toolbar_shadow_thickness),
|
|
1685 toolbar_shadows_changed,
|
|
1686 0,0, 0);
|
|
1687
|
|
1688 fb = Qnil;
|
|
1689
|
|
1690 #ifdef HAVE_TTY
|
|
1691 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
|
|
1692 #endif
|
|
1693 #ifdef HAVE_GTK
|
|
1694 fb = Fcons (Fcons (list1 (Qgtk), make_int (2)), fb);
|
|
1695 #endif
|
|
1696 #ifdef HAVE_X_WINDOWS
|
|
1697 fb = Fcons (Fcons (list1 (Qx), make_int (2)), fb);
|
|
1698 #endif
|
|
1699 #ifdef HAVE_MS_WINDOWS
|
|
1700 fb = Fcons (Fcons (list1 (Qmswindows), make_int (2)), fb);
|
|
1701 #endif
|
|
1702
|
|
1703 if (!NILP (fb))
|
|
1704 set_specifier_fallback (Vtoolbar_shadow_thickness, fb);
|
|
1705
|
428
|
1706 fb = Qnil;
|
|
1707 #ifdef HAVE_TTY
|
|
1708 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
|
|
1709 #endif
|
462
|
1710 #ifdef HAVE_GTK
|
|
1711 fb = Fcons (Fcons (list1 (Qgtk), make_int (DEFAULT_TOOLBAR_HEIGHT)), fb);
|
|
1712 #endif
|
428
|
1713 #ifdef HAVE_X_WINDOWS
|
|
1714 fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_HEIGHT)), fb);
|
|
1715 #endif
|
|
1716 #ifdef HAVE_MS_WINDOWS
|
442
|
1717 fb = Fcons (Fcons (list1 (Qmswindows),
|
428
|
1718 make_int (MSWINDOWS_DEFAULT_TOOLBAR_HEIGHT)), fb);
|
|
1719 #endif
|
|
1720 if (!NILP (fb))
|
|
1721 set_specifier_fallback (Vdefault_toolbar_height, fb);
|
|
1722
|
|
1723 fb = Qnil;
|
|
1724 #ifdef HAVE_TTY
|
|
1725 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
|
|
1726 #endif
|
462
|
1727 #ifdef HAVE_GTK
|
|
1728 fb = Fcons (Fcons (list1 (Qgtk), make_int (DEFAULT_TOOLBAR_WIDTH)), fb);
|
|
1729 #endif
|
428
|
1730 #ifdef HAVE_X_WINDOWS
|
|
1731 fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_WIDTH)), fb);
|
|
1732 #endif
|
|
1733 #ifdef HAVE_MS_WINDOWS
|
442
|
1734 fb = Fcons (Fcons (list1 (Qmswindows),
|
428
|
1735 make_int (MSWINDOWS_DEFAULT_TOOLBAR_WIDTH)), fb);
|
|
1736 #endif
|
|
1737 if (!NILP (fb))
|
|
1738 set_specifier_fallback (Vdefault_toolbar_width, fb);
|
|
1739
|
|
1740 set_specifier_fallback (Vtoolbar_size[TOP_TOOLBAR], Vdefault_toolbar_height);
|
|
1741 fb = list1 (Fcons (Qnil, Qzero));
|
|
1742 set_specifier_fallback (Vtoolbar_size[BOTTOM_TOOLBAR], fb);
|
|
1743 set_specifier_fallback (Vtoolbar_size[LEFT_TOOLBAR], fb);
|
|
1744 set_specifier_fallback (Vtoolbar_size[RIGHT_TOOLBAR], fb);
|
|
1745
|
|
1746 DEFVAR_SPECIFIER ("default-toolbar-border-width",
|
|
1747 &Vdefault_toolbar_border_width /*
|
|
1748 *Width of the border around the default toolbar.
|
|
1749 This is a specifier; use `set-specifier' to change it.
|
|
1750
|
|
1751 The position of the default toolbar is specified by the function
|
|
1752 `set-default-toolbar-position'. If the corresponding position-specific
|
|
1753 toolbar border width specifier (e.g. `top-toolbar-border-width' if
|
|
1754 `default-toolbar-position' is 'top) does not specify a border width in a
|
|
1755 particular domain (a window or a frame), then the value of
|
|
1756 `default-toolbar-border-width' in that domain, if any, will be used
|
|
1757 instead.
|
|
1758
|
|
1759 Internally, toolbar border width specifiers are instantiated in both
|
|
1760 window and frame domains, for different purposes. The value in the
|
|
1761 domain of a frame's selected window specifies the actual toolbar border
|
|
1762 width that you will see in that frame. The value in the domain of a
|
|
1763 frame itself specifies the toolbar border width that is used in frame
|
|
1764 geometry calculations. Changing the border width value in the frame
|
|
1765 domain will result in a size change in the frame itself, while changing
|
|
1766 the value in a window domain will not.
|
|
1767 */ );
|
|
1768 Vdefault_toolbar_border_width = Fmake_specifier (Qnatnum);
|
|
1769 set_specifier_caching (Vdefault_toolbar_border_width,
|
438
|
1770 offsetof (struct window, default_toolbar_border_width),
|
428
|
1771 default_toolbar_border_width_changed_in_window,
|
438
|
1772 offsetof (struct frame, default_toolbar_border_width),
|
444
|
1773 default_toolbar_border_width_changed_in_frame, 0);
|
428
|
1774
|
|
1775 DEFVAR_SPECIFIER ("top-toolbar-border-width",
|
|
1776 &Vtoolbar_border_width[TOP_TOOLBAR] /*
|
|
1777 *Border width of the top toolbar.
|
|
1778 This is a specifier; use `set-specifier' to change it.
|
|
1779
|
|
1780 See `default-toolbar-height' for more information.
|
|
1781 */ );
|
|
1782 Vtoolbar_border_width[TOP_TOOLBAR] = Fmake_specifier (Qnatnum);
|
|
1783 set_specifier_caching (Vtoolbar_border_width[TOP_TOOLBAR],
|
438
|
1784 offsetof (struct window,
|
|
1785 toolbar_border_width[TOP_TOOLBAR]),
|
428
|
1786 toolbar_geometry_changed_in_window,
|
438
|
1787 offsetof (struct frame,
|
|
1788 toolbar_border_width[TOP_TOOLBAR]),
|
444
|
1789 frame_size_slipped, 0);
|
428
|
1790
|
|
1791 DEFVAR_SPECIFIER ("bottom-toolbar-border-width",
|
|
1792 &Vtoolbar_border_width[BOTTOM_TOOLBAR] /*
|
|
1793 *Border width of the bottom toolbar.
|
|
1794 This is a specifier; use `set-specifier' to change it.
|
|
1795
|
|
1796 See `default-toolbar-height' for more information.
|
|
1797 */ );
|
|
1798 Vtoolbar_border_width[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum);
|
|
1799 set_specifier_caching (Vtoolbar_border_width[BOTTOM_TOOLBAR],
|
438
|
1800 offsetof (struct window,
|
|
1801 toolbar_border_width[BOTTOM_TOOLBAR]),
|
428
|
1802 toolbar_geometry_changed_in_window,
|
438
|
1803 offsetof (struct frame,
|
|
1804 toolbar_border_width[BOTTOM_TOOLBAR]),
|
444
|
1805 frame_size_slipped, 0);
|
428
|
1806
|
|
1807 DEFVAR_SPECIFIER ("left-toolbar-border-width",
|
|
1808 &Vtoolbar_border_width[LEFT_TOOLBAR] /*
|
|
1809 *Border width of left toolbar.
|
|
1810 This is a specifier; use `set-specifier' to change it.
|
|
1811
|
|
1812 See `default-toolbar-height' for more information.
|
|
1813 */ );
|
|
1814 Vtoolbar_border_width[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum);
|
|
1815 set_specifier_caching (Vtoolbar_border_width[LEFT_TOOLBAR],
|
438
|
1816 offsetof (struct window,
|
|
1817 toolbar_border_width[LEFT_TOOLBAR]),
|
428
|
1818 toolbar_geometry_changed_in_window,
|
438
|
1819 offsetof (struct frame,
|
|
1820 toolbar_border_width[LEFT_TOOLBAR]),
|
444
|
1821 frame_size_slipped, 0);
|
428
|
1822
|
|
1823 DEFVAR_SPECIFIER ("right-toolbar-border-width",
|
|
1824 &Vtoolbar_border_width[RIGHT_TOOLBAR] /*
|
|
1825 *Border width of right toolbar.
|
|
1826 This is a specifier; use `set-specifier' to change it.
|
|
1827
|
|
1828 See `default-toolbar-height' for more information.
|
|
1829 */ );
|
|
1830 Vtoolbar_border_width[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum);
|
|
1831 set_specifier_caching (Vtoolbar_border_width[RIGHT_TOOLBAR],
|
438
|
1832 offsetof (struct window,
|
|
1833 toolbar_border_width[RIGHT_TOOLBAR]),
|
428
|
1834 toolbar_geometry_changed_in_window,
|
438
|
1835 offsetof (struct frame,
|
|
1836 toolbar_border_width[RIGHT_TOOLBAR]),
|
444
|
1837 frame_size_slipped, 0);
|
428
|
1838
|
|
1839 fb = Qnil;
|
|
1840 #ifdef HAVE_TTY
|
|
1841 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
|
|
1842 #endif
|
|
1843 #ifdef HAVE_X_WINDOWS
|
|
1844 fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_BORDER_WIDTH)), fb);
|
|
1845 #endif
|
462
|
1846 #ifdef HAVE_GTK
|
|
1847 fb = Fcons (Fcons (list1 (Qgtk), make_int (DEFAULT_TOOLBAR_BORDER_WIDTH)), fb);
|
|
1848 #endif
|
428
|
1849 #ifdef HAVE_MS_WINDOWS
|
|
1850 fb = Fcons (Fcons (list1 (Qmswindows), make_int (MSWINDOWS_DEFAULT_TOOLBAR_BORDER_WIDTH)), fb);
|
|
1851 #endif
|
|
1852 if (!NILP (fb))
|
|
1853 set_specifier_fallback (Vdefault_toolbar_border_width, fb);
|
|
1854
|
|
1855 set_specifier_fallback (Vtoolbar_border_width[TOP_TOOLBAR], Vdefault_toolbar_border_width);
|
|
1856 fb = list1 (Fcons (Qnil, Qzero));
|
|
1857 set_specifier_fallback (Vtoolbar_border_width[BOTTOM_TOOLBAR], fb);
|
|
1858 set_specifier_fallback (Vtoolbar_border_width[LEFT_TOOLBAR], fb);
|
|
1859 set_specifier_fallback (Vtoolbar_border_width[RIGHT_TOOLBAR], fb);
|
|
1860
|
|
1861 DEFVAR_SPECIFIER ("default-toolbar-visible-p", &Vdefault_toolbar_visible_p /*
|
|
1862 *Whether the default toolbar is visible.
|
|
1863 This is a specifier; use `set-specifier' to change it.
|
|
1864
|
|
1865 The position of the default toolbar is specified by the function
|
|
1866 `set-default-toolbar-position'. If the corresponding position-specific
|
|
1867 toolbar visibility specifier (e.g. `top-toolbar-visible-p' if
|
|
1868 `default-toolbar-position' is 'top) does not specify a visible-p value
|
|
1869 in a particular domain (a window or a frame), then the value of
|
|
1870 `default-toolbar-visible-p' in that domain, if any, will be used
|
|
1871 instead.
|
|
1872
|
|
1873 Both window domains and frame domains are used internally, for
|
|
1874 different purposes. The distinction here is exactly the same as
|
|
1875 for thickness specifiers; see `default-toolbar-height' for more
|
|
1876 information.
|
|
1877
|
|
1878 `default-toolbar-visible-p' and all of the position-specific toolbar
|
|
1879 visibility specifiers have a fallback value of true.
|
|
1880 */ );
|
|
1881 Vdefault_toolbar_visible_p = Fmake_specifier (Qboolean);
|
|
1882 set_specifier_caching (Vdefault_toolbar_visible_p,
|
438
|
1883 offsetof (struct window, default_toolbar_visible_p),
|
428
|
1884 default_toolbar_visible_p_changed_in_window,
|
438
|
1885 offsetof (struct frame, default_toolbar_visible_p),
|
444
|
1886 default_toolbar_visible_p_changed_in_frame, 0);
|
428
|
1887
|
|
1888 DEFVAR_SPECIFIER ("top-toolbar-visible-p",
|
|
1889 &Vtoolbar_visible_p[TOP_TOOLBAR] /*
|
|
1890 *Whether the top toolbar is visible.
|
|
1891 This is a specifier; use `set-specifier' to change it.
|
|
1892
|
|
1893 See `default-toolbar-visible-p' for more information.
|
|
1894 */ );
|
|
1895 Vtoolbar_visible_p[TOP_TOOLBAR] = Fmake_specifier (Qboolean);
|
|
1896 set_specifier_caching (Vtoolbar_visible_p[TOP_TOOLBAR],
|
438
|
1897 offsetof (struct window,
|
|
1898 toolbar_visible_p[TOP_TOOLBAR]),
|
428
|
1899 toolbar_geometry_changed_in_window,
|
438
|
1900 offsetof (struct frame,
|
|
1901 toolbar_visible_p[TOP_TOOLBAR]),
|
444
|
1902 frame_size_slipped, 0);
|
428
|
1903
|
|
1904 DEFVAR_SPECIFIER ("bottom-toolbar-visible-p",
|
|
1905 &Vtoolbar_visible_p[BOTTOM_TOOLBAR] /*
|
|
1906 *Whether the bottom toolbar is visible.
|
|
1907 This is a specifier; use `set-specifier' to change it.
|
|
1908
|
|
1909 See `default-toolbar-visible-p' for more information.
|
|
1910 */ );
|
|
1911 Vtoolbar_visible_p[BOTTOM_TOOLBAR] = Fmake_specifier (Qboolean);
|
|
1912 set_specifier_caching (Vtoolbar_visible_p[BOTTOM_TOOLBAR],
|
438
|
1913 offsetof (struct window,
|
|
1914 toolbar_visible_p[BOTTOM_TOOLBAR]),
|
428
|
1915 toolbar_geometry_changed_in_window,
|
438
|
1916 offsetof (struct frame,
|
|
1917 toolbar_visible_p[BOTTOM_TOOLBAR]),
|
444
|
1918 frame_size_slipped, 0);
|
428
|
1919
|
|
1920 DEFVAR_SPECIFIER ("left-toolbar-visible-p",
|
|
1921 &Vtoolbar_visible_p[LEFT_TOOLBAR] /*
|
|
1922 *Whether the left toolbar is visible.
|
|
1923 This is a specifier; use `set-specifier' to change it.
|
|
1924
|
|
1925 See `default-toolbar-visible-p' for more information.
|
|
1926 */ );
|
|
1927 Vtoolbar_visible_p[LEFT_TOOLBAR] = Fmake_specifier (Qboolean);
|
|
1928 set_specifier_caching (Vtoolbar_visible_p[LEFT_TOOLBAR],
|
438
|
1929 offsetof (struct window,
|
|
1930 toolbar_visible_p[LEFT_TOOLBAR]),
|
428
|
1931 toolbar_geometry_changed_in_window,
|
438
|
1932 offsetof (struct frame,
|
|
1933 toolbar_visible_p[LEFT_TOOLBAR]),
|
444
|
1934 frame_size_slipped, 0);
|
428
|
1935
|
|
1936 DEFVAR_SPECIFIER ("right-toolbar-visible-p",
|
|
1937 &Vtoolbar_visible_p[RIGHT_TOOLBAR] /*
|
|
1938 *Whether the right toolbar is visible.
|
|
1939 This is a specifier; use `set-specifier' to change it.
|
|
1940
|
|
1941 See `default-toolbar-visible-p' for more information.
|
|
1942 */ );
|
|
1943 Vtoolbar_visible_p[RIGHT_TOOLBAR] = Fmake_specifier (Qboolean);
|
|
1944 set_specifier_caching (Vtoolbar_visible_p[RIGHT_TOOLBAR],
|
438
|
1945 offsetof (struct window,
|
|
1946 toolbar_visible_p[RIGHT_TOOLBAR]),
|
428
|
1947 toolbar_geometry_changed_in_window,
|
438
|
1948 offsetof (struct frame,
|
|
1949 toolbar_visible_p[RIGHT_TOOLBAR]),
|
444
|
1950 frame_size_slipped, 0);
|
428
|
1951
|
|
1952 /* initially, top inherits from default; this can be
|
|
1953 changed with `set-default-toolbar-position'. */
|
|
1954 fb = list1 (Fcons (Qnil, Qt));
|
|
1955 set_specifier_fallback (Vdefault_toolbar_visible_p, fb);
|
|
1956 set_specifier_fallback (Vtoolbar_visible_p[TOP_TOOLBAR],
|
|
1957 Vdefault_toolbar_visible_p);
|
|
1958 set_specifier_fallback (Vtoolbar_visible_p[BOTTOM_TOOLBAR], fb);
|
|
1959 set_specifier_fallback (Vtoolbar_visible_p[LEFT_TOOLBAR], fb);
|
|
1960 set_specifier_fallback (Vtoolbar_visible_p[RIGHT_TOOLBAR], fb);
|
|
1961
|
|
1962 DEFVAR_SPECIFIER ("toolbar-buttons-captioned-p",
|
|
1963 &Vtoolbar_buttons_captioned_p /*
|
|
1964 *Whether the toolbar buttons are captioned.
|
|
1965 This will only have a visible effect for those toolbar buttons which had
|
|
1966 captioned versions specified.
|
|
1967 This is a specifier; use `set-specifier' to change it.
|
|
1968 */ );
|
|
1969 Vtoolbar_buttons_captioned_p = Fmake_specifier (Qboolean);
|
|
1970 set_specifier_caching (Vtoolbar_buttons_captioned_p,
|
438
|
1971 offsetof (struct window, toolbar_buttons_captioned_p),
|
428
|
1972 toolbar_buttons_captioned_p_changed,
|
444
|
1973 0, 0, 0);
|
428
|
1974 set_specifier_fallback (Vtoolbar_buttons_captioned_p,
|
|
1975 list1 (Fcons (Qnil, Qt)));
|
|
1976 }
|