Permalink
Browse files

Remove the old and not well supported GTK 1 code. (James Vega)

--HG--
branch : vim73
  • Loading branch information...
1 parent 50e21c4 commit b65daa26c36381a1d9fb1eabe2da1a98d68e1cb4 @brammool brammool committed Jun 25, 2010
Showing with 237 additions and 4,358 deletions.
  1. +2 −3 runtime/doc/todo.txt
  2. +3 −7 src/Makefile
  3. +28 −444 src/auto/configure
  4. +37 −182 src/configure.in
  5. +0 −2 src/eval.c
  6. +1 −7 src/globals.h
  7. +2 −2 src/gui.c
  8. +0 −14 src/gui.h
  9. +5 −58 src/gui_beval.c
  10. +11 −1,228 src/gui_gtk.c
  11. +0 −90 src/gui_gtk_f.c
  12. +0 −1 src/gui_gtk_f.h
  13. +31 −1,319 src/gui_gtk_x11.c
  14. +0 −2 src/main.c
  15. +111 −978 src/mbyte.c
  16. +4 −4 src/option.c
  17. +2 −2 src/option.h
  18. +0 −1 src/os_unix.c
  19. +0 −1 src/proto/gui_gtk.pro
  20. +0 −5 src/proto/gui_gtk_x11.pro
  21. +0 −8 src/version.c
View
5 runtime/doc/todo.txt
@@ -1086,8 +1086,8 @@ restored. (Luc St-Louis)
Vim 7.3:
- using NSIS 2.46: install on Windows 7 works, but no "Edit with Vim" menu.
- Use register_shell_extension()? (George Reilly, 2010 May 26)
- Ron's version: http://dev.ronware.org/p/vim/finfo?name=gvim.nsi
+ Use register_shell_extension()?
+ Patch from Geoffrey Reilly, 2010 Jun 22
- Patch for conceal feature from Vince, 2010 June 16.
Needs some more testing.
- undofile: keep markers where the file was written/read, so that it's easy to
@@ -1097,7 +1097,6 @@ Vim 7.3:
Show "file saved" marker in :undolist
- Function to get undo tree: undotree(). List of lists. Each entry is a
dictionary: {'nr': 2, 'time': 1234, 'saved': 1}
-- Remove support for GTK 1? Patch by James Vega, Jun 11 (removes too much).
Patches to include:
- Patch for Lisp support with ECL (Mikael Jansson, 2008 Oct 25)
- Minor patches from Dominique Pelle, 2010 May 15
View
10 src/Makefile
@@ -325,9 +325,7 @@ CClink = $(CC)
# Uncomment one of these lines if you have that GUI but don't want to use it.
# The automatic check will use another one that can be found.
# Gnome is disabled by default, it may cause trouble.
-#CONF_OPT_GUI = --disable-gtk-check
#CONF_OPT_GUI = --disable-gtk2-check
-#CONF_OPT_GUI = --enable-gnome-check
#CONF_OPT_GUI = --enable-gnome2-check
#CONF_OPT_GUI = --disable-motif-check
#CONF_OPT_GUI = --disable-athena-check
@@ -339,18 +337,16 @@ CClink = $(CC)
#
# GTK versions that are known not to work 100% are rejected.
# Use "--disable-gtktest" to accept them anyway.
+# Only GTK 2 is supported, for GTK 1 use Vim 7.2.
#
# GNOME means GTK with Gnome support. If using GTK and --enable-gnome-check
# is used then GNOME will automatically be used if it is found. If you have
# GNOME, but do not want to use it (e.g., want a GTK-only version), then use
# --enable-gui=gtk or leave out --enable-gnome-check.
#
# If the selected GUI isn't found, the GUI is disabled automatically
-#CONF_OPT_GUI = --enable-gui=gtk
-#CONF_OPT_GUI = --enable-gui=gtk --disable-gtktest
#CONF_OPT_GUI = --enable-gui=gtk2
#CONF_OPT_GUI = --enable-gui=gtk2 --disable-gtktest
-#CONF_OPT_GUI = --enable-gui=gnome
#CONF_OPT_GUI = --enable-gui=gnome2
#CONF_OPT_GUI = --enable-gui=gnome2 --disable-gtktest
#CONF_OPT_GUI = --enable-gui=motif
@@ -396,8 +392,8 @@ CClink = $(CC)
# RUBY
# Uncomment this when you want to include the Ruby interface.
# Note: you need the development package (e.g., ruby1.9.1-dev on Ubuntu).
-# CONF_OPT_RUBY = --enable-rubyinterp
-# CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1
+#CONF_OPT_RUBY = --enable-rubyinterp
+#CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1
# MZSCHEME
# Uncomment this when you want to include the MzScheme interface.
View
472 src/auto/configure
@@ -607,16 +607,13 @@ GUI_LIB_LOC
GUI_INC_LOC
NARROW_PROTO
MOTIF_LIBNAME
-GNOME_CONFIG
GNOME_INCLUDEDIR
GNOME_LIBDIR
GNOME_LIBS
GTK_LIBNAME
GTK_LIBS
GTK_CFLAGS
PKG_CONFIG
-GTK12_CONFIG
-GTK_CONFIG
X_LIB
X_EXTRA_LIBS
X_LIBS
@@ -765,15 +762,12 @@ enable_xim
enable_fontset
with_x
enable_gui
-enable_gtk_check
enable_gtk2_check
enable_gnome_check
enable_motif_check
enable_athena_check
enable_nextaw_check
enable_carbon_check
-with_gtk_prefix
-with_gtk_exec_prefix
enable_gtktest
with_gnome_includes
with_gnome_libs
@@ -1425,9 +1419,8 @@ Optional Features:
--enable-hangulinput Include Hangul input support.
--enable-xim Include XIM input support.
--enable-fontset Include X fontset output support.
- --enable-gui=OPTS X11 GUI default=auto OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon
- --enable-gtk-check If auto-select GUI, check for GTK default=yes
- --enable-gtk2-check If GTK GUI, check for GTK+ 2 default=yes
+ --enable-gui=OPTS X11 GUI default=auto OPTS=auto/no/gtk2/gnome2/motif/athena/neXtaw/photon/carbon
+ --enable-gtk2-check If auto-select GUI, check for GTK+ 2 default=yes
--enable-gnome-check If GTK GUI, check for GNOME default=no
--enable-motif-check If auto-select GUI, check for Motif default=yes
--enable-athena-check If auto-select GUI, check for Athena default=yes
@@ -1459,8 +1452,6 @@ Optional Packages:
--with-tclsh=PATH which tclsh to use (default: tclsh8.0)
--with-ruby-command=RUBY name of the Ruby command (default: ruby)
--with-x use the X Window System
- --with-gtk-prefix=PFX Prefix where GTK is installed (optional)
- --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)
--with-gnome-includes=DIR Specify location of GNOME headers
--with-gnome-libs=DIR Specify location of GNOME libs
--with-gnome Specify prefix for GNOME files
@@ -4204,7 +4195,7 @@ fi
if test "x$CARBON" = "xyes"; then
- if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk -a "X$enable_gui" != Xgtk2; then
+ if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk2; then
with_x=no
fi
fi
@@ -7004,7 +6995,6 @@ fi
enable_gui_canon=`echo "_$enable_gui" | \
sed 's/[ _+-]//g;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
-SKIP_GTK=YES
SKIP_GTK2=YES
SKIP_GNOME=YES
SKIP_MOTIF=YES
@@ -7055,28 +7045,18 @@ else
$as_echo "no GUI support" >&6; } ;;
yes|""|auto) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes/auto - automatic GUI support" >&5
$as_echo "yes/auto - automatic GUI support" >&6; }
- SKIP_GTK=
SKIP_GTK2=
SKIP_GNOME=
SKIP_MOTIF=
SKIP_ATHENA=
SKIP_NEXTAW=
SKIP_CARBON=;;
- gtk) { $as_echo "$as_me:${as_lineno-$LINENO}: result: GTK+ 1.x GUI support" >&5
-$as_echo "GTK+ 1.x GUI support" >&6; }
- SKIP_GTK=;;
gtk2) { $as_echo "$as_me:${as_lineno-$LINENO}: result: GTK+ 2.x GUI support" >&5
$as_echo "GTK+ 2.x GUI support" >&6; }
- SKIP_GTK=
SKIP_GTK2=;;
- gnome) { $as_echo "$as_me:${as_lineno-$LINENO}: result: GNOME 1.x GUI support" >&5
-$as_echo "GNOME 1.x GUI support" >&6; }
- SKIP_GNOME=
- SKIP_GTK=;;
gnome2) { $as_echo "$as_me:${as_lineno-$LINENO}: result: GNOME 2.x GUI support" >&5
$as_echo "GNOME 2.x GUI support" >&6; }
SKIP_GNOME=
- SKIP_GTK=
SKIP_GTK2=;;
motif) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Motif GUI support" >&5
$as_echo "Motif GUI support" >&6; }
@@ -7093,24 +7073,6 @@ $as_echo "Sorry, $enable_gui GUI is not supported" >&6; } ;;
fi
-if test "x$SKIP_GTK" != "xYES" -a "$enable_gui_canon" != "gtk" -a "$enable_gui_canon" != "gtk2"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for GTK" >&5
-$as_echo_n "checking whether or not to look for GTK... " >&6; }
- # Check whether --enable-gtk-check was given.
-if test "${enable_gtk_check+set}" = set; then :
- enableval=$enable_gtk_check;
-else
- enable_gtk_check="yes"
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_check" >&5
-$as_echo "$enable_gtk_check" >&6; }
- if test "x$enable_gtk_check" = "xno"; then
- SKIP_GTK=YES
- SKIP_GNOME=YES
- fi
-fi
-
if test "x$SKIP_GTK2" != "xYES" -a "$enable_gui_canon" != "gtk2" \
-a "$enable_gui_canon" != "gnome2"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for GTK+ 2" >&5
@@ -7126,11 +7088,11 @@ fi
$as_echo "$enable_gtk2_check" >&6; }
if test "x$enable_gtk2_check" = "xno"; then
SKIP_GTK2=YES
+ SKIP_GNOME=YES
fi
fi
-if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome" \
- -a "$enable_gui_canon" != "gnome2"; then
+if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome2"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not to look for GNOME" >&5
$as_echo_n "checking whether or not to look for GNOME... " >&6; }
# Check whether --enable-gnome-check was given.
@@ -7232,8 +7194,7 @@ $as_echo "yes" >&6; };
datadir='${prefix}/Vim.app/Contents/Resources'
- SKIP_GTK=YES;
- SKIP_GTK2=YES;
+ SKIP_GTK2=YES;
SKIP_GNOME=YES;
SKIP_MOTIF=YES;
SKIP_ATHENA=YES;
@@ -7249,34 +7210,7 @@ fi
-
-if test -z "$SKIP_GTK"; then
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-gtk-prefix argument" >&5
-$as_echo_n "checking --with-gtk-prefix argument... " >&6; }
-
-# Check whether --with-gtk-prefix was given.
-if test "${with_gtk_prefix+set}" = set; then :
- withval=$with_gtk_prefix; gtk_config_prefix="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gtk_config_prefix" >&5
-$as_echo "$gtk_config_prefix" >&6; }
-else
- gtk_config_prefix=""; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-gtk-exec-prefix argument" >&5
-$as_echo_n "checking --with-gtk-exec-prefix argument... " >&6; }
-
-# Check whether --with-gtk-exec-prefix was given.
-if test "${with_gtk_exec_prefix+set}" = set; then :
- withval=$with_gtk_exec_prefix; gtk_config_exec_prefix="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gtk_config_prefix" >&5
-$as_echo "$gtk_config_prefix" >&6; }
-else
- gtk_config_exec_prefix=""; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
+if test -z "$SKIP_GTK2"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-gtktest argument" >&5
$as_echo_n "checking --disable-gtktest argument... " >&6; }
@@ -7295,104 +7229,6 @@ $as_echo "gtk test enabled" >&6; }
$as_echo "gtk test disabled" >&6; }
fi
- if test "x$gtk_config_prefix" != "x" ; then
- gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
- GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
- fi
- if test "x$gtk_config_exec_prefix" != "x" ; then
- gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
- GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
- fi
- if test "X$GTK_CONFIG" = "X"; then
- # Extract the first word of "gtk-config", so it can be a program name with args.
-set dummy gtk-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_GTK_CONFIG+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- case $GTK_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_GTK_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no"
- ;;
-esac
-fi
-GTK_CONFIG=$ac_cv_path_GTK_CONFIG
-if test -n "$GTK_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_CONFIG" >&5
-$as_echo "$GTK_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test "X$GTK_CONFIG" = "Xno"; then
- # Extract the first word of "gtk12-config", so it can be a program name with args.
-set dummy gtk12-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_GTK12_CONFIG+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- case $GTK12_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GTK12_CONFIG="$GTK12_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_GTK12_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_GTK12_CONFIG" && ac_cv_path_GTK12_CONFIG="no"
- ;;
-esac
-fi
-GTK12_CONFIG=$ac_cv_path_GTK12_CONFIG
-if test -n "$GTK12_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK12_CONFIG" >&5
-$as_echo "$GTK12_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- GTK_CONFIG="$GTK12_CONFIG"
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using GTK configuration program $GTK_CONFIG" >&5
-$as_echo "Using GTK configuration program $GTK_CONFIG" >&6; }
- fi
if test "X$PKG_CONFIG" = "X"; then
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
@@ -7437,8 +7273,7 @@ fi
fi
- if test "x$GTK_CONFIG:$PKG_CONFIG" != "xno:no"; then
- if test "X$SKIP_GTK2" != "XYES"; then
+ if test "x$PKG_CONFIG" != "xno"; then
if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
{
@@ -7459,18 +7294,6 @@ $as_echo_n "checking for GTK - version >= $min_gtk_version... " >&6; }
gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
}
- elif test "X$GTK_CONFIG" != "Xno"; then
- {
- GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
- GTK_LIBDIR=
- GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
- gtk_major_version=`$GTK_CONFIG $gtk_config_args --version | \
- sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
- gtk_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
- sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
- gtk_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
- sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
- }
else
no_gtk=yes
fi
@@ -7482,7 +7305,7 @@ $as_echo_n "checking for GTK - version >= $min_gtk_version... " >&6; }
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
- rm -f conf.gtktest
+ rm -f conf.gtktest
if test "$cross_compiling" = yes; then :
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
@@ -7544,8 +7367,8 @@ $as_echo "yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_ve
$as_echo "found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; }
fi
GUI_LIB_LOC="$GTK_LIBDIR"
- GTK_LIBNAME="$GTK_LIBS"
- GUI_INC_LOC="$GTK_CFLAGS"
+ GTK_LIBNAME="$GTK_LIBS"
+ GUI_INC_LOC="$GTK_CFLAGS"
else
{
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -7565,170 +7388,24 @@ $as_echo "no" >&6; }
rm -f conf.gtktest
- if test "x$GTK_CFLAGS" != "x"; then
- SKIP_ATHENA=YES
- SKIP_NEXTAW=YES
- SKIP_MOTIF=YES
- GUITYPE=GTK
-
- fi
- fi
-
- if test "x$GUITYPE" != "xGTK"; then
- SKIP_GTK2=YES
-
- if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
- {
- min_gtk_version=1.1.16
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5
-$as_echo_n "checking for GTK - version >= $min_gtk_version... " >&6; }
- no_gtk=""
- if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \
- && $PKG_CONFIG --exists gtk+-2.0; then
- {
- GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
- GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-2.0`
- GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
- gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
- sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
- gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
- sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
- gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
- sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
- }
- elif test "X$GTK_CONFIG" != "Xno"; then
- {
- GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
- GTK_LIBDIR=
- GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
- gtk_major_version=`$GTK_CONFIG $gtk_config_args --version | \
- sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
- gtk_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
- sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
- gtk_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
- sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
- }
- else
- no_gtk=yes
- fi
-
- if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then
- {
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $GTK_CFLAGS"
- LIBS="$LIBS $GTK_LIBS"
-
- rm -f conf.gtktest
- if test "$cross_compiling" = yes; then :
- echo $ac_n "cross compiling; assumed OK... $ac_c"
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <gtk/gtk.h>
-#include <stdio.h>
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#endif
-
-int
-main ()
-{
-int major, minor, micro;
-char *tmp_version;
-
-system ("touch conf.gtktest");
-
-/* HP/UX 9 (%@#!) writes to sscanf strings */
-tmp_version = g_strdup("$min_gtk_version");
-if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
- printf("%s, bad version string\n", "$min_gtk_version");
- exit(1);
- }
-
-if ((gtk_major_version > major) ||
- ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
- ((gtk_major_version == major) && (gtk_minor_version == minor) &&
- (gtk_micro_version >= micro)))
-{
- return 0;
-}
-return 1;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- no_gtk=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+ if test "x$GTK_CFLAGS" != "x"; then
+ SKIP_ATHENA=YES
+ SKIP_NEXTAW=YES
+ SKIP_MOTIF=YES
+ GUITYPE=GTK
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- }
fi
- if test "x$no_gtk" = x ; then
- if test "x$enable_gtktest" = "xyes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&5
-$as_echo "yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&5
-$as_echo "found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; }
- fi
- GTK_LIBNAME="$GTK_LIBS"
- GUI_INC_LOC="$GTK_CFLAGS"
- else
- {
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- GTK_CFLAGS=""
- GTK_LIBS=""
- :
- }
- fi
- }
- else
- GTK_CFLAGS=""
- GTK_LIBS=""
- :
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
- rm -f conf.gtktest
-
- if test "x$GTK_CFLAGS" != "x"; then
- SKIP_ATHENA=YES
- SKIP_NEXTAW=YES
- SKIP_MOTIF=YES
- GUITYPE=GTK
-
- fi
fi
- fi
- if test "x$GUITYPE" = "xGTK"; then
- if test "$gtk_major_version" = 1 -a "0$gtk_minor_version" -lt 2 \
- -o "$gtk_major_version" = 1 -a "$gtk_minor_version" = 2 -a "0$gtk_micro_version" -lt 3; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: this GTK version is old; version 1.2.3 or later is recommended" >&5
-$as_echo "this GTK version is old; version 1.2.3 or later is recommended" >&6; }
- else
+ if test -z "$SKIP_GNOME"; then
{
- if test "0$gtk_major_version" -ge 2; 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 \
- || test "0$gtk_major_version" -gt 2; then
- $as_echo "#define HAVE_GTK_MULTIHEAD 1" >>confdefs.h
-
- fi
- fi
- if test -z "$SKIP_GNOME"; then
- {
@@ -7771,7 +7448,7 @@ else
fi
- if test "x$want_gnome" = xyes -a "0$gtk_major_version" -ge 2; then
+ if test "x$want_gnome" = xyes; then
{
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgnomeui-2.0" >&5
$as_echo_n "checking for libgnomeui-2.0... " >&6; }
@@ -7802,106 +7479,13 @@ $as_echo "not found" >&6; }
fi
fi
}
- elif test "x$want_gnome" = xyes; then
- {
- # Extract the first word of "gnome-config", so it can be a program name with args.
-set dummy gnome-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_GNOME_CONFIG+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- case $GNOME_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GNOME_CONFIG="$GNOME_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_GNOME_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_GNOME_CONFIG" && ac_cv_path_GNOME_CONFIG="no"
- ;;
-esac
-fi
-GNOME_CONFIG=$ac_cv_path_GNOME_CONFIG
-if test -n "$GNOME_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNOME_CONFIG" >&5
-$as_echo "$GNOME_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test "$GNOME_CONFIG" = "no"; then
- no_gnome_config="yes"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $GNOME_CONFIG works" >&5
-$as_echo_n "checking if $GNOME_CONFIG works... " >&6; }
- if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome gnomeui`"
- GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
- GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
- have_gnome=yes
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- no_gnome_config="yes"
- fi
- fi
-
- if test x$exec_prefix = xNONE; then
- if test x$prefix = xNONE; then
- gnome_prefix=$ac_default_prefix/lib
- else
- gnome_prefix=$prefix/lib
- fi
- else
- gnome_prefix=`eval echo \`echo $libdir\``
- fi
-
- if test "$no_gnome_config" = "yes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnomeConf.sh file in $gnome_prefix" >&5
-$as_echo_n "checking for gnomeConf.sh file in $gnome_prefix... " >&6; }
- if test -f $gnome_prefix/gnomeConf.sh; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
-$as_echo "found" >&6; }
- echo "loading gnome configuration from" \
- "$gnome_prefix/gnomeConf.sh"
- . $gnome_prefix/gnomeConf.sh
- have_gnome=yes
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
- if test x = xfail; then
- as_fn_error "Could not find the gnomeConf.sh file that is generated by gnome-libs install" "$LINENO" 5
- fi
- fi
- fi
- }
fi
- if test x$have_gnome = xyes ; then
- $as_echo "#define FEAT_GUI_GNOME 1" >>confdefs.h
+ if test "x$have_gnome" = xyes ; then
+ $as_echo "#define FEAT_GUI_GNOME 1" >>confdefs.h
- GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
- GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
- fi
- }
+ GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
+ GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
fi
}
fi
@@ -8467,7 +8051,7 @@ if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then
$as_echo "no GUI selected; fontset has been disabled" >&6; }
enable_fontset="no"
fi
-if test "x$GUITYPE:$enable_fontset" = "xGTK:yes" -a "0$gtk_major_version" -ge 2; then
+if test "x$GUITYPE:$enable_fontset" = "xGTK:yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: GTK+ 2 GUI selected; fontset has been disabled" >&5
$as_echo "GTK+ 2 GUI selected; fontset has been disabled" >&6; }
enable_fontset="no"
View
219 src/configure.in
@@ -183,7 +183,7 @@ if test "`(uname) 2>/dev/null`" = Darwin; then
dnl or Motif, Athena or GTK GUI is used.
AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes)
if test "x$CARBON" = "xyes"; then
- if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk -a "X$enable_gui" != Xgtk2; then
+ if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk2; then
with_x=no
fi
fi
@@ -1156,7 +1156,6 @@ AC_ARG_ENABLE(xim,
[ --enable-xim Include XIM input support.],
AC_MSG_RESULT($enable_xim),
[enable_xim="auto"; AC_MSG_RESULT(defaulting to auto)])
-dnl defining FEAT_XIM is delayed, so that it can be disabled for older GTK
AC_MSG_CHECKING(--enable-fontset argument)
AC_ARG_ENABLE(fontset,
@@ -1296,15 +1295,14 @@ test "x$with_x" = xno -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui
AC_MSG_CHECKING(--enable-gui argument)
AC_ARG_ENABLE(gui,
- [ --enable-gui[=OPTS] X11 GUI [default=auto] [OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon]], , enable_gui="auto")
+ [ --enable-gui[=OPTS] X11 GUI [default=auto] [OPTS=auto/no/gtk2/gnome2/motif/athena/neXtaw/photon/carbon]], , enable_gui="auto")
dnl Canonicalize the --enable-gui= argument so that it can be easily compared.
dnl Do not use character classes for portability with old tools.
enable_gui_canon=`echo "_$enable_gui" | \
sed 's/[[ _+-]]//g;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
dnl Skip everything by default.
-SKIP_GTK=YES
SKIP_GTK2=YES
SKIP_GNOME=YES
SKIP_MOTIF=YES
@@ -1343,24 +1341,16 @@ else
case "$enable_gui_canon" in
no|none) AC_MSG_RESULT(no GUI support) ;;
yes|""|auto) AC_MSG_RESULT(yes/auto - automatic GUI support)
- SKIP_GTK=
SKIP_GTK2=
SKIP_GNOME=
SKIP_MOTIF=
SKIP_ATHENA=
SKIP_NEXTAW=
SKIP_CARBON=;;
- gtk) AC_MSG_RESULT(GTK+ 1.x GUI support)
- SKIP_GTK=;;
gtk2) AC_MSG_RESULT(GTK+ 2.x GUI support)
- SKIP_GTK=
SKIP_GTK2=;;
- gnome) AC_MSG_RESULT(GNOME 1.x GUI support)
- SKIP_GNOME=
- SKIP_GTK=;;
gnome2) AC_MSG_RESULT(GNOME 2.x GUI support)
SKIP_GNOME=
- SKIP_GTK=
SKIP_GTK2=;;
motif) AC_MSG_RESULT(Motif GUI support)
SKIP_MOTIF=;;
@@ -1373,32 +1363,20 @@ else
fi
-if test "x$SKIP_GTK" != "xYES" -a "$enable_gui_canon" != "gtk" -a "$enable_gui_canon" != "gtk2"; then
- AC_MSG_CHECKING(whether or not to look for GTK)
- AC_ARG_ENABLE(gtk-check,
- [ --enable-gtk-check If auto-select GUI, check for GTK [default=yes]],
- , enable_gtk_check="yes")
- AC_MSG_RESULT($enable_gtk_check)
- if test "x$enable_gtk_check" = "xno"; then
- SKIP_GTK=YES
- SKIP_GNOME=YES
- fi
-fi
-
if test "x$SKIP_GTK2" != "xYES" -a "$enable_gui_canon" != "gtk2" \
-a "$enable_gui_canon" != "gnome2"; then
AC_MSG_CHECKING(whether or not to look for GTK+ 2)
AC_ARG_ENABLE(gtk2-check,
- [ --enable-gtk2-check If GTK GUI, check for GTK+ 2 [default=yes]],
+ [ --enable-gtk2-check If auto-select GUI, check for GTK+ 2 [default=yes]],
, enable_gtk2_check="yes")
AC_MSG_RESULT($enable_gtk2_check)
if test "x$enable_gtk2_check" = "xno"; then
SKIP_GTK2=YES
+ SKIP_GNOME=YES
fi
fi
-if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome" \
- -a "$enable_gui_canon" != "gnome2"; then
+if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome2"; then
AC_MSG_CHECKING(whether or not to look for GNOME)
AC_ARG_ENABLE(gnome-check,
[ --enable-gnome-check If GTK GUI, check for GNOME [default=no]],
@@ -1472,7 +1450,6 @@ if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then
datadir='${prefix}/Vim.app/Contents/Resources'
dnl skip everything else
- SKIP_GTK=YES;
SKIP_GTK2=YES;
SKIP_GNOME=YES;
SKIP_MOTIF=YES;
@@ -1482,12 +1459,8 @@ if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then
SKIP_CARBON=YES
fi
-dnl
-dnl Get the cflags and libraries from the gtk-config script
-dnl
-
dnl define an autoconf function to check for a specified version of GTK, and
-dnl try to compile/link a GTK program. this gets used once for GTK 1.1.16.
+dnl try to compile/link a GTK program.
dnl
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for GTK, and define GTK_CFLAGS, GTK_LIBDIR and GTK_LIBS
@@ -1496,7 +1469,7 @@ AC_DEFUN(AM_PATH_GTK,
[
if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
{
- min_gtk_version=ifelse([$1], ,0.99.7,$1)
+ min_gtk_version=ifelse([$1], ,2.2.0,$1)
AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
no_gtk=""
if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \
@@ -1515,18 +1488,6 @@ AC_DEFUN(AM_PATH_GTK,
gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
}
- elif test "X$GTK_CONFIG" != "Xno"; then
- {
- GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
- GTK_LIBDIR=
- GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
- gtk_major_version=`$GTK_CONFIG $gtk_config_args --version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
- gtk_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
- gtk_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
- }
else
no_gtk=yes
fi
@@ -1539,8 +1500,7 @@ AC_DEFUN(AM_PATH_GTK,
LIBS="$LIBS $GTK_LIBS"
dnl
- dnl Now check if the installed GTK is sufficiently new. (Also sanity
- dnl checks the results of gtk-config to some extent
+ dnl Now check if the installed GTK is sufficiently new.
dnl
rm -f conf.gtktest
AC_TRY_RUN([
@@ -1642,7 +1602,7 @@ AC_DEFUN([GNOME_INIT_HOOK],
fi,
want_gnome=yes)
- if test "x$want_gnome" = xyes -a "0$gtk_major_version" -ge 2; then
+ if test "x$want_gnome" = xyes; then
{
AC_MSG_CHECKING(for libgnomeui-2.0)
if $PKG_CONFIG --exists libgnomeui-2.0; then
@@ -1669,51 +1629,6 @@ AC_DEFUN([GNOME_INIT_HOOK],
fi
fi
}
- elif test "x$want_gnome" = xyes; then
- {
- AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
- if test "$GNOME_CONFIG" = "no"; then
- no_gnome_config="yes"
- else
- AC_MSG_CHECKING(if $GNOME_CONFIG works)
- if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
- AC_MSG_RESULT(yes)
- GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome gnomeui`"
- GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
- GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
- $1
- else
- AC_MSG_RESULT(no)
- no_gnome_config="yes"
- fi
- fi
-
- if test x$exec_prefix = xNONE; then
- if test x$prefix = xNONE; then
- gnome_prefix=$ac_default_prefix/lib
- else
- gnome_prefix=$prefix/lib
- fi
- else
- gnome_prefix=`eval echo \`echo $libdir\``
- fi
-
- if test "$no_gnome_config" = "yes"; then
- AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
- if test -f $gnome_prefix/gnomeConf.sh; then
- AC_MSG_RESULT(found)
- echo "loading gnome configuration from" \
- "$gnome_prefix/gnomeConf.sh"
- . $gnome_prefix/gnomeConf.sh
- $1
- else
- AC_MSG_RESULT(not found)
- if test x$2 = xfail; then
- AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
- fi
- fi
- fi
- }
fi
])
@@ -1723,21 +1638,9 @@ AC_DEFUN([GNOME_INIT],[
dnl ---------------------------------------------------------------------------
-dnl Check for GTK. First checks for gtk-config, cause it needs that to get the
-dnl correct compiler flags. Then checks for GTK 1.1.16. If that fails, then
-dnl it checks for 1.0.6. If both fail, then continue on for Motif as before...
+dnl Check for GTK2. If it fails, then continue on for Motif as before...
dnl ---------------------------------------------------------------------------
-if test -z "$SKIP_GTK"; then
-
- AC_MSG_CHECKING(--with-gtk-prefix argument)
- AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
- gtk_config_prefix="$withval"; AC_MSG_RESULT($gtk_config_prefix),
- gtk_config_prefix=""; AC_MSG_RESULT(no))
-
- AC_MSG_CHECKING(--with-gtk-exec-prefix argument)
- AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
- gtk_config_exec_prefix="$withval"; AC_MSG_RESULT($gtk_config_prefix),
- gtk_config_exec_prefix=""; AC_MSG_RESULT(no))
+if test -z "$SKIP_GTK2"; then
AC_MSG_CHECKING(--disable-gtktest argument)
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
@@ -1748,89 +1651,41 @@ if test -z "$SKIP_GTK"; then
AC_MSG_RESULT(gtk test disabled)
fi
- if test "x$gtk_config_prefix" != "x" ; then
- gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
- GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
- fi
- if test "x$gtk_config_exec_prefix" != "x" ; then
- gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
- GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
- fi
- if test "X$GTK_CONFIG" = "X"; then
- AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
- if test "X$GTK_CONFIG" = "Xno"; then
- dnl Some distributions call it gtk12-config, annoying!
- AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no)
- GTK_CONFIG="$GTK12_CONFIG"
- fi
- else
- AC_MSG_RESULT(Using GTK configuration program $GTK_CONFIG)
- fi
if test "X$PKG_CONFIG" = "X"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
- if test "x$GTK_CONFIG:$PKG_CONFIG" != "xno:no"; then
+ if test "x$PKG_CONFIG" != "xno"; then
dnl First try finding version 2.2.0 or later. The 2.0.x series has
dnl problems (bold fonts, --remote doesn't work).
- if test "X$SKIP_GTK2" != "XYES"; then
- AM_PATH_GTK(2.2.0,
- [GUI_LIB_LOC="$GTK_LIBDIR"
- GTK_LIBNAME="$GTK_LIBS"
- GUI_INC_LOC="$GTK_CFLAGS"], )
- if test "x$GTK_CFLAGS" != "x"; then
- SKIP_ATHENA=YES
- SKIP_NEXTAW=YES
- SKIP_MOTIF=YES
- GUITYPE=GTK
- AC_SUBST(GTK_LIBNAME)
- fi
- fi
-
- dnl If there is no 2.2.0 or later try the 1.x.x series. We require at
- dnl least GTK 1.1.16. 1.0.6 doesn't work. 1.1.1 to 1.1.15
- dnl were test versions.
- if test "x$GUITYPE" != "xGTK"; then
- SKIP_GTK2=YES
- AM_PATH_GTK(1.1.16,
- [GTK_LIBNAME="$GTK_LIBS"
- GUI_INC_LOC="$GTK_CFLAGS"], )
- if test "x$GTK_CFLAGS" != "x"; then
- SKIP_ATHENA=YES
- SKIP_NEXTAW=YES
- SKIP_MOTIF=YES
- GUITYPE=GTK
- AC_SUBST(GTK_LIBNAME)
- fi
+ AM_PATH_GTK(2.2.0,
+ [GUI_LIB_LOC="$GTK_LIBDIR"
+ GTK_LIBNAME="$GTK_LIBS"
+ GUI_INC_LOC="$GTK_CFLAGS"], )
+ if test "x$GTK_CFLAGS" != "x"; then
+ SKIP_ATHENA=YES
+ SKIP_NEXTAW=YES
+ SKIP_MOTIF=YES
+ GUITYPE=GTK
+ AC_SUBST(GTK_LIBNAME)
fi
fi
- dnl Give a warning if GTK is older than 1.2.3
if test "x$GUITYPE" = "xGTK"; then
- if test "$gtk_major_version" = 1 -a "0$gtk_minor_version" -lt 2 \
- -o "$gtk_major_version" = 1 -a "$gtk_minor_version" = 2 -a "0$gtk_micro_version" -lt 3; then
- AC_MSG_RESULT(this GTK version is old; version 1.2.3 or later is recommended)
- else
+ 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)
+ fi
+ dnl
+ dnl if GTK exists, then check for GNOME.
+ dnl
+ if test -z "$SKIP_GNOME"; then
{
- if test "0$gtk_major_version" -ge 2; 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 \
- || test "0$gtk_major_version" -gt 2; then
- AC_DEFINE(HAVE_GTK_MULTIHEAD)
- fi
- fi
- dnl
- dnl if GTK exists, and it's not the 1.0.x series, then check for GNOME.
- dnl
- if test -z "$SKIP_GNOME"; then
- {
- GNOME_INIT_HOOK([have_gnome=yes])
- if test x$have_gnome = xyes ; then
- AC_DEFINE(FEAT_GUI_GNOME)
- GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
- GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
- fi
- }
+ GNOME_INIT_HOOK([have_gnome=yes])
+ if test "x$have_gnome" = xyes ; then
+ AC_DEFINE(FEAT_GUI_GNOME)
+ GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
+ GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
fi
}
fi
@@ -2088,7 +1943,7 @@ if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then
AC_MSG_RESULT(no GUI selected; fontset has been disabled)
enable_fontset="no"
fi
-if test "x$GUITYPE:$enable_fontset" = "xGTK:yes" -a "0$gtk_major_version" -ge 2; then
+if test "x$GUITYPE:$enable_fontset" = "xGTK:yes"; then
AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled)
enable_fontset="no"
fi
View
2 src/eval.c
@@ -11813,9 +11813,7 @@ f_has(argvars, rettv)
#endif
#ifdef FEAT_GUI_GTK
"gui_gtk",
-# ifdef HAVE_GTK2
"gui_gtk2",
-# endif
#endif
#ifdef FEAT_GUI_GNOME
"gui_gnome",
View
8 src/globals.h
@@ -847,13 +847,7 @@ EXTERN int* (*iconv_errno) (void);
#ifdef FEAT_XIM
# ifdef FEAT_GUI_GTK
-# ifdef HAVE_GTK2
EXTERN GtkIMContext *xic INIT(= NULL);
-# else
-EXTERN GdkICAttr *xic_attr INIT(= NULL);
-EXTERN GdkIC *xic INIT(= NULL);
-EXTERN char *draw_feedback INIT(= NULL);
-# endif
/*
* Start and end column of the preedit area in virtual columns from the start
* of the text line. When there is no preedit area they are set to MAXCOL.
@@ -1402,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(FEAT_GUI_GTK)) && !defined(HAVE_GTK2)
+#if defined(FEAT_GUI_X11) && !defined(HAVE_GTK2)
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"));
View
4 src/gui.c
@@ -2261,7 +2261,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
/* print the string so far if it's the last character or there is
* a composing character. */
if (i + cl >= len || (comping && i > start) || dowide
-# if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
+# if defined(FEAT_GUI_X11)
|| (cn > 1
# ifdef FEAT_XFONTSET
/* No fontset: At least draw char after wide char at
@@ -2293,7 +2293,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
start += cl;
}
-# if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
+# if defined(FEAT_GUI_X11)
/* No fontset: draw a space to fill the gap after a wide char
* */
if (cn > 1 && (draw_flags & DRAW_TRANSP) == 0
View
14 src/gui.h
@@ -235,13 +235,8 @@ typedef long guicolor_T; /* handle for a GUI color; for X11 this should
actual color */
#ifdef FEAT_GUI_GTK
-# ifdef HAVE_GTK2
typedef PangoFontDescription *GuiFont; /* handle for a GUI font */
typedef PangoFontDescription *GuiFontset; /* handle for a GUI fontset */
-# else
- typedef GdkFont *GuiFont; /* handle for a GUI font */
- typedef GdkFont *GuiFontset; /* handle for a GUI fontset */
-# endif
# define NOFONT (GuiFont)NULL
# define NOFONTSET (GuiFontset)NULL
#else
@@ -402,24 +397,15 @@ typedef struct Gui
GdkColor *fgcolor; /* GDK-styled foreground color */
GdkColor *bgcolor; /* GDK-styled background color */
GdkColor *spcolor; /* GDK-styled special color */
-# ifndef HAVE_GTK2
- GuiFont current_font;
-# endif
GdkGC *text_gc; /* cached GC for normal text */
-# ifdef HAVE_GTK2
PangoContext *text_context; /* the context used for all text */
PangoFont *ascii_font; /* cached font for ASCII strings */
PangoGlyphString *ascii_glyphs; /* cached code point -> glyph map */
-# endif
# ifdef FEAT_GUI_TABLINE
GtkWidget *tabline; /* tab pages line handle */
# endif
GtkAccelGroup *accel_group;
-# ifndef HAVE_GTK2
- GtkWidget *fontdlg; /* font selection dialog window */
- char_u *fontname; /* font name from font selection dialog */
-# endif
GtkWidget *filedlg; /* file selection dialog */
char_u *browse_fname; /* file name from filedlg */
#endif /* FEAT_GUI_GTK */
View
63 src/gui_beval.c
@@ -157,9 +157,6 @@ static void pointer_event __ARGS((BalloonEval *, int, int, unsigned));
static void key_event __ARGS((BalloonEval *, unsigned, int));
static gint timeout_cb __ARGS((gpointer));
static gint balloon_expose_event_cb __ARGS((GtkWidget *, GdkEventExpose *, gpointer));
-# ifndef HAVE_GTK2
-static void balloon_draw_cb __ARGS((GtkWidget *, GdkRectangle *, gpointer));
-# endif
#else
static void addEventHandler __ARGS((Widget, BalloonEval *));
static void removeEventHandler __ARGS((BalloonEval *));
@@ -534,9 +531,7 @@ target_event_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
cancelBalloon(beval);
break;
case GDK_BUTTON_PRESS:
-# ifdef HAVE_GTK2
case GDK_SCROLL:
-# endif
cancelBalloon(beval);
break;
case GDK_KEY_PRESS:
@@ -676,25 +671,6 @@ balloon_expose_event_cb(GtkWidget *widget,
return FALSE; /* continue emission */
}
-# ifndef HAVE_GTK2
- static void
-balloon_draw_cb(GtkWidget *widget, GdkRectangle *area, gpointer data)
-{
- GtkWidget *child;
- GdkRectangle child_area;
-
- gtk_paint_flat_box(widget->style, widget->window,
- GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- area, widget, "tooltip",
- 0, 0, -1, -1);
-
- child = GTK_BIN(widget)->child;
-
- if (gtk_widget_intersect(child, area, &child_area))
- gtk_widget_draw(child, &child_area);
-}
-# endif
-
#else /* !FEAT_GUI_GTK */
static void
@@ -913,15 +889,13 @@ requestBalloon(beval)
}
#ifdef FEAT_GUI_GTK
-
-# ifdef HAVE_GTK2
/*
* Convert the string to UTF-8 if 'encoding' is not "utf-8".
* Replace any non-printable characters and invalid bytes sequences with
* "^X" or "<xx>" escapes, and apply SpecialKey highlighting to them.
* TAB and NL are passed through unscathed.
*/
-# define IS_NONPRINTABLE(c) (((c) < 0x20 && (c) != TAB && (c) != NL) \
+# define IS_NONPRINTABLE(c) (((c) < 0x20 && (c) != TAB && (c) != NL) \
|| (c) == DEL)
static void
set_printable_label_text(GtkLabel *label, char_u *text)
@@ -1059,8 +1033,7 @@ set_printable_label_text(GtkLabel *label, char_u *text)
gtk_label_set_attributes(label, attr_list);
pango_attr_list_unref(attr_list);
}
-# undef IS_NONPRINTABLE
-# endif /* HAVE_GTK2 */
+# undef IS_NONPRINTABLE
/*
* Draw a balloon.
@@ -1077,9 +1050,7 @@ drawBalloon(BalloonEval *beval)
int y;
int x_offset = EVAL_OFFSET_X;
int y_offset = EVAL_OFFSET_Y;
-# ifdef HAVE_GTK2
PangoLayout *layout;
-# endif
# ifdef HAVE_GTK_MULTIHEAD
GdkScreen *screen;
@@ -1094,19 +1065,18 @@ drawBalloon(BalloonEval *beval)
gtk_widget_ensure_style(beval->balloonShell);
gtk_widget_ensure_style(beval->balloonLabel);
-# ifdef HAVE_GTK2
set_printable_label_text(GTK_LABEL(beval->balloonLabel), beval->msg);
/*
* Dirty trick: Enable wrapping mode on the label's layout behind its
* back. This way GtkLabel won't try to constrain the wrap width to a
* builtin maximum value of about 65 Latin characters.
*/
layout = gtk_label_get_layout(GTK_LABEL(beval->balloonLabel));
-# ifdef PANGO_WRAP_WORD_CHAR
+# ifdef PANGO_WRAP_WORD_CHAR
pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
-# else
+# else
pango_layout_set_wrap(layout, PANGO_WRAP_WORD);
-# endif
+# endif
pango_layout_set_width(layout,
/* try to come up with some reasonable width */
PANGO_SCALE * CLAMP(gui.num_cols * gui.char_width,
@@ -1115,25 +1085,6 @@ drawBalloon(BalloonEval *beval)
/* Calculate the balloon's width and height. */
gtk_widget_size_request(beval->balloonShell, &requisition);
-# else
- gtk_label_set_line_wrap(GTK_LABEL(beval->balloonLabel), FALSE);
- gtk_label_set_text(GTK_LABEL(beval->balloonLabel),
- (const char *)beval->msg);
-
- /* Calculate the balloon's width and height. */
- gtk_widget_size_request(beval->balloonShell, &requisition);
- /*
- * Unfortunately, the dirty trick used above to get around the builtin
- * maximum wrap width of GtkLabel doesn't work with GTK+ 1. Thus if
- * and only if it's absolutely necessary to avoid drawing off-screen,
- * do enable wrapping now and recalculate the size request.
- */
- if (requisition.width > screen_w)
- {
- gtk_label_set_line_wrap(GTK_LABEL(beval->balloonLabel), TRUE);
- gtk_widget_size_request(beval->balloonShell, &requisition);
- }
-# endif
/* Compute position of the balloon area */
gdk_window_get_origin(beval->target->window, &x, &y);
@@ -1196,10 +1147,6 @@ createBalloonEvalWindow(BalloonEval *beval)
gtk_signal_connect((GtkObject*)(beval->balloonShell), "expose_event",
GTK_SIGNAL_FUNC(balloon_expose_event_cb), NULL);
-# ifndef HAVE_GTK2
- gtk_signal_connect((GtkObject*)(beval->balloonShell), "draw",
- GTK_SIGNAL_FUNC(balloon_draw_cb), NULL);
-# endif
beval->balloonLabel = gtk_label_new(NULL);
gtk_label_set_line_wrap(GTK_LABEL(beval->balloonLabel), FALSE);
View
1,239 src/gui_gtk.c
@@ -62,53 +62,6 @@
# include <gnome.h>
#endif
-#if defined(FEAT_GUI_DIALOG) && !defined(HAVE_GTK2)
-# include "../pixmaps/alert.xpm"
-# include "../pixmaps/error.xpm"
-# include "../pixmaps/generic.xpm"
-# include "../pixmaps/info.xpm"
-# include "../pixmaps/quest.xpm"
-#endif
-
-#if defined(FEAT_TOOLBAR) && !defined(HAVE_GTK2)
-/*
- * Icons used by the toolbar code.
- */
-#include "../pixmaps/tb_new.xpm"
-#include "../pixmaps/tb_open.xpm"
-#include "../pixmaps/tb_close.xpm"
-#include "../pixmaps/tb_save.xpm"
-#include "../pixmaps/tb_print.xpm"
-#include "../pixmaps/tb_cut.xpm"
-#include "../pixmaps/tb_copy.xpm"
-#include "../pixmaps/tb_paste.xpm"
-#include "../pixmaps/tb_find.xpm"
-#include "../pixmaps/tb_find_next.xpm"
-#include "../pixmaps/tb_find_prev.xpm"
-#include "../pixmaps/tb_find_help.xpm"
-#include "../pixmaps/tb_exit.xpm"
-#include "../pixmaps/tb_undo.xpm"
-#include "../pixmaps/tb_redo.xpm"
-#include "../pixmaps/tb_help.xpm"
-#include "../pixmaps/tb_macro.xpm"
-#include "../pixmaps/tb_make.xpm"
-#include "../pixmaps/tb_save_all.xpm"
-#include "../pixmaps/tb_jump.xpm"
-#include "../pixmaps/tb_ctags.xpm"
-#include "../pixmaps/tb_load_session.xpm"
-#include "../pixmaps/tb_save_session.xpm"
-#include "../pixmaps/tb_new_session.xpm"
-#include "../pixmaps/tb_blank.xpm"
-#include "../pixmaps/tb_maximize.xpm"
-#include "../pixmaps/tb_split.xpm"
-#include "../pixmaps/tb_minimize.xpm"
-#include "../pixmaps/tb_shell.xpm"
-#include "../pixmaps/tb_replace.xpm"
-#include "../pixmaps/tb_vsplit.xpm"
-#include "../pixmaps/tb_maxwidth.xpm"
-#include "../pixmaps/tb_minwidth.xpm"
-#endif /* FEAT_TOOLBAR && !HAVE_GTK2 */
-
#ifdef FEAT_GUI_GTK
# include <gdk/gdkkeysyms.h>
# include <gdk/gdk.h>
@@ -137,11 +90,8 @@ typedef int GtkWidget;
static void entry_activate_cb(GtkWidget *widget, gpointer data);
static void entry_changed_cb(GtkWidget *entry, GtkWidget *dialog);
static void find_replace_cb(GtkWidget *widget, gpointer data);
-#ifndef HAVE_GTK2
-static void gui_gtk_position_in_parent(GtkWidget *parent, GtkWidget *child, gui_win_pos_T where);
-#endif
-#if defined(FEAT_TOOLBAR) && defined(HAVE_GTK2)
+#if defined(FEAT_TOOLBAR)
/*
* Table from BuiltIn## icon indices to GTK+ stock IDs. Order must exactly
* match toolbar_names[] in menu.c! All stock icons including the "vim-*"
@@ -298,9 +248,9 @@ toolbar_button_focus_in_event(GtkWidget *widget UNUSED,
return TRUE;
}
-#endif /* FEAT_TOOLBAR && HAVE_GTK2 */
+#endif /* FEAT_TOOLBAR */
-#if (defined(FEAT_TOOLBAR) && defined(HAVE_GTK2)) || defined(PROTO)
+#if defined(FEAT_TOOLBAR) || defined(PROTO)
void
gui_gtk_register_stock_icons(void)
@@ -330,19 +280,8 @@ gui_gtk_register_stock_icons(void)
g_object_unref(factory);
}
-#endif /* FEAT_TOOLBAR && HAVE_GTK2 */
-
+#endif /* FEAT_TOOLBAR */
-/*
- * Only use accelerators when gtk_menu_ensure_uline_accel_group() is
- * available, which is in version 1.2.1. That was the first version where
- * accelerators properly worked (according to the change log).
- */
-#ifdef GTK_CHECK_VERSION
-# if GTK_CHECK_VERSION(1, 2, 1)
-# define GTK_USE_ACCEL
-# endif
-#endif
#if defined(FEAT_MENU) || defined(PROTO)
@@ -364,9 +303,7 @@ translate_mnemonic_tag(char_u *name, int use_mnemonic)
char_u *pdest;
int n_underscores = 0;
-# ifdef HAVE_GTK2
name = CONVERT_TO_UTF8(name);
-# endif
if (name == NULL)
return NULL;
@@ -401,14 +338,10 @@ translate_mnemonic_tag(char_u *name, int use_mnemonic)
*pdest = NUL;
}
-# ifdef HAVE_GTK2
CONVERT_TO_UTF8_FREE(name);
-# endif
return buf;
}
-# ifdef HAVE_GTK2
-
static void
menu_item_new(vimmenu_T *menu, GtkWidget *parent_widget)
{
@@ -445,96 +378,6 @@ menu_item_new(vimmenu_T *menu, GtkWidget *parent_widget)
gtk_widget_show_all(menu->id);
}
-# else /* !HAVE_GTK2 */
-
-/*
- * Create a highly customized menu item by hand instead of by using:
- *
- * gtk_menu_item_new_with_label(menu->dname);
- *
- * This is necessary, since there is no other way in GTK+ 1 to get the
- * not automatically parsed accelerator stuff right.
- */
- static void
-menu_item_new(vimmenu_T *menu, GtkWidget *parent_widget)
-{
- GtkWidget *widget;
- GtkWidget *bin;
- GtkWidget *label;
- char_u *name;
- guint accel_key;
-
- widget = gtk_widget_new(GTK_TYPE_MENU_ITEM,
- "GtkWidget::visible", TRUE,
- "GtkWidget::sensitive", TRUE,
- /* "GtkWidget::parent", parent->submenu_id, */
- NULL);
- bin = gtk_widget_new(GTK_TYPE_HBOX,
- "GtkWidget::visible", TRUE,
- "GtkWidget::parent", widget,
- "GtkBox::spacing", 16,
- NULL);
- label = gtk_widget_new(GTK_TYPE_ACCEL_LABEL,
- "GtkWidget::visible", TRUE,
- "GtkWidget::parent", bin,
- "GtkAccelLabel::accel_widget", widget,
- "GtkMisc::xalign", 0.0,
- NULL);
- menu->label = label;
-
- if (menu->actext)
- gtk_widget_new(GTK_TYPE_LABEL,
- "GtkWidget::visible", TRUE,
- "GtkWidget::parent", bin,
- "GtkLabel::label", menu->actext,
- "GtkMisc::xalign", 1.0,
- NULL);
-
- /*
- * Translate VIM accelerator tagging into GTK+'s. Note that since GTK uses
- * underscores as the accelerator key, we need to add an additional under-
- * score for each understore that appears in the menu name.
- */
-# ifdef GTK_USE_ACCEL
- name = translate_mnemonic_tag(menu->name,
- (p_wak[0] != 'n' || !GTK_IS_MENU_BAR(parent_widget)));
-# else
- name = translate_mnemonic_tag(menu->name, FALSE);
-# endif
-
- /* let GTK do its thing */
- accel_key = gtk_label_parse_uline(GTK_LABEL(label), (const char *)name);
- vim_free(name);
-
-# ifdef GTK_USE_ACCEL
- /* Don't add accelator if 'winaltkeys' is "no". */
- if (accel_key != GDK_VoidSymbol)
- {
- if (GTK_IS_MENU_BAR(parent_widget))
- {
- if (*p_wak != 'n')
- gtk_widget_add_accelerator(widget,
- "activate_item",
- gui.accel_group,
- accel_key, GDK_MOD1_MASK,
- (GtkAccelFlags)0);
- }
- else
- {
- gtk_widget_add_accelerator(widget,
- "activate_item",
- gtk_menu_ensure_uline_accel_group(GTK_MENU(parent_widget)),
- accel_key, 0,
- (GtkAccelFlags)0);
- }
- }
-# endif /* GTK_USE_ACCEL */
-
- menu->id = widget;
-}
-
-# endif /* !HAVE_GTK2 */
-
void
gui_mch_add_menu(vimmenu_T *menu, int idx)
{
@@ -562,18 +405,6 @@ gui_mch_add_menu(vimmenu_T *menu, int idx)
gtk_menu_shell_insert(GTK_MENU_SHELL(parent_widget), menu->id, idx);
-#ifndef HAVE_GTK2
- /*
- * The "Help" menu is a special case, and should be placed at the far
- * right hand side of the menu-bar. It's detected by its high priority.
- *
- * Right-aligning "Help" is considered bad UI design nowadays.
- * Thus lets disable this for GTK+ 2 to match the environment.
- */
- if (parent == NULL && menu->priority >= 9999)
- gtk_menu_item_right_justify(GTK_MENU_ITEM(menu->id));
-#endif
-
menu->submenu_id = gtk_menu_new();
gtk_menu_set_accel_group(GTK_MENU(menu->submenu_id), gui.accel_group);
@@ -590,117 +421,11 @@ menu_item_activate(GtkWidget *widget UNUSED, gpointer data)
{
gui_menu_cb((vimmenu_T *)data);
-# ifndef HAVE_GTK2
- /* Work around a bug in GTK+ 1: we don't seem to get a focus-in
- * event after clicking a menu item shown via :popup. */
- if (!gui.in_focus)
- gui_focus_change(TRUE);
-# endif
-
/* make sure the menu action is taken immediately */
if (gtk_main_level() > 0)
gtk_main_quit();
}
-# if defined(FEAT_TOOLBAR) && !defined(HAVE_GTK2)
-/*
- * These are the pixmaps used for the default buttons.
- * Order must exactly match toolbar_names[] in menu.c!
- */
-static char **(built_in_pixmaps[]) =
-{
- tb_new_xpm,
- tb_open_xpm,
- tb_save_xpm,
- tb_undo_xpm,
- tb_redo_xpm,
- tb_cut_xpm,
- tb_copy_xpm,
- tb_paste_xpm,
- tb_print_xpm,
- tb_help_xpm,
- tb_find_xpm,
- tb_save_all_xpm,
- tb_save_session_xpm,
- tb_new_session_xpm,
- tb_load_session_xpm,
- tb_macro_xpm,
- tb_replace_xpm,
- tb_close_xpm,
- tb_maximize_xpm,
- tb_minimize_xpm,
- tb_split_xpm,
- tb_shell_xpm,
- tb_find_prev_xpm,
- tb_find_next_xpm,
- tb_find_help_xpm,
- tb_make_xpm,
- tb_jump_xpm,
- tb_ctags_xpm,
- tb_vsplit_xpm,
- tb_maxwidth_xpm,
- tb_minwidth_xpm,
- tb_exit_xpm
-};
-
-/*
- * creates a blank pixmap using tb_blank
- */
- static void
-pixmap_create_from_xpm(char **xpm, GdkPixmap **pixmap, GdkBitmap **mask)
-{
- *pixmap = gdk_pixmap_colormap_create_from_xpm_d(
- NULL,
- gtk_widget_get_colormap(gui.mainwin),
- mask,
- NULL,
- xpm);
-}
-
-/*
- * creates a pixmap by using a built-in number
- */
- static void
-pixmap_create_by_num(int pixmap_num, GdkPixmap **pixmap, GdkBitmap **mask)
-{
- if (pixmap_num >= 0 && pixmap_num < (sizeof(built_in_pixmaps)
- / sizeof(built_in_pixmaps[0])))
- pixmap_create_from_xpm(built_in_pixmaps[pixmap_num], pixmap, mask);
-}
-
-/*
- * Creates a pixmap by using the pixmap "name" found in 'runtimepath'/bitmaps/
- */
- static void
-pixmap_create_by_dir(char_u *name, GdkPixmap **pixmap, GdkBitmap **mask)
-{
- char_u full_pathname[MAXPATHL + 1];
-
- if (gui_find_bitmap(name, full_pathname, "xpm") == OK)
- *pixmap = gdk_pixmap_colormap_create_from_xpm(
- NULL,
- gtk_widget_get_colormap(gui.mainwin),
- mask,
- &gui.mainwin->style->bg[GTK_STATE_NORMAL],
- (const char *)full_pathname);
-}
-
-/*
- * Creates a pixmap by using the pixmap "fname".
- */
- static void
-pixmap_create_from_file(char_u *fname, GdkPixmap **pixmap, GdkBitmap **mask)
-{
- *pixmap = gdk_pixmap_colormap_create_from_xpm(
- NULL,
- gtk_widget_get_colormap(gui.mainwin),
- mask,
- &gui.mainwin->style->bg[GTK_STATE_NORMAL],
- (const char *)fname);
-}
-
-# endif /* FEAT_TOOLBAR && !HAVE_GTK2 */
-
void
gui_mch_add_menu_item(vimmenu_T *menu, int idx)
{
@@ -723,7 +448,6 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx)
}
else
{
-# ifdef HAVE_GTK2
char_u *text;
char_u *tooltip;
@@ -750,39 +474,6 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx)
CONVERT_TO_UTF8_FREE(text);
CONVERT_TO_UTF8_FREE(tooltip);
-
-# else /* !HAVE_GTK2 */
-
- GdkPixmap *pixmap = NULL;
- GdkBitmap *mask = NULL;
-
- /* First try user specified bitmap, then builtin, the a blank. */
- if (menu->iconfile != NULL)
- {
- char_u buf[MAXPATHL + 1];
-
- gui_find_iconfile(menu->iconfile, buf, "xpm");
- pixmap_create_from_file(buf, &pixmap, &mask);
- }
- if (pixmap == NULL && !menu->icon_builtin)
- pixmap_create_by_dir(menu->name, &pixmap, &mask);
- if (pixmap == NULL && menu->iconidx >= 0)
- pixmap_create_by_num(menu->iconidx, &pixmap, &mask);
- if (pixmap == NULL)
- pixmap_create_from_xpm(tb_blank_xpm, &pixmap, &mask);
- if (pixmap == NULL)
- return; /* should at least have blank pixmap, but if not... */
-
- menu->id = gtk_toolbar_insert_item(
- toolbar,
- (char *)(menu->dname),
- (char *)(menu->strings[MENU_INDEX_TIP]),
- (char *)(menu->dname),
- gtk_pixmap_new(pixmap, mask),
- GTK_SIGNAL_FUNC(menu_item_activate),
- (gpointer)menu,
- idx);
-# endif /* !HAVE_GTK2 */
}
}
else
@@ -837,45 +528,16 @@ gui_gtk_set_mnemonics(int enable)
{
vimmenu_T *menu;
char_u *name;
-# if !defined(HAVE_GTK2) && defined(GTK_USE_ACCEL)
- guint accel_key;
-# endif
for (menu = root_menu; menu != NULL; menu = menu->next)
{
if (menu->id == NULL)
continue;
-# if defined(HAVE_GTK2)
name = translate_mnemonic_tag(menu->name, enable);
gtk_label_set_text_with_mnemonic(GTK_LABEL(menu->label),
(const char *)name);
vim_free(name);
-# else
-# if defined(GTK_USE_ACCEL)
- name = translate_mnemonic_tag(menu->name, TRUE);
- if (name != NULL)
- {
- accel_key = gtk_label_parse_uline(GTK_LABEL(menu->label),
- (const char *)name);
- if (accel_key != GDK_VoidSymbol)
- gtk_widget_remove_accelerator(menu->id, gui.accel_group,
- accel_key, GDK_MOD1_MASK);
- if (enable && accel_key != GDK_VoidSymbol)
- gtk_widget_add_accelerator(menu->id, "activate_item",
- gui.accel_group,
- accel_key, GDK_MOD1_MASK,
- (GtkAccelFlags)0);
- vim_free(name);
- }
- if (!enable)
- {
- name = translate_mnemonic_tag(menu->name, FALSE);
- gtk_label_parse_uline(GTK_LABEL(menu->label), (const char *)name);
- vim_free(name);
- }
-# endif
-# endif
}
}
@@ -903,58 +565,7 @@ gui_mch_toggle_tearoffs(int enable)
}
#endif /* FEAT_MENU */
-
-#if defined(FEAT_TOOLBAR) && !defined(HAVE_GTK2)
-/*
- * Seems like there's a hole in the GTK Toolbar API: there's no provision for
- * removing an item from the toolbar. Therefore I need to resort to going
- * really deeply into the internal widget structures.
- *
- * <danielk> I'm not sure the statement above is true -- at least with
- * GTK+ 2 one can just call gtk_widget_destroy() and be done with it.
- * It is true though that you couldn't remove space items before GTK+ 2
- * (without digging into the internals that is). But the code below
- * doesn't seem to handle those either. Well, it's obsolete anyway.
- */
- static void
-toolbar_remove_item_by_text(GtkToolbar *tb, const char *text)
-{
- GtkContainer *container;
- GList *childl;
- GtkToolbarChild *gtbc;
-
- g_return_if_fail(tb != NULL);
- g_return_if_fail(GTK_IS_TOOLBAR(tb));
- container = GTK_CONTAINER(&tb->container);
-
- for (childl = tb->children; childl; childl = childl->next)
- {
- gtbc = (GtkToolbarChild *)childl->data;
-
- if (gtbc->type != GTK_TOOLBAR_CHILD_SPACE
- && strcmp(GTK_LABEL(gtbc->label)->label, text) == 0)
- {
- gboolean was_visible;
-
- was_visible = GTK_WIDGET_VISIBLE(gtbc->widget);
- gtk_widget_unparent(gtbc->widget);
-
- tb->children = g_list_remove_link(tb->children, childl);
- g_free(gtbc);
- g_list_free(childl);
- tb->num_children--;
-
- if (was_visible && GTK_WIDGET_VISIBLE(container))
- gtk_widget_queue_resize(GTK_WIDGET(container));
-
- break;
- }
- }
-}
-#endif /* FEAT_TOOLBAR && !HAVE_GTK2 */
-
-
-#if defined(FEAT_TOOLBAR) && defined(HAVE_GTK2)
+#if defined(FEAT_TOOLBAR)
static int
get_menu_position(vimmenu_T *menu)
{
@@ -969,7 +580,7 @@ get_menu_position(vimmenu_T *menu)
return idx;
}
-#endif /* FEAT_TOOLBAR && HAVE_GTK2 */
+#endif /* FEAT_TOOLBAR */
#if defined(FEAT_TOOLBAR) || defined(PROTO)
@@ -981,18 +592,12 @@ gui_mch_menu_set_tip(vimmenu_T *menu)
{
char_u *tooltip;
-# ifdef HAVE_GTK2
tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]);
if (tooltip == NULL || utf_valid_string(tooltip, NULL))
/* Only set the tooltip when it's valid utf-8. */
-# else
- tooltip = menu->strings[MENU_INDEX_TIP];
-# endif
gtk_tooltips_set_tip(GTK_TOOLBAR(gui.toolbar)->tooltips,
menu->id, (const char *)tooltip, NULL);
-# ifdef HAVE_GTK2
CONVERT_TO_UTF8_FREE(tooltip);
-# endif
}
}
#endif /* FEAT_TOOLBAR */
@@ -1008,16 +613,11 @@ gui_mch_destroy_menu(vimmenu_T *menu)
# ifdef FEAT_TOOLBAR
if (menu->parent != NULL && menu_is_toolbar(menu->parent->name))
{
-# ifdef HAVE_GTK2
if (menu_is_separator(menu->name))
gtk_toolbar_remove_space(GTK_TOOLBAR(gui.toolbar),
get_menu_position(menu));
else if (menu->id != NULL)
gtk_widget_destroy(menu->id);
-# else
- toolbar_remove_item_by_text(GTK_TOOLBAR(gui.toolbar),
- (const char *)menu->dname);
-# endif
}
else
# endif /* FEAT_TOOLBAR */
@@ -1054,21 +654,11 @@ gui_mch_set_scrollbar_thumb(scrollbar_T *sb, long val, long size, long max)
adjustment->page_increment = size < 3L ? 1L : size - 2L;
adjustment->step_increment = 1.0;
-#ifdef HAVE_GTK2
g_signal_handler_block(GTK_OBJECT(adjustment),
(gulong)sb->handler_id);
-#else
- gtk_signal_handler_block(GTK_OBJECT(adjustment),
- (guint)sb->handler_id);
-#endif
gtk_adjustment_changed(adjustment);
-#ifdef HAVE_GTK2
g_signal_handler_unblock(GTK_OBJECT(adjustment),
(gulong)sb->handler_id);
-#else
- gtk_signal_handler_unblock(GTK_OBJECT(adjustment),
- (guint)sb->handler_id);
-#endif
}
}
@@ -1108,7 +698,6 @@ adjustment_value_changed(GtkAdjustment *adjustment, gpointer data)
*/
if (sb != NULL)
{
-#ifdef HAVE_GTK2
dragging = TRUE;
if (sb->wp != NULL)
@@ -1139,9 +728,6 @@ adjustment_value_changed(GtkAdjustment *adjustment, gpointer data)
}
}
}
-#else
- dragging = (GTK_RANGE(sb->id)->scroll_type == GTK_SCROLL_NONE);
-#endif
}
gui_drag_scrollbar(sb, value, dragging);
@@ -1193,7 +779,7 @@ gui_mch_destroy_scrollbar(scrollbar_T *sb)
/*
* Implementation of the file selector related stuff
*/
-#if defined(HAVE_GTK2) && GTK_CHECK_VERSION(2,4,0)
+#if GTK_CHECK_VERSION(2,4,0)
/* This has been disabled, because the GTK library rewrites
* ~/.recently-used.xbel every time the main loop is quit. For Vim that means
* on just about any event. */
@@ -1271,9 +857,7 @@ gui_mch_browse(int saving UNUSED,
#endif
char_u dirbuf[MAXPATHL];
-# ifdef HAVE_GTK2
title = CONVERT_TO_UTF8(title);
-# endif
/* GTK has a bug, it only works with an absolute path. */
if (initdir == NULL || *initdir == NUL)
@@ -1343,28 +927,20 @@ gui_mch_browse(int saving UNUSED,
gtk_file_selection_set_filename(GTK_FILE_SELECTION(gui.filedlg),
(const gchar *)dirbuf);
-# ifndef HAVE_GTK2
- gui_gtk_position_in_parent(GTK_WIDGET(gui.mainwin),
- GTK_WIDGET(gui.filedlg), VW_POS_MOUSE);
-# endif
gtk_widget_show(gui.filedlg);
while (gui.filedlg && GTK_WIDGET_DRAWABLE(gui.filedlg))
gtk_main_iteration_do(TRUE);
#endif
-# ifdef HAVE_GTK2
CONVERT_TO_UTF8_FREE(title);
-# endif
if (gui.browse_fname == NULL)
return NULL;
/* shorten the file name if possible */
return vim_strsave(shorten_fname1(gui.browse_fname));
}
-#if defined(HAVE_GTK2) || defined(PROTO)
-
/*
* Put up a directory selector
* Returns the selected name in allocated memory, or NULL for Cancel.
@@ -1428,544 +1004,11 @@ gui_mch_browsedir(
return gui_mch_browse(0, title, NULL, NULL, initdir, NULL);
# endif
}
-#endif
#endif /* FEAT_BROWSE */
-#if defined(FEAT_GUI_DIALOG) && !defined(HAVE_GTK2)
-
-static char_u *dialog_textfield = NULL;
-static GtkWidget *dialog_textentry;
-
- static void
-dlg_destroy(GtkWidget *dlg)
-{
- if (dialog_textfield != NULL)
- {
- const char *text;
-
- text = gtk_entry_get_text(GTK_ENTRY(dialog_textentry));
- vim_strncpy(dialog_textfield, (char_u *)text, IOSIZE - 1);
- }
-
- /* Destroy the dialog, will break the waiting loop. */
- gtk_widget_destroy(dlg);
-}
-
-# ifdef FEAT_GUI_GNOME
- static int
-gui_gnome_dialog( int type,
- char_u *title,
- char_u *message,
- char_u *buttons,
- int dfltbutton,
- char_u *textfield)
-{
- GtkWidget *dlg;
- char *gdtype;
- char_u *buttons_copy, *p, *next;
- char **buttons_list;
- int butcount, cur;
-
- /* make a copy, so that we can insert NULs */
- if ((buttons_copy = vim_strsave(buttons)) == NULL)
- return -1;
-
- /* determine exact number of buttons and allocate array to hold them */
- for (butcount = 0, p = buttons; *p; p++)
- {
- if (*p == '\n')
- butcount++;
- }
- butcount++;
- buttons_list = g_new0(char *, butcount + 1);
-
- /* Add pixmap */
- switch (type)
- {
- case VIM_ERROR:
- gdtype = GNOME_MESSAGE_BOX_ERROR;
- break;
- case VIM_WARNING:
- gdtype = GNOME_MESSAGE_BOX_WARNING;
- break;
- case VIM_INFO:
- gdtype = GNOME_MESSAGE_BOX_INFO;
- break;
- case VIM_QUESTION:
- gdtype = GNOME_MESSAGE_BOX_QUESTION;
- break;
- default:
- gdtype = GNOME_MESSAGE_BOX_GENERIC;
- };
-
- p = buttons_copy;
- for (cur = 0; cur < butcount; ++cur)
- {
- for (next = p; *next; ++next)
- {
- if (*next == DLG_HOTKEY_CHAR)
- STRMOVE(next, next + 1);
- if (*next == DLG_BUTTON_SEP)
- {
- *next++ = NUL;
- break;
- }
- }
-
- /* this should probably go into a table, but oh well */
- if (g_strcasecmp((char *)p, "Ok") == 0)
- buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_OK);
- else if (g_strcasecmp((char *)p, "Cancel") == 0)
- buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_CANCEL);
- else if (g_strcasecmp((char *)p, "Yes") == 0)
- buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_YES);
- else if (g_strcasecmp((char *)p, "No") == 0)
- buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_NO);
- else if (g_strcasecmp((char *)p, "Close") == 0)
- buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_CLOSE);
- else if (g_strcasecmp((char *)p, "Help") == 0)
- buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_HELP);
- else if (g_strcasecmp((char *)p, "Apply") == 0)
- buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_APPLY);
-#if 0
- /*
- * these aren't really used that often anyway, but are listed here as
- * placeholders in case we need them.
- */
- else if (g_strcasecmp((char *)p, "Next") == 0)
- buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_NEXT);
- else if (g_strcasecmp((char *)p, "Prev") == 0)
- buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_PREV);
- else if (g_strcasecmp((char *)p, "Up") == 0)
- buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_UP);
- else if (g_strcasecmp((char *)p, "Down") == 0)
- buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_DOWN);
- else if (g_strcasecmp((char *)p, "Font") == 0)
- buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_FONT);
-#endif
- else
- buttons_list[cur] = g_strdup((char *)p);
-
- if (*next == NUL)
- break;
-
- p = next;
- }
- vim_free(buttons_copy);
-
- dlg = gnome_message_box_newv((const char *)message,
- (const char *)gdtype,
- (const char **)buttons_list);
- for (cur = 0; cur < butcount; ++cur)
- g_free(buttons_list[cur]);
- g_free(buttons_list);
-
- dialog_textfield = textfield;
- if (textfield != NULL)
- {
- /* Add text entry field */
- dialog_textentry = gtk_entry_new();
- gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dlg)->vbox), dialog_textentry,
- TRUE, TRUE, 0);
- gtk_entry_set_text(GTK_ENTRY(dialog_textentry),
- (const gchar *)textfield);
- gtk_entry_select_region(GTK_ENTRY(dialog_textentry), 0,
- STRLEN(textfield));
- gtk_entry_set_max_length(GTK_ENTRY(dialog_textentry), IOSIZE - 1);
- gtk_entry_set_position(GTK_ENTRY(dialog_textentry), STRLEN(textfield));
- gtk_widget_show(dialog_textentry);
- gtk_window_set_focus(GTK_WINDOW(dlg), dialog_textentry);
- }
-
- gtk_signal_connect_object(GTK_OBJECT(dlg), "destroy",
- GTK_SIGNAL_FUNC(dlg_destroy), GTK_OBJECT(dlg));
- gnome_dialog_set_default(GNOME_DIALOG(dlg), dfltbutton + 1);
- gui_gtk_position_in_parent(GTK_WIDGET(gui.mainwin),
- GTK_WIDGET(dlg), VW_POS_MOUSE);
-
- return (1 + gnome_dialog_run_and_close(GNOME_DIALOG(dlg)));
-}
-
-# endif /* FEAT_GUI_GNOME */
-
-typedef struct _ButtonData