typedef struct _Deserializer Deserializer;
-struct _Deserializer
+struct _Deserializer
{
const char * mime_type; /* interned */
GType type;
formats = gdk_pixbuf_get_formats ();
- /* Make sure png comes first */
- for (f = formats; f; f = f->next)
- {
- GdkPixbufFormat *fmt = f->data;
- char *name;
-
- name = gdk_pixbuf_format_get_name (fmt);
- if (g_str_equal (name, "png"))
- {
- formats = g_slist_delete_link (formats, f);
- formats = g_slist_prepend (formats, fmt);
-
- g_free (name);
- break;
- }
-
- g_free (name);
- }
-
for (f = formats; f; f = f->next)
{
GdkPixbufFormat *fmt = f->data;
typedef struct _Serializer Serializer;
-struct _Serializer
+struct _Serializer
{
const char * mime_type; /* interned */
GType type;
serializer->type == type)
return serializer;
}
-
+
return NULL;
}
const GValue *value;
GdkPixbuf *pixbuf;
const char *name;
-
+
name = gdk_content_serializer_get_user_data (serializer);
value = gdk_content_serializer_get_value (serializer);
gdk_pixbuf_save_to_stream_async (pixbuf,
gdk_content_serializer_get_output_stream (serializer),
name,
- gdk_content_serializer_get_cancellable (serializer),
+ gdk_content_serializer_get_cancellable (serializer),
pixbuf_serializer_finish,
serializer,
g_str_equal (name, "png") ? "compression" : NULL, "2",
else if (G_VALUE_HOLDS (value, GDK_TYPE_FILE_LIST))
{
GSList *l;
-
+
for (l = g_value_get_boxed (value); l; l = l->next)
{
uri = g_file_get_uri (l->data);
{
GString *str;
GSList *l;
-
+
str = g_string_new (NULL);
for (l = g_value_get_boxed (value); l; l = l->next)
formats = gdk_pixbuf_get_formats ();
- /* Make sure png comes first */
- for (f = formats; f; f = f->next)
- {
- GdkPixbufFormat *fmt = f->data;
- char *name;
-
- name = gdk_pixbuf_format_get_name (fmt);
- if (g_str_equal (name, "png"))
- {
- formats = g_slist_delete_link (formats, f);
- formats = g_slist_prepend (formats, fmt);
-
- g_free (name);
- break;
- }
-
- g_free (name);
- }
-
for (f = formats; f; f = f->next)
{
GdkPixbufFormat *fmt = f->data;