summaryrefslogtreecommitdiff
path: root/gtk/tools
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/tools')
-rw-r--r--gtk/tools/gdkpixbufutils.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gtk/tools/gdkpixbufutils.c b/gtk/tools/gdkpixbufutils.c
index c706d720a8..1bbde140ba 100644
--- a/gtk/tools/gdkpixbufutils.c
+++ b/gtk/tools/gdkpixbufutils.c
@@ -561,6 +561,19 @@ gtk_make_symbolic_pixbuf_from_file (GFile *file,
}
GdkTexture *
+gtk_load_symbolic_texture_from_resource (const char *path)
+{
+ GdkPixbuf *pixbuf;
+ GdkTexture *texture;
+
+ pixbuf = _gdk_pixbuf_new_from_resource (path, "png", NULL);
+ texture = gdk_texture_new_for_pixbuf (pixbuf);
+ g_object_unref (pixbuf);
+
+ return texture;
+}
+
+GdkTexture *
gtk_make_symbolic_texture_from_resource (const char *path,
int width,
int height,
@@ -581,6 +594,28 @@ gtk_make_symbolic_texture_from_resource (const char *path,
}
GdkTexture *
+gtk_load_symbolic_texture_from_file (GFile *file)
+{
+ GdkPixbuf *pixbuf;
+ GdkTexture *texture;
+ GInputStream *stream;
+
+ stream = G_INPUT_STREAM (g_file_read (file, NULL, NULL));
+ if (stream == NULL)
+ return NULL;
+
+ pixbuf = _gdk_pixbuf_new_from_stream (stream, "png", NULL, NULL);
+ g_object_unref (stream);
+ if (pixbuf == NULL)
+ return NULL;
+
+ texture = gdk_texture_new_for_pixbuf (pixbuf);
+ g_object_unref (pixbuf);
+
+ return texture;
+}
+
+GdkTexture *
gtk_make_symbolic_texture_from_file (GFile *file,
int width,
int height,