Change weston_surface.resource to a wl_resource pointer.

This is the first in what will be a series of weston patches to convert
instances of wl_resource to pointers so we can make wl_resource opaque.
This patch handles weston_surface and should be the most invasive of the
entire series.  I am sending this one out ahead of the rest for review.

Specifically, my machine is not set up to build XWayland so I have no
ability to test it fully.  Could someone please test with XWayland and let
me know if this causes problems?

Because a surface may be created from XWayland, the resource may not always
exist.  Therefore, a destroy signal was added to weston_surface and
everything used to listen to surface->resource.destroy_signal now listens
to surface->destroy_signal.
xwm: Define SEND_EVENT_MASK and EVENT_TYPE macros to clarify xcb event type checks
xwm: Check result of xcb_get_atom_name_reply

When printing debug information about atoms, the XWM would crash if the X
server failed to respond to a request about atom names. In practice this
occurred when the server itself crashed, e.g. when starting mplayer with the
"xv" vo.
xwayland: Forward global position to X

xeyes works as expected now. subwindows are popped also as expected. This
patch should fix the following:

https://bugs.freedesktop.org/show_bug.cgi?id=59983

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
compositor-drm: free plane resources using drm function.

Free plane resources using drmModeFreePlaneResources()

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Use wl_resource_get_user_data for weston_surface resources

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
shell: Convert resources to pointers

This commit converts shell_surface.resource to a pointers and updates
shell.c to use wl_resource_get accessors for shell_surface, desktop_shell,
screensaver, and workspace_manager related resources.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
region: Change resource to a wl_resource pointer

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
callback: Change resource to a wl_resource pointer

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
input_panel_surface: Change resource to a wl_resource pointer

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
text-backend: Change resources to wl_resource pointers

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
input: Use wl_resource_get accessor functions for resources

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
output: Use wl_resource_get accessors for weston_output resources

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
subsurfaces: Use wl_resource_get accessors for subsurfaces

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Add spring-tool, a small utility to plot spring behavior

The weston_spring is a very flexible and powerful mecanhism for driving
animations.  However, it can be a little difficult to tame, but this
little helper can plot the response of the spring to a set of initial
parameters and makes it easy to tune and tweak the spring behavior.
spring: End spring simulatio faster

The spring animation runs for a long time after it has visually settled
down, because we're requiring too much stability.
spring: Make clip behavior configurable

When the spring goes outside the envelope, we have a few options for
bringing it back: either just let it overshoot, bounce off the limit or
just clamp it.  Instead of controlling that with #ifdef, let's make it
a part of the spring state.
spring: Make min/max part of spring parameters

Don't hard code the 0.0 - 1.0 spring envelope.
spring: Tweak the window fade-in spring to not overshoot

The fade animation overshoots and rings for a bit dipping back into
slightly transparent.  Bug 61675 was right.

https://bugs.freedesktop.org/show_bug.cgi?id=61675
input-panel: Bounce the input panel slide

A little bit over the top, but fun.  We may want to make a weston.ini key
for this eventually.