This exposes some type mismatches that are fixed in the next commit.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
* this be a wl_data_device request? */
if (offer->source)
- wl_resource_post_event(&offer->source->resource,
- WL_DATA_SOURCE_TARGET, mime_type);
+ wl_data_source_send_target(&offer->source->resource,
+ mime_type);
}
static void
struct wl_data_offer *offer = resource->data;
if (offer->source)
- wl_resource_post_event(&offer->source->resource,
- WL_DATA_SOURCE_SEND, mime_type, fd);
+ wl_data_source_send_send(&offer->source->resource,
+ mime_type, fd);
close(fd);
}
static void
data_source_cancel(struct wl_data_source *source)
{
- wl_resource_post_event(&source->resource, WL_DATA_SOURCE_CANCELLED);
+ wl_data_source_send_cancelled(&source->resource);
}
static struct wl_resource *
wl_client_add_resource(target->client, &offer->resource);
- wl_resource_post_event(target,
- WL_DATA_DEVICE_DATA_OFFER, &offer->resource);
+ wl_data_device_send_data_offer(target, &offer->resource);
end = source->mime_types.data + source->mime_types.size;
for (p = source->mime_types.data; p < end; p++)
- wl_resource_post_event(&offer->resource,
- WL_DATA_OFFER_OFFER, *p);
+ wl_data_offer_send_offer(&offer->resource, *p);
return &offer->resource;
}
struct wl_resource *resource, *offer;
if (device->drag_focus_resource) {
- wl_resource_post_event(device->drag_focus_resource,
- WL_DATA_DEVICE_LEAVE);
+ wl_data_device_send_leave(device->drag_focus_resource);
wl_list_remove(&device->drag_focus_listener.link);
device->drag_focus_resource = NULL;
device->drag_focus = NULL;
offer = wl_data_source_send_offer(device->drag_data_source,
resource);
- wl_resource_post_event(resource,
- WL_DATA_DEVICE_ENTER,
- time, surface, x, y, offer);
+ wl_data_device_send_enter(resource, time, surface,
+ x, y, offer);
device->drag_focus = surface;
device->drag_focus_listener.func = destroy_drag_focus;
container_of(grab, struct wl_input_device, drag_grab);
if (device->drag_focus_resource)
- wl_resource_post_event(device->drag_focus_resource,
- WL_DATA_DEVICE_MOTION, time, x, y);
+ wl_data_device_send_motion(device->drag_focus_resource,
+ time, x, y);
}
static void
if (device->drag_focus_resource &&
device->grab_button == button && state == 0)
- wl_resource_post_event(device->drag_focus_resource,
- WL_DATA_DEVICE_DROP);
+ wl_data_device_send_drop(device->drag_focus_resource);
if (device->button_count == 0 && state == 0) {
wl_input_device_end_pointer_grab(device, time);
if (focus) {
data_device = find_resource(&device->drag_resource_list,
focus->client);
- wl_resource_post_event(data_device,
- WL_DATA_DEVICE_SELECTION, NULL);
+ wl_data_device_send_selection(data_device, NULL);
}
}
if (data_device) {
offer = wl_data_source_send_offer(device->selection_data_source,
data_device);
- wl_resource_post_event(data_device,
- WL_DATA_DEVICE_SELECTION,
- offer);
+ wl_data_device_send_selection(data_device, offer);
}
}
source = device->selection_data_source;
if (source) {
offer = wl_data_source_send_offer(source, data_device);
- wl_resource_post_event(data_device,
- WL_DATA_DEVICE_SELECTION, offer);
+ wl_data_device_send_selection(data_device, offer);
}
}
resource = grab->input_device->pointer_focus_resource;
if (resource)
- wl_resource_post_event(resource, WL_INPUT_DEVICE_MOTION,
- time, x, y);
+ wl_input_device_send_motion(resource, time, x, y);
}
static void
resource = device->pointer_focus_resource;
if (resource)
- wl_resource_post_event(resource, WL_INPUT_DEVICE_BUTTON,
- time, button, state);
+ wl_input_device_send_button(resource, time, button, state);
if (device->button_count == 0 && state == 0)
wl_input_device_set_pointer_focus(device,
resource = device->keyboard_focus_resource;
if (resource)
- wl_resource_post_event(resource, WL_INPUT_DEVICE_KEY,
- time, key, state);
+ wl_input_device_send_key(resource, time, key, state);
}
static const struct wl_keyboard_grab_interface
return;
if (device->pointer_focus_resource) {
- wl_resource_post_event(device->pointer_focus_resource,
- WL_INPUT_DEVICE_POINTER_LEAVE,
- time, device->pointer_focus);
+ wl_input_device_send_pointer_leave(
+ device->pointer_focus_resource,
+ time, device->pointer_focus);
wl_list_remove(&device->pointer_focus_listener.link);
}
resource = find_resource_for_surface(&device->resource_list, surface);
if (resource) {
- wl_resource_post_event(resource,
- WL_INPUT_DEVICE_POINTER_ENTER,
- time, surface, sx, sy);
+ wl_input_device_send_pointer_enter(resource, time,
+ surface, sx, sy);
wl_list_insert(resource->destroy_listener_list.prev,
&device->pointer_focus_listener.link);
}
return;
if (device->keyboard_focus_resource) {
- wl_resource_post_event(device->keyboard_focus_resource,
- WL_INPUT_DEVICE_KEYBOARD_LEAVE,
- time, device->keyboard_focus);
+ wl_input_device_send_keyboard_leave(
+ device->keyboard_focus_resource,
+ time, device->keyboard_focus);
wl_list_remove(&device->keyboard_focus_listener.link);
}
resource = find_resource_for_surface(&device->resource_list, surface);
if (resource) {
- wl_resource_post_event(resource,
- WL_INPUT_DEVICE_KEYBOARD_ENTER,
- time, surface, &device->keys);
+ wl_input_device_send_keyboard_enter(resource, time,
+ surface, &device->keys);
wl_list_insert(resource->destroy_listener_list.prev,
&device->keyboard_focus_listener.link);
}
callback = wl_client_add_object(client,
&wl_callback_interface, NULL, id, NULL);
- wl_resource_post_event(callback, WL_CALLBACK_DONE, 0);
+ wl_callback_send_done(callback, 0);
wl_resource_destroy(callback, 0);
}
resource = wl_client_add_object(client, &wl_shm_interface,
&shm_interface, id, data);
- wl_resource_post_event(resource, WL_SHM_FORMAT,
- WL_SHM_FORMAT_ARGB8888);
- wl_resource_post_event(resource, WL_SHM_FORMAT,
- WL_SHM_FORMAT_XRGB8888);
+ wl_shm_send_format(resource, WL_SHM_FORMAT_ARGB8888);
+ wl_shm_send_format(resource, WL_SHM_FORMAT_XRGB8888);
}
WL_EXPORT struct wl_shm *