Lines Matching +defs:child +defs:name

26 static int menu_nable_recurse __ARGS((vimmenu_T *menu, char_u *name, int modes, int enable));
32 static int menu_name_equal __ARGS((char_u *name, vimmenu_T *menu));
33 static int menu_namecmp __ARGS((char_u *name, char_u *mname));
35 static char_u *popup_mode_name __ARGS((char_u *name, int idx));
49 static int menu_is_hidden __ARGS((char_u *name));
51 static int menu_is_tearoff __ARGS((char_u *name));
58 static char_u *menutrans_lookup __ARGS((char_u *name, int len));
263 * If there is only a menu name, display menus with that name.
410 * Add the menu with the given name to the menu hierarchy
434 char_u *name;
458 name = path_name;
459 while (*name)
461 /* Get name of this element in the menu hierarchy, and the simplified
462 * name (without mnemonic and accelerator text). */
463 next_name = menu_name_skip(name);
465 map_to = menutrans_lookup(name, (int)STRLEN(name));
468 en_name = name;
469 name = map_to;
474 dname = menu_text(name, NULL, NULL);
480 EMSG(_("E792: Empty menu name"));
493 if (menu_name_equal(name, menu) || menu_name_equal(dname, menu))
517 if (parent != NULL || menu_is_menubar(menu->name))
554 menu->name = vim_strsave(name);
555 /* separate mnemonic and accelerator text from actual menu name */
556 menu->dname = menu_text(name, &menu->mnemonic, &menu->actext);
650 && menu_is_menubar(name))
686 name = next_name;
806 * Set the (sub)menu with the given name to enabled or disabled.
810 menu_nable_recurse(menu, name, modes, enable)
812 char_u *name;
821 /* Get name of this element in the menu hierarchy */
822 p = menu_name_skip(name);
827 if (*name == NUL || *name == '*' || menu_name_equal(name, menu))
847 * When name is empty, we are doing all menu items for the given
851 if (*name != NUL && *name != '*')
856 if (*name != NUL && *name != '*' && menu == NULL)
858 EMSG2(_(e_nomenu), name);
871 * Remove the (sub)menu with the given name from the menu hierarchy
875 remove_menu(menup, name, modes, silent)
877 char_u *name;
882 vimmenu_T *child;
888 /* Get name of this element in the menu hierarchy */
889 p = menu_name_skip(name);
894 if (*name == NUL || menu_name_equal(name, menu))
918 else if (*name != NUL)
926 * When name is empty, we are removing all menu items for the given
930 if (*name != NUL)
946 if (*name != NUL)
951 EMSG2(_(e_nomenu), name);
960 child = menu->children->next; /* don't count tearoff bar */
963 child = menu->children;
964 for ( ; child != NULL; child = child->next)
965 menu->modes |= child->modes;
1013 vim_free(menu->name);
1064 char_u *name;
1069 name = path_name = vim_strsave(path_name);
1073 /* First, find the (sub)menu with the given name */
1074 while (*name)
1076 p = menu_name_skip(name);
1079 if (menu_name_equal(name, menu))
1100 EMSG2(_(e_nomenu), name);
1104 name = p;
1146 msg_outtrans_attr(menu->name, hl_attr(HLF_D));
1220 char_u *name;
1263 if (*p == NUL) /* Complete the menu name */
1267 * With :menu though you might want to add a menu with the same name as
1282 name = path_name;
1283 while (name != NULL && *name)
1285 p = menu_name_skip(name);
1288 if (menu_name_equal(name, menu))
1307 /* No menu found with the name we were looking for */
1311 name = p;
1482 * "name" may be modified.
1485 menu_name_skip(name)
1486 char_u *name;
1490 for (p = name; *p && *p != '.'; mb_ptr_adv(p))
1505 * Return TRUE when "name" matches with menu "menu". The name is compared in
1506 * two ways: raw menu name and menu name without '&'. ignore part after a TAB.
1509 menu_name_equal(name, menu)
1510 char_u *name;
1515 && (menu_namecmp(name,menu->en_name)
1516 || menu_namecmp(name,menu->en_dname)))
1519 return menu_namecmp(name, menu->name) || menu_namecmp(name, menu->dname);
1523 menu_namecmp(name, mname)
1524 char_u *name;
1529 for (i = 0; name[i] != NUL && name[i] != TAB; ++i)
1530 if (name[i] != mname[i])
1532 return ((name[i] == NUL || name[i] == TAB)
1605 * Modify a menu name starting with "PopUp" to include the mode character.
1606 * Returns the name in allocated memory (NULL for failure).
1609 popup_mode_name(name, idx)
1610 char_u *name;
1614 int len = (int)STRLEN(name);
1616 p = vim_strnsave(name, len + 1);
1725 * Return TRUE if "name" can be a menu in the MenuBar.
1728 menu_is_menubar(name)
1729 char_u *name;
1731 return (!menu_is_popup(name)
1732 && !menu_is_toolbar(name)
1733 && *name != MNU_HIDDEN_CHAR);
1737 * Return TRUE if "name" is a popup menu name.
1740 menu_is_popup(name)
1741 char_u *name;
1743 return (STRNCMP(name, "PopUp", 5) == 0);
1748 * Return TRUE if "name" is part of a popup menu.
1756 return menu_is_popup(menu->name);
1761 * Return TRUE if "name" is a toolbar menu name.
1764 menu_is_toolbar(name)
1765 char_u *name;
1767 return (STRNCMP(name, "ToolBar", 7) == 0);
1771 * Return TRUE if the name is a menu separator identifier: Starts and ends
1775 menu_is_separator(name)
1776 char_u *name;
1778 return (name[0] == '-' && name[STRLEN(name) - 1] == '-');
1785 menu_is_hidden(name)
1786 char_u *name;
1788 return (name[0] == ']') || (menu_is_popup(name) && name[5] != NUL);
1797 menu_is_tearoff(name)
1798 char_u *name UNUSED;
1801 return (STRCMP(name, TEAR_STRING) == 0);
1914 || menu_is_toolbar(menu->parent->name)
2012 if (STRNCMP("PopUp", menu->name, 5) == 0 && menu->name[5] == mode)
2065 if (menu->children != NULL && menu_is_menubar(menu->name))
2067 /* Add the menu name to the menu path. Insert a backslash before
2069 len = (int)STRLEN(pname) + (int)STRLEN(menu->name);
2070 for (s = menu->name; *s; ++s)
2078 for (s = menu->name; *s; ++s)
2087 if (STRCMP(menu->children->name, TEAR_STRING) != 0)
2165 if (STRCMP(menu->children->name, TEAR_STRING) == 0)
2188 char_u *name;
2199 name = saved_name;
2200 while (*name)
2203 p = menu_name_skip(name);
2207 if (menu_name_equal(name, menu))
2226 name = p;
2327 char_u *name;
2337 name = saved_name;
2338 while (*name)
2340 /* find the end of one dot-separated name and put a NUL at the dot */
2341 p = menu_name_skip(name);
2345 if (STRCMP(name, menu->name) == 0 || STRCMP(name, menu->dname) == 0)
2368 name = p;
2386 char_u *from; /* English name */
2388 char_u *to; /* translated name */
2476 * Find the character just after one part of a menu name.
2494 * Lookup part of a menu name in the translations.
2498 menutrans_lookup(name, len)
2499 char_u *name;
2507 if (STRNCMP(name, tp[i].from, len) == 0 && tp[i].from[len] == NUL)
2511 i = name[len];
2512 name[len] = NUL;
2513 dname = menu_text(name, NULL, NULL);
2514 name[len] = i;
2530 * Unescape the name in the translate dictionary table.
2533 menu_unescape_name(name)
2534 char_u *name;
2538 for (p = name; *p && *p != '.'; mb_ptr_adv(p))
2545 * Isolate the menu name.
2546 * Skip the menu name, and translate <Tab> into a real TAB.