Mercurial > hg > xemacs-beta
comparison src/toolbar.c @ 2:ac2d302a0011 r19-15b2
Import from CVS: tag r19-15b2
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:46:35 +0200 |
parents | 376386a54a3c |
children | bcdc7deadc19 |
comparison
equal
deleted
inserted
replaced
1:c0c6a60d29db | 2:ac2d302a0011 |
---|---|
250 | 250 |
251 | 251 |
252 static enum toolbar_pos | 252 static enum toolbar_pos |
253 decode_toolbar_position (Lisp_Object position) | 253 decode_toolbar_position (Lisp_Object position) |
254 { | 254 { |
255 if (EQ (position, Qtop)) | 255 if (EQ (position, Qtop)) return TOP_TOOLBAR; |
256 return TOP_TOOLBAR; | 256 if (EQ (position, Qbottom)) return BOTTOM_TOOLBAR; |
257 else if (EQ (position, Qbottom)) | 257 if (EQ (position, Qleft)) return LEFT_TOOLBAR; |
258 return BOTTOM_TOOLBAR; | 258 if (EQ (position, Qright)) return RIGHT_TOOLBAR; |
259 else if (EQ (position, Qleft)) | |
260 return LEFT_TOOLBAR; | |
261 else if (EQ (position, Qright)) | |
262 return RIGHT_TOOLBAR; | |
263 signal_simple_error ("Invalid toolbar position", position); | 259 signal_simple_error ("Invalid toolbar position", position); |
264 return 0; /* not reached */ | 260 |
261 return TOP_TOOLBAR; /* not reached */ | |
265 } | 262 } |
266 | 263 |
267 DEFUN ("set-default-toolbar-position", Fset_default_toolbar_position, | 264 DEFUN ("set-default-toolbar-position", Fset_default_toolbar_position, |
268 Sset_default_toolbar_position, 1, 1, 0 /* | 265 Sset_default_toolbar_position, 1, 1, 0 /* |
269 Set the position that the `default-toolbar' will be displayed at. | 266 Set the position that the `default-toolbar' will be displayed at. |
662 buttons and return. */ | 659 buttons and return. */ |
663 if (NILP (toolbar)) | 660 if (NILP (toolbar)) |
664 { | 661 { |
665 if (!NILP (buttons)) | 662 if (!NILP (buttons)) |
666 { | 663 { |
667 /* If this is the case the the only thing we saw was a | 664 /* If this is the case the only thing we saw was a |
668 pushright marker. */ | 665 pushright marker. */ |
669 if (EQ (buttons, first_button)) | 666 if (EQ (buttons, first_button)) |
670 { | 667 { |
671 UNGCPRO; | 668 UNGCPRO; |
672 return Qnil; | 669 return Qnil; |
1247 | 1244 |
1248 static void | 1245 static void |
1249 toolbar_size_changed_in_frame (Lisp_Object specifier, struct frame *f, | 1246 toolbar_size_changed_in_frame (Lisp_Object specifier, struct frame *f, |
1250 Lisp_Object oldval) | 1247 Lisp_Object oldval) |
1251 { | 1248 { |
1252 enum toolbar_pos pos; | 1249 int pos; |
1253 | 1250 |
1254 for (pos = 0; pos < 4; pos++) | 1251 for (pos = 0; pos < countof (Vtoolbar_size); pos++) |
1255 if (EQ (specifier, Vtoolbar_size[pos])) | 1252 if (EQ (specifier, Vtoolbar_size[(enum toolbar_pos) pos])) |
1256 break; | 1253 break; |
1257 | 1254 |
1258 assert (pos < 4); | 1255 assert (pos < countof (Vtoolbar_size)); |
1259 | 1256 |
1260 MAYBE_FRAMEMETH (f, toolbar_size_changed_in_frame, | 1257 MAYBE_FRAMEMETH (f, toolbar_size_changed_in_frame, |
1261 (f, pos, oldval)); | 1258 (f, pos, oldval)); |
1262 | 1259 |
1263 /* Let redisplay know that something has possibly changed. */ | 1260 /* Let redisplay know that something has possibly changed. */ |
1266 | 1263 |
1267 static void | 1264 static void |
1268 toolbar_visible_p_changed_in_frame (Lisp_Object specifier, struct frame *f, | 1265 toolbar_visible_p_changed_in_frame (Lisp_Object specifier, struct frame *f, |
1269 Lisp_Object oldval) | 1266 Lisp_Object oldval) |
1270 { | 1267 { |
1271 enum toolbar_pos pos; | 1268 int pos; |
1272 | 1269 |
1273 for (pos = 0; pos < 4; pos++) | 1270 for (pos = 0; pos < countof (Vtoolbar_visible_p); pos++) |
1274 if (EQ (specifier, Vtoolbar_visible_p[pos])) | 1271 if (EQ (specifier, Vtoolbar_visible_p[(enum toolbar_pos) pos])) |
1275 break; | 1272 break; |
1276 | 1273 |
1277 assert (pos < 4); | 1274 assert (pos < countof (Vtoolbar_visible_p)); |
1278 | 1275 |
1279 MAYBE_FRAMEMETH (f, toolbar_visible_p_changed_in_frame, | 1276 MAYBE_FRAMEMETH (f, toolbar_visible_p_changed_in_frame, |
1280 (f, pos, oldval)); | 1277 (f, pos, oldval)); |
1281 | 1278 |
1282 /* Let redisplay know that something has possibly changed. */ | 1279 /* Let redisplay know that something has possibly changed. */ |