4 # ifdef EFL_BETA_API_SUPPORT
13 # define EAPI __attribute__ ((visibility("default")))
23 ELPUT_DEVICE_CAPS_POINTER = (1 << 0),
24 ELPUT_DEVICE_CAPS_KEYBOARD = (1 << 1),
25 ELPUT_DEVICE_CAPS_TOUCH = (1 << 2),
26 ELPUT_DEVICE_CAPS_TABLET_TOOL = (1 << 3),
27 ELPUT_DEVICE_CAPS_TABLET_PAD = (1 << 4),
28 ELPUT_DEVICE_CAPS_GESTURE = (1 << 5),
29 ELPUT_DEVICE_CAPS_SWITCH = (1 << 6),
32 /* opaque structure to represent an input manager */
33 typedef struct _Elput_Manager Elput_Manager;
35 /* opaque structure to represent an input seat */
36 typedef struct _Elput_Seat Elput_Seat;
38 /* opaque structure to represent an input device */
39 typedef struct _Elput_Device Elput_Device;
41 /* opaque structure to represent a keyboard */
42 typedef struct _Elput_Keyboard Elput_Keyboard;
44 /* opaque structure to represent a mouse */
45 typedef struct _Elput_Pointer Elput_Pointer;
47 /* opaque structure to represent a touch device */
48 typedef struct _Elput_Touch Elput_Touch;
50 /* structure to represent event for seat capability changes */
51 typedef struct _Elput_Event_Seat_Caps
57 } Elput_Event_Seat_Caps;
59 /* structure to represent event for seat frame */
60 typedef struct _Elput_Event_Seat_Frame
63 } Elput_Event_Seat_Frame;
65 /* structure to represent event for seat modifiers changes */
66 typedef struct _Elput_Event_Modifiers_Send
68 unsigned int depressed;
72 } Elput_Event_Modifiers_Send;
74 typedef enum _Elput_Device_Change_Type
78 } Elput_Device_Change_Type;
80 /* structure to represent event for device being added or removed */
81 typedef struct _Elput_Event_Device_Change
84 Elput_Device_Change_Type type;
85 } Elput_Event_Device_Change;
87 /* structure to represent session active changes */
88 typedef struct _Elput_Event_Session_Active
92 } Elput_Event_Session_Active;
95 typedef struct Elput_Event_Pointer_Motion
102 } Elput_Event_Pointer_Motion;
107 ELPUT_SWITCH_TYPE_LID = 1,
108 ELPUT_SWITCH_TYPE_TABLET_MODE,
114 ELPUT_SWITCH_STATE_OFF = 0,
115 ELPUT_SWITCH_STATE_ON = 1,
116 } Elput_Switch_State;
119 typedef struct _Elput_Event_Switch
121 Elput_Device *device;
123 Elput_Switch_Type type;
124 Elput_Switch_State state;
125 } Elput_Event_Switch;
128 EAPI extern int ELPUT_EVENT_SEAT_CAPS;
129 EAPI extern int ELPUT_EVENT_SEAT_FRAME;
130 EAPI extern int ELPUT_EVENT_MODIFIERS_SEND;
131 EAPI extern int ELPUT_EVENT_DEVICE_CHANGE;
132 EAPI extern int ELPUT_EVENT_SESSION_ACTIVE;
135 EAPI extern int ELPUT_EVENT_POINTER_MOTION;
138 EAPI extern int ELPUT_EVENT_SWITCH;
142 * @brief Ecore functions for dealing with libinput
144 * @defgroup Elput_Group Elput - libinput integration
147 * Elput provides a wrapper and functions for using libinput
149 * @li @ref Elput_Init_Group
150 * @li @ref Elput_Manager_Group
151 * @li @ref Elput_Input_Group
152 * @li @ref Elput_Touch_Group
157 * @defgroup Elput_Init_Group Library Init and Shutdown functions
159 * Functions that start and shutdown the Elput library
163 * Initialize the Elput library
165 * @return The number of times the library has been initialized without being
166 * shutdown. 0 is returned if an error occurs.
168 * @ingroup Elput_Init_Group
171 EAPI int elput_init(void);
174 * Shutdown the Elput library
176 * @return The number of times the library has been initialized without being
177 * shutdown. 0 is returned if an error occurs.
179 * @ingroup Elput_Init_Group
182 EAPI int elput_shutdown(void);
185 * @defgroup Elput_Manager_Group Elput Manager
187 * Functions that deal with connecting, disconnecting, opening, closing
192 * Create an input manager on the specified seat
197 * @return A Elput_Manager on success, NULL on failure
199 * @ingroup Elput_Manager_Group
202 EAPI Elput_Manager *elput_manager_connect(const char *seat, unsigned int tty);
205 * Disconnect an input manager
209 * @ingroup Elput_Manager_Group
212 EAPI void elput_manager_disconnect(Elput_Manager *manager);
215 * Request input manager to open a file
221 * @return Filedescriptor of opened file or -1 on failure
223 * @ingroup Elput_Manager_Group
226 EAPI int elput_manager_open(Elput_Manager *manager, const char *path, int flags);
229 * Request input manager to close a file
234 * @ingroup Elput_Manager_Group
237 EAPI void elput_manager_close(Elput_Manager *manager, int fd);
240 * Request to switch to a given vt
245 * @return EINA_TRUE on success, EINA_FALSE otherwise
247 * @ingroup Elput_Manager_Group
250 EAPI Eina_Bool elput_manager_vt_set(Elput_Manager *manager, int vt);
253 * Get the list of seats from a manager
257 * @return An Eina_List of existing Elput_Seats or NULL on failure
259 * @ingroup Elput_Manager_Group
262 EAPI const Eina_List *elput_manager_seats_get(Elput_Manager *manager);
266 * Set which window to use for this input manager
268 * This function should be used to specify which window to set on the
269 * input manager. Setting a window on the input manager is done so that
270 * when we raise events (mouse movement, keyboard key, etc) then this
271 * window is passed to the event structure as the window which the event
277 * @ingroup Elput_Manager_Group
280 EAPI void elput_manager_window_set(Elput_Manager *manager, unsigned int window);
283 * @defgroup Elput_Input_Group Elput input functions
285 * Functions that deal with setup of inputs
293 * @return EINA_TRUE on success, EINA_FALSE on failure
295 * @ingroup Elput_Input_Group
298 EAPI Eina_Bool elput_input_init(Elput_Manager *manager);
305 * @ingroup Elput_Input_Group
308 EAPI void elput_input_shutdown(Elput_Manager *manager);
311 * Get the pointer position on a given seat
318 * @ingroup Elput_Input_Group
321 EAPI void elput_input_pointer_xy_get(Elput_Manager *manager, const char *seat, int *x, int *y);
324 * Set the pointer position on a given seat
331 * @ingroup Elput_Input_Group
334 EAPI void elput_input_pointer_xy_set(Elput_Manager *manager, const char *seat, int x, int y);
337 * Set the pointer left-handed mode
343 * @return EINA_TRUE on success, EINA_FALSE otherwise
345 * @ingroup Elput_Input_Group
348 EAPI Eina_Bool elput_input_pointer_left_handed_set(Elput_Manager *manager, const char *seat, Eina_Bool left);
351 * Set the maximum position of any existing mouse pointers
357 * @ingroup Elput_Input_Group
360 EAPI void elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh);
363 * Set pointer value rotation
368 * @return EINA_TRUE on success, EINA_FALSE otherwise
370 * @ingroup Elput_Input_Group
373 EAPI Eina_Bool elput_input_pointer_rotation_set(Elput_Manager *manager, int rotation);
376 * Set tap-to-click status
382 * @return EINA_TRUE on success, EINA_FALSE otherwise
384 * @ingroup Elput_Input_Group
387 EAPI void elput_input_touch_tap_to_click_enabled_set(Elput_Manager *manager, const char *seat, Eina_Bool enabled);
390 * Calibrate input devices for given screen size
396 * @ingroup Elput_Input_Group
399 EAPI void elput_input_devices_calibrate(Elput_Manager *manager, int w, int h);
402 * Enable key remap functionality
407 * @return EINA_TRUE on success, EINA_FALSE otherwise
409 * @ingroup Elput_Input_Group
412 EAPI Eina_Bool elput_input_key_remap_enable(Elput_Manager *manager, Eina_Bool enable);
415 * Set a given set of keys as remapped keys
422 * @return EINA_TRUE on success, EINA_FALSE otherwise
424 * @ingroup Elput_Input_Group
427 EAPI Eina_Bool elput_input_key_remap_set(Elput_Manager *manager, int *from_keys, int *to_keys, int num);
430 * Set info to be used for keyboards
437 * @ingroup Elput_Input_Group
440 EAPI void elput_input_keyboard_info_set(Elput_Manager *manager, void *context, void *keymap, int group);
443 * Set group layout to be used for keyboards
448 * @ingroup Elput_Input_Group
451 EAPI void elput_input_keyboard_group_set(Elput_Manager *manager, int group);
454 * Set the pointer acceleration profile
460 * @ingroup Elput_Input_Group
463 EAPI void elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat, uint32_t profile);
466 * Set the pointer acceleration speed
472 * @ingroup Elput_Input_Group
475 EAPI void elput_input_pointer_accel_speed_set(Elput_Manager *manager, const char *seat, double speed);
478 * @defgroup Elput_Touch_Group Configuration of touch devices
480 * Functions related to configuration of touch devices
484 * Enable or disable tap-and-drag on this device.
486 * When enabled, a single-finger tap immediately followed by a finger
487 * down results in a button down event, subsequent finger motion thus
488 * triggers a drag. The button is released on finger up.
493 * @return EINA_TRUE on success, EINA_FALSE otherwise
495 * @ingroup Elput_Touch_Group
498 EAPI Eina_Bool elput_touch_drag_enabled_set(Elput_Device *device, Eina_Bool enabled);
501 * Get if tap-and-drag is enabled on this device.
505 * @return EINA_TRUE if enabled, EINA_FALSE otherwise
507 * @ingroup Elput_Touch_Group
510 EAPI Eina_Bool elput_touch_drag_enabled_get(Elput_Device *device);
513 * Enable or disable drag-lock during tapping on a device.
515 * When enabled, a finger may be lifted and put back on the touchpad
516 * within a timeout and the drag process continues. When disabled,
517 * lifting the finger during a tap-and-drag will immediately stop the
523 * @return EINA_TRUE on success, EINA_FALSE otherwise
525 * @ingroup Elput_Touch_Group
528 EAPI Eina_Bool elput_touch_drag_lock_enabled_set(Elput_Device *device, Eina_Bool enabled);
531 * Get if drag-lock is enabled on this device.
535 * @return EINA_TRUE if enabled, EINA_FALSE otherwise
537 * @ingroup Elput_Touch_Group
540 EAPI Eina_Bool elput_touch_drag_lock_enabled_get(Elput_Device *device);
543 * Enable or disable touchpad dwt (disable-while-typing) feature.
545 * When enabled, the device will be disabled while typing and for a
546 * short period after.
551 * @return EINA_TRUE on success, EINA_FALSE otherwise
553 * @ingroup Elput_Touch_Group
556 EAPI Eina_Bool elput_touch_dwt_enabled_set(Elput_Device *device, Eina_Bool enabled);
559 * Get if touchpad dwt (disable-while-typing) is enabled.
563 * @return EINA_TRUE if enabled, EINA_FALSE otherwise
565 * @ingroup Elput_Touch_Group
568 EAPI Eina_Bool elput_touch_dwt_enabled_get(Elput_Device *device);
571 * Set the scroll method used for this device.
573 * The scroll method defines when to generate scroll axis events instead
574 * of pointer motion events.
579 * @return EINA_TRUE on success, EINA_FALSE otherwise
581 * @ingroup Elput_Touch_Group
584 EAPI Eina_Bool elput_touch_scroll_method_set(Elput_Device *device, int method);
587 * Get the current scroll method set on a device
591 * @return The current scroll method
593 * @ingroup Elput_Touch_Group
596 EAPI int elput_touch_scroll_method_get(Elput_Device *device);
599 * Set the button click method for a device.
601 * The button click method defines when to generate software emulated
607 * @return EINA_TRUE on success, EINA_FALSE otherwise
609 * @ingroup Elput_Touch_Group
612 EAPI Eina_Bool elput_touch_click_method_set(Elput_Device *device, int method);
615 * Get the current button click method for a device
619 * @return The current button click method
621 * @ingroup Elput_Touch_Group
624 EAPI int elput_touch_click_method_get(Elput_Device *device);
627 * Enable or disable tap-to-click on a given device
632 * @return EINA_TRUE on success, EINA_FALSE otherwise
634 * @ingroup Elput_Touch_Group
637 EAPI Eina_Bool elput_touch_tap_enabled_set(Elput_Device *device, Eina_Bool enabled);
640 * Get if tap-to-click is enabled on a given device
644 * @return EINA_TRUE if enabled, EINA_FALSE otherwise
646 * @ingroup Elput_Touch_Group
649 EAPI Eina_Bool elput_touch_tap_enabled_get(Elput_Device *device);
653 * @defgroup Elput_Device_Group Elput device functions
655 * Functions for getting attributes of devices
659 * Get the seat object for a device
662 * @ingroup Elput_Device_Group
665 EAPI Elput_Seat *elput_device_seat_get(const Elput_Device *dev);
668 * Get the caps for a device
670 * @return The caps, 0 on failure
671 * @ingroup Elput_Device_Group
674 EAPI Elput_Device_Caps elput_device_caps_get(const Elput_Device *dev);
677 * Return the output name associated with a given device
681 * @return An Eina_Stringshare of the output name for this device, or NULL on error
683 * @ingroup Elput_Device_Group
686 EAPI Eina_Stringshare *elput_device_output_name_get(Elput_Device *device);
689 * @defgroup Elput_Seat_Group Elput seat functions
691 * Functions for getting attributes of seats
695 * Get the list of devices on a given seat
699 * @return An immutable list of existing Elput_Devices on a given seat or NULL on failure
701 * @ingroup Elput_Seat_Group
704 EAPI const Eina_List *elput_seat_devices_get(const Elput_Seat *seat);
707 * Get the name of a given seat
713 * @ingroup Elput_Seat_Group
716 EAPI Eina_Stringshare *elput_seat_name_get(const Elput_Seat *seat);
719 * Get the manager of a given seat
723 * @return The Elput_Manager
725 * @ingroup Elput_Seat_Group
728 EAPI Elput_Manager *elput_seat_manager_get(const Elput_Seat *seat);