Jasper St. Pierre [Fri, 31 Jan 2014 20:55:48 +0000 (15:55 -0500)]
protocol: Fix documentation for the parameter of wl_callback
The parameter here is an opaque integer, rather than the event serial.
The "frame" callback uses this to pass the current time of day in
milliseconds.
Jasper St. Pierre [Fri, 31 Jan 2014 20:38:07 +0000 (15:38 -0500)]
protocol: Fix the name of the registry argument
A simple copy-paste typo.
Kristian Høgsberg [Fri, 24 Jan 2014 04:50:27 +0000 (20:50 -0800)]
configure.ac: Bump version to 1.4
Kristian Høgsberg [Mon, 20 Jan 2014 23:07:55 +0000 (15:07 -0800)]
resources-test: Don't send invalid event
Even if nothing receives the even, the arguments still need to be valid.
The test is sending out event 0 from the wl_display interface, which is
the error event. This requires arg 0 to be a valid object and arg 2 to
be a non-null string. The test just leaves that undefined, causing
intermittent test failures.
As it is, the resource destroy test doesn't need to send an event to
validate the various resource destroy hooks, so we can just remove the
call to wl_resource_post_event() alltogether.
Thanks to Matt Turner <mattst88@gmail.com> for pointing out the failure.
Jonas Ådahl [Sun, 19 Jan 2014 09:32:11 +0000 (10:32 +0100)]
protocol: Clarify semantics of wl_subsurface.set_position
Make it clear that multiple requests before commit are allowed and how it
is handled.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Jonas Ådahl [Sun, 19 Jan 2014 09:32:10 +0000 (10:32 +0100)]
protocol: Clarify semantics of sub-surface placement requests
Clarify some semantics of wl_subsurface.place_below and
wl_subsurface.place_below that were not specified.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Kristian Høgsberg [Mon, 20 Jan 2014 05:58:27 +0000 (21:58 -0800)]
configure.ac: Bump version to 1.3.93
This is the release candidate.
Kristian Høgsberg [Sun, 19 Jan 2014 18:03:22 +0000 (10:03 -0800)]
Revert "xwayland: Add .gitignore"
I accidentally committed Jaspers xserver patch to wayland.
This reverts commit
8a781aef0ebf8d5be4116fa40d9155af4ba61257.
Jonas 'Sortie' Termansen [Tue, 14 Jan 2014 17:38:59 +0000 (18:38 +0100)]
client: Include poll.h instead of sys/poll.h
POSIX mandates the poll.h header as the standard location of poll(2).
U. Artie Eoff [Tue, 14 Jan 2014 17:18:03 +0000 (09:18 -0800)]
add_shm_format: check wl_array_add return value before deref
In wl_display_add_shm_format(), check the return value from
wl_array_add() before dereferencing it and assigning it a value.
Return the resulting pointer back to the caller.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 10 Jan 2014 22:43:48 +0000 (14:43 -0800)]
xcursor: don't proceed if XcursorImageCreate failed
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 10 Jan 2014 22:33:36 +0000 (14:33 -0800)]
cursor: check for memory allocation errors
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 10 Jan 2014 21:49:44 +0000 (13:49 -0800)]
cursor: free theme->name too
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 10 Jan 2014 21:21:04 +0000 (13:21 -0800)]
resources-test: assert non-NULL return values
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 10 Jan 2014 21:18:42 +0000 (13:18 -0800)]
queue-test: assert non-NULL return values
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 10 Jan 2014 21:04:34 +0000 (13:04 -0800)]
os-wrappers-test: assert closure is not NULL before invoking it
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 10 Jan 2014 20:55:25 +0000 (12:55 -0800)]
event-loop-test: assert non-NULL results
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 10 Jan 2014 20:28:43 +0000 (12:28 -0800)]
connection-test: assert closure is not NULL before invoking it
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 10 Jan 2014 20:17:24 +0000 (12:17 -0800)]
array-test: assert wl_array_add result is not NULL
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 10 Jan 2014 19:26:27 +0000 (11:26 -0800)]
shm: assert sigbus_data is not NULL before member access
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Jasper St. Pierre [Mon, 9 Dec 2013 21:29:03 +0000 (16:29 -0500)]
xwayland: Add .gitignore
chi ding [Thu, 5 Dec 2013 13:28:53 +0000 (14:28 +0100)]
Fix buffer overflow when serializing a closure object
Here is the JIRA page of this issue
https://bugs.tizen.org/jira/browse/TIVI-1889
Change-Id: I773a6d2d8f6fd02ff10c92450db1fa8a69544219
Signed-off-by: Chi Ding <chi.ding@mobica.com>
Closes: https://bugs.freedesktop.org/show_bug.cgi?id=65186
Adrian Negreanu [Tue, 17 Dec 2013 11:48:54 +0000 (13:48 +0200)]
scanner: set errno=0 before strtol
POSIX says to set errno=0 before calling strtol since
the return value alne cannot tell a failure.
on ubuntu armel I get:
../src/wayland-scanner client-header < ../../protocol/wayland.xml > wayland-client-protocol.h
<stdin>:1188: error: invalid integer (2)
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Kristian Høgsberg [Tue, 17 Dec 2013 07:51:12 +0000 (23:51 -0800)]
configure.ac: Bump version to 1.3.91 for the alpha release
Kristian Høgsberg [Mon, 9 Dec 2013 23:49:48 +0000 (15:49 -0800)]
client: Handle EINTR in wl_display_dispatch_queue()
Restart the poll() if we take a signal. This is easily triggered in
an application that ends up blocking in eglSwapBuffers(), and causes EGL
to fail to allocate a back buffer.
Jonas Ådahl [Mon, 9 Dec 2013 21:35:22 +0000 (22:35 +0100)]
doc: Fix spelling of parameters
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Jonas Ådahl [Mon, 9 Dec 2013 21:35:21 +0000 (22:35 +0100)]
doc: Remove incorrect docmentation
The documentation was about wl_client_get_object(), not about
wl_resource_get_client().
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Neil Roberts [Thu, 5 Dec 2013 00:58:39 +0000 (16:58 -0800)]
client: Make wl_proxy_set_queue() with NULL revert to default queue
This will be useful in order to implement the
EGL_WL_create_wayland_buffer_from_image extension. The buffers created
within Mesa's Wayland platform are created using the the wl_drm object
as a proxy factory which means they will be set to use Mesa's internal
event queue. However, these buffers will be owned by the client
application so they ideally need to use the default event loop. This
function provides a way to set the proxy's event queue back to the
default.
krh: Edited from Neils original patch to just use wl_proxy_set_queue() with
a NULL argument instead of introducing a new function.
Pekka Paalanen [Fri, 29 Nov 2013 15:47:09 +0000 (17:47 +0200)]
cursor: handle running out of buffer space
If posix_fallocate is available, use it to detect when we are running
out of buffer space.
Propagate the failure properly through the various functions, stopping
loading cursors but keeping the cursors that were already successfully
loaded.
This may result in an animated cursor not having all of its images, or a
cursor theme not having all of its cursors. When that happens, the
failure is NOT communicated to the application. Instead, the application
will get NULL from wl_cursor_theme_get_cursor() for a cursor that was
not loaded successfully. If an animated cursor is missing only some
images, the animation is truncated but the cursor is still available.
This patch relies on the commit "os: use posix_fallocate in creating
sharable buffers" for defining HAVE_POSIX_FALLOCATE.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Fri, 29 Nov 2013 15:47:08 +0000 (17:47 +0200)]
os: use posix_fallocate in creating sharable buffers
If posix_fallocate is available, use it instead of ftruncate. Unlike
ftruncate, when posix_fallocate succeeds, it guarantees that you cannot
run out of disk space, when later writing to the mmap()'ed file.
With posix_fallocate, if os_create_anonymous_file() succeeds, the
program cannot get a SIGBUS later from accessing this file via mmap. If
there is insufficient disk space, the function fails and errno is set to
ENOSPC.
This is useful on systems, that limit the available buffer space by
having XDG_RUNTIME_DIR on a small tmpfs.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Kristian Høgsberg [Sat, 23 Nov 2013 20:24:26 +0000 (12:24 -0800)]
Add -pthread to AM_CFLAGS to do the right thing when using threads
https://bugs.freedesktop.org/show_bug.cgi?id=71633
Lubomir Rintel [Sat, 16 Nov 2013 13:31:03 +0000 (14:31 +0100)]
connection: Error out if file descriptor was not received
Otherwise the tail of fds_in buffer would just shift beyond the beginning.
That confuses the actual request handler and results in a crash further on
due to corrupted tail.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Jasper St. Pierre [Wed, 13 Nov 2013 02:44:37 +0000 (21:44 -0500)]
wayland-server: Improve error messages for bad globals
A bug in Weston's toytoolkit gave me an hour of debugging headaches.
Improve the error messages that we send if a client requests an invalid
global, either by name or by version.
Jasper St. Pierre [Wed, 13 Nov 2013 02:44:36 +0000 (21:44 -0500)]
Update .gitignore for protocol/
Kristian Høgsberg [Fri, 15 Nov 2013 05:29:06 +0000 (21:29 -0800)]
client: Introduce functions to allocate and marshal proxies atomically
The server requires clients to only allocate one ID ahead of the previously
highest ID in order to keep the ID range tight. Failure to do so will
make the server close the client connection. However, the way we allocate
new IDs is racy. The generated code looks like:
new_proxy = wl_proxy_create(...);
wl_proxy_marshal(proxy, ... new_proxy, ...);
If two threads do this at the same time, there's a chance that thread A
will allocate a proxy, then get pre-empted by thread B which then allocates
a proxy and then passes it to wl_proxy_marshal(). The ID for thread As
proxy will be one higher that the currently highest ID, but the ID for
thread Bs proxy will be two higher. But since thread B prempted thread A
before it could send its new ID, B will send its new ID first, the server
will see the ID from thread Bs proxy first, and will reject it.
We fix this by introducing wl_proxy_marshal_constructor(). This
function is identical to wl_proxy_marshal(), except that it will
allocate a wl_proxy for NEW_ID arguments and send it, all under the
display mutex. By introducing a new function, we maintain backwards
compatibility with older code from the generator, and make sure that
the new generated code has an explicit dependency on a new enough
libwayland-client.so.
A virtual Wayland merit badge goes to Kalle Vahlman, who tracked this
down and analyzed the issue.
Reported-by: Kalle Vahlman <kalle.vahlman@movial.com>
Pekka Paalanen [Fri, 15 Nov 2013 14:09:45 +0000 (16:09 +0200)]
protocol: add sub-surfaces to the core
The sub-surface protocol was originally committed into Weston on May
10th, 2013, in commit
2396aec6842c709a714f3825dbad9fd88478f2e6. The
design for the protocol had started in the beginning of December 2012. I
think it is high time to move this into the core now.
This patch copies the sub-surface protocol as it was in Weston on Nov
15th, 2013, into Wayland. Weston gets a patch to remove the protocol from
there.
Sub-surface is a wl_surface role. You create a wl_surface as usual, and
assign it the sub-surface role and a parent wl_surface. Sub-surfaces are
an integral part of the parent surface, and stay glued to the parent.
For window management, a window is the union of the top-level
wl_surface and all its sub-surfaces. Sub-surfaces are not clipped to the
parent, and the union of the surface tree can be larger than the
(top-level) wl_surface at its root.
The representative use case for sub-surfaces is a video player window.
When the video content is given its own wl_surface, there is no need to
modify the video frame contents after decoding or copy them into a whole
window sized buffer before submitting it to the compositor. This allows
efficient, zero-copy video presentation paths, where video decoding
hardware produces a (YUV) buffer, which eventually ends up in a
(YUV-capable) hardware overlay and is scanned out directly.
This can also be used for zero-copy presentation of windowed OpenGL
content, where the OpenGL rendering engine does not need to draw or
avoid window decorations.
Sub-surfaces allow mixing different buffer types into the same window,
e.g. software-rendered decorations in wl_shm buffers, and live content
in EGL-based buffers.
However, the sub-surface extension does not offer clipping or scaling
facilities, or accurate presentation timing. Those are topics for
additional extensions.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Lubomir Rintel [Fri, 15 Nov 2013 13:17:56 +0000 (14:17 +0100)]
shm: Avoid file descriptor leak upon unsuccessful mmap
It would be possible to make the compositor leak file descriptors by
passing descriptors of open unmmapable files to it, such as /dev/null.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Neil Roberts [Thu, 14 Nov 2013 12:28:51 +0000 (12:28 +0000)]
Add documentation for wl_shm_buffer_begin/end_access
It's not obvious that these functions are needed so it would be good
to have some documentation for them.
Kristian Høgsberg [Fri, 15 Nov 2013 22:37:55 +0000 (14:37 -0800)]
scanner: Add location to elements so we can give better errors/warnings
Kristian Høgsberg [Fri, 15 Nov 2013 22:29:40 +0000 (14:29 -0800)]
scanner: Make fail() function use va_list and elaborate a few errors
Kristian Høgsberg [Fri, 15 Nov 2013 22:21:11 +0000 (14:21 -0800)]
scanner: Introduce struct location for tracking source locations
Kristian Høgsberg [Fri, 15 Nov 2013 21:26:03 +0000 (13:26 -0800)]
scanner: Warn about requests with more than one new-id and don't generate stubs
The generated code only support one new-id per request, since the stubs
return the new proxy. It's still possible to send requests with multiple
new-id arguments, but it must be done with
wl_proxy_marshal_array_constructor().
Kristian Høgsberg [Thu, 14 Nov 2013 05:11:17 +0000 (21:11 -0800)]
server: Start documenting the server side API
This is now public, stable API, so it seems prudent to actually document it.
Neil Roberts [Wed, 13 Nov 2013 15:32:05 +0000 (15:32 +0000)]
server: Add API to protect access to an SHM buffer
Linux will let you mmap a region of a file that is larger than the
size of the file. If you then try to read from that region the process
will get a SIGBUS signal. Currently the clients can use this to crash
a compositor because it can create a pool and lie about the size of
the file which will cause the compositor to try and read past the end
of it. The compositor can't simply check the size of the file to
verify that it is big enough because then there is a race condition
where the client may truncate the file after the check is performed.
This patch adds the following two public functions in the server API
which can be used wrap access to an SHM buffer:
void wl_shm_buffer_begin_access(struct wl_shm_buffer *buffer);
void wl_shm_buffer_end_access(struct wl_shm_buffer *buffer);
The first time wl_shm_buffer_begin_access is called a signal handler
for SIGBUS will be installed. If the signal is caught then the buffer
for the current pool is remapped to an anonymous private buffer at the
same address which allows the compositor to continue without crashing.
The end_access function will then post an error to the buffer
resource.
The current pool is stored as part of some thread-local storage so
that multiple threads can safely independently access separate
buffers.
Eventually we may want to add some more API so that compositors can
hook into the signal handler or replace it entirely if they also want
to do some SIGBUS handling.
Peter Hutterer [Wed, 23 Oct 2013 04:56:04 +0000 (14:56 +1000)]
protocol: validate the protocol against a dtd
The scanner is not very forgiving if the protocol doesn't match it's
expectations and crashes without much of a notice. Thus, validate the protocol
against a DTD.
Move the protocol subdir forward so we validate first before trying anything
else, and install the DTD so we can validate weston's protocols as well.
Kristian Høgsberg [Wed, 23 Oct 2013 16:25:08 +0000 (09:25 -0700)]
configure.ac: Bump version to 1.3.90 for the master branch
Kristian Høgsberg [Mon, 21 Oct 2013 21:39:06 +0000 (14:39 -0700)]
wayland: Be consistent about #include-guard names
We had a mix of inconsistent names, some of which were non-conformant.
Standardize on all-uppercase-and-underscore naming convention.
https://bugs.freedesktop.org/show_bug.cgi?id=70679
José Bollo [Fri, 11 Oct 2013 07:14:25 +0000 (09:14 +0200)]
protocol: Fix typo in documentation
Kristian Høgsberg [Wed, 9 Oct 2013 23:20:54 +0000 (16:20 -0700)]
configure.ac: Bump version to 1.3
Kristian Høgsberg [Tue, 8 Oct 2013 04:36:31 +0000 (21:36 -0700)]
scanner: Handle unrecognized invocation mode
Print usage if we don't recognize the invocation mode. Also fixes
uninitialized variable warning.
Kristian Høgsberg [Thu, 3 Oct 2013 05:14:57 +0000 (22:14 -0700)]
configure.ac: Bump version to 1.2.92
Neil Roberts [Wed, 25 Sep 2013 09:39:12 +0000 (10:39 +0100)]
client: Fix handling display->reader_count if poll fails
In wl_display_dispatch_queue, if poll fails then it would previously
return immediately and leak a reference in display->reader_count. Then
if the application ignores the error and tries to read again it will
block forever. This can happen for example if the poll fails with
EINTR which the application might consider to be a recoverable error.
This patch makes it cancel the read so the reader_count will be
decremented when poll fails.
Kristian Høgsberg [Sun, 22 Sep 2013 21:12:26 +0000 (14:12 -0700)]
configure.ac: Bump version to 1.2.91
Jason Ekstrand [Fri, 20 Sep 2013 13:27:06 +0000 (08:27 -0500)]
Export the Wayland protocol XML file
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Marek Ch [Wed, 18 Sep 2013 15:29:50 +0000 (17:29 +0200)]
tests: add wl_resource tests
Marek Ch [Wed, 18 Sep 2013 15:29:49 +0000 (17:29 +0200)]
tests: add unit tests for wl_signal
Test wl_signal initialization, adding and getting listeners and emitting
Marek Ch [Wed, 18 Sep 2013 15:29:48 +0000 (17:29 +0200)]
tests: extended message when leak in test is detected
When memory or fd leak is detected, print how many blocks of memory were
allocated and not freed, respectively how many files were opened/unclosed.
Chang Liu [Wed, 18 Sep 2013 10:45:06 +0000 (10:45 +0000)]
client: fix an inconsistency in documentation
The errno is set to EAGAIN when there are undispatched events, according
to L1066 of wayland-client.c.
Aaron Faanes [Tue, 17 Sep 2013 21:44:24 +0000 (16:44 -0500)]
doc: Slight tweaks to wl_listener
Prefer \comment over // in code blocks for consistency's sake and keep
variable definitions separated by a line from the rest of the body.
Aaron Faanes [Tue, 17 Sep 2013 21:42:43 +0000 (16:42 -0500)]
utils: Document wl_container_of
Aaron Faanes [Tue, 17 Sep 2013 21:40:49 +0000 (16:40 -0500)]
doc: Create \comment alias for C-style comments
Since /* */ do not nest, documentation is forced to either use C++ style
// comments or some other foreign notation. This commit provides an alias
that allows C-style comments to be introduced in code blocks that support
aliases.
It should be noted that this macro will not work within \code blocks, as
Doxygen commands are ignored there. Instead, Doxygen's fenced code
blocks (created via ~~~) must be used for proper output. To demonstrate:
~~~
struct example_node {
int id;
\comment{Other members ...}
};
~~~
will roughly yield the following HTML (excluding syntax highlighting):
<pre>
struct example_node {
int id;
/* Other members ... */
};
</pre>
Aaron Faanes [Sun, 15 Sep 2013 18:37:09 +0000 (13:37 -0500)]
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.
Aaron Faanes [Sun, 15 Sep 2013 18:37:08 +0000 (13:37 -0500)]
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.
Aaron Faanes [Sun, 15 Sep 2013 18:37:07 +0000 (13:37 -0500)]
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.
Aaron Faanes [Sun, 15 Sep 2013 18:37:06 +0000 (13:37 -0500)]
utils: Reference some useful methods in wl_signal's doxygen
This commit adds a bit more detail on the lifecycle of a signal.
Aaron Faanes [Sun, 15 Sep 2013 18:09:18 +0000 (13:09 -0500)]
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.
Chang Liu [Sun, 8 Sep 2013 11:12:33 +0000 (11:12 +0000)]
gitignore: add ./compile
./compile is a GNU autotools helper script and should be ignored by git
Rob Bradford [Fri, 6 Sep 2013 16:56:27 +0000 (17:56 +0100)]
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.
Aaron Faanes [Wed, 28 Aug 2013 23:02:02 +0000 (18:02 -0500)]
utils: tweak wl_list for better doxygen output
Aaron Faanes [Wed, 28 Aug 2013 23:02:01 +0000 (18:02 -0500)]
wayland-server: Document wl_signal
Aaron Faanes [Wed, 28 Aug 2013 22:43:34 +0000 (17:43 -0500)]
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.
Kristian Høgsberg [Fri, 30 Aug 2013 21:54:40 +0000 (14:54 -0700)]
configure.ac: Bump version to 1.2.90 for master branch
Kristian Høgsberg [Tue, 13 Aug 2013 19:06:30 +0000 (20:06 +0100)]
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.
Kristian Høgsberg [Tue, 13 Aug 2013 19:06:29 +0000 (20:06 +0100)]
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.
Jason Ekstrand [Thu, 18 Jul 2013 02:58:47 +0000 (21:58 -0500)]
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>
Jason Ekstrand [Thu, 18 Jul 2013 02:58:46 +0000 (21:58 -0500)]
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>
Jason Ekstrand [Sun, 18 Aug 2013 21:53:54 +0000 (16:53 -0500)]
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>
Jason Ekstrand [Sun, 18 Aug 2013 21:52:36 +0000 (16:52 -0500)]
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>
Peter Hutterer [Thu, 15 Aug 2013 10:58:10 +0000 (20:58 +1000)]
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.
Bryce W. Harrington [Fri, 9 Aug 2013 17:44:59 +0000 (17:44 +0000)]
protocol: Improve a bit of grammar for wl_surface::attach description
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Rob Bradford [Mon, 22 Jul 2013 16:30:52 +0000 (17:30 +0100)]
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.
Rob Bradford [Mon, 22 Jul 2013 16:30:51 +0000 (17:30 +0100)]
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.
Bryce W. Harrington [Fri, 9 Aug 2013 01:47:07 +0000 (01:47 +0000)]
protocol: Fix pluralization of user in popup_done description
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Bryce W. Harrington [Fri, 9 Aug 2013 01:47:07 +0000 (01:47 +0000)]
protocol: Improve grammar for set class description
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Bryce W. Harrington [Fri, 9 Aug 2013 01:47:07 +0000 (01:47 +0000)]
protocol: Add missing d to 'x an y'
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Bryce W. Harrington [Fri, 9 Aug 2013 01:47:07 +0000 (01:47 +0000)]
protocol: Fix typo by removing a redundant 'a'
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Bryce W. Harrington [Fri, 9 Aug 2013 01:47:06 +0000 (01:47 +0000)]
client: Improve spelling and grammar in comments
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Bryce W. Harrington [Fri, 9 Aug 2013 01:47:05 +0000 (01:47 +0000)]
publican: Fix grammar several places in Protocol docs
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Bryce W. Harrington [Fri, 9 Aug 2013 01:47:05 +0000 (01:47 +0000)]
publican: Drop unneeded 'of'
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Bryce W. Harrington [Fri, 9 Aug 2013 01:47:04 +0000 (01:47 +0000)]
publican: Cleanup Preface's grammar.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Tomeu Vizoso [Thu, 8 Aug 2013 08:31:56 +0000 (10:31 +0200)]
server: Release additional_shm_formats array at display destruction
Peter Hutterer [Wed, 7 Aug 2013 01:05:59 +0000 (11:05 +1000)]
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.
Peter Hutterer [Wed, 7 Aug 2013 01:05:58 +0000 (11:05 +1000)]
scanner: expand help string
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 7 Aug 2013 01:05:57 +0000 (11:05 +1000)]
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.
Kristian Høgsberg [Wed, 7 Aug 2013 16:17:02 +0000 (09:17 -0700)]
Don't include wayland-server.h in wayland-private.h
We just declare struct wl_display manually instead.
Tomeu Vizoso [Tue, 6 Aug 2013 18:05:53 +0000 (20:05 +0200)]
shm: Add API for renderers to register additional pixel formats
Kristian Høgsberg [Tue, 6 Aug 2013 17:15:35 +0000 (10:15 -0700)]
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.
Kristian Høgsberg [Tue, 6 Aug 2013 16:50:14 +0000 (09:50 -0700)]
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.
Jiergir Ogoerg [Mon, 29 Jul 2013 23:50:44 +0000 (16:50 -0700)]
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.
Tomeu Vizoso [Thu, 11 Jul 2013 14:08:20 +0000 (16:08 +0200)]
protocol: Copy missing pixel formats from wl_drm to wl_shm