protocol: add role error code to xdg_shell

Needed for properly reporting role violations from
xdg_shell.get_xdg_surface and .get_xdg_popup.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
compositor: send error for surface role resets

With the more accurate definition of wl_surface roles in Wayland,
enforce the restriction: a role is always set permanently, and
attempting to change it is a protocol error.

This patch is based on Jasper's patch:
http://lists.freedesktop.org/archives/wayland-devel/2014-August/016811.html

The difference in this patch compared to his are:

- send role errors on the interface whose request triggers it, not on
  wl_surface

- an interface could have several requests assigning different roles,
  cannot use wl_interface as the unique key; use an arbitary string
  instead

- ensure in window-manager.c that create_shell_surface() ->
  create_common_surface() is never called with surface->configure set,
  to avoid compositor abort

- use wl_resource_post_no_memory() where appropriate instead of
  hand-rolling it with wl_resource_post_error()

Ideally we would not add weston_surface::role_name field, but use
weston_surface::configure. At the moment this is not possible though,
because at least shell.c uses several different roles with the same
configure function. Drag'n'drop uses two configure functions for the
same role. The configure hook is also reset in several places,
which is not good for role tracking.

This patch overlooks the wl_surface roles assigned in privileged
extensions: screensaver, panel, background, lock, input panel.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
tests: add role conflict sub-surface vs. wl_shell_surface

Add tests for triggering the role conflict when a wl_surface is already
a wl_shell_surface and then attempted to be made into a sub-surface, and
vice versa.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
releasing: update web host name

Signed-off-by: Daniel Stone <daniels@collabora.com>
Very OCD cosmetic nitpick
gl-renderer: don't move memory in output_rotate_damage

output_rotate_damage shifted an array of pixman regions with a loop.  Now
it uses an index into that array.

This currently only saves 1 pixman_region32_copy, but we can now raise
BUFFER_DAMAGE_COUNT without a performance impact if we run into a
configuration where this is useful.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Initial libweston implementation

The approach taken here is to move all the stuff that belongs in a binary,
such as the main(), module and backend loading, config handling, to
a weston.c/h, keeping the behavior untouched.
All .so modules include weston.h, so they cannot be directly used by other
users of libweston, instead the modules provide a .h which are to be called
by the compositors using libweston directly, or by plugins of them.
All the config handling (weston_config, weston_option, ..) is weston-specific,
so weston_compositor does not hold a weston_config pointer anymore. Instead,
the config is passed to each module on creation.
libweston: port the drm compositor
libweston: make a shared library for compositor launchers
libweston: libweston-ify xwayland
xwm: find a seat for all the surface's views
libweston: handle the screenshoot and record bindings in weston.c

Move the code launching the screenshooter client and implementing
the screenshot protocol out of libweston, and make screenshooter.c
a generic way to hook screenshoot protocols into weston.
libweston: moved zoom.c in libweston
port the wayland backend to libweston
input: don't send to clients key events eaten by bindings

weston key bindings are supposed to eat the key events, and not pass it
on to clients, and indeed the wl_keyboard.key event is not sent. But
we must also not put the key in the keys array to pass to client with
the wl_keyboard.enter event, or else we may send the 'eaten' one too.
In the case of a key binding hiding a surface having the keyboard focus,
the shell may decide to give the focus to another surface, but that will
happen before the key is released, so the new focus surface will receive
the code of the bound key in the wl_keyboard.enter array.
headless: make it build again

This doesn't make the headless backend libweston compatible, it
just make it build.
libweston: make the rpi backend build