From dc12fac5f8a36d0276719bc5a98aa63bffe86399 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 17 Feb 2005 21:11:18 +0000 Subject: 2005-02-17 Colin Walters * glib/dbus-gparser.c (struct Parser): Add in_annotation boolean. (parse_node, parse_interface, parse_method, parse_signal) (parse_property, parse_annotation): Lose if we're currently in an annotation. (parse_annotation): New function. (parser_start_element, parser_end_element): Handle annotation. (parse_method, parse_interface): Remove support for c_name attribute, switch to annotations. * glib/dbus-gidl.h (interface_info_get_binding_names) (method_info_get_binding_names) (interface_info_get_binding_name, method_info_get_binding_name) (interface_info_set_binding_name, method_info_set_binding_name): Remove. (interface_info_get_annotations, method_info_get_annotations) (interface_info_get_annotation, method_info_get_annotation) (interface_info_add_annotation, method_info_add_annotation): Prototype. * glib/dbus-gidl.c (struct InterfaceInfo): Substitute "annotations" for "bindings". (struct MethodInfo): Ditto. Straightfoward conversion of binding methods into annotation methods as prototyped. * glib/dbus-glib-tool.c (pretty_print): Print annotations. * glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_C_SYMBOL): Define. * glib/dbus-binding-tool-glib.c (gather_marshallers, generate_glue): Use new annotation API. * doc/introspect.dtd: Fix a number of DTD syntax errors. Add annotation element. * doc/dbus-specification.xml: Discuss introspection annotations, include list of well-known annotations. * test/glib/test-service-glib.xml: Make validate against new DTD. --- doc/dbus-specification.xml | 41 ++++++++++++++++++++++++++++++----------- doc/introspect.dtd | 23 ++++++++++++----------- 2 files changed, 42 insertions(+), 22 deletions(-) (limited to 'doc') diff --git a/doc/dbus-specification.xml b/doc/dbus-specification.xml index 3d6a207f..ad21af62 100644 --- a/doc/dbus-specification.xml +++ b/doc/dbus-specification.xml @@ -2296,6 +2296,7 @@ <method name="Frobate"> <arg name="foo" type="int32" direction="in"/> <arg name="bar" type="string" direction="out"/> + <annotation name="org.freedesktop.DBus.Deprecated" value="true"/> </method> <signal name="Changed"> <arg name="new_value" type="boolean"/> @@ -2365,15 +2366,6 @@ one <node>. - - - The method, interface, property, and signal elements may have - an attribute deprecated="yes|no". If the attribute is not - present, the default value for an interface is "no", and - the default value for methods, properties, and signals is - the deprecation status of the interface. - - The "name" attribute on arguments is optional. @@ -2381,9 +2373,36 @@ - + + Method, interface, property, and signal elements may have + "annotations", which are generic key/value pairs of metadata. + They are similar conceptually to Java's annotations and C# attributes. + Well-known annotations: + + + + + + Name + Values (separated by ,) + Description + + + + + org.freedesktop.DBus.Deprecated + true,false + Whether or not the entity is deprecated; defaults to false + + + org.freedesktop.DBus.GLib.CSymbol + (string) + The C symbol; may be used for methods and interfaces + + + + - Message Bus Specification diff --git a/doc/introspect.dtd b/doc/introspect.dtd index 5e1c96df..fd6aa472 100644 --- a/doc/introspect.dtd +++ b/doc/introspect.dtd @@ -4,32 +4,33 @@ - + - + - + - - + - + - + - - + - - + + + + + -- cgit