mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.1.0941: macros for MS-Windows are inconsistent
Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and others. Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the GUI build. (Hirohito Higashi, closes #3932)
This commit is contained in:
46
src/menu.c
46
src/menu.c
@@ -18,7 +18,7 @@
|
||||
|
||||
#define MENUDEPTH 10 /* maximum depth of menus */
|
||||
|
||||
#ifdef FEAT_GUI_W32
|
||||
#ifdef FEAT_GUI_MSWIN
|
||||
static int add_menu_path(char_u *, vimmenu_T *, int *, char_u *, int);
|
||||
#else
|
||||
static int add_menu_path(char_u *, vimmenu_T *, int *, char_u *);
|
||||
@@ -35,7 +35,7 @@ static int get_menu_cmd_modes(char_u *, int, int *, int *);
|
||||
static char_u *popup_mode_name(char_u *name, int idx);
|
||||
static char_u *menu_text(char_u *text, int *mnemonic, char_u **actext);
|
||||
|
||||
#if defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)
|
||||
#if defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF)
|
||||
static void gui_create_tearoffs_recurse(vimmenu_T *menu, const char_u *pname, int *pri_tab, int pri_idx);
|
||||
static void gui_add_tearoff(char_u *tearpath, int *pri_tab, int pri_idx);
|
||||
static void gui_destroy_tearoffs_recurse(vimmenu_T *menu);
|
||||
@@ -43,7 +43,7 @@ static int s_tearoffs = FALSE;
|
||||
#endif
|
||||
|
||||
static int menu_is_hidden(char_u *name);
|
||||
#if defined(FEAT_CMDL_COMPL) || (defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF))
|
||||
#if defined(FEAT_CMDL_COMPL) || (defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF))
|
||||
static int menu_is_tearoff(char_u *name);
|
||||
#endif
|
||||
|
||||
@@ -122,7 +122,7 @@ ex_menu(
|
||||
int i;
|
||||
#if defined(FEAT_GUI) && !defined(FEAT_GUI_GTK)
|
||||
int old_menu_height;
|
||||
# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
|
||||
# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
|
||||
int old_toolbar_height;
|
||||
# endif
|
||||
#endif
|
||||
@@ -295,7 +295,7 @@ ex_menu(
|
||||
}
|
||||
#if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON))
|
||||
old_menu_height = gui.menu_height;
|
||||
# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
|
||||
# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
|
||||
old_toolbar_height = gui.toolbar_height;
|
||||
# endif
|
||||
#endif
|
||||
@@ -381,7 +381,7 @@ ex_menu(
|
||||
menuarg.noremap[0] = noremap;
|
||||
menuarg.silent[0] = silent;
|
||||
add_menu_path(menu_path, &menuarg, pri_tab, map_to
|
||||
#ifdef FEAT_GUI_W32
|
||||
#ifdef FEAT_GUI_MSWIN
|
||||
, TRUE
|
||||
#endif
|
||||
);
|
||||
@@ -405,7 +405,7 @@ ex_menu(
|
||||
menuarg.icon_builtin = FALSE;
|
||||
#endif
|
||||
add_menu_path(p, &menuarg, pri_tab, map_to
|
||||
#ifdef FEAT_GUI_W32
|
||||
#ifdef FEAT_GUI_MSWIN
|
||||
, TRUE
|
||||
#endif
|
||||
);
|
||||
@@ -421,7 +421,7 @@ ex_menu(
|
||||
/* If the menubar height changed, resize the window */
|
||||
if (gui.in_use
|
||||
&& (gui.menu_height != old_menu_height
|
||||
# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
|
||||
# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
|
||||
|| gui.toolbar_height != old_toolbar_height
|
||||
# endif
|
||||
))
|
||||
@@ -455,7 +455,7 @@ add_menu_path(
|
||||
icon_builtin, silent[0], noremap[0] */
|
||||
int *pri_tab,
|
||||
char_u *call_data
|
||||
#ifdef FEAT_GUI_W32
|
||||
#ifdef FEAT_GUI_MSWIN
|
||||
, int addtearoff /* may add tearoff item */
|
||||
#endif
|
||||
)
|
||||
@@ -537,7 +537,7 @@ add_menu_path(
|
||||
goto erret;
|
||||
}
|
||||
if (*next_name != NUL && menu->children == NULL
|
||||
#ifdef FEAT_GUI_W32
|
||||
#ifdef FEAT_GUI_MSWIN
|
||||
&& addtearoff
|
||||
#endif
|
||||
)
|
||||
@@ -630,7 +630,7 @@ add_menu_path(
|
||||
if (*next_name == NUL && menuarg->iconfile != NULL)
|
||||
menu->iconfile = vim_strsave(menuarg->iconfile);
|
||||
#endif
|
||||
#if defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)
|
||||
#if defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF)
|
||||
/* the tearoff item must be present in the modes of each item. */
|
||||
if (parent != NULL && menu_is_tearoff(parent->children->dname))
|
||||
parent->children->modes |= modes;
|
||||
@@ -645,7 +645,7 @@ add_menu_path(
|
||||
* modes, then make sure it's available for this one now
|
||||
* Also enable a menu when it's created or changed.
|
||||
*/
|
||||
#ifdef FEAT_GUI_W32
|
||||
#ifdef FEAT_GUI_MSWIN
|
||||
/* If adding a tearbar (addtearoff == FALSE) don't update modes */
|
||||
if (addtearoff)
|
||||
#endif
|
||||
@@ -680,7 +680,7 @@ add_menu_path(
|
||||
}
|
||||
}
|
||||
|
||||
# if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF)
|
||||
# if defined(FEAT_GUI_MSWIN) & defined(FEAT_TEAROFF)
|
||||
/* When adding a new submenu, may add a tearoff item */
|
||||
if ( addtearoff
|
||||
&& *next_name
|
||||
@@ -758,7 +758,7 @@ add_menu_path(
|
||||
c = 0;
|
||||
d = 0;
|
||||
if (amenu && call_data != NULL && *call_data != NUL
|
||||
#ifdef FEAT_GUI_W32
|
||||
#ifdef FEAT_GUI_MSWIN
|
||||
&& addtearoff
|
||||
#endif
|
||||
)
|
||||
@@ -808,7 +808,7 @@ add_menu_path(
|
||||
menu->silent[i] = menuarg->silent[0];
|
||||
}
|
||||
}
|
||||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) \
|
||||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) \
|
||||
&& (defined(FEAT_BEVAL_GUI) || defined(FEAT_GUI_GTK))
|
||||
/* Need to update the menu tip. */
|
||||
if (modes & MENU_TIP_MODE)
|
||||
@@ -938,7 +938,7 @@ remove_menu(
|
||||
}
|
||||
if ((menu->modes & modes) != 0x0)
|
||||
{
|
||||
#if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF)
|
||||
#if defined(FEAT_GUI_MSWIN) & defined(FEAT_TEAROFF)
|
||||
/*
|
||||
* If we are removing all entries for this menu,MENU_ALL_MODES,
|
||||
* Then kill any tearoff before we start
|
||||
@@ -992,7 +992,7 @@ remove_menu(
|
||||
|
||||
/* Recalculate modes for menu based on the new updated children */
|
||||
menu->modes &= ~modes;
|
||||
#if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF)
|
||||
#if defined(FEAT_GUI_MSWIN) & defined(FEAT_TEAROFF)
|
||||
if ((s_tearoffs) && (menu->children != NULL)) /* there's a tear bar.. */
|
||||
child = menu->children->next; /* don't count tearoff bar */
|
||||
else
|
||||
@@ -1003,7 +1003,7 @@ remove_menu(
|
||||
if (modes & MENU_TIP_MODE)
|
||||
{
|
||||
free_menu_string(menu, MENU_INDEX_TIP);
|
||||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) \
|
||||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) \
|
||||
&& (defined(FEAT_BEVAL_GUI) || defined(FEAT_GUI_GTK))
|
||||
/* Need to update the menu tip. */
|
||||
if (gui.in_use)
|
||||
@@ -1013,7 +1013,7 @@ remove_menu(
|
||||
if ((menu->modes & MENU_ALL_MODES) == 0)
|
||||
{
|
||||
/* The menu item is no longer valid in ANY mode, so delete it */
|
||||
#if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF)
|
||||
#if defined(FEAT_GUI_MSWIN) & defined(FEAT_TEAROFF)
|
||||
if (s_tearoffs && menu->children != NULL) /* there's a tear bar.. */
|
||||
free_menu(&menu->children);
|
||||
#endif
|
||||
@@ -1867,7 +1867,7 @@ menu_is_hidden(char_u *name)
|
||||
}
|
||||
|
||||
#if defined(FEAT_CMDL_COMPL) \
|
||||
|| (defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF))
|
||||
|| (defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF))
|
||||
/*
|
||||
* Return TRUE if the menu is the tearoff menu.
|
||||
*/
|
||||
@@ -2031,7 +2031,7 @@ gui_update_menus_recurse(vimmenu_T *menu, int mode)
|
||||
while (menu)
|
||||
{
|
||||
if ((menu->modes & menu->enabled & mode)
|
||||
# if defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)
|
||||
# if defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF)
|
||||
|| menu_is_tearoff(menu->dname)
|
||||
# endif
|
||||
)
|
||||
@@ -2105,7 +2105,7 @@ gui_is_menu_shortcut(int key)
|
||||
# endif
|
||||
#endif /* FEAT_GUI */
|
||||
|
||||
#if (defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)) || defined(PROTO)
|
||||
#if (defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF)) || defined(PROTO)
|
||||
|
||||
/*
|
||||
* Deal with tearoff items that are added like a menu item.
|
||||
@@ -2257,7 +2257,7 @@ gui_destroy_tearoffs_recurse(vimmenu_T *menu)
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* FEAT_GUI_W32 && FEAT_TEAROFF */
|
||||
#endif /* FEAT_GUI_MSWIN && FEAT_TEAROFF */
|
||||
|
||||
/*
|
||||
* Execute "menu". Use by ":emenu" and the window toolbar.
|
||||
|
Reference in New Issue
Block a user