diff options
| author | Miles Bader | 2004-08-27 07:00:34 +0000 |
|---|---|---|
| committer | Miles Bader | 2004-08-27 07:00:34 +0000 |
| commit | b71f2b97d343dd5ec39b64b66de86051ee47eb3e (patch) | |
| tree | 85e3d906c7ba13a3fd447ad054a430388386b748 /src/macmenu.c | |
| parent | 21b4a4fb21f6254fb37da88b0d5858575f953e22 (diff) | |
| parent | 11d2e01ba3a82c41eec105df81260568f048e726 (diff) | |
| download | emacs-b71f2b97d343dd5ec39b64b66de86051ee47eb3e.tar.gz emacs-b71f2b97d343dd5ec39b64b66de86051ee47eb3e.zip | |
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-32
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-486
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-487
Tweak permissions
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-488
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-489
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-490
Update from CVS: man/fixit.texi (Spelling): Fix typo.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-491
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-494
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-495
Update from CVS: Add missing lisp/mh-e files
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-496
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-499
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-500
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-513
Update from CVS
Diffstat (limited to 'src/macmenu.c')
| -rw-r--r-- | src/macmenu.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/macmenu.c b/src/macmenu.c index d205ee3b877..67e18481a1b 100644 --- a/src/macmenu.c +++ b/src/macmenu.c | |||
| @@ -163,6 +163,12 @@ extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; | |||
| 163 | 163 | ||
| 164 | extern Lisp_Object Qmenu_bar_update_hook; | 164 | extern Lisp_Object Qmenu_bar_update_hook; |
| 165 | 165 | ||
| 166 | #if TARGET_API_MAC_CARBON | ||
| 167 | #define ENCODE_MENU_STRING(str) ENCODE_UTF_8 (str) | ||
| 168 | #else | ||
| 169 | #define ENCODE_MENU_STRING(str) ENCODE_SYSTEM (str) | ||
| 170 | #endif | ||
| 171 | |||
| 166 | void set_frame_menubar (); | 172 | void set_frame_menubar (); |
| 167 | 173 | ||
| 168 | static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, | 174 | static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, |
| @@ -1246,13 +1252,13 @@ single_submenu (item_key, item_name, maps) | |||
| 1246 | #ifndef HAVE_MULTILINGUAL_MENU | 1252 | #ifndef HAVE_MULTILINGUAL_MENU |
| 1247 | if (STRING_MULTIBYTE (item_name)) | 1253 | if (STRING_MULTIBYTE (item_name)) |
| 1248 | { | 1254 | { |
| 1249 | item_name = ENCODE_SYSTEM (item_name); | 1255 | item_name = ENCODE_MENU_STRING (item_name); |
| 1250 | AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; | 1256 | AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; |
| 1251 | } | 1257 | } |
| 1252 | 1258 | ||
| 1253 | if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) | 1259 | if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) |
| 1254 | { | 1260 | { |
| 1255 | descrip = ENCODE_SYSTEM (descrip); | 1261 | descrip = ENCODE_MENU_STRING (descrip); |
| 1256 | AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; | 1262 | AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; |
| 1257 | } | 1263 | } |
| 1258 | #endif /* not HAVE_MULTILINGUAL_MENU */ | 1264 | #endif /* not HAVE_MULTILINGUAL_MENU */ |
| @@ -1705,12 +1711,12 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) | |||
| 1705 | #ifndef HAVE_MULTILINGUAL_MENU | 1711 | #ifndef HAVE_MULTILINGUAL_MENU |
| 1706 | if (STRINGP (item_name) && STRING_MULTIBYTE (item_name)) | 1712 | if (STRINGP (item_name) && STRING_MULTIBYTE (item_name)) |
| 1707 | { | 1713 | { |
| 1708 | item_name = ENCODE_SYSTEM (item_name); | 1714 | item_name = ENCODE_MENU_STRING (item_name); |
| 1709 | AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; | 1715 | AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; |
| 1710 | } | 1716 | } |
| 1711 | if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) | 1717 | if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) |
| 1712 | { | 1718 | { |
| 1713 | descrip = ENCODE_SYSTEM (descrip); | 1719 | descrip = ENCODE_MENU_STRING (descrip); |
| 1714 | AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; | 1720 | AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; |
| 1715 | } | 1721 | } |
| 1716 | #endif /* not HAVE_MULTILINGUAL_MENU */ | 1722 | #endif /* not HAVE_MULTILINGUAL_MENU */ |
| @@ -1764,7 +1770,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) | |||
| 1764 | 1770 | ||
| 1765 | #ifndef HAVE_MULTILINGUAL_MENU | 1771 | #ifndef HAVE_MULTILINGUAL_MENU |
| 1766 | if (STRING_MULTIBYTE (title)) | 1772 | if (STRING_MULTIBYTE (title)) |
| 1767 | title = ENCODE_SYSTEM (title); | 1773 | title = ENCODE_MENU_STRING (title); |
| 1768 | #endif | 1774 | #endif |
| 1769 | wv_title->name = (char *) SDATA (title); | 1775 | wv_title->name = (char *) SDATA (title); |
| 1770 | wv_title->enabled = TRUE; | 1776 | wv_title->enabled = TRUE; |
| @@ -1813,6 +1819,10 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) | |||
| 1813 | discard_mouse_events (); | 1819 | discard_mouse_events (); |
| 1814 | #endif | 1820 | #endif |
| 1815 | 1821 | ||
| 1822 | /* Must reset this manually because the button release event is not | ||
| 1823 | passed to Emacs event loop. */ | ||
| 1824 | FRAME_MAC_DISPLAY_INFO (f)->grabbed = 0; | ||
| 1825 | |||
| 1816 | /* Free the widget_value objects we used to specify the | 1826 | /* Free the widget_value objects we used to specify the |
| 1817 | contents. */ | 1827 | contents. */ |
| 1818 | free_menubar_widget_value_tree (first_wv); | 1828 | free_menubar_widget_value_tree (first_wv); |
| @@ -2219,8 +2229,18 @@ add_menu_item (MenuHandle menu, widget_value *wv, int submenu, | |||
| 2219 | strncat (item_name, wv->key, 255); | 2229 | strncat (item_name, wv->key, 255); |
| 2220 | } | 2230 | } |
| 2221 | item_name[255] = 0; | 2231 | item_name[255] = 0; |
| 2232 | #if TARGET_API_MAC_CARBON | ||
| 2233 | { | ||
| 2234 | CFStringRef string = | ||
| 2235 | CFStringCreateWithCString (NULL, item_name, kCFStringEncodingUTF8); | ||
| 2236 | |||
| 2237 | SetMenuItemTextWithCFString (menu, pos, string); | ||
| 2238 | CFRelease (string); | ||
| 2239 | } | ||
| 2240 | #else | ||
| 2222 | c2pstr (item_name); | 2241 | c2pstr (item_name); |
| 2223 | SetMenuItemText (menu, pos, item_name); | 2242 | SetMenuItemText (menu, pos, item_name); |
| 2243 | #endif | ||
| 2224 | 2244 | ||
| 2225 | if (wv->enabled && !force_disable) | 2245 | if (wv->enabled && !force_disable) |
| 2226 | #if TARGET_API_MAC_CARBON | 2246 | #if TARGET_API_MAC_CARBON |