[gthumb: 13/20] removed use of gdk_drawable_get_size



commit c5493603922574cb30fc1a9bc2446f9507b168f0
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu May 12 13:08:10 2011 +0200

    removed use of gdk_drawable_get_size

 .../contact_sheet/gth-contact-sheet-theme-dialog.c |    8 ++++----
 extensions/image_viewer/gth-image-viewer-page.c    |    3 ++-
 gthumb/gth-icon-view.c                             |    7 +++----
 3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/extensions/contact_sheet/gth-contact-sheet-theme-dialog.c b/extensions/contact_sheet/gth-contact-sheet-theme-dialog.c
index b8f1aa9..61a2f1e 100644
--- a/extensions/contact_sheet/gth-contact-sheet-theme-dialog.c
+++ b/extensions/contact_sheet/gth-contact-sheet-theme-dialog.c
@@ -73,12 +73,12 @@ preview_area_expose_event_cb (GtkWidget      *widget,
 {
 	GthContactSheetThemeDialog *self = user_data;
 	cairo_t                    *cr;
-	int                         width;
-	int                         height;
 
 	cr = gdk_cairo_create (gtk_widget_get_window (widget));
-	gdk_drawable_get_size (gtk_widget_get_window (widget), &width, &height);
-	gth_contact_sheet_theme_paint_preview (self->priv->theme, cr, width, height);
+	gth_contact_sheet_theme_paint_preview (self->priv->theme,
+					       cr,
+					       gdk_window_get_width (gtk_widget_get_window (widget)),
+					       gdk_window_get_height (gtk_widget_get_window (widget)));
 	cairo_destroy (cr);
 
 	return TRUE;
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index d864c01..9fe157c 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -668,7 +668,8 @@ paint_comment_over_image_func (GthImageViewer *image_viewer,
 	icon_width = gdk_pixbuf_get_width (icon);
 	icon_height = gdk_pixbuf_get_height (icon);
 
-	gdk_drawable_get_size (gtk_widget_get_window (self->priv->viewer), &image_width, &image_height);
+	image_width = gdk_window_get_width (gtk_widget_get_window (self->priv->viewer));
+	image_height = gdk_window_get_height (gtk_widget_get_window (self->priv->viewer));
 	max_text_width = ((image_width * 3 / 4) - icon_width - (x_padding * 3) - (x_padding * 2));
 
 	pango_layout_set_width (layout, max_text_width * PANGO_SCALE);
diff --git a/gthumb/gth-icon-view.c b/gthumb/gth-icon-view.c
index 6736c9d..fd0071a 100644
--- a/gthumb/gth-icon-view.c
+++ b/gthumb/gth-icon-view.c
@@ -723,8 +723,6 @@ icon_view_motion_notify_event_cb (GtkWidget      *widget,
 			GtkTreePath    *path = NULL;
 			GdkDragContext *context;
 			GdkPixmap      *dnd_icon;
-			int             width;
-			int             height;
 			int             n_selected;
 
 			path = gtk_icon_view_get_path_at_pos (GTK_ICON_VIEW (icon_view),
@@ -747,18 +745,19 @@ icon_view_motion_notify_event_cb (GtkWidget      *widget,
 				context->suggested_action = GDK_ACTION_ASK;
 
 			dnd_icon = gtk_icon_view_create_drag_icon (GTK_ICON_VIEW (icon_view), path);
-			gdk_drawable_get_size (dnd_icon, &width, &height);
 
 			n_selected =  gth_file_selection_get_n_selected (GTH_FILE_SELECTION (icon_view));
 			if (n_selected >= 1) {
 				const int  offset = 3;
 				int        n_visible;
+				int        width;
+				int        height;
 				int        border;
 				GdkPixbuf *multi_dnd_icon;
 				int        i;
 
 				n_visible = MIN (n_selected, 4);
-				gdk_drawable_get_size (dnd_icon, &width, &height);
+				gdk_pixmap_get_size (dnd_icon, &width, &height);
 				border = n_visible * offset;
 				multi_dnd_icon = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width + border, height + border);
 				gdk_pixbuf_fill (multi_dnd_icon, 0x00000000);



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