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);
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);
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 */
#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.
*
* @param dev The device to open.
* 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];
}
}
- device->window = ee;
_ecore_fb_li_devices = eina_list_append(_ecore_fb_li_devices, device);
return device;