summaryrefslogtreecommitdiff
path: root/src/nsmenu.m
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2010-12-17 12:04:06 +0800
committerChong Yidong <cyd@stupidchicken.com>2010-12-17 12:04:06 +0800
commit4039c78625bb20cf57b434a7d395bf2473e45133 (patch)
tree729b8ce725973a7e31d769e4ab1217b517738a21 /src/nsmenu.m
parent8b358e9038806836c599da8233781b14c6bb53e7 (diff)
downloademacs-4039c78625bb20cf57b434a7d395bf2473e45133.tar.gz
Support for menu separators in the GTK tool-bar.
* src/gtkutil.c (XG_BIN_CHILD): New macro. (xg_get_menu_item_label, xg_update_menubar) (xg_update_menu_item, xg_tool_bar_menu_proxy) (xg_show_toolbar_item, update_frame_tool_bar): Use it. (separator_names, xg_separator_p): Move to keyboard.c. (create_menus, xg_update_submenu, update_frame_tool_bar): Use menu_separator_name_p. * src/keyboard.c (parse_tool_bar_item): Allow menu separators in tool-bar maps. (menu_separator_name_p): New function, from gtkutil.c. (separator_names): Move from gtkutil.c. * src/keyboard.h (menu_separator_name_p): Add prototype. * src/nsmenu.m (name_is_separator): Function deleted. (addItemWithWidgetValue): Use menu_separator_name_p. * src/w32menu.c (name_is_separator): Function deleted. (add_menu_item): Use menu_separator_name_p.
Diffstat (limited to 'src/nsmenu.m')
-rw-r--r--src/nsmenu.m17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 973f2c15e2f..95f651f6690 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -507,21 +507,6 @@ set_frame_menubar (struct frame *f, int first_time, int deep_p)
}
-/* Utility (from macmenu.c): is this item a separator? */
-static int
-name_is_separator ( const char *name)
-{
- const char *start = name;
-
- /* Check if name string consists of only dashes ('-'). */
- while (*name == '-') name++;
- /* Separators can also be of the form "--:TripleSuperMegaEtched"
- or "--deep-shadow". We don't implement them yet, se we just treat
- them like normal separators. */
- return (*name == '\0' || start + 2 == name);
-}
-
-
/* ==========================================================================
Menu: class implementation
@@ -624,7 +609,7 @@ name_is_separator ( const char *name)
NSMenuItem *item;
widget_value *wv = (widget_value *)wvptr;
- if (name_is_separator (wv->name))
+ if (menu_separator_name_p (wv->name))
{
item = [NSMenuItem separatorItem];
[self addItem: item];