From 8c634044edaab62448858a8dd1a200a96f3feb6c Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Thu, 4 Oct 2012 04:26:31 -0300 Subject: [PATCH] gdbus: Add properties into Introspectable interface --- gdbus/object.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gdbus/object.c b/gdbus/object.c index 7378523a..662ebe3b 100644 --- a/gdbus/object.c +++ b/gdbus/object.c @@ -95,6 +95,7 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface) { const GDBusMethodTable *method; const GDBusSignalTable *signal; + const GDBusPropertyTable *property; for (method = iface->methods; method && method->name; method++) { gboolean deprecated = method->flags & @@ -147,6 +148,24 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface) g_string_append_printf(gstr, "\t\t\n"); } } + + for (property = iface->properties; property && property->name; + property++) { + gboolean deprecated = property->flags & + G_DBUS_PROPERTY_FLAG_DEPRECATED; + + g_string_append_printf(gstr, "\t\tname, property->type, + property->get ? "read" : "", + property->set ? "write" : ""); + + if (!deprecated) + g_string_append_printf(gstr, "/>\n"); + else + g_string_append_printf(gstr, + G_DBUS_ANNOTATE_DEPRECATED(">\n\t\t\t")); + } } static void generate_introspection_xml(DBusConnection *conn,