lib/efl/interfaces/efl_ui_spin.eo \
lib/efl/interfaces/efl_ui_progress.eo \
lib/efl/interfaces/efl_event.eo \
- lib/efl/interfaces/efl_pointer_event.eo \
+ lib/efl/interfaces/efl_input_state.eo \
$(efl_eolian_legacy_files) \
$(NULL)
lib/efl/interfaces/efl_vpath_core.c \
lib/efl/interfaces/efl_vpath_file_core.c \
lib/efl/interfaces/efl_input_device.c \
-lib/efl/interfaces/efl_event.c \
-lib/efl/interfaces/efl_pointer_event.c \
$(NULL)
lib_efl_libefl_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl -I$(top_srcdir)/src/lib/efl @EFL_CFLAGS@ -DEFL_GFX_FILTER_BETA
lib/evas/canvas/efl_canvas_surface_wayland.eo \
lib/evas/canvas/evas_filter.eo \
lib/evas/canvas/evas_smart_clipped.eo \
+ lib/evas/canvas/efl_pointer_event.eo \
$(NULL)
evas_eolian_legacy_files = \
lib/evas/canvas/efl_canvas_surface_tbm.c \
lib/evas/canvas/efl_canvas_surface_x11.c \
lib/evas/canvas/efl_canvas_surface_wayland.c \
+lib/evas/canvas/efl_pointer_event.c \
$(NULL)
EXTRA_DIST += \
* root.{x,y}
* root_window
* event_window
- * modifiers
* same_screen
+ * modifiers (already passed to evas, no need to do anything)
*/
evt = efl_pointer_event_instance_get(EFL_POINTER_EVENT_CLASS, e, (void **) &ev);
* root.{x,y}
* root_window
* event_window
- * modifiers
* same_screen
+ * modifiers (already passed to evas, no need to do anything)
*/
evt = efl_pointer_event_instance_get(EFL_POINTER_EVENT_CLASS, e, (void **) &ev);
* root.{x,y}
* root_window
* event_window
- * modifiers
- * same_screen
+ * modifiers (already passed to evas, no need to do anything)
*/
evt = efl_pointer_event_instance_get(EFL_POINTER_EVENT_CLASS, e, (void **) &ev);
/* Unused information:
* event_window
- * modifiers
+ * modifiers (already passed to evas, no need to do anything)
*/
evt = efl_pointer_event_instance_get(EFL_POINTER_EVENT_CLASS, e, (void **) &ev);
/* Input events */
#include "interfaces/efl_event_types.eot.h"
#include "interfaces/efl_input_device.eo.h"
-//#include "interfaces/efl_input_state.eo.h"
+#include "interfaces/efl_input_state.eo.h"
#include "interfaces/efl_event.eo.h"
-#include "interfaces/efl_pointer_event.eo.h"
#else
typedef struct _Efl_Input_State_Data Efl_Input_State_Data;
#ifndef _EVAS_TYPES_EOT_H_
-/* FIXME */
-//typedef struct _Evas_Modifier Evas_Modifier;
-//typedef struct _Evas_Lock Evas_Lock;
+typedef struct _Evas_Modifier Evas_Modifier;
+typedef struct _Evas_Lock Evas_Lock;
#endif
-struct _Efl_Input_State_Data
-{
- Eo *eo;
- /* FIXME / TODO */
-// Evas_Modifier *modifiers;
-// Evas_Lock *locks;
-};
-
struct _Efl_Pointer_Event_Data
{
Eo *eo;
const Eo_Event_Description *event_desc;
Eina_Bool window_pos; /* true if positions are window-relative
(see input vs. feed: this is "input") */
- //Efl_Input_State *state;
- void *legacy; /* DO NOT TOUCH */
+ Evas_Modifier *modifiers;
+ Evas_Lock *locks;
+ void *legacy; /* DO NOT TOUCH (may contain the legacy event_info) */
Eina_Bool evas_done; /* set by evas */
};
+++ /dev/null
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <Efl.h>
-
-#define EFL_INTERNAL_UNSTABLE
-#include "efl_common_internal.h"
-
-#include "interfaces/efl_event.eo.c"
--- /dev/null
+interface Efl.Input.State ()
+{
+ eo_prefix: efl_input;
+ methods {
+ /* FIXME: legacy name was 'modifier_is_set' */
+ @property modifier_enabled {
+ [[Indicates whether a key modifier is on, such as Ctrl, Shift,...]]
+ get {}
+ keys {
+ name: string;
+ }
+ values {
+ is_set: bool; [[$true if the key modifier is pressed.]]
+ }
+ }
+ @property lock_enabled {
+ [[Indicates whether a key lock is on, such as NumLock, CapsLock, ...]]
+ get {}
+ keys {
+ name: string;
+ }
+ values {
+ is_set: bool; [[$true if the key lock is on.]]
+ }
+ }
+ }
+}
#include "interfaces/efl_ui_spin.eo.c"
#include "interfaces/efl_ui_progress.eo.c"
+#include "interfaces/efl_event.eo.c"
+#include "interfaces/efl_input_state.eo.c"
+
EAPI void
__efl_internal_init(void)
{
return name ? strdup(name) : NULL;
}
+EOLIAN static Eina_Bool
+_elm_win_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Elm_Win_Data *pd, const char *name)
+{
+ const Evas_Modifier *m = evas_key_modifier_get(pd->evas);
+ return evas_key_modifier_is_set(m, name);
+}
+
+EOLIAN static Eina_Bool
+_elm_win_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Elm_Win_Data *pd, const char *name)
+{
+ const Evas_Lock *m = evas_key_lock_get(pd->evas);
+ return evas_key_lock_is_set(m, name);
+}
+
#ifndef EFL_TEAMWORK_VERSION
# define EFL_TEAMWORK_VERSION 2
#endif
}
class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
- Elm.Interface.Atspi_Widget_Action, Efl.Pack)
+ Elm.Interface.Atspi_Widget_Action, Efl.Pack,
+ Efl.Input.State)
{
legacy_prefix: elm_win;
eo_prefix: elm_obj_win;
Efl.Container.content_count;
Efl.Pack.unpack;
Efl.Pack.pack;
+ Efl.Input.State.modifier_enabled.get;
+ Efl.Input.State.lock_enabled.get;
}
constructors {
.name;
#include "canvas/efl_vg_gradient.eo.h"
#include "canvas/efl_vg_gradient_linear.eo.h"
#include "canvas/efl_vg_gradient_radial.eo.h"
+
+#include "canvas/efl_pointer_event.eo.h"
# include <config.h>
#endif
-#include <Efl.h>
+#include <Evas.h>
#define EFL_INTERNAL_UNSTABLE
-#include "efl_common_internal.h"
+#include "interfaces/efl_common_internal.h"
#define MY_CLASS EFL_POINTER_EVENT_CLASS
if (y) *y = pd->prev.y;
}
-
-/* FIXME: implement input state with eo*/
-
-/*
-EOLIAN static void
-_efl_pointer_event_input_state_set(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd, Efl_Input_State *modifiers)
-{
-
-}
-EOLIAN static Efl_Input_State *
-_efl_pointer_event_input_state_get(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd)
-{
-
-}
-*/
-
EOLIAN static void
_efl_pointer_event_device_set(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd, Efl_Input_Device *dev)
{
if (angle) *angle = pd->angle;
}
-
EOLIAN static void
_efl_pointer_event_touch_set(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd, double r, double rx, double ry, double press, double angle)
{
pd->angle = angle;
}
-#include "interfaces/efl_pointer_event.eo.c"
+EOLIAN static Eina_Bool
+_efl_pointer_event_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd, const char *name)
+{
+ if (!pd->modifiers) return EINA_FALSE;
+ return evas_key_modifier_is_set(pd->modifiers, name);
+}
+
+EOLIAN static Eina_Bool
+_efl_pointer_event_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd, const char *name)
+{
+ if (!pd->locks) return EINA_FALSE;
+ return evas_key_lock_is_set(pd->locks, name);
+}
+
+#include "efl_pointer_event.eo.c"
import efl_orientation;
import efl_event_types;
-class Efl.Pointer.Event (Eo.Base, Efl.Event)
+class Efl.Pointer.Event (Eo.Base, Efl.Event, Efl.Input.State)
{
[[Event data carried over with any pointer event (mouse, touch, ...)
Efl.Event.timestamp.get;
Efl.Event.event_type.set;
Efl.Event.event_type.get;
+ Efl.Input.State.modifier_enabled.get;
+ Efl.Input.State.lock_enabled.get;
}
}
if (!ev) return EO_CALLBACK_CONTINUE;
/* TODO:
- * - pass event to the internal functions
- * - implement legacy over eo instead of this
+ * - implement legacy over eo instead of this (hardcore)
*/
ev->evas_done = EINA_TRUE;
+ ev->modifiers = &e->modifiers;
+ ev->locks = &e->locks;
+
switch (ev->action)
{
case EFL_POINTER_ACTION_MOVE:
ev->event_flags = e->event_flags;
ev->device = e->dev;
ev->source = e->event_src;
+ ev->modifiers = e->modifiers;
+ ev->locks = e->locks;
break;
}
ev->event_flags = e->event_flags;
ev->device = e->dev;
ev->source = e->event_src;
+ ev->modifiers = e->modifiers;
+ ev->locks = e->locks;
break;
}
ev->event_flags = e->event_flags;
ev->device = e->dev;
ev->source = e->event_src;
+ ev->modifiers = e->modifiers;
+ ev->locks = e->locks;
break;
}
ev->event_flags = e->event_flags;
ev->device = e->dev;
ev->source = e->event_src;
+ ev->modifiers = e->modifiers;
+ ev->locks = e->locks;
break;
}
ev->event_flags = e->event_flags;
ev->device = e->dev;
ev->source = e->event_src;
+ ev->modifiers = e->modifiers;
+ ev->locks = e->locks;
break;
}
ev->timestamp = e->timestamp;
ev->event_flags = e->event_flags;
ev->device = e->dev;
+ ev->modifiers = e->modifiers;
+ ev->locks = e->locks;
break;
}
ev->timestamp = e->timestamp;
ev->event_flags = e->event_flags;
ev->device = e->dev;
+ ev->modifiers = e->modifiers;
+ ev->locks = e->locks;
break;
}
ev->timestamp = e->timestamp;
ev->event_flags = e->event_flags;
ev->device = e->dev;
+ ev->modifiers = e->modifiers;
+ ev->locks = e->locks;
break;
}
ev->timestamp = e->timestamp;
ev->event_flags = e->event_flags;
ev->device = e->dev;
+ ev->modifiers = e->modifiers;
+ ev->locks = e->locks;
break;
}
e->timestamp = ev->timestamp;
e->event_flags = ev->event_flags;
e->dev = ev->device;
- e->modifiers = NULL; /* FIXME */
- e->locks = NULL; /* FIXME */
e->event_src = ev->source;
+ e->modifiers = ev->modifiers;
+ e->locks = ev->locks;
}
break;
e->event_flags = ev->event_flags;
e->dev = ev->device;
e->event_src = ev->source;
- e->modifiers = NULL; /* FIXME */
- e->locks = NULL; /* FIXME */
+ e->modifiers = ev->modifiers;
+ e->locks = ev->locks;
}
break;
e->event_flags = ev->event_flags;
e->dev = ev->device;
e->event_src = ev->source;
- e->modifiers = NULL; /* FIXME */
- e->locks = NULL; /* FIXME */
+ e->modifiers = ev->modifiers;
+ e->locks = ev->locks;
}
else
{
e->timestamp = ev->timestamp;
e->event_flags = ev->event_flags;
e->dev = ev->device;
- e->modifiers = NULL; /* FIXME */
- e->locks = NULL; /* FIXME */
+ e->modifiers = ev->modifiers;
+ e->locks = ev->locks;
}
break;
e->event_flags = ev->event_flags;
e->dev = ev->device;
e->event_src = ev->source;
- e->modifiers = NULL; /* FIXME */
- e->locks = NULL; /* FIXME */
+ e->modifiers = ev->modifiers;
+ e->locks = ev->locks;
}
else
{
e->timestamp = ev->timestamp;
e->event_flags = ev->event_flags;
e->dev = ev->device;
- e->modifiers = NULL; /* FIXME */
- e->locks = NULL; /* FIXME */
+ e->modifiers = ev->modifiers;
+ e->locks = ev->locks;
break;
}
break;
e->event_flags = ev->event_flags;
e->dev = ev->device;
e->event_src = ev->source;
- e->modifiers = NULL; /* FIXME */
- e->locks = NULL; /* FIXME */
+ e->modifiers = ev->modifiers;
+ e->locks = ev->locks;
}
else
{
e->timestamp = ev->timestamp;
e->event_flags = ev->event_flags;
e->dev = ev->device;
- e->modifiers = NULL; /* FIXME */
- e->locks = NULL; /* FIXME */
+ e->modifiers = ev->modifiers;
+ e->locks = ev->locks;
}
break;
e->timestamp = ev->timestamp;
e->event_flags = ev->event_flags;
e->dev = ev->device;
- e->modifiers = NULL; /* FIXME */
- e->locks = NULL; /* FIXME */
+ e->modifiers = ev->modifiers;
+ e->locks = ev->locks;
break;
}