}
static void
-drag_grab_focus(struct wl_grab *grab, uint32_t time,
+drag_grab_focus(struct wl_pointer_grab *grab, uint32_t time,
struct wl_surface *surface, int32_t x, int32_t y)
{
struct wl_input_device *device =
}
static void
-drag_grab_motion(struct wl_grab *grab,
+drag_grab_motion(struct wl_pointer_grab *grab,
uint32_t time, int32_t x, int32_t y)
{
struct wl_input_device *device =
}
static void
-drag_grab_button(struct wl_grab *grab,
+drag_grab_button(struct wl_pointer_grab *grab,
uint32_t time, int32_t button, int32_t state)
{
struct wl_input_device *device =
WL_DATA_DEVICE_DROP);
if (device->button_count == 0 && state == 0) {
- wl_input_device_end_grab(device, time);
+ wl_input_device_end_pointer_grab(device, time);
if (device->drag_surface) {
struct wl_resource *surface_resource =
}
}
-static const struct wl_grab_interface drag_grab_interface = {
+static const struct wl_pointer_grab_interface drag_grab_interface = {
drag_grab_focus,
drag_grab_motion,
drag_grab_button,
if (icon_resource)
device->drag_surface = icon_resource->data;
- wl_input_device_start_grab(device, &device->drag_grab, time);
+ wl_input_device_start_pointer_grab(device, &device->drag_grab, time);
}
static void
}
static void
-default_grab_focus(struct wl_grab *grab, uint32_t time,
+default_grab_focus(struct wl_pointer_grab *grab, uint32_t time,
struct wl_surface *surface, int32_t x, int32_t y)
{
struct wl_input_device *device = grab->input_device;
}
static void
-default_grab_motion(struct wl_grab *grab,
+default_grab_motion(struct wl_pointer_grab *grab,
uint32_t time, int32_t x, int32_t y)
{
struct wl_resource *resource;
}
static void
-default_grab_button(struct wl_grab *grab,
+default_grab_button(struct wl_pointer_grab *grab,
uint32_t time, int32_t button, int32_t state)
{
struct wl_input_device *device = grab->input_device;
device->current_y);
}
-static const struct wl_grab_interface default_grab_interface = {
+static const struct wl_pointer_grab_interface
+ default_pointer_grab_interface = {
default_grab_focus,
default_grab_motion,
default_grab_button
device->pointer_focus_listener.func = lose_pointer_focus;
device->keyboard_focus_listener.func = lose_keyboard_focus;
- device->default_grab.interface = &default_grab_interface;
- device->default_grab.input_device = device;
- device->grab = &device->default_grab;
+ device->default_pointer_grab.interface = &default_pointer_grab_interface;
+ device->default_pointer_grab.input_device = device;
+ device->pointer_grab = &device->default_pointer_grab;
wl_list_init(&device->drag_resource_list);
device->selection_data_source = NULL;
device->pointer_focus_resource = resource;
device->pointer_focus = surface;
device->pointer_focus_time = time;
- device->default_grab.focus = surface;
+ device->default_pointer_grab.focus = surface;
}
WL_EXPORT void
}
WL_EXPORT void
-wl_input_device_start_grab(struct wl_input_device *device,
- struct wl_grab *grab, uint32_t time)
+wl_input_device_start_pointer_grab(struct wl_input_device *device,
+ struct wl_pointer_grab *grab, uint32_t time)
{
- const struct wl_grab_interface *interface;
+ const struct wl_pointer_grab_interface *interface;
- device->grab = grab;
- interface = device->grab->interface;
+ device->pointer_grab = grab;
+ interface = device->pointer_grab->interface;
grab->input_device = device;
if (device->current)
- interface->focus(device->grab, time, device->current,
+ interface->focus(device->pointer_grab, time, device->current,
device->current_x, device->current_y);
}
WL_EXPORT void
-wl_input_device_end_grab(struct wl_input_device *device, uint32_t time)
+wl_input_device_end_pointer_grab(struct wl_input_device *device, uint32_t time)
{
- const struct wl_grab_interface *interface;
+ const struct wl_pointer_grab_interface *interface;
- device->grab = &device->default_grab;
- interface = device->grab->interface;
- interface->focus(device->grab, time, device->current,
+ device->pointer_grab = &device->default_pointer_grab;
+ interface = device->pointer_grab->interface;
+ interface->focus(device->pointer_grab, time, device->current,
device->current_x, device->current_y);
}
struct wl_resource resource;
};
-struct wl_grab;
-struct wl_grab_interface {
- void (*focus)(struct wl_grab *grab, uint32_t time,
+struct wl_pointer_grab;
+struct wl_pointer_grab_interface {
+ void (*focus)(struct wl_pointer_grab *grab, uint32_t time,
struct wl_surface *surface, int32_t x, int32_t y);
- void (*motion)(struct wl_grab *grab,
+ void (*motion)(struct wl_pointer_grab *grab,
uint32_t time, int32_t x, int32_t y);
- void (*button)(struct wl_grab *grab,
+ void (*button)(struct wl_pointer_grab *grab,
uint32_t time, int32_t button, int32_t state);
};
-struct wl_grab {
- const struct wl_grab_interface *interface;
+struct wl_pointer_grab {
+ const struct wl_pointer_grab_interface *interface;
struct wl_input_device *input_device;
struct wl_surface *focus;
int32_t x, y;
struct wl_surface *current;
int32_t current_x, current_y;
- struct wl_grab *grab;
- struct wl_grab default_grab;
+ struct wl_pointer_grab *pointer_grab;
+ struct wl_pointer_grab default_pointer_grab;
uint32_t button_count;
uint32_t grab_time;
int32_t grab_x, grab_y;
struct wl_surface *drag_focus;
struct wl_resource *drag_focus_resource;
struct wl_listener drag_focus_listener;
- struct wl_grab drag_grab;
+ struct wl_pointer_grab drag_grab;
struct wl_surface *drag_surface;
struct wl_data_source *selection_data_source;
wl_data_device_manager_init(struct wl_display *display);
void
-wl_input_device_end_grab(struct wl_input_device *device, uint32_t time);
+wl_input_device_start_pointer_grab(struct wl_input_device *device,
+ struct wl_pointer_grab *grab, uint32_t time);
void
-wl_input_device_start_grab(struct wl_input_device *device,
- struct wl_grab *grab, uint32_t time);
+wl_input_device_end_pointer_grab(struct wl_input_device *device, uint32_t time);
void
wl_input_device_set_selection(struct wl_input_device *device,