[evolution/gtk3] Adapt deprecated expose-event signal for gtk-3.0



commit bad7d8077f6d1bc6809d25b6c8a4e3cde9c2f891
Author: Vibha Yadav <yvibha novell com>
Date:   Thu Dec 2 17:12:19 2010 +0530

    Adapt deprecated expose-event signal for gtk-3.0
    
    Using draw signal instead of expose-event signal

 calendar/gui/e-meeting-time-sel.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index 4b2ccfc..f1ba207 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -115,7 +115,7 @@ static void e_meeting_time_selector_realize (GtkWidget *widget);
 static void e_meeting_time_selector_unrealize (GtkWidget *widget);
 static void e_meeting_time_selector_style_set (GtkWidget *widget,
 					       GtkStyle  *previous_style);
-static gint e_meeting_time_selector_expose_event (GtkWidget *widget,
+static gint e_meeting_time_selector_draw (GtkWidget *widget,
 						  GdkEventExpose *event);
 static void e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts);
 static void e_meeting_time_selector_hadjustment_changed (GtkAdjustment *adjustment,
@@ -319,7 +319,7 @@ e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * class)
 	widget_class->realize = e_meeting_time_selector_realize;
 	widget_class->unrealize = e_meeting_time_selector_unrealize;
 	widget_class->style_set = e_meeting_time_selector_style_set;
-	widget_class->expose_event = e_meeting_time_selector_expose_event;
+	widget_class->draw = e_meeting_time_selector_draw;
 
 	g_object_class_install_property (
 		object_class,
@@ -885,7 +885,7 @@ e_meeting_time_selector_add_key_color (EMeetingTimeSelector * mts,
 	gtk_box_pack_start (GTK_BOX (child_hbox), label, TRUE, TRUE, 6);
 	gtk_widget_show (label);
 
-	g_signal_connect (darea, "expose_event",
+	g_signal_connect (darea, "draw",
 			  G_CALLBACK (e_meeting_time_selector_expose_key_color),
 			  color);
 }
@@ -899,7 +899,7 @@ e_meeting_time_selector_expose_key_color (GtkWidget *darea,
 	GtkAllocation allocation;
 	GdkWindow *window;
 	GtkStyle *style;
-        cairo_t *cr;
+        cairo_t *cr, *window_cr;
 
 	style = gtk_widget_get_style (darea);
 	window = gtk_widget_get_window (darea);
@@ -907,8 +907,10 @@ e_meeting_time_selector_expose_key_color (GtkWidget *darea,
 
 	mts = g_object_get_data (G_OBJECT (darea), "data");
 
+	window_cr = gdk_cairo_create(window);
+
 	gtk_paint_shadow (
-		style, window, GTK_STATE_NORMAL,
+		style, window_cr, GTK_STATE_NORMAL,
 		GTK_SHADOW_IN, NULL, NULL, NULL, 0, 0,
 		allocation.width, allocation.height);
 
@@ -925,6 +927,7 @@ e_meeting_time_selector_expose_key_color (GtkWidget *darea,
         cairo_fill (cr);
 
         cairo_destroy (cr);
+	 cairo_destroy (window_cr);
 
 	return TRUE;
 }
@@ -1209,7 +1212,7 @@ e_meeting_time_selector_style_set (GtkWidget *widget,
 
 /* This draws a shadow around the top display and main display. */
 static gint
-e_meeting_time_selector_expose_event (GtkWidget *widget,
+e_meeting_time_selector_draw (GtkWidget *widget,
 				      GdkEventExpose *event)
 {
 	EMeetingTimeSelector *mts;
@@ -1218,8 +1221,8 @@ e_meeting_time_selector_expose_event (GtkWidget *widget,
 
 	e_meeting_time_selector_draw_shadow (mts);
 
-	if (GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->expose_event)
-		(*GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->expose_event)(widget, event);
+	if (GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->draw)
+		(*GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->draw)(widget, event);
 
 	return FALSE;
 }
@@ -1229,6 +1232,7 @@ e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts)
 {
 	GtkAllocation allocation;
 	GdkWindow *window;
+	cairo_t *cr;
 	GtkStyle *style;
 	gint x, y, w, h;
 
@@ -1242,9 +1246,11 @@ e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts)
 	style = gtk_widget_get_style (GTK_WIDGET (mts));
 	window = gtk_widget_get_window (GTK_WIDGET (mts));
 
+	cr = gdk_cairo_create(window);
 	gtk_paint_shadow (
-		style, window, GTK_STATE_NORMAL,
-		GTK_SHADOW_IN, NULL, NULL, NULL, x, y, w, h);
+		style, cr, GTK_STATE_NORMAL,
+		GTK_SHADOW_IN, NULL, NULL, x, y, w, h);
+	cairo_destroy(cr);
 }
 
 /* When the main canvas scrolls, we scroll the other canvases. */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]