aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-02-12 12:15:09 -0600
committerTed Gould <ted@canonical.com>2009-02-12 12:15:09 -0600
commitc3964b3bdbd6ccfe97d6b0387f6784e891df8552 (patch)
tree7c2f5796887f0c4fed5e68bb6f7c96e5e8a3308a
parentee2747416fa823d805af6d417dcd5f6159399f11 (diff)
downloadlibayatana-indicator-c3964b3bdbd6ccfe97d6b0387f6784e891df8552.tar.gz
libayatana-indicator-c3964b3bdbd6ccfe97d6b0387f6784e891df8552.tar.bz2
libayatana-indicator-c3964b3bdbd6ccfe97d6b0387f6784e891df8552.zip
Adding in the code for handling icons and time
-rw-r--r--libindicate/listener.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/libindicate/listener.c b/libindicate/listener.c
index f641b56..3b1e3ea 100644
--- a/libindicate/listener.c
+++ b/libindicate/listener.c
@@ -686,9 +686,39 @@ get_property_cb (DBusGProxy *proxy, char * OUT_value, GError *error, gpointer us
break;
}
case PROPERTY_TYPE_ICON: {
+ indicate_listener_get_property_icon_cb cb = (indicate_listener_get_property_icon_cb)get_property_data->cb;
+
+ GInputStream * input = g_memory_input_stream_new_from_data(OUT_value, strlen(OUT_value) - 1, NULL);
+ if (input == NULL) {
+ g_warning("Cound not create input stream from icon property data");
+ break;
+ }
+
+ GError * error = NULL;
+ GdkPixbuf * icon = gdk_pixbuf_new_from_stream(input, NULL, &error);
+ if (icon != NULL) {
+ cb(get_property_data->listener, get_property_data->server, get_property_data->indicator, get_property_data->property, icon, get_property_data->data);
+ }
+
+ if (error != NULL) {
+ g_warning("Unable to build Pixbuf from icon data: %s", error->message);
+ g_error_free(error);
+ }
+
+ error = NULL;
+ g_input_stream_close(input, NULL, error);
+ if (error != NULL) {
+ g_warning("Unable to close input stream: %s", error->message);
+ g_error_free(error);
+ }
break;
}
case PROPERTY_TYPE_TIME: {
+ indicate_listener_get_property_time_cb cb = (indicate_listener_get_property_icon_cb)get_property_data->cb;
+ GTimeVal time;
+ if (g_time_val_from_iso8601(OUT_value, &time)) {
+ cb(get_property_data->listener, get_property_data->server, get_property_data->indicator, get_property_data->property, &time, get_property_data->data);
+ }
break;
}
}