From 6e5e8e567b774118ffc14a09442742e867b3cf75 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Thu, 24 Aug 2017 13:45:01 +0900 Subject: [PATCH] widget: Rename hook "orientation" (EO) Renamed to on_orientation_update This internal / virtual function is in fact not overridden anywhere. Not sure it is necessary to expose it in EO API? Ref T5363 --- src/lib/elementary/efl_ui_win.c | 4 ++-- src/lib/elementary/elm_widget.c | 8 ++++---- src/lib/elementary/elm_widget.eo | 23 +++++++++++++++++------ src/lib/elementary/elm_widget.h | 1 - 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index e4d48c3..67c5a2d 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -1631,7 +1631,7 @@ _elm_win_state_change(Ecore_Evas *ee) _elm_win_xwin_update(sd); #endif ELM_WIN_DATA_ALIVE_CHECK(obj, sd); - elm_widget_orientation_set(obj, sd->rot); + elm_obj_widget_on_orientation_update(obj, sd->rot); efl_event_callback_legacy_call (obj, EFL_UI_WIN_EVENT_ROTATION_CHANGED, NULL); efl_event_callback_legacy_call @@ -6050,7 +6050,7 @@ _win_rotate(Evas_Object *obj, Efl_Ui_Win_Data *sd, int rotation, Eina_Bool resiz _elm_win_xwin_update(sd); #endif _elm_win_frame_obj_update(sd); - elm_widget_orientation_set(obj, rotation); + elm_obj_widget_on_orientation_update(obj, rotation); efl_event_callback_legacy_call (obj, EFL_UI_WIN_EVENT_ROTATION_CHANGED, NULL); } diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c index d9437e8..e22a6f3 100644 --- a/src/lib/elementary/elm_widget.c +++ b/src/lib/elementary/elm_widget.c @@ -1424,7 +1424,7 @@ _elm_widget_widget_sub_object_add(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Objec _full_eval(sobj, sdc); if (!sdc->on_create) - elm_obj_widget_orientation_set(sobj, sd->orient_mode); + elm_obj_widget_on_orientation_update(sobj, sd->orient_mode); else sdc->orient_mode = sd->orient_mode; @@ -4643,7 +4643,7 @@ _elm_widget_orientation_mode_disabled_set(Eo *obj, Elm_Widget_Smart_Data *sd, Ei if (!sd_parent) orient_mode = 0; else orient_mode = sd_parent->orient_mode; } - elm_obj_widget_orientation_set(obj, orient_mode); + elm_obj_widget_on_orientation_update(obj, orient_mode); } EOLIAN static Eina_Bool @@ -4654,7 +4654,7 @@ _elm_widget_orientation_mode_disabled_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_ } EOLIAN static void -_elm_widget_orientation_set(Eo *obj, Elm_Widget_Smart_Data *sd, int orient_mode) +_elm_widget_on_orientation_update(Eo *obj, Elm_Widget_Smart_Data *sd, int orient_mode) { Evas_Object *child; Eina_List *l; @@ -4664,7 +4664,7 @@ _elm_widget_orientation_set(Eo *obj, Elm_Widget_Smart_Data *sd, int orient_mode) EINA_LIST_FOREACH (sd->subobjs, l, child) { if (elm_widget_is(child)) - elm_obj_widget_orientation_set(child, orient_mode); + elm_obj_widget_on_orientation_update(child, orient_mode); } if (orient_mode != -1) diff --git a/src/lib/elementary/elm_widget.eo b/src/lib/elementary/elm_widget.eo index a75706b..60ed7ec 100644 --- a/src/lib/elementary/elm_widget.eo +++ b/src/lib/elementary/elm_widget.eo @@ -350,12 +350,23 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible, return: bool; [[Indicates if the operation succeeded.]] legacy: elm_widget_sub_object_del; } - @property orientation { - [[Widget orientation]] - set { - } - values { - rotation: int; [[Orientation]] + on_orientation_update @protected { + [[Virtual function handling canvas orientation changes. + + This method will be called recursively from the top widget (the + window) to all the children objects whenever the window rotation + is changed. The given $rotation will be one of 0, 90, 180, 270 or + the special value -1 if @.orientation_mode_disabled is $true. + + If @.orientation_mode_disabled is $false, the default implementation + will emit the signal "elm,state,orient,$R" will be emitted (where $R + is the rotation angle in degrees). + + See also @Efl.Orientation.orientation.set. + ]] + params { + rotation: int; [[Orientation in degrees: 0, 90, 180, 270 or -1 if + @.orientation_mode_disabled is $true.]] } } disable { diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h index dd27716..4e062e4 100644 --- a/src/lib/elementary/elm_widget.h +++ b/src/lib/elementary/elm_widget.h @@ -768,7 +768,6 @@ EAPI Evas_Object *elm_widget_content_part_get(const Evas_Object *obj, const EAPI Evas_Object *elm_widget_content_part_unset(Evas_Object *obj, const char *part); EAPI void elm_widget_access_info_set(Evas_Object *obj, const char *txt); EAPI const char *elm_widget_access_info_get(const Evas_Object *obj); -EAPI void elm_widget_orientation_set(Evas_Object *obj, int rotation); EAPI Elm_Object_Item *elm_widget_focused_item_get(const Evas_Object *obj); EAPI void elm_widget_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled); EAPI Eina_Bool elm_widget_orientation_mode_disabled_get(const Evas_Object *obj); -- 2.7.4