Mercurial > emacs
comparison src/w32menu.c @ 29320:33aa00975055
(single_submenu, w32_menu_show): Call ENCODE_SYSTEM on menu strings.
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Tue, 30 May 2000 21:52:06 +0000 |
parents | 2c8492145fc8 |
children | baccf5e9ab70 |
comparison
equal
deleted
inserted
replaced
29319:2069f3aa4939 | 29320:33aa00975055 |
---|---|
27 #include "frame.h" | 27 #include "frame.h" |
28 #include "window.h" | 28 #include "window.h" |
29 #include "keyboard.h" | 29 #include "keyboard.h" |
30 #include "blockinput.h" | 30 #include "blockinput.h" |
31 #include "buffer.h" | 31 #include "buffer.h" |
32 #include "charset.h" | |
33 #include "coding.h" | |
32 | 34 |
33 /* This may include sys/types.h, and that somehow loses | 35 /* This may include sys/types.h, and that somehow loses |
34 if this is not done before the other system files. */ | 36 if this is not done before the other system files. */ |
35 #include "w32term.h" | 37 #include "w32term.h" |
36 | 38 |
67 char* name; | 69 char* name; |
68 /* value (meaning depend on widget type) */ | 70 /* value (meaning depend on widget type) */ |
69 char* value; | 71 char* value; |
70 /* keyboard equivalent. no implications for XtTranslations */ | 72 /* keyboard equivalent. no implications for XtTranslations */ |
71 char* key; | 73 char* key; |
72 /* Help string. */ | 74 /* Help string or null if none. */ |
73 char* help; | 75 char *help; |
74 /* true if enabled */ | 76 /* true if enabled */ |
75 Boolean enabled; | 77 Boolean enabled; |
76 /* true if selected */ | 78 /* true if selected */ |
77 Boolean selected; | 79 Boolean selected; |
78 /* The type of a button. */ | 80 /* The type of a button. */ |
1170 char *pane_string; | 1172 char *pane_string; |
1171 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; | 1173 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; |
1172 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; | 1174 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; |
1173 #ifndef HAVE_MULTILINGUAL_MENU | 1175 #ifndef HAVE_MULTILINGUAL_MENU |
1174 if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) | 1176 if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) |
1175 pane_name = string_make_unibyte (pane_name); | 1177 pane_name = ENCODE_SYSTEM (pane_name); |
1176 #endif | 1178 #endif |
1177 pane_string = (NILP (pane_name) | 1179 pane_string = (NILP (pane_name) |
1178 ? "" : (char *) XSTRING (pane_name)->data); | 1180 ? "" : (char *) XSTRING (pane_name)->data); |
1179 /* If there is just one top-level pane, put all its items directly | 1181 /* If there is just one top-level pane, put all its items directly |
1180 under the top-level menu. */ | 1182 under the top-level menu. */ |
1208 { | 1210 { |
1209 /* Create a new item within current pane. */ | 1211 /* Create a new item within current pane. */ |
1210 Lisp_Object item_name, enable, descrip, def, type, selected; | 1212 Lisp_Object item_name, enable, descrip, def, type, selected; |
1211 Lisp_Object help; | 1213 Lisp_Object help; |
1212 | 1214 |
1213 /* NTEMACS_TODO: implement popup/modeline help for menus. */ | |
1214 | |
1215 item_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_NAME]; | 1215 item_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_NAME]; |
1216 enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE]; | 1216 enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE]; |
1217 descrip | 1217 descrip |
1218 = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY]; | 1218 = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY]; |
1219 def = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_DEFINITION]; | 1219 def = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_DEFINITION]; |
1221 selected = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_SELECTED]; | 1221 selected = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_SELECTED]; |
1222 help = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_HELP]; | 1222 help = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_HELP]; |
1223 | 1223 |
1224 #ifndef HAVE_MULTILINGUAL_MENU | 1224 #ifndef HAVE_MULTILINGUAL_MENU |
1225 if (STRING_MULTIBYTE (item_name)) | 1225 if (STRING_MULTIBYTE (item_name)) |
1226 item_name = string_make_unibyte (item_name); | 1226 item_name = ENCODE_SYSTEM (item_name); |
1227 if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) | 1227 if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) |
1228 descrip = string_make_unibyte (descrip); | 1228 descrip = ENCODE_SYSTEM (descrip); |
1229 #endif | 1229 #endif |
1230 | 1230 |
1231 wv = xmalloc_widget_value (); | 1231 wv = xmalloc_widget_value (); |
1232 if (prev_wv) | 1232 if (prev_wv) |
1233 prev_wv->next = wv; | 1233 prev_wv->next = wv; |
1617 char *pane_string; | 1617 char *pane_string; |
1618 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; | 1618 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; |
1619 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; | 1619 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; |
1620 #ifndef HAVE_MULTILINGUAL_MENU | 1620 #ifndef HAVE_MULTILINGUAL_MENU |
1621 if (!NILP (pane_name) && STRING_MULTIBYTE (pane_name)) | 1621 if (!NILP (pane_name) && STRING_MULTIBYTE (pane_name)) |
1622 pane_name = string_make_unibyte (pane_name); | 1622 pane_name = ENCODE_SYSTEM (pane_name); |
1623 #endif | 1623 #endif |
1624 pane_string = (NILP (pane_name) | 1624 pane_string = (NILP (pane_name) |
1625 ? "" : (char *) XSTRING (pane_name)->data); | 1625 ? "" : (char *) XSTRING (pane_name)->data); |
1626 /* If there is just one top-level pane, put all its items directly | 1626 /* If there is just one top-level pane, put all its items directly |
1627 under the top-level menu. */ | 1627 under the top-level menu. */ |
1669 selected = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_SELECTED]; | 1669 selected = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_SELECTED]; |
1670 help = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_HELP]; | 1670 help = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_HELP]; |
1671 | 1671 |
1672 #ifndef HAVE_MULTILINGUAL_MENU | 1672 #ifndef HAVE_MULTILINGUAL_MENU |
1673 if (STRINGP (item_name) && STRING_MULTIBYTE (item_name)) | 1673 if (STRINGP (item_name) && STRING_MULTIBYTE (item_name)) |
1674 item_name = string_make_unibyte (item_name); | 1674 item_name = ENCODE_SYSTEM (item_name); |
1675 if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) | 1675 if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) |
1676 descrip = string_make_unibyte (descrip); | 1676 descrip = ENCODE_SYSTEM (descrip); |
1677 #endif | 1677 #endif |
1678 | 1678 |
1679 wv = xmalloc_widget_value (); | 1679 wv = xmalloc_widget_value (); |
1680 if (prev_wv) | 1680 if (prev_wv) |
1681 prev_wv->next = wv; | 1681 prev_wv->next = wv; |
1723 wv_sep->name = "--"; | 1723 wv_sep->name = "--"; |
1724 wv_sep->next = first_wv->contents; | 1724 wv_sep->next = first_wv->contents; |
1725 | 1725 |
1726 #ifndef HAVE_MULTILINGUAL_MENU | 1726 #ifndef HAVE_MULTILINGUAL_MENU |
1727 if (STRING_MULTIBYTE (title)) | 1727 if (STRING_MULTIBYTE (title)) |
1728 title = string_make_unibyte (title); | 1728 title = ENCODE_SYSTEM (title); |
1729 #endif | 1729 #endif |
1730 wv_title->name = (char *) XSTRING (title)->data; | 1730 wv_title->name = (char *) XSTRING (title)->data; |
1731 wv_title->enabled = True; | 1731 wv_title->enabled = True; |
1732 wv_title->button_type = BUTTON_TYPE_NONE; | 1732 wv_title->button_type = BUTTON_TYPE_NONE; |
1733 wv_title->next = wv_sep; | 1733 wv_title->next = wv_sep; |