summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-05-26 16:34:10 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-05-26 16:27:43 -0400
commitb09c6f1f3e849da59497bedff1a37f3cb45e873b (patch)
treef6e1e798fcf823e07db6a689d9c39544eceea99a
parente34088d74e22ddc4bd41dcbd52db07015a29f9e0 (diff)
elput: start elput_device_ and elput_seat_ namespaces, rename some functions
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c4
-rw-r--r--src/lib/elput/Elput.h78
-rw-r--r--src/lib/elput/elput_input.c46
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)
47 Ecore_Drm2_Output *output; 47 Ecore_Drm2_Output *output;
48 Eina_Stringshare *name; 48 Eina_Stringshare *name;
49 49
50 name = elput_input_device_output_name_get(ev->device); 50 name = elput_device_output_name_get(ev->device);
51 if (!name) 51 if (!name)
52 { 52 {
53 output = eina_list_data_get(device->outputs); 53 output = eina_list_data_get(device->outputs);
@@ -67,8 +67,6 @@ _cb_device_change(void *data, int type EINA_UNUSED, void *event)
67 break; 67 break;
68 } 68 }
69 } 69 }
70
71 eina_stringshare_del(name);
72 } 70 }
73 } 71 }
74 72
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
342EAPI Eina_Bool elput_input_pointer_left_handed_set(Elput_Manager *manager, const char *seat, Eina_Bool left); 342EAPI Eina_Bool elput_input_pointer_left_handed_set(Elput_Manager *manager, const char *seat, Eina_Bool left);
343 343
344/** 344/**
345 * Get the list of devices on a given seat
346 *
347 * @param seat
348 *
349 * @return An Eina_List of existing Elput_Devices on a given seat or NULL on failure
350 *
351 * @ingroup Elput_Input_Group
352 * @since 1.18
353 */
354EAPI const Eina_List *elput_input_devices_get(Elput_Seat *seat);
355
356/**
357 * Set the maximum position of any existing mouse pointers 345 * Set the maximum position of any existing mouse pointers
358 * 346 *
359 * @param manager 347 * @param manager
@@ -430,18 +418,6 @@ EAPI void elput_input_keyboard_info_set(Elput_Manager *manager, void *context, v
430EAPI void elput_input_keyboard_group_set(Elput_Manager *manager, int group); 418EAPI void elput_input_keyboard_group_set(Elput_Manager *manager, int group);
431 419
432/** 420/**
433 * Return the output name associated with a given device
434 *
435 * @param device
436 *
437 * @return An Eina_Stringshare of the output name for this device, or NULL on error
438 *
439 * @ingroup Elput_Input_Group
440 * @since 1.18
441 */
442EAPI Eina_Stringshare *elput_input_device_output_name_get(Elput_Device *device);
443
444/**
445 * Set the pointer acceleration profile 421 * Set the pointer acceleration profile
446 * 422 *
447 * @param manager 423 * @param manager
@@ -618,6 +594,60 @@ EAPI Eina_Bool elput_touch_tap_enabled_set(Elput_Device *device, Eina_Bool enabl
618 */ 594 */
619EAPI Eina_Bool elput_touch_tap_enabled_get(Elput_Device *device); 595EAPI Eina_Bool elput_touch_tap_enabled_get(Elput_Device *device);
620 596
597
598/**
599 * @defgroup Elput_Device_Group Elput device functions
600 *
601 * Functions for getting attributes of devices
602 */
603
604/**
605 * Get the seat object for a device
606 * @param dev
607 * @return The seat
608 * @ingroup Elput_Device_Group
609 * @since 1.20
610 */
611EAPI Elput_Seat *elput_device_seat_get(const Elput_Device *dev);
612
613/**
614 * Get the caps for a device
615 * @param dev
616 * @return The caps, 0 on failure
617 * @ingroup Elput_Device_Group
618 * @since 1.20
619 */
620EAPI Elput_Device_Caps elput_device_caps_get(const Elput_Device *dev);
621
622/**
623 * Return the output name associated with a given device
624 *
625 * @param device
626 *
627 * @return An Eina_Stringshare of the output name for this device, or NULL on error
628 *
629 * @ingroup Elput_Device_Group
630 * @since 1.20
631 */
632EAPI Eina_Stringshare *elput_device_output_name_get(Elput_Device *device);
633
634/**
635 * @defgroup Elput_Seat_Group Elput seat functions
636 *
637 * Functions for getting attributes of seats
638 */
639
640/**
641 * Get the list of devices on a given seat
642 *
643 * @param seat
644 *
645 * @return An immutable list of existing Elput_Devices on a given seat or NULL on failure
646 *
647 * @ingroup Elput_Seat_Group
648 * @since 1.20
649 */
650EAPI const Eina_List *elput_seat_devices_get(const Elput_Seat *seat);
621# endif 651# endif
622 652
623# undef EAPI 653# 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
552 return EINA_TRUE; 552 return EINA_TRUE;
553} 553}
554 554
555EAPI const Eina_List *
556elput_input_devices_get(Elput_Seat *seat)
557{
558 EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
559 return seat->devices;
560}
561
562EAPI void 555EAPI void
563elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh) 556elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh)
564{ 557{
@@ -687,15 +680,6 @@ elput_input_keyboard_group_set(Elput_Manager *manager, int group)
687 _keyboard_group_update(seat); 680 _keyboard_group_update(seat);
688} 681}
689 682
690EAPI Eina_Stringshare *
691elput_input_device_output_name_get(Elput_Device *device)
692{
693 EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL);
694
695 if (!device->output_name) return NULL;
696 return eina_stringshare_ref(device->output_name);
697}
698
699EAPI void 683EAPI void
700elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat, uint32_t profile) 684elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat, uint32_t profile)
701{ 685{
@@ -730,3 +714,33 @@ elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat,
730 } 714 }
731 } 715 }
732} 716}
717
718EAPI Elput_Seat *
719elput_device_seat_get(const Elput_Device *dev)
720{
721 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL);
722 return dev->seat;
723}
724
725EAPI Elput_Device_Caps
726elput_device_caps_get(const Elput_Device *dev)
727{
728 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, 0);
729 return dev->caps;
730}
731
732EAPI Eina_Stringshare *
733elput_device_output_name_get(Elput_Device *device)
734{
735 EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL);
736
737 return device->output_name;
738}
739
740EAPI const Eina_List *
741elput_seat_devices_get(const Elput_Seat *seat)
742{
743 EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
744 return seat->devices;
745}
746