uint32_t key;
};
-struct wl_touch_grab;
-struct wl_touch_grab_interface {
- void (*down)(struct wl_touch_grab *grab,
+struct weston_touch_grab;
+struct weston_touch_grab_interface {
+ void (*down)(struct weston_touch_grab *grab,
uint32_t time,
int touch_id,
wl_fixed_t sx,
wl_fixed_t sy);
- void (*up)(struct wl_touch_grab *grab,
+ void (*up)(struct weston_touch_grab *grab,
uint32_t time,
int touch_id);
- void (*motion)(struct wl_touch_grab *grab,
+ void (*motion)(struct weston_touch_grab *grab,
uint32_t time,
int touch_id,
wl_fixed_t sx,
wl_fixed_t sy);
};
-struct wl_touch_grab {
- const struct wl_touch_grab_interface *interface;
- struct wl_touch *touch;
+struct weston_touch_grab {
+ const struct weston_touch_grab_interface *interface;
+ struct weston_touch *touch;
struct wl_surface *focus;
};
};
-struct wl_touch {
+struct weston_touch {
struct wl_seat *seat;
struct wl_list resource_list;
uint32_t focus_serial;
struct wl_signal focus_signal;
- struct wl_touch_grab *grab;
- struct wl_touch_grab default_grab;
+ struct weston_touch_grab *grab;
+ struct weston_touch_grab default_grab;
wl_fixed_t grab_x, grab_y;
uint32_t grab_serial;
uint32_t grab_time;
struct weston_pointer *pointer;
struct weston_keyboard *keyboard;
- struct wl_touch *touch;
+ struct weston_touch *touch;
uint32_t selection_serial;
struct wl_data_source *selection_data_source;
void
wl_seat_set_keyboard(struct wl_seat *seat, struct weston_keyboard *keyboard);
void
-wl_seat_set_touch(struct wl_seat *seat, struct wl_touch *touch);
+wl_seat_set_touch(struct wl_seat *seat, struct weston_touch *touch);
void
weston_pointer_init(struct weston_pointer *pointer);
weston_keyboard_end_grab(struct weston_keyboard *keyboard);
void
-wl_touch_init(struct wl_touch *touch);
+weston_touch_init(struct weston_touch *touch);
void
-wl_touch_release(struct wl_touch *touch);
+weston_touch_release(struct weston_touch *touch);
void
-wl_touch_start_grab(struct wl_touch *device,
- struct wl_touch_grab *grab);
+weston_touch_start_grab(struct weston_touch *device,
+ struct weston_touch_grab *grab);
void
-wl_touch_end_grab(struct wl_touch *touch);
+weston_touch_end_grab(struct weston_touch *touch);
void
wl_data_device_set_keyboard_focus(struct wl_seat *seat);
int has_pointer;
struct weston_keyboard keyboard;
int has_keyboard;
- struct wl_touch touch;
+ struct weston_touch touch;
int has_touch;
struct wl_signal destroy_signal;
static void
lose_touch_focus(struct wl_listener *listener, void *data)
{
- struct wl_touch *touch =
- container_of(listener, struct wl_touch, focus_listener);
+ struct weston_touch *touch =
+ container_of(listener, struct weston_touch, focus_listener);
touch->focus_resource = NULL;
}
default_grab_button
};
-static void default_grab_touch_down(struct wl_touch_grab *grab,
- uint32_t time,
- int touch_id,
- wl_fixed_t sx,
- wl_fixed_t sy)
+static void
+default_grab_touch_down(struct weston_touch_grab *grab, uint32_t time,
+ int touch_id, wl_fixed_t sx, wl_fixed_t sy)
{
- struct wl_touch *touch = grab->touch;
+ struct weston_touch *touch = grab->touch;
struct wl_display *display;
uint32_t serial;
display = wl_client_get_display(touch->focus_resource->client);
serial = wl_display_next_serial(display);
wl_touch_send_down(touch->focus_resource, serial, time,
- &touch->focus->resource, touch_id, sx, sy);
+ &touch->focus->resource,
+ touch_id, sx, sy);
}
}
-static void default_grab_touch_up(struct wl_touch_grab *grab,
- uint32_t time,
- int touch_id)
+static void
+default_grab_touch_up(struct weston_touch_grab *grab,
+ uint32_t time, int touch_id)
{
- struct wl_touch *touch = grab->touch;
+ struct weston_touch *touch = grab->touch;
struct wl_display *display;
uint32_t serial;
}
}
-static void default_grab_touch_motion(struct wl_touch_grab *grab,
- uint32_t time,
- int touch_id,
- wl_fixed_t sx,
- wl_fixed_t sy)
+static void
+default_grab_touch_motion(struct weston_touch_grab *grab, uint32_t time,
+ int touch_id, wl_fixed_t sx, wl_fixed_t sy)
{
- struct wl_touch *touch = grab->touch;
+ struct weston_touch *touch = grab->touch;
if (touch->focus_resource) {
wl_touch_send_motion(touch->focus_resource, time,
- touch_id, sx, sy);
+ touch_id, sx, sy);
}
}
-static const struct wl_touch_grab_interface default_touch_grab_interface = {
+static const struct weston_touch_grab_interface default_touch_grab_interface = {
default_grab_touch_down,
default_grab_touch_up,
default_grab_touch_motion
}
WL_EXPORT void
-wl_touch_init(struct wl_touch *touch)
+weston_touch_init(struct weston_touch *touch)
{
memset(touch, 0, sizeof *touch);
wl_list_init(&touch->resource_list);
}
WL_EXPORT void
-wl_touch_release(struct wl_touch *touch)
+weston_touch_release(struct weston_touch *touch)
{
/* XXX: What about touch->resource_list? */
if (touch->focus_resource)
if (seat->keyboard)
weston_keyboard_release(seat->keyboard);
if (seat->touch)
- wl_touch_release(seat->touch);
+ weston_touch_release(seat->touch);
}
static void
}
WL_EXPORT void
-wl_seat_set_touch(struct wl_seat *seat, struct wl_touch *touch)
+wl_seat_set_touch(struct wl_seat *seat, struct weston_touch *touch)
{
if (touch && (seat->touch || touch->seat))
return; /* XXX: error? */
}
WL_EXPORT void
-wl_touch_start_grab(struct wl_touch *touch, struct wl_touch_grab *grab)
+weston_touch_start_grab(struct weston_touch *touch, struct weston_touch_grab *grab)
{
touch->grab = grab;
grab->touch = touch;
}
WL_EXPORT void
-wl_touch_end_grab(struct wl_touch *touch)
+weston_touch_end_grab(struct weston_touch *touch)
{
touch->grab = &touch->default_grab;
}
wl_fixed_t x, wl_fixed_t y, int touch_type)
{
struct weston_compositor *ec = seat->compositor;
- struct wl_touch *touch = seat->seat.touch;
- struct wl_touch_grab *grab = touch->grab;
+ struct weston_touch *touch = seat->seat.touch;
+ struct weston_touch_grab *grab = touch->grab;
struct weston_surface *es;
wl_fixed_t sx, sy;
if (seat->has_touch)
return;
- wl_touch_init(&seat->touch);
+ weston_touch_init(&seat->touch);
wl_seat_set_touch(&seat->seat, &seat->touch);
seat->has_touch = 1;