output: Use wl_resource_get accessors for weston_output resources

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand 12 years ago committed by Kristian Høgsberg
parent 44a3863a17
commit a0d2dde6cd
  1. 21
      src/compositor.c
  2. 6
      src/data-device.c
  3. 3
      src/screenshooter.c
  4. 12
      src/shell.c

@ -502,19 +502,6 @@ weston_surface_damage_below(struct weston_surface *surface)
pixman_region32_fini(&damage); pixman_region32_fini(&damage);
} }
static struct wl_resource *
find_resource_for_client(struct wl_list *list, struct wl_client *client)
{
struct wl_resource *r;
wl_list_for_each(r, list, link) {
if (r->client == client)
return r;
}
return NULL;
}
static void static void
weston_surface_update_output_mask(struct weston_surface *es, uint32_t mask) weston_surface_update_output_mask(struct weston_surface *es, uint32_t mask)
{ {
@ -536,7 +523,7 @@ weston_surface_update_output_mask(struct weston_surface *es, uint32_t mask)
wl_list_for_each(output, &es->compositor->output_list, link) { wl_list_for_each(output, &es->compositor->output_list, link) {
if (1 << output->id & different) if (1 << output->id & different)
resource = resource =
find_resource_for_client(&output->resource_list, wl_resource_find_for_client(&output->resource_list,
client); client);
if (resource == NULL) if (resource == NULL)
continue; continue;
@ -2489,7 +2476,7 @@ weston_compositor_stack_plane(struct weston_compositor *ec,
static void unbind_resource(struct wl_resource *resource) static void unbind_resource(struct wl_resource *resource)
{ {
wl_list_remove(&resource->link); wl_list_remove(wl_resource_get_link(resource));
free(resource); free(resource);
} }
@ -2504,8 +2491,8 @@ bind_output(struct wl_client *client,
resource = wl_client_add_object(client, resource = wl_client_add_object(client,
&wl_output_interface, NULL, id, data); &wl_output_interface, NULL, id, data);
wl_list_insert(&output->resource_list, &resource->link); wl_list_insert(&output->resource_list, wl_resource_get_link(resource));
resource->destroy = unbind_resource; wl_resource_set_destructor(resource, unbind_resource);
wl_output_send_geometry(resource, wl_output_send_geometry(resource,
output->x, output->x,

@ -366,8 +366,8 @@ data_device_start_drag(struct wl_client *client, struct wl_resource *resource,
struct wl_resource *origin_resource, struct wl_resource *origin_resource,
struct wl_resource *icon_resource, uint32_t serial) struct wl_resource *icon_resource, uint32_t serial)
{ {
struct weston_seat *seat = resource->data; struct weston_seat *seat = wl_resource_get_user_data(resource);
struct weston_drag *drag = resource->data; struct weston_drag *drag = wl_resource_get_user_data(resource);
struct weston_surface *icon = NULL; struct weston_surface *icon = NULL;
if (seat->pointer->button_count == 0 || if (seat->pointer->button_count == 0 ||
@ -573,7 +573,7 @@ get_data_device(struct wl_client *client,
struct wl_resource *manager_resource, struct wl_resource *manager_resource,
uint32_t id, struct wl_resource *seat_resource) uint32_t id, struct wl_resource *seat_resource)
{ {
struct weston_seat *seat = seat_resource->data; struct weston_seat *seat = wl_resource_get_user_data(seat_resource);
struct wl_resource *resource; struct wl_resource *resource;
resource = wl_client_add_object(client, &wl_data_device_interface, resource = wl_client_add_object(client, &wl_data_device_interface,

@ -175,7 +175,8 @@ screenshooter_shoot(struct wl_client *client,
struct wl_resource *output_resource, struct wl_resource *output_resource,
struct wl_resource *buffer_resource) struct wl_resource *buffer_resource)
{ {
struct weston_output *output = output_resource->data; struct weston_output *output =
wl_resource_get_user_data(output_resource);
struct screenshooter_frame_listener *l; struct screenshooter_frame_listener *l;
struct wl_buffer *buffer = buffer_resource->data; struct wl_buffer *buffer = buffer_resource->data;

@ -1717,7 +1717,7 @@ shell_surface_set_maximized(struct wl_client *client,
/* get the default output, if the client set it as NULL /* get the default output, if the client set it as NULL
check whether the ouput is available */ check whether the ouput is available */
if (output_resource) if (output_resource)
shsurf->output = output_resource->data; shsurf->output = wl_resource_get_user_data(output_resource);
else if (es->output) else if (es->output)
shsurf->output = es->output; shsurf->output = es->output;
else else
@ -1930,7 +1930,7 @@ shell_surface_set_fullscreen(struct wl_client *client,
struct weston_output *output; struct weston_output *output;
if (output_resource) if (output_resource)
output = output_resource->data; output = wl_resource_get_user_data(output_resource);
else else
output = NULL; output = NULL;
@ -2449,7 +2449,7 @@ desktop_shell_set_background(struct wl_client *client,
surface->configure = background_configure; surface->configure = background_configure;
surface->configure_private = shell; surface->configure_private = shell;
surface->output = output_resource->data; surface->output = wl_resource_get_user_data(output_resource);
desktop_shell_send_configure(resource, 0, desktop_shell_send_configure(resource, 0,
surface_resource, surface_resource,
surface->output->width, surface->output->width,
@ -2483,7 +2483,7 @@ desktop_shell_set_panel(struct wl_client *client,
surface->configure = panel_configure; surface->configure = panel_configure;
surface->configure_private = shell; surface->configure_private = shell;
surface->output = output_resource->data; surface->output = wl_resource_get_user_data(output_resource);
desktop_shell_send_configure(resource, 0, desktop_shell_send_configure(resource, 0,
surface_resource, surface_resource,
surface->output->width, surface->output->width,
@ -3675,7 +3675,7 @@ screensaver_set_surface(struct wl_client *client,
struct desktop_shell *shell = wl_resource_get_user_data(resource); struct desktop_shell *shell = wl_resource_get_user_data(resource);
struct weston_surface *surface = struct weston_surface *surface =
wl_resource_get_user_data(surface_resource); wl_resource_get_user_data(surface_resource);
struct weston_output *output = output_resource->data; struct weston_output *output = wl_resource_get_user_data(output_resource);
surface->configure = screensaver_configure; surface->configure = screensaver_configure;
surface->configure_private = shell; surface->configure_private = shell;
@ -3838,7 +3838,7 @@ input_panel_surface_set_toplevel(struct wl_client *client,
wl_list_insert(&shell->input_panel.surfaces, wl_list_insert(&shell->input_panel.surfaces,
&input_panel_surface->link); &input_panel_surface->link);
input_panel_surface->output = output_resource->data; input_panel_surface->output = wl_resource_get_user_data(output_resource);
input_panel_surface->panel = 0; input_panel_surface->panel = 0;
} }

Loading…
Cancel
Save