*/
const String& GetAppId() const;
+#ifdef TIZEN_MIGRATION
/**
* This method retrieves the request app id.
*
* @return A constant reference to a string containing the request app id.
*/
const String& GetRequestAppId() const;
+#endif
/**
* This is a static method which returns the singleton's instance.
*/
static ApplicationContext& GetInstance();
+#ifdef TIZEN_MIGRATION
/**
* This method initialises the singleton object.
*
* <code>false</code>.
*/
bool Initialize(const String& sAppCode, const String& sAppId, const String& sRequestAppId = "");
+#else
+ /**
+ * This method initialises the singleton object.
+ *
+ * @param sAppCode A constant reference to a string containing the app code.
+ *
+ * @param sAppId A constant reference to a string containing the app id.
+ *
+ * @return A Boolean indicating the result of initialization,
+ * <code>true</code> on success, <code>false</code> on failure. Note
+ * that if the object already exists and has been initialized,
+ * further attempts to call this methods fail (the return value is
+ * <code>false</code>.
+ */
+ bool Initialize(const String& sAppCode, const String& sAppId);
+#endif
/**
* This method queries initialisation status.
*/
void SetEvasGlApi(Evas_GL_API *__glapi);
+#ifdef TIZEN_MIGRATION
/**
* This typedef defines a function object as a type. The function object can
* be called when the map has been ready after initialized. A function object of
* this type returns <code>void</code> and receives no arguments.
*/
- typedef void(*ReadyMapSignalFunctor)(void);
+ typedef void(*ReadyMapSignalFunctor)(void *data);
/**
* This method sets a callback to be invoked when the map has
* @param slot A function object to be called when the map has
* been ready after initialization.
*/
+ void SetReadyMapSignal(ReadyMapSignalFunctor callback, void *data);
+#else
+ /**
+ * This typedef defines a function object as a type. The function object can
+ * be called when the map has been ready after initialized. A function object of
+ * this type returns <code>void</code> and receives no arguments.
+ */
+ typedef void(*ReadyMapSignalFunctor)(void);
+
+ /**
+ * This method sets a callback to be invoked when the map has
+ * been ready after initialization.
+ *
+ * @param slot A function object to be called when the map has
+ * been ready after initialization.
+ */
void SetReadyMapSignal(ReadyMapSignalFunctor callback);
+#endif
/**
* This method sets the angle of the map.
*
/* Mapping API */
-int HerePluginSetMapView(const maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc);
+int HerePluginCreateMapView(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc);
-int HerePluginRenderMap(const maps_coordinates_h mapsCoord, const double dZoom, const double dAngle,
+int HerePluginDestroyMapView(maps_view_h hView);
+
+int HerePluginRenderMap(maps_view_h hView, const maps_coordinates_h mapsCoord, const double dZoom, const double dAngle,
maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId);
-int HerePluginRenderMapArea(const maps_area_h hArea, const double dZoom, const double dAngle,
+int HerePluginRenderMapArea(maps_view_h hView, const maps_area_h hArea, const double dZoom, const double dAngle,
maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId);
-int HerePluginMoveCenter(const int delta_x, const int delta_y,
+int HerePluginMoveCenter(maps_view_h hView, const int delta_x, const int delta_y,
maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId);
-int HerePluginSetScalebar(bool enable);
+int HerePluginSetScalebar(maps_view_h hView, bool enable);
-int HerePluginGetScalebar(bool *enabled);
+int HerePluginGetScalebar(maps_view_h hView, bool *enabled);
int HerePluginDrawMap(Evas* pCanvas, const int x, const int y,
const int nWidth, const int nHeight);
-int HerePluginGetCenter(maps_coordinates_h *center);
+int HerePluginGetCenter(maps_view_h hView, maps_coordinates_h *center);
-int HerePluginScreenToGeography(const int x, const int y, maps_coordinates_h *mapsCoord);
+int HerePluginScreenToGeography(maps_view_h hView, const int x, const int y, maps_coordinates_h *mapsCoord);
-int HerePluginGeographyToScreen(const maps_coordinates_h mapsCoord, int *x, int *y);
+int HerePluginGeographyToScreen(maps_view_h hView, const maps_coordinates_h mapsCoord, int *x, int *y);
-int HerePluginGetMinZoomLevel(int *nMinZoomLevel);
+int HerePluginGetMinZoomLevel(maps_view_h hView, int *nMinZoomLevel);
-int HerePluginGetMaxZoomLevel(int *nMaxZoomLevel);
+int HerePluginGetMaxZoomLevel(maps_view_h hView, int *nMaxZoomLevel);
-int HerePluginOnViewObject(const maps_view_object_h object,
- const maps_view_object_operation_e operation);
+int HerePluginOnViewObject(maps_view_h hView, const maps_view_object_h object, const maps_view_object_operation_e operation);
#endif //_LOCATION_HERE_API_H_
\ No newline at end of file
//maps-service header
#include <maps_service.h>
#include <maps_view.h>
+#include <maps_view_plugin.h>
//map engine header
#include <maps/GeoTiledMap.h>
int x, y, w, h;
double lat, lng, zoom, angle;
- maps_view_h hView;
-
// to remove // UpdatedObjects updatedObjects;
HereViewObjects visualObjects;
PendingObjects pendingObjects;
HereView(void *pCbFunc, void *pUserData, int nReqId);
~HereView();
- here_error_e Init(const maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc);
- static here_error_e Close();
- here_error_e RenderMap(const maps_coordinates_h mapsCoord, double dZoom, double dAngle);
- here_error_e RenderMapByArea(const maps_area_h hArea, double dZoom, double dAngle);
- static here_error_e DrawMap(Evas* pCanvas, int x, int y, int nWidth, int nHeight);
- here_error_e MoveCenter(int delta_x, int delta_y);
- here_error_e SetScalebar(bool enable);
- here_error_e GetScalebar(bool *enabled);
- here_error_e GetCenter(maps_coordinates_h *center);
- here_error_e ScreenToGeolocation(int x, int y, maps_coordinates_h *mapsCoord);
- here_error_e GeolocationToScreen(const maps_coordinates_h mapsCoord, int *x, int *y);
-
- static here_error_e GetMinZoomLevel(int *nMinZoomLevel);
- static here_error_e GetMaxZoomLevel(int *nMaxZoomLevel);
- static here_error_e OnViewObject(const maps_view_object_h object, maps_view_object_operation_e operation);
+ here_error_e Init(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc);
+ static here_error_e Close(maps_view_h hView);
+ here_error_e RenderMap(maps_view_h hView, const maps_coordinates_h mapsCoord, double dZoom, double dAngle);
+ here_error_e RenderMapByArea(maps_view_h hView, const maps_area_h hArea, double dZoom, double dAngle);
+ static here_error_e DrawMap(maps_view_h hView, Evas* pCanvas, int x, int y, int nWidth, int nHeight);
+ here_error_e MoveCenter(maps_view_h hView, int delta_x, int delta_y);
+ here_error_e SetScalebar(maps_view_h hView, bool enable);
+ here_error_e GetScalebar(maps_view_h hView, bool *enabled);
+ here_error_e GetCenter(maps_view_h hView, maps_coordinates_h *center);
+ here_error_e ScreenToGeolocation(maps_view_h hView, int x, int y, maps_coordinates_h *mapsCoord);
+ here_error_e GeolocationToScreen(maps_view_h hView, const maps_coordinates_h mapsCoord, int *x, int *y);
+
+ static here_error_e GetMinZoomLevel(maps_view_h hView, int *nMinZoomLevel);
+ static here_error_e GetMaxZoomLevel(maps_view_h hView, int *nMaxZoomLevel);
+ static here_error_e OnViewObject(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation);
static void RenderingCb(void *data);
static bool foreachObject(int index, int total, maps_view_object_h object, void *user_data);
private:
here_error_e InitOpenGL(GLData *gld);
- here_error_e InitOpenGLSurface(GLData *gld);
- here_error_e InitMap(GLData *gld, maps_plugin_map_view_ready_cb pCbFunc);
- static void __readyCb();
+ here_error_e InitOpenGLSurface(maps_view_h hView);
+ here_error_e InitMap(maps_view_h hView, GLData *gld, maps_plugin_map_view_ready_cb pCbFunc);
+ static void __readyCb(maps_view_h hView);
static Eina_Bool __idlerCb(void *data);
static void __renderingCb(void *data);
static void __pixelGetCb(void *data, Evas_Object *obj);
- static void __processViewObject(const maps_view_object_h object, maps_view_object_operation_e operation);
- void __setMapType();
-
- static GLData *m_pImpl;
+ static void __processViewObject(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation);
+ void __setMapType(maps_view_h hView);
};
return (HereManager::GetHandler()->CancelInstance(nReqId));
}
-int HerePluginSetMapView(const maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc)
+int HerePluginCreateMapView(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc)
{
- if (!HereManager::GetHandler())
+ if (!hView || !HereManager::GetHandler())
return HERE_ERROR_INVALID_OPERATION;
/* creating instance */
/* sending request */
here_error_e error = HERE_ERROR_NONE;
- if (hView)
- error = pView->Init(hView, pCbFunc);
- else
- error = pView->Close();
+ error = pView->Init(hView, pCbFunc);
delete pView;
return error;
}
-int HerePluginRenderMap(const maps_coordinates_h mapsCoord, const double dZoom, const double dAngle,
+int HerePluginDestroyMapView(maps_view_h hView)
+{
+ if (!hView || !HereManager::GetHandler())
+ return HERE_ERROR_INVALID_OPERATION;
+
+ /* creating instance */
+ HereView *pView =
+ (HereView*)(HereManager::GetHandler()->CreateInstance(HereManager::HERE_SVC_VIEW));
+
+ if(!pView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+
+ /* sending request */
+ here_error_e error = HERE_ERROR_NONE;
+
+ error = pView->Close(hView);
+
+ delete pView;
+
+ return error;
+}
+
+int HerePluginRenderMap(maps_view_h hView, const maps_coordinates_h mapsCoord, const double dZoom, const double dAngle,
maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId)
{
- if (!mapsCoord || !pCbFunc || !nReqId)
+ if (!hView || !mapsCoord || !pCbFunc || !nReqId)
return HERE_ERROR_INVALID_PARAMETER;
if (!HereManager::GetHandler())
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
/* sending request */
- here_error_e error = pView->RenderMap(mapsCoord, dZoom, dAngle);
+ here_error_e error = pView->RenderMap(hView, mapsCoord, dZoom, dAngle);
delete pView;
return error;
}
-int HerePluginRenderMapArea(const maps_area_h hArea, const double dZoom, const double dAngle,
+int HerePluginRenderMapArea(maps_view_h hView, const maps_area_h hArea, const double dZoom, const double dAngle,
maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId)
{
- if (!hArea || !pCbFunc || !nReqId)
+ if (!hView || !hArea || !pCbFunc || !nReqId)
return HERE_ERROR_INVALID_PARAMETER;
if (!HereManager::GetHandler())
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
/* sending request */
- here_error_e error = pView->RenderMapByArea(hArea, dZoom, dAngle);
+ here_error_e error = pView->RenderMapByArea(hView, hArea, dZoom, dAngle);
delete pView;
return error;
}
-int HerePluginMoveCenter(const int delta_x, const int delta_y,
- maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId)
+int HerePluginMoveCenter(maps_view_h hView, const int delta_x, const int delta_y, maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId)
{
- if (!pCbFunc || !nReqId)
+ if (!hView || !pCbFunc || !nReqId)
return HERE_ERROR_INVALID_PARAMETER;
if (!HereManager::GetHandler())
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
/* sending request */
- here_error_e error = pView->MoveCenter(delta_x, delta_y);
+ here_error_e error = pView->MoveCenter(hView, delta_x, delta_y);
delete pView;
return error;
}
-int HerePluginSetScalebar(bool enable)
+int HerePluginSetScalebar(maps_view_h hView, bool enable)
{
- if (!HereManager::GetHandler())
+ if (!hView || !HereManager::GetHandler())
return HERE_ERROR_INVALID_OPERATION;
HereView *pView =
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
/* sending request */
- here_error_e error = pView->SetScalebar(enable);
+ here_error_e error = pView->SetScalebar(hView, enable);
delete pView;
return error;
}
-int HerePluginGetScalebar(bool *enabled)
+int HerePluginGetScalebar(maps_view_h hView, bool *enabled)
{
- if (!enabled)
+ if (!hView || !enabled)
return HERE_ERROR_INVALID_PARAMETER;
if (!HereManager::GetHandler())
if(!pView)
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
- here_error_e error = pView->GetScalebar(enabled);
+ here_error_e error = pView->GetScalebar(hView, enabled);
delete pView;
return error;
return HERE_ERROR_NONE;
}
-int HerePluginGetCenter(maps_coordinates_h *center)
+int HerePluginGetCenter(maps_view_h hView, maps_coordinates_h *center)
{
- if (!center)
+ if (!hView || !center)
return HERE_ERROR_INVALID_PARAMETER;
if (!HereManager::GetHandler())
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
/* sending request */
- here_error_e error = pView->GetCenter(center);
+ here_error_e error = pView->GetCenter(hView, center);
delete pView;
return error;
}
-int HerePluginScreenToGeography(const int x, const int y, maps_coordinates_h *mapsCoord)
+int HerePluginScreenToGeography(maps_view_h hView, const int x, const int y, maps_coordinates_h *mapsCoord)
{
- if (!mapsCoord)
+ if (!hView || !mapsCoord)
return HERE_ERROR_INVALID_PARAMETER;
if (!HereManager::GetHandler())
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
/* sending request */
- here_error_e error = pView->ScreenToGeolocation(x, y, mapsCoord);
+ here_error_e error = pView->ScreenToGeolocation(hView, x, y, mapsCoord);
delete pView;
return error;
}
-int HerePluginGeographyToScreen(const maps_coordinates_h mapsCoord, int *x, int *y)
+int HerePluginGeographyToScreen(maps_view_h hView, const maps_coordinates_h mapsCoord, int *x, int *y)
{
- if (!mapsCoord || !x || !y)
+ if (!hView || !mapsCoord || !x || !y)
return HERE_ERROR_INVALID_PARAMETER;
if (!HereManager::GetHandler())
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
/* sending request */
- here_error_e error = pView->GeolocationToScreen(mapsCoord, x, y);
+ here_error_e error = pView->GeolocationToScreen(hView, mapsCoord, x, y);
delete pView;
return error;
}
-int HerePluginGetMinZoomLevel(int *nMinZoomLevel)
+int HerePluginGetMinZoomLevel(maps_view_h hView, int *nMinZoomLevel)
{
- return HereView::GetMinZoomLevel(nMinZoomLevel);
+ if (!hView)
+ return HERE_ERROR_INVALID_PARAMETER;
+
+ return HereView::GetMinZoomLevel(hView, nMinZoomLevel);
}
-int HerePluginGetMaxZoomLevel(int *nMaxZoomLevel)
+int HerePluginGetMaxZoomLevel(maps_view_h hView, int *nMaxZoomLevel)
{
- return HereView::GetMaxZoomLevel(nMaxZoomLevel);
+ if (!hView)
+ return HERE_ERROR_INVALID_PARAMETER;
+
+ return HereView::GetMaxZoomLevel(hView, nMaxZoomLevel);
}
-int HerePluginOnViewObject(const maps_view_object_h object,
- const maps_view_object_operation_e operation)
+int HerePluginOnViewObject(maps_view_h hView, const maps_view_object_h object, const maps_view_object_operation_e operation)
{
- return HereView::OnViewObject(object, operation);
+ if (!hView)
+ return HERE_ERROR_INVALID_PARAMETER;
+
+ return HereView::OnViewObject(hView, object, operation);
}
}
EXPORT_API int maps_plugin_search_route(const maps_coordinates_h origin, const maps_coordinates_h destination,
- maps_preference_h preference, maps_service_search_route_cb callback,
- void* user_data, int* request_id)
+ maps_preference_h preference, maps_service_search_route_cb callback, void* user_data, int* request_id)
{
int ret = HerePluginSearchRoute(origin, destination, preference, callback, user_data, request_id);
}
/* Mapping */
-EXPORT_API int maps_plugin_set_map_view(const maps_view_h view, maps_plugin_map_view_ready_cb pCbFunc)
+EXPORT_API int maps_plugin_create_map_view(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc)
{
- int ret = HerePluginSetMapView(view, pCbFunc);
+ int ret = HerePluginCreateMapView(hView, pCbFunc);
MAPS_LOGD("here_error_e = %d", ret);
return ConvertToMapsError(ret);
}
-EXPORT_API int maps_plugin_render_map(const maps_coordinates_h coordinates,
- const double zoom_factor,
- const double rotation_angle,
- maps_plugin_render_map_cb callback,
- void* user_data,
- int* request_id)
+EXPORT_API int maps_plugin_destroy_map_view(maps_view_h hView)
+{
+ int ret = HerePluginDestroyMapView(hView);
+
+ MAPS_LOGD("here_error_e = %d", ret);
+
+ return ConvertToMapsError(ret);
+}
+EXPORT_API int maps_plugin_render_map(maps_view_h hView, const maps_coordinates_h coordinates, const double zoom_factor,
+ const double rotation_angle, maps_plugin_render_map_cb callback, void* user_data, int* request_id)
{
- int ret = HerePluginRenderMap(coordinates, zoom_factor, rotation_angle,
+ int ret = HerePluginRenderMap(hView, coordinates, zoom_factor, rotation_angle,
callback, user_data, request_id);
if (ret != HERE_ERROR_NONE)
return ConvertToMapsError(ret);
}
-EXPORT_API int maps_plugin_render_map_area(const maps_area_h area,
- const double zoom_factor,
- const double rotation_angle,
- maps_plugin_render_map_cb callback,
- void* user_data,
- int* request_id)
+EXPORT_API int maps_plugin_render_map_area(maps_view_h hView, const maps_area_h area, const double zoom_factor,
+ const double rotation_angle, maps_plugin_render_map_cb callback, void* user_data, int* request_id)
{
- int ret = HerePluginRenderMapArea(area, zoom_factor, rotation_angle,
- callback, user_data, request_id);
+ int ret = HerePluginRenderMapArea(hView, area, zoom_factor, rotation_angle, callback, user_data, request_id);
if (ret != HERE_ERROR_NONE)
MAPS_LOGD("here_error_e = %d", ret);
return ConvertToMapsError(ret);
}
-EXPORT_API int maps_plugin_move_center(const int delta_x, const int delta_y,
- maps_plugin_render_map_cb callback,
- void* user_data,
- int* request_id)
+EXPORT_API int maps_plugin_move_center(maps_view_h hView, const int delta_x, const int delta_y, maps_plugin_render_map_cb callback,
+ void* user_data, int* request_id)
{
- int ret = HerePluginMoveCenter(delta_x, delta_y,
- callback, user_data, request_id);
+ int ret = HerePluginMoveCenter(hView, delta_x, delta_y, callback, user_data, request_id);
if (ret != HERE_ERROR_NONE)
MAPS_LOGD("here_error_e = %d", ret);
return ConvertToMapsError(ret);
}
-EXPORT_API int maps_plugin_set_scalebar(bool enable)
+EXPORT_API int maps_plugin_set_scalebar(maps_view_h hView, bool enable)
{
- int ret = HerePluginSetScalebar(enable);
+ int ret = HerePluginSetScalebar(hView, enable);
if (ret != HERE_ERROR_NONE)
MAPS_LOGD("here_error_e = %d", ret);
return ConvertToMapsError(ret);
}
-EXPORT_API int maps_plugin_get_scalebar(bool *enabled)
+EXPORT_API int maps_plugin_get_scalebar(maps_view_h hView, bool *enabled)
{
- int ret = HerePluginGetScalebar(enabled);
+ int ret = HerePluginGetScalebar(hView, enabled);
return ConvertToMapsError(ret);
}
-EXPORT_API int maps_plugin_draw_map(Evas* canvas, const int x, const int y,
- const int width, const int height)
+EXPORT_API int maps_plugin_draw_map(maps_view_h hView, Evas* canvas, const int x, const int y, const int width, const int height)
{
int ret = HerePluginDrawMap(canvas, x, y, width, height);
return ConvertToMapsError(ret);
}
-EXPORT_API int maps_plugin_get_center(maps_coordinates_h *center)
+EXPORT_API int maps_plugin_get_center(maps_view_h hView, maps_coordinates_h *center)
{
- int ret = HerePluginGetCenter(center);
+ int ret = HerePluginGetCenter(hView, center);
return ConvertToMapsError(ret);
}
-EXPORT_API int maps_plugin_screen_to_geography(const int x, const int y,
- maps_coordinates_h *mapsCoord)
+EXPORT_API int maps_plugin_screen_to_geography(maps_view_h hView, const int x, const int y, maps_coordinates_h *mapsCoord)
{
- int ret = HerePluginScreenToGeography(x, y, mapsCoord);
+ int ret = HerePluginScreenToGeography(hView, x, y, mapsCoord);
return ConvertToMapsError(ret);
}
-EXPORT_API int maps_plugin_geography_to_screen(const maps_coordinates_h mapsCoord,
- int* x, int* y)
+EXPORT_API int maps_plugin_geography_to_screen(maps_view_h hView, const maps_coordinates_h mapsCoord, int* x, int* y)
{
- int ret = HerePluginGeographyToScreen(mapsCoord, x, y);
+ int ret = HerePluginGeographyToScreen(hView, mapsCoord, x, y);
return ConvertToMapsError(ret);
}
-EXPORT_API int maps_plugin_get_min_zoom_level(int *min_zoom_level)
+EXPORT_API int maps_plugin_get_min_zoom_level(maps_view_h hView, int *min_zoom_level)
{
- int ret = HerePluginGetMinZoomLevel(min_zoom_level);
+ int ret = HerePluginGetMinZoomLevel(hView, min_zoom_level);
return ConvertToMapsError(ret);
}
-EXPORT_API int maps_plugin_get_max_zoom_level(int *max_zoom_level)
+EXPORT_API int maps_plugin_get_max_zoom_level(maps_view_h hView, int *max_zoom_level)
{
- int ret = HerePluginGetMaxZoomLevel(max_zoom_level);
+ int ret = HerePluginGetMaxZoomLevel(hView, max_zoom_level);
return ConvertToMapsError(ret);
}
-EXPORT_API int maps_plugin_on_object(const maps_view_object_h object,
- const maps_view_object_operation_e operation)
+EXPORT_API int maps_plugin_on_object(maps_view_h hView, const maps_view_object_h object, const maps_view_object_operation_e operation)
{
- int ret = HerePluginOnViewObject(object, operation);
+ int ret = HerePluginOnViewObject(hView, object, operation);
if (ret != HERE_ERROR_NONE)
MAPS_LOGD("here_error_e = %d", ret);
HERE_PLUGIN_BEGIN_NAMESPACE
-GLData *HereView::m_pImpl = NULL;
-
HereView::HereView(void *pCbFunc, void *pUserData, int nReqId)
{
m_pCbFunc = pCbFunc;
{
}
-GLData* HereView::GetImplHandler()
-{
- return m_pImpl;
-}
-
here_error_e HereView::Init(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc)
{
+ GLData *m_pImpl = NULL;
+
if (!hView)
return HERE_ERROR_INVALID_PARAMETER;
- if (m_pImpl)
- return HERE_ERROR_INVALID_OPERATION;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
if (!m_pImpl)
{
if (!m_pImpl)
return HERE_ERROR_INVALID_PARAMETER;
- m_pImpl->idler = ecore_idler_add(__idlerCb, (void*)m_pImpl);
+ maps_view_set_maps_plugin_view_handle(hView, (void *)m_pImpl);
+
+ m_pImpl->idler = ecore_idler_add(__idlerCb, (void*)hView);
m_pImpl->readyCb = NULL;
- }
+ } else
+ return HERE_ERROR_INVALID_OPERATION;
here_error_e error = HERE_ERROR_NONE;
int error2 = MAPS_ERROR_NONE;
error2 = maps_view_get_screen_location(hView, &m_pImpl->x, &m_pImpl->y, &m_pImpl->w, &m_pImpl->h);
if (error2 != MAPS_ERROR_NONE) break;
- m_pImpl->hView = hView;
-
error = InitOpenGL(m_pImpl);
if (error != HERE_ERROR_NONE) break;
- error = InitOpenGLSurface(m_pImpl);
+ error = InitOpenGLSurface(hView);
if (error != HERE_ERROR_NONE) break;
- error = InitMap(m_pImpl, pCbFunc);
+ error = InitMap(hView, m_pImpl, pCbFunc);
} while(0);
if (error == HERE_ERROR_NONE && error2 != MAPS_ERROR_NONE)
return HERE_ERROR_NONE;
}
-here_error_e HereView::InitOpenGLSurface(GLData *gld)
+here_error_e HereView::InitOpenGLSurface(maps_view_h hView)
{
- if (!gld || !gld->gl || !gld->cfg || !gld->img || !gld->ctx)
+ if (!hView)
return HERE_ERROR_INVALID_PARAMETER;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
+ if (!m_pImpl || !m_pImpl->gl || !m_pImpl->cfg || !m_pImpl->img || !m_pImpl->ctx)
+ return HERE_ERROR_INVALID_PARAMETER;
- evas_object_image_pixels_get_callback_set(gld->img, NULL, NULL);
+ evas_object_image_pixels_get_callback_set(m_pImpl->img, NULL, NULL);
- if (gld->sfc)
+ if (m_pImpl->sfc)
{
- evas_object_image_native_surface_set(gld->img, NULL);
- evas_gl_surface_destroy(gld->gl, gld->sfc);
+ evas_object_image_native_surface_set(m_pImpl->img, NULL);
+ evas_gl_surface_destroy(m_pImpl->gl, m_pImpl->sfc);
}
m_pImpl->w = MAX(m_pImpl->w, 1);
m_pImpl->h = MAX(m_pImpl->h, 1);
- evas_object_image_size_set(gld->img, gld->w, gld->h);
+ evas_object_image_size_set(m_pImpl->img, m_pImpl->w, m_pImpl->h);
Evas_Native_Surface ns;
- gld->sfc = evas_gl_surface_create(gld->gl, gld->cfg, gld->w, gld->h);
- if (!gld->sfc)
+ m_pImpl->sfc = evas_gl_surface_create(m_pImpl->gl, m_pImpl->cfg, m_pImpl->w, m_pImpl->h);
+ if (!m_pImpl->sfc)
{
MAPS_LOGE("evas_gl_surface_create() failed");
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
}
- if (!evas_gl_native_surface_get(gld->gl, gld->sfc, &ns))
+ if (!evas_gl_native_surface_get(m_pImpl->gl, m_pImpl->sfc, &ns))
{
- evas_gl_make_current(gld->gl, NULL, NULL);
- evas_gl_surface_destroy(gld->gl, gld->sfc);
- gld->sfc = NULL;
+ evas_gl_make_current(m_pImpl->gl, NULL, NULL);
+ evas_gl_surface_destroy(m_pImpl->gl, m_pImpl->sfc);
+ m_pImpl->sfc = NULL;
MAPS_LOGE("evas_gl_native_surface_get() faile");
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
}
- evas_object_image_native_surface_set(gld->img, &ns);
+ evas_object_image_native_surface_set(m_pImpl->img, &ns);
- evas_object_image_pixels_get_callback_set(gld->img, __pixelGetCb, this);
+ evas_object_image_pixels_get_callback_set(m_pImpl->img, __pixelGetCb, hView);
- gld->isInitialized = true;
+ m_pImpl->isInitialized = true;
//MAPS_LOGD("initializing is Done!!!");
return HERE_ERROR_NONE;
}
-here_error_e HereView::InitMap(GLData *gld, maps_plugin_map_view_ready_cb pCbFunc)
+here_error_e HereView::InitMap(maps_view_h hView, GLData *gld, maps_plugin_map_view_ready_cb pCbFunc)
{
- if (!gld)
+ if (!hView || !gld)
return HERE_ERROR_INVALID_PARAMETER;
gld->map = new (std::nothrow) GeoTiledMap();
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!gld->map)
return HERE_ERROR_OUT_OF_MEMORY;
gld->readyCb = pCbFunc;
- gld->map->SetReadyMapSignal((GeoTiledMap::ReadyMapSignalFunctor)__readyCb);
+ gld->map->SetReadyMapSignal((GeoTiledMap::ReadyMapSignalFunctor)__readyCb, (void *)hView);
gld->map->SetEvasGlApi(gld->api);
return HERE_ERROR_NONE;
}
-here_error_e HereView::Close()
+here_error_e HereView::Close(maps_view_h hView)
{
+ if (!hView)
+ return HERE_ERROR_INVALID_PARAMETER;
+
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
+ if (!m_pImpl)
+ return HERE_ERROR_INVALID_OPERATION;
+
if (m_pImpl)
{
m_pImpl->isInitialized = false;
return HERE_ERROR_NONE;
}
-void HereView::__readyCb()
+void HereView::__readyCb(void *data)
{
+ if (!data)
+ return;
+
+ maps_view_h hView = (maps_view_h)data;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (m_pImpl->readyCb)
- m_pImpl->readyCb(m_pImpl->hView);
+ m_pImpl->readyCb(hView);
}
void HereView::__pixelGetCb(void *data, Evas_Object *obj)
{
+ if (!data)
+ return;
+
+ maps_view_h hView = (maps_view_h)data;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!m_pImpl || !m_pImpl->map) return;
if (!m_pImpl->gl || !m_pImpl->sfc || !m_pImpl->ctx) return;
evas_object_image_pixels_dirty_set((Evas_Object*)data, EINA_TRUE);
}
-void HereView::__setMapType()
+void HereView::__setMapType(maps_view_h hView)
{
+ if (!hView)
+ return;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
/* When the theme is changed, clear cache */
maps_view_type_e map_type;
- maps_view_get_type(m_pImpl->hView, &map_type);
+ maps_view_get_type(hView, &map_type);
bool buildings_enabled = false;
- maps_view_get_buildings_enabled(m_pImpl->hView, &buildings_enabled);
+ maps_view_get_buildings_enabled(hView, &buildings_enabled);
bool traffic_enabled = false;
- maps_view_get_traffic_enabled(m_pImpl->hView, &traffic_enabled);
+ maps_view_get_traffic_enabled(hView, &traffic_enabled);
bool public_transit_enabled = false;
}
}
-here_error_e HereView::RenderMap(const maps_coordinates_h mapsCoord, double dZoom, double dAngle)
+here_error_e HereView::RenderMap(maps_view_h hView, const maps_coordinates_h mapsCoord, double dZoom, double dAngle)
{
+ if (!hView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !m_pImpl->api)
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
return HERE_ERROR_INVALID_PARAMETER;
/* set map type */
- __setMapType();
+ __setMapType(hView);
/* resize window */
int x, y, w, h;
- maps_view_get_screen_location(m_pImpl->hView, &x, &y, &w, &h);
+ maps_view_get_screen_location(hView, &x, &y, &w, &h);
m_pImpl->w = MAX(m_pImpl->w, 1);
m_pImpl->h = MAX(m_pImpl->h, 1);
m_pImpl->api->glViewport(0, 0, m_pImpl->w, m_pImpl->h);
m_pImpl->map->SetMapSize(Dimension(m_pImpl->w,m_pImpl->h));
- InitOpenGLSurface(m_pImpl);
+ InitOpenGLSurface(hView);
}
/* callback */
return HERE_ERROR_NONE;
}
-here_error_e HereView::RenderMapByArea(const maps_area_h hArea, double dZoom, double dAngle)
+here_error_e HereView::RenderMapByArea(maps_view_h hView, const maps_area_h hArea, double dZoom, double dAngle)
{
+ if (!hView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !m_pImpl->map->GetRootPixmap() || !m_pImpl->api)
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
return HERE_ERROR_NONE;
}
-here_error_e HereView::MoveCenter(int delta_x, int delta_y)
+here_error_e HereView::MoveCenter(maps_view_h hView, int delta_x, int delta_y)
{
+ if (!hView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !m_pImpl->map->GetRootPixmap() || !m_pImpl->api)
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
return HERE_ERROR_NONE;
}
-here_error_e HereView::SetScalebar(bool enable)
+here_error_e HereView::SetScalebar(maps_view_h hView, bool enable)
{
+ if (!hView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
return HERE_ERROR_NONE;
}
-here_error_e HereView::GetScalebar(bool *enabled)
+here_error_e HereView::GetScalebar(maps_view_h hView, bool *enabled)
{
+ if (!hView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !enabled)
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
return HERE_ERROR_NONE;
}
-here_error_e HereView::DrawMap(Evas* pCanvas, int x, int y, int nWidth, int nHeight)
+here_error_e HereView::DrawMap(maps_view_h hView, Evas* pCanvas, int x, int y, int nWidth, int nHeight)
{
+ if (!hView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !m_pImpl->map->GetRootPixmap() || !m_pImpl->api)
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
return HERE_ERROR_NONE;
}
-here_error_e HereView::GetCenter(maps_coordinates_h *center)
+here_error_e HereView::GetCenter(maps_view_h hView, maps_coordinates_h *center)
{
+ if (!hView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!center)
return HERE_ERROR_INVALID_PARAMETER;
return HERE_ERROR_NONE;
}
-here_error_e HereView::ScreenToGeolocation(int x, int y, maps_coordinates_h *mapsCoord)
+here_error_e HereView::ScreenToGeolocation(maps_view_h hView, int x, int y, maps_coordinates_h *mapsCoord)
{
+ if (!hView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
return HERE_ERROR_NONE;
}
-here_error_e HereView::GeolocationToScreen(const maps_coordinates_h mapsCoord, int *x, int *y)
+here_error_e HereView::GeolocationToScreen(maps_view_h hView, const maps_coordinates_h mapsCoord, int *x, int *y)
{
+ if (!hView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
return HERE_ERROR_NONE;
}
-here_error_e HereView::GetMinZoomLevel(int *nMinZoomLevel)
+here_error_e HereView::GetMinZoomLevel(maps_view_h hView, int *nMinZoomLevel)
{
+ if (!hView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
return HERE_ERROR_NONE;
}
-here_error_e HereView::GetMaxZoomLevel(int *nMaxZoomLevel)
+here_error_e HereView::GetMaxZoomLevel(maps_view_h hView, int *nMaxZoomLevel)
{
+ if (!hView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
return HERE_ERROR_NONE;
}
-here_error_e HereView::OnViewObject(const maps_view_object_h object, maps_view_object_operation_e operation)
+here_error_e HereView::OnViewObject(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation)
{
+ if (!hView)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
return HERE_ERROR_SERVICE_NOT_AVAILABLE;
return HERE_ERROR_INVALID_PARAMETER;
if (m_pImpl->map->GetRootPixmap())
- __processViewObject(object, operation);
+ __processViewObject(hView, object, operation);
else
m_pImpl->pendingObjects.push_back(std::make_pair(object, operation));
Eina_Bool HereView::__idlerCb(void *data)
{
- GLData *pImpl = (GLData*)data;
+ if (!data) return false;
+ maps_view_h hView = (maps_view_h)data;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
- if (!pImpl || !pImpl->map || !pImpl->map->GetRootPixmap()) return true;
+ if (!m_pImpl || !m_pImpl->map || !m_pImpl->map->GetRootPixmap()) return true;
- while (pImpl->pendingObjects.size())
+ while (m_pImpl->pendingObjects.size())
{
- PendingObject pending = pImpl->pendingObjects.front();
- pImpl->pendingObjects.pop_front();
+ PendingObject pending = m_pImpl->pendingObjects.front();
+ m_pImpl->pendingObjects.pop_front();
maps_view_object_h object = pending.first;
maps_view_object_operation_e operation = pending.second;
- __processViewObject(object, operation);
+ __processViewObject(hView, object, operation);
}
return true;
}
-void HereView::__processViewObject(const maps_view_object_h object, maps_view_object_operation_e operation)
+void HereView::__processViewObject(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation)
{
+ if (!hView)
+ return;
+ GLData *m_pImpl = NULL;
+ maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
+
maps_view_object_type_e type;
maps_view_object_get_type(object, &type);
switch(operation)
{
- case MAPS_VIEW_OBJECT_ADD: m_pImpl->visualObjects.add(object); break;
- case MAPS_VIEW_OBJECT_SET_VISIBLE: m_pImpl->visualObjects.setVisible(object); break;
+ case MAPS_VIEW_OBJECT_ADD: m_pImpl->visualObjects.add(object); break;
+ case MAPS_VIEW_OBJECT_SET_VISIBLE: m_pImpl->visualObjects.setVisible(object); break;
case MAPS_VIEW_OBJECT_CHANGE: m_pImpl->visualObjects.update(object); break;
case MAPS_VIEW_OBJECT_REMOVE: m_pImpl->visualObjects.remove(object); break;
default: break;