Mercurial > hg > xemacs-beta
comparison src/menubar-x.c @ 5027:22179cd0fe15
merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 10 Feb 2010 07:25:19 -0600 |
parents | ae48681c47fa |
children | 6f2158fa75ed |
comparison
equal
deleted
inserted
replaced
5026:46cf825f6158 | 5027:22179cd0fe15 |
---|---|
126 wv->enabled = 1; | 126 wv->enabled = 1; |
127 /* dverna Dec. 98: command_builder_operate_menu_accelerator will | 127 /* dverna Dec. 98: command_builder_operate_menu_accelerator will |
128 manipulate the accel as a Lisp_Object if the widget has a name. | 128 manipulate the accel as a Lisp_Object if the widget has a name. |
129 Since simple labels have a name, but no accel, we *must* set it | 129 Since simple labels have a name, but no accel, we *must* set it |
130 to nil */ | 130 to nil */ |
131 wv->accel = LISP_TO_VOID (Qnil); | 131 wv->accel = STORE_LISP_IN_VOID (Qnil); |
132 } | 132 } |
133 } | 133 } |
134 else if (VECTORP (desc)) | 134 else if (VECTORP (desc)) |
135 { | 135 { |
136 Lisp_Object gui_item = gui_parse_item_keywords (desc); | 136 Lisp_Object gui_item = gui_parse_item_keywords (desc); |
160 wv->type = CASCADE_TYPE; | 160 wv->type = CASCADE_TYPE; |
161 wv->enabled = 1; | 161 wv->enabled = 1; |
162 wv->name = add_accel_and_to_external (XCAR (desc)); | 162 wv->name = add_accel_and_to_external (XCAR (desc)); |
163 | 163 |
164 accel = gui_name_accelerator (XCAR (desc)); | 164 accel = gui_name_accelerator (XCAR (desc)); |
165 wv->accel = LISP_TO_VOID (accel); | 165 wv->accel = STORE_LISP_IN_VOID (accel); |
166 | 166 |
167 desc = Fcdr (desc); | 167 desc = Fcdr (desc); |
168 | 168 |
169 while (key = Fcar (desc), KEYWORDP (key)) | 169 while (key = Fcar (desc), KEYWORDP (key)) |
170 { | 170 { |
184 active_p = val, active_spec = 1; | 184 active_p = val, active_spec = 1; |
185 else if (EQ (key, Q_accelerator)) | 185 else if (EQ (key, Q_accelerator)) |
186 { | 186 { |
187 if ( SYMBOLP (val) | 187 if ( SYMBOLP (val) |
188 || CHARP (val)) | 188 || CHARP (val)) |
189 wv->accel = LISP_TO_VOID (val); | 189 wv->accel = STORE_LISP_IN_VOID (val); |
190 else | 190 else |
191 invalid_argument ("bad keyboard accelerator", val); | 191 invalid_argument ("bad keyboard accelerator", val); |
192 } | 192 } |
193 else if (EQ (key, Q_label)) | 193 else if (EQ (key, Q_label)) |
194 { | 194 { |
229 incr_wv->name = wv->name; | 229 incr_wv->name = wv->name; |
230 incr_wv->name = xstrdup (wv->name); | 230 incr_wv->name = xstrdup (wv->name); |
231 /* This is automatically GC protected through | 231 /* This is automatically GC protected through |
232 the call to lw_map_widget_values(); no need | 232 the call to lw_map_widget_values(); no need |
233 to worry. */ | 233 to worry. */ |
234 incr_wv->call_data = LISP_TO_VOID (incremental_data); | 234 incr_wv->call_data = STORE_LISP_IN_VOID (incremental_data); |
235 goto menu_item_done; | 235 goto menu_item_done; |
236 } | 236 } |
237 #endif /* LWLIB_MENUBARS_LUCID || LWLIB_MENUBARS_MOTIF */ | 237 #endif /* LWLIB_MENUBARS_LUCID || LWLIB_MENUBARS_MOTIF */ |
238 } | 238 } |
239 if (menu_type == POPUP_TYPE && popup_menu_titles && depth == 0) | 239 if (menu_type == POPUP_TYPE && popup_menu_titles && depth == 0) |
259 { | 259 { |
260 widget_value *dummy; | 260 widget_value *dummy; |
261 /* Add a fake entry so the menus show up */ | 261 /* Add a fake entry so the menus show up */ |
262 wv->contents = dummy = xmalloc_widget_value (); | 262 wv->contents = dummy = xmalloc_widget_value (); |
263 dummy->name = xstrdup ("(inactive)"); | 263 dummy->name = xstrdup ("(inactive)"); |
264 dummy->accel = LISP_TO_VOID (Qnil); | 264 dummy->accel = STORE_LISP_IN_VOID (Qnil); |
265 dummy->enabled = 0; | 265 dummy->enabled = 0; |
266 dummy->selected = 0; | 266 dummy->selected = 0; |
267 dummy->value = NULL; | 267 dummy->value = NULL; |
268 dummy->type = BUTTON_TYPE; | 268 dummy->type = BUTTON_TYPE; |
269 dummy->call_data = NULL; | 269 dummy->call_data = NULL; |
469 widget_value *hack_wv = (widget_value *) client_data; | 469 widget_value *hack_wv = (widget_value *) client_data; |
470 Lisp_Object submenu_desc; | 470 Lisp_Object submenu_desc; |
471 widget_value *wv; | 471 widget_value *wv; |
472 | 472 |
473 assert (hack_wv->type == INCREMENTAL_TYPE); | 473 assert (hack_wv->type == INCREMENTAL_TYPE); |
474 submenu_desc = VOID_TO_LISP (hack_wv->call_data); | 474 submenu_desc = GET_LISP_FROM_VOID (hack_wv->call_data); |
475 | 475 |
476 wv = (protected_menu_item_descriptor_to_widget_value | 476 wv = (protected_menu_item_descriptor_to_widget_value |
477 (submenu_desc, SUBMENU_TYPE, 1, 0)); | 477 (submenu_desc, SUBMENU_TYPE, 1, 0)); |
478 | 478 |
479 if (!wv) | 479 if (!wv) |
480 { | 480 { |
481 wv = xmalloc_widget_value (); | 481 wv = xmalloc_widget_value (); |
482 wv->type = CASCADE_TYPE; | 482 wv->type = CASCADE_TYPE; |
483 wv->next = NULL; | 483 wv->next = NULL; |
484 wv->accel = LISP_TO_VOID (Qnil); | 484 wv->accel = STORE_LISP_IN_VOID (Qnil); |
485 wv->contents = xmalloc_widget_value (); | 485 wv->contents = xmalloc_widget_value (); |
486 wv->contents->type = TEXT_TYPE; | 486 wv->contents->type = TEXT_TYPE; |
487 wv->contents->name = xstrdup ("No menu"); | 487 wv->contents->name = xstrdup ("No menu"); |
488 wv->contents->next = NULL; | 488 wv->contents->next = NULL; |
489 wv->contents->accel = LISP_TO_VOID (Qnil); | 489 wv->contents->accel = STORE_LISP_IN_VOID (Qnil); |
490 } | 490 } |
491 assert (wv && wv->type == CASCADE_TYPE && wv->contents); | 491 assert (wv && wv->type == CASCADE_TYPE && wv->contents); |
492 replace_widget_value_tree (hack_wv, wv->contents); | 492 replace_widget_value_tree (hack_wv, wv->contents); |
493 free_popup_widget_value_tree (wv); | 493 free_popup_widget_value_tree (wv); |
494 /* Now that we've destructively modified part of the widget value | 494 /* Now that we've destructively modified part of the widget value |
1030 entries=lw_get_entries (True); | 1030 entries=lw_get_entries (True); |
1031 | 1031 |
1032 while (entries) | 1032 while (entries) |
1033 { | 1033 { |
1034 Lisp_Object accel; | 1034 Lisp_Object accel; |
1035 accel = VOID_TO_LISP (entries->accel); | 1035 accel = GET_LISP_FROM_VOID (entries->accel); |
1036 if (entries->name && !NILP (accel)) | 1036 if (entries->name && !NILP (accel)) |
1037 { | 1037 { |
1038 if (event_matches_key_specifier_p (evee, accel)) | 1038 if (event_matches_key_specifier_p (evee, accel)) |
1039 { | 1039 { |
1040 /* a match! */ | 1040 /* a match! */ |
1263 GCPRO1 (fake); | 1263 GCPRO1 (fake); |
1264 | 1264 |
1265 while (val) | 1265 while (val) |
1266 { | 1266 { |
1267 Lisp_Object accel; | 1267 Lisp_Object accel; |
1268 accel = VOID_TO_LISP (val->accel); | 1268 accel = GET_LISP_FROM_VOID (val->accel); |
1269 if (val->name && !NILP (accel)) | 1269 if (val->name && !NILP (accel)) |
1270 { | 1270 { |
1271 Fsetcar (last, accel); | 1271 Fsetcar (last, accel); |
1272 Fsetcar (fake, event0); | 1272 Fsetcar (fake, event0); |
1273 matchp = condition_case_1 (Qerror, | 1273 matchp = condition_case_1 (Qerror, |