wayland: Use the send event wrappers

Rather than raw post_event.
This commit is contained in:
Jasper St. Pierre 2014-08-05 16:11:48 -04:00
parent 2ce23072d3
commit e5c4fedd55

View File

@ -114,18 +114,17 @@ bind_output (struct wl_client *client,
output->crtc->rect.width, output->crtc->rect.height, output->crtc->rect.width, output->crtc->rect.height,
output->crtc->current_mode->refresh_rate); output->crtc->current_mode->refresh_rate);
wl_resource_post_event (resource, wl_output_send_geometry (resource,
WL_OUTPUT_GEOMETRY, (int)output->crtc->rect.x,
(int)output->crtc->rect.x, (int)output->crtc->rect.y,
(int)output->crtc->rect.y, output->width_mm,
output->width_mm, output->height_mm,
output->height_mm, /* Cogl values reflect XRandR values,
/* Cogl values reflect XRandR values, and so does wayland */
and so does wayland */ output->subpixel_order,
output->subpixel_order, output->vendor,
output->vendor, output->product,
output->product, output->crtc->transform);
output->crtc->transform);
g_assert (output->crtc->current_mode != NULL); g_assert (output->crtc->current_mode != NULL);
@ -133,22 +132,18 @@ bind_output (struct wl_client *client,
if (output->crtc->current_mode == output->preferred_mode) if (output->crtc->current_mode == output->preferred_mode)
mode_flags |= WL_OUTPUT_MODE_PREFERRED; mode_flags |= WL_OUTPUT_MODE_PREFERRED;
wl_resource_post_event (resource, wl_output_send_mode (resource,
WL_OUTPUT_MODE, mode_flags,
mode_flags, (int)output->crtc->current_mode->width,
(int)output->crtc->current_mode->width, (int)output->crtc->current_mode->height,
(int)output->crtc->current_mode->height, (int)output->crtc->current_mode->refresh_rate);
(int)output->crtc->current_mode->refresh_rate);
output->scale = compute_scale (output); output->scale = compute_scale (output);
if (version >= WL_OUTPUT_SCALE_SINCE_VERSION) if (version >= WL_OUTPUT_SCALE_SINCE_VERSION)
wl_resource_post_event (resource, wl_output_send_scale (resource, output->scale);
WL_OUTPUT_SCALE,
output->scale);
if (version >= WL_OUTPUT_DONE_SINCE_VERSION) if (version >= WL_OUTPUT_DONE_SINCE_VERSION)
wl_resource_post_event (resource, wl_output_send_done (resource);
WL_OUTPUT_DONE);
} }
static void static void