Mercurial > hg > xemacs-beta
comparison src/toolbar.c @ 185:3d6bfa290dbd r20-3b19
Import from CVS: tag r20-3b19
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:55:28 +0200 |
parents | 8eaf7971accc |
children | 1f0dabaa0855 |
comparison
equal
deleted
inserted
replaced
184:bcd2674570bf | 185:3d6bfa290dbd |
---|---|
307 elt = XVECTOR_DATA (desc); | 307 elt = XVECTOR_DATA (desc); |
308 buffer = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer; | 308 buffer = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer; |
309 | 309 |
310 if (!tb) | 310 if (!tb) |
311 { | 311 { |
312 tb = alloc_lcrecord (sizeof (struct toolbar_button), | 312 tb = alloc_lcrecord_type (struct toolbar_button, lrecord_toolbar_button); |
313 lrecord_toolbar_button); | |
314 tb->next = Qnil; | 313 tb->next = Qnil; |
315 XSETFRAME (tb->frame, f); | 314 XSETFRAME (tb->frame, f); |
316 tb->up_glyph = Qnil; | 315 tb->up_glyph = Qnil; |
317 tb->down_glyph = Qnil; | 316 tb->down_glyph = Qnil; |
318 tb->disabled_glyph = Qnil; | 317 tb->disabled_glyph = Qnil; |
712 | 711 |
713 toolbar = w->toolbar[pos]; | 712 toolbar = w->toolbar[pos]; |
714 | 713 |
715 if (NILP (f->toolbar_data[pos])) | 714 if (NILP (f->toolbar_data[pos])) |
716 { | 715 { |
717 struct toolbar_data *td = alloc_lcrecord (sizeof (struct toolbar_data), | 716 struct toolbar_data *td = alloc_lcrecord_type (struct toolbar_data, |
718 lrecord_toolbar_data); | 717 lrecord_toolbar_data); |
719 | 718 |
720 td->last_toolbar_buffer = Qnil; | 719 td->last_toolbar_buffer = Qnil; |
721 td->toolbar_buttons = Qnil; | 720 td->toolbar_buttons = Qnil; |
722 XSETTOOLBAR_DATA (f->toolbar_data[pos], td); | 721 XSETTOOLBAR_DATA (f->toolbar_data[pos], td); |
723 } | 722 } |
724 | 723 |
725 if (visible) | 724 buttons = visible ? compute_frame_toolbar_buttons (f, pos, toolbar) : Qnil; |
726 buttons = compute_frame_toolbar_buttons (f, pos, toolbar); | |
727 else | |
728 buttons = Qnil; | |
729 | 725 |
730 FRAME_TOOLBAR_DATA (f, pos)->last_toolbar_buffer = buffer; | 726 FRAME_TOOLBAR_DATA (f, pos)->last_toolbar_buffer = buffer; |
731 FRAME_TOOLBAR_DATA (f, pos)->toolbar_buttons = buttons; | 727 FRAME_TOOLBAR_DATA (f, pos)->toolbar_buttons = buttons; |
732 | 728 |
733 return visible; | 729 return visible; |
1193 Toolbar specifiers are used to specify the format of a toolbar. | 1189 Toolbar specifiers are used to specify the format of a toolbar. |
1194 The values of the variables `default-toolbar', `top-toolbar', | 1190 The values of the variables `default-toolbar', `top-toolbar', |
1195 `left-toolbar', `right-toolbar', and `bottom-toolbar' are always | 1191 `left-toolbar', `right-toolbar', and `bottom-toolbar' are always |
1196 toolbar specifiers. | 1192 toolbar specifiers. |
1197 | 1193 |
1198 Valid toolbar instantiators are called \"toolbar descriptors\" | 1194 Valid toolbar instantiators are called "toolbar descriptors" |
1199 and are lists of vectors. See `default-toolbar' for a description | 1195 and are lists of vectors. See `default-toolbar' for a description |
1200 of the exact format. | 1196 of the exact format. |
1201 */ | 1197 */ |
1202 (object)) | 1198 (object)) |
1203 { | 1199 { |
1236 break; | 1232 break; |
1237 | 1233 |
1238 assert (pos < countof (Vtoolbar_size)); | 1234 assert (pos < countof (Vtoolbar_size)); |
1239 | 1235 |
1240 MAYBE_FRAMEMETH (f, toolbar_size_changed_in_frame, | 1236 MAYBE_FRAMEMETH (f, toolbar_size_changed_in_frame, |
1241 (f, pos, oldval)); | 1237 (f, (enum toolbar_pos) pos, oldval)); |
1242 | 1238 |
1243 /* Let redisplay know that something has possibly changed. */ | 1239 /* Let redisplay know that something has possibly changed. */ |
1244 MARK_TOOLBAR_CHANGED; | 1240 MARK_TOOLBAR_CHANGED; |
1245 } | 1241 } |
1246 | 1242 |
1255 break; | 1251 break; |
1256 | 1252 |
1257 assert (pos < countof (Vtoolbar_visible_p)); | 1253 assert (pos < countof (Vtoolbar_visible_p)); |
1258 | 1254 |
1259 MAYBE_FRAMEMETH (f, toolbar_visible_p_changed_in_frame, | 1255 MAYBE_FRAMEMETH (f, toolbar_visible_p_changed_in_frame, |
1260 (f, pos, oldval)); | 1256 (f, (enum toolbar_pos) pos, oldval)); |
1261 | 1257 |
1262 /* Let redisplay know that something has possibly changed. */ | 1258 /* Let redisplay know that something has possibly changed. */ |
1263 MARK_TOOLBAR_CHANGED; | 1259 MARK_TOOLBAR_CHANGED; |
1264 } | 1260 } |
1265 | 1261 |
1400 For the first vector format: | 1396 For the first vector format: |
1401 | 1397 |
1402 -- GLYPH-LIST should be a list of one to six glyphs (as created by | 1398 -- GLYPH-LIST should be a list of one to six glyphs (as created by |
1403 `make-glyph') or a symbol whose value is such a list. The first | 1399 `make-glyph') or a symbol whose value is such a list. The first |
1404 glyph, which must be provided, is the glyph used to display the | 1400 glyph, which must be provided, is the glyph used to display the |
1405 toolbar button when it is in the \"up\" (not pressed) state. The | 1401 toolbar button when it is in the "up" (not pressed) state. The |
1406 optional second glyph is for displaying the button when it is in | 1402 optional second glyph is for displaying the button when it is in |
1407 the \"down\" (pressed) state. The optional third glyph is for when | 1403 the "down" (pressed) state. The optional third glyph is for when |
1408 the button is disabled. The optional fourth, fifth and sixth glyphs | 1404 the button is disabled. The optional fourth, fifth and sixth glyphs |
1409 are used to specify captioned versions for the up, down and disabled | 1405 are used to specify captioned versions for the up, down and disabled |
1410 states respectively. The function `toolbar-make-button-list' is | 1406 states respectively. The function `toolbar-make-button-list' is |
1411 useful in creating these glyph lists. The specifier variable | 1407 useful in creating these glyph lists. The specifier variable |
1412 `toolbar-buttons-captioned-p' controls which glyphs are actually used. | 1408 `toolbar-buttons-captioned-p' controls which glyphs are actually used. |