profile/ivi/wayland.git
12 years agotests: add sanity-test
Pekka Paalanen [Thu, 19 Apr 2012 11:46:52 +0000 (14:46 +0300)]
tests: add sanity-test

Test the testing framework itself, so that it catches the errors we
expect it to.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agotests: add support for tests expected to fail
Pekka Paalanen [Thu, 19 Apr 2012 11:26:51 +0000 (14:26 +0300)]
tests: add support for tests expected to fail

Add a new macro FAIL_TEST that can be used to define tests that are
supposed to fail. To distinguish the supposed outcome of a test, add a
field to 'struct test'.

However, simply adding a field to 'struct test' will make all tests past
the first one in an executable to be garbage. Apparently, the variables
of type 'struct test' have different alignment when put into a special
section than otherwise, and the compiler will get the skip from one
'struct test' to the next wrong.

Explicitly specify the alingment of 'struct test' to be 16 bytes, which
is what it seems to be in the special section on x86_64.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agotests: stylish test-runner.c
Pekka Paalanen [Thu, 19 Apr 2012 11:06:08 +0000 (14:06 +0300)]
tests: stylish test-runner.c

Fix a typo, add a comment, change the print format, and add a variable
that will ease implementing tests that are expected to fail.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agotests: fail build if NDEBUG is defined
Pekka Paalanen [Thu, 19 Apr 2012 09:14:19 +0000 (12:14 +0300)]
tests: fail build if NDEBUG is defined

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agotests: put common test source files in a variable
Pekka Paalanen [Thu, 19 Apr 2012 09:12:13 +0000 (12:12 +0300)]
tests: put common test source files in a variable

Makes all test targets have the same common make dependencies.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoFix printf format warnings
Pekka Paalanen [Tue, 17 Apr 2012 12:16:38 +0000 (15:16 +0300)]
Fix printf format warnings

connection.c:530: warning: format '%lu' expects type 'long unsigned
int', but argument 2 has type 'unsigned int'

/connection.c:560: warning: format '%lu' expects type 'long unsigned
int', but argument 2 has type 'unsigned int'

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agodata-device: Take away pointer focus when we start a dnd drag
Kristian Høgsberg [Fri, 13 Apr 2012 16:51:40 +0000 (12:51 -0400)]
data-device: Take away pointer focus when we start a dnd drag

12 years agodata-device: Record the serial number for the current selection
Kristian Høgsberg [Fri, 13 Apr 2012 16:48:38 +0000 (12:48 -0400)]
data-device: Record the serial number for the current selection

And reject setting a selection that's older than our current selection.

12 years agodata-device: Clear drag focus when we end the drag-and-drop
Kristian Høgsberg [Fri, 13 Apr 2012 14:39:24 +0000 (10:39 -0400)]
data-device: Clear drag focus when we end the drag-and-drop

Otherwise we'll see a spurious leave event when we start the next dnd.

12 years agotests: Make leak check work again by setting default visibility for malloc/free
Kristian Høgsberg [Fri, 13 Apr 2012 14:13:49 +0000 (10:13 -0400)]
tests: Make leak check work again by setting default visibility for malloc/free

We compile the test cases with -fvisibility=hidden which makes
our malloc/free wrappers fail to override system malloc/free.

12 years agotests: Fix warning in memory leak assert
Kristian Høgsberg [Fri, 13 Apr 2012 14:13:21 +0000 (10:13 -0400)]
tests: Fix warning in  memory leak assert

12 years agotests: Fix signedness warnings
Kristian Høgsberg [Fri, 13 Apr 2012 14:11:11 +0000 (10:11 -0400)]
tests: Fix signedness warnings

12 years agoserver: Add client destroy signal
Kristian Høgsberg [Fri, 13 Apr 2012 13:53:15 +0000 (09:53 -0400)]
server: Add client destroy signal

12 years agoAdd a public header for the version number
Neil Roberts [Wed, 11 Apr 2012 15:59:05 +0000 (16:59 +0100)]
Add a public header for the version number

This adds a public header so that applications can get the Wayland
version number at compile time. This can be used to make applications
that support compiling against multiple versions of Wayland.

There is a separate installed header called cogl-version.h which gets
included by both wayland-client.h and wayland-server.h

The canonical place for the version number is the configure.ac script
which splits it into three separate m4 defines for the major, minor
and micro version. These are copied into the generated
wayland-version.h header using AC_SUBST. There is also a string form
of the complete version number.

The version number is now also automatically copied into the two .pc
files.

Because the major, minor and micro parts are required it is no longer
possible to leave the version number as 'master' when building from
git. Most projects seem to immediately bump the git repo to a fake
version number (usually odd) after making a release so that there is
always a relative number that can be used for comparison. This patch
sets the git version to 0.99.0 under the assumption that the next
release will be 1.0.0.

12 years agoUpdate TODO
Kristian Høgsberg [Thu, 12 Apr 2012 21:43:12 +0000 (17:43 -0400)]
Update TODO

12 years agoIntroduce wl_signal
Kristian Høgsberg [Thu, 12 Apr 2012 19:29:48 +0000 (15:29 -0400)]
Introduce wl_signal

This is mostly renaming and consolidating the listener_list pattern
into something more concise and reusable.

12 years agoSwitch protocol to using serial numbers for ordering events and requests
Kristian Høgsberg [Thu, 12 Apr 2012 02:25:51 +0000 (22:25 -0400)]
Switch protocol to using serial numbers for ordering events and requests

The wayland protocol, as X, uses timestamps to match up certain
requests with input events.  The problem is that sometimes we need to
send out an event that doesn't have a corresponding timestamped input
event.  For example, the pointer focus surface goes away and new
surface needs to receive a pointer enter event.  These events are
normally timestamped with the evdev event timestamp, but in this case,
we don't have a evdev timestamp.  So we have to go to gettimeofday (or
clock_gettime()) and then we don't know if it's coming from the same
time source etc.

However for all these cases we don't need a real time timestamp, we
just need a serial number that encodes the order of events inside the
server.  So we introduce a serial number mechanism that we can use to
order events.  We still need real-time timestamps for actual input
device events (motion, buttons, keys, touch), to be able to reason
about double-click speed and movement speed so events that correspond to user input carry both a serial number and a timestamp.

The serial number also give us a mechanism to key together events that
are "logically the same" such as a unicode event and a keycode event,
or a motion event and a relative event from a raw device.

12 years agoremove superfluous functions
Jørgen Lind [Fri, 6 Apr 2012 11:27:57 +0000 (13:27 +0200)]
remove superfluous functions

12 years agowayland-util.h: Include stddef.h for size_t
Benjamin Franzke [Fri, 6 Apr 2012 13:54:38 +0000 (15:54 +0200)]
wayland-util.h: Include stddef.h for size_t

12 years agoshm: Allocate shm buffers through new wl_shm_pool interface
Kristian Høgsberg [Tue, 3 Apr 2012 16:08:50 +0000 (12:08 -0400)]
shm: Allocate shm buffers through new wl_shm_pool interface

There's a big cost to setting up and tearing down a mmap and faulting in
the pages to back it.  For cases where we're continuously reallocating
shm wl_buffers (resizing a surface, typically) it is a big performance
improvement to be able to reuse a mmap area.  This change makes the shm
buffer allocation a two step process: first allocate a wl_shm_pool, then
allocate a buffer from the pool.  The wl_shm_pool encapsulate the shared
memory pool, and lets clients allocate wl_buffers backed by chunks of that
memory.  Buffers are allocated at an offset into the pool, so it's possible
to create multiple buffers from one pool, for example for icons or cursor
images.

12 years agowayland-utils: add wl_list_for_each_reverse_safe macro.
Alex Wu [Sun, 1 Apr 2012 12:13:07 +0000 (20:13 +0800)]
wayland-utils: add wl_list_for_each_reverse_safe macro.

Add the safe version for wl_list_for_each_reverse

12 years agoFix remaining signedness errors
Kristian Høgsberg [Fri, 30 Mar 2012 15:27:02 +0000 (11:27 -0400)]
Fix remaining signedness errors

We can change the data type for 'size' but we have to cast len to size_t
for the comparisons with sizeof results.

12 years agowayland-util: Fix wl_array signedness warnings
Kristian Høgsberg [Fri, 30 Mar 2012 14:41:38 +0000 (10:41 -0400)]
wayland-util: Fix wl_array signedness warnings

12 years agoconnection.c: Fix signedness warnings
Kristian Høgsberg [Fri, 30 Mar 2012 14:36:57 +0000 (10:36 -0400)]
connection.c: Fix signedness warnings

12 years agoMove DIV_ROUNDUP out of public header, remove unused ALIGN
Kristian Høgsberg [Fri, 30 Mar 2012 14:28:39 +0000 (10:28 -0400)]
Move DIV_ROUNDUP out of public header, remove unused ALIGN

12 years agoshm: Fix stride signedness in protocol
Kristian Høgsberg [Fri, 30 Mar 2012 14:24:29 +0000 (10:24 -0400)]
shm: Fix stride signedness in protocol

Make stride argument of wl_shm.create_buffer a signed integer.

12 years agoserver: fix button signedness in wl_grab_interface
Pekka Paalanen [Fri, 30 Mar 2012 13:38:39 +0000 (16:38 +0300)]
server: fix button signedness in wl_grab_interface

wl_input_device::grab_button is unsigned but the button parameter to
wl_grab_interface::button is signed. This lead to a warning in
data-device.c.

The button number is unsigned in the protocol, so make it unsigned in
the wl_grab_interface API, too. Fixes the compiler warning "comparison
between signed and unsigned integer expressions".

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoscanner: fix a signedness warning
Pekka Paalanen [Fri, 23 Mar 2012 12:00:32 +0000 (14:00 +0200)]
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>
12 years agoshm: fix cosmetic gcc warnings
Pekka Paalanen [Thu, 22 Mar 2012 09:33:35 +0000 (11:33 +0200)]
shm: fix cosmetic gcc warnings

Fix warning: 'static' is not at beginning of declaration

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoserver: fix signedness in wl_client_connection_data
Pekka Paalanen [Thu, 22 Mar 2012 15:21:58 +0000 (17:21 +0200)]
server: fix signedness in wl_client_connection_data

The variables opcode and size were unsigned, which lead to warnings
about comparisons of signed vs. unsigned.

Change these variable to signed. Their usage never relies on being
unsigned.

This also fixes (an assumed) printf format string problem, where these
were printed with %d, not %u.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoconfigure: add -Wextra -Wno-unused-parameter
Pekka Paalanen [Thu, 22 Mar 2012 09:30:35 +0000 (11:30 +0200)]
configure: add -Wextra -Wno-unused-parameter

This adds more gcc warnings that should be useful, and suppresses the
unused parameter warnings that are not wanted.

Most importantly, this change enables warnings about comparison between
signed and unsigned.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agodocs: Touch ouput dir Wayland to update timestamp
Kristian Høgsberg [Thu, 29 Mar 2012 18:11:16 +0000 (14:11 -0400)]
docs: Touch ouput dir Wayland to update timestamp

Prevents rebuild every time.

12 years agoRemove unused bits from wayland-server.h
Kristian Høgsberg [Thu, 29 Mar 2012 17:34:08 +0000 (13:34 -0400)]
Remove unused bits from wayland-server.h

12 years agoUpdate TODO
Kristian Høgsberg [Thu, 29 Mar 2012 03:13:59 +0000 (23:13 -0400)]
Update TODO

12 years agodoc: consistently indent the xml files by 2 spaces
Peter Hutterer [Thu, 29 Mar 2012 00:50:13 +0000 (10:50 +1000)]
doc: consistently indent the xml files by 2 spaces

2 spaces is enough for xml, otherwise we end up with too little room for the
actual text.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12 years agodoc: rename Procotol to ProtocolSpec and WaylandProtocol to Protocol
Peter Hutterer [Thu, 29 Mar 2012 00:50:12 +0000 (10:50 +1000)]
doc: rename Procotol to ProtocolSpec and WaylandProtocol to Protocol

The former is the actual specification, the latter notes about the protocol.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12 years agodoc: remove unused example files
Peter Hutterer [Thu, 29 Mar 2012 00:50:11 +0000 (10:50 +1000)]
doc: remove unused example files

These files were left in as examples, we have real-world examples now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12 years agodoc: move documentation from the tex file to docbook
Peter Hutterer [Thu, 29 Mar 2012 00:50:10 +0000 (10:50 +1000)]
doc: move documentation from the tex file to docbook

And remove the .tex file

Minor changes:
- where the .tex file had some interface descriptions, the docbook source
  now links to the actual protocol. The exception here is the shared object
  cache which is simply a <programlisting> until the protocol spec exists.
- "Implementation" section skipped, this seems in need of an update anyway
  and may be better documented elsewhere (wiki?)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12 years agoFix formatting warning
Kristian Høgsberg [Tue, 27 Mar 2012 20:36:25 +0000 (16:36 -0400)]
Fix formatting warning

12 years agodata-device: notify the compositor about new drag icons
Ander Conselvan de Oliveira [Tue, 27 Mar 2012 14:36:35 +0000 (17:36 +0300)]
data-device: notify the compositor about new drag icons

Let the compositor use a listener to be notified when a new drag icon
is set up.

12 years agoRemove wl_buffer.damage and simplify shm implementation
Kristian Høgsberg [Mon, 26 Mar 2012 20:33:24 +0000 (16:33 -0400)]
Remove wl_buffer.damage and simplify shm implementation

12 years agoAdd simple memory leak check to all tests.
U. Artie Eoff [Fri, 23 Mar 2012 17:01:23 +0000 (10:01 -0700)]
Add simple memory leak check to all tests.

Wrap all tests with a memory balance check to detect potential
memory leaks.
Fixed a few tests that had memory leaks contained in the tests
themselves.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
12 years agoconnection-test: Add test case to stress connection buffers
Kristian Høgsberg [Sat, 24 Mar 2012 18:34:05 +0000 (14:34 -0400)]
connection-test: Add test case to stress connection buffers

This catches the bug fixed in cab70c9e5d8c38260a07bb1ddb7618826a120465.

12 years agoconnection-test: Test fd transport
Kristian Høgsberg [Sat, 24 Mar 2012 18:27:30 +0000 (14:27 -0400)]
connection-test: Test fd transport

12 years agoconnection-test: Add more test cases
Kristian Høgsberg [Fri, 23 Mar 2012 20:57:34 +0000 (16:57 -0400)]
connection-test: Add more test cases

12 years agoconnection-test: Store expected result in struct marshal_data
Kristian Høgsberg [Fri, 23 Mar 2012 20:56:19 +0000 (16:56 -0400)]
connection-test: Store expected result in struct marshal_data

12 years agotests: Add marshal+demarshal connection test
Kristian Høgsberg [Fri, 23 Mar 2012 15:41:34 +0000 (11:41 -0400)]
tests: Add marshal+demarshal connection test

12 years agotests: Use different connections for read and write tests
Kristian Høgsberg [Fri, 23 Mar 2012 15:32:17 +0000 (11:32 -0400)]
tests: Use different connections for read and write tests

The connection tests so far only use one connection at a time, but this
prepares for tests that use a connection on both sides of the socket.

12 years agoconnection: Just look at buffer size and remove redundant n_fds_out
Kristian Høgsberg [Fri, 23 Mar 2012 04:48:19 +0000 (00:48 -0400)]
connection: Just look at buffer size and remove redundant n_fds_out

Instead of maintaining a count of the fds in the buffer, just compute
that from the buffer size.  That way we don't get out of sync.

12 years agoconnection: Set n_fds_out to 0 when we send out the fds
Kristian Høgsberg [Fri, 23 Mar 2012 04:27:04 +0000 (00:27 -0400)]
connection: Set n_fds_out to 0 when we send out the fds

This needs to happen always, not just when the fd buffer overflows.

12 years agoAdd protocol for axis events
Scott Moreau [Tue, 20 Mar 2012 15:10:18 +0000 (09:10 -0600)]
Add protocol for axis events

12 years agotests: Remove debug printf
Kristian Høgsberg [Wed, 21 Mar 2012 14:32:06 +0000 (10:32 -0400)]
tests: Remove debug printf

12 years agoevent-loop: Use two-step destruction of event loop sources.
Jonas Ådahl [Wed, 21 Mar 2012 09:31:24 +0000 (10:31 +0100)]
event-loop: Use two-step destruction of event loop sources.

Instead of directly freeing an event source upon removal put it in a
queue later handled by the event loop; either after a dispatch or upon
event loop destruction.

This is necessary to avoid already queued up event sources to be freed
during some other dispatch callback, causing segmentation faults when
the event loop later tries to handle an event from the freed source.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
12 years agotests: Add test case for freeing source with pending data
Kristian Høgsberg [Wed, 21 Mar 2012 14:29:47 +0000 (10:29 -0400)]
tests: Add test case for freeing source with pending data

12 years agoCheck arguments to wl_resource_post_error in gcc
Bill Spitzak [Mon, 19 Mar 2012 01:54:21 +0000 (18:54 -0700)]
Check arguments to wl_resource_post_error in gcc

The attached patch turns on printf argument warnings for this function,
which I found was being called incorrectly at least once in the wayland
source code.

12 years agoconfigure: Add option to disable building documentation.
Üstün Ergenoğlu [Sat, 17 Mar 2012 17:09:39 +0000 (19:09 +0200)]
configure: Add option to disable building documentation.

Signed-off-by: Üstün Ergenoğlu <ego@ustun.fi>
12 years agotest: add a unit test for the event loop post dispatch check
Ander Conselvan de Oliveira [Wed, 14 Mar 2012 12:47:40 +0000 (14:47 +0200)]
test: add a unit test for the event loop post dispatch check

12 years agoevent-loop: always do the post-dispatch check
Ander Conselvan de Oliveira [Tue, 13 Mar 2012 11:16:13 +0000 (13:16 +0200)]
event-loop: always do the post-dispatch check

The post-dispatch check on wl_event_loop_dispatch() was not being run
if epoll_wait returned 0 events, making the check unreliable.

12 years agoTODO: Pull in updated TODO list from 1.0 roadmap email
Kristian Høgsberg [Tue, 20 Mar 2012 16:32:51 +0000 (12:32 -0400)]
TODO: Pull in updated TODO list from 1.0 roadmap email

12 years agodoc: Don't list directories in list of files to install
Kristian Høgsberg [Fri, 16 Mar 2012 13:26:05 +0000 (09:26 -0400)]
doc: Don't list directories in list of files to install

The find expression was listing the xml_tmp directory, because it matched
the -prune rule.

12 years agoFlush the connection if we have to many marshaled fds
Ander Conselvan de Oliveira [Fri, 9 Mar 2012 10:51:42 +0000 (12:51 +0200)]
Flush the connection if we have to many marshaled fds

The buffer used by wl_connection_data to receive a cmsg is 128 bytes
long. This can hold at most 28 fds but when a cmsg is generated for
sending the fds, there is no check for this limitation. The man page
for recvmsg does not show any way of recovering from MSG_CTRUNC, that
happens when the buffer supplied for cmsg is too short.

Fix this by flushing the data to be written instead of generating a
cmsg buffer longer than the maximum.

12 years agotest-runner.c: Consolidate test running code
Kristian Høgsberg [Tue, 6 Mar 2012 03:29:53 +0000 (22:29 -0500)]
test-runner.c: Consolidate test running code

12 years agotests: Add demarshal tests
Kristian Høgsberg [Tue, 6 Mar 2012 03:26:17 +0000 (22:26 -0500)]
tests: Add demarshal tests

12 years agotests: Add more marshal tests
Kristian Høgsberg [Tue, 6 Mar 2012 02:53:38 +0000 (21:53 -0500)]
tests: Add more marshal tests

12 years agotests: Simplify connection tests a bit
Kristian Høgsberg [Tue, 6 Mar 2012 02:40:01 +0000 (21:40 -0500)]
tests: Simplify connection tests a bit

12 years agotests: Add wl_list tests
Kristian Høgsberg [Tue, 6 Mar 2012 02:38:25 +0000 (21:38 -0500)]
tests: Add wl_list tests

12 years agotests: More wl_map tests
Kristian Høgsberg [Tue, 6 Mar 2012 02:14:57 +0000 (21:14 -0500)]
tests: More wl_map tests

12 years agoTOOD: Frame based input done
Kristian Høgsberg [Tue, 6 Mar 2012 02:02:53 +0000 (21:02 -0500)]
TOOD: Frame based input done

12 years agotests: makefile error: missing test-runner.h
Gaetan Nadon [Sat, 3 Mar 2012 22:32:59 +0000 (17:32 -0500)]
tests: makefile error: missing test-runner.h

Detected by running distcheck

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
12 years agoscanner: Add since attribute
Kristian Høgsberg [Mon, 5 Mar 2012 15:31:53 +0000 (10:31 -0500)]
scanner: Add since attribute

This will help us document when a request or event was added to the protocol.

12 years agocheck: connection-test fails to link to ffi
Gaetan Nadon [Sun, 4 Mar 2012 17:15:31 +0000 (12:15 -0500)]
check: connection-test fails to link to ffi

This prevents distcheck from completing.
Moving the -lffi at the end of the command fixes the problem.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
12 years agopublican: support out-of-source tree build
Gaetan Nadon [Sat, 3 Mar 2012 22:32:58 +0000 (17:32 -0500)]
publican: support out-of-source tree build

When srcdir!=builddir, there is no way to tell publican that the source
is in srcdir rather than builldir. The workaround is to copy the source
files from srcdir to builddir. To retain the en-US final destination
name, the source directory is renamed to en_US.

Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
12 years agoFix distcheck where protocol.xsl was missing in the tarball
Gaetan Nadon [Sat, 3 Mar 2012 22:32:57 +0000 (17:32 -0500)]
Fix distcheck where protocol.xsl was missing in the tarball

To reproduce, invoke distcheck from an out-of-source tree.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
12 years agoAdd wl_array_for_each
Kristian Høgsberg [Sun, 4 Mar 2012 18:40:49 +0000 (13:40 -0500)]
Add wl_array_for_each

12 years agoAdd tests subdir to toplevel SUBDIRS variable
Kristian Høgsberg [Sat, 3 Mar 2012 05:39:42 +0000 (00:39 -0500)]
Add tests subdir to toplevel SUBDIRS variable

Artie spotted this.

12 years agotests: Add connection marshalling tests
Kristian Høgsberg [Sat, 3 Mar 2012 05:29:21 +0000 (00:29 -0500)]
tests: Add connection marshalling tests

12 years agotests: Add connection tests
Kristian Høgsberg [Sat, 3 Mar 2012 04:42:46 +0000 (23:42 -0500)]
tests: Add connection tests

12 years agotest-runner: Fix warnings
Kristian Høgsberg [Sat, 3 Mar 2012 04:42:07 +0000 (23:42 -0500)]
test-runner: Fix warnings

12 years agoconnection: Export wl_connection_queue() so we can test it
Kristian Høgsberg [Sat, 3 Mar 2012 04:38:31 +0000 (23:38 -0500)]
connection: Export wl_connection_queue() so we can test it

12 years agotests: Print test status after running test
Kristian Høgsberg [Sat, 3 Mar 2012 03:45:28 +0000 (22:45 -0500)]
tests: Print test status after running test

This way assert output will be a line by itself, which is easier to read
and lets editors such as emacs step through failed assertions.

12 years agotests: Add Unit tests for wl_map and wl_array data structures
Kristian Høgsberg [Fri, 2 Mar 2012 23:03:16 +0000 (18:03 -0500)]
tests: Add Unit tests for wl_map and wl_array data structures

We use a simple test-runner helper that runs each test in a separate
process and reports the pass/fail rate at the end.

12 years agoTerminate drag if data source is destroyed
Ander Conselvan de Oliveira [Fri, 2 Mar 2012 13:45:56 +0000 (15:45 +0200)]
Terminate drag if data source is destroyed

12 years agoserver: fix event sending type mismatches
Pekka Paalanen [Fri, 2 Mar 2012 16:09:27 +0000 (18:09 +0200)]
server: fix event sending type mismatches

These were not bugs in practice, because the first (and only) field of
struct wl_surface is struct wl_resource.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoserver: use the event sending wrappers
Pekka Paalanen [Fri, 2 Mar 2012 15:08:59 +0000 (17:08 +0200)]
server: use the event sending wrappers

This exposes some type mismatches that are fixed in the next commit.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoscanner: emit event wrapper functions for server
Pekka Paalanen [Fri, 2 Mar 2012 13:16:33 +0000 (15:16 +0200)]
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>
12 years agowayland-server: Destroy resource before sending out delete_id event
Kristian Høgsberg [Fri, 2 Mar 2012 03:46:07 +0000 (22:46 -0500)]
wayland-server: Destroy resource before sending out delete_id event

In some cases, we send out events from the resource destructor and
those need to go out before we recycle the object ID.

12 years agoFix server crash when a client dies during a drag with an icon
Ander Conselvan de Oliveira [Thu, 1 Mar 2012 12:09:42 +0000 (14:09 +0200)]
Fix server crash when a client dies during a drag with an icon

If a client dies during a drag that it started using an icon surface,
the server could crash because the icon surface is not valid anymore.

Fix this by using a destroy listener to reset device->drag_surface to
nil when the surface is destroyed.

12 years agoFix wl_data_offer source destroy listener
Ander Conselvan de Oliveira [Thu, 1 Mar 2012 12:09:41 +0000 (14:09 +0200)]
Fix wl_data_offer source destroy listener

The listener function implementation was getting a wrong pointer to the
wl_data_offer object because the resource parameter is actually the
data source and not the data offer.

12 years agoconfigure.ac: Fix test-for-empty bug
Kristian Høgsberg [Wed, 29 Feb 2012 17:49:25 +0000 (12:49 -0500)]
configure.ac: Fix test-for-empty bug

From Gaetan Nadon:

./configure: line 11662: test: !=: unary operator expected
AM_CONDITIONAL([HAVE_XSLTPROC], [test $XSLTPROC != ""])
AM_CONDITIONAL([HAVE_PUBLICAN], [test $PUBLICAN != ""])

It shows up when you do not have publican. The usual "testing for blank" bug.

12 years agoprotocol: Clarify the documentation for the fullscreen protocol
Rob Bradford [Tue, 28 Feb 2012 16:48:26 +0000 (16:48 +0000)]
protocol: Clarify the documentation for the fullscreen protocol

12 years agoMerge remote-tracking branch 'whot/publican'
Kristian Høgsberg [Wed, 29 Feb 2012 16:54:36 +0000 (11:54 -0500)]
Merge remote-tracking branch 'whot/publican'

12 years agoDon't block when flushing a full protocol buffer
Kristian Høgsberg [Wed, 29 Feb 2012 16:07:48 +0000 (11:07 -0500)]
Don't block when flushing a full protocol buffer

In case the client isn't responding, this will block the compositor.
Instead we flush with MSG_DONTWAIT, which lets us fill up the kernel buffer
as much as we can (after not returning EPOLLOUT anymore it still can take
80k more), and then disconnect the client if we get EAGAIN.

12 years agoHack up distcheck for publican
Peter Hutterer [Wed, 29 Feb 2012 01:49:16 +0000 (11:49 +1000)]
Hack up distcheck for publican

Publican requires a read-write source tree, see
http://bugzilla.redhat.com/show_bug.cgi?id=798484

And it currently cannot build out-of-tree, so we need to copy the sources
into the _build tree and generate Protocol.xml into that tree too (we'd have
to do this anyway since automake creates a read-only source tree, so we
can't just link).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12 years agoGenerate the docbook description for the protocol from wayland.xml
Peter Hutterer [Fri, 24 Feb 2012 07:31:51 +0000 (17:31 +1000)]
Generate the docbook description for the protocol from wayland.xml

Convert the wayland.xml protocol description to a docbook-compatible format
and hook it up to the publican sources.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12 years agoHook up autotools for publican
Peter Hutterer [Thu, 23 Feb 2012 23:42:05 +0000 (09:42 +1000)]
Hook up autotools for publican

automake doesn't seem to provide a sensible method to install a directory of
stuff in $(docdir). Do it manually then.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12 years agodoc: Comment out some of the default chapters
Peter Hutterer [Tue, 28 Feb 2012 22:42:26 +0000 (08:42 +1000)]
doc: Comment out some of the default chapters

I'll leave them in for now as a template for how things looked originally,
this can be removed later.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12 years agodoc: Add architecture from the website
Peter Hutterer [Fri, 24 Feb 2012 01:01:39 +0000 (11:01 +1000)]
doc: Add architecture from the website

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12 years agodoc: Fix up title page with logo and author information
Peter Hutterer [Thu, 23 Feb 2012 23:47:44 +0000 (09:47 +1000)]
doc: Fix up title page with logo and author information

Abstract taken from http://wayland.freedesktop.org

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12 years agodoc: add publican-created doctree
Peter Hutterer [Thu, 23 Feb 2012 23:37:02 +0000 (09:37 +1000)]
doc: add publican-created doctree

$> publican create --name=Wayland
unmodified otherwise

To build the tree to target formats, use
$> publican build --langs=en-US --formats=html,pdf

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12 years agoprotocol: fix make distcheck
Peter Hutterer [Wed, 29 Feb 2012 00:40:53 +0000 (10:40 +1000)]
protocol: fix make distcheck

Distribute all source files that we need for buildling.
Plus, remove the html file on make clean.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>