summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2019-07-07 07:00:00 -0400
committermonsta <[email protected]>2019-07-23 17:37:34 +0300
commit8446b73407dd3c9ca0b061d4c87b94e52cf94a85 (patch)
tree531589c21ceb68636d9c18fec8a53387aee5e0c5 /src
parentdd2609cd88cfded8f4a5c8d8455f8aaad324b3d9 (diff)
downloadcaja-8446b73407dd3c9ca0b061d4c87b94e52cf94a85.tar.bz2
caja-8446b73407dd3c9ca0b061d4c87b94e52cf94a85.tar.xz
Replace gdkpixbuf with cairo_surfaces in a few more places
Diffstat (limited to 'src')
-rw-r--r--src/caja-spatial-window.c55
-rw-r--r--src/file-manager/fm-empty-view.c6
2 files changed, 30 insertions, 31 deletions
diff --git a/src/caja-spatial-window.c b/src/caja-spatial-window.c
index ec088035..af776214 100644
--- a/src/caja-spatial-window.c
+++ b/src/caja-spatial-window.c
@@ -43,7 +43,6 @@
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-string.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
@@ -647,7 +646,7 @@ location_button_clicked_callback (GtkWidget *widget,
{
CajaWindowSlot *slot;
GtkWidget *popup, *menu_item, *first_item = NULL;
- GdkPixbuf *pixbuf;
+ cairo_surface_t *surface;
GFile *location;
GFile *child_location;
GMainLoop *loop;
@@ -672,18 +671,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
{
@@ -772,19 +771,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.
@@ -852,18 +851,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
{
diff --git a/src/file-manager/fm-empty-view.c b/src/file-manager/fm-empty-view.c
index 36d76d9d..b0f577f7 100644
--- a/src/file-manager/fm-empty-view.c
+++ b/src/file-manager/fm-empty-view.c
@@ -57,17 +57,17 @@ fm_empty_view_add_file (FMDirectoryView *view, CajaFile *file, CajaDirectory *di
static GTimer *timer = NULL;
static gdouble cumu = 0, elaps;
FM_EMPTY_VIEW (view)->details->number_of_files++;
- GdkPixbuf *icon;
+ cairo_surface_t *icon;
if (!timer) timer = g_timer_new ();
g_timer_start (timer);
- icon = caja_file_get_icon_pixbuf (file, caja_get_icon_size_for_zoom_level (CAJA_ZOOM_LEVEL_STANDARD), TRUE, 0);
+ icon = caja_file_get_icon_surface (file, caja_get_icon_size_for_zoom_level (CAJA_ZOOM_LEVEL_STANDARD), TRUE, 0);
elaps = g_timer_elapsed (timer, NULL);
g_timer_stop (timer);
- g_object_unref (icon);
+ cairo_surface_destroy (icon);
cumu += elaps;
g_message ("entire loading: %.3f, cumulative %.3f", elaps, cumu);