mirror of
https://github.com/zoriya/vim.git
synced 2025-12-19 13:45:18 +00:00
Remove the old and not well supported GTK 1 code. (James Vega)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,6 +337,7 @@ 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
|
||||
@@ -346,11 +345,8 @@ CClink = $(CC)
|
||||
# --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
|
||||
|
||||
438
src/auto/configure
vendored
438
src/auto/configure
vendored
@@ -607,7 +607,6 @@ GUI_LIB_LOC
|
||||
GUI_INC_LOC
|
||||
NARROW_PROTO
|
||||
MOTIF_LIBNAME
|
||||
GNOME_CONFIG
|
||||
GNOME_INCLUDEDIR
|
||||
GNOME_LIBDIR
|
||||
GNOME_LIBS
|
||||
@@ -615,8 +614,6 @@ 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,7 +7194,6 @@ $as_echo "yes" >&6; };
|
||||
|
||||
datadir='${prefix}/Vim.app/Contents/Resources'
|
||||
|
||||
SKIP_GTK=YES;
|
||||
SKIP_GTK2=YES;
|
||||
SKIP_GNOME=YES;
|
||||
SKIP_MOTIF=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
|
||||
@@ -7573,159 +7396,13 @@ $as_echo "no" >&6; }
|
||||
|
||||
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, µ) != 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
|
||||
|
||||
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
|
||||
|
||||
|
||||
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 "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
|
||||
|| test "0$gtk_minor_version" -ge 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,100 +7479,9 @@ $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
|
||||
if test "x$have_gnome" = xyes ; then
|
||||
$as_echo "#define FEAT_GUI_GNOME 1" >>confdefs.h
|
||||
|
||||
GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
|
||||
@@ -7903,8 +7489,6 @@ $as_echo "not found" >&6; }
|
||||
fi
|
||||
}
|
||||
fi
|
||||
}
|
||||
fi
|
||||
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"
|
||||
|
||||
177
src/configure.in
177
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,7 +1295,7 @@ 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.
|
||||
@@ -1304,7 +1303,6 @@ 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,32 +1651,13 @@ 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"
|
||||
@@ -1786,54 +1670,25 @@ if test -z "$SKIP_GTK"; then
|
||||
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
|
||||
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
|
||||
{
|
||||
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
|
||||
|| test "0$gtk_minor_version" -ge 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 GTK exists, then check for GNOME.
|
||||
dnl
|
||||
if test -z "$SKIP_GNOME"; then
|
||||
{
|
||||
GNOME_INIT_HOOK([have_gnome=yes])
|
||||
if test x$have_gnome = xyes ; then
|
||||
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
|
||||
}
|
||||
fi
|
||||
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
|
||||
|
||||
@@ -11813,10 +11813,8 @@ f_has(argvars, rettv)
|
||||
#endif
|
||||
#ifdef FEAT_GUI_GTK
|
||||
"gui_gtk",
|
||||
# ifdef HAVE_GTK2
|
||||
"gui_gtk2",
|
||||
#endif
|
||||
#endif
|
||||
#ifdef FEAT_GUI_GNOME
|
||||
"gui_gnome",
|
||||
#endif
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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
|
||||
|
||||
14
src/gui.h
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 */
|
||||
|
||||
@@ -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,8 +889,6 @@ 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
|
||||
@@ -1060,7 +1034,6 @@ set_printable_label_text(GtkLabel *label, char_u *text)
|
||||
pango_attr_list_unref(attr_list);
|
||||
}
|
||||
# undef IS_NONPRINTABLE
|
||||
# endif /* HAVE_GTK2 */
|
||||
|
||||
/*
|
||||
* 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,7 +1065,6 @@ 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
|
||||
@@ -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);
|
||||
|
||||
1239
src/gui_gtk.c
1239
src/gui_gtk.c
File diff suppressed because it is too large
Load Diff
@@ -54,10 +54,6 @@ static void gtk_form_size_request(GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_form_size_allocate(GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
#ifndef HAVE_GTK2 /* this isn't needed in gtk2 */
|
||||
static void gtk_form_draw(GtkWidget *widget,
|
||||
GdkRectangle *area);
|
||||
#endif
|
||||
static gint gtk_form_expose(GtkWidget *widget,
|
||||
GdkEventExpose *event);
|
||||
|
||||
@@ -172,27 +168,6 @@ gtk_form_move(GtkForm *form,
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(HAVE_GTK2) || defined(PROTO)
|
||||
void
|
||||
gtk_form_set_size(GtkForm *form, guint width, guint height)
|
||||
{
|
||||
g_return_if_fail(GTK_IS_FORM(form));
|
||||
|
||||
/* prevent useless calls */
|
||||
if (form->width == width && form->height == height)
|
||||
return;
|
||||
form->width = width;
|
||||
form->height = height;
|
||||
|
||||
/* signal the change */
|
||||
#ifdef HAVE_GTK2
|
||||
gtk_widget_queue_resize(gtk_widget_get_parent(GTK_WIDGET(form)));
|
||||
#else
|
||||
gtk_container_queue_resize(GTK_CONTAINER(GTK_WIDGET(form)->parent));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
gtk_form_freeze(GtkForm *form)
|
||||
{
|
||||
@@ -211,11 +186,7 @@ gtk_form_thaw(GtkForm *form)
|
||||
if (!(--form->freeze_count))
|
||||
{
|
||||
gtk_form_position_children(form);
|
||||
#ifdef HAVE_GTK2
|
||||
gtk_widget_queue_draw(GTK_WIDGET(form));
|
||||
#else
|
||||
gtk_widget_draw(GTK_WIDGET(form), NULL);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -259,9 +230,6 @@ gtk_form_class_init(GtkFormClass *klass)
|
||||
widget_class->map = gtk_form_map;
|
||||
widget_class->size_request = gtk_form_size_request;
|
||||
widget_class->size_allocate = gtk_form_size_allocate;
|
||||
#ifndef HAVE_GTK2 /* not needed for GTK2 */
|
||||
widget_class->draw = gtk_form_draw;
|
||||
#endif
|
||||
widget_class->expose_event = gtk_form_expose;
|
||||
|
||||
container_class->remove = gtk_form_remove;
|
||||
@@ -421,37 +389,6 @@ gtk_form_unrealize(GtkWidget *widget)
|
||||
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
|
||||
}
|
||||
|
||||
#ifndef HAVE_GTK2
|
||||
static void
|
||||
gtk_form_draw(GtkWidget *widget, GdkRectangle *area)
|
||||
{
|
||||
GtkForm *form;
|
||||
GList *children;
|
||||
GtkFormChild *child;
|
||||
GdkRectangle child_area;
|
||||
|
||||
g_return_if_fail(GTK_IS_FORM(widget));
|
||||
|
||||
if (GTK_WIDGET_DRAWABLE(widget))
|
||||
{
|
||||
form = GTK_FORM(widget);
|
||||
|
||||
children = form->children;
|
||||
|
||||
while (children)
|
||||
{
|
||||
child = children->data;
|
||||
|
||||
if (GTK_WIDGET_DRAWABLE(child->widget)
|
||||
&& gtk_widget_intersect(child->widget, area, &child_area))
|
||||
gtk_widget_draw(child->widget, &child_area);
|
||||
|
||||
children = children->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* !HAVE_GTK2 */
|
||||
|
||||
static void
|
||||
gtk_form_size_request(GtkWidget *widget, GtkRequisition *requisition)
|
||||
{
|
||||
@@ -536,7 +473,6 @@ gtk_form_expose(GtkWidget *widget, GdkEventExpose *event)
|
||||
|
||||
for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
|
||||
{
|
||||
#ifdef HAVE_GTK2
|
||||
GtkFormChild *formchild = tmp_list->data;
|
||||
GtkWidget *child = formchild->widget;
|
||||
/*
|
||||
@@ -557,12 +493,6 @@ gtk_form_expose(GtkWidget *widget, GdkEventExpose *event)
|
||||
gtk_widget_send_expose(child, (GdkEvent *)&child_event);
|
||||
}
|
||||
}
|
||||
#else /* !HAVE_GTK2 */
|
||||
GtkFormChild *child = tmp_list->data;
|
||||
|
||||
if (event->window == child->window)
|
||||
return gtk_widget_event(child->widget, (GdkEvent *) event);
|
||||
#endif /* !HAVE_GTK2 */
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -854,28 +784,12 @@ gtk_form_main_filter(GdkXEvent *gdk_xevent,
|
||||
return GDK_FILTER_CONTINUE;
|
||||
}
|
||||
|
||||
/* Routines to set the window gravity, and check whether it is
|
||||
* functional. Extra capabilities need to be added to GDK, so
|
||||
* we don't have to use Xlib here.
|
||||
*/
|
||||
static void
|
||||
gtk_form_set_static_gravity(GdkWindow *window, gboolean use_static)
|
||||
{
|
||||
#ifdef HAVE_GTK2
|
||||
/* We don't check if static gravity is actually supported, because it
|
||||
* results in an annoying assertion error message. */
|
||||
gdk_window_set_static_gravities(window, use_static);
|
||||
#else
|
||||
XSetWindowAttributes xattributes;
|
||||
|
||||
xattributes.win_gravity = (use_static) ? StaticGravity : NorthWestGravity;
|
||||
xattributes.bit_gravity = (use_static) ? StaticGravity : NorthWestGravity;
|
||||
|
||||
XChangeWindowAttributes(GDK_WINDOW_XDISPLAY(window),
|
||||
GDK_WINDOW_XWINDOW(window),
|
||||
CWBitGravity | CWWinGravity,
|
||||
&xattributes);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -903,11 +817,7 @@ gtk_form_send_configure(GtkForm *form)
|
||||
event.width = widget->allocation.width;
|
||||
event.height = widget->allocation.height;
|
||||
|
||||
#ifdef HAVE_GTK2
|
||||
gtk_main_do_event((GdkEvent*)&event);
|
||||
#else
|
||||
gtk_widget_event(widget, (GdkEvent*)&event);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -62,7 +62,6 @@ void gtk_form_move(GtkForm *form, GtkWidget * widget,
|
||||
void gtk_form_move_resize(GtkForm * form, GtkWidget * widget,
|
||||
gint x, gint y,
|
||||
gint w, gint h);
|
||||
void gtk_form_set_size(GtkForm * form, guint width, guint height);
|
||||
|
||||
/* These disable and enable moving and repainting respectively. If you
|
||||
* want to update the layout's offsets but do not want it to repaint
|
||||
|
||||
1310
src/gui_gtk_x11.c
1310
src/gui_gtk_x11.c
File diff suppressed because it is too large
Load Diff
@@ -3233,9 +3233,7 @@ usage()
|
||||
main_msg(_("-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"));
|
||||
main_msg(_("-reverse\t\tUse reverse video (also: -rv)"));
|
||||
main_msg(_("-display <display>\tRun vim on <display> (also: --display)"));
|
||||
# ifdef HAVE_GTK2
|
||||
main_msg(_("--role <role>\tSet a unique role to identify the main window"));
|
||||
# endif
|
||||
main_msg(_("--socketid <xid>\tOpen Vim inside another GTK widget"));
|
||||
#endif
|
||||
#ifdef FEAT_GUI_W32
|
||||
|
||||
871
src/mbyte.c
871
src/mbyte.c
@@ -100,7 +100,7 @@
|
||||
#include <X11/Xlocale.h>
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_GUI_GTK) && defined(FEAT_XIM) && defined(HAVE_GTK2)
|
||||
#if defined(FEAT_GUI_GTK) && defined(FEAT_XIM)
|
||||
# include <gdk/gdkkeysyms.h>
|
||||
# ifdef WIN3264
|
||||
# include <gdk/gdkwin32.h>
|
||||
@@ -5068,147 +5068,6 @@ static XIMStyle input_style;
|
||||
static int status_area_enabled = TRUE;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_GUI_GTK
|
||||
# ifdef WIN3264
|
||||
# include <gdk/gdkwin32.h>
|
||||
# else
|
||||
# include <gdk/gdkx.h>
|
||||
# endif
|
||||
#else
|
||||
# ifdef PROTO
|
||||
/* Define a few things to be able to generate prototypes while not configured
|
||||
* for GTK. */
|
||||
# define GSList int
|
||||
# define gboolean int
|
||||
typedef int GdkEvent;
|
||||
typedef int GdkEventKey;
|
||||
# define GdkIC int
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_GUI_GTK) || defined(PROTO)
|
||||
static int preedit_buf_len = 0;
|
||||
static int xim_can_preediting INIT(= FALSE); /* XIM in showmode() */
|
||||
static int xim_input_style;
|
||||
#ifndef FEAT_GUI_GTK
|
||||
# define gboolean int
|
||||
#endif
|
||||
static gboolean use_status_area = 0;
|
||||
|
||||
static int im_xim_str2keycode __ARGS((unsigned int *code, unsigned int *state));
|
||||
static void im_xim_send_event_imactivate __ARGS((void));
|
||||
|
||||
/*
|
||||
* Convert string to keycode and state for XKeyEvent.
|
||||
* When string is valid return OK, when invalid return FAIL.
|
||||
*
|
||||
* See 'imactivatekey' documentation for the format.
|
||||
*/
|
||||
static int
|
||||
im_xim_str2keycode(code, state)
|
||||
unsigned int *code;
|
||||
unsigned int *state;
|
||||
{
|
||||
int retval = OK;
|
||||
int len;
|
||||
unsigned keycode = 0, keystate = 0;
|
||||
Window window;
|
||||
Display *display;
|
||||
char_u *flag_end;
|
||||
char_u *str;
|
||||
|
||||
if (*p_imak != NUL)
|
||||
{
|
||||
len = STRLEN(p_imak);
|
||||
for (flag_end = p_imak + len - 1;
|
||||
flag_end > p_imak && *flag_end != '-'; --flag_end)
|
||||
;
|
||||
|
||||
/* Parse modifier keys */
|
||||
for (str = p_imak; str < flag_end; ++str)
|
||||
{
|
||||
switch (*str)
|
||||
{
|
||||
case 's': case 'S':
|
||||
keystate |= ShiftMask;
|
||||
break;
|
||||
case 'l': case 'L':
|
||||
keystate |= LockMask;
|
||||
break;
|
||||
case 'c': case 'C':
|
||||
keystate |= ControlMask;
|
||||
break;
|
||||
case '1':
|
||||
keystate |= Mod1Mask;
|
||||
break;
|
||||
case '2':
|
||||
keystate |= Mod2Mask;
|
||||
break;
|
||||
case '3':
|
||||
keystate |= Mod3Mask;
|
||||
break;
|
||||
case '4':
|
||||
keystate |= Mod4Mask;
|
||||
break;
|
||||
case '5':
|
||||
keystate |= Mod5Mask;
|
||||
break;
|
||||
case '-':
|
||||
break;
|
||||
default:
|
||||
retval = FAIL;
|
||||
}
|
||||
}
|
||||
if (*str == '-')
|
||||
++str;
|
||||
|
||||
/* Get keycode from string. */
|
||||
gui_get_x11_windis(&window, &display);
|
||||
if (display)
|
||||
keycode = XKeysymToKeycode(display, XStringToKeysym((char *)str));
|
||||
if (keycode == 0)
|
||||
retval = FAIL;
|
||||
|
||||
if (code != NULL)
|
||||
*code = keycode;
|
||||
if (state != NULL)
|
||||
*state = keystate;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
im_xim_send_event_imactivate()
|
||||
{
|
||||
/* Force turn on preedit state by simulating keypress event.
|
||||
* Keycode and state is specified by 'imactivatekey'.
|
||||
*/
|
||||
XKeyEvent ev;
|
||||
|
||||
gui_get_x11_windis(&ev.window, &ev.display);
|
||||
ev.root = RootWindow(ev.display, DefaultScreen(ev.display));
|
||||
ev.subwindow = None;
|
||||
ev.time = CurrentTime;
|
||||
ev.x = 1;
|
||||
ev.y = 1;
|
||||
ev.x_root = 1;
|
||||
ev.y_root = 1;
|
||||
ev.same_screen = 1;
|
||||
ev.type = KeyPress;
|
||||
if (im_xim_str2keycode(&ev.keycode, &ev.state) == OK)
|
||||
XSendEvent(ev.display, ev.window, 1, KeyPressMask, (XEvent*)&ev);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if 'imactivatekey' has a valid value.
|
||||
*/
|
||||
int
|
||||
im_xim_isvalid_imactivate()
|
||||
{
|
||||
return im_xim_str2keycode(NULL, NULL) == OK;
|
||||
}
|
||||
#endif /* FEAT_GUI_GTK */
|
||||
|
||||
/*
|
||||
* Switch using XIM on/off. This is used by the code that changes "State".
|
||||
*/
|
||||
@@ -5232,124 +5091,6 @@ im_set_active(active)
|
||||
|
||||
/* Remember the active state, it is needed when Vim gets keyboard focus. */
|
||||
xim_is_active = active;
|
||||
|
||||
#ifdef FEAT_GUI_GTK
|
||||
/* When 'imactivatekey' has valid key-string, try to control XIM preedit
|
||||
* state. When 'imactivatekey' has no or invalid string, try old XIM
|
||||
* focus control.
|
||||
*/
|
||||
if (*p_imak != NUL)
|
||||
{
|
||||
/* BASIC STRATEGY:
|
||||
* Destroy old Input Context (XIC), and create new one. New XIC
|
||||
* would have a state of preedit that is off. When argument:active
|
||||
* is false, that's all. Else argument:active is true, send a key
|
||||
* event specified by 'imactivatekey' to activate XIM preedit state.
|
||||
*/
|
||||
|
||||
xim_is_active = TRUE; /* Disable old XIM focus control */
|
||||
/* If we can monitor preedit state with preedit callback functions,
|
||||
* try least creation of new XIC.
|
||||
*/
|
||||
if (xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS)
|
||||
{
|
||||
if (xim_can_preediting && !active)
|
||||
{
|
||||
/* Force turn off preedit state. With some IM
|
||||
* implementations, we cannot turn off preedit state by
|
||||
* simulating keypress event. It is why using such a method
|
||||
* that destroy old IC (input context), and create new one.
|
||||
* When create new IC, its preedit state is usually off.
|
||||
*/
|
||||
xim_reset();
|
||||
xim_set_focus(FALSE);
|
||||
gdk_ic_destroy(xic);
|
||||
xim_init();
|
||||
xim_can_preediting = FALSE;
|
||||
}
|
||||
else if (!xim_can_preediting && active)
|
||||
im_xim_send_event_imactivate();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* First, force destroy old IC, and create new one. It
|
||||
* simulates "turning off preedit state".
|
||||
*/
|
||||
xim_set_focus(FALSE);
|
||||
gdk_ic_destroy(xic);
|
||||
xim_init();
|
||||
xim_can_preediting = FALSE;
|
||||
|
||||
/* 2nd, when requested to activate IM, simulate this by sending
|
||||
* the event.
|
||||
*/
|
||||
if (active)
|
||||
{
|
||||
im_xim_send_event_imactivate();
|
||||
xim_can_preediting = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# ifndef XIMPreeditUnKnown
|
||||
/* X11R5 doesn't have these, it looks safe enough to define here. */
|
||||
typedef unsigned long XIMPreeditState;
|
||||
# define XIMPreeditUnKnown 0L
|
||||
# define XIMPreeditEnable 1L
|
||||
# define XIMPreeditDisable (1L<<1)
|
||||
# define XNPreeditState "preeditState"
|
||||
# endif
|
||||
XIMPreeditState preedit_state = XIMPreeditUnKnown;
|
||||
XVaNestedList preedit_attr;
|
||||
XIC pxic;
|
||||
|
||||
preedit_attr = XVaCreateNestedList(0,
|
||||
XNPreeditState, &preedit_state,
|
||||
NULL);
|
||||
pxic = ((GdkICPrivate *)xic)->xic;
|
||||
|
||||
if (!XGetICValues(pxic, XNPreeditAttributes, preedit_attr, NULL))
|
||||
{
|
||||
XFree(preedit_attr);
|
||||
preedit_attr = XVaCreateNestedList(0,
|
||||
XNPreeditState,
|
||||
active ? XIMPreeditEnable : XIMPreeditDisable,
|
||||
NULL);
|
||||
XSetICValues(pxic, XNPreeditAttributes, preedit_attr, NULL);
|
||||
xim_can_preediting = active;
|
||||
xim_is_active = active;
|
||||
}
|
||||
XFree(preedit_attr);
|
||||
}
|
||||
if (xim_input_style & XIMPreeditCallbacks)
|
||||
{
|
||||
preedit_buf_len = 0;
|
||||
init_preedit_start_col();
|
||||
}
|
||||
#else
|
||||
# if 0
|
||||
/* When had tested kinput2 + canna + Athena GUI version with
|
||||
* 'imactivatekey' is "s-space", im_xim_send_event_imactivate() did not
|
||||
* work correctly. It just inserted one space. I don't know why we
|
||||
* couldn't switch state of XIM preediting. This is reason why these
|
||||
* codes are commented out.
|
||||
*/
|
||||
/* First, force destroy old IC, and create new one. It simulates
|
||||
* "turning off preedit state".
|
||||
*/
|
||||
xim_set_focus(FALSE);
|
||||
XDestroyIC(xic);
|
||||
xic = NULL;
|
||||
xim_init();
|
||||
|
||||
/* 2nd, when requested to activate IM, simulate this by sending the
|
||||
* event.
|
||||
*/
|
||||
if (active)
|
||||
im_xim_send_event_imactivate();
|
||||
# endif
|
||||
#endif
|
||||
xim_set_preedit();
|
||||
}
|
||||
|
||||
@@ -5373,11 +5114,7 @@ xim_set_focus(focus)
|
||||
if (!xim_has_focus)
|
||||
{
|
||||
xim_has_focus = TRUE;
|
||||
#ifdef FEAT_GUI_GTK
|
||||
gdk_im_begin(xic, gui.drawarea->window);
|
||||
#else
|
||||
XSetICFocus(xic);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -5385,11 +5122,7 @@ xim_set_focus(focus)
|
||||
if (xim_has_focus)
|
||||
{
|
||||
xim_has_focus = FALSE;
|
||||
#ifdef FEAT_GUI_GTK
|
||||
gdk_im_end();
|
||||
#else
|
||||
XUnsetICFocus(xic);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5413,89 +5146,6 @@ xim_set_preedit()
|
||||
|
||||
xim_set_focus(TRUE);
|
||||
|
||||
#ifdef FEAT_GUI_GTK
|
||||
if (gdk_im_ready())
|
||||
{
|
||||
int attrmask;
|
||||
GdkICAttr *attr;
|
||||
|
||||
if (!xic_attr)
|
||||
return;
|
||||
|
||||
attr = xic_attr;
|
||||
attrmask = 0;
|
||||
|
||||
# ifdef FEAT_XFONTSET
|
||||
if ((xim_input_style & (int)GDK_IM_PREEDIT_POSITION)
|
||||
&& gui.fontset != NOFONTSET
|
||||
&& gui.fontset->type == GDK_FONT_FONTSET)
|
||||
{
|
||||
if (!xim_has_focus)
|
||||
{
|
||||
if (attr->spot_location.y >= 0)
|
||||
{
|
||||
attr->spot_location.x = 0;
|
||||
attr->spot_location.y = -100;
|
||||
attrmask |= (int)GDK_IC_SPOT_LOCATION;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gint width, height;
|
||||
|
||||
if (attr->spot_location.x != TEXT_X(gui.col)
|
||||
|| attr->spot_location.y != TEXT_Y(gui.row))
|
||||
{
|
||||
attr->spot_location.x = TEXT_X(gui.col);
|
||||
attr->spot_location.y = TEXT_Y(gui.row);
|
||||
attrmask |= (int)GDK_IC_SPOT_LOCATION;
|
||||
}
|
||||
|
||||
gdk_window_get_size(gui.drawarea->window, &width, &height);
|
||||
width -= 2 * gui.border_offset;
|
||||
height -= 2 * gui.border_offset;
|
||||
if (xim_input_style & (int)GDK_IM_STATUS_AREA)
|
||||
height -= gui.char_height;
|
||||
if (attr->preedit_area.width != width
|
||||
|| attr->preedit_area.height != height)
|
||||
{
|
||||
attr->preedit_area.x = gui.border_offset;
|
||||
attr->preedit_area.y = gui.border_offset;
|
||||
attr->preedit_area.width = width;
|
||||
attr->preedit_area.height = height;
|
||||
attrmask |= (int)GDK_IC_PREEDIT_AREA;
|
||||
}
|
||||
|
||||
if (attr->preedit_fontset != gui.current_font)
|
||||
{
|
||||
attr->preedit_fontset = gui.current_font;
|
||||
attrmask |= (int)GDK_IC_PREEDIT_FONTSET;
|
||||
}
|
||||
}
|
||||
}
|
||||
# endif /* FEAT_XFONTSET */
|
||||
|
||||
if (xim_fg_color == INVALCOLOR)
|
||||
{
|
||||
xim_fg_color = gui.def_norm_pixel;
|
||||
xim_bg_color = gui.def_back_pixel;
|
||||
}
|
||||
if (attr->preedit_foreground.pixel != xim_fg_color)
|
||||
{
|
||||
attr->preedit_foreground.pixel = xim_fg_color;
|
||||
attrmask |= (int)GDK_IC_PREEDIT_FOREGROUND;
|
||||
}
|
||||
if (attr->preedit_background.pixel != xim_bg_color)
|
||||
{
|
||||
attr->preedit_background.pixel = xim_bg_color;
|
||||
attrmask |= (int)GDK_IC_PREEDIT_BACKGROUND;
|
||||
}
|
||||
|
||||
if (attrmask != 0)
|
||||
gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask);
|
||||
}
|
||||
#else /* FEAT_GUI_GTK */
|
||||
{
|
||||
XVaNestedList attr_list;
|
||||
XRectangle spot_area;
|
||||
XPoint over_spot;
|
||||
@@ -5541,8 +5191,6 @@ xim_set_preedit()
|
||||
XFree(attr_list);
|
||||
}
|
||||
}
|
||||
#endif /* FEAT_GUI_GTK */
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up the status area.
|
||||
@@ -5558,43 +5206,6 @@ xim_set_status_area()
|
||||
if (xic == NULL)
|
||||
return;
|
||||
|
||||
#ifdef FEAT_GUI_GTK
|
||||
# if defined(FEAT_XFONTSET)
|
||||
if (use_status_area)
|
||||
{
|
||||
GdkICAttr *attr;
|
||||
int style;
|
||||
gint width, height;
|
||||
GtkWidget *widget;
|
||||
int attrmask;
|
||||
|
||||
if (!xic_attr)
|
||||
return;
|
||||
|
||||
attr = xic_attr;
|
||||
attrmask = 0;
|
||||
style = (int)gdk_ic_get_style(xic);
|
||||
if ((style & (int)GDK_IM_STATUS_MASK) == (int)GDK_IM_STATUS_AREA)
|
||||
{
|
||||
if (gui.fontset != NOFONTSET
|
||||
&& gui.fontset->type == GDK_FONT_FONTSET)
|
||||
{
|
||||
widget = gui.mainwin;
|
||||
gdk_window_get_size(widget->window, &width, &height);
|
||||
|
||||
attrmask |= (int)GDK_IC_STATUS_AREA;
|
||||
attr->status_area.x = 0;
|
||||
attr->status_area.y = height - gui.char_height - 1;
|
||||
attr->status_area.width = width;
|
||||
attr->status_area.height = gui.char_height;
|
||||
}
|
||||
}
|
||||
if (attrmask != 0)
|
||||
gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask);
|
||||
}
|
||||
# endif
|
||||
#else
|
||||
{
|
||||
XVaNestedList preedit_list = 0, status_list = 0, list = 0;
|
||||
XRectangle pre_area, status_area;
|
||||
|
||||
@@ -5685,10 +5296,8 @@ xim_set_status_area()
|
||||
if (preedit_list)
|
||||
XFree(preedit_list);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
|
||||
#if defined(FEAT_GUI_X11)
|
||||
static char e_xim[] = N_("E285: Failed to create input context");
|
||||
#endif
|
||||
|
||||
@@ -5998,483 +5607,11 @@ xim_real_init(x11_window, x11_display)
|
||||
|
||||
#endif /* FEAT_GUI_X11 */
|
||||
|
||||
#if defined(FEAT_GUI_GTK) || defined(PROTO)
|
||||
|
||||
# ifdef FEAT_XFONTSET
|
||||
static char e_overthespot[] = N_("E290: over-the-spot style requires fontset");
|
||||
# endif
|
||||
|
||||
# ifdef PROTO
|
||||
typedef int GdkIC;
|
||||
# endif
|
||||
|
||||
void
|
||||
xim_decide_input_style()
|
||||
{
|
||||
/* GDK_IM_STATUS_CALLBACKS was disabled, enabled it to allow Japanese
|
||||
* OverTheSpot. */
|
||||
int supported_style = (int)GDK_IM_PREEDIT_NONE |
|
||||
(int)GDK_IM_PREEDIT_NOTHING |
|
||||
(int)GDK_IM_PREEDIT_POSITION |
|
||||
(int)GDK_IM_PREEDIT_CALLBACKS |
|
||||
(int)GDK_IM_STATUS_CALLBACKS |
|
||||
(int)GDK_IM_STATUS_AREA |
|
||||
(int)GDK_IM_STATUS_NONE |
|
||||
(int)GDK_IM_STATUS_NOTHING;
|
||||
|
||||
#ifdef XIM_DEBUG
|
||||
xim_log("xim_decide_input_style()\n");
|
||||
#endif
|
||||
|
||||
if (!gdk_im_ready())
|
||||
xim_input_style = 0;
|
||||
else
|
||||
{
|
||||
if (gtk_major_version > 1
|
||||
|| (gtk_major_version == 1
|
||||
&& (gtk_minor_version > 2
|
||||
|| (gtk_minor_version == 2 && gtk_micro_version >= 3))))
|
||||
use_status_area = TRUE;
|
||||
else
|
||||
{
|
||||
EMSG(_("E291: Your GTK+ is older than 1.2.3. Status area disabled"));
|
||||
use_status_area = FALSE;
|
||||
}
|
||||
#ifdef FEAT_XFONTSET
|
||||
if (gui.fontset == NOFONTSET || gui.fontset->type != GDK_FONT_FONTSET)
|
||||
#endif
|
||||
supported_style &= ~((int)GDK_IM_PREEDIT_POSITION
|
||||
| (int)GDK_IM_STATUS_AREA);
|
||||
if (!use_status_area)
|
||||
supported_style &= ~(int)GDK_IM_STATUS_AREA;
|
||||
xim_input_style = (int)gdk_im_decide_style((GdkIMStyle)supported_style);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
preedit_start_cbproc(XIC thexic UNUSED,
|
||||
XPointer client_data UNUSED,
|
||||
XPointer call_data UNUSED)
|
||||
{
|
||||
#ifdef XIM_DEBUG
|
||||
xim_log("xim_decide_input_style()\n");
|
||||
#endif
|
||||
|
||||
draw_feedback = NULL;
|
||||
xim_can_preediting = TRUE;
|
||||
xim_has_preediting = TRUE;
|
||||
gui_update_cursor(TRUE, FALSE);
|
||||
if (showmode() > 0)
|
||||
{
|
||||
setcursor();
|
||||
out_flush();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
xim_back_delete(int n)
|
||||
{
|
||||
char_u str[3];
|
||||
|
||||
str[0] = CSI;
|
||||
str[1] = 'k';
|
||||
str[2] = 'b';
|
||||
while (n-- > 0)
|
||||
add_to_input_buf(str, 3);
|
||||
}
|
||||
|
||||
static GSList *key_press_event_queue = NULL;
|
||||
static gboolean processing_queued_event = FALSE;
|
||||
|
||||
static void
|
||||
preedit_draw_cbproc(XIC thexic UNUSED,
|
||||
XPointer client_data UNUSED,
|
||||
XPointer call_data)
|
||||
{
|
||||
XIMPreeditDrawCallbackStruct *draw_data;
|
||||
XIMText *text;
|
||||
char *src;
|
||||
GSList *event_queue;
|
||||
|
||||
#ifdef XIM_DEBUG
|
||||
xim_log("preedit_draw_cbproc()\n");
|
||||
#endif
|
||||
|
||||
draw_data = (XIMPreeditDrawCallbackStruct *) call_data;
|
||||
text = (XIMText *) draw_data->text;
|
||||
|
||||
if ((text == NULL && draw_data->chg_length == preedit_buf_len)
|
||||
|| preedit_buf_len == 0)
|
||||
{
|
||||
init_preedit_start_col();
|
||||
vim_free(draw_feedback);
|
||||
draw_feedback = NULL;
|
||||
}
|
||||
if (draw_data->chg_length > 0)
|
||||
{
|
||||
int bs_cnt;
|
||||
|
||||
if (draw_data->chg_length > preedit_buf_len)
|
||||
bs_cnt = preedit_buf_len;
|
||||
else
|
||||
bs_cnt = draw_data->chg_length;
|
||||
xim_back_delete(bs_cnt);
|
||||
preedit_buf_len -= bs_cnt;
|
||||
}
|
||||
if (text != NULL)
|
||||
{
|
||||
int len;
|
||||
#ifdef FEAT_MBYTE
|
||||
char_u *buf = NULL;
|
||||
unsigned int nfeedback = 0;
|
||||
#endif
|
||||
char_u *ptr;
|
||||
|
||||
src = text->string.multi_byte;
|
||||
if (src != NULL && !text->encoding_is_wchar)
|
||||
{
|
||||
len = strlen(src);
|
||||
ptr = (char_u *)src;
|
||||
/* Avoid the enter for decision */
|
||||
if (*ptr == '\n')
|
||||
return;
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (input_conv.vc_type != CONV_NONE
|
||||
&& (buf = string_convert(&input_conv,
|
||||
(char_u *)src, &len)) != NULL)
|
||||
{
|
||||
/* Converted from 'termencoding' to 'encoding'. */
|
||||
add_to_input_buf_csi(buf, len);
|
||||
ptr = buf;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
add_to_input_buf_csi((char_u *)src, len);
|
||||
/* Add count of character to preedit_buf_len */
|
||||
while (*ptr != NUL)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (draw_data->text->feedback != NULL)
|
||||
{
|
||||
if (draw_feedback == NULL)
|
||||
draw_feedback = (char *)alloc(draw_data->chg_first
|
||||
+ text->length);
|
||||
else
|
||||
draw_feedback = vim_realloc(draw_feedback,
|
||||
draw_data->chg_first + text->length);
|
||||
if (draw_feedback != NULL)
|
||||
{
|
||||
draw_feedback[nfeedback + draw_data->chg_first]
|
||||
= draw_data->text->feedback[nfeedback];
|
||||
nfeedback++;
|
||||
}
|
||||
}
|
||||
if (has_mbyte)
|
||||
ptr += (*mb_ptr2len)(ptr);
|
||||
else
|
||||
#endif
|
||||
ptr++;
|
||||
preedit_buf_len++;
|
||||
}
|
||||
#ifdef FEAT_MBYTE
|
||||
vim_free(buf);
|
||||
#endif
|
||||
preedit_end_col = MAXCOL;
|
||||
}
|
||||
}
|
||||
if (text != NULL || draw_data->chg_length > 0)
|
||||
{
|
||||
event_queue = key_press_event_queue;
|
||||
processing_queued_event = TRUE;
|
||||
while (event_queue != NULL && processing_queued_event)
|
||||
{
|
||||
GdkEvent *ev = event_queue->data;
|
||||
|
||||
gboolean *ret;
|
||||
gtk_signal_emit_by_name((GtkObject*)gui.mainwin, "key_press_event",
|
||||
ev, &ret);
|
||||
gdk_event_free(ev);
|
||||
event_queue = event_queue->next;
|
||||
}
|
||||
processing_queued_event = FALSE;
|
||||
if (key_press_event_queue)
|
||||
{
|
||||
g_slist_free(key_press_event_queue);
|
||||
key_press_event_queue = NULL;
|
||||
}
|
||||
}
|
||||
if (gtk_main_level() > 0)
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
/*
|
||||
* Retrieve the highlighting attributes at column col in the preedit string.
|
||||
* Return -1 if not in preediting mode or if col is out of range.
|
||||
*/
|
||||
int
|
||||
im_get_feedback_attr(int col)
|
||||
{
|
||||
if (draw_feedback != NULL && col < preedit_buf_len)
|
||||
{
|
||||
if (draw_feedback[col] & XIMReverse)
|
||||
return HL_INVERSE;
|
||||
else if (draw_feedback[col] & XIMUnderline)
|
||||
return HL_UNDERLINE;
|
||||
else
|
||||
return hl_attr(HLF_V);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void
|
||||
preedit_caret_cbproc(XIC thexic UNUSED,
|
||||
XPointer client_data UNUSED,
|
||||
XPointer call_data UNUSED)
|
||||
{
|
||||
#ifdef XIM_DEBUG
|
||||
xim_log("preedit_caret_cbproc()\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
preedit_done_cbproc(XIC thexic UNUSED,
|
||||
XPointer client_data UNUSED,
|
||||
XPointer call_data UNUSED)
|
||||
{
|
||||
#ifdef XIM_DEBUG
|
||||
xim_log("preedit_done_cbproc()\n");
|
||||
#endif
|
||||
|
||||
vim_free(draw_feedback);
|
||||
draw_feedback = NULL;
|
||||
xim_can_preediting = FALSE;
|
||||
xim_has_preediting = FALSE;
|
||||
gui_update_cursor(TRUE, FALSE);
|
||||
if (showmode() > 0)
|
||||
{
|
||||
setcursor();
|
||||
out_flush();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
xim_reset(void)
|
||||
{
|
||||
char *text;
|
||||
|
||||
#ifdef XIM_DEBUG
|
||||
xim_log("xim_reset()\n");
|
||||
#endif
|
||||
|
||||
if (xic != NULL)
|
||||
{
|
||||
text = XmbResetIC(((GdkICPrivate *)xic)->xic);
|
||||
if (text != NULL && !(xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS))
|
||||
add_to_input_buf_csi((char_u *)text, strlen(text));
|
||||
else
|
||||
preedit_buf_len = 0;
|
||||
if (text != NULL)
|
||||
XFree(text);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
xim_queue_key_press_event(GdkEventKey *event, int down UNUSED)
|
||||
{
|
||||
#ifdef XIM_DEBUG
|
||||
xim_log("xim_queue_key_press_event()\n");
|
||||
#endif
|
||||
|
||||
if (preedit_buf_len <= 0)
|
||||
return FALSE;
|
||||
if (processing_queued_event)
|
||||
processing_queued_event = FALSE;
|
||||
|
||||
key_press_event_queue = g_slist_append(key_press_event_queue,
|
||||
gdk_event_copy((GdkEvent *)event));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
preedit_callback_setup(GdkIC *ic UNUSED)
|
||||
{
|
||||
XIC xxic;
|
||||
XVaNestedList preedit_attr;
|
||||
XIMCallback preedit_start_cb;
|
||||
XIMCallback preedit_draw_cb;
|
||||
XIMCallback preedit_caret_cb;
|
||||
XIMCallback preedit_done_cb;
|
||||
|
||||
xxic = ((GdkICPrivate*)xic)->xic;
|
||||
preedit_start_cb.callback = (XIMProc)preedit_start_cbproc;
|
||||
preedit_draw_cb.callback = (XIMProc)preedit_draw_cbproc;
|
||||
preedit_caret_cb.callback = (XIMProc)preedit_caret_cbproc;
|
||||
preedit_done_cb.callback = (XIMProc)preedit_done_cbproc;
|
||||
preedit_attr
|
||||
= XVaCreateNestedList(0,
|
||||
XNPreeditStartCallback, &preedit_start_cb,
|
||||
XNPreeditDrawCallback, &preedit_draw_cb,
|
||||
XNPreeditCaretCallback, &preedit_caret_cb,
|
||||
XNPreeditDoneCallback, &preedit_done_cb,
|
||||
NULL);
|
||||
XSetICValues(xxic, XNPreeditAttributes, preedit_attr, NULL);
|
||||
XFree(preedit_attr);
|
||||
}
|
||||
|
||||
static void
|
||||
reset_state_setup(GdkIC *ic UNUSED)
|
||||
{
|
||||
#ifdef USE_X11R6_XIM
|
||||
/* don't change the input context when we call reset */
|
||||
XSetICValues(((GdkICPrivate *)ic)->xic, XNResetState, XIMPreserveState,
|
||||
NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
xim_init(void)
|
||||
{
|
||||
#ifdef XIM_DEBUG
|
||||
xim_log("xim_init()\n");
|
||||
#endif
|
||||
|
||||
xic = NULL;
|
||||
xic_attr = NULL;
|
||||
|
||||
if (!gdk_im_ready())
|
||||
{
|
||||
if (p_verbose > 0)
|
||||
{
|
||||
verbose_enter();
|
||||
EMSG(_("E292: Input Method Server is not running"));
|
||||
verbose_leave();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((xic_attr = gdk_ic_attr_new()) != NULL)
|
||||
{
|
||||
#ifdef FEAT_XFONTSET
|
||||
gint width, height;
|
||||
#endif
|
||||
int mask;
|
||||
GdkColormap *colormap;
|
||||
GdkICAttr *attr = xic_attr;
|
||||
int attrmask = (int)GDK_IC_ALL_REQ;
|
||||
GtkWidget *widget = gui.drawarea;
|
||||
|
||||
attr->style = (GdkIMStyle)xim_input_style;
|
||||
attr->client_window = gui.mainwin->window;
|
||||
|
||||
if ((colormap = gtk_widget_get_colormap(widget)) !=
|
||||
gtk_widget_get_default_colormap())
|
||||
{
|
||||
attrmask |= (int)GDK_IC_PREEDIT_COLORMAP;
|
||||
attr->preedit_colormap = colormap;
|
||||
}
|
||||
attrmask |= (int)GDK_IC_PREEDIT_FOREGROUND;
|
||||
attrmask |= (int)GDK_IC_PREEDIT_BACKGROUND;
|
||||
attr->preedit_foreground = widget->style->fg[GTK_STATE_NORMAL];
|
||||
attr->preedit_background = widget->style->base[GTK_STATE_NORMAL];
|
||||
|
||||
#ifdef FEAT_XFONTSET
|
||||
if ((xim_input_style & (int)GDK_IM_PREEDIT_MASK)
|
||||
== (int)GDK_IM_PREEDIT_POSITION)
|
||||
{
|
||||
if (gui.fontset == NOFONTSET
|
||||
|| gui.fontset->type != GDK_FONT_FONTSET)
|
||||
{
|
||||
EMSG(_(e_overthespot));
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_window_get_size(widget->window, &width, &height);
|
||||
|
||||
attrmask |= (int)GDK_IC_PREEDIT_POSITION_REQ;
|
||||
attr->spot_location.x = TEXT_X(0);
|
||||
attr->spot_location.y = TEXT_Y(0);
|
||||
attr->preedit_area.x = gui.border_offset;
|
||||
attr->preedit_area.y = gui.border_offset;
|
||||
attr->preedit_area.width = width - 2*gui.border_offset;
|
||||
attr->preedit_area.height = height - 2*gui.border_offset;
|
||||
attr->preedit_fontset = gui.fontset;
|
||||
}
|
||||
}
|
||||
|
||||
if ((xim_input_style & (int)GDK_IM_STATUS_MASK)
|
||||
== (int)GDK_IM_STATUS_AREA)
|
||||
{
|
||||
if (gui.fontset == NOFONTSET
|
||||
|| gui.fontset->type != GDK_FONT_FONTSET)
|
||||
{
|
||||
EMSG(_(e_overthespot));
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_window_get_size(gui.mainwin->window, &width, &height);
|
||||
attrmask |= (int)GDK_IC_STATUS_AREA_REQ;
|
||||
attr->status_area.x = 0;
|
||||
attr->status_area.y = height - gui.char_height - 1;
|
||||
attr->status_area.width = width;
|
||||
attr->status_area.height = gui.char_height;
|
||||
attr->status_fontset = gui.fontset;
|
||||
}
|
||||
}
|
||||
else if ((xim_input_style & (int)GDK_IM_STATUS_MASK)
|
||||
== (int)GDK_IM_STATUS_CALLBACKS)
|
||||
{
|
||||
/* FIXME */
|
||||
}
|
||||
#endif
|
||||
|
||||
xic = gdk_ic_new(attr, (GdkICAttributesType)attrmask);
|
||||
|
||||
if (xic == NULL)
|
||||
EMSG(_(e_xim));
|
||||
else
|
||||
{
|
||||
mask = (int)gdk_window_get_events(widget->window);
|
||||
mask |= (int)gdk_ic_get_events(xic);
|
||||
gdk_window_set_events(widget->window, (GdkEventMask)mask);
|
||||
if (xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS)
|
||||
preedit_callback_setup(xic);
|
||||
reset_state_setup(xic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
im_shutdown(void)
|
||||
{
|
||||
#ifdef XIM_DEBUG
|
||||
xim_log("im_shutdown()\n");
|
||||
#endif
|
||||
|
||||
if (xic != NULL)
|
||||
{
|
||||
gdk_im_end();
|
||||
gdk_ic_destroy(xic);
|
||||
xic = NULL;
|
||||
}
|
||||
xim_is_active = FALSE;
|
||||
xim_can_preediting = FALSE;
|
||||
preedit_start_col = MAXCOL;
|
||||
xim_has_preediting = FALSE;
|
||||
}
|
||||
|
||||
#endif /* FEAT_GUI_GTK */
|
||||
|
||||
int
|
||||
xim_get_status_area_height()
|
||||
{
|
||||
#ifdef FEAT_GUI_GTK
|
||||
if (xim_input_style & (int)GDK_IM_STATUS_AREA)
|
||||
return gui.char_height;
|
||||
#else
|
||||
if (status_area_enabled)
|
||||
return gui.char_height;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -6487,10 +5624,6 @@ xim_get_status_area_height()
|
||||
int
|
||||
im_get_status()
|
||||
{
|
||||
# ifdef FEAT_GUI_GTK
|
||||
if (xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS)
|
||||
return xim_can_preediting;
|
||||
# endif
|
||||
return xim_has_focus;
|
||||
}
|
||||
|
||||
|
||||
@@ -2582,7 +2582,7 @@ static struct vimoption
|
||||
{(char_u *)"icons,tooltips", (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
#endif
|
||||
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)
|
||||
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK)
|
||||
{"toolbariconsize", "tbis", P_STRING|P_VI_DEF,
|
||||
(char_u *)&p_tbis, PV_NONE,
|
||||
{(char_u *)"small", (char_u *)0L} SCRIPTID_INIT},
|
||||
@@ -5152,7 +5152,7 @@ didset_options()
|
||||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
|
||||
(void)opt_strings_flags(p_toolbar, p_toolbar_values, &toolbar_flags, TRUE);
|
||||
#endif
|
||||
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)
|
||||
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK)
|
||||
(void)opt_strings_flags(p_tbis, p_tbis_values, &tbis_flags, FALSE);
|
||||
#endif
|
||||
#ifdef FEAT_CMDWIN
|
||||
@@ -5825,7 +5825,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
|
||||
}
|
||||
}
|
||||
|
||||
# if defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)
|
||||
# if defined(FEAT_GUI_GTK)
|
||||
if (errmsg == NULL && varp == &p_tenc && gui.in_use)
|
||||
{
|
||||
/* GTK+ 2 uses only a single encoding, and that is UTF-8. */
|
||||
@@ -6602,7 +6602,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)
|
||||
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK)
|
||||
/* 'toolbariconsize': GTK+ 2 only */
|
||||
else if (varp == &p_tbis)
|
||||
{
|
||||
|
||||
@@ -544,7 +544,7 @@ EXTERN int p_icon; /* 'icon' */
|
||||
EXTERN char_u *p_iconstring; /* 'iconstring' */
|
||||
#endif
|
||||
EXTERN int p_ic; /* 'ignorecase' */
|
||||
#if defined(FEAT_XIM) && (defined(FEAT_GUI_GTK))
|
||||
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
|
||||
EXTERN char_u *p_imak; /* 'imactivatekey' */
|
||||
#endif
|
||||
#ifdef USE_IM_CONTROL
|
||||
@@ -790,7 +790,7 @@ static char *(p_toolbar_values[]) = {"text", "icons", "tooltips", "horiz", NULL}
|
||||
# define TOOLBAR_TOOLTIPS 0x04
|
||||
# define TOOLBAR_HORIZ 0x08
|
||||
#endif
|
||||
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)
|
||||
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK)
|
||||
EXTERN char_u *p_tbis; /* 'toolbariconsize' */
|
||||
EXTERN unsigned tbis_flags;
|
||||
# ifdef IN_OPTION_C
|
||||
|
||||
@@ -2991,7 +2991,6 @@ mch_free_mem()
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
/* Don't close the display for GTK 1, it is done in exit(). */
|
||||
# if defined(FEAT_X11) && (!defined(FEAT_GUI_GTK) || defined(HAVE_GTK2))
|
||||
if (x11_display != NULL
|
||||
# ifdef FEAT_XCLIPBOARD
|
||||
|
||||
@@ -18,6 +18,5 @@ void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
|
||||
void gui_make_popup __ARGS((char_u *path_name, int mouse_pos));
|
||||
void gui_mch_find_dialog __ARGS((exarg_T *eap));
|
||||
void gui_mch_replace_dialog __ARGS((exarg_T *eap));
|
||||
void gui_gtk_synch_fonts __ARGS((void));
|
||||
void ex_helpfind __ARGS((exarg_T *eap));
|
||||
/* vim: set ft=c : */
|
||||
|
||||
@@ -26,21 +26,16 @@ void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
|
||||
void gui_mch_enable_menu __ARGS((int showit));
|
||||
void gui_mch_show_toolbar __ARGS((int showit));
|
||||
int gui_mch_adjust_charheight __ARGS((void));
|
||||
GuiFontset gui_mch_get_fontset __ARGS((char_u *name, int report_error, int fixed_width));
|
||||
char_u *gui_mch_font_dialog __ARGS((char_u *oldval));
|
||||
int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
|
||||
GuiFont gui_mch_get_font __ARGS((char_u *name, int report_error));
|
||||
char_u *gui_mch_get_fontname __ARGS((GuiFont font, char_u *name));
|
||||
void gui_mch_set_font __ARGS((GuiFont font));
|
||||
void gui_mch_set_fontset __ARGS((GuiFontset fontset));
|
||||
void gui_mch_free_font __ARGS((GuiFont font));
|
||||
void gui_mch_free_fontset __ARGS((GuiFontset fontset));
|
||||
guicolor_T gui_mch_get_color __ARGS((char_u *name));
|
||||
void gui_mch_set_fg_color __ARGS((guicolor_T color));
|
||||
void gui_mch_set_bg_color __ARGS((guicolor_T color));
|
||||
void gui_mch_set_sp_color __ARGS((guicolor_T color));
|
||||
int gui_gtk2_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
|
||||
void gui_mch_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
|
||||
int gui_mch_haskey __ARGS((char_u *name));
|
||||
int gui_get_x11_windis __ARGS((Window *win, Display **dis));
|
||||
Display *gui_mch_get_display __ARGS((void));
|
||||
|
||||
@@ -916,17 +916,9 @@ list_version()
|
||||
#else
|
||||
# ifdef FEAT_GUI_GTK
|
||||
# ifdef FEAT_GUI_GNOME
|
||||
# ifdef HAVE_GTK2
|
||||
MSG_PUTS(_("with GTK2-GNOME GUI."));
|
||||
# else
|
||||
MSG_PUTS(_("with GTK-GNOME GUI."));
|
||||
# endif
|
||||
# else
|
||||
# ifdef HAVE_GTK2
|
||||
MSG_PUTS(_("with GTK2 GUI."));
|
||||
# else
|
||||
MSG_PUTS(_("with GTK GUI."));
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# ifdef FEAT_GUI_MOTIF
|
||||
|
||||
Reference in New Issue
Block a user