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.
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.
shm: Add API for renderers to register additional pixel formats
Don't include wayland-server.h in wayland-private.h

We just declare struct wl_display manually instead.
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.
scanner: expand help string

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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.
tests: do fixed test with random number more times

1000x in this case
tests: add some more list test

nothing big, just test if wl_list_empty() works
tests: simple interface_equal test
tests: Add some signal tests
tests: print backtrace when got SIGSEGV

the same way as in weston
tests/input-helper: simple compositor for testing

Initial commit, mostly works
Some functionality left though.

input-helper-test.c are basic tests for the input-helper
events-test
input-helper: generate unique socket name

When we run tests paralelly, we need different socket names for
displays. Otherwise the tests will fail when wl_display_add_socket
is called.
input-helper: more asserts in handle_event
input-helper: count processed events

count readable, writable, hungupx and error events
and events with no mask. Print the status at the end (when destroying
compositor)
input-helper: new assert
input-helper: trigger emitting events from client

Use SIGUSR1 to trigger emitting events. Events are defined in
user-defined function and registred into compositor by
test_compositor_add_events()
input-helper: create generic functions for getting wayland objects

New functions	test_compositor_emit_events
		test_compositor_client_add_listener
		test_compositor_client_populate/free
has been added. Their code is mostly moved from events-test.c
Usual workflow should be (pseudo-code):

// define listener and it's members
// ...
// ...
wl_object_listener listener;

client_main()
{
	test_compositor_client_populate()
	test_compositor_client_add_listener(&listener)

	// anything you want
	// ...

	test_compositor_emit_events()

	test_compositor_client_free()

	return 0;
}

events()
{
	//	send_motion ..
	//	send_motion ..
	//	send_button ..
	//	send_enter ..
	//	send_key ..
	//	...
	//	...
}

server()
{
	test_compositor_create()

	test_compositor_client_create(client_main)
	test_compositor_add_events(events)

	test_compositor_run()

	test_compositor_destroy()
}