summaryrefslogtreecommitdiff
path: root/legacy/elementary
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2012-03-23 01:29:32 +0000
committerDaniel Juyung Seo <seojuyung2@gmail.com>2012-03-23 01:29:32 +0000
commita40e45f37cec0cdb358105b6c42f275e0a81d2e5 (patch)
tree7bd9a2c247258d83061739331b158b89c692c913 /legacy/elementary
parent36ebfc9972e31a64ed07eff5a067997bbf12e484 (diff)
elm map: Removed unused codes. Patch by Bluezery <ohpowel@gmail.com>
On Thu, Mar 22, 2012 at 9:38 PM, Bluezery <ohpowel@gmail.com> wrote: > Hello, > > Now, Elm_Map_Marker, Elm_Map_Marker_Class, Elm_Map_Group_Class, > Marker_Bubble are not used anymore.  So I removed all things related > those in elm_map. > Please review this patch. > Thanks > SVN revision: 69571
Diffstat (limited to 'legacy/elementary')
-rw-r--r--legacy/elementary/src/lib/elm_map.c562
1 files changed, 10 insertions, 552 deletions
diff --git a/legacy/elementary/src/lib/elm_map.c b/legacy/elementary/src/lib/elm_map.c
index 442cc3b22a..84cb38451d 100644
--- a/legacy/elementary/src/lib/elm_map.c
+++ b/legacy/elementary/src/lib/elm_map.c
@@ -26,8 +26,6 @@ typedef struct _Overlay_Line Overlay_Line;
26typedef struct _Overlay_Polygon Overlay_Polygon; 26typedef struct _Overlay_Polygon Overlay_Polygon;
27typedef struct _Overlay_Circle Overlay_Circle; 27typedef struct _Overlay_Circle Overlay_Circle;
28typedef struct _Overlay_Scale Overlay_Scale; 28typedef struct _Overlay_Scale Overlay_Scale;
29typedef struct _Marker_Group Marker_Group;
30typedef struct _Marker_Bubble Marker_Bubble;
31typedef struct _Path_Node Path_Node; 29typedef struct _Path_Node Path_Node;
32typedef struct _Path_Waypoint Path_Waypoint; 30typedef struct _Path_Waypoint Path_Waypoint;
33typedef struct _Route_Dump Route_Dump; 31typedef struct _Route_Dump Route_Dump;
@@ -116,11 +114,9 @@ struct _Delayed_Data
116 Elm_Map_Zoom_Mode mode; 114 Elm_Map_Zoom_Mode mode;
117 int zoom; 115 int zoom;
118 double lon, lat; 116 double lon, lat;
119 Eina_List *markers;
120 Eina_List *overlays; 117 Eina_List *overlays;
121}; 118};
122 119
123// Map Tile source
124// FIXME: Currently tile size must be 256*256 120// FIXME: Currently tile size must be 256*256
125// and the map size is pow(2.0, z) * (tile size) 121// and the map size is pow(2.0, z) * (tile size)
126struct _Source_Tile 122struct _Source_Tile
@@ -134,14 +130,12 @@ struct _Source_Tile
134 Elm_Map_Module_Tile_Scale_Func scale_cb; 130 Elm_Map_Module_Tile_Scale_Func scale_cb;
135}; 131};
136 132
137// Map Route Source
138struct _Source_Route 133struct _Source_Route
139{ 134{
140 const char *name; 135 const char *name;
141 Elm_Map_Module_Route_Url_Func url_cb; 136 Elm_Map_Module_Route_Url_Func url_cb;
142}; 137};
143 138
144// Map Name Source
145struct _Source_Name 139struct _Source_Name
146{ 140{
147 const char *name; 141 const char *name;
@@ -261,73 +255,6 @@ struct _Elm_Map_Overlay
261 Overlay_Group *grp; 255 Overlay_Group *grp;
262}; 256};
263 257
264struct _Elm_Map_Marker_Class
265{
266 const char *style;
267 struct _Elm_Map_Marker_Class_Func
268 {
269 Elm_Map_Marker_Get_Func get;
270 Elm_Map_Marker_Del_Func del; //if NULL the object will be destroyed with evas_object_del()
271 Elm_Map_Marker_Icon_Get_Func icon_get;
272 } func;
273};
274
275struct _Elm_Map_Group_Class
276{
277 Widget_Data *wd;
278
279 Eina_List *markers;
280 int zoom_displayed; // display the group if the zoom is >= to zoom_display
281 int zoom_grouped; // group the markers only if the zoom is <= to zoom_groups
282 const char *style;
283 void *data;
284 struct
285 {
286 Elm_Map_Group_Icon_Get_Func icon_get;
287 } func;
288
289 Eina_Bool hide : 1;
290};
291
292struct _Marker_Bubble
293{
294 Widget_Data *wd;
295 Evas_Object *pobj;
296 Evas_Object *obj, *sc, *bx;
297};
298
299struct _Elm_Map_Marker
300{
301 Widget_Data *wd;
302 Elm_Map_Marker_Class *clas;
303 Elm_Map_Group_Class *group_clas;
304 double longitude, latitude;
305 Evas_Coord w, h;
306 Evas_Object *obj;
307
308 Evas_Coord x, y;
309 Eina_Bool grouped : 1;
310 Eina_Bool leader : 1; // if marker is group leader
311 Marker_Group *group;
312
313 Marker_Bubble *bubble;
314 Evas_Object *content;
315 void *data;
316};
317
318struct _Marker_Group
319{
320 Widget_Data *wd;
321 Elm_Map_Group_Class *clas;
322 Evas_Coord w, h;
323 Evas_Object *obj;
324
325 Evas_Coord x, y;
326 Eina_List *markers;
327
328 Marker_Bubble *bubble;
329};
330
331struct _Elm_Map_Route 258struct _Elm_Map_Route
332{ 259{
333 Widget_Data *wd; 260 Widget_Data *wd;
@@ -440,7 +367,7 @@ struct _Widget_Data
440 Evas_Object *scr; 367 Evas_Object *scr;
441 Evas_Object *ges; 368 Evas_Object *ges;
442 Evas_Object *pan_smart; 369 Evas_Object *pan_smart;
443 Evas_Object *sep_maps_markers; // Tiles are below this and overlays are on top 370 Evas_Object *sep_maps_overlays; // Tiles are below this and overlays are on top
444 Evas_Map *map; 371 Evas_Map *map;
445 372
446 Eina_Array *src_tile_mods; 373 Eina_Array *src_tile_mods;
@@ -466,8 +393,6 @@ struct _Widget_Data
466 393
467 int zoom; 394 int zoom;
468 double zoom_detail; 395 double zoom_detail;
469 double prev_lon, prev_lat;
470 Evas_Coord ox, oy;
471 struct 396 struct
472 { 397 {
473 int w, h; // Current pixel width, heigth of a grid 398 int w, h; // Current pixel width, heigth of a grid
@@ -509,12 +434,6 @@ struct _Widget_Data
509 434
510 Eina_Bool wheel_disabled : 1; 435 Eina_Bool wheel_disabled : 1;
511 436
512 unsigned int markers_max_num;
513 Eina_Bool paused_markers : 1;
514 Eina_List *group_classes;
515 Eina_List *marker_classes;
516 Eina_List *markers;
517
518 Eina_List *routes; 437 Eina_List *routes;
519 Eina_List *track; 438 Eina_List *track;
520 Eina_List *names; 439 Eina_List *names;
@@ -627,7 +546,7 @@ static const Evas_Smart_Cb_Description _signals[] = {
627}; 546};
628 547
629static void 548static void
630_edj_marker_size_get(Widget_Data *wd, Evas_Coord *w, Evas_Coord *h) 549_edj_overlay_size_get(Widget_Data *wd, Evas_Coord *w, Evas_Coord *h)
631{ 550{
632 EINA_SAFETY_ON_NULL_RETURN(wd); 551 EINA_SAFETY_ON_NULL_RETURN(wd);
633 EINA_SAFETY_ON_NULL_RETURN(w); 552 EINA_SAFETY_ON_NULL_RETURN(w);
@@ -789,419 +708,6 @@ _region_show(void *data)
789} 708}
790 709
791static void 710static void
792_bubble_update(Marker_Bubble *bubble, Eina_List *contents)
793{
794 EINA_SAFETY_ON_NULL_RETURN(bubble);
795 EINA_SAFETY_ON_NULL_RETURN(contents);
796
797 Eina_List *l;
798 Evas_Object *c;
799
800 elm_box_clear(bubble->bx);
801 EINA_LIST_FOREACH(contents, l, c) elm_box_pack_end(bubble->bx, c);
802}
803
804static void
805_bubble_place(Marker_Bubble *bubble)
806{
807 EINA_SAFETY_ON_NULL_RETURN(bubble);
808
809 Evas_Coord x, y, w, h;
810 Evas_Coord xx, yy, ww, hh;
811 const char *s;
812
813 if ((!bubble->obj) || (!bubble->pobj)) return;
814 evas_object_geometry_get(bubble->pobj, &x, &y, &w, NULL);
815
816 s = edje_object_data_get(bubble->obj, "size_w");
817 if (s) ww = atoi(s);
818 else ww = 0;
819
820 edje_object_size_min_calc(bubble->obj, NULL, &hh);
821 s = edje_object_data_get(bubble->obj, "size_h");
822 if (s) h = atoi(s);
823 else h = 0;
824 if (hh < h) hh = h;
825
826 xx = x + (w / 2) - (ww / 2);
827 yy = y - hh;
828
829 _obj_place(bubble->obj, xx, yy, ww, hh);
830 evas_object_raise(bubble->obj);
831}
832
833static void
834_bubble_sc_hints_changed_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
835{
836 Marker_Bubble *bubble = data;
837 EINA_SAFETY_ON_NULL_RETURN(bubble);
838 _bubble_place(data);
839}
840
841static void
842_bubble_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
843{
844 Marker_Bubble *bubble = data;
845 EINA_SAFETY_ON_NULL_RETURN(bubble);
846 _bubble_place(bubble);
847}
848
849static void
850_bubble_hide_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
851{
852 Marker_Bubble *bubble = data;
853 EINA_SAFETY_ON_NULL_RETURN(bubble);
854 evas_object_hide(bubble->obj);
855}
856
857static void
858_bubble_show_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
859{
860 Marker_Bubble *bubble = data;
861 EINA_SAFETY_ON_NULL_RETURN(bubble);
862 _bubble_place(bubble);
863}
864
865static void
866_bubble_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
867{
868 Marker_Bubble *bubble = data;
869 EINA_SAFETY_ON_NULL_RETURN(bubble);
870 _bubble_place(bubble);
871}
872
873static void
874_bubble_free(Marker_Bubble* bubble)
875{
876 EINA_SAFETY_ON_NULL_RETURN(bubble);
877
878 evas_object_del(bubble->bx);
879 evas_object_del(bubble->sc);
880 evas_object_del(bubble->obj);
881 free(bubble);
882}
883
884static Marker_Bubble*
885_bubble_create(Evas_Object *pobj, Widget_Data *wd)
886{
887 EINA_SAFETY_ON_NULL_RETURN_VAL(pobj, NULL);
888 EINA_SAFETY_ON_NULL_RETURN_VAL(wd, NULL);
889
890 Marker_Bubble *bubble = ELM_NEW(Marker_Bubble);
891 EINA_SAFETY_ON_NULL_RETURN_VAL(bubble, NULL);
892
893 bubble->wd = wd;
894 bubble->pobj = pobj;
895 evas_object_event_callback_add(pobj, EVAS_CALLBACK_HIDE, _bubble_hide_cb,
896 bubble);
897 evas_object_event_callback_add(pobj, EVAS_CALLBACK_SHOW, _bubble_show_cb,
898 bubble);
899 evas_object_event_callback_add(pobj, EVAS_CALLBACK_MOVE, _bubble_move_cb,
900 bubble);
901
902 bubble->obj = edje_object_add(evas_object_evas_get(pobj));
903 _elm_theme_object_set(wd->obj, bubble->obj , "map", "marker_bubble",
904 elm_widget_style_get(wd->obj));
905 evas_object_event_callback_add(bubble->obj, EVAS_CALLBACK_MOUSE_UP,
906 _bubble_mouse_up_cb, bubble);
907
908 bubble->sc = elm_scroller_add(bubble->obj);
909 elm_widget_style_set(bubble->sc, "map_bubble");
910 elm_scroller_content_min_limit(bubble->sc, EINA_FALSE, EINA_TRUE);
911 elm_scroller_policy_set(bubble->sc, ELM_SCROLLER_POLICY_AUTO,
912 ELM_SCROLLER_POLICY_OFF);
913 elm_scroller_bounce_set(bubble->sc, _elm_config->thumbscroll_bounce_enable,
914 EINA_FALSE);
915 edje_object_part_swallow(bubble->obj, "elm.swallow.content", bubble->sc);
916 evas_object_event_callback_add(bubble->sc, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
917 _bubble_sc_hints_changed_cb, bubble);
918
919 bubble->bx = elm_box_add(bubble->sc);
920 evas_object_size_hint_align_set(bubble->bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
921 evas_object_size_hint_weight_set(bubble->bx, EVAS_HINT_EXPAND,
922 EVAS_HINT_EXPAND);
923 elm_box_horizontal_set(bubble->bx, EINA_TRUE);
924 elm_object_content_set(bubble->sc, bubble->bx);
925
926 return bubble;
927}
928
929static void
930_marker_group_update(Marker_Group* group, Elm_Map_Group_Class *clas, Eina_List *markers)
931{
932 EINA_SAFETY_ON_NULL_RETURN(group);
933 EINA_SAFETY_ON_NULL_RETURN(clas);
934 EINA_SAFETY_ON_NULL_RETURN(markers);
935 Widget_Data *wd = clas->wd;
936 EINA_SAFETY_ON_NULL_RETURN(wd);
937
938 char buf[PATH_MAX];
939 Eina_List *l;
940 Elm_Map_Marker *marker;
941 int cnt = 0;
942 int sum_x = 0, sum_y = 0;
943
944 EINA_LIST_FOREACH(markers, l, marker)
945 {
946 sum_x += marker->x;
947 sum_y += marker->y;
948 cnt++;
949 }
950
951 group->x = sum_x / cnt;
952 group->y = sum_y / cnt;
953 _edj_marker_size_get(wd, &group->w, &group->h);
954 group->w *=2;
955 group->h *=2;
956 group->clas = clas;
957 group->markers = markers;
958
959 if (clas->style) elm_layout_theme_set(group->obj, "map/marker", clas->style,
960 elm_widget_style_get(wd->obj));
961 else elm_layout_theme_set(group->obj, "map/marker", "radio",
962 elm_widget_style_get(wd->obj));
963
964
965 if (clas->func.icon_get)
966 {
967 Evas_Object *icon = NULL;
968
969 icon = elm_object_part_content_get(group->obj, "elm.icon");
970 if (icon) evas_object_del(icon);
971
972 icon = clas->func.icon_get(wd->obj, clas->data);
973 elm_object_part_content_set(group->obj, "elm.icon", icon);
974 }
975 snprintf(buf, sizeof(buf), "%d", cnt);
976 edje_object_part_text_set(elm_layout_edje_get(group->obj), "elm.text", buf);
977
978 if (group->bubble)
979 {
980 Eina_List *contents = NULL;
981
982 EINA_LIST_FOREACH(group->markers, l, marker)
983 {
984 Evas_Object *c = marker->clas->func.get(marker->wd->obj,
985 marker, marker->data);
986 if (c) contents = eina_list_append(contents, c);
987 }
988 _bubble_update(group->bubble, contents);
989 }
990}
991
992static void
993_marker_group_bubble_open_cb(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *soure __UNUSED__)
994{
995 EINA_SAFETY_ON_NULL_RETURN(data);
996 Marker_Group *group = data;
997 Eina_List *l;
998 Elm_Map_Marker *marker;
999 Eina_List *contents = NULL;
1000
1001 if (!group->bubble) group->bubble = _bubble_create(group->obj, group->wd);
1002
1003 EINA_LIST_FOREACH(group->markers, l, marker)
1004 {
1005 if (group->wd->markers_max_num <= eina_list_count(contents)) break;
1006 Evas_Object *c = marker->clas->func.get(marker->wd->obj,
1007 marker, marker->data);
1008 if (c) contents = eina_list_append(contents, c);
1009 }
1010 _bubble_update(group->bubble, contents);
1011 _bubble_place(group->bubble);
1012}
1013
1014static void
1015_marker_group_bringin_cb(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *soure __UNUSED__)
1016{
1017 EINA_SAFETY_ON_NULL_RETURN(data);
1018
1019 double lon, lat;
1020 Marker_Group *group = data;
1021 _coord_to_region_convert(group->wd, group->x, group->y, group->wd->size.w,
1022 &lon, &lat);
1023 elm_map_region_bring_in(group->wd->obj, lon, lat);
1024}
1025
1026static void
1027_marker_group_free(Marker_Group* group)
1028{
1029 EINA_SAFETY_ON_NULL_RETURN(group);
1030
1031 if (group->bubble) _bubble_free(group->bubble);
1032
1033 eina_list_free(group->markers);
1034 evas_object_del(group->obj);
1035
1036 free(group);
1037}
1038
1039static Marker_Group*
1040_marker_group_create(Widget_Data *wd)
1041{
1042 EINA_SAFETY_ON_NULL_RETURN_VAL(wd, NULL);
1043
1044 Marker_Group *group = ELM_NEW(Marker_Group);
1045
1046 group->wd = wd;
1047 group->obj = elm_layout_add(wd->obj);
1048 evas_object_smart_member_add(group->obj, wd->pan_smart);
1049 evas_object_stack_above(group->obj, wd->sep_maps_markers);
1050 elm_layout_theme_set(group->obj, "map/marker", "radio",
1051 elm_widget_style_get(wd->obj));
1052 edje_object_signal_callback_add(elm_layout_edje_get(group->obj),
1053 "open", "elm", _marker_group_bubble_open_cb,
1054 group);
1055 edje_object_signal_callback_add(elm_layout_edje_get(group->obj),
1056 "bringin", "elm", _marker_group_bringin_cb,
1057 group);
1058 return group;
1059}
1060
1061static void
1062_marker_update(Elm_Map_Marker *marker)
1063{
1064 EINA_SAFETY_ON_NULL_RETURN(marker);
1065 Elm_Map_Marker_Class *clas = marker->clas;
1066 EINA_SAFETY_ON_NULL_RETURN(clas);
1067
1068 if (clas->style) elm_layout_theme_set(marker->obj, "map/marker", clas->style,
1069 elm_widget_style_get(marker->wd->obj));
1070 else elm_layout_theme_set(marker->obj, "map/marker", "radio",
1071 elm_widget_style_get(marker->wd->obj));
1072
1073 if (clas->func.icon_get)
1074 {
1075 Evas_Object *icon = NULL;
1076
1077 icon = elm_object_part_content_get(marker->obj, "elm.icon");
1078 if (icon) evas_object_del(icon);
1079
1080 icon = clas->func.icon_get(marker->wd->obj, marker, marker->data);
1081 elm_object_part_content_set(marker->obj, "elm.icon", icon);
1082 }
1083 _region_to_coord_convert(marker->wd, marker->longitude, marker->latitude,
1084 marker->wd->size.w, &(marker->x), &(marker->y));
1085
1086 if (marker->bubble)
1087 {
1088 if (marker->content) evas_object_del(marker->content);
1089 if (marker->clas->func.get)
1090 marker->content = marker->clas->func.get(marker->wd->obj, marker,
1091 marker->data);
1092 if (marker->content)
1093 {
1094 Eina_List *contents = NULL;
1095 contents = eina_list_append(contents, marker->content);
1096 _bubble_update(marker->bubble, contents);
1097 }
1098 }
1099}
1100
1101
1102
1103static void
1104_marker_place(Widget_Data *wd)
1105{
1106 EINA_SAFETY_ON_NULL_RETURN(wd);
1107
1108 Eina_List *l;
1109
1110 Elm_Map_Marker *marker;
1111 Elm_Map_Group_Class *group_clas;
1112
1113 Evas_Coord gw, gh;
1114
1115 if (wd->paused_markers || (!eina_list_count(wd->markers))) return;
1116
1117 _edj_marker_size_get(wd, &gw, &gh);
1118 gw *= 2;
1119 gh *= 2;
1120
1121 EINA_LIST_FOREACH(wd->markers, l, marker)
1122 {
1123 _marker_update(marker);
1124 marker->grouped = EINA_FALSE;
1125 marker->leader = EINA_FALSE;
1126 }
1127
1128 EINA_LIST_FOREACH(wd->group_classes, l, group_clas)
1129 {
1130 Eina_List *ll;
1131 EINA_LIST_FOREACH(group_clas->markers, ll, marker)
1132 {
1133 Eina_List *lll;
1134 Elm_Map_Marker *mm;
1135 Eina_List *markers = NULL;
1136
1137 if (marker->grouped) continue;
1138 if (group_clas->zoom_grouped < wd->zoom)
1139 {
1140 marker->grouped = EINA_FALSE;
1141 continue;
1142 }
1143
1144 EINA_LIST_FOREACH(group_clas->markers, lll, mm)
1145 {
1146 if (marker == mm || mm->grouped) continue;
1147 if (ELM_RECTS_INTERSECT(mm->x, mm->y, mm->w, mm->h,
1148 marker->x, marker->y, gw, gh))
1149 {
1150 // mm is group follower.
1151 mm->leader = EINA_FALSE;
1152 mm->grouped = EINA_TRUE;
1153 markers = eina_list_append(markers, mm);
1154 }
1155 }
1156 if (eina_list_count(markers) >= 1)
1157 {
1158 // marker is group leader.
1159 marker->leader = EINA_TRUE;
1160 marker->grouped = EINA_TRUE;
1161 markers = eina_list_append(markers, marker);
1162
1163 if (!marker->group) marker->group = _marker_group_create(wd);
1164 _marker_group_update(marker->group, group_clas, markers);
1165 }
1166 }
1167 }
1168
1169 EINA_LIST_FOREACH(wd->markers, l, marker)
1170 {
1171
1172 if (marker->grouped ||
1173 (marker->group_clas &&
1174 (marker->group_clas->hide ||
1175 marker->group_clas->zoom_displayed > wd->zoom)))
1176 evas_object_hide(marker->obj);
1177 else
1178 {
1179 Evas_Coord x, y;
1180 _coord_to_canvas(wd, marker->x, marker->y, &x, &y);
1181 _obj_place(marker->obj, x - (marker->w / 2), y - (marker->h / 2),
1182 marker->w, marker->h);
1183 }
1184 }
1185
1186 EINA_LIST_FOREACH(wd->markers, l, marker)
1187 {
1188 Marker_Group *group = marker->group;
1189 if (!group) continue;
1190
1191 if (!marker->leader || (group->clas->hide) ||
1192 (group->clas->zoom_displayed > wd->zoom))
1193 evas_object_hide(group->obj);
1194 else
1195 {
1196 Evas_Coord x, y;
1197 _coord_to_canvas(wd, group->x, group->y, &x, &y);
1198 _obj_place(group->obj, x - (group->w / 2), y - (group->h / 2),
1199 group->w, group->h);
1200 }
1201 }
1202}
1203
1204static void
1205_grid_item_coord_get(Grid_Item *gi, int *x, int *y, int *w, int *h) 711_grid_item_coord_get(Grid_Item *gi, int *x, int *y, int *w, int *h)
1206{ 712{
1207 EINA_SAFETY_ON_NULL_RETURN(gi); 713 EINA_SAFETY_ON_NULL_RETURN(gi);
@@ -1307,7 +813,7 @@ _grid_item_create(Grid *g, Evas_Coord x, Evas_Coord y)
1307 evas_object_image_filled_set(gi->img, EINA_TRUE); 813 evas_object_image_filled_set(gi->img, EINA_TRUE);
1308 evas_object_smart_member_add(gi->img, g->wd->pan_smart); 814 evas_object_smart_member_add(gi->img, g->wd->pan_smart);
1309 evas_object_pass_events_set(gi->img, EINA_TRUE); 815 evas_object_pass_events_set(gi->img, EINA_TRUE);
1310 evas_object_stack_below(gi->img, g->wd->sep_maps_markers); 816 evas_object_stack_below(gi->img, g->wd->sep_maps_overlays);
1311 817
1312 snprintf(buf, sizeof(buf), CACHE_TILE_ROOT, g->wd->id, g->zoom, x); 818 snprintf(buf, sizeof(buf), CACHE_TILE_ROOT, g->wd->id, g->zoom, x);
1313 snprintf(buf2, sizeof(buf2), CACHE_TILE_PATH, buf, y); 819 snprintf(buf2, sizeof(buf2), CACHE_TILE_PATH, buf, y);
@@ -2103,12 +1609,12 @@ _overlay_default_new(Elm_Map_Overlay *overlay, double lon, double lat, Color c,
2103 1609
2104 Overlay_Default *ovl = ELM_NEW(Overlay_Default); 1610 Overlay_Default *ovl = ELM_NEW(Overlay_Default);
2105 ovl->wd = overlay->wd; 1611 ovl->wd = overlay->wd;
2106 _edj_marker_size_get(ovl->wd, &(ovl->w), &(ovl->h)); 1612 _edj_overlay_size_get(ovl->wd, &(ovl->w), &(ovl->h));
2107 ovl->w *= scale; 1613 ovl->w *= scale;
2108 ovl->h *= scale; 1614 ovl->h *= scale;
2109 ovl->layout = elm_layout_add(ovl->wd->obj); 1615 ovl->layout = elm_layout_add(ovl->wd->obj);
2110 evas_object_smart_member_add(ovl->layout, ovl->wd->pan_smart); 1616 evas_object_smart_member_add(ovl->layout, ovl->wd->pan_smart);
2111 evas_object_stack_above(ovl->layout, ovl->wd->sep_maps_markers); 1617 evas_object_stack_above(ovl->layout, ovl->wd->sep_maps_overlays);
2112 elm_layout_theme_set(ovl->layout, "map/marker", "radio", 1618 elm_layout_theme_set(ovl->layout, "map/marker", "radio",
2113 elm_widget_style_get(ovl->wd->obj)); 1619 elm_widget_style_get(ovl->wd->obj));
2114 evas_object_event_callback_add(ovl->layout, EVAS_CALLBACK_MOUSE_DOWN, 1620 evas_object_event_callback_add(ovl->layout, EVAS_CALLBACK_MOUSE_DOWN,
@@ -2722,7 +2228,7 @@ _overlay_circle_new(Widget_Data *wd, double lon, double lat, double radius, Colo
2722 2228
2723 ovl->obj = elm_layout_add(wd->obj); 2229 ovl->obj = elm_layout_add(wd->obj);
2724 evas_object_smart_member_add(ovl->obj, wd->pan_smart); 2230 evas_object_smart_member_add(ovl->obj, wd->pan_smart);
2725 evas_object_stack_above(ovl->obj, wd->sep_maps_markers); 2231 evas_object_stack_above(ovl->obj, wd->sep_maps_overlays);
2726 elm_layout_theme_set(ovl->obj, "map/circle", "base", 2232 elm_layout_theme_set(ovl->obj, "map/circle", "base",
2727 elm_widget_style_get(wd->obj)); 2233 elm_widget_style_get(wd->obj));
2728 _overlay_circle_color_update(ovl, c); 2234 _overlay_circle_color_update(ovl, c);
@@ -2794,7 +2300,7 @@ _overlay_scale_new(Widget_Data *wd, Evas_Coord x, Evas_Coord y, Color c)
2794 2300
2795 ovl->obj = elm_layout_add(wd->obj); 2301 ovl->obj = elm_layout_add(wd->obj);
2796 evas_object_smart_member_add(ovl->obj, wd->pan_smart); 2302 evas_object_smart_member_add(ovl->obj, wd->pan_smart);
2797 evas_object_stack_above(ovl->obj, wd->sep_maps_markers); 2303 evas_object_stack_above(ovl->obj, wd->sep_maps_overlays);
2798 elm_layout_theme_set(ovl->obj, "map/scale", "base", 2304 elm_layout_theme_set(ovl->obj, "map/scale", "base",
2799 elm_widget_style_get(wd->obj)); 2305 elm_widget_style_get(wd->obj));
2800 s = edje_object_data_get(elm_layout_edje_get(ovl->obj), "size_w"); 2306 s = edje_object_data_get(elm_layout_edje_get(ovl->obj), "size_w");
@@ -3114,7 +2620,6 @@ _pan_calculate(Evas_Object *obj)
3114 if (w <= 0 || h <= 0) return; 2620 if (w <= 0 || h <= 0) return;
3115 2621
3116 _grid_place(sd->wd); 2622 _grid_place(sd->wd);
3117 _marker_place(sd->wd);
3118 _overlay_place(sd->wd); 2623 _overlay_place(sd->wd);
3119 _track_place(sd->wd); 2624 _track_place(sd->wd);
3120 _delayed_do(sd->wd); 2625 _delayed_do(sd->wd);
@@ -3159,33 +2664,6 @@ _freeze_off(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__
3159 elm_smart_scroller_freeze_set(wd->scr, 0); 2664 elm_smart_scroller_freeze_set(wd->scr, 0);
3160} 2665}
3161 2666
3162static void
3163_elm_map_marker_remove(Elm_Map_Marker *marker)
3164{
3165#ifdef HAVE_ELEMENTARY_ECORE_CON
3166 EINA_SAFETY_ON_NULL_RETURN(marker);
3167 Widget_Data *wd = marker->wd;
3168 EINA_SAFETY_ON_NULL_RETURN(wd);
3169
3170 if ((marker->content) && (marker->clas->func.del))
3171 marker->clas->func.del(wd->obj, marker, marker->data, marker->content);
3172
3173 if (marker->bubble) _bubble_free(marker->bubble);
3174 if (marker->group) _marker_group_free(marker->group);
3175
3176 if (marker->group_clas)
3177 marker->group_clas->markers = eina_list_remove(marker->group_clas->markers, marker);
3178 wd->markers = eina_list_remove(wd->markers, marker);
3179
3180 evas_object_del(marker->obj);
3181 free(marker);
3182
3183 evas_object_smart_changed(wd->pan_smart);
3184#else
3185 (void) marker;
3186#endif
3187}
3188
3189static Eina_Bool 2667static Eina_Bool
3190cb_dump_name_attrs(void *data, const char *key, const char *value) 2668cb_dump_name_attrs(void *data, const char *key, const char *value)
3191{ 2669{
@@ -4254,9 +3732,6 @@ _del_pre_hook(Evas_Object *obj)
4254 Elm_Map_Route *r; 3732 Elm_Map_Route *r;
4255 Elm_Map_Name *na; 3733 Elm_Map_Name *na;
4256 Evas_Object *track; 3734 Evas_Object *track;
4257 Elm_Map_Marker *marker;
4258 Elm_Map_Group_Class *group_clas;
4259 Elm_Map_Marker_Class *clas;
4260 Elm_Map_Overlay *overlay; 3735 Elm_Map_Overlay *overlay;
4261 Delayed_Data *dd; 3736 Delayed_Data *dd;
4262 3737
@@ -4272,22 +3747,6 @@ _del_pre_hook(Evas_Object *obj)
4272 3747
4273 EINA_LIST_FREE(wd->track, track) evas_object_del(track); 3748 EINA_LIST_FREE(wd->track, track) evas_object_del(track);
4274 3749
4275 EINA_LIST_FOREACH_SAFE(wd->markers, l, ll, marker)
4276 _elm_map_marker_remove(marker);
4277 eina_list_free(wd->markers);
4278
4279 EINA_LIST_FREE(wd->group_classes, group_clas)
4280 {
4281 eina_list_free(group_clas->markers);
4282 if (group_clas->style) eina_stringshare_del(group_clas->style);
4283 free(group_clas);
4284 }
4285 EINA_LIST_FREE(wd->marker_classes, clas)
4286 {
4287 if (clas->style) eina_stringshare_del(clas->style);
4288 free(clas);
4289 }
4290
4291 if (wd->scr_timer) ecore_timer_del(wd->scr_timer); 3750 if (wd->scr_timer) ecore_timer_del(wd->scr_timer);
4292 if (wd->long_timer) ecore_timer_del(wd->long_timer); 3751 if (wd->long_timer) ecore_timer_del(wd->long_timer);
4293 3752
@@ -4480,9 +3939,9 @@ elm_map_add(Evas_Object *parent)
4480 elm_gesture_layer_cb_set(wd->ges, ELM_GESTURE_ROTATE, ELM_GESTURE_STATE_ABORT, 3939 elm_gesture_layer_cb_set(wd->ges, ELM_GESTURE_ROTATE, ELM_GESTURE_STATE_ABORT,
4481 _pinch_rotate_end_cb, wd); 3940 _pinch_rotate_end_cb, wd);
4482 3941
4483 wd->sep_maps_markers = evas_object_rectangle_add(evas_object_evas_get(obj)); 3942 wd->sep_maps_overlays = evas_object_rectangle_add(evas_object_evas_get(obj));
4484 elm_widget_sub_object_add(obj, wd->sep_maps_markers); 3943 elm_widget_sub_object_add(obj, wd->sep_maps_overlays);
4485 evas_object_smart_member_add(wd->sep_maps_markers, wd->pan_smart); 3944 evas_object_smart_member_add(wd->sep_maps_overlays, wd->pan_smart);
4486 3945
4487 wd->map = evas_map_new(EVAS_MAP_POINT); 3946 wd->map = evas_map_new(EVAS_MAP_POINT);
4488 3947
@@ -4501,7 +3960,6 @@ elm_map_add(Evas_Object *parent)
4501 zoom_do(wd, 0); 3960 zoom_do(wd, 0);
4502 3961
4503 wd->mode = ELM_MAP_ZOOM_MODE_MANUAL; 3962 wd->mode = ELM_MAP_ZOOM_MODE_MANUAL;
4504 wd->markers_max_num = MARER_MAX_NUMBER;
4505 3963
4506 // TODO: convert Elementary to subclassing of Evas_Smart_Class 3964 // TODO: convert Elementary to subclassing of Evas_Smart_Class
4507 // TODO: and save some bytes, making descriptions per-class and not instance! 3965 // TODO: and save some bytes, making descriptions per-class and not instance!