Fix up elm_route have min_max API consistent with the rest of elm.

Signed-off-by: Sanjeev BA <eflelev8@gmail.com>

SVN revision: 68379
This commit is contained in:
Sanjeev BA 2012-02-24 05:48:27 +00:00 committed by Sanjeev BA
parent 83631900d8
commit 4b20052170
4 changed files with 100 additions and 20 deletions

View File

@ -4563,6 +4563,17 @@ EINA_DEPRECATED EAPI void elm_video_uri_set(Evas_Object *video,
*/
EINA_DEPRECATED EAPI void elm_photocam_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h);
/* No documentation for these API before.
*
* @deprecated Use elm_route_latitude_min_max_get()
* elm_route_longitude_min_max_get()
* instead.
*/
EINA_DEPRECATED EAPI double elm_route_lon_min_get(Evas_Object *obj);
EINA_DEPRECATED EAPI double elm_route_lat_min_get(Evas_Object *obj);
EINA_DEPRECATED EAPI double elm_route_lon_max_get(Evas_Object *obj);
EINA_DEPRECATED EAPI double elm_route_lat_max_get(Evas_Object *obj);
/**
* @}
*/

View File

@ -1466,8 +1466,12 @@ _track_place(Widget_Data *wd)
EINA_LIST_FOREACH(wd->track, l, route)
{
elm_map_utils_convert_geo_into_coord(wd->obj, elm_route_lon_min_get(route), elm_route_lat_max_get(route), size, &xmin, &ymin);
elm_map_utils_convert_geo_into_coord(wd->obj, elm_route_lon_max_get(route), elm_route_lat_min_get(route), size, &xmax, &ymax);
double lon_min, lon_max;
double lat_min, lat_max;
elm_route_longitude_min_max_get(route, &lon_min, &lon_max);
elm_route_latitude_min_max_get(route, &lat_min, &lat_max);
elm_map_utils_convert_geo_into_coord(wd->obj, lon_min, lat_max, size, &xmin, &ymin);
elm_map_utils_convert_geo_into_coord(wd->obj, lon_max, lat_min, size, &xmax, &ymax);
if( !(xmin < px && xmax < px) && !(xmin > px+ow && xmax > px+ow))
{

View File

@ -265,36 +265,55 @@ elm_route_emap_set(Evas_Object *obj, EMap_Route *emap)
}
#endif
EAPI double
EINA_DEPRECATED EAPI double
elm_route_lon_min_get(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
return wd->lon_min;
double val;
elm_route_longitude_min_max_get(obj, &val, NULL);
return val;
}
EAPI double
EINA_DEPRECATED EAPI double
elm_route_lat_min_get(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
return wd->lat_min;
double val;
elm_route_latitude_min_max_get(obj, &val, NULL);
return val;
}
EAPI double
EINA_DEPRECATED EAPI double
elm_route_lon_max_get(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
return wd->lon_max;
double val;
elm_route_longitude_min_max_get(obj, NULL, &val);
return val;
}
EAPI double
EINA_DEPRECATED EAPI double
elm_route_lat_max_get(Evas_Object *obj)
{
double val;
elm_route_latitude_min_max_get(obj, NULL, &val);
return val;
}
EAPI void
elm_route_longitude_min_max_get(const Evas_Object *obj, double *min, double *max)
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
return wd->lat_max;
if (!wd) return;
if (min) *min = wd->lon_min;
if (max) *max = wd->lon_max;
}
EAPI void
elm_route_latitude_min_max_get(const Evas_Object *obj, double *min, double *max)
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (min) *min = wd->lat_min;
if (max) *max = wd->lat_max;
}
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-3f0^-2{2(0W1st0 :*/

View File

@ -1,8 +1,54 @@
/**
* @defgroup Route Route
*
* For displaying a route on the map widget.
*
* @{
*/
/**
* Add a new route object to the parent's canvas
*
* @param parent The parent object
* @return The new object or NULL if it cannot be created
*
*/
EAPI Evas_Object *elm_route_add(Evas_Object *parent);
#ifdef ELM_EMAP
EAPI void elm_route_emap_set(Evas_Object *obj, EMap_Route *emap);
#endif
EAPI double elm_route_lon_min_get(Evas_Object *obj);
EAPI double elm_route_lat_min_get(Evas_Object *obj);
EAPI double elm_route_lon_max_get(Evas_Object *obj);
EAPI double elm_route_lat_max_get(Evas_Object *obj);
EINA_DEPRECATED EAPI double elm_route_lon_min_get(Evas_Object *obj);
EINA_DEPRECATED EAPI double elm_route_lat_min_get(Evas_Object *obj);
EINA_DEPRECATED EAPI double elm_route_lon_max_get(Evas_Object *obj);
EINA_DEPRECATED EAPI double elm_route_lat_max_get(Evas_Object *obj);
/**
* Get the minimum and maximum values along the longitude.
*
* @param obj The route object.
* @param min Pointer to store the minimum value.
* @param max Pointer to store the maximum value.
*
* @note If only one value is needed, the other pointer can be passed
* as @c NULL.
*
* @ingroup Route
*/
EAPI void elm_route_longitude_min_max_get(const Evas_Object *obj, double *min, double *max);
/**
* Get the minimum and maximum values along the latitude.
*
* @param obj The route object.
* @param min Pointer to store the minimum value.
* @param max Pointer to store the maximum value.
*
* @note If only one value is needed, the other pointer can be passed
* as @c NULL.
*
* @ingroup Route
*/
EAPI void elm_route_latitude_min_max_get(const Evas_Object *obj, double *min, double *max);