From a380c859371eb4266a62e6bd72412208f2557f28 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 7 Mar 2019 17:42:43 -0500 Subject: [PATCH] evas: restore legacy types which were defined to eo types Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D8245 Change-Id: Icecac2cd81bf67fcd3af69444e984d05438b7841 --- src/lib/edje/edje_smart.c | 2 +- src/lib/edje/edje_text.c | 2 +- src/lib/evas/Evas_Common.h | 118 +++++++++++++++++----------- src/lib/evas/canvas/evas_device.c | 4 +- src/lib/evas/canvas/evas_object_main.c | 10 +-- src/lib/evas/canvas/evas_object_smart.c | 12 +-- src/lib/evas/canvas/evas_object_text.c | 16 ++-- src/lib/evas/canvas/evas_object_textblock.c | 12 +-- src/tests/evas/evas_test_object_smart.c | 10 +-- src/tests/evas/evas_test_text.c | 16 ++-- 10 files changed, 116 insertions(+), 86 deletions(-) diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c index 0a4cdb5..dff0bf9 100644 --- a/src/lib/edje/edje_smart.c +++ b/src/lib/edje/edje_smart.c @@ -476,7 +476,7 @@ edje_object_file_get(const Edje_Object *obj, const char **file, const char **gro } EOLIAN static void -_efl_canvas_layout_efl_canvas_object_paragraph_direction_set(Eo *obj, Edje *ed, Evas_BiDi_Direction dir) +_efl_canvas_layout_efl_canvas_object_paragraph_direction_set(Eo *obj, Edje *ed, Efl_Text_Bidirectional_Type dir) { efl_canvas_object_paragraph_direction_set(efl_super(obj, MY_CLASS), dir); diff --git a/src/lib/edje/edje_text.c b/src/lib/edje/edje_text.c index 438d20e..c8cb4d2 100644 --- a/src/lib/edje/edje_text.c +++ b/src/lib/edje/edje_text.c @@ -506,7 +506,7 @@ arrange_text: if (params->type.text->align.x < FROM_INT(0)) { /* TIZEN_ONLY(20170216): Apply align according to paragraph_direction - if (evas_object_text_direction_get(ep->object) == + if ((Evas_BiDi_Direction)evas_object_text_direction_get(ep->object) == EVAS_BIDI_DIRECTION_RTL) { align_x = FROM_INT(1); diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h index f1b3473..8de865a 100644 --- a/src/lib/evas/Evas_Common.h +++ b/src/lib/evas/Evas_Common.h @@ -246,10 +246,12 @@ typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source /* Opaque types */ typedef Eo Evas_Device; /**< A source device handle - where the event came from */ -typedef Efl_Gfx_Image_Content_Hint Evas_Image_Content_Hint; -#define EVAS_IMAGE_CONTENT_HINT_NONE EFL_GFX_IMAGE_CONTENT_HINT_NONE -#define EVAS_IMAGE_CONTENT_HINT_DYNAMIC EFL_GFX_IMAGE_CONTENT_HINT_DYNAMIC -#define EVAS_IMAGE_CONTENT_HINT_STATIC EFL_GFX_IMAGE_CONTENT_HINT_STATIC +typedef enum _Evas_Image_Content_Hint +{ + EVAS_IMAGE_CONTENT_HINT_NONE = 0, /**< No hint at all */ + EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1, /**< The contents will change over time */ + EVAS_IMAGE_CONTENT_HINT_STATIC = 2 /**< The contents won't change over time */ +} Evas_Image_Content_Hint; /**< How an image's data is to be treated by Evas, for optimization */ typedef enum _Evas_Alloc_Error { @@ -295,17 +297,18 @@ 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_Type Evas_Device_Class; - -#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 enum _Evas_Device_Class +{ + EVAS_DEVICE_CLASS_NONE, /**< Not a device @since 1.8 */ + EVAS_DEVICE_CLASS_SEAT, /**< The user/seat (the user themselves) @since 1.8 */ + EVAS_DEVICE_CLASS_KEYBOARD, /**< A regular keyboard, numberpad or attached buttons @since 1.8 */ + EVAS_DEVICE_CLASS_MOUSE, /**< A mouse, trackball or touchpad relative motion device @since 1.8 */ + EVAS_DEVICE_CLASS_TOUCH, /**< A touchscreen with fingers or stylus @since 1.8 */ + EVAS_DEVICE_CLASS_PEN, /**< A special pen device @since 1.8 */ +#define EVAS_DEVICE_CLASS_WAND EVAS_DEVICE_CLASS_POINTER + EVAS_DEVICE_CLASS_POINTER, /**< A laser pointer, wii-style or "minority report" pointing device @since 1.8 */ + EVAS_DEVICE_CLASS_GAMEPAD /**< A gamepad controller or joystick @since 1.8 */ +} Evas_Device_Class; /**< A general class of device @since 1.8 */ /** * @brief Specific type of input device. @@ -333,42 +336,69 @@ typedef enum // } Evas_Device_Subclass; -typedef Efl_Pointer_Flags Evas_Button_Flags; - -#define EVAS_BUTTON_NONE EFL_POINTER_FLAGS_NONE -#define EVAS_BUTTON_DOUBLE_CLICK EFL_POINTER_FLAGS_DOUBLE_CLICK -#define EVAS_BUTTON_TRIPLE_CLICK EFL_POINTER_FLAGS_TRIPLE_CLICK - -typedef Efl_Input_Flags Evas_Event_Flags; - -#define EVAS_EVENT_FLAG_NONE EFL_INPUT_FLAGS_NONE -#define EVAS_EVENT_FLAG_ON_HOLD EFL_INPUT_FLAGS_PROCESSED -#define EVAS_EVENT_FLAG_ON_SCROLL EFL_INPUT_FLAGS_SCROLLING - -typedef Efl_Gfx_Hint_Aspect Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set */ +/** + * Flags for Mouse Button events + */ +typedef enum _Evas_Button_Flags +{ + EVAS_BUTTON_NONE = 0, /**< No extra mouse button data */ + EVAS_BUTTON_DOUBLE_CLICK = (1 << 0), /**< This mouse button press was the 2nd press of a double click */ + EVAS_BUTTON_TRIPLE_CLICK = (1 << 1) /**< This mouse button press was the 3rd press of a triple click */ +} Evas_Button_Flags; /**< Flags for Mouse Button events */ -#define EVAS_ASPECT_CONTROL_NONE EFL_GFX_HINT_ASPECT_NONE -#define EVAS_ASPECT_CONTROL_NEITHER EFL_GFX_HINT_ASPECT_NEITHER -#define EVAS_ASPECT_CONTROL_HORIZONTAL EFL_GFX_HINT_ASPECT_HORIZONTAL -#define EVAS_ASPECT_CONTROL_VERTICAL EFL_GFX_HINT_ASPECT_VERTICAL -#define EVAS_ASPECT_CONTROL_BOTH EFL_GFX_HINT_ASPECT_BOTH +/** + * Flags for Events + */ +typedef enum _Evas_Event_Flags +{ + EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */ + EVAS_EVENT_FLAG_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 */ + EVAS_EVENT_FLAG_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 */ +} Evas_Event_Flags; /**< Flags for Events */ -typedef Efl_Text_Bidirectional_Type Evas_BiDi_Direction; +typedef enum _Evas_Aspect_Control +{ + EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */ + EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */ + EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */ + EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */ + EVAS_ASPECT_CONTROL_BOTH = 4 /**< Use all horizontal @b and vertical container spaces to place an object (never growing it out of those bounds), using the given aspect */ +} Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */ + +typedef enum _Evas_BiDi_Direction +{ + EVAS_BIDI_DIRECTION_NATURAL, + EVAS_BIDI_DIRECTION_NEUTRAL = EVAS_BIDI_DIRECTION_NATURAL, + EVAS_BIDI_DIRECTION_LTR, + EVAS_BIDI_DIRECTION_RTL, + EVAS_BIDI_DIRECTION_INHERIT +} Evas_BiDi_Direction; -#define EVAS_BIDI_DIRECTION_NATURAL EFL_TEXT_BIDIRECTIONAL_TYPE_NATURAL -#define EVAS_BIDI_DIRECTION_NEUTRAL EFL_TEXT_BIDIRECTIONAL_TYPE_NEUTRAL -#define EVAS_BIDI_DIRECTION_LTR EFL_TEXT_BIDIRECTIONAL_TYPE_LTR -#define EVAS_BIDI_DIRECTION_RTL EFL_TEXT_BIDIRECTIONAL_TYPE_RTL -#define EVAS_BIDI_DIRECTION_INHERIT EFL_TEXT_BIDIRECTIONAL_TYPE_INHERIT /* TIZEN_ONLY(20170216): add EVAS_BIDI_DIRECTION_ANY_RTL for evas_object_paragraph_direction_set API */ #define EVAS_BIDI_DIRECTION_ANY_RTL EFL_TEXT_BIDIRECTIONAL_TYPE_ANY_RTL /* END */ -typedef Efl_Input_Object_Pointer_Mode Evas_Object_Pointer_Mode; - -#define EVAS_OBJECT_POINTER_MODE_AUTOGRAB EFL_INPUT_OBJECT_POINTER_MODE_AUTO_GRAB -#define EVAS_OBJECT_POINTER_MODE_NOGRAB EFL_INPUT_OBJECT_POINTER_MODE_NO_GRAB -#define EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN EFL_INPUT_OBJECT_POINTER_MODE_NO_GRAB_NO_REPEAT_UPDOWN +/** + * How the mouse pointer should be handled by Evas. + * + * In the mode #EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button + * is pressed down over an object and held, with the mouse pointer + * being moved outside of it, the pointer still behaves as being bound + * to that object, albeit out of its drawing region. When the button + * is released, the event will be fed to the object, that may check if + * the final position is over it or not and do something about it. + * + * In the mode #EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will + * always be bound to the object right below it. + * + * @ingroup Evas_Object_Group_Extras + */ +typedef enum _Evas_Object_Pointer_Mode +{ + EVAS_OBJECT_POINTER_MODE_AUTOGRAB, /**< default, X11-like */ + EVAS_OBJECT_POINTER_MODE_NOGRAB, /**< pointer always bound to the object right below it */ + EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN /**< useful on object with "repeat events" enabled, where mouse/touch up and down events WONT be repeated to objects and these objects wont be auto-grabbed. @since 1.2 */ +} Evas_Object_Pointer_Mode; /**< How the mouse pointer should be handled by Evas. */ // FIXME: Move to Evas_Legacy.h /** Identifier of callbacks to be set for Evas canvases or Evas objects. */ diff --git a/src/lib/evas/canvas/evas_device.c b/src/lib/evas/canvas/evas_device.c index a3cb063..2e5e141 100644 --- a/src/lib/evas/canvas/evas_device.c +++ b/src/lib/evas/canvas/evas_device.c @@ -50,7 +50,7 @@ _new_default_device_find(Evas_Public_Data *e, Evas_Device *old_dev) EINA_LIST_FOREACH(e->devices, l, dev) { - if (efl_input_device_type_get(dev) != old_class) + if ((Evas_Device_Class)efl_input_device_type_get(dev) != old_class) continue; def = dev; @@ -405,7 +405,7 @@ evas_device_class_set(Evas_Device *dev, Evas_Device_Class clas) Efl_Input_Device_Data *d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS); Evas_Public_Data *edata = efl_data_scope_get(d->evas, EVAS_CANVAS_CLASS); - if (d->klass == clas) + if ((Evas_Device_Class)d->klass == clas) return; if (_is_pointer(d->klass)) diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index 2f4b7a0..ad0eaf8 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -1554,7 +1554,7 @@ _efl_canvas_object_efl_gfx_hint_hint_aspect_set(Eo *eo_obj, Evas_Object_Protecte if (!sz.w && !sz.h) return; _evas_object_size_hint_alloc(eo_obj, obj); } - if ((obj->size_hints->aspect.mode == aspect) && + if ((obj->size_hints->aspect.mode == (Evas_Aspect_Control)aspect) && (obj->size_hints->aspect.size.w == sz.w) && (obj->size_hints->aspect.size.h == sz.h)) return; obj->size_hints->aspect.mode = aspect; @@ -2354,15 +2354,15 @@ _efl_canvas_object_render_parent_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_P } EOLIAN static void -_efl_canvas_object_paragraph_direction_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, Evas_BiDi_Direction dir EINA_UNUSED) +_efl_canvas_object_paragraph_direction_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, Efl_Text_Bidirectional_Type dir EINA_UNUSED) { return; } -EOLIAN static Evas_BiDi_Direction +EOLIAN static Efl_Text_Bidirectional_Type _efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) { - return EVAS_BIDI_DIRECTION_NEUTRAL; + return (Efl_Text_Bidirectional_Type)EVAS_BIDI_DIRECTION_NEUTRAL; } EOLIAN static void @@ -2426,7 +2426,7 @@ EAPI void evas_object_size_hint_aspect_get(const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h) { Eina_Size2D sz = { 0, 0 }; - efl_gfx_hint_aspect_get(obj, aspect, &sz); + efl_gfx_hint_aspect_get(obj, (Efl_Gfx_Hint_Aspect*)aspect, &sz); if (w) *w = sz.w; if (h) *h = sz.h; } diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c index ab81ff5..b4d9730 100644 --- a/src/lib/evas/canvas/evas_object_smart.c +++ b/src/lib/evas/canvas/evas_object_smart.c @@ -1802,16 +1802,16 @@ _efl_canvas_group_group_paragraph_direction_set_internal(Eo *eo_obj, EOLIAN static void _efl_canvas_group_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, Evas_Smart_Data *o, - Evas_BiDi_Direction dir) + Efl_Text_Bidirectional_Type dir) { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Smart_Data *parent; - if ((!(o->inherit_paragraph_direction) && (o->paragraph_direction == dir)) || - (o->inherit_paragraph_direction && (dir == EVAS_BIDI_DIRECTION_INHERIT))) + if ((!(o->inherit_paragraph_direction) && (o->paragraph_direction == (Evas_BiDi_Direction)dir)) || + (o->inherit_paragraph_direction && ((Evas_BiDi_Direction)dir == EVAS_BIDI_DIRECTION_INHERIT))) return; - if (dir == EVAS_BIDI_DIRECTION_INHERIT) + if (dir == (Efl_Text_Bidirectional_Type)EVAS_BIDI_DIRECTION_INHERIT) { o->inherit_paragraph_direction = EINA_TRUE; Evas_BiDi_Direction parent_dir = EVAS_BIDI_DIRECTION_NEUTRAL; @@ -1840,10 +1840,10 @@ _efl_canvas_group_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, Evas_Sma _efl_canvas_group_group_paragraph_direction_set_internal(eo_obj, o->paragraph_direction); } -EOLIAN static Evas_BiDi_Direction +EOLIAN static Efl_Text_Bidirectional_Type _efl_canvas_group_efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o) { - return o->paragraph_direction; + return (Efl_Text_Bidirectional_Type)o->paragraph_direction; } EOLIAN static const Eo * diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 57affaa..195326a 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -1201,7 +1201,7 @@ _evas_text_efl_text_text_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o) return o->cur.utf8_text; } -EOLIAN static Evas_BiDi_Direction +EOLIAN static Efl_Text_Bidirectional_Type _evas_text_direction_get(const Eo *eo_obj, Evas_Text_Data *o) { #ifdef BIDI_SUPPORT @@ -1230,7 +1230,7 @@ _evas_text_direction_get(const Eo *eo_obj, Evas_Text_Data *o) } #endif - return o->bidi_dir; + return (Efl_Text_Bidirectional_Type)o->bidi_dir; } EOLIAN static Evas_Coord @@ -2491,16 +2491,16 @@ evas_object_text_filter_source_set(Evas_Object *obj, const char *name, Evas_Obje EOLIAN static void _evas_text_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, Evas_Text_Data *o, - Evas_BiDi_Direction dir) + Efl_Text_Bidirectional_Type dir) { #ifdef BIDI_SUPPORT Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); - if ((!(o->inherit_paragraph_direction) && (o->paragraph_direction == dir)) || - (o->inherit_paragraph_direction && (dir == EVAS_BIDI_DIRECTION_INHERIT))) + if ((!(o->inherit_paragraph_direction) && (o->paragraph_direction == (Evas_BiDi_Direction)dir)) || + (o->inherit_paragraph_direction && ((Evas_BiDi_Direction)dir == EVAS_BIDI_DIRECTION_INHERIT))) return; - if (dir == EVAS_BIDI_DIRECTION_INHERIT) + if (dir == (Efl_Text_Bidirectional_Type)EVAS_BIDI_DIRECTION_INHERIT) { o->inherit_paragraph_direction = EINA_TRUE; Evas_BiDi_Direction parent_dir = EVAS_BIDI_DIRECTION_NEUTRAL; @@ -2529,11 +2529,11 @@ _evas_text_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, Evas_Text_Data #endif } -EOLIAN static Evas_BiDi_Direction +EOLIAN static Efl_Text_Bidirectional_Type _evas_text_efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o) { - return o->paragraph_direction; + return (Efl_Text_Bidirectional_Type)o->paragraph_direction; } EOLIAN static void diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 662a9ca..cfbc369 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -15701,16 +15701,16 @@ _evas_object_textblock_rehint(Evas_Object *eo_obj) EOLIAN static void _efl_canvas_text_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, Efl_Canvas_Text_Data *o, - Evas_BiDi_Direction dir) + Efl_Text_Bidirectional_Type dir) { #ifdef BIDI_SUPPORT Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); - if ((!(o->inherit_paragraph_direction) && (o->paragraph_direction == dir)) || - (o->inherit_paragraph_direction && (dir == EVAS_BIDI_DIRECTION_INHERIT))) + if ((!(o->inherit_paragraph_direction) && (o->paragraph_direction == (Evas_BiDi_Direction)dir)) || + (o->inherit_paragraph_direction && ((Evas_BiDi_Direction)dir == EVAS_BIDI_DIRECTION_INHERIT))) return; - if (dir == EVAS_BIDI_DIRECTION_INHERIT) + if (dir == (Efl_Text_Bidirectional_Type)EVAS_BIDI_DIRECTION_INHERIT) { o->inherit_paragraph_direction = EINA_TRUE; Evas_BiDi_Direction parent_dir = EVAS_BIDI_DIRECTION_NEUTRAL; @@ -15741,11 +15741,11 @@ _efl_canvas_text_efl_canvas_object_paragraph_direction_set(Eo *eo_obj, #endif } -EOLIAN static Evas_BiDi_Direction +EOLIAN static Efl_Text_Bidirectional_Type _efl_canvas_text_efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o) { - return o->paragraph_direction; + return (Efl_Text_Bidirectional_Type)o->paragraph_direction; } static int diff --git a/src/tests/evas/evas_test_object_smart.c b/src/tests/evas/evas_test_object_smart.c index dd72980..188e9c2 100644 --- a/src/tests/evas/evas_test_object_smart.c +++ b/src/tests/evas/evas_test_object_smart.c @@ -122,7 +122,7 @@ EFL_START_TEST(evas_object_smart_paragraph_direction) evas_textblock_cursor_geometry_get(cur, &x, &y, &w, &h, &dir, EVAS_TEXTBLOCK_CURSOR_UNDER); fail_if(dir == EVAS_BIDI_DIRECTION_RTL); - fail_if(evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); /* Change paragraph direction of smart parent object */ evas_object_paragraph_direction_set(smart_obj, EVAS_BIDI_DIRECTION_RTL); @@ -131,7 +131,7 @@ EFL_START_TEST(evas_object_smart_paragraph_direction) EVAS_TEXTBLOCK_CURSOR_UNDER); fail_if(dir != EVAS_BIDI_DIRECTION_RTL); fail_if((x >= xx) || (y != yy) || (w != ww) || (h != hh)); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); /* The paragraph direction of smart member object has to be reset if smart member object is removed from smart parent. */ @@ -142,7 +142,7 @@ EFL_START_TEST(evas_object_smart_paragraph_direction) EVAS_TEXTBLOCK_CURSOR_UNDER); fail_if(dir == EVAS_BIDI_DIRECTION_RTL); fail_if((x >= xx) || (y != yy) || (w != ww) || (h != hh)); - fail_if(evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); /* The paragraph direction of smart member object has to be changed if smart member object is appended to smart parent. */ @@ -153,7 +153,7 @@ EFL_START_TEST(evas_object_smart_paragraph_direction) EVAS_TEXTBLOCK_CURSOR_UNDER); fail_if(dir != EVAS_BIDI_DIRECTION_RTL); fail_if((x >= xx) || (y != yy) || (w != ww) || (h != hh)); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); /* Ignore smart parent's paragraph direction */ evas_object_paragraph_direction_set(tb, EVAS_BIDI_DIRECTION_NEUTRAL); @@ -163,7 +163,7 @@ EFL_START_TEST(evas_object_smart_paragraph_direction) EVAS_TEXTBLOCK_CURSOR_UNDER); fail_if(dir == EVAS_BIDI_DIRECTION_RTL); fail_if((x >= xx) || (y != yy) || (w != ww) || (h != hh)); - fail_if(evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); evas_object_smart_member_del(tb); evas_object_smart_member_del(to); diff --git a/src/tests/evas/evas_test_text.c b/src/tests/evas/evas_test_text.c index 7c66fc9..929c88d 100644 --- a/src/tests/evas/evas_test_text.c +++ b/src/tests/evas/evas_test_text.c @@ -387,26 +387,26 @@ EFL_START_TEST(evas_text_set_get) /* Direction of an empty text should be NEUTRAL */ evas_object_text_text_set(to, ""); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_NEUTRAL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_NEUTRAL); /* LTR paragraphs */ evas_object_text_text_set(to, "Test נסיון"); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); /* RTL paragraphs */ evas_object_text_text_set(to, "נסיון test"); #ifdef HAVE_FRIBIDI - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); #else - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); #endif #ifdef HAVE_FRIBIDI /* Check direction with evas_object_paragraph_direction_set API */ evas_object_text_text_set(to, "12345"); - fail_if(evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) == EVAS_BIDI_DIRECTION_RTL); evas_object_paragraph_direction_set(to, EVAS_BIDI_DIRECTION_RTL); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); evas_object_paragraph_direction_set(to, EVAS_BIDI_DIRECTION_NEUTRAL); #endif @@ -478,9 +478,9 @@ EFL_START_TEST(evas_text_bidi) evas_object_text_font_set(to, font, size); evas_object_text_text_set(to, buf); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_LTR); evas_object_text_text_set(to, "בדיקה"); - fail_if(evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); + fail_if((Evas_BiDi_Direction)evas_object_text_direction_get(to) != EVAS_BIDI_DIRECTION_RTL); /* With RTL text coords should be monotontically decreasing. */ evas_object_text_text_set(to, "נסיון..."); -- 2.7.4