#include "interfaces/efl_gfx_filter.eo.h"
#include "interfaces/efl_gfx_size_hint.eo.h"
+/* Input events */
+#include "interfaces/efl_input_types.eot.h"
+#include "interfaces/efl_input_device.eo.h"
+
/* Canvas & UI */
#include "interfaces/efl_canvas.eo.h"
#include "interfaces/efl_ui_view.eo.h"
#include "interfaces/efl_pack_linear.eo.h"
#include "interfaces/efl_pack_grid.eo.h"
-/* Input events */
-#include "interfaces/efl_input_types.eot.h"
-#include "interfaces/efl_input_device.eo.h"
-
/* Input and Output */
#include "interfaces/efl_io_closer.eo.h"
#include "interfaces/efl_io_reader.eo.h"
+import efl_input_device;
+
interface Efl.Canvas ()
{
[[Common interface for window and some internal classes in EFL.]]
]]
}
}
+ seats {
+ [[Iterate over the input device seats.
+
+ @since 1.20
+ ]]
+ return: own(free(iterator<Efl.Input.Device>, eina_iterator_free));
+ [[An iterator over the attached seats.]]
+ }
+ @property device {
+ [[An input device attached to this canvas, found by name.
+
+ Note: This function is meant to find seats and not individual
+ input devices.
+
+ See also @.seat to find a seat by id instead of by name.
+ ]]
+ get {
+ [[Get a device by name.]]
+ }
+ keys {
+ name: string; [[The name of the seat to find.]]
+ }
+ values {
+ seat: Efl.Input.Device; [[The device or seat, $null if not found.]]
+ }
+ }
+ @property seat {
+ [[A seat attached to this canvas, found by id.
+
+ See also @.device to find a seat by name instead of by id.
+ ]]
+ get {
+ [[Get a seat by id.]]
+ }
+ keys {
+ id: int; [[The id of the seat to find.]]
+ }
+ values {
+ seat: Efl.Input.Device; [[The seat or $null if not found.]]
+ }
+ }
}
events {
focus,in: Efl.Input.Focus; [[Called when canvas got focus]]
}
@property default_device {
[[Return the default device of a given type.
- \@note Currently Evas only creates a seat, mouse and keyboard.
+
+ Note: Currently EFL only creates a seat, mouse and keyboard.
@since 1.19
]]
get {}
Efl.Object.event_freeze;
Efl.Object.provider_find;
Efl.Loop_User.loop { get; }
+ //Efl.Canvas.seats;
+ Efl.Canvas.device { get; }
+ Efl.Canvas.seat { get; }
}
}
ev->object);
}
-EAPI Evas_Device *
-evas_device_get(Evas *eo_e, const char *name)
+EOLIAN Efl_Input_Device *
+_evas_canvas_efl_canvas_device_get(Evas *eo_e EINA_UNUSED, Evas_Public_Data *e, const char *name)
{
const char *dev_name;
- Evas_Public_Data *e;
Evas_Device *dev;
Eina_List *l;
- SAFETY_CHECK(eo_e, EVAS_CANVAS_CLASS, NULL);
-
- if (!name)
- return NULL;
-
- e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
+ if (!name) return NULL;
EINA_LIST_FOREACH(e->devices, l, dev)
{
}
EAPI Evas_Device *
-evas_device_get_by_seat_id(Evas *eo_e, unsigned int id)
+evas_device_get(Evas *eo_e, const char *name)
+{
+ return efl_canvas_device_get(eo_e, name);
+}
+
+EOLIAN Efl_Input_Device *
+_evas_canvas_efl_canvas_seat_get(Evas *eo_e EINA_UNUSED, Evas_Public_Data *e, unsigned int id)
{
- unsigned int seat_id;
- Evas_Public_Data *e;
Evas_Device *dev;
Eina_List *l;
- SAFETY_CHECK(eo_e, EVAS_CANVAS_CLASS, NULL);
-
- e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
-
EINA_LIST_FOREACH(e->devices, l, dev)
{
- seat_id = efl_input_device_seat_id_get(dev);
+ if (efl_input_device_type_get(dev) != EFL_INPUT_DEVICE_TYPE_SEAT)
+ continue;
- if (seat_id == id)
+ if (efl_input_device_seat_id_get(dev) == id)
return dev;
}
}
EAPI Evas_Device *
+evas_device_get_by_seat_id(Evas *eo_e, unsigned int id)
+{
+ return efl_canvas_seat_get(eo_e, id);
+}
+
+EAPI Evas_Device *
evas_device_add(Evas *eo_e)
{
return evas_device_add_full(eo_e, NULL, NULL, NULL, NULL,