Generate more Wayland boilerplate

This change better automates the generation of almost all of the
boilerplate needed when adding a new Wayland protocol.

  1) Previously a manually created header in mock_wayland_client/ which
just included a generated header file was needed. This was easily
confused with some kind of problem with the normal protocol headers.
These headers are now generated.

  2) Previously the new protocol files would need to be listed in both the
wayland-protocols/ as well as mock_wayland_client/
I've made changes so that the mock_wayland_client/ references
the list in wayland-protocols.

  3) Adding a new global to wayland_globals meant adding five or six lines
scattered around the .h and the .cpp file. This has now been reduced to
adding just one in the .h file.

  4) You also needed to add one line in wayland_unique_ptr.h for every
interface that was added by the protocol where you wanted to use the
unique_ptr<T> wrapper. And you needed to understand which was the right
destructor function to call for the interface. This is now automatically

After this change, adding a new protocol should be as easy as:

  a) Adding the xml file to wayland-protocols/protocol/
  b) Referencing it in wayland-protocols/ (one line)
  c) Adding an entry in wayland_globals.h for the global interface(s)
     (one line each)

Test: Incremental build from cleanly built parent works
Test: Clean build works (no dependency issues on generated code)
Test: Unit test passes
Test: Play store loads
Bug: None

Change-Id: I705ef9661dc69c9ed9c1cb0cb74832fbec1c4924
1 file changed