Commit graph

1205 commits

Author SHA1 Message Date
Kristian Høgsberg
1f521a4f77 configure.ac: Bump version to 1.0.0 2012-10-22 14:55:06 -04:00
Kristian Høgsberg
3b7d7b0c80 scanner: Preserve paragraph breaks in input XML
If we have a blank line in the incoming XML documentation, keep that in
the emitted doxygen comments.
2012-10-21 22:24:33 -04:00
Kristian Høgsberg
cc95db359c doc: Fix typo in generated section header
We were generating headers such as 'Events provided by wl_display events',
drop the last 'events'.
2012-10-21 22:11:36 -04:00
Kristian Høgsberg
65eef9d817 wayland: Add protocol documentation for various interfaces 2012-10-21 22:08:08 -04:00
Kristian Høgsberg
a04beb1298 Update TODO
We've knocked a few items of the list.
2012-10-21 20:53:37 -04:00
Kristian Høgsberg
c450b6e23b tests: Include wayland-private.h for container_of 2012-10-21 10:04:17 -04:00
Kristian Høgsberg
1bade73b6b scanner: Fix valgrind errors 2012-10-20 11:38:57 -04:00
Kristian Høgsberg
620d9edb25 Rename __wl_container_of macro to just wl_container_of
The _* namespace and identifiers with double underscore are reserved
by the C standard.  That makes __wl_container_of is double plus bad,
so lets just call it wl_container_of.
2012-10-19 23:26:45 -04:00
Kristian Høgsberg
7ec35d8e13 Move un-namespaced container_of into private header 2012-10-19 23:06:53 -04:00
Kristian Høgsberg
bdd272f024 Move ARRAY_LENGTH out of public headers
Exporting unprefixed symbols is a pretty bad idea so don't do that.
Instea of redefining it WL_ARRAY_LENGTH, we just move the define to
our private header.  The scanner generates code that uses ARRAY_LENGTH,
but we can just make it count the number elements and emit an integer
constant instead.
2012-10-19 17:08:38 -04:00
Tiago Vignatti
56061674cd configure: Depend on a more strict version of publican
Fix https://bugs.freedesktop.org/show_bug.cgi?id=56101

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-19 16:51:38 -04:00
Ander Conselvan de Oliveira
68c4136a07 doc: Update doxygen documentation when source files are changed 2012-10-19 16:50:38 -04:00
Ander Conselvan de Oliveira
818bb399b0 doc: Clarify documentation about dispatching event queues
Clarify on what cases each of the dispatching functions may block, what
is the main thread and add some real world examples.
2012-10-19 16:50:29 -04:00
Ander Conselvan de Oliveira
a4dace7e30 doc: Update wl_display_get_error() documentation 2012-10-17 17:29:04 -04:00
John Kåre Alsaker
0a6fabecd7 wayland-server: Fix up error handling with client creation. 2012-10-17 16:46:15 -04:00
Kristian Høgsberg
009d452432 wayland-egl: Drop ill-defined pixmap support
We don't have a use case for this and the actual semantics and
synchronization behavior of wl_egl_pixmap were never really well-defined.
It also doesn't provide the cross-process buffer sharing that make
window systems pixmaps useful in other window systems.
2012-10-16 15:30:56 -04:00
John Kåre Alsaker
4b6d0e65e7 connection: Dereference id completely for comparasion. 2012-10-16 11:24:31 -04:00
John Kåre Alsaker
a6bc8b426c connection: Removed crashing code. 2012-10-16 11:15:02 -04:00
John Kåre Alsaker
fa51801786 scanner: Make sure arguments have names. 2012-10-16 11:14:24 -04:00
John Kåre Alsaker
5cff8244f2 connection: Don't call memcpy with null pointer. 2012-10-16 11:12:38 -04:00
Pekka Paalanen
6c3e9b8f54 protocol: try to clarify wl_buffer doc
Fix few typos in wl_buffer description.

Mention backing storage in wl_buffer.destroy.

Try to clarify the wl_buffer.release semantics by not explaining what
*might* happen. It is important to not suggest, that if release does not
come before frame callback, it will not come before attaching a new
buffer to the surface. We want to allow the following scenario:

The compositor is able to texture from wl_buffers directly, but it also
keeps a copy of the surface contents. The copy is updated when the
compositor is idle, to avoid the performance hit on
wl_surface.attach/commit. When the copy completes some time later, the
server sends the release event. If the client has not yet allocated a
second buffer (e.g. it updates rarely), it can reuse the old buffer.

Reported-by: John Kåre Alsaker <john.kare.alsaker@gmail.com>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-16 11:06:51 -04:00
Pekka Paalanen
cb2296778d protocol: say update instead of repaint
wl_surface.commit itself does not force any repainting unless there is
damage, so change the wording to not imply repainting.

Reported-by: John Kåre Alsaker <john.kare.alsaker@gmail.com>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-16 10:52:40 -04:00
Ander Conselvan de Oliveira
de3d0ecd44 doc: Add doxygen documentation to wl_display_get_error() 2012-10-16 10:50:57 -04:00
Ander Conselvan de Oliveira
244fe474dd doc: Document change of return value of dispatch functions 2012-10-16 10:50:28 -04:00
Ander Conselvan de Oliveira
1c10723dfe doc: Document the restriction of destroying queues before the display 2012-10-16 10:50:14 -04:00
Ander Conselvan de Oliveira
80e6b7d7ed doc: Put wl_display_flush() documentation in the right place
It seems a rebase error caused it to end up in the wrong place.
2012-10-16 10:50:02 -04:00
Jonas Ådahl
de1b471318 protocol: Clarify pointer axis event
Pointer axis events are in the same coordinate space as motion events.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-16 10:44:13 -04:00
Kristian Høgsberg
6ac1cd692f configure.ac: Bump version to 0.99.0 2012-10-15 20:49:41 -04:00
Kristian Høgsberg
f858099d47 docs: Make distcheck happy
publican doesn't seem to be a very well-behaved tool and needs a bit
of hacking to work well for both in-tree and out-of-tree builds.
2012-10-15 20:48:28 -04:00
Matt Roper
4ce294d641 wayland-server: Add touch grab support
Touch grabs allow the compositor to be placed into a mode where touch events
temporarily bypass their default behavior and perform other operations.
Wayland already supports keyboard and pointer grabs, but was lacking
corresponding touch support.  The default touch grab handlers here contain the
client event delivery code that was previously called directly in weston.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2012-10-15 19:44:08 -04:00
David Herrmann
33b7637b45 wayland-client: forward fatal errors to caller
If any callback or helper function fails with a fatal error, we now
set the last_error flag and prevent all further I/O on the wl_display. We
wake up all sleeping event-queues and notify the caller that they
should shutdown wl_display.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 19:23:40 -04:00
Kristian Høgsberg
edae4ffa37 wayland: Take ownership of fd in wl_display_connect_to_fd()
This means we're free to close it when we want, which we'll use to wake
up the main thread if we hit an error in a different thread.
2012-10-15 17:50:36 -04:00
David Herrmann
780b980670 wayland-client: link all event-queues of each display into a list
We need access to all event-queues of a single wl_display object. For
instance during connection-errors, we need to be able to wake up all event
queues. Otherwise, they will be stuck waiting for incoming events.

The API user is responsible to keep a wl_display object around until all
event-queues that were created on it are destroyed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 17:27:59 -04:00
Kristian Høgsberg
04720307e9 connection: return error on buffer-overflow during read
wl_connection_read() assumes that the caller dispatched all messages
before calling it. wl_buffer_put_iov() does only provide enough room so we
fill the buffer. So the only case when the buffer overflows, is when a
previous read filled up the buffer but we couldn't parse a single message
from it. In this case, the client sent a message bigger than our buffer
and we should return an error and close the connection.

krh: Edited from Davids original patch to just check that the buffer
 isn't full before we try reading into it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 17:21:06 -04:00
Kristian Høgsberg
ad03a59f5c connection: Use uin32_t for circular buffer indexes
We rely on well-defined unsigned overflow behaviour so let's make the
index fields actually unsigned.  Signed ints aren't guaranteed to have the
behavior we want (could be either ones or twos complement).
2012-10-15 17:16:30 -04:00
David Herrmann
a9dd3badb5 connection: fix leaking FDs on buffer-overflow during read
If we read more FDs than we have room for, we currently leak FDs because
we overwrite previous still pending FDs. Instead, we do now close incoming
FDs if the buffer is full and return EOVERFLOW.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 16:25:19 -04:00
David Herrmann
0b399b8d68 connection: fix buffer-overflow in build_cmsg()
Same problem as we had with close_fds(). We cannot rely on the fds_out
buffer being filled with less than MAX_FDS_OUT file descriptors.
Therefore, write at most MAX_FDS_OUT file-descriptors to the outgoing
buffer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 16:23:38 -04:00
David Herrmann
5bae0650ba connection: close pending incoming FDs on shutdown
Same problem as with outgoing FDs. We need to close these on shutdown,
otherwise we leak open file descriptors.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 16:16:24 -04:00
David Herrmann
9bd41ed6a9 connection: fix buffer-overflow in close_fds()
If we push two messages via wl_connection_write() and both messages
contain more than MAX_FDS_OUT file-descriptors combined, then
wl_connection_flush() will write only MAX_FDS_OUT of them, but close all
pending ones, too.

Furthermore, close_fds() will copy more FDs out of the buffer than it can
hold and cause a buffer overflow. Therefore, we simply pass a maximum
limit to close_fds().

During shutdown, we simply close all available FDs.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 16:15:41 -04:00
David Herrmann
cda89f3a42 connection: close pending outgoing fds on shutdown
When destroying a wl_connection object, there might still be data in the
queue. We would leak open file-descriptors so we must close them.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 16:12:46 -04:00
David Herrmann
c13a65fd20 wayland-util: return 0 on OOM in wl_map_insert_new()
If we cannot increase the array for new entries, we now return 0 instead
of accessing invalid memory.

krh: Edited to return 0 on failure instead.  In the initialization path,
we call wl_map_insert_new() to insert NULL at index 0, which also returns
0 but not as an error.  Since we do that up front, every other case of
returning 0 is an unambiguous error.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 16:08:27 -04:00
David Herrmann
0d5850e6d6 wayland-util: return -1 if wl_array_copy() fails
We might have to perform memory allocations in wl_array_copy(), so catch
out-of-memory errors in wl_array_add() and return -1 before changing any
state.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 16:06:15 -04:00
David Herrmann
66e4aa98cf wayland-client: add wl_display_get_error()
A server may asynchronously send errors via wl_display.error() events.
Instead of aborting we now the a "last_error" flag inside of wl_display
objects. The user can retrieve these via wl_display_get_error().

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 16:06:00 -04:00
Jonas Ådahl
36e29df2cb protocol: Clarify pointer axis event
Pointer axis events are in the same coordinate space as motion events.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-15 14:10:24 -04:00
Tiago Vignatti
008760822b configure: Make documentation option work in fact
Also, now doxygen is mandatory for building the documentation (looks
reasonable because both man-pages and publican will need it).

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-15 13:10:08 -04:00
Tiago Vignatti
96a6ee58b9 doc: doxygen: Add .gitignore
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-15 13:10:07 -04:00
Ander Conselvan de Oliveira
3f94d984f7 doc: Improve libwayland-client doxygen documentation
Document wl_proxy, wl_display and wl_event_queue classes and add a
description to all public entry points. Also fix some typos.
2012-10-15 13:07:42 -04:00
Ander Conselvan de Oliveira
2320757e8e doc: Add some doxygen documentation to wayland-client entry points
Add some brief documentation for the public libwayland-client entry
points. This is by no means complete, some functions are still
undocumented and some might need extra information.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-15 13:06:15 -04:00
Ander Conselvan de Oliveira
e78abc4892 doc: Split protocol description paragraphs properly
The xsl translation from the protocol xml to publican would create only
one paragraph for all the text in a description. Make it generate one
paragraph for each block of text separated by two consecutive line
breaks instead.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-15 13:04:19 -04:00
Olivier Blin
0d77c5302e scanner: use printf format attributes for desc_dump 2012-10-15 13:04:07 -04:00