From 0afb4571a7b54dc7693e605f7ec8a0a3a9251b4d Mon Sep 17 00:00:00 2001 From: Jan D Date: Tue, 8 Mar 2011 09:34:55 +0100 Subject: Updates for compiling with Gtk+ 3.0 (--with-x-toolkit=gtk3). * configure.in: Require 3.0 for --with-gtk3. Add HAVE_GTK3. * doc/emacs/xresources.texi (GTK resources): ~/.emacs.d/gtkrc does not work for Gtk+ 3. * src/gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define gdk_window_get_screen, gdk_window_get_geometry, gdk_x11_window_lookup_for_display and GDK_KEY_g. (xg_set_screen): Use DEFAULT_GDK_DISPLAY. (xg_get_pixbuf_from_pixmap): New function. (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap to Pixmap, take frame as parameter, remove GdkColormap parameter. Call xg_get_pixbuf_from_pixmap instead of gdk_pixbuf_get_from_drawable. (xg_get_image_for_pixmap): Do not make GdkPixmaps, call xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead. (xg_check_special_colors): Use GtkStyleContext and its functions for HAVE_GTK3. (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen. (xg_prepare_tooltip, create_dialog, menubar_map_cb) (xg_update_frame_menubar, xg_tool_bar_detach_callback) (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes): Call gtk_widget_get_preferred_size. (xg_frame_resized): gdk_window_get_geometry only takes 5 parameters. (xg_win_to_widget, xg_event_is_for_menubar): Call gdk_x11_window_lookup_for_display. (xg_set_widget_bg): New function. (delete_cb): New function. (xg_create_frame_widgets): connect delete-event to delete_cb. Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3 (xg_set_background_color): Call xg_set_widget_bg. (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask. (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3. Only call gtk_range_set_update_policy if ! HAVE_GTK3. (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback if ! HAVE_GTK3. (update_frame_tool_bar): Call gtk_widget_hide. (xg_initialize): Use GDK_KEY_g. * src/xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size. * src/xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id if ! HAVE_GTK3 (x_session_initialize): Call gdk_x11_set_sm_client_id. * src/xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3. (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS. Load ~/emacs.d/gtkrc only for ! HAVE_GTK3. * src/xterm.h (DEFAULT_GDK_DISPLAY): New define. (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines for ! HAVE_GTK3. (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID. --- configure.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 69d1a1e5bd..086a7e12d6 100644 --- a/configure.in +++ b/configure.in @@ -1826,8 +1826,8 @@ fi HAVE_GTK=no if test "${with_gtk3}" = "yes"; then - GLIB_REQUIRED=2.6 - GTK_REQUIRED=2.90 + GLIB_REQUIRED=2.28 + GTK_REQUIRED=3.0 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" dnl Checks for libraries. @@ -1835,6 +1835,7 @@ if test "${with_gtk3}" = "yes"; then if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then AC_MSG_ERROR($GTK_PKG_ERRORS) fi + AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) fi if test "$pkg_check_gtk" != "yes"; then -- cgit v1.2.3