Mercurial > hg > xemacs-beta
comparison src/toolbar.c @ 5077:d372b17f63ce
clean up toolbar/gutter edge geometry
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-02-25 Ben Wing <ben@xemacs.org>
* EmacsFrame.c (EmacsFrameSetValues):
* frame-impl.h:
* frame-impl.h (struct frame):
* frame-impl.h (FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT):
* frame-impl.h (FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH):
* frame-impl.h (FRAME_REAL_TOP_TOOLBAR_HEIGHT):
* frame-impl.h (FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH):
* frame-impl.h (FRAME_REAL_TOP_TOOLBAR_VISIBLE):
* frame-impl.h (FRAME_REAL_TOP_TOOLBAR_BOUNDS):
* frame.h:
* frame.h (enum edge_pos):
* gutter.c:
* gutter.c (get_gutter_coords):
* gutter.c (display_boxes_in_gutter_p):
* gutter.c (construct_window_gutter_spec):
* gutter.c (calculate_gutter_size_from_display_lines):
* gutter.c (calculate_gutter_size):
* gutter.c (output_gutter):
* gutter.c (clear_gutter):
* gutter.c (mark_gutters):
* gutter.c (gutter_extent_signal_changed_region_maybe):
* gutter.c (update_gutter_geometry):
* gutter.c (update_frame_gutter_geometry):
* gutter.c (update_frame_gutters):
* gutter.c (reset_gutter_display_lines):
* gutter.c (redraw_exposed_gutter):
* gutter.c (redraw_exposed_gutters):
* gutter.c (free_frame_gutters):
* gutter.c (decode_gutter_position):
* gutter.c (Fset_default_gutter_position):
* gutter.c (Fgutter_pixel_width):
* gutter.c (Fgutter_pixel_height):
* gutter.c (recompute_overlaying_specifier):
* gutter.c (gutter_specs_changed_1):
* gutter.c (gutter_specs_changed):
* gutter.c (top_gutter_specs_changed):
* gutter.c (bottom_gutter_specs_changed):
* gutter.c (left_gutter_specs_changed):
* gutter.c (right_gutter_specs_changed):
* gutter.c (gutter_geometry_changed_in_window):
* gutter.c (init_frame_gutters):
* gutter.c (specifier_vars_of_gutter):
* gutter.h:
* gutter.h (WINDOW_REAL_TOP_GUTTER_BOUNDS):
* gutter.h (FRAME_TOP_GUTTER_BOUNDS):
* lisp.h (enum edge_style):
* native-gtk-toolbar.c:
* native-gtk-toolbar.c (gtk_output_toolbar):
* native-gtk-toolbar.c (gtk_clear_toolbar):
* native-gtk-toolbar.c (gtk_output_frame_toolbars):
* native-gtk-toolbar.c (gtk_initialize_frame_toolbars):
* toolbar-msw.c:
* toolbar-msw.c (TOOLBAR_HANDLE):
* toolbar-msw.c (allocate_toolbar_item_id):
* toolbar-msw.c (mswindows_clear_toolbar):
* toolbar-msw.c (mswindows_output_toolbar):
* toolbar-msw.c (mswindows_move_toolbar):
* toolbar-msw.c (mswindows_redraw_exposed_toolbars):
* toolbar-msw.c (mswindows_initialize_frame_toolbars):
* toolbar-msw.c (mswindows_output_frame_toolbars):
* toolbar-msw.c (mswindows_clear_frame_toolbars):
* toolbar-msw.c (DELETE_TOOLBAR):
* toolbar-msw.c (mswindows_free_frame_toolbars):
* toolbar-msw.c (mswindows_get_toolbar_button_text):
* toolbar-xlike.c:
* toolbar-xlike.c (__prepare_button_area):
* toolbar-xlike.c (XLIKE_OUTPUT_BUTTONS_LOOP):
* toolbar-xlike.c (xlike_output_toolbar):
* toolbar-xlike.c (xlike_clear_toolbar):
* toolbar-xlike.c (xlike_output_frame_toolbars):
* toolbar-xlike.c (xlike_clear_frame_toolbars):
* toolbar-xlike.c (xlike_redraw_exposed_toolbar):
* toolbar-xlike.c (xlike_redraw_exposed_toolbars):
* toolbar-xlike.c (xlike_redraw_frame_toolbars):
* toolbar.c:
* toolbar.c (decode_toolbar_position):
* toolbar.c (Fset_default_toolbar_position):
* toolbar.c (mark_frame_toolbar_buttons_dirty):
* toolbar.c (compute_frame_toolbar_buttons):
* toolbar.c (set_frame_toolbar):
* toolbar.c (compute_frame_toolbars_data):
* toolbar.c (update_frame_toolbars_geometry):
* toolbar.c (init_frame_toolbars):
* toolbar.c (get_toolbar_coords):
* toolbar.c (CHECK_TOOLBAR):
* toolbar.c (toolbar_buttons_at_pixpos):
* toolbar.c (CTB_ERROR):
* toolbar.c (recompute_overlaying_specifier):
* toolbar.c (specifier_vars_of_toolbar):
* toolbar.h:
* toolbar.h (SET_TOOLBAR_WAS_VISIBLE_FLAG):
Create new enum edge_pos with TOP_EDGE, BOTTOM_EDGE, LEFT_EDGE,
RIGHT_EDGE; subsume TOP_BORDER, TOP_GUTTER, enum toolbar_pos,
enum gutter_pos, etc.
Create EDGE_POS_LOOP, subsuming GUTTER_POS_LOOP.
Create NUM_EDGES, use in many places instead of hardcoded '4'.
Instead of top_toolbar_was_visible, bottom_toolbar_was_visible,
etc. make an array toolbar_was_visible[NUM_EDGES]. This increases
the frame size by 15 bytes or so (could be 3 if we use Boolbytes)
but hardly seems w to matter -- frames are heavy weight objects
anyway. Same with top_gutter_was_visible, etc.
Remove duplicated SET_TOOLBAR_WAS_VISIBLE_FLAG and put defn in
one place (toolbar.h).
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Thu, 25 Feb 2010 04:45:13 -0600 |
parents | d0c14ea98592 |
children | 0ca81354c4c7 |
comparison
equal
deleted
inserted
replaced
5076:d555581e3cba | 5077:d372b17f63ce |
---|---|
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; |
230 | 230 |
231 return glyph; | 231 return glyph; |
232 } | 232 } |
233 | 233 |
234 | 234 |
235 static enum toolbar_pos | 235 static enum edge_pos |
236 decode_toolbar_position (Lisp_Object position) | 236 decode_toolbar_position (Lisp_Object position) |
237 { | 237 { |
238 if (EQ (position, Qtop)) return TOP_TOOLBAR; | 238 if (EQ (position, Qtop)) return TOP_EDGE; |
239 if (EQ (position, Qbottom)) return BOTTOM_TOOLBAR; | 239 if (EQ (position, Qbottom)) return BOTTOM_EDGE; |
240 if (EQ (position, Qleft)) return LEFT_TOOLBAR; | 240 if (EQ (position, Qleft)) return LEFT_EDGE; |
241 if (EQ (position, Qright)) return RIGHT_TOOLBAR; | 241 if (EQ (position, Qright)) return RIGHT_EDGE; |
242 invalid_constant ("Invalid toolbar position", position); | 242 invalid_constant ("Invalid toolbar position", position); |
243 | 243 |
244 RETURN_NOT_REACHED (TOP_TOOLBAR); | 244 RETURN_NOT_REACHED (TOP_EDGE); |
245 } | 245 } |
246 | 246 |
247 DEFUN ("set-default-toolbar-position", Fset_default_toolbar_position, 1, 1, 0, /* | 247 DEFUN ("set-default-toolbar-position", Fset_default_toolbar_position, 1, 1, 0, /* |
248 Set the position that the `default-toolbar' will be displayed at. | 248 Set the position that the `default-toolbar' will be displayed at. |
249 Valid positions are `top', `bottom', `left' and `right'. | 249 Valid positions are `top', `bottom', `left' and `right'. |
250 See `default-toolbar-position'. | 250 See `default-toolbar-position'. |
251 */ | 251 */ |
252 (position)) | 252 (position)) |
253 { | 253 { |
254 enum toolbar_pos cur = decode_toolbar_position (Vdefault_toolbar_position); | 254 enum edge_pos cur = decode_toolbar_position (Vdefault_toolbar_position); |
255 enum toolbar_pos new_ = decode_toolbar_position (position); | 255 enum edge_pos new_ = decode_toolbar_position (position); |
256 | 256 |
257 if (cur != new_) | 257 if (cur != new_) |
258 { | 258 { |
259 /* The following calls will automatically cause the dirty | 259 /* The following calls will automatically cause the dirty |
260 flags to be set; we delay frame size changes to avoid | 260 flags to be set; we delay frame size changes to avoid |
262 int depth = begin_hold_frame_size_changes (); | 262 int depth = begin_hold_frame_size_changes (); |
263 set_specifier_fallback (Vtoolbar[cur], list1 (Fcons (Qnil, Qnil))); | 263 set_specifier_fallback (Vtoolbar[cur], list1 (Fcons (Qnil, Qnil))); |
264 set_specifier_fallback (Vtoolbar[new_], Vdefault_toolbar); | 264 set_specifier_fallback (Vtoolbar[new_], Vdefault_toolbar); |
265 set_specifier_fallback (Vtoolbar_size[cur], list1 (Fcons (Qnil, Qzero))); | 265 set_specifier_fallback (Vtoolbar_size[cur], list1 (Fcons (Qnil, Qzero))); |
266 set_specifier_fallback (Vtoolbar_size[new_], | 266 set_specifier_fallback (Vtoolbar_size[new_], |
267 new_ == TOP_TOOLBAR || new_ == BOTTOM_TOOLBAR | 267 new_ == TOP_EDGE || new_ == BOTTOM_EDGE |
268 ? Vdefault_toolbar_height | 268 ? Vdefault_toolbar_height |
269 : Vdefault_toolbar_width); | 269 : Vdefault_toolbar_width); |
270 set_specifier_fallback (Vtoolbar_border_width[cur], | 270 set_specifier_fallback (Vtoolbar_border_width[cur], |
271 list1 (Fcons (Qnil, Qzero))); | 271 list1 (Fcons (Qnil, Qzero))); |
272 set_specifier_fallback (Vtoolbar_border_width[new_], | 272 set_specifier_fallback (Vtoolbar_border_width[new_], |
588 UNGCPRO; | 588 UNGCPRO; |
589 return retval; | 589 return retval; |
590 } | 590 } |
591 | 591 |
592 void | 592 void |
593 mark_frame_toolbar_buttons_dirty (struct frame *f, enum toolbar_pos pos) | 593 mark_frame_toolbar_buttons_dirty (struct frame *f, enum edge_pos pos) |
594 { | 594 { |
595 Lisp_Object button = FRAME_TOOLBAR_BUTTONS (f, pos); | 595 Lisp_Object button = FRAME_TOOLBAR_BUTTONS (f, pos); |
596 | 596 |
597 while (!NILP (button)) | 597 while (!NILP (button)) |
598 { | 598 { |
602 } | 602 } |
603 return; | 603 return; |
604 } | 604 } |
605 | 605 |
606 static Lisp_Object | 606 static Lisp_Object |
607 compute_frame_toolbar_buttons (struct frame *f, enum toolbar_pos pos, | 607 compute_frame_toolbar_buttons (struct frame *f, enum edge_pos pos, |
608 Lisp_Object toolbar) | 608 Lisp_Object toolbar) |
609 { | 609 { |
610 Lisp_Object buttons, prev_button, first_button; | 610 Lisp_Object buttons, prev_button, first_button; |
611 Lisp_Object orig_toolbar = toolbar; | 611 Lisp_Object orig_toolbar = toolbar; |
612 int pushright_seen = 0; | 612 int pushright_seen = 0; |
711 UNGCPRO; | 711 UNGCPRO; |
712 return first_button; | 712 return first_button; |
713 } | 713 } |
714 | 714 |
715 static void | 715 static void |
716 set_frame_toolbar (struct frame *f, enum toolbar_pos pos) | 716 set_frame_toolbar (struct frame *f, enum edge_pos pos) |
717 { | 717 { |
718 struct window *w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); | 718 struct window *w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); |
719 Lisp_Object toolbar = w->toolbar[pos]; | 719 Lisp_Object toolbar = w->toolbar[pos]; |
720 f->toolbar_buttons[pos] = (FRAME_REAL_TOOLBAR_VISIBLE (f, pos) | 720 f->toolbar_buttons[pos] = (FRAME_REAL_TOOLBAR_VISIBLE (f, pos) |
721 ? compute_frame_toolbar_buttons (f, pos, toolbar) | 721 ? compute_frame_toolbar_buttons (f, pos, toolbar) |
723 } | 723 } |
724 | 724 |
725 static void | 725 static void |
726 compute_frame_toolbars_data (struct frame *f) | 726 compute_frame_toolbars_data (struct frame *f) |
727 { | 727 { |
728 set_frame_toolbar (f, TOP_TOOLBAR); | 728 set_frame_toolbar (f, TOP_EDGE); |
729 set_frame_toolbar (f, BOTTOM_TOOLBAR); | 729 set_frame_toolbar (f, BOTTOM_EDGE); |
730 set_frame_toolbar (f, LEFT_TOOLBAR); | 730 set_frame_toolbar (f, LEFT_EDGE); |
731 set_frame_toolbar (f, RIGHT_TOOLBAR); | 731 set_frame_toolbar (f, RIGHT_EDGE); |
732 } | 732 } |
733 | 733 |
734 /* Update the toolbar geometry separately from actually displaying the | 734 /* Update the toolbar geometry separately from actually displaying the |
735 toolbar. This is necessary because both the gutter and the toolbar | 735 toolbar. This is necessary because both the gutter and the toolbar |
736 are competing for redisplay cycles and, unfortunately, gutter | 736 are competing for redisplay cycles and, unfortunately, gutter |
760 necessitate this layout, as it is outside any windows. We | 760 necessitate this layout, as it is outside any windows. We |
761 take care not to change size if toolbar geometry is really | 761 take care not to change size if toolbar geometry is really |
762 unchanged, as it will hose windows whose pixsizes are not | 762 unchanged, as it will hose windows whose pixsizes are not |
763 multiple of character sizes. */ | 763 multiple of character sizes. */ |
764 | 764 |
765 for (pos = 0; pos < 4; pos++) | 765 EDGE_POS_LOOP (pos) |
766 if (FRAME_REAL_TOOLBAR_SIZE (f, pos) | 766 if (FRAME_REAL_TOOLBAR_SIZE (f, pos) |
767 != FRAME_CURRENT_TOOLBAR_SIZE (f, pos)) | 767 != FRAME_CURRENT_TOOLBAR_SIZE (f, pos)) |
768 frame_size_changed = 1; | 768 frame_size_changed = 1; |
769 | 769 |
770 for (pos = 0; pos < 4; pos++) { | 770 EDGE_POS_LOOP (pos) |
771 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); | 771 { |
772 } | 772 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); |
773 } | |
773 | 774 |
774 /* Removed the check for the minibuffer here. We handle this | 775 /* Removed the check for the minibuffer here. We handle this |
775 more correctly now by consistently using | 776 more correctly now by consistently using |
776 FRAME_LAST_NONMINIBUF_WINDOW instead of FRAME_SELECTED_WINDOW | 777 FRAME_LAST_NONMINIBUF_WINDOW instead of FRAME_SELECTED_WINDOW |
777 throughout the toolbar code. */ | 778 throughout the toolbar code. */ |
831 | 832 |
832 /* We are here as far in frame creation so cached specifiers are | 833 /* We are here as far in frame creation so cached specifiers are |
833 already recomputed, and possibly modified by resource | 834 already recomputed, and possibly modified by resource |
834 initialization. Remember current toolbar geometry so next | 835 initialization. Remember current toolbar geometry so next |
835 redisplay will not needlessly relayout toolbars. */ | 836 redisplay will not needlessly relayout toolbars. */ |
836 for (pos = 0; pos < 4; pos++) | 837 EDGE_POS_LOOP (pos) |
837 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); | 838 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); |
838 } | 839 } |
839 } | 840 } |
840 | 841 |
841 void | 842 void |
866 | 867 |
867 MAYBE_FRAMEMETH (f, free_frame_toolbars, (f)); | 868 MAYBE_FRAMEMETH (f, free_frame_toolbars, (f)); |
868 } | 869 } |
869 | 870 |
870 void | 871 void |
871 get_toolbar_coords (struct frame *f, enum toolbar_pos pos, int *x, int *y, | 872 get_toolbar_coords (struct frame *f, enum edge_pos pos, int *x, int *y, |
872 int *width, int *height, int *vert, int for_layout) | 873 int *width, int *height, int *vert, int for_layout) |
873 { | 874 { |
874 int visible_top_toolbar_height, visible_bottom_toolbar_height; | 875 int visible_top_toolbar_height, visible_bottom_toolbar_height; |
875 int adjust = (for_layout ? 1 : 0); | 876 int adjust = (for_layout ? 1 : 0); |
876 | 877 |
890 at the outside edges. However, when we are simply determining | 891 at the outside edges. However, when we are simply determining |
891 toolbar location we don't want to do that. */ | 892 toolbar location we don't want to do that. */ |
892 | 893 |
893 switch (pos) | 894 switch (pos) |
894 { | 895 { |
895 case TOP_TOOLBAR: | 896 case TOP_EDGE: |
896 *x = 1; | 897 *x = 1; |
897 *y = 0; /* #### should be 1 if no menubar */ | 898 *y = 0; /* #### should be 1 if no menubar */ |
898 *width = FRAME_PIXWIDTH (f) - 2; | 899 *width = FRAME_PIXWIDTH (f) - 2; |
899 *height = FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) + | 900 *height = FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) + |
900 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f) - adjust; | 901 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f) - adjust; |
901 *vert = 0; | 902 *vert = 0; |
902 break; | 903 break; |
903 case BOTTOM_TOOLBAR: | 904 case BOTTOM_EDGE: |
904 *x = 1; | 905 *x = 1; |
905 *y = FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - | 906 *y = FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - |
906 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); | 907 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); |
907 *width = FRAME_PIXWIDTH (f) - 2; | 908 *width = FRAME_PIXWIDTH (f) - 2; |
908 *height = FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) + | 909 *height = FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) + |
909 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f) - adjust; | 910 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f) - adjust; |
910 *vert = 0; | 911 *vert = 0; |
911 break; | 912 break; |
912 case LEFT_TOOLBAR: | 913 case LEFT_EDGE: |
913 *x = 1; | 914 *x = 1; |
914 *y = visible_top_toolbar_height; | 915 *y = visible_top_toolbar_height; |
915 *width = FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + | 916 *width = FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + |
916 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f) - adjust; | 917 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f) - adjust; |
917 *height = (FRAME_PIXHEIGHT (f) - visible_top_toolbar_height - | 918 *height = (FRAME_PIXHEIGHT (f) - visible_top_toolbar_height - |
918 visible_bottom_toolbar_height - 1); | 919 visible_bottom_toolbar_height - 1); |
919 *vert = 1; | 920 *vert = 1; |
920 break; | 921 break; |
921 case RIGHT_TOOLBAR: | 922 case RIGHT_EDGE: |
922 *x = FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - | 923 *x = FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - |
923 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); | 924 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); |
924 *y = visible_top_toolbar_height; | 925 *y = visible_top_toolbar_height; |
925 *width = FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) + | 926 *width = FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) + |
926 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f) - adjust; | 927 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f) - adjust; |
932 ABORT (); | 933 ABORT (); |
933 } | 934 } |
934 } | 935 } |
935 | 936 |
936 #define CHECK_TOOLBAR(pos) do { \ | 937 #define CHECK_TOOLBAR(pos) do { \ |
937 if (FRAME_REAL_##pos##_VISIBLE (f)) \ | 938 if (FRAME_REAL_TOOLBAR_VISIBLE (f, pos)) \ |
938 { \ | 939 { \ |
939 int x, y, width, height, vert; \ | 940 int x, y, width, height, vert; \ |
940 \ | 941 \ |
941 get_toolbar_coords (f, pos, &x, &y, &width, &height, &vert, 0); \ | 942 get_toolbar_coords (f, pos, &x, &y, &width, &height, &vert, 0); \ |
942 if ((x_coord >= x) && (x_coord < (x + width))) \ | 943 if ((x_coord >= x) && (x_coord < (x + width))) \ |
948 } while (0) | 949 } while (0) |
949 | 950 |
950 static Lisp_Object | 951 static Lisp_Object |
951 toolbar_buttons_at_pixpos (struct frame *f, int x_coord, int y_coord) | 952 toolbar_buttons_at_pixpos (struct frame *f, int x_coord, int y_coord) |
952 { | 953 { |
953 CHECK_TOOLBAR (TOP_TOOLBAR); | 954 CHECK_TOOLBAR (TOP_EDGE); |
954 CHECK_TOOLBAR (BOTTOM_TOOLBAR); | 955 CHECK_TOOLBAR (BOTTOM_EDGE); |
955 CHECK_TOOLBAR (LEFT_TOOLBAR); | 956 CHECK_TOOLBAR (LEFT_EDGE); |
956 CHECK_TOOLBAR (RIGHT_TOOLBAR); | 957 CHECK_TOOLBAR (RIGHT_EDGE); |
957 | 958 |
958 return Qnil; | 959 return Qnil; |
959 } | 960 } |
960 #undef CHECK_TOOLBAR | 961 #undef CHECK_TOOLBAR |
961 | 962 |
995 /* Toolbar specifier type */ | 996 /* Toolbar specifier type */ |
996 /************************************************************************/ | 997 /************************************************************************/ |
997 | 998 |
998 DEFINE_SPECIFIER_TYPE (toolbar); | 999 DEFINE_SPECIFIER_TYPE (toolbar); |
999 | 1000 |
1000 #define CTB_ERROR(msg) do { \ | 1001 #define CTB_ERROR(msg) do { \ |
1001 maybe_signal_error (Qinvalid_argument, msg, button, Qtoolbar, errb); \ | 1002 maybe_signal_error (Qinvalid_argument, msg, button, Qtoolbar, errb); \ |
1002 RETURN_SANS_WARNINGS Qnil; \ | 1003 RETURN_SANS_WARNINGS Qnil; \ |
1003 } while (0) | 1004 } while (0) |
1004 | 1005 |
1005 /* Returns Q_style if key was :style, Qt if ok otherwise, Qnil if error. */ | 1006 /* Returns Q_style if key was :style, Qt if ok otherwise, Qnil if error. */ |
1006 static Lisp_Object | 1007 static Lisp_Object |
1007 check_toolbar_button_keywords (Lisp_Object button, Lisp_Object key, | 1008 check_toolbar_button_keywords (Lisp_Object button, Lisp_Object key, |
1214 /* | 1215 /* |
1215 Helper for invalidating the real specifier when default | 1216 Helper for invalidating the real specifier when default |
1216 specifier caching changes | 1217 specifier caching changes |
1217 */ | 1218 */ |
1218 static void | 1219 static void |
1219 recompute_overlaying_specifier (Lisp_Object real_one[4]) | 1220 recompute_overlaying_specifier (Lisp_Object real_one[NUM_EDGES]) |
1220 { | 1221 { |
1221 enum toolbar_pos pos = decode_toolbar_position (Vdefault_toolbar_position); | 1222 enum edge_pos pos = decode_toolbar_position (Vdefault_toolbar_position); |
1222 Fset_specifier_dirty_flag (real_one[pos]); | 1223 Fset_specifier_dirty_flag (real_one[pos]); |
1223 } | 1224 } |
1224 | 1225 |
1225 static void | 1226 static void |
1226 toolbar_specs_changed (Lisp_Object UNUSED (specifier), | 1227 toolbar_specs_changed (Lisp_Object UNUSED (specifier), |
1499 offsetof (struct window, default_toolbar), | 1500 offsetof (struct window, default_toolbar), |
1500 default_toolbar_specs_changed, | 1501 default_toolbar_specs_changed, |
1501 0, 0, 0); | 1502 0, 0, 0); |
1502 | 1503 |
1503 DEFVAR_SPECIFIER ("top-toolbar", | 1504 DEFVAR_SPECIFIER ("top-toolbar", |
1504 &Vtoolbar[TOP_TOOLBAR] /* | 1505 &Vtoolbar[TOP_EDGE] /* |
1505 Specifier for the toolbar at the top of the frame. | 1506 Specifier for the toolbar at the top of the frame. |
1506 Use `set-specifier' to change this. | 1507 Use `set-specifier' to change this. |
1507 See `default-toolbar' for a description of a valid toolbar instantiator. | 1508 See `default-toolbar' for a description of a valid toolbar instantiator. |
1508 */ ); | 1509 */ ); |
1509 Vtoolbar[TOP_TOOLBAR] = Fmake_specifier (Qtoolbar); | 1510 Vtoolbar[TOP_EDGE] = Fmake_specifier (Qtoolbar); |
1510 set_specifier_caching (Vtoolbar[TOP_TOOLBAR], | 1511 set_specifier_caching (Vtoolbar[TOP_EDGE], |
1511 offsetof (struct window, toolbar[TOP_TOOLBAR]), | 1512 offsetof (struct window, toolbar[TOP_EDGE]), |
1512 toolbar_specs_changed, | 1513 toolbar_specs_changed, |
1513 0, 0, 0); | 1514 0, 0, 0); |
1514 | 1515 |
1515 DEFVAR_SPECIFIER ("bottom-toolbar", | 1516 DEFVAR_SPECIFIER ("bottom-toolbar", |
1516 &Vtoolbar[BOTTOM_TOOLBAR] /* | 1517 &Vtoolbar[BOTTOM_EDGE] /* |
1517 Specifier for the toolbar at the bottom of the frame. | 1518 Specifier for the toolbar at the bottom of the frame. |
1518 Use `set-specifier' to change this. | 1519 Use `set-specifier' to change this. |
1519 See `default-toolbar' for a description of a valid toolbar instantiator. | 1520 See `default-toolbar' for a description of a valid toolbar instantiator. |
1520 | 1521 |
1521 Note that, unless the `default-toolbar-position' is `bottom', by | 1522 Note that, unless the `default-toolbar-position' is `bottom', by |
1522 default the height of the bottom toolbar (controlled by | 1523 default the height of the bottom toolbar (controlled by |
1523 `bottom-toolbar-height') is 0; thus, a bottom toolbar will not be | 1524 `bottom-toolbar-height') is 0; thus, a bottom toolbar will not be |
1524 displayed even if you provide a value for `bottom-toolbar'. | 1525 displayed even if you provide a value for `bottom-toolbar'. |
1525 */ ); | 1526 */ ); |
1526 Vtoolbar[BOTTOM_TOOLBAR] = Fmake_specifier (Qtoolbar); | 1527 Vtoolbar[BOTTOM_EDGE] = Fmake_specifier (Qtoolbar); |
1527 set_specifier_caching (Vtoolbar[BOTTOM_TOOLBAR], | 1528 set_specifier_caching (Vtoolbar[BOTTOM_EDGE], |
1528 offsetof (struct window, toolbar[BOTTOM_TOOLBAR]), | 1529 offsetof (struct window, toolbar[BOTTOM_EDGE]), |
1529 toolbar_specs_changed, | 1530 toolbar_specs_changed, |
1530 0, 0, 0); | 1531 0, 0, 0); |
1531 | 1532 |
1532 DEFVAR_SPECIFIER ("left-toolbar", | 1533 DEFVAR_SPECIFIER ("left-toolbar", |
1533 &Vtoolbar[LEFT_TOOLBAR] /* | 1534 &Vtoolbar[LEFT_EDGE] /* |
1534 Specifier for the toolbar at the left edge of the frame. | 1535 Specifier for the toolbar at the left edge of the frame. |
1535 Use `set-specifier' to change this. | 1536 Use `set-specifier' to change this. |
1536 See `default-toolbar' for a description of a valid toolbar instantiator. | 1537 See `default-toolbar' for a description of a valid toolbar instantiator. |
1537 | 1538 |
1538 Note that, unless the `default-toolbar-position' is `left', by | 1539 Note that, unless the `default-toolbar-position' is `left', by |
1539 default the height of the left toolbar (controlled by | 1540 default the height of the left toolbar (controlled by |
1540 `left-toolbar-width') is 0; thus, a left toolbar will not be | 1541 `left-toolbar-width') is 0; thus, a left toolbar will not be |
1541 displayed even if you provide a value for `left-toolbar'. | 1542 displayed even if you provide a value for `left-toolbar'. |
1542 */ ); | 1543 */ ); |
1543 Vtoolbar[LEFT_TOOLBAR] = Fmake_specifier (Qtoolbar); | 1544 Vtoolbar[LEFT_EDGE] = Fmake_specifier (Qtoolbar); |
1544 set_specifier_caching (Vtoolbar[LEFT_TOOLBAR], | 1545 set_specifier_caching (Vtoolbar[LEFT_EDGE], |
1545 offsetof (struct window, toolbar[LEFT_TOOLBAR]), | 1546 offsetof (struct window, toolbar[LEFT_EDGE]), |
1546 toolbar_specs_changed, | 1547 toolbar_specs_changed, |
1547 0, 0, 0); | 1548 0, 0, 0); |
1548 | 1549 |
1549 DEFVAR_SPECIFIER ("right-toolbar", | 1550 DEFVAR_SPECIFIER ("right-toolbar", |
1550 &Vtoolbar[RIGHT_TOOLBAR] /* | 1551 &Vtoolbar[RIGHT_EDGE] /* |
1551 Specifier for the toolbar at the right edge of the frame. | 1552 Specifier for the toolbar at the right edge of the frame. |
1552 Use `set-specifier' to change this. | 1553 Use `set-specifier' to change this. |
1553 See `default-toolbar' for a description of a valid toolbar instantiator. | 1554 See `default-toolbar' for a description of a valid toolbar instantiator. |
1554 | 1555 |
1555 Note that, unless the `default-toolbar-position' is `right', by | 1556 Note that, unless the `default-toolbar-position' is `right', by |
1556 default the height of the right toolbar (controlled by | 1557 default the height of the right toolbar (controlled by |
1557 `right-toolbar-width') is 0; thus, a right toolbar will not be | 1558 `right-toolbar-width') is 0; thus, a right toolbar will not be |
1558 displayed even if you provide a value for `right-toolbar'. | 1559 displayed even if you provide a value for `right-toolbar'. |
1559 */ ); | 1560 */ ); |
1560 Vtoolbar[RIGHT_TOOLBAR] = Fmake_specifier (Qtoolbar); | 1561 Vtoolbar[RIGHT_EDGE] = Fmake_specifier (Qtoolbar); |
1561 set_specifier_caching (Vtoolbar[RIGHT_TOOLBAR], | 1562 set_specifier_caching (Vtoolbar[RIGHT_EDGE], |
1562 offsetof (struct window, toolbar[RIGHT_TOOLBAR]), | 1563 offsetof (struct window, toolbar[RIGHT_EDGE]), |
1563 toolbar_specs_changed, | 1564 toolbar_specs_changed, |
1564 0, 0, 0); | 1565 0, 0, 0); |
1565 | 1566 |
1566 /* initially, top inherits from default; this can be | 1567 /* initially, top inherits from default; this can be |
1567 changed with `set-default-toolbar-position'. */ | 1568 changed with `set-default-toolbar-position'. */ |
1568 fb = list1 (Fcons (Qnil, Qnil)); | 1569 fb = list1 (Fcons (Qnil, Qnil)); |
1569 set_specifier_fallback (Vdefault_toolbar, fb); | 1570 set_specifier_fallback (Vdefault_toolbar, fb); |
1570 set_specifier_fallback (Vtoolbar[TOP_TOOLBAR], Vdefault_toolbar); | 1571 set_specifier_fallback (Vtoolbar[TOP_EDGE], Vdefault_toolbar); |
1571 set_specifier_fallback (Vtoolbar[BOTTOM_TOOLBAR], fb); | 1572 set_specifier_fallback (Vtoolbar[BOTTOM_EDGE], fb); |
1572 set_specifier_fallback (Vtoolbar[LEFT_TOOLBAR], fb); | 1573 set_specifier_fallback (Vtoolbar[LEFT_EDGE], fb); |
1573 set_specifier_fallback (Vtoolbar[RIGHT_TOOLBAR], fb); | 1574 set_specifier_fallback (Vtoolbar[RIGHT_EDGE], fb); |
1574 | 1575 |
1575 DEFVAR_SPECIFIER ("default-toolbar-height", &Vdefault_toolbar_height /* | 1576 DEFVAR_SPECIFIER ("default-toolbar-height", &Vdefault_toolbar_height /* |
1576 *Height of the default toolbar, if it's oriented horizontally. | 1577 *Height of the default toolbar, if it's oriented horizontally. |
1577 This is a specifier; use `set-specifier' to change it. | 1578 This is a specifier; use `set-specifier' to change it. |
1578 | 1579 |
1630 default_toolbar_size_changed_in_window, | 1631 default_toolbar_size_changed_in_window, |
1631 offsetof (struct frame, default_toolbar_width), | 1632 offsetof (struct frame, default_toolbar_width), |
1632 default_toolbar_size_changed_in_frame, 0); | 1633 default_toolbar_size_changed_in_frame, 0); |
1633 | 1634 |
1634 DEFVAR_SPECIFIER ("top-toolbar-height", | 1635 DEFVAR_SPECIFIER ("top-toolbar-height", |
1635 &Vtoolbar_size[TOP_TOOLBAR] /* | 1636 &Vtoolbar_size[TOP_EDGE] /* |
1636 *Height of the top toolbar. | 1637 *Height of the top toolbar. |
1637 This is a specifier; use `set-specifier' to change it. | 1638 This is a specifier; use `set-specifier' to change it. |
1638 | 1639 |
1639 See `default-toolbar-height' for more information. | 1640 See `default-toolbar-height' for more information. |
1640 */ ); | 1641 */ ); |
1641 Vtoolbar_size[TOP_TOOLBAR] = Fmake_specifier (Qnatnum); | 1642 Vtoolbar_size[TOP_EDGE] = Fmake_specifier (Qnatnum); |
1642 set_specifier_caching (Vtoolbar_size[TOP_TOOLBAR], | 1643 set_specifier_caching (Vtoolbar_size[TOP_EDGE], |
1643 offsetof (struct window, toolbar_size[TOP_TOOLBAR]), | 1644 offsetof (struct window, toolbar_size[TOP_EDGE]), |
1644 toolbar_geometry_changed_in_window, | 1645 toolbar_geometry_changed_in_window, |
1645 offsetof (struct frame, toolbar_size[TOP_TOOLBAR]), | 1646 offsetof (struct frame, toolbar_size[TOP_EDGE]), |
1646 frame_size_slipped, 0); | 1647 frame_size_slipped, 0); |
1647 | 1648 |
1648 DEFVAR_SPECIFIER ("bottom-toolbar-height", | 1649 DEFVAR_SPECIFIER ("bottom-toolbar-height", |
1649 &Vtoolbar_size[BOTTOM_TOOLBAR] /* | 1650 &Vtoolbar_size[BOTTOM_EDGE] /* |
1650 *Height of the bottom toolbar. | 1651 *Height of the bottom toolbar. |
1651 This is a specifier; use `set-specifier' to change it. | 1652 This is a specifier; use `set-specifier' to change it. |
1652 | 1653 |
1653 See `default-toolbar-height' for more information. | 1654 See `default-toolbar-height' for more information. |
1654 */ ); | 1655 */ ); |
1655 Vtoolbar_size[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum); | 1656 Vtoolbar_size[BOTTOM_EDGE] = Fmake_specifier (Qnatnum); |
1656 set_specifier_caching (Vtoolbar_size[BOTTOM_TOOLBAR], | 1657 set_specifier_caching (Vtoolbar_size[BOTTOM_EDGE], |
1657 offsetof (struct window, toolbar_size[BOTTOM_TOOLBAR]), | 1658 offsetof (struct window, toolbar_size[BOTTOM_EDGE]), |
1658 toolbar_geometry_changed_in_window, | 1659 toolbar_geometry_changed_in_window, |
1659 offsetof (struct frame, toolbar_size[BOTTOM_TOOLBAR]), | 1660 offsetof (struct frame, toolbar_size[BOTTOM_EDGE]), |
1660 frame_size_slipped, 0); | 1661 frame_size_slipped, 0); |
1661 | 1662 |
1662 DEFVAR_SPECIFIER ("left-toolbar-width", | 1663 DEFVAR_SPECIFIER ("left-toolbar-width", |
1663 &Vtoolbar_size[LEFT_TOOLBAR] /* | 1664 &Vtoolbar_size[LEFT_EDGE] /* |
1664 *Width of left toolbar. | 1665 *Width of left toolbar. |
1665 This is a specifier; use `set-specifier' to change it. | 1666 This is a specifier; use `set-specifier' to change it. |
1666 | 1667 |
1667 See `default-toolbar-height' for more information. | 1668 See `default-toolbar-height' for more information. |
1668 */ ); | 1669 */ ); |
1669 Vtoolbar_size[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum); | 1670 Vtoolbar_size[LEFT_EDGE] = Fmake_specifier (Qnatnum); |
1670 set_specifier_caching (Vtoolbar_size[LEFT_TOOLBAR], | 1671 set_specifier_caching (Vtoolbar_size[LEFT_EDGE], |
1671 offsetof (struct window, toolbar_size[LEFT_TOOLBAR]), | 1672 offsetof (struct window, toolbar_size[LEFT_EDGE]), |
1672 toolbar_geometry_changed_in_window, | 1673 toolbar_geometry_changed_in_window, |
1673 offsetof (struct frame, toolbar_size[LEFT_TOOLBAR]), | 1674 offsetof (struct frame, toolbar_size[LEFT_EDGE]), |
1674 frame_size_slipped, 0); | 1675 frame_size_slipped, 0); |
1675 | 1676 |
1676 DEFVAR_SPECIFIER ("right-toolbar-width", | 1677 DEFVAR_SPECIFIER ("right-toolbar-width", |
1677 &Vtoolbar_size[RIGHT_TOOLBAR] /* | 1678 &Vtoolbar_size[RIGHT_EDGE] /* |
1678 *Width of right toolbar. | 1679 *Width of right toolbar. |
1679 This is a specifier; use `set-specifier' to change it. | 1680 This is a specifier; use `set-specifier' to change it. |
1680 | 1681 |
1681 See `default-toolbar-height' for more information. | 1682 See `default-toolbar-height' for more information. |
1682 */ ); | 1683 */ ); |
1683 Vtoolbar_size[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum); | 1684 Vtoolbar_size[RIGHT_EDGE] = Fmake_specifier (Qnatnum); |
1684 set_specifier_caching (Vtoolbar_size[RIGHT_TOOLBAR], | 1685 set_specifier_caching (Vtoolbar_size[RIGHT_EDGE], |
1685 offsetof (struct window, toolbar_size[RIGHT_TOOLBAR]), | 1686 offsetof (struct window, toolbar_size[RIGHT_EDGE]), |
1686 toolbar_geometry_changed_in_window, | 1687 toolbar_geometry_changed_in_window, |
1687 offsetof (struct frame, toolbar_size[RIGHT_TOOLBAR]), | 1688 offsetof (struct frame, toolbar_size[RIGHT_EDGE]), |
1688 frame_size_slipped, 0); | 1689 frame_size_slipped, 0); |
1689 | 1690 |
1690 DEFVAR_SPECIFIER ("toolbar-shadow-thickness", | 1691 DEFVAR_SPECIFIER ("toolbar-shadow-thickness", |
1691 &Vtoolbar_shadow_thickness /* | 1692 &Vtoolbar_shadow_thickness /* |
1692 *Width of shadows around toolbar buttons. | 1693 *Width of shadows around toolbar buttons. |
1748 make_int (MSWINDOWS_DEFAULT_TOOLBAR_WIDTH)), fb); | 1749 make_int (MSWINDOWS_DEFAULT_TOOLBAR_WIDTH)), fb); |
1749 #endif | 1750 #endif |
1750 if (!NILP (fb)) | 1751 if (!NILP (fb)) |
1751 set_specifier_fallback (Vdefault_toolbar_width, fb); | 1752 set_specifier_fallback (Vdefault_toolbar_width, fb); |
1752 | 1753 |
1753 set_specifier_fallback (Vtoolbar_size[TOP_TOOLBAR], Vdefault_toolbar_height); | 1754 set_specifier_fallback (Vtoolbar_size[TOP_EDGE], Vdefault_toolbar_height); |
1754 fb = list1 (Fcons (Qnil, Qzero)); | 1755 fb = list1 (Fcons (Qnil, Qzero)); |
1755 set_specifier_fallback (Vtoolbar_size[BOTTOM_TOOLBAR], fb); | 1756 set_specifier_fallback (Vtoolbar_size[BOTTOM_EDGE], fb); |
1756 set_specifier_fallback (Vtoolbar_size[LEFT_TOOLBAR], fb); | 1757 set_specifier_fallback (Vtoolbar_size[LEFT_EDGE], fb); |
1757 set_specifier_fallback (Vtoolbar_size[RIGHT_TOOLBAR], fb); | 1758 set_specifier_fallback (Vtoolbar_size[RIGHT_EDGE], fb); |
1758 | 1759 |
1759 DEFVAR_SPECIFIER ("default-toolbar-border-width", | 1760 DEFVAR_SPECIFIER ("default-toolbar-border-width", |
1760 &Vdefault_toolbar_border_width /* | 1761 &Vdefault_toolbar_border_width /* |
1761 *Width of the border around the default toolbar. | 1762 *Width of the border around the default toolbar. |
1762 This is a specifier; use `set-specifier' to change it. | 1763 This is a specifier; use `set-specifier' to change it. |
1784 default_toolbar_border_width_changed_in_window, | 1785 default_toolbar_border_width_changed_in_window, |
1785 offsetof (struct frame, default_toolbar_border_width), | 1786 offsetof (struct frame, default_toolbar_border_width), |
1786 default_toolbar_border_width_changed_in_frame, 0); | 1787 default_toolbar_border_width_changed_in_frame, 0); |
1787 | 1788 |
1788 DEFVAR_SPECIFIER ("top-toolbar-border-width", | 1789 DEFVAR_SPECIFIER ("top-toolbar-border-width", |
1789 &Vtoolbar_border_width[TOP_TOOLBAR] /* | 1790 &Vtoolbar_border_width[TOP_EDGE] /* |
1790 *Border width of the top toolbar. | 1791 *Border width of the top toolbar. |
1791 This is a specifier; use `set-specifier' to change it. | 1792 This is a specifier; use `set-specifier' to change it. |
1792 | 1793 |
1793 See `default-toolbar-height' for more information. | 1794 See `default-toolbar-height' for more information. |
1794 */ ); | 1795 */ ); |
1795 Vtoolbar_border_width[TOP_TOOLBAR] = Fmake_specifier (Qnatnum); | 1796 Vtoolbar_border_width[TOP_EDGE] = Fmake_specifier (Qnatnum); |
1796 set_specifier_caching (Vtoolbar_border_width[TOP_TOOLBAR], | 1797 set_specifier_caching (Vtoolbar_border_width[TOP_EDGE], |
1797 offsetof (struct window, | 1798 offsetof (struct window, |
1798 toolbar_border_width[TOP_TOOLBAR]), | 1799 toolbar_border_width[TOP_EDGE]), |
1799 toolbar_geometry_changed_in_window, | 1800 toolbar_geometry_changed_in_window, |
1800 offsetof (struct frame, | 1801 offsetof (struct frame, |
1801 toolbar_border_width[TOP_TOOLBAR]), | 1802 toolbar_border_width[TOP_EDGE]), |
1802 frame_size_slipped, 0); | 1803 frame_size_slipped, 0); |
1803 | 1804 |
1804 DEFVAR_SPECIFIER ("bottom-toolbar-border-width", | 1805 DEFVAR_SPECIFIER ("bottom-toolbar-border-width", |
1805 &Vtoolbar_border_width[BOTTOM_TOOLBAR] /* | 1806 &Vtoolbar_border_width[BOTTOM_EDGE] /* |
1806 *Border width of the bottom toolbar. | 1807 *Border width of the bottom toolbar. |
1807 This is a specifier; use `set-specifier' to change it. | 1808 This is a specifier; use `set-specifier' to change it. |
1808 | 1809 |
1809 See `default-toolbar-height' for more information. | 1810 See `default-toolbar-height' for more information. |
1810 */ ); | 1811 */ ); |
1811 Vtoolbar_border_width[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum); | 1812 Vtoolbar_border_width[BOTTOM_EDGE] = Fmake_specifier (Qnatnum); |
1812 set_specifier_caching (Vtoolbar_border_width[BOTTOM_TOOLBAR], | 1813 set_specifier_caching (Vtoolbar_border_width[BOTTOM_EDGE], |
1813 offsetof (struct window, | 1814 offsetof (struct window, |
1814 toolbar_border_width[BOTTOM_TOOLBAR]), | 1815 toolbar_border_width[BOTTOM_EDGE]), |
1815 toolbar_geometry_changed_in_window, | 1816 toolbar_geometry_changed_in_window, |
1816 offsetof (struct frame, | 1817 offsetof (struct frame, |
1817 toolbar_border_width[BOTTOM_TOOLBAR]), | 1818 toolbar_border_width[BOTTOM_EDGE]), |
1818 frame_size_slipped, 0); | 1819 frame_size_slipped, 0); |
1819 | 1820 |
1820 DEFVAR_SPECIFIER ("left-toolbar-border-width", | 1821 DEFVAR_SPECIFIER ("left-toolbar-border-width", |
1821 &Vtoolbar_border_width[LEFT_TOOLBAR] /* | 1822 &Vtoolbar_border_width[LEFT_EDGE] /* |
1822 *Border width of left toolbar. | 1823 *Border width of left toolbar. |
1823 This is a specifier; use `set-specifier' to change it. | 1824 This is a specifier; use `set-specifier' to change it. |
1824 | 1825 |
1825 See `default-toolbar-height' for more information. | 1826 See `default-toolbar-height' for more information. |
1826 */ ); | 1827 */ ); |
1827 Vtoolbar_border_width[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum); | 1828 Vtoolbar_border_width[LEFT_EDGE] = Fmake_specifier (Qnatnum); |
1828 set_specifier_caching (Vtoolbar_border_width[LEFT_TOOLBAR], | 1829 set_specifier_caching (Vtoolbar_border_width[LEFT_EDGE], |
1829 offsetof (struct window, | 1830 offsetof (struct window, |
1830 toolbar_border_width[LEFT_TOOLBAR]), | 1831 toolbar_border_width[LEFT_EDGE]), |
1831 toolbar_geometry_changed_in_window, | 1832 toolbar_geometry_changed_in_window, |
1832 offsetof (struct frame, | 1833 offsetof (struct frame, |
1833 toolbar_border_width[LEFT_TOOLBAR]), | 1834 toolbar_border_width[LEFT_EDGE]), |
1834 frame_size_slipped, 0); | 1835 frame_size_slipped, 0); |
1835 | 1836 |
1836 DEFVAR_SPECIFIER ("right-toolbar-border-width", | 1837 DEFVAR_SPECIFIER ("right-toolbar-border-width", |
1837 &Vtoolbar_border_width[RIGHT_TOOLBAR] /* | 1838 &Vtoolbar_border_width[RIGHT_EDGE] /* |
1838 *Border width of right toolbar. | 1839 *Border width of right toolbar. |
1839 This is a specifier; use `set-specifier' to change it. | 1840 This is a specifier; use `set-specifier' to change it. |
1840 | 1841 |
1841 See `default-toolbar-height' for more information. | 1842 See `default-toolbar-height' for more information. |
1842 */ ); | 1843 */ ); |
1843 Vtoolbar_border_width[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum); | 1844 Vtoolbar_border_width[RIGHT_EDGE] = Fmake_specifier (Qnatnum); |
1844 set_specifier_caching (Vtoolbar_border_width[RIGHT_TOOLBAR], | 1845 set_specifier_caching (Vtoolbar_border_width[RIGHT_EDGE], |
1845 offsetof (struct window, | 1846 offsetof (struct window, |
1846 toolbar_border_width[RIGHT_TOOLBAR]), | 1847 toolbar_border_width[RIGHT_EDGE]), |
1847 toolbar_geometry_changed_in_window, | 1848 toolbar_geometry_changed_in_window, |
1848 offsetof (struct frame, | 1849 offsetof (struct frame, |
1849 toolbar_border_width[RIGHT_TOOLBAR]), | 1850 toolbar_border_width[RIGHT_EDGE]), |
1850 frame_size_slipped, 0); | 1851 frame_size_slipped, 0); |
1851 | 1852 |
1852 fb = Qnil; | 1853 fb = Qnil; |
1853 #ifdef HAVE_TTY | 1854 #ifdef HAVE_TTY |
1854 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); | 1855 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); |
1863 fb = Fcons (Fcons (list1 (Qmswindows), make_int (MSWINDOWS_DEFAULT_TOOLBAR_BORDER_WIDTH)), fb); | 1864 fb = Fcons (Fcons (list1 (Qmswindows), make_int (MSWINDOWS_DEFAULT_TOOLBAR_BORDER_WIDTH)), fb); |
1864 #endif | 1865 #endif |
1865 if (!NILP (fb)) | 1866 if (!NILP (fb)) |
1866 set_specifier_fallback (Vdefault_toolbar_border_width, fb); | 1867 set_specifier_fallback (Vdefault_toolbar_border_width, fb); |
1867 | 1868 |
1868 set_specifier_fallback (Vtoolbar_border_width[TOP_TOOLBAR], Vdefault_toolbar_border_width); | 1869 set_specifier_fallback (Vtoolbar_border_width[TOP_EDGE], Vdefault_toolbar_border_width); |
1869 fb = list1 (Fcons (Qnil, Qzero)); | 1870 fb = list1 (Fcons (Qnil, Qzero)); |
1870 set_specifier_fallback (Vtoolbar_border_width[BOTTOM_TOOLBAR], fb); | 1871 set_specifier_fallback (Vtoolbar_border_width[BOTTOM_EDGE], fb); |
1871 set_specifier_fallback (Vtoolbar_border_width[LEFT_TOOLBAR], fb); | 1872 set_specifier_fallback (Vtoolbar_border_width[LEFT_EDGE], fb); |
1872 set_specifier_fallback (Vtoolbar_border_width[RIGHT_TOOLBAR], fb); | 1873 set_specifier_fallback (Vtoolbar_border_width[RIGHT_EDGE], fb); |
1873 | 1874 |
1874 DEFVAR_SPECIFIER ("default-toolbar-visible-p", &Vdefault_toolbar_visible_p /* | 1875 DEFVAR_SPECIFIER ("default-toolbar-visible-p", &Vdefault_toolbar_visible_p /* |
1875 *Whether the default toolbar is visible. | 1876 *Whether the default toolbar is visible. |
1876 This is a specifier; use `set-specifier' to change it. | 1877 This is a specifier; use `set-specifier' to change it. |
1877 | 1878 |
1897 default_toolbar_visible_p_changed_in_window, | 1898 default_toolbar_visible_p_changed_in_window, |
1898 offsetof (struct frame, default_toolbar_visible_p), | 1899 offsetof (struct frame, default_toolbar_visible_p), |
1899 default_toolbar_visible_p_changed_in_frame, 0); | 1900 default_toolbar_visible_p_changed_in_frame, 0); |
1900 | 1901 |
1901 DEFVAR_SPECIFIER ("top-toolbar-visible-p", | 1902 DEFVAR_SPECIFIER ("top-toolbar-visible-p", |
1902 &Vtoolbar_visible_p[TOP_TOOLBAR] /* | 1903 &Vtoolbar_visible_p[TOP_EDGE] /* |
1903 *Whether the top toolbar is visible. | 1904 *Whether the top toolbar is visible. |
1904 This is a specifier; use `set-specifier' to change it. | 1905 This is a specifier; use `set-specifier' to change it. |
1905 | 1906 |
1906 See `default-toolbar-visible-p' for more information. | 1907 See `default-toolbar-visible-p' for more information. |
1907 */ ); | 1908 */ ); |
1908 Vtoolbar_visible_p[TOP_TOOLBAR] = Fmake_specifier (Qboolean); | 1909 Vtoolbar_visible_p[TOP_EDGE] = Fmake_specifier (Qboolean); |
1909 set_specifier_caching (Vtoolbar_visible_p[TOP_TOOLBAR], | 1910 set_specifier_caching (Vtoolbar_visible_p[TOP_EDGE], |
1910 offsetof (struct window, | 1911 offsetof (struct window, |
1911 toolbar_visible_p[TOP_TOOLBAR]), | 1912 toolbar_visible_p[TOP_EDGE]), |
1912 toolbar_geometry_changed_in_window, | 1913 toolbar_geometry_changed_in_window, |
1913 offsetof (struct frame, | 1914 offsetof (struct frame, |
1914 toolbar_visible_p[TOP_TOOLBAR]), | 1915 toolbar_visible_p[TOP_EDGE]), |
1915 frame_size_slipped, 0); | 1916 frame_size_slipped, 0); |
1916 | 1917 |
1917 DEFVAR_SPECIFIER ("bottom-toolbar-visible-p", | 1918 DEFVAR_SPECIFIER ("bottom-toolbar-visible-p", |
1918 &Vtoolbar_visible_p[BOTTOM_TOOLBAR] /* | 1919 &Vtoolbar_visible_p[BOTTOM_EDGE] /* |
1919 *Whether the bottom toolbar is visible. | 1920 *Whether the bottom toolbar is visible. |
1920 This is a specifier; use `set-specifier' to change it. | 1921 This is a specifier; use `set-specifier' to change it. |
1921 | 1922 |
1922 See `default-toolbar-visible-p' for more information. | 1923 See `default-toolbar-visible-p' for more information. |
1923 */ ); | 1924 */ ); |
1924 Vtoolbar_visible_p[BOTTOM_TOOLBAR] = Fmake_specifier (Qboolean); | 1925 Vtoolbar_visible_p[BOTTOM_EDGE] = Fmake_specifier (Qboolean); |
1925 set_specifier_caching (Vtoolbar_visible_p[BOTTOM_TOOLBAR], | 1926 set_specifier_caching (Vtoolbar_visible_p[BOTTOM_EDGE], |
1926 offsetof (struct window, | 1927 offsetof (struct window, |
1927 toolbar_visible_p[BOTTOM_TOOLBAR]), | 1928 toolbar_visible_p[BOTTOM_EDGE]), |
1928 toolbar_geometry_changed_in_window, | 1929 toolbar_geometry_changed_in_window, |
1929 offsetof (struct frame, | 1930 offsetof (struct frame, |
1930 toolbar_visible_p[BOTTOM_TOOLBAR]), | 1931 toolbar_visible_p[BOTTOM_EDGE]), |
1931 frame_size_slipped, 0); | 1932 frame_size_slipped, 0); |
1932 | 1933 |
1933 DEFVAR_SPECIFIER ("left-toolbar-visible-p", | 1934 DEFVAR_SPECIFIER ("left-toolbar-visible-p", |
1934 &Vtoolbar_visible_p[LEFT_TOOLBAR] /* | 1935 &Vtoolbar_visible_p[LEFT_EDGE] /* |
1935 *Whether the left toolbar is visible. | 1936 *Whether the left toolbar is visible. |
1936 This is a specifier; use `set-specifier' to change it. | 1937 This is a specifier; use `set-specifier' to change it. |
1937 | 1938 |
1938 See `default-toolbar-visible-p' for more information. | 1939 See `default-toolbar-visible-p' for more information. |
1939 */ ); | 1940 */ ); |
1940 Vtoolbar_visible_p[LEFT_TOOLBAR] = Fmake_specifier (Qboolean); | 1941 Vtoolbar_visible_p[LEFT_EDGE] = Fmake_specifier (Qboolean); |
1941 set_specifier_caching (Vtoolbar_visible_p[LEFT_TOOLBAR], | 1942 set_specifier_caching (Vtoolbar_visible_p[LEFT_EDGE], |
1942 offsetof (struct window, | 1943 offsetof (struct window, |
1943 toolbar_visible_p[LEFT_TOOLBAR]), | 1944 toolbar_visible_p[LEFT_EDGE]), |
1944 toolbar_geometry_changed_in_window, | 1945 toolbar_geometry_changed_in_window, |
1945 offsetof (struct frame, | 1946 offsetof (struct frame, |
1946 toolbar_visible_p[LEFT_TOOLBAR]), | 1947 toolbar_visible_p[LEFT_EDGE]), |
1947 frame_size_slipped, 0); | 1948 frame_size_slipped, 0); |
1948 | 1949 |
1949 DEFVAR_SPECIFIER ("right-toolbar-visible-p", | 1950 DEFVAR_SPECIFIER ("right-toolbar-visible-p", |
1950 &Vtoolbar_visible_p[RIGHT_TOOLBAR] /* | 1951 &Vtoolbar_visible_p[RIGHT_EDGE] /* |
1951 *Whether the right toolbar is visible. | 1952 *Whether the right toolbar is visible. |
1952 This is a specifier; use `set-specifier' to change it. | 1953 This is a specifier; use `set-specifier' to change it. |
1953 | 1954 |
1954 See `default-toolbar-visible-p' for more information. | 1955 See `default-toolbar-visible-p' for more information. |
1955 */ ); | 1956 */ ); |
1956 Vtoolbar_visible_p[RIGHT_TOOLBAR] = Fmake_specifier (Qboolean); | 1957 Vtoolbar_visible_p[RIGHT_EDGE] = Fmake_specifier (Qboolean); |
1957 set_specifier_caching (Vtoolbar_visible_p[RIGHT_TOOLBAR], | 1958 set_specifier_caching (Vtoolbar_visible_p[RIGHT_EDGE], |
1958 offsetof (struct window, | 1959 offsetof (struct window, |
1959 toolbar_visible_p[RIGHT_TOOLBAR]), | 1960 toolbar_visible_p[RIGHT_EDGE]), |
1960 toolbar_geometry_changed_in_window, | 1961 toolbar_geometry_changed_in_window, |
1961 offsetof (struct frame, | 1962 offsetof (struct frame, |
1962 toolbar_visible_p[RIGHT_TOOLBAR]), | 1963 toolbar_visible_p[RIGHT_EDGE]), |
1963 frame_size_slipped, 0); | 1964 frame_size_slipped, 0); |
1964 | 1965 |
1965 /* initially, top inherits from default; this can be | 1966 /* initially, top inherits from default; this can be |
1966 changed with `set-default-toolbar-position'. */ | 1967 changed with `set-default-toolbar-position'. */ |
1967 fb = list1 (Fcons (Qnil, Qt)); | 1968 fb = list1 (Fcons (Qnil, Qt)); |
1968 set_specifier_fallback (Vdefault_toolbar_visible_p, fb); | 1969 set_specifier_fallback (Vdefault_toolbar_visible_p, fb); |
1969 set_specifier_fallback (Vtoolbar_visible_p[TOP_TOOLBAR], | 1970 set_specifier_fallback (Vtoolbar_visible_p[TOP_EDGE], |
1970 Vdefault_toolbar_visible_p); | 1971 Vdefault_toolbar_visible_p); |
1971 set_specifier_fallback (Vtoolbar_visible_p[BOTTOM_TOOLBAR], fb); | 1972 set_specifier_fallback (Vtoolbar_visible_p[BOTTOM_EDGE], fb); |
1972 set_specifier_fallback (Vtoolbar_visible_p[LEFT_TOOLBAR], fb); | 1973 set_specifier_fallback (Vtoolbar_visible_p[LEFT_EDGE], fb); |
1973 set_specifier_fallback (Vtoolbar_visible_p[RIGHT_TOOLBAR], fb); | 1974 set_specifier_fallback (Vtoolbar_visible_p[RIGHT_EDGE], fb); |
1974 | 1975 |
1975 DEFVAR_SPECIFIER ("toolbar-buttons-captioned-p", | 1976 DEFVAR_SPECIFIER ("toolbar-buttons-captioned-p", |
1976 &Vtoolbar_buttons_captioned_p /* | 1977 &Vtoolbar_buttons_captioned_p /* |
1977 *Whether the toolbar buttons are captioned. | 1978 *Whether the toolbar buttons are captioned. |
1978 This will only have a visible effect for those toolbar buttons which had | 1979 This will only have a visible effect for those toolbar buttons which had |