discomfitor pushed a commit to branch master.

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

commit b09c6f1f3e849da59497bedff1a37f3cb45e873b
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri May 26 16:34:10 2017 -0400

    elput: start elput_device_ and elput_seat_ namespaces, rename some functions
---
 src/lib/ecore_drm2/ecore_drm2_device.c |  4 +-
 src/lib/elput/Elput.h                  | 78 +++++++++++++++++++++++-----------
 src/lib/elput/elput_input.c            | 46 +++++++++++++-------
 3 files changed, 85 insertions(+), 43 deletions(-)

diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c 
b/src/lib/ecore_drm2/ecore_drm2_device.c
index f225ad8129..c61afcdb3c 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -47,7 +47,7 @@ _cb_device_change(void *data, int type EINA_UNUSED, void 
*event)
         Ecore_Drm2_Output *output;
         Eina_Stringshare *name;
 
-        name = elput_input_device_output_name_get(ev->device);
+        name = elput_device_output_name_get(ev->device);
         if (!name)
           {
              output = eina_list_data_get(device->outputs);
@@ -67,8 +67,6 @@ _cb_device_change(void *data, int type EINA_UNUSED, void 
*event)
                        break;
                     }
                }
-
-             eina_stringshare_del(name);
           }
      }
 
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index eefcd7b340..df33b60d55 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -342,18 +342,6 @@ EAPI void elput_input_pointer_xy_set(Elput_Manager 
*manager, const char *seat, i
 EAPI Eina_Bool elput_input_pointer_left_handed_set(Elput_Manager *manager, 
const char *seat, Eina_Bool left);
 
 /**
- * Get the list of devices on a given seat
- *
- * @param seat
- *
- * @return An Eina_List of existing Elput_Devices on a given seat or NULL on 
failure
- *
- * @ingroup Elput_Input_Group
- * @since 1.18
- */
-EAPI const Eina_List *elput_input_devices_get(Elput_Seat *seat);
-
-/**
  * Set the maximum position of any existing mouse pointers
  *
  * @param manager
@@ -430,18 +418,6 @@ EAPI void elput_input_keyboard_info_set(Elput_Manager 
*manager, void *context, v
 EAPI void elput_input_keyboard_group_set(Elput_Manager *manager, int group);
 
 /**
- * Return the output name associated with a given device
- *
- * @param device
- *
- * @return An Eina_Stringshare of the output name for this device, or NULL on 
error
- *
- * @ingroup Elput_Input_Group
- * @since 1.18
- */
-EAPI Eina_Stringshare *elput_input_device_output_name_get(Elput_Device 
*device);
-
-/**
  * Set the pointer acceleration profile
  *
  * @param manager
@@ -618,6 +594,60 @@ EAPI Eina_Bool elput_touch_tap_enabled_set(Elput_Device 
*device, Eina_Bool enabl
  */
 EAPI Eina_Bool elput_touch_tap_enabled_get(Elput_Device *device);
 
+
+/**
+ * @defgroup Elput_Device_Group Elput device functions
+ *
+ * Functions for getting attributes of devices
+ */
+ 
+/**
+ * Get the seat object for a device
+ * @param dev
+ * @return The seat
+ * @ingroup Elput_Device_Group
+ * @since 1.20
+ */
+EAPI Elput_Seat *elput_device_seat_get(const Elput_Device *dev);
+
+/**
+ * Get the caps for a device
+ * @param dev
+ * @return The caps, 0 on failure
+ * @ingroup Elput_Device_Group
+ * @since 1.20
+ */
+EAPI Elput_Device_Caps elput_device_caps_get(const Elput_Device *dev);
+
+/**
+ * Return the output name associated with a given device
+ *
+ * @param device
+ *
+ * @return An Eina_Stringshare of the output name for this device, or NULL on 
error
+ *
+ * @ingroup Elput_Device_Group
+ * @since 1.20
+ */
+EAPI Eina_Stringshare *elput_device_output_name_get(Elput_Device *device);
+
+/**
+ * @defgroup Elput_Seat_Group Elput seat functions
+ *
+ * Functions for getting attributes of seats
+ */
+ 
+/**
+ * Get the list of devices on a given seat
+ *
+ * @param seat
+ *
+ * @return An immutable list of existing Elput_Devices on a given seat or NULL 
on failure
+ *
+ * @ingroup Elput_Seat_Group
+ * @since 1.20
+ */
+EAPI const Eina_List *elput_seat_devices_get(const Elput_Seat *seat);
 # endif
 
 # undef EAPI
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index ec38413bc9..00308e6a8e 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -552,13 +552,6 @@ elput_input_pointer_left_handed_set(Elput_Manager 
*manager, const char *seat, Ei
    return EINA_TRUE;
 }
 
-EAPI const Eina_List *
-elput_input_devices_get(Elput_Seat *seat)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
-   return seat->devices;
-}
-
 EAPI void
 elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh)
 {
@@ -687,15 +680,6 @@ elput_input_keyboard_group_set(Elput_Manager *manager, int 
group)
      _keyboard_group_update(seat);
 }
 
-EAPI Eina_Stringshare *
-elput_input_device_output_name_get(Elput_Device *device)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL);
-
-   if (!device->output_name) return NULL;
-   return eina_stringshare_ref(device->output_name);
-}
-
 EAPI void
 elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char 
*seat, uint32_t profile)
 {
@@ -730,3 +714,33 @@ elput_input_pointer_accel_profile_set(Elput_Manager 
*manager, const char *seat,
           }
      }
 }
+
+EAPI Elput_Seat *
+elput_device_seat_get(const Elput_Device *dev)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL);
+   return dev->seat;
+}
+
+EAPI Elput_Device_Caps
+elput_device_caps_get(const Elput_Device *dev)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(dev, 0);
+   return dev->caps;
+}
+
+EAPI Eina_Stringshare *
+elput_device_output_name_get(Elput_Device *device)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL);
+
+   return device->output_name;
+}
+
+EAPI const Eina_List *
+elput_seat_devices_get(const Elput_Seat *seat)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
+   return seat->devices;
+}
+

-- 


Reply via email to