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().
scanner: Introduce struct location for tracking source locations
scanner: Make fail() function use va_list and elaborate a few errors
scanner: Add location to elements so we can give better errors/warnings
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.
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>
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>
tests: move test-runner into subdirectory

It's nice to keep helper sources separately from tests sources.
It's better for searching files as well as for extending
the test-suite.

Also, there were no need to compile each test with test-*.c files
so I used them to create noinst library and link the tests against it.
Now we don't need to attach test-runner files to each test sources.
test-compositor: add tc-config.h file

This file defines configuration of test-compositor. It's initial file
because it will be used in the main files.
test-compositor: add libtc-utils library

This library contains generic function used by display and client
test-compositor: make compiler search for headers in src

Search for headers in wayland/src
test-compositor: add client and server header files

Add prototypes of functions. Since it's being trasfred from
wayland integration tests, I don't want to split the patch into
more patches which would be logical, but it would take a lot of time.
test-compositor: add tc-events.[ch]

This is support for simulating events. It will be used by
test-compositor.
test-compositor: add libtc-server library

Server side functions
test-compositor: add client-side functions

Add functions which can be used by client's subprocess. The header has
been already added.
test-compositor: add main header file

Add test-compositor header file
tests: look even for test-compositor headers

Search for headers in test-compositor/ dir
test-compositor: add README
autotools: link against test-compositor libraries

Tests using test-compositor need to be linked against it
tests: add wl_shm test

The test uses test-compositor