+static gboolean
+g_file_icon_to_tokens (GIcon *icon,
+ GPtrArray *tokens,
+ gint *out_version)
+{
+ GFileIcon *file_icon = G_FILE_ICON (icon);
+
+ g_return_val_if_fail (out_version != NULL, FALSE);
+
+ *out_version = 0;
+
+ g_ptr_array_add (tokens, g_file_get_uri (file_icon->file));
+ return TRUE;
+}
+
+static GIcon *
+g_file_icon_from_tokens (gchar **tokens,
+ gint num_tokens,
+ gint version,
+ GError **error)
+{
+ GIcon *icon;
+ GFile *file;
+
+ icon = NULL;
+
+ if (version != 0)
+ {
+ g_set_error (error,
+ G_IO_ERROR,
+ G_IO_ERROR_INVALID_ARGUMENT,
+ _("Can't handle version %d of GFileIcon encoding"),
+ version);
+ goto out;
+ }
+
+ if (num_tokens != 1)
+ {
+ g_set_error_literal (error,
+ G_IO_ERROR,
+ G_IO_ERROR_INVALID_ARGUMENT,
+ _("Malformed input data for GFileIcon"));
+ goto out;
+ }
+
+ file = g_file_new_for_uri (tokens[0]);
+ icon = g_file_icon_new (file);
+ g_object_unref (file);
+
+ out:
+ return icon;
+}
+
+static GVariant *
+g_file_icon_serialize (GIcon *icon)
+{
+ GFileIcon *file_icon = G_FILE_ICON (icon);
+
+ return g_variant_new ("(sv)", "file", g_variant_new_take_string (g_file_get_uri (file_icon->file)));
+}