elput: Create and raise event when seat capabilities change

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This commit is contained in:
Chris Michael 2016-04-06 10:26:46 -04:00
parent 3070c4cf08
commit b764978f29
4 changed files with 46 additions and 10 deletions

View File

@ -43,6 +43,17 @@ typedef struct _Elput_Pointer Elput_Pointer;
/* opaque structure to represent a touch device */
typedef struct _Elput_Touch Elput_Touch;
/* structure to represent event for seat capability changes */
typedef struct _Elput_Event_Seat_Caps
{
int pointer_count;
int keyboard_count;
int touch_count;
Elput_Seat *seat;
} Elput_Event_Seat_Caps;
EAPI extern int ELPUT_EVENT_SEAT_CAPS;
/**
* @file
* @brief Ecore functions for dealing with libinput

View File

@ -6,6 +6,8 @@ static int _elput_init_count = 0;
/* external variables */
int _elput_log_dom = -1;
EAPI int ELPUT_EVENT_SEAT_CAPS = -1;
EAPI int
elput_init(void)
{
@ -23,6 +25,8 @@ elput_init(void)
goto log_err;
}
ELPUT_EVENT_SEAT_CAPS = ecore_event_type_new();
return _elput_init_count;
log_err:
@ -43,6 +47,8 @@ elput_shutdown(void)
if (_elput_init_count < 1) return 0;
if (--_elput_init_count != 0) return _elput_init_count;
ELPUT_EVENT_SEAT_CAPS = -1;
eina_log_domain_unregister(_elput_log_dom);
_elput_log_dom = -1;

View File

@ -3,7 +3,17 @@
static void
_seat_caps_update(Elput_Seat *seat)
{
/* TODO: raise event for seat caps */
Elput_Event_Seat_Caps *ev;
ev = calloc(1, sizeof(Elput_Event_Seat_Caps));
if (!ev) return;
ev->pointer_count = seat->count.ptr;
ev->keyboard_count = seat->count.kbd;
ev->touch_count = seat->count.touch;
ev->seat = seat;
ecore_event_add(ELPUT_EVENT_SEAT_CAPS, ev, NULL, NULL);
}
static int
@ -360,7 +370,13 @@ _evdev_event_process(struct libinput_event *event)
if (frame)
{
Elput_Device *edev;
edev = libinput_device_get_user_data(idev);
if (edev)
{
/* TODO: send seat frame event ?? */
}
}
return ret;

View File

@ -78,9 +78,10 @@ _cb_device_paused(void *data, const Eldbus_Message *msg)
if (!strcmp(type, "pause"))
_logind_device_pause_complete(em, maj, min);
/* TODO */
/* if ((em->sync) && (maj == DRM_MAJOR)) */
/* _ecore_drm2_launcher_activate_send(em, EINA_FALSE); */
if ((em->sync) && (maj == 226)) // DRM_MAJOR
{
/* TODO: _ecore_drm2_launcher_activate_send(em, EINA_FALSE); */
}
}
}
@ -102,9 +103,10 @@ _cb_device_resumed(void *data, const Eldbus_Message *msg)
if (eldbus_message_arguments_get(msg, "uuh", &maj, &min, &fd))
{
/* TODO */
/* if ((em->sync) && (maj == DRM_MAJOR)) */
/* _ecore_drm2_launcher_activate_send(em, EINA_TRUE); */
if ((em->sync) && (maj == 226)) // DRM_MAJOR
{
/* TODO: _ecore_drm2_launcher_activate_send(em, EINA_TRUE); */
}
}
}
@ -123,9 +125,10 @@ _cb_property_changed(void *data, Eldbus_Proxy *proxy EINA_UNUSED, void *event)
if (!strcmp(ev->name, "Active"))
{
eina_value_get(ev->value, &active);
/* TODO */
/* if ((!em->sync) || (!active)) */
/* _ecore_drm2_launcher_activate_send(em, active); */
if ((!em->sync) || (!active))
{
/* TODO: _ecore_drm2_launcher_activate_send(em, active); */
}
}
}