changeset 2277:f42e0b5ff9e9 vim73

Change remaining HAVE_GTK2 to FEAT_GUI_GTK.
author Bram Moolenaar <bram@vim.org>
date Sat, 26 Jun 2010 05:38:18 +0200
parents ebabd8a8b714
children 0b3be97064e5
files src/auto/configure src/config.h.in src/configure.in src/feature.h src/getchar.c src/globals.h src/gui.c src/gui.h src/mbyte.c src/message.c src/os_unix.c src/screen.c src/syntax.c
diffstat 13 files changed, 54 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -7397,8 +7397,6 @@ fi
     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
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -366,9 +366,6 @@
 /* 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
 
--- a/src/configure.in
+++ b/src/configure.in
@@ -1671,7 +1671,6 @@ if test -z "$SKIP_GTK2"; then
     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)
--- a/src/feature.h
+++ b/src/feature.h
@@ -640,7 +640,7 @@
  * 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
@@ -693,7 +693,7 @@
 # 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)
@@ -710,7 +710,7 @@
  * +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 */
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1605,7 +1605,7 @@ vgetc()
 		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. */
--- a/src/globals.h
+++ b/src/globals.h
@@ -1396,7 +1396,7 @@ EXTERN char_u e_fontset[]	INIT(= N_("E23
 	|| 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"));
@@ -1508,7 +1508,7 @@ EXTERN char_u e_screenmode[]	INIT(= N_("
 #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"));
--- a/src/gui.c
+++ b/src/gui.c
@@ -13,14 +13,14 @@
 /* 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));
@@ -250,7 +250,7 @@ gui_init_check()
     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;
@@ -260,7 +260,7 @@ gui_init_check()
 #endif
 
 #ifdef FEAT_MENU
-# ifndef HAVE_GTK2
+# ifndef FEAT_GUI_GTK
 #  ifdef FONTSET_ALWAYS
     gui.menu_fontset = NOFONTSET;
 #  else
@@ -709,7 +709,7 @@ gui_init_font(font_list, fontset)
 		 * 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)
@@ -736,7 +736,7 @@ gui_init_font(font_list, fontset)
 
     if (ret == OK)
     {
-#ifndef HAVE_GTK2
+#ifndef FEAT_GUI_GTK
 	/* Set normal font as current font */
 # ifdef FEAT_XFONTSET
 	if (gui.fontset != NOFONTSET)
@@ -758,7 +758,7 @@ gui_init_font(font_list, fontset)
 }
 
 #if defined(FEAT_MBYTE) || defined(PROTO)
-# ifndef HAVE_GTK2
+# ifndef FEAT_GUI_GTK
 /*
  * Try setting 'guifontwide' to a font twice as wide as "name".
  */
@@ -806,7 +806,7 @@ set_guifontwide(name)
 	}
     }
 }
-# endif /* !HAVE_GTK2 */
+# endif /* !FEAT_GUI_GTK */
 
 /*
  * Get the font for 'guifontwide'.
@@ -837,7 +837,7 @@ gui_get_wide_font()
     }
 
     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))
@@ -954,7 +954,7 @@ gui_update_cursor(force, clear_selection
 		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()
@@ -1183,7 +1183,7 @@ gui_position_components(total_width)
 			      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
 			      );
@@ -1314,7 +1314,7 @@ again:
 
     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
 
@@ -1381,7 +1381,7 @@ gui_set_shellsize(mustset, fit_to_displa
     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
@@ -1429,7 +1429,7 @@ gui_set_shellsize(mustset, fit_to_displa
 	    if (Columns < MIN_COLUMNS)
 		Columns = MIN_COLUMNS;
 	    width = Columns * gui.char_width + base_width;
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
 	    ++did_adjust;
 #endif
 	}
@@ -1438,11 +1438,11 @@ gui_set_shellsize(mustset, fit_to_displa
 	    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 */
@@ -1458,7 +1458,7 @@ gui_set_shellsize(mustset, fit_to_displa
     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
@@ -1918,7 +1918,7 @@ gui_screenchar(off, flags, fg, bg, back)
 #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
@@ -1992,7 +1992,7 @@ gui_screenstr(off, len, flags, fg, bg, b
 				 flags, fg, bg, back);
     }
 }
-#endif /* HAVE_GTK2 */
+#endif /* FEAT_GUI_GTK */
 
 /*
  * Output the given string at the current cursor position.  If the string is
@@ -2020,7 +2020,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg,
     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;
@@ -2074,7 +2074,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg,
 	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;
@@ -2188,7 +2188,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg,
     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)
@@ -2217,7 +2217,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg,
     /*
      * 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
@@ -2340,7 +2340,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg,
 	}
 # endif
     }
-#endif /* !HAVE_GTK2 */
+#endif /* !FEAT_GUI_GTK */
 
     if (!(flags & (GUI_MON_IS_CURSOR | GUI_MON_TRS_CURSOR)))
 	gui.col = col + len;
@@ -2499,7 +2499,7 @@ gui_redraw_block(row1, col1, row2, col2,
 	{
 	    if (ScreenLines[off + col1] == 0)
 		--col1;
-# ifdef HAVE_GTK2
+# ifdef FEAT_GUI_GTK
 	    if (col2 + 1 < Columns && ScreenLines[off + col2 + 1] == 0)
 		++col2;
 # endif
@@ -2524,7 +2524,7 @@ gui_redraw_block(row1, col1, row2, col2,
 	{
 	    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 */
@@ -2545,7 +2545,7 @@ gui_redraw_block(row1, col1, row2, col2,
 	    else
 #endif
 	    {
-#ifdef HAVE_GTK2
+#ifdef FEAT_GUI_GTK
 		for (idx = 0; idx < len; ++idx)
 		{
 		    if (enc_utf8 && ScreenLines[off + idx] == 0)
@@ -3089,7 +3089,7 @@ button_set:
      * 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
 }
@@ -3739,7 +3739,7 @@ gui_drag_scrollbar(sb, value, still_drag
     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;
@@ -4832,7 +4832,7 @@ gui_find_bitmap(name, buffer, ext)
     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
--- a/src/gui.h
+++ b/src/gui.h
@@ -75,7 +75,7 @@
  * 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
 
@@ -151,7 +151,7 @@
 #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) */
@@ -310,7 +310,7 @@ typedef struct Gui
     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 */
@@ -319,7 +319,7 @@ typedef struct Gui
 				     * 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
@@ -508,7 +508,7 @@ typedef enum
 # 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
@@ -549,4 +549,4 @@ typedef enum
 # 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 */
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -3482,7 +3482,7 @@ theend:
     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.
@@ -4223,7 +4223,7 @@ init_preedit_start_col(void)
 }
 # 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;
@@ -5058,7 +5058,7 @@ im_get_status(void)
     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 */
@@ -5627,9 +5627,9 @@ im_get_status()
     return xim_has_focus;
 }
 
-# endif /* !HAVE_GTK2 */
-
-# if defined(HAVE_GTK2) || defined(PROTO)
+# endif /* !FEAT_GUI_GTK */
+
+# if defined(FEAT_GUI_GTK) || defined(PROTO)
     int
 preedit_get_status(void)
 {
--- a/src/message.c
+++ b/src/message.c
@@ -3778,7 +3778,7 @@ do_browse(flags, title, dflt, ext, initd
 	    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
@@ -3786,7 +3786,7 @@ do_browse(flags, title, dflt, ext, initd
 	     * 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))
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -2991,7 +2991,7 @@ mch_free_mem()
     }
 #  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
--- a/src/screen.c
+++ b/src/screen.c
@@ -9298,14 +9298,14 @@ showmode()
 					&& 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);
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -9430,7 +9430,7 @@ free_highlight_fonts()
 # 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);