summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-icon-info.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcaja-private/caja-icon-info.c')
-rw-r--r--libcaja-private/caja-icon-info.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/libcaja-private/caja-icon-info.c b/libcaja-private/caja-icon-info.c
index 70b75ecb..75c3330c 100644
--- a/libcaja-private/caja-icon-info.c
+++ b/libcaja-private/caja-icon-info.c
@@ -558,6 +558,18 @@ caja_icon_info_get_pixbuf_nodefault (CajaIconInfo *icon)
return res;
}
+cairo_surface_t *
+caja_icon_info_get_surface_nodefault (CajaIconInfo *icon)
+{
+ GdkPixbuf *pixbuf;
+ cairo_surface_t *surface;
+
+ pixbuf = caja_icon_info_get_pixbuf_nodefault (icon);
+ surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, icon->orig_scale, NULL);
+ g_object_unref (pixbuf);
+
+ return surface;
+}
GdkPixbuf *
caja_icon_info_get_pixbuf (CajaIconInfo *icon)
@@ -581,6 +593,19 @@ caja_icon_info_get_pixbuf (CajaIconInfo *icon)
return res;
}
+cairo_surface_t *
+caja_icon_info_get_surface (CajaIconInfo *icon)
+{
+ GdkPixbuf *pixbuf;
+ cairo_surface_t *surface;
+
+ pixbuf = caja_icon_info_get_pixbuf (icon);
+ surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, icon->orig_scale, NULL);
+ g_object_unref (pixbuf);
+
+ return surface;
+}
+
GdkPixbuf *
caja_icon_info_get_pixbuf_nodefault_at_size (CajaIconInfo *icon,
gsize forced_size)
@@ -610,6 +635,19 @@ caja_icon_info_get_pixbuf_nodefault_at_size (CajaIconInfo *icon,
return scaled_pixbuf;
}
+cairo_surface_t *
+caja_icon_info_get_surface_nodefault_at_size (CajaIconInfo *icon,
+ gsize forced_size)
+{
+ GdkPixbuf *pixbuf;
+ cairo_surface_t *surface;
+
+ pixbuf = caja_icon_info_get_pixbuf_nodefault_at_size (icon, forced_size);
+ surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, icon->orig_scale, NULL);
+ g_object_unref (pixbuf);
+
+ return surface;
+}
GdkPixbuf *
caja_icon_info_get_pixbuf_at_size (CajaIconInfo *icon,
@@ -621,6 +659,9 @@ caja_icon_info_get_pixbuf_at_size (CajaIconInfo *icon,
pixbuf = caja_icon_info_get_pixbuf (icon);
+ if (pixbuf == NULL)
+ return NULL;
+
w = gdk_pixbuf_get_width (pixbuf) / icon->orig_scale;
h = gdk_pixbuf_get_height (pixbuf) / icon->orig_scale;
s = MAX (w, h);
@@ -637,6 +678,20 @@ caja_icon_info_get_pixbuf_at_size (CajaIconInfo *icon,
return scaled_pixbuf;
}
+cairo_surface_t *
+caja_icon_info_get_surface_at_size (CajaIconInfo *icon,
+ gsize forced_size)
+{
+ GdkPixbuf *pixbuf;
+ cairo_surface_t *surface;
+
+ pixbuf = caja_icon_info_get_pixbuf_at_size (icon, forced_size);
+ surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, icon->orig_scale, NULL);
+ g_object_unref (pixbuf);
+
+ return surface;
+}
+
gboolean
caja_icon_info_get_embedded_rect (CajaIconInfo *icon,
GdkRectangle *rectangle)