summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-04-30 23:24:04 +0200
committerStefano Karapetsas <[email protected]>2014-04-30 23:24:04 +0200
commit36c964e0a6d1deaee624cd2a6a76ff5c73141865 (patch)
tree1479121d344123a17ec1e4238aa276ee59572d4e
parent309200788af7a414b4c54234d7791a31ca4abcff (diff)
downloadmate-utils-36c964e0a6d1deaee624cd2a6a76ff5c73141865.tar.bz2
mate-utils-36c964e0a6d1deaee624cd2a6a76ff5c73141865.tar.xz
mate-dictionary: Add GTK3 support
-rw-r--r--mate-dictionary/libgdict/Makefile.am1
-rw-r--r--mate-dictionary/libgdict/gdict-defbox.c5
-rw-r--r--mate-dictionary/src/gdict-aligned-window.c28
-rw-r--r--mate-dictionary/src/gdict-applet.c9
-rw-r--r--mate-dictionary/src/gdict-sidebar.c5
5 files changed, 29 insertions, 19 deletions
diff --git a/mate-dictionary/libgdict/Makefile.am b/mate-dictionary/libgdict/Makefile.am
index 45806c0a..c159bd24 100644
--- a/mate-dictionary/libgdict/Makefile.am
+++ b/mate-dictionary/libgdict/Makefile.am
@@ -10,7 +10,6 @@ AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Gdict\" \
-DGDICT_ENABLE_INTERNALS \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED \
-DPANGO_DISABLE_DEPRECATED \
-DG_DISABLE_SINGLE_INCLUDES \
-DGTK_DISABLE_SINGLE_INCLUDES \
diff --git a/mate-dictionary/libgdict/gdict-defbox.c b/mate-dictionary/libgdict/gdict-defbox.c
index eb375c5c..b5618ddc 100644
--- a/mate-dictionary/libgdict/gdict-defbox.c
+++ b/mate-dictionary/libgdict/gdict-defbox.c
@@ -38,8 +38,11 @@
#include <string.h>
#include <stdarg.h>
-#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+#if GTK_CHECK_VERSION (3, 0, 0)
+#include <gdk/gdkkeysyms-compat.h>
+#endif
#include <glib/gi18n-lib.h>
#include "gdict-defbox.h"
diff --git a/mate-dictionary/src/gdict-aligned-window.c b/mate-dictionary/src/gdict-aligned-window.c
index c4858cff..c1cb9d53 100644
--- a/mate-dictionary/src/gdict-aligned-window.c
+++ b/mate-dictionary/src/gdict-aligned-window.c
@@ -172,14 +172,13 @@ gdict_aligned_window_position (GdictAlignedWindow *window)
gdk_window = gtk_widget_get_window (align_widget);
gdk_flush ();
-
- gdk_window_get_geometry (gtk_widget_get_window (GTK_WIDGET (window)),
- NULL,
- NULL,
- &our_width,
- &our_height,
- NULL);
-
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_window_get_geometry (gtk_widget_get_window (GTK_WIDGET (window)), NULL, NULL, &our_width, &our_height);
+#else
+ gdk_window_get_geometry (gtk_widget_get_window (GTK_WIDGET (window)), NULL, NULL, &our_width, &our_height, NULL);
+#endif
+
/* stick, skip taskbar and pager */
gtk_window_stick (GTK_WINDOW (window));
gtk_window_set_skip_taskbar_hint (GTK_WINDOW (window), TRUE);
@@ -192,13 +191,12 @@ gdict_aligned_window_position (GdictAlignedWindow *window)
gdk_window_get_origin (gdk_window,
&entry_x,
&entry_y);
- gdk_window_get_geometry (gdk_window,
- NULL,
- NULL,
- &entry_width,
- &entry_height,
- NULL);
-
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_window_get_geometry (gdk_window, NULL, NULL, &entry_width, &entry_height);
+#else
+ gdk_window_get_geometry (gdk_window, NULL, NULL, &entry_width, &entry_height, NULL);
+#endif
+
if (entry_x + our_width < gdk_screen_width ())
x = entry_x + 1;
else
diff --git a/mate-dictionary/src/gdict-applet.c b/mate-dictionary/src/gdict-applet.c
index ae94b698..b29b8cd8 100644
--- a/mate-dictionary/src/gdict-applet.c
+++ b/mate-dictionary/src/gdict-applet.c
@@ -27,9 +27,12 @@
#include <glib/gi18n.h>
#include <gio/gio.h>
+#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
+#if GTK_CHECK_VERSION (3, 0, 0)
+#include <gdk/gdkkeysyms-compat.h>
+#endif
#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gtk/gtk.h>
#include "gdict-applet.h"
#include "gdict-about.h"
@@ -742,6 +745,7 @@ gdict_applet_cmd_help (GtkAction *action,
}
}
+#if !GTK_CHECK_VERSION (3, 0, 0)
static void
gdict_applet_change_background (MatePanelApplet *applet,
MatePanelAppletBackgroundType type,
@@ -754,6 +758,7 @@ gdict_applet_change_background (MatePanelApplet *applet,
color,
pixmap);
}
+#endif
static void
gdict_applet_change_orient (MatePanelApplet *applet,
@@ -1111,7 +1116,9 @@ gdict_applet_class_init (GdictAppletClass *klass)
widget_class->size_allocate = gdict_applet_size_allocate;
widget_class->style_set = gdict_applet_style_set;
+#if !GTK_CHECK_VERSION (3, 0, 0)
applet_class->change_background = gdict_applet_change_background;
+#endif
applet_class->change_orient = gdict_applet_change_orient;
g_type_class_add_private (gobject_class, sizeof (GdictAppletPrivate));
diff --git a/mate-dictionary/src/gdict-sidebar.c b/mate-dictionary/src/gdict-sidebar.c
index 9bb0007b..8da6775e 100644
--- a/mate-dictionary/src/gdict-sidebar.c
+++ b/mate-dictionary/src/gdict-sidebar.c
@@ -30,8 +30,11 @@
#include <string.h>
#include <stdarg.h>
-#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+#if GTK_CHECK_VERSION (3, 0, 0)
+#include <gdk/gdkkeysyms-compat.h>
+#endif
#include <glib/gi18n.h>
#include "gdict-sidebar.h"