e_input: change E_API to EINTERN
[platform/upstream/enlightenment.git] / src / bin / e_input.h
1 #ifdef E_TYPEDEFS
2
3 typedef struct _E_Input E_Input;
4
5 #else
6
7 #ifndef E_INPUT_H
8 #define E_INPUT_H
9
10 #define E_INPUT_TYPE (int)0xE0b0beaf
11
12 #define E_INPUT_REQUEST_SERVER ((void *)0x1)
13
14 #include <xkbcommon/xkbcommon.h>
15
16 EINTERN extern int E_INPUT_EVENT_SEAT_ADD;
17 EINTERN extern int E_EVENT_INPUT_ENABLED;
18 EINTERN extern int E_EVENT_INPUT_DISABLED;
19
20 typedef enum _E_Input_Seat_Capabilities
21 {
22    E_INPUT_SEAT_POINTER = (1 << 0),
23    E_INPUT_SEAT_KEYBOARD = (1 << 1),
24    E_INPUT_SEAT_TOUCH = (1 << 2),
25 } E_Input_Seat_Capabilities;
26
27 typedef enum _E_Input_Libinput_Backend
28 {
29    E_INPUT_LIBINPUT_BACKEND_UDEV = 1,
30    E_INPUT_LIBINPUT_BACKEND_PATH
31 } E_Input_Libinput_Backend;
32
33 typedef struct _E_Input_Device E_Input_Device;
34 typedef struct _E_Input_Backend E_Input_Backend;
35 typedef struct _E_Input_Evdev E_Input_Evdev;
36 typedef struct _E_Input_Seat E_Input_Seat;
37 typedef struct _E_Input_Coord E_Input_Coord;
38
39 struct _E_Input
40 {
41    Ecore_Window window;
42    Ecore_Evas *ee;
43    E_Input_Device *dev;
44    const char *input_base_dir;
45    Eina_List *handlers;
46
47    Eina_Bool use_thread : 1;
48    unsigned int touch_max_count;
49    unsigned int touch_device_count;
50 };
51
52 struct _E_Input_Device
53 {
54    const char *seat;
55
56    Eina_List *seats;
57    Eina_List *inputs;
58    Eina_Hash *fd_hash;
59
60    struct xkb_context *xkb_ctx;
61    Ecore_Window window;
62    Eina_Bool left_handed : 1;
63
64    unsigned int blocked;
65    void *blocked_client;
66    unsigned int server_blocked;
67 };
68
69 EINTERN int e_input_init(Ecore_Evas *ee);
70 EINTERN int e_input_shutdown(void);
71 EINTERN const char *e_input_base_dir_get(void);
72 EINTERN Eina_Bool e_input_thread_enabled_get(void);
73 EINTERN E_Input *e_input_get(void);
74 EINTERN Ecore_Evas *e_input_ecore_evas_get(E_Input *ei);
75
76 EINTERN E_Input_Device *e_input_device_open(void);
77 EINTERN Eina_Bool e_input_device_close(E_Input_Device *dev);
78 EINTERN void e_input_device_keyboard_cached_context_set(struct xkb_context *ctx);
79 EINTERN void e_input_device_keyboard_cached_keymap_set(struct xkb_keymap *map);
80 EINTERN Eina_Bool e_input_device_input_backend_create(E_Input_Device *dev, E_Input_Libinput_Backend backend);
81 EINTERN Eina_Bool e_input_device_input_create_libinput_udev(E_Input_Device *dev);
82 EINTERN Eina_Bool e_input_device_input_create_libinput_path(E_Input_Device *dev);
83 EINTERN void e_input_device_window_set(E_Input_Device *dev, Ecore_Window window);
84 EINTERN void e_input_device_pointer_xy_get(E_Input_Device *dev, int *x, int *y);
85 EINTERN Eina_Bool e_input_device_pointer_left_handed_set(E_Input_Device *dev, Eina_Bool left_handed);
86 EINTERN Eina_Bool e_input_device_pointer_rotation_set(E_Input_Device *dev, int rotation);
87 EINTERN Eina_Bool e_input_device_touch_rotation_set(E_Input_Device *dev, unsigned int rotation);
88 EINTERN void e_input_device_rotation_set(E_Input_Device *dev, unsigned int rotation);
89 EINTERN Eina_Bool e_input_device_touch_transformation_set(E_Input_Device *dev, int offset_x, int offset_y, int w, int h);
90
91 EINTERN Eina_Bool e_input_enable_input(E_Input_Backend *input);
92 EINTERN void e_input_disable_input(E_Input_Backend *input);
93
94 EINTERN void e_input_evdev_axis_size_set(E_Input_Evdev *edev, int w, int h);
95 EINTERN const char *e_input_evdev_sysname_get(E_Input_Evdev *evdev);
96 EINTERN Eina_Bool e_input_evdev_key_remap_enable(E_Input_Evdev *edev, Eina_Bool enable);
97 EINTERN Eina_Bool e_input_evdev_key_remap_set(E_Input_Evdev *edev, int *from_keys, int *to_keys, int num);
98 EINTERN Eina_Bool e_input_evdev_touch_calibration_set(E_Input_Evdev *edev, float matrix[6]);
99 EINTERN Eina_Bool e_input_evdev_mouse_accel_speed_set(E_Input_Evdev *edev, double speed);
100 EINTERN Eina_Bool e_input_evdev_mouse_accel_enable(E_Input_Evdev *edev, Eina_Bool enable);
101 EINTERN unsigned int e_input_evdev_touch_pressed_get(E_Input_Evdev *edev);
102
103 E_API const Eina_List *e_input_devices_get(void);
104 E_API Eina_Bool e_input_device_pointer_warp(E_Input_Device *dev, int x, int y);
105 E_API Eina_Bool e_input_device_mouse_accel_speed_set(E_Input_Device *dev, double speed);
106
107 EINTERN const char *e_input_evdev_name_get(E_Input_Evdev *evdev);
108 EINTERN Eina_List *e_input_seat_evdev_list_get(E_Input_Seat *seat);
109 EINTERN int e_input_evdev_wheel_click_angle_get(E_Input_Evdev *dev);
110 EINTERN Ecore_Device *e_input_evdev_get_ecore_device(const char *path, Ecore_Device_Class clas);
111
112 EINTERN unsigned int e_input_device_touch_pressed_get(E_Input_Device *dev);
113 EINTERN Eina_Bool e_input_device_keyboard_remap_set(E_Input_Device *dev, int *from_keys, int *to_keys, int num);
114
115 E_API unsigned int e_input_touch_max_count_get();
116 EINTERN void e_input_touch_max_count_set(unsigned int max_count);
117
118 EINTERN Eina_Bool e_input_device_block(E_Input_Device *dev, unsigned int type, void *client);
119 EINTERN Eina_Bool e_input_device_unblock(E_Input_Device *dev, void *client);
120 EINTERN Eina_Bool e_input_device_output_name_set(E_Input_Device *dev, const char *input, const char *output);
121 EINTERN const char *e_input_device_output_name_get(E_Input_Device *dev, const char *input);
122
123 EINTERN Eina_Bool e_input_device_seat_name_set(E_Input_Device *dev, const char *input, const char *seat_name);
124 #endif
125 #endif