[geany/geany-plugins] 384ad9: WebHelper: Add support for GTK3
Colomban Wendling
git-noreply at xxxxx
Mon Mar 18 08:32:06 UTC 2013
Branch: refs/heads/master
Author: Colomban Wendling <ban at herbesfolles.org>
Committer: Colomban Wendling <ban at herbesfolles.org>
Date: Wed, 30 Jan 2013 21:24:55 UTC
Commit: 384ad9563db3446bab152d46232c2dfde91cec57
https://github.com/geany/geany-plugins/commit/384ad9563db3446bab152d46232c2dfde91cec57
Log Message:
-----------
WebHelper: Add support for GTK3
Modified Paths:
--------------
build/webhelper.m4
webhelper/src/gwh-browser.c
webhelper/src/gwh-settings.c
Modified: build/webhelper.m4
6 files changed, 4 insertions(+), 2 deletions(-)
===================================================================
@@ -18,12 +18,14 @@ AC_DEFUN([GP_CHECK_WEBHELPER],
fi
fi
+ GP_CHECK_GTK3([webkit_package=webkitgtk-3.0],
+ [webkit_package=webkit-1.0])
GP_CHECK_PLUGIN_DEPS([WebHelper], [WEBHELPER],
- [gtk+-2.0 >= ${GTK_VERSION}
+ [$GP_GTK_PACKAGE >= ${GTK_VERSION}
glib-2.0 >= ${GLIB_VERSION}
gio-2.0 >= ${GIO_VERSION}
gdk-pixbuf-2.0 >= ${GDK_PIXBUF_VERSION}
- webkit-1.0 >= ${WEBKIT_VERSION}
+ $webkit_package >= ${WEBKIT_VERSION}
gthread-2.0])
Modified: webhelper/src/gwh-browser.c
6 files changed, 6 insertions(+), 0 deletions(-)
===================================================================
@@ -49,6 +49,12 @@
(GTK_WIDGET_MAPPED ((w)))
# endif /* defined (gtk_widget_get_mapped) */
#endif /* GTK_CHECK_VERSION (2, 20, 0) */
+#if GTK_CHECK_VERSION (3, 0, 0)
+/* alias GtkObject, we implement the :destroy signal */
+# define GtkObject GtkWidget
+# define GtkObjectClass GtkWidgetClass
+# define GTK_OBJECT_CLASS GTK_WIDGET_CLASS
+#endif /* GTK_CHECK_VERSION (3, 0, 0) */
struct _GwhBrowserPrivate
Modified: webhelper/src/gwh-settings.c
11 files changed, 9 insertions(+), 2 deletions(-)
===================================================================
@@ -29,6 +29,13 @@
#include <gtk/gtk.h>
+#if ! GTK_CHECK_VERSION (3, 0, 0)
+/* make gtk_adjustment_new() return a real GtkAdjustment, not a GtkObject */
+# define gtk_adjustment_new(v, l, u, si, pi, ps) \
+ (GtkAdjustment *) (gtk_adjustment_new ((v), (l), (u), (si), (pi), (ps)))
+#endif
+
+
struct _GwhSettingsPrivate
{
GPtrArray *prop_array;
@@ -619,14 +626,14 @@ struct _GwhSettingsPrivate
gboolean *needs_label)
{
GtkWidget *button;
- GtkObject *adj;
+ GtkAdjustment *adj;
GParamSpecInt *pspec_int = G_PARAM_SPEC_INT (pspec);
adj = gtk_adjustment_new ((gdouble)g_value_get_int (value),
(gdouble)pspec_int->minimum,
(gdouble)pspec_int->maximum,
1.0, 10.0, 0.0);
- button = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 0.0, 0);
+ button = gtk_spin_button_new (adj, 0.0, 0);
*needs_label = TRUE;
return button;
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Plugins-Commits
mailing list