From a8f3b4f16028eaa411edde1f610f004c30ade82e Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Tue, 21 Feb 2012 03:40:52 +0000 Subject: [PATCH] fix some naming in elm_map as i suggested before. SVN revision: 68195 --- src/lib/elm_map.c | 82 +++++++++++++++++++++++++++---------------------------- src/lib/elm_map.h | 54 ++++++++++++++++++------------------ 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c index 62bcd57..f9015a4 100644 --- a/src/lib/elm_map.c +++ b/src/lib/elm_map.c @@ -24,28 +24,28 @@ typedef struct _Delayed_Data Delayed_Data; typedef struct _Map_Sources_Tab Map_Sources_Tab; #define ROUND(z) (((z) < 0) ? (int)ceil((z) - 0.005) : (int)floor((z) + 0.005)) -#define EVAS_MAP_POINT 4 -#define DEFAULT_TILE_SIZE 256 -#define MARER_MAX_NUMBER 30 -#define CACHE_ROOT_PATH "/tmp/elm_map" -#define CACHE_PATH CACHE_ROOT_PATH"/%d/%d/%d" -#define CACHE_FILE_PATH "%s/%d.png" +#define EVAS_MAP_POINT 4 +#define DEFAULT_TILE_SIZE 256 +#define MARER_MAX_NUMBER 30 +#define CACHE_ROOT_PATH "/tmp/elm_map" +#define CACHE_PATH CACHE_ROOT_PATH"/%d/%d/%d" +#define CACHE_FILE_PATH "%s/%d.png" #define DEST_ROUTE_XML_FILE "/tmp/elm_map-route-XXXXXX" -#define DEST_NAME_XML_FILE "/tmp/elm_map-name-XXXXXX" +#define DEST_NAME_XML_FILE "/tmp/elm_map-name-XXXXXX" -#define ROUTE_YOURS_URL "http://www.yournavigation.org/api/dev/route.php" +#define ROUTE_YOURS_URL "http://www.yournavigation.org/api/dev/route.php" #define ROUTE_TYPE_MOTORCAR "motocar" -#define ROUTE_TYPE_BICYCLE "bicycle" -#define ROUTE_TYPE_FOOT "foot" -#define YOURS_DISTANCE "distance" -#define YOURS_DESCRIPTION "description" -#define YOURS_COORDINATES "coordinates" - -#define NAME_NOMINATIM_URL "http://nominatim.openstreetmap.org" -#define NOMINATIM_RESULT "result" -#define NOMINATIM_PLACE "place" -#define NOMINATIM_ATTR_LON "lon" -#define NOMINATIM_ATTR_LAT "lat" +#define ROUTE_TYPE_BICYCLE "bicycle" +#define ROUTE_TYPE_FOOT "foot" +#define YOURS_DISTANCE "distance" +#define YOURS_DESCRIPTION "description" +#define YOURS_COORDINATES "coordinates" + +#define NAME_NOMINATIM_URL "http://nominatim.openstreetmap.org" +#define NOMINATIM_RESULT "result" +#define NOMINATIM_PLACE "place" +#define NOMINATIM_ATTR_LON "lon" +#define NOMINATIM_ATTR_LAT "lat" #define MAX_CONCURRENT_DOWNLOAD 10 @@ -101,12 +101,12 @@ struct _Map_Sources_Tab const char *name; int zoom_min; int zoom_max; - ElmMapModuleUrlFunc url_cb; + Elm_Map_Module_Url_Func url_cb; Elm_Map_Route_Sources route_source; - ElmMapModuleRouteUrlFunc route_url_cb; - ElmMapModuleNameUrlFunc name_url_cb; - ElmMapModuleGeoIntoCoordFunc geo_into_coord; - ElmMapModuleCoordIntoGeoFunc coord_into_geo; + Elm_Map_Module_Route_Url_Func route_url_cb; + Elm_Map_Module_Name_Url_Func name_url_cb; + Elm_Map_Module_Geo_Into_Coord_Func geo_into_coord; + Elm_Map_Module_Coord_Into_Geo_Func coord_into_geo; }; struct _Url_Data @@ -122,9 +122,9 @@ struct _Elm_Map_Marker_Class const char *style; struct _Elm_Map_Marker_Class_Func { - ElmMapMarkerGetFunc get; - ElmMapMarkerDelFunc del; //if NULL the object will be destroyed with evas_object_del() - ElmMapMarkerIconGetFunc icon_get; + Elm_Map_Marker_Get_Func get; + Elm_Map_Marker_Del_Func del; //if NULL the object will be destroyed with evas_object_del() + Elm_Map_Marker_Icon_Get_Func icon_get; } func; }; @@ -139,7 +139,7 @@ struct _Elm_Map_Group_Class void *data; struct { - ElmMapGroupIconGetFunc icon_get; + Elm_Map_Group_Icon_Get_Func icon_get; } func; Eina_Bool hide : 1; @@ -448,15 +448,15 @@ module_list_cb(Eina_Module *m, void *data) Widget_Data *wd = data; Map_Sources_Tab *s; - ElmMapModuleSourceFunc source; - ElmMapModuleZoomMinFunc zoom_min; - ElmMapModuleZoomMaxFunc zoom_max; - ElmMapModuleUrlFunc url; - ElmMapModuleRouteSourceFunc route_source; - ElmMapModuleRouteUrlFunc route_url; - ElmMapModuleNameUrlFunc name_url; - ElmMapModuleGeoIntoCoordFunc geo_into_coord; - ElmMapModuleCoordIntoGeoFunc coord_into_geo; + Elm_Map_Module_Source_Func source; + Elm_Map_Module_Zoom_Min_Func zoom_min; + Elm_Map_Module_Zoom_Max_Func zoom_max; + Elm_Map_Module_Url_Func url; + Elm_Map_Module_Route_Source_Func route_source; + Elm_Map_Module_Route_Url_Func route_url; + Elm_Map_Module_Name_Url_Func name_url; + Elm_Map_Module_Geo_Into_Coord_Func geo_into_coord; + Elm_Map_Module_Coord_Into_Geo_Func coord_into_geo; const char *file; file = eina_module_file_get(m); @@ -3580,7 +3580,7 @@ elm_map_group_class_style_set(Elm_Map_Group_Class *clas, const char *style) } EAPI void -elm_map_group_class_icon_cb_set(Elm_Map_Group_Class *clas, ElmMapGroupIconGetFunc icon_get) +elm_map_group_class_icon_cb_set(Elm_Map_Group_Class *clas, Elm_Map_Group_Icon_Get_Func icon_get) { #ifdef HAVE_ELEMENTARY_ECORE_CON EINA_SAFETY_ON_NULL_RETURN(clas); @@ -3677,7 +3677,7 @@ elm_map_marker_class_style_set(Elm_Map_Marker_Class *clas, const char *style) } EAPI void -elm_map_marker_class_icon_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerIconGetFunc icon_get) +elm_map_marker_class_icon_cb_set(Elm_Map_Marker_Class *clas, Elm_Map_Marker_Icon_Get_Func icon_get) { #ifdef HAVE_ELEMENTARY_ECORE_CON EINA_SAFETY_ON_NULL_RETURN(clas); @@ -3689,7 +3689,7 @@ elm_map_marker_class_icon_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerIconGet } EAPI void -elm_map_marker_class_get_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerGetFunc get) +elm_map_marker_class_get_cb_set(Elm_Map_Marker_Class *clas, Elm_Map_Marker_Get_Func get) { #ifdef HAVE_ELEMENTARY_ECORE_CON EINA_SAFETY_ON_NULL_RETURN(clas); @@ -3701,7 +3701,7 @@ elm_map_marker_class_get_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerGetFunc } EAPI void -elm_map_marker_class_del_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerDelFunc del) +elm_map_marker_class_del_cb_set(Elm_Map_Marker_Class *clas, Elm_Map_Marker_Del_Func del) { #ifdef HAVE_ELEMENTARY_ECORE_CON EINA_SAFETY_ON_NULL_RETURN(clas); diff --git a/src/lib/elm_map.h b/src/lib/elm_map.h index 9a1fde4..fcc5c12 100644 --- a/src/lib/elm_map.h +++ b/src/lib/elm_map.h @@ -153,20 +153,20 @@ typedef struct _Elm_Map_Route Elm_Map_Route; /**< A route to be shown in typedef struct _Elm_Map_Name Elm_Map_Name; /**< A handle for specific coordinates. */ typedef struct _Elm_Map_Track Elm_Map_Track; -typedef Evas_Object *(*ElmMapMarkerGetFunc)(Evas_Object *obj, Elm_Map_Marker *marker, void *data); /**< Bubble content fetching class function for marker classes. When the user click on a marker, a bubble is displayed with a content. */ -typedef void (*ElmMapMarkerDelFunc)(Evas_Object *obj, Elm_Map_Marker *marker, void *data, Evas_Object *o); /**< Function to delete bubble content for marker classes. */ -typedef Evas_Object *(*ElmMapMarkerIconGetFunc)(Evas_Object *obj, Elm_Map_Marker *marker, void *data); /**< Icon fetching class function for marker classes. */ -typedef Evas_Object *(*ElmMapGroupIconGetFunc)(Evas_Object *obj, void *data); /**< Icon fetching class function for markers group classes. */ - -typedef char *(*ElmMapModuleSourceFunc)(void); -typedef int (*ElmMapModuleZoomMinFunc)(void); -typedef int (*ElmMapModuleZoomMaxFunc)(void); -typedef char *(*ElmMapModuleUrlFunc)(Evas_Object *obj, int x, int y, int zoom); -typedef int (*ElmMapModuleRouteSourceFunc)(void); -typedef char *(*ElmMapModuleRouteUrlFunc)(Evas_Object *obj, char *type_name, int method, double flon, double flat, double tlon, double tlat); -typedef char *(*ElmMapModuleNameUrlFunc)(Evas_Object *obj, int method, char *name, double lon, double lat); -typedef Eina_Bool (*ElmMapModuleGeoIntoCoordFunc)(const Evas_Object *obj, int zoom, double lon, double lat, int size, int *x, int *y); -typedef Eina_Bool (*ElmMapModuleCoordIntoGeoFunc)(const Evas_Object *obj, int zoom, int x, int y, int size, double *lon, double *lat); +typedef Evas_Object *(*Elm_Map_Marker_Get_Func)(Evas_Object *obj, Elm_Map_Marker *marker, void *data); /**< Bubble content fetching class function for marker classes. When the user click on a marker, a bubble is displayed with a content. */ +typedef void (*Elm_Map_Marker_Del_Func)(Evas_Object *obj, Elm_Map_Marker *marker, void *data, Evas_Object *o); /**< Function to delete bubble content for marker classes. */ +typedef Evas_Object *(*Elm_Map_Marker_Icon_Get_Func)(Evas_Object *obj, Elm_Map_Marker *marker, void *data); /**< Icon fetching class function for marker classes. */ +typedef Evas_Object *(*Elm_Map_Group_Icon_Get_Func)(Evas_Object *obj, void *data); /**< Icon fetching class function for markers group classes. */ + +typedef char *(*Elm_Map_Module_Source_Func)(void); +typedef int (*Elm_Map_Module_Zoom_Min_Func)(void); +typedef int (*Elm_Map_Module_Zoom_Max_Func)(void); +typedef char *(*Elm_Map_Module_Url_Func)(Evas_Object *obj, int x, int y, int zoom); +typedef int (*Elm_Map_Module_Route_Source_Func)(void); +typedef char *(*Elm_Map_Module_Route_Url_Func)(Evas_Object *obj, char *type_name, int method, double flon, double flat, double tlon, double tlat); +typedef char *(*Elm_Map_Module_Name_Url_Func)(Evas_Object *obj, int method, char *name, double lon, double lat); +typedef Eina_Bool (*Elm_Map_Module_Geo_Into_Coord_Func)(const Evas_Object *obj, int zoom, double lon, double lat, int size, int *x, int *y); +typedef Eina_Bool (*Elm_Map_Module_Coord_Into_Geo_Func)(const Evas_Object *obj, int zoom, int x, int y, int size, double *lon, double *lat); /** * Add a new map widget to the given parent Elementary (container) object. @@ -661,12 +661,12 @@ EAPI void elm_map_marker_show(Elm_Map_Marker *marker); EAPI void elm_map_markers_list_show(Eina_List *markers); /** - * Get the Evas object returned by the ElmMapMarkerGetFunc callback + * Get the Evas object returned by the Elm_Map_Marker_Get_Func callback * * @param marker The marker which content should be returned. * @return Return the evas object if it exists, else @c NULL. * - * To set callback function #ElmMapMarkerGetFunc for the marker class, + * To set callback function #Elm_Map_Marker_Get_Func for the marker class, * elm_map_marker_class_get_cb_set() should be used. * * This content is what will be inside the bubble that will be displayed @@ -691,8 +691,8 @@ EAPI Evas_Object *elm_map_marker_object_get(const Elm_Map_Marker *marke * @param marker The marker to be updated. * * If a content is set to this marker, it will call function to delete it, - * #ElmMapMarkerDelFunc, and then will fetch the content again with - * #ElmMapMarkerGetFunc. + * #Elm_Map_Marker_Del_Func, and then will fetch the content again with + * #Elm_Map_Marker_Get_Func. * * These functions are set for the marker class with * elm_map_marker_class_get_cb_set() and elm_map_marker_class_del_cb_set(). @@ -706,7 +706,7 @@ EAPI void elm_map_marker_update(Elm_Map_Marker *marker); * * @param obj The map object. * - * A bubble is displayed with a content fetched with #ElmMapMarkerGetFunc + * A bubble is displayed with a content fetched with #Elm_Map_Marker_Get_Func * when the user clicks on a marker. * * This functions is set for the marker class with @@ -741,7 +741,7 @@ EAPI void elm_map_bubbles_close(Evas_Object *obj); * elm_map_group_class_zoom_grouped_set(). * - visibility - set if markers will be visible or not, set with * elm_map_group_class_hide_set(). - * - #ElmMapGroupIconGetFunc - used to fetch icon for markers group classes. + * - #Elm_Map_Group_Icon_Get_Func - used to fetch icon for markers group classes. * It can be set using elm_map_group_class_icon_cb_set(). * * @see elm_map_marker_add() @@ -791,7 +791,7 @@ EAPI void elm_map_group_class_style_set(Elm_Map_Group_Class *cl * * @ingroup Map */ -EAPI void elm_map_group_class_icon_cb_set(Elm_Map_Group_Class *clas, ElmMapGroupIconGetFunc icon_get); +EAPI void elm_map_group_class_icon_cb_set(Elm_Map_Group_Class *clas, Elm_Map_Group_Icon_Get_Func icon_get); /** * Set the data associated to the group class. @@ -877,11 +877,11 @@ EAPI void elm_map_group_class_hide_set(Evas_Object *obj, Elm_Ma * * Some properties and functions can be set by class, as: * - style, with elm_map_marker_class_style_set() - * - #ElmMapMarkerIconGetFunc - used to fetch icon for markers classes. + * - #Elm_Map_Marker_Icon_Get_Func - used to fetch icon for markers classes. * It can be set using elm_map_marker_class_icon_cb_set(). - * - #ElmMapMarkerGetFunc - used to fetch bubble content for marker classes. + * - #Elm_Map_Marker_Get_Func - used to fetch bubble content for marker classes. * Set using elm_map_marker_class_get_cb_set(). - * - #ElmMapMarkerDelFunc - used to delete bubble content for marker classes. + * - #Elm_Map_Marker_Del_Func - used to delete bubble content for marker classes. * Set using elm_map_marker_class_del_cb_set(). * * @see elm_map_marker_add() @@ -929,7 +929,7 @@ EAPI void elm_map_marker_class_style_set(Elm_Map_Marker_Class * * * @ingroup Map */ -EAPI void elm_map_marker_class_icon_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerIconGetFunc icon_get); +EAPI void elm_map_marker_class_icon_cb_set(Elm_Map_Marker_Class *clas, Elm_Map_Marker_Icon_Get_Func icon_get); /** * Set the bubble content callback function of a marker class. @@ -950,7 +950,7 @@ EAPI void elm_map_marker_class_icon_cb_set(Elm_Map_Marker_Class * * @ingroup Map */ -EAPI void elm_map_marker_class_get_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerGetFunc get); +EAPI void elm_map_marker_class_get_cb_set(Elm_Map_Marker_Class *clas, Elm_Map_Marker_Get_Func get); /** * Set the callback function used to delete bubble content of a marker class. @@ -976,7 +976,7 @@ EAPI void elm_map_marker_class_get_cb_set(Elm_Map_Marker_Class * * @ingroup Map */ -EAPI void elm_map_marker_class_del_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerDelFunc del); +EAPI void elm_map_marker_class_del_cb_set(Elm_Map_Marker_Class *clas, Elm_Map_Marker_Del_Func del); /** * Get the list of available sources. -- 2.7.4