Commit e547b051 authored by Jan D's avatar Jan D

Use non-deprecated Gtk+ functions, add changes for Gtk+3 with GSEAL_ENABLE.

* configure.in: Add --with-x-toolkit=gtk3. Remove HAVE_GTK_MULTIDISPLAY,
check for gtk_file_chooser_dialog_new, and HAVE_GTK_FILE_BOTH (implied
by minimum required Gtk+ 2.6).  Add checks for functions introduced
in Gtk+ 2.14 or newer.

* xterm.h (gtk_widget_get_window, gtk_widget_get_mapped)
(gtk_adjustment_get_page_size, gtk_adjustment_get_upper): New
defines based on what configure finds.

* xterm.c (XTflash): Use gtk_widget_get_window.
(xg_scroll_callback): Use gtk_adjustment_get_upper and
gtk_adjustment_get_page_size.
(handle_one_xevent): Use gtk_widget_get_mapped.
(x_term_init): Remove HAVE_GTK_MULTIDISPLAY and associated error
messages.

* xmenu.c (create_and_show_popup_menu): Call gtk_widget_get_mapped.

* gtkutil.h: Replace HAVE_GTK_FILE_BOTH with
HAVE_GTK_FILE_SELECTION_NEW.

* gtkutil.c (xg_display_open, xg_display_close): Remove
HAVE_GTK_MULTIDISPLAY, it is always defined.
(xg_display_open): Return type is void.
(gtk_widget_set_has_window)
(gtk_dialog_get_action_area, gtk_dialog_get_content_area)
(gtk_widget_get_sensitive, gtk_adjustment_set_page_size)
(gtk_adjustment_set_page_increment)
(gtk_adjustment_get_step_increment): #define these if not found
by configure.
(remove_submenu): New define based on Gtk+ version.
(xg_set_cursor, xg_frame_resized, xg_event_is_for_scrollbar): Use
gtk_widget_get_window.
(xg_frame_resized, xg_update_frame_menubar): Use gtk_widget_get_mapped.
(xg_create_frame_widgets): Use gtk_widget_set_has_window.
(create_dialog): Use gtk_dialog_get_action_area and
gtk_dialog_get_content_area.
(xg_uses_old_file_dialog, xg_get_file_name): Remove HAVE_GTK_FILE_BOTH
and HAVE_GTK_FILE_CHOOSER_DIALOG_NEW.  File chooser is always
available, so checking for HAVE_GTK_FILE_SELECTION_NEW is enough.
(xg_update_menubar, xg_update_submenu, xg_show_toolbar_item): Use
g_object_ref and g_object_unref.
(xg_update_menu_item, xg_tool_bar_menu_proxy): Use
gtk_widget_get_sensitive.
(xg_update_submenu): Use remove_submenu.
(xg_update_scrollbar_pos): Don't use GtkFixedChild, use child
properties instead to get old x and y position.
(xg_set_toolkit_scroll_bar_thumb): Use gtk_adjustment_get_page_size,
gtk_adjustment_get_step_increment, gtk_adjustment_set_page_size,
gtk_adjustment_set_step_increment and gtk_adjustment_set_page_increment.
(xg_get_tool_bar_widgets): New function.
(xg_tool_bar_menu_proxy, xg_show_toolbar_item)
(update_frame_tool_bar): Call xg_get_tool_bar_widgets.
(toolbar_set_orientation): New #define based on if configure
finds gtk_orientable_set_orientation.
(xg_create_tool_bar): Call toolbar_set_orientation.
(xg_make_tool_item, xg_show_toolbar_item): Call gtk_box_pack_start
instead of gtk_box_pack_start_defaults.
parent 1180f752
2010-06-28 Jan Djärv <jan.h.d@swipnet.se>
* configure.in: Add --with-x-toolkit=gtk3. Remove HAVE_GTK_MULTIDISPLAY,
check for gtk_file_chooser_dialog_new, and HAVE_GTK_FILE_BOTH (implied
by minimum required Gtk+ 2.6). Add checks for functions introduced
in Gtk+ 2.14 or newer.
2010-06-26 Eli Zaretskii <eliz@gnu.org>
* config.bat: Remove white space around "+" in COPY commands.
......
......@@ -745,6 +745,7 @@ build_vendor
build_cpu
build
MAINT
GZIP_INFO
target_alias
host_alias
build_alias
......@@ -815,6 +816,7 @@ with_dbus
with_gconf
with_selinux
with_makeinfo
with_compress_info
with_pkg_config_prog
with_crt_dir
with_gnustep_conf
......@@ -1495,8 +1497,8 @@ Optional Packages:
string giving default POP mail host
--without-sound don't compile with sound support
--without-sync-input process async input synchronously
--with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk, lucid or
athena, motif, no)
--with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk, gtk3,
lucid or athena, motif, no)
--without-xpm don't compile with XPM image support
--without-jpeg don't compile with JPEG image support
--without-tiff don't compile with TIFF image support
......@@ -1517,6 +1519,7 @@ Optional Packages:
--without-gconf don't compile with GConf support
--without-selinux don't compile with SELinux support
--without-makeinfo don't require makeinfo for building manuals
--without-compress-info don't compress the installed Info pages
--with-pkg-config-prog=PATH
path to pkg-config for finding GTK and librsvg
--with-crt-dir=DIR directory containing crtn.o etc. The default is
......@@ -2658,10 +2661,11 @@ if test "${with_x_toolkit+set}" = set; then :
a | at | ath | athe | athen | athena ) val=athena ;;
m | mo | mot | moti | motif ) val=motif ;;
g | gt | gtk ) val=gtk ;;
gtk3 ) val=gtk3 ;;
* )
as_fn_error "\`--with-x-toolkit=$withval' is invalid;
this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif' or \`gtk'.
\`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5
this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk' or
\`gtk3'. \`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5
;;
esac
with_x_toolkit=$val
......@@ -2820,6 +2824,23 @@ else
fi
## This is an option because I do not know if all info/man support
## compressed files, nor how to test if they do so.
# Check whether --with-compress-info was given.
if test "${with_compress_info+set}" = set; then :
withval=$with_compress_info;
else
with_compress_info=yes
fi
if test $with_compress_info = yes; then
GZIP_INFO=yes
else
GZIP_INFO=
fi
# Check whether --with-pkg-config-prog was given.
if test "${with_pkg_config_prog+set}" = set; then :
......@@ -7482,6 +7503,8 @@ case "${window_system}" in
motif ) USE_X_TOOLKIT=MOTIF ;;
gtk ) with_gtk=yes
USE_X_TOOLKIT=none ;;
gtk3 ) with_gtk3=yes
USE_X_TOOLKIT=none ;;
no ) USE_X_TOOLKIT=none ;;
* ) USE_X_TOOLKIT=maybe ;;
esac
......@@ -8317,6 +8340,112 @@ fi
HAVE_GTK=no
if test "${with_gtk3}" = "yes"; then
GLIB_REQUIRED=2.6
GTK_REQUIRED=2.90
GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
succeeded=no
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-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_PKG_CONFIG+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_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_PKG_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_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
$as_echo "$PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "$PKG_CONFIG" = "no" ; then
pkg_check_gtk=no
else
PKG_CONFIG_MIN_VERSION=0.9.0
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $GTK_MODULES" >&5
$as_echo_n "checking for $GTK_MODULES... " >&6; }
if $PKG_CONFIG --exists "$GTK_MODULES" 2>&5; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
succeeded=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking GTK_CFLAGS" >&5
$as_echo_n "checking GTK_CFLAGS... " >&6; }
GTK_CFLAGS=`$PKG_CONFIG --cflags "$GTK_MODULES"|sed -e 's,///*,/,g'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_CFLAGS" >&5
$as_echo "$GTK_CFLAGS" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking GTK_LIBS" >&5
$as_echo_n "checking GTK_LIBS... " >&6; }
GTK_LIBS=`$PKG_CONFIG --libs "$GTK_MODULES"|sed -e 's,///*,/,g'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_LIBS" >&5
$as_echo "$GTK_LIBS" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
GTK_CFLAGS=""
GTK_LIBS=""
## If we have a custom action on failure, don't print errors, but
## do set a variable so people can do so.
GTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$GTK_MODULES"`
fi
else
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
echo "*** See http://www.freedesktop.org/software/pkgconfig"
fi
fi
if test $succeeded = yes; then
pkg_check_gtk=yes
else
pkg_check_gtk=no
fi
if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5
fi
fi
if test "$pkg_check_gtk" != "yes"; then
HAVE_GTK=no
if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
GLIB_REQUIRED=2.6
GTK_REQUIRED=2.6
......@@ -8420,7 +8549,7 @@ $as_echo "no" >&6; }
as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5
fi
fi
fi
GTK_OBJ=
if test x"$pkg_check_gtk" = xyes; then
......@@ -8476,24 +8605,6 @@ if test "${HAVE_GTK}" = "yes"; then
if test "$with_toolkit_scroll_bars" != no; then
with_toolkit_scroll_bars=yes
fi
HAVE_GTK_MULTIDISPLAY=no
for ac_func in gdk_display_open
do :
ac_fn_c_check_func "$LINENO" "gdk_display_open" "ac_cv_func_gdk_display_open"
if test "x$ac_cv_func_gdk_display_open" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_GDK_DISPLAY_OPEN 1
_ACEOF
HAVE_GTK_MULTIDISPLAY=yes
fi
done
if test "${HAVE_GTK_MULTIDISPLAY}" = "yes"; then
$as_echo "#define HAVE_GTK_MULTIDISPLAY 1" >>confdefs.h
fi
HAVE_GTK_FILE_SELECTION=no
......@@ -8514,49 +8625,13 @@ if test "x$ac_cv_func_gtk_file_selection_new" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_GTK_FILE_SELECTION_NEW 1
_ACEOF
HAVE_GTK_FILE_SELECTION=yes
else
HAVE_GTK_FILE_SELECTION=no
fi
done
fi
HAVE_GTK_FILE_CHOOSER=no
ac_fn_c_check_decl "$LINENO" "GTK_TYPE_FILE_CHOOSER" "ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER" "$ac_includes_default
#include <gtk/gtk.h>
"
if test "x$ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER" = x""yes; then :
HAVE_GTK_FILE_CHOOSER=yes
else
HAVE_GTK_FILE_CHOOSER=no
fi
if test "$HAVE_GTK_FILE_CHOOSER" = yes; then
for ac_func in gtk_file_chooser_dialog_new
do :
ac_fn_c_check_func "$LINENO" "gtk_file_chooser_dialog_new" "ac_cv_func_gtk_file_chooser_dialog_new"
if test "x$ac_cv_func_gtk_file_chooser_dialog_new" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_GTK_FILE_CHOOSER_DIALOG_NEW 1
_ACEOF
HAVE_GTK_FILE_CHOOSER=yes
else
HAVE_GTK_FILE_CHOOSER=no
fi
done
fi
if test "$HAVE_GTK_FILE_SELECTION" = yes \
&& test "$HAVE_GTK_FILE_CHOOSER" = yes; then
$as_echo "#define HAVE_GTK_FILE_BOTH 1" >>confdefs.h
fi
if test "$HAVE_GTK_FILE_CHOOSER" = yes; then
HAVE_GTK_AND_PTHREAD=no
HAVE_GTK_AND_PTHREAD=no
for ac_header in pthread.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
......@@ -8620,7 +8695,24 @@ fi
$as_echo "#define HAVE_GTK_AND_PTHREAD 1" >>confdefs.h
fi
fi
for ac_func in gtk_widget_get_window gtk_widget_set_has_window \
gtk_dialog_get_action_area gtk_widget_get_sensitive \
gtk_widget_get_mapped gtk_adjustment_get_page_size \
gtk_orientable_set_orientation
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
eval as_val=\$$as_ac_var
if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
fi
HAVE_DBUS=no
......
......@@ -129,7 +129,7 @@ dnl This should be the last --with option, because --with-x is
dnl added later on when we find the path of X, and it's best to
dnl keep them together visually.
AC_ARG_WITH([x-toolkit],[AS_HELP_STRING([--with-x-toolkit=KIT],
[use an X toolkit (KIT one of: yes or gtk, lucid or athena, motif, no)])],
[use an X toolkit (KIT one of: yes or gtk, gtk3, lucid or athena, motif, no)])],
[ case "${withval}" in
y | ye | yes ) val=gtk ;;
n | no ) val=no ;;
......@@ -137,10 +137,11 @@ AC_ARG_WITH([x-toolkit],[AS_HELP_STRING([--with-x-toolkit=KIT],
a | at | ath | athe | athen | athena ) val=athena ;;
m | mo | mot | moti | motif ) val=motif ;;
g | gt | gtk ) val=gtk ;;
gtk3 ) val=gtk3 ;;
* )
AC_MSG_ERROR([`--with-x-toolkit=$withval' is invalid;
this option's value should be `yes', `no', `lucid', `athena', `motif' or `gtk'.
`yes' and `gtk' are synonyms. `athena' and `lucid' are synonyms.])
this option's value should be `yes', `no', `lucid', `athena', `motif', `gtk' or
`gtk3'. `yes' and `gtk' are synonyms. `athena' and `lucid' are synonyms.])
;;
esac
with_x_toolkit=$val
......@@ -1594,6 +1595,8 @@ case "${window_system}" in
dnl Dont set this for GTK. A lot of tests below assumes Xt when
dnl USE_X_TOOLKIT is set.
USE_X_TOOLKIT=none ;;
gtk3 ) with_gtk3=yes
USE_X_TOOLKIT=none ;;
no ) USE_X_TOOLKIT=none ;;
dnl If user did not say whether to use a toolkit, make this decision later:
dnl use the toolkit if we have gtk, or X11R5 or newer.
......@@ -1842,6 +1845,20 @@ fi
HAVE_GTK=no
if test "${with_gtk3}" = "yes"; then
GLIB_REQUIRED=2.6
GTK_REQUIRED=2.90
GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
dnl Checks for libraries.
PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
AC_MSG_ERROR($GTK_PKG_ERRORS)
fi
fi
if test "$pkg_check_gtk" != "yes"; then
HAVE_GTK=no
if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
GLIB_REQUIRED=2.6
GTK_REQUIRED=2.6
......@@ -1853,7 +1870,7 @@ if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
AC_MSG_ERROR($GTK_PKG_ERRORS)
fi
fi
fi
GTK_OBJ=
if test x"$pkg_check_gtk" = xyes; then
......@@ -1898,15 +1915,6 @@ if test "${HAVE_GTK}" = "yes"; then
with_toolkit_scroll_bars=yes
fi
dnl Check if we can use multiple displays with this GTK version.
dnl If gdk_display_open exists, assume all others are there also.
HAVE_GTK_MULTIDISPLAY=no
AC_CHECK_FUNCS(gdk_display_open, HAVE_GTK_MULTIDISPLAY=yes)
if test "${HAVE_GTK_MULTIDISPLAY}" = "yes"; then
AC_DEFINE(HAVE_GTK_MULTIDISPLAY, 1,
[Define to 1 if GTK can handle more than one display.])
fi
dnl Check if we have the old file selection dialog declared and
dnl in the link library. In 2.x it may be in the library,
dnl but not declared if deprecated featured has been selected out.
......@@ -1916,29 +1924,11 @@ if test "${HAVE_GTK}" = "yes"; then
HAVE_GTK_FILE_SELECTION=no, [AC_INCLUDES_DEFAULT
#include <gtk/gtk.h>])
if test "$HAVE_GTK_FILE_SELECTION" = yes; then
AC_CHECK_FUNCS(gtk_file_selection_new, HAVE_GTK_FILE_SELECTION=yes,
HAVE_GTK_FILE_SELECTION=no)
fi
dnl Check if we have the new file chooser dialog
HAVE_GTK_FILE_CHOOSER=no
AC_CHECK_DECL(GTK_TYPE_FILE_CHOOSER, HAVE_GTK_FILE_CHOOSER=yes,
HAVE_GTK_FILE_CHOOSER=no, [AC_INCLUDES_DEFAULT
#include <gtk/gtk.h>])
if test "$HAVE_GTK_FILE_CHOOSER" = yes; then
AC_CHECK_FUNCS(gtk_file_chooser_dialog_new, HAVE_GTK_FILE_CHOOSER=yes,
HAVE_GTK_FILE_CHOOSER=no)
fi
if test "$HAVE_GTK_FILE_SELECTION" = yes \
&& test "$HAVE_GTK_FILE_CHOOSER" = yes; then
AC_DEFINE(HAVE_GTK_FILE_BOTH, 1,
[Define to 1 if GTK has both file selection and chooser dialog.])
AC_CHECK_FUNCS(gtk_file_selection_new)
fi
dnl Check if pthreads are available. Emacs only needs this when using
dnl gtk_file_chooser under Gnome.
if test "$HAVE_GTK_FILE_CHOOSER" = yes; then
HAVE_GTK_AND_PTHREAD=no
AC_CHECK_HEADERS(pthread.h)
if test "$ac_cv_header_pthread_h"; then
......@@ -1952,7 +1942,13 @@ if test "${HAVE_GTK}" = "yes"; then
AC_DEFINE(HAVE_GTK_AND_PTHREAD, 1,
[Define to 1 if you have GTK and pthread (-lpthread).])
fi
fi
dnl Check for functions introduced in 2.14 and later.
AC_CHECK_FUNCS(gtk_widget_get_window gtk_widget_set_has_window \
gtk_dialog_get_action_area gtk_widget_get_sensitive \
gtk_widget_get_mapped gtk_adjustment_get_page_size \
gtk_orientable_set_orientation)
fi
dnl D-Bus has been tested under GNU/Linux only. Must be adapted for
......
......@@ -41,6 +41,12 @@ lib-src/Makefile by hand in order to use the associated features.
** There is a new configure option --with-crt-dir.
This is only useful if your crt*.o files are in a non-standard location.
---
** Emacs can be compiled against Gtk+ 3.0 if you pass --with-x-toolkit=gtk3
to configure. Note that other libraries used by Emacs, RSVG and GConf,
also depend on Gtk+. You can disable them with --without-rsvg and
--without-gconf.
* Startup Changes in Emacs 24.1
......
2010-06-28 Jan Djärv <jan.h.d@swipnet.se>
* xterm.h (gtk_widget_get_window, gtk_widget_get_mapped)
(gtk_adjustment_get_page_size, gtk_adjustment_get_upper): New
defines based on what configure finds.
* xterm.c (XTflash): Use gtk_widget_get_window.
(xg_scroll_callback): Use gtk_adjustment_get_upper and
gtk_adjustment_get_page_size.
(handle_one_xevent): Use gtk_widget_get_mapped.
(x_term_init): Remove HAVE_GTK_MULTIDISPLAY and associated error
messages.
* xmenu.c (create_and_show_popup_menu): Call gtk_widget_get_mapped.
* gtkutil.h: Replace HAVE_GTK_FILE_BOTH with
HAVE_GTK_FILE_SELECTION_NEW.
* gtkutil.c (xg_display_open, xg_display_close): Remove
HAVE_GTK_MULTIDISPLAY, it is always defined.
(xg_display_open): Return type is void.
(gtk_widget_set_has_window)
(gtk_dialog_get_action_area, gtk_dialog_get_content_area)
(gtk_widget_get_sensitive, gtk_adjustment_set_page_size)
(gtk_adjustment_set_page_increment)
(gtk_adjustment_get_step_increment): #define these if not found
by configure.
(remove_submenu): New define based on Gtk+ version.
(xg_set_cursor, xg_frame_resized, xg_event_is_for_scrollbar): Use
gtk_widget_get_window.
(xg_frame_resized, xg_update_frame_menubar): Use gtk_widget_get_mapped.
(xg_create_frame_widgets): Use gtk_widget_set_has_window.
(create_dialog): Use gtk_dialog_get_action_area and
gtk_dialog_get_content_area.
(xg_uses_old_file_dialog, xg_get_file_name): Remove HAVE_GTK_FILE_BOTH
and HAVE_GTK_FILE_CHOOSER_DIALOG_NEW. File chooser is always
available, so checking for HAVE_GTK_FILE_SELECTION_NEW is enough.
(xg_update_menubar, xg_update_submenu, xg_show_toolbar_item): Use
g_object_ref and g_object_unref.
(xg_update_menu_item, xg_tool_bar_menu_proxy): Use
gtk_widget_get_sensitive.
(xg_update_submenu): Use remove_submenu.
(xg_update_scrollbar_pos): Don't use GtkFixedChild, use child
properties instead to get old x and y position.
(xg_set_toolkit_scroll_bar_thumb): Use gtk_adjustment_get_page_size,
gtk_adjustment_get_step_increment, gtk_adjustment_set_page_size,
gtk_adjustment_set_step_increment and gtk_adjustment_set_page_increment.
(xg_get_tool_bar_widgets): New function.
(xg_tool_bar_menu_proxy, xg_show_toolbar_item)
(update_frame_tool_bar): Call xg_get_tool_bar_widgets.
(toolbar_set_orientation): New #define based on if configure
finds gtk_orientable_set_orientation.
(xg_create_tool_bar): Call toolbar_set_orientation.
(xg_make_tool_item, xg_show_toolbar_item): Call gtk_box_pack_start
instead of gtk_box_pack_start_defaults.
2010-06-28 Chong Yidong <cyd@stupidchicken.com>
* cmds.c (Fdelete_backward_char): Move into Lisp.
......
......@@ -195,9 +195,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if using GConf. */
#undef HAVE_GCONF
/* Define to 1 if you have the `gdk_display_open' function. */
#undef HAVE_GDK_DISPLAY_OPEN
/* Define to 1 if you have the `getaddrinfo' function. */
#undef HAVE_GETADDRINFO
......@@ -264,14 +261,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `grantpt' function. */
#undef HAVE_GRANTPT
/* Define to 1 if you have the `gtk_adjustment_get_page_size' function. */
#undef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE
/* Define to 1 if you have GTK and pthread (-lpthread). */
#undef HAVE_GTK_AND_PTHREAD
/* Define to 1 if GTK has both file selection and chooser dialog. */
#undef HAVE_GTK_FILE_BOTH
/* Define to 1 if you have the `gtk_file_chooser_dialog_new' function. */
#undef HAVE_GTK_FILE_CHOOSER_DIALOG_NEW
/* Define to 1 if you have the `gtk_dialog_get_action_area' function. */
#undef HAVE_GTK_DIALOG_GET_ACTION_AREA
/* Define to 1 if you have the `gtk_file_selection_new' function. */
#undef HAVE_GTK_FILE_SELECTION_NEW
......@@ -279,8 +276,20 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `gtk_main' function. */
#undef HAVE_GTK_MAIN
/* Define to 1 if GTK can handle more than one display. */
#undef HAVE_GTK_MULTIDISPLAY
/* Define to 1 if you have the `gtk_orientable_set_orientation' function. */
#undef HAVE_GTK_ORIENTABLE_SET_ORIENTATION
/* Define to 1 if you have the `gtk_widget_get_mapped' function. */
#undef HAVE_GTK_WIDGET_GET_MAPPED
/* Define to 1 if you have the `gtk_widget_get_sensitive' function. */
#undef HAVE_GTK_WIDGET_GET_SENSITIVE
/* Define to 1 if you have the `gtk_widget_get_window' function. */
#undef HAVE_GTK_WIDGET_GET_WINDOW
/* Define to 1 if you have the `gtk_widget_set_has_window' function. */
#undef HAVE_GTK_WIDGET_SET_HAS_WINDOW
/* Define to 1 if netdb.h declares h_errno. */
#undef HAVE_H_ERRNO
......
This diff is collapsed.
......@@ -38,7 +38,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Key for data that menu items hold. */
#define XG_ITEM_DATA "emacs_menuitem"
/* Button types in menus. */
enum button_type
{
......@@ -119,7 +118,7 @@ typedef struct _widget_value
struct _widget_value *free_list;
} widget_value;
#ifdef HAVE_GTK_FILE_BOTH
#ifdef HAVE_GTK_FILE_SELECTION_NEW
extern int use_old_gtk_file_dialog;
#endif
......@@ -187,7 +186,7 @@ extern void xg_frame_resized P_ ((FRAME_PTR f,
extern void xg_frame_set_char_size P_ ((FRAME_PTR f, int cols, int rows));
extern GtkWidget * xg_win_to_widget P_ ((Display *dpy, Window wdesc));
extern int xg_display_open P_ ((char *display_name, Display **dpy));
extern void xg_display_open P_ ((char *display_name, Display **dpy));
extern void xg_display_close P_ ((Display *dpy));
extern GdkCursor * xg_create_default_cursor P_ ((Display *dpy));
......
......@@ -1565,7 +1565,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp)
record_unwind_protect (pop_down_menu, make_save_value (menu, 0));
if (GTK_WIDGET_MAPPED (menu))
if (gtk_widget_get_mapped (menu))
{
/* Set this to one. popup_widget_loop increases it by one, so it becomes
two. show_help_echo uses this to detect popup menus. */
......
......@@ -3017,18 +3017,16 @@ XTflash (f)
#ifdef USE_GTK
/* Use Gdk routines to draw. This way, we won't draw over scroll bars
when the scroll bars and the edit widget share the same X window. */
GdkWindow *window = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
GdkGCValues vals;
GdkGC *gc;
vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f)
^ FRAME_BACKGROUND_PIXEL (f));
vals.function = GDK_XOR;
gc = gdk_gc_new_with_values (FRAME_GTK_WIDGET (f)->window,
&vals,
GDK_GC_FUNCTION
| GDK_GC_FOREGROUND);
gc = gdk_gc_new_with_values (window,
&vals, GDK_GC_FUNCTION | GDK_GC_FOREGROUND);
#define XFillRectangle(d, win, gc, x, y, w, h) \
gdk_draw_rectangle (FRAME_GTK_WIDGET (f)->window, \
gc, TRUE, x, y, w, h)
gdk_draw_rectangle (window, gc, TRUE, x, y, w, h)
#else
GC gc;
......@@ -4428,7 +4426,8 @@ xg_scroll_callback (GtkRange *range,
&& FRAME_X_DISPLAY_INFO (f)->grabbed < (1 << 4))
{
part = scroll_bar_handle;
whole = adj->upper - adj->page_size;
whole = gtk_adjustment_get_upper (adj) -
gtk_adjustment_get_page_size (adj);
portion = min ((int)position, whole);
bar->dragging = make_number ((int)portion);
}
......@@ -6845,7 +6844,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
/* GTK creates windows but doesn't map them.
Only get real positions when mapped. */
if (FRAME_GTK_OUTER_WIDGET (f)
&& GTK_WIDGET_MAPPED (FRAME_GTK_OUTER_WIDGET (f)))
&& gtk_widget_get_mapped (FRAME_GTK_OUTER_WIDGET (f)))
#endif
{
x_real_positions (f, &f->left_pos, &f->top_pos);
......@@ -10109,20 +10108,10 @@ x_term_init (display_name, xrm_option, resource_name)
char *argv[NUM_ARGV];
char **argv2 = argv;
guint id;
#ifndef HAVE_GTK_MULTIDISPLAY
if (!EQ (Vinitial_window_system, Qx))
error ("Sorry, you cannot connect to X servers with the GTK toolkit");
#endif
if (x_initialized++ > 1)
{
#ifdef HAVE_GTK_MULTIDISPLAY
/* Opening another display. If xg_display_open returns less
than zero, we are probably on GTK 2.0, which can only handle
one display. GTK 2.2 or later can handle more than one. */
if (xg_display_open (SDATA (display_name), &dpy) < 0)
#endif
error ("Sorry, this version of GTK can only handle one display");
xg_display_open (SDATA (display_name), &dpy);
}
else
{
......
......@@ -661,8 +661,22 @@ enum
FRAME_X_WINDOW (f))
#else
#ifdef USE_GTK
/* Functions not present in older Gtk+ */
#ifndef HAVE_GTK_WIDGET_GET_WINDOW
#define gtk_widget_get_window(w) ((w)->window)
#endif
#ifndef HAVE_GTK_WIDGET_GET_MAPPED
#define gtk_widget_get_mapped(w) (GTK_WIDGET_MAPPED (w))
#endif
#ifndef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE
#define gtk_adjustment_get_page_size(w) ((w)->page_size)
#define gtk_adjustment_get_upper(w) ((w)->upper)
#endif
#define GTK_WIDGET_TO_X_WIN(w) \
((w) && (w)->window ? GDK_WINDOW_XWINDOW ((w)->window) : 0)
((w) && gtk_widget_get_window (w) \
? GDK_WINDOW_XWINDOW (gtk_widget_get_window (w)) : 0)
#define FRAME_GTK_OUTER_WIDGET(f) ((f)->output_data.x->widget)
#define FRAME_GTK_WIDGET(f) ((f)->output_data.x->edit_widget)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment