static void resize_grab_motion(struct wl_grab *grab, uint32_t time, int32_t x, int32_t y) { struct wlsc_resize_grab *resize = (struct wlsc_resize_grab *) grab; struct wl_input_device *device = grab->input_device; struct wl_surface *surface = &resize->surface->surface; int32_t width, height; if (resize->edges & WL_SHELL_RESIZE_LEFT) { width = device->grab_x - x + resize->width; } else if (resize->edges & WL_SHELL_RESIZE_RIGHT) { width = x - device->grab_x + resize->width; } else { width = resize->width; } if (resize->edges & WL_SHELL_RESIZE_TOP) { height = device->grab_y - y + resize->height; } else if (resize->edges & WL_SHELL_RESIZE_BOTTOM) { height = y - device->grab_y + resize->height; } else { height = resize->height; } wl_client_post_event(surface->client, &resize->shell->object, WL_SHELL_CONFIGURE, time, resize->edges, surface, width, height); }
static void post_drm_device(struct wl_client *client, struct wl_object *global, uint32_t version) { struct wl_drm *drm = (struct wl_drm *) global; wl_client_post_event(client, global, WL_DRM_DEVICE, drm->device_name); }
static void drm_authenticate(struct wl_client *client, struct wl_drm *drm, uint32_t id) { if (drm->callbacks->authenticate(drm->user_data, id) < 0) wl_client_post_error(client, &drm->object, WL_DRM_ERROR_AUTHENTICATE_FAIL, "authenicate failed"); else wl_client_post_event(client, &drm->object, WL_DRM_AUTHENTICATED); }
static void cogland_output_post_geometry (struct wl_client *wayland_client, struct wl_object *wayland_output, guint32 version) { CoglandOutput *output = container_of (wayland_output, CoglandOutput, wayland_output); wl_client_post_event (wayland_client, wayland_output, WL_OUTPUT_GEOMETRY, output->x, output->y, output->width, output->height); }