forked from enlightenment/efl
evas: Remove device "parent", "name" and "description" properties
Those are now merged with Efl.Object parent, name and comment. The reasoning is that only seats can be parent devices; And name and description are not only name clashes but also not extremely useful anyway. Tested with VNC. Fixes T5540
This commit is contained in:
parent
67295ed747
commit
83d18617b4
|
@ -56,11 +56,11 @@ _mouse_pos_print(void *data)
|
||||||
if (!seat)
|
if (!seat)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Could not fetch the seat from mouse '%s'\n",
|
fprintf(stderr, "Could not fetch the seat from mouse '%s'\n",
|
||||||
efl_input_device_name_get(pointer));
|
efl_name_get(pointer));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
printf("Mouse from seat '%s' is at (%d, %d)\n",
|
printf("Mouse from seat '%s' is at (%d, %d)\n",
|
||||||
efl_input_device_name_get(seat), x, y);
|
efl_name_get(seat), x, y);
|
||||||
}
|
}
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -109,14 +109,14 @@ _seat_children_print(Efl_Input_Device *seat)
|
||||||
Efl_Input_Device *child;
|
Efl_Input_Device *child;
|
||||||
Eina_Iterator *it;
|
Eina_Iterator *it;
|
||||||
|
|
||||||
printf("Children of seat: %s (%s, seat id: %d)\n", efl_input_device_name_get(seat),
|
printf("Children of seat: %s (%s, seat id: %d)\n", efl_name_get(seat),
|
||||||
_device_type_to_string(efl_input_device_type_get(seat)),
|
_device_type_to_string(efl_input_device_type_get(seat)),
|
||||||
efl_input_device_seat_id_get(seat));
|
efl_input_device_seat_id_get(seat));
|
||||||
|
|
||||||
it = efl_input_device_children_iterate(seat);
|
it = efl_input_device_children_iterate(seat);
|
||||||
EINA_ITERATOR_FOREACH(it, child)
|
EINA_ITERATOR_FOREACH(it, child)
|
||||||
{
|
{
|
||||||
printf(" - Sub device: %s (%s, seat id: %d)\n", efl_input_device_name_get(child),
|
printf(" - Sub device: %s (%s, seat id: %d)\n", efl_name_get(child),
|
||||||
_device_type_to_string(efl_input_device_type_get(child)),
|
_device_type_to_string(efl_input_device_type_get(child)),
|
||||||
efl_input_device_seat_id_get(seat));
|
efl_input_device_seat_id_get(seat));
|
||||||
}
|
}
|
||||||
|
@ -135,10 +135,10 @@ _device_added(void *data, const Efl_Event *event)
|
||||||
if (!seat)
|
if (!seat)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Could not fetch the seat from pointer '%s'\n",
|
fprintf(stderr, "Could not fetch the seat from pointer '%s'\n",
|
||||||
efl_input_device_name_get(pointer));
|
efl_name_get(pointer));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printf("Setting cursor image at seat '%s'\n", efl_input_device_name_get(seat));
|
printf("Setting cursor image at seat '%s'\n", efl_name_get(seat));
|
||||||
_cursor_set(data, pointer);
|
_cursor_set(data, pointer);
|
||||||
_seat_children_print(seat);
|
_seat_children_print(seat);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ _keyboard_event(void *data EINA_UNUSED, int type, void *event)
|
||||||
seat = efl_input_device_seat_get(e->dev);
|
seat = efl_input_device_seat_get(e->dev);
|
||||||
|
|
||||||
printf("The keyboard on seat '%s' %s the key '%s'\n", seat ?
|
printf("The keyboard on seat '%s' %s the key '%s'\n", seat ?
|
||||||
efl_input_device_name_get(seat) : "default",
|
efl_name_get(seat) : "default",
|
||||||
type == ECORE_EVENT_KEY_DOWN ? "pressed" : "released",
|
type == ECORE_EVENT_KEY_DOWN ? "pressed" : "released",
|
||||||
e->keyname);
|
e->keyname);
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ _mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||||
seat = efl_input_device_seat_get(e->dev);
|
seat = efl_input_device_seat_get(e->dev);
|
||||||
|
|
||||||
printf("The mouse on seat '%s' is at X: %d Y:%d\n",
|
printf("The mouse on seat '%s' is at X: %d Y:%d\n",
|
||||||
seat ? efl_input_device_name_get(seat) : "default", e->x, e->y);
|
seat ? efl_name_get(seat) : "default", e->x, e->y);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ _mouse_button(void *data EINA_UNUSED, int type, void *event)
|
||||||
seat = efl_input_device_seat_get(e->dev);
|
seat = efl_input_device_seat_get(e->dev);
|
||||||
|
|
||||||
printf("The mouse on seat '%s' %s the following button '%d'\n",
|
printf("The mouse on seat '%s' %s the following button '%d'\n",
|
||||||
seat ? efl_input_device_name_get(seat) : "default",
|
seat ? efl_name_get(seat) : "default",
|
||||||
type == ECORE_EVENT_MOUSE_BUTTON_DOWN ? "pressed" : "released",
|
type == ECORE_EVENT_MOUSE_BUTTON_DOWN ? "pressed" : "released",
|
||||||
e->buttons);
|
e->buttons);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
|
@ -128,7 +128,7 @@ _mouse_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||||
seat = efl_input_device_seat_get(e->dev);
|
seat = efl_input_device_seat_get(e->dev);
|
||||||
|
|
||||||
printf("The mouse on seat '%s' moved the wheel '%s'\n",
|
printf("The mouse on seat '%s' moved the wheel '%s'\n",
|
||||||
seat ? efl_input_device_name_get(seat) : "default",
|
seat ? efl_name_get(seat) : "default",
|
||||||
e->z < 0 ? "up" : "down");
|
e->z < 0 ? "up" : "down");
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
@ -165,14 +165,14 @@ _seat_children_print(Efl_Input_Device *seat)
|
||||||
Efl_Input_Device *child;
|
Efl_Input_Device *child;
|
||||||
Eina_Iterator *it;
|
Eina_Iterator *it;
|
||||||
|
|
||||||
printf("Children of seat: %s (%s, seat id: %d)\n", efl_input_device_name_get(seat),
|
printf("Children of seat: %s (%s, seat id: %d)\n", efl_name_get(seat),
|
||||||
_device_type_to_string(efl_input_device_type_get(seat)),
|
_device_type_to_string(efl_input_device_type_get(seat)),
|
||||||
efl_input_device_seat_id_get(seat));
|
efl_input_device_seat_id_get(seat));
|
||||||
|
|
||||||
it = efl_input_device_children_iterate(seat);
|
it = efl_input_device_children_iterate(seat);
|
||||||
EINA_ITERATOR_FOREACH(it, child)
|
EINA_ITERATOR_FOREACH(it, child)
|
||||||
{
|
{
|
||||||
printf(" - Sub device: %s (%s, seat id: %d)\n", efl_input_device_name_get(child),
|
printf(" - Sub device: %s (%s, seat id: %d)\n", efl_name_get(child),
|
||||||
_device_type_to_string(efl_input_device_type_get(child)),
|
_device_type_to_string(efl_input_device_type_get(child)),
|
||||||
efl_input_device_seat_id_get(seat));
|
efl_input_device_seat_id_get(seat));
|
||||||
}
|
}
|
||||||
|
@ -185,9 +185,9 @@ _dev_added_or_removed(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
Efl_Input_Device *dev = event->info;
|
Efl_Input_Device *dev = event->info;
|
||||||
|
|
||||||
printf("The device '%s' - class: '%s' - description: '%s' was '%s'\n",
|
printf("The device '%s' - class: '%s' - description: '%s' was '%s'\n",
|
||||||
efl_input_device_name_get(dev),
|
efl_name_get(dev),
|
||||||
_device_type_to_string(efl_input_device_type_get(dev)),
|
_device_type_to_string(efl_input_device_type_get(dev)),
|
||||||
efl_input_device_description_get(dev),
|
efl_comment_get(dev),
|
||||||
event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED ? "added" : "removed");
|
event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED ? "added" : "removed");
|
||||||
|
|
||||||
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_CLASS_SEAT)
|
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||||
|
|
|
@ -19,7 +19,7 @@ _keyboard_event(void *data EINA_UNUSED, int type, void *event)
|
||||||
seat = efl_input_device_seat_get(e->dev);
|
seat = efl_input_device_seat_get(e->dev);
|
||||||
|
|
||||||
printf("The keyboard on seat '%s' %s the key '%s'\n", seat ?
|
printf("The keyboard on seat '%s' %s the key '%s'\n", seat ?
|
||||||
efl_input_device_name_get(seat) : "unknown",
|
efl_name_get(seat) : "unknown",
|
||||||
type == ECORE_EVENT_KEY_DOWN ? "pressed" : "released",
|
type == ECORE_EVENT_KEY_DOWN ? "pressed" : "released",
|
||||||
e->keyname);
|
e->keyname);
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ _mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||||
seat = efl_input_device_seat_get(e->dev);
|
seat = efl_input_device_seat_get(e->dev);
|
||||||
|
|
||||||
printf("The mouse on seat '%s' is at X: %d Y:%d\n",
|
printf("The mouse on seat '%s' is at X: %d Y:%d\n",
|
||||||
seat ? efl_input_device_name_get(seat) : "unknown", e->x, e->y);
|
seat ? efl_name_get(seat) : "unknown", e->x, e->y);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ _mouse_button(void *data EINA_UNUSED, int type, void *event)
|
||||||
seat = efl_input_device_seat_get(e->dev);
|
seat = efl_input_device_seat_get(e->dev);
|
||||||
|
|
||||||
printf("The mouse on seat '%s' %s the following button '%d'\n",
|
printf("The mouse on seat '%s' %s the following button '%d'\n",
|
||||||
seat ? efl_input_device_name_get(seat) : "unknown",
|
seat ? efl_name_get(seat) : "unknown",
|
||||||
type == ECORE_EVENT_MOUSE_BUTTON_DOWN ? "pressed" : "released",
|
type == ECORE_EVENT_MOUSE_BUTTON_DOWN ? "pressed" : "released",
|
||||||
e->buttons);
|
e->buttons);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
|
@ -66,7 +66,7 @@ _mouse_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||||
seat = efl_input_device_seat_get(e->dev);
|
seat = efl_input_device_seat_get(e->dev);
|
||||||
|
|
||||||
printf("The mouse on seat '%s' moved the wheel '%s'\n",
|
printf("The mouse on seat '%s' moved the wheel '%s'\n",
|
||||||
seat ? efl_input_device_name_get(seat) : "unknown",
|
seat ? efl_name_get(seat) : "unknown",
|
||||||
e->z < 0 ? "up" : "down");
|
e->z < 0 ? "up" : "down");
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
@ -103,9 +103,9 @@ _dev_added_or_removed(void *data, const Efl_Event *event)
|
||||||
Efl_Input_Device *dev = event->info;
|
Efl_Input_Device *dev = event->info;
|
||||||
|
|
||||||
printf("The device %p '%s' - class: '%s' - desc: '%s' was '%s' on ee %p\n",
|
printf("The device %p '%s' - class: '%s' - desc: '%s' was '%s' on ee %p\n",
|
||||||
dev, efl_input_device_name_get(dev),
|
dev, efl_name_get(dev),
|
||||||
_device_type_to_string(efl_input_device_type_get(dev)),
|
_device_type_to_string(efl_input_device_type_get(dev)),
|
||||||
efl_input_device_description_get(dev),
|
efl_comment_get(dev),
|
||||||
event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED ? "added" : "removed",
|
event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED ? "added" : "removed",
|
||||||
data);
|
data);
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ _dev_changed(void *data, const Efl_Event *event)
|
||||||
Efl_Input_Device *dev = event->info;
|
Efl_Input_Device *dev = event->info;
|
||||||
|
|
||||||
printf("The device %p '%s' - class: '%s' was changed on ee %p\n",
|
printf("The device %p '%s' - class: '%s' was changed on ee %p\n",
|
||||||
dev, efl_input_device_name_get(dev),
|
dev, efl_name_get(dev),
|
||||||
_device_type_to_string(efl_input_device_type_get(dev)), data);
|
_device_type_to_string(efl_input_device_type_get(dev)), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ _focus_obj_in_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
/* it always will print the default seat name, since FOCUS_OBJECT
|
/* it always will print the default seat name, since FOCUS_OBJECT
|
||||||
isn't setting a specific seat */
|
isn't setting a specific seat */
|
||||||
printf("Focus set to object %s (seat %s)\n", evas_object_name_get(rect),
|
printf("Focus set to object %s (seat %s)\n", evas_object_name_get(rect),
|
||||||
efl_input_device_name_get(efl_input_device_get(ev)));
|
efl_name_get(efl_input_device_get(ev)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -75,7 +75,7 @@ _focus_obj_out_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
Efl_Input_Focus *ev = event->info;
|
Efl_Input_Focus *ev = event->info;
|
||||||
Evas_Object *rect = event->object;
|
Evas_Object *rect = event->object;
|
||||||
printf("Focus unset to object %s (seat %s)\n", evas_object_name_get(rect),
|
printf("Focus unset to object %s (seat %s)\n", evas_object_name_get(rect),
|
||||||
efl_input_device_name_get(efl_input_device_get(ev)));
|
efl_name_get(efl_input_device_get(ev)));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -52,13 +52,13 @@ _device_rename(Efl_Input_Device *dev)
|
||||||
{
|
{
|
||||||
if (!default_seat) {
|
if (!default_seat) {
|
||||||
default_seat = dev;
|
default_seat = dev;
|
||||||
efl_input_device_name_set(dev, "default");
|
efl_name_set(dev, "default");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!secondary_seat) {
|
if (!secondary_seat) {
|
||||||
secondary_seat = dev;
|
secondary_seat = dev;
|
||||||
efl_input_device_name_set(dev, "secondary");
|
efl_name_set(dev, "secondary");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,9 +78,9 @@ _device_changed(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
Efl_Input_Device *dev = event->info;
|
Efl_Input_Device *dev = event->info;
|
||||||
|
|
||||||
if (dev == default_seat)
|
if (dev == default_seat)
|
||||||
efl_input_device_name_set(dev, "default");
|
efl_name_set(dev, "default");
|
||||||
else if (dev == secondary_seat)
|
else if (dev == secondary_seat)
|
||||||
efl_input_device_name_set(dev, "secondary");
|
efl_name_set(dev, "secondary");
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -72,7 +72,7 @@ _on_rect_focus_in(void *data, const Efl_Event *event)
|
||||||
name = edje_obj_seat_name_get(edje_obj, seat);
|
name = edje_obj_seat_name_get(edje_obj, seat);
|
||||||
|
|
||||||
printf("Seat %s (%s) focused the rect object\n",
|
printf("Seat %s (%s) focused the rect object\n",
|
||||||
efl_input_device_name_get(seat), name);
|
efl_name_get(seat), name);
|
||||||
|
|
||||||
if (!strcmp(name, "seat1"))
|
if (!strcmp(name, "seat1"))
|
||||||
evas_object_color_set(rect, 200, 0, 0, 255);
|
evas_object_color_set(rect, 200, 0, 0, 255);
|
||||||
|
@ -97,7 +97,7 @@ _on_rect_focus_out(void *data, const Efl_Event *event)
|
||||||
name = edje_obj_seat_name_get(edje_obj, seat);
|
name = edje_obj_seat_name_get(edje_obj, seat);
|
||||||
|
|
||||||
printf("Seat %s (%s) unfocused the rect object\n",
|
printf("Seat %s (%s) unfocused the rect object\n",
|
||||||
efl_input_device_name_get(seat), name);
|
efl_name_get(seat), name);
|
||||||
evas_object_color_set(rect, 200, 200, 200, 255);
|
evas_object_color_set(rect, 200, 200, 200, 255);
|
||||||
|
|
||||||
efl_canvas_object_seat_focus_add(edje_obj, seat);
|
efl_canvas_object_seat_focus_add(edje_obj, seat);
|
||||||
|
@ -112,7 +112,7 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *o, void *event_info)
|
||||||
Evas *evas = data;
|
Evas *evas = data;
|
||||||
|
|
||||||
seat = efl_input_device_seat_get(ev->dev);
|
seat = efl_input_device_seat_get(ev->dev);
|
||||||
printf("Seat %s (%s) pressed key %s\n", efl_input_device_name_get(seat),
|
printf("Seat %s (%s) pressed key %s\n", efl_name_get(seat),
|
||||||
edje_obj_seat_name_get(o, seat), ev->key);
|
edje_obj_seat_name_get(o, seat), ev->key);
|
||||||
|
|
||||||
mods = evas_key_modifier_get(evas);
|
mods = evas_key_modifier_get(evas);
|
||||||
|
@ -141,7 +141,7 @@ _on_drag_started(void *data EINA_UNUSED, Evas_Object *o, const char *emission, c
|
||||||
seat_name_str = emission + strlen("drag,start,");
|
seat_name_str = emission + strlen("drag,start,");
|
||||||
seat_name = eina_stringshare_add(seat_name_str);
|
seat_name = eina_stringshare_add(seat_name_str);
|
||||||
seat = edje_obj_seat_get(o, seat_name);
|
seat = edje_obj_seat_get(o, seat_name);
|
||||||
printf("Seat %s (%s) started drag %s\n", efl_input_device_name_get(seat),
|
printf("Seat %s (%s) started drag %s\n", efl_name_get(seat),
|
||||||
seat_name, source);
|
seat_name, source);
|
||||||
eina_stringshare_del(seat_name);
|
eina_stringshare_del(seat_name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ _allowed_seat_get(Evas_Object *filtered_obj,
|
||||||
{
|
{
|
||||||
printf("The '%s' shall only receive events from seat '%s'\n",
|
printf("The '%s' shall only receive events from seat '%s'\n",
|
||||||
evas_object_name_get(filtered_obj),
|
evas_object_name_get(filtered_obj),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
allowed_seat_changed = EINA_TRUE;
|
allowed_seat_changed = EINA_TRUE;
|
||||||
*allowed_seat = seat;
|
*allowed_seat = seat;
|
||||||
efl_input_seat_event_filter_set(filtered_obj, seat, EINA_TRUE);
|
efl_input_seat_event_filter_set(filtered_obj, seat, EINA_TRUE);
|
||||||
|
@ -78,7 +78,7 @@ _allowed_seat_get(Evas_Object *filtered_obj,
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: The '%s' could not be focused by the seat '%s'\n",
|
fprintf(stderr, "ERROR: The '%s' could not be focused by the seat '%s'\n",
|
||||||
evas_object_name_get(filtered_obj),
|
evas_object_name_get(filtered_obj),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ _allowed_seat_get(Evas_Object *filtered_obj,
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: The '%s' should not be focused by the seat '%s'\n",
|
fprintf(stderr, "ERROR: The '%s' should not be focused by the seat '%s'\n",
|
||||||
evas_object_name_get(filtered_obj),
|
evas_object_name_get(filtered_obj),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,13 +138,13 @@ _obj_events_cb(void *data, const Efl_Event *event)
|
||||||
fprintf(stderr, "ERROR: The object '%s' should not receive the event"
|
fprintf(stderr, "ERROR: The object '%s' should not receive the event"
|
||||||
"'%s' from the seat '%s'\n",
|
"'%s' from the seat '%s'\n",
|
||||||
evas_object_name_get(event->object), event_name,
|
evas_object_name_get(event->object), event_name,
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
ecore_main_loop_quit();
|
ecore_main_loop_quit();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("The object '%s' recevied a '%s' event from seat '%s'\n",
|
printf("The object '%s' recevied a '%s' event from seat '%s'\n",
|
||||||
evas_object_name_get(event->object), event_name,
|
evas_object_name_get(event->object), event_name,
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -40,7 +40,7 @@ _canvas_focus_in_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
|
|
||||||
printf("Object %s was focused by seat %s\n",
|
printf("Object %s was focused by seat %s\n",
|
||||||
evas_object_name_get(focused),
|
evas_object_name_get(focused),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -55,7 +55,7 @@ _hold_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
printf("Hold %s at object %s from seat %s\n",
|
printf("Hold %s at object %s from seat %s\n",
|
||||||
efl_input_hold_get(ev) ? "on" : "off",
|
efl_input_hold_get(ev) ? "on" : "off",
|
||||||
evas_object_name_get(event->object),
|
evas_object_name_get(event->object),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -70,7 +70,7 @@ _focus_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
printf("Focus %s at object %s from seat %s\n",
|
printf("Focus %s at object %s from seat %s\n",
|
||||||
event->desc == EFL_EVENT_FOCUS_IN ? "in" : "out",
|
event->desc == EFL_EVENT_FOCUS_IN ? "in" : "out",
|
||||||
evas_object_name_get(event->object),
|
evas_object_name_get(event->object),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -85,7 +85,7 @@ _pointer_in_out_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
printf("Pointer %s at object %s from seat %s\n",
|
printf("Pointer %s at object %s from seat %s\n",
|
||||||
event->desc == EFL_EVENT_POINTER_IN ? "in" : "out",
|
event->desc == EFL_EVENT_POINTER_IN ? "in" : "out",
|
||||||
evas_object_name_get(event->object),
|
evas_object_name_get(event->object),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -115,7 +115,7 @@ _pointer_down_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
|
|
||||||
printf("%s at object %s from seat %s\n", buf,
|
printf("%s at object %s from seat %s\n", buf,
|
||||||
evas_object_name_get(event->object),
|
evas_object_name_get(event->object),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -130,7 +130,7 @@ _pointer_up_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
printf("Pointer button %i up at object %s from seat %s\n",
|
printf("Pointer button %i up at object %s from seat %s\n",
|
||||||
efl_input_pointer_button_get(ev),
|
efl_input_pointer_button_get(ev),
|
||||||
evas_object_name_get(event->object),
|
evas_object_name_get(event->object),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -146,7 +146,7 @@ _pointer_move_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
efl_input_pointer_value_get(ev, EFL_INPUT_VALUE_X),
|
efl_input_pointer_value_get(ev, EFL_INPUT_VALUE_X),
|
||||||
efl_input_pointer_value_get(ev, EFL_INPUT_VALUE_Y),
|
efl_input_pointer_value_get(ev, EFL_INPUT_VALUE_Y),
|
||||||
evas_object_name_get(event->object),
|
evas_object_name_get(event->object),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -162,7 +162,7 @@ _pointer_wheel_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
efl_input_pointer_wheel_direction_get(ev),
|
efl_input_pointer_wheel_direction_get(ev),
|
||||||
efl_input_pointer_wheel_delta_get(ev),
|
efl_input_pointer_wheel_delta_get(ev),
|
||||||
evas_object_name_get(event->object),
|
evas_object_name_get(event->object),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -179,11 +179,11 @@ _key_down_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
printf("Key down: '%s' on object %s from seat %s\n",
|
printf("Key down: '%s' on object %s from seat %s\n",
|
||||||
efl_input_key_name_get(ev),
|
efl_input_key_name_get(ev),
|
||||||
evas_object_name_get(event->object),
|
evas_object_name_get(event->object),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
|
|
||||||
if (evas_seat_key_modifier_is_set(mods, "Control", seat))
|
if (evas_seat_key_modifier_is_set(mods, "Control", seat))
|
||||||
printf("Ctrl is pressed by seat %s\n",
|
printf("Ctrl is pressed by seat %s\n",
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -198,7 +198,7 @@ _key_up_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
printf("Key up: '%s' on object %s from seat %s\n",
|
printf("Key up: '%s' on object %s from seat %s\n",
|
||||||
efl_input_key_name_get(ev),
|
efl_input_key_name_get(ev),
|
||||||
evas_object_name_get(event->object),
|
evas_object_name_get(event->object),
|
||||||
efl_input_device_name_get(seat));
|
efl_name_get(seat));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -210,8 +210,8 @@ _dev_added_or_removed(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
printf("The seat '%s' - description: '%s' was '%s'\n",
|
printf("The seat '%s' - description: '%s' was '%s'\n",
|
||||||
efl_input_device_name_get(dev),
|
efl_name_get(dev),
|
||||||
efl_input_device_description_get(dev),
|
efl_comment_get(dev),
|
||||||
event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED ? "added" : "removed");
|
event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED ? "added" : "removed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,8 +283,8 @@ main(void)
|
||||||
{
|
{
|
||||||
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_CLASS_SEAT)
|
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||||
printf("The seat '%s' - description: '%s' was 'added'\n",
|
printf("The seat '%s' - description: '%s' was 'added'\n",
|
||||||
efl_input_device_name_get(dev),
|
efl_name_get(dev),
|
||||||
efl_input_device_description_get(dev));
|
efl_comment_get(dev));
|
||||||
}
|
}
|
||||||
|
|
||||||
ecore_evas_show(ee);
|
ecore_evas_show(ee);
|
||||||
|
|
|
@ -172,7 +172,7 @@ _edje_focus_in(Edje *ed, Efl_Input_Device *seat)
|
||||||
|
|
||||||
_edje_seat_emit(ed, seat, "focus,in", "");
|
_edje_seat_emit(ed, seat, "focus,in", "");
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
rp = _edje_focused_part_get(ed, efl_input_device_name_get(seat));
|
rp = _edje_focused_part_get(ed, efl_name_get(seat));
|
||||||
if (!rp) return;
|
if (!rp) return;
|
||||||
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||||
(!rp->typedata.text)) return;
|
(!rp->typedata.text)) return;
|
||||||
|
@ -207,7 +207,7 @@ _edje_focus_out(Edje *ed, Efl_Input_Device *seat)
|
||||||
_edje_seat_emit(ed, seat, "focus,out", "");
|
_edje_seat_emit(ed, seat, "focus,out", "");
|
||||||
|
|
||||||
#ifdef HAVE_ECORE_IMF
|
#ifdef HAVE_ECORE_IMF
|
||||||
rp = _edje_focused_part_get(ed, efl_input_device_name_get(seat));
|
rp = _edje_focused_part_get(ed, efl_name_get(seat));
|
||||||
if (!rp) return;
|
if (!rp) return;
|
||||||
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
|
||||||
(!rp->typedata.text)) return;
|
(!rp->typedata.text)) return;
|
||||||
|
|
|
@ -593,7 +593,7 @@ _edje_device_add(Edje *ed, Efl_Input_Device *dev)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
|
|
||||||
if (ed->collection && ed->collection->use_custom_seat_names)
|
if (ed->collection && ed->collection->use_custom_seat_names)
|
||||||
name = eina_stringshare_add(efl_input_device_name_get(dev));
|
name = eina_stringshare_add(efl_name_get(dev));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ed->seats_count++;
|
ed->seats_count++;
|
||||||
|
@ -619,7 +619,7 @@ _edje_device_add(Edje *ed, Efl_Input_Device *dev)
|
||||||
|
|
||||||
seat->device = dev;
|
seat->device = dev;
|
||||||
snprintf(sig, sizeof(sig), "seat,added,%s,%s", seat->name,
|
snprintf(sig, sizeof(sig), "seat,added,%s,%s", seat->name,
|
||||||
efl_input_device_name_get(dev));
|
efl_name_get(dev));
|
||||||
_edje_emit(ed, sig, "");
|
_edje_emit(ed, sig, "");
|
||||||
_edje_seat_event_filter_apply(ed, seat);
|
_edje_seat_event_filter_apply(ed, seat);
|
||||||
|
|
||||||
|
@ -692,7 +692,7 @@ _edje_device_changed_cb(void *data, const Efl_Event *event)
|
||||||
if (!seat)
|
if (!seat)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
name = efl_input_device_name_get(dev);
|
name = efl_name_get(dev);
|
||||||
if (!name)
|
if (!name)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -90,11 +90,8 @@ struct _Efl_Input_Device_Data
|
||||||
{
|
{
|
||||||
Eo *eo;
|
Eo *eo;
|
||||||
Eo *evas; /* Evas */
|
Eo *evas; /* Evas */
|
||||||
Efl_Input_Device *parent; /* no ref */
|
|
||||||
Efl_Input_Device *source; /* ref */
|
Efl_Input_Device *source; /* ref */
|
||||||
Eina_List *children; /* ref */
|
Eina_List *children; /* ref'ed by efl_parent, not by this list */
|
||||||
Eina_Stringshare *name;
|
|
||||||
Eina_Stringshare *desc;
|
|
||||||
unsigned int id;
|
unsigned int id;
|
||||||
Efl_Input_Device_Class klass;
|
Efl_Input_Device_Class klass;
|
||||||
Efl_Input_Device_Sub_Class subclass;
|
Efl_Input_Device_Sub_Class subclass;
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#define EFL_INTERNAL_UNSTABLE
|
#define EFL_INTERNAL_UNSTABLE
|
||||||
#include "efl_common_internal.h"
|
#include "efl_common_internal.h"
|
||||||
|
|
||||||
|
#define MY_CLASS EFL_INPUT_DEVICE_CLASS
|
||||||
|
|
||||||
/* Efl Input Device = Evas Device */
|
/* Efl Input Device = Evas Device */
|
||||||
|
|
||||||
typedef struct _Child_Device_Iterator Child_Device_Iterator;
|
typedef struct _Child_Device_Iterator Child_Device_Iterator;
|
||||||
|
@ -38,7 +40,7 @@ _seat_pointers_update(Efl_Input_Device_Data *seat, Efl_Input_Device_Data *dev)
|
||||||
EOLIAN static Efl_Object *
|
EOLIAN static Efl_Object *
|
||||||
_efl_input_device_efl_object_constructor(Eo *obj, Efl_Input_Device_Data *pd)
|
_efl_input_device_efl_object_constructor(Eo *obj, Efl_Input_Device_Data *pd)
|
||||||
{
|
{
|
||||||
obj = efl_constructor(efl_super(obj, EFL_INPUT_DEVICE_CLASS));
|
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
||||||
pd->eo = obj;
|
pd->eo = obj;
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
@ -46,34 +48,69 @@ _efl_input_device_efl_object_constructor(Eo *obj, Efl_Input_Device_Data *pd)
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_input_device_efl_object_destructor(Eo *obj, Efl_Input_Device_Data *pd)
|
_efl_input_device_efl_object_destructor(Eo *obj, Efl_Input_Device_Data *pd)
|
||||||
{
|
{
|
||||||
Eo *eo_child;
|
pd->children = eina_list_free(pd->children);
|
||||||
|
if (pd->klass != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||||
|
{
|
||||||
|
Efl_Input_Device_Data *p;
|
||||||
|
Eo *seat;
|
||||||
|
|
||||||
eina_stringshare_del(pd->name);
|
seat = efl_input_device_seat_get(obj);
|
||||||
eina_stringshare_del(pd->desc);
|
p = efl_data_scope_get(seat, MY_CLASS);
|
||||||
EINA_LIST_FREE(pd->children, eo_child)
|
if (p) p->children = eina_list_remove(p->children, obj);
|
||||||
{
|
|
||||||
Efl_Input_Device_Data *child = efl_data_scope_get(eo_child, EFL_INPUT_DEVICE_CLASS);
|
|
||||||
child->parent = NULL;
|
|
||||||
}
|
}
|
||||||
if (pd->parent)
|
efl_unref(pd->source);
|
||||||
|
|
||||||
|
return efl_destructor(efl_super(obj, MY_CLASS));
|
||||||
|
}
|
||||||
|
|
||||||
|
EOLIAN static void
|
||||||
|
_efl_input_device_efl_object_parent_set(Eo *obj, Efl_Input_Device_Data *pd EINA_UNUSED, Eo *parent)
|
||||||
{
|
{
|
||||||
Efl_Input_Device_Data *p = efl_data_scope_get(pd->parent, EFL_INPUT_DEVICE_CLASS);
|
Efl_Input_Device_Data *p;
|
||||||
|
|
||||||
|
if (parent)
|
||||||
|
{
|
||||||
|
if (efl_isa(parent, MY_CLASS))
|
||||||
|
{
|
||||||
|
p = efl_data_scope_get(parent, MY_CLASS);
|
||||||
|
EINA_SAFETY_ON_FALSE_RETURN(p->klass == EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||||
|
if (!eina_list_data_find(p->children, obj))
|
||||||
|
{
|
||||||
|
p->children = eina_list_append(p->children, obj);
|
||||||
|
_seat_pointers_update(p, pd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(!efl_isa(parent, EFL_CANVAS_INTERFACE))
|
||||||
|
{
|
||||||
|
EINA_SAFETY_ERROR("The parent of a device must be a seat or the canvas");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Eo *old_parent = efl_parent_get(obj);
|
||||||
|
if (old_parent && efl_isa(old_parent, MY_CLASS))
|
||||||
|
{
|
||||||
|
p = efl_data_scope_get(old_parent, MY_CLASS);
|
||||||
p->children = eina_list_remove(p->children, obj);
|
p->children = eina_list_remove(p->children, obj);
|
||||||
if (_is_pointer(pd))
|
if (_is_pointer(pd))
|
||||||
p->pointer_count--;
|
p->pointer_count--;
|
||||||
}
|
}
|
||||||
efl_unref(pd->source);
|
}
|
||||||
|
|
||||||
return efl_destructor(efl_super(obj, EFL_INPUT_DEVICE_CLASS));
|
efl_parent_set(efl_super(obj, MY_CLASS), parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_input_device_device_type_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, Efl_Input_Device_Class klass)
|
_efl_input_device_device_type_set(Eo *obj, Efl_Input_Device_Data *pd, Efl_Input_Device_Class klass)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_TRUE_RETURN(pd->klass);
|
EINA_SAFETY_ON_TRUE_RETURN(pd->klass);
|
||||||
pd->klass = klass;
|
pd->klass = klass;
|
||||||
if (klass != EFL_INPUT_DEVICE_CLASS_SEAT)
|
if (klass != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||||
_seat_pointers_update(efl_data_scope_get(pd->parent, EFL_INPUT_DEVICE_CLASS), pd);
|
{
|
||||||
|
Efl_Input_Device_Data *seat = efl_data_scope_get(efl_input_device_seat_get(obj), MY_CLASS);
|
||||||
|
_seat_pointers_update(seat, pd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Efl_Input_Device_Class
|
EOLIAN static Efl_Input_Device_Class
|
||||||
|
@ -108,30 +145,6 @@ _efl_input_device_source_get(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
|
||||||
return pd->source;
|
return pd->source;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
|
||||||
_efl_input_device_name_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, const char *name)
|
|
||||||
{
|
|
||||||
eina_stringshare_replace(&pd->name, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
EOLIAN static const char *
|
|
||||||
_efl_input_device_name_get(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
|
|
||||||
{
|
|
||||||
return pd->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
EOLIAN static void
|
|
||||||
_efl_input_device_description_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, const char *desc)
|
|
||||||
{
|
|
||||||
eina_stringshare_replace(&pd->desc, desc);
|
|
||||||
}
|
|
||||||
|
|
||||||
EOLIAN static const char *
|
|
||||||
_efl_input_device_description_get(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
|
|
||||||
{
|
|
||||||
return pd->desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_input_device_seat_id_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, unsigned int id)
|
_efl_input_device_seat_id_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, unsigned int id)
|
||||||
{
|
{
|
||||||
|
@ -148,46 +161,20 @@ _efl_input_device_seat_id_get(Eo *obj, Efl_Input_Device_Data *pd)
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Efl_Input_Device *
|
EOLIAN static Efl_Input_Device *
|
||||||
_efl_input_device_seat_get(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
|
_efl_input_device_seat_get(Eo *obj, Efl_Input_Device_Data *pd)
|
||||||
{
|
{
|
||||||
while (1)
|
for (; obj; obj = efl_parent_get(obj))
|
||||||
{
|
{
|
||||||
if (pd->klass == EFL_INPUT_DEVICE_CLASS_SEAT)
|
if (pd->klass == EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||||
return pd->eo;
|
return pd->eo;
|
||||||
|
|
||||||
if (!pd->parent)
|
if (!efl_isa(obj, MY_CLASS)) break;
|
||||||
break;
|
pd = efl_data_scope_get(obj, MY_CLASS);
|
||||||
|
|
||||||
pd = efl_data_scope_get(pd->parent, EFL_INPUT_DEVICE_CLASS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Efl_Input_Device *
|
|
||||||
_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);
|
|
||||||
}
|
|
||||||
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);
|
|
||||||
_seat_pointers_update(p, pd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_child_device_iterator_next(Child_Device_Iterator *it, void **data)
|
_child_device_iterator_next(Child_Device_Iterator *it, void **data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -67,24 +67,6 @@ class Efl.Input.Device (Efl.Object)
|
||||||
src: Efl.Input.Device; [[Input device]]
|
src: Efl.Input.Device; [[Input device]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@property name {
|
|
||||||
[[device name property]]
|
|
||||||
values {
|
|
||||||
name: string; [[Input device name]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@property description {
|
|
||||||
[[device description property]]
|
|
||||||
values {
|
|
||||||
desc: string; [[Input device description]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@property parent {
|
|
||||||
[[Device parent property]]
|
|
||||||
values {
|
|
||||||
parent: Efl.Input.Device; [[Parent input device]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@property seat {
|
@property seat {
|
||||||
[[Get the @Efl.Input.Device that represents a seat.
|
[[Get the @Efl.Input.Device that represents a seat.
|
||||||
|
|
||||||
|
@ -113,7 +95,7 @@ class Efl.Input.Device (Efl.Object)
|
||||||
children_iterate {
|
children_iterate {
|
||||||
[[Lists the children attached to this device.
|
[[Lists the children attached to this device.
|
||||||
|
|
||||||
This is mostly meaningful with seat devices, as they are groups of
|
This is only meaningful with seat devices, as they are groups of
|
||||||
real input devices.
|
real input devices.
|
||||||
|
|
||||||
@since 1.20
|
@since 1.20
|
||||||
|
@ -135,5 +117,6 @@ class Efl.Input.Device (Efl.Object)
|
||||||
implements {
|
implements {
|
||||||
Efl.Object.constructor;
|
Efl.Object.constructor;
|
||||||
Efl.Object.destructor;
|
Efl.Object.destructor;
|
||||||
|
Efl.Object.parent { set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ _new_default_device_find(Evas_Public_Data *e, Evas_Device *old_dev)
|
||||||
|
|
||||||
if (e->cleanup) return NULL;
|
if (e->cleanup) return NULL;
|
||||||
old_class = efl_input_device_type_get(old_dev);
|
old_class = efl_input_device_type_get(old_dev);
|
||||||
old_parent = efl_input_device_parent_get(old_dev);
|
old_parent = efl_parent_get(old_dev);
|
||||||
def = NULL;
|
def = NULL;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(e->devices, l, dev)
|
EINA_LIST_FOREACH(e->devices, l, dev)
|
||||||
|
@ -55,7 +55,7 @@ _new_default_device_find(Evas_Public_Data *e, Evas_Device *old_dev)
|
||||||
|
|
||||||
def = dev;
|
def = dev;
|
||||||
//Prefer devices with the same parent.
|
//Prefer devices with the same parent.
|
||||||
if (efl_input_device_parent_get(dev) == old_parent)
|
if (efl_parent_get(dev) == old_parent)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ evas_device_get(Evas *eo_e, const char *name)
|
||||||
|
|
||||||
EINA_LIST_FOREACH(e->devices, l, dev)
|
EINA_LIST_FOREACH(e->devices, l, dev)
|
||||||
{
|
{
|
||||||
dev_name = efl_input_device_name_get(dev);
|
dev_name = efl_name_get(dev);
|
||||||
|
|
||||||
if (eina_streq(dev_name, name))
|
if (eina_streq(dev_name, name))
|
||||||
return dev;
|
return dev;
|
||||||
|
@ -163,13 +163,12 @@ evas_device_add_full(Evas *eo_e, const char *name, const char *desc,
|
||||||
|
|
||||||
SAFETY_CHECK(eo_e, EVAS_CANVAS_CLASS, NULL);
|
SAFETY_CHECK(eo_e, EVAS_CANVAS_CLASS, NULL);
|
||||||
|
|
||||||
dev = efl_add(EFL_INPUT_DEVICE_CLASS, eo_e,
|
dev = efl_add(EFL_INPUT_DEVICE_CLASS, parent_dev ?: eo_e,
|
||||||
efl_input_device_name_set(efl_added, name),
|
efl_name_set(efl_added, name),
|
||||||
efl_input_device_description_set(efl_added, desc),
|
efl_comment_set(efl_added, desc),
|
||||||
efl_input_device_type_set(efl_added, clas),
|
efl_input_device_type_set(efl_added, clas),
|
||||||
efl_input_device_subtype_set(efl_added, sub_clas),
|
efl_input_device_subtype_set(efl_added, sub_clas),
|
||||||
efl_input_device_source_set(efl_added, emulation_dev),
|
efl_input_device_source_set(efl_added, emulation_dev));
|
||||||
efl_input_device_parent_set(efl_added, parent_dev));
|
|
||||||
|
|
||||||
d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
|
d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
|
||||||
d->evas = eo_e;
|
d->evas = eo_e;
|
||||||
|
@ -281,14 +280,14 @@ evas_device_name_set(Evas_Device *dev, const char *name)
|
||||||
|
|
||||||
Efl_Input_Device_Data *d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
|
Efl_Input_Device_Data *d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
|
||||||
|
|
||||||
efl_input_device_name_set(dev, name);
|
efl_name_set(dev, name);
|
||||||
evas_event_callback_call(d->evas, EVAS_CALLBACK_DEVICE_CHANGED, dev);
|
evas_event_callback_call(d->evas, EVAS_CALLBACK_DEVICE_CHANGED, dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
evas_device_name_get(const Evas_Device *dev)
|
evas_device_name_get(const Evas_Device *dev)
|
||||||
{
|
{
|
||||||
return efl_input_device_name_get(dev);
|
return efl_name_get(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -296,7 +295,7 @@ evas_device_description_set(Evas_Device *dev, const char *desc)
|
||||||
{
|
{
|
||||||
SAFETY_CHECK(dev, EFL_INPUT_DEVICE_CLASS);
|
SAFETY_CHECK(dev, EFL_INPUT_DEVICE_CLASS);
|
||||||
|
|
||||||
efl_input_device_description_set(dev, desc);
|
efl_comment_set(dev, desc);
|
||||||
|
|
||||||
Efl_Input_Device_Data *d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
|
Efl_Input_Device_Data *d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
|
||||||
evas_event_callback_call(d->evas, EVAS_CALLBACK_DEVICE_CHANGED, dev);
|
evas_event_callback_call(d->evas, EVAS_CALLBACK_DEVICE_CHANGED, dev);
|
||||||
|
@ -305,12 +304,16 @@ evas_device_description_set(Evas_Device *dev, const char *desc)
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
evas_device_description_get(const Evas_Device *dev)
|
evas_device_description_get(const Evas_Device *dev)
|
||||||
{
|
{
|
||||||
return efl_input_device_description_get(dev);
|
return efl_comment_get(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_device_parent_set(Evas_Device *dev, Evas_Device *parent)
|
evas_device_parent_set(Evas_Device *dev, Evas_Device *parent)
|
||||||
{
|
{
|
||||||
|
// Note: This function should be deprecated. parent_set doesn't make sense
|
||||||
|
// unless the parent is a seat device. Parent shouldn't be changed after
|
||||||
|
// creation.
|
||||||
|
|
||||||
SAFETY_CHECK(dev, EFL_INPUT_DEVICE_CLASS);
|
SAFETY_CHECK(dev, EFL_INPUT_DEVICE_CLASS);
|
||||||
|
|
||||||
Efl_Input_Device_Data *d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
|
Efl_Input_Device_Data *d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
|
||||||
|
@ -318,15 +321,24 @@ evas_device_parent_set(Evas_Device *dev, Evas_Device *parent)
|
||||||
{
|
{
|
||||||
SAFETY_CHECK(parent, EFL_INPUT_DEVICE_CLASS);
|
SAFETY_CHECK(parent, EFL_INPUT_DEVICE_CLASS);
|
||||||
}
|
}
|
||||||
|
else if (efl_parent_get(dev))
|
||||||
|
{
|
||||||
|
efl_ref(dev);
|
||||||
|
}
|
||||||
|
|
||||||
efl_input_device_parent_set(dev, parent);
|
efl_parent_set(dev, parent);
|
||||||
evas_event_callback_call(d->evas, EVAS_CALLBACK_DEVICE_CHANGED, dev);
|
evas_event_callback_call(d->evas, EVAS_CALLBACK_DEVICE_CHANGED, dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const Evas_Device *
|
EAPI const Evas_Device *
|
||||||
evas_device_parent_get(const Evas_Device *dev)
|
evas_device_parent_get(const Evas_Device *dev)
|
||||||
{
|
{
|
||||||
return efl_input_device_parent_get(dev);
|
Eo *parent = efl_parent_get(dev);
|
||||||
|
|
||||||
|
if (!efl_isa(parent, EFL_INPUT_DEVICE_CLASS))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
|
|
@ -3138,7 +3138,7 @@ _key_event_dispatch(Evas_Public_Data *e, void *event_info,
|
||||||
device = e->default_seat;
|
device = e->default_seat;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char *name = efl_input_device_name_get(device);
|
const char *name = efl_name_get(device);
|
||||||
|
|
||||||
device = efl_input_device_seat_get(device);
|
device = efl_input_device_seat_get(device);
|
||||||
if (!device)
|
if (!device)
|
||||||
|
|
Loading…
Reference in New Issue