[libegg/spread-table-dnd: 68/78] Replace some deprecated code



commit 73f929fddef438b843582ea7d6881c28373d6b9a
Author: David King <davidk openismus com>
Date:   Wed Mar 30 10:58:59 2011 +0200

    Replace some deprecated code

 libegg/dock/egg-dock-master.c                 |    4 ---
 libegg/dock/egg-dock-object.c                 |    2 +-
 libegg/smclient/eggsmclient-dbus.c            |    4 +++
 libegg/smclient/eggsmclient-xsmp.c            |    2 +-
 libegg/thumbnailpreview/eggthumbnailpreview.c |    2 +-
 libegg/treeviewutils/egg-cell-renderer-text.c |   27 ++++++++++++-------------
 6 files changed, 20 insertions(+), 21 deletions(-)
---
diff --git a/libegg/dock/egg-dock-master.c b/libegg/dock/egg-dock-master.c
index 417b8f6..79ddd78 100644
--- a/libegg/dock/egg-dock-master.c
+++ b/libegg/dock/egg-dock-master.c
@@ -593,11 +593,7 @@ egg_dock_master_xor_rect (EggDockMaster *master)
     
     rect = &master->_priv->drag_request->rect;
 
-#ifdef GDK_WINDOWING_X11
-    window = gdk_window_lookup (gdk_x11_get_default_root_xwindow ());
-#else
     window = gdk_get_default_root_window (); /* ??? */
-#endif
 
     if (!master->_priv->root_xor_gc) {
         GdkGCValues values;
diff --git a/libegg/dock/egg-dock-object.c b/libegg/dock/egg-dock-object.c
index 295fb11..1938fa9 100644
--- a/libegg/dock/egg-dock-object.c
+++ b/libegg/dock/egg-dock-object.c
@@ -391,7 +391,7 @@ egg_dock_object_real_reduce (EggDockObject *object)
             g_object_unref (child);
         }
         /* sink the widget, so any automatic floating widget is destroyed */
-        gtk_object_sink (GTK_OBJECT (object)); /* TODO: This function is deprecated. */
+        g_object_ref_sink (GTK_OBJECT (object));
         /* don't reenter */
         object->reduce_pending = FALSE;
         egg_dock_object_thaw (object);
diff --git a/libegg/smclient/eggsmclient-dbus.c b/libegg/smclient/eggsmclient-dbus.c
index 21d9199..0275d89 100644
--- a/libegg/smclient/eggsmclient-dbus.c
+++ b/libegg/smclient/eggsmclient-dbus.c
@@ -185,7 +185,11 @@ sm_client_dbus_startup (EggSMClient *client,
 			 G_TYPE_INVALID))
     {
       gdk_threads_enter ();
+#if !GTK_CHECK_VERSION(2,23,3) && !GTK_CHECK_VERSION(3,0,0)
       gdk_set_sm_client_id (ret_client_id);
+#else
+      gdk_x11_set_sm_client_id (ret_client_id);
+#endif
       gdk_threads_leave ();
 
       g_debug ("Got client ID \"%s\"", ret_client_id);
diff --git a/libegg/smclient/eggsmclient-xsmp.c b/libegg/smclient/eggsmclient-xsmp.c
index ec1b594..9fd1e5d 100644
--- a/libegg/smclient/eggsmclient-xsmp.c
+++ b/libegg/smclient/eggsmclient-xsmp.c
@@ -368,7 +368,7 @@ sm_client_xsmp_startup (EggSMClient *client,
       free (ret_client_id);
 
       gdk_threads_enter ();
-#if !GTK_CHECK_VERSION(2,91,7) && !GTK_CHECK_VERSION(3,0,0)
+#if !GTK_CHECK_VERSION(2,23,3) && !GTK_CHECK_VERSION(3,0,0)
       gdk_set_sm_client_id (xsmp->client_id);
 #else
       gdk_x11_set_sm_client_id (xsmp->client_id);
diff --git a/libegg/thumbnailpreview/eggthumbnailpreview.c b/libegg/thumbnailpreview/eggthumbnailpreview.c
index 1b6fc33..27714fe 100644
--- a/libegg/thumbnailpreview/eggthumbnailpreview.c
+++ b/libegg/thumbnailpreview/eggthumbnailpreview.c
@@ -489,7 +489,7 @@ label_style_set (GtkWidget *label,
   pango_font_description_set_size (font_desc,
 				   pango_font_description_get_size (font_desc) * PANGO_SCALE_SMALL);
   g_signal_handlers_block_by_func (label, label_style_set, NULL);
-  gtk_widget_modify_font (label, font_desc);
+  gtk_widget_override_font (label, font_desc);
   g_signal_handlers_unblock_by_func (label, label_style_set, NULL);
   pango_font_description_free (font_desc);
 }
diff --git a/libegg/treeviewutils/egg-cell-renderer-text.c b/libegg/treeviewutils/egg-cell-renderer-text.c
index 5468cd0..cdd8a01 100644
--- a/libegg/treeviewutils/egg-cell-renderer-text.c
+++ b/libegg/treeviewutils/egg-cell-renderer-text.c
@@ -115,25 +115,24 @@ egg_cell_renderer_text_render (GtkCellRenderer    *cell,
 	if ( state == GTK_STATE_SELECTED  && celltext->background_set)
 	{
 		GdkColor color;
-		GdkGC *gc;
+		cairo_t *cr;
 		
 		color.red = celltext->background.red;
 		color.green = celltext->background.green;
 		color.blue = celltext->background.blue;
 		
-		gc = gdk_gc_new (window);
-		
-		gdk_gc_set_rgb_fg_color (gc, &color);
-		
-		gdk_draw_rectangle (window,
-				    gc,
-				    TRUE,
-				    background_area->x,
-				    background_area->y + cell->ypad,
-				    background_area->width,
-				    background_area->height - 2 * cell->ypad);
-		
-		g_object_unref (G_OBJECT (gc));
+		cr = gdk_cairo_create (window);
+
+		gdk_cairo_set_source_color (cr, &color);
+
+		cairo_rectangle (cr,
+		                 background_area->x,
+				 background_area->y + cell->ypad,
+				 background_area->width,
+				 background_area->height - 2 * cell->ypad);
+
+		cairo_fill (cr);
+		cairo_destroy (cr);
 	}
 
 	GTK_CELL_RENDERER_CLASS (parent_class)->render (cell, window, widget, background_area,



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