Added basic input framework.

Added xw::Seat to wrap wl_seat and WaylandInput to be the central
control object for keyboard and mouse input.

EventListener is a pure virtual class that WaylandInput delegates
to. EventDispatch implements EventListener and forwards input
and focus events on to XBMC.

Let WinEventsWayland manage the wl_seat * from EGLNativeTypeWayland
once it appears
Added support for pointer events and hide the system pointer.

Created classes xbmc::wayland::Pointer to wrap wl_pointer and
xbmc::PointerProcessor implementing xbmc::wayland::PointerListener
which contains the logic for converting wayland button and pointer
events into xbmc events.

Made xbmc::wayland::Seat wait for a pointer to appear and initialize
a pointer in WaylandInput.

Call wl_pointer_set_cursor as soon as the pointer enters our surface
as it is undefined before that.
Listen for a new wl_keyboard from wl_seat_listener and create an
XKBKeymap implementing wayland::Keymap. This class keeps track
of the keyboard state and MUST be updated every time a modifier or
a key is pressed (eg, every time we get an event from the protocol).

KeyboardProcessor implements the logic of converting XKB keysyms to
XBMC keysyms. It also changes the focus state of the window and
delivers key events to the XBMC event subsystem.

TimeoutManager and WaylandEventLoop are just a simple abstraction for
adding timeouts to the poll () / wl_display_dispatch () mainloop, in
place so that we can implement key repeat
Read or dispatch events in a separate thread.

MessagePump() should not be a blocking operation

Because wl_display_read_events was only introduced in wayland 1.2, we need
to support two methods of making MessagePump() nonblocking.

version_11::EventQueueStrategy dispatches the whole event queue and gathers
the resulting XBMC_Events or other messages wrapped up into Action functors
in its reader thread. It then dispatches these to XBMC in the main thread.

version_12::EventQueueStrategy simply reads the wayland connection fd and
then flushes the output buffer and dispatches any read events in the
main thread.

In either version, the wayland listeners may be running in a separate thread.

As such, there is no guaruntee that it is safe to mutate the state of
objects in the xbmc::wayland namespace, at least until
version_11::EventQueueStrategy can be dropped.
XBMCConnection::WaitForSynchronize() should also only be called from
the main thread and not the dispatch thread as it is responsible for
setting synchronized == true
[aml] add macro for optional export resolving
Add wayland-specific workaround for an intel driver bug.

Add EGL_QUIRK_DONT_TRUST_SURFACE_SIZE. The intel driver in Ubuntu Raring is
broken and returns a surface size of -1, -1. This is only temporary.
Optionally resolve wl_display_read_events and wl_display_prepare_read
Initial wayland test framework

Secondary Author: Cory Fields

wayland: Fixup test building

- Build tests in the test dir, not the main make.
- Guard objects and code appropriately
- Remove support for all but weston += 1.0.99. pkg-config and versioning were
  not implemented before that anyway.
Lazy-bind global interfaces.

Make all global-interfaces lazy-binding. This means that we store
the result of any incoming wl_registry.global event and then actually
process it later when we call wl_registry.bind after trying to
access the global object for the first time.
Add wayland object listeners.

We will need direct access to some wayland objects in testing,
some of which are only available to the client itself. Add some
hooks to the client classes to advertise via a singleton via
any other interested code that some wayland object became available.

Test that we received the xbmc_wayland object after connection and
sync.
Add tests that depend on xbmc_wayland
Split WinEventsWayland.cpp into separate files and refactor.

Rename WaylandInput to InputFactory and WaylandEventLoop to Loop.
Put each of them in the appropriate namespace. WaylandEventLoop
now delegates event queue callbacks to an injected EventListener
so as to decouple it from the rest of XBMC.
Added input acceptance tests
Add unit tests for PointerProcessor
Give xbmc::wayland::Keyboard the responsibility of managing the keymap.

The fact that we recieve the keymap as a string in shared memory is
really a wayland-specific implementation detail and not an abstraction
suitable for KeyboardProcessor. All KeyboardProcessor needs to care
about is receiving a keymap of some sort.
Do a reverse lookup on the keymap instead of hardcoding keys
Add key repeat tests
Split up TestEGLNativeTypeWayland.cpp into separate translation units.

Where we don't generate the xbmc_wayland test extension, those tests
depending on it are disabled
Merge pull request #2978 from smspillaz/wayland-gsoc-1

Implement support for display on Wayland compositors
[WIN32] fixed: check for the error return code instead if XBMC.exe exist. Latter one won't fetch build failures for the other projects.