int walking;
int movements;
struct {
- Evas_Coord x, y;
+ Evas_Coord x, y;
} history[SWIPE_MOVES];
Eina_Bool swipe : 1;
Eina_Bool fix_pending : 1;
static Eina_Bool _deselect_all_items(Widget_Data *wd);
#define ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, ...) \
- ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, __VA_ARGS__); \
- if (it->deleted) \
- { \
- ERR("ERROR: "#it" has been DELETED.\n"); \
- return __VA_ARGS__; \
- }
+ ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, __VA_ARGS__); \
+if (it->deleted) \
+{ \
+ ERR("ERROR: "#it" has been DELETED.\n"); \
+ return __VA_ARGS__; \
+}
static inline void
_elm_list_item_free(Elm_List_Item *it)
{
evas_object_event_callback_del_full
- (it->base.view, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, it);
+ (it->base.view, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, it);
evas_object_event_callback_del_full
- (it->base.view, EVAS_CALLBACK_MOUSE_UP, _mouse_up, it);
+ (it->base.view, EVAS_CALLBACK_MOUSE_UP, _mouse_up, it);
evas_object_event_callback_del_full
- (it->base.view, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, it);
+ (it->base.view, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, it);
if (it->icon)
evas_object_event_callback_del_full
- (it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, it->base.widget);
+ (it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _changed_size_hints, it->base.widget);
if (it->end)
evas_object_event_callback_del_full
- (it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, it->base.widget);
+ (it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _changed_size_hints, it->base.widget);
eina_stringshare_del(it->label);
}
else if (!strcmp(ev->keyname, "Escape"))
{
- if (!_deselect_all_items(wd)) return EINA_FALSE;
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (!_deselect_all_items(wd)) return EINA_FALSE;
+ ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+ return EINA_TRUE;
}
else return EINA_FALSE;
{
if (wd->walking < 0)
{
- ERR("ERROR: walking was negative. fixed!\n");
- wd->walking = 0;
+ ERR("ERROR: walking was negative. fixed!\n");
+ wd->walking = 0;
}
wd->walking++;
}
wd->walking--;
if (wd->walking < 0)
{
- ERR("ERROR: walking became negative. fixed!\n");
- wd->walking = 0;
+ ERR("ERROR: walking became negative. fixed!\n");
+ wd->walking = 0;
}
if (wd->walking)
{
Widget_Data *wd = elm_widget_data_get(obj);
edje_object_signal_callback_del_full(
- elm_smart_scroller_edje_object_get(wd->scr),
- emission, source, func_cb, data);
+ elm_smart_scroller_edje_object_get(wd->scr),
+ emission, source, func_cb, data);
}
static void
elm_smart_scroller_object_theme_set(obj, wd->scr, "list", "base",
elm_widget_style_get(obj));
-// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
+ // edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
edj = elm_smart_scroller_edje_object_get(wd->scr);
str = edje_object_data_get(edj, "focus_highlight");
if ((str) && (!strcmp(str, "on")))
if (it->icon == sub) it->icon = NULL;
if (it->end == sub) it->end = NULL;
evas_object_event_callback_del_full
- (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints,
- obj);
+ (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints,
+ obj);
if (!wd->walking)
{
_fix_items(obj);
if (!wd) return;
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
if (it->hilighted) return;
-
+
evas_object_ref(obj);
_elm_list_walk(wd);
}
it->selected = EINA_TRUE;
wd->selected = eina_list_append(wd->selected, it);
-
- call:
+
+call:
evas_object_ref(obj);
_elm_list_walk(wd);
-
+
if (it->func) it->func((void *)it->base.data, it->base.widget, it);
evas_object_smart_callback_call(obj, "selected", it);
it->wd->last_selected_item = it;
if (!wd) return;
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
if (!it->hilighted) return;
-
+
evas_object_ref(obj);
_elm_list_walk(wd);
-
+
edje_object_signal_emit(it->base.view, "elm,state,unselected", "elm");
stacking = edje_object_data_get(it->base.view, "stacking");
selectraise = edje_object_data_get(it->base.view, "selectraise");
if ((selectraise) && (!strcmp(selectraise, "on")))
{
if ((stacking) && (!strcmp(stacking, "below")))
- evas_object_lower(it->base.view);
+ evas_object_lower(it->base.view);
}
it->hilighted = EINA_FALSE;
if (it->selected)
wd->selected = eina_list_remove(wd->selected, it);
evas_object_smart_callback_call(it->base.widget, "unselected", it);
}
-
+
_elm_list_unwalk(wd);
evas_object_unref(obj);
}
if (!wd) return;
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
-
+
evas_object_ref(obj2);
_elm_list_walk(wd);
-
+
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
{
if (!wd->on_hold)
wd->history[wd->movements].x = ev->cur.canvas.x;
wd->history[wd->movements].y = ev->cur.canvas.y;
if (abs((wd->history[wd->movements].x - wd->history[0].x)) > 40)
- wd->swipe = EINA_TRUE;
+ wd->swipe = EINA_TRUE;
else
- wd->movements++;
+ wd->movements++;
}
}
-
+
_elm_list_unwalk(wd);
evas_object_unref(obj2);
}
wd->longpressed = EINA_TRUE;
evas_object_smart_callback_call(it->base.widget, "longpressed", it);
- end:
+end:
return ECORE_CALLBACK_CANCEL;
}
else wd->on_hold = EINA_FALSE;
if (wd->on_hold) return;
wd->wasselected = it->selected;
-
+
evas_object_ref(obj2);
_elm_list_walk(wd);
-
+
_item_hilight(it);
wd->longpressed = EINA_FALSE;
if (it->long_timer) ecore_timer_del(it->long_timer);
evas_object_smart_callback_call(it->base.widget, "clicked", it);
wd->swipe = EINA_FALSE;
wd->movements = 0;
-
+
_elm_list_unwalk(wd);
evas_object_unref(obj2);
}
if (it->disabled)
return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
-
+
evas_object_ref(obj2);
_elm_list_walk(wd);
if (!it->selected)
{
while (wd->selected)
- _item_unselect(wd->selected->data);
+ _item_unselect(wd->selected->data);
_item_hilight(it);
_item_select(it);
}
i = 0;
EINA_LIST_FOREACH(wd->items, l, it)
{
- if (it->deleted)
+ if (it->deleted)
continue;
- it->even = i & 0x1;
- if ((it->even != it->is_even) || (!it->fixed) || (redo))
- {
- const char *stacking;
+ it->even = i & 0x1;
+ if ((it->even != it->is_even) || (!it->fixed) || (redo))
+ {
+ const char *stacking;
/* FIXME: separators' themes seem to be b0rked */
- if (it->is_separator)
- _elm_theme_object_set(obj, it->base.view, "separator",
+ if (it->is_separator)
+ _elm_theme_object_set(obj, it->base.view, "separator",
wd->h_mode ? "horizontal" : "vertical",
style);
- else if (wd->mode == ELM_LIST_COMPRESS)
- {
- if (it->even)
- _elm_theme_object_set(obj, it->base.view, "list",
+ else if (wd->mode == ELM_LIST_COMPRESS)
+ {
+ if (it->even)
+ _elm_theme_object_set(obj, it->base.view, "list",
it_compress, style);
- else
- _elm_theme_object_set(obj, it->base.view, "list",
+ else
+ _elm_theme_object_set(obj, it->base.view, "list",
it_compress_odd, style);
- }
- else
- {
- if (it->even)
- _elm_theme_object_set(obj, it->base.view, "list", it_plain,
+ }
+ else
+ {
+ if (it->even)
+ _elm_theme_object_set(obj, it->base.view, "list", it_plain,
style);
- else
- _elm_theme_object_set(obj, it->base.view, "list", it_odd,
+ else
+ _elm_theme_object_set(obj, it->base.view, "list", it_odd,
style);
- }
- stacking = edje_object_data_get(it->base.view, "stacking");
- if (stacking)
- {
- if (!strcmp(stacking, "below"))
- evas_object_lower(it->base.view);
- else if (!strcmp(stacking, "above"))
- evas_object_raise(it->base.view);
- }
- edje_object_part_text_set(it->base.view, "elm.text", it->label);
-
- if ((!it->icon) && (minh[0] > 0))
- {
- it->icon = evas_object_rectangle_add(evas_object_evas_get(it->base.view));
- evas_object_color_set(it->icon, 0, 0, 0, 0);
- it->dummy_icon = EINA_TRUE;
- }
- if ((!it->end) && (minh[1] > 0))
- {
- it->end = evas_object_rectangle_add(evas_object_evas_get(it->base.view));
- evas_object_color_set(it->end, 0, 0, 0, 0);
- it->dummy_end = EINA_TRUE;
- }
- if (it->icon)
- {
- evas_object_size_hint_min_set(it->icon, minw[0], minh[0]);
- evas_object_size_hint_max_set(it->icon, 99999, 99999);
- edje_object_part_swallow(it->base.view, "elm.swallow.icon", it->icon);
- }
- if (it->end)
- {
- evas_object_size_hint_min_set(it->end, minw[1], minh[1]);
- evas_object_size_hint_max_set(it->end, 99999, 99999);
- edje_object_part_swallow(it->base.view, "elm.swallow.end", it->end);
- }
- if (!it->fixed)
- {
- // this may call up user and it may modify the list item
- // but we're safe as we're flagged as walking.
- // just don't process further
- edje_object_message_signal_process(it->base.view);
- if (it->deleted)
- continue;
- mw = mh = -1;
- elm_coords_finger_size_adjust(1, &mw, 1, &mh);
- edje_object_size_min_restricted_calc(it->base.view, &mw, &mh, mw, mh);
- elm_coords_finger_size_adjust(1, &mw, 1, &mh);
- evas_object_size_hint_min_set(it->base.view, mw, mh);
- evas_object_show(it->base.view);
- }
- if ((it->selected) || (it->hilighted))
- {
- const char *selectraise;
-
- // this may call up user and it may modify the list item
- // but we're safe as we're flagged as walking.
- // just don't process further
- edje_object_signal_emit(it->base.view, "elm,state,selected", "elm");
- if (it->deleted)
- continue;
-
- selectraise = edje_object_data_get(it->base.view, "selectraise");
- if ((selectraise) && (!strcmp(selectraise, "on")))
- evas_object_raise(it->base.view);
- }
+ }
+ stacking = edje_object_data_get(it->base.view, "stacking");
+ if (stacking)
+ {
+ if (!strcmp(stacking, "below"))
+ evas_object_lower(it->base.view);
+ else if (!strcmp(stacking, "above"))
+ evas_object_raise(it->base.view);
+ }
+ edje_object_part_text_set(it->base.view, "elm.text", it->label);
+
+ if ((!it->icon) && (minh[0] > 0))
+ {
+ it->icon = evas_object_rectangle_add(evas_object_evas_get(it->base.view));
+ evas_object_color_set(it->icon, 0, 0, 0, 0);
+ it->dummy_icon = EINA_TRUE;
+ }
+ if ((!it->end) && (minh[1] > 0))
+ {
+ it->end = evas_object_rectangle_add(evas_object_evas_get(it->base.view));
+ evas_object_color_set(it->end, 0, 0, 0, 0);
+ it->dummy_end = EINA_TRUE;
+ }
+ if (it->icon)
+ {
+ evas_object_size_hint_min_set(it->icon, minw[0], minh[0]);
+ evas_object_size_hint_max_set(it->icon, 99999, 99999);
+ edje_object_part_swallow(it->base.view, "elm.swallow.icon", it->icon);
+ }
+ if (it->end)
+ {
+ evas_object_size_hint_min_set(it->end, minw[1], minh[1]);
+ evas_object_size_hint_max_set(it->end, 99999, 99999);
+ edje_object_part_swallow(it->base.view, "elm.swallow.end", it->end);
+ }
+ if (!it->fixed)
+ {
+ // this may call up user and it may modify the list item
+ // but we're safe as we're flagged as walking.
+ // just don't process further
+ edje_object_message_signal_process(it->base.view);
+ if (it->deleted)
+ continue;
+ mw = mh = -1;
+ elm_coords_finger_size_adjust(1, &mw, 1, &mh);
+ edje_object_size_min_restricted_calc(it->base.view, &mw, &mh, mw, mh);
+ elm_coords_finger_size_adjust(1, &mw, 1, &mh);
+ evas_object_size_hint_min_set(it->base.view, mw, mh);
+ evas_object_show(it->base.view);
+ }
+ if ((it->selected) || (it->hilighted))
+ {
+ const char *selectraise;
+
+ // this may call up user and it may modify the list item
+ // but we're safe as we're flagged as walking.
+ // just don't process further
+ edje_object_signal_emit(it->base.view, "elm,state,selected", "elm");
+ if (it->deleted)
+ continue;
+
+ selectraise = edje_object_data_get(it->base.view, "selectraise");
+ if ((selectraise) && (!strcmp(selectraise, "on")))
+ evas_object_raise(it->base.view);
+ }
if (it->disabled)
edje_object_signal_emit(it->base.view, "elm,state,disabled",
"elm");
- it->fixed = EINA_TRUE;
- it->is_even = it->even;
- }
- i++;
+ it->fixed = EINA_TRUE;
+ it->is_even = it->even;
+ }
+ i++;
}
mw = 0; mh = 0;
evas_object_size_hint_min_get(wd->box, &mw, &mh);
_elm_list_mode_set_internal(wd);
-
+
_elm_list_unwalk(wd);
evas_object_unref(obj);
}
Evas_Coord minw, minh;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "list");
elm_widget_type_set(obj, "list");
elm_widget_sub_object_add(parent, obj);
if (!wd->multi)
{
while (wd->selected)
- _item_unselect(wd->selected->data);
+ _item_unselect(wd->selected->data);
}
_item_hilight(it);
_item_select(it);
}
else
- _item_unselect(it);
+ _item_unselect(it);
_elm_list_unwalk(wd);
evas_object_unref(obj);
if (!wd) return;
if ((policy_h >= ELM_SCROLLER_POLICY_LAST) ||
(policy_v >= ELM_SCROLLER_POLICY_LAST))
- if (wd->scr)
- elm_smart_scroller_policy_set(wd->scr, policy_h, policy_v);
+ if (wd->scr)
+ elm_smart_scroller_policy_set(wd->scr, policy_h, policy_v);
}
EAPI void
int zoom_displayed;
struct _Elm_Map_Marker_Class_Func {
- ElmMapMarkerGetFunc get;
- ElmMapMarkerDelFunc del; //if NULL the object will be destroyed with evas_object_del()
- ElmMapMarkerIconGetFunc icon_get;
+ ElmMapMarkerGetFunc get;
+ ElmMapMarkerDelFunc del; //if NULL the object will be destroyed with evas_object_del()
+ ElmMapMarkerIconGetFunc icon_get;
} func;
struct { //this part is private, do not modify these values
- Eina_Bool set : 1;
- Evas_Coord edje_w, edje_h;
+ Eina_Bool set : 1;
+ Evas_Coord edje_w, edje_h;
} priv;
};
Eina_Bool hide : 1;
struct {
- ElmMapGroupIconGetFunc icon_get;
+ ElmMapGroupIconGetFunc icon_get;
} func;
-
+
struct { //this part is private, do not modify these values
- Eina_Bool set : 1;
- Evas_Coord edje_w, edje_h;
- Evas_Coord edje_max_w, edje_max_h;
-
- Eina_List *objs_used;
- Eina_List *objs_notused;
+ Eina_Bool set : 1;
+ Evas_Coord edje_w, edje_h;
+ Evas_Coord edje_max_w, edje_max_h;
+
+ Eina_List *objs_used;
+ Eina_List *objs_notused;
} priv;
};
//Evas_Object *txt;
const char *file;
struct {
- int x, y, w, h;
+ int x, y, w, h;
} src, out;
Eina_Bool want : 1;
Eina_Bool download : 1;
Ecore_Animator *zoom_animator;
double t_start, t_end;
struct {
- int w, h;
- int ow, oh, nw, nh;
- struct {
- double x, y;
- } spos;
+ int w, h;
+ int ow, oh, nw, nh;
+ struct {
+ double x, y;
+ } spos;
} size;
struct {
- Eina_Bool show : 1;
- Evas_Coord x, y ,w ,h;
+ Eina_Bool show : 1;
+ Evas_Coord x, y ,w ,h;
} show;
int tsize;
int nosmooth;
Eina_Bool paused : 1;
Eina_Bool paused_markers : 1;
Eina_Bool pinch_zoom : 1;
-
+
struct {
- Eina_Bool enabled;
- double lon, lat;
+ Eina_Bool enabled;
+ double lon, lat;
} center_on;
Ecore_Job *markers_place_job;
struct _Event
{
int device;
-
+
struct {
- Evas_Coord x, y;
+ Evas_Coord x, y;
} prev;
-
+
Evas_Coord x, y, w, h;
-
+
Evas_Object *object;
Ecore_Timer *hold_timer;
-
+
int pinch_dis;
};
static const char SIG_ZOOM_STOP[] = "zoom,stop";
static const char SIG_DOWNLOADED[] = "downloaded";
static const Evas_Smart_Cb_Description _signals[] = {
- {SIG_CHANGED, ""},
- {SIG_CLICKED, ""},
- {SIG_CLICKED_DOUBLE, ""},
- {SIG_LOADED_DETAIL, ""},
- {SIG_LOAD_DETAIL, ""},
- {SIG_LONGPRESSED, ""},
- {SIG_PRESS, ""},
- {SIG_SCROLL, ""},
- {SIG_SCROLL_DRAG_START, ""},
- {SIG_SCROLL_DRAG_STOP, ""},
- {SIG_ZOOM_CHANGE, ""},
- {SIG_ZOOM_START, ""},
- {SIG_ZOOM_STOP, ""},
- {SIG_DOWNLOADED, ""},
- {NULL, NULL}
+ {SIG_CHANGED, ""},
+ {SIG_CLICKED, ""},
+ {SIG_CLICKED_DOUBLE, ""},
+ {SIG_LOADED_DETAIL, ""},
+ {SIG_LOAD_DETAIL, ""},
+ {SIG_LONGPRESSED, ""},
+ {SIG_PRESS, ""},
+ {SIG_SCROLL, ""},
+ {SIG_SCROLL_DRAG_START, ""},
+ {SIG_SCROLL_DRAG_STOP, ""},
+ {SIG_ZOOM_CHANGE, ""},
+ {SIG_ZOOM_START, ""},
+ {SIG_ZOOM_STOP, ""},
+ {SIG_DOWNLOADED, ""},
+ {NULL, NULL}
};
static void _pan_calculate(Evas_Object *obj);
Widget_Data *wd = elm_widget_data_get(obj);
Eina_List *l;
Event *ev;
-
+
EINA_LIST_FOREACH(wd->s_event_list, l, ev)
{
- if (ev->device) return ev->device;
+ if (ev->device) return ev->device;
}
return 0;
}
{
Widget_Data *wd = elm_widget_data_get(data);
Event *ev = calloc(1, sizeof(Event));
-
+
EINA_SAFETY_ON_NULL_RETURN_VAL(ev, NULL);
-
+
ev->object = obj;
ev->device = device;
evas_object_geometry_get(obj, &ev->x, &ev->y, &ev->w, &ev->h);
Widget_Data *wd = elm_widget_data_get(data);
Eina_List *l;
Event *ev;
-
+
EINA_LIST_FOREACH(wd->s_event_list, l, ev)
{
if (ev->device == device) break;
m->api = malloc(sizeof(Mod_Api));
if (!m->api) return NULL;
((Mod_Api *)(m->api) )->obj_hook =
- _elm_module_symbol_get(m, "obj_hook");
+ _elm_module_symbol_get(m, "obj_hook");
((Mod_Api *)(m->api) )->obj_unhook =
- _elm_module_symbol_get(m, "obj_unhook");
+ _elm_module_symbol_get(m, "obj_unhook");
((Mod_Api *)(m->api) )->obj_url_request =
- _elm_module_symbol_get(m, "obj_url_request");
+ _elm_module_symbol_get(m, "obj_url_request");
((Mod_Api *)(m->api) )->obj_convert_coord_into_geo =
- _elm_module_symbol_get(m, "obj_convert_coord_into_geo");
+ _elm_module_symbol_get(m, "obj_convert_coord_into_geo");
((Mod_Api *)(m->api) )->obj_convert_geo_into_coord =
- _elm_module_symbol_get(m, "obj_convert_geo_into_coord");
- ok:
+ _elm_module_symbol_get(m, "obj_convert_geo_into_coord");
+ok:
return m->api;
}
ox + 0 - px + ax,
oy + 0 - py + ay);
evas_object_resize(wd->rect, gw, gh);
-
+
if (wd->show.show)
{
- wd->show.show = EINA_FALSE;
- elm_smart_scroller_child_region_show(wd->scr, wd->show.x, wd->show.y, wd->show.w, wd->show.h);
+ wd->show.show = EINA_FALSE;
+ elm_smart_scroller_child_region_show(wd->scr, wd->show.x, wd->show.y, wd->show.w, wd->show.h);
}
}
if (wd->zoom != wd->marker_zoom)
{
- EINA_LIST_FREE(wd->cells_displayed, cell)
- {
- EINA_LIST_FOREACH(eina_matrixsparse_cell_data_get(cell), l, group)
- {
- if (group->obj) _group_object_free(group);
- }
- }
+ EINA_LIST_FREE(wd->cells_displayed, cell)
+ {
+ EINA_LIST_FOREACH(eina_matrixsparse_cell_data_get(cell), l, group)
+ {
+ if (group->obj) _group_object_free(group);
+ }
+ }
}
wd->marker_zoom = wd->zoom;
//hide groups no more displayed
EINA_LIST_FREE(wd->cells_displayed, cell)
{
- eina_matrixsparse_cell_position_get(cell, (unsigned long *)&y, (unsigned long *)&x);
- if ((y < g_yy) || (y > g_yy + g_hh) || (x < g_xx) || (x > g_xx + g_ww))
- {
- EINA_LIST_FOREACH(eina_matrixsparse_cell_data_get(cell), l, group)
- {
- if (group->obj) _group_object_free(group);
- }
- }
+ eina_matrixsparse_cell_position_get(cell, (unsigned long *)&y, (unsigned long *)&x);
+ if ((y < g_yy) || (y > g_yy + g_hh) || (x < g_xx) || (x > g_xx + g_ww))
+ {
+ EINA_LIST_FOREACH(eina_matrixsparse_cell_data_get(cell), l, group)
+ {
+ if (group->obj) _group_object_free(group);
+ }
+ }
}
for (y = g_yy; y <= g_yy + g_hh; y++)
{
- for (x = g_xx; x <= g_xx + g_ww; x++)
- {
- if (!wd->markers[wd->zoom]) continue;
- eina_matrixsparse_cell_idx_get(wd->markers[wd->zoom], y, x, &cell);
- if (!cell) continue;
- wd->cells_displayed = eina_list_append(wd->cells_displayed, cell);
- markers = eina_matrixsparse_cell_data_get(cell);
- EINA_LIST_FOREACH(markers, l, group)
- {
- if (!group->markers) continue;
- if (group->clas->zoom_displayed > wd->zoom) continue;
-
- xx = group->x;
- yy = group->y;
- ww = group->w;
- hh = group->h;
-
- if (eina_list_count(group->markers) == 1)
- {
- Elm_Map_Marker *m = eina_list_data_get(group->markers);
- ww = m->clas->priv.edje_w;
- hh = m->clas->priv.edje_h;
- }
-
- if (ww <= 0) ww = 1;
- if (hh <= 0) hh = 1;
-
- if ((gw != g->w) && (g->w > 0))
- {
- tx = xx;
- xx = ((long long )gw * xx) / g->w;
- ww = (((long long)gw * (tx + ww)) / g->w) - xx;
- }
- if ((gh != g->h) && (g->h > 0))
- {
- ty = yy;
- yy = ((long long)gh * yy) / g->h;
- hh = (((long long)gh * (ty + hh)) / g->h) - yy;
- }
-
- if ((!group->clas->hide)
+ for (x = g_xx; x <= g_xx + g_ww; x++)
+ {
+ if (!wd->markers[wd->zoom]) continue;
+ eina_matrixsparse_cell_idx_get(wd->markers[wd->zoom], y, x, &cell);
+ if (!cell) continue;
+ wd->cells_displayed = eina_list_append(wd->cells_displayed, cell);
+ markers = eina_matrixsparse_cell_data_get(cell);
+ EINA_LIST_FOREACH(markers, l, group)
+ {
+ if (!group->markers) continue;
+ if (group->clas->zoom_displayed > wd->zoom) continue;
+
+ xx = group->x;
+ yy = group->y;
+ ww = group->w;
+ hh = group->h;
+
+ if (eina_list_count(group->markers) == 1)
+ {
+ Elm_Map_Marker *m = eina_list_data_get(group->markers);
+ ww = m->clas->priv.edje_w;
+ hh = m->clas->priv.edje_h;
+ }
+
+ if (ww <= 0) ww = 1;
+ if (hh <= 0) hh = 1;
+
+ if ((gw != g->w) && (g->w > 0))
+ {
+ tx = xx;
+ xx = ((long long )gw * xx) / g->w;
+ ww = (((long long)gw * (tx + ww)) / g->w) - xx;
+ }
+ if ((gh != g->h) && (g->h > 0))
+ {
+ ty = yy;
+ yy = ((long long)gh * yy) / g->h;
+ hh = (((long long)gh * (ty + hh)) / g->h) - yy;
+ }
+
+ if ((!group->clas->hide)
&& (xx-px+ax+ox >= ox) && (xx-px+ax+ox<= ox+ow)
&& (yy-py+ay+oy >= oy) && (yy-py+ay+oy<= oy+oh))
- {
- if (!group->obj) _group_object_create(group);
-
- if (group->update_nbelems)
- {
- group->update_nbelems = EINA_FALSE;
- if (eina_list_count(group->markers) > 1)
- {
- snprintf(buf, sizeof(buf), "%d", eina_list_count(group->markers));
- edje_object_part_text_set(elm_layout_edje_get(group->obj), "elm.text", buf);
- }
- else
- edje_object_part_text_set(elm_layout_edje_get(group->obj), "elm.text", "");
- }
- evas_object_move(group->obj,
+ {
+ if (!group->obj) _group_object_create(group);
+
+ if (group->update_nbelems)
+ {
+ group->update_nbelems = EINA_FALSE;
+ if (eina_list_count(group->markers) > 1)
+ {
+ snprintf(buf, sizeof(buf), "%d", eina_list_count(group->markers));
+ edje_object_part_text_set(elm_layout_edje_get(group->obj), "elm.text", buf);
+ }
+ else
+ edje_object_part_text_set(elm_layout_edje_get(group->obj), "elm.text", "");
+ }
+ evas_object_move(group->obj,
xx - px + ax + ox - ww/2,
yy - py + ay + oy - hh/2);
- if ((!wd->paused_markers) || (group->update_resize))
- {
- group->update_resize = EINA_FALSE;
- evas_object_resize(group->obj, ww, hh);
- }
- if (group->update_raise)
- {
- group->update_raise = EINA_FALSE;
- evas_object_raise(group->obj);
- evas_object_show(group->obj);
- }
- if (group->bubble) _group_bubble_place(group);
- }
- else if (group->obj)
- {
- _group_object_free(group);
- }
- }
- }
+ if ((!wd->paused_markers) || (group->update_resize))
+ {
+ group->update_resize = EINA_FALSE;
+ evas_object_resize(group->obj, ww, hh);
+ }
+ if (group->update_raise)
+ {
+ group->update_raise = EINA_FALSE;
+ evas_object_raise(group->obj);
+ evas_object_show(group->obj);
+ }
+ if (group->bubble) _group_bubble_place(group);
+ }
+ else if (group->obj)
+ {
+ _group_object_free(group);
+ }
+ }
+ }
}
}
int xx, yy, ww, hh;
if (!wd) return;
-
+
ax = 0;
ay = 0;
gw = wd->size.w;
EINA_ITERATOR_FOREACH(it, cell)
{
- Grid_Item *gi = eina_matrixsparse_cell_data_get(cell);
-
- xx = gi->out.x;
- yy = gi->out.y;
- ww = gi->out.w;
- hh = gi->out.h;
- if ((gw != g->w) && (g->w > 0))
- {
- tx = xx;
- xx = ((long long )gw * xx) / g->w;
- ww = (((long long)gw * (tx + ww)) / g->w) - xx;
- }
- if ((gh != g->h) && (g->h > 0))
- {
- ty = yy;
- yy = ((long long)gh * yy) / g->h;
- hh = (((long long)gh * (ty + hh)) / g->h) - yy;
- }
- evas_object_move(gi->img,
+ Grid_Item *gi = eina_matrixsparse_cell_data_get(cell);
+
+ xx = gi->out.x;
+ yy = gi->out.y;
+ ww = gi->out.w;
+ hh = gi->out.h;
+ if ((gw != g->w) && (g->w > 0))
+ {
+ tx = xx;
+ xx = ((long long )gw * xx) / g->w;
+ ww = (((long long)gw * (tx + ww)) / g->w) - xx;
+ }
+ if ((gh != g->h) && (g->h > 0))
+ {
+ ty = yy;
+ yy = ((long long)gh * yy) / g->h;
+ hh = (((long long)gh * (ty + hh)) / g->h) - yy;
+ }
+ evas_object_move(gi->img,
xx - px + ax + ox,
yy - py + ay + oy);
-
- evas_object_resize(gi->img, ww, hh);
- /*evas_object_move(gi->txt,
- xx - px + ax + ox,
- yy - py + ay + oy);
+ evas_object_resize(gi->img, ww, hh);
+
+ /*evas_object_move(gi->txt,
+ xx - px + ax + ox,
+ yy - py + ay + oy);
- evas_object_resize(gi->txt, ww, hh);
- */
+ evas_object_resize(gi->txt, ww, hh);
+ */
}
eina_iterator_free(it);
}
EINA_ITERATOR_FOREACH(it, cell)
{
- Grid_Item *gi = eina_matrixsparse_cell_data_get(cell);
- evas_object_del(gi->img);
- //evas_object_del(gi->txt);
-
- if (gi->want)
- {
- gi->want = EINA_FALSE;
- wd->preload_num--;
- if (!wd->preload_num)
- {
- edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
- "elm,state,busy,stop", "elm");
- evas_object_smart_callback_call(obj, SIG_LOADED_DETAIL, NULL);
- }
- }
-
- if (gi->job)
- {
- DBG("DOWNLOAD abort %s", gi->file);
- ecore_file_download_abort(gi->job);
- ecore_file_remove(gi->file);
- gi->job = NULL;
- wd->try_num--;
- }
- if (gi->file)
- eina_stringshare_del(gi->file);
-
- free(gi);
+ Grid_Item *gi = eina_matrixsparse_cell_data_get(cell);
+ evas_object_del(gi->img);
+ //evas_object_del(gi->txt);
+
+ if (gi->want)
+ {
+ gi->want = EINA_FALSE;
+ wd->preload_num--;
+ if (!wd->preload_num)
+ {
+ edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
+ "elm,state,busy,stop", "elm");
+ evas_object_smart_callback_call(obj, SIG_LOADED_DETAIL, NULL);
+ }
+ }
+
+ if (gi->job)
+ {
+ DBG("DOWNLOAD abort %s", gi->file);
+ ecore_file_download_abort(gi->job);
+ ecore_file_remove(gi->file);
+ gi->job = NULL;
+ wd->try_num--;
+ }
+ if (gi->file)
+ eina_stringshare_del(gi->file);
+
+ free(gi);
}
eina_matrixsparse_free(g->grid);
eina_iterator_free(it);
evas_object_image_file_set(gi->img, gi->file, NULL);
if (evas_object_image_load_error_get(gi->img) != EVAS_LOAD_ERROR_NONE)
ecore_file_remove(gi->file);
-
+
evas_object_show(gi->img);
//evas_object_text_text_set(gi->txt, gi->file);
gi->wd->preload_num--;
if (!gi->wd->preload_num)
{
- edje_object_signal_emit(elm_smart_scroller_edje_object_get(gi->wd->scr),
+ edje_object_signal_emit(elm_smart_scroller_edje_object_get(gi->wd->scr),
"elm,state,busy,stop", "elm");
- evas_object_smart_callback_call(gi->wd->obj, SIG_LOADED_DETAIL, NULL);
+ evas_object_smart_callback_call(gi->wd->obj, SIG_LOADED_DETAIL, NULL);
}
}
if (status)
{
- DBG("Download failed %s (%d) ", gi->file, status);
- ecore_file_remove(gi->file);
+ DBG("Download failed %s (%d) ", gi->file, status);
+ ecore_file_remove(gi->file);
}
else
gi->wd->finish_num++;
if (!wd) return;
evas_object_geometry_get(wd->pan_smart, &ox, &oy, &ow, &oh);
evas_output_viewport_get(evas_object_evas_get(wd->obj), &cvx, &cvy, &cvw, &cvh);
-
+
gw = wd->size.w;
gh = wd->size.h;
if (size < (g->tsize / 2)) return; // else we will load to much tiles
it = eina_matrixsparse_iterator_new(g->grid);
-
+
EINA_ITERATOR_FOREACH(it, cell)
{
- gi = eina_matrixsparse_cell_data_get(cell);
-
- xx = gi->out.x;
- yy = gi->out.y;
- ww = gi->out.w;
- hh = gi->out.h;
-
- if ((gw != g->w) && (g->w > 0))
- {
- tx = xx;
- xx = ((long long )gw * xx) / g->w;
- ww = (((long long)gw * (tx + ww)) / g->w) - xx;
- }
- if ((gh != g->h) && (g->h > 0))
- {
- ty = yy;
- yy = ((long long)gh * yy) / g->h;
- hh = (((long long)gh * (ty + hh)) / g->h) - yy;
- }
-
- if (!ELM_RECTS_INTERSECT(xx - wd->pan_x + ox,
+ gi = eina_matrixsparse_cell_data_get(cell);
+
+ xx = gi->out.x;
+ yy = gi->out.y;
+ ww = gi->out.w;
+ hh = gi->out.h;
+
+ if ((gw != g->w) && (g->w > 0))
+ {
+ tx = xx;
+ xx = ((long long )gw * xx) / g->w;
+ ww = (((long long)gw * (tx + ww)) / g->w) - xx;
+ }
+ if ((gh != g->h) && (g->h > 0))
+ {
+ ty = yy;
+ yy = ((long long)gh * yy) / g->h;
+ hh = (((long long)gh * (ty + hh)) / g->h) - yy;
+ }
+
+ if (!ELM_RECTS_INTERSECT(xx - wd->pan_x + ox,
yy - wd->pan_y + oy,
ww, hh,
cvx, cvy, cvw, cvh))
- {
- if (gi->want)
- {
- evas_object_hide(gi->img);
- //evas_object_hide(gi->txt);
- evas_object_image_file_set(gi->img, NULL, NULL);
- gi->want = EINA_FALSE;
- gi->have = EINA_FALSE;
-
- if (gi->job)
- {
- DBG("DOWNLOAD abort %s", gi->file);
- ecore_file_download_abort(gi->job);
- ecore_file_remove(gi->file);
- gi->job = NULL;
+ {
+ if (gi->want)
+ {
+ evas_object_hide(gi->img);
+ //evas_object_hide(gi->txt);
+ evas_object_image_file_set(gi->img, NULL, NULL);
+ gi->want = EINA_FALSE;
+ gi->have = EINA_FALSE;
+
+ if (gi->job)
+ {
+ DBG("DOWNLOAD abort %s", gi->file);
+ ecore_file_download_abort(gi->job);
+ ecore_file_remove(gi->file);
+ gi->job = NULL;
wd->try_num--;
- }
- gi->download = EINA_FALSE;
- wd->preload_num--;
- if (!wd->preload_num)
- {
- edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
+ }
+ gi->download = EINA_FALSE;
+ wd->preload_num--;
+ if (!wd->preload_num)
+ {
+ edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
"elm,state,busy,stop", "elm");
- evas_object_smart_callback_call(obj, SIG_LOADED_DETAIL,
- NULL);
- }
-
- }
- else if (gi->have)
- {
- evas_object_hide(gi->img);
- //evas_object_hide(gi->txt);
- evas_object_image_preload(gi->img, 1);
- evas_object_image_file_set(gi->img, NULL, NULL);
- gi->have = EINA_FALSE;
- gi->want = EINA_FALSE;
- }
- }
+ evas_object_smart_callback_call(obj, SIG_LOADED_DETAIL,
+ NULL);
+ }
+
+ }
+ else if (gi->have)
+ {
+ evas_object_hide(gi->img);
+ //evas_object_hide(gi->txt);
+ evas_object_image_preload(gi->img, 1);
+ evas_object_image_file_set(gi->img, NULL, NULL);
+ gi->have = EINA_FALSE;
+ gi->want = EINA_FALSE;
+ }
+ }
}
eina_iterator_free(it);
for (y = yy; y <= yy + hh; y++)
{
- for (x = xx; x <= xx + ww; x++)
- {
- gi = eina_matrixsparse_data_idx_get(g->grid, y, x);
-
- if ((!gi) && (g != eina_list_data_get(wd->grids)))
- continue;
-
- if (!gi)
- {
- gi = calloc(1, sizeof(Grid_Item));
- gi->src.x = x * g->tsize;
- gi->src.y = y * g->tsize;
- gi->src.w = g->tsize;
- gi->src.h = g->tsize;
-
- gi->out.x = gi->src.x;
- gi->out.y = gi->src.y;
- gi->out.w = gi->src.w;
- gi->out.h = gi->src.h;
-
- gi->wd = wd;
-
- gi->img = evas_object_image_add(evas_object_evas_get(obj));
- evas_object_image_scale_hint_set
- (gi->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
- evas_object_image_filled_set(gi->img, 1);
-
- evas_object_smart_member_add(gi->img, wd->pan_smart);
- elm_widget_sub_object_add(obj, gi->img);
- evas_object_pass_events_set(gi->img, EINA_TRUE);
- evas_object_stack_below(gi->img, wd->sep_maps_markers);
-
- /*gi->txt = evas_object_text_add(evas_object_evas_get(obj));
- evas_object_text_font_set(gi->txt, "Vera", 12);
- evas_object_color_set(gi->txt, 100, 100, 100, 255);
- evas_object_smart_member_add(gi->txt,
- wd->pan_smart);
- elm_widget_sub_object_add(obj, gi->txt);
- evas_object_pass_events_set(gi->txt, EINA_TRUE);
+ for (x = xx; x <= xx + ww; x++)
+ {
+ gi = eina_matrixsparse_data_idx_get(g->grid, y, x);
+
+ if ((!gi) && (g != eina_list_data_get(wd->grids)))
+ continue;
+
+ if (!gi)
+ {
+ gi = calloc(1, sizeof(Grid_Item));
+ gi->src.x = x * g->tsize;
+ gi->src.y = y * g->tsize;
+ gi->src.w = g->tsize;
+ gi->src.h = g->tsize;
+
+ gi->out.x = gi->src.x;
+ gi->out.y = gi->src.y;
+ gi->out.w = gi->src.w;
+ gi->out.h = gi->src.h;
+
+ gi->wd = wd;
+
+ gi->img = evas_object_image_add(evas_object_evas_get(obj));
+ evas_object_image_scale_hint_set
+ (gi->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
+ evas_object_image_filled_set(gi->img, 1);
+
+ evas_object_smart_member_add(gi->img, wd->pan_smart);
+ elm_widget_sub_object_add(obj, gi->img);
+ evas_object_pass_events_set(gi->img, EINA_TRUE);
+ evas_object_stack_below(gi->img, wd->sep_maps_markers);
+
+ /*gi->txt = evas_object_text_add(evas_object_evas_get(obj));
+ evas_object_text_font_set(gi->txt, "Vera", 12);
+ evas_object_color_set(gi->txt, 100, 100, 100, 255);
+ evas_object_smart_member_add(gi->txt,
+ wd->pan_smart);
+ elm_widget_sub_object_add(obj, gi->txt);
+ evas_object_pass_events_set(gi->txt, EINA_TRUE);
*/
- eina_matrixsparse_data_idx_set(g->grid, y, x, gi);
- }
-
- if ((!gi->have) && (!gi->download))
- {
- char buf[PATH_MAX], buf2[PATH_MAX];
- char *source;
-
- gi->want = EINA_TRUE;
-
- snprintf(buf, sizeof(buf), DEST_DIR_PATH, wd->id, g->zoom, x);
- if (!ecore_file_exists(buf))
- ecore_file_mkpath(buf);
-
- snprintf(buf2, sizeof(buf2), DEST_FILE_PATH, buf, y);
-
- source = map_sources_tab[wd->source].url_cb(obj, x, y, g->zoom);
- if ((!source) || (strlen(source)==0)) continue;
-
- eina_stringshare_replace(&gi->file, buf2);
-
- if ((ecore_file_exists(buf2)) || (g == eina_list_data_get(wd->grids)))
- {
- gi->download = EINA_TRUE;
- wd->preload_num++;
- if (wd->preload_num == 1)
- {
- edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
+ eina_matrixsparse_data_idx_set(g->grid, y, x, gi);
+ }
+
+ if ((!gi->have) && (!gi->download))
+ {
+ char buf[PATH_MAX], buf2[PATH_MAX];
+ char *source;
+
+ gi->want = EINA_TRUE;
+
+ snprintf(buf, sizeof(buf), DEST_DIR_PATH, wd->id, g->zoom, x);
+ if (!ecore_file_exists(buf))
+ ecore_file_mkpath(buf);
+
+ snprintf(buf2, sizeof(buf2), DEST_FILE_PATH, buf, y);
+
+ source = map_sources_tab[wd->source].url_cb(obj, x, y, g->zoom);
+ if ((!source) || (strlen(source)==0)) continue;
+
+ eina_stringshare_replace(&gi->file, buf2);
+
+ if ((ecore_file_exists(buf2)) || (g == eina_list_data_get(wd->grids)))
+ {
+ gi->download = EINA_TRUE;
+ wd->preload_num++;
+ if (wd->preload_num == 1)
+ {
+ edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
"elm,state,busy,start", "elm");
- evas_object_smart_callback_call(obj,
- SIG_LOAD_DETAIL,
- NULL);
- }
-
- if (ecore_file_exists(buf2))
- _tile_update(gi);
- else
- {
- DBG("DOWNLOAD %s \t in %s", source, buf2);
- ecore_file_download_full(source, buf2, _tile_downloaded, NULL, gi, &(gi->job), wd->ua);
+ evas_object_smart_callback_call(obj,
+ SIG_LOAD_DETAIL,
+ NULL);
+ }
+
+ if (ecore_file_exists(buf2))
+ _tile_update(gi);
+ else
+ {
+ DBG("DOWNLOAD %s \t in %s", source, buf2);
+ ecore_file_download_full(source, buf2, _tile_downloaded, NULL, gi, &(gi->job), wd->ua);
if (!gi->job)
DBG("Can't start to download %s", buf);
else
wd->try_num++;
- }
- }
- if (source) free(source);
- }
- else if (gi->have)
- evas_object_show(gi->img);
- }
+ }
+ }
+ if (source) free(source);
+ }
+ else if (gi->have)
+ evas_object_show(gi->img);
+ }
}
}
if (!wd) return;
EINA_LIST_FREE(wd->grids, g)
{
- grid_clear(obj, g);
- free(g);
+ grid_clear(obj, g);
+ free(g);
}
}
if (!wd) return;
EINA_LIST_FOREACH(wd->grids, l, g)
{
- Eina_Iterator *it = eina_matrixsparse_iterator_new(g->grid);
- Eina_Matrixsparse_Cell *cell;
-
- EINA_ITERATOR_FOREACH(it, cell)
- {
- Grid_Item *gi = eina_matrixsparse_cell_data_get(cell);
- evas_object_image_smooth_scale_set(gi->img, (!wd->nosmooth));
- }
- eina_iterator_free(it);
+ Eina_Iterator *it = eina_matrixsparse_iterator_new(g->grid);
+ Eina_Matrixsparse_Cell *cell;
+
+ EINA_ITERATOR_FOREACH(it, cell)
+ {
+ Grid_Item *gi = eina_matrixsparse_cell_data_get(cell);
+ evas_object_image_smooth_scale_set(gi->img, (!wd->nosmooth));
+ }
+ eina_iterator_free(it);
}
}
EINA_ITERATOR_FOREACH(it, cell)
{
- Grid_Item *gi = eina_matrixsparse_cell_data_get(cell);
- evas_object_raise(gi->img);
- //evas_object_raise(gi->txt);
+ Grid_Item *gi = eina_matrixsparse_cell_data_get(cell);
+ evas_object_raise(gi->img);
+ //evas_object_raise(gi->txt);
}
eina_iterator_free(it);
}
if (!wd) return;
if (!wd->scr_timer)
{
- wd->nosmooth++;
- if (wd->nosmooth == 1) _smooth_update(data);
+ wd->nosmooth++;
+ if (wd->nosmooth == 1) _smooth_update(data);
}
if (wd->scr_timer) ecore_timer_del(wd->scr_timer);
wd->scr_timer = ecore_timer_add(0.5, _scr_timeout, data);
if (wd->center_on.enabled)
{
- elm_map_utils_convert_geo_into_coord(obj, wd->center_on.lon, wd->center_on.lat, wd->size.w, &xx, &yy);
- xx -= ow / 2;
- yy -= oh / 2;
+ elm_map_utils_convert_geo_into_coord(obj, wd->center_on.lon, wd->center_on.lat, wd->size.w, &xx, &yy);
+ xx -= ow / 2;
+ yy -= oh / 2;
}
else
{
- xx = (wd->size.spos.x * wd->size.w) - (ow / 2);
- yy = (wd->size.spos.y * wd->size.h) - (oh / 2);
+ xx = (wd->size.spos.x * wd->size.w) - (ow / 2);
+ yy = (wd->size.spos.y * wd->size.h) - (oh / 2);
}
if (xx < 0) xx = 0;
wd->calc_job = ecore_job_add(_calc_job, wd);
if (t >= 1.0)
{
- return ECORE_CALLBACK_CANCEL;
+ return ECORE_CALLBACK_CANCEL;
}
return ECORE_CALLBACK_RENEW;
}
go = zoom_do(obj, t);
if (!go)
{
- wd->nosmooth--;
- if (!wd->nosmooth) _smooth_update(data);
- wd->zoom_animator = NULL;
- evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
+ wd->nosmooth--;
+ if (!wd->nosmooth) _smooth_update(data);
+ wd->zoom_animator = NULL;
+ evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
}
return go;
}
Widget_Data *wd = elm_widget_data_get(data);
Evas_Event_Mouse_Down *ev = event_info;
Event *ev0;
-
+
ev0 = get_event_object(data, 0);
if (ev0) return;
ev0 = create_event_object(data, obj, 0);
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) wd->on_hold = EINA_TRUE;
else wd->on_hold = EINA_FALSE;
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
- evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, ev);
+ evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, ev);
else
- evas_object_smart_callback_call(data, SIG_PRESS, ev);
+ evas_object_smart_callback_call(data, SIG_PRESS, ev);
wd->longpressed = EINA_FALSE;
if (wd->long_timer) ecore_timer_del(wd->long_timer);
wd->long_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, data);
Widget_Data *wd = elm_widget_data_get(data);
Evas_Event_Mouse_Move *move = event_info;
Event *ev0;
-
+
if (wd->pinch_zoom) return;
ev0 = get_event_object(data, 0);
if (!ev0) return;
int mdevice;
Event *ev0;
Event *ev1;
-
+
ev0 = get_event_object(data, 0);
if (ev0)
{
else
{
ev1 = get_event_object(data, mdevice);
- if (ev1)
- ev1->hold_timer = ecore_timer_add(0.35, _hold_timer_cb, ev1);
+ if (ev1)
+ ev1->hold_timer = ecore_timer_add(0.35, _hold_timer_cb, ev1);
}
destroy_event_object(data, ev0);
}
else wd->on_hold = EINA_FALSE;
if (wd->long_timer)
{
- ecore_timer_del(wd->long_timer);
- wd->long_timer = NULL;
+ ecore_timer_del(wd->long_timer);
+ wd->long_timer = NULL;
}
if (!wd->on_hold) evas_object_smart_callback_call(data, SIG_CLICKED, ev);
wd->on_hold = EINA_FALSE;
dis_new = get_distance(ev0->prev.x, ev0->prev.y, ev->prev.x, ev->prev.y);
zoom = wd->zoom;
-
+
if (dis_old)
{
- if (((dis_old - dis_new) > 0) &&
+ if (((dis_old - dis_new) > 0) &&
(ev->pinch_dis > elm_finger_size_get()))
{
wd->pinch_zoom = EINA_TRUE;
elm_map_zoom_set(data, zoom);
ev->pinch_dis = 0;
}
- else if (((dis_old - dis_new) < 0) &&
+ else if (((dis_old - dis_new) < 0) &&
(ev->pinch_dis < -elm_finger_size_get()))
{
wd->pinch_zoom = EINA_TRUE;
return;
}
dis_old = 0;
-
+
ev0 = get_event_object(data, 0);
if (ev0)
- ev0->hold_timer = ecore_timer_add(0.35, _hold_timer_cb, ev0);
+ ev0->hold_timer = ecore_timer_add(0.35, _hold_timer_cb, ev0);
else
{
if (ev->hold_timer)
{
ecore_timer_del(ev->hold_timer);
ev->hold_timer = NULL;
- }
+ }
}
destroy_event_object(data, ev);
}
_hold_timer_cb(void *data)
{
Event *ev0 = data;
-
+
ev0->hold_timer = NULL;
return ECORE_CALLBACK_CANCEL;
}
-static void
+static void
_rect_resize_cb(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
EINA_LIST_FREE(wd->groups_clas, group_clas)
{
- if (group_clas->style)
- eina_stringshare_del(group_clas->style);
- free(group_clas);
+ if (group_clas->style)
+ eina_stringshare_del(group_clas->style);
+ free(group_clas);
}
EINA_LIST_FREE(wd->markers_clas, marker_clas)
{
- if (marker_clas->style)
- eina_stringshare_del(marker_clas->style);
- free(marker_clas);
+ if (marker_clas->style)
+ eina_stringshare_del(marker_clas->style);
+ free(marker_clas);
}
EINA_LIST_FOREACH(wd->s_event_list, l, ev)
if (!wd) return;
for (i = 0; i < ZOOM_MAX + 1; i++)
{
- if (!wd->markers[i]) continue;
- Eina_Iterator *it = eina_matrixsparse_iterator_new(wd->markers[i]);
- Eina_Matrixsparse_Cell *cell;
-
- EINA_ITERATOR_FOREACH(it, cell)
- {
- l = eina_matrixsparse_cell_data_get(cell);
- EINA_LIST_FREE(l, group)
- {
- EINA_LIST_FREE(group->markers, marker)
- {
- evas_object_event_callback_del_full(group->sc, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ if (!wd->markers[i]) continue;
+ Eina_Iterator *it = eina_matrixsparse_iterator_new(wd->markers[i]);
+ Eina_Matrixsparse_Cell *cell;
+
+ EINA_ITERATOR_FOREACH(it, cell)
+ {
+ l = eina_matrixsparse_cell_data_get(cell);
+ EINA_LIST_FREE(l, group)
+ {
+ EINA_LIST_FREE(group->markers, marker)
+ {
+ evas_object_event_callback_del_full(group->sc, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_bubble_sc_hits_changed_cb, group);
- if (free_marker) free(marker);
- }
- free(group);
- }
- free_marker = EINA_FALSE;
- }
- eina_iterator_free(it);
- eina_matrixsparse_free(wd->markers[i]);
+ if (free_marker) free(marker);
+ }
+ free(group);
+ }
+ free_marker = EINA_FALSE;
+ }
+ eina_iterator_free(it);
+ eina_matrixsparse_free(wd->markers[i]);
}
evas_object_del(wd->sep_maps_markers);
if (!wd) return;
if (elm_widget_focus_get(obj))
{
- edje_object_signal_emit(wd->obj, "elm,action,focus", "elm");
- evas_object_focus_set(wd->obj, EINA_TRUE);
+ edje_object_signal_emit(wd->obj, "elm,action,focus", "elm");
+ evas_object_focus_set(wd->obj, EINA_TRUE);
}
else
{
- edje_object_signal_emit(wd->obj, "elm,action,unfocus", "elm");
- evas_object_focus_set(wd->obj, EINA_FALSE);
+ edje_object_signal_emit(wd->obj, "elm,action,unfocus", "elm");
+ evas_object_focus_set(wd->obj, EINA_FALSE);
}
}
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
elm_smart_scroller_object_theme_set(obj, wd->scr, "map", "base", elm_widget_style_get(obj));
-// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
+ // edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
_sizing_eval(obj);
}
minh = wd->size.h;
if (wd->resized)
{
- wd->resized = 0;
- if (wd->mode != ELM_MAP_ZOOM_MODE_MANUAL)
- {
- double tz = wd->zoom;
- wd->zoom = 0.0;
- elm_map_zoom_set(wd->obj, tz);
- }
+ wd->resized = 0;
+ if (wd->mode != ELM_MAP_ZOOM_MODE_MANUAL)
+ {
+ double tz = wd->zoom;
+ wd->zoom = 0.0;
+ elm_map_zoom_set(wd->obj, tz);
+ }
}
if ((minw != wd->minw) || (minh != wd->minh))
{
- wd->minw = minw;
- wd->minh = minh;
- evas_object_smart_callback_call(wd->pan_smart, SIG_CHANGED, NULL);
- _sizing_eval(wd->obj);
+ wd->minw = minw;
+ wd->minh = minh;
+ evas_object_smart_callback_call(wd->pan_smart, SIG_CHANGED, NULL);
+ _sizing_eval(wd->obj);
}
wd->calc_job = NULL;
evas_object_smart_changed(wd->pan_smart);
rect_place(sd->wd->obj, sd->wd->pan_x, sd->wd->pan_y, ox, oy, ow, oh);
EINA_LIST_FOREACH(sd->wd->grids, l, g)
{
- grid_load(sd->wd->obj, g);
- grid_place(sd->wd->obj, g, sd->wd->pan_x, sd->wd->pan_y, ox, oy, ow, oh);
- marker_place(sd->wd->obj, g, sd->wd->pan_x, sd->wd->pan_y, ox, oy, ow, oh);
+ grid_load(sd->wd->obj, g);
+ grid_place(sd->wd->obj, g, sd->wd->pan_x, sd->wd->pan_y, ox, oy, ow, oh);
+ marker_place(sd->wd->obj, g, sd->wd->pan_x, sd->wd->pan_y, ox, oy, ow, oh);
}
}
if (group->obj) return;
if ((!group->clas->priv.objs_notused) || (eina_list_count(group->markers) == 1))
{
- //set icon and style
- if (eina_list_count(group->markers) == 1)
- {
- Elm_Map_Marker *m = eina_list_data_get(group->markers);
- if (m->clas->style)
- style = m->clas->style;
-
- if (m->clas->func.icon_get)
- icon = m->clas->func.icon_get(group->wd->obj, m, m->data);
-
- group->delete_object = EINA_TRUE;
- }
- else
- {
- if (group->clas->style)
- style = group->clas->style;
-
- if (group->clas->func.icon_get)
- icon = group->clas->func.icon_get(group->wd->obj, group->clas->data);
-
- group->delete_object = EINA_FALSE;
- }
-
- group->obj = elm_layout_add(group->wd->obj);
- elm_layout_theme_set(group->obj, "map/marker", style, elm_widget_style_get(group->wd->obj));
-
- if (icon) elm_layout_content_set(group->obj, "elm.icon", icon);
-
- evas_object_smart_member_add(group->obj, group->wd->pan_smart);
- elm_widget_sub_object_add(group->wd->obj, group->obj);
- evas_object_stack_above(group->obj, group->wd->sep_maps_markers);
-
- if (!group->delete_object)
- group->clas->priv.objs_used = eina_list_append(group->clas->priv.objs_used, group->obj);
+ //set icon and style
+ if (eina_list_count(group->markers) == 1)
+ {
+ Elm_Map_Marker *m = eina_list_data_get(group->markers);
+ if (m->clas->style)
+ style = m->clas->style;
+
+ if (m->clas->func.icon_get)
+ icon = m->clas->func.icon_get(group->wd->obj, m, m->data);
+
+ group->delete_object = EINA_TRUE;
+ }
+ else
+ {
+ if (group->clas->style)
+ style = group->clas->style;
+
+ if (group->clas->func.icon_get)
+ icon = group->clas->func.icon_get(group->wd->obj, group->clas->data);
+
+ group->delete_object = EINA_FALSE;
+ }
+
+ group->obj = elm_layout_add(group->wd->obj);
+ elm_layout_theme_set(group->obj, "map/marker", style, elm_widget_style_get(group->wd->obj));
+
+ if (icon) elm_layout_content_set(group->obj, "elm.icon", icon);
+
+ evas_object_smart_member_add(group->obj, group->wd->pan_smart);
+ elm_widget_sub_object_add(group->wd->obj, group->obj);
+ evas_object_stack_above(group->obj, group->wd->sep_maps_markers);
+
+ if (!group->delete_object)
+ group->clas->priv.objs_used = eina_list_append(group->clas->priv.objs_used, group->obj);
}
else
{
- group->delete_object = EINA_FALSE;
-
- group->obj = eina_list_data_get(group->clas->priv.objs_notused);
- group->clas->priv.objs_used = eina_list_append(group->clas->priv.objs_used, group->obj);
- group->clas->priv.objs_notused = eina_list_remove(group->clas->priv.objs_notused, group->obj);
- evas_object_show(group->obj);
+ group->delete_object = EINA_FALSE;
+
+ group->obj = eina_list_data_get(group->clas->priv.objs_notused);
+ group->clas->priv.objs_used = eina_list_append(group->clas->priv.objs_used, group->obj);
+ group->clas->priv.objs_notused = eina_list_remove(group->clas->priv.objs_notused, group->obj);
+ evas_object_show(group->obj);
}
edje_object_signal_callback_add(elm_layout_edje_get(group->obj), "open", "elm", _group_open_cb, group);
if (!group->obj) return;
if (!group->delete_object)
{
- group->clas->priv.objs_notused = eina_list_append(group->clas->priv.objs_notused, group->obj);
- group->clas->priv.objs_used = eina_list_remove(group->clas->priv.objs_used, group->obj);
- evas_object_hide(group->obj);
+ group->clas->priv.objs_notused = eina_list_append(group->clas->priv.objs_notused, group->obj);
+ group->clas->priv.objs_used = eina_list_remove(group->clas->priv.objs_used, group->obj);
+ evas_object_hide(group->obj);
- edje_object_signal_callback_del(elm_layout_edje_get(group->obj), "open", "elm", _group_open_cb);
- edje_object_signal_callback_del(elm_layout_edje_get(group->obj), "bringin", "elm", _group_bringin_cb);
+ edje_object_signal_callback_del(elm_layout_edje_get(group->obj), "open", "elm", _group_open_cb);
+ edje_object_signal_callback_del(elm_layout_edje_get(group->obj), "bringin", "elm", _group_bringin_cb);
}
else
evas_object_del(group->obj);
evas_object_smart_member_add(group->bubble,
group->wd->obj);
elm_widget_sub_object_add(group->wd->obj, group->bubble);
-
+
_group_bubble_content_free(group);
if (!_group_bubble_content_update(group))
{
- //no content, we can delete the bubble
- _group_bubble_free(group);
- return;
+ //no content, we can delete the bubble
+ _group_bubble_free(group);
+ return;
}
-
+
group->rect = evas_object_rectangle_add(evas_object_evas_get(group->obj));
evas_object_color_set(group->rect, 0, 0, 0, 0);
evas_object_repeat_events_set(group->rect, EINA_TRUE);
evas_object_smart_member_add(group->rect, group->wd->obj);
elm_widget_sub_object_add(group->wd->obj, group->rect);
-
+
evas_object_event_callback_add(group->rect, EVAS_CALLBACK_MOUSE_UP, _group_bubble_mouse_up_cb, group);
-
+
_group_bubble_place(group);
}
if (!group->sc)
{
- group->sc = elm_scroller_add(group->bubble);
- elm_widget_style_set(group->sc, "map_bubble");
- elm_scroller_content_min_limit(group->sc, EINA_FALSE, EINA_TRUE);
- elm_scroller_policy_set(group->sc, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF);
- elm_scroller_bounce_set(group->sc, _elm_config->thumbscroll_bounce_enable, EINA_FALSE);
- edje_object_part_swallow(group->bubble, "elm.swallow.content", group->sc);
- evas_object_show(group->sc);
- evas_object_smart_member_add(group->sc,
+ group->sc = elm_scroller_add(group->bubble);
+ elm_widget_style_set(group->sc, "map_bubble");
+ elm_scroller_content_min_limit(group->sc, EINA_FALSE, EINA_TRUE);
+ elm_scroller_policy_set(group->sc, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF);
+ elm_scroller_bounce_set(group->sc, _elm_config->thumbscroll_bounce_enable, EINA_FALSE);
+ edje_object_part_swallow(group->bubble, "elm.swallow.content", group->sc);
+ evas_object_show(group->sc);
+ evas_object_smart_member_add(group->sc,
group->wd->obj);
- elm_widget_sub_object_add(group->wd->obj, group->sc);
-
- group->bx = elm_box_add(group->bubble);
- evas_object_size_hint_align_set(group->bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(group->bx, 0.5, 0.5);
- elm_box_horizontal_set(group->bx, EINA_TRUE);
- evas_object_show(group->bx);
-
- elm_scroller_content_set(group->sc, group->bx);
-
- evas_object_event_callback_add(group->sc, EVAS_CALLBACK_RESIZE,
+ elm_widget_sub_object_add(group->wd->obj, group->sc);
+
+ group->bx = elm_box_add(group->bubble);
+ evas_object_size_hint_align_set(group->bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(group->bx, 0.5, 0.5);
+ elm_box_horizontal_set(group->bx, EINA_TRUE);
+ evas_object_show(group->bx);
+
+ elm_scroller_content_set(group->sc, group->bx);
+
+ evas_object_event_callback_add(group->sc, EVAS_CALLBACK_RESIZE,
_bubble_sc_hits_changed_cb, group);
}
-
+
EINA_LIST_FOREACH(group->markers, l, marker)
{
- if (i >= group->wd->markers_max_num) break;
- if ((!marker->content) && (marker->clas->func.get))
- marker->content = marker->clas->func.get(group->wd->obj, marker, marker->data);
- else if (marker->content)
- elm_box_unpack(group->bx, marker->content);
- if (marker->content)
- {
- elm_box_pack_end(group->bx, marker->content);
- i++;
- }
+ if (i >= group->wd->markers_max_num) break;
+ if ((!marker->content) && (marker->clas->func.get))
+ marker->content = marker->clas->func.get(group->wd->obj, marker, marker->data);
+ else if (marker->content)
+ elm_box_unpack(group->bx, marker->content);
+ if (marker->content)
+ {
+ elm_box_pack_end(group->bx, marker->content);
+ i++;
+ }
}
return i;
}
if (!group->sc) return;
EINA_LIST_FOREACH(group->markers, l, marker)
{
- if ((marker->content) && (marker->clas->func.del))
- marker->clas->func.del(group->wd->obj, marker, marker->data, marker->content);
- else if (marker->content)
- evas_object_del(marker->content);
- marker->content = NULL;
+ if ((marker->content) && (marker->clas->func.del))
+ marker->clas->func.del(group->wd->obj, marker, marker->data, marker->content);
+ else if (marker->content)
+ evas_object_del(marker->content);
+ marker->content = NULL;
}
evas_object_del(group->sc);
group->sc = NULL;
if (group->bringin)
{
- group->bringin = EINA_FALSE;
- return;
+ group->bringin = EINA_FALSE;
+ return;
}
if (group->bubble)
{
- group->open = EINA_FALSE;
- _group_bubble_free(group);
- return;
+ group->open = EINA_FALSE;
+ _group_bubble_free(group);
+ return;
}
group->open = EINA_TRUE;
_group_bubble_create(group);
else if ((!strcmp(ev->keyname, "Prior")) || (!strcmp(ev->keyname, "KP_Prior")))
{
if (page_y < 0)
- y -= -(page_y * v_h) / 100;
+ y -= -(page_y * v_h) / 100;
else
- y -= page_y;
+ y -= page_y;
}
else if ((!strcmp(ev->keyname, "Next")) || (!strcmp(ev->keyname, "KP_Next")))
{
if (page_y < 0)
- y += -(page_y * v_h) / 100;
+ y += -(page_y * v_h) / 100;
else
- y += page_y;
+ y += page_y;
}
else if (!strcmp(ev->keyname, "KP_Add"))
{
Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "map");
elm_widget_type_set(obj, "map");
elm_widget_sub_object_add(parent, obj);
if (!smart)
{
- static Evas_Smart_Class sc;
+ static Evas_Smart_Class sc;
- evas_object_smart_clipped_smart_set(&_pan_sc);
- sc = _pan_sc;
- sc.name = "elm_map_pan";
- sc.version = EVAS_SMART_CLASS_VERSION;
- sc.add = _pan_add;
- sc.del = _pan_del;
- sc.resize = _pan_resize;
- sc.move = _pan_move;
- sc.calculate = _pan_calculate;
- smart = evas_smart_class_new(&sc);
+ evas_object_smart_clipped_smart_set(&_pan_sc);
+ sc = _pan_sc;
+ sc.name = "elm_map_pan";
+ sc.version = EVAS_SMART_CLASS_VERSION;
+ sc.add = _pan_add;
+ sc.del = _pan_del;
+ sc.resize = _pan_resize;
+ sc.move = _pan_move;
+ sc.calculate = _pan_calculate;
+ smart = evas_smart_class_new(&sc);
}
if (smart)
{
- wd->pan_smart = evas_object_smart_add(e, smart);
- wd->pan = evas_object_smart_data_get(wd->pan_smart);
- wd->pan->wd = wd;
+ wd->pan_smart = evas_object_smart_add(e, smart);
+ wd->pan = evas_object_smart_data_get(wd->pan_smart);
+ wd->pan->wd = wd;
}
elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart,
evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_RESIZE,
_rect_resize_cb, obj);
evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MOUSE_DOWN,
- _mouse_down, obj);
+ _mouse_down, obj);
evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MOUSE_MOVE,
_mouse_move, obj);
evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MOUSE_UP,
- _mouse_up, obj);
- evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MULTI_DOWN,
+ _mouse_up, obj);
+ evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MULTI_DOWN,
_mouse_multi_down, obj);
evas_object_event_callback_add(wd->rect, EVAS_CALLBACK_MULTI_MOVE,
_mouse_multi_move, obj);
// TODO: convert Elementary to subclassing of Evas_Smart_Class
// TODO: and save some bytes, making descriptions per-class and not instance!
evas_object_smart_callbacks_descriptions_set(obj, _signals);
-
+
if (!ecore_file_download_protocol_available("http://"))
{
- ERR("Ecore must be built with curl support for the map widget!");
+ ERR("Ecore must be built with curl support for the map widget!");
}
-
+
return obj;
}
Evas_Coord rx, ry, rw, rh;
int z;
int zoom_changed = 0, started = 0;
-
+
if (!wd) return;
if (zoom < 0 ) zoom = 0;
if (zoom > map_sources_tab[wd->source].zoom_max)
if (wd->mode == ELM_MAP_ZOOM_MODE_MANUAL)
{
- wd->size.nw = pow(2.0, wd->zoom) * wd->tsize;
- wd->size.nh = pow(2.0, wd->zoom) * wd->tsize;
+ wd->size.nw = pow(2.0, wd->zoom) * wd->tsize;
+ wd->size.nh = pow(2.0, wd->zoom) * wd->tsize;
}
else if (wd->mode == ELM_MAP_ZOOM_MODE_AUTO_FIT)
{
- int p2w, p2h;
- int cumulw, cumulh;
-
- cumulw = wd->tsize;
- p2w = 0;
- while (cumulw <= rw)
- {
- p2w++;
- cumulw *= 2;
- }
- p2w--;
-
- cumulh = wd->tsize;
- p2h = 0;
- while (cumulh <= rh)
- {
- p2h++;
- cumulh *= 2;
- }
- p2h--;
-
- if (p2w < p2h)
- z = p2w;
- else
- z = p2h;
-
- wd->zoom = z;
- wd->size.nw = pow(2.0, wd->zoom) * wd->tsize;
- wd->size.nh = pow(2.0, wd->zoom) * wd->tsize;
+ int p2w, p2h;
+ int cumulw, cumulh;
+
+ cumulw = wd->tsize;
+ p2w = 0;
+ while (cumulw <= rw)
+ {
+ p2w++;
+ cumulw *= 2;
+ }
+ p2w--;
+
+ cumulh = wd->tsize;
+ p2h = 0;
+ while (cumulh <= rh)
+ {
+ p2h++;
+ cumulh *= 2;
+ }
+ p2h--;
+
+ if (p2w < p2h)
+ z = p2w;
+ else
+ z = p2h;
+
+ wd->zoom = z;
+ wd->size.nw = pow(2.0, wd->zoom) * wd->tsize;
+ wd->size.nh = pow(2.0, wd->zoom) * wd->tsize;
}
else if (wd->mode == ELM_MAP_ZOOM_MODE_AUTO_FILL)
{
- int p2w, p2h;
- int cumulw, cumulh;
-
- cumulw = wd->tsize;
- p2w = 0;
- while (cumulw <= rw)
- {
- p2w++;
- cumulw *= 2;
- }
- p2w--;
-
- cumulh = wd->tsize;
- p2h = 0;
- while (cumulh <= rh)
- {
- p2h++;
- cumulh *= 2;
- }
- p2h--;
-
- if (p2w > p2h)
- z = p2w;
- else
- z = p2h;
-
- wd->zoom = z;
- wd->size.nw = pow(2.0, wd->zoom) * wd->tsize;
- wd->size.nh = pow(2.0, wd->zoom) * wd->tsize;
+ int p2w, p2h;
+ int cumulw, cumulh;
+
+ cumulw = wd->tsize;
+ p2w = 0;
+ while (cumulw <= rw)
+ {
+ p2w++;
+ cumulw *= 2;
+ }
+ p2w--;
+
+ cumulh = wd->tsize;
+ p2h = 0;
+ while (cumulh <= rh)
+ {
+ p2h++;
+ cumulh *= 2;
+ }
+ p2h--;
+
+ if (p2w > p2h)
+ z = p2w;
+ else
+ z = p2h;
+
+ wd->zoom = z;
+ wd->size.nw = pow(2.0, wd->zoom) * wd->tsize;
+ wd->size.nh = pow(2.0, wd->zoom) * wd->tsize;
}
EINA_LIST_FOREACH(wd->grids, l, g)
{
- if (g->zoom == wd->zoom)
- {
- wd->grids = eina_list_remove(wd->grids, g);
- wd->grids = eina_list_prepend(wd->grids, g);
- _grid_raise(g);
- goto done;
- }
+ if (g->zoom == wd->zoom)
+ {
+ wd->grids = eina_list_remove(wd->grids, g);
+ wd->grids = eina_list_prepend(wd->grids, g);
+ _grid_raise(g);
+ goto done;
+ }
}
g = grid_create(obj);
if (g)
{
- if (eina_list_count(wd->grids) > 1)
- {
- g_zoom = eina_list_last(wd->grids)->data;
- wd->grids = eina_list_remove(wd->grids, g_zoom);
- grid_clear(obj, g_zoom);
- free(g_zoom);
- }
- wd->grids = eina_list_prepend(wd->grids, g);
+ if (eina_list_count(wd->grids) > 1)
+ {
+ g_zoom = eina_list_last(wd->grids)->data;
+ wd->grids = eina_list_remove(wd->grids, g_zoom);
+ grid_clear(obj, g_zoom);
+ free(g_zoom);
+ }
+ wd->grids = eina_list_prepend(wd->grids, g);
}
else
{
- EINA_LIST_FREE(wd->grids, g)
- {
- grid_clear(obj, g);
- free(g);
- }
+ EINA_LIST_FREE(wd->grids, g)
+ {
+ grid_clear(obj, g);
+ free(g);
+ }
}
done:
wd->t_end = wd->t_start + _elm_config->zoom_friction;
if ((wd->size.w > 0) && (wd->size.h > 0))
{
- wd->size.spos.x = (double)(rx + (rw / 2)) / (double)wd->size.ow;
- wd->size.spos.y = (double)(ry + (rh / 2)) / (double)wd->size.oh;
+ wd->size.spos.x = (double)(rx + (rw / 2)) / (double)wd->size.ow;
+ wd->size.spos.y = (double)(ry + (rh / 2)) / (double)wd->size.oh;
}
else
{
- wd->size.spos.x = 0.5;
- wd->size.spos.y = 0.5;
+ wd->size.spos.x = 0.5;
+ wd->size.spos.y = 0.5;
}
if (rw > wd->size.ow) wd->size.spos.x = 0.5;
if (rh > wd->size.oh) wd->size.spos.y = 0.5;
if (wd->size.spos.y > 1.0) wd->size.spos.y = 1.0;
if (wd->paused)
{
- zoom_do(obj, 1.0);
+ zoom_do(obj, 1.0);
}
else
{
- if (!wd->zoom_animator)
- {
- wd->zoom_animator = ecore_animator_add(_zoom_anim, obj);
- wd->nosmooth++;
- if (wd->nosmooth == 1) _smooth_update(obj);
- started = 1;
- }
+ if (!wd->zoom_animator)
+ {
+ wd->zoom_animator = ecore_animator_add(_zoom_anim, obj);
+ wd->nosmooth++;
+ if (wd->nosmooth == 1) _smooth_update(obj);
+ started = 1;
+ }
}
if (wd->zoom_animator)
{
- if (!_zoom_anim(obj))
- {
- ecore_animator_del(wd->zoom_animator);
- wd->zoom_animator = NULL;
- }
+ if (!_zoom_anim(obj))
+ {
+ ecore_animator_del(wd->zoom_animator);
+ wd->zoom_animator = NULL;
+ }
}
if (wd->calc_job) ecore_job_del(wd->calc_job);
wd->calc_job = ecore_job_add(_calc_job, wd);
if (!wd->paused)
{
- if (started)
- evas_object_smart_callback_call(obj, SIG_ZOOM_START, NULL);
- if (!wd->zoom_animator)
- evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
+ if (started)
+ evas_object_smart_callback_call(obj, SIG_ZOOM_START, NULL);
+ if (!wd->zoom_animator)
+ evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
}
if (zoom_changed)
if (wd->mode == mode) return;
wd->mode = mode;
{
- double tz = wd->zoom;
- wd->zoom = 0.0;
- elm_map_zoom_set(wd->obj, tz);
+ double tz = wd->zoom;
+ wd->zoom = 0.0;
+ elm_map_zoom_set(wd->obj, tz);
}
}
if (wd->zoom_animator)
{
- wd->nosmooth--;
- if (!wd->nosmooth) _smooth_update(obj);
- ecore_animator_del(wd->zoom_animator);
- wd->zoom_animator = NULL;
- zoom_do(obj, 1.0);
- evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
+ wd->nosmooth--;
+ if (!wd->nosmooth) _smooth_update(obj);
+ ecore_animator_del(wd->zoom_animator);
+ wd->zoom_animator = NULL;
+ zoom_do(obj, 1.0);
+ evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
}
elm_smart_scroller_region_bring_in(wd->scr, rx, ry, rw, rh);
if (wd->zoom_animator)
{
- wd->nosmooth--;
- ecore_animator_del(wd->zoom_animator);
- wd->zoom_animator = NULL;
- zoom_do(obj, 1.0);
- evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
+ wd->nosmooth--;
+ ecore_animator_del(wd->zoom_animator);
+ wd->zoom_animator = NULL;
+ zoom_do(obj, 1.0);
+ evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
}
elm_smart_scroller_child_region_show(wd->scr, rx, ry, rw, rh);
wd->paused = paused;
if (wd->paused)
{
- if (wd->zoom_animator)
- {
- ecore_animator_del(wd->zoom_animator);
- wd->zoom_animator = NULL;
- zoom_do(obj, 1.0);
- evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
- }
+ if (wd->zoom_animator)
+ {
+ ecore_animator_del(wd->zoom_animator);
+ wd->zoom_animator = NULL;
+ zoom_do(obj, 1.0);
+ evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
+ }
}
}
* @ingroup Map
*/
-EAPI void
+EAPI void
elm_map_utils_downloading_status_get(const Evas_Object *obj, int *try_num, int *finish_num)
{
ELM_CHECK_WIDTYPE(obj, widtype);
if (lon)
{
- *lon = x / (double)size * 360.0 - 180;
+ *lon = x / (double)size * 360.0 - 180;
}
if (lat)
{
- double n = ELM_PI - 2.0 * ELM_PI * y / size;
- *lat = 180.0 / ELM_PI * atan(0.5 * (exp(n) - exp(-n)));
+ double n = ELM_PI - 2.0 * ELM_PI * y / size;
+ *lat = 180.0 / ELM_PI * atan(0.5 * (exp(n) - exp(-n)));
}
}
if (!clas_group->priv.set)
{
- style = "radio";
- if (marker->clas_group && marker->clas_group->style)
- style = marker->clas_group->style;
-
- o = edje_object_add(evas_object_evas_get(obj));
- _elm_theme_object_set(obj, o, "map/marker", style, elm_widget_style_get(obj));
- s = edje_object_data_get(o, "size_w");
- if (s) clas_group->priv.edje_w = atoi(s);
- else clas_group->priv.edje_w = 0;
- s = edje_object_data_get(o, "size_h");
- if (s) clas_group->priv.edje_h = atoi(s);
- else clas_group->priv.edje_h = 0;
- s = edje_object_data_get(o, "size_max_w");
- if (s) clas_group->priv.edje_max_w = atoi(s);
- else clas_group->priv.edje_max_w = 0;
- s = edje_object_data_get(o, "size_max_h");
- if (s) clas_group->priv.edje_max_h = atoi(s);
- else clas_group->priv.edje_max_h = 0;
- evas_object_del(o);
-
- clas_group->priv.set = EINA_TRUE;
+ style = "radio";
+ if (marker->clas_group && marker->clas_group->style)
+ style = marker->clas_group->style;
+
+ o = edje_object_add(evas_object_evas_get(obj));
+ _elm_theme_object_set(obj, o, "map/marker", style, elm_widget_style_get(obj));
+ s = edje_object_data_get(o, "size_w");
+ if (s) clas_group->priv.edje_w = atoi(s);
+ else clas_group->priv.edje_w = 0;
+ s = edje_object_data_get(o, "size_h");
+ if (s) clas_group->priv.edje_h = atoi(s);
+ else clas_group->priv.edje_h = 0;
+ s = edje_object_data_get(o, "size_max_w");
+ if (s) clas_group->priv.edje_max_w = atoi(s);
+ else clas_group->priv.edje_max_w = 0;
+ s = edje_object_data_get(o, "size_max_h");
+ if (s) clas_group->priv.edje_max_h = atoi(s);
+ else clas_group->priv.edje_max_h = 0;
+ evas_object_del(o);
+
+ clas_group->priv.set = EINA_TRUE;
}
if (!clas->priv.set)
{
- style = "radio";
- if (marker->clas && marker->clas->style)
- style = marker->clas->style;
-
- o = edje_object_add(evas_object_evas_get(obj));
- _elm_theme_object_set(obj, o, "map/marker", style, elm_widget_style_get(obj));
- s = edje_object_data_get(o, "size_w");
- if (s) clas->priv.edje_w = atoi(s);
- else clas->priv.edje_w = 0;
- s = edje_object_data_get(o, "size_h");
- if (s) clas->priv.edje_h = atoi(s);
- else clas->priv.edje_h = 0;
- evas_object_del(o);
+ style = "radio";
+ if (marker->clas && marker->clas->style)
+ style = marker->clas->style;
- clas->priv.set = EINA_TRUE;
+ o = edje_object_add(evas_object_evas_get(obj));
+ _elm_theme_object_set(obj, o, "map/marker", style, elm_widget_style_get(obj));
+ s = edje_object_data_get(o, "size_w");
+ if (s) clas->priv.edje_w = atoi(s);
+ else clas->priv.edje_w = 0;
+ s = edje_object_data_get(o, "size_h");
+ if (s) clas->priv.edje_h = atoi(s);
+ else clas->priv.edje_h = 0;
+ evas_object_del(o);
+
+ clas->priv.set = EINA_TRUE;
}
for (i = clas_group->zoom_displayed; i <= ZOOM_MAX; i++)
{
- elm_map_utils_convert_geo_into_coord(obj, lon, lat, pow(2.0, i)*wd->tsize,
+ elm_map_utils_convert_geo_into_coord(obj, lon, lat, pow(2.0, i)*wd->tsize,
&(marker->x[i]), &(marker->y[i]));
-
- //search in the matrixsparse the region where the marker will be
- mpi = marker->x[i] / wd->tsize;
- mpj = marker->y[i] / wd->tsize;
-
- if (!wd->markers[i])
- {
- int size = pow(2.0, i);
- wd->markers[i] = eina_matrixsparse_new(size, size, NULL, NULL);
- }
-
- group = NULL;
- if (i <= clas_group->zoom_grouped)
- {
- for (j = 0, group = NULL; j < 9 && !group; j++)
- {
- EINA_LIST_FOREACH(eina_matrixsparse_data_idx_get(wd->markers[i], mpj + tabj[j], mpi + tabi[j]),
+
+ //search in the matrixsparse the region where the marker will be
+ mpi = marker->x[i] / wd->tsize;
+ mpj = marker->y[i] / wd->tsize;
+
+ if (!wd->markers[i])
+ {
+ int size = pow(2.0, i);
+ wd->markers[i] = eina_matrixsparse_new(size, size, NULL, NULL);
+ }
+
+ group = NULL;
+ if (i <= clas_group->zoom_grouped)
+ {
+ for (j = 0, group = NULL; j < 9 && !group; j++)
+ {
+ EINA_LIST_FOREACH(eina_matrixsparse_data_idx_get(wd->markers[i], mpj + tabj[j], mpi + tabi[j]),
l, group)
- {
- if (group->clas == marker->clas_group
+ {
+ if (group->clas == marker->clas_group
&& ELM_RECTS_INTERSECT(marker->x[i]-clas->priv.edje_w/4,
marker->y[i]-clas->priv.edje_h/4, clas->priv.edje_w, clas->priv.edje_h,
group->x-group->w/4, group->y-group->h/4, group->w, group->h))
- {
- group->markers = eina_list_append(group->markers, marker);
- group->update_nbelems = EINA_TRUE;
- group->update_resize = EINA_TRUE;
-
- group->sum_x += marker->x[i];
- group->sum_y += marker->y[i];
- group->x = group->sum_x / eina_list_count(group->markers);
- group->y = group->sum_y / eina_list_count(group->markers);
-
- group->w = group->clas->priv.edje_w + group->clas->priv.edje_w/8.
- * eina_list_count(group->markers);
- group->h = group->clas->priv.edje_h + group->clas->priv.edje_h/8.
- * eina_list_count(group->markers);
- if (group->w > group->clas->priv.edje_max_w) group->w = group->clas->priv.edje_max_w;
- if (group->h > group->clas->priv.edje_max_h) group->h = group->clas->priv.edje_max_h;
-
- if (group->obj && eina_list_count(group->markers) == 2)
- {
- _group_object_free(group);
- _group_object_create(group);
- }
- if (group->bubble)
- _group_bubble_content_update(group);
-
- break;
- }
- }
- }
- }
- if (!group)
- {
- group = calloc(1, sizeof(Marker_Group));
- group->wd = wd;
- group->sum_x = marker->x[i];
- group->sum_y = marker->y[i];
- group->x = marker->x[i];
- group->y = marker->y[i];
- group->w = clas_group->priv.edje_w;
- group->h = clas_group->priv.edje_h;
- group->clas = clas_group;
-
- group->markers = eina_list_append(group->markers, marker);
- group->update_nbelems = EINA_TRUE;
- group->update_resize = EINA_TRUE;
-
- eina_matrixsparse_cell_idx_get(wd->markers[i], mpj, mpi, &(group->cell));
-
- if (!group->cell)
- {
- l = eina_list_append(NULL, group);
- eina_matrixsparse_data_idx_set(wd->markers[i], mpj, mpi, l);
- eina_matrixsparse_cell_idx_get(wd->markers[i], mpj, mpi, &(group->cell));
- }
- else
- {
- l = eina_matrixsparse_cell_data_get(group->cell);
- l = eina_list_append(l, group);
- eina_matrixsparse_cell_data_set(group->cell, l);
- }
- }
- marker->groups[i] = group;
+ {
+ group->markers = eina_list_append(group->markers, marker);
+ group->update_nbelems = EINA_TRUE;
+ group->update_resize = EINA_TRUE;
+
+ group->sum_x += marker->x[i];
+ group->sum_y += marker->y[i];
+ group->x = group->sum_x / eina_list_count(group->markers);
+ group->y = group->sum_y / eina_list_count(group->markers);
+
+ group->w = group->clas->priv.edje_w + group->clas->priv.edje_w/8.
+ * eina_list_count(group->markers);
+ group->h = group->clas->priv.edje_h + group->clas->priv.edje_h/8.
+ * eina_list_count(group->markers);
+ if (group->w > group->clas->priv.edje_max_w) group->w = group->clas->priv.edje_max_w;
+ if (group->h > group->clas->priv.edje_max_h) group->h = group->clas->priv.edje_max_h;
+
+ if (group->obj && eina_list_count(group->markers) == 2)
+ {
+ _group_object_free(group);
+ _group_object_create(group);
+ }
+ if (group->bubble)
+ _group_bubble_content_update(group);
+
+ break;
+ }
+ }
+ }
+ }
+ if (!group)
+ {
+ group = calloc(1, sizeof(Marker_Group));
+ group->wd = wd;
+ group->sum_x = marker->x[i];
+ group->sum_y = marker->y[i];
+ group->x = marker->x[i];
+ group->y = marker->y[i];
+ group->w = clas_group->priv.edje_w;
+ group->h = clas_group->priv.edje_h;
+ group->clas = clas_group;
+
+ group->markers = eina_list_append(group->markers, marker);
+ group->update_nbelems = EINA_TRUE;
+ group->update_resize = EINA_TRUE;
+
+ eina_matrixsparse_cell_idx_get(wd->markers[i], mpj, mpi, &(group->cell));
+
+ if (!group->cell)
+ {
+ l = eina_list_append(NULL, group);
+ eina_matrixsparse_data_idx_set(wd->markers[i], mpj, mpi, l);
+ eina_matrixsparse_cell_idx_get(wd->markers[i], mpj, mpi, &(group->cell));
+ }
+ else
+ {
+ l = eina_matrixsparse_cell_data_get(group->cell);
+ l = eina_list_append(l, group);
+ eina_matrixsparse_cell_data_set(group->cell, l);
+ }
+ }
+ marker->groups[i] = group;
}
if (wd->grids)
{
- Evas_Coord ox, oy, ow, oh;
- evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
- marker_place(obj, eina_list_data_get(wd->grids), wd->pan_x, wd->pan_y, ox, oy, ow, oh);
+ Evas_Coord ox, oy, ow, oh;
+ evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
+ marker_place(obj, eina_list_data_get(wd->grids), wd->pan_x, wd->pan_y, ox, oy, ow, oh);
}
return marker;
marker->clas->func.del(marker->wd->obj, marker, marker->data, marker->content);
else if (marker->content)
evas_object_del(marker->content);
-
+
free(marker);
-
+
if (wd->grids)
{
- Evas_Coord ox, oy, ow, oh;
- evas_object_geometry_get(wd->obj, &ox, &oy, &ow, &oh);
- marker_place(wd->obj, eina_list_data_get(wd->grids), wd->pan_x, wd->pan_y, ox, oy, ow, oh);
+ Evas_Coord ox, oy, ow, oh;
+ evas_object_geometry_get(wd->obj, &ox, &oy, &ow, &oh);
+ marker_place(wd->obj, eina_list_data_get(wd->grids), wd->pan_x, wd->pan_y, ox, oy, ow, oh);
}
}
EINA_LIST_FOREACH(markers, l, marker)
{
- wd = marker->wd;
-
- if ((!m_min_lon) || (marker->longitude < m_min_lon->longitude))
- m_min_lon = marker;
-
- if ((!m_max_lon) || (marker->longitude > m_max_lon->longitude))
- m_max_lon = marker;
-
- if ((!m_min_lat) || (marker->latitude > m_min_lat->latitude))
- m_min_lat = marker;
-
- if ((!m_max_lat) || (marker->latitude < m_max_lat->latitude))
- m_max_lat = marker;
- }
-
+ wd = marker->wd;
+
+ if ((!m_min_lon) || (marker->longitude < m_min_lon->longitude))
+ m_min_lon = marker;
+
+ if ((!m_max_lon) || (marker->longitude > m_max_lon->longitude))
+ m_max_lon = marker;
+
+ if ((!m_min_lat) || (marker->latitude > m_min_lat->latitude))
+ m_min_lat = marker;
+
+ if ((!m_max_lat) || (marker->latitude < m_max_lat->latitude))
+ m_max_lat = marker;
+ }
+
lon = (m_max_lon->longitude - m_min_lon->longitude) / 2. + m_min_lon->longitude;
lat = (m_max_lat->latitude - m_min_lat->latitude) / 2. + m_min_lat->latitude;
-
+
elm_smart_scroller_child_viewport_size_get(wd->scr, &rw, &rh);
for (zoom = map_sources_tab[wd->source].zoom_max; zoom>map_sources_tab[wd->source].zoom_min; zoom--)
{
- Evas_Coord size = pow(2.0, zoom)*wd->tsize;
- elm_map_utils_convert_geo_into_coord(wd->obj, lon, lat, size, &xc, &yc);
-
- if ((m_min_lon->x[zoom] - wd->marker_max_w >= xc-rw/2)
+ Evas_Coord size = pow(2.0, zoom)*wd->tsize;
+ elm_map_utils_convert_geo_into_coord(wd->obj, lon, lat, size, &xc, &yc);
+
+ if ((m_min_lon->x[zoom] - wd->marker_max_w >= xc-rw/2)
&& (m_min_lat->y[zoom] - wd->marker_max_h >= yc-rh/2)
&& (m_max_lon->x[zoom] + wd->marker_max_w <= xc+rw/2)
&& (m_max_lat->y[zoom] + wd->marker_max_h <= yc+rh/2))
- break;
+ break;
}
elm_map_geo_region_show(wd->obj, lon, lat);
EINA_SAFETY_ON_NULL_RETURN(marker);
if (marker->content)
{
- if (marker->clas->func.del)
- marker->clas->func.del(marker->wd->obj, marker, marker->data, marker->content);
- else
- evas_object_del(marker->content);
- marker->content = NULL;
- _group_bubble_content_update(marker->groups[marker->wd->zoom]);
+ if (marker->clas->func.del)
+ marker->clas->func.del(marker->wd->obj, marker, marker->data, marker->content);
+ else
+ evas_object_del(marker->content);
+ marker->content = NULL;
+ _group_bubble_content_update(marker->groups[marker->wd->zoom]);
}
}
Eina_List *l, *l_next;
if (!wd) return;
EINA_LIST_FOREACH_SAFE(wd->opened_bubbles, l, l_next, group)
- _group_bubble_free(group);
+ _group_bubble_free(group);
}
clas->hide = hide;
if (wd->grids)
{
- Evas_Coord ox, oy, ow, oh;
- evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
- marker_place(obj, eina_list_data_get(wd->grids), wd->pan_x, wd->pan_y, ox, oy, ow, oh);
+ Evas_Coord ox, oy, ow, oh;
+ evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
+ marker_place(obj, eina_list_data_get(wd->grids), wd->pan_x, wd->pan_y, ox, oy, ow, oh);
}
}
wd->source = source;
zoom = wd->zoom;
wd->zoom = -1;
-
+
if (map_sources_tab[wd->source].zoom_max < zoom)
zoom = map_sources_tab[wd->source].zoom_max;
if (map_sources_tab[wd->source].zoom_min > zoom)
zoom = map_sources_tab[wd->source].zoom_min;
-
+
elm_map_zoom_set(obj, zoom);
}
if (!wd) return;
if (!wd->user_agent) wd->user_agent = eina_stringshare_add(user_agent);
else eina_stringshare_replace(&wd->user_agent, user_agent);
-
+
if (!wd->ua) wd->ua = eina_hash_string_small_new(NULL);
eina_hash_set(wd->ua, "User-Agent", wd->user_agent);
}
_osmarender_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom)
{
char buf[PATH_MAX];
- snprintf(buf, sizeof(buf),
+ snprintf(buf, sizeof(buf),
"http://tah.openstreetmap.org/Tiles/tile/%d/%d/%d.png",
zoom, x, y);
return strdup(buf);
_cyclemap_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom)
{
char buf[PATH_MAX];
- snprintf(buf, sizeof(buf),
+ snprintf(buf, sizeof(buf),
"http://andy.sandbox.cloudmade.com/tiles/cycle/%d/%d/%d.png",
zoom, x, y);
return strdup(buf);
_maplint_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom)
{
char buf[PATH_MAX];
- snprintf(buf, sizeof(buf),
+ snprintf(buf, sizeof(buf),
"http://tah.openstreetmap.org/Tiles/maplint/%d/%d/%d.png",
zoom, x, y);
return strdup(buf);
char *buf = NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if (elm_map_source_get(obj) == ELM_MAP_SOURCE_MODULE)
- if ((wd->api) && (wd->api->obj_url_request))
- buf = wd->api->obj_url_request(obj, x, y, zoom);
+ if ((wd->api) && (wd->api->obj_url_request))
+ buf = wd->api->obj_url_request(obj, x, y, zoom);
if (!buf) buf = strdup("");