/[emacs]/emacs/src/macmenu.c
ViewVC logotype

Diff of /emacs/src/macmenu.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11.2.2 by miles, Mon Jun 28 07:29:22 2004 UTC revision 1.11.2.3 by miles, Fri Aug 27 07:00:32 2004 UTC
# Line 163  extern Lisp_Object Qoverriding_local_map Line 163  extern Lisp_Object Qoverriding_local_map
163    
164  extern Lisp_Object Qmenu_bar_update_hook;  extern Lisp_Object Qmenu_bar_update_hook;
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    
172  void set_frame_menubar ();  void set_frame_menubar ();
173    
174  static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object,  static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
# Line 1246  single_submenu (item_key, item_name, map Line 1252  single_submenu (item_key, item_name, map
1252  #ifndef HAVE_MULTILINGUAL_MENU  #ifndef HAVE_MULTILINGUAL_MENU
1253            if (STRING_MULTIBYTE (item_name))            if (STRING_MULTIBYTE (item_name))
1254              {              {
1255                item_name = ENCODE_SYSTEM (item_name);                item_name = ENCODE_MENU_STRING (item_name);
1256                AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name;                AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name;
1257              }              }
1258    
1259            if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))            if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
1260              {              {
1261                descrip = ENCODE_SYSTEM (descrip);                descrip = ENCODE_MENU_STRING (descrip);
1262                AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip;                AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip;
1263              }              }
1264  #endif /* not HAVE_MULTILINGUAL_MENU */  #endif /* not HAVE_MULTILINGUAL_MENU */
# Line 1705  mac_menu_show (f, x, y, for_click, keyma Line 1711  mac_menu_show (f, x, y, for_click, keyma
1711  #ifndef HAVE_MULTILINGUAL_MENU  #ifndef HAVE_MULTILINGUAL_MENU
1712            if (STRINGP (item_name) && STRING_MULTIBYTE (item_name))            if (STRINGP (item_name) && STRING_MULTIBYTE (item_name))
1713              {              {
1714                item_name = ENCODE_SYSTEM (item_name);                item_name = ENCODE_MENU_STRING (item_name);
1715                AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name;                AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name;
1716              }              }
1717            if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))            if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
1718              {              {
1719                descrip = ENCODE_SYSTEM (descrip);                descrip = ENCODE_MENU_STRING (descrip);
1720                AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip;                AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip;
1721              }              }
1722  #endif /* not HAVE_MULTILINGUAL_MENU */  #endif /* not HAVE_MULTILINGUAL_MENU */
# Line 1764  mac_menu_show (f, x, y, for_click, keyma Line 1770  mac_menu_show (f, x, y, for_click, keyma
1770    
1771  #ifndef HAVE_MULTILINGUAL_MENU  #ifndef HAVE_MULTILINGUAL_MENU
1772        if (STRING_MULTIBYTE (title))        if (STRING_MULTIBYTE (title))
1773          title = ENCODE_SYSTEM (title);          title = ENCODE_MENU_STRING (title);
1774  #endif  #endif
1775        wv_title->name = (char *) SDATA (title);        wv_title->name = (char *) SDATA (title);
1776        wv_title->enabled = TRUE;        wv_title->enabled = TRUE;
# Line 1813  mac_menu_show (f, x, y, for_click, keyma Line 1819  mac_menu_show (f, x, y, for_click, keyma
1819    discard_mouse_events ();    discard_mouse_events ();
1820  #endif  #endif
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    
1826    /* Free the widget_value objects we used to specify the    /* Free the widget_value objects we used to specify the
1827       contents.  */       contents.  */
1828    free_menubar_widget_value_tree (first_wv);    free_menubar_widget_value_tree (first_wv);
# Line 2219  add_menu_item (MenuHandle menu, widget_v Line 2229  add_menu_item (MenuHandle menu, widget_v
2229            strncat (item_name, wv->key, 255);            strncat (item_name, wv->key, 255);
2230          }          }
2231        item_name[255] = 0;        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
2241        c2pstr (item_name);        c2pstr (item_name);
2242        SetMenuItemText (menu, pos, item_name);        SetMenuItemText (menu, pos, item_name);
2243    #endif
2244    
2245        if (wv->enabled && !force_disable)        if (wv->enabled && !force_disable)
2246  #if TARGET_API_MAC_CARBON  #if TARGET_API_MAC_CARBON

Legend:
Removed from v.1.11.2.2  
changed lines
  Added in v.1.11.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26