diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-06-26 05:38:18 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-06-26 05:38:18 +0200 |
commit | 0eda7ac7f897433c9d346743bf38fcd291673070 (patch) | |
tree | 90a05f07c0c73e33b1097fab8f73d57a019027df /src | |
parent | 51f53dfe17617792a0275b19f27b50f98b0db764 (diff) | |
download | vim-git-0eda7ac7f897433c9d346743bf38fcd291673070.tar.gz |
Change remaining HAVE_GTK2 to FEAT_GUI_GTK.
Diffstat (limited to 'src')
-rwxr-xr-x | src/auto/configure | 2 | ||||
-rw-r--r-- | src/config.h.in | 3 | ||||
-rw-r--r-- | src/configure.in | 1 | ||||
-rw-r--r-- | src/feature.h | 6 | ||||
-rw-r--r-- | src/getchar.c | 2 | ||||
-rw-r--r-- | src/globals.h | 4 | ||||
-rw-r--r-- | src/gui.c | 60 | ||||
-rw-r--r-- | src/gui.h | 12 | ||||
-rw-r--r-- | src/mbyte.c | 10 | ||||
-rw-r--r-- | src/message.c | 4 | ||||
-rw-r--r-- | src/os_unix.c | 2 | ||||
-rw-r--r-- | src/screen.c | 4 | ||||
-rw-r--r-- | src/syntax.c | 2 |
13 files changed, 53 insertions, 59 deletions
diff --git a/src/auto/configure b/src/auto/configure index 42e5ed3d3..9688efac1 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -7397,8 +7397,6 @@ $as_echo "no" >&6; } 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 diff --git a/src/config.h.in b/src/config.h.in index f6c4561ae..2ebd8df5b 100644 --- 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 diff --git a/src/configure.in b/src/configure.in index 043eb329e..b99bcb8c3 100644 --- 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) diff --git a/src/feature.h b/src/feature.h index 7a38b853d..e31e4630d 100644 --- 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 */ diff --git a/src/getchar.c b/src/getchar.c index 0d1995704..2718ec6aa 100644 --- 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. */ diff --git a/src/globals.h b/src/globals.h index 4192bd765..4b1bafe7d 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1396,7 +1396,7 @@ EXTERN char_u e_fontset[] INIT(= N_("E234: Unknown fontset: %s")); || 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_("E359: Screen mode setting not supported" #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")); @@ -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_display, direction) 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_display, direction) 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_display, direction) 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_display, direction) 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, back) 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, back) 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, back) 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, back) 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, back) /* * 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, back) } # 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, flags) { 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, flags) { 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, flags) 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_dragging) 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 @@ -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 */ diff --git a/src/mbyte.c b/src/mbyte.c index 1eeede30b..939173ec3 100644 --- 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 */ +# endif /* !FEAT_GUI_GTK */ -# if defined(HAVE_GTK2) || defined(PROTO) +# if defined(FEAT_GUI_GTK) || defined(PROTO) int preedit_get_status(void) { diff --git a/src/message.c b/src/message.c index e29f5f8fe..f234a9db2 100644 --- a/src/message.c +++ b/src/message.c @@ -3778,7 +3778,7 @@ do_browse(flags, title, dflt, ext, initdir, filter, buf) 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, initdir, filter, buf) * 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)) diff --git a/src/os_unix.c b/src/os_unix.c index cb323c80f..42009e5d8 100644 --- 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 diff --git a/src/screen.c b/src/screen.c index f2108be23..dddb0719f 100644 --- 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); diff --git a/src/syntax.c b/src/syntax.c index 7d96febb6..7df00aaa5 100644 --- 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); |