}
static inline Eina_Bool
-_is_horizontal(Efl_Orient orientation)
+_is_horizontal(Efl_Ui_Dir dir)
{
- if (orientation == EFL_ORIENT_LEFT ||
- orientation == EFL_ORIENT_RIGHT)
- return EINA_TRUE;
-
- return EINA_FALSE;
+ return efl_ui_dir_is_horizontal(dir, EINA_TRUE);
}
static inline Eina_Bool
-_is_inverted(Efl_Orient orientation)
+_is_inverted(Efl_Ui_Dir dir)
{
- if (orientation == EFL_ORIENT_LEFT ||
- orientation == EFL_ORIENT_UP)
+ if ((dir == EFL_UI_DIR_LEFT) || (dir == EFL_UI_DIR_UP))
return EINA_TRUE;
return EINA_FALSE;
}
+static Efl_Ui_Dir
+_direction_get(Eina_Bool horizontal, Eina_Bool inverted)
+{
+ if (horizontal)
+ {
+ if (inverted)
+ return EFL_UI_DIR_LEFT;
+ else
+ return EFL_UI_DIR_RIGHT;
+ }
+ else
+ {
+ if (inverted)
+ return EFL_UI_DIR_UP;
+ else
+ return EFL_UI_DIR_DOWN;
+ }
+}
+
static void
_units_set(Evas_Object *obj)
{
Eina_List *l;
EINA_LIST_FOREACH(sd->progress_status, l, ps)
- {
- pos = ps->val;
- if ((!rtl && _is_inverted(sd->orientation)) ||
- (rtl && ((sd->orientation == EFL_ORIENT_UP) ||
- (sd->orientation == EFL_ORIENT_RIGHT))))
- pos = MAX_RATIO_LVL - pos;
-
- edje_object_part_drag_value_set
- (wd->resize_obj, ps->part_name, pos, pos);
- }
+ {
+ pos = ps->val;
+ if ((!rtl && _is_inverted(sd->dir)) ||
+ (rtl && ((sd->dir == EFL_UI_DIR_UP) ||
+ (sd->dir == EFL_UI_DIR_RIGHT))))
+ pos = MAX_RATIO_LVL - pos;
+
+ edje_object_part_drag_value_set
+ (wd->resize_obj, ps->part_name, pos, pos);
+ }
}
EOLIAN static void
EFL_UI_LAYOUT_DATA_GET(obj, ld);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
- if (_is_horizontal(sd->orientation))
+ if (_is_horizontal(sd->dir))
eina_stringshare_replace(&ld->group, "horizontal");
else eina_stringshare_replace(&ld->group, "vertical");
if (((sd->units) || (sd->unit_format_func)) && (!sd->pulse))
elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
- if (_is_horizontal(sd->orientation))
+ if (_is_horizontal(sd->dir))
evas_object_size_hint_min_set
(sd->spacer, (double)sd->size * efl_ui_scale_get(obj) *
elm_config_scale_get(), 1);
(sd->spacer, 1, (double)sd->size * efl_ui_scale_get(obj) *
elm_config_scale_get());
- if (_is_inverted(sd->orientation))
+ if (_is_inverted(sd->dir))
elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
else
elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
- priv->orientation = EFL_ORIENT_RIGHT;
+ priv->dir = EFL_UI_DIR_RIGHT;
priv->units = eina_stringshare_add("%.0f %%");
priv->val = MIN_RATIO_LVL;
}
EOLIAN static void
-_efl_ui_progressbar_efl_orientation_orientation_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Efl_Orient dir)
+_efl_ui_progressbar_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Efl_Ui_Dir dir)
{
- sd->orientation = dir;
+ sd->dir = dir;
elm_obj_widget_theme_apply(obj);
}
-EOLIAN static Efl_Orient
-_efl_ui_progressbar_efl_orientation_orientation_get(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
+EOLIAN static Efl_Ui_Dir
+_efl_ui_progressbar_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
{
- return sd->orientation;
+ return sd->dir;
}
EOLIAN static void
sd->size = size;
- if (_is_horizontal(sd->orientation))
+ if (_is_horizontal(sd->dir))
evas_object_size_hint_min_set
(sd->spacer, (double)sd->size * efl_ui_scale_get(obj) *
elm_config_scale_get(), 1);
elm_layout_sizing_eval(obj);
}
-static Efl_Orient
-_orientation_get(Eina_Bool horizontal, Eina_Bool inverted)
-{
- if (horizontal)
- {
- if (inverted)
- return EFL_ORIENT_LEFT;
- else
- return EFL_ORIENT_RIGHT;
- }
- else
- {
- if (inverted)
- return EFL_ORIENT_UP;
- else
- return EFL_ORIENT_DOWN;
- }
-}
-
EAPI void
elm_progressbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
{
- Efl_Orient dir;
+ Efl_Ui_Dir dir;
EFL_UI_PROGRESSBAR_DATA_GET(obj, sd);
- dir = _orientation_get(horizontal, _is_inverted(sd->orientation));
+ dir = _direction_get(horizontal, _is_inverted(sd->dir));
- efl_orientation_set(obj, dir);
+ efl_ui_direction_set(obj, dir);
}
EAPI Eina_Bool
elm_progressbar_horizontal_get(const Evas_Object *obj)
{
- Efl_Orient dir;
- dir = efl_orientation_get(obj);
+ Efl_Ui_Dir dir;
+ dir = efl_ui_direction_get(obj);
return _is_horizontal(dir);
}
EAPI void
elm_progressbar_inverted_set(Evas_Object *obj, Eina_Bool inverted)
{
- Efl_Orient dir;
+ Efl_Ui_Dir dir;
EFL_UI_PROGRESSBAR_DATA_GET(obj, sd);
- dir = _orientation_get(_is_horizontal(sd->orientation), inverted);
+ dir = _direction_get(_is_horizontal(sd->dir), inverted);
- efl_orientation_set(obj, dir);
+ efl_ui_direction_set(obj, dir);
}
EAPI Eina_Bool
elm_progressbar_inverted_get(const Evas_Object *obj)
{
- Efl_Orient dir;
- dir = efl_orientation_get(obj);
+ Efl_Ui_Dir dir;
+ dir = efl_ui_direction_get(obj);
return _is_inverted(dir);
}