From 0124edc9296b9f0a942053d9f1ae1c778ca79185 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Sun, 7 Jul 2019 07:00:00 -0400 Subject: Replace gdkpixbuf with cairo_surfaces in a few more places --- src/caja-spatial-window.c | 55 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 28 deletions(-) (limited to 'src/caja-spatial-window.c') diff --git a/src/caja-spatial-window.c b/src/caja-spatial-window.c index c4c04983..52bd6d39 100644 --- a/src/caja-spatial-window.c +++ b/src/caja-spatial-window.c @@ -29,7 +29,6 @@ #include -#include #include #include #include @@ -653,7 +652,7 @@ location_button_clicked_callback (GtkWidget *widget, { CajaWindowSlot *slot; GtkWidget *popup, *menu_item, *first_item = NULL; - GdkPixbuf *pixbuf = NULL; + cairo_surface_t *surface = NULL; GFile *location; GFile *child_location; GMainLoop *loop; @@ -678,18 +677,18 @@ location_button_clicked_callback (GtkWidget *widget, name = caja_file_get_display_name (file); - pixbuf = NULL; + surface = NULL; - pixbuf = caja_file_get_icon_pixbuf (file, - caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU), - TRUE, - gtk_widget_get_scale_factor (widget), - CAJA_FILE_ICON_FLAGS_IGNORE_VISITING); + surface = caja_file_get_icon_surface (file, + caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU), + TRUE, + gtk_widget_get_scale_factor (widget), + CAJA_FILE_ICON_FLAGS_IGNORE_VISITING); - if (pixbuf != NULL) + if (surface != NULL) { - menu_item = eel_image_menu_item_new_from_pixbuf (pixbuf, name); - g_object_unref (pixbuf); + menu_item = eel_image_menu_item_new_from_surface (surface, name); + cairo_surface_destroy (surface); } else { @@ -778,19 +777,19 @@ location_button_drag_begin_callback (GtkWidget *widget, CajaSpatialWindow *window) { CajaWindowSlot *slot; - GdkPixbuf *pixbuf; + cairo_surface_t *surface; slot = CAJA_WINDOW (window)->details->active_pane->active_slot; - pixbuf = caja_file_get_icon_pixbuf (slot->viewed_file, - get_dnd_icon_size (window), - FALSE, - gtk_widget_get_scale_factor (widget), - CAJA_FILE_ICON_FLAGS_IGNORE_VISITING | CAJA_FILE_ICON_FLAGS_FOR_DRAG_ACCEPT); + surface = caja_file_get_icon_surface (slot->viewed_file, + get_dnd_icon_size (window), + FALSE, + gtk_widget_get_scale_factor (widget), + CAJA_FILE_ICON_FLAGS_IGNORE_VISITING | CAJA_FILE_ICON_FLAGS_FOR_DRAG_ACCEPT); - gtk_drag_set_icon_pixbuf (context, pixbuf, 0, 0); + gtk_drag_set_icon_surface (context, surface); - g_object_unref (pixbuf); + cairo_surface_destroy (surface); } /* build MATE icon list, which only contains the window's URI. @@ -858,18 +857,18 @@ caja_spatial_window_set_location_button (CajaSpatialWindow *window, error = caja_file_get_file_info_error (file); if (error == NULL) { - GdkPixbuf *pixbuf; + cairo_surface_t *surface; - pixbuf = caja_file_get_icon_pixbuf (file, - caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU), - TRUE, - gtk_widget_get_scale_factor (window->details->location_button), - CAJA_FILE_ICON_FLAGS_IGNORE_VISITING); + surface = caja_file_get_icon_surface (file, + caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU), + TRUE, + gtk_widget_get_scale_factor (window->details->location_button), + CAJA_FILE_ICON_FLAGS_IGNORE_VISITING); - if (pixbuf != NULL) + if (surface != NULL) { - gtk_image_set_from_pixbuf (GTK_IMAGE (window->details->location_icon), pixbuf); - g_object_unref (pixbuf); + gtk_image_set_from_surface (GTK_IMAGE (window->details->location_icon), surface); + cairo_surface_destroy (surface); } else { -- cgit v1.2.1