devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b764978f29d86a3e42eac1de3e438e0932b4331f

commit b764978f29d86a3e42eac1de3e438e0932b4331f
Author: Chris Michael <cpmich...@osg.samsung.com>
Date:   Wed Apr 6 10:26:46 2016 -0400

    elput: Create and raise event when seat capabilities change
    
    Signed-off-by: Chris Michael <cpmich...@osg.samsung.com>
---
 src/lib/elput/Elput.h        | 11 +++++++++++
 src/lib/elput/elput.c        |  6 ++++++
 src/lib/elput/elput_evdev.c  | 18 +++++++++++++++++-
 src/lib/elput/elput_logind.c | 21 ++++++++++++---------
 4 files changed, 46 insertions(+), 10 deletions(-)

diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index f6ad5d2..90cfe77 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -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
diff --git a/src/lib/elput/elput.c b/src/lib/elput/elput.c
index 1b5613f..ef2ca6b 100644
--- a/src/lib/elput/elput.c
+++ b/src/lib/elput/elput.c
@@ -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;
 
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index 4c34738..a0dc07e 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -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;
diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c
index c89ca2a..e829b4a 100644
--- a/src/lib/elput/elput_logind.c
+++ b/src/lib/elput/elput_logind.c
@@ -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); */
+          }
      }
 }
 

-- 


Reply via email to