From: Henrique Dante de Almeida <hdante@profusion.mobi>
To: linux-bluetooth@vger.kernel.org
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Subject: [PATCH 10/11] gdbus: add Deprecated annotation in introspection
Date: Wed, 23 May 2012 10:20:07 -0300 [thread overview]
Message-ID: <1337779208-3555-11-git-send-email-hdante@profusion.mobi> (raw)
In-Reply-To: <1337779208-3555-1-git-send-email-hdante@profusion.mobi>
From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
---
gdbus/object.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/gdbus/object.c b/gdbus/object.c
index fcdd6ec..95947f3 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -82,7 +82,11 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
const GDBusSignalTable *signal;
for (method = iface->methods; method && method->name; method++) {
- if (!(method->in_args && method->in_args->name) &&
+ gboolean deprecated = method->flags &
+ G_DBUS_METHOD_FLAG_DEPRECATED;
+
+ if (!deprecated &&
+ !(method->in_args && method->in_args->name) &&
!(method->out_args && method->out_args->name))
g_string_append_printf(gstr, "\t\t<method name=\"%s\"/>\n",
method->name);
@@ -91,18 +95,29 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
method->name);
print_arguments(gstr, method->in_args, "in");
print_arguments(gstr, method->out_args, "out");
+
+ if (deprecated)
+ g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n");
+
g_string_append_printf(gstr, "\t\t</method>\n");
}
}
for (signal = iface->signals; signal && signal->name; signal++) {
- if (!(signal->args && signal->args->name))
+ gboolean deprecated = signal->flags &
+ G_DBUS_SIGNAL_FLAG_DEPRECATED;
+
+ if (!deprecated && !(signal->args && signal->args->name))
g_string_append_printf(gstr, "\t\t<signal name=\"%s\"/>\n",
signal->name);
else {
g_string_append_printf(gstr, "\t\t<signal name=\"%s\">\n",
signal->name);
print_arguments(gstr, signal->args, NULL);
+
+ if (deprecated)
+ g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n");
+
g_string_append_printf(gstr, "\t\t</signal>\n");
}
}
--
1.7.9.5
next prev parent reply other threads:[~2012-05-23 13:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-23 13:19 [PATCH 00/11] gdbus: Better D-Bus introspection Henrique Dante de Almeida
2012-05-23 13:19 ` [PATCH 01/11] Constify GDBus method tables Henrique Dante de Almeida
2012-05-23 13:19 ` [PATCH 02/11] Constify GDBus signal tables Henrique Dante de Almeida
2012-05-23 13:20 ` [PATCH 03/11] gdbus: add argument info to methods and signals Henrique Dante de Almeida
2012-05-23 13:20 ` [PATCH 04/11] gdbus: add and use helpers for table declarations Henrique Dante de Almeida
2012-05-23 13:20 ` [PATCH 05/11] Convert GDBus methods and signals to use macro helpers Henrique Dante de Almeida
2012-05-23 13:20 ` [PATCH 06/11] gdbus: use GDBusArgInfo to generate introspection Henrique Dante de Almeida
2012-05-23 13:20 ` [PATCH 07/11] gdbus: loop over args to check message signature Henrique Dante de Almeida
2012-05-23 13:20 ` [PATCH 08/11] Do not set signature and reply in GDBus tables Henrique Dante de Almeida
2012-05-23 13:20 ` [PATCH 09/11] gdbus: remove signature and reply from tables Henrique Dante de Almeida
2012-05-23 13:20 ` Henrique Dante de Almeida [this message]
2012-05-23 13:20 ` [PATCH 11/11] gdbus: add Method.NoReply annotation in introspection Henrique Dante de Almeida
2012-05-23 13:28 ` [PATCH 00/11] gdbus: Better D-Bus introspection Marcel Holtmann
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=1337779208-3555-11-git-send-email-hdante@profusion.mobi \
--to=hdante@profusion.mobi \
--cc=linux-bluetooth@vger.kernel.org \
--cc=lucas.demarchi@profusion.mobi \
/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