elm_map: convert paused to animation property

Summary:
this commit migrates the paused property over to the property defined by
efl.ui.zoom. This is done in order to implement all APIs in the elm_map
object.

ref T5719

Depends on D7783

Reviewers: cedric, zmike, segfaultxavi

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T5719

Differential Revision: https://phab.enlightenment.org/D7784
This commit is contained in:
Marcel Hollerbach 2019-01-28 12:11:37 -05:00 committed by Mike Blumenkrantz
parent 5791ea7158
commit 3278e82759
3 changed files with 46 additions and 27 deletions

View File

@ -4475,7 +4475,7 @@ _elm_map_region_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd, double *lon, do
}
EOLIAN static void
_elm_map_paused_set(Eo *obj, Elm_Map_Data *sd, Eina_Bool paused)
_elm_map_efl_ui_zoom_zoom_animation_set(Eo *obj, Elm_Map_Data *sd, Eina_Bool paused)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@ -4499,7 +4499,7 @@ _elm_map_paused_set(Eo *obj, Elm_Map_Data *sd, Eina_Bool paused)
}
EOLIAN static Eina_Bool
_elm_map_paused_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
_elm_map_efl_ui_zoom_zoom_animation_get(const Eo *obj EINA_UNUSED, Elm_Map_Data *sd)
{
return sd->paused;
}
@ -5504,6 +5504,18 @@ elm_map_wheel_disabled_get(const Evas_Object *obj)
return elm_interface_scrollable_wheel_disabled_get(obj);
}
EAPI void
elm_map_paused_set(Evas_Object *obj, Eina_Bool paused)
{
efl_ui_zoom_animation_set(obj, paused);
}
EAPI Eina_Bool
elm_map_paused_get(const Evas_Object *obj)
{
return efl_ui_zoom_animation_get(obj);
}
EOLIAN static Elm_Map_Overlay*
_elm_map_overlay_route_add(Eo *obj, Elm_Map_Data *sd, const Elm_Map_Route *route)
{

View File

@ -58,31 +58,6 @@ class Elm.Map extends Efl.Ui.Widget implements Elm.Interface_Scrollable,
eo_prefix: elm_obj_map;
event_prefix: elm_map;
methods {
@property paused {
set {
[[Pause or unpause the map.
This sets the paused state to on ($true) or off ($false)
for map.
The default is off.
This will stop zooming using animation, changing zoom levels
will change instantly. This will stop any existing animations
that are running.
]]
}
get {
[[Get a value whether map is paused or not.
This gets the current paused state for the map object.
]]
}
values {
paused: bool; [[Use $true to pause the map $obj or $false
to unpause it.]]
}
}
@property zoom_min {
set {
[[Set the minimum zoom of the source.]]
@ -535,6 +510,7 @@ class Elm.Map extends Efl.Ui.Widget implements Elm.Interface_Scrollable,
Efl.Access.Widget.Action.elm_actions { get; }
Efl.Ui.Zoom.zoom_level { set; get; }
Efl.Ui.Zoom.zoom_mode { set; get; }
Efl.Ui.Zoom.zoom_animation { get; set; }
Elm.Interface_Scrollable.wheel_disabled { set; }
}
events {

View File

@ -141,4 +141,35 @@ EAPI void elm_map_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled);
*/
EAPI Eina_Bool elm_map_wheel_disabled_get(const Evas_Object *obj);
/**
* @brief Pause or unpause the map.
*
* This sets the paused state to on @c true or off @c false for map.
*
* The default is off.
*
* This will stop zooming using animation, changing zoom levels will change
* instantly. This will stop any existing animations that are running.
*
* @param[in] obj The object.
* @param[in] paused Use @c true to pause the map @c obj or @c false to unpause
* it.
*
* @ingroup Elm_Map_Group
*/
EAPI void elm_map_paused_set(Evas_Object *obj, Eina_Bool paused);
/**
* @brief Get a value whether map is paused or not.
*
* This gets the current paused state for the map object.
*
* @param[in] obj The object.
*
* @return Use @c true to pause the map @c obj or @c false to unpause it.
*
* @ingroup Elm_Map_Group
*/
EAPI Eina_Bool elm_map_paused_get(const Evas_Object *obj);
#include "elm_map.eo.legacy.h"