/pidgin/main: 6283b3708b03: Re-commit improved 3a61567

Tomasz Wasilczyk twasilczyk at pidgin.im
Sat Mar 22 09:37:43 EDT 2014


Changeset: 6283b3708b038f2f7d7fb0bb4ae4508056063a4d
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-03-22 14:37 +0100
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/6283b3708b03

Description:

Re-commit improved 3a61567

diffstat:

 pidgin/gtkwebview.c |  44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diffs (61 lines):

diff --git a/pidgin/gtkwebview.c b/pidgin/gtkwebview.c
--- a/pidgin/gtkwebview.c
+++ b/pidgin/gtkwebview.c
@@ -1494,6 +1494,37 @@ pidgin_webview_finalize(GObject *webview
 	G_OBJECT_CLASS(parent_class)->finalize(G_OBJECT(webview));
 }
 
+enum {
+	PROP_0,
+	PROP_EXPAND
+};
+
+static void
+pidgin_webview_set_property(GObject *object, guint prop_id, const GValue *value,
+	GParamSpec *pspec)
+{
+	g_return_if_fail(PIDGIN_IS_WEBVIEW(object));
+
+	switch (prop_id) {
+		case PROP_EXPAND:
+			purple_debug_misc("webview",
+				"Ignored expand property (set to %d)",
+				g_value_get_boolean(value));
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id,
+				pspec);
+	}
+}
+
+static void
+pidgin_webview_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+	g_return_if_fail(PIDGIN_IS_WEBVIEW(object));
+
+	G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+}
+
 static void
 pidgin_webview_class_init(PidginWebViewClass *klass, gpointer userdata)
 {
@@ -1579,6 +1610,19 @@ pidgin_webview_class_init(PidginWebViewC
 	gtk_binding_entry_add_signal(binding_set, GDK_KEY_r, GDK_CONTROL_MASK,
 	                             "format-cleared", 0);
 
+	/* properties */
+
+	G_OBJECT_CLASS(klass)->set_property = pidgin_webview_set_property;
+	G_OBJECT_CLASS(klass)->get_property = pidgin_webview_get_property;
+
+	if (!g_object_class_find_property(G_OBJECT_CLASS(klass), "expand")) {
+		/* webkitgtk for gtk2 doesn't seems to have this */
+		g_object_class_install_property(G_OBJECT_CLASS(klass),
+			PROP_EXPAND, g_param_spec_boolean("expand", "Expand Both",
+			"Whether widget wants to expand in both directions",
+			FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+	}
+
 	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/webview");
 	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/webview/inspector_enabled", FALSE);
 }



More information about the Commits mailing list