← Back to team overview

ayatana-commits team mailing list archive

[Branch ~indicator-applet-developers/indicator-messages/trunk] Rev 200: Fix deprecations and ensure they're part of distcheck

 

Merge authors:
  Michael Terry (mterry)
------------------------------------------------------------
revno: 200 [merge]
committer: Ted Gould <ted@xxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-10-08 16:13:11 -0600
message:
  Fix deprecations and ensure they're part of distcheck
modified:
  Makefile.am
  configure.ac
  src/indicator-messages.c


--
lp:indicator-messages
https://code.launchpad.net/~indicator-applet-developers/indicator-messages/trunk

Your team ayatana-commits is subscribed to branch lp:indicator-messages.
To unsubscribe from this branch go to https://code.launchpad.net/~indicator-applet-developers/indicator-messages/trunk/+edit-subscription
=== modified file 'Makefile.am'
--- Makefile.am	2010-09-21 21:10:56 +0000
+++ Makefile.am	2010-10-08 22:13:11 +0000
@@ -4,7 +4,7 @@
 	data \
 	po
 
-DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall
+DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall --enable-deprecations
 
 dist-hook:
 	@if test -d "$(top_srcdir)/.bzr"; \

=== modified file 'configure.ac'
--- configure.ac	2010-09-09 18:10:37 +0000
+++ configure.ac	2010-10-06 18:58:05 +0000
@@ -22,6 +22,15 @@
 
 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 
+AC_ARG_ENABLE([deprecations],
+  [AS_HELP_STRING([--enable-deprecations],
+    [allow deprecated API usage @<:@default=yes@:>@])],
+  [],
+  [enable_deprecations=yes])
+AS_IF([test "x$enable_deprecations" = xno],
+  [CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGTK_DISABLE_SINGLE_INCLUDES"]
+)
+
 ###########################
 # Dependencies 
 ###########################

=== modified file 'src/indicator-messages.c'
--- src/indicator-messages.c	2010-09-03 18:13:16 +0000
+++ src/indicator-messages.c	2010-10-06 18:58:05 +0000
@@ -299,6 +299,7 @@
 static gboolean
 application_triangle_draw_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
 {
+	GtkAllocation allocation;
 	GtkStyle *style;
 	cairo_t *cr;
 	int x, y, arrow_width, arrow_height;
@@ -316,11 +317,12 @@
 	/* set arrow position / dimensions */
 	arrow_width = 5; /* the pixel-based reference triangle is 5x9 */
 	arrow_height = 9;
-	x = widget->allocation.x;
-	y = widget->allocation.y + widget->allocation.height/2.0 - (double)arrow_height/2.0;
+	gtk_widget_get_allocation (widget, &allocation);
+	x = allocation.x;
+	y = allocation.y + allocation.height/2.0 - (double)arrow_height/2.0;
 
 	/* initialize cairo drawing area */
-	cr = (cairo_t*) gdk_cairo_create (widget->window);
+	cr = (cairo_t*) gdk_cairo_create (gtk_widget_get_window (widget));
 
 	/* set line width */	
 	cairo_set_line_width (cr, 1.0);
@@ -359,6 +361,7 @@
 static gboolean
 numbers_draw_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
 {
+	GtkAllocation allocation;
 	GtkStyle *style;
 	cairo_t *cr;
 	double x, y, w, h;
@@ -371,10 +374,11 @@
 	style = gtk_widget_get_style (widget);
 
 	/* set arrow position / dimensions */
-	w = widget->allocation.width;
-	h = widget->allocation.height;
-	x = widget->allocation.x;
-	y = widget->allocation.y;
+	gtk_widget_get_allocation (widget, &allocation);
+	w = allocation.width;
+	h = allocation.height;
+	x = allocation.x;
+	y = allocation.y;
 
 	layout = gtk_label_get_layout (GTK_LABEL(widget));
 
@@ -385,7 +389,7 @@
 	font_size = pango_font_description_get_size (font_description); */
 
 	/* initialize cairo drawing area */
-	cr = (cairo_t*) gdk_cairo_create (widget->window);
+	cr = (cairo_t*) gdk_cairo_create (gtk_widget_get_window (widget));
 
 	/* set line width */	
 	cairo_set_line_width (cr, 1.0);