mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-15 20:44:08 +00:00
cairo-util: return theme location from frame_touch_down
I'll be using this in a follow up patch that adds touch input to weston's wayland backend. Reviewed-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
This commit is contained in:
parent
3375ccaa27
commit
9690641bfc
|
@ -210,7 +210,7 @@ enum theme_location
|
||||||
frame_pointer_button(struct frame *frame, void *pointer,
|
frame_pointer_button(struct frame *frame, void *pointer,
|
||||||
uint32_t button, enum frame_button_state state);
|
uint32_t button, enum frame_button_state state);
|
||||||
|
|
||||||
void
|
enum theme_location
|
||||||
frame_touch_down(struct frame *frame, void *data, int32_t id, int x, int y);
|
frame_touch_down(struct frame *frame, void *data, int32_t id, int x, int y);
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -786,27 +786,27 @@ frame_pointer_button(struct frame *frame, void *data,
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
enum theme_location
|
||||||
frame_touch_down(struct frame *frame, void *data, int32_t id, int x, int y)
|
frame_touch_down(struct frame *frame, void *data, int32_t id, int x, int y)
|
||||||
{
|
{
|
||||||
struct frame_touch *touch = frame_touch_get(frame, data);
|
struct frame_touch *touch = frame_touch_get(frame, data);
|
||||||
struct frame_button *button = frame_find_button(frame, x, y);
|
struct frame_button *button = frame_find_button(frame, x, y);
|
||||||
enum theme_location location;
|
enum theme_location location;
|
||||||
|
|
||||||
if (id > 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (touch && button) {
|
|
||||||
touch->button = button;
|
|
||||||
frame_button_press(touch->button);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = theme_get_location(frame->theme, x, y,
|
location = theme_get_location(frame->theme, x, y,
|
||||||
frame->width, frame->height,
|
frame->width, frame->height,
|
||||||
frame->flags & FRAME_FLAG_MAXIMIZED ?
|
frame->flags & FRAME_FLAG_MAXIMIZED ?
|
||||||
THEME_FRAME_MAXIMIZED : 0);
|
THEME_FRAME_MAXIMIZED : 0);
|
||||||
|
|
||||||
|
if (id > 0)
|
||||||
|
return location;
|
||||||
|
|
||||||
|
if (touch && button) {
|
||||||
|
touch->button = button;
|
||||||
|
frame_button_press(touch->button);
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
switch (location) {
|
switch (location) {
|
||||||
case THEME_LOCATION_TITLEBAR:
|
case THEME_LOCATION_TITLEBAR:
|
||||||
frame->status |= FRAME_STATUS_MOVE;
|
frame->status |= FRAME_STATUS_MOVE;
|
||||||
|
@ -824,6 +824,7 @@ frame_touch_down(struct frame *frame, void *data, int32_t id, int x, int y)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue