← Back to team overview

ayatana-commits team mailing list archive

lp:~mrazik/indicator-datetime/gtk3-and-libdbusmenu-building-issues-fix into lp:indicator-datetime

 

Martin Mrazik has proposed merging lp:~mrazik/indicator-datetime/gtk3-and-libdbusmenu-building-issues-fix into lp:indicator-datetime.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)

For more details, see:
https://code.launchpad.net/~mrazik/indicator-datetime/gtk3-and-libdbusmenu-building-issues-fix/+merge/91822

Fixing couple of building errors on 12.04
-- 
https://code.launchpad.net/~mrazik/indicator-datetime/gtk3-and-libdbusmenu-building-issues-fix/+merge/91822
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c	2011-10-23 21:54:15 +0000
+++ src/datetime-service.c	2012-02-07 13:15:25 +0000
@@ -31,7 +31,7 @@
 #include <math.h>
 #include <gconf/gconf-client.h>
 
-#include <libdbusmenu-gtk3/menuitem.h>
+#include <libdbusmenu-gtk/menuitem.h>
 #include <libdbusmenu-glib/server.h>
 #include <libdbusmenu-glib/client.h>
 #include <libdbusmenu-glib/menuitem.h>
@@ -979,13 +979,19 @@
 		// Draw the correct icon for the appointment type and then tint it using mask fill.
 		// For now we'll create a circle
         if (color_spec != NULL) {
-        	GdkColor color;
-        	gdk_color_parse (color_spec, &color);	
         	g_debug("Creating a cairo surface: size, %d by %d", width, height);         
         	cairo_surface_t *surface = cairo_image_surface_create( CAIRO_FORMAT_ARGB32, width, height ); 
 
     		cairo_t *cr = cairo_create(surface);
-			gdk_cairo_set_source_color(cr, &color);
+        	#if GTK_MAJOR_VERSION >= 3
+        		GdkRGBA color;
+        		gdk_rgba_parse (&color, color_spec);	
+        		gdk_cairo_set_source_rgba(cr, &color);
+        	#else
+         		GdkColor color;
+        		gdk_color_parse (color_spec, &color);	
+        		gdk_cairo_set_source_color(cr, &color);
+        	#endif
 			cairo_paint(cr);
     		cairo_set_source_rgba(cr, 0,0,0,0.5);
     		cairo_set_line_width(cr, 1);

=== modified file 'src/indicator-datetime.c'
--- src/indicator-datetime.c	2011-09-21 20:19:53 +0000
+++ src/indicator-datetime.c	2012-02-07 13:15:25 +0000
@@ -41,9 +41,9 @@
 #include <libindicator/indicator-service-manager.h>
 
 /* DBusMenu */
-#include <libdbusmenu-gtk3/menu.h>
+#include <libdbusmenu-gtk/menu.h>
 #include <libido/libido.h>
-#include <libdbusmenu-gtk3/menuitem.h>
+#include <libdbusmenu-gtk/menuitem.h>
 
 #include "utils.h"
 #include "dbus-shared.h"
@@ -1261,7 +1261,11 @@
 
 	mi_data->gmi = gtk_menu_item_new();
 
-	GtkWidget * hbox = gtk_hbox_new(FALSE, 4);
+	#if GTK_MAJOR_VERSION >= 3
+		GtkWidget * hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
+	#else
+		GtkWidget * hbox = gtk_hbox_new(FALSE, 4);
+	#endif
 
 	/* Icon, probably someone's face or avatar on an IM */
 	mi_data->icon = gtk_image_new();
@@ -1472,7 +1476,11 @@
 	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mi_data->gmi),
 		dbusmenu_menuitem_property_get_bool(newitem, TIMEZONE_MENUITEM_PROP_RADIO));
 
-	GtkWidget * hbox = gtk_hbox_new(FALSE, 4);
+	#if GTK_MAJOR_VERSION >= 3
+		GtkWidget * hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
+	#else
+		GtkWidget * hbox = gtk_hbox_new(FALSE, 4);
+	#endif
 
   	/* Label, probably a username, chat room or mailbox name */
 	mi_data->label = gtk_label_new("");