modified intermediate APIs for maps-widget between maps-service and plug-in 59/73259/4 accepted/tizen/ivi/20160607.235735 accepted/tizen/mobile/20160607.235740 accepted/tizen/tv/20160607.235649 accepted/tizen/wearable/20160607.235704 submit/tizen/20160607.104438
authorchanywa <cbible.kim@samsung.com>
Tue, 7 Jun 2016 09:39:55 +0000 (18:39 +0900)
committerchanywa <cbible.kim@samsung.com>
Tue, 7 Jun 2016 10:19:06 +0000 (19:19 +0900)
Change-Id: Ia84753b81d177f5e4687a24030e663286fbdd914
Signed-off-by: chanywa <cbible.kim@samsung.com>
inc/here_api.h [changed mode: 0644->0755]
inc/here_utils.h
inc/here_view.h
maps-plugin-here.changes
packaging/maps-plugin-here.spec
src/here_api.cpp
src/here_manager.cpp
src/here_plugin.cpp
src/here_view.cpp [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index daf9ca8..3d6440a
@@ -87,14 +87,9 @@ int HerePluginCreateMapView(maps_view_h hView, maps_plugin_map_view_ready_cb pCb
 
 int HerePluginDestroyMapView(maps_view_h hView);
 
-int HerePluginRenderMap(maps_view_h hView, const maps_coordinates_h mapsCoord, double dZoom, double dAngle,
-       maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId);
+int HerePluginRenderMap(maps_view_h hView, const maps_coordinates_h mapsCoord, double dZoom, double dAngle);
 
-int HerePluginRenderMapArea(maps_view_h hView, const maps_area_h hArea, double dZoom, double dAngle,
-       maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId);
-
-int HerePluginMoveCenter(maps_view_h hView, int delta_x, int delta_y,
-       maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId);
+int HerePluginMoveCenter(maps_view_h hView, int delta_x, int delta_y);
 
 int HerePluginSetScalebar(maps_view_h hView, bool enable);
 
index 75333bc..d9e8b35 100644 (file)
@@ -145,8 +145,6 @@ public:
        static bool IsValid(maps_coordinates_s geoCoord);
        static bool IsValidCoord(double dLat, double dLng);
        static bool IsValid(maps_area_s hArea);
-
-private:
 };
 
 HERE_PLUGIN_END_NAMESPACE
index fd4c0d3..587fa1c 100644 (file)
@@ -42,71 +42,61 @@ HERE_PLUGIN_BEGIN_NAMESPACE
 
 using namespace HERE_MAPS_NAMESPACE_PREFIX;
 
-
-typedef struct _GLData
-{
-       Here::Maps::GeoTiledMap *map;
-
-       Evas_Object     *img;
-       Evas_GL_Context *ctx;
-       Evas_GL_Surface *sfc;
-       Evas_GL_Config  *cfg;
-       Evas_GL         *gl;
-       Evas_GL_API     *api;
-
-       bool isInitialized;
-
-       int x, y, w, h;
-       double lat, lng, zoom, angle;
-
-       // to remove // UpdatedObjects updatedObjects;
-       HereViewObjects visualObjects;
-       PendingObjects pendingObjects;
-       Ecore_Idler *idler;
-       bool redraw;
-
-       maps_plugin_map_view_ready_cb readyCb;
-} GLData;
-
 class HereView
 : public HereBase
 {
 public:
-       HereView(void *pCbFunc, void *pUserData, int nReqId);
+       HereView();
        ~HereView();
 
        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 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 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 GetCenter(maps_view_h hView, maps_coordinates_h *center);
        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);
-       static GLData* GetImplHandler();
+       here_error_e GetMinZoomLevel(maps_view_h hView, int *nMinZoomLevel);
+       here_error_e GetMaxZoomLevel(maps_view_h hView, int *nMaxZoomLevel);
+       here_error_e OnViewObject(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation);
 
 private:
-
-       here_error_e InitOpenGL(GLData *gld);
-       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);
+       here_error_e __initOpenGL();
+       here_error_e __initOpenGLSurface(maps_view_h hView);
+       here_error_e __initMap(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc);
+       static void __readyMapCb(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(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation);
        void __setMapType(maps_view_h hView);
 
+private:
+       Here::Maps::GeoTiledMap *__map;
+
+       Evas_Object     *__img;
+       Evas_GL_Context *__ctx;
+       Evas_GL_Surface *__sfc;
+       Evas_GL_Config  *__cfg;
+       Evas_GL         *__gl;
+       Evas_GL_API     *__api;
+
+       bool __isInitialized;
+
+       int __x, __y, __w, __h;
+       double __lat, __lng, __zoom, __angle;
+
+       HereViewObjects __visualObjects;
+       PendingObjects __pendingObjects;
+       Ecore_Idler *__idler;
+       bool __redraw;
+
+       maps_plugin_map_view_ready_cb __readyCb;
 };
 
 HERE_PLUGIN_END_NAMESPACE
index a01bb42..a234461 100644 (file)
@@ -1,3 +1,8 @@
+[Version]   maps-plugin-here_0.3.2
+[Date]      07 June 2016
+[Title]     modified internal APIs for maps-service
+[Developer] Seechan Kim <cbible.kim@samsung.com>
+
 [Version]   maps-plugin-here_0.3.0
 [Date]      18 April 2016
 [Title]     Added new Maps View APIs
index 202e620..442dc7b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       maps-plugin-here
 Summary:    Tizen HERE Maps Plug-in Library
-Version:    0.3.1
+Version:    0.3.2
 Release:    1
 Group:      Location/Libraries
 License:    Apache-2.0 and HERE
index 40df814..592e53d 100644 (file)
@@ -661,154 +661,74 @@ int HerePluginCancelRequest(int nReqId)
        return (HereManager::GetHandler()->CancelInstance(nReqId));
 }
 
+/*****************************************************************************/
+/*                                                                           */
+/*  Maps Widget                                                              */
+/*                                                                           */
+/*****************************************************************************/
+
 int HerePluginCreateMapView(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc)
 {
-       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->Init(hView, pCbFunc);
-
-       delete pView;
-
-       return error;
+       HereView *vh = NULL, *ovh = NULL;
+       vh = new HereView();
+       if (!vh) return HERE_ERROR_OUT_OF_MEMORY;
+       maps_view_get_maps_plugin_view_handle(hView, (void**)&ovh);
+       maps_view_set_maps_plugin_view_handle(hView, vh);
+       if (ovh)
+               delete ovh;
+       return vh->Init(hView, pCbFunc);
 }
 
 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, double dZoom, double dAngle,
-       maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId)
-{
-       if (!hView || !mapsCoord || !pCbFunc || !nReqId)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       if (!HereManager::GetHandler())
-               return HERE_ERROR_INVALID_OPERATION;
-
-       HereView *pView =
-               (HereView*)(HereManager::GetHandler()->CreateInstance(HereManager::HERE_SVC_VIEW,
-               (void*)pCbFunc, pUserData, nReqId));
-
-       if(!pView)
-               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
-
-       /* sending request */
-       here_error_e error = pView->RenderMap(hView, mapsCoord, dZoom, dAngle);
-       delete pView;
-
+       HereView *vh = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh);
+       here_error_e error = (here_error_e)ConvertToHereError(maps_error);
+       if (error == HERE_ERROR_NONE && vh) {
+               maps_view_set_maps_plugin_view_handle(hView, NULL);
+               error = vh->Close(hView);
+               delete vh;
+       }
        return error;
 }
 
-int HerePluginRenderMapArea(maps_view_h hView, const maps_area_h hArea, double dZoom, double dAngle,
-       maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId)
+int HerePluginRenderMap(maps_view_h hView, const maps_coordinates_h mapsCoord, double dZoom, double dAngle)
 {
-       if (!hView || !hArea || !pCbFunc || !nReqId)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       if (!HereManager::GetHandler())
-               return HERE_ERROR_INVALID_OPERATION;
-
-       HereView *pView =
-               (HereView*)(HereManager::GetHandler()->CreateInstance(HereManager::HERE_SVC_VIEW,
-               (void*)pCbFunc, pUserData, nReqId));
-
-       if(!pView)
-               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
-
-       /* sending request */
-       here_error_e error = pView->RenderMapByArea(hView, hArea, dZoom, dAngle);
-       delete pView;
-
+       HereView *vh = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh);
+       here_error_e error = (here_error_e)ConvertToHereError(maps_error);
+       if (error == HERE_ERROR_NONE && vh)
+               error = vh->RenderMap(hView, mapsCoord, dZoom, dAngle);
        return error;
 }
 
-int HerePluginMoveCenter(maps_view_h hView, int delta_x, int delta_y,
-       maps_plugin_render_map_cb pCbFunc, void* pUserData, int* nReqId)
+int HerePluginMoveCenter(maps_view_h hView, int delta_x, int delta_y)
 {
-       if (!hView || !pCbFunc || !nReqId)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       if (!HereManager::GetHandler())
-               return HERE_ERROR_INVALID_OPERATION;
-
-       HereView *pView =
-               (HereView*)(HereManager::GetHandler()->CreateInstance(HereManager::HERE_SVC_VIEW,
-               (void*)pCbFunc, pUserData, nReqId));
-
-       if(!pView)
-               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
-
-       /* sending request */
-       here_error_e error = pView->MoveCenter(hView, delta_x, delta_y);
-       delete pView;
-
+       HereView *vh = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh);
+       here_error_e error = (here_error_e)ConvertToHereError(maps_error);
+       if (error == HERE_ERROR_NONE && vh)
+               error = vh->MoveCenter(hView, delta_x, delta_y);
        return error;
 }
 
 int HerePluginSetScalebar(maps_view_h hView, bool enable)
 {
-       if (!hView || !HereManager::GetHandler())
-               return HERE_ERROR_INVALID_OPERATION;
-
-       HereView *pView =
-               (HereView*)(HereManager::GetHandler()->CreateInstance(HereManager::HERE_SVC_VIEW));
-
-       if(!pView)
-               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
-
-       /* sending request */
-       here_error_e error = pView->SetScalebar(hView, enable);
-       delete pView;
-
+       HereView *vh = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh);
+       here_error_e error = (here_error_e)ConvertToHereError(maps_error);
+       if (error == HERE_ERROR_NONE && vh)
+               error = vh->SetScalebar(hView, enable);
        return error;
 }
 
 int HerePluginGetScalebar(maps_view_h hView, bool *enabled)
 {
-       if (!hView || !enabled)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       if (!HereManager::GetHandler())
-               return HERE_ERROR_INVALID_OPERATION;
-
-       HereView *pView =
-               (HereView*)(HereManager::GetHandler()->CreateInstance(HereManager::HERE_SVC_VIEW));
-
-       if(!pView)
-               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
-
-       here_error_e error = pView->GetScalebar(hView, enabled);
-       delete pView;
-
+       HereView *vh = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh);
+       here_error_e error = (here_error_e)ConvertToHereError(maps_error);
+       if (error == HERE_ERROR_NONE && vh)
+               error = vh->GetScalebar(hView, enabled);
        return error;
 }
 
@@ -819,90 +739,60 @@ int HerePluginDrawMap(maps_view_h hView, Evas* pCanvas, int x, int y, int w, int
 
 int HerePluginGetCenter(maps_view_h hView, maps_coordinates_h *center)
 {
-       if (!hView || !center)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       if (!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 = pView->GetCenter(hView, center);
-       delete pView;
-
+       HereView *vh = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh);
+       here_error_e error = (here_error_e)ConvertToHereError(maps_error);
+       if (error == HERE_ERROR_NONE && vh)
+               error = vh->GetCenter(hView, center);
        return error;
 }
 
 int HerePluginScreenToGeography(maps_view_h hView, int x, int y, maps_coordinates_h *mapsCoord)
 {
-       if (!hView || !mapsCoord)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       if (!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 = pView->ScreenToGeolocation(hView, x, y, mapsCoord);
-       delete pView;
-
+       HereView *vh = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh);
+       here_error_e error = (here_error_e)ConvertToHereError(maps_error);
+       if (error == HERE_ERROR_NONE && vh)
+               error = vh->ScreenToGeolocation(hView, x, y, mapsCoord);
        return error;
 }
 
 int HerePluginGeographyToScreen(maps_view_h hView, const maps_coordinates_h mapsCoord, int *x, int *y)
 {
-       if (!hView || !mapsCoord || !x || !y)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       if (!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 = pView->GeolocationToScreen(hView, mapsCoord, x, y);
-       delete pView;
-
+       HereView *vh = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh);
+       here_error_e error = (here_error_e)ConvertToHereError(maps_error);
+       if (error == HERE_ERROR_NONE && vh)
+               error = vh->GeolocationToScreen(hView, mapsCoord, x, y);
        return error;
 }
 
 int HerePluginGetMinZoomLevel(maps_view_h hView, int *nMinZoomLevel)
 {
-       if (!hView)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       return HereView::GetMinZoomLevel(hView, nMinZoomLevel);
+       HereView *vh = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh);
+       here_error_e error = (here_error_e)ConvertToHereError(maps_error);
+       if (error == HERE_ERROR_NONE && vh)
+               error = vh->GetMinZoomLevel(hView, nMinZoomLevel);
+       return error;
 }
 
 int HerePluginGetMaxZoomLevel(maps_view_h hView, int *nMaxZoomLevel)
 {
-       if (!hView)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       return HereView::GetMaxZoomLevel(hView, nMaxZoomLevel);
+       HereView *vh = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh);
+       here_error_e error = (here_error_e)ConvertToHereError(maps_error);
+       if (error == HERE_ERROR_NONE && vh)
+               error = vh->GetMaxZoomLevel(hView, nMaxZoomLevel);
+       return error;
 }
 
 int HerePluginOnViewObject(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation)
 {
-       if (!hView)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       return HereView::OnViewObject(hView, object, operation);
+       HereView *vh = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&vh);
+       here_error_e error = (here_error_e)ConvertToHereError(maps_error);
+       if (error == HERE_ERROR_NONE && vh)
+               error = vh->OnViewObject(hView, object, operation);
+       return error;
 }
index 02e06d8..ab04411 100644 (file)
@@ -143,7 +143,7 @@ void* HereManager::CreateInstance(HereSvcType nHereSvc, void* pCbFunc,
                break;
 
        case HERE_SVC_VIEW:
-               pHere = (HereBase*)new (std::nothrow) HereView(pCbFunc, pUserData, reqId);
+               pHere = (HereBase*)new (std::nothrow) HereView();
                break;
 
        default:
index f1a2bb9..018d05f 100644 (file)
@@ -29,7 +29,7 @@ EXPORT_API int maps_plugin_init(maps_plugin_h *plugin)
 {
        int ret = HerePluginInit(plugin);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -38,7 +38,7 @@ EXPORT_API int maps_plugin_init_module(maps_plugin_h *plugin, const char *module
 {
        int ret = HerePluginInit(plugin, module);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -47,7 +47,7 @@ EXPORT_API int maps_plugin_shutdown(maps_plugin_h plugin)
 {
        int ret = HerePluginShutdown(plugin);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -66,7 +66,7 @@ EXPORT_API int maps_plugin_set_provider_key(const char* provider_key)
 {
        int ret = HerePluginSetProviderKey(provider_key);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -75,7 +75,7 @@ EXPORT_API int maps_plugin_get_provider_key(char** provider_key)
 {
        int ret = HerePluginGetProviderKey(provider_key);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -84,7 +84,7 @@ EXPORT_API int maps_plugin_set_preference(maps_preference_h preference)
 {
        int ret = HerePluginSetPreference(preference);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -93,7 +93,7 @@ EXPORT_API int maps_plugin_get_preference(maps_preference_h* preference)
 {
        int ret = HerePluginGetPreference(preference);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -166,7 +166,7 @@ EXPORT_API int maps_plugin_geocode(const char* address, const maps_preference_h
 {
        int ret = HerePluginGeocode(address, preference, callback, user_data, request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -177,7 +177,7 @@ EXPORT_API int maps_plugin_geocode_inside_area(const char* address, const maps_a
 {
        int ret = HerePluginGeocodeInsideArea(address, bounds, preference, callback, user_data, request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -188,7 +188,7 @@ EXPORT_API int maps_plugin_geocode_by_structured_address(const maps_address_h ad
 {
        int ret = HerePluginGeocodeByStructuredAddress(address, preference, callback, user_data, request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -199,7 +199,7 @@ EXPORT_API int maps_plugin_reverse_geocode(double latitude, double longitude,
 {
        int ret = HerePluginReverseGeocode(latitude, longitude, preference, callback, user_data, request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -210,7 +210,7 @@ EXPORT_API int maps_plugin_multi_reverse_geocode(const maps_coordinates_list_h g
 {
        int ret = HerePluginMultiReverseGeocode(geocode_list, preference, callback, user_data, request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -221,7 +221,7 @@ EXPORT_API int maps_plugin_search_place(const maps_coordinates_h position, int d
 {
        int ret = HerePluginSearchPlace(position, distance, preference, filter, callback, user_data, request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -232,7 +232,7 @@ EXPORT_API int maps_plugin_search_place_by_area(const maps_area_h boundary,
 {
        int ret = HerePluginSearchPlaceByArea(boundary, preference, filter, callback, user_data, request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -243,7 +243,7 @@ EXPORT_API int maps_plugin_search_place_by_address(const char* address, const ma
 {
        int ret = HerePluginSearchPlaceByAddress(address, boundary, preference, filter, callback, user_data, request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -253,7 +253,7 @@ EXPORT_API int maps_plugin_search_place_list(const maps_area_h boundary, const m
 {
        int ret = HerePluginSearchPlaceList(boundary, preference, filter, callback, user_data, request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -263,7 +263,7 @@ EXPORT_API int maps_plugin_get_place_details(const char* url,
 {
        int ret = HerePluginSearchPlaceDetails(url, callback, user_data, request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -273,7 +273,7 @@ EXPORT_API int maps_plugin_search_route(const maps_coordinates_h origin, const m
 {
        int ret = HerePluginSearchRoute(origin, destination, preference, callback, user_data, request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -284,7 +284,7 @@ EXPORT_API int maps_plugin_search_route_waypoints(const maps_coordinates_h* wayp
 {
        int ret = HerePluginSearchRouteWaypoints(waypoint_list, waypoint_num, preference, callback, user_data, request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -293,7 +293,7 @@ EXPORT_API int maps_plugin_cancel_request(int request_id)
 {
        int ret = HerePluginCancelRequest(request_id);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -303,7 +303,7 @@ EXPORT_API int maps_plugin_create_map_view(maps_view_h hView, maps_plugin_map_vi
 {
        int ret = HerePluginCreateMapView(hView, pCbFunc);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -312,7 +312,7 @@ EXPORT_API int maps_plugin_destroy_map_view(maps_view_h hView)
 {
        int ret = HerePluginDestroyMapView(hView);
 
-       MAPS_LOGD("here_error_e = %d", ret);
+       MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -321,24 +321,10 @@ EXPORT_API int maps_plugin_render_map(maps_view_h hView,
        const maps_coordinates_h coordinates, double zoom_factor, double rotation_angle,
        maps_plugin_render_map_cb callback, void* user_data, int* request_id)
 {
-       int ret = HerePluginRenderMap(hView, coordinates, zoom_factor, rotation_angle,
-                               callback, user_data, request_id);
+       int ret = HerePluginRenderMap(hView, coordinates, zoom_factor, rotation_angle);
 
        if (ret != HERE_ERROR_NONE)
-               MAPS_LOGD("here_error_e = %d", ret);
-
-       return ConvertToMapsError(ret);
-}
-
-EXPORT_API int maps_plugin_render_map_area(maps_view_h hView, const maps_area_h area,
-       double zoom_factor, double rotation_angle,
-       maps_plugin_render_map_cb callback, void* user_data, int* 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);
+               MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -346,10 +332,10 @@ EXPORT_API int maps_plugin_render_map_area(maps_view_h hView, const maps_area_h
 EXPORT_API int maps_plugin_move_center(maps_view_h hView, int delta_x, int delta_y,
        maps_plugin_render_map_cb callback, void* user_data, int* request_id)
 {
-       int ret = HerePluginMoveCenter(hView, delta_x, delta_y, callback, user_data, request_id);
+       int ret = HerePluginMoveCenter(hView, delta_x, delta_y);
 
        if (ret != HERE_ERROR_NONE)
-               MAPS_LOGD("here_error_e = %d", ret);
+               MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -359,7 +345,7 @@ EXPORT_API int maps_plugin_set_scalebar(maps_view_h hView, bool enable)
        int ret = HerePluginSetScalebar(hView, enable);
 
        if (ret != HERE_ERROR_NONE)
-               MAPS_LOGD("here_error_e = %d", ret);
+               MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -375,7 +361,7 @@ EXPORT_API int maps_plugin_draw_map(maps_view_h hView, Evas* canvas, int x, int
        int ret = HerePluginDrawMap(hView, canvas, x, y, w, h);
 
        if (ret != HERE_ERROR_NONE)
-               MAPS_LOGD("here_error_e = %d", ret);
+               MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
@@ -415,7 +401,7 @@ EXPORT_API int maps_plugin_on_object(maps_view_h hView, const maps_view_object_h
        int ret = HerePluginOnViewObject(hView, object, operation);
 
        if (ret != HERE_ERROR_NONE)
-               MAPS_LOGD("here_error_e = %d", ret);
+               MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
 
        return ConvertToMapsError(ret);
 }
old mode 100644 (file)
new mode 100755 (executable)
index ee4ba8e..f9c4d6e
@@ -24,11 +24,32 @@ static const char SIG_LOADED[] = "loaded";
 
 HERE_PLUGIN_BEGIN_NAMESPACE
 
-HereView::HereView(void *pCbFunc, void *pUserData, int nReqId)
+HereView::HereView()
 {
-       m_pCbFunc = pCbFunc;
-       m_pUserData = pUserData;
-       m_nReqId = nReqId;
+       __map = NULL;
+
+       __img = NULL;
+       __ctx = NULL;
+       __sfc = NULL;
+       __cfg = NULL;
+       __gl = NULL;
+       __api = NULL;
+
+       __isInitialized = false;
+
+       __x = 0;
+       __y = 0;
+       __w = 0;
+       __h = 0;
+
+       __lat = 0.;
+       __lng = 0.;
+       __zoom = 0.;
+       __angle = 0.;
+
+       __idler = NULL;
+       __redraw = false;
+       __readyCb = NULL;
 }
 
 HereView::~HereView()
@@ -37,44 +58,28 @@ HereView::~HereView()
 
 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;
 
-       maps_view_get_maps_plugin_view_handle(hView, (void **)&m_pImpl);
-
-       if (!m_pImpl)
-       {
-               m_pImpl = new (std::nothrow) GLData();
-
-               if (!m_pImpl)
-                       return HERE_ERROR_INVALID_PARAMETER;
-
-               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;
+       __idler = ecore_idler_add(__idlerCb, (void*)hView);
 
        here_error_e error = HERE_ERROR_NONE;
        int error2 = MAPS_ERROR_NONE;
 
        do {
-               error2 = maps_view_get_viewport(hView, &m_pImpl->img);
+               error2 = maps_view_get_viewport(hView, &__img);
                if (error2 != MAPS_ERROR_NONE) break;
 
-               error2 = maps_view_get_screen_location(hView, &m_pImpl->x, &m_pImpl->y, &m_pImpl->w, &m_pImpl->h);
+               error2 = maps_view_get_screen_location(hView, &__x, &__y, &__w, &__h);
                if (error2 != MAPS_ERROR_NONE) break;
 
-               error = InitOpenGL(m_pImpl);
+               error = __initOpenGL();
                if (error != HERE_ERROR_NONE) break;
 
-               error = InitOpenGLSurface(hView);
+               error = __initOpenGLSurface(hView);
                if (error != HERE_ERROR_NONE) break;
 
-               error = InitMap(hView, m_pImpl, pCbFunc);
+               error = __initMap(hView, pCbFunc);
        } while(0);
 
        if (error == HERE_ERROR_NONE && error2 != MAPS_ERROR_NONE)
@@ -83,41 +88,33 @@ here_error_e HereView::Init(maps_view_h hView, maps_plugin_map_view_ready_cb pCb
        return error;
 }
 
-here_error_e HereView::InitOpenGL(GLData *gld)
+here_error_e HereView::__initOpenGL()
 {
-       if (!gld)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-
-       gld->cfg = evas_gl_config_new();
-       if (!gld->cfg)
-       {
+       __cfg = evas_gl_config_new();
+       if (!__cfg) {
                MAPS_LOGE("evas_gl_config_new() failed");
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
        }
 
-       gld->cfg->color_format = EVAS_GL_RGBA_8888;    // Surface Color Format
-       gld->cfg->depth_bits   = EVAS_GL_DEPTH_NONE;   // Surface Depth Format
-       gld->cfg->stencil_bits = EVAS_GL_STENCIL_NONE; // Surface Stencil Format
-       gld->cfg->options_bits = EVAS_GL_OPTIONS_DIRECT; // Configuration options (here, no extra options)
+       __cfg->color_format = EVAS_GL_RGBA_8888;    // Surface Color Format
+       __cfg->depth_bits   = EVAS_GL_DEPTH_NONE;   // Surface Depth Format
+       __cfg->stencil_bits = EVAS_GL_STENCIL_NONE; // Surface Stencil Format
+       __cfg->options_bits = EVAS_GL_OPTIONS_DIRECT; // Configuration options (here, no extra options)
 
-       gld->gl = evas_gl_new(evas_object_evas_get(gld->img));
-       if (!gld->gl)
-       {
+       __gl = evas_gl_new(evas_object_evas_get(__img));
+       if (!__gl) {
                MAPS_LOGE("evas_gl_new() failed");
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
        }
 
-       gld->api = evas_gl_api_get(gld->gl);
-       if (!gld->api)
-       {
+       __api = evas_gl_api_get(__gl);
+       if (!__api) {
                MAPS_LOGE("evas_gl_api_get() failed");
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
        }
 
-       gld->ctx = evas_gl_context_create(gld->gl, NULL);
-       if (!gld->ctx)
-       {
+       __ctx = evas_gl_context_create(__gl, NULL);
+       if (!__ctx) {
                MAPS_LOGE("evas_gl_context_create() failed");
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
        }
@@ -125,83 +122,61 @@ here_error_e HereView::InitOpenGL(GLData *gld)
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::InitOpenGLSurface(maps_view_h hView)
+here_error_e HereView::__initOpenGLSurface(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 || !m_pImpl->gl || !m_pImpl->cfg || !m_pImpl->img || !m_pImpl->ctx)
+       if (!hView || !__gl || !__cfg || !__img || !__ctx)
                return HERE_ERROR_INVALID_PARAMETER;
 
-       evas_object_image_pixels_get_callback_set(m_pImpl->img, NULL, NULL);
+       evas_object_image_pixels_get_callback_set(__img, NULL, NULL);
 
-       if (m_pImpl->sfc)
-       {
-               evas_object_image_native_surface_set(m_pImpl->img, NULL);
-               evas_gl_surface_destroy(m_pImpl->gl, m_pImpl->sfc);
+       if (__sfc) {
+               evas_object_image_native_surface_set(__img, NULL);
+               evas_gl_surface_destroy(__gl, __sfc);
        }
 
-       m_pImpl->w = MAX(m_pImpl->w, 1);
-       m_pImpl->h = MAX(m_pImpl->h, 1);
+       __w = MAX(__w, 1);
+       __h = MAX(__h, 1);
 
-       evas_object_image_size_set(m_pImpl->img, m_pImpl->w, m_pImpl->h);
+       evas_object_image_size_set(__img, __w, __h);
 
        Evas_Native_Surface ns;
-       m_pImpl->sfc = evas_gl_surface_create(m_pImpl->gl, m_pImpl->cfg, m_pImpl->w, m_pImpl->h);
-       if (!m_pImpl->sfc)
-       {
+       __sfc = evas_gl_surface_create(__gl, __cfg, __w, __h);
+       if (!__sfc) {
                MAPS_LOGE("evas_gl_surface_create() failed");
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
        }
 
-       if (!evas_gl_native_surface_get(m_pImpl->gl, m_pImpl->sfc, &ns))
-       {
-               evas_gl_make_current(m_pImpl->gl, NULL, NULL);
-               evas_gl_surface_destroy(m_pImpl->gl, m_pImpl->sfc);
-               m_pImpl->sfc = NULL;
+       if (!evas_gl_native_surface_get(__gl, __sfc, &ns)) {
+               evas_gl_make_current(__gl, NULL, NULL);
+               evas_gl_surface_destroy(__gl, __sfc);
+               __sfc = NULL;
                MAPS_LOGE("evas_gl_native_surface_get() faile");
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
        }
 
-       evas_object_image_native_surface_set(m_pImpl->img, &ns);
-
-       evas_object_image_pixels_get_callback_set(m_pImpl->img, __pixelGetCb, hView);
-
-       m_pImpl->isInitialized = true;
-       //MAPS_LOGD("initializing is Done!!!");
+       evas_object_image_native_surface_set(__img, &ns);
+       evas_object_image_pixels_get_callback_set(__img, __pixelGetCb, hView);
+       __isInitialized = true;
 
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::InitMap(maps_view_h hView, GLData *gld, maps_plugin_map_view_ready_cb pCbFunc)
+here_error_e HereView::__initMap(maps_view_h hView,  maps_plugin_map_view_ready_cb pCbFunc)
 {
-       if (!hView || !gld)
+       if (!hView)
                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)
+       __map = new (std::nothrow) GeoTiledMap();
+       if (!__map)
                return HERE_ERROR_OUT_OF_MEMORY;
 
-       gld->readyCb = pCbFunc;
-
-       gld->map->SetReadyMapSignal((GeoTiledMap::ReadyMapSignalFunctor)__readyCb, (void *)hView);
+       __readyCb = pCbFunc;
 
-       gld->map->SetEvasGlApi(gld->api);
+       __map->SetReadyMapSignal((GeoTiledMap::ReadyMapSignalFunctor)__readyMapCb, (void *)hView);
+       __map->SetEvasGlApi(__api);
+       __map->SetMapSize(Dimension(__w,__h));
 
-       MAPS_LOGD("gld->api=%p, m_pImpl->api=%p", gld->api, m_pImpl->api);
-
-       gld->map->SetMapSize(Dimension(gld->w,gld->h));
-
-       //gld->map->SetUpdateMapSignal(RenderingCb, this);
-
-       m_pImpl->visualObjects.set(gld->map, evas_object_evas_get(gld->img));
+       __visualObjects.set(__map, evas_object_evas_get(__img));
 
        return HERE_ERROR_NONE;
 }
@@ -211,102 +186,62 @@ 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);
+       __isInitialized = false;
 
-       if (!m_pImpl)
-               return HERE_ERROR_INVALID_OPERATION;
+       __visualObjects.set(NULL, NULL);
 
-       if (m_pImpl)
-       {
-               m_pImpl->isInitialized = false;
-
-               if (m_pImpl->map)
-               {
-                       m_pImpl->map->SetUpdateMapSignal(NULL);
-               }
-
-               m_pImpl->visualObjects.set(NULL, NULL);
-
-               if (m_pImpl->img)
-               {
-                       evas_object_image_pixels_get_callback_set(m_pImpl->img, NULL, NULL);
-               }
-
-               if (m_pImpl->idler)
-               {
-                       ecore_idler_del(m_pImpl->idler);
-                       m_pImpl->idler = NULL;
-               }
-
-               if (m_pImpl->map)
-               {
-                       m_pImpl->map->SetUpdateMapSignal(NULL);
-                       delete m_pImpl->map;
-                       m_pImpl->map = NULL;
-               }
-
-               if (m_pImpl->gl)
-               {
-                       evas_gl_make_current(m_pImpl->gl, m_pImpl->sfc, m_pImpl->ctx);
-
-                       if (m_pImpl->sfc)
-                       {
-                               evas_object_image_native_surface_set(m_pImpl->img, NULL);
-                               evas_gl_surface_destroy(m_pImpl->gl, m_pImpl->sfc);
-                               m_pImpl->sfc = NULL;
-                       }
-
-                       if (m_pImpl->ctx)
-                       {
-                               evas_gl_context_destroy(m_pImpl->gl, m_pImpl->ctx);
-                               m_pImpl->ctx = NULL;
-                       }
-
-                       evas_gl_free(m_pImpl->gl);
-                       m_pImpl->gl = NULL;
-               }
-
-               if (m_pImpl->cfg)
-               {
-                       evas_gl_config_free(m_pImpl->cfg);
-                       m_pImpl->cfg = NULL;
-               }
-
-               delete m_pImpl;
-               m_pImpl = NULL;
+       if (__img)
+               evas_object_image_pixels_get_callback_set(__img, NULL, NULL);
+
+       if (__idler)
+               ecore_idler_del(__idler);
+
+       if (__map) {
+               __map->SetUpdateMapSignal(NULL);
+               delete __map;
+       }
+
+       /* clear Open GL */
+       if (__gl) {
+               if (__sfc && __ctx)
+                       evas_gl_make_current(__gl, __sfc, __ctx);
+
+               if (__sfc)
+                       evas_object_image_native_surface_set(__img, NULL);
+                       evas_gl_surface_destroy(__gl, __sfc);
+
+               if (__ctx)
+                       evas_gl_context_destroy(__gl, __ctx);
+
+               evas_gl_free(__gl);
+               __gl = NULL;
        }
 
+       if (__cfg)
+               evas_gl_config_free(__cfg);
+
        return HERE_ERROR_NONE;
 }
 
-void HereView::__readyCb(void *data)
+void HereView::__readyMapCb(void *data)
 {
-       if (!data)
-               return;
+       HereView *hv = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle((maps_view_h)data, (void**)&hv);
+       if (maps_error != MAPS_ERROR_NONE || !hv) 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(hView);
+       if (hv->__readyCb)
+               hv->__readyCb(data);
 }
 
 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;
+       HereView *hv = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(data, (void**)&hv);
+       if (maps_error != MAPS_ERROR_NONE || !hv ||
+               !hv->__map || !hv->__gl || !hv->__sfc || !hv->__ctx) return;
 
-       evas_gl_make_current(m_pImpl->gl, m_pImpl->sfc, m_pImpl->ctx);
-       m_pImpl->map->PaintMap(m_pImpl->w, m_pImpl->h);
+       evas_gl_make_current(hv->__gl, hv->__sfc, hv->__ctx);
+       hv->__map->PaintMap(hv->__w, hv->__h);
 }
 
 void HereView::__renderingCb(void *data)
@@ -319,8 +254,6 @@ 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;
@@ -338,66 +271,61 @@ void HereView::__setMapType(maps_view_h hView)
        GeoTiledMap::MapType hereMapType = HereUtils::Convert(map_type, buildings_enabled,
                                                traffic_enabled, public_transit_enabled);
 
-       if (hereMapType != m_pImpl->map->GetMapType())
+       if (hereMapType != __map->GetMapType())
        {
                MAPS_LOGD("Clear cache, because map type is changed.");
-               m_pImpl->map->ClearCache();
+               __map->ClearCache();
 #ifdef TIZEN_SUPPORT_TILE_FILE_CACHE
-               m_pImpl->map->ClearTileFileCache();
+               __map->ClearTileFileCache();
 #endif
-               m_pImpl->map->SetMapType(hereMapType);
+               __map->SetMapType(hereMapType);
        }
 }
 
 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 (!hView || !mapsCoord)
+               return HERE_ERROR_INVALID_PARAMETER;
 
-       if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !m_pImpl->api)
+       if (!__isInitialized || !__map || !__api)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
-       if (!mapsCoord)
-               return HERE_ERROR_INVALID_PARAMETER;
-
        /* set map type */
        __setMapType(hView);
 
        /* resize window */
        int 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);
+       __w = MAX(__w, 1);
+       __h = MAX(__h, 1);
 
-       if (x != m_pImpl->x || y != m_pImpl->y || w != m_pImpl->w || h != m_pImpl->h)
+       if (x != __x || y != __y || w != __w || h != __h)
        {
-               m_pImpl->x = x;
-               m_pImpl->y = y;
-               m_pImpl->w = w;
-               m_pImpl->h = h;
-
-               m_pImpl->api->glViewport(0, 0, m_pImpl->w, m_pImpl->h);
-               m_pImpl->map->SetMapSize(Dimension(m_pImpl->w,m_pImpl->h));
-               InitOpenGLSurface(hView);
+               __x = x;
+               __y = y;
+               __w = w;
+               __h = h;
+
+               __api->glViewport(0, 0, __w, __h);
+               __map->SetMapSize(Dimension(__w,__h));
+               __initOpenGLSurface(hView);
        }
 
        /* callback */
-       GeoTiledMap::UpdateMapSignalFunctor callback = std::tr1::bind(&__renderingCb, m_pImpl->img);
-       m_pImpl->map->SetUpdateMapSignal(callback);
+       GeoTiledMap::UpdateMapSignalFunctor callback = std::tr1::bind(&__renderingCb, __img);
+       __map->SetUpdateMapSignal(callback);
 
        /* zoom level */
-       if (m_pImpl->map->GetZoomLevel() != dZoom)
+       if (__map->GetZoomLevel() != dZoom)
        {
-               m_pImpl->zoom = dZoom;
-               m_pImpl->map->SetZoomLevel(dZoom, false);
+               __zoom = dZoom;
+               __map->SetZoomLevel(dZoom, false);
        }
 
        /* angle */
-       if (m_pImpl->angle != dAngle) {
-               m_pImpl->angle = dAngle;
-               m_pImpl->map->SetAngle(dAngle);
+       if (__angle != dAngle) {
+               __angle = dAngle;
+               __map->SetAngle(dAngle);
        }
 
        /* center */
@@ -406,106 +334,104 @@ here_error_e HereView::RenderMap(maps_view_h hView, const maps_coordinates_h map
        maps_coordinates_get_longitude(mapsCoord, &lng);
 
        GeoCoordinates geoCoord(lat, lng);
-       m_pImpl->lat = lat;
-       m_pImpl->lng = lng;
-       m_pImpl->map->SetCenter(geoCoord);
+       __lat = lat;
+       __lng = lng;
+       __map->SetCenter(geoCoord);
 
        return HERE_ERROR_NONE;
 }
 
 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 (!hView || !hArea)
+               return HERE_ERROR_INVALID_PARAMETER;
 
-       if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !m_pImpl->map->GetRootPixmap() || !m_pImpl->api)
+       if (!__isInitialized || !__map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
-       if (!hArea)
-               return HERE_ERROR_INVALID_PARAMETER;
-
        return HERE_ERROR_NONE;
 }
 
 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);
+               return HERE_ERROR_INVALID_PARAMETER;
 
-       if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !m_pImpl->map->GetRootPixmap() || !m_pImpl->api)
+       if (!__isInitialized || !__map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
        if (delta_x == 0 && delta_y == 0)
                return HERE_ERROR_NONE;
 
-       m_pImpl->map->Pan(delta_x, delta_y);
+       __map->Pan(delta_x, delta_y);
 
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::SetScalebar(maps_view_h hView, bool enable)
+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 (!hView || !center)
+               return HERE_ERROR_INVALID_PARAMETER;
 
-       if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
+       if (!__isInitialized || !__map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
-       m_pImpl->map->SetScalebar(enable);
+       GeoCoordinates geoCoord = __map->GetCenter();
+       if (*center == NULL) {
+               maps_coordinates_create(geoCoord.GetLatitude(), geoCoord.GetLongitude(), center);
+       } else {
+               maps_coordinates_set_latitude(*center, geoCoord.GetLatitude());
+               maps_coordinates_set_longitude(*center, geoCoord.GetLongitude());
+       }
 
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::GetScalebar(maps_view_h hView, bool *enabled)
+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);
+               return HERE_ERROR_INVALID_PARAMETER;
 
-       if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !enabled)
+       if (!__isInitialized || !__map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
-       *enabled = m_pImpl->map->GetScalebar();
+       __map->SetScalebar(enable);
+
        return HERE_ERROR_NONE;
 }
 
-here_error_e HereView::DrawMap(maps_view_h hView, Evas* pCanvas, int x, int y, int nWidth, int nHeight)
+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 (!hView || !enabled)
+               return HERE_ERROR_INVALID_PARAMETER;
 
-       if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map || !m_pImpl->map->GetRootPixmap() || !m_pImpl->api)
+       if (!__isInitialized || !__map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
-       if (!pCanvas || nWidth <= 0 || nHeight <= 0)
-               return HERE_ERROR_INVALID_PARAMETER;
+       *enabled = __map->GetScalebar();
+       return HERE_ERROR_NONE;
+}
 
-       if (m_pImpl->w <= 0 || m_pImpl->h <= 0)
+here_error_e HereView::DrawMap(maps_view_h hView, Evas* pCanvas, int x, int y, int nWidth, int nHeight)
+{
+       if (!hView || !pCanvas || nWidth <= 0 || nHeight <= 0)
                return HERE_ERROR_INVALID_PARAMETER;
 
-       unsigned char* srcimg_data = (unsigned char*)malloc(m_pImpl->w*m_pImpl->h*4);
+       if (!__isInitialized || !__map || !__map->GetRootPixmap() || !__api || __w <= 0 || __h <= 0)
+               return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+
+       unsigned char* srcimg_data = (unsigned char*)malloc(__w * __h * 4);
        if (!srcimg_data)
                return HERE_ERROR_OUT_OF_MEMORY;
 
        Evas_Object *dstimg = evas_object_image_filled_add(pCanvas);
-       if (!dstimg)
-       {
+       if (!dstimg) {
                g_free(srcimg_data);
                return HERE_ERROR_INVALID_OPERATION;
        }
 
        unsigned char *dstimg_data = (unsigned char *)evas_object_image_data_get(dstimg, EINA_TRUE);
-       if (!dstimg_data)
-       {
+       if (!dstimg_data) {
                g_free(srcimg_data);
                return HERE_ERROR_INVALID_OPERATION;
        }
@@ -513,16 +439,16 @@ here_error_e HereView::DrawMap(maps_view_h hView, Evas* pCanvas, int x, int y, i
        int w = nWidth;
        int h = nHeight;
 
-       if (m_pImpl->w < w) w = m_pImpl->w;
-       if (m_pImpl->h < h) h = m_pImpl->h;
+       if (__w < w) w = __w;
+       if (__h < h) h = __h;
 
-       m_pImpl->api->glReadPixels(x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, srcimg_data);
+       __api->glReadPixels(x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, srcimg_data);
 
        try {
-               for (int i = 0; i < h; i++)
-                       memcpy(dstimg_data+(i*w), srcimg_data+(i*m_pImpl->w+x), w*4);
+               for(int i = 0; i < h; i++)
+                       memcpy(dstimg_data+(i*w), srcimg_data+(i * w + x), w * 4);
        }
-       catch (std::exception &e) {
+       catch(std::exception &e) {
                MAPS_LOGD("Exception caught: %s", e.what());
        }
        g_free(srcimg_data);
@@ -530,93 +456,39 @@ here_error_e HereView::DrawMap(maps_view_h hView, Evas* pCanvas, int x, int y, i
        return HERE_ERROR_NONE;
 }
 
-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;
-
-       GeoCoordinates geoCoord = m_pImpl->map->GetCenter();
-
-       if (*center == NULL)
-       {
-               maps_coordinates_create(geoCoord.GetLatitude(), geoCoord.GetLongitude(), center);
-       }
-       else
-       {
-               maps_coordinates_set_latitude(*center, geoCoord.GetLatitude());
-               maps_coordinates_set_longitude(*center, geoCoord.GetLongitude());
-       }
-
-       return HERE_ERROR_NONE;
-}
-
 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 (!hView || !mapsCoord)
+               return HERE_ERROR_INVALID_PARAMETER;
 
-       if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
+       if (!__isInitialized || !__map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
-       if (!mapsCoord)
-               return HERE_ERROR_INVALID_PARAMETER;
-
        Tizen::Maps::Point mapsPoint(x, y);
-       GeoCoordinates hereCoord = m_pImpl->map->ScreenPositionToCoordinate(mapsPoint);
+       GeoCoordinates hereCoord = __map->ScreenPositionToCoordinate(mapsPoint);
        double lat = hereCoord.GetLatitude();
        double lng = hereCoord.GetLongitude();
 
-#if 1
        int error = maps_coordinates_create(lat, lng, mapsCoord);
        if (error != MAPS_ERROR_NONE)
                return (here_error_e)ConvertToHereError(error);
-#else
-       maps_coordinates_h __mapsCoord;
-       int error = maps_coordinates_create(lat, lng, &__mapsCoord);
-       if (error != MAPS_ERROR_NONE)
-               return (here_error_e)ConvertToHereError(error);
-
-       if (*mapsCoord) {
-               /* maps_coord is already allocated in heap memory */
-               maps_coordinates_get_latitude(__mapsCoord, &lat);
-               maps_coordinates_get_longitude(__mapsCoord, &lng);
-               maps_coordinates_set_latitude(*mapsCoord, lat);
-               maps_coordinates_set_longitude(*mapsCoord, lng);
-       } else {
-               /* maps_coord is not allocated yet */
-               maps_coordinates_clone(__mapsCoord, mapsCoord);
-       }
-       maps_coordinates_destroy(__mapsCoord);
-#endif
 
        return HERE_ERROR_NONE;
 }
 
 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 (!hView || !x || !y)
+               return HERE_ERROR_INVALID_PARAMETER;
 
-       if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
+       if (!__isInitialized || !__map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
-       if (!x || !y)
-               return HERE_ERROR_INVALID_PARAMETER;
-
        double lat, lng;
        maps_coordinates_get_latitude(mapsCoord, &lat);
        maps_coordinates_get_longitude(mapsCoord, &lng);
        GeoCoordinates hereCoord(lat, lng);
-       Tizen::Maps::Point mapsPoint = m_pImpl->map->CoordinateToScreenPosition(hereCoord);
+       Tizen::Maps::Point mapsPoint = __map->CoordinateToScreenPosition(hereCoord);
 
        *x = mapsPoint.x;
        *y = mapsPoint.y;
@@ -626,89 +498,70 @@ here_error_e HereView::GeolocationToScreen(maps_view_h hView, const maps_coordin
 
 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 (!hView || !nMinZoomLevel)
+               return HERE_ERROR_INVALID_PARAMETER;
 
-       if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
+       if (!__isInitialized || !__map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
-       if (!nMinZoomLevel)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       *nMinZoomLevel = (int)m_pImpl->map->GetMinimumZoomLevel();
+       *nMinZoomLevel = (int)__map->GetMinimumZoomLevel();
 
        return HERE_ERROR_NONE;
 }
 
 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 (!hView || !nMaxZoomLevel)
+               return HERE_ERROR_INVALID_PARAMETER;
 
-       if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
+       if (!__isInitialized || !__map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
-       if (!nMaxZoomLevel)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       *nMaxZoomLevel = (int)m_pImpl->map->GetMaximumZoomLevel();
+       *nMaxZoomLevel = (int)__map->GetMaximumZoomLevel();
 
        return HERE_ERROR_NONE;
 }
 
 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 (!hView || !object ||
+               operation < MAPS_VIEW_OBJECT_ADD || operation > MAPS_VIEW_OBJECT_REMOVE)
+               return HERE_ERROR_INVALID_PARAMETER;
 
-       if (!m_pImpl || !m_pImpl->isInitialized || !m_pImpl->map)
+       if (!__isInitialized || !__map)
                return HERE_ERROR_SERVICE_NOT_AVAILABLE;
 
-       if (!object || operation < MAPS_VIEW_OBJECT_ADD || operation > MAPS_VIEW_OBJECT_REMOVE)
-               return HERE_ERROR_INVALID_PARAMETER;
-
-       if (m_pImpl->map->GetRootPixmap())
+       if (__map->GetRootPixmap())
                __processViewObject(hView, object, operation);
        else
-               m_pImpl->pendingObjects.push_back(std::make_pair(object, operation));
+               __pendingObjects.push_back(std::make_pair(object, operation));
 
        return HERE_ERROR_NONE;
 }
 
 Eina_Bool HereView::__idlerCb(void *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 (!m_pImpl || !m_pImpl->map || !m_pImpl->map->GetRootPixmap()) return true;
-
-       while (m_pImpl->pendingObjects.size())
-       {
-               PendingObject pending = m_pImpl->pendingObjects.front();
-               m_pImpl->pendingObjects.pop_front();
+       HereView *hv = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(data, (void**)&hv);
+       if (maps_error != MAPS_ERROR_NONE || !hv) return true;
+       if (!hv->__map || !hv->__map->GetRootPixmap()) return true;
+
+       while (hv->__pendingObjects.size()) {
+               PendingObject pending = hv->__pendingObjects.front();
+               hv->__pendingObjects.pop_front();
                maps_view_object_h object = pending.first;
                maps_view_object_operation_e operation = pending.second;
 
-               __processViewObject(hView, object, operation);
+               __processViewObject(data, object, operation);
        }
-
        return true;
 }
 
 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);
+       HereView *hv = NULL;
+       int maps_error = maps_view_get_maps_plugin_view_handle(hView, (void**)&hv);
+       if (maps_error != MAPS_ERROR_NONE || !hv) return;
 
        maps_view_object_type_e type;
        maps_view_object_get_type(object, &type);
@@ -726,10 +579,10 @@ void HereView::__processViewObject(maps_view_h hView, const maps_view_object_h o
 
        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_CHANGE:                   m_pImpl->visualObjects.update(object); break;
-       case MAPS_VIEW_OBJECT_REMOVE:                   m_pImpl->visualObjects.remove(object); break;
+       case MAPS_VIEW_OBJECT_ADD:                              hv->__visualObjects.add(object); break;
+       case MAPS_VIEW_OBJECT_SET_VISIBLE:              hv->__visualObjects.setVisible(object); break;
+       case MAPS_VIEW_OBJECT_CHANGE:                   hv->__visualObjects.update(object); break;
+       case MAPS_VIEW_OBJECT_REMOVE:                   hv->__visualObjects.remove(object); break;
        default:                        break;
        }
 }