fi
fi
if test "x$GUITYPE" = "xGTK"; then
- $as_echo "#define HAVE_GTK2 1" >>confdefs.h
-
if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
|| test "0$gtk_minor_version" -ge 2; then
$as_echo "#define HAVE_GTK_MULTIHEAD 1" >>confdefs.h
/* Define if you use KDE and want KDE Toolbar support. */
#undef FEAT_KDETOOLBAR
-/* Define if GTK+ 2 is available. */
-#undef HAVE_GTK2
-
/* Define if GTK+ multihead support is available (requires GTK+ >= 2.1.1). */
#undef HAVE_GTK_MULTIHEAD
fi
fi
if test "x$GUITYPE" = "xGTK"; then
- AC_DEFINE(HAVE_GTK2)
if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
|| test "0$gtk_minor_version" -ge 2; then
AC_DEFINE(HAVE_GTK_MULTIHEAD)
* Disabled for EBCDIC:
* Multibyte support doesn't work on z/OS Unix currently.
*/
-#if (defined(FEAT_BIG) || defined(HAVE_GTK2) || defined(FEAT_ARABIC)) \
+#if (defined(FEAT_BIG) || defined(FEAT_GUI_GTK) || defined(FEAT_ARABIC)) \
&& !defined(FEAT_MBYTE) && !defined(WIN16) \
&& SIZEOF_INT >= 4 && !defined(EBCDIC)
# define FEAT_MBYTE
# define ESC_CHG_TO_ENG_MODE /* if defined, when ESC pressed,
* turn to english mode
*/
-# if !defined(FEAT_XFONTSET) && defined(HAVE_X11) && !defined(HAVE_GTK2)
+# if !defined(FEAT_XFONTSET) && defined(HAVE_X11) && !defined(FEAT_GUI_GTK)
# define FEAT_XFONTSET /* Hangul input requires xfontset */
# endif
# if defined(FEAT_XIM) && !defined(LINT)
* +xfontset X fontset support. For outputting wide characters.
*/
#ifndef FEAT_XFONTSET
-# if defined(FEAT_MBYTE) && defined(HAVE_X11) && !defined(HAVE_GTK2)
+# if defined(FEAT_MBYTE) && defined(HAVE_X11) && !defined(FEAT_GUI_GTK)
# define FEAT_XFONTSET
# else
/* # define FEAT_XFONTSET */
continue;
}
#endif
-#if defined(FEAT_GUI) && defined(HAVE_GTK2) && defined(FEAT_MENU)
+#if defined(FEAT_GUI) && defined(FEAT_GUI_GTK) && defined(FEAT_MENU)
/* GTK: <F10> normally selects the menu, but it's passed until
* here to allow mapping it. Intercept and invoke the GTK
* behavior if it's not mapped. */
|| defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MSWIN)
EXTERN char_u e_font[] INIT(= N_("E235: Unknown font: %s"));
#endif
-#if defined(FEAT_GUI_X11) && !defined(HAVE_GTK2)
+#if defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK)
EXTERN char_u e_fontwidth[] INIT(= N_("E236: Font \"%s\" is not fixed-width"));
#endif
EXTERN char_u e_internal[] INIT(= N_("E473: Internal error"));
#endif
EXTERN char_u e_scroll[] INIT(= N_("E49: Invalid scroll size"));
EXTERN char_u e_shellempty[] INIT(= N_("E91: 'shell' option is empty"));
-#if defined(FEAT_SIGN_ICONS) && !defined(HAVE_GTK2)
+#if defined(FEAT_SIGN_ICONS) && !defined(FEAT_GUI_GTK)
EXTERN char_u e_signdata[] INIT(= N_("E255: Couldn't read in sign data!"));
#endif
EXTERN char_u e_swapclose[] INIT(= N_("E72: Close error on swap file"));
/* Structure containing all the GUI information */
gui_T gui;
-#if defined(FEAT_MBYTE) && !defined(HAVE_GTK2)
+#if defined(FEAT_MBYTE) && !defined(FEAT_GUI_GTK)
static void set_guifontwide __ARGS((char_u *font_name));
#endif
static void gui_check_pos __ARGS((void));
static void gui_position_components __ARGS((int));
static void gui_outstr __ARGS((char_u *, int));
static int gui_screenchar __ARGS((int off, int flags, guicolor_T fg, guicolor_T bg, int back));
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
static int gui_screenstr __ARGS((int off, int len, int flags, guicolor_T fg, guicolor_T bg, int back));
#endif
static void gui_delete_lines __ARGS((int row, int count));
gui.border_width = 0;
gui.norm_font = NOFONT;
-#ifndef HAVE_GTK2
+#ifndef FEAT_GUI_GTK
gui.bold_font = NOFONT;
gui.ital_font = NOFONT;
gui.boldital_font = NOFONT;
#endif
#ifdef FEAT_MENU
-# ifndef HAVE_GTK2
+# ifndef FEAT_GUI_GTK
# ifdef FONTSET_ALWAYS
gui.menu_fontset = NOFONTSET;
# else
* longer be used! */
if (gui_mch_init_font(font_name, FALSE) == OK)
{
-#if defined(FEAT_MBYTE) && !defined(HAVE_GTK2)
+#if defined(FEAT_MBYTE) && !defined(FEAT_GUI_GTK)
/* If it's a Unicode font, try setting 'guifontwide' to a
* similar double-width font. */
if ((p_guifontwide == NULL || *p_guifontwide == NUL)
if (ret == OK)
{
-#ifndef HAVE_GTK2
+#ifndef FEAT_GUI_GTK
/* Set normal font as current font */
# ifdef FEAT_XFONTSET
if (gui.fontset != NOFONTSET)
}
#if defined(FEAT_MBYTE) || defined(PROTO)
-# ifndef HAVE_GTK2
+# ifndef FEAT_GUI_GTK
/*
* Try setting 'guifontwide' to a font twice as wide as "name".
*/
}
}
}
-# endif /* !HAVE_GTK2 */
+# endif /* !FEAT_GUI_GTK */
/*
* Get the font for 'guifontwide'.
}
gui_mch_free_font(gui.wide_font);
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
/* Avoid unnecessary overhead if 'guifontwide' is equal to 'guifont'. */
if (font != NOFONT && gui.norm_font != NOFONT
&& pango_font_description_equal(font, gui.norm_font))
guicolor_T fg, bg;
if (
-# if defined(HAVE_GTK2) && !defined(FEAT_HANGULIN)
+# if defined(FEAT_GUI_GTK) && !defined(FEAT_HANGULIN)
preedit_get_status()
# else
im_get_status()
text_area_y,
text_area_width,
text_area_height
-#if defined(FEAT_XIM) && !defined(HAVE_GTK2)
+#if defined(FEAT_XIM) && !defined(FEAT_GUI_GTK)
+ xim_get_status_area_height()
#endif
);
gui_update_scrollbars(TRUE);
gui_update_cursor(FALSE, TRUE);
-#if defined(FEAT_XIM) && !defined(HAVE_GTK2)
+#if defined(FEAT_XIM) && !defined(FEAT_GUI_GTK)
xim_set_status_area();
#endif
int min_height;
int screen_w;
int screen_h;
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
int un_maximize = mustset;
int did_adjust = 0;
#endif
if (Columns < MIN_COLUMNS)
Columns = MIN_COLUMNS;
width = Columns * gui.char_width + base_width;
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
++did_adjust;
#endif
}
Rows = (screen_h - base_height) / gui.char_height;
check_shellsize();
height = Rows * gui.char_height + base_height;
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
++did_adjust;
#endif
}
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
if (did_adjust == 2 || (width + gui.char_width >= screen_w
&& height + gui.char_height >= screen_h))
/* don't unmaximize if at maximum size */
min_height += tabline_height() * gui.char_height;
#endif
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
if (un_maximize)
{
/* If the window size is smaller than the screen unmaximize the
#endif
}
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
/*
* Output the string at the given screen position. This is used in place
* of gui_screenchar() where possible because Pango needs as much context
flags, fg, bg, back);
}
}
-#endif /* HAVE_GTK2 */
+#endif /* FEAT_GUI_GTK */
/*
* Output the given string at the current cursor position. If the string is
guicolor_T fg_color;
guicolor_T bg_color;
guicolor_T sp_color;
-#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2)
+#if !defined(MSWIN16_FASTTEXT) && !defined(FEAT_GUI_GTK)
GuiFont font = NOFONT;
# ifdef FEAT_XFONTSET
GuiFontset fontset = NOFONTSET;
highlight_mask = gui.highlight_mask;
hl_mask_todo = highlight_mask;
-#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2)
+#if !defined(MSWIN16_FASTTEXT) && !defined(FEAT_GUI_GTK)
/* Set the font */
if (aep != NULL && aep->ae_u.gui.font != NOFONT)
font = aep->ae_u.gui.font;
if (back != 0 && ((draw_flags & DRAW_BOLD) || (highlight_mask & HL_ITALIC)))
return FAIL;
-#if defined(RISCOS) || defined(HAVE_GTK2)
+#if defined(RISCOS) || defined(FEAT_GUI_GTK)
/* If there's no italic font, then fake it.
* For GTK2, we don't need a different font for italic style. */
if (hl_mask_todo & HL_ITALIC)
/*
* Draw the text.
*/
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
/* The value returned is the length in display cells */
len = gui_gtk2_draw_string(gui.row, col, s, len, draw_flags);
#else
}
# endif
}
-#endif /* !HAVE_GTK2 */
+#endif /* !FEAT_GUI_GTK */
if (!(flags & (GUI_MON_IS_CURSOR | GUI_MON_TRS_CURSOR)))
gui.col = col + len;
{
if (ScreenLines[off + col1] == 0)
--col1;
-# ifdef HAVE_GTK2
+# ifdef FEAT_GUI_GTK
if (col2 + 1 < Columns && ScreenLines[off + col2 + 1] == 0)
++col2;
# endif
{
first_attr = ScreenAttrs[off];
gui.highlight_mask = first_attr;
-#if defined(FEAT_MBYTE) && !defined(HAVE_GTK2)
+#if defined(FEAT_MBYTE) && !defined(FEAT_GUI_GTK)
if (enc_utf8 && ScreenLinesUC[off] != 0)
{
/* output multi-byte character separately */
else
#endif
{
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
for (idx = 0; idx < len; ++idx)
{
if (enc_utf8 && ScreenLines[off + idx] == 0)
* We need to make sure this is cleared since Athena doesn't tell us when
* he is done dragging. Neither does GTK+ 2 -- at least for now.
*/
-#if defined(FEAT_GUI_ATHENA) || defined(HAVE_GTK2)
+#if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK)
gui.dragged_sb = SBAR_NONE;
#endif
}
else
{
gui.dragged_sb = SBAR_NONE;
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
/* Keep the "dragged_wp" value until after the scrolling, for when the
* moust button is released. GTK2 doesn't send the button-up event. */
gui.dragged_wp = NULL;
return OK;
}
-# if !defined(HAVE_GTK2) || defined(PROTO)
+# if !defined(FEAT_GUI_GTK) || defined(PROTO)
/*
* Given the name of the "icon=" argument, try finding the bitmap file for the
* icon. If it is an absolute path name, use it as it is. Otherwise append
* On some systems scrolling needs to be done right away instead of in the
* main loop.
*/
-#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MAC) || defined(HAVE_GTK2)
+#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MAC) || defined(FEAT_GUI_GTK)
# define USE_ON_FLY_SCROLL
#endif
#define DRAW_BOLD 0x02 /* draw bold text */
#define DRAW_UNDERL 0x04 /* draw underline text */
#define DRAW_UNDERC 0x08 /* draw undercurl text */
-#if defined(RISCOS) || defined(HAVE_GTK2)
+#if defined(RISCOS) || defined(FEAT_GUI_GTK)
# define DRAW_ITALIC 0x10 /* draw italic text */
#endif
#define DRAW_CURSOR 0x20 /* drawing block cursor (win32) */
int border_offset; /* Total pixel offset for all borders */
GuiFont norm_font; /* Normal font */
-#ifndef HAVE_GTK2
+#ifndef FEAT_GUI_GTK
GuiFont bold_font; /* Bold font */
GuiFont ital_font; /* Italic font */
GuiFont boldital_font; /* Bold-Italic font */
* The styled font variants are not used. */
#endif
-#if defined(FEAT_MENU) && !defined(HAVE_GTK2)
+#if defined(FEAT_MENU) && !defined(FEAT_GUI_GTK)
# ifdef FONTSET_ALWAYS
GuiFontset menu_fontset; /* set of fonts for multi-byte chars */
# else
# define FRD_MATCH_CASE 0x10 /* match case */
#endif
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
/*
* Convenience macros to convert from 'encoding' to 'termencoding' and
* vice versa. If no conversion is necessary the passed-in pointer is
# define CONVERT_TO_UTF8_FREE(String) ((String) = (char_u *)NULL)
# define CONVERT_FROM_UTF8(String) (String)
# define CONVERT_FROM_UTF8_FREE(String) ((String) = (char_u *)NULL)
-#endif /* HAVE_GTK2 */
+#endif /* FEAT_GUI_GTK */
convert_setup(&vimconv, NULL, NULL);
}
-#if defined(HAVE_GTK2) || defined(PROTO)
+#if defined(FEAT_GUI_GTK) || defined(PROTO)
/*
* Return TRUE if string "s" is a valid utf-8 string.
* When "end" is NULL stop at the first NUL.
}
# endif
-# if defined(HAVE_GTK2) && !defined(PROTO)
+# if defined(FEAT_GUI_GTK) && !defined(PROTO)
static int im_is_active = FALSE; /* IM is enabled for current mode */
static int preedit_is_active = FALSE;
return im_is_active;
}
-# else /* !HAVE_GTK2 */
+# else /* !FEAT_GUI_GTK */
static int xim_is_active = FALSE; /* XIM should be active in the current
mode */
return xim_has_focus;
}
-# endif /* !HAVE_GTK2 */
+# endif /* !FEAT_GUI_GTK */
-# if defined(HAVE_GTK2) || defined(PROTO)
+# if defined(FEAT_GUI_GTK) || defined(PROTO)
int
preedit_get_status(void)
{
filter = BROWSE_FILTER_DEFAULT;
if (flags & BROWSE_DIR)
{
-# if defined(HAVE_GTK2) || defined(WIN3264)
+# if defined(FEAT_GUI_GTK) || defined(WIN3264)
/* For systems that have a directory dialog. */
fname = gui_mch_browsedir(title, initdir);
# else
* remove the file name. */
fname = gui_mch_browse(0, title, dflt, ext, initdir, (char_u *)"");
# endif
-# if !defined(HAVE_GTK2)
+# if !defined(FEAT_GUI_GTK)
/* Win32 adds a dummy file name, others return an arbitrary file
* name. GTK+ 2 returns only the directory, */
if (fname != NULL && *fname != NUL && !mch_isdir(fname))
}
# endif
# endif
-# if defined(FEAT_X11) && (!defined(FEAT_GUI_GTK) || defined(HAVE_GTK2))
+# if defined(FEAT_X11)
if (x11_display != NULL
# ifdef FEAT_XCLIPBOARD
&& x11_display != xterm_dpy
&& curbuf->b_p_iminsert == B_IMODE_IM)
# else
if (
-# ifdef HAVE_GTK2
+# ifdef FEAT_GUI_GTK
preedit_get_status()
# else
im_get_status()
# endif
)
# endif
-# ifdef HAVE_GTK2 /* most of the time, it's not XIM being used */
+# ifdef FEAT_GUI_GTK /* most of the time, it's not XIM being used */
MSG_PUTS_ATTR(" IM", attr);
# else
MSG_PUTS_ATTR(" XIM", attr);
# ifdef FEAT_XFONTSET
gui_mch_free_fontset(gui.fontset);
# endif
-# ifndef HAVE_GTK2
+# ifndef FEAT_GUI_GTK
gui_mch_free_font(gui.bold_font);
gui_mch_free_font(gui.ital_font);
gui_mch_free_font(gui.boldital_font);