forked from enlightenment/efl
Evas events: Add helper functions to read event info
This adds simple helpers for double/triple click and on_hold/on_scroll flags.
This commit is contained in:
parent
4381d3a824
commit
6832959318
|
@ -338,4 +338,64 @@ _efl_pointer_event_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Poi
|
|||
return evas_key_lock_is_set(pd->locks, name);
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_pointer_event_double_click_set(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd, Eina_Bool val)
|
||||
{
|
||||
if (val)
|
||||
pd->button_flags |= EFL_POINTER_BUTTON_FLAGS_DOUBLE_CLICK;
|
||||
else
|
||||
pd->button_flags &= ~EFL_POINTER_BUTTON_FLAGS_DOUBLE_CLICK;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_pointer_event_double_click_get(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd)
|
||||
{
|
||||
return !!(pd->button_flags & EFL_POINTER_BUTTON_FLAGS_DOUBLE_CLICK);
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_pointer_event_triple_click_set(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd, Eina_Bool val)
|
||||
{
|
||||
if (val)
|
||||
pd->button_flags |= EFL_POINTER_BUTTON_FLAGS_TRIPLE_CLICK;
|
||||
else
|
||||
pd->button_flags &= ~EFL_POINTER_BUTTON_FLAGS_TRIPLE_CLICK;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_pointer_event_triple_click_get(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd)
|
||||
{
|
||||
return !!(pd->button_flags & EFL_POINTER_BUTTON_FLAGS_TRIPLE_CLICK);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_pointer_event_on_hold_set(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd, Eina_Bool val)
|
||||
{
|
||||
if (val)
|
||||
pd->event_flags |= EFL_POINTER_EVENT_FLAGS_ON_HOLD;
|
||||
else
|
||||
pd->event_flags &= ~EFL_POINTER_EVENT_FLAGS_ON_HOLD;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_pointer_event_on_hold_get(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd)
|
||||
{
|
||||
return !!(pd->event_flags & EFL_POINTER_EVENT_FLAGS_ON_HOLD);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_pointer_event_on_scroll_set(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd, Eina_Bool val)
|
||||
{
|
||||
if (val)
|
||||
pd->event_flags |= EFL_POINTER_EVENT_FLAGS_ON_SCROLL;
|
||||
else
|
||||
pd->event_flags &= ~EFL_POINTER_EVENT_FLAGS_ON_SCROLL;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_pointer_event_on_scroll_get(Eo *obj EINA_UNUSED, Efl_Pointer_Event_Data *pd)
|
||||
{
|
||||
return !!(pd->event_flags & EFL_POINTER_EVENT_FLAGS_ON_SCROLL);
|
||||
}
|
||||
|
||||
#include "efl_pointer_event.eo.c"
|
||||
|
|
|
@ -97,19 +97,48 @@ class Efl.Pointer.Event (Eo.Base, Efl.Event, Efl.Input.State)
|
|||
src: Eo.Base; [[Source object: $Efl.Gfx]]
|
||||
}
|
||||
}
|
||||
/* FIXME: why not double_click() and triple_click() */
|
||||
@property button_flags {
|
||||
[[Double or triple click information.]]
|
||||
values {
|
||||
flags: Efl.Pointer.Button_Flags;
|
||||
}
|
||||
}
|
||||
@property double_click {
|
||||
[[$true if @.button_flags indicates a double click (2nd press).
|
||||
|
||||
This is just a helper function around @.button_flags.
|
||||
]]
|
||||
values {
|
||||
val: bool;
|
||||
}
|
||||
}
|
||||
@property triple_click {
|
||||
[[$true if @.button_flags indicates a triple click (3rd press).
|
||||
|
||||
This is just a helper function around @.button_flags.
|
||||
]]
|
||||
values {
|
||||
val: bool;
|
||||
}
|
||||
}
|
||||
@property event_flags {
|
||||
[[Extra flags for this event, may be changed by the user.]]
|
||||
values {
|
||||
flags: Efl.Pointer.Event_Flags;
|
||||
}
|
||||
}
|
||||
@property on_hold {
|
||||
[[$true if @.event_flags indicates the event is on hold.]]
|
||||
values {
|
||||
val: bool;
|
||||
}
|
||||
}
|
||||
@property on_scroll {
|
||||
[[$true if @.event_flags indicates the event happened while scrolling.]]
|
||||
values {
|
||||
val: bool;
|
||||
}
|
||||
}
|
||||
@property wheel_direction {
|
||||
values {
|
||||
dir: Efl.Orient; [[Horizontal or Vertical only.]]
|
||||
|
|
Loading…
Reference in New Issue