Mercurial > hg > xemacs-beta
annotate src/winslots.h @ 5554:a42e686a01bf
Automated merge with file:///Sources/xemacs-21.5-checked-out
| author | Aidan Kehoe <kehoea@parhasard.net> |
|---|---|
| date | Wed, 24 Aug 2011 11:07:26 +0100 |
| parents | 308d34e9f07d |
| children |
| rev | line source |
|---|---|
| 428 | 1 /* Definitions of marked slots in windows and window configs |
| 2 Copyright (C) 1985, 1986, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. | |
| 3 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. | |
| 844 | 4 Copyright (C) 1995, 1996, 2001, 2002 Ben Wing. |
| 428 | 5 Copyright (C) 1996 Chuck Thompson. |
| 6 | |
| 7 This file is part of XEmacs. | |
| 8 | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1279
diff
changeset
|
9 XEmacs is free software: you can redistribute it and/or modify it |
| 428 | 10 under the terms of the GNU General Public License as published by the |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1279
diff
changeset
|
11 Free Software Foundation, either version 3 of the License, or (at your |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1279
diff
changeset
|
12 option) any later version. |
| 428 | 13 |
| 14 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 17 for more details. | |
| 18 | |
| 19 You should have received a copy of the GNU General Public License | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
1279
diff
changeset
|
20 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
| 428 | 21 |
| 22 /* Split out of window.h and window.c | |
| 23 by Kirill Katsnelson <kkm@kis.ru>, May 1998 */ | |
| 24 | |
| 617 | 25 /* Separation into WINDOW_SLOT / WINDOW_SAVED_SLOT by Ben Wing, June 2001. |
| 26 | |
| 27 NOTE: No semicolons after slot declarations in this file! The | |
| 28 definitions of WINDOW_SLOT (and possibly WINDOW_SAVED_SLOT) need | |
| 844 | 29 to include a semicolon. This is because these may be defined as |
| 30 nothing, and some compilers don't tolerate extra semicolons in | |
| 31 structure definitions. | |
| 617 | 32 |
| 33 WINDOW_SLOT declares a Lisp_Object that is not copied into the | |
| 34 saved_window struct of a window configuration, or is handled in | |
| 35 a special way in window configurations. | |
| 36 WINDOW_SLOT_ARRAY is the same for an array of Lisp_Objects. | |
| 37 WINDOW_SAVED_SLOT declares a Lisp_Object that is copied with no | |
| 38 special handling into the saved_window struct of a window | |
| 39 configuration. You must also declare the comparison function, | |
| 40 either EQ or EQUAL_WRAPPED (i.e. Feq() or Fequal()). | |
| 41 WINDOW_SAVED_SLOT_ARRAY is the same for an array of Lisp_Objects. | |
| 42 | |
| 1204 | 43 Callers should define WINDOW_SLOT (with a terminating semicolon if not |
| 44 blank), and WINDOW_SAVED_SLOT if different; otherwise the latter will be | |
| 45 defined using WINDOW_SLOT. Callers should also either (a) do nothing | |
| 46 else (which defines WINDOW_SLOT_ARRAY using a for() loop, appropriate | |
| 47 for normal code), define WINDOW_SLOT_DECLARATION (which defines | |
| 48 WINDOW_SLOT_ARRAY using WINDOW_SLOT (slot[size]), appropriate for a | |
| 49 struct definition), or define WINDOW_SLOT_ARRAY themselves. In the | |
| 50 first two cases, WINDOW_SAVED_SLOT_ARRAY will be defined in the same | |
| 51 fashion, using WINDOW_SAVED_SLOT. In the last case, if | |
| 52 WINDOW_SAVED_SLOT is defined, the caller must provide an appropriate | |
| 53 definition of WINDOW_SAVED_SLOT_ARRAY; otherwise, it will be defined | |
| 54 using WINDOW_SLOT_ARRAY. | |
| 617 | 55 |
| 56 Callers do not need to undefine these definitions; it is done | |
| 57 automatically. | |
| 58 */ | |
| 59 | |
| 1204 | 60 #ifdef WINDOW_SLOT_ARRAY |
| 61 # ifndef WINDOW_SAVED_SLOT_ARRAY | |
| 62 # ifdef WINDOW_SAVED_SLOT | |
| 63 # error must define WINDOW_SAVED_SLOT_ARRAY if WINDOW_SAVED_SLOT and WINDOW_SLOT_ARRAY are defined | |
| 64 # else | |
| 65 # define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) \ | |
| 66 WINDOW_SLOT_ARRAY (slot, size) | |
| 67 # endif /* WINDOW_SAVED_SLOT */ | |
| 68 # endif /* not WINDOW_SAVED_SLOT_ARRAY */ | |
| 69 #elif defined (WINDOW_SLOT_DECLARATION) /* not WINDOW_SLOT_ARRAY */ | |
| 70 # define WINDOW_SLOT_ARRAY(slot, size) WINDOW_SLOT (slot[size]) | |
| 71 # define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) \ | |
| 617 | 72 WINDOW_SAVED_SLOT (slot[size], compare) |
| 1204 | 73 #else /* not WINDOW_SLOT_DECLARATION, not WINDOW_SLOT_ARRAY */ |
| 74 # define WINDOW_SLOT_ARRAY(slot, size) do { \ | |
| 617 | 75 int wsaidx; \ |
| 76 for (wsaidx = 0; wsaidx < size; wsaidx++) \ | |
| 77 { \ | |
| 78 WINDOW_SLOT (slot[wsaidx]); \ | |
| 79 } \ | |
| 80 } while (0); | |
| 1204 | 81 # define WINDOW_SAVED_SLOT_ARRAY(slot, size, compare) do { \ |
| 617 | 82 int wsaidx; \ |
| 83 for (wsaidx = 0; wsaidx < size; wsaidx++) \ | |
| 84 { \ | |
| 85 WINDOW_SAVED_SLOT (slot[wsaidx], compare); \ | |
| 86 } \ | |
| 87 } while (0); | |
| 88 #endif /* WINDOW_SLOT_DECLARATION */ | |
| 89 | |
| 1204 | 90 #ifndef WINDOW_SAVED_SLOT |
| 91 #define WINDOW_SAVED_SLOT(slot, compare) WINDOW_SLOT (slot) | |
| 92 #endif | |
| 93 | |
| 428 | 94 #define EQUAL_WRAPPED(x,y) internal_equal ((x), (y), 0) |
| 95 | |
| 617 | 96 |
| 97 /* The frame this window is on. */ | |
| 98 WINDOW_SLOT (frame) | |
| 99 /* t if this window is a minibuffer window. */ | |
| 100 WINDOW_SLOT (mini_p) | |
| 101 /* Following child (to right or down) at same level of tree */ | |
| 102 WINDOW_SLOT (next) | |
| 103 /* Preceding child (to left or up) at same level of tree */ | |
| 104 WINDOW_SLOT (prev) | |
| 105 /* First child of this window. */ | |
| 106 /* vchild is used if this is a vertical combination, | |
| 107 hchild if this is a horizontal combination. */ | |
| 108 WINDOW_SLOT (hchild) | |
| 109 WINDOW_SLOT (vchild) | |
| 110 /* The window this one is a child of. */ | |
| 111 WINDOW_SLOT (parent) | |
| 112 | |
| 113 /* The buffer displayed in this window */ | |
| 114 /* Of the fields vchild, hchild and buffer, only one is non-nil. */ | |
| 115 WINDOW_SLOT (buffer) | |
| 116 /* A marker pointing to where in the text to start displaying */ | |
| 117 /* need one for each set of display structures */ | |
| 118 WINDOW_SLOT_ARRAY (start, 3) | |
| 119 /* A marker pointing to where in the text point is in this window, | |
| 120 used only when the window is not selected. | |
| 121 This exists so that when multiple windows show one buffer | |
| 122 each one can have its own value of point. */ | |
| 123 /* need one for each set of display structures */ | |
| 124 WINDOW_SLOT_ARRAY (pointm, 3) | |
| 125 /* A marker pointing to where in the text the scrollbar is pointing; | |
| 126 #### moved to scrollbar.c? */ | |
| 127 WINDOW_SLOT (sb_point) | |
| 844 | 128 /* A table that remembers (in marker form) the value of point in buffers |
| 129 previously displayed in this window. Switching back to those buffers | |
| 130 causes the remembered point value to become current, rather than the | |
| 131 buffer's point. This is so that you get sensible behavior if you have | |
| 132 a buffer displayed in multiple windows and temporarily switch away and | |
| 133 then back in one window. We don't save or restore this table in a | |
| 134 window configuration, since that would be counterproductive -- we | |
| 135 always want to remember the most recent value of point in buffers we | |
| 136 switched away from. */ | |
| 137 WINDOW_SLOT (saved_point_cache) | |
| 138 /* A table that remembers (in marker form) the value of window start in | |
| 139 buffers previously displayed in this window. Save reason as for | |
| 140 the previous table. */ | |
| 141 WINDOW_SLOT (saved_last_window_start_cache) | |
| 617 | 142 |
| 143 /* Number saying how recently window was selected */ | |
| 144 WINDOW_SLOT (use_time) | |
| 145 /* text.modified of displayed buffer as of last time display completed */ | |
| 146 WINDOW_SLOT_ARRAY (last_modified, 3) | |
| 147 /* Value of point at that time */ | |
| 148 WINDOW_SLOT_ARRAY (last_point, 3) | |
| 149 /* Value of start at that time */ | |
| 150 WINDOW_SLOT_ARRAY (last_start, 3) | |
| 151 /* buf.face_change as of last time display completed */ | |
| 152 WINDOW_SLOT_ARRAY (last_facechange, 3) | |
| 153 | |
| 154 /* we cannot have a per-device cache of widgets / subwindows because | |
| 155 each visible instance needs to be a separate instance. The lowest | |
| 156 level of granularity we can get easily is the window that the | |
| 157 subwindow is in. This will fail if we attach the same subwindow | |
| 158 twice to a buffer. However, we are quite unlikely to do this, | |
| 159 especially with buttons which will need individual callbacks. The | |
| 160 proper solution is probably not worth the effort. */ | |
| 161 WINDOW_SLOT (subwindow_instance_cache) | |
| 162 | |
| 163 WINDOW_SLOT (line_cache_last_updated) | |
| 164 | |
| 428 | 165 /*** Non-specifier vars of window and window config ***/ |
| 166 | |
| 167 /* Non-nil means window is marked as dedicated. */ | |
| 617 | 168 WINDOW_SAVED_SLOT (dedicated, EQ) |
| 428 | 169 |
| 170 /*** specifier values cached in the struct window ***/ | |
| 171 | |
| 172 /* Display-table to use for displaying chars in this window. */ | |
| 617 | 173 WINDOW_SAVED_SLOT (display_table, EQUAL_WRAPPED) |
| 428 | 174 /* Thickness of modeline shadow, in pixels. If negative, draw |
| 175 as recessed. */ | |
| 617 | 176 WINDOW_SAVED_SLOT (modeline_shadow_thickness, EQ) |
| 428 | 177 /* Non-nil means to display a modeline for the buffer. */ |
| 617 | 178 WINDOW_SAVED_SLOT (has_modeline_p, EQ) |
| 428 | 179 /* Thickness of vertical divider shadow, in pixels. If negative, draw as |
| 180 recessed. */ | |
| 617 | 181 WINDOW_SAVED_SLOT (vertical_divider_shadow_thickness, EQ) |
| 428 | 182 /* Divider surface width (not counting 3-d borders) */ |
| 617 | 183 WINDOW_SAVED_SLOT (vertical_divider_line_width, EQ) |
| 442 | 184 /* Spacing between outer edge of divider border and window edge */ |
| 617 | 185 WINDOW_SAVED_SLOT (vertical_divider_spacing, EQ) |
| 428 | 186 /* Whether vertical dividers are always displayed */ |
| 617 | 187 WINDOW_SAVED_SLOT (vertical_divider_always_visible_p, EQ) |
| 428 | 188 |
| 189 #ifdef HAVE_SCROLLBARS | |
| 190 /* Width of vertical scrollbars. */ | |
| 617 | 191 WINDOW_SAVED_SLOT (scrollbar_width, EQ) |
| 428 | 192 /* Height of horizontal scrollbars. */ |
| 617 | 193 WINDOW_SAVED_SLOT (scrollbar_height, EQ) |
| 428 | 194 /* Whether the scrollbars are visible */ |
| 617 | 195 WINDOW_SAVED_SLOT (horizontal_scrollbar_visible_p, EQ) |
| 196 WINDOW_SAVED_SLOT (vertical_scrollbar_visible_p, EQ) | |
| 428 | 197 /* Scrollbar positions */ |
| 617 | 198 WINDOW_SAVED_SLOT (scrollbar_on_left_p, EQ) |
| 199 WINDOW_SAVED_SLOT (scrollbar_on_top_p, EQ) | |
| 428 | 200 /* Pointer to use for vertical and horizontal scrollbars. */ |
| 617 | 201 WINDOW_SAVED_SLOT (scrollbar_pointer, EQ) |
| 428 | 202 #endif /* HAVE_SCROLLBARS */ |
| 203 #ifdef HAVE_TOOLBARS | |
| 204 /* Toolbar specification for each of the four positions. | |
| 205 This is not a size hog because the value here is not copied, | |
| 206 and will be shared with the specs in the specifier. */ | |
| 617 | 207 WINDOW_SAVED_SLOT_ARRAY (toolbar, 4, EQUAL_WRAPPED) |
| 428 | 208 /* Toolbar size for each of the four positions. */ |
| 617 | 209 WINDOW_SAVED_SLOT_ARRAY (toolbar_size, 4, EQUAL_WRAPPED) |
| 428 | 210 /* Toolbar border width for each of the four positions. */ |
| 617 | 211 WINDOW_SAVED_SLOT_ARRAY (toolbar_border_width, 4, EQUAL_WRAPPED) |
| 428 | 212 /* Toolbar visibility status for each of the four positions. */ |
| 617 | 213 WINDOW_SAVED_SLOT_ARRAY (toolbar_visible_p, 4, EQUAL_WRAPPED) |
| 428 | 214 /* Caption status of toolbar. */ |
| 617 | 215 WINDOW_SAVED_SLOT (toolbar_buttons_captioned_p, EQ) |
| 428 | 216 /* The following five don't really need to be cached except |
| 217 that we need to know when they've changed. */ | |
| 617 | 218 WINDOW_SAVED_SLOT (default_toolbar, EQUAL_WRAPPED) |
| 219 WINDOW_SAVED_SLOT (default_toolbar_width, EQ) | |
| 220 WINDOW_SAVED_SLOT (default_toolbar_height, EQ) | |
| 221 WINDOW_SAVED_SLOT (default_toolbar_visible_p, EQ) | |
| 222 WINDOW_SAVED_SLOT (default_toolbar_border_width, EQ) | |
| 744 | 223 WINDOW_SAVED_SLOT (toolbar_shadow_thickness, EQ) |
| 428 | 224 #endif /* HAVE_TOOLBARS */ |
| 225 | |
| 226 /* Gutter specification for each of the four positions. | |
| 227 This is not a size hog because the value here is not copied, | |
| 228 and will be shared with the specs in the specifier. */ | |
| 617 | 229 WINDOW_SAVED_SLOT_ARRAY (gutter, 4, EQUAL_WRAPPED) |
| 442 | 230 /* Real (pre-calculated) gutter specification for each of the four positions. |
| 231 This is not a specifier, it is calculated by the specifier change | |
| 232 functions. */ | |
| 617 | 233 WINDOW_SAVED_SLOT_ARRAY (real_gutter, 4, EQUAL_WRAPPED) |
| 428 | 234 /* Gutter size for each of the four positions. */ |
| 617 | 235 WINDOW_SAVED_SLOT_ARRAY (gutter_size, 4, EQUAL_WRAPPED) |
| 428 | 236 /* Real (pre-calculated) gutter size for each of the four positions. |
| 237 This is not a specifier, it is calculated by the specifier change | |
| 238 functions. */ | |
| 617 | 239 WINDOW_SAVED_SLOT_ARRAY (real_gutter_size, 4, EQUAL_WRAPPED) |
| 428 | 240 /* Gutter border width for each of the four positions. */ |
| 617 | 241 WINDOW_SAVED_SLOT_ARRAY (gutter_border_width, 4, EQUAL_WRAPPED) |
| 428 | 242 /* Gutter visibility status for each of the four positions. */ |
| 617 | 243 WINDOW_SAVED_SLOT_ARRAY (gutter_visible_p, 4, EQUAL_WRAPPED) |
| 428 | 244 /* The following five don't really need to be cached except |
| 245 that we need to know when they've changed. */ | |
| 617 | 246 WINDOW_SAVED_SLOT (default_gutter, EQUAL_WRAPPED) |
| 247 WINDOW_SAVED_SLOT (default_gutter_width, EQ) | |
| 248 WINDOW_SAVED_SLOT (default_gutter_height, EQ) | |
| 249 WINDOW_SAVED_SLOT (default_gutter_visible_p, EQ) | |
| 250 WINDOW_SAVED_SLOT (default_gutter_border_width, EQ) | |
| 428 | 251 /* margins */ |
| 617 | 252 WINDOW_SAVED_SLOT (left_margin_width, EQ) |
| 253 WINDOW_SAVED_SLOT (right_margin_width, EQ) | |
| 254 WINDOW_SAVED_SLOT (minimum_line_ascent, EQ) | |
| 255 WINDOW_SAVED_SLOT (minimum_line_descent, EQ) | |
| 256 WINDOW_SAVED_SLOT (use_left_overflow, EQ) | |
| 257 WINDOW_SAVED_SLOT (use_right_overflow, EQ) | |
| 428 | 258 #ifdef HAVE_MENUBARS |
| 259 /* Visibility of menubar. */ | |
| 617 | 260 WINDOW_SAVED_SLOT (menubar_visible_p, EQ) |
| 428 | 261 #endif /* HAVE_MENUBARS */ |
| 617 | 262 WINDOW_SAVED_SLOT (text_cursor_visible_p, EQ) |
| 428 | 263 |
| 264 /* Hara-kiri */ | |
| 265 #undef EQUAL_WRAPPED | |
| 266 #undef WINDOW_SLOT_DECLARATION | |
| 267 #undef WINDOW_SLOT | |
| 268 #undef WINDOW_SLOT_ARRAY | |
| 617 | 269 #undef WINDOW_SAVED_SLOT |
| 270 #undef WINDOW_SAVED_SLOT_ARRAY |
