<!-- drm support. This object is created by the server and published
using the display's global event. -->
<interface name="wl_drm" version="1">
+ <enum name="error">
+ <entry name="authenticate_fail" value="0"/>
+ <entry name="invalid_visual" value="1"/>
+ <entry name="invalid_name" value="2"/>
+ </enum>
+
<!-- Call this request with the magic received from drmGetMagic().
It will be passed on to the drmAuthMagic() or
DRIAuthConnection() call. This authentication must be
buffer->buffer.visual = visual;
if (visual->object.interface != &wl_visual_interface) {
- /* FIXME: Define a real exception event instead of
- * abusing this one */
- wl_client_post_event(client,
- (struct wl_object *) drm->display,
- WL_DISPLAY_INVALID_OBJECT, 0);
- fprintf(stderr, "invalid visual in create_buffer\n");
+ wl_client_post_error(client, &drm->object,
+ WL_DRM_ERROR_INVALID_VISUAL,
+ "invalid visual");
return;
}
stride, visual);
if (buffer->driver_buffer == NULL) {
- /* FIXME: Define a real exception event instead of
- * abusing this one */
- wl_client_post_event(client,
- (struct wl_object *) drm->display,
- WL_DISPLAY_INVALID_OBJECT, 0);
- fprintf(stderr, "failed to create image for name %d\n", name);
+ wl_client_post_error(client, &drm->object,
+ WL_DRM_ERROR_INVALID_NAME,
+ "invalid name");
return;
}
struct wl_drm *drm, uint32_t id)
{
if (drm->callbacks->authenticate(drm->user_data, id) < 0)
- wl_client_post_event(client,
- (struct wl_object *) drm->display,
- WL_DISPLAY_INVALID_OBJECT, 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
-post_drm_device(struct wl_client *client, struct wl_object *global)
+post_drm_device(struct wl_client *client,
+ struct wl_object *global, uint32_t version)
{
struct wl_drm *drm = (struct wl_drm *) global;