summaryrefslogtreecommitdiffstats
path: root/gtk/src/icon_tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/src/icon_tools.c')
-rw-r--r--gtk/src/icon_tools.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/gtk/src/icon_tools.c b/gtk/src/icon_tools.c
index 7fd0479e6..66ce20226 100644
--- a/gtk/src/icon_tools.c
+++ b/gtk/src/icon_tools.c
@@ -19,84 +19,84 @@
GdkPixbuf*
icon_deserialize(const guint8 *sd, guint len)
{
- GdkPixdata pd;
- GdkPixbuf *pb;
- GError *err = NULL;
+ GdkPixdata pd;
+ GdkPixbuf *pb;
+ GError *err = NULL;
- gdk_pixdata_deserialize(&pd, len, sd, &err);
- pb = gdk_pixbuf_from_pixdata(&pd, TRUE, &err);
- return pb;
+ gdk_pixdata_deserialize(&pd, len, sd, &err);
+ pb = gdk_pixbuf_from_pixdata(&pd, TRUE, &err);
+ return pb;
}
guint8*
icon_serialize(const GdkPixbuf *pixbuf, guint *len)
{
- GdkPixdata pd;
- guint8 *sd;
+ GdkPixdata pd;
+ guint8 *sd;
- gdk_pixdata_from_pixbuf(&pd, pixbuf, FALSE);
- sd = gdk_pixdata_serialize(&pd, len);
- return sd;
+ gdk_pixdata_from_pixbuf(&pd, pixbuf, FALSE);
+ sd = gdk_pixdata_serialize(&pd, len);
+ return sd;
}
guint8*
icon_file_serialize(const gchar *filename, guint *len)
{
- GdkPixbuf *pb;
- GError *err = NULL;
+ GdkPixbuf *pb;
+ GError *err = NULL;
- pb = gdk_pixbuf_new_from_file(filename, &err);
- if (pb == NULL)
- {
- g_warning("Failed to open icon file %s: %s", filename, err->message);
- return NULL;
- }
- return icon_serialize(pb, len);
+ pb = gdk_pixbuf_new_from_file(filename, &err);
+ if (pb == NULL)
+ {
+ g_warning("Failed to open icon file %s: %s", filename, err->message);
+ return NULL;
+ }
+ return icon_serialize(pb, len);
}
GdkPixbuf*
base64_to_icon(const gchar *bd)
{
- guchar *sd;
- gsize len;
- GdkPixdata pd;
- GdkPixbuf *pb;
- GError *err = NULL;
+ guchar *sd;
+ gsize len;
+ GdkPixdata pd;
+ GdkPixbuf *pb;
+ GError *err = NULL;
- sd = g_base64_decode(bd, &len);
- gdk_pixdata_deserialize(&pd, len, sd, &err);
- pb = gdk_pixbuf_from_pixdata(&pd, TRUE, &err);
- g_free(sd);
- return pb;
+ sd = g_base64_decode(bd, &len);
+ gdk_pixdata_deserialize(&pd, len, sd, &err);
+ pb = gdk_pixbuf_from_pixdata(&pd, TRUE, &err);
+ g_free(sd);
+ return pb;
}
gchar*
icon_to_base64(const GdkPixbuf *pixbuf)
{
- GdkPixdata pd;
- guint len;
- guint8 *sd;
- gchar *bd;
+ GdkPixdata pd;
+ guint len;
+ guint8 *sd;
+ gchar *bd;
- gdk_pixdata_from_pixbuf(&pd, pixbuf, FALSE);
- sd = gdk_pixdata_serialize(&pd, &len);
- bd = g_base64_encode(sd, len);
- g_free(sd);
- return bd;
+ gdk_pixdata_from_pixbuf(&pd, pixbuf, FALSE);
+ sd = gdk_pixdata_serialize(&pd, &len);
+ bd = g_base64_encode(sd, len);
+ g_free(sd);
+ return bd;
}
gchar*
icon_file_to_base64(const gchar *filename)
{
- GdkPixbuf *pb;
- GError *err = NULL;
+ GdkPixbuf *pb;
+ GError *err = NULL;
- pb = gdk_pixbuf_new_from_file(filename, &err);
- if (pb == NULL)
- {
- g_warning("Failed to open icon file %s: %s", filename, err->message);
- return NULL;
- }
- return icon_to_base64(pb);
+ pb = gdk_pixbuf_new_from_file(filename, &err);
+ if (pb == NULL)
+ {
+ g_warning("Failed to open icon file %s: %s", filename, err->message);
+ return NULL;
+ }
+ return icon_to_base64(pb);
}