summaryrefslogtreecommitdiff
path: root/src/lib/elput
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elput')
-rw-r--r--src/lib/elput/Elput.h78
-rw-r--r--src/lib/elput/elput_input.c46
2 files changed, 84 insertions, 40 deletions
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;
+}
+