summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2016-09-20 13:40:31 -0300
committerBruno Dilly <bdilly@profusion.mobi>2016-09-26 22:06:59 -0300
commitcdc5ecec1e5ee37d4de57f20a627ceba7d39ceca (patch)
tree47baff5ad1fc9ef507764b419800f0be0208c1f9
parentfc66dd62b73a07ca00a29fef70a69dc2bfd21d05 (diff)
downloadefl-cdc5ecec1e5ee37d4de57f20a627ceba7d39ceca.tar.gz
Efl_Input_Device: Implement efl_input_device_parent_set().
This commits moves the parent_set implementation where it should be.
-rw-r--r--src/lib/efl/interfaces/efl_input_device.c19
-rw-r--r--src/lib/efl/interfaces/efl_input_device.eo4
-rw-r--r--src/lib/evas/canvas/evas_device.c17
3 files changed, 23 insertions, 17 deletions
diff --git a/src/lib/efl/interfaces/efl_input_device.c b/src/lib/efl/interfaces/efl_input_device.c
index 6e51972779..1c79e5bee6 100644
--- a/src/lib/efl/interfaces/efl_input_device.c
+++ b/src/lib/efl/interfaces/efl_input_device.c
@@ -103,4 +103,23 @@ _efl_input_device_parent_get(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
return pd->parent;
}
+EOLIAN static void
+_efl_input_device_parent_set(Eo *obj, Efl_Input_Device_Data *pd, Efl_Input_Device *parent)
+{
+ if (pd->parent == parent) return;
+ if (pd->parent)
+ {
+ Efl_Input_Device_Data *p = efl_data_scope_get(pd->parent, EFL_INPUT_DEVICE_CLASS);
+ p->children = eina_list_remove(p->children, obj);
+ efl_unref(obj);
+ }
+ pd->parent = parent;
+ if (parent)
+ {
+ Efl_Input_Device_Data *p = efl_data_scope_get(parent, EFL_INPUT_DEVICE_CLASS);
+ p->children = eina_list_append(p->children, obj);
+ efl_ref(obj);
+ }
+}
+
#include "interfaces/efl_input_device.eo.c"
diff --git a/src/lib/efl/interfaces/efl_input_device.eo b/src/lib/efl/interfaces/efl_input_device.eo
index 14f4470ec6..35052cabac 100644
--- a/src/lib/efl/interfaces/efl_input_device.eo
+++ b/src/lib/efl/interfaces/efl_input_device.eo
@@ -39,7 +39,7 @@ enum Efl.Input.Device.Sub_Class
/* This represents Evas_Device */
-/* FIXME: no parent, no children and no Evas */
+/* FIXME: no children and no Evas */
class Efl.Input.Device (Efl.Object)
{
@@ -75,7 +75,7 @@ class Efl.Input.Device (Efl.Object)
}
}
@property parent {
- /* set {} */
+ set {}
get {}
values {
parent: Efl.Input.Device;
diff --git a/src/lib/evas/canvas/evas_device.c b/src/lib/evas/canvas/evas_device.c
index 228009fa87..6285264d6b 100644
--- a/src/lib/evas/canvas/evas_device.c
+++ b/src/lib/evas/canvas/evas_device.c
@@ -155,24 +155,11 @@ evas_device_parent_set(Evas_Device *dev, Evas_Device *parent)
SAFETY_CHECK(parent, EFL_INPUT_DEVICE_CLASS);
}
- /* FIXME: move this to Efl.Input.Device */
- if (d->parent == parent) return;
- if (d->parent)
- {
- Efl_Input_Device_Data *p = efl_data_scope_get(d->parent, EFL_INPUT_DEVICE_CLASS);
- p->children = eina_list_remove(p->children, dev);
- }
- else if (parent)
- e->devices = eina_list_remove(e->devices, dev);
- d->parent = parent;
+ efl_input_device_parent_set(dev, parent);
if (parent)
- {
- Efl_Input_Device_Data *p = efl_data_scope_get(parent, EFL_INPUT_DEVICE_CLASS);
- p->children = eina_list_append(p->children, dev);
- }
+ e->devices = eina_list_remove(e->devices, dev);
else
e->devices = eina_list_append(e->devices, dev);
-
evas_event_callback_call(d->evas, EVAS_CALLBACK_DEVICE_CHANGED, dev);
}