diff options
author | Ryan Lortie <desrt@moonpix.lan> | 2013-02-15 11:12:47 -0500 |
---|---|---|
committer | Ryan Lortie <desrt@moonpix.lan> | 2013-02-15 11:12:47 -0500 |
commit | c447062e42944470d0b34d581368fcaad58118b1 (patch) | |
tree | 0d9f3c333bfdf345f5e87aeb4ea9cf61ab4d04a0 /gio/gemblem.c | |
parent | 23d6d1769bc95eba6029dae4593755154c320cf4 (diff) | |
download | glib-wip/gicon.tar.gz |
GIcon serialize wipwip/gicon
Diffstat (limited to 'gio/gemblem.c')
-rw-r--r-- | gio/gemblem.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gio/gemblem.c b/gio/gemblem.c index 1df712b6a..77ea405e5 100644 --- a/gio/gemblem.c +++ b/gio/gemblem.c @@ -349,6 +349,23 @@ g_emblem_from_tokens (gchar **tokens, return G_ICON (emblem); } +static GVariant * +g_emblem_serialize (GIcon *icon) +{ + GEmblem *emblem = G_EMBLEM (icon); + GVariant *icon_data; + GVariant *result; + + icon_data = g_icon_serialize (emblem->icon); + if (!icon_data) + return NULL; + + result = g_variant_new ("(vu)", icon_data, emblem->origin); + g_variant_unref (icon_data); + + return result; +} + static void g_emblem_iface_init (GIconIface *iface) { @@ -356,4 +373,5 @@ g_emblem_iface_init (GIconIface *iface) iface->equal = g_emblem_equal; iface->to_tokens = g_emblem_to_tokens; iface->from_tokens = g_emblem_from_tokens; + iface->serialize = g_emblem_serialize; } |