forked from enlightenment/efl
Elementary map: add APIs for setting min,max zoom level
SVN revision: 59704
This commit is contained in:
parent
b11b798344
commit
92060c1ed5
|
@ -428,6 +428,18 @@ map_rotate_reset(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNU
|
|||
elm_map_rotate_set(data, 0.0, x + half_w, y + half_h);
|
||||
}
|
||||
|
||||
static void
|
||||
map_zoom_min_set(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
elm_map_source_zoom_min_set(data, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
map_zoom_max_set(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
elm_map_source_zoom_max_set(data, 10);
|
||||
}
|
||||
|
||||
static void
|
||||
map_source(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
|
@ -628,6 +640,8 @@ _map_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event
|
|||
elm_menu_item_add(menu, NULL, NULL, "Rotate CW", map_rotate_cw, data);
|
||||
elm_menu_item_add(menu, NULL, NULL, "Rotate CCW", map_rotate_ccw, data);
|
||||
elm_menu_item_add(menu, NULL, NULL, "Reset Rotate", map_rotate_reset, data);
|
||||
elm_menu_item_add(menu, NULL, NULL, "Set Zoom Min to 1", map_zoom_min_set, data);
|
||||
elm_menu_item_add(menu, NULL, NULL, "Set Zoom Max to 10", map_zoom_max_set, data);
|
||||
|
||||
elm_menu_move(menu, down->canvas.x, down->canvas.y);
|
||||
evas_object_show(menu);
|
||||
|
|
|
@ -2405,7 +2405,9 @@ EAPI Elm_Genlist_Item *elm_genlist_item_sorted_insert(Evas_Object *obj, const El
|
|||
EAPI const char *elm_map_source_name_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_map_route_source_set(Evas_Object *obj, Elm_Map_Route_Sources source) EINA_ARG_NONNULL(1);
|
||||
EAPI Elm_Map_Route_Sources elm_map_route_source_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_map_source_zoom_min_set(Evas_Object *obj, int zoom) EINA_ARG_NONNULL(1);
|
||||
EAPI int elm_map_source_zoom_min_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_map_source_zoom_max_set(Evas_Object *obj, int zoom) EINA_ARG_NONNULL(1);
|
||||
EAPI int elm_map_source_zoom_max_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_map_user_agent_set(Evas_Object *obj, const char *user_agent) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI const char *elm_map_user_agent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
|
|
|
@ -4809,6 +4809,24 @@ elm_map_route_source_get(const Evas_Object *obj)
|
|||
return wd->route_source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the maximum zoom of the source.
|
||||
*
|
||||
* @param source the source
|
||||
*
|
||||
* @ingroup Map
|
||||
*/
|
||||
EAPI void
|
||||
elm_map_source_zoom_max_set(Evas_Object *obj, int zoom)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
if ((!wd) || (!wd->src)) return;
|
||||
if ((zoom > wd->zoom_max) || (zoom < wd->zoom_min)) return;
|
||||
wd->src->zoom_max = zoom;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the maximum zoom of the source.
|
||||
*
|
||||
|
@ -4827,6 +4845,25 @@ elm_map_source_zoom_max_get(const Evas_Object *obj)
|
|||
return wd->src->zoom_max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the minimum zoom of the source.
|
||||
*
|
||||
* @param source the source
|
||||
*
|
||||
* @ingroup Map
|
||||
*/
|
||||
EAPI void
|
||||
elm_map_source_zoom_min_set(Evas_Object *obj, int zoom)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
if ((!wd) || (!wd->src)) return;
|
||||
if ((zoom > wd->zoom_max) || (zoom < wd->zoom_min)) return;
|
||||
wd->src->zoom_min = zoom;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the minimum zoom of the source.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue