Efl.Ui.Progressbar: add pulse_mode & pulse as eo API

and mark pulse_set/get, pulse and is_pulsing_get() as legacy APIs

ref T5360

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
This commit is contained in:
Amitesh Singh 2017-05-24 14:12:34 +09:00
parent 81eb7a3f0b
commit 071bdb6b22
3 changed files with 121 additions and 22 deletions

View File

@ -367,7 +367,7 @@ _efl_ui_progressbar_efl_object_constructor(Eo *obj, Efl_Ui_Progressbar_Data *_pd
}
EOLIAN static void
_efl_ui_progressbar_pulse_set(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd, Eina_Bool pulse)
_efl_ui_progressbar_pulse_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd, Eina_Bool pulse)
{
pulse = !!pulse;
if (sd->pulse == pulse) return;
@ -378,7 +378,7 @@ _efl_ui_progressbar_pulse_set(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd,
}
EOLIAN static Eina_Bool
_efl_ui_progressbar_pulse_get(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
_efl_ui_progressbar_pulse_mode_get(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
{
return sd->pulse;
}
@ -458,7 +458,7 @@ _efl_ui_progressbar_efl_ui_progress_unit_format_get(Eo *obj EINA_UNUSED, Efl_Ui_
}
EOLIAN static void
_efl_ui_progressbar_pulse(Eo *obj, Efl_Ui_Progressbar_Data *sd, Eina_Bool state)
_efl_ui_progressbar_pulse_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Eina_Bool state)
{
state = !!state;
if ((!sd->pulse) || (sd->pulse_state == state)) return;
@ -472,7 +472,7 @@ _efl_ui_progressbar_pulse(Eo *obj, Efl_Ui_Progressbar_Data *sd, Eina_Bool state)
}
EOLIAN static Eina_Bool
_efl_ui_progressbar_is_pulsing_get(const Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
_efl_ui_progressbar_pulse_get(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
{
return (sd->pulse_state && sd->pulse);
}
@ -671,3 +671,27 @@ ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_progressbar, EFL_UI_PROGRESSBAR, ELM_LAYOUT
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_progressbar)
#include "efl_ui_progressbar.eo.c"
EAPI void
elm_progressbar_pulse_set(Evas_Object *obj, Eina_Bool pulse)
{
efl_ui_progressbar_pulse_mode_set(obj, pulse);
}
EAPI Eina_Bool
elm_progressbar_pulse_get(const Evas_Object *obj)
{
return efl_ui_progressbar_pulse_mode_get(obj);
}
EAPI void
elm_progressbar_pulse(Evas_Object *obj, Eina_Bool state)
{
efl_ui_progressbar_pulse_set(obj, state);
}
EAPI Eina_Bool
elm_progressbar_is_pulsing_get(const Evas_Object *obj)
{
return efl_ui_progressbar_pulse_get(obj);
}

View File

@ -2,9 +2,9 @@ class Efl.Ui.Progressbar (Elm.Layout, Efl.Ui.Progress,
Efl.Orientation)
{
[[Elementary progressbar class]]
legacy_prefix: elm_progressbar;
//legacy_prefix: elm_progressbar;
methods {
@property pulse {
@property pulse_mode {
[[Control whether a given progress bar widget is at "pulsing mode" or not.
By default, progress bars will display values from the low to
@ -15,7 +15,11 @@ class Efl.Ui.Progressbar (Elm.Layout, Efl.Ui.Progress,
without exact progress values. In the default theme, it will
animate its bar with the contents filling in constantly and back
to non-filled, in a loop. To start and stop this pulsing
animation, one has to explicitly call elm_progressbar_pulse().]]
animation, one has to explicitly call elm_progressbar_pulse().
@since 1.20
]]
set {
}
get {
@ -24,6 +28,25 @@ class Efl.Ui.Progressbar (Elm.Layout, Efl.Ui.Progress,
pulse: bool; [[$true to put $obj in pulsing mode, $false to put it back to its default one]]
}
}
@property pulse {
set {
[[Start/stop a given progress bar "pulsing" animation, if its under that mode
Note: This call won't do anything if $obj is not under "pulsing mode".
@since 1.20
]]
}
get {
[[ Get the pulsing state on a given progressbar widget.
@since 1.20
]]
}
values {
state: bool; [[$true, to start the pulsing animation, $false to stop it]]
}
}
part_value_set {
[[Set the progress value (in percentage) on a given progress bar widget for the given part name
@ -44,21 +67,6 @@ class Efl.Ui.Progressbar (Elm.Layout, Efl.Ui.Progress,
@in part: string; [[The part name of the progress bar]]
}
}
pulse {
[[Start/stop a given progress bar "pulsing" animation, if its under that mode
Note: This call won't do anything if $obj is not under "pulsing mode".]]
params {
@in state: bool; [[$true, to start the pulsing animation, $false to stop it]]
}
}
is_pulsing_get @const {
[[Get the pulsing state on a given progressbar widget.
@since 1.19]]
return: bool; [[$true if the $obj is currently pulsing ]]
}
}
implements {
class.constructor;

View File

@ -186,4 +186,71 @@ EAPI const char *elm_progressbar_unit_format_get(const Evas_Object *obj);
*/
EAPI void elm_progressbar_unit_format_function_set(Evas_Object *obj, progressbar_func_type func, progressbar_freefunc_type free_func);
/**
* @brief Control whether a given progress bar widget is at "pulsing mode" or
* not.
*
* By default, progress bars will display values from the low to high value
* boundaries. There are, though, contexts in which the progress of a given
* task is unknown. For such cases, one can set a progress bar widget to a
* "pulsing state", to give the user an idea that some computation is being
* held, but without exact progress values. In the default theme, it will
* animate its bar with the contents filling in constantly and back to
* non-filled, in a loop. To start and stop this pulsing animation, one has to
* explicitly call elm_progressbar_pulse().
*
* @param[in] pulse @c true to put @c obj in pulsing mode, @c false to put it
* back to its default one
*
* @ingroup Elm_Progressbar
*/
EAPI void elm_progressbar_pulse_set(Evas_Object *obj, Eina_Bool pulse);
/**
* @brief Control whether a given progress bar widget is at "pulsing mode" or
* not.
*
* By default, progress bars will display values from the low to high value
* boundaries. There are, though, contexts in which the progress of a given
* task is unknown. For such cases, one can set a progress bar widget to a
* "pulsing state", to give the user an idea that some computation is being
* held, but without exact progress values. In the default theme, it will
* animate its bar with the contents filling in constantly and back to
* non-filled, in a loop. To start and stop this pulsing animation, one has to
* explicitly call elm_progressbar_pulse().
*
* @return @c true to put @c obj in pulsing mode, @c false to put it back to
* its default one
*
* @ingroup Elm_Progressbar
*/
EAPI Eina_Bool elm_progressbar_pulse_get(const Evas_Object *obj);
/**
* @brief Start/stop a given progress bar "pulsing" animation, if its under
* that mode
*
* @note This call won't do anything if @c obj is not under "pulsing mode".
*
* @param[in] state @c true, to start the pulsing animation, @c false to stop
* it
*
* @ingroup Elm_Progressbar
*/
EAPI void elm_progressbar_pulse(Evas_Object *obj, Eina_Bool state);
/**
* @brief Get the pulsing state on a given progressbar widget.
*
* @return @c true if the @c obj is currently pulsing
*
* @since 1.19
*
* @ingroup Elm_Progressbar
*/
EAPI Eina_Bool elm_progressbar_is_pulsing_get(const Evas_Object *obj);
#include "efl_ui_progressbar.eo.legacy.h"