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