summaryrefslogtreecommitdiff
path: root/src/lib/elput
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-05-24 16:14:41 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-05-25 12:57:27 -0400
commit7fdcf841f57de11ea92f4b2d4eeec34c1c5a70e0 (patch)
treebbbd6c3619f22e7b15cf6b180981af05b384a8fb /src/lib/elput
parent5f088b026d8f39aafc6b6e70fe3b04dff79b179e (diff)
elput: change some functions and internal flags to enable async input setup
this sets attributes on the Elput_Manager struct so that devices created at a later point can then have relevant attributes applied to them
Diffstat (limited to 'src/lib/elput')
-rw-r--r--src/lib/elput/Elput.h35
-rw-r--r--src/lib/elput/elput_evdev.c8
-rw-r--r--src/lib/elput/elput_input.c10
-rw-r--r--src/lib/elput/elput_logind.c10
-rw-r--r--src/lib/elput/elput_manager.c17
-rw-r--r--src/lib/elput/elput_private.h3
6 files changed, 39 insertions, 44 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index 2f311608a4..77ba406e30 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -230,6 +230,24 @@ EAPI Eina_Bool elput_manager_vt_set(Elput_Manager *manager, int vt);
230 */ 230 */
231EAPI const Eina_List *elput_manager_seats_get(Elput_Manager *manager); 231EAPI const Eina_List *elput_manager_seats_get(Elput_Manager *manager);
232 232
233
234/**
235 * Set which window to use for this input manager
236 *
237 * @brief This function should be used to specify which window to set on the
238 * input manager. Setting a window on the input manager is done so that
239 * when we raise events (mouse movement, keyboard key, etc) then
240 * this window is passed to the event structure as the window which
241 * the event occured on.
242 *
243 * @param manager
244 * @param window
245 *
246 * @ingroup Elput_Manager_Group
247 * @since 1.18
248 */
249EAPI void elput_manager_window_set(Elput_Manager *manager, unsigned int window);
250
233/** 251/**
234 * @defgroup Elput_Input_Group Elput input functions 252 * @defgroup Elput_Input_Group Elput input functions
235 * 253 *
@@ -329,23 +347,6 @@ EAPI void elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh
329 */ 347 */
330 348
331/** 349/**
332 * Set which window to use for this input device
333 *
334 * @brief This function should be used to specify which window to set on the
335 * input device. Setting a window on the input device is done so that
336 * when we raise events (mouse movement, keyboard key, etc) then
337 * this window is passed to the event structure as the window which
338 * the event occured on.
339 *
340 * @param device
341 * @param window
342 *
343 * @ingroup Elput_Device_Group
344 * @since 1.18
345 */
346EAPI void elput_device_window_set(Elput_Device *device, unsigned int window);
347
348/**
349 * Set size of output for input device calibration 350 * Set size of output for input device calibration
350 * 351 *
351 * @param device 352 * @param device
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index 45370197df..5095320ac8 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -1345,14 +1345,6 @@ _evdev_touch_get(Elput_Seat *seat)
1345} 1345}
1346 1346
1347EAPI void 1347EAPI void
1348elput_device_window_set(Elput_Device *device, unsigned int window)
1349{
1350 EINA_SAFETY_ON_NULL_RETURN(device);
1351
1352 device->window = window;
1353}
1354
1355EAPI void
1356elput_device_output_size_set(Elput_Device *device, int w, int h) 1348elput_device_output_size_set(Elput_Device *device, int w, int h)
1357{ 1349{
1358 EINA_SAFETY_ON_NULL_RETURN(device); 1350 EINA_SAFETY_ON_NULL_RETURN(device);
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index 8431c290b5..45778ebe91 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -500,12 +500,8 @@ elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh)
500 Elput_Seat *eseat; 500 Elput_Seat *eseat;
501 501
502 EINA_SAFETY_ON_NULL_RETURN(manager); 502 EINA_SAFETY_ON_NULL_RETURN(manager);
503 manager->input.pointer_w = maxw;
504 manager->input.pointer_h = maxh;
503 505
504 EINA_LIST_FOREACH(manager->input.seats, l, eseat) 506 _elput_input_pointer_max_update(manager);
505 {
506 if (!eseat->ptr) continue;
507
508 eseat->ptr->maxw = maxw;
509 eseat->ptr->maxh = maxh;
510 }
511} 507}
diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c
index 8db4a113fa..475b1c68b0 100644
--- a/src/lib/elput/elput_logind.c
+++ b/src/lib/elput/elput_logind.c
@@ -200,16 +200,6 @@ _logind_dbus_setup(Elput_Manager *em)
200 _cb_device_paused, em); 200 _cb_device_paused, em);
201 eldbus_proxy_signal_handler_add(proxy, "ResumeDevice", 201 eldbus_proxy_signal_handler_add(proxy, "ResumeDevice",
202 _cb_device_resumed, em); 202 _cb_device_resumed, em);
203 proxy =
204 eldbus_proxy_get(em->dbus.obj, "org.freedesktop.DBus.Properties");
205 if (!proxy)
206 {
207 ERR("Could not get dbus proxy");
208 goto proxy_err;
209 }
210
211 eldbus_proxy_unref(proxy);
212
213 return EINA_TRUE; 203 return EINA_TRUE;
214 204
215proxy_err: 205proxy_err:
diff --git a/src/lib/elput/elput_manager.c b/src/lib/elput/elput_manager.c
index 3b127afdc7..0dcc82055d 100644
--- a/src/lib/elput/elput_manager.c
+++ b/src/lib/elput/elput_manager.c
@@ -89,6 +89,7 @@ elput_manager_open(Elput_Manager *manager, const char *path, int flags)
89 manager->vt_hdlr = 89 manager->vt_hdlr =
90 ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, 90 ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
91 _cb_key_down, manager); 91 _cb_key_down, manager);
92 manager->vt_fd = ret;
92 } 93 }
93 } 94 }
94 95
@@ -101,8 +102,11 @@ elput_manager_close(Elput_Manager *manager, int fd)
101 EINA_SAFETY_ON_NULL_RETURN(manager); 102 EINA_SAFETY_ON_NULL_RETURN(manager);
102 EINA_SAFETY_ON_NULL_RETURN(manager->interface); 103 EINA_SAFETY_ON_NULL_RETURN(manager->interface);
103 104
104 if (manager->vt_hdlr) ecore_event_handler_del(manager->vt_hdlr); 105 if (fd == manager->vt_fd)
105 manager->vt_hdlr = NULL; 106 {
107 if (manager->vt_hdlr) ecore_event_handler_del(manager->vt_hdlr);
108 manager->vt_hdlr = NULL;
109 }
106 110
107 if (manager->interface->close) 111 if (manager->interface->close)
108 manager->interface->close(manager, fd); 112 manager->interface->close(manager, fd);
@@ -121,6 +125,15 @@ elput_manager_vt_set(Elput_Manager *manager, int vt)
121 return EINA_FALSE; 125 return EINA_FALSE;
122} 126}
123 127
128EAPI void
129elput_manager_window_set(Elput_Manager *manager, unsigned int window)
130{
131 EINA_SAFETY_ON_NULL_RETURN(manager);
132
133 manager->window = window;
134 _elput_input_window_update(manager);
135}
136
124EAPI const Eina_List * 137EAPI const Eina_List *
125elput_manager_seats_get(Elput_Manager *manager) 138elput_manager_seats_get(Elput_Manager *manager)
126{ 139{
diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h
index a934bf1d23..0fc5d6af32 100644
--- a/src/lib/elput/elput_private.h
+++ b/src/lib/elput/elput_private.h
@@ -86,6 +86,7 @@ typedef struct _Elput_Input
86 Ecore_Thread *thread; 86 Ecore_Thread *thread;
87 Eldbus_Pending *current_pending; 87 Eldbus_Pending *current_pending;
88 int pipe; 88 int pipe;
89 int pointer_w, pointer_h;
89 90
90 Eina_Bool suspended : 1; 91 Eina_Bool suspended : 1;
91} Elput_Input; 92} Elput_Input;
@@ -252,6 +253,8 @@ typedef struct _Elput_Async_Open
252 int flags; 253 int flags;
253} Elput_Async_Open; 254} Elput_Async_Open;
254 255
256void _elput_input_window_update(Elput_Manager *manager);
257
255int _evdev_event_process(struct libinput_event *event); 258int _evdev_event_process(struct libinput_event *event);
256Elput_Device *_evdev_device_create(Elput_Seat *seat, struct libinput_device *device); 259Elput_Device *_evdev_device_create(Elput_Seat *seat, struct libinput_device *device);
257void _evdev_device_destroy(Elput_Device *edev); 260void _evdev_device_destroy(Elput_Device *edev);