if (e->clas == ECORE_DEVICE_CLASS_MOUSE)
{
- if (seat->ptr.num_devices == 0)
+ if (e_seat_pointer_device_count(seat) == 0)
{
e_pointer_view_set(comp->pointer, NULL, 0, 0);
e_seat_pointer_enabled_set(seat, EINA_TRUE);
}
- seat->ptr.num_devices++;
+
+ e_seat_pointer_device_count_increase(seat);
}
else if (e->clas == ECORE_DEVICE_CLASS_KEYBOARD)
{
e_seat_touch_enabled_set(seat, EINA_TRUE);
if (comp_screen)
_e_comp_screen_input_rotation_set(comp_screen->rotation);
- seat->touch.num_devices++;
+ e_seat_touch_device_count_increase(seat);
}
end:
E_Comp_Wl_Data *comp_wl;
comp_wl = e_comp_wl_get();
- if ((seat->ptr.num_devices == 0) && comp_wl->ptr.ec && comp_wl->ptr.ec->pointer_enter_sent)
+ if ((e_seat_pointer_device_count(seat) == 0) && comp_wl->ptr.ec && comp_wl->ptr.ec->pointer_enter_sent)
{
if (e_devicemgr->last_device_ptr)
{
if (e->clas == ECORE_DEVICE_CLASS_MOUSE)
{
- seat->ptr.num_devices--;
- if (seat->ptr.num_devices == 0)
+ e_seat_pointer_device_count_decrease(seat);
+ if (e_seat_pointer_device_count(seat) == 0)
{
e_seat_pointer_enabled_set(seat, EINA_FALSE);
e_pointer_view_set(comp->pointer, NULL, 0, 0);
}
else if (e->clas == ECORE_DEVICE_CLASS_TOUCH)
{
- seat->touch.num_devices--;
- if (seat->touch.num_devices == 0)
+ e_seat_touch_device_count_decrease(seat);
+ if (e_seat_touch_device_count(seat) == 0)
{
e_seat_touch_enabled_set(seat, EINA_FALSE);
}
#include "e_policy_intern.h"
#include "e_utils_intern.h"
+struct _E_Seat
+{
+ struct wl_global *global;
+ Eina_List *resources;
+ uint32_t version;
+ char *name;
+ struct
+ {
+ Eina_List *resources;
+ Eina_Bool enabled : 1;
+ unsigned int num_devices;
+ } ptr;
+
+ struct
+ {
+ Eina_List *resources;
+ Eina_Bool enabled : 1;
+ unsigned int num_devices;
+ } touch;
+
+ E_Zone *zone;
+};
+
static Eina_List *_ecore_event_handlers = NULL;
static Eina_List *_seats = NULL;
if (!seat)
seat = e_seat_find("default");
+ EINA_SAFETY_ON_NULL_RETURN(seat);
+
if (seat->ptr.enabled)
caps |= WL_SEAT_CAPABILITY_POINTER;
if (e_comp_input_key->kbd.enabled)
&_e_touch_interface);
}
+EINTERN unsigned int
+e_seat_touch_device_count(E_Seat *seat)
+{
+ return seat->touch.num_devices;
+}
+
+EINTERN void
+e_seat_touch_device_count_increase(E_Seat *seat)
+{
+ seat->touch.num_devices++;
+}
+
+EINTERN void
+e_seat_touch_device_count_decrease(E_Seat *seat)
+{
+ seat->touch.num_devices--;
+}
+
+EINTERN Eina_List *
+e_seat_touch_resources_get(E_Seat *seat)
+{
+ return seat->touch.resources;
+}
+
EINTERN void
e_seat_pointer_send_motion(E_Seat *seat, struct wl_client *wc,
int x, int y, uint32_t timestamp)
&_e_pointer_interface);
}
+EINTERN unsigned int
+e_seat_pointer_device_count(E_Seat *seat)
+{
+ return seat->ptr.num_devices;
+}
+
+EINTERN void
+e_seat_pointer_device_count_increase(E_Seat *seat)
+{
+ seat->ptr.num_devices++;
+}
+
+EINTERN void
+e_seat_pointer_device_count_decrease(E_Seat *seat)
+{
+ seat->ptr.num_devices--;
+}
+
EINTERN Eina_Bool
e_seat_keyboard_check(struct wl_resource *res)
{
e_seat_destroy(seat);
}
}
+
+EINTERN Eina_List *
+e_seat_resources_get(E_Seat *seat)
+{
+ return seat->resources;
+}
#include "e_intern.h"
typedef struct _E_Seat_Event_Info E_Seat_Event_Info;
+typedef struct _E_Seat E_Seat;
struct _E_Seat_Event_Info
{
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 Eina_Bool e_seat_touch_check(struct wl_resource *res);
+EINTERN unsigned int e_seat_touch_device_count(E_Seat *seat);
+EINTERN void e_seat_touch_device_count_increase(E_Seat *seat);
+EINTERN void e_seat_touch_device_count_decrease(E_Seat *seat);
+EINTERN Eina_List *e_seat_touch_resources_get(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 Eina_Bool e_seat_pointer_enabled_get(E_Seat *seat);
EINTERN Eina_Bool e_seat_pointer_is_empty(E_Seat *seat);
EINTERN Eina_Bool e_seat_pointer_check(struct wl_resource *res);
+EINTERN unsigned int e_seat_pointer_device_count(E_Seat *seat);
+EINTERN void e_seat_pointer_device_count_increase(E_Seat *seat);
+EINTERN void e_seat_pointer_device_count_decrease(E_Seat *seat);
EINTERN Eina_Bool e_seat_keyboard_check(struct wl_resource *res);
+EINTERN Eina_List *e_seat_resources_get(E_Seat *seat);
+
#endif // E_SEAT_INTERN_H
seat = e_seat_find("default");
if (caps & E_INPUT_SEAT_POINTER)
- seat->ptr.enabled = need_update = EINA_TRUE;
+ {
+ need_update = EINA_TRUE;
+ e_seat_pointer_enabled_set(seat, need_update);
+ }
+
if (caps & E_INPUT_SEAT_KEYBOARD)
e_comp_input_key->kbd.enabled = need_update = EINA_TRUE;
+
if (caps & E_INPUT_SEAT_TOUCH)
- seat->touch.enabled = need_update = EINA_TRUE;
+ {
+ need_update = EINA_TRUE;
+ e_seat_touch_enabled_set(seat, need_update);
+ }
if (need_update)
e_seat_update_seat_caps(seat, NULL);
#include "e_intern.h"
#include "e_comp_wl_input.h"
+#include "e_seat_intern.h"
EINTERN Eina_Bool e_comp_wl_input_init(void);
EINTERN void e_comp_wl_input_shutdown(void);
#include "e_policy_wl.h"
#include "e_device_intern.h"
#include "e_compositor_intern.h"
+#include "e_seat_intern.h"
#include <pixman.h>
serial = wl_display_next_serial(comp_wl->wl.disp);
wl_array_init(&axes);
- EINA_LIST_FOREACH(seat->resources, l, seat_res)
+ EINA_LIST_FOREACH(e_seat_resources_get(seat), l, seat_res)
{
wc = wl_resource_get_client(seat_res);
Eina_List *lll;
EINA_LIST_FOREACH(e_seat_list_get(), lll, seat)
{
- EINA_LIST_FOREACH(seat->resources, l, seat_resource)
+ EINA_LIST_FOREACH(e_seat_resources_get(seat), l, seat_resource)
{
wc = wl_resource_get_client(seat_resource);
Eina_List *lll;
EINA_LIST_FOREACH(e_seat_list_get(), lll, seat)
{
- EINA_LIST_FOREACH(seat->resources, l, seat_res)
+ EINA_LIST_FOREACH(e_seat_resources_get(seat), l, seat_res)
{
if (wl_resource_get_client(seat_res) != client) continue;
wc = wl_resource_get_client(volume_cdata->surface);
EINA_LIST_FOREACH(e_seat_list_get(), l, seat)
{
- EINA_LIST_FOREACH(seat->touch.resources, ll, res)
+ EINA_LIST_FOREACH(e_seat_touch_resources_get(seat), ll, res)
{
if (wl_resource_get_client(res) != wc) continue;
typedef struct _E_Comp_Wl_Output E_Comp_Wl_Output;
typedef struct _E_Comp_Wl_Intercept_Hook E_Comp_Wl_Intercept_Hook;
typedef struct _E_Comp_Wl_Pointer_Constraint E_Comp_Wl_Pointer_Constraint;
-typedef struct _E_Seat E_Seat;
typedef enum _E_Comp_Wl_Buffer_Type
{
void *data;
};
-struct _E_Seat
-{
- struct wl_global *global;
- Eina_List *resources;
- uint32_t version;
- char *name;
- struct
- {
- Eina_List *resources;
- Eina_Bool enabled : 1;
- unsigned int num_devices;
- } ptr;
-
- struct
- {
- Eina_List *resources;
- Eina_Bool enabled : 1;
- unsigned int num_devices;
- } touch;
-
- E_Zone *zone;
-};
-
struct _E_Comp_Wl_Hook
{
EINA_INLIST;