From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
To: linux-bluetooth@vger.kernel.org
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Subject: [BlueZ v3 07/10] gdbus: add Deprecated annotation to introspection
Date: Fri, 27 Apr 2012 18:14:42 -0300 [thread overview]
Message-ID: <1335561285-3332-8-git-send-email-lucas.demarchi@profusion.mobi> (raw)
In-Reply-To: <1335561285-3332-1-git-send-email-lucas.demarchi@profusion.mobi>
---
gdbus/object.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/gdbus/object.c b/gdbus/object.c
index acbaad0..52803c0 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -160,7 +160,10 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
const GDBusSignalTable *signal;
for (method = iface->methods; method && method->name; method++) {
- if (!strlen(method->decorated_signature) &&
+ gboolean deprecated = method->flags &
+ G_DBUS_METHOD_FLAG_DEPRECATED;
+
+ if (!deprecated && !strlen(method->decorated_signature) &&
!strlen(method->decorated_reply))
g_string_append_printf(gstr, "\t\t<method name=\"%s\"/>\n",
method->name);
@@ -169,18 +172,29 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
method->name);
print_arguments(gstr, method->decorated_signature, "in");
print_arguments(gstr, method->decorated_reply, "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 (!strlen(signal->decorated_signature))
+ gboolean deprecated = signal->flags &
+ G_DBUS_SIGNAL_FLAG_DEPRECATED;
+
+ if (!deprecated && !strlen(signal->decorated_signature))
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->decorated_signature, 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.10
next prev parent reply other threads:[~2012-04-27 21:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-27 21:14 [BlueZ v3 00/10] gdbus: Better D-Bus introspection Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 01/10] gdbus: return if method signature is malformed Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 02/10] gdbus: do not call memset for terminating NUL Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 03/10] gdbus: save copy of undecorated signature Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 04/10] gdbus: use argument name in method introspection Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 05/10] gdbus: add decorated signature to arguments Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 06/10] gdbus: add decorated signature to return values Lucas De Marchi
2012-04-27 21:14 ` Lucas De Marchi [this message]
2012-04-27 21:14 ` [BlueZ v3 08/10] gdbus: add Method.NoReply annotation to introspection Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 09/10] Constify GDBus method tables Lucas De Marchi
2012-04-27 21:14 ` [BlueZ v3 10/10] Constify GDBus signal tables Lucas De Marchi
2012-04-29 11:52 ` [BlueZ v3 00/10] gdbus: Better D-Bus introspection Luiz Augusto von Dentz
2012-04-29 21:40 ` Lucas De Marchi
2012-04-30 10:34 ` Luiz Augusto von Dentz
2012-04-30 13:37 ` Lucas De Marchi
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=1335561285-3332-8-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).