/soc/2013/ankitkv/gobjectification: 4309235d2a46: Merged default...

Ankit Vani a at nevitus.org
Wed Feb 12 00:26:50 EST 2014


Changeset: 4309235d2a469ad95589fd945f281e7523b55c2e
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-02-12 10:54 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/4309235d2a46

Description:

Merged default branch

diffstat:

 libpurple/Makefile.am  |   2 ++
 pidgin/Makefile.am     |   2 ++
 pidgin/gtk3compat.h    |   2 ++
 pidgin/gtkconv.c       |   3 +++
 pidgin/gtkmenutray.c   |  10 +++++-----
 pidgin/gtkstatusbox.c  |   6 ++++++
 pidgin/gtkutils.c      |   5 +++++
 pidgin/plugins/unity.c |  11 ++++++-----
 8 files changed, 31 insertions(+), 10 deletions(-)

diffs (161 lines):

diff --git a/libpurple/Makefile.am b/libpurple/Makefile.am
--- a/libpurple/Makefile.am
+++ b/libpurple/Makefile.am
@@ -2,6 +2,8 @@ EXTRA_DIST = \
 		dbus-analyze-functions.py \
 		dbus-analyze-signals.py \
 		dbus-analyze-types.py \
+		enums.c.in \
+		enums.h.in \
 		glibcompat.h \
 		marshallers.list \
 		purple-notifications-example \
diff --git a/pidgin/Makefile.am b/pidgin/Makefile.am
--- a/pidgin/Makefile.am
+++ b/pidgin/Makefile.am
@@ -144,6 +144,8 @@ libpidgin_la_headers = \
 pidgin_SOURCES = \
 	pidgin.c
 
+noinst_HEADERS= gtkinternal.h
+
 libpidginincludedir=$(includedir)/pidgin
 libpidgininclude_HEADERS = \
 	$(libpidgin_la_headers)
diff --git a/pidgin/gtk3compat.h b/pidgin/gtk3compat.h
--- a/pidgin/gtk3compat.h
+++ b/pidgin/gtk3compat.h
@@ -31,6 +31,8 @@
  * Also, any public API should not depend on this file.
  */
 
+#include <gtk/gtk.h>
+
 #if !GTK_CHECK_VERSION(3,2,0)
 
 #define GTK_FONT_CHOOSER GTK_FONT_SELECTION_DIALOG
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -231,6 +231,9 @@ static const GdkColor *get_nick_color(Pi
 	float scale;
 
 	col = g_array_index(gtkconv->nick_colors, GdkColor, g_str_hash(name) % gtkconv->nick_colors->len);
+
+	g_return_val_if_fail(style != NULL, &col);
+
 #if GTK_CHECK_VERSION(3,0,0)
 	gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &rgba);
 	scale = (1 - LUMINANCE(rgba)) * ((float)0xffff / MAX(MAX(col.red, col.blue), col.green));
diff --git a/pidgin/gtkmenutray.c b/pidgin/gtkmenutray.c
--- a/pidgin/gtkmenutray.c
+++ b/pidgin/gtkmenutray.c
@@ -23,6 +23,7 @@
 
 #include "gtkmenutray.h"
 
+#include "glibcompat.h"
 #include "gtk3compat.h"
 
 /******************************************************************************
@@ -155,12 +156,11 @@ pidgin_menu_tray_init(PidginMenuTray *me
 	GtkSettings *settings;
 	gint height = -1;
 
-#if GTK_CHECK_VERSION(3,0,0)
-	gtk_widget_set_hexpand(widget, TRUE);
-	gtk_widget_set_halign(widget, GTK_ALIGN_END);
-#else
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+	/* Gtk3 docs says, it should be replaced with gtk_widget_set_hexpand and
+	 * gtk_widget_set_halign. But it doesn't seems to work. */
 	gtk_menu_item_set_right_justified(GTK_MENU_ITEM(menu_tray), TRUE);
-#endif
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 	if(!GTK_IS_WIDGET(menu_tray->tray))
 		menu_tray->tray = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
diff --git a/pidgin/gtkstatusbox.c b/pidgin/gtkstatusbox.c
--- a/pidgin/gtkstatusbox.c
+++ b/pidgin/gtkstatusbox.c
@@ -455,8 +455,14 @@ destroy_icon_box(PidginStatusBox *status
 		return;
 
 	gtk_widget_destroy(statusbox->icon_box);
+
+#if GTK_CHECK_VERSION(3,0,0)
 	g_object_unref(statusbox->hand_cursor);
 	g_object_unref(statusbox->arrow_cursor);
+#else
+	gdk_cursor_unref(statusbox->hand_cursor);
+	gdk_cursor_unref(statusbox->arrow_cursor);
+#endif
 
 	purple_imgstore_unref(statusbox->buddy_icon_img);
 
diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c
--- a/pidgin/gtkutils.c
+++ b/pidgin/gtkutils.c
@@ -2104,7 +2104,12 @@ void pidgin_set_cursor(GtkWidget *widget
 
 	cursor = gdk_cursor_new(cursor_type);
 	gdk_window_set_cursor(gtk_widget_get_window(widget), cursor);
+
+#if GTK_CHECK_VERSION(3,0,0)
 	g_object_unref(cursor);
+#else
+	gdk_cursor_unref(cursor);
+#endif
 
 	gdk_display_flush(gdk_window_get_display(gtk_widget_get_window(widget)));
 }
diff --git a/pidgin/plugins/unity.c b/pidgin/plugins/unity.c
--- a/pidgin/plugins/unity.c
+++ b/pidgin/plugins/unity.c
@@ -17,10 +17,11 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 #include "internal.h"
-#include "version.h"
 #include "account.h"
 #include "savedstatuses.h"
+#include "version.h"
 
+#include "gtk3compat.h"
 #include "gtkplugin.h"
 #include "gtkconv.h"
 #include "gtkutils.h"
@@ -431,13 +432,13 @@ get_config_frame(PurplePlugin *plugin)
 	GtkWidget *ret = NULL, *frame = NULL;
 	GtkWidget *vbox = NULL, *toggle = NULL;
 
-	ret = gtk_vbox_new(FALSE, 18);
+	ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 18);
 	gtk_container_set_border_width(GTK_CONTAINER (ret), 12);
 
 	/* Alerts */
 
 	frame = pidgin_make_frame(ret, _("Chatroom alerts"));
-	vbox = gtk_vbox_new(FALSE, 5);
+	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
 	gtk_container_add(GTK_CONTAINER(frame), vbox);
 
 	toggle = gtk_check_button_new_with_mnemonic(_("Chatroom message alerts _only where someone says your username"));
@@ -450,7 +451,7 @@ get_config_frame(PurplePlugin *plugin)
 	/* Launcher integration */
 
 	frame = pidgin_make_frame(ret, _("Launcher Icon"));
-	vbox = gtk_vbox_new(FALSE, 5);
+	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
 	gtk_container_add(GTK_CONTAINER(frame), vbox);
 
 	toggle = gtk_radio_button_new_with_mnemonic(NULL, _("_Disable launcher integration"));
@@ -479,7 +480,7 @@ get_config_frame(PurplePlugin *plugin)
 	/* Messaging menu integration */
 
 	frame = pidgin_make_frame(ret, _("Messaging Menu"));
-	vbox = gtk_vbox_new(FALSE, 5);
+	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
 	gtk_container_add(GTK_CONTAINER(frame), vbox);
 
 	toggle = gtk_radio_button_new_with_mnemonic(NULL,



More information about the Commits mailing list