Hello guys,

Recently I sent this change to ecore_fb_input:
http://trac.enlightenment.org/e/changeset/64447

It changes

ecore_fb_input_device_open(const char *dev)

to

ecore_fb_input_device_open(void *window, const char *dev)

Sorry, I didn't notice that this API was public at that time, but I
also think that it isn't used outside of Ecore. Anyway, I would like
to fix this break before the release.

The options are either reverting this commit (and others related to
it), or applying the attached patch, which would make that function
have the previous signature, but introduces a new function:

So, any objections that I apply this patch now? Or should I just revert it?

-- 
Rafael Antognolli
ProFUSION embedded systems
http://profusion.mobi
diff --git a/ChangeLog b/ChangeLog
index 36790b5..e05a2b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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-23 Rafael Antognolli
+
+        * Add ecore_fb_input_device_window_set().
diff --git a/src/lib/ecore_evas/ecore_evas_fb.c b/src/lib/ecore_evas/ecore_evas_fb.c
index 77d9153..3ee913e 100644
--- a/src/lib/ecore_evas/ecore_evas_fb.c
+++ b/src/lib/ecore_evas/ecore_evas_fb.c
@@ -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);
 
diff --git a/src/lib/ecore_fb/Ecore_Fb.h b/src/lib/ecore_fb/Ecore_Fb.h
index 37b9e1e..069cccd 100644
--- a/src/lib/ecore_fb/Ecore_Fb.h
+++ b/src/lib/ecore_fb/Ecore_Fb.h
@@ -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 */
 
diff --git a/src/lib/ecore_fb/ecore_fb_li.c b/src/lib/ecore_fb/ecore_fb_li.c
index 0b0900c..970869b 100644
--- a/src/lib/ecore_fb/ecore_fb_li.c
+++ b/src/lib/ecore_fb/ecore_fb_li.c
@@ -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;
 
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to