Commit graph

133 commits

Author SHA1 Message Date
John Kåre Alsaker
fa51801786 scanner: Make sure arguments have names. 2012-10-16 11:14:24 -04:00
Olivier Blin
0d77c5302e scanner: use printf format attributes for desc_dump 2012-10-15 13:04:07 -04:00
Olivier Blin
f36c61571f scanner: fix writing i586 descriptions
This moves desc as first argument of desc_dump().
Description writing was broken on i586 because desc_dump() used
va_arg() after a vsnprintf() call to find the last argument.
But after calling a function with a va_arg argument, this arguments is
undefined.
2012-10-15 13:04:07 -04:00
Olivier Blin
dc28c0bafd scanner: remove useless desc_dump arguments
This are remnant from the desc_dump generalization in commit 375cb418.
2012-10-15 13:04:07 -04:00
Kristian Høgsberg
8872956dfd scanner: Generate client stubs for wl_display requests
We used to special case this because of the untyped new-id argument in
the bind request.  Now that the scanner can handle that, we can
remove the special case.

Switching to the generated stubs does bring an API change since we now
also take the interface version that the client expects as an argument.
Previously we would take this from the interface struct, but the
application may implement a lower version than what the interface struct
provides.  To make sure we don't try to dispatch event the client
doesn't implement handlers for, we have to use a client supplied version
number.
2012-10-10 20:59:00 -04:00
Kristian Høgsberg
85a6a47087 scanner: Send interface name and version for types new_id args
This makes the scanner generate the code and meta data to send the
interface name and version when we pass a typeless new_id.  This way, the
generic factory mechanism provided by wl_display.bind can be provided by
any interface.
2012-10-10 20:59:00 -04:00
Daniel Stone
db0add6d5e Make NEW_IDs nullable
The connection-handling code already allows this, so make it legal in
the protocol definition too.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-07-23 20:16:57 -04:00
Robert Ancell
e7e1296682 scanner: Include weston-client.h as the inline functions require it 2012-07-09 22:01:25 -04:00
Martin Olsson
e760ec9fa9 scanner: Plug memory leak in end_element() 2012-07-09 17:59:23 -04:00
Christopher James Halse Rogers
161c690b55 protocol: Add explicit nullable types
Most of the time it does not make sense to pass a NULL object, string, or array
to a protocol request. This commit adds an explicit “allow-null” attribute
to mark the request arguments where NULL makes sense.

Passing a NULL object, string, or array to a protocol request which is not
marked as allow-null is now an error. An implementation will never receive
a NULL value for these arguments from a client.

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-07-02 13:53:02 -04:00
Dylan Noblesmith
cadd999292 drop use of strerror()
It isn't thread-safe. Use the %m conversion specifier instead,
like the rest of the code already does.
2012-06-30 19:37:04 +00:00
Kristian Høgsberg
9de9e39f87 Allocate client proxy automatically for new objects
When the server send a new object ID, the client used to have to allocate
the proxy manually and without type-safety.  We now allocate the proxy
in a client-side post-processing step on the incoming closure.
2012-06-28 22:01:58 -04:00
Daniel Stone
c5aba11acc Add support for signed 24.8 decimal numbers
'fixed' is a signed decimal type which offers a sign bit, 23 bits of
integer precision, and 8 bits of decimal precision.  This is exposed as
an opaque struct with conversion helpers to and from double and int on
the C API side.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08 14:40:39 -04:00
Kristian Høgsberg
375cb418f4 scanner: Generalize desc_dump() to handle hanging indents 2012-05-07 23:41:48 -04:00
Kristian Høgsberg
5b0d8f09af scanner: Fix desc_dump() to not extend beyond column 72 2012-05-07 22:43:56 -04:00
Kristian Høgsberg
e4026ff797 scanner: Use indent() function in desc_dump() 2012-05-07 22:38:23 -04:00
Pekka Paalanen
03c40a8c99 scanner: fix a signedness warning
Trivial fix to a
warning: comparison between signed and unsigned integer expressions

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-30 10:12:35 -04:00
Kristian Høgsberg
814a626087 scanner: Add since attribute
This will help us document when a request or event was added to the protocol.
2012-03-05 10:31:53 -05:00
Pekka Paalanen
86a5d17afe scanner: emit event wrapper functions for server
Generate typed wrapper functions for sending events in a server.

This allows compile time type checking, unlike the existing method of
calling the variadic function wl_resource_post_event().

The stuff in wayland-server.h had to be slightly reordered to have all
(forward) declarations before use.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-02 17:55:45 +02:00
Peter Hutterer
a8c9e82c49 scanner: Remove unused variable 'len'
scanner.c: In function ‘desc_dump’:
scanner.c:142:42: warning: unused variable ‘len’ [-Wunused-variable]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-23 15:45:03 -05:00
Tiago Vignatti
8f9de83f7b scanner: don't print new line when no descriptions are provided
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-02-09 10:06:18 -05:00
Jesse Barnes
f66aa1d08f scanner: allow summary attributes in args and <description> in <protocol>
Add support for arg summaries for use by detailed structure element
descriptions.
2012-01-19 17:16:39 -05:00
Jesse Barnes
5cd0471311 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);
};
2012-01-18 18:22:25 -05:00
Kristian Høgsberg
44186b522f scanner: Only strdup interface_name after making sure it's not NULL 2011-11-18 21:23:33 -05:00
Kristian Høgsberg
e742dcc9ed scanner: Check name == NULL for enum entries
From a clang static analysis warning.
2011-10-31 11:21:38 -04:00
Kristian Høgsberg
7e57dc143e scanner: Fix typo in error message 2011-10-24 17:05:39 -04:00
Kristian Høgsberg
d63884b0c7 scanner: Catch more invalid attribute combinations for arg
Spotted by Jakob Bornecrantz.
2011-10-24 16:04:09 -04:00
Benjamin Franzke
1482b9e906 scanner: Fix indent for *_add_listener 2011-10-11 13:24:18 -04:00
Kristian Høgsberg
b15259bff4 server: Pass struct wl_resource for object references 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
e908893080 Bind globals to client provided object IDs 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
a7c6824328 server: Hand code all wl_display client stubs 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
e8a192ca61 server: Make everything in the object hash a wl_resource 2011-08-27 12:06:10 -04:00
Kristian Høgsberg
4c260db68c Rename source subdir from wayland to src 2011-08-12 16:25:14 -04:00
Renamed from wayland/scanner.c (Browse further)