Mercurial > hg > xemacs-beta
comparison src/toolbar.c @ 5178:97eb4942aec8
merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 29 Mar 2010 21:28:13 -0500 |
parents | 7be849cb8828 |
children | 308d34e9f07d |
comparison
equal
deleted
inserted
replaced
5177:b785049378e3 | 5178:97eb4942aec8 |
---|---|
35 #include "glyphs.h" | 35 #include "glyphs.h" |
36 #include "redisplay.h" | 36 #include "redisplay.h" |
37 #include "toolbar.h" | 37 #include "toolbar.h" |
38 #include "window.h" | 38 #include "window.h" |
39 | 39 |
40 Lisp_Object Vtoolbar[4]; | 40 Lisp_Object Vtoolbar[NUM_EDGES]; |
41 Lisp_Object Vtoolbar_size[4]; | 41 Lisp_Object Vtoolbar_size[NUM_EDGES]; |
42 Lisp_Object Vtoolbar_visible_p[4]; | 42 Lisp_Object Vtoolbar_visible_p[NUM_EDGES]; |
43 Lisp_Object Vtoolbar_border_width[4]; | 43 Lisp_Object Vtoolbar_border_width[NUM_EDGES]; |
44 | 44 |
45 Lisp_Object Vdefault_toolbar, Vdefault_toolbar_visible_p; | 45 Lisp_Object Vdefault_toolbar, Vdefault_toolbar_visible_p; |
46 Lisp_Object Vdefault_toolbar_width, Vdefault_toolbar_height; | 46 Lisp_Object Vdefault_toolbar_width, Vdefault_toolbar_height; |
47 Lisp_Object Vdefault_toolbar_border_width; | 47 Lisp_Object Vdefault_toolbar_border_width; |
48 Lisp_Object Vtoolbar_shadow_thickness; | 48 Lisp_Object Vtoolbar_shadow_thickness; |
69 { XD_LISP_OBJECT, offsetof (struct toolbar_button, enabled_p) }, | 69 { XD_LISP_OBJECT, offsetof (struct toolbar_button, enabled_p) }, |
70 { XD_LISP_OBJECT, offsetof (struct toolbar_button, help_string) }, | 70 { XD_LISP_OBJECT, offsetof (struct toolbar_button, help_string) }, |
71 { XD_END } | 71 { XD_END } |
72 }; | 72 }; |
73 | 73 |
74 | |
75 static Lisp_Object | |
76 allocate_toolbar_button (struct frame *f, int pushright) | |
77 { | |
78 struct toolbar_button *tb; | |
79 | |
80 tb = XTOOLBAR_BUTTON (ALLOC_NORMAL_LISP_OBJECT (toolbar_button)); | |
81 tb->next = Qnil; | |
82 tb->frame = wrap_frame (f); | |
83 tb->up_glyph = Qnil; | |
84 tb->down_glyph = Qnil; | |
85 tb->disabled_glyph = Qnil; | |
86 tb->cap_up_glyph = Qnil; | |
87 tb->cap_down_glyph = Qnil; | |
88 tb->cap_disabled_glyph = Qnil; | |
89 tb->callback = Qnil; | |
90 tb->enabled_p = Qnil; | |
91 tb->help_string = Qnil; | |
92 | |
93 tb->pushright = pushright; | |
94 tb->x = tb->y = tb->width = tb->height = -1; | |
95 tb->dirty = 1; | |
96 | |
97 return wrap_toolbar_button (tb); | |
98 } | |
99 | |
100 | |
74 static Lisp_Object | 101 static Lisp_Object |
75 mark_toolbar_button (Lisp_Object obj) | 102 mark_toolbar_button (Lisp_Object obj) |
76 { | 103 { |
77 struct toolbar_button *data = XTOOLBAR_BUTTON (obj); | 104 struct toolbar_button *data = XTOOLBAR_BUTTON (obj); |
78 mark_object (data->next); | 105 mark_object (data->next); |
86 mark_object (data->callback); | 113 mark_object (data->callback); |
87 mark_object (data->enabled_p); | 114 mark_object (data->enabled_p); |
88 return data->help_string; | 115 return data->help_string; |
89 } | 116 } |
90 | 117 |
91 DEFINE_LRECORD_IMPLEMENTATION ("toolbar-button", toolbar_button, | 118 DEFINE_NODUMP_INTERNAL_LISP_OBJECT ("toolbar-button", toolbar_button, |
92 0, /*dumpable-flag*/ | 119 mark_toolbar_button, |
93 mark_toolbar_button, | 120 toolbar_button_description, |
94 default_object_printer, | 121 struct toolbar_button); |
95 0, 0, 0, | |
96 toolbar_button_description, | |
97 struct toolbar_button); | |
98 | 122 |
99 DEFUN ("toolbar-button-p", Ftoolbar_button_p, 1, 1, 0, /* | 123 DEFUN ("toolbar-button-p", Ftoolbar_button_p, 1, 1, 0, /* |
100 Return non-nil if OBJECT is a toolbar button. | 124 Return non-nil if OBJECT is a toolbar button. |
101 */ | 125 */ |
102 (object)) | 126 (object)) |
230 | 254 |
231 return glyph; | 255 return glyph; |
232 } | 256 } |
233 | 257 |
234 | 258 |
235 static enum toolbar_pos | 259 static enum edge_pos |
236 decode_toolbar_position (Lisp_Object position) | 260 decode_toolbar_position (Lisp_Object position) |
237 { | 261 { |
238 if (EQ (position, Qtop)) return TOP_TOOLBAR; | 262 if (EQ (position, Qtop)) return TOP_EDGE; |
239 if (EQ (position, Qbottom)) return BOTTOM_TOOLBAR; | 263 if (EQ (position, Qbottom)) return BOTTOM_EDGE; |
240 if (EQ (position, Qleft)) return LEFT_TOOLBAR; | 264 if (EQ (position, Qleft)) return LEFT_EDGE; |
241 if (EQ (position, Qright)) return RIGHT_TOOLBAR; | 265 if (EQ (position, Qright)) return RIGHT_EDGE; |
242 invalid_constant ("Invalid toolbar position", position); | 266 invalid_constant ("Invalid toolbar position", position); |
243 | 267 |
244 RETURN_NOT_REACHED (TOP_TOOLBAR); | 268 RETURN_NOT_REACHED (TOP_EDGE); |
245 } | 269 } |
246 | 270 |
247 DEFUN ("set-default-toolbar-position", Fset_default_toolbar_position, 1, 1, 0, /* | 271 DEFUN ("set-default-toolbar-position", Fset_default_toolbar_position, 1, 1, 0, /* |
248 Set the position that the `default-toolbar' will be displayed at. | 272 Set the position that the `default-toolbar' will be displayed at. |
249 Valid positions are `top', `bottom', `left' and `right'. | 273 Valid positions are `top', `bottom', `left' and `right'. |
250 See `default-toolbar-position'. | 274 See `default-toolbar-position'. |
251 */ | 275 */ |
252 (position)) | 276 (position)) |
253 { | 277 { |
254 enum toolbar_pos cur = decode_toolbar_position (Vdefault_toolbar_position); | 278 enum edge_pos cur = decode_toolbar_position (Vdefault_toolbar_position); |
255 enum toolbar_pos new_ = decode_toolbar_position (position); | 279 enum edge_pos new_ = decode_toolbar_position (position); |
256 | 280 |
257 if (cur != new_) | 281 if (cur != new_) |
258 { | 282 { |
259 /* The following calls will automatically cause the dirty | 283 /* The following calls will automatically cause the dirty |
260 flags to be set; we delay frame size changes to avoid | 284 flags to be set; we delay frame size changes to avoid |
262 int depth = begin_hold_frame_size_changes (); | 286 int depth = begin_hold_frame_size_changes (); |
263 set_specifier_fallback (Vtoolbar[cur], list1 (Fcons (Qnil, Qnil))); | 287 set_specifier_fallback (Vtoolbar[cur], list1 (Fcons (Qnil, Qnil))); |
264 set_specifier_fallback (Vtoolbar[new_], Vdefault_toolbar); | 288 set_specifier_fallback (Vtoolbar[new_], Vdefault_toolbar); |
265 set_specifier_fallback (Vtoolbar_size[cur], list1 (Fcons (Qnil, Qzero))); | 289 set_specifier_fallback (Vtoolbar_size[cur], list1 (Fcons (Qnil, Qzero))); |
266 set_specifier_fallback (Vtoolbar_size[new_], | 290 set_specifier_fallback (Vtoolbar_size[new_], |
267 new_ == TOP_TOOLBAR || new_ == BOTTOM_TOOLBAR | 291 new_ == TOP_EDGE || new_ == BOTTOM_EDGE |
268 ? Vdefault_toolbar_height | 292 ? Vdefault_toolbar_height |
269 : Vdefault_toolbar_width); | 293 : Vdefault_toolbar_width); |
270 set_specifier_fallback (Vtoolbar_border_width[cur], | 294 set_specifier_fallback (Vtoolbar_border_width[cur], |
271 list1 (Fcons (Qnil, Qzero))); | 295 list1 (Fcons (Qnil, Qzero))); |
272 set_specifier_fallback (Vtoolbar_border_width[new_], | 296 set_specifier_fallback (Vtoolbar_border_width[new_], |
302 | 326 |
303 elt = XVECTOR_DATA (desc); | 327 elt = XVECTOR_DATA (desc); |
304 buffer = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer; | 328 buffer = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer; |
305 | 329 |
306 if (!tb) | 330 if (!tb) |
307 { | 331 tb = XTOOLBAR_BUTTON (allocate_toolbar_button (f, pushright)); |
308 tb = ALLOC_LCRECORD_TYPE (struct toolbar_button, &lrecord_toolbar_button); | |
309 tb->next = Qnil; | |
310 tb->frame = wrap_frame (f); | |
311 tb->up_glyph = Qnil; | |
312 tb->down_glyph = Qnil; | |
313 tb->disabled_glyph = Qnil; | |
314 tb->cap_up_glyph = Qnil; | |
315 tb->cap_down_glyph = Qnil; | |
316 tb->cap_disabled_glyph = Qnil; | |
317 tb->callback = Qnil; | |
318 tb->enabled_p = Qnil; | |
319 tb->help_string = Qnil; | |
320 | |
321 tb->enabled = 0; | |
322 tb->down = 0; | |
323 tb->pushright = pushright; | |
324 tb->blank = 0; | |
325 tb->x = tb->y = tb->width = tb->height = -1; | |
326 tb->dirty = 1; | |
327 } | |
328 retval = wrap_toolbar_button (tb); | 332 retval = wrap_toolbar_button (tb); |
329 | 333 |
330 /* Let's make sure nothing gets mucked up by the potential call to | 334 /* Let's make sure nothing gets mucked up by the potential call to |
331 eval farther down. */ | 335 eval farther down. */ |
332 GCPRO2 (retval, desc); | 336 GCPRO2 (retval, desc); |
588 UNGCPRO; | 592 UNGCPRO; |
589 return retval; | 593 return retval; |
590 } | 594 } |
591 | 595 |
592 void | 596 void |
593 mark_frame_toolbar_buttons_dirty (struct frame *f, enum toolbar_pos pos) | 597 mark_frame_toolbar_buttons_dirty (struct frame *f, enum edge_pos pos) |
594 { | 598 { |
595 Lisp_Object button = FRAME_TOOLBAR_BUTTONS (f, pos); | 599 Lisp_Object button = FRAME_TOOLBAR_BUTTONS (f, pos); |
596 | 600 |
597 while (!NILP (button)) | 601 while (!NILP (button)) |
598 { | 602 { |
602 } | 606 } |
603 return; | 607 return; |
604 } | 608 } |
605 | 609 |
606 static Lisp_Object | 610 static Lisp_Object |
607 compute_frame_toolbar_buttons (struct frame *f, enum toolbar_pos pos, | 611 compute_frame_toolbar_buttons (struct frame *f, enum edge_pos pos, |
608 Lisp_Object toolbar) | 612 Lisp_Object toolbar) |
609 { | 613 { |
610 Lisp_Object buttons, prev_button, first_button; | 614 Lisp_Object buttons, prev_button, first_button; |
611 Lisp_Object orig_toolbar = toolbar; | 615 Lisp_Object orig_toolbar = toolbar; |
612 int pushright_seen = 0; | 616 int pushright_seen = 0; |
711 UNGCPRO; | 715 UNGCPRO; |
712 return first_button; | 716 return first_button; |
713 } | 717 } |
714 | 718 |
715 static void | 719 static void |
716 set_frame_toolbar (struct frame *f, enum toolbar_pos pos) | 720 set_frame_toolbar (struct frame *f, enum edge_pos pos) |
717 { | 721 { |
718 struct window *w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); | 722 struct window *w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); |
719 Lisp_Object toolbar = w->toolbar[pos]; | 723 Lisp_Object toolbar = w->toolbar[pos]; |
720 f->toolbar_buttons[pos] = (FRAME_REAL_TOOLBAR_VISIBLE (f, pos) | 724 f->toolbar_buttons[pos] = (FRAME_REAL_TOOLBAR_VISIBLE (f, pos) |
721 ? compute_frame_toolbar_buttons (f, pos, toolbar) | 725 ? compute_frame_toolbar_buttons (f, pos, toolbar) |
723 } | 727 } |
724 | 728 |
725 static void | 729 static void |
726 compute_frame_toolbars_data (struct frame *f) | 730 compute_frame_toolbars_data (struct frame *f) |
727 { | 731 { |
728 set_frame_toolbar (f, TOP_TOOLBAR); | 732 set_frame_toolbar (f, TOP_EDGE); |
729 set_frame_toolbar (f, BOTTOM_TOOLBAR); | 733 set_frame_toolbar (f, BOTTOM_EDGE); |
730 set_frame_toolbar (f, LEFT_TOOLBAR); | 734 set_frame_toolbar (f, LEFT_EDGE); |
731 set_frame_toolbar (f, RIGHT_TOOLBAR); | 735 set_frame_toolbar (f, RIGHT_EDGE); |
732 } | 736 } |
733 | 737 |
734 /* Update the toolbar geometry separately from actually displaying the | 738 /* Update the toolbar geometry separately from actually displaying the |
735 toolbar. This is necessary because both the gutter and the toolbar | 739 toolbar. This is necessary because both the gutter and the toolbar |
736 are competing for redisplay cycles and, unfortunately, gutter | 740 are competing for redisplay cycles and, unfortunately, gutter |
760 necessitate this layout, as it is outside any windows. We | 764 necessitate this layout, as it is outside any windows. We |
761 take care not to change size if toolbar geometry is really | 765 take care not to change size if toolbar geometry is really |
762 unchanged, as it will hose windows whose pixsizes are not | 766 unchanged, as it will hose windows whose pixsizes are not |
763 multiple of character sizes. */ | 767 multiple of character sizes. */ |
764 | 768 |
765 for (pos = 0; pos < 4; pos++) | 769 EDGE_POS_LOOP (pos) |
766 if (FRAME_REAL_TOOLBAR_SIZE (f, pos) | 770 if (FRAME_REAL_TOOLBAR_SIZE (f, pos) |
767 != FRAME_CURRENT_TOOLBAR_SIZE (f, pos)) | 771 != FRAME_CURRENT_TOOLBAR_SIZE (f, pos)) |
768 frame_size_changed = 1; | 772 frame_size_changed = 1; |
769 | 773 |
770 for (pos = 0; pos < 4; pos++) { | 774 EDGE_POS_LOOP (pos) |
771 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); | 775 { |
772 } | 776 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); |
777 } | |
773 | 778 |
774 /* Removed the check for the minibuffer here. We handle this | 779 /* Removed the check for the minibuffer here. We handle this |
775 more correctly now by consistently using | 780 more correctly now by consistently using |
776 FRAME_LAST_NONMINIBUF_WINDOW instead of FRAME_SELECTED_WINDOW | 781 FRAME_LAST_NONMINIBUF_WINDOW instead of FRAME_SELECTED_WINDOW |
777 throughout the toolbar code. */ | 782 throughout the toolbar code. */ |
778 compute_frame_toolbars_data (f); | 783 compute_frame_toolbars_data (f); |
784 | |
785 /* #### GEOM! Turning the toolbar on and off repeatedly causes the | |
786 frame to steadily shrink. Basically, turning it on doesn't | |
787 increase the frame size, while turning it off does reduce the | |
788 frame size. The cause has something to do with the combination | |
789 of this maybe questionable code here, plus the fact that toolbars | |
790 are included in the displayable area, and the difference between | |
791 real and theoretical toolbar sizes, and exactly when the various | |
792 computations happen w.r.t. the specifiers or whatever that control | |
793 whether toolbars are visible and hence whether their thickness is | |
794 greater than zero. --ben */ | |
779 | 795 |
780 if (frame_size_changed) | 796 if (frame_size_changed) |
781 { | 797 { |
782 int width, height; | 798 int width, height; |
783 pixel_to_frame_unit_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), | 799 pixel_to_frame_unit_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), |
831 | 847 |
832 /* We are here as far in frame creation so cached specifiers are | 848 /* We are here as far in frame creation so cached specifiers are |
833 already recomputed, and possibly modified by resource | 849 already recomputed, and possibly modified by resource |
834 initialization. Remember current toolbar geometry so next | 850 initialization. Remember current toolbar geometry so next |
835 redisplay will not needlessly relayout toolbars. */ | 851 redisplay will not needlessly relayout toolbars. */ |
836 for (pos = 0; pos < 4; pos++) | 852 EDGE_POS_LOOP (pos) |
837 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); | 853 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); |
838 } | 854 } |
839 } | 855 } |
840 | 856 |
841 void | 857 void |
866 | 882 |
867 MAYBE_FRAMEMETH (f, free_frame_toolbars, (f)); | 883 MAYBE_FRAMEMETH (f, free_frame_toolbars, (f)); |
868 } | 884 } |
869 | 885 |
870 void | 886 void |
871 get_toolbar_coords (struct frame *f, enum toolbar_pos pos, int *x, int *y, | 887 get_toolbar_coords (struct frame *f, enum edge_pos pos, int *x, int *y, |
872 int *width, int *height, int *vert, int for_layout) | 888 int *width, int *height, int *vert, int for_layout) |
873 { | 889 { |
874 int visible_top_toolbar_height, visible_bottom_toolbar_height; | 890 int visible_top_toolbar_height, visible_bottom_toolbar_height; |
875 int adjust = (for_layout ? 1 : 0); | 891 int adjust = (for_layout ? 1 : 0); |
876 | 892 |
890 at the outside edges. However, when we are simply determining | 906 at the outside edges. However, when we are simply determining |
891 toolbar location we don't want to do that. */ | 907 toolbar location we don't want to do that. */ |
892 | 908 |
893 switch (pos) | 909 switch (pos) |
894 { | 910 { |
895 case TOP_TOOLBAR: | 911 case TOP_EDGE: |
896 *x = 1; | 912 *x = 1; |
897 *y = 0; /* #### should be 1 if no menubar */ | 913 *y = 0; /* #### should be 1 if no menubar */ |
898 *width = FRAME_PIXWIDTH (f) - 2; | 914 *width = FRAME_PIXWIDTH (f) - 2; |
899 *height = FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) + | 915 *height = FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) + |
900 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f) - adjust; | 916 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f) - adjust; |
901 *vert = 0; | 917 *vert = 0; |
902 break; | 918 break; |
903 case BOTTOM_TOOLBAR: | 919 case BOTTOM_EDGE: |
904 *x = 1; | 920 *x = 1; |
905 *y = FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - | 921 *y = FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - |
906 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); | 922 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); |
907 *width = FRAME_PIXWIDTH (f) - 2; | 923 *width = FRAME_PIXWIDTH (f) - 2; |
908 *height = FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) + | 924 *height = FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) + |
909 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f) - adjust; | 925 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f) - adjust; |
910 *vert = 0; | 926 *vert = 0; |
911 break; | 927 break; |
912 case LEFT_TOOLBAR: | 928 case LEFT_EDGE: |
913 *x = 1; | 929 *x = 1; |
914 *y = visible_top_toolbar_height; | 930 *y = visible_top_toolbar_height; |
915 *width = FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + | 931 *width = FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + |
916 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f) - adjust; | 932 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f) - adjust; |
917 *height = (FRAME_PIXHEIGHT (f) - visible_top_toolbar_height - | 933 *height = (FRAME_PIXHEIGHT (f) - visible_top_toolbar_height - |
918 visible_bottom_toolbar_height - 1); | 934 visible_bottom_toolbar_height - 1); |
919 *vert = 1; | 935 *vert = 1; |
920 break; | 936 break; |
921 case RIGHT_TOOLBAR: | 937 case RIGHT_EDGE: |
922 *x = FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - | 938 *x = FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - |
923 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); | 939 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); |
924 *y = visible_top_toolbar_height; | 940 *y = visible_top_toolbar_height; |
925 *width = FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) + | 941 *width = FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) + |
926 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f) - adjust; | 942 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f) - adjust; |
932 ABORT (); | 948 ABORT (); |
933 } | 949 } |
934 } | 950 } |
935 | 951 |
936 #define CHECK_TOOLBAR(pos) do { \ | 952 #define CHECK_TOOLBAR(pos) do { \ |
937 if (FRAME_REAL_##pos##_VISIBLE (f)) \ | 953 if (FRAME_REAL_TOOLBAR_VISIBLE (f, pos)) \ |
938 { \ | 954 { \ |
939 int x, y, width, height, vert; \ | 955 int x, y, width, height, vert; \ |
940 \ | 956 \ |
941 get_toolbar_coords (f, pos, &x, &y, &width, &height, &vert, 0); \ | 957 get_toolbar_coords (f, pos, &x, &y, &width, &height, &vert, 0); \ |
942 if ((x_coord >= x) && (x_coord < (x + width))) \ | 958 if ((x_coord >= x) && (x_coord < (x + width))) \ |
948 } while (0) | 964 } while (0) |
949 | 965 |
950 static Lisp_Object | 966 static Lisp_Object |
951 toolbar_buttons_at_pixpos (struct frame *f, int x_coord, int y_coord) | 967 toolbar_buttons_at_pixpos (struct frame *f, int x_coord, int y_coord) |
952 { | 968 { |
953 CHECK_TOOLBAR (TOP_TOOLBAR); | 969 CHECK_TOOLBAR (TOP_EDGE); |
954 CHECK_TOOLBAR (BOTTOM_TOOLBAR); | 970 CHECK_TOOLBAR (BOTTOM_EDGE); |
955 CHECK_TOOLBAR (LEFT_TOOLBAR); | 971 CHECK_TOOLBAR (LEFT_EDGE); |
956 CHECK_TOOLBAR (RIGHT_TOOLBAR); | 972 CHECK_TOOLBAR (RIGHT_EDGE); |
957 | 973 |
958 return Qnil; | 974 return Qnil; |
959 } | 975 } |
960 #undef CHECK_TOOLBAR | 976 #undef CHECK_TOOLBAR |
961 | 977 |
995 /* Toolbar specifier type */ | 1011 /* Toolbar specifier type */ |
996 /************************************************************************/ | 1012 /************************************************************************/ |
997 | 1013 |
998 DEFINE_SPECIFIER_TYPE (toolbar); | 1014 DEFINE_SPECIFIER_TYPE (toolbar); |
999 | 1015 |
1000 #define CTB_ERROR(msg) do { \ | 1016 #define CTB_ERROR(msg) do { \ |
1001 maybe_signal_error (Qinvalid_argument, msg, button, Qtoolbar, errb); \ | 1017 maybe_signal_error (Qinvalid_argument, msg, button, Qtoolbar, errb); \ |
1002 RETURN_SANS_WARNINGS Qnil; \ | 1018 RETURN_SANS_WARNINGS Qnil; \ |
1003 } while (0) | 1019 } while (0) |
1004 | 1020 |
1005 /* Returns Q_style if key was :style, Qt if ok otherwise, Qnil if error. */ | 1021 /* Returns Q_style if key was :style, Qt if ok otherwise, Qnil if error. */ |
1006 static Lisp_Object | 1022 static Lisp_Object |
1007 check_toolbar_button_keywords (Lisp_Object button, Lisp_Object key, | 1023 check_toolbar_button_keywords (Lisp_Object button, Lisp_Object key, |
1214 /* | 1230 /* |
1215 Helper for invalidating the real specifier when default | 1231 Helper for invalidating the real specifier when default |
1216 specifier caching changes | 1232 specifier caching changes |
1217 */ | 1233 */ |
1218 static void | 1234 static void |
1219 recompute_overlaying_specifier (Lisp_Object real_one[4]) | 1235 recompute_overlaying_specifier (Lisp_Object real_one[NUM_EDGES]) |
1220 { | 1236 { |
1221 enum toolbar_pos pos = decode_toolbar_position (Vdefault_toolbar_position); | 1237 enum edge_pos pos = decode_toolbar_position (Vdefault_toolbar_position); |
1222 Fset_specifier_dirty_flag (real_one[pos]); | 1238 Fset_specifier_dirty_flag (real_one[pos]); |
1223 } | 1239 } |
1224 | 1240 |
1225 static void | 1241 static void |
1226 toolbar_specs_changed (Lisp_Object UNUSED (specifier), | 1242 toolbar_specs_changed (Lisp_Object UNUSED (specifier), |
1330 | 1346 |
1331 | 1347 |
1332 void | 1348 void |
1333 syms_of_toolbar (void) | 1349 syms_of_toolbar (void) |
1334 { | 1350 { |
1335 INIT_LRECORD_IMPLEMENTATION (toolbar_button); | 1351 INIT_LISP_OBJECT (toolbar_button); |
1336 | 1352 |
1337 DEFSYMBOL_MULTIWORD_PREDICATE (Qtoolbar_buttonp); | 1353 DEFSYMBOL_MULTIWORD_PREDICATE (Qtoolbar_buttonp); |
1338 DEFSYMBOL (Q2D); | 1354 DEFSYMBOL (Q2D); |
1339 DEFSYMBOL (Q3D); | 1355 DEFSYMBOL (Q3D); |
1340 DEFSYMBOL (Q2d); | 1356 DEFSYMBOL (Q2d); |
1499 offsetof (struct window, default_toolbar), | 1515 offsetof (struct window, default_toolbar), |
1500 default_toolbar_specs_changed, | 1516 default_toolbar_specs_changed, |
1501 0, 0, 0); | 1517 0, 0, 0); |
1502 | 1518 |
1503 DEFVAR_SPECIFIER ("top-toolbar", | 1519 DEFVAR_SPECIFIER ("top-toolbar", |
1504 &Vtoolbar[TOP_TOOLBAR] /* | 1520 &Vtoolbar[TOP_EDGE] /* |
1505 Specifier for the toolbar at the top of the frame. | 1521 Specifier for the toolbar at the top of the frame. |
1506 Use `set-specifier' to change this. | 1522 Use `set-specifier' to change this. |
1507 See `default-toolbar' for a description of a valid toolbar instantiator. | 1523 See `default-toolbar' for a description of a valid toolbar instantiator. |
1508 */ ); | 1524 */ ); |
1509 Vtoolbar[TOP_TOOLBAR] = Fmake_specifier (Qtoolbar); | 1525 Vtoolbar[TOP_EDGE] = Fmake_specifier (Qtoolbar); |
1510 set_specifier_caching (Vtoolbar[TOP_TOOLBAR], | 1526 set_specifier_caching (Vtoolbar[TOP_EDGE], |
1511 offsetof (struct window, toolbar[TOP_TOOLBAR]), | 1527 offsetof (struct window, toolbar[TOP_EDGE]), |
1512 toolbar_specs_changed, | 1528 toolbar_specs_changed, |
1513 0, 0, 0); | 1529 0, 0, 0); |
1514 | 1530 |
1515 DEFVAR_SPECIFIER ("bottom-toolbar", | 1531 DEFVAR_SPECIFIER ("bottom-toolbar", |
1516 &Vtoolbar[BOTTOM_TOOLBAR] /* | 1532 &Vtoolbar[BOTTOM_EDGE] /* |
1517 Specifier for the toolbar at the bottom of the frame. | 1533 Specifier for the toolbar at the bottom of the frame. |
1518 Use `set-specifier' to change this. | 1534 Use `set-specifier' to change this. |
1519 See `default-toolbar' for a description of a valid toolbar instantiator. | 1535 See `default-toolbar' for a description of a valid toolbar instantiator. |
1520 | 1536 |
1521 Note that, unless the `default-toolbar-position' is `bottom', by | 1537 Note that, unless the `default-toolbar-position' is `bottom', by |
1522 default the height of the bottom toolbar (controlled by | 1538 default the height of the bottom toolbar (controlled by |
1523 `bottom-toolbar-height') is 0; thus, a bottom toolbar will not be | 1539 `bottom-toolbar-height') is 0; thus, a bottom toolbar will not be |
1524 displayed even if you provide a value for `bottom-toolbar'. | 1540 displayed even if you provide a value for `bottom-toolbar'. |
1525 */ ); | 1541 */ ); |
1526 Vtoolbar[BOTTOM_TOOLBAR] = Fmake_specifier (Qtoolbar); | 1542 Vtoolbar[BOTTOM_EDGE] = Fmake_specifier (Qtoolbar); |
1527 set_specifier_caching (Vtoolbar[BOTTOM_TOOLBAR], | 1543 set_specifier_caching (Vtoolbar[BOTTOM_EDGE], |
1528 offsetof (struct window, toolbar[BOTTOM_TOOLBAR]), | 1544 offsetof (struct window, toolbar[BOTTOM_EDGE]), |
1529 toolbar_specs_changed, | 1545 toolbar_specs_changed, |
1530 0, 0, 0); | 1546 0, 0, 0); |
1531 | 1547 |
1532 DEFVAR_SPECIFIER ("left-toolbar", | 1548 DEFVAR_SPECIFIER ("left-toolbar", |
1533 &Vtoolbar[LEFT_TOOLBAR] /* | 1549 &Vtoolbar[LEFT_EDGE] /* |
1534 Specifier for the toolbar at the left edge of the frame. | 1550 Specifier for the toolbar at the left edge of the frame. |
1535 Use `set-specifier' to change this. | 1551 Use `set-specifier' to change this. |
1536 See `default-toolbar' for a description of a valid toolbar instantiator. | 1552 See `default-toolbar' for a description of a valid toolbar instantiator. |
1537 | 1553 |
1538 Note that, unless the `default-toolbar-position' is `left', by | 1554 Note that, unless the `default-toolbar-position' is `left', by |
1539 default the height of the left toolbar (controlled by | 1555 default the height of the left toolbar (controlled by |
1540 `left-toolbar-width') is 0; thus, a left toolbar will not be | 1556 `left-toolbar-width') is 0; thus, a left toolbar will not be |
1541 displayed even if you provide a value for `left-toolbar'. | 1557 displayed even if you provide a value for `left-toolbar'. |
1542 */ ); | 1558 */ ); |
1543 Vtoolbar[LEFT_TOOLBAR] = Fmake_specifier (Qtoolbar); | 1559 Vtoolbar[LEFT_EDGE] = Fmake_specifier (Qtoolbar); |
1544 set_specifier_caching (Vtoolbar[LEFT_TOOLBAR], | 1560 set_specifier_caching (Vtoolbar[LEFT_EDGE], |
1545 offsetof (struct window, toolbar[LEFT_TOOLBAR]), | 1561 offsetof (struct window, toolbar[LEFT_EDGE]), |
1546 toolbar_specs_changed, | 1562 toolbar_specs_changed, |
1547 0, 0, 0); | 1563 0, 0, 0); |
1548 | 1564 |
1549 DEFVAR_SPECIFIER ("right-toolbar", | 1565 DEFVAR_SPECIFIER ("right-toolbar", |
1550 &Vtoolbar[RIGHT_TOOLBAR] /* | 1566 &Vtoolbar[RIGHT_EDGE] /* |
1551 Specifier for the toolbar at the right edge of the frame. | 1567 Specifier for the toolbar at the right edge of the frame. |
1552 Use `set-specifier' to change this. | 1568 Use `set-specifier' to change this. |
1553 See `default-toolbar' for a description of a valid toolbar instantiator. | 1569 See `default-toolbar' for a description of a valid toolbar instantiator. |
1554 | 1570 |
1555 Note that, unless the `default-toolbar-position' is `right', by | 1571 Note that, unless the `default-toolbar-position' is `right', by |
1556 default the height of the right toolbar (controlled by | 1572 default the height of the right toolbar (controlled by |
1557 `right-toolbar-width') is 0; thus, a right toolbar will not be | 1573 `right-toolbar-width') is 0; thus, a right toolbar will not be |
1558 displayed even if you provide a value for `right-toolbar'. | 1574 displayed even if you provide a value for `right-toolbar'. |
1559 */ ); | 1575 */ ); |
1560 Vtoolbar[RIGHT_TOOLBAR] = Fmake_specifier (Qtoolbar); | 1576 Vtoolbar[RIGHT_EDGE] = Fmake_specifier (Qtoolbar); |
1561 set_specifier_caching (Vtoolbar[RIGHT_TOOLBAR], | 1577 set_specifier_caching (Vtoolbar[RIGHT_EDGE], |
1562 offsetof (struct window, toolbar[RIGHT_TOOLBAR]), | 1578 offsetof (struct window, toolbar[RIGHT_EDGE]), |
1563 toolbar_specs_changed, | 1579 toolbar_specs_changed, |
1564 0, 0, 0); | 1580 0, 0, 0); |
1565 | 1581 |
1566 /* initially, top inherits from default; this can be | 1582 /* initially, top inherits from default; this can be |
1567 changed with `set-default-toolbar-position'. */ | 1583 changed with `set-default-toolbar-position'. */ |
1568 fb = list1 (Fcons (Qnil, Qnil)); | 1584 fb = list1 (Fcons (Qnil, Qnil)); |
1569 set_specifier_fallback (Vdefault_toolbar, fb); | 1585 set_specifier_fallback (Vdefault_toolbar, fb); |
1570 set_specifier_fallback (Vtoolbar[TOP_TOOLBAR], Vdefault_toolbar); | 1586 set_specifier_fallback (Vtoolbar[TOP_EDGE], Vdefault_toolbar); |
1571 set_specifier_fallback (Vtoolbar[BOTTOM_TOOLBAR], fb); | 1587 set_specifier_fallback (Vtoolbar[BOTTOM_EDGE], fb); |
1572 set_specifier_fallback (Vtoolbar[LEFT_TOOLBAR], fb); | 1588 set_specifier_fallback (Vtoolbar[LEFT_EDGE], fb); |
1573 set_specifier_fallback (Vtoolbar[RIGHT_TOOLBAR], fb); | 1589 set_specifier_fallback (Vtoolbar[RIGHT_EDGE], fb); |
1574 | 1590 |
1575 DEFVAR_SPECIFIER ("default-toolbar-height", &Vdefault_toolbar_height /* | 1591 DEFVAR_SPECIFIER ("default-toolbar-height", &Vdefault_toolbar_height /* |
1576 *Height of the default toolbar, if it's oriented horizontally. | 1592 *Height of the default toolbar, if it's oriented horizontally. |
1577 This is a specifier; use `set-specifier' to change it. | 1593 This is a specifier; use `set-specifier' to change it. |
1578 | 1594 |
1630 default_toolbar_size_changed_in_window, | 1646 default_toolbar_size_changed_in_window, |
1631 offsetof (struct frame, default_toolbar_width), | 1647 offsetof (struct frame, default_toolbar_width), |
1632 default_toolbar_size_changed_in_frame, 0); | 1648 default_toolbar_size_changed_in_frame, 0); |
1633 | 1649 |
1634 DEFVAR_SPECIFIER ("top-toolbar-height", | 1650 DEFVAR_SPECIFIER ("top-toolbar-height", |
1635 &Vtoolbar_size[TOP_TOOLBAR] /* | 1651 &Vtoolbar_size[TOP_EDGE] /* |
1636 *Height of the top toolbar. | 1652 *Height of the top toolbar. |
1637 This is a specifier; use `set-specifier' to change it. | 1653 This is a specifier; use `set-specifier' to change it. |
1638 | 1654 |
1639 See `default-toolbar-height' for more information. | 1655 See `default-toolbar-height' for more information. |
1640 */ ); | 1656 */ ); |
1641 Vtoolbar_size[TOP_TOOLBAR] = Fmake_specifier (Qnatnum); | 1657 Vtoolbar_size[TOP_EDGE] = Fmake_specifier (Qnatnum); |
1642 set_specifier_caching (Vtoolbar_size[TOP_TOOLBAR], | 1658 set_specifier_caching (Vtoolbar_size[TOP_EDGE], |
1643 offsetof (struct window, toolbar_size[TOP_TOOLBAR]), | 1659 offsetof (struct window, toolbar_size[TOP_EDGE]), |
1644 toolbar_geometry_changed_in_window, | 1660 toolbar_geometry_changed_in_window, |
1645 offsetof (struct frame, toolbar_size[TOP_TOOLBAR]), | 1661 offsetof (struct frame, toolbar_size[TOP_EDGE]), |
1646 frame_size_slipped, 0); | 1662 frame_size_slipped, 0); |
1647 | 1663 |
1648 DEFVAR_SPECIFIER ("bottom-toolbar-height", | 1664 DEFVAR_SPECIFIER ("bottom-toolbar-height", |
1649 &Vtoolbar_size[BOTTOM_TOOLBAR] /* | 1665 &Vtoolbar_size[BOTTOM_EDGE] /* |
1650 *Height of the bottom toolbar. | 1666 *Height of the bottom toolbar. |
1651 This is a specifier; use `set-specifier' to change it. | 1667 This is a specifier; use `set-specifier' to change it. |
1652 | 1668 |
1653 See `default-toolbar-height' for more information. | 1669 See `default-toolbar-height' for more information. |
1654 */ ); | 1670 */ ); |
1655 Vtoolbar_size[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum); | 1671 Vtoolbar_size[BOTTOM_EDGE] = Fmake_specifier (Qnatnum); |
1656 set_specifier_caching (Vtoolbar_size[BOTTOM_TOOLBAR], | 1672 set_specifier_caching (Vtoolbar_size[BOTTOM_EDGE], |
1657 offsetof (struct window, toolbar_size[BOTTOM_TOOLBAR]), | 1673 offsetof (struct window, toolbar_size[BOTTOM_EDGE]), |
1658 toolbar_geometry_changed_in_window, | 1674 toolbar_geometry_changed_in_window, |
1659 offsetof (struct frame, toolbar_size[BOTTOM_TOOLBAR]), | 1675 offsetof (struct frame, toolbar_size[BOTTOM_EDGE]), |
1660 frame_size_slipped, 0); | 1676 frame_size_slipped, 0); |
1661 | 1677 |
1662 DEFVAR_SPECIFIER ("left-toolbar-width", | 1678 DEFVAR_SPECIFIER ("left-toolbar-width", |
1663 &Vtoolbar_size[LEFT_TOOLBAR] /* | 1679 &Vtoolbar_size[LEFT_EDGE] /* |
1664 *Width of left toolbar. | 1680 *Width of left toolbar. |
1665 This is a specifier; use `set-specifier' to change it. | 1681 This is a specifier; use `set-specifier' to change it. |
1666 | 1682 |
1667 See `default-toolbar-height' for more information. | 1683 See `default-toolbar-height' for more information. |
1668 */ ); | 1684 */ ); |
1669 Vtoolbar_size[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum); | 1685 Vtoolbar_size[LEFT_EDGE] = Fmake_specifier (Qnatnum); |
1670 set_specifier_caching (Vtoolbar_size[LEFT_TOOLBAR], | 1686 set_specifier_caching (Vtoolbar_size[LEFT_EDGE], |
1671 offsetof (struct window, toolbar_size[LEFT_TOOLBAR]), | 1687 offsetof (struct window, toolbar_size[LEFT_EDGE]), |
1672 toolbar_geometry_changed_in_window, | 1688 toolbar_geometry_changed_in_window, |
1673 offsetof (struct frame, toolbar_size[LEFT_TOOLBAR]), | 1689 offsetof (struct frame, toolbar_size[LEFT_EDGE]), |
1674 frame_size_slipped, 0); | 1690 frame_size_slipped, 0); |
1675 | 1691 |
1676 DEFVAR_SPECIFIER ("right-toolbar-width", | 1692 DEFVAR_SPECIFIER ("right-toolbar-width", |
1677 &Vtoolbar_size[RIGHT_TOOLBAR] /* | 1693 &Vtoolbar_size[RIGHT_EDGE] /* |
1678 *Width of right toolbar. | 1694 *Width of right toolbar. |
1679 This is a specifier; use `set-specifier' to change it. | 1695 This is a specifier; use `set-specifier' to change it. |
1680 | 1696 |
1681 See `default-toolbar-height' for more information. | 1697 See `default-toolbar-height' for more information. |
1682 */ ); | 1698 */ ); |
1683 Vtoolbar_size[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum); | 1699 Vtoolbar_size[RIGHT_EDGE] = Fmake_specifier (Qnatnum); |
1684 set_specifier_caching (Vtoolbar_size[RIGHT_TOOLBAR], | 1700 set_specifier_caching (Vtoolbar_size[RIGHT_EDGE], |
1685 offsetof (struct window, toolbar_size[RIGHT_TOOLBAR]), | 1701 offsetof (struct window, toolbar_size[RIGHT_EDGE]), |
1686 toolbar_geometry_changed_in_window, | 1702 toolbar_geometry_changed_in_window, |
1687 offsetof (struct frame, toolbar_size[RIGHT_TOOLBAR]), | 1703 offsetof (struct frame, toolbar_size[RIGHT_EDGE]), |
1688 frame_size_slipped, 0); | 1704 frame_size_slipped, 0); |
1689 | 1705 |
1690 DEFVAR_SPECIFIER ("toolbar-shadow-thickness", | 1706 DEFVAR_SPECIFIER ("toolbar-shadow-thickness", |
1691 &Vtoolbar_shadow_thickness /* | 1707 &Vtoolbar_shadow_thickness /* |
1692 *Width of shadows around toolbar buttons. | 1708 *Width of shadows around toolbar buttons. |
1748 make_int (MSWINDOWS_DEFAULT_TOOLBAR_WIDTH)), fb); | 1764 make_int (MSWINDOWS_DEFAULT_TOOLBAR_WIDTH)), fb); |
1749 #endif | 1765 #endif |
1750 if (!NILP (fb)) | 1766 if (!NILP (fb)) |
1751 set_specifier_fallback (Vdefault_toolbar_width, fb); | 1767 set_specifier_fallback (Vdefault_toolbar_width, fb); |
1752 | 1768 |
1753 set_specifier_fallback (Vtoolbar_size[TOP_TOOLBAR], Vdefault_toolbar_height); | 1769 set_specifier_fallback (Vtoolbar_size[TOP_EDGE], Vdefault_toolbar_height); |
1754 fb = list1 (Fcons (Qnil, Qzero)); | 1770 fb = list1 (Fcons (Qnil, Qzero)); |
1755 set_specifier_fallback (Vtoolbar_size[BOTTOM_TOOLBAR], fb); | 1771 set_specifier_fallback (Vtoolbar_size[BOTTOM_EDGE], fb); |
1756 set_specifier_fallback (Vtoolbar_size[LEFT_TOOLBAR], fb); | 1772 set_specifier_fallback (Vtoolbar_size[LEFT_EDGE], fb); |
1757 set_specifier_fallback (Vtoolbar_size[RIGHT_TOOLBAR], fb); | 1773 set_specifier_fallback (Vtoolbar_size[RIGHT_EDGE], fb); |
1758 | 1774 |
1759 DEFVAR_SPECIFIER ("default-toolbar-border-width", | 1775 DEFVAR_SPECIFIER ("default-toolbar-border-width", |
1760 &Vdefault_toolbar_border_width /* | 1776 &Vdefault_toolbar_border_width /* |
1761 *Width of the border around the default toolbar. | 1777 *Width of the border around the default toolbar. |
1762 This is a specifier; use `set-specifier' to change it. | 1778 This is a specifier; use `set-specifier' to change it. |
1784 default_toolbar_border_width_changed_in_window, | 1800 default_toolbar_border_width_changed_in_window, |
1785 offsetof (struct frame, default_toolbar_border_width), | 1801 offsetof (struct frame, default_toolbar_border_width), |
1786 default_toolbar_border_width_changed_in_frame, 0); | 1802 default_toolbar_border_width_changed_in_frame, 0); |
1787 | 1803 |
1788 DEFVAR_SPECIFIER ("top-toolbar-border-width", | 1804 DEFVAR_SPECIFIER ("top-toolbar-border-width", |
1789 &Vtoolbar_border_width[TOP_TOOLBAR] /* | 1805 &Vtoolbar_border_width[TOP_EDGE] /* |
1790 *Border width of the top toolbar. | 1806 *Border width of the top toolbar. |
1791 This is a specifier; use `set-specifier' to change it. | 1807 This is a specifier; use `set-specifier' to change it. |
1792 | 1808 |
1793 See `default-toolbar-height' for more information. | 1809 See `default-toolbar-height' for more information. |
1794 */ ); | 1810 */ ); |
1795 Vtoolbar_border_width[TOP_TOOLBAR] = Fmake_specifier (Qnatnum); | 1811 Vtoolbar_border_width[TOP_EDGE] = Fmake_specifier (Qnatnum); |
1796 set_specifier_caching (Vtoolbar_border_width[TOP_TOOLBAR], | 1812 set_specifier_caching (Vtoolbar_border_width[TOP_EDGE], |
1797 offsetof (struct window, | 1813 offsetof (struct window, |
1798 toolbar_border_width[TOP_TOOLBAR]), | 1814 toolbar_border_width[TOP_EDGE]), |
1799 toolbar_geometry_changed_in_window, | 1815 toolbar_geometry_changed_in_window, |
1800 offsetof (struct frame, | 1816 offsetof (struct frame, |
1801 toolbar_border_width[TOP_TOOLBAR]), | 1817 toolbar_border_width[TOP_EDGE]), |
1802 frame_size_slipped, 0); | 1818 frame_size_slipped, 0); |
1803 | 1819 |
1804 DEFVAR_SPECIFIER ("bottom-toolbar-border-width", | 1820 DEFVAR_SPECIFIER ("bottom-toolbar-border-width", |
1805 &Vtoolbar_border_width[BOTTOM_TOOLBAR] /* | 1821 &Vtoolbar_border_width[BOTTOM_EDGE] /* |
1806 *Border width of the bottom toolbar. | 1822 *Border width of the bottom toolbar. |
1807 This is a specifier; use `set-specifier' to change it. | 1823 This is a specifier; use `set-specifier' to change it. |
1808 | 1824 |
1809 See `default-toolbar-height' for more information. | 1825 See `default-toolbar-height' for more information. |
1810 */ ); | 1826 */ ); |
1811 Vtoolbar_border_width[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum); | 1827 Vtoolbar_border_width[BOTTOM_EDGE] = Fmake_specifier (Qnatnum); |
1812 set_specifier_caching (Vtoolbar_border_width[BOTTOM_TOOLBAR], | 1828 set_specifier_caching (Vtoolbar_border_width[BOTTOM_EDGE], |
1813 offsetof (struct window, | 1829 offsetof (struct window, |
1814 toolbar_border_width[BOTTOM_TOOLBAR]), | 1830 toolbar_border_width[BOTTOM_EDGE]), |
1815 toolbar_geometry_changed_in_window, | 1831 toolbar_geometry_changed_in_window, |
1816 offsetof (struct frame, | 1832 offsetof (struct frame, |
1817 toolbar_border_width[BOTTOM_TOOLBAR]), | 1833 toolbar_border_width[BOTTOM_EDGE]), |
1818 frame_size_slipped, 0); | 1834 frame_size_slipped, 0); |
1819 | 1835 |
1820 DEFVAR_SPECIFIER ("left-toolbar-border-width", | 1836 DEFVAR_SPECIFIER ("left-toolbar-border-width", |
1821 &Vtoolbar_border_width[LEFT_TOOLBAR] /* | 1837 &Vtoolbar_border_width[LEFT_EDGE] /* |
1822 *Border width of left toolbar. | 1838 *Border width of left toolbar. |
1823 This is a specifier; use `set-specifier' to change it. | 1839 This is a specifier; use `set-specifier' to change it. |
1824 | 1840 |
1825 See `default-toolbar-height' for more information. | 1841 See `default-toolbar-height' for more information. |
1826 */ ); | 1842 */ ); |
1827 Vtoolbar_border_width[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum); | 1843 Vtoolbar_border_width[LEFT_EDGE] = Fmake_specifier (Qnatnum); |
1828 set_specifier_caching (Vtoolbar_border_width[LEFT_TOOLBAR], | 1844 set_specifier_caching (Vtoolbar_border_width[LEFT_EDGE], |
1829 offsetof (struct window, | 1845 offsetof (struct window, |
1830 toolbar_border_width[LEFT_TOOLBAR]), | 1846 toolbar_border_width[LEFT_EDGE]), |
1831 toolbar_geometry_changed_in_window, | 1847 toolbar_geometry_changed_in_window, |
1832 offsetof (struct frame, | 1848 offsetof (struct frame, |
1833 toolbar_border_width[LEFT_TOOLBAR]), | 1849 toolbar_border_width[LEFT_EDGE]), |
1834 frame_size_slipped, 0); | 1850 frame_size_slipped, 0); |
1835 | 1851 |
1836 DEFVAR_SPECIFIER ("right-toolbar-border-width", | 1852 DEFVAR_SPECIFIER ("right-toolbar-border-width", |
1837 &Vtoolbar_border_width[RIGHT_TOOLBAR] /* | 1853 &Vtoolbar_border_width[RIGHT_EDGE] /* |
1838 *Border width of right toolbar. | 1854 *Border width of right toolbar. |
1839 This is a specifier; use `set-specifier' to change it. | 1855 This is a specifier; use `set-specifier' to change it. |
1840 | 1856 |
1841 See `default-toolbar-height' for more information. | 1857 See `default-toolbar-height' for more information. |
1842 */ ); | 1858 */ ); |
1843 Vtoolbar_border_width[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum); | 1859 Vtoolbar_border_width[RIGHT_EDGE] = Fmake_specifier (Qnatnum); |
1844 set_specifier_caching (Vtoolbar_border_width[RIGHT_TOOLBAR], | 1860 set_specifier_caching (Vtoolbar_border_width[RIGHT_EDGE], |
1845 offsetof (struct window, | 1861 offsetof (struct window, |
1846 toolbar_border_width[RIGHT_TOOLBAR]), | 1862 toolbar_border_width[RIGHT_EDGE]), |
1847 toolbar_geometry_changed_in_window, | 1863 toolbar_geometry_changed_in_window, |
1848 offsetof (struct frame, | 1864 offsetof (struct frame, |
1849 toolbar_border_width[RIGHT_TOOLBAR]), | 1865 toolbar_border_width[RIGHT_EDGE]), |
1850 frame_size_slipped, 0); | 1866 frame_size_slipped, 0); |
1851 | 1867 |
1852 fb = Qnil; | 1868 fb = Qnil; |
1853 #ifdef HAVE_TTY | 1869 #ifdef HAVE_TTY |
1854 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); | 1870 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); |
1863 fb = Fcons (Fcons (list1 (Qmswindows), make_int (MSWINDOWS_DEFAULT_TOOLBAR_BORDER_WIDTH)), fb); | 1879 fb = Fcons (Fcons (list1 (Qmswindows), make_int (MSWINDOWS_DEFAULT_TOOLBAR_BORDER_WIDTH)), fb); |
1864 #endif | 1880 #endif |
1865 if (!NILP (fb)) | 1881 if (!NILP (fb)) |
1866 set_specifier_fallback (Vdefault_toolbar_border_width, fb); | 1882 set_specifier_fallback (Vdefault_toolbar_border_width, fb); |
1867 | 1883 |
1868 set_specifier_fallback (Vtoolbar_border_width[TOP_TOOLBAR], Vdefault_toolbar_border_width); | 1884 set_specifier_fallback (Vtoolbar_border_width[TOP_EDGE], Vdefault_toolbar_border_width); |
1869 fb = list1 (Fcons (Qnil, Qzero)); | 1885 fb = list1 (Fcons (Qnil, Qzero)); |
1870 set_specifier_fallback (Vtoolbar_border_width[BOTTOM_TOOLBAR], fb); | 1886 set_specifier_fallback (Vtoolbar_border_width[BOTTOM_EDGE], fb); |
1871 set_specifier_fallback (Vtoolbar_border_width[LEFT_TOOLBAR], fb); | 1887 set_specifier_fallback (Vtoolbar_border_width[LEFT_EDGE], fb); |
1872 set_specifier_fallback (Vtoolbar_border_width[RIGHT_TOOLBAR], fb); | 1888 set_specifier_fallback (Vtoolbar_border_width[RIGHT_EDGE], fb); |
1873 | 1889 |
1874 DEFVAR_SPECIFIER ("default-toolbar-visible-p", &Vdefault_toolbar_visible_p /* | 1890 DEFVAR_SPECIFIER ("default-toolbar-visible-p", &Vdefault_toolbar_visible_p /* |
1875 *Whether the default toolbar is visible. | 1891 *Whether the default toolbar is visible. |
1876 This is a specifier; use `set-specifier' to change it. | 1892 This is a specifier; use `set-specifier' to change it. |
1877 | 1893 |
1897 default_toolbar_visible_p_changed_in_window, | 1913 default_toolbar_visible_p_changed_in_window, |
1898 offsetof (struct frame, default_toolbar_visible_p), | 1914 offsetof (struct frame, default_toolbar_visible_p), |
1899 default_toolbar_visible_p_changed_in_frame, 0); | 1915 default_toolbar_visible_p_changed_in_frame, 0); |
1900 | 1916 |
1901 DEFVAR_SPECIFIER ("top-toolbar-visible-p", | 1917 DEFVAR_SPECIFIER ("top-toolbar-visible-p", |
1902 &Vtoolbar_visible_p[TOP_TOOLBAR] /* | 1918 &Vtoolbar_visible_p[TOP_EDGE] /* |
1903 *Whether the top toolbar is visible. | 1919 *Whether the top toolbar is visible. |
1904 This is a specifier; use `set-specifier' to change it. | 1920 This is a specifier; use `set-specifier' to change it. |
1905 | 1921 |
1906 See `default-toolbar-visible-p' for more information. | 1922 See `default-toolbar-visible-p' for more information. |
1907 */ ); | 1923 */ ); |
1908 Vtoolbar_visible_p[TOP_TOOLBAR] = Fmake_specifier (Qboolean); | 1924 Vtoolbar_visible_p[TOP_EDGE] = Fmake_specifier (Qboolean); |
1909 set_specifier_caching (Vtoolbar_visible_p[TOP_TOOLBAR], | 1925 set_specifier_caching (Vtoolbar_visible_p[TOP_EDGE], |
1910 offsetof (struct window, | 1926 offsetof (struct window, |
1911 toolbar_visible_p[TOP_TOOLBAR]), | 1927 toolbar_visible_p[TOP_EDGE]), |
1912 toolbar_geometry_changed_in_window, | 1928 toolbar_geometry_changed_in_window, |
1913 offsetof (struct frame, | 1929 offsetof (struct frame, |
1914 toolbar_visible_p[TOP_TOOLBAR]), | 1930 toolbar_visible_p[TOP_EDGE]), |
1915 frame_size_slipped, 0); | 1931 frame_size_slipped, 0); |
1916 | 1932 |
1917 DEFVAR_SPECIFIER ("bottom-toolbar-visible-p", | 1933 DEFVAR_SPECIFIER ("bottom-toolbar-visible-p", |
1918 &Vtoolbar_visible_p[BOTTOM_TOOLBAR] /* | 1934 &Vtoolbar_visible_p[BOTTOM_EDGE] /* |
1919 *Whether the bottom toolbar is visible. | 1935 *Whether the bottom toolbar is visible. |
1920 This is a specifier; use `set-specifier' to change it. | 1936 This is a specifier; use `set-specifier' to change it. |
1921 | 1937 |
1922 See `default-toolbar-visible-p' for more information. | 1938 See `default-toolbar-visible-p' for more information. |
1923 */ ); | 1939 */ ); |
1924 Vtoolbar_visible_p[BOTTOM_TOOLBAR] = Fmake_specifier (Qboolean); | 1940 Vtoolbar_visible_p[BOTTOM_EDGE] = Fmake_specifier (Qboolean); |
1925 set_specifier_caching (Vtoolbar_visible_p[BOTTOM_TOOLBAR], | 1941 set_specifier_caching (Vtoolbar_visible_p[BOTTOM_EDGE], |
1926 offsetof (struct window, | 1942 offsetof (struct window, |
1927 toolbar_visible_p[BOTTOM_TOOLBAR]), | 1943 toolbar_visible_p[BOTTOM_EDGE]), |
1928 toolbar_geometry_changed_in_window, | 1944 toolbar_geometry_changed_in_window, |
1929 offsetof (struct frame, | 1945 offsetof (struct frame, |
1930 toolbar_visible_p[BOTTOM_TOOLBAR]), | 1946 toolbar_visible_p[BOTTOM_EDGE]), |
1931 frame_size_slipped, 0); | 1947 frame_size_slipped, 0); |
1932 | 1948 |
1933 DEFVAR_SPECIFIER ("left-toolbar-visible-p", | 1949 DEFVAR_SPECIFIER ("left-toolbar-visible-p", |
1934 &Vtoolbar_visible_p[LEFT_TOOLBAR] /* | 1950 &Vtoolbar_visible_p[LEFT_EDGE] /* |
1935 *Whether the left toolbar is visible. | 1951 *Whether the left toolbar is visible. |
1936 This is a specifier; use `set-specifier' to change it. | 1952 This is a specifier; use `set-specifier' to change it. |
1937 | 1953 |
1938 See `default-toolbar-visible-p' for more information. | 1954 See `default-toolbar-visible-p' for more information. |
1939 */ ); | 1955 */ ); |
1940 Vtoolbar_visible_p[LEFT_TOOLBAR] = Fmake_specifier (Qboolean); | 1956 Vtoolbar_visible_p[LEFT_EDGE] = Fmake_specifier (Qboolean); |
1941 set_specifier_caching (Vtoolbar_visible_p[LEFT_TOOLBAR], | 1957 set_specifier_caching (Vtoolbar_visible_p[LEFT_EDGE], |
1942 offsetof (struct window, | 1958 offsetof (struct window, |
1943 toolbar_visible_p[LEFT_TOOLBAR]), | 1959 toolbar_visible_p[LEFT_EDGE]), |
1944 toolbar_geometry_changed_in_window, | 1960 toolbar_geometry_changed_in_window, |
1945 offsetof (struct frame, | 1961 offsetof (struct frame, |
1946 toolbar_visible_p[LEFT_TOOLBAR]), | 1962 toolbar_visible_p[LEFT_EDGE]), |
1947 frame_size_slipped, 0); | 1963 frame_size_slipped, 0); |
1948 | 1964 |
1949 DEFVAR_SPECIFIER ("right-toolbar-visible-p", | 1965 DEFVAR_SPECIFIER ("right-toolbar-visible-p", |
1950 &Vtoolbar_visible_p[RIGHT_TOOLBAR] /* | 1966 &Vtoolbar_visible_p[RIGHT_EDGE] /* |
1951 *Whether the right toolbar is visible. | 1967 *Whether the right toolbar is visible. |
1952 This is a specifier; use `set-specifier' to change it. | 1968 This is a specifier; use `set-specifier' to change it. |
1953 | 1969 |
1954 See `default-toolbar-visible-p' for more information. | 1970 See `default-toolbar-visible-p' for more information. |
1955 */ ); | 1971 */ ); |
1956 Vtoolbar_visible_p[RIGHT_TOOLBAR] = Fmake_specifier (Qboolean); | 1972 Vtoolbar_visible_p[RIGHT_EDGE] = Fmake_specifier (Qboolean); |
1957 set_specifier_caching (Vtoolbar_visible_p[RIGHT_TOOLBAR], | 1973 set_specifier_caching (Vtoolbar_visible_p[RIGHT_EDGE], |
1958 offsetof (struct window, | 1974 offsetof (struct window, |
1959 toolbar_visible_p[RIGHT_TOOLBAR]), | 1975 toolbar_visible_p[RIGHT_EDGE]), |
1960 toolbar_geometry_changed_in_window, | 1976 toolbar_geometry_changed_in_window, |
1961 offsetof (struct frame, | 1977 offsetof (struct frame, |
1962 toolbar_visible_p[RIGHT_TOOLBAR]), | 1978 toolbar_visible_p[RIGHT_EDGE]), |
1963 frame_size_slipped, 0); | 1979 frame_size_slipped, 0); |
1964 | 1980 |
1965 /* initially, top inherits from default; this can be | 1981 /* initially, top inherits from default; this can be |
1966 changed with `set-default-toolbar-position'. */ | 1982 changed with `set-default-toolbar-position'. */ |
1967 fb = list1 (Fcons (Qnil, Qt)); | 1983 fb = list1 (Fcons (Qnil, Qt)); |
1968 set_specifier_fallback (Vdefault_toolbar_visible_p, fb); | 1984 set_specifier_fallback (Vdefault_toolbar_visible_p, fb); |
1969 set_specifier_fallback (Vtoolbar_visible_p[TOP_TOOLBAR], | 1985 set_specifier_fallback (Vtoolbar_visible_p[TOP_EDGE], |
1970 Vdefault_toolbar_visible_p); | 1986 Vdefault_toolbar_visible_p); |
1971 set_specifier_fallback (Vtoolbar_visible_p[BOTTOM_TOOLBAR], fb); | 1987 set_specifier_fallback (Vtoolbar_visible_p[BOTTOM_EDGE], fb); |
1972 set_specifier_fallback (Vtoolbar_visible_p[LEFT_TOOLBAR], fb); | 1988 set_specifier_fallback (Vtoolbar_visible_p[LEFT_EDGE], fb); |
1973 set_specifier_fallback (Vtoolbar_visible_p[RIGHT_TOOLBAR], fb); | 1989 set_specifier_fallback (Vtoolbar_visible_p[RIGHT_EDGE], fb); |
1974 | 1990 |
1975 DEFVAR_SPECIFIER ("toolbar-buttons-captioned-p", | 1991 DEFVAR_SPECIFIER ("toolbar-buttons-captioned-p", |
1976 &Vtoolbar_buttons_captioned_p /* | 1992 &Vtoolbar_buttons_captioned_p /* |
1977 *Whether the toolbar buttons are captioned. | 1993 *Whether the toolbar buttons are captioned. |
1978 This will only have a visible effect for those toolbar buttons which had | 1994 This will only have a visible effect for those toolbar buttons which had |