From c06cdadca28db6c4547562b2f577a2c21452d24e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Fri, 29 Apr 2016 14:24:14 +0900 Subject: [PATCH] Evas: Fix compilation warnings (enum implicit cast) Moving enums to Efl renames them but keeps the value the same. --- src/Makefile_Efl.am | 1 + src/lib/efl/Efl.h | 2 ++ src/lib/efl/interfaces/efl_common_internal.h | 4 +-- src/lib/efl/interfaces/efl_event_types.eot | 33 ++++++++++++++++++ src/lib/efl/interfaces/efl_pointer_event.eo | 35 +------------------- src/lib/elementary/elm_widget.eo | 3 +- src/lib/evas/Evas_Common.h | 12 +++++++ src/lib/evas/canvas/evas_canvas.eo | 11 +++--- src/lib/evas/canvas/evas_types.eot | 18 ---------- 9 files changed, 59 insertions(+), 60 deletions(-) create mode 100644 src/lib/efl/interfaces/efl_event_types.eot diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index a7700394cf..b8c2834ecc 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -46,6 +46,7 @@ efl_eolian_files = \ efl_eolian_type_files = \ lib/efl/interfaces/efl_gfx_types.eot \ + lib/efl/interfaces/efl_event_types.eot \ lib/efl/interfaces/efl_types.eot \ $(NULL) diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index a71d17b88f..2d25714146 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -126,6 +126,7 @@ static inline void efl_gfx_color16_type_set(Efl_Gfx_Color *color, #include "interfaces/efl_pack_grid.eo.h" /* 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_event.eo.h" @@ -135,6 +136,7 @@ static inline void efl_gfx_color16_type_set(Efl_Gfx_Color *color, #ifndef EFL_NOLEGACY_API_SUPPORT #include "interfaces/efl_gfx_types.eot.h" +#include "interfaces/efl_event_types.eot.h" #include "interfaces/efl_gfx_fill.eo.legacy.h" #include "interfaces/efl_gfx.eo.legacy.h" #include "interfaces/efl_image.eo.legacy.h" diff --git a/src/lib/efl/interfaces/efl_common_internal.h b/src/lib/efl/interfaces/efl_common_internal.h index aa956897ee..32d5471b07 100644 --- a/src/lib/efl/interfaces/efl_common_internal.h +++ b/src/lib/efl/interfaces/efl_common_internal.h @@ -19,8 +19,8 @@ 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_Pointer_Event_Data diff --git a/src/lib/efl/interfaces/efl_event_types.eot b/src/lib/efl/interfaces/efl_event_types.eot new file mode 100644 index 0000000000..9152a0d59c --- /dev/null +++ b/src/lib/efl/interfaces/efl_event_types.eot @@ -0,0 +1,33 @@ +/* FIXME: Do we need this? Or just use the Eo Event Description as a type? */ +enum Efl.Pointer.Action +{ + [[Pointer event type. + + @since 1.18 + ]] + none, [[Not a valid event.]] + mouse_move, [[Mouse or equivalent pointer moved.]] + mouse_down, [[Mouse button pressed down.]] + mouse_up, [[Mouse button released.]] + mouse_wheel, [[Mouse wheel scroll, horizontally or vertically.]] + touch_move, [[Finger moved while touching surface.]] + touch_down, [[Finger touch made contact.]] + touch_up, [[Finger touch released.]] + hover, [[A hovering movement over a distance-sensitive touch screen.]] +} + +enum Efl.Pointer.Button_Flags +{ + /* Evas.Button_Flags */ + none = 0, [[No extra mouse button data]] + double_click = (1 << 0), [[This mouse button press was the 2nd press of a double click]] + triple_click = (1 << 1), [[This mouse button press was the 3rd press of a triple click]] +} + +enum Efl.Pointer.Event_Flags +{ + /* Evas.Event_Flags */ + none = 0, [[No fancy flags set]] + on_hold = (1 << 0), [[This event is being delivered but should be put "on hold" until the on hold flag is unset. The event should be used for informational purposes and maybe some indications visually, but not actually perform anything]] + on_scroll = (1 << 1), [[This event flag indicates the event occurs while scrolling; for example, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything]] +} diff --git a/src/lib/efl/interfaces/efl_pointer_event.eo b/src/lib/efl/interfaces/efl_pointer_event.eo index ecc955fe34..2ee4625177 100644 --- a/src/lib/efl/interfaces/efl_pointer_event.eo +++ b/src/lib/efl/interfaces/efl_pointer_event.eo @@ -1,38 +1,5 @@ import efl_orientation; - -/* FIXME: Do we need this? Or just use the Eo Event Description as a type? */ -enum Efl.Pointer.Action -{ - [[Pointer event type. - - @since 1.18 - ]] - none, [[Not a valid event.]] - mouse_move, [[Mouse or equivalent pointer moved.]] - mouse_down, [[Mouse button pressed down.]] - mouse_up, [[Mouse button released.]] - mouse_wheel, [[Mouse wheel scroll, horizontally or vertically.]] - touch_move, [[Finger moved while touching surface.]] - touch_down, [[Finger touch made contact.]] - touch_up, [[Finger touch released.]] - hover, [[A hovering movement over a distance-sensitive touch screen.]] -} - -enum Efl.Pointer.Button_Flags -{ - /* Evas.Button_Flags */ - none = 0, [[No extra mouse button data]] - double_click = (1 << 0), [[This mouse button press was the 2nd press of a double click]] - triple_click = (1 << 1), [[This mouse button press was the 3rd press of a triple click]] -} - -enum Efl.Pointer.Event_Flags -{ - /* Evas.Event_Flags */ - none = 0, [[No fancy flags set]] - on_hold = (1 << 0), [[This event is being delivered but should be put "on hold" until the on hold flag is unset. The event should be used for informational purposes and maybe some indications visually, but not actually perform anything]] - on_scroll = (1 << 1), [[This event flag indicates the event occurs while scrolling; for example, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything]] -} +import efl_event_types; class Efl.Pointer.Event (Eo.Base, Efl.Event) { diff --git a/src/lib/elementary/elm_widget.eo b/src/lib/elementary/elm_widget.eo index 94edf90b10..06a08b17d3 100644 --- a/src/lib/elementary/elm_widget.eo +++ b/src/lib/elementary/elm_widget.eo @@ -1,5 +1,6 @@ import edje_types; import elm_general; +import efl_event_types; /* FIXME: This shouldn't be here. */ type list_data_get_func_type: __undefined_type; @@ -630,7 +631,7 @@ abstract Elm.Widget (Evas.Object.Smart, Elm.Interface.Atspi_Accessible, Elm.Inte params { @in type: Evas.Callback_Type; @in event_info: void *; - @in event_flags: Evas.Event_Flags *; + @in event_flags: Efl.Pointer.Event_Flags *; } } signal_callback_add { diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h index 7e949302f1..496dad7132 100644 --- a/src/lib/evas/Evas_Common.h +++ b/src/lib/evas/Evas_Common.h @@ -342,6 +342,18 @@ typedef Efl_Input_Device_Sub_Class Evas_Device_Subclass; #define EVAS_DEVICE_SUBCLASS_TRACKPOINT EFL_INPUT_DEVICE_SUBCLASS_TRACKPOINT /**< A trackpoint style mouse @since 1.8 */ #define EVAS_DEVICE_SUBCLASS_TRACKBALL EFL_INPUT_DEVICE_SUBCLASS_TRACKBALL /**< A trackball style mouse @since 1.8 */ +typedef Efl_Pointer_Button_Flags Evas_Button_Flags; + +#define EVAS_BUTTON_NONE EFL_POINTER_BUTTON_FLAGS_NONE +#define EVAS_BUTTON_DOUBLE_CLICK EFL_POINTER_BUTTON_FLAGS_DOUBLE_CLICK +#define EVAS_BUTTON_TRIPLE_CLICK EFL_POINTER_BUTTON_FLAGS_TRIPLE_CLICK + +typedef Efl_Pointer_Event_Flags Evas_Event_Flags; + +#define EVAS_EVENT_FLAG_NONE EFL_POINTER_EVENT_FLAGS_NONE +#define EVAS_EVENT_FLAG_ON_HOLD EFL_POINTER_EVENT_FLAGS_ON_HOLD +#define EVAS_EVENT_FLAG_ON_SCROLL EFL_POINTER_EVENT_FLAGS_ON_SCROLL + struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */ { int magic; /**< Magic number */ diff --git a/src/lib/evas/canvas/evas_canvas.eo b/src/lib/evas/canvas/evas_canvas.eo index dca90e3013..b05e906904 100644 --- a/src/lib/evas/canvas/evas_canvas.eo +++ b/src/lib/evas/canvas/evas_canvas.eo @@ -1,4 +1,5 @@ import evas_types; +import efl_event_types; class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator) { @@ -113,7 +114,7 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator) ]] } values { - flags: Evas.Event_Flags; [[The default flags to use.]] + flags: Efl.Pointer.Event_Flags; [[The default flags to use.]] } } @property output_method { @@ -731,7 +732,7 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator) @in ang: double; @in fx: double; @in fy: double; - @in flags: Evas.Button_Flags; + @in flags: Efl.Pointer.Button_Flags; @in timestamp: uint; @in data: const(void)*; } @@ -748,7 +749,7 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator) @in ang: double; @in fx: double; @in fy: double; - @in flags: Evas.Button_Flags; + @in flags: Efl.Pointer.Button_Flags; @in timestamp: uint; @in data: const(void)*; } @@ -844,7 +845,7 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator) @in ang: double; @in fx: double; @in fy: double; - @in flags: Evas.Button_Flags; + @in flags: Efl.Pointer.Button_Flags; @in timestamp: uint; @in data: const(void)*; } @@ -1370,7 +1371,7 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator) @in ang: double; @in fx: double; @in fy: double; - @in flags: Evas.Button_Flags; + @in flags: Efl.Pointer.Button_Flags; @in timestamp: uint; @in data: const(void)*; } diff --git a/src/lib/evas/canvas/evas_types.eot b/src/lib/evas/canvas/evas_types.eot index 0c95385424..fcfcc83b44 100644 --- a/src/lib/evas/canvas/evas_types.eot +++ b/src/lib/evas/canvas/evas_types.eot @@ -128,24 +128,6 @@ struct Evas.Map; [[An opaque handle to map points \@ref evas_map_dup. ]] -enum Evas.Button_Flags { - [[Flags for Mouse Button events]] - legacy: Evas_Button; - - none = 0, [[No extra mouse button data]] - double_click = (1 << 0), [[This mouse button press was the 2nd press of a double click]] - triple_click = (1 << 1) [[This mouse button press was the 3rd press of a triple click]] -} - -enum Evas.Event_Flags { - [[Flags for Events]] - legacy: Evas_Event_Flag; - - none = 0, [[No fancy flags set]] - on_hold = (1 << 0), [[This event is being delivered but should be put "on hold" until the on hold flag is unset. The event should be used for informational purposes and maybe some indications visually, but not actually perform anything]] - on_scroll = (1 << 1) [[This event flag indicates the event occurs while scrolling; for example, DOWN event occurs during scrolling; the event should be used for informational purposes and maybe some indications visually, but not actually perform anything]] -} - enum Evas.Touch_Point_State { [[State of Evas_Coord_Touch_Point]] legacy: Evas_Touch_Point;