Ecore_Job *markers_place_job;
Eina_Matrixsparse *markers[19];
- Eina_List *groups_displayed;
+ Eina_List *cells_displayed; // list of Eina_Matrixsparse_Cell
Evas_Coord markers_max_num;
Evas_Coord marker_w, marker_h;
Evas_Coord marker_max_w, marker_max_h;
static void marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh);
static void _bubble_sc_hits_changed_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void
+static void
rect_place(Evas_Object *obj, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh)
{
Widget_Data *wd = elm_widget_data_get(obj);
}
}
-static void
+static void
marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh)
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord ax, ay, gw, gh, tx, ty;
Eina_List *l, *l_next, *markers;
+ Eina_Matrixsparse_Cell *cell;
Marker_Group *group;
int xx, yy, ww, hh;
char buf[PATH_MAX];
if(wd->zoom != wd->marker_zoom)
{
- EINA_LIST_FOREACH_SAFE(wd->groups_displayed, l, l_next, group)
+ EINA_LIST_FREE(wd->cells_displayed, cell)
{
- if(group->obj)
+ EINA_LIST_FOREACH_SAFE(eina_matrixsparse_cell_data_get(cell), l, l_next, group)
{
- _group_object_free(group);
+ if(group->obj)
+ _group_object_free(group);
}
}
}
wd->marker_zoom = wd->zoom;
- //hide groups no more displayed
- EINA_LIST_FOREACH_SAFE(wd->groups_displayed, l, l_next, group)
- {
- xx = group->x;
- yy = group->y;
- ww = group->w;
- hh = group->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->obj &&
- !(xx-px+ax+ox >= ox && xx-px+ax+ox<= ox+ow
- && yy-py+ay+oy >= oy && yy-py+ay+oy<= oy+oh))
- _group_object_free(group);
- }
-
+
g_xx = wd->pan_x / wd->tsize;
if(g_xx < 0) g_xx = 0;
g_hh = oh / wd->tsize + 1;
if(g_yy + g_hh >= g->gh) g_hh = g->gh - g_yy - 1;
+ //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_SAFE(eina_matrixsparse_cell_data_get(cell), l, l_next, 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++)
{
+ 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);
+
if(!wd->markers[wd->zoom])
continue ;
}
}
-static void
+static void
grid_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh)
{
Widget_Data *wd = elm_widget_data_get(obj);
eina_iterator_free(it);
}
-static void
+static void
grid_clear(Evas_Object *obj, Grid *g)
{
Widget_Data *wd = elm_widget_data_get(obj);
g->gh = 0;
}
-static void
+static void
_tile_update(Grid_Item *gi)
{
gi->want = EINA_FALSE;
}
-static void
+static void
_tile_downloaded(void *data, const char *file, int status)
{
Grid_Item *gi = data;
return g;
}
-static void
+static void
grid_load(Evas_Object *obj, Grid *g)
{
Widget_Data *wd = elm_widget_data_get(obj);
}
}
-static void
+static void
grid_clearall(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
}
}
-static void
+static void
_smooth_update(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
}
}
-static void
+static void
_grid_raise(Grid *g)
{
Eina_Iterator *it = eina_matrixsparse_iterator_new(g->grid);
eina_iterator_free(it);
}
-static int
+static int
_scr_timeout(void *data)
{
Widget_Data *wd = elm_widget_data_get(data);
return 0;
}
-static void
+static void
_scr(void *data, Evas_Object *obj, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(data);
wd->scr_timer = ecore_timer_add(0.5, _scr_timeout, data);
}
-static int
+static int
zoom_do(Evas_Object *obj, double t)
{
Widget_Data *wd = elm_widget_data_get(obj);
return 1;
}
-static int
+static int
_zoom_anim(void *data)
{
Evas_Object *obj = data;
return go;
}
-static int
+static int
_long_press(void *data)
{
Widget_Data *wd = elm_widget_data_get(data);
return 0;
}
-static void
+static void
_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(data);
wd->long_timer = ecore_timer_add(1.0, _long_press, data);
}
-static void
+static void
_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(data);
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_NULL;
-static void
+static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
free(wd);
}
-static void
+static void
_del_pre_hook(Evas_Object *obj)
{
Marker_Group *group;
wd->pan_smart = NULL;
}
-static void
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
_sizing_eval(obj);
}
-static void
+static void
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
evas_object_size_hint_max_set(obj, maxw, maxh);
}
-static void
+static void
_calc_job(void *data)
{
Widget_Data *wd = data;
evas_object_smart_changed(wd->pan_smart);
}
-static void
+static void
_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
{
Pan *sd = evas_object_smart_data_get(obj);
evas_object_smart_changed(obj);
}
-static void
+static void
_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
{
Pan *sd = evas_object_smart_data_get(obj);
if (y) *y = sd->wd->pan_y;
}
-static void
+static void
_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
{
Pan *sd = evas_object_smart_data_get(obj);
if (y) *y = oh;
}
-static void
+static void
_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
{
Pan *sd = evas_object_smart_data_get(obj);
if (h) *h = sd->wd->minh;
}
-static void
+static void
_pan_add(Evas_Object *obj)
{
Pan *sd;
evas_object_smart_data_set(obj, sd);
}
-static void
+static void
_pan_del(Evas_Object *obj)
{
Pan *sd = evas_object_smart_data_get(obj);
_pan_sc.del(obj);
}
-static void
+static void
_pan_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
{
Pan *sd = evas_object_smart_data_get(obj);
sd->wd->calc_job = ecore_job_add(_calc_job, sd->wd);
}
-static void
+static void
_pan_calculate(Evas_Object *obj)
{
Pan *sd = evas_object_smart_data_get(obj);
}
}
-static void
+static void
_hold_on(void *data, Evas_Object *obj, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(obj);
elm_smart_scroller_hold_set(wd->scr, 1);
}
-static void
+static void
_hold_off(void *data, Evas_Object *obj, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(obj);
elm_smart_scroller_hold_set(wd->scr, 0);
}
-static void
+static void
_freeze_on(void *data, Evas_Object *obj, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(obj);
elm_smart_scroller_freeze_set(wd->scr, 1);
}
-static void
+static void
_freeze_off(void *data, Evas_Object *obj, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(obj);
elm_smart_scroller_freeze_set(wd->scr, 0);
}
-static void
+static void
_scr_anim_start(void *data, Evas_Object *obj, void *event_info)
{
evas_object_smart_callback_call(data, "scroll,anim,start", NULL);
}
-static void
+static void
_scr_anim_stop(void *data, Evas_Object *obj, void *event_info)
{
evas_object_smart_callback_call(data, "scroll,anim,stop", NULL);
}
-static void
+static void
_scr_drag_start(void *data, Evas_Object *obj, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(data);
evas_object_smart_callback_call(data, "scroll,drag,start", NULL);
}
-static void
+static void
_scr_drag_stop(void *data, Evas_Object *obj, void *event_info)
{
evas_object_smart_callback_call(data, "scroll,drag,stop", NULL);
}
-static void
+static void
_scr_scroll(void *data, Evas_Object *obj, void *event_info)
{
evas_object_smart_callback_call(data, "scroll", NULL);
}
-static void
+static void
_group_object_create(Marker_Group *group)
{
if(group->obj) return ;
if(group->open)
_group_bubble_create(group);
-
- group->wd->groups_displayed = eina_list_append(group->wd->groups_displayed, group);
}
-static void
+static void
_group_object_free(Marker_Group *group)
{
if(!group->obj) return ;
group->obj = NULL;
_group_bubble_free(group);
-
- group->wd->groups_displayed = eina_list_remove(group->wd->groups_displayed, group);
}
-static void
+static void
_group_bubble_mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Marker_Group *group = data;
evas_object_raise(group->rect);
}
-static void
+static void
_group_bubble_create(Marker_Group *group)
{
if(group->bubble) return ;
_group_bubble_place(data);
}
-static void
+static void
_group_bubble_content_update(Marker_Group *group)
{
Eina_List *l;
}
}
-static void
+static void
_group_bubble_content_free(Marker_Group *group)
{
Eina_List *l;
group->sc = NULL;
}
-static void
+static void
_group_bubble_free(Marker_Group *group)
{
if(!group->bubble) return ;
_group_bubble_content_free(group);
}
-static void
+static void
_group_bubble_place(Marker_Group *group)
{
Evas_Coord x, y, w;
evas_object_show(group->rect);
}
-static void
+static void
_group_bringin_cb(void *data, Evas_Object *obj, const char *emission, const char *soure)
{
Marker_Group *group = data;
elm_map_geo_region_bring_in(group->wd->obj, marker->longitude, marker->latitude);
}
-static void
+static void
_group_open_cb(void *data, Evas_Object *obj, const char *emission, const char *soure)
{
Marker_Group *group = data;
tabi[1] = tabi[4] = tabi[6] = -1;
tabi[2] = tabi[0] = tabi[7] = 0;
tabi[3] = tabi[5] = tabi[8] = 1;
-
+
tabj[1] = tabj[2] = tabj[3] = -1;
tabj[4] = tabj[0] = tabj[5] = 0;
tabj[6] = tabj[7] = tabj[8] = 1;
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]),
+ EINA_LIST_FOREACH(eina_matrixsparse_data_idx_get(wd->markers[i], mpj + tabj[j], mpi + tabi[j]),
l, group)
{
if(ELM_RECTS_INTERSECT( marker->x[i]-sizew/4, marker->y[i]-sizeh/4, sizew, sizeh,
*
* @param marker The marker.
*/
-EAPI void
+EAPI void
elm_map_marker_update(Elm_Map_Marker *marker)
{
if(marker->content)