From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
To: linux-bluetooth@vger.kernel.org
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Subject: [PATCH BlueZ 5/5] gdbus: Add properties into Introspectable interface
Date: Thu, 19 Jul 2012 00:20:08 -0300 [thread overview]
Message-ID: <1342668008-5522-6-git-send-email-lucas.demarchi@profusion.mobi> (raw)
In-Reply-To: <1342668008-5522-1-git-send-email-lucas.demarchi@profusion.mobi>
---
gdbus/object.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/gdbus/object.c b/gdbus/object.c
index c19f1d7..e2e8b12 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -80,6 +80,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 &
@@ -126,6 +127,26 @@ 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,
+ ">\n\t\t\t<annotation"
+ " name=\"org.freedesktop.DBus.Deprecated\""
+ " value=\"true\"/>\n\t\t</property>\n");
+ }
}
static void generate_introspection_xml(DBusConnection *conn,
--
1.7.11.2
prev parent reply other threads:[~2012-07-19 3:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 3:20 [PATCH BlueZ 0/5] DBus.Properties Lucas De Marchi
2012-07-19 3:20 ` [PATCH BlueZ 1/5] gdbus: Add skeleton of DBus.Properties interface Lucas De Marchi
2012-07-19 8:03 ` Marcel Holtmann
2012-07-19 8:19 ` Lucas De Marchi
2012-07-19 8:49 ` Marcel Holtmann
2012-07-19 3:20 ` [PATCH BlueZ 2/5] gdbus: Implement DBus.Properties.Get method Lucas De Marchi
2012-07-19 3:20 ` [PATCH BlueZ 3/5] gdbus: Implement DBus.Properties.GetAll method Lucas De Marchi
2012-07-19 3:20 ` [PATCH BlueZ 4/5] gdbus: Implement DBus.Properties.Set method Lucas De Marchi
2012-07-19 3:20 ` Lucas De Marchi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1342668008-5522-6-git-send-email-lucas.demarchi@profusion.mobi \
--to=lucas.demarchi@profusion.mobi \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).