if (!(e = event)) goto end;
ELOGF("COMP_SCREEN", "Input Device Add. name:%s(%s), seat:%s", NULL, e->name, e->identifier, e->seatname);
- seat = e_comp_wl_input_seat_get(e->seatname);
+ seat = e_seat_find(e->seatname);
if (!seat) goto end;
if (e->clas == ECORE_DEVICE_CLASS_MOUSE)
if (seat->ptr.num_devices == 0)
{
e_pointer_view_set(comp->pointer, NULL, 0, 0);
- e_comp_wl_input_pointer_enabled_set(seat, EINA_TRUE);
+ e_seat_pointer_enabled_set(seat, EINA_TRUE);
}
seat->ptr.num_devices++;
}
else if (e->clas == ECORE_DEVICE_CLASS_TOUCH)
{
E_Comp_Screen *comp_screen = e_comp_screen_get();
- e_comp_wl_input_touch_enabled_set(seat, EINA_TRUE);
+ e_seat_touch_enabled_set(seat, EINA_TRUE);
if (comp_screen)
_e_comp_screen_input_rotation_set(comp_screen->rotation);
seat->touch.num_devices++;
if (!(e = event)) goto end;
ELOGF("COMP_SCREEN", "Input Device Del. name:%s(%s), seat:%s", NULL, e->name, e->identifier, e->seatname);
- seat = e_comp_wl_input_seat_get(e->seatname);
+ seat = e_seat_find(e->seatname);
if (!seat) goto end;
if (e->clas == ECORE_DEVICE_CLASS_MOUSE)
seat->ptr.num_devices--;
if (seat->ptr.num_devices == 0)
{
- e_comp_wl_input_pointer_enabled_set(seat, EINA_FALSE);
+ e_seat_pointer_enabled_set(seat, EINA_FALSE);
e_pointer_view_set(comp->pointer, NULL, 0, 0);
e_pointer_hide(comp->pointer);
seat->touch.num_devices--;
if (seat->touch.num_devices == 0)
{
- e_comp_wl_input_touch_enabled_set(seat, EINA_FALSE);
+ e_seat_touch_enabled_set(seat, EINA_FALSE);
}
}
#include "e_devicemgr_wl_intern.h"
#include "e_input_log.h"
#include "e_client_intern.h"
+#include "e_seat_intern.h"
#include <tizen-extension-server-protocol.h>
return TIZEN_INPUT_DEVICE_MANAGER_ERROR_INVALID_SURFACE;
}
- if ((!e_config->show_cursor) || (!e_comp_wl_input_seat_pointer_enabled_get(NULL)))
+ if ((!e_config->show_cursor) || (!e_seat_pointer_enabled_get(NULL)))
{
DMERR("Pointer is not available");
if (!e_comp_wl_input_pointer_constraint_activated_get())
#include "e_seat_intern.h"
#include "e_input_seat_intern.h"
#include "e_comp_intern.h"
+#include "e_comp_wl_intern.h"
#include "e_comp_wl_input_intern.h"
+#include "e_comp_input_intern.h"
static Eina_List *_ecore_event_handlers = NULL;
E_Seat *seat = NULL;
E_Zone *zone = NULL;
- seat = e_comp_wl_input_seat_get(ei->seat_name);
+ seat = e_seat_find(ei->seat_name);
if (!seat) return ECORE_CALLBACK_PASS_ON;
if (ei->output_name)
return seat->zone;
}
+
+EINTERN E_Seat *
+e_seat_find(const char *name)
+{
+ Eina_List *l;
+ E_Seat *seat;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+
+ EINA_LIST_FOREACH(comp_wl->seats, l, seat)
+ {
+ if (seat->name && !strcmp(seat->name, name))
+ return seat;
+ }
+
+ return NULL;
+}
+
+EINTERN void
+e_seat_update_seat_caps(E_Seat *seat, struct wl_client *wc)
+{
+ Eina_List *l;
+ struct wl_resource *res;
+ enum wl_seat_capability caps = 0;
+
+ if (!seat)
+ seat = e_seat_find("default");
+
+ if (seat->ptr.enabled)
+ caps |= WL_SEAT_CAPABILITY_POINTER;
+ if (e_comp_input_key->kbd.enabled)
+ caps |= WL_SEAT_CAPABILITY_KEYBOARD;
+ if (seat->touch.enabled)
+ caps |= WL_SEAT_CAPABILITY_TOUCH;
+
+ EINA_LIST_FOREACH(seat->resources, l, res)
+ {
+ /* if a wc is null, send seat capability to all wl_seat resources */
+ if (wc && (wl_resource_get_client(res) != wc)) continue;
+ wl_seat_send_capabilities(res, caps);
+ }
+}
+
+EINTERN void
+e_seat_touch_send_motion(E_Seat *seat, struct wl_client *wc,
+ int idx, int x, int y, uint32_t timestamp)
+{
+ Eina_List *l, *ll;
+ struct wl_resource *res;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ E_Seat *s;
+
+ if (!seat) goto iterate;
+
+ EINA_LIST_FOREACH(seat->touch.resources, l, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_touch_check(res)) continue;
+
+ wl_touch_send_motion(res, timestamp, idx, wl_fixed_from_int(x), wl_fixed_from_int(y));
+ }
+ return;
+
+iterate:
+ EINA_LIST_FOREACH(comp_wl->seats, l, s)
+ {
+ EINA_LIST_FOREACH(s->touch.resources, ll, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_touch_check(res)) continue;
+
+ wl_touch_send_motion(res, timestamp, idx, wl_fixed_from_int(x), wl_fixed_from_int(y));
+ }
+ }
+}
+
+EINTERN void
+e_seat_touch_send_downup(E_Seat *seat, struct wl_client *wc,
+ struct wl_resource *surface, int idx, int x, int y, uint32_t timestamp,
+ Eina_Bool pressed)
+{
+ Eina_List *l, *ll;
+ struct wl_resource *res;
+ uint32_t serial;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ E_Seat *s;
+
+ serial = wl_display_next_serial(comp_wl->wl.disp);
+
+ if (!seat) goto iterate;
+
+ EINA_LIST_FOREACH(seat->touch.resources, l, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_touch_check(res)) continue;
+
+ TRACE_INPUT_BEGIN(e_seat_touch_send_downup);
+ if (pressed)
+ {
+ ELOGF("Touch", "Down (id: %d, time: %d, x:%d, y:%d)", NULL, idx, timestamp, x, y);
+ wl_touch_send_down(res, serial, timestamp, surface, idx, wl_fixed_from_int(x), wl_fixed_from_int(y));
+ }
+ else
+ {
+ ELOGF("Touch", "Up (id: %d, time: %d, x:%d, y:%d)", NULL, idx, timestamp, x, y);
+ wl_touch_send_up(res, serial, timestamp, idx);
+ }
+ TRACE_INPUT_END();
+ }
+ return;
+
+iterate:
+ EINA_LIST_FOREACH(comp_wl->seats, l, s)
+ {
+ EINA_LIST_FOREACH(s->touch.resources, ll, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_touch_check(res)) continue;
+
+ TRACE_INPUT_BEGIN(e_seat_touch_send_downup);
+ if (pressed)
+ {
+ ELOGF("Touch", "Down (id: %d, time: %d, x:%d, y:%d)", NULL, idx, timestamp, x, y);
+ wl_touch_send_down(res, serial, timestamp, surface, idx, wl_fixed_from_int(x), wl_fixed_from_int(y));
+ }
+ else
+ {
+ ELOGF("Touch", "Up (id: %d, time: %d, x:%d, y:%d)", NULL, idx, timestamp, x, y);
+ wl_touch_send_up(res, serial, timestamp, idx);
+ }
+ TRACE_INPUT_END();
+ }
+ }
+}
+
+EINTERN void
+e_seat_touch_send_cancel(E_Seat *seat, struct wl_client *wc, E_Client *ec)
+{
+ Eina_List *l, *ll;
+ struct wl_resource *res;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ E_Seat *s;
+
+ if (!seat) goto iterate;
+
+ EINA_LIST_FOREACH(seat->touch.resources, l, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_touch_check(res)) continue;
+
+ ELOGF("Touch", "Cancel name:%20s", ec, ec ? e_client_util_name_get(ec) : "Unknown");
+
+ wl_touch_send_cancel(res);
+ }
+ return;
+
+iterate:
+ EINA_LIST_FOREACH(comp_wl->seats, l, s)
+ {
+ EINA_LIST_FOREACH(s->touch.resources, ll, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_touch_check(res)) continue;
+
+ ELOGF("Touch", "Cancel name:%20s", ec, ec ? e_client_util_name_get(ec) : "Unknown");
+
+ wl_touch_send_cancel(res);
+ }
+ }
+}
+
+EINTERN void
+e_seat_touch_send_frame(E_Seat *seat, struct wl_client *wc)
+{
+ Eina_List *l, *ll;
+ struct wl_resource *res;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ E_Seat *s;
+
+ if (!seat) goto iterate;
+
+ EINA_LIST_FOREACH(seat->touch.resources, l, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_touch_check(res)) continue;
+
+ wl_touch_send_frame(res);
+ }
+ return;
+
+iterate:
+ EINA_LIST_FOREACH(comp_wl->seats, l, s)
+ {
+ EINA_LIST_FOREACH(s->touch.resources, ll, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_touch_check(res)) continue;
+ wl_touch_send_frame(res);
+ }
+ }
+}
+
+EINTERN void
+e_seat_touch_enabled_set(E_Seat *seat, Eina_Bool enabled)
+{
+ if (!seat) return;
+
+ seat->touch.enabled = !!enabled;
+ e_seat_update_seat_caps(seat, NULL);
+}
+
+EINTERN Eina_Bool
+e_seat_touch_is_empty(E_Seat *seat)
+{
+ if (!seat) goto iterate;
+
+ if (!eina_list_count(seat->ptr.resources)) return EINA_TRUE;
+
+ return EINA_FALSE;
+
+iterate:
+ Eina_List *l;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ EINA_LIST_FOREACH(comp_wl->seats, l, seat)
+ {
+ if (eina_list_count(seat->touch.resources))
+ return EINA_FALSE;
+ }
+ return EINA_TRUE;
+}
+
+EINTERN void
+e_seat_pointer_send_motion(E_Seat *seat, struct wl_client *wc,
+ int x, int y, uint32_t timestamp)
+{
+ Eina_List *l, *ll;
+ struct wl_resource *res;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ E_Seat *s;
+
+ if (!seat) goto iterate;
+
+ EINA_LIST_FOREACH(seat->ptr.resources, l, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+
+ wl_pointer_send_motion(res, timestamp,
+ wl_fixed_from_int(x),
+ wl_fixed_from_int(y));
+ }
+ return;
+
+iterate:
+ EINA_LIST_FOREACH(comp_wl->seats, l, s)
+ {
+ EINA_LIST_FOREACH(s->ptr.resources, ll, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+
+ wl_pointer_send_motion(res, timestamp,
+ wl_fixed_from_int(x),
+ wl_fixed_from_int(y));
+ }
+ }
+}
+
+EINTERN void
+e_seat_pointer_send_enter(E_Seat *seat, struct wl_client *wc, E_Client *ec,
+ struct wl_resource *surface, int x, int y)
+{
+ Eina_List *l, *ll;
+ struct wl_resource *res;
+ uint32_t serial;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ E_Seat *s;
+
+ serial = wl_display_next_serial(comp_wl->wl.disp);
+
+ if (!seat) goto iterate;
+
+ EINA_LIST_FOREACH(seat->ptr.resources, l, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+
+ wl_pointer_send_enter(res, serial, surface,
+ wl_fixed_from_int(x), wl_fixed_from_int(y));
+
+ if (ec)
+ ec->pointer_enter_sent = EINA_TRUE;
+ }
+ return;
+
+iterate:
+ EINA_LIST_FOREACH(comp_wl->seats, l, s)
+ {
+ EINA_LIST_FOREACH(s->ptr.resources, ll, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+
+ wl_pointer_send_enter(res, serial, surface,
+ wl_fixed_from_int(x), wl_fixed_from_int(y));
+
+ if (ec)
+ ec->pointer_enter_sent = EINA_TRUE;
+ }
+ }
+}
+
+EINTERN void
+e_seat_pointer_send_leave(E_Seat *seat, struct wl_client *wc, E_Client *ec,
+ struct wl_resource *surface)
+{
+ Eina_List *l, *ll;
+ struct wl_resource *res;
+ uint32_t serial;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ E_Seat *s;
+
+ serial = wl_display_next_serial(comp_wl->wl.disp);
+
+ if (!seat) goto iterate;
+
+ EINA_LIST_FOREACH(seat->ptr.resources, l, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+ if (ec && ec->pointer_enter_sent == EINA_FALSE) continue;
+
+ wl_pointer_send_leave(res, serial, surface);
+
+ if (ec)
+ ec->pointer_enter_sent = EINA_FALSE;
+ }
+ return;
+
+iterate:
+ EINA_LIST_FOREACH(comp_wl->seats, l, s)
+ {
+ EINA_LIST_FOREACH(s->ptr.resources, ll, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+ if (ec && ec->pointer_enter_sent == EINA_FALSE) continue;
+
+ wl_pointer_send_leave(res, serial, surface);
+
+ if (ec)
+ ec->pointer_enter_sent = EINA_FALSE;
+ }
+ }
+}
+
+EINTERN void
+e_seat_pointer_send_button(E_Seat *seat, struct wl_client *wc,
+ uint32_t button, uint32_t state, uint32_t timestamp)
+{
+ Eina_List *l, *ll;
+ struct wl_resource *res;
+ uint32_t serial;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ E_Seat *s;
+
+ serial = wl_display_next_serial(comp_wl->wl.disp);
+
+ if (!seat) goto iterate;
+
+ EINA_LIST_FOREACH(seat->ptr.resources, l, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+
+ TRACE_INPUT_BEGIN(e_comp_wl_surface_mouse_button);
+ ELOGF("Mouse", "Button %s (btn: %d, time: %d)", NULL, (state ? "Down" : "Up"), button, timestamp);
+ wl_pointer_send_button(res, serial, timestamp,
+ button, state);
+ TRACE_INPUT_END();
+ }
+ return;
+
+iterate:
+ EINA_LIST_FOREACH(comp_wl->seats, l, s)
+ {
+ EINA_LIST_FOREACH(s->ptr.resources, ll, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+
+ wl_pointer_send_button(res, serial, timestamp,
+ button, state);
+ }
+ }
+}
+
+EINTERN void
+e_seat_pointer_send_axis(E_Seat *seat, struct wl_client *wc,
+ uint32_t axis, uint32_t dir, uint32_t timestamp)
+{
+ Eina_List *l, *ll;
+ struct wl_resource *res;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ E_Seat *s;
+
+ if (!seat) goto iterate;
+
+ EINA_LIST_FOREACH(seat->ptr.resources, l, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+
+ wl_pointer_send_axis(res, timestamp, axis, dir);
+ }
+ return;
+
+iterate:
+ EINA_LIST_FOREACH(comp_wl->seats, l, s)
+ {
+ EINA_LIST_FOREACH(s->ptr.resources, ll, res)
+ {
+ if (wl_resource_get_client(res) != wc) continue;
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+
+ wl_pointer_send_axis(res, timestamp, axis, dir);
+ }
+ }
+}
+
+EINTERN void
+e_seat_pointer_enabled_set(E_Seat *seat, Eina_Bool enabled)
+{
+ if (!seat) return;
+
+ seat->ptr.enabled = !!enabled;
+ e_seat_update_seat_caps(seat, NULL);
+}
+
+EINTERN Eina_Bool
+e_seat_pointer_enabled_get(E_Seat *seat)
+{
+ if (!seat) goto iterate;
+
+ if (seat->ptr.enabled) return EINA_TRUE;
+
+ return EINA_FALSE;
+
+iterate:
+ Eina_List *l;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ EINA_LIST_FOREACH(comp_wl->seats, l, seat)
+ {
+ if (seat->ptr.enabled) return EINA_TRUE;
+ }
+ return EINA_FALSE;
+}
+
+EINTERN Eina_Bool
+e_seat_pointer_is_empty(E_Seat *seat)
+{
+ if (!seat) goto iterate;
+
+ if (!eina_list_count(seat->ptr.resources)) return EINA_TRUE;
+
+ return EINA_FALSE;
+
+iterate:
+ Eina_List *l;
+ E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+ EINA_LIST_FOREACH(comp_wl->seats, l, seat)
+ {
+ if (eina_list_count(seat->ptr.resources))
+ return EINA_FALSE;
+ }
+ return EINA_TRUE;
+}
+
EINTERN void e_seat_init();
EINTERN void e_seat_shutdown();
EINTERN E_Zone *e_seat_zone_get(E_Seat *seat);
+EINTERN E_Seat *e_seat_find(const char *name);
+EINTERN void e_seat_update_seat_caps(E_Seat *seat, struct wl_client *wc);
+
+EINTERN void e_seat_touch_send_motion(E_Seat *seat, struct wl_client *wc,
+ int idx, int x, int y, uint32_t timestamp);
+EINTERN void e_seat_touch_send_downup(E_Seat *seat, struct wl_client *wc,
+ struct wl_resource *surface, int idx, int x, int y, uint32_t timestamp,
+ Eina_Bool pressed);
+EINTERN void e_seat_touch_send_cancel(E_Seat *seat, struct wl_client *wc, E_Client *ec);
+EINTERN void e_seat_touch_send_frame(E_Seat *seat, struct wl_client *wc);
+EINTERN void e_seat_touch_enabled_set(E_Seat *seat, Eina_Bool enabled);
+EINTERN Eina_Bool e_seat_touch_is_empty(E_Seat *seat);
+
+EINTERN void e_seat_pointer_send_motion(E_Seat *seat, struct wl_client *wc,
+ int x, int y, unsigned int timestamp);
+EINTERN void e_seat_pointer_send_enter(E_Seat *seat, struct wl_client *wc, E_Client *ec,
+ struct wl_resource *surface, int x, int y);
+EINTERN void e_seat_pointer_send_leave(E_Seat *seat, struct wl_client *wc, E_Client *ec,
+ struct wl_resource *surface);
+EINTERN void e_seat_pointer_send_button(E_Seat *seat, struct wl_client *wc,
+ uint32_t button, uint32_t state, uint32_t timestamp);
+EINTERN void e_seat_pointer_send_axis(E_Seat *seat, struct wl_client *wc,
+ uint32_t axis, uint32_t dir, uint32_t timestamp);
+EINTERN void e_seat_pointer_enabled_set(E_Seat *seat, Eina_Bool enabled);
+EINTERN Eina_Bool e_seat_pointer_enabled_get(E_Seat *seat);
+EINTERN Eina_Bool e_seat_pointer_is_empty(E_Seat *seat);
#endif // E_SEAT_INTERN_H
#include "e_devicemgr_wl_intern.h"
#include "e_view_client_intern.h"
#include "e_comp_wl_input_thread_intern.h"
+#include "e_seat_intern.h"
#include <tizen-extension-server-protocol.h>
#include <relative-pointer-unstable-v1-server-protocol.h>
static Eina_Bool _e_comp_wl_cursor_timer_control(Evas_Callback_Type type, E_Comp_Wl_Data *comp_wl, E_Client *ec);
static void _e_comp_wl_surface_state_serial_update(E_Client *ec, E_Comp_Wl_Buffer *buffer);
-static void _e_comp_wl_seat_pointer_send_axis(E_Seat *seat, struct wl_client *wc,
- uint32_t axis, uint32_t dir, uint32_t timestamp);
-
-static void _e_comp_wl_seat_touch_send_cancel(E_Seat *seat, struct wl_client *wc, E_Client *ec);
-static void _e_comp_wl_seat_touch_send_frame(E_Seat *seat, struct wl_client *wc);
-
/* local variables */
typedef struct _E_Comp_Wl_Key_Data
{
wc = wl_resource_get_client(surface);
- _e_comp_wl_seat_touch_send_cancel(NULL, wc, ec);
+ e_seat_touch_send_cancel(NULL, wc, ec);
}
static void
wc = wl_resource_get_client(surface);
- e_comp_wl_seat_pointer_send_enter(NULL, wc, ec, surface, cx, cy);
+ e_seat_pointer_send_enter(NULL, wc, ec, surface, cx, cy);
wl_signal_emit(&comp_wl->ptr_constraints.surface_mousein_signal, ec);
}
return;
}
- if (e_comp_wl_input_seat_pointer_is_empty(NULL)) return;
+ if (e_seat_pointer_is_empty(NULL)) return;
wc = wl_resource_get_client(surface);
_e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_MOUSE, ev->timestamp);
- e_comp_wl_seat_pointer_send_enter(NULL, wc, ec, surface, ev->canvas.x - ec->client.x, ev->canvas.y - ec->client.y);
+ e_seat_pointer_send_enter(NULL, wc, ec, surface, ev->canvas.x - ec->client.x, ev->canvas.y - ec->client.y);
wl_signal_emit(&comp_wl->ptr_constraints.surface_mousein_signal, ec);
}
return;
}
- if (e_comp_wl_input_seat_pointer_is_empty(NULL)) return;
+ if (e_seat_pointer_is_empty(NULL)) return;
wc = wl_resource_get_client(surface);
_e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_MOUSE, ev->timestamp);
- e_comp_wl_seat_pointer_send_leave(NULL, wc, ec, surface);
+ e_seat_pointer_send_leave(NULL, wc, ec, surface);
wl_signal_emit(&comp_wl->ptr_constraints.surface_mouseout_signal, ec);
}
x = canvas_x - client_x;
y = canvas_y - client_y;
- e_comp_wl_seat_touch_send_downup(NULL, wc, surface, idx, x, y, timestamp, pressed);
+ e_seat_touch_send_downup(NULL, wc, surface, idx, x, y, timestamp, pressed);
}
static void
x = canvas_x - ec->client.x;
y = canvas_y - ec->client.y;
- e_comp_wl_seat_touch_send_motion(NULL, wc, idx, x, y, timestamp);
+ e_seat_touch_send_motion(NULL, wc, idx, x, y, timestamp);
e_comp_wl_touch_frame_send_ec_set(comp_wl, ec);
}
sx = x - ec->client.x;
sy = y - ec->client.y;
- e_comp_wl_seat_pointer_send_motion(NULL, wc, sx, sy, timestamp);
+ e_seat_pointer_send_motion(NULL, wc, sx, sy, timestamp);
}
static void
dir = wl_fixed_from_int(z);
wc = wl_resource_get_client(surface);
- _e_comp_wl_seat_pointer_send_axis(NULL, wc, axis, dir, timestamp);
+ e_seat_pointer_send_axis(NULL, wc, axis, dir, timestamp);
}
static void
comp_wl = e_comp_wl_get();
- if (e_comp_wl_input_seat_pointer_is_empty(NULL)) return;
+ if (e_seat_pointer_is_empty(NULL)) return;
if (_e_comp_wl_check_cursor_timer_needed(ec))
{
if (!(surface = e_comp_wl_client_surface_get(ec))) return ECORE_CALLBACK_PASS_ON;
wc = wl_resource_get_client(surface);
- _e_comp_wl_seat_touch_send_frame(NULL, wc);
+ e_seat_touch_send_frame(NULL, wc);
e_comp_wl_touch_frame_send_ec_set(comp_wl, NULL);
return ECORE_CALLBACK_PASS_ON;
comp_wl->ptr.button = btn;
wc = wl_resource_get_client(surface);
- e_comp_wl_seat_pointer_send_button(NULL, wc, btn, state, timestamp);
+ e_seat_pointer_send_button(NULL, wc, btn, state, timestamp);
}
EINTERN Eina_Bool
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
if (!surface) return EINA_FALSE;
- if (e_comp_wl_input_seat_pointer_is_empty(NULL)) return EINA_FALSE;
+ if (e_seat_pointer_is_empty(NULL)) return EINA_FALSE;
ELOGF("Mouse", "Button %s (btn: %d, time: %d)", ec, (state ? "Down" : "Up"), button_id, timestamp);
EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(e_object_is_del(E_OBJECT(ec)), EINA_FALSE);
- if (e_comp_wl_input_seat_pointer_is_empty(NULL)) return EINA_FALSE;
+ if (e_seat_pointer_is_empty(NULL)) return EINA_FALSE;
wc = wl_resource_get_client(surface);
serial = wl_display_next_serial(comp_wl->wl.disp);
if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
else _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_MOUSE, time);
- e_comp_wl_seat_pointer_send_enter(NULL, wc, ec, surface, x, y);
+ e_seat_pointer_send_enter(NULL, wc, ec, surface, x, y);
wl_signal_emit(&comp_wl->ptr_constraints.surface_mousein_signal, ec);
return EINA_TRUE;
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(e_object_is_del(E_OBJECT(ec)), EINA_FALSE);
- if (e_comp_wl_input_seat_pointer_is_empty(NULL)) return EINA_FALSE;
+ if (e_seat_pointer_is_empty(NULL)) return EINA_FALSE;
wc = wl_resource_get_client(surface);
serial = wl_display_next_serial(comp_wl->wl.disp);
if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
else _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_MOUSE, time);
- e_comp_wl_seat_pointer_send_leave(NULL, wc, ec, surface);
+ e_seat_pointer_send_leave(NULL, wc, ec, surface);
wl_signal_emit(&comp_wl->ptr_constraints.surface_mouseout_signal, ec);
return EINA_TRUE;
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
wc = wl_resource_get_client(surface);
- e_comp_wl_seat_pointer_send_leave(NULL, wc, ec, surface);
+ e_seat_pointer_send_leave(NULL, wc, ec, surface);
return EINA_TRUE;
}
return comp_wl->ptr.ec;
}
-static void
-_e_comp_wl_seat_touch_send_cancel(E_Seat *seat, struct wl_client *wc, E_Client *ec)
-{
- Eina_List *l, *ll;
- struct wl_resource *res;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- E_Seat *s;
-
- if (!seat) goto iterate;
-
- EINA_LIST_FOREACH(seat->touch.resources, l, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_touch_check(res)) continue;
-
- ELOGF("Touch", "Cancel name:%20s", ec, ec ? e_client_util_name_get(ec) : "Unknown");
-
- wl_touch_send_cancel(res);
- }
- return;
-
-iterate:
- EINA_LIST_FOREACH(comp_wl->seats, l, s)
- {
- EINA_LIST_FOREACH(s->touch.resources, ll, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_touch_check(res)) continue;
-
- ELOGF("Touch", "Cancel name:%20s", ec, ec ? e_client_util_name_get(ec) : "Unknown");
-
- wl_touch_send_cancel(res);
- }
- }
-}
-
-static void
-_e_comp_wl_seat_touch_send_frame(E_Seat *seat, struct wl_client *wc)
-{
- Eina_List *l, *ll;
- struct wl_resource *res;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- E_Seat *s;
-
- if (!seat) goto iterate;
-
- EINA_LIST_FOREACH(seat->touch.resources, l, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_touch_check(res)) continue;
-
- wl_touch_send_frame(res);
- }
- return;
-
-iterate:
- EINA_LIST_FOREACH(comp_wl->seats, l, s)
- {
- EINA_LIST_FOREACH(s->touch.resources, ll, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_touch_check(res)) continue;
- wl_touch_send_frame(res);
- }
- }
-}
-
-EINTERN void
-e_comp_wl_seat_touch_send_downup(E_Seat *seat, struct wl_client *wc,
- struct wl_resource *surface, int idx, int x, int y, uint32_t timestamp,
- Eina_Bool pressed)
-{
- Eina_List *l, *ll;
- struct wl_resource *res;
- uint32_t serial;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- E_Seat *s;
-
- serial = wl_display_next_serial(comp_wl->wl.disp);
-
- if (!seat) goto iterate;
-
- EINA_LIST_FOREACH(seat->touch.resources, l, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_touch_check(res)) continue;
-
- TRACE_INPUT_BEGIN(e_comp_wl_seat_touch_send_downup);
- if(pressed)
- {
- ELOGF("Touch", "Down (id: %d, time: %d, x:%d, y:%d)", NULL, idx, timestamp, x, y);
- wl_touch_send_down(res, serial, timestamp, surface, idx, wl_fixed_from_int(x), wl_fixed_from_int(y));
- }
- else
- {
- ELOGF("Touch", "Up (id: %d, time: %d, x:%d, y:%d)", NULL, idx, timestamp, x, y);
- wl_touch_send_up(res, serial, timestamp, idx);
- }
- TRACE_INPUT_END();
- }
- return;
-
-iterate:
- EINA_LIST_FOREACH(comp_wl->seats, l, s)
- {
- EINA_LIST_FOREACH(s->touch.resources, ll, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_touch_check(res)) continue;
-
- TRACE_INPUT_BEGIN(e_comp_wl_seat_touch_send_downup);
- if (pressed)
- {
- ELOGF("Touch", "Down (id: %d, time: %d, x:%d, y:%d)", NULL, idx, timestamp, x, y);
- wl_touch_send_down(res, serial, timestamp, surface, idx, wl_fixed_from_int(x), wl_fixed_from_int(y));
- }
- else
- {
- ELOGF("Touch", "Up (id: %d, time: %d, x:%d, y:%d)", NULL, idx, timestamp, x, y);
- wl_touch_send_up(res, serial, timestamp, idx);
- }
- TRACE_INPUT_END();
- }
- }
-}
-
-EINTERN void
-e_comp_wl_seat_touch_send_motion(E_Seat *seat, struct wl_client *wc,
- int idx, int x, int y, uint32_t timestamp)
-{
- Eina_List *l, *ll;
- struct wl_resource *res;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- E_Seat *s;
-
- if (!seat) goto iterate;
-
- EINA_LIST_FOREACH(seat->touch.resources, l, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_touch_check(res)) continue;
-
- wl_touch_send_motion(res, timestamp, idx, wl_fixed_from_int(x), wl_fixed_from_int(y));
- }
- return;
-
-iterate:
- EINA_LIST_FOREACH(comp_wl->seats, l, s)
- {
- EINA_LIST_FOREACH(s->touch.resources, ll, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_touch_check(res)) continue;
-
- wl_touch_send_motion(res, timestamp, idx, wl_fixed_from_int(x), wl_fixed_from_int(y));
- }
- }
-}
-
-EINTERN void
-e_comp_wl_seat_pointer_send_enter(E_Seat *seat, struct wl_client *wc, E_Client *ec,
- struct wl_resource *surface, int x, int y)
-{
- Eina_List *l, *ll;
- struct wl_resource *res;
- uint32_t serial;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- E_Seat *s;
-
- serial = wl_display_next_serial(comp_wl->wl.disp);
-
- if (!seat) goto iterate;
-
- EINA_LIST_FOREACH(seat->ptr.resources, l, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_pointer_check(res)) continue;
-
- wl_pointer_send_enter(res, serial, surface,
- wl_fixed_from_int(x), wl_fixed_from_int(y));
-
- if (ec)
- ec->pointer_enter_sent = EINA_TRUE;
- }
- return;
-
-iterate:
- EINA_LIST_FOREACH(comp_wl->seats, l, s)
- {
- EINA_LIST_FOREACH(s->ptr.resources, ll, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_pointer_check(res)) continue;
-
- wl_pointer_send_enter(res, serial, surface,
- wl_fixed_from_int(x), wl_fixed_from_int(y));
-
- if (ec)
- ec->pointer_enter_sent = EINA_TRUE;
- }
- }
-}
-
-EINTERN void
-e_comp_wl_seat_pointer_send_leave(E_Seat *seat, struct wl_client *wc, E_Client *ec,
- struct wl_resource *surface)
-{
- Eina_List *l, *ll;
- struct wl_resource *res;
- uint32_t serial;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- E_Seat *s;
-
- serial = wl_display_next_serial(comp_wl->wl.disp);
-
- if (!seat) goto iterate;
-
- EINA_LIST_FOREACH(seat->ptr.resources, l, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_pointer_check(res)) continue;
- if (ec && ec->pointer_enter_sent == EINA_FALSE) continue;
-
- wl_pointer_send_leave(res, serial, surface);
-
- if (ec)
- ec->pointer_enter_sent = EINA_FALSE;
- }
- return;
-
-iterate:
- EINA_LIST_FOREACH(comp_wl->seats, l, s)
- {
- EINA_LIST_FOREACH(s->ptr.resources, ll, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_pointer_check(res)) continue;
- if (ec && ec->pointer_enter_sent == EINA_FALSE) continue;
-
- wl_pointer_send_leave(res, serial, surface);
-
- if (ec)
- ec->pointer_enter_sent = EINA_FALSE;
- }
- }
-}
-
-EINTERN void
-e_comp_wl_seat_pointer_send_motion(E_Seat *seat, struct wl_client *wc,
- int x, int y, uint32_t timestamp)
-{
- Eina_List *l, *ll;
- struct wl_resource *res;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- E_Seat *s;
-
- if (!seat) goto iterate;
-
- EINA_LIST_FOREACH(seat->ptr.resources, l, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_pointer_check(res)) continue;
-
- wl_pointer_send_motion(res, timestamp,
- wl_fixed_from_int(x),
- wl_fixed_from_int(y));
- }
- return;
-
-iterate:
- EINA_LIST_FOREACH(comp_wl->seats, l, s)
- {
- EINA_LIST_FOREACH(s->ptr.resources, ll, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_pointer_check(res)) continue;
-
- wl_pointer_send_motion(res, timestamp,
- wl_fixed_from_int(x),
- wl_fixed_from_int(y));
- }
- }
-}
-
-EINTERN void
-e_comp_wl_seat_pointer_send_button(E_Seat *seat, struct wl_client *wc,
- uint32_t button, uint32_t state, uint32_t timestamp)
-{
- Eina_List *l, *ll;
- struct wl_resource *res;
- uint32_t serial;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- E_Seat *s;
-
- serial = wl_display_next_serial(comp_wl->wl.disp);
-
- if (!seat) goto iterate;
-
- EINA_LIST_FOREACH(seat->ptr.resources, l, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_pointer_check(res)) continue;
-
- TRACE_INPUT_BEGIN(e_comp_wl_surface_mouse_button);
- ELOGF("Mouse", "Button %s (btn: %d, time: %d)", NULL, (state ? "Down" : "Up"), button, timestamp);
- wl_pointer_send_button(res, serial, timestamp,
- button, state);
- TRACE_INPUT_END();
- }
- return;
-
-iterate:
- EINA_LIST_FOREACH(comp_wl->seats, l, s)
- {
- EINA_LIST_FOREACH(s->ptr.resources, ll, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_pointer_check(res)) continue;
-
- wl_pointer_send_button(res, serial, timestamp,
- button, state);
- }
- }
-}
-
-static void
-_e_comp_wl_seat_pointer_send_axis(E_Seat *seat, struct wl_client *wc,
- uint32_t axis, uint32_t dir, uint32_t timestamp)
-{
- Eina_List *l, *ll;
- struct wl_resource *res;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- E_Seat *s;
-
- if (!seat) goto iterate;
-
- EINA_LIST_FOREACH(seat->ptr.resources, l, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_pointer_check(res)) continue;
-
- wl_pointer_send_axis(res, timestamp, axis, dir);
- }
- return;
-
-iterate:
- EINA_LIST_FOREACH(comp_wl->seats, l, s)
- {
- EINA_LIST_FOREACH(s->ptr.resources, ll, res)
- {
- if (wl_resource_get_client(res) != wc) continue;
- if (!e_comp_wl_input_pointer_check(res)) continue;
-
- wl_pointer_send_axis(res, timestamp, axis, dir);
- }
- }
-}
#include "e_view_intern.h"
#include "e_view_client_intern.h"
#include "e_view_edje_intern.h"
+#include "e_seat_intern.h"
#include <fcntl.h>
#include <unistd.h>
{
wc = wl_resource_get_client(origin_resource);
//TODO: consider multi-seat
- e_comp_wl_seat_pointer_send_leave(NULL, wc, ec, e_comp_wl_client_surface_get(ec));
+ e_seat_pointer_send_leave(NULL, wc, ec, e_comp_wl_client_surface_get(ec));
}
evas_pointer_canvas_xy_get(e_comp_evas_get(), &x, &y);
#include "e_policy_intern.h"
#include "e_keyrouter_intern.h"
#include "e_input_thread_client_intern.h"
+#include "e_seat_intern.h"
#include <sys/mman.h>
#include <fcntl.h>
wl_fixed_t fx,
wl_fixed_t fy);
-static void
-_e_comp_wl_input_update_seat_caps(E_Seat *seat, struct wl_client *wc)
-{
- Eina_List *l;
- struct wl_resource *res;
- enum wl_seat_capability caps = 0;
-
- if (!seat)
- seat = e_comp_wl_input_seat_get("default");
-
- if (seat->ptr.enabled)
- caps |= WL_SEAT_CAPABILITY_POINTER;
- if (e_comp_input_key->kbd.enabled)
- caps |= WL_SEAT_CAPABILITY_KEYBOARD;
- if (seat->touch.enabled)
- caps |= WL_SEAT_CAPABILITY_TOUCH;
-
- EINA_LIST_FOREACH(seat->resources, l, res)
- {
- /* if a wc is null, send seat capability to all wl_seat resources */
- if (wc && (wl_resource_get_client(res) != wc)) continue;
- wl_seat_send_capabilities(res, caps);
- }
-}
-
static void
_e_comp_wl_input_pointer_map(struct wl_resource *resource)
{
seat,
_e_comp_wl_input_cb_unbind_seat);
- _e_comp_wl_input_update_seat_caps(seat, client);
+ e_seat_update_seat_caps(seat, client);
if (seat->version >= WL_SEAT_NAME_SINCE_VERSION)
wl_seat_send_name(res, seat->name);
}
{
E_Seat *seat;
E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- seat = e_comp_wl_input_seat_get(seat_name);
+ seat = e_seat_find(seat_name);
if (seat) return EINA_FALSE;
if (!(seat = E_NEW(E_Seat, 1))) return EINA_FALSE;
e_comp_wl_input_keyboard_modifiers_update();
}
-EINTERN void
-e_comp_wl_input_pointer_enabled_set(E_Seat *seat, Eina_Bool enabled)
-{
- if (!seat) return;
-
- seat->ptr.enabled = !!enabled;
- _e_comp_wl_input_update_seat_caps(seat, NULL);
-}
-
static void
_e_comp_wl_input_thread_cb_keyboard_enabled_set(void *data)
{
}
e_input_backend_thread_safe_call(_e_comp_wl_input_thread_cb_keyboard_enabled_set, &enabled, sizeof(Eina_Bool));
- _e_comp_wl_input_update_seat_caps(NULL, NULL);
+ e_seat_update_seat_caps(NULL, NULL);
}
E_API Eina_Bool
g_rec_mutex_unlock(&e_comp_input_key->xkb.keymap_mutex);
}
-EINTERN void
-e_comp_wl_input_touch_enabled_set(E_Seat *seat, Eina_Bool enabled)
-{
- if (!seat) return;
-
- seat->touch.enabled = !!enabled;
- _e_comp_wl_input_update_seat_caps(seat, NULL);
-}
-
EINTERN void
e_comp_wl_input_seat_caps_set(unsigned int caps)
{
Eina_Bool need_update = EINA_FALSE;
E_Seat *seat;
- seat = e_comp_wl_input_seat_get("default");
+ seat = e_seat_find("default");
if (caps & E_INPUT_SEAT_POINTER)
seat->ptr.enabled = need_update = EINA_TRUE;
seat->touch.enabled = need_update = EINA_TRUE;
if (need_update)
- _e_comp_wl_input_update_seat_caps(seat, NULL);
+ e_seat_update_seat_caps(seat, NULL);
}
EINTERN Eina_Bool
EINA_SAFETY_ON_NULL_RETURN(e_comp_input_key);
g_rec_mutex_unlock(&e_comp_input_key->kbd.resources_mutex);
}
-
-EINTERN E_Seat *
-e_comp_wl_input_seat_get(const char *name)
-{
- Eina_List *l;
- E_Seat *seat;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
-
- EINA_LIST_FOREACH(comp_wl->seats, l, seat)
- {
- if (seat->name && !strcmp(seat->name, name))
- return seat;
- }
-
- return NULL;
-}
-
-EINTERN Eina_Bool
-e_comp_wl_input_seat_pointer_is_empty(E_Seat *seat)
-{
- if (!seat) goto iterate;
-
- if (!eina_list_count(seat->ptr.resources)) return EINA_TRUE;
-
- return EINA_FALSE;
-
-iterate:
- Eina_List *l;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- EINA_LIST_FOREACH(comp_wl->seats, l, seat)
- {
- if (eina_list_count(seat->ptr.resources))
- return EINA_FALSE;
- }
- return EINA_TRUE;
-}
-
-EINTERN Eina_Bool
-e_comp_wl_input_seat_touch_is_empty(E_Seat *seat)
-{
- if (!seat) goto iterate;
-
- if (!eina_list_count(seat->ptr.resources)) return EINA_TRUE;
-
- return EINA_FALSE;
-
-iterate:
- Eina_List *l;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- EINA_LIST_FOREACH(comp_wl->seats, l, seat)
- {
- if (eina_list_count(seat->touch.resources))
- return EINA_FALSE;
- }
- return EINA_TRUE;
-}
-
-EINTERN Eina_Bool
-e_comp_wl_input_seat_pointer_enabled_get(E_Seat *seat)
-{
- if (!seat) goto iterate;
-
- if (seat->ptr.enabled) return EINA_TRUE;
-
- return EINA_FALSE;
-
-iterate:
- Eina_List *l;
- E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
- EINA_LIST_FOREACH(comp_wl->seats, l, seat)
- {
- if (seat->ptr.enabled) return EINA_TRUE;
- }
- return EINA_FALSE;
-}
EINTERN Eina_Bool e_comp_wl_input_relative_pointer_check(struct wl_resource *res);
EINTERN Eina_Bool e_comp_wl_input_pointer_check(struct wl_resource *res);
-EINTERN void e_comp_wl_input_pointer_enabled_set(E_Seat *seat, Eina_Bool enabled);
EINTERN Eina_Bool e_comp_wl_input_touch_check(struct wl_resource *res);
-EINTERN void e_comp_wl_input_touch_enabled_set(E_Seat *seat, Eina_Bool enabled);
EINTERN Eina_Bool e_comp_wl_input_keyboard_check(struct wl_resource *res);
EINTERN Eina_Bool e_comp_wl_input_keyboard_modifiers_serialize(void);
EINTERN void e_comp_wl_input_keymap_init(void);
-EINTERN E_Seat *e_comp_wl_input_seat_get(const char *name);
-EINTERN Eina_Bool e_comp_wl_input_seat_pointer_is_empty(E_Seat *seat);
-EINTERN Eina_Bool e_comp_wl_input_seat_touch_is_empty(E_Seat *seat);
-EINTERN Eina_Bool e_comp_wl_input_seat_pointer_enabled_get(E_Seat *seat);
-
#endif
#include "e_input_thread_client.h"
#include "e_pointer_intern.h"
#include "e_input_backend_intern.h"
+#include "e_seat_intern.h"
#include <tizen-extension-server-protocol.h>
NULL, timestamp, x, y, x, y,
e_input_thread_client_util_name_get(iec));
- if (e_comp_wl_input_seat_pointer_is_empty(NULL)) return;
+ if (e_seat_pointer_is_empty(NULL)) return;
wc = wl_resource_get_client(surface);
- e_comp_wl_seat_pointer_send_enter(seat, wc, NULL, surface, x - client_x, y - client_y);
+ e_seat_pointer_send_enter(seat, wc, NULL, surface, x - client_x, y - client_y);
e_input_thread_client_pointer_enter_sent_set(iec, EINA_TRUE);
}
NULL, timestamp,
e_input_thread_client_util_name_get(iec));
- if (e_comp_wl_input_seat_pointer_is_empty(NULL)) return;
+ if (e_seat_pointer_is_empty(NULL)) return;
wc = wl_resource_get_client(surface);
- e_comp_wl_seat_pointer_send_leave(seat, wc, NULL, surface);
+ e_seat_pointer_send_leave(seat, wc, NULL, surface);
e_input_thread_client_pointer_enter_sent_set(iec, EINA_FALSE);
}
dev_name = e_device_name_get(dev);
dev_class = e_device_class_get(dev);
seat_name = e_device_seatname_get(dev);
- seat = e_comp_wl_input_seat_get(seat_name);
+ seat = e_seat_find(seat_name);
if (comp_conf && comp_conf->input_log_enable)
ELOGF("Mouse", "Move (time: %d, x:%d, y:%d), (name:%20s) (dev:%s, class:%d, seat:%s)",
_e_comp_wl_device_input_thread_send_event_device(iec, dev, ev->timestamp);
wc = wl_resource_get_client(surface);
- e_comp_wl_seat_touch_send_motion(seat, wc, 0, ev->x - client_x, ev->y - client_y, ev->timestamp);
+ e_seat_touch_send_motion(seat, wc, 0, ev->x - client_x, ev->y - client_y, ev->timestamp);
}
}
_e_comp_wl_device_input_thread_send_event_device(iec, dev, ev->timestamp);
wc = wl_resource_get_client(surface);
- e_comp_wl_seat_pointer_send_motion(seat, wc, ev->x - client_x, ev->y - client_y, ev->timestamp);
+ e_seat_pointer_send_motion(seat, wc, ev->x - client_x, ev->y - client_y, ev->timestamp);
}
e_pointer_mouse_move(e_comp_pointer_get(), ev->x, ev->y);
dev_name = e_device_name_get(dev);
dev_class = e_device_class_get(dev);
seat_name = e_device_seatname_get(dev);
- seat = e_comp_wl_input_seat_get(seat_name);
+ seat = e_seat_find(seat_name);
ELOGF("Mouse", "Down (button: %d, time: %d, x:%d, y:%d) (name:%20s) (dev:%s, class:%d, seat:%s)",
NULL, ev->buttons, ev->timestamp, ev->x, ev->y,
comp_wl->ptr.button = BTN_LEFT;
wc = wl_resource_get_client(surface);
- e_comp_wl_seat_touch_send_downup(seat, wc, surface, 0, ev->x - client_x, ev->y - client_y, ev->timestamp, EINA_TRUE);
+ e_seat_touch_send_downup(seat, wc, surface, 0, ev->x - client_x, ev->y - client_y, ev->timestamp, EINA_TRUE);
e_pointer_touch_move(e_comp_pointer_get(), ev->x, ev->y);
btn = _e_comp_wl_input_thread_button_convert(ev->buttons);
comp_wl->ptr.button = btn;
wc = wl_resource_get_client(surface);
- e_comp_wl_seat_pointer_send_button(seat, wc, btn, WL_POINTER_BUTTON_STATE_PRESSED, ev->timestamp);
+ e_seat_pointer_send_button(seat, wc, btn, WL_POINTER_BUTTON_STATE_PRESSED, ev->timestamp);
e_pointer_mouse_move(e_comp_pointer_get(), ev->x, ev->y);
}
dev_name = e_device_name_get(dev);
dev_class = e_device_class_get(dev);
seat_name = e_device_seatname_get(dev);
- seat = e_comp_wl_input_seat_get(seat_name);
+ seat = e_seat_find(seat_name);
comp_wl = e_comp_wl_get();
if (dev && (dev_class == ECORE_DEVICE_CLASS_TOUCH))
surface, 0, ev->x, ev->y, ev->multi.pressure, ev->multi.angle);
comp_wl->ptr.button = BTN_LEFT;
wc = wl_resource_get_client(surface);
- e_comp_wl_seat_touch_send_downup(seat, wc, surface, 0, ev->x - client_x, ev->y - client_y, ev->timestamp, EINA_FALSE);
+ e_seat_touch_send_downup(seat, wc, surface, 0, ev->x - client_x, ev->y - client_y, ev->timestamp, EINA_FALSE);
}
else
{
btn = _e_comp_wl_input_thread_button_convert(ev->buttons);
comp_wl->ptr.button = btn;
wc = wl_resource_get_client(surface);
- e_comp_wl_seat_pointer_send_button(seat, wc, btn, WL_POINTER_BUTTON_STATE_RELEASED, ev->timestamp);
+ e_seat_pointer_send_button(seat, wc, btn, WL_POINTER_BUTTON_STATE_RELEASED, ev->timestamp);
}
comp_wl = e_comp_wl_get();
- if (e_comp_wl_input_seat_pointer_is_empty(NULL)) return ECORE_CALLBACK_RENEW;
+ if (e_seat_pointer_is_empty(NULL)) return ECORE_CALLBACK_RENEW;
if (e_input_backend_mouse_printing_needed())
e_input_backend_mouse_timestamp_append(ev->timestamp);
EINTERN E_Devicemgr_Input_Device *e_comp_wl_device_last_device_get(Ecore_Device_Class dev_class);
EINTERN void e_comp_wl_device_last_device_set(Ecore_Device_Class dev_class, E_Devicemgr_Input_Device *device);
-EINTERN void e_comp_wl_seat_touch_send_motion(E_Seat *seat, struct wl_client *wc,
- int idx, int x, int y, uint32_t timestamp);
-EINTERN void e_comp_wl_seat_touch_send_downup(E_Seat *seat, struct wl_client *wc,
- struct wl_resource *surface, int idx, int x, int y, uint32_t timestamp,
- Eina_Bool pressed);
-
-EINTERN void e_comp_wl_seat_pointer_send_motion(E_Seat *seat, struct wl_client *wc,
- int x, int y, unsigned int timestamp);
-EINTERN void e_comp_wl_seat_pointer_send_enter(E_Seat *seat, struct wl_client *wc, E_Client *ec,
- struct wl_resource *surface, int x, int y);
-EINTERN void e_comp_wl_seat_pointer_send_leave(E_Seat *seat, struct wl_client *wc, E_Client *ec,
- struct wl_resource *surface);
-EINTERN void e_comp_wl_seat_pointer_send_button(E_Seat *seat, struct wl_client *wc,
- uint32_t button, uint32_t state, uint32_t timestamp);
#endif
#include "e_privilege_intern.h"
#include "e_security.h"
#include "e_input_log.h"
+#include "e_seat_intern.h"
#include <tizen-extension-server-protocol.h>
E_Comp_Wl_Data *comp_wl;
E_Seat *seat;
- seat = e_comp_wl_input_seat_get(dev->seat_name);
+ seat = e_seat_find(dev->seat_name);
if (!seat)
{
DMERR("Could not find seat by seat_name(%s)", dev->seat_name);
g_rec_mutex_lock(&e_devicemgr->device_list_mutex);
EINA_LIST_FOREACH(e_devicemgr->device_list, ll, dev)
{
- seat = e_comp_wl_input_seat_get(dev->seat_name);
+ seat = e_seat_find(dev->seat_name);
if (!seat)
{
DMWRN("Could not find seat by seat_name(%s)", dev->seat_name);
#include "e_view_client_intern.h"
#include "e_output_intern.h"
#include "e_canvas_intern.h"
+#include "e_seat_intern.h"
/* local variables */
static Eina_List *_ptrs = NULL;
EINA_SAFETY_ON_NULL_RETURN(ptr);
/* don't show cursor if in hidden mode */
- if ((!e_config->show_cursor) || (!e_comp_wl_input_seat_pointer_enabled_get(NULL)))
+ if ((!e_config->show_cursor) || (!e_seat_pointer_enabled_get(NULL)))
{
if (ptr->view_client && _e_pointer_view_hide(ptr, ptr->view_client))
_e_pointer_hook_call(E_POINTER_HOOK_HIDE, ptr);