summaryrefslogtreecommitdiff
path: root/src/modules/test_map
diff options
context:
space:
mode:
authorSangho Park <gouache95@gmail.com>2011-05-04 09:44:53 +0000
committerSangho Park <gouache95@gmail.com>2011-05-04 09:44:53 +0000
commit3f4c095af814c6d61ac4c7043f219e45792787d9 (patch)
tree467dad42453264611b0f4cbe538f56f42bfb8f4c /src/modules/test_map
parent2ad65b8fc2121ee44213432e507f3f886d09eabe (diff)
Elementary map: elm_map source patch
i removed all custom enum & url callback of elm_map. (ELM_MAP_SOURCE_CUSTOM_1, ELM_MAP_SOURCE_CUSTOM_2, ..., _custom1_url_cb, _custom2_url_cb, ... etc) instead of those, i made sources list. changed APIs are almost internal APIs... but some APIs were changed for intuitive usage of map source. user can make map module instead of setting custom APIs. another change is "elm_module -> eina_module". the reason of this change, is that elm_module uses environment value (i.e getenv, setenv.. ELM_MODULES) i don't want to have a environment value dependency. SVN revision: 59184
Diffstat (limited to 'src/modules/test_map')
-rw-r--r--src/modules/test_map/mod.c65
1 files changed, 46 insertions, 19 deletions
diff --git a/src/modules/test_map/mod.c b/src/modules/test_map/mod.c
index e133cb023..8466aa316 100644
--- a/src/modules/test_map/mod.c
+++ b/src/modules/test_map/mod.c
@@ -1,50 +1,77 @@
1#include <Elementary.h> 1#include "Elementary.h"
2#include <Eina.h>
2#ifdef HAVE_CONFIG_H 3#ifdef HAVE_CONFIG_H
3# include "elementary_config.h" 4# include "elementary_config.h"
4#endif 5#endif
5 6
7EAPI char *
8map_module_source_get(void)
9{
10 return strdup("test_map");
11}
12
6EAPI int 13EAPI int
7elm_modapi_init(void *m __UNUSED__) 14map_module_zoom_min_get(void)
8{ 15{
9 return 1; // succeed always 16 return 0;
10} 17}
11 18
12EAPI int 19EAPI int
13elm_modapi_shutdown(void *m __UNUSED__) 20map_module_zoom_max_get(void)
14{ 21{
15 return 1; // succeed always 22 return 18;
16} 23}
17 24
18EAPI Eina_Bool 25EAPI char *
19obj_hook(Evas_Object *obj __UNUSED__) 26map_module_url_get(Evas_Object *obj __UNUSED__, int x, int y, int zoom)
20{ 27{
21 return EINA_TRUE; 28 char buf[PATH_MAX];
29 snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png",
30 zoom, x, y);
31 return strdup(buf);
22} 32}
23 33
24EAPI Eina_Bool 34EAPI int
25obj_unhook(Evas_Object *obj __UNUSED__) 35map_module_route_source_get(void)
26{ 36{
27 return EINA_TRUE; 37 return 0;
38}
39
40EAPI char *
41map_module_route_url_get(Evas_Object *obj __UNUSED__, char *type_name __UNUSED__, int method __UNUSED__, double flon __UNUSED__, double flat __UNUSED__, double tlon __UNUSED__, double tlat __UNUSED__)
42{
43 return strdup("");
44}
45
46EAPI char *
47map_module_name_url_get(Evas_Object *obj __UNUSED__, int method __UNUSED__, char *name __UNUSED__, double lon __UNUSED__, double lat __UNUSED__)
48{
49 return strdup("");
28} 50}
29 51
30EAPI Eina_Bool 52EAPI Eina_Bool
31obj_convert_geo_into_coord(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, double lon __UNUSED__, double lat __UNUSED__, int size __UNUSED__, int *x __UNUSED__, int *y __UNUSED__) 53map_module_geo_into_coord(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, double lon __UNUSED__, double lat __UNUSED__, int size __UNUSED__, int *x __UNUSED__, int *y __UNUSED__)
32{ 54{
33 return EINA_FALSE; 55 return EINA_FALSE;
34} 56}
35 57
36EAPI Eina_Bool 58EAPI Eina_Bool
37obj_convert_coord_into_geo(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, int x __UNUSED__, int y __UNUSED__, int size __UNUSED__, double *lon __UNUSED__, double *lat __UNUSED__) 59map_module_coord_into_geo(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, int x __UNUSED__, int y __UNUSED__, int size __UNUSED__, double *lon __UNUSED__, double *lat __UNUSED__)
38{ 60{
39 return EINA_FALSE; 61 return EINA_FALSE;
40} 62}
41 63
42EAPI char* 64static Eina_Bool
43obj_url_request(Evas_Object *obj __UNUSED__, int x, int y, int zoom) 65_module_init(void)
66{
67 return EINA_TRUE;
68}
69
70static void
71_module_shutdown(void)
44{ 72{
45 char buf[PATH_MAX];
46 snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png",
47 zoom, x, y);
48 return strdup(buf);
49} 73}
50 74
75EINA_MODULE_INIT(_module_init);
76EINA_MODULE_SHUTDOWN(_module_shutdown);
77