scanner: Support documentation elements

On Wed, 18 Jan 2012 12:29:37 -0800
"Kristensen, Kristian H" <kristian.h.kristensen@intel.com> wrote:
> Yeah, that looks good.  I was thinking of a separate <description> tag
> to avoid stuffing too much into an attribute.

How does this look?  It adds a summary attribute to atomic elements,
and a <description> tag with a summary for others.  Spits out enum
documentation like this:

/**
 * wl_display_error - global error values
 * @WL_DISPLAY_ERROR_INVALID_OBJECT: server couldn't find object
 * @WL_DISPLAY_ERROR_INVALID_METHOD: method doesn't exist on the specified interface
 * @WL_DISPLAY_ERROR_NO_MEMORY: server is out of memory
 *
 * These errors are global and can be emitted in response to any server request.
 */
enum wl_display_error {
	WL_DISPLAY_ERROR_INVALID_OBJECT = 0,
	WL_DISPLAY_ERROR_INVALID_METHOD = 1,
	WL_DISPLAY_ERROR_NO_MEMORY = 2,
};

and structure documentation like this:

/**
 * wl_display - core global object
 * @bind: bind an object to the display
 * @sync: (none)
 *
 * The core global object. This is a special singleton object. It is used for
 * internal wayland protocol features.
 */
struct wl_display_interface {
	void (*bind)(struct wl_client *client,
		     struct wl_resource *resource,
		     uint32_t name,
		     const char *interface,
		     uint32_t version,
		     uint32_t id);
	void (*sync)(struct wl_client *client,
		     struct wl_resource *resource,
		     uint32_t callback);
};
This commit is contained in:
Jesse Barnes 2012-01-18 14:09:47 -08:00 committed by Kristian Høgsberg
parent 4b5871e2b8
commit 5cd0471311
2 changed files with 146 additions and 4 deletions

View file

@ -30,7 +30,13 @@
<!-- The core global object. This is a special singleton object.
It is used for internal wayland protocol features. -->
<interface name="wl_display" version="1">
<description summary="core global object">
The core global object. This is a special singleton object.
It is used for internal wayland protocol features.
</description>
<request name="bind">
<description summary="bind an object to the display">
</description>
<arg name="name" type="uint"/>
<arg name="interface" type="string"/>
<arg name="version" type="uint"/>
@ -54,9 +60,16 @@
</event>
<enum name="error">
<entry name="invalid_object" value="0"/>
<entry name="invalid_method" value="1"/>
<entry name="no_memory" value="2"/>
<description summary="global error values">
These errors are global and can be emitted in response to any
server request.
</description>
<entry name="invalid_object" value="0"
summary="server couldn't find object"/>
<entry name="invalid_method" value="1"
summary="method doesn't exist on the specified interface"/>
<entry name="no_memory" value="2"
summary="server is out of memory"/>
</enum>
<!-- Notify the client of global objects. These are objects that