emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/macmenu.c


From: Steven Tamm
Subject: [Emacs-diffs] Changes to emacs/src/macmenu.c
Date: Fri, 27 Aug 2004 07:14:19 -0400

Index: emacs/src/macmenu.c
diff -c emacs/src/macmenu.c:1.15 emacs/src/macmenu.c:1.16
*** emacs/src/macmenu.c:1.15    Sun May 30 00:18:41 2004
--- emacs/src/macmenu.c Thu Aug 26 18:43:29 2004
***************
*** 163,168 ****
--- 163,174 ----
  
  extern Lisp_Object Qmenu_bar_update_hook;
  
+ #if TARGET_API_MAC_CARBON
+ #define ENCODE_MENU_STRING(str) ENCODE_UTF_8 (str)
+ #else
+ #define ENCODE_MENU_STRING(str) ENCODE_SYSTEM (str)
+ #endif
+ 
  void set_frame_menubar ();
  
  static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
***************
*** 1246,1258 ****
  #ifndef HAVE_MULTILINGUAL_MENU
          if (STRING_MULTIBYTE (item_name))
            {
!             item_name = ENCODE_SYSTEM (item_name);
              AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name;
            }
  
          if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
            {
!             descrip = ENCODE_SYSTEM (descrip);
              AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip;
            }
  #endif /* not HAVE_MULTILINGUAL_MENU */
--- 1252,1264 ----
  #ifndef HAVE_MULTILINGUAL_MENU
          if (STRING_MULTIBYTE (item_name))
            {
!             item_name = ENCODE_MENU_STRING (item_name);
              AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name;
            }
  
          if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
            {
!             descrip = ENCODE_MENU_STRING (descrip);
              AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip;
            }
  #endif /* not HAVE_MULTILINGUAL_MENU */
***************
*** 1705,1716 ****
  #ifndef HAVE_MULTILINGUAL_MENU
            if (STRINGP (item_name) && STRING_MULTIBYTE (item_name))
            {
!             item_name = ENCODE_SYSTEM (item_name);
              AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name;
            }
            if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
              {
!             descrip = ENCODE_SYSTEM (descrip);
              AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip;
            }
  #endif /* not HAVE_MULTILINGUAL_MENU */
--- 1711,1722 ----
  #ifndef HAVE_MULTILINGUAL_MENU
            if (STRINGP (item_name) && STRING_MULTIBYTE (item_name))
            {
!             item_name = ENCODE_MENU_STRING (item_name);
              AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name;
            }
            if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
              {
!             descrip = ENCODE_MENU_STRING (descrip);
              AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip;
            }
  #endif /* not HAVE_MULTILINGUAL_MENU */
***************
*** 1764,1770 ****
  
  #ifndef HAVE_MULTILINGUAL_MENU
        if (STRING_MULTIBYTE (title))
!       title = ENCODE_SYSTEM (title);
  #endif
        wv_title->name = (char *) SDATA (title);
        wv_title->enabled = TRUE;
--- 1770,1776 ----
  
  #ifndef HAVE_MULTILINGUAL_MENU
        if (STRING_MULTIBYTE (title))
!       title = ENCODE_MENU_STRING (title);
  #endif
        wv_title->name = (char *) SDATA (title);
        wv_title->enabled = TRUE;
***************
*** 1813,1818 ****
--- 1819,1828 ----
    discard_mouse_events ();
  #endif
  
+   /* Must reset this manually because the button release event is not
+      passed to Emacs event loop. */
+   FRAME_MAC_DISPLAY_INFO (f)->grabbed = 0;
+ 
    /* Free the widget_value objects we used to specify the
       contents.  */
    free_menubar_widget_value_tree (first_wv);
***************
*** 2219,2226 ****
--- 2229,2246 ----
          strncat (item_name, wv->key, 255);
        }
        item_name[255] = 0;
+ #if TARGET_API_MAC_CARBON
+       {
+       CFStringRef string =
+         CFStringCreateWithCString (NULL, item_name, kCFStringEncodingUTF8);
+ 
+       SetMenuItemTextWithCFString (menu, pos, string);
+       CFRelease (string);
+       }
+ #else
        c2pstr (item_name);
        SetMenuItemText (menu, pos, item_name);
+ #endif
  
        if (wv->enabled && !force_disable)
  #if TARGET_API_MAC_CARBON




reply via email to

[Prev in Thread] Current Thread [Next in Thread]