lib/efl/interfaces/efl_vpath_file.eo \
lib/efl/interfaces/efl_vpath_core.eo \
lib/efl/interfaces/efl_vpath_file_core.eo \
+ lib/efl/interfaces/efl_ui_progress.eo \
$(efl_eolian_legacy_files) \
$(NULL)
#include "interfaces/efl_text_properties.eo.h"
#include "interfaces/efl_orientation.eo.h"
#include "interfaces/efl_flip.eo.h"
+#include "interfaces/efl_ui_progress.eo.h"
/* Core interface */
#include "interfaces/efl_animator.eo.h"
#include "interfaces/efl_animator.eo.c"
#include "interfaces/efl_orientation.eo.c"
#include "interfaces/efl_flip.eo.c"
+#include "interfaces/efl_ui_progress.eo.c"
EAPI void
__efl_internal_init(void)
--- /dev/null
+interface Efl.Ui.Progress {
+ legacy_prefix: null;
+ methods {
+ @property span_size {
+ [[Control the (exact) length of the bar region of a given progress widget
+
+ This sets the minimum width (when in horizontal mode) or height
+ (when in vertical mode) of the actual bar area of the progress
+ bar $obj. This in turn affects the object's minimum size. Use
+ this when you're not setting other size hints expanding on the
+ given direction (like weight and alignment hints) and you would
+ like it to have a specific size.
+
+ Note: Icon, label and unit text around $obj will require their
+ own space, which will make $obj to require more the $size,
+ actually.]]
+ set {
+ }
+ get {
+ }
+ values {
+ size: int; [[The length of the progress's bar region]]
+ }
+ }
+ @property value {
+ [[Control the progress value (in percentage) on a given progress widget
+
+ Use this call to set progress levels.
+
+ Note: If you passes a value out of the specified range for
+ $val, it will be interpreted as the closest of the boundary
+ values in the range.]]
+ set {
+ }
+ get {
+ }
+ values {
+ val: double; [[The progress value (must be between $0.0 and 1.0)]]
+ }
+ }
+ @property unit_format {
+ [[Control the format string for a given progress widget's units label
+
+ If $NULL is passed on $format, it will make $obj's units
+ area to be hidden completely. If not, it'll set the <b>format
+ string</b> for the units label's text. The units label is
+ provided a floating point value, so the units text is up display
+ at most one floating point value. Note that the units label is
+ optional. Use a format string such as "%1.2f meters" for
+ example.
+
+ Note: The default format string for a progress is an integer
+ percentage, as in $"%.0f %%".]]
+ set {
+ }
+ get {
+ }
+ values {
+ units: const(char)* @nullable; [[The format string for $obj's units label]]
+ }
+ }
+ }
+}
eina_stringshare_del(ps->part_name);
free(ps);
}
+
+static inline Eina_Bool
+_is_horizontal(Efl_Orient orientation)
+{
+ if (orientation == EFL_ORIENT_LEFT ||
+ orientation == EFL_ORIENT_RIGHT)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
+static inline Eina_Bool
+_is_inverted(Efl_Orient orientation)
+{
+ if (orientation == EFL_ORIENT_LEFT ||
+ orientation == EFL_ORIENT_UP)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
static void
_units_set(Evas_Object *obj)
{
EINA_LIST_FOREACH(sd->progress_status, l, ps)
{
pos = ps->val;
- if ((!rtl && sd->inverted) ||
- (rtl && ((!sd->horizontal && sd->inverted) ||
- (sd->horizontal && !sd->inverted))))
+ 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
ELM_LAYOUT_DATA_GET(obj, ld);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
- if (sd->horizontal)
+ if (_is_horizontal(sd->orientation))
eina_stringshare_replace(&ld->group, "horizontal");
else eina_stringshare_replace(&ld->group, "vertical");
if ((sd->units) && (!sd->pulse))
elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
- if (sd->horizontal)
+ if (_is_horizontal(sd->orientation))
evas_object_size_hint_min_set
(sd->spacer, (double)sd->size * elm_widget_scale_get(obj) *
elm_config_scale_get(), 1);
(sd->spacer, 1, (double)sd->size * elm_widget_scale_get(obj) *
elm_config_scale_get());
- if (sd->inverted)
+ if (_is_inverted(sd->orientation))
elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
+ else
+ elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
_units_set(obj);
_val_set(obj);
evas_obj_smart_add(eo_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
- priv->horizontal = EINA_TRUE;
+ priv->orientation = EFL_ORIENT_RIGHT;
priv->units = eina_stringshare_add("%.0f %%");
priv->val = MIN_RATIO_LVL;
}
EOLIAN static void
+_elm_progressbar_efl_orientation_orientation_set(Eo *obj, Elm_Progressbar_Data *sd, Efl_Orient dir)
+{
+ sd->orientation = dir;
+
+ elm_obj_widget_theme_apply(obj);
+}
+
+EOLIAN static Efl_Orient
+_elm_progressbar_efl_orientation_orientation_get(Eo *obj EINA_UNUSED, Elm_Progressbar_Data *sd)
+{
+ return sd->orientation;
+}
+
+EOLIAN static void
+_elm_progressbar_efl_ui_progress_span_size_set(Eo *obj, Elm_Progressbar_Data *sd, Evas_Coord size)
+{
+ if (sd->size == size) return;
+
+ sd->size = size;
+
+ if (_is_horizontal(sd->orientation))
+ evas_object_size_hint_min_set
+ (sd->spacer, (double)sd->size * elm_widget_scale_get(obj) *
+ elm_config_scale_get(), 1);
+ else
+ evas_object_size_hint_min_set
+ (sd->spacer, 1, (double)sd->size * elm_widget_scale_get(obj) *
+ elm_config_scale_get());
+
+ elm_layout_sizing_eval(obj);
+}
+
+EOLIAN static Evas_Coord
+_elm_progressbar_efl_ui_progress_span_size_get(Eo *obj EINA_UNUSED, Elm_Progressbar_Data *sd)
+{
+ return sd->size;
+}
+
+EOLIAN static void
+_elm_progressbar_efl_ui_progress_value_set(Eo *obj, Elm_Progressbar_Data *sd, double val)
+{
+ if (sd->val == val) return;
+
+ elm_progressbar_part_value_set(obj, "elm.cur.progressbar", val);
+}
+
+EOLIAN static double
+_elm_progressbar_efl_ui_progress_value_get(Eo *obj EINA_UNUSED, Elm_Progressbar_Data *sd)
+{
+ return sd->val;
+}
+
+EOLIAN static void
+_elm_progressbar_efl_ui_progress_unit_format_set(Eo *obj, Elm_Progressbar_Data *sd, const char *units)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ eina_stringshare_replace(&sd->units, units);
+ if (units)
+ {
+ elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
+ edje_object_message_signal_process(wd->resize_obj);
+ }
+ else
+ {
+ elm_layout_signal_emit(obj, "elm,state,units,hidden", "elm");
+ edje_object_message_signal_process(wd->resize_obj);
+ }
+
+ _units_set(obj);
+ elm_layout_sizing_eval(obj);
+}
+
+EOLIAN static const char *
+_elm_progressbar_efl_ui_progress_unit_format_get(Eo *obj EINA_UNUSED, Elm_Progressbar_Data *sd)
+{
+ return sd->units;
+}
+
+EOLIAN static void
_elm_progressbar_pulse(Eo *obj, Elm_Progressbar_Data *sd, Eina_Bool state)
{
state = !!state;
return 0.0;
}
-EOLIAN static void
-_elm_progressbar_value_set(Eo *obj, Elm_Progressbar_Data *sd, double val)
+EAPI void
+elm_progressbar_value_set(Elm_Progressbar *obj, double val)
{
- if (sd->val == val) return;
-
- elm_progressbar_part_value_set(obj, "elm.cur.progressbar", val);
+ efl_ui_progress_value_set(obj, val);
}
-EOLIAN static double
-_elm_progressbar_value_get(Eo *obj EINA_UNUSED, Elm_Progressbar_Data *sd)
+EAPI double
+elm_progressbar_value_get(const Elm_Progressbar *obj)
{
- return sd->val;
+ return efl_ui_progress_value_get(obj);
}
-EOLIAN static void
-_elm_progressbar_span_size_set(Eo *obj, Elm_Progressbar_Data *sd, Evas_Coord size)
+EAPI void
+elm_progressbar_span_size_set(Elm_Progressbar *obj, Evas_Coord size)
{
- if (sd->size == size) return;
-
- sd->size = size;
-
- if (sd->horizontal)
- evas_object_size_hint_min_set
- (sd->spacer, (double)sd->size * elm_widget_scale_get(obj) *
- elm_config_scale_get(), 1);
- else
- evas_object_size_hint_min_set
- (sd->spacer, 1, (double)sd->size * elm_widget_scale_get(obj) *
- elm_config_scale_get());
-
- elm_layout_sizing_eval(obj);
+ efl_ui_progress_span_size_set(obj, size);
}
-EOLIAN static Evas_Coord
-_elm_progressbar_span_size_get(Eo *obj EINA_UNUSED, Elm_Progressbar_Data *sd)
+EAPI Evas_Coord
+elm_progressbar_span_size_get(const Elm_Progressbar *obj)
{
- return sd->size;
+ return efl_ui_progress_span_size_get(obj);
}
-EOLIAN static void
-_elm_progressbar_unit_format_set(Eo *obj, Elm_Progressbar_Data *sd, const char *units)
+EAPI void
+elm_progressbar_unit_format_set(Elm_Progressbar *obj, const char *units)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
- eina_stringshare_replace(&sd->units, units);
- if (units)
- {
- elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
- edje_object_message_signal_process(wd->resize_obj);
- }
- else
- {
- elm_layout_signal_emit(obj, "elm,state,units,hidden", "elm");
- edje_object_message_signal_process(wd->resize_obj);
- }
-
- _units_set(obj);
- elm_layout_sizing_eval(obj);
+ efl_ui_progress_unit_format_set(obj, units);
}
-EOLIAN static const char*
-_elm_progressbar_unit_format_get(Eo *obj EINA_UNUSED, Elm_Progressbar_Data *sd)
+EAPI const char *
+elm_progressbar_unit_format_get(const Elm_Progressbar *obj)
{
- return sd->units;
+ return efl_ui_progress_unit_format_get(obj);
}
-EOLIAN static void
-_elm_progressbar_unit_format_function_set(Eo *obj, Elm_Progressbar_Data *sd, progressbar_func_type func, progressbar_freefunc_type free_func)
+EAPI void
+elm_progressbar_unit_format_function_set(Elm_Progressbar *obj, progressbar_func_type func, progressbar_freefunc_type free_func)
{
+ ELM_PROGRESSBAR_DATA_GET(obj, sd);
+
sd->unit_format_func = func;
sd->unit_format_free = free_func;
elm_layout_sizing_eval(obj);
}
-EOLIAN static void
-_elm_progressbar_horizontal_set(Eo *obj, Elm_Progressbar_Data *sd, Eina_Bool horizontal)
+static Efl_Orient
+_orientation_get(Eina_Bool horizontal, Eina_Bool inverted)
{
- horizontal = !!horizontal;
- if (sd->horizontal == horizontal) return;
-
- sd->horizontal = horizontal;
- elm_obj_widget_theme_apply(obj);
+ 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;
+ }
}
-EOLIAN static Eina_Bool
-_elm_progressbar_horizontal_get(Eo *obj EINA_UNUSED, Elm_Progressbar_Data *sd)
+EAPI void
+elm_progressbar_horizontal_set(Elm_Progressbar *obj, Eina_Bool horizontal)
{
- return sd->horizontal;
+ Efl_Orient dir;
+ ELM_PROGRESSBAR_DATA_GET(obj, sd);
+
+ dir = _orientation_get(horizontal, _is_inverted(sd->orientation));
+
+ efl_orientation_set(obj, dir);
}
-EOLIAN static void
-_elm_progressbar_inverted_set(Eo *obj, Elm_Progressbar_Data *sd, Eina_Bool inverted)
+EAPI Eina_Bool
+elm_progressbar_horizontal_get(const Elm_Progressbar *obj)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ Efl_Orient dir;
+ dir = efl_orientation_get(obj);
- inverted = !!inverted;
- if (sd->inverted == inverted) return;
+ return _is_horizontal(dir);
+}
- sd->inverted = inverted;
- if (sd->inverted)
- elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
- else
- elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
+EAPI void
+elm_progressbar_inverted_set(Elm_Progressbar *obj, Eina_Bool inverted)
+{
+ Efl_Orient dir;
+ ELM_PROGRESSBAR_DATA_GET(obj, sd);
- edje_object_message_signal_process(wd->resize_obj);
+ dir = _orientation_get(_is_horizontal(sd->orientation), inverted);
- _val_set(obj);
- _units_set(obj);
+ efl_orientation_set(obj, dir);
}
-EOLIAN static Eina_Bool
-_elm_progressbar_inverted_get(Eo *obj EINA_UNUSED, Elm_Progressbar_Data *sd)
+EAPI Eina_Bool
+elm_progressbar_inverted_get(const Elm_Progressbar *obj)
{
- return sd->inverted;
+ Efl_Orient dir;
+ dir = efl_orientation_get(obj);
+
+ return _is_inverted(dir);
}
EOLIAN static Eina_Bool
-class Elm.Progressbar (Elm.Layout)
+class Elm.Progressbar (Elm.Layout, Efl.Ui.Progress,
+ Efl.Orientation)
{
eo_prefix: elm_obj_progressbar;
methods {
- @property span_size {
- [[Control the (exact) length of the bar region of a given progress bar widget
-
- This sets the minimum width (when in horizontal mode) or height
- (when in vertical mode) of the actual bar area of the progress
- bar $obj. This in turn affects the object's minimum size. Use
- this when you're not setting other size hints expanding on the
- given direction (like weight and alignment hints) and you would
- like it to have a specific size.
-
- Note: Icon, label and unit text around $obj will require their
- own space, which will make $obj to require more the $size,
- actually.]]
- set {
- }
- get {
- }
- values {
- size: Evas.Coord; [[The length of the progress bar's bar region]]
- }
- }
@property pulse {
[[Control whether a given progress bar widget is at "pulsing mode" or not.
pulse: bool; [[$true to put $obj in pulsing mode, $false to put it back to its default one]]
}
}
- @property value {
- [[Control the progress value (in percentage) on a given progress bar widget
-
- Use this call to set progress bar levels.
-
- Note: If you passes a value out of the specified range for
- $val, it will be interpreted as the closest of the boundary
- values in the range.]]
- set {
- }
- get {
- }
- values {
- val: double; [[The progress value (must be between $0.0 and 1.0)]]
- }
- }
- @property inverted {
- [[Invert a given progress bar widget's displaying values order
-
- A progress bar may be inverted, in which state it gets its
- values inverted, with high values being on the left or top and
- low values on the right or bottom, as opposed to normally have
- the low values on the former and high values on the latter,
- respectively, for horizontal and vertical modes.]]
- set {
- }
- get {
- }
- values {
- inverted: bool; [[Use $true to make $obj inverted, $false to bring it back to default, non-inverted values.]]
- }
- }
- @property horizontal {
- [[Control the orientation of a given progress bar widget
-
- Use this function to change how your progress bar is to be
- disposed: vertically or horizontally.]]
- set {
- }
- get {
- }
- values {
- horizontal: bool; [[Use $true to make $obj to be horizontal, $false to make it vertical]]
- }
- }
- @property unit_format {
- [[Control the format string for a given progress bar widget's units label
-
- If $NULL is passed on $format, it will make $obj's units
- area to be hidden completely. If not, it'll set the <b>format
- string</b> for the units label's text. The units label is
- provided a floating point value, so the units text is up display
- at most one floating point value. Note that the units label is
- optional. Use a format string such as "%1.2f meters" for
- example.
-
- Note: The default format string for a progress bar is an integer
- percentage, as in $"%.0f %%".]]
- set {
- }
- get {
- }
- values {
- units: const(char)* @nullable; [[The format string for $obj's units label]]
- }
- }
- @property unit_format_function {
- set {
- [[Set the format function pointer for the units label
-
- Set the callback function to format the unit string.
-
- See: @.unit_format.set for more info on how this works.
-
- @since 1.7]]
- }
- values {
- func: progressbar_func_type @nullable; [[The unit format function]]
- free_func: progressbar_freefunc_type @optional; [[The freeing function for the format string.]]
- }
- }
part_value_set {
[[Set the progress value (in percentage) on a given progress bar widget for the given part name
Elm.Layout.text_aliases.get;
Elm.Layout.content_aliases.get;
Elm.Layout.sizing_eval;
+ Efl.Ui.Progress.span_size;
+ Efl.Ui.Progress.value;
+ Efl.Ui.Progress.unit_format;
+ Efl.Orientation.orientation;
}
events {
changed;
*/
EAPI Evas_Object *elm_progressbar_add(Evas_Object *parent);
+/**
+ * @brief Control the (exact) length of the bar region of a given progress bar
+ * widget
+ *
+ * This sets the minimum width (when in horizontal mode) or height (when in
+ * vertical mode) of the actual bar area of the progress bar @c obj. This in
+ * turn affects the object's minimum size. Use this when you're not setting
+ * other size hints expanding on the given direction (like weight and alignment
+ * hints) and you would like it to have a specific size.
+ *
+ * @note Icon, label and unit text around @c obj will require their own space,
+ * which will make @c obj to require more the @c size, actually.
+ *
+ * @param[in] size The length of the progress bar's bar region
+ *
+ * @ingroup Elm_Progressbar
+ */
+EAPI void elm_progressbar_span_size_set(Evas_Object *obj, Evas_Coord size);
+
+/**
+ * @brief Control the (exact) length of the bar region of a given progress bar
+ * widget
+ *
+ * This sets the minimum width (when in horizontal mode) or height (when in
+ * vertical mode) of the actual bar area of the progress bar @c obj. This in
+ * turn affects the object's minimum size. Use this when you're not setting
+ * other size hints expanding on the given direction (like weight and alignment
+ * hints) and you would like it to have a specific size.
+ *
+ * @note Icon, label and unit text around @c obj will require their own space,
+ * which will make @c obj to require more the @c size, actually.
+ *
+ * @return The length of the progress bar's bar region
+ *
+ * @ingroup Elm_Progressbar
+ */
+EAPI Evas_Coord elm_progressbar_span_size_get(const Evas_Object *obj);
+
+/**
+ * @brief Control the progress value (in percentage) on a given progress bar
+ * widget
+ *
+ * Use this call to set progress bar levels.
+ *
+ * @note If you passes a value out of the specified range for @c val, it will
+ * be interpreted as the closest of the boundary values in the range.
+ *
+ * @param[in] val The progress value (must be between $0.0 and 1.0)
+ *
+ * @ingroup Elm_Progressbar
+ */
+EAPI void elm_progressbar_value_set(Evas_Object *obj, double val);
+
+/**
+ * @brief Control the progress value (in percentage) on a given progress bar
+ * widget
+ *
+ * Use this call to set progress bar levels.
+ *
+ * @note If you passes a value out of the specified range for @c val, it will
+ * be interpreted as the closest of the boundary values in the range.
+ *
+ * @return The progress value (must be between $0.0 and 1.0)
+ *
+ * @ingroup Elm_Progressbar
+ */
+EAPI double elm_progressbar_value_get(const Evas_Object *obj);
+
+/**
+ * @brief Invert a given progress bar widget's displaying values order
+ *
+ * A progress bar may be inverted, in which state it gets its values inverted,
+ * with high values being on the left or top and low values on the right or
+ * bottom, as opposed to normally have the low values on the former and high
+ * values on the latter, respectively, for horizontal and vertical modes.
+ *
+ * @param[in] inverted Use @c true to make @c obj inverted, @c false to bring
+ * it back to default, non-inverted values.
+ *
+ * @ingroup Elm_Progressbar
+ */
+EAPI void elm_progressbar_inverted_set(Evas_Object *obj, Eina_Bool inverted);
+
+/**
+ * @brief Invert a given progress bar widget's displaying values order
+ *
+ * A progress bar may be inverted, in which state it gets its values inverted,
+ * with high values being on the left or top and low values on the right or
+ * bottom, as opposed to normally have the low values on the former and high
+ * values on the latter, respectively, for horizontal and vertical modes.
+ *
+ * @return Use @c true to make @c obj inverted, @c false to bring it back to
+ * default, non-inverted values.
+ *
+ * @ingroup Elm_Progressbar
+ */
+EAPI Eina_Bool elm_progressbar_inverted_get(const Evas_Object *obj);
+
+/**
+ * @brief Control the orientation of a given progress bar widget
+ *
+ * Use this function to change how your progress bar is to be disposed:
+ * vertically or horizontally.
+ *
+ * @param[in] horizontal Use @c true to make @c obj to be horizontal, @c false
+ * to make it vertical
+ *
+ * @ingroup Elm_Progressbar
+ */
+EAPI void elm_progressbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
+
+/**
+ * @brief Control the orientation of a given progress bar widget
+ *
+ * Use this function to change how your progress bar is to be disposed:
+ * vertically or horizontally.
+ *
+ * @return Use @c true to make @c obj to be horizontal, @c false to make it
+ * vertical
+ *
+ * @ingroup Elm_Progressbar
+ */
+EAPI Eina_Bool elm_progressbar_horizontal_get(const Evas_Object *obj);
+
+/**
+ * @brief Control the format string for a given progress bar widget's units
+ * label
+ *
+ * If @c NULL is passed on @c format, it will make @c obj's units area to be
+ * hidden completely. If not, it'll set the <b>format string</b> for the units
+ * label's text. The units label is provided a floating point value, so the
+ * units text is up display at most one floating point value. Note that the
+ * units label is optional. Use a format string such as "%1.2f meters" for
+ * example.
+ *
+ * @note The default format string for a progress bar is an integer percentage,
+ * as in $"%.0f %%".
+ *
+ * @param[in] units The format string for @c obj's units label
+ *
+ * @ingroup Elm_Progressbar
+ */
+EAPI void elm_progressbar_unit_format_set(Evas_Object *obj, const char *units);
+
+/**
+ * @brief Control the format string for a given progress bar widget's units
+ * label
+ *
+ * If @c NULL is passed on @c format, it will make @c obj's units area to be
+ * hidden completely. If not, it'll set the <b>format string</b> for the units
+ * label's text. The units label is provided a floating point value, so the
+ * units text is up display at most one floating point value. Note that the
+ * units label is optional. Use a format string such as "%1.2f meters" for
+ * example.
+ *
+ * @note The default format string for a progress bar is an integer percentage,
+ * as in $"%.0f %%".
+ *
+ * @return The format string for @c obj's units label
+ *
+ * @ingroup Elm_Progressbar
+ */
+EAPI const char *elm_progressbar_unit_format_get(const Evas_Object *obj);
+
+/**
+ * @brief Set the format function pointer for the units label
+ *
+ * Set the callback function to format the unit string.
+ *
+ * See: @ref elm_progressbar_unit_format_set for more info on how this works.
+ *
+ * @param[in] func The unit format function
+ * @param[in] free_func The freeing function for the format string.
+ *
+ * @since 1.7
+ *
+ * @ingroup Elm_Progressbar
+ */
+EAPI void elm_progressbar_unit_format_function_set(Evas_Object *obj, progressbar_func_type func, progressbar_freefunc_type free_func);
+
#include "elm_progressbar.eo.legacy.h"
\ No newline at end of file
return ECORE_CALLBACK_CANCEL;
}
+static inline Eina_Bool
+_is_horizontal(Efl_Orient orientation)
+{
+ if (orientation == EFL_ORIENT_LEFT ||
+ orientation == EFL_ORIENT_RIGHT)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
+static inline Eina_Bool
+_is_inverted(Efl_Orient orientation)
+{
+ if (orientation == EFL_ORIENT_LEFT ||
+ orientation == EFL_ORIENT_UP)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
+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;
+ }
+}
+
static void
_val_fetch(Evas_Object *obj, Eina_Bool user_event)
{
edje_object_part_drag_value_get
(wd->resize_obj, "elm.dragable.slider", &posx, &posy);
- if (sd->horizontal) pos = posx;
+ if (_is_horizontal(sd->orientation)) pos = posx;
else pos = posy;
edje_object_part_drag_value_get
(wd->resize_obj, "elm.dragable2.slider", &posx2, &posy2);
- if (sd->horizontal) pos2 = posx2;
+ if (_is_horizontal(sd->orientation)) pos2 = posx2;
else pos2 = posy2;
rtl = elm_widget_mirrored_get(obj);
- if ((!rtl && sd->inverted) ||
- (rtl && ((!sd->horizontal && sd->inverted) ||
- (sd->horizontal && !sd->inverted))))
+ if ((!rtl && _is_inverted(sd->orientation)) ||
+ (rtl && ((sd->orientation == EFL_ORIENT_UP) ||
+ (sd->orientation == EFL_ORIENT_RIGHT))))
{
pos = 1.0 - pos;
pos2 = 1.0 - pos2;
pos2 = 1.0;
rtl = elm_widget_mirrored_get(obj);
- if ((!rtl && sd->inverted) ||
- (rtl && ((!sd->horizontal && sd->inverted) ||
- (sd->horizontal && !sd->inverted))))
+ if ((!rtl && _is_inverted(sd->orientation)) ||
+ (rtl && ((sd->orientation == EFL_ORIENT_UP) ||
+ (sd->orientation == EFL_ORIENT_RIGHT))))
{
pos = 1.0 - pos;
pos2 = 1.0 - pos2;
ELM_SLIDER_DATA_GET(data, sd);
step = sd->step;
- if (sd->inverted) step *= -1.0;
+ if (_is_inverted(sd->orientation)) step *= -1.0;
ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
edje_object_part_drag_step
ELM_SLIDER_DATA_GET(data, sd);
step = -sd->step;
- if (sd->inverted) step *= -1.0;
+ if (_is_inverted(sd->orientation)) step *= -1.0;
ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
edje_object_part_drag_step
if (!strcmp(dir, "left"))
{
- if (!sd->horizontal) return EINA_FALSE;
- if (!sd->inverted) _drag_down(obj, NULL, NULL, NULL);
+ if (!_is_horizontal(sd->orientation))
+ return EINA_FALSE;
+ if (!_is_inverted(sd->orientation))
+ _drag_down(obj, NULL, NULL, NULL);
else _drag_up(obj, NULL, NULL, NULL);
}
else if (!strcmp(dir, "right"))
{
- if (!sd->horizontal) return EINA_FALSE;
- if (!sd->inverted) _drag_up(obj, NULL, NULL, NULL);
+ if (!_is_horizontal(sd->orientation))
+ return EINA_FALSE;
+ if (!_is_inverted(sd->orientation))
+ _drag_up(obj, NULL, NULL, NULL);
else _drag_down(obj, NULL, NULL, NULL);
}
else if (!strcmp(dir, "up"))
{
- if (sd->horizontal) return EINA_FALSE;
- if (sd->inverted) _drag_up(obj, NULL, NULL, NULL);
+ if (_is_horizontal(sd->orientation))
+ return EINA_FALSE;
+ if (_is_inverted(sd->orientation))
+ _drag_up(obj, NULL, NULL, NULL);
else _drag_down(obj, NULL, NULL, NULL);
}
else if (!strcmp(dir, "down"))
{
- if (sd->horizontal) return EINA_FALSE;
- if (sd->inverted) _drag_down(obj, NULL, NULL, NULL);
+ if (_is_horizontal(sd->orientation))
+ return EINA_FALSE;
+ if (_is_inverted(sd->orientation))
+ _drag_down(obj, NULL, NULL, NULL);
else _drag_up(obj, NULL, NULL, NULL);
}
else return EINA_FALSE;
if ((act == ELM_ACTIVATE_UP) ||
(act == ELM_ACTIVATE_RIGHT))
{
- if (!sd->inverted) _drag_up(obj, NULL, NULL, NULL);
+ if (!_is_inverted(sd->orientation))
+ _drag_up(obj, NULL, NULL, NULL);
else _drag_down(obj, NULL, NULL, NULL);
}
else if ((act == ELM_ACTIVATE_DOWN) ||
(act == ELM_ACTIVATE_LEFT))
{
- if (!sd->inverted) _drag_down(obj, NULL, NULL, NULL);
+ if (!_is_inverted(sd->orientation))
+ _drag_down(obj, NULL, NULL, NULL);
else _drag_up(obj, NULL, NULL, NULL);
}
// XXX popup needs to adapt to theme etc.
*popup = edje_object_add(evas_object_evas_get(obj));
evas_object_smart_member_add(*popup, obj);
- if (sd->horizontal)
+ if (_is_horizontal(sd->orientation))
_elm_theme_set(elm_widget_theme_get(obj), *popup, "slider", "horizontal/popup", elm_widget_style_get(obj));
else
_elm_theme_set(elm_widget_theme_get(obj), *popup, "slider", "vertical/popup", elm_widget_style_get(obj));
ELM_LAYOUT_DATA_GET(obj, ld);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
- if (sd->horizontal)
+ if (_is_horizontal(sd->orientation))
{
eina_stringshare_replace(&ld->group, "horizontal");
if (sd->popup)
_popup_add(sd, obj, &sd->popup2, &sd->track2, EINA_TRUE);
}
- if (sd->horizontal)
+ if (_is_horizontal(sd->orientation))
evas_object_size_hint_min_set
(sd->spacer, (double)sd->size * elm_widget_scale_get(obj) *
elm_config_scale_get(), 1);
else
elm_layout_signal_emit(obj, "elm,slider,range,disable", "elm");
- if (sd->inverted)
+ if (_is_inverted(sd->orientation))
{
elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
if (sd->popup)
if (sd->popup2)
edje_object_signal_emit(sd->popup2, "elm,state,inverted,on", "elm");
}
+ else
+ {
+ elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
+ if (sd->popup)
+ edje_object_signal_emit(sd->popup, "elm,state,inverted,off", "elm");
+ }
+
if (sd->indicator_show)
{
elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
edje_object_part_drag_value_get
(wd->resize_obj, "elm.dragable2.slider", &posx2, &posy2);
- if (sd->horizontal)
+ if (_is_horizontal(sd->orientation))
{
diff1 = fabs(button_x - posx);
diff2 = fabs(button_x - posx2);
evas_object_geometry_get(sd->spacer, &x, &y, &w, &h);
sd->downx = ev->canvas.x - x;
sd->downy = ev->canvas.y - y;
- if (sd->horizontal)
+ if (_is_horizontal(sd->orientation))
{
button_x = ((double)ev->canvas.x - (double)x) / (double)w;
if (button_x > 1) button_x = 1;
Evas_Coord d = 0;
evas_object_geometry_get(sd->spacer, &x, &y, &w, &h);
- if (sd->horizontal) d = abs(ev->cur.canvas.x - x - sd->downx);
+ if (_is_horizontal(sd->orientation))
+ d = abs(ev->cur.canvas.x - x - sd->downx);
else d = abs(ev->cur.canvas.y - y - sd->downy);
if (d > (_elm_config->thumbscroll_threshold - 1))
{
elm_slider_value_set(data, sd->val2);
return;
}
- if (sd->horizontal)
+ if (_is_horizontal(sd->orientation))
{
button_x = ((double)ev->cur.canvas.x - (double)x) / (double)w;
if (button_x > 1) button_x = 1;
{
elm_layout_freeze(obj);
- if (sd->horizontal)
+ if (_is_horizontal(sd->orientation))
evas_object_size_hint_min_set
(sd->spacer, (double)sd->size * elm_widget_scale_get(obj) *
elm_config_scale_get(), 1);
evas_obj_smart_add(eo_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
- priv->horizontal = EINA_TRUE;
+ priv->orientation = EFL_ORIENT_RIGHT;
priv->indicator_show = EINA_TRUE;
priv->indicator_visible_mode = elm_config_slider_indicator_visible_mode_get();
priv->val_max = 1.0;
return obj;
}
+EAPI void
+elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size)
+{
+ efl_ui_progress_span_size_set(obj, size);
+}
+
+EAPI Evas_Coord
+elm_slider_span_size_get(const Evas_Object *obj)
+{
+ return efl_ui_progress_span_size_get(obj);
+}
+
+EAPI void
+elm_slider_unit_format_set(Evas_Object *obj, const char *units)
+{
+ efl_ui_progress_unit_format_set(obj, units);
+}
+
+EAPI const char *
+elm_slider_unit_format_get(const Evas_Object *obj)
+{
+ return efl_ui_progress_unit_format_get(obj);
+}
+
+EAPI void
+elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
+{
+ Efl_Orient dir;
+ ELM_SLIDER_DATA_GET(obj, sd);
+
+ dir = _orientation_get(horizontal, _is_inverted(sd->orientation));
+
+ efl_orientation_set(obj, dir);
+}
+
+EAPI Eina_Bool
+elm_slider_horizontal_get(const Evas_Object *obj)
+{
+ Efl_Orient dir;
+ dir = efl_orientation_get(obj);
+
+ return _is_horizontal(dir);
+}
+
+EAPI void
+elm_slider_value_set(Evas_Object *obj, double val)
+{
+ efl_ui_progress_value_set(obj, val);
+}
+
+EAPI double
+elm_slider_value_get(const Evas_Object *obj)
+{
+ return efl_ui_progress_value_get(obj);
+}
+
+EAPI void
+elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted)
+{
+ Efl_Orient dir;
+ ELM_SLIDER_DATA_GET(obj, sd);
+
+ dir = _orientation_get(_is_horizontal(sd->orientation), inverted);
+
+ efl_orientation_set(obj, dir);
+}
+
+EAPI Eina_Bool
+elm_slider_inverted_get(const Evas_Object *obj)
+{
+ Efl_Orient dir;
+ dir = efl_orientation_get(obj);
+
+ return _is_inverted(dir);
+}
+
+EAPI void
+elm_slider_units_format_function_set(Evas_Object *obj, slider_func_type func, slider_freefunc_type free_func)
+{
+ ELM_SLIDER_DATA_GET(obj, sd);
+
+ sd->units_format_func = func;
+ sd->units_format_free = free_func;
+
+ evas_object_smart_changed(obj);
+}
+
EOLIAN static void
-_elm_slider_span_size_set(Eo *obj, Elm_Slider_Data *sd, Evas_Coord size)
+_elm_slider_efl_orientation_orientation_set(Eo *obj, Elm_Slider_Data *sd, Efl_Orient dir)
+{
+ sd->orientation = dir;
+
+ elm_obj_widget_theme_apply(obj);
+}
+
+EOLIAN static Efl_Orient
+_elm_slider_efl_orientation_orientation_get(Eo *obj EINA_UNUSED, Elm_Slider_Data *sd)
+{
+ return sd->orientation;
+}
+
+EOLIAN static void
+_elm_slider_efl_ui_progress_span_size_set(Eo *obj, Elm_Slider_Data *sd, Evas_Coord size)
{
if (sd->size == size) return;
sd->size = size;
}
EOLIAN static Evas_Coord
-_elm_slider_span_size_get(Eo *obj EINA_UNUSED, Elm_Slider_Data *sd)
+_elm_slider_efl_ui_progress_span_size_get(Eo *obj EINA_UNUSED, Elm_Slider_Data *sd)
{
return sd->size;
}
EOLIAN static void
-_elm_slider_unit_format_set(Eo *obj, Elm_Slider_Data *sd, const char *units)
+_elm_slider_efl_ui_progress_unit_format_set(Eo *obj, Elm_Slider_Data *sd, const char *units)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
evas_object_smart_changed(obj);
}
-EOLIAN static const char*
-_elm_slider_unit_format_get(Eo *obj EINA_UNUSED, Elm_Slider_Data *sd)
+EOLIAN static const char *
+_elm_slider_efl_ui_progress_unit_format_get(Eo *obj EINA_UNUSED, Elm_Slider_Data *sd)
{
return sd->units;
}
}
EOLIAN static void
-_elm_slider_horizontal_set(Eo *obj, Elm_Slider_Data *sd, Eina_Bool horizontal)
-{
- horizontal = !!horizontal;
- if (sd->horizontal == horizontal) return;
- sd->horizontal = horizontal;
-
- elm_obj_widget_theme_apply(obj);
-}
-
-EOLIAN static Eina_Bool
-_elm_slider_horizontal_get(Eo *obj EINA_UNUSED, Elm_Slider_Data *sd)
-{
- return sd->horizontal;
-}
-
-EOLIAN static void
_elm_slider_min_max_set(Eo *obj, Elm_Slider_Data *sd, double min, double max)
{
if ((sd->val_min == min) && (sd->val_max == max)) return;
}
EOLIAN static void
-_elm_slider_value_set(Eo *obj, Elm_Slider_Data *sd, double val)
+_elm_slider_efl_ui_progress_value_set(Eo *obj, Elm_Slider_Data *sd, double val)
{
if (sd->val == val) return;
sd->val = val;
}
EOLIAN static double
-_elm_slider_value_get(Eo *obj EINA_UNUSED, Elm_Slider_Data *sd)
+_elm_slider_efl_ui_progress_value_get(Eo *obj EINA_UNUSED, Elm_Slider_Data *sd)
{
return sd->val;
}
EOLIAN static void
-_elm_slider_inverted_set(Eo *obj, Elm_Slider_Data *sd, Eina_Bool inverted)
-{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
- inverted = !!inverted;
- if (sd->inverted == inverted) return;
- sd->inverted = inverted;
-
- if (sd->inverted)
- {
- elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
- if (sd->popup)
- edje_object_signal_emit(sd->popup, "elm,state,inverted,on", "elm");
- }
- else
- {
- elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
- if (sd->popup)
- edje_object_signal_emit(sd->popup, "elm,state,inverted,off", "elm");
- }
-
- edje_object_message_signal_process(wd->resize_obj);
-
- _visuals_refresh(obj);
-}
-
-EOLIAN static Eina_Bool
-_elm_slider_inverted_get(Eo *obj EINA_UNUSED, Elm_Slider_Data *sd)
-{
- return sd->inverted;
-}
-
-EOLIAN static void
_elm_slider_indicator_format_function_set(Eo *obj, Elm_Slider_Data *sd, slider_func_type func, slider_freefunc_type free_func)
{
sd->indicator_format_func = func;
}
EOLIAN static void
-_elm_slider_units_format_function_set(Eo *obj, Elm_Slider_Data *sd, slider_func_type func, slider_freefunc_type free_func)
-{
- sd->units_format_func = func;
- sd->units_format_free = free_func;
-
- evas_object_smart_changed(obj);
-}
-
-EOLIAN static void
_elm_slider_indicator_show_set(Eo *obj, Elm_Slider_Data *sd, Eina_Bool show)
{
if (show)
-class Elm.Slider (Elm.Layout, Elm.Interface_Atspi_Value,
+class Elm.Slider (Elm.Layout, Efl.Ui.Progress,
+ Efl.Orientation,
+ Elm.Interface_Atspi_Value,
Elm.Interface_Atspi_Widget_Action)
{
eo_prefix: elm_obj_slider;
methods {
- @property horizontal {
- set {
- [[Set the orientation of a given slider widget.
-
- Use this function to change how your slider is to be
- disposed: vertically or horizontally.
-
- By default it's displayed horizontally.
- ]]
- }
- get {
- [[Get the orientation of a given slider widget.]]
- }
- values {
- horizontal: bool;
- }
- }
- @property value {
- set {
- [[Set the value the slider displays.
-
- Value will be presented on the unit label following format
- specified with @.unit_format.set and on indicator with
- @.indicator_format.set.
-
- Note: The value must to be between min and max values. This values
- are set by @.min_max.set.
- ]]
- }
- get {
- [[Get the value displayed by the slider.]]
- }
- values {
- val: double; [[The value to be displayed.]]
- }
- }
@property indicator_format {
set {
[[Set the format string for the indicator label.
indicator: const(char)* @nullable; [[The format string for the indicator display.]]
}
}
- @property inverted {
- set {
- [[Invert a given slider widget's displaying values order
-
- A slider may be inverted, in which state it gets its values
- inverted, with high vales being on the left or top and low
- values on the right or bottom, as opposed to normally have
- the low values on the former and high values on the latter,
- respectively, for horizontal and vertical modes.
- ]]
- }
- get {
- [[Get whether a given slider widget's displaying values are
- inverted or not.
- ]]
- }
- values {
- inverted: bool; [[Use $true to make $obj inverted, $false to bring
- it back to default, non-inverted values.]]
- }
- }
@property indicator_show {
set {
[[Set whether to enlarge slider indicator (augmented knob) or not.
If actual value is less than $min, it will be updated to $min.
If it is bigger then $max, will be updated to $max. Actual value
- can be get with @.value,get.
+ can be get with @Efl.Ui.Progress.value.get
By default, min is equal to 0.0, and max is equal to 1.0.
max: double; [[The maximum value.]]
}
}
- @property unit_format {
- set {
- [[Set the format string for the unit label.
-
- Unit label is displayed all the time, if set, after slider's bar.
- In horizontal mode, at right and in vertical mode, at bottom.
-
- If $null, unit label won't be visible. If not it sets the format
- string for the label text. To the label text is provided a
- floating point value, so the label text can display up to 1
- floating point value. Note that this is optional.
-
- Use a format string such as "%1.2f meters" for example, and it
- will display values like: "3.14 meters" for a value equal to
- 3.14159.
-
- Default is unit label disabled.
- ]]
- }
- get {
- [[Get the unit label format of the slider.
-
- Unit label is displayed all the time, if set, after slider's bar.
- In horizontal mode, at right and in vertical mode, at bottom.
- ]]
- }
- values {
- units: const(char)* @nullable; [[The format string for the unit display.]]
- }
- }
@property indicator_show_on_focus {
set {
[[Show the indicator of slider on focus.]]
flag: bool;
}
}
- @property span_size {
- set {
- [[Set the (exact) length of the bar region of a given slider widget.
-
- This sets the minimum width (when in horizontal mode) or height
- (when in vertical mode) of the actual bar area of the slider
- $obj. This in turn affects the object's minimum size. Use
- this when you're not setting other size hints expanding on the
- given direction (like weight and alignment hints) and you would
- like it to have a specific size.
-
- Note: Icon, end, label, indicator and unit text around $obj
- will require their own space, which will make $obj to require
- more the $size, actually.
- ]]
- }
- get {
- [[Get the length set for the bar region of a given slider widget
-
- If that size was not set previously, with @.span_size.set, this
- call will return $0.
- ]]
- }
- values {
- size: Evas.Coord; [[The length of the slider's bar region.]]
- }
- }
@property step {
set {
[[Set the step by which slider indicator will move.
free_func: slider_freefunc_type @nullable; [[The freeing function for the format string.]]
}
}
- @property units_format_function {
- set {
- [[Set the format function pointer for the units label
-
- Set the callback function to format the units string.
- ]]
- }
- values {
- func: slider_func_type @nullable; [[The units format function.]]
- free_func: slider_freefunc_type @nullable; [[The freeing function for the format string.]]
- }
- }
@property range_enabled {
set {
[[Enables the range. This enables two indicators in slider.]]
Elm.Layout.text_aliases.get;
Elm.Layout.content_aliases.get;
Elm.Layout.sizing_eval;
+ Efl.Ui.Progress.span_size;
+ Efl.Ui.Progress.value;
+ Efl.Ui.Progress.unit_format;
+ Efl.Orientation.orientation;
Elm.Interface_Atspi_Value.value_and_text.get;
Elm.Interface_Atspi_Value.value_and_text.set;
Elm.Interface_Atspi_Value.range.get;
*/
EAPI Evas_Object *elm_slider_add(Evas_Object *parent);
+/**
+ * @brief Set the orientation of a given slider widget.
+ *
+ * Use this function to change how your slider is to be disposed: vertically or
+ * horizontally.
+ *
+ * By default it's displayed horizontally.
+ *
+ * @param[in] horizontal
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI void elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
+
+/** Get the orientation of a given slider widget.
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI Eina_Bool elm_slider_horizontal_get(const Evas_Object *obj);
+
+/**
+ * @brief Set the value the slider displays.
+ *
+ * Value will be presented on the unit label following format specified with
+ * @ref elm_slider_unit_format_set and on indicator with
+ * @ref elm_slider_indicator_format_set.
+ *
+ * @note The value must to be between min and max values. This values are set
+ * by @ref elm_slider_min_max_set.
+ *
+ * @param[in] val The value to be displayed.
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI void elm_slider_value_set(Evas_Object *obj, double val);
+
+/**
+ * @brief Get the value displayed by the slider.
+ *
+ * @return The value to be displayed.
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI double elm_slider_value_get(const Evas_Object *obj);
+
+/**
+ * @brief Invert a given slider widget's displaying values order
+ *
+ * A slider may be inverted, in which state it gets its values inverted, with
+ * high vales being on the left or top and low values on the right or bottom,
+ * as opposed to normally have the low values on the former and high values on
+ * the latter, respectively, for horizontal and vertical modes.
+ *
+ * @param[in] inverted Use @c true to make @c obj inverted, @c false to bring
+ * it back to default, non-inverted values.
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI void elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted);
+
+/**
+ * @brief Get whether a given slider widget's displaying values are inverted or
+ * not.
+ *
+ * @return Use @c true to make @c obj inverted, @c false to bring it back to
+ * default, non-inverted values.
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI Eina_Bool elm_slider_inverted_get(const Evas_Object *obj);
+
+/**
+ * @brief Set the (exact) length of the bar region of a given slider widget.
+ *
+ * This sets the minimum width (when in horizontal mode) or height (when in
+ * vertical mode) of the actual bar area of the slider @c obj. This in turn
+ * affects the object's minimum size. Use this when you're not setting other
+ * size hints expanding on the given direction (like weight and alignment
+ * hints) and you would like it to have a specific size.
+ *
+ * @note Icon, end, label, indicator and unit text around @c obj will require
+ * their own space, which will make @c obj to require more the @c size,
+ * actually.
+ *
+ * @param[in] size The length of the slider's bar region.
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI void elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size);
+
+/**
+ * @brief Get the length set for the bar region of a given slider widget
+ *
+ * If that size was not set previously, with @ref elm_slider_span_size_set,
+ * this call will return $0.
+ *
+ * @return The length of the slider's bar region.
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI Evas_Coord elm_slider_span_size_get(const Evas_Object *obj);
+
+/**
+ * @brief Set the format string for the unit label.
+ *
+ * Unit label is displayed all the time, if set, after slider's bar. In
+ * horizontal mode, at right and in vertical mode, at bottom.
+ *
+ * If @c null, unit label won't be visible. If not it sets the format string
+ * for the label text. To the label text is provided a floating point value, so
+ * the label text can display up to 1 floating point value. Note that this is
+ * optional.
+ *
+ * Use a format string such as "%1.2f meters" for example, and it will display
+ * values like: "3.14 meters" for a value equal to 3.14159.
+ *
+ * Default is unit label disabled.
+ *
+ * @param[in] units The format string for the unit display.
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI void elm_slider_unit_format_set(Evas_Object *obj, const char *units);
+
+/**
+ * @brief Get the unit label format of the slider.
+ *
+ * Unit label is displayed all the time, if set, after slider's bar. In
+ * horizontal mode, at right and in vertical mode, at bottom.
+ *
+ * @return The format string for the unit display.
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI const char *elm_slider_unit_format_get(const Evas_Object *obj);
+
+/**
+ * @brief Set the format function pointer for the units label
+ *
+ * Set the callback function to format the units string.
+ *
+ * @param[in] func The units format function.
+ * @param[in] free_func The freeing function for the format string.
+ *
+ * @ingroup Elm_Slider
+ */
+EAPI void elm_slider_units_format_function_set(Evas_Object *obj, slider_func_type func, slider_freefunc_type free_func);
+
#include "elm_slider.eo.legacy.h"
\ No newline at end of file
Evas_Coord size; /**< Width or height of progressbar */
double val; /**< Value of progressbar */
- Eina_Bool horizontal : 1; /**< Whether progressbar style is horizontal */
- Eina_Bool inverted : 1; /**< Whether direction of progressbar is LTR */
+ Efl_Orient orientation; /**< Orientation of the progressbar */
Eina_Bool pulse : 1; /**< Whether object is put in the pulsing mode */
Eina_Bool pulse_state : 1; /**< To start the pulsing animation, otherwise to stop it */
Eina_List *progress_status; /**< The list of _Elm_Progress_Status. To save the progress value(in percentage) each part of given progress bar */
Evas_Coord size;
Evas_Coord downx, downy;
+ Efl_Orient orientation;
double range_from, range_to;
- Eina_Bool horizontal : 1;
- Eina_Bool inverted : 1;
Eina_Bool indicator_show : 1;
Eina_Bool spacer_down : 1;
Eina_Bool frozen : 1;