wayland: Rearrange create_surface_extension a tiny bit

This moves all the "uninteresting" variables we pass to the end.
This commit is contained in:
Jasper St. Pierre 2014-02-28 08:40:42 -05:00
parent a27fb19473
commit e56cbfbd0f

View File

@ -668,13 +668,13 @@ get_resource_version (struct wl_resource *master_resource,
static gboolean static gboolean
create_surface_extension (MetaWaylandSurfaceExtension *extension, create_surface_extension (MetaWaylandSurfaceExtension *extension,
MetaWaylandSurface *surface,
struct wl_resource *master_resource,
guint32 id,
int max_version, int max_version,
const struct wl_interface *interface, const struct wl_interface *interface,
const void *implementation, const void *implementation,
wl_resource_destroy_func_t destructor) wl_resource_destroy_func_t destructor,
MetaWaylandSurface *surface,
struct wl_resource *master_resource,
guint32 id)
{ {
struct wl_client *client; struct wl_client *client;
@ -958,11 +958,12 @@ xdg_shell_get_xdg_surface (struct wl_client *client,
{ {
MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource); MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
if (!create_surface_extension (&surface->xdg_surface, surface, resource, id, if (!create_surface_extension (&surface->xdg_surface,
META_XDG_SURFACE_VERSION, META_XDG_SURFACE_VERSION,
&xdg_surface_interface, &xdg_surface_interface,
&meta_wayland_xdg_surface_interface, &meta_wayland_xdg_surface_interface,
xdg_surface_destructor)) xdg_surface_destructor,
surface, resource, id))
{ {
wl_resource_post_error (surface_resource, wl_resource_post_error (surface_resource,
WL_DISPLAY_ERROR_INVALID_OBJECT, WL_DISPLAY_ERROR_INVALID_OBJECT,
@ -1014,11 +1015,12 @@ xdg_shell_get_xdg_popup (struct wl_client *client,
if (parent_surf == NULL || parent_surf->window == NULL) if (parent_surf == NULL || parent_surf->window == NULL)
return; return;
if (!create_surface_extension (&surface->xdg_popup, surface, resource, id, if (!create_surface_extension (&surface->xdg_popup,
META_XDG_POPUP_VERSION, META_XDG_POPUP_VERSION,
&xdg_popup_interface, &xdg_popup_interface,
&meta_wayland_xdg_popup_interface, &meta_wayland_xdg_popup_interface,
xdg_popup_destructor)) xdg_popup_destructor,
surface, resource, id))
{ {
wl_resource_post_error (surface_resource, wl_resource_post_error (surface_resource,
WL_DISPLAY_ERROR_INVALID_OBJECT, WL_DISPLAY_ERROR_INVALID_OBJECT,
@ -1329,11 +1331,12 @@ wl_shell_get_shell_surface (struct wl_client *client,
{ {
MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource); MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
if (!create_surface_extension (&surface->wl_shell_surface, surface, resource, id, if (!create_surface_extension (&surface->wl_shell_surface,
META_WL_SHELL_SURFACE_VERSION, META_WL_SHELL_SURFACE_VERSION,
&wl_shell_surface_interface, &wl_shell_surface_interface,
&meta_wayland_wl_shell_surface_interface, &meta_wayland_wl_shell_surface_interface,
wl_shell_surface_destructor)) wl_shell_surface_destructor,
surface, resource, id))
{ {
wl_resource_post_error (surface_resource, wl_resource_post_error (surface_resource,
WL_DISPLAY_ERROR_INVALID_OBJECT, WL_DISPLAY_ERROR_INVALID_OBJECT,
@ -1412,11 +1415,12 @@ get_gtk_surface (struct wl_client *client,
{ {
MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource); MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
if (!create_surface_extension (&surface->gtk_surface, surface, resource, id, if (!create_surface_extension (&surface->gtk_surface,
META_GTK_SURFACE_VERSION, META_GTK_SURFACE_VERSION,
&gtk_surface_interface, &gtk_surface_interface,
&meta_wayland_gtk_surface_interface, &meta_wayland_gtk_surface_interface,
gtk_surface_destructor)) gtk_surface_destructor,
surface, resource, id))
{ {
wl_resource_post_error (surface_resource, wl_resource_post_error (surface_resource,
WL_DISPLAY_ERROR_INVALID_OBJECT, WL_DISPLAY_ERROR_INVALID_OBJECT,
@ -1699,11 +1703,12 @@ wl_subcompositor_get_subsurface (struct wl_client *client,
MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource); MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
MetaWaylandSurface *parent = wl_resource_get_user_data (parent_resource); MetaWaylandSurface *parent = wl_resource_get_user_data (parent_resource);
if (!create_surface_extension (&surface->subsurface, surface, resource, id, if (!create_surface_extension (&surface->subsurface,
META_GTK_SURFACE_VERSION, META_GTK_SURFACE_VERSION,
&wl_subsurface_interface, &wl_subsurface_interface,
&meta_wayland_subsurface_interface, &meta_wayland_subsurface_interface,
wl_subsurface_destructor)) wl_subsurface_destructor,
surface, resource, id))
{ {
wl_resource_post_error (surface_resource, wl_resource_post_error (surface_resource,
WL_DISPLAY_ERROR_INVALID_OBJECT, WL_DISPLAY_ERROR_INVALID_OBJECT,