summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-10-04 04:26:31 -0300
committerMarcel Holtmann <marcel@holtmann.org>2012-11-26 14:44:48 +0100
commitad0a89121ec05d963f41525fb889eb0286aa754f (patch)
tree170620dcf8cf3aa0182154c979582fc19002451d /gdbus
parentd5ea6186eb121f3d2218c710298aa551ec9cb312 (diff)
downloadconnman-ad0a89121ec05d963f41525fb889eb0286aa754f.tar.gz
connman-ad0a89121ec05d963f41525fb889eb0286aa754f.tar.bz2
connman-ad0a89121ec05d963f41525fb889eb0286aa754f.zip
gdbus: Add properties into Introspectable interface
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/object.c19
1 files changed, 19 insertions, 0 deletions
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</signal>\n");
}
}
+
+ for (property = iface->properties; property && property->name;
+ property++) {
+ gboolean deprecated = property->flags &
+ G_DBUS_PROPERTY_FLAG_DEPRECATED;
+
+ g_string_append_printf(gstr, "\t\t<property name=\"%s\""
+ " type=\"%s\" access=\"%s%s\"",
+ property->name, 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,