forked from enlightenment/efl
ecore/fb: Bring back the old signature of ecore_fb_input_device_open.
A previous patch had changed its signature, but since this is an EAPI, we can't break it. Now ecore_fb_input_device_window_set() was added to provide the same functionality. SVN revision: 65589
This commit is contained in:
parent
f21568bcb5
commit
e8060b3cd6
|
@ -343,3 +343,6 @@
|
|||
* Fix setting override state to only hide if it should be
|
||||
visible at that point in x back end support
|
||||
|
||||
2011-11-24 Rafael Antognolli
|
||||
|
||||
* Add ecore_fb_input_device_window_set().
|
||||
|
|
|
@ -208,8 +208,9 @@ _ecore_evas_fb_init(Ecore_Evas *ee, int w, int h)
|
|||
continue;
|
||||
|
||||
snprintf(device_path, 256, "/dev/input/%s", input_entry->d_name);
|
||||
if (!(device = ecore_fb_input_device_open(ee, device_path)))
|
||||
if (!(device = ecore_fb_input_device_open(device_path)))
|
||||
continue;
|
||||
ecore_fb_input_device_window_set(device, ee);
|
||||
|
||||
caps = ecore_fb_input_device_cap_get(device);
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ EAPI void ecore_fb_callback_gain_set(void (*func) (void *da
|
|||
EAPI void ecore_fb_callback_lose_set(void (*func) (void *data), void *data);
|
||||
|
||||
/* ecore_fb_li.c */
|
||||
EAPI Ecore_Fb_Input_Device *ecore_fb_input_device_open(void *window, const char *dev);
|
||||
EAPI Ecore_Fb_Input_Device *ecore_fb_input_device_open(const char *dev);
|
||||
EAPI void ecore_fb_input_device_close(Ecore_Fb_Input_Device *dev);
|
||||
EAPI void ecore_fb_input_device_listen(Ecore_Fb_Input_Device *dev, Eina_Bool listen);
|
||||
EAPI const char *ecore_fb_input_device_name_get(Ecore_Fb_Input_Device *dev);
|
||||
|
@ -78,6 +78,7 @@ EAPI Ecore_Fb_Input_Device_Cap ecore_fb_input_device_cap_get(Ecore_Fb_Input_Devi
|
|||
EAPI void ecore_fb_input_device_axis_size_set(Ecore_Fb_Input_Device *dev, int w, int h);
|
||||
EAPI void ecore_fb_input_threshold_click_set(Ecore_Fb_Input_Device *dev, double threshold);
|
||||
EAPI double ecore_fb_input_threshold_click_get(Ecore_Fb_Input_Device *dev);
|
||||
EAPI void ecore_fb_input_device_window_set(Ecore_Fb_Input_Device *dev, void *window);
|
||||
|
||||
/* ecore_fb.c */
|
||||
|
||||
|
|
|
@ -451,6 +451,42 @@ ecore_fb_input_device_listen(Ecore_Fb_Input_Device *dev, Eina_Bool listen)
|
|||
# define EV_CNT (EV_MAX+1)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Associates an input device with the given @ref Ecore_Evas.
|
||||
*
|
||||
* @param dev The input being associated with an @ref Ecore_Evas (not @c NULL).
|
||||
* @param window The window which this input is being associated to.
|
||||
* @c NULL will remove any previous association.
|
||||
*
|
||||
* Events generated by this device will have a pointer to @p window. If this @p
|
||||
* window is registered with ecore_event_window_register() or
|
||||
* ecore_evas_input_event_register(), respective evas events will be delivered
|
||||
* by the ecore_input_evas system. An example can be seen in the following code:
|
||||
*
|
||||
* @code
|
||||
* Ecore_Evas *ee = ecore_evas_new(NULL, 0, 0, 800, 600, NULL);
|
||||
*
|
||||
* ecore_evas_input_event_register(ee);
|
||||
*
|
||||
* device = ecore_fb_input_device_open(device_path);
|
||||
* if (device)
|
||||
* ecore_fb_input_device_window_set(device, ee);
|
||||
*
|
||||
* @endcode
|
||||
*
|
||||
* On the previous code, all input captured on the mentioned device will be
|
||||
* delivered to the @Ecore_Evas @c ee.
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
EAPI void
|
||||
ecore_fb_input_device_window_set(Ecore_Fb_Input_Device *dev, void *window)
|
||||
{
|
||||
if (!dev) return;
|
||||
|
||||
dev->window = window;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Open an input device.
|
||||
*
|
||||
|
@ -461,7 +497,7 @@ ecore_fb_input_device_listen(Ecore_Fb_Input_Device *dev, Eina_Bool listen)
|
|||
* object for it, or returns @c NULL on failure.
|
||||
*/
|
||||
EAPI Ecore_Fb_Input_Device *
|
||||
ecore_fb_input_device_open(void *ee, const char *dev)
|
||||
ecore_fb_input_device_open(const char *dev)
|
||||
{
|
||||
Ecore_Fb_Input_Device *device;
|
||||
unsigned long event_type_bitmask[EV_CNT / 32 + 1];
|
||||
|
@ -525,7 +561,6 @@ ecore_fb_input_device_open(void *ee, const char *dev)
|
|||
}
|
||||
}
|
||||
|
||||
device->window = ee;
|
||||
_ecore_fb_li_devices = eina_list_append(_ecore_fb_li_devices, device);
|
||||
return device;
|
||||
|
||||
|
|
Loading…
Reference in New Issue