evas: Rename device Class to Type, remove Sub_Class
1. The word "class" is a pain point with many languages where it's a keyword. Type is a little better. Also, the property was already named "device_type" and not "device_class". 2. Remove Efl.Input.Device.Sub_Class It's not used inside EFL upstream codebase, and unlikely to be used anywhere else (even in Tizen). Hopefully no one used the Efl_ enum types. So far only the Evas_ types should be in used. Ref T5540
This commit is contained in:
parent
83d18617b4
commit
e8f9f109a6
|
@ -49,7 +49,7 @@ _mouse_pos_print(void *data)
|
|||
Evas_Coord x, y;
|
||||
Efl_Input_Device *seat;
|
||||
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_CLASS_MOUSE)
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_TYPE_MOUSE)
|
||||
continue;
|
||||
ecore_evas_pointer_device_xy_get(data, pointer, &x, &y);
|
||||
seat = efl_input_device_seat_get(pointer);
|
||||
|
@ -78,25 +78,25 @@ _cursor_set(Ecore_Evas *ee, Efl_Input_Device *pointer)
|
|||
}
|
||||
|
||||
static const char *
|
||||
_device_type_to_string(Efl_Input_Device_Class klass)
|
||||
_device_type_to_string(Efl_Input_Device_Type klass)
|
||||
{
|
||||
switch (klass)
|
||||
{
|
||||
case EFL_INPUT_DEVICE_CLASS_NONE:
|
||||
case EFL_INPUT_DEVICE_TYPE_NONE:
|
||||
return "None";
|
||||
case EFL_INPUT_DEVICE_CLASS_SEAT:
|
||||
case EFL_INPUT_DEVICE_TYPE_SEAT:
|
||||
return "Seat";
|
||||
case EFL_INPUT_DEVICE_CLASS_KEYBOARD:
|
||||
case EFL_INPUT_DEVICE_TYPE_KEYBOARD:
|
||||
return "Keyboard";
|
||||
case EFL_INPUT_DEVICE_CLASS_MOUSE:
|
||||
case EFL_INPUT_DEVICE_TYPE_MOUSE:
|
||||
return "Mouse";
|
||||
case EFL_INPUT_DEVICE_CLASS_TOUCH:
|
||||
case EFL_INPUT_DEVICE_TYPE_TOUCH:
|
||||
return "Touch";
|
||||
case EFL_INPUT_DEVICE_CLASS_PEN:
|
||||
case EFL_INPUT_DEVICE_TYPE_PEN:
|
||||
return "Pen";
|
||||
case EFL_INPUT_DEVICE_CLASS_WAND:
|
||||
case EFL_INPUT_DEVICE_TYPE_WAND:
|
||||
return "Wand";
|
||||
case EFL_INPUT_DEVICE_CLASS_GAMEPAD:
|
||||
case EFL_INPUT_DEVICE_TYPE_GAMEPAD:
|
||||
return "Gamepad";
|
||||
default:
|
||||
return "Unknown";
|
||||
|
@ -129,7 +129,7 @@ _device_added(void *data, const Efl_Event *event)
|
|||
Efl_Input_Device *pointer = event->info;
|
||||
Efl_Input_Device *seat;
|
||||
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_CLASS_MOUSE)
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_TYPE_MOUSE)
|
||||
return;
|
||||
seat = efl_input_device_seat_get(pointer);
|
||||
if (!seat)
|
||||
|
@ -191,10 +191,10 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
|
|||
{
|
||||
switch (efl_input_device_type_get(dev))
|
||||
{
|
||||
case EFL_INPUT_DEVICE_CLASS_SEAT:
|
||||
case EFL_INPUT_DEVICE_TYPE_SEAT:
|
||||
_seat_children_print(dev);
|
||||
break;
|
||||
case EFL_INPUT_DEVICE_CLASS_MOUSE:
|
||||
case EFL_INPUT_DEVICE_TYPE_MOUSE:
|
||||
_cursor_set(ee, dev);
|
||||
break;
|
||||
default: break;
|
||||
|
|
|
@ -134,25 +134,25 @@ _mouse_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
|||
}
|
||||
|
||||
static const char *
|
||||
_device_type_to_string(Efl_Input_Device_Class klass)
|
||||
_device_type_to_string(Efl_Input_Device_Type klass)
|
||||
{
|
||||
switch (klass)
|
||||
{
|
||||
case EFL_INPUT_DEVICE_CLASS_NONE:
|
||||
case EFL_INPUT_DEVICE_TYPE_NONE:
|
||||
return "None";
|
||||
case EFL_INPUT_DEVICE_CLASS_SEAT:
|
||||
case EFL_INPUT_DEVICE_TYPE_SEAT:
|
||||
return "Seat";
|
||||
case EFL_INPUT_DEVICE_CLASS_KEYBOARD:
|
||||
case EFL_INPUT_DEVICE_TYPE_KEYBOARD:
|
||||
return "Keyboard";
|
||||
case EFL_INPUT_DEVICE_CLASS_MOUSE:
|
||||
case EFL_INPUT_DEVICE_TYPE_MOUSE:
|
||||
return "Mouse";
|
||||
case EFL_INPUT_DEVICE_CLASS_TOUCH:
|
||||
case EFL_INPUT_DEVICE_TYPE_TOUCH:
|
||||
return "Touch";
|
||||
case EFL_INPUT_DEVICE_CLASS_PEN:
|
||||
case EFL_INPUT_DEVICE_TYPE_PEN:
|
||||
return "Pen";
|
||||
case EFL_INPUT_DEVICE_CLASS_WAND:
|
||||
case EFL_INPUT_DEVICE_TYPE_WAND:
|
||||
return "Wand";
|
||||
case EFL_INPUT_DEVICE_CLASS_GAMEPAD:
|
||||
case EFL_INPUT_DEVICE_TYPE_GAMEPAD:
|
||||
return "Gamepad";
|
||||
default:
|
||||
return "Unknown";
|
||||
|
@ -190,7 +190,7 @@ _dev_added_or_removed(void *data EINA_UNUSED, const Efl_Event *event)
|
|||
efl_comment_get(dev),
|
||||
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_TYPE_SEAT)
|
||||
_seat_children_print(dev);
|
||||
}
|
||||
|
||||
|
@ -300,7 +300,7 @@ main(int argc, char *argv[])
|
|||
mouse_wheel = ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL,
|
||||
_mouse_wheel, NULL);
|
||||
|
||||
_seat_children_print(evas_canvas_default_device_get(evas, EFL_INPUT_DEVICE_CLASS_SEAT));
|
||||
_seat_children_print(evas_canvas_default_device_get(evas, EFL_INPUT_DEVICE_TYPE_SEAT));
|
||||
efl_event_callback_add(evas, EFL_CANVAS_EVENT_DEVICE_ADDED,
|
||||
_dev_added_or_removed, NULL);
|
||||
efl_event_callback_add(evas, EFL_CANVAS_EVENT_DEVICE_REMOVED,
|
||||
|
|
|
@ -72,25 +72,25 @@ _mouse_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
|||
}
|
||||
|
||||
static const char *
|
||||
_device_type_to_string(Efl_Input_Device_Class klass)
|
||||
_device_type_to_string(Efl_Input_Device_Type klass)
|
||||
{
|
||||
switch (klass)
|
||||
{
|
||||
case EFL_INPUT_DEVICE_CLASS_NONE:
|
||||
case EFL_INPUT_DEVICE_TYPE_NONE:
|
||||
return "None";
|
||||
case EFL_INPUT_DEVICE_CLASS_SEAT:
|
||||
case EFL_INPUT_DEVICE_TYPE_SEAT:
|
||||
return "Seat";
|
||||
case EFL_INPUT_DEVICE_CLASS_KEYBOARD:
|
||||
case EFL_INPUT_DEVICE_TYPE_KEYBOARD:
|
||||
return "Keyboard";
|
||||
case EFL_INPUT_DEVICE_CLASS_MOUSE:
|
||||
case EFL_INPUT_DEVICE_TYPE_MOUSE:
|
||||
return "Mouse";
|
||||
case EFL_INPUT_DEVICE_CLASS_TOUCH:
|
||||
case EFL_INPUT_DEVICE_TYPE_TOUCH:
|
||||
return "Touch";
|
||||
case EFL_INPUT_DEVICE_CLASS_PEN:
|
||||
case EFL_INPUT_DEVICE_TYPE_PEN:
|
||||
return "Pen";
|
||||
case EFL_INPUT_DEVICE_CLASS_WAND:
|
||||
case EFL_INPUT_DEVICE_TYPE_WAND:
|
||||
return "Wand";
|
||||
case EFL_INPUT_DEVICE_CLASS_GAMEPAD:
|
||||
case EFL_INPUT_DEVICE_TYPE_GAMEPAD:
|
||||
return "Gamepad";
|
||||
default:
|
||||
return "Unknown";
|
||||
|
|
|
@ -67,7 +67,7 @@ _device_added(void *data EINA_UNUSED, const Efl_Event *event)
|
|||
{
|
||||
Efl_Input_Device *dev = event->info;
|
||||
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
return;
|
||||
_device_rename(dev);
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
|
|||
devices = evas_device_list(evas, NULL);
|
||||
EINA_LIST_FOREACH(devices, l, dev)
|
||||
{
|
||||
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
_device_rename(dev);
|
||||
}
|
||||
efl_event_callback_add(evas, EFL_CANVAS_EVENT_DEVICE_ADDED,
|
||||
|
|
|
@ -61,7 +61,7 @@ _device_added(void *data, const Efl_Event *event)
|
|||
Efl_Input_Device *dev = event->info;
|
||||
Evas_Object *edje_obj = data;
|
||||
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
return;
|
||||
|
||||
efl_canvas_object_seat_focus_add(edje_obj, dev);
|
||||
|
@ -104,7 +104,7 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
|
|||
devices = evas_device_list(evas, NULL);
|
||||
EINA_LIST_FOREACH(devices, l, dev)
|
||||
{
|
||||
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
efl_canvas_object_seat_focus_add(edje_obj, dev);
|
||||
|
||||
}
|
||||
|
|
|
@ -183,7 +183,7 @@ _device_added(void *data, const Efl_Event *event)
|
|||
Efl_Input_Device *dev = event->info;
|
||||
Evas_Object *edje_obj = data;
|
||||
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
return;
|
||||
|
||||
efl_canvas_object_seat_focus_add(edje_obj, dev);
|
||||
|
@ -251,7 +251,7 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
|
|||
devices = evas_device_list(evas, NULL);
|
||||
EINA_LIST_FOREACH(devices, l, dev)
|
||||
{
|
||||
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
efl_canvas_object_seat_focus_add(edje_obj, dev);
|
||||
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ _allowed_seat_get(Evas_Object *filtered_obj,
|
|||
devs = evas_device_list(evas_object_evas_get(filtered_obj), NULL);
|
||||
EINA_LIST_FOREACH(devs, l, seat)
|
||||
{
|
||||
if ((efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT) ||
|
||||
if ((efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT) ||
|
||||
(*allowed_seat == seat))
|
||||
continue;
|
||||
if (!allowed_seat_changed)
|
||||
|
@ -162,7 +162,7 @@ _device_added_removed_cb(void *data, const Efl_Event *event)
|
|||
Efl_Input_Device *dev = event->info;
|
||||
Context *ctx = data;
|
||||
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
return;
|
||||
|
||||
if (event->desc == EFL_CANVAS_EVENT_DEVICE_ADDED)
|
||||
|
|
|
@ -206,7 +206,7 @@ _dev_added_or_removed(void *data EINA_UNUSED, const Efl_Event *event)
|
|||
{
|
||||
Efl_Input_Device *dev = event->info;
|
||||
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
return;
|
||||
|
||||
printf("The seat '%s' - description: '%s' was '%s'\n",
|
||||
|
@ -281,7 +281,7 @@ main(void)
|
|||
devices = evas_device_list(canvas, NULL);
|
||||
EINA_LIST_FOREACH(devices, l, dev)
|
||||
{
|
||||
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
printf("The seat '%s' - description: '%s' was 'added'\n",
|
||||
efl_name_get(dev),
|
||||
efl_comment_get(dev));
|
||||
|
|
|
@ -351,7 +351,7 @@ _ecore_evas_cursor_add(Ecore_Evas *ee, Efl_Input_Device *dev)
|
|||
cursor = calloc(1, sizeof(Ecore_Evas_Cursor));
|
||||
EINA_SAFETY_ON_NULL_RETURN(cursor);
|
||||
eina_hash_add(ee->prop.cursors, &seat, cursor);
|
||||
if (seat != evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT)) return;
|
||||
if (seat != evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT)) return;
|
||||
if (ee->prop.cursor_cache.object)
|
||||
{
|
||||
ecore_evas_object_cursor_device_set(ee, dev,
|
||||
|
@ -366,11 +366,11 @@ _ecore_evas_cursor_add(Ecore_Evas *ee, Efl_Input_Device *dev)
|
|||
static inline Eina_Bool
|
||||
_is_pointer(Eo *dev)
|
||||
{
|
||||
Efl_Input_Device_Class c = efl_input_device_type_get(dev);
|
||||
return (c == EFL_INPUT_DEVICE_CLASS_MOUSE) ||
|
||||
(c == EFL_INPUT_DEVICE_CLASS_PEN) ||
|
||||
(c == EFL_INPUT_DEVICE_CLASS_TOUCH) ||
|
||||
(c == EFL_INPUT_DEVICE_CLASS_WAND);
|
||||
Efl_Input_Device_Type c = efl_input_device_type_get(dev);
|
||||
return (c == EFL_INPUT_DEVICE_TYPE_MOUSE) ||
|
||||
(c == EFL_INPUT_DEVICE_TYPE_PEN) ||
|
||||
(c == EFL_INPUT_DEVICE_TYPE_TOUCH) ||
|
||||
(c == EFL_INPUT_DEVICE_TYPE_WAND);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -382,7 +382,7 @@ _ecore_evas_dev_added_or_removed(void *data, const Efl_Event *event)
|
|||
{
|
||||
if (_is_pointer(event->info))
|
||||
_ecore_evas_cursor_add(ee, event->info);
|
||||
else if (event->info == evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT))
|
||||
else if (event->info == evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT))
|
||||
{
|
||||
if (ee->prop.focused)
|
||||
_ecore_evas_focus_device_set(ee, event->info, 1);
|
||||
|
@ -1734,7 +1734,7 @@ _ecore_evas_default_cursor_image_get(Ecore_Evas *ee)
|
|||
Efl_Input_Device *pointer;
|
||||
Ecore_Evas_Cursor *cursor;
|
||||
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
cursor = eina_hash_find(ee->prop.cursors, &pointer);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(cursor, NULL);
|
||||
return cursor->object;
|
||||
|
@ -1746,7 +1746,7 @@ _ecore_evas_default_cursor_hide(Ecore_Evas *ee)
|
|||
Efl_Input_Device *pointer;
|
||||
Ecore_Evas_Cursor *cursor;
|
||||
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
cursor = eina_hash_find(ee->prop.cursors, &pointer);
|
||||
EINA_SAFETY_ON_NULL_RETURN(cursor);
|
||||
if (cursor->object)
|
||||
|
@ -1765,12 +1765,12 @@ _ecore_evas_object_cursor_device_set(Ecore_Evas *ee, Efl_Input_Device *pointer,
|
|||
|
||||
ECORE_EVAS_CHECK(ee);
|
||||
|
||||
dpointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
dpointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
if (pointer)
|
||||
{
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
pointer = efl_input_device_seat_get(pointer);
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
{
|
||||
ERR("Could not find seat");
|
||||
return;
|
||||
|
@ -1882,16 +1882,16 @@ ecore_evas_cursor_device_get(const Ecore_Evas *ee, Efl_Input_Device *pointer,
|
|||
|
||||
if (pointer)
|
||||
{
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
pointer = efl_input_device_seat_get(pointer);
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
{
|
||||
ERR("Could not find seat");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
if (pointer)
|
||||
{
|
||||
cursor = eina_hash_find(ee->prop.cursors, &pointer);
|
||||
|
@ -1929,16 +1929,16 @@ ecore_evas_cursor_device_unset(Ecore_Evas *ee, Efl_Input_Device *pointer)
|
|||
|
||||
if (pointer)
|
||||
{
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
pointer = efl_input_device_seat_get(pointer);
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
{
|
||||
ERR("Could not find seat");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
if (pointer)
|
||||
cursor = eina_hash_find(ee->prop.cursors, &pointer);
|
||||
if (!cursor) return NULL;
|
||||
|
@ -1980,7 +1980,7 @@ ecore_evas_focus_device_get(const Ecore_Evas *ee, Efl_Input_Device *seat)
|
|||
{
|
||||
ECORE_EVAS_CHECK(ee, EINA_FALSE);
|
||||
if (!seat)
|
||||
seat = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
seat = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
return eina_list_data_find(ee->prop.focused_by, seat) ? EINA_TRUE : EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1991,10 +1991,10 @@ _ecore_evas_focus_device_set(Ecore_Evas *ee, Efl_Input_Device *seat,
|
|||
Eina_Bool present;
|
||||
|
||||
if (!seat)
|
||||
seat = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
seat = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
if ((!on) && (!seat)) return;
|
||||
|
||||
if (seat && (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT))
|
||||
if (seat && (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT))
|
||||
{
|
||||
ERR("The Input device must be an seat");
|
||||
return;
|
||||
|
@ -2768,16 +2768,16 @@ ecore_evas_pointer_device_xy_get(const Ecore_Evas *ee,
|
|||
|
||||
if (pointer)
|
||||
{
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
pointer = efl_input_device_seat_get(pointer);
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
{
|
||||
ERR("Could not find seat");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ((!pointer) ||
|
||||
(pointer == evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT)))
|
||||
(pointer == evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT)))
|
||||
ecore_evas_pointer_xy_get(ee, x, y);
|
||||
else
|
||||
{
|
||||
|
@ -3354,16 +3354,16 @@ _ecore_evas_mouse_move_process_internal(Ecore_Evas *ee,
|
|||
|
||||
if (pointer)
|
||||
{
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
pointer = efl_input_device_seat_get(pointer);
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(pointer) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
{
|
||||
ERR("Could not find seat");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
cursor = eina_hash_find(ee->prop.cursors, &pointer);
|
||||
if (cursor)
|
||||
{
|
||||
|
@ -4583,7 +4583,7 @@ _direct_mouse_updown(Ecore_Evas *ee, const Ecore_Event_Mouse_Button *info, Efl_P
|
|||
ev->pressure = info->multi.pressure;
|
||||
ev->angle = info->multi.angle - ee->rotation;
|
||||
if (info->dev) ev->device = efl_ref(info->dev);
|
||||
else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_CLASS_MOUSE));
|
||||
else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE));
|
||||
|
||||
efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt);
|
||||
processed = ev->evas_done;
|
||||
|
@ -4644,7 +4644,7 @@ _direct_mouse_move_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Move *info)
|
|||
ev->pressure = info->multi.pressure;
|
||||
ev->angle = info->multi.angle - ee->rotation;
|
||||
if (info->dev) ev->device = efl_ref(info->dev);
|
||||
else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_CLASS_MOUSE));
|
||||
else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE));
|
||||
|
||||
efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt);
|
||||
processed = ev->evas_done;
|
||||
|
@ -4678,7 +4678,7 @@ _direct_mouse_wheel_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Wheel *info)
|
|||
ev->wheel.z = info->z;
|
||||
ev->wheel.dir = info->direction ? EFL_ORIENT_HORIZONTAL : EFL_ORIENT_VERTICAL;
|
||||
if (info->dev) ev->device = efl_ref(info->dev);
|
||||
else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_CLASS_MOUSE));
|
||||
else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE));
|
||||
|
||||
efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt);
|
||||
processed = ev->evas_done;
|
||||
|
@ -4707,7 +4707,7 @@ _direct_mouse_inout(Ecore_Evas *ee, const Ecore_Event_Mouse_IO *info, Efl_Pointe
|
|||
ev->timestamp = info->timestamp;
|
||||
_pointer_position_set(ev, ee, info->x, info->y, info->x, info->y);
|
||||
if (info->dev) ev->device = efl_ref(info->dev);
|
||||
else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_CLASS_MOUSE));
|
||||
else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE));
|
||||
|
||||
efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt);
|
||||
processed = ev->evas_done;
|
||||
|
@ -4836,7 +4836,7 @@ _direct_axis_update_cb(Ecore_Evas *ee, const Ecore_Event_Axis_Update *info)
|
|||
}
|
||||
_pointer_position_set(ev, ee, x, y, x, y);
|
||||
if (info->dev) ev->device = efl_ref(info->dev);
|
||||
else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_CLASS_MOUSE));
|
||||
else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE));
|
||||
|
||||
efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt);
|
||||
processed = ev->evas_done;
|
||||
|
@ -4874,7 +4874,7 @@ _direct_key_updown_cb(Ecore_Evas *ee, const Ecore_Event_Key *info, Eina_Bool dow
|
|||
ev->data = info->data;
|
||||
ev->event_flags = 0;
|
||||
if (info->dev) ev->device = efl_ref(info->dev);
|
||||
else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_CLASS_KEYBOARD));
|
||||
else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_KEYBOARD));
|
||||
|
||||
if (down)
|
||||
efl_event_callback_legacy_call(e, EFL_EVENT_KEY_DOWN, evt);
|
||||
|
@ -4927,7 +4927,7 @@ _ecore_evas_mouse_inout_set(Ecore_Evas *ee, Efl_Input_Device *mouse,
|
|||
|
||||
if (!mouse)
|
||||
mouse = evas_default_device_get(ee->evas,
|
||||
EFL_INPUT_DEVICE_CLASS_MOUSE);;
|
||||
EFL_INPUT_DEVICE_TYPE_MOUSE);;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN(mouse);
|
||||
present = eina_list_data_find(ee->mice_in, mouse);
|
||||
|
@ -4954,7 +4954,7 @@ EAPI Eina_Bool
|
|||
_ecore_evas_mouse_in_check(Ecore_Evas *ee, Efl_Input_Device *mouse)
|
||||
{
|
||||
if (!mouse)
|
||||
mouse = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
|
||||
mouse = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_MOUSE);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(mouse, EINA_FALSE);
|
||||
return eina_list_data_find(ee->mice_in, mouse) ? EINA_TRUE : EINA_FALSE;
|
||||
}
|
||||
|
|
|
@ -4567,7 +4567,7 @@ _edje_entry_imf_default_focused_rp_get(Edje *ed)
|
|||
Evas *e;
|
||||
|
||||
e = evas_object_evas_get(ed->obj);
|
||||
seat = evas_canvas_default_device_get(e, EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
seat = evas_canvas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
seat_name = _edje_seat_name_get(ed, seat);
|
||||
|
||||
return _edje_focused_part_get(ed, seat_name);
|
||||
|
|
|
@ -633,7 +633,7 @@ _edje_device_added_cb(void *data, const Efl_Event *event)
|
|||
Efl_Input_Device *dev = event->info;
|
||||
Edje *ed = data;
|
||||
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
return;
|
||||
|
||||
_edje_device_add(ed, dev);
|
||||
|
@ -648,7 +648,7 @@ _edje_device_removed_cb(void *data, const Efl_Event *event)
|
|||
char sig[256];
|
||||
Eina_List *l;
|
||||
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
return;
|
||||
|
||||
EINA_LIST_FOREACH(ed->seats, l, s)
|
||||
|
@ -677,7 +677,7 @@ _edje_device_changed_cb(void *data, const Efl_Event *event)
|
|||
char sig[256];
|
||||
Eina_List *l;
|
||||
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
return;
|
||||
|
||||
EINA_LIST_FOREACH(ed->seats, l, s)
|
||||
|
@ -744,7 +744,7 @@ _edje_devices_add(Edje *ed, Evas *tev)
|
|||
devices = evas_device_list(tev, NULL);
|
||||
EINA_LIST_FOREACH(devices, l, dev)
|
||||
{
|
||||
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
_edje_device_add(ed, dev);
|
||||
}
|
||||
|
||||
|
|
|
@ -656,7 +656,7 @@ _edje_part_focus_set(Edje *ed, const char *seat_name, Edje_Real_Part *rp)
|
|||
else /* Use default seat name */
|
||||
{
|
||||
e = evas_object_evas_get(ed->obj);
|
||||
seat = evas_canvas_default_device_get(e, EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
seat = evas_canvas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
sname = eina_stringshare_ref(_edje_seat_name_get(ed, seat));
|
||||
}
|
||||
|
||||
|
@ -1044,7 +1044,7 @@ low_mem_current:
|
|||
Evas *e;
|
||||
|
||||
e = evas_object_evas_get(ed->obj);
|
||||
seat = evas_canvas_default_device_get(e, EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
seat = evas_canvas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
}
|
||||
if (!pr->targets)
|
||||
{
|
||||
|
|
|
@ -93,9 +93,9 @@ struct _Efl_Input_Device_Data
|
|||
Efl_Input_Device *source; /* ref */
|
||||
Eina_List *children; /* ref'ed by efl_parent, not by this list */
|
||||
unsigned int id;
|
||||
Efl_Input_Device_Class klass;
|
||||
Efl_Input_Device_Sub_Class subclass;
|
||||
unsigned int pointer_count;
|
||||
Efl_Input_Device_Type klass;
|
||||
unsigned int subclass; // Evas_Device_Subclass (unused)
|
||||
unsigned int pointer_count;
|
||||
};
|
||||
|
||||
struct _Efl_Input_Hold_Data
|
||||
|
|
|
@ -24,10 +24,10 @@ struct _Child_Device_Iterator
|
|||
static Eina_Bool
|
||||
_is_pointer(Efl_Input_Device_Data *pd)
|
||||
{
|
||||
return (pd->klass == EFL_INPUT_DEVICE_CLASS_MOUSE ||
|
||||
pd->klass == EFL_INPUT_DEVICE_CLASS_TOUCH ||
|
||||
pd->klass == EFL_INPUT_DEVICE_CLASS_PEN ||
|
||||
pd->klass == EFL_INPUT_DEVICE_CLASS_WAND);
|
||||
return (pd->klass == EFL_INPUT_DEVICE_TYPE_MOUSE ||
|
||||
pd->klass == EFL_INPUT_DEVICE_TYPE_TOUCH ||
|
||||
pd->klass == EFL_INPUT_DEVICE_TYPE_PEN ||
|
||||
pd->klass == EFL_INPUT_DEVICE_TYPE_WAND);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -49,7 +49,7 @@ EOLIAN static void
|
|||
_efl_input_device_efl_object_destructor(Eo *obj, Efl_Input_Device_Data *pd)
|
||||
{
|
||||
pd->children = eina_list_free(pd->children);
|
||||
if (pd->klass != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (pd->klass != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
{
|
||||
Efl_Input_Device_Data *p;
|
||||
Eo *seat;
|
||||
|
@ -73,7 +73,7 @@ _efl_input_device_efl_object_parent_set(Eo *obj, Efl_Input_Device_Data *pd EINA_
|
|||
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);
|
||||
EINA_SAFETY_ON_FALSE_RETURN(p->klass == EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
if (!eina_list_data_find(p->children, obj))
|
||||
{
|
||||
p->children = eina_list_append(p->children, obj);
|
||||
|
@ -102,35 +102,23 @@ _efl_input_device_efl_object_parent_set(Eo *obj, Efl_Input_Device_Data *pd EINA_
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_input_device_device_type_set(Eo *obj, 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_Type klass)
|
||||
{
|
||||
EINA_SAFETY_ON_TRUE_RETURN(pd->klass);
|
||||
pd->klass = klass;
|
||||
if (klass != EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (klass != EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
{
|
||||
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_Type
|
||||
_efl_input_device_device_type_get(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
|
||||
{
|
||||
return pd->klass;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_input_device_device_subtype_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, Efl_Input_Device_Sub_Class klass)
|
||||
{
|
||||
pd->subclass = klass;
|
||||
}
|
||||
|
||||
EOLIAN static Efl_Input_Device_Sub_Class
|
||||
_efl_input_device_device_subtype_get(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
|
||||
{
|
||||
return pd->subclass;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_input_device_source_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, Efl_Input_Device *src)
|
||||
{
|
||||
|
@ -148,14 +136,14 @@ _efl_input_device_source_get(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
|
|||
EOLIAN static void
|
||||
_efl_input_device_seat_id_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, unsigned int id)
|
||||
{
|
||||
EINA_SAFETY_ON_TRUE_RETURN(pd->klass != EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
EINA_SAFETY_ON_TRUE_RETURN(pd->klass != EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
pd->id = id;
|
||||
}
|
||||
|
||||
EOLIAN static unsigned int
|
||||
_efl_input_device_seat_id_get(Eo *obj, Efl_Input_Device_Data *pd)
|
||||
{
|
||||
if (pd->klass == EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
return pd->id;
|
||||
return efl_input_device_seat_id_get(efl_input_device_seat_get(obj));
|
||||
}
|
||||
|
@ -165,7 +153,7 @@ _efl_input_device_seat_get(Eo *obj, Efl_Input_Device_Data *pd)
|
|||
{
|
||||
for (; obj; obj = efl_parent_get(obj))
|
||||
{
|
||||
if (pd->klass == EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
return pd->eo;
|
||||
|
||||
if (!efl_isa(obj, MY_CLASS)) break;
|
||||
|
@ -224,7 +212,7 @@ _efl_input_device_children_iterate(Eo *obj, Efl_Input_Device_Data *pd)
|
|||
EOLIAN static unsigned int
|
||||
_efl_input_device_has_pointer_caps(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
|
||||
{
|
||||
if (pd->klass == EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
return pd->pointer_count;
|
||||
return _is_pointer(pd);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
enum Efl.Input.Device.Class
|
||||
enum Efl.Input.Device.Type
|
||||
{
|
||||
[[General type of input device.
|
||||
|
||||
Legacy support since 1.8.
|
||||
|
||||
@since 1.18
|
||||
Legacy support since 1.8 as $Evas_Device_Class.
|
||||
]]
|
||||
none, [[Not a device.]]
|
||||
seat, [[The user/seat (the user themselves).]]
|
||||
|
@ -16,27 +14,6 @@ enum Efl.Input.Device.Class
|
|||
gamepad, [[A gamepad controller or joystick.]]
|
||||
}
|
||||
|
||||
enum Efl.Input.Device.Sub_Class
|
||||
{
|
||||
[[Specific type of input device.
|
||||
|
||||
Legacy support since 1.8.
|
||||
|
||||
@since 1.18
|
||||
]]
|
||||
none, [[Not a device.]]
|
||||
finger, [[The normal flat of your finger.]]
|
||||
fingernail, [[A fingernail.]]
|
||||
knuckle, [[A Knuckle.]]
|
||||
palm, [[The palm of a users hand.]]
|
||||
hand_size, [[The side of your hand.]]
|
||||
hand_flat, [[The flat of your hand.]]
|
||||
pen_tip, [[The tip of a pen.]]
|
||||
trackpad, [[A trackpad style mouse.]]
|
||||
trackpoint, [[A trackpoint style mouse.]]
|
||||
trackball, [[A trackball style mouse.]]
|
||||
}
|
||||
|
||||
/* TODO: Add canvas property. Current problem is we need to return
|
||||
Efl.Ui.Win and not Evas:
|
||||
@property canvas { values { canvas: Efl.Canvas; } }
|
||||
|
@ -52,13 +29,7 @@ class Efl.Input.Device (Efl.Object)
|
|||
@property device_type {
|
||||
[[Device type property]]
|
||||
values {
|
||||
klass: Efl.Input.Device.Class; [[Input device class]]
|
||||
}
|
||||
}
|
||||
@property device_subtype {
|
||||
[[Device subtype property]]
|
||||
values {
|
||||
klass: Efl.Input.Device.Sub_Class; [[Input device sub-class]]
|
||||
klass: Efl.Input.Device.Type; [[Input device class]]
|
||||
}
|
||||
}
|
||||
@property source {
|
||||
|
@ -73,7 +44,7 @@ class Efl.Input.Device (Efl.Object)
|
|||
This method will find the seat the device belongs to.
|
||||
|
||||
For this, it walk through device's parents looking for a device
|
||||
with @Efl.Input.Device.Class.seat. It may be
|
||||
with @Efl.Input.Device.Type.seat. It may be
|
||||
the device itself.
|
||||
|
||||
In case no seat is found, $null is returned.
|
||||
|
|
|
@ -294,31 +294,39 @@ typedef enum _Evas_Engine_Render_Mode
|
|||
|
||||
typedef Efl_Gfx_Event_Render_Post Evas_Event_Render_Post; /**< Event info sent after a frame was rendered. @since 1.18 */
|
||||
|
||||
typedef Efl_Input_Device_Class Evas_Device_Class;
|
||||
typedef Efl_Input_Device_Type Evas_Device_Class;
|
||||
|
||||
#define EVAS_DEVICE_CLASS_NONE EFL_INPUT_DEVICE_CLASS_NONE /**< Not a device @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_SEAT EFL_INPUT_DEVICE_CLASS_SEAT /**< The user/seat (the user themselves) @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_KEYBOARD EFL_INPUT_DEVICE_CLASS_KEYBOARD /**< A regular keyboard, numberpad or attached buttons @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_MOUSE EFL_INPUT_DEVICE_CLASS_MOUSE /**< A mouse, trackball or touchpad relative motion device @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_TOUCH EFL_INPUT_DEVICE_CLASS_TOUCH /**< A touchscreen with fingers or stylus @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_PEN EFL_INPUT_DEVICE_CLASS_PEN /**< A special pen device @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_POINTER EFL_INPUT_DEVICE_CLASS_WAND /**< A laser pointer, wii-style or "minority report" pointing device @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_WAND EFL_INPUT_DEVICE_CLASS_WAND /**< A synonym for EVAS_DEVICE_CLASS_POINTER @since 1.18 */
|
||||
#define EVAS_DEVICE_CLASS_GAMEPAD EFL_INPUT_DEVICE_CLASS_GAMEPAD /**< A gamepad controller or joystick @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_NONE EFL_INPUT_DEVICE_TYPE_NONE /**< Not a device @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_SEAT EFL_INPUT_DEVICE_TYPE_SEAT /**< The user/seat (the user themselves) @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_KEYBOARD EFL_INPUT_DEVICE_TYPE_KEYBOARD /**< A regular keyboard, numberpad or attached buttons @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_MOUSE EFL_INPUT_DEVICE_TYPE_MOUSE /**< A mouse, trackball or touchpad relative motion device @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_TOUCH EFL_INPUT_DEVICE_TYPE_TOUCH /**< A touchscreen with fingers or stylus @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_PEN EFL_INPUT_DEVICE_TYPE_PEN /**< A special pen device @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_POINTER EFL_INPUT_DEVICE_TYPE_WAND /**< A laser pointer, wii-style or "minority report" pointing device @since 1.8 */
|
||||
#define EVAS_DEVICE_CLASS_WAND EFL_INPUT_DEVICE_TYPE_WAND /**< A synonym for EVAS_DEVICE_CLASS_POINTER @since 1.18 */
|
||||
#define EVAS_DEVICE_CLASS_GAMEPAD EFL_INPUT_DEVICE_TYPE_GAMEPAD /**< A gamepad controller or joystick @since 1.8 */
|
||||
|
||||
typedef Efl_Input_Device_Sub_Class Evas_Device_Subclass;
|
||||
|
||||
#define EVAS_DEVICE_SUBCLASS_NONE EFL_INPUT_DEVICE_SUB_CLASS_NONE /**< Not a device @since 1.8 */
|
||||
#define EVAS_DEVICE_SUBCLASS_FINGER EFL_INPUT_DEVICE_SUB_CLASS_FINGER /**< The normal flat of your finger @since 1.8 */
|
||||
#define EVAS_DEVICE_SUBCLASS_FINGERNAIL EFL_INPUT_DEVICE_SUB_CLASS_FINGERNAIL /**< A fingernail @since 1.8 */
|
||||
#define EVAS_DEVICE_SUBCLASS_KNUCKLE EFL_INPUT_DEVICE_SUB_CLASS_KNUCKLE /**< A Knuckle @since 1.8 */
|
||||
#define EVAS_DEVICE_SUBCLASS_PALM EFL_INPUT_DEVICE_SUB_CLASS_PALM /**< The palm of a users hand @since 1.8 */
|
||||
#define EVAS_DEVICE_SUBCLASS_HAND_SIZE EFL_INPUT_DEVICE_SUB_CLASS_HAND_SIZE /**< The side of your hand @since 1.8 */
|
||||
#define EVAS_DEVICE_SUBCLASS_HAND_FLAT EFL_INPUT_DEVICE_SUB_CLASS_HAND_FLAT /**< The flat of your hand @since 1.8 */
|
||||
#define EVAS_DEVICE_SUBCLASS_PEN_TIP EFL_INPUT_DEVICE_SUB_CLASS_PEN_TIP /**< The tip of a pen @since 1.8 */
|
||||
#define EVAS_DEVICE_SUBCLASS_TRACKPAD EFL_INPUT_DEVICE_SUB_CLASS_TRACKPAD /**< A trackpad style mouse @since 1.8 */
|
||||
#define EVAS_DEVICE_SUBCLASS_TRACKPOINT EFL_INPUT_DEVICE_SUB_CLASS_TRACKPOINT /**< A trackpoint style mouse @since 1.8 */
|
||||
#define EVAS_DEVICE_SUBCLASS_TRACKBALL EFL_INPUT_DEVICE_SUB_CLASS_TRACKBALL /**< A trackball style mouse @since 1.8 */
|
||||
/**
|
||||
* @brief Specific type of input device.
|
||||
*
|
||||
* Note: Currently not used inside EFL.
|
||||
*
|
||||
* @since 1.8
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
EVAS_DEVICE_SUBCLASS_NONE = 0, /**< Not a device. */
|
||||
EVAS_DEVICE_SUBCLASS_FINGER, /**< The normal flat of your finger. */
|
||||
EVAS_DEVICE_SUBCLASS_FINGERNAIL, /**< A fingernail. */
|
||||
EVAS_DEVICE_SUBCLASS_KNUCKLE, /**< A Knuckle. */
|
||||
EVAS_DEVICE_SUBCLASS_PALM, /**< The palm of a users hand. */
|
||||
EVAS_DEVICE_SUBCLASS_HAND_SIZE, /**< The side of your hand. */
|
||||
EVAS_DEVICE_SUBCLASS_HAND_FLAT, /**< The flat of your hand. */
|
||||
EVAS_DEVICE_SUBCLASS_PEN_TIP, /**< The tip of a pen. */
|
||||
EVAS_DEVICE_SUBCLASS_TRACKPAD, /**< A trackpad style mouse. */
|
||||
EVAS_DEVICE_SUBCLASS_TRACKPOINT, /**< A trackpoint style mouse. */
|
||||
EVAS_DEVICE_SUBCLASS_TRACKBALL /**< A trackball style mouse. */
|
||||
} Evas_Device_Subclass;
|
||||
|
||||
typedef Efl_Pointer_Flags Evas_Button_Flags;
|
||||
|
||||
|
|
|
@ -1123,7 +1123,7 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
|
|||
]]
|
||||
get {}
|
||||
keys {
|
||||
type: Efl.Input.Device.Class; [[The class of the default device to fetch.]]
|
||||
type: Efl.Input.Device.Type; [[The class of the default device to fetch.]]
|
||||
}
|
||||
values {
|
||||
seat: Efl.Input.Device; [[The default device or $null on error.]]
|
||||
|
|
|
@ -167,12 +167,14 @@ evas_device_add_full(Evas *eo_e, const char *name, const char *desc,
|
|||
efl_name_set(efl_added, name),
|
||||
efl_comment_set(efl_added, desc),
|
||||
efl_input_device_type_set(efl_added, clas),
|
||||
efl_input_device_subtype_set(efl_added, sub_clas),
|
||||
efl_input_device_source_set(efl_added, emulation_dev));
|
||||
|
||||
d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
|
||||
d->evas = eo_e;
|
||||
|
||||
// Legacy support, subclass is most likely unused
|
||||
d->subclass = (unsigned) sub_clas;
|
||||
|
||||
e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
||||
|
||||
/* This is the case when the user is using wayland backend,
|
||||
|
@ -375,14 +377,17 @@ evas_device_subclass_set(Evas_Device *dev, Evas_Device_Subclass clas)
|
|||
SAFETY_CHECK(dev, EFL_INPUT_DEVICE_CLASS);
|
||||
Efl_Input_Device_Data *d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
|
||||
|
||||
efl_input_device_subtype_set(dev, clas);
|
||||
d->subclass = (unsigned) clas;
|
||||
evas_event_callback_call(d->evas, EVAS_CALLBACK_DEVICE_CHANGED, dev);
|
||||
}
|
||||
|
||||
EAPI Evas_Device_Subclass
|
||||
evas_device_subclass_get(const Evas_Device *dev)
|
||||
{
|
||||
return efl_input_device_subtype_get(dev);
|
||||
SAFETY_CHECK(dev, EFL_INPUT_DEVICE_CLASS, EVAS_DEVICE_SUBCLASS_NONE);
|
||||
Efl_Input_Device_Data *d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
|
||||
|
||||
return (Evas_Device_Subclass) d->subclass;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
|
@ -172,7 +172,7 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj,
|
|||
event_id = _evas_event_counter;
|
||||
if (!seat) seat = _default_seat_get(eo_obj);
|
||||
|
||||
if (seat && (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT))
|
||||
if (seat && (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT))
|
||||
return EINA_FALSE;
|
||||
|
||||
if (obj->layer && (!seat))
|
||||
|
|
|
@ -201,7 +201,7 @@ _evas_canvas_seat_key_modifier_on(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e,
|
|||
if (!seat)
|
||||
seat = e->default_seat;
|
||||
EINA_SAFETY_ON_NULL_RETURN(seat);
|
||||
if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT) return;
|
||||
if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT) return;
|
||||
_mask_set(evas_key_modifier_number(&(e->modifiers), keyname),
|
||||
e->modifiers.masks, seat, EINA_TRUE);
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ _evas_canvas_seat_key_lock_on(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e,
|
|||
if (!seat)
|
||||
seat = e->default_seat;
|
||||
EINA_SAFETY_ON_NULL_RETURN(seat);
|
||||
if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT) return;
|
||||
if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT) return;
|
||||
_mask_set(evas_key_lock_number(&(e->locks), keyname), e->locks.masks,
|
||||
seat, EINA_TRUE);
|
||||
}
|
||||
|
|
|
@ -478,13 +478,13 @@ _evas_canvas_coord_world_y_to_screen(const Eo *eo_e EINA_UNUSED, Evas_Public_Dat
|
|||
EOLIAN static Efl_Input_Device *
|
||||
_evas_canvas_default_device_get(Eo *eo_e EINA_UNUSED,
|
||||
Evas_Public_Data *e,
|
||||
Efl_Input_Device_Class klass)
|
||||
Efl_Input_Device_Type klass)
|
||||
{
|
||||
if (klass == EFL_INPUT_DEVICE_CLASS_SEAT)
|
||||
if (klass == EFL_INPUT_DEVICE_TYPE_SEAT)
|
||||
return e->default_seat;
|
||||
if (klass == EFL_INPUT_DEVICE_CLASS_MOUSE)
|
||||
if (klass == EFL_INPUT_DEVICE_TYPE_MOUSE)
|
||||
return e->default_mouse;
|
||||
if (klass == EFL_INPUT_DEVICE_CLASS_KEYBOARD)
|
||||
if (klass == EFL_INPUT_DEVICE_TYPE_KEYBOARD)
|
||||
return e->default_keyboard;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -655,7 +655,7 @@ _evas_canvas_seat_focus_in(Eo *eo_e, Evas_Public_Data *e,
|
|||
Efl_Input_Device *seat)
|
||||
{
|
||||
if (!seat) seat = e->default_seat;
|
||||
if (!seat || efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT) return;
|
||||
if (!seat || efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT) return;
|
||||
_evas_canvas_focus_inout_dispatch(eo_e, seat, EINA_TRUE);
|
||||
}
|
||||
|
||||
|
@ -664,7 +664,7 @@ _evas_canvas_seat_focus_out(Eo *eo_e, Evas_Public_Data *e,
|
|||
Efl_Input_Device *seat)
|
||||
{
|
||||
if (!seat) seat = e->default_seat;
|
||||
if (!seat || efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT) return;
|
||||
if (!seat || efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT) return;
|
||||
_evas_canvas_focus_inout_dispatch(eo_e, seat, EINA_FALSE);
|
||||
}
|
||||
|
||||
|
|
|
@ -911,7 +911,7 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_set(Eo *eo_obj,
|
|||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN(seat);
|
||||
|
||||
if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT) return;
|
||||
if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT) return;
|
||||
|
||||
obj->events_filter_enabled = EINA_TRUE;
|
||||
if (add)
|
||||
|
@ -928,7 +928,7 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_set(Eo *eo_obj,
|
|||
EINA_LIST_FOREACH(devices, l, dev)
|
||||
{
|
||||
if ((efl_input_device_type_get(dev) ==
|
||||
EFL_INPUT_DEVICE_CLASS_SEAT) && (dev != seat))
|
||||
EFL_INPUT_DEVICE_TYPE_SEAT) && (dev != seat))
|
||||
efl_canvas_object_seat_focus_del(eo_obj, dev);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -752,7 +752,7 @@ _ecore_evas_extn_cb_focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj E
|
|||
Extn *extn;
|
||||
Evas_Device *dev;
|
||||
|
||||
dev = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
|
||||
dev = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||
if (ecore_evas_focus_device_get(ee, dev)) return;
|
||||
ee->prop.focused_by = eina_list_append(ee->prop.focused_by, dev);
|
||||
extn = bdata->data;
|
||||
|
@ -769,7 +769,7 @@ _ecore_evas_extn_cb_focus_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj
|
|||
Extn *extn;
|
||||
|
||||
ee->prop.focused_by = eina_list_remove(ee->prop.focused_by,
|
||||
evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT));
|
||||
evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT));
|
||||
extn = bdata->data;
|
||||
if (!extn) return;
|
||||
if (!extn->ipc.server) return;
|
||||
|
|
|
@ -62,7 +62,7 @@ _ecore_evas_mouse_move_process_fb(Ecore_Evas *ee, int x, int y)
|
|||
|
||||
ecore_fb_size_get(&fbw, &fbh);
|
||||
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_MOUSE);
|
||||
pointer = evas_device_parent_get(pointer);
|
||||
cursor = eina_hash_find(ee->prop.cursors, &pointer);
|
||||
EINA_SAFETY_ON_NULL_RETURN(cursor);
|
||||
|
@ -331,7 +331,7 @@ _ecore_evas_rotation_set(Ecore_Evas *ee, int rotation, int resize EINA_UNUSED)
|
|||
Evas_Engine_Info_FB *einfo;
|
||||
int rot_dif;
|
||||
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_MOUSE);
|
||||
pointer = evas_device_parent_get(pointer);
|
||||
cursor = eina_hash_find(ee->prop.cursors, &pointer);
|
||||
EINA_SAFETY_ON_NULL_RETURN(cursor);
|
||||
|
|
|
@ -221,7 +221,7 @@ _ecore_evas_screen_resized(Ecore_Evas *ee)
|
|||
|
||||
ecore_psl1ght_screen_resolution_get (&w, &h);
|
||||
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_MOUSE);
|
||||
pointer = evas_device_parent_get(pointer);
|
||||
cursor = eina_hash_find(ee->prop.cursors, &pointer);
|
||||
EINA_SAFETY_ON_NULL_RETURN(cursor);
|
||||
|
|
|
@ -342,7 +342,7 @@ _ecore_evas_win32_event_window_configure(void *data EINA_UNUSED, int type EINA_U
|
|||
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
||||
if ((Ecore_Window)e->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_MOUSE);
|
||||
pointer = evas_device_parent_get(pointer);
|
||||
cursor = eina_hash_find(ee->prop.cursors, &pointer);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(cursor, 1);
|
||||
|
@ -659,7 +659,7 @@ _ecore_evas_win32_rotation_set_internal(Ecore_Evas *ee, int rotation)
|
|||
rot_dif = ee->rotation - rotation;
|
||||
if (rot_dif < 0) rot_dif = -rot_dif;
|
||||
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_MOUSE);
|
||||
pointer = evas_device_parent_get(pointer);
|
||||
cursor = eina_hash_find(ee->prop.cursors, &pointer);
|
||||
EINA_SAFETY_ON_NULL_RETURN(cursor);
|
||||
|
|
|
@ -1621,7 +1621,7 @@ _ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSE
|
|||
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
||||
if (edata->direct_resize) return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_MOUSE);
|
||||
pointer = evas_device_parent_get(pointer);
|
||||
cursor = eina_hash_find(ee->prop.cursors, &pointer);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(cursor, ECORE_CALLBACK_PASS_ON);
|
||||
|
@ -2344,7 +2344,7 @@ _ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int rotation, int resize,
|
|||
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
||||
int fw = 0, fh = 0;
|
||||
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_MOUSE);
|
||||
pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_MOUSE);
|
||||
pointer = evas_device_parent_get(pointer);
|
||||
cursor = eina_hash_find(ee->prop.cursors, &pointer);
|
||||
EINA_SAFETY_ON_NULL_RETURN(cursor);
|
||||
|
|
Loading…
Reference in New Issue