static int recursive = 0;
++recursive;
- gui.starting = TRUE;
+ gui.starting = true;
#ifdef FEAT_GUI_GTK
gui.event_time = GDK_CURRENT_TIME;
void
gui_prepare(int *argc, char **argv)
{
- gui.in_use = FALSE; // No GUI yet (maybe later)
- gui.starting = FALSE; // No GUI yet (maybe later)
+ gui.in_use = false; // No GUI yet (maybe later)
+ gui.starting = false; // No GUI yet (maybe later)
gui_mch_prepare(argc, argv);
}
}
gui.shell_created = false;
- gui.dying = FALSE;
- gui.in_focus = TRUE; // so the guicursor setting works
+ gui.dying = false;
+ gui.in_focus = true; // so the guicursor setting works
gui.dragged_sb = SBAR_NONE;
gui.dragged_wp = NULL;
- gui.pointer_hidden = FALSE;
+ gui.pointer_hidden = false;
gui.col = 0;
gui.row = 0;
gui.num_cols = Columns;
gui.num_rows = Rows;
- gui.cursor_is_valid = FALSE;
+ gui.cursor_is_valid = false;
gui.scroll_region_top = 0;
gui.scroll_region_bot = Rows - 1;
gui.scroll_region_left = 0;
gui.menu_font = NOFONT;
# endif
# endif
- gui.menu_is_active = TRUE; // default: include menu
+ gui.menu_is_active = true; // default: include menu
# ifndef FEAT_GUI_GTK
gui.menu_height = MENU_DEFAULT_HEIGHT;
gui.menu_width = 0;
/*
* Create the GUI shell.
*/
- gui.in_use = TRUE; // Must be set after menus have been set up
+ gui.in_use = true; // Must be set after menus have been set up
if (gui_mch_init() == FAIL)
goto error;
// It was still there to make F10 work.
if (vim_strchr(p_go, GO_MENUS) == NULL)
{
- --gui.starting;
+ bool save_starting = gui.starting;
+
+ gui.starting = false;
gui_mch_enable_menu(FALSE);
- ++gui.starting;
+ gui.starting = save_starting;
gui_mch_update();
}
# endif
#endif
error:
- gui.in_use = FALSE;
+ gui.in_use = false;
clip_init(FALSE);
}
// don't free the fonts, it leads to a BUS error
// richard@whitequeen.com Jul 99
free_highlight_fonts();
- gui.in_use = FALSE;
+ gui.in_use = false;
gui_mch_exit(rc);
}
if (gui.col >= screen_Columns)
gui.col = screen_Columns - 1;
if (gui.cursor_row >= screen_Rows || gui.cursor_col >= screen_Columns)
- gui.cursor_is_valid = FALSE;
+ gui.cursor_is_valid = false;
}
/*
if (gui.row >= screen_Rows || gui.col >= screen_Columns)
return;
- gui.cursor_is_valid = TRUE;
+ gui.cursor_is_valid = true;
/*
* How the cursor is drawn depends on the current mode.
// Invalidate cursor if it was in this block
if ( gui.cursor_row >= row1 && gui.cursor_row <= row2
&& gui.cursor_col >= col1 && gui.cursor_col <= col2)
- gui.cursor_is_valid = FALSE;
+ gui.cursor_is_valid = false;
}
/*
case 'C': // Clear screen
clip_scroll_selection(9999);
gui_mch_clear_all();
- gui.cursor_is_valid = FALSE;
+ gui.cursor_is_valid = false;
force_scrollbar = TRUE;
break;
case 'M': // Move cursor
if (gui.cursor_row == gui.row
&& gui.cursor_col >= col
&& gui.cursor_col < col + len)
- gui.cursor_is_valid = FALSE;
+ gui.cursor_is_valid = false;
}
#ifdef FEAT_SIGN_ICONS
// Cursor_is_valid is reset when the cursor is undrawn, also reset it
// here in case it wasn't needed to undraw it.
- gui.cursor_is_valid = FALSE;
+ gui.cursor_is_valid = false;
}
void
&& gui.cursor_col <= gui.scroll_region_right)
{
if (gui.cursor_row < row + count)
- gui.cursor_is_valid = FALSE;
+ gui.cursor_is_valid = false;
else if (gui.cursor_row <= gui.scroll_region_bot)
gui.cursor_row -= count;
}
if (gui.cursor_row <= gui.scroll_region_bot - count)
gui.cursor_row += count;
else if (gui.cursor_row <= gui.scroll_region_bot)
- gui.cursor_is_valid = FALSE;
+ gui.cursor_is_valid = false;
}
}
}
p_go = temp;
}
}
- gui.menu_is_active = FALSE;
+ gui.menu_is_active = false;
#endif
for (i = 0; i < 3; i++)
- gui.which_scrollbars[i] = FALSE;
+ gui.which_scrollbars[i] = false;
for (p = p_go; *p; p++)
switch (*p)
{
case GO_LEFT:
- gui.which_scrollbars[SBAR_LEFT] = TRUE;
+ gui.which_scrollbars[SBAR_LEFT] = true;
break;
case GO_RIGHT:
- gui.which_scrollbars[SBAR_RIGHT] = TRUE;
+ gui.which_scrollbars[SBAR_RIGHT] = true;
break;
case GO_VLEFT:
if (win_hasvertsplit())
- gui.which_scrollbars[SBAR_LEFT] = TRUE;
+ gui.which_scrollbars[SBAR_LEFT] = true;
break;
case GO_VRIGHT:
if (win_hasvertsplit())
- gui.which_scrollbars[SBAR_RIGHT] = TRUE;
+ gui.which_scrollbars[SBAR_RIGHT] = true;
break;
case GO_BOT:
- gui.which_scrollbars[SBAR_BOTTOM] = TRUE;
+ gui.which_scrollbars[SBAR_BOTTOM] = true;
break;
#ifdef FEAT_GUI_DARKTHEME
case GO_DARKTHEME:
#endif
#ifdef FEAT_MENU
case GO_MENUS:
- gui.menu_is_active = TRUE;
+ gui.menu_is_active = true;
break;
#endif
case GO_GREY:
typedef struct Gui
{
- int in_focus; // Vim has input focus
- int in_use; // Is the GUI being used?
- int starting; // GUI will start in a little while
+ bool in_focus; // Vim has input focus
+ bool in_use; // Is the GUI being used?
+ bool starting; // GUI will start in a little while
bool shell_created; // Has the shell been created yet?
- int dying; // Is vim dying? Then output to terminal
- int dofork; // Use fork() when GUI is starting
+ bool dying; // Is vim dying? Then output to terminal
+ bool dofork; // Use fork() when GUI is starting
#ifdef GUI_MAY_SPAWN
- int dospawn; // Use spawn() when GUI is starting
+ bool dospawn; // Use spawn() when GUI is starting
#endif
int dragged_sb; // Which scrollbar being dragged, if any?
win_T *dragged_wp; // Which WIN's sb being dragged, if any?
- int pointer_hidden; // Is the mouse pointer hidden?
+ bool pointer_hidden; // Is the mouse pointer hidden?
int col; // Current cursor column in GUI display
int row; // Current cursor row in GUI display
int cursor_col; // Physical cursor column in GUI display
int cursor_row; // Physical cursor row in GUI display
- char cursor_is_valid; // There is a cursor at cursor_row/col
+ bool cursor_is_valid; // There is a cursor at cursor_row/col
int num_cols; // Number of columns
int num_rows; // Number of rows
int scroll_region_top; // Top (first) line of scroll region
int scrollbar_height; // Height of horizontal scrollbar
int left_sbar_x; // Calculated x coord for left scrollbar
int right_sbar_x; // Calculated x coord for right scrollbar
- int force_redraw; // Force a redraw even e.g. not resized
+ bool force_redraw; // Force a redraw even e.g. not resized
#ifdef FEAT_DIRECTX
- int directx_enabled; // DirectX (DirectWrite) rendering active
+ bool directx_enabled; // DirectX (DirectWrite) rendering active
#endif
#ifdef FEAT_MENU
int menu_height; // Height of the menu bar
int menu_width; // Width of the menu bar
# endif
- char menu_is_active; // TRUE if menu is present
+ bool menu_is_active; // true if menu is present
#endif
scrollbar_T bottom_sbar; // Bottom scrollbar
- int which_scrollbars[3];// Which scrollbar boxes are active?
+ bool which_scrollbars[3];// Which scrollbar boxes are active?
int prev_wrap; // For updating the horizontal scrollbar
int char_width; // Width of char cell in pixels
int char_height; // Height of char cell in pixels, includes
GuiFont ital_font; // Italic font
GuiFont boldital_font; // Bold-Italic font
#else
- int font_can_bold; // Whether norm_font supports bold weight.
+ bool font_can_bold; // Whether norm_font supports bold weight.
// The styled font variants are not used.
#endif
break;
#ifdef FEAT_NETBEANS_INTG
case ARG_NETBEANS:
- gui.dofork = FALSE; // don't fork() when starting GUI
+ gui.dofork = false; // don't fork() when starting GUI
netbeansArg = argv[i];
break;
#endif
// Only when the GUI can start.
if ((option->flags & ARG_NEEDS_GUI)
&& gui_mch_early_init_check(FALSE) == OK)
- gui.starting = TRUE;
+ gui.starting = true;
if (option->flags & ARG_KEEP)
++i;
q = mch_getenv((char_u *)"WAYLAND_DISPLAY");
if ((p == NULL || *p == NUL) && (q == NULL || *q == NUL))
{
- gui.dying = TRUE;
+ gui.dying = true;
if (give_message)
emsg(_((char *)e_cannot_open_display));
return FAIL;
// Don't use gtk_init() or gnome_init(), it exits on failure.
if (!gtk_init_check(&gui_argc, &gui_argv))
{
- gui.dying = TRUE;
+ gui.dying = true;
emsg(_((char *)e_cannot_open_display));
return FAIL;
}
G_CALLBACK(scroll_event), NULL);
// Pretend we don't have input focus, we will get an event if we do.
- gui.in_focus = FALSE;
+ gui.in_focus = false;
// Handle changes to the "Xft/DPI" setting.
{
PangoFont *plain_font;
PangoFont *bold_font;
- gui.font_can_bold = FALSE;
+ gui.font_can_bold = false;
plain_font = pango_context_load_font(gui.text_context, gui.norm_font);
gui_x11_callbacks(textArea, vimForm);
// Pretend we don't have input focus, we will get an event if we do.
- gui.in_focus = FALSE;
+ gui.in_focus = false;
}
/*
// scrolling such that the cursor ends up in the top-left character on
// the screen... But why? (Webb)
// It's probably fixed by disabling drawing the cursor while scrolling.
- // gui.cursor_is_valid = FALSE;
+ // gui.cursor_is_valid = false;
gui_clear_block(gui.scroll_region_bot - num_lines + 1,
gui.scroll_region_left,
#ifdef FEAT_NETBEANS_INTG
if (strncmp("-nb", argv[arg], 3) == 0)
{
- gui.dofork = FALSE; // don't fork() when starting GUI
+ gui.dofork = false; // don't fork() when starting GUI
netbeansArg = argv[arg];
mch_memmove(&argv[arg], &argv[arg + 1],
(--*argc - arg) * sizeof(char *));
#endif
if (app_context == NULL || gui.dpy == NULL)
{
- gui.dying = TRUE;
+ gui.dying = true;
emsg(_(e_cannot_open_display));
return FAIL;
}
// Check if the current executable file is for the GUI subsystem.
gui.starting = mch_is_gui_executable();
# elif defined(FEAT_GUI_MSWIN)
- gui.starting = TRUE;
+ gui.starting = true;
# endif
# ifdef FEAT_CLIENTSERVER
* :gui.
*/
# ifdef ALWAYS_USE_GUI
- gui.starting = TRUE;
+ gui.starting = true;
# else
# if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
/*
{
if (gui_init_check() == FAIL)
{
- gui.starting = FALSE;
+ gui.starting = false;
// When running "evim" or "gvim -y" we need the menus, exit if we
// don't have them.
#endif
#ifdef FEAT_GUI
- gui.dofork = TRUE; // default is to use fork()
+ gui.dofork = true; // default is to use fork()
#endif
/*
# ifdef FEAT_GUI
if (strstr(argv[i], "-wait") != 0)
// don't fork() when starting the GUI to edit files ourself
- gui.dofork = FALSE;
+ gui.dofork = false;
# endif
}
# if defined(FEAT_X11) && defined(FEAT_SOCKETSERVER)
|| TOLOWER_ASC(initstr[1]) == 'g'))
{
# ifdef FEAT_GUI
- gui.starting = TRUE;
+ gui.starting = true;
# endif
parmp->evim_mode = TRUE;
++initstr;
++initstr;
# endif
# ifdef GUI_MAY_SPAWN
- gui.dospawn = FALSE; // No need to spawn a new process.
+ gui.dospawn = false; // No need to spawn a new process.
# endif
}
# ifdef GUI_MAY_SPAWN
else
- gui.dospawn = TRUE; // Not "gvim". Need to spawn gvim.exe.
+ gui.dospawn = true; // Not "gvim". Need to spawn gvim.exe.
# endif
cmdline_width = Columns = 80; // need to init Columns
info_message = TRUE; // use mch_msg(), not mch_errmsg()
# if defined(FEAT_GUI) && !defined(ALWAYS_USE_GUI) && !defined(VIMDLL)
- gui.starting = FALSE; // not starting GUI, will exit
+ gui.starting = false; // not starting GUI, will exit
# endif
list_version();
msg_putchar('\n');
else if (STRNICMP(argv[0] + argv_idx, "nofork", 6) == 0)
{
# ifdef FEAT_GUI
- gui.dofork = FALSE; // don't fork() when starting GUI
+ gui.dofork = false; // don't fork() when starting GUI
# endif
}
else if (STRNICMP(argv[0] + argv_idx, "noplugin", 8) == 0)
case 'f': // "-f" GUI: run in foreground. Amiga: open
// window directly, not with newcli
# ifdef FEAT_GUI
- gui.dofork = FALSE; // don't fork() when starting GUI
+ gui.dofork = false; // don't fork() when starting GUI
# endif
break;
case 'h': // "-h" give help message
# ifdef FEAT_GUI_GNOME
// Tell usage() to exit for "gvim".
- gui.starting = FALSE;
+ gui.starting = false;
# endif
usage();
break;
case 'y': // "-y" easy mode
# ifdef FEAT_GUI
- gui.starting = TRUE; // start GUI a bit later
+ gui.starting = true; // start GUI a bit later
# endif
parmp->evim_mode = TRUE;
break;
case 'v': // "-v" Vi-mode (as if called "vi")
exmode_active = 0;
# if defined(FEAT_GUI) && !defined(VIMDLL)
- gui.starting = FALSE; // don't start GUI
+ gui.starting = false; // don't start GUI
# endif
break;
*/
# ifdef FEAT_GUI
if (term_is_gui((char_u *)argv[0]))
- gui.starting = TRUE; // start GUI a bit later
+ gui.starting = true; // start GUI a bit later
else
# endif
parmp->term = (char_u *)argv[0];
main_start_gui(void)
{
# ifdef FEAT_GUI
- gui.starting = TRUE; // start GUI a bit later
+ gui.starting = true; // start GUI a bit later
# else
mch_errmsg(_(e_gui_cannot_be_used_not_enabled_at_compile_time));
mch_errmsg("\n");
gui.in_use = mch_is_gui_executable();
#endif
#ifdef FEAT_GUI_MSWIN
- gui.starting = FALSE; // Needed to show as error.
+ gui.starting = false; // Needed to show as error.
#endif
init_longVersion();
if (gui.starting)
{
mch_msg("\n");
- gui.dofork = FALSE;
+ gui.dofork = false;
}
else
# endif
#ifdef FEAT_GUI
if (gui.in_use)
{
- gui.dying = TRUE;
+ gui.dying = true;
out_trash(); // trash any pending output
}
else
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 377,
/**/
376,
/**/