}
static void
+_key_set_unimplemented(Evas_Object *obj __UNUSED__, const char *key __UNUSED__)
+{
+ WRN("key set is not implemented");
+}
+
+static void
_pan_unimplemented(Evas_Object *obj __UNUSED__, int x_1 __UNUSED__, int y_1 __UNUSED__, int x_2 __UNUSED__, int y_2 __UNUSED__)
{
WRN("pan is not implemented");
Elm_Map_Module_Source_Name_Func name_cb;
Elm_Map_Module_Add_Func add_cb;
+ Elm_Map_Module_Key_Set_Func key_set_cb;
Elm_Map_Module_Del_Func del_cb;
Elm_Map_Module_Move_Func move_cb;
Elm_Map_Module_Resize_Func resize_cb;
zoom_min = eina_module_symbol_get(m, "map_module_zoom_min_get");
zoom_max = eina_module_symbol_get(m, "map_module_zoom_max_get");
add_cb = eina_module_symbol_get(m, "map_module_add");
+ key_set_cb = eina_module_symbol_get(m, "map_module_key_set");
del_cb = eina_module_symbol_get(m, "map_module_del");
move_cb = eina_module_symbol_get(m, "map_module_move");
resize_cb = eina_module_symbol_get(m, "map_module_resize");
s->zoom_min = zoom_min();
s->zoom_max = zoom_max();
s->add = add_cb;
+ s->key_set = key_set_cb;
s->del = del_cb;
if (move_cb) s->move = move_cb;
else s->move = _move_unimplemented;
engine->zoom_min = src_tiles[0].zoom_min;
engine->zoom_max = src_tiles[0].zoom_max;
engine->add = _map_pan_add;
+ engine->key_set = _key_set_unimplemented;
engine->del = _map_pan_del;
engine->pan = _pan_unimplemented;
engine->show = _map_pan_show;
static void
_elm_map_smart_del(Evas_Object *obj)
{
+ Source_Engine *e;
ELM_MAP_DATA_GET(obj, sd);
if (sd->zoom_timer) ecore_timer_del(sd->zoom_timer);
if (sd->ua) eina_hash_free(sd->ua);
sd->engine->del(obj);
+ EINA_LIST_FREE(sd->engines, e)
+ {
+ if (e->key) free(e->key);
+ free(e);
+ }
_source_all_unload(sd);
evas_object_del(sd->pan_obj);
}
EAPI void
+elm_map_engine_key_set(Evas_Object *obj,
+ const char *engine_name,
+ const char *key)
+{
+ ELM_MAP_CHECK(obj);
+ ELM_MAP_DATA_GET(obj, sd);
+ EINA_SAFETY_ON_NULL_RETURN(engine_name);
+ EINA_SAFETY_ON_NULL_RETURN(key);
+
+ Eina_List *l;
+ Source_Engine *e;
+
+ EINA_LIST_FOREACH(sd->engines, l, e)
+ {
+ if (!strcmp(e->name, engine_name))
+ {
+ if (e->key) free(e->key);
+ e->key = strdup(key);
+ e->key_set(obj, key);
+ break;
+ }
+ }
+}
+
+
+EAPI void
elm_map_zoom_set(Evas_Object *obj,
int zoom)
{
sd->engine->del(obj);
sd->engine = engine;
+ if (sd->engine->key)
+ sd->engine->key_set(obj, sd->engine->key);
+
if (sd->engine->zoom_max < sd->zoom)
sd->zoom = sd->engine->zoom_max;
else if (sd->engine->zoom_min > sd->zoom)