Commit Graph

1613 Commits

Author SHA1 Message Date
Aaron Faanes
2e3af5e5d7 doc: Include wayland-util.* for doxygen output
This commit creates a shared file list that is included by both the
client and the server for the XML Makefile targets, as classes within
util are used by both the client and the server.
2013-09-16 22:00:00 -07:00
Aaron Faanes
5197aa30c8 wayland-server: Improve wording for wl_signal_get's doc
The old description was a bit vague; this commit hopefully improves
describing what is returned.
2013-09-16 21:59:28 -07:00
Aaron Faanes
fffcdb25de utils: Add doxygen for wayland-util.h
This is needed for doxygen to generate output for macro definitions, such
as wl_container_of, that are contained by this file. Classes like
wl_list would be documented regardless.
2013-09-16 21:59:12 -07:00
Aaron Faanes
bc30c5eb8a utils: Reference some useful methods in wl_signal's doxygen
This commit adds a bit more detail on the lifecycle of a signal.
2013-09-16 21:59:00 -07:00
Aaron Faanes
f8b2730039 wayland-server: Document wl_listener
This patch takes Kristian's comments into account, adding a demonstration and
giving a more thorough idea of how wl_listener is used.
2013-09-16 21:47:52 -07:00
Chang Liu
9a5ed7877d gitignore: add ./compile
./compile is a GNU autotools helper script and should be ignored by git
2013-09-11 12:15:11 -07:00
Rob Bradford
656f3ea5b3 wayland-server: Add a wl_resource_for_each_safe macro
A version of wl_resource_for_each that is safe for iteration when items
in the list are removed.
2013-09-11 12:03:22 -07:00
Aaron Faanes
a27b730490 utils: tweak wl_list for better doxygen output 2013-09-11 10:53:39 -07:00
Aaron Faanes
660f2d7acc wayland-server: Document wl_signal 2013-09-11 10:52:41 -07:00
Aaron Faanes
cdea669858 wayland-server: Fix a uninitialized warning from clang
This warning is unnecessary, since the pointer in question is only used
for pointer arithmetic, but setting it explicitly to NULL doesn't hurt.
2013-09-11 10:42:37 -07:00
Kristian Høgsberg
10dcf86f7d configure.ac: Bump version to 1.2.90 for master branch 2013-08-30 15:53:55 -07:00
Kristian Høgsberg
b76a6968fc scanner: Emit wl_*_destroy stub even if interface has a destructor
If an interface has a destructor but no 'destroy' method we used to
not emit a destroy method.  Now with the fix for missing destroy
requests for wl_pointer etc we need to emit the local wl_*_destroy
always.
2013-08-30 15:53:55 -07:00
Kristian Høgsberg
ea1fb51aae protocol: Add release requests for wl_pointer, wl_keyboard, and wl_touch
We missed destroy requests in the 1.0 protocol and since the scanner
generates local-only *_destroy requests in that case we can't add
destroy requests without breaking protocol.  A client needs to verify
that the server provides a version 3 seat to use the protocol destructor
so the name needs to be something else than wl_*_destroy.

v2 (Rob Bradford): Rebased, bumped the protocol versions and added since
attributes to the requests.
2013-08-30 15:46:41 -07:00
Jason Ekstrand
eb947e9408 Add support for client-side language bindings
This commit adds support for language bindings on the client half of the
library.  The idea is the same as for server-side dispatchers.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-08-19 16:23:08 -07:00
Jason Ekstrand
c44090908d Add support for server-side language bindings
This commit adds support for server-side languages bindings.  This is done
in two ways:

1. Adding a wl_resource_set_dispatcher function that corresponds to
wl_resource_set_interface.  The only difference between the two functions
is that the new version takes a dispatcher along with the implementation,
data, and destructor.  This allows for runtime calling of native language
functions for callbacks instead of having to generate function pointers.

2. Adding versions of wl_resource_post_event and wl_resource_queue_event
that take an array of wl_argument instead of a variable argument list.
This allows for easier run-time argument conversion and removes the need
for libffi-based calling of variadic functions.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-08-19 16:23:08 -07:00
Jason Ekstrand
6b8eef962f doc: Add a section on interface and protocol object versioning
There have been a lot of questions asked lately about versioning of
interfaces and protocol objects.  This addition to the documentation should
clear up some of those questions.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-08-19 16:23:08 -07:00
Jason Ekstrand
52de023482 doc: Update the ID alocation section
The method described of alocation IDs has been wrong at least since version
1.0.  This commit updates it to correspond to the way IDs are chosen in
versions >= 1.0.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-08-19 16:23:02 -07:00
Peter Hutterer
2cc551b1ec publican: only split chapters and top-level sections onto separate pages
When generating HTML, don't split once we're into subjections. This
generates a single page for each protocol interface instead of the previous
separate pages for requests, events and enums.
No effect on the rest of the HTML configuration.
2013-08-15 14:42:44 -07:00
Bryce W. Harrington
f169614738 protocol: Improve a bit of grammar for wl_surface::attach description
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-12 21:25:48 -07:00
Rob Bradford
4ad58fbb4a wayland-client: Add wl_proxy_get_listener
This is the mirror function to wl_proxy_add_listener and is useful
inside client libraries to differentiate events on listeners for which
multiple proxies have been created.
2013-08-12 16:26:36 -07:00
Rob Bradford
748c20c46f wayland-server: Add a wl_resource_for_each macro
This macro allows you to correctly iterate through a list of resources
handling the opaque nature of this type.
2013-08-12 16:26:36 -07:00
Bryce W. Harrington
dbc41f0344 protocol: Fix pluralization of user in popup_done description
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-08 21:42:38 -07:00
Bryce W. Harrington
b5e7f9caef protocol: Improve grammar for set class description
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-08 21:42:26 -07:00
Bryce W. Harrington
3d6470b1ef protocol: Add missing d to 'x an y'
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-08 21:41:57 -07:00
Bryce W. Harrington
fecef1ca66 protocol: Fix typo by removing a redundant 'a'
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-08 21:41:44 -07:00
Bryce W. Harrington
65efa2ed3a client: Improve spelling and grammar in comments
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-08 21:41:33 -07:00
Bryce W. Harrington
eda474c779 publican: Fix grammar several places in Protocol docs
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-08 21:39:25 -07:00
Bryce W. Harrington
9fc867060f publican: Drop unneeded 'of'
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-08 21:38:28 -07:00
Bryce W. Harrington
c7d2c0b423 publican: Cleanup Preface's grammar.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-08 21:38:14 -07:00
Tomeu Vizoso
f26a322327 server: Release additional_shm_formats array at display destruction 2013-08-08 13:51:13 -07:00
Peter Hutterer
6dd0ba0e32 scanner: check for wayland-scanner.pc before using variables
If wayland-scanner.pc can't be found the variables end up being set
irrespectively, leaving the user with odd compiler errors about missing
headers, etc.
2013-08-07 16:25:10 -07:00
Peter Hutterer
2b26edb877 scanner: expand help string
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-07 16:24:55 -07:00
Peter Hutterer
2d1ed470d9 scanner: support help and --help
wayland-scanner without arguments prints out usage. With help or --help it
waits for stdin to supply something which isn't quite as informative as
printing out the help.

This patch also moves the strcmp for args up to have all of them in one
location.
2013-08-07 16:24:44 -07:00
Kristian Høgsberg
81555350af Don't include wayland-server.h in wayland-private.h
We just declare struct wl_display manually instead.
2013-08-07 09:17:24 -07:00
Tomeu Vizoso
d9883a6be1 shm: Add API for renderers to register additional pixel formats 2013-08-06 16:48:02 -07:00
Kristian Høgsberg
dbeb5134fa server: Set client->error when we fail to send a closure
We we're using wl_event_loop_add_idle() here, but if we're failing
because of OOM, that will typically also fail.  Instead, use the
existing client->error flag, which will break out of the event
handling loop and shut down the client.
2013-08-06 10:16:46 -07:00
Kristian Høgsberg
1b0cabfc48 server: Handle OOM properly when we fail to allocate a send closure
If we can't allocate a closure, don't just silently continue.  Set
client->error so we shut down the client when we're done processing events.
2013-08-06 09:51:53 -07:00
Jiergir Ogoerg
c1fd097cd9 client: Simply wl_display_dispatch_queue_pending() and fix return value
We're supposed to return number of events dispatched on success, not 0.
Refactor to avoid goto and just return ret.
2013-07-29 16:50:44 -07:00
Tomeu Vizoso
03dc786c90 protocol: Copy missing pixel formats from wl_drm to wl_shm 2013-07-29 09:28:12 -07:00
Kristian Høgsberg
6ef06ad06d Bump version to 1.2.0 2013-07-13 01:30:45 -04:00
Kristian Høgsberg
e0579bfb61 wayland-client: Handle potential NULL-deref
Instead, return -1 on out-of-memory.  errno will be set to ENOMEM by
the failing malloc.
2013-07-13 00:42:14 -04:00
Kristian Høgsberg
8bd93c5c9d scanner: Fail more gracefully on out-of-memory
Failing with an error message and error code is little nicer.  I doubt we'll
hit this case much, but it makes the static analysis happy.
2013-07-13 00:35:21 -04:00
Mariusz Ceier
43f7268989 connection: Handle empty signature and signature with just a version.
Functions like wl_argument_from_va_list expect from get_next_argument,
to initialize details->type but when the signature is empty or contains
only version (like in desktop-shell-protocol.c in weston) it is left
uninitialized.

This patch fixes it, by initializing details->type with '\0' value,
signaling end of arguments.

Signed-off-by: Mariusz Ceier <mceier+wayland@gmail.com>
2013-07-12 21:52:33 -04:00
Kristian Høgsberg
3f3671e92e Bump version to 1.1.91 2013-07-09 19:27:08 -04:00
Kristian Høgsberg
7100a5e0bb Replace two remaining wl_display_add_gloavl() occurences 2013-07-09 19:18:10 -04:00
Kristian Høgsberg
93d888aec6 wayland-server: Don't close display fd in fatal error handler
We can't do that there, we have to make sure it stays a valid fd until
the application calls wl_display_disconnect().  Otherwise the application
may end up poll()ing on a stale or wrong fd in case another part of the
application (or another thread) triggered a fatal error.
2013-07-09 18:59:11 -04:00
Kristian Høgsberg
becca5fcf7 wayland-server: Return 0 from read_events() in case of EAGAIN
Getting no data from the socket is not an error condition.  This may
happen in case of calling prepare_read() and then read_events() with
no other pending readers and no data in the socket.  In general,
read_events() may not queue up events in the given event queue.  From
a given threads point of view it doesn't matter whether events were
read and put in a different event queue or no events were read at all.
2013-07-09 18:00:00 -04:00
Neil Roberts
12cea95593 wayland-client: Treat EOF when reading the wayland socket as an error
If EOF is encountered while reading from the Wayland socket, make
wl_display_read_events() return -1 so that it will be treated as an
error. The documentation for this function states that it will set
errno when there is an error so it additionally makes up an errno of
EPIPE.

If we don't do this then when the compositor quits the Wayland socket
will be become ready for reading but wl_display_dispatch will do
nothing which typically makes the application take up 100% CPU. In
particular eglSwapBuffers will likely get stuck in an infinite busy
loop because it repeatedly calls wl_display_dispatch_queue while it
waits for the frame callback.

https://bugzilla.gnome.org/show_bug.cgi?id=703892
2013-07-09 17:59:56 -04:00
Kristian Høgsberg
4cffa0fd61 wayland-server: Add wl_global_create/destroy()
This patch introduces wl_global_create() and wl_global_destroy() as
replacements for wl_display_add_global() and wl_display_remove_global().
The add/remove_global API did not allow a compositor to indicate
the implemented version of a global, it just took the version from
the interface meta data.  The problem is that the meta data
(which lives in libwayland-server.so) can get out of sync with a
compositor implementation.  The compositor will then advertise a
higher version of a global than what it actually implements.

The new API lets a compositor pass in a version when it registers
a global, which solves the problem.  The add/remove API is deprecated
with this patch and will be removed.
2013-07-09 01:15:37 -04:00
Daiki Ueno
40fc79d5b0 build: Add wayland-scanner.pc.
To allow user program to include wayland-scanner.m4 in tarball, move
the path variables from it into wayland-scanner.pc.
2013-07-03 16:38:12 -04:00