ecore/fb: Bring back the old signature of ecore_fb_input_device_open.
authorantognolli <antognolli@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 24 Nov 2011 21:08:22 +0000 (21:08 +0000)
committerantognolli <antognolli@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 24 Nov 2011 21:08:22 +0000 (21:08 +0000)
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.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@65589 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
src/lib/ecore_evas/ecore_evas_fb.c
src/lib/ecore_fb/Ecore_Fb.h
src/lib/ecore_fb/ecore_fb_li.c

index 36790b5..0440b77 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
         * 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().
index 77d9153..3ee913e 100644 (file)
@@ -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);
 
index 37b9e1e..069cccd 100644 (file)
@@ -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 */
 
index 0b0900c..4a196dd 100644 (file)
@@ -452,6 +452,42 @@ ecore_fb_input_device_listen(Ecore_Fb_Input_Device *dev, Eina_Bool listen)
 #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.
@@ -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;