fix for using maps_view_handle in maps_plugin 46/68446/5 accepted/tizen/ivi/20160517.083334 accepted/tizen/mobile/20160517.083350 accepted/tizen/tv/20160517.083247 accepted/tizen/wearable/20160517.083318 submit/tizen/20160517.035309
authorjongmun.woo <jongmun.woo@samsung.com>
Wed, 4 May 2016 09:03:55 +0000 (18:03 +0900)
committerJongmun Woo <jongmun.woo@samsung.com>
Tue, 17 May 2016 03:48:48 +0000 (20:48 -0700)
Signed-off-by: jongmun.woo <jongmun.woo@samsung.com>
Change-Id: I7fa110f836dae7b4a438b697c67fe65080d0957c

include/maps_plugin.h
include/maps_view_plugin.h
src/api/maps_view.cpp
src/api/maps_view_object.cpp
src/plugin/empty_module.cpp
src/plugin/module.cpp
src/plugin/module.h

index f147160..152f179 100755 (executable)
@@ -805,22 +805,37 @@ int maps_plugin_cancel_request(int request_id);
  *
  * @see maps_plugin_render_map()
  */
-typedef void(*maps_plugin_map_view_ready_cb) (const maps_view_h view);
+typedef void(*maps_plugin_map_view_ready_cb) (maps_view_h hView);
 
 /**
- * @brief      Set a maps view.
- * @details This function sets a maps view to the plugin.
+ * @brief      Create a maps view.
+ * @details This function create a maps view to the plugin.
  * @since_tizen 3.0
- * @remarks When the Maps View is being destroying, the parameter @a view is set to NULL.
  *
- * @param[in]  view            The maps view
+ * @param[in]  hView           The maps view
+ * @return     0 on success, otherwise a negative error value
+ * @retval     #MAPS_ERROR_NONE Successful
+ * @retval     #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see #maps_view_h
+ * @see maps_plugin_destroy_map_view()
+ */
+int maps_plugin_create_map_view(maps_view_h hView, maps_plugin_map_view_ready_cb callback);
+
+/**
+ * @brief      Destroy a maps view.
+ * @details This function destory a maps view to the plugin.
+ * @since_tizen 3.0
+ *
+ * @param[in]  hView           The maps view
  * @return     0 on success, otherwise a negative error value
  * @retval     #MAPS_ERROR_NONE Successful
  * @retval     #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
  *
  * @see #maps_view_h
+ * @see maps_plugin_create_map_view()
  */
-int maps_plugin_set_map_view(const maps_view_h view, maps_plugin_map_view_ready_cb callback);
+int maps_plugin_destroy_map_view(maps_view_h hView);
 
 /**
  * @brief      Called when the map rendering is finished.
@@ -847,10 +862,8 @@ int maps_plugin_set_map_view(const maps_view_h view, maps_plugin_map_view_ready_
  *
  * @see maps_plugin_render_map()
  */
-typedef void(*maps_plugin_render_map_cb) (maps_error_e result, int request_id,
-                                         maps_coordinates_h center,
-                                         maps_area_h area,
-                                         void* user_data);
+typedef void(*maps_plugin_render_map_cb) (maps_error_e result, int request_id, maps_coordinates_h center,
+                                         maps_area_h area, void* user_data);
 
 /**
  * @brief      Request a map rendering.
@@ -858,6 +871,7 @@ typedef void(*maps_plugin_render_map_cb) (maps_error_e result, int request_id,
  * specified zoom factor and rotation angle.
  * @since_tizen 3.0
  *
+ * @param[in]  hView           The handle of maps_view
  * @param[in]  coordinates     The coordinates of location to draw
  * @param[in]  zoom_factor     The zoom factor
  * @param[in]  rotation_angle  The rotation factor
@@ -868,7 +882,6 @@ typedef void(*maps_plugin_render_map_cb) (maps_error_e result, int request_id,
  * @retval     #MAPS_ERROR_NONE Successful
  * @retval     #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
  *
- * @pre the maps view is set with maps_plugin_set_map_view().
  * @post It invokes maps_plugin_render_map_cb() to notify that the rendering is
  * finished
  *
@@ -876,12 +889,8 @@ typedef void(*maps_plugin_render_map_cb) (maps_error_e result, int request_id,
  * @see maps_plugin_render_map_cb()
  * @see maps_plugin_draw_map()
  */
-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);
+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);
 
 /**
  * @brief      Request the Plugin to move a map on a given delta.
@@ -890,16 +899,16 @@ int maps_plugin_render_map(const maps_coordinates_h coordinates,
  * remaining same.
  * @since_tizen 3.0
  *
+ * @param[in]  hView           The handle of maps_view
  * @param[in]  delta_x         The delta x
  * @param[in]  delta_y         The delta y
- * @param[in]  callback        The callback to notify that the rendering is finished
+ * @param[in]  callback                The callback to notify that the rendering is finished
  * @param[in]  user_data       The user data to be passed to the callback
  * @param[out] request_id      The id of request
  * @return     0 on success, otherwise a negative error value
  * @retval     #MAPS_ERROR_NONE Successful
  * @retval     #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
  *
- * @pre the maps view is set with maps_plugin_set_map_view().
  * @post It invokes maps_plugin_render_map_cb() to notify that the rendering is
  * finished
  *
@@ -908,11 +917,8 @@ int maps_plugin_render_map(const maps_coordinates_h coordinates,
  * @see maps_plugin_render_map()
  * @see maps_plugin_draw_map()
  */
-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);
+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);
 
 /**
  * @brief      Draw a map on the maps view panel.
@@ -920,9 +926,10 @@ int maps_plugin_move_center(const int delta_x,
  * panel in accordance with the current maps settings.
  * @since_tizen 3.0
  *
+ * @param[in]  hView           The handle of maps_view
  * @param[in]  canvas          The canvas to draw on
- * @param[in]  x               The x coordinate on the canvas top left
- * @param[in]  y               The y coordinate on the canvas top left
+ * @param[in]  x                       The x coordinate on the canvas top left
+ * @param[in]  y                       The y coordinate on the canvas top left
  * @param[in]  width           The width of the cancas
  * @param[in]  height          The height of the cancas
  * @return     0 on success, otherwise a negative error value
@@ -935,11 +942,7 @@ int maps_plugin_move_center(const int delta_x,
  * @see maps_plugin_set_view()
  * @see maps_plugin_render_map()
  */
-int maps_plugin_draw_map(Evas* canvas,
-                        const int x,
-                        const int y,
-                        const int width,
-                        const int height);
+int maps_plugin_draw_map(maps_view_h hView, Evas* canvas, const int x, const int y, const int width, const int height);
 
 /**
  * @brief      Notifyes that the visual object is changed.
@@ -949,6 +952,7 @@ int maps_plugin_draw_map(Evas* canvas,
  * visibility modificating or editing object specific properties.
  * @since_tizen 3.0
  *
+ * @param[in]  hView           The handle of maps_view
  * @param[in]  object          The object handle
  * @param[in]  operation       The operation over the object
  * @return     0 on success, otherwise a negative error value
@@ -957,8 +961,7 @@ int maps_plugin_draw_map(Evas* canvas,
  *
  * @see maps_plugin_create()
  */
-int maps_plugin_on_object(const maps_view_object_h object,
-                         const maps_view_object_operation_e operation);
+int maps_plugin_on_object(maps_view_h hView, const maps_view_object_h object, const maps_view_object_operation_e operation);
 
 /**
  * @brief      Converts screen coordinates to the geographical coordinates.
@@ -966,6 +969,7 @@ int maps_plugin_on_object(const maps_view_object_h object,
  * coordinates accordingly to the current maps settings.
  * @since_tizen 3.0
  *
+ * @param[in]  hView   The handle of maps_view
  * @param[in]  x               The x coordinate on the screen
  * @param[in]  y               The y coordinate on the screen
  * @param[out] coordinates     The corresponding geographical coordinates
@@ -977,8 +981,7 @@ int maps_plugin_on_object(const maps_view_object_h object,
  * @see maps_plugin_geography_to_screen()
  * @see #maps_coordinates_h
  */
-int maps_plugin_screen_to_geography(const int x, const int y,
-                                   maps_coordinates_h* coordinates);
+int maps_plugin_screen_to_geography(maps_view_h hView, const int x, const int y, maps_coordinates_h* coordinates);
 
 /**
  * @brief      Converts geographical coordinates to the screen coordinates.
@@ -986,9 +989,10 @@ int maps_plugin_screen_to_geography(const int x, const int y,
  * coordinates accordingly to the current maps settings.
  * @since_tizen 3.0
  *
+ * @param[in]  hView           The handle of maps_view
  * @param[in]  coordinates     The geographical coordinates
- * @param[out] x               The corresponding x coordinate on the screen
- * @param[out] y               The corresponding y coordinate on the screen
+ * @param[out]x                        The corresponding x coordinate on the screen
+ * @param[out]y                        The corresponding y coordinate on the screen
  * @return     0 on success, otherwise a negative error value
  * @retval     #MAPS_ERROR_NONE Successful
  * @retval     #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -997,32 +1001,33 @@ int maps_plugin_screen_to_geography(const int x, const int y,
  * @see maps_plugin_screen_to_geography()
  * @see #maps_coordinates_h
  */
-int maps_plugin_geography_to_screen(const maps_coordinates_h coordinates,
-                                   int* x, int* y);
+int maps_plugin_geography_to_screen(maps_view_h hView, const maps_coordinates_h coordinates, int* x, int* y);
 
 /**
  * @brief      Gets the minimal zooms level of the Map.
  * @details This function gets the minimally available zoom level of the Map.
  * @since_tizen 3.0
  *
- * @param[out] min_zoom_level  The minimally available zoom level
+ * @param[in]  hView                   The handle of maps_view
+ * @param[out]min_zoom_level   The minimally available zoom level
  * @return     0 on success, otherwise a negative error value
  * @retval     #MAPS_ERROR_NONE Successful
  * @retval     #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
  */
-int maps_plugin_get_min_zoom_level(int *min_zoom_level);
+int maps_plugin_get_min_zoom_level(maps_view_h hView, int *min_zoom_level);
 
 /**
  * @brief      Gets the maximal zooms level of the Map.
  * @details This function gets the maximally available zoom level of the Map.
  * @since_tizen 3.0
  *
- * @param[out] max_zoom_level  The maximally available zoom level
+ * @param[in]  hView                   The handle of maps_view
+ * @param[out]max_zoom_level   The maximally available zoom level
  * @return     0 on success, otherwise a negative error value
  * @retval     #MAPS_ERROR_NONE Successful
  * @retval     #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
  */
-int maps_plugin_get_max_zoom_level(int *max_zoom_level);
+int maps_plugin_get_max_zoom_level(maps_view_h hView, int *max_zoom_level);
 
 /**
  * @brief      Get the central coordinates of a Map.
@@ -1030,7 +1035,8 @@ int maps_plugin_get_max_zoom_level(int *max_zoom_level);
  * @since_tizen 3.0
  * @remarks @a coordinates must be released using maps_coordinates_destroy().
  *
- * @param[out] coordinates     The pointer to #maps_coordinates_h in which to
+ * @param[in]  hView           The handle of maps_view
+ * @param[out]coordinates      The pointer to #maps_coordinates_h in which to
  * store the geographical coordinates of the central position of the Map
  * @return     0 on success, otherwise a negative error value
  * @retval     #MAPS_ERROR_NONE Successful
@@ -1039,7 +1045,7 @@ int maps_plugin_get_max_zoom_level(int *max_zoom_level);
  * @see maps_plugin_get_min_zoom_level()
  * @see maps_plugin_get_max_zoom_level
  */
-int maps_plugin_get_center(maps_coordinates_h *coordinates);
+int maps_plugin_get_center(maps_view_h hView, maps_coordinates_h *coordinates);
 
 /**
  * @brief      Enables or disables the scalebar.
@@ -1047,7 +1053,7 @@ int maps_plugin_get_center(maps_coordinates_h *coordinates);
  * @since_tizen 3.0
  * @remarks This function requires network access.
  *
- * @param[in]  view            The view handle
+ * @param[in]  hView           The handle of maps_view
  * @param[in]  enabled         The enable status
  * @return     0 on success, otherwise a negative error value
  * @retval     #MAPS_ERROR_NONE Successful
@@ -1056,22 +1062,22 @@ int maps_plugin_get_center(maps_coordinates_h *coordinates);
  *
  * @see maps_plugin_get_scalebar()
  */
-int maps_plugin_set_scalebar(bool enable);
+int maps_plugin_set_scalebar(maps_view_h hView, bool enable);
 
 /**
  * @brief      Checks whether the scalebar is enabled or not.
  * @details This function checks whether the scalebar is enabled or not.
  * @since_tizen 3.0
  *
- * @param[in]  view            The view handle
- * @param[out] enabled         The pointer to a boolean in which to store the enable status
+ * @param[in]  hView           The handle of maps_view
+ * @param[out]enabled          The pointer to a boolean in which to store the enable status
  * @return     0 on success, otherwise a negative error value
  * @retval     #MAPS_ERROR_NONE Successful
  * @retval     #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
  *
  * @see maps_plugin_set_scalebar()
  */
-int maps_plugin_get_scalebar(bool *enabled);
+int maps_plugin_get_scalebar(maps_view_h hView, bool *enabled);
 
 #ifdef __cplusplus
 }
index 752d9a2..a141f4b 100644 (file)
@@ -88,6 +88,38 @@ int maps_view_set_zoom_factor(maps_view_h view, double zoom_factor);
  */
 int maps_view_get_zoom_factor(const maps_view_h view, double *zoom_factor);
 
+/**
+ * @brief      Get the view handle of maps plugin.
+ * @details This function gets the view handle of maps plugin.
+ *
+ * @param[in]  hView                                   The view handle
+ * @param[in]  maps_plugin_view_handle The view handle of maps plugin
+ * @return     0 on success, otherwise a negative error value
+ * @retval     #MAPS_ERROR_NONE Successful
+ * @retval     #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre @a hView is created using maps_view_create().
+ *
+ * @see maps_view_create()
+ */
+int maps_view_get_maps_plugin_view_handle(maps_view_h hView, void **maps_plugin_view_handle);
+
+/**
+ * @brief      Set the view handle of maps plugin.
+ * @details This function sets the view handle of maps plugin.
+ *
+ * @param[in]  hView                                   The view handle
+ * @param[in]  maps_plugin_view_handle The view handle of maps plugin
+ * @return     0 on success, otherwise a negative error value
+ * @retval     #MAPS_ERROR_NONE Successful
+ * @retval     #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre @a hView is created using maps_view_create().
+ *
+ * @see maps_view_create()
+ */
+int maps_view_set_maps_plugin_view_handle(maps_view_h hView, void *maps_plugin_view_handle);
+
 #ifdef __cplusplus
 }
 #endif
index 8a0edde..f061977 100644 (file)
@@ -112,6 +112,7 @@ typedef struct _maps_view_s {
        bool public_transit_enabled;
        bool scalebar_enabled;
 
+       void *maps_plugin_view_handle;
 } maps_view_s;
 
 
@@ -224,7 +225,7 @@ int _maps_view_on_object_operation(maps_view_h view, maps_view_object_h object,
        if(!__get_plugin_interface(view)->maps_plugin_on_object)
                return  MAPS_ERROR_INVALID_PARAMETER;
 
-       return __get_plugin_interface(view)->maps_plugin_on_object(object, operation);
+       return __get_plugin_interface(view)->maps_plugin_on_object(view, object, operation);
 }
 
 static void __on_canvas_tap(void *data, Evas *e, Evas_Object *obj, void *event_info)
@@ -338,13 +339,8 @@ static int __maps_plugin_render_map(const maps_view_h view,
                return MAPS_ERROR_INVALID_PARAMETER;
 
        int request_id = 0;
-       return __get_plugin_interface(view)->maps_plugin_render_map(
-                                            coordinates,
-                                            zoom_factor,
-                                            rotation_angle,
-                                            __maps_plugin_render_map_cb,
-                                            view,
-                                            &request_id);
+       return __get_plugin_interface(view)->maps_plugin_render_map(view, coordinates, zoom_factor, rotation_angle,
+                                                                                                               __maps_plugin_render_map_cb, view, &request_id);
 
 }
 
@@ -466,6 +462,8 @@ EXPORT_API int maps_view_create(maps_service_h maps, Evas_Image *obj, maps_view_
 
        v->panel = obj;
 
+       v->maps_plugin_view_handle = NULL;
+
        evas_object_event_callback_add(v->panel, EVAS_CALLBACK_RESIZE, __maps_view_panel_resize_cb, v);
 
        /* Set up event callbacks by default */
@@ -535,11 +533,11 @@ EXPORT_API int maps_view_create(maps_service_h maps, Evas_Image *obj, maps_view_
        *view = (maps_view_h) v;
 
        /* Notify the Plugin, that the view is created */
-       __get_plugin_interface(v)->maps_plugin_set_map_view(*view, __maps_view_ready);
+       __get_plugin_interface(v)->maps_plugin_create_map_view(*view, __maps_view_ready);
 
        /* Set up zoom and rotation */
-       __get_plugin_interface(v)->maps_plugin_get_min_zoom_level(&v->min_zoom_level);
-       __get_plugin_interface(v)->maps_plugin_get_max_zoom_level(&v->max_zoom_level);
+       __get_plugin_interface(v)->maps_plugin_get_min_zoom_level(v, &v->min_zoom_level);
+       __get_plugin_interface(v)->maps_plugin_get_max_zoom_level(v, &v->max_zoom_level);
 
        if(v->min_zoom_level <= 0)
                v->min_zoom_level = 2;
@@ -595,7 +593,7 @@ EXPORT_API int maps_view_destroy(maps_view_h view)
                ecore_animator_del(v->animator);
 
        /* Notify the Plugin, that the view is to be destroyed */
-       __get_plugin_interface(view)->maps_plugin_set_map_view(NULL, NULL);
+       __get_plugin_interface(view)->maps_plugin_destroy_map_view(view);
 
        /* Destroy a visual panel */
        if (v->panel)
@@ -644,7 +642,7 @@ int _maps_view_get_plugin_center(const maps_view_h view,
        if (!view || !center)
                return MAPS_ERROR_INVALID_PARAMETER;
 
-       return __get_plugin_interface(view)->maps_plugin_get_center(center);
+       return __get_plugin_interface(view)->maps_plugin_get_center(view, center);
 }
 
 /*----------------------MAP ZOOM, ROTATE, SET CENTER--------------------------*/
@@ -707,11 +705,8 @@ int _maps_view_move_center(maps_view_h view, const int delta_x, const int delta_
        *  similarly as it is done in maps service */
 
        int request_id = 0;
-       int error = __get_plugin_interface(view)->maps_plugin_move_center(
-                                               delta_x, delta_y,
-                                               __maps_plugin_render_map_cb,
-                                               view,
-                                               &request_id);
+       int error = __get_plugin_interface(view)->maps_plugin_move_center(view, delta_x, delta_y,
+                                                                               __maps_plugin_render_map_cb, view, &request_id);
 
        /* Invoke user registered event callback */
        maps_view_event_data_h ed =
@@ -731,7 +726,7 @@ EXPORT_API int maps_view_set_scalebar_enabled(const maps_view_h view, bool enabl
        if (!view)
                return MAPS_ERROR_INVALID_PARAMETER;
 
-       return __get_plugin_interface(view)->maps_plugin_set_scalebar(enable);
+       return __get_plugin_interface(view)->maps_plugin_set_scalebar(view, enable);
 }
 
 EXPORT_API int maps_view_get_scalebar_enabled(const maps_view_h view, bool *enabled)
@@ -739,7 +734,7 @@ EXPORT_API int maps_view_get_scalebar_enabled(const maps_view_h view, bool *enab
        if (!view || !enabled)
                return MAPS_ERROR_INVALID_PARAMETER;
 
-       return __get_plugin_interface(view)->maps_plugin_get_scalebar(enabled);
+       return __get_plugin_interface(view)->maps_plugin_get_scalebar(view, enabled);
 }
 
 EXPORT_API int maps_view_get_center(const maps_view_h view, maps_coordinates_h *coordinates)
@@ -935,8 +930,7 @@ EXPORT_API int maps_view_screen_to_geolocation(maps_view_h view,
        int posx = 0;
        int posy = 0;
        maps_view_get_screen_location(view, &posx, &posy, NULL, NULL);
-       return __get_plugin_interface(view)->
-               maps_plugin_screen_to_geography(x - posx, y - posy, coordinates);
+       return __get_plugin_interface(view)->maps_plugin_screen_to_geography(view, x - posx, y - posy, coordinates);
 }
 
 EXPORT_API int maps_view_geolocation_to_screen(const maps_view_h view,
@@ -947,8 +941,7 @@ EXPORT_API int maps_view_geolocation_to_screen(const maps_view_h view,
        int posx = 0;
        int posy = 0;
        maps_view_get_screen_location(view, &posx, &posy, NULL, NULL);
-       const int error = __get_plugin_interface(view)->
-               maps_plugin_geography_to_screen(coordinates, x, y);
+       const int error = __get_plugin_interface(view)->maps_plugin_geography_to_screen(view, coordinates, x, y);
        *x += posx;
        *y += posy;
        return error;
@@ -1544,3 +1537,28 @@ maps_view_object_h _maps_view_object_hit_test(maps_view_h view, int x, int y, ma
        /* 2. Extract test result */
        return htd.object;
 }
+
+EXPORT_API int maps_view_get_maps_plugin_view_handle(maps_view_h hView, void **maps_plugin_view_handle)
+{
+       if (!hView || !maps_plugin_view_handle)
+               return MAPS_ERROR_INVALID_PARAMETER;
+
+       maps_view_s *v = (maps_view_s *)hView;
+
+       *maps_plugin_view_handle = v->maps_plugin_view_handle;
+
+       return MAPS_ERROR_NONE;
+}
+
+EXPORT_API int maps_view_set_maps_plugin_view_handle(maps_view_h hView, void *maps_plugin_view_handle)
+{
+       if (!hView || !maps_plugin_view_handle)
+               return MAPS_ERROR_INVALID_PARAMETER;
+
+       maps_view_s *v = (maps_view_s *)hView;
+
+       v->maps_plugin_view_handle = maps_plugin_view_handle;
+
+       return MAPS_ERROR_NONE;
+}
+
index bd9039f..b2e99ea 100644 (file)
@@ -106,7 +106,7 @@ static int __maps_view_marker_data_destroy(void *marker);
 
 static maps_view_h __get_view(const maps_view_object_h object)
 {
-       if(!object)
+       if (!object)
                return NULL;
        maps_view_object_s *o = (maps_view_object_s *)object;
        return o->view;
index d1256bb..2403683 100755 (executable)
@@ -193,76 +193,69 @@ int maps_plugin_cancel_request_empty(int request_id)
 }
 
 /* Mapping */
-int maps_plugin_set_map_view_empty(const maps_view_h view,
-                                  maps_plugin_map_view_ready_cb callback)
+int maps_plugin_create_map_view_empty(maps_view_h hView, maps_plugin_map_view_ready_cb callback)
 {
        return 0;
 }
 
-int maps_plugin_render_map_empty(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 maps_plugin_destroy_map_view_empty(maps_view_h hView)
 {
        return 0;
 }
 
-int maps_plugin_move_center_empty(const int delta_x,
-                                 const int delta_y,
-                                 maps_plugin_render_map_cb callback,
-                                 void* user_data,
-                                 int* request_id)
+int maps_plugin_render_map_empty(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)
 {
        return 0;
 }
 
-int maps_plugin_set_scalebar_empty(bool enable)
+int maps_plugin_move_center_empty(maps_view_h hView, const int delta_x, const int delta_y,
+                                 maps_plugin_render_map_cb callback, void* user_data, int* request_id)
 {
        return 0;
 }
 
-int maps_plugin_get_scalebar_empty(bool *enabled)
+int maps_plugin_set_scalebar_empty(maps_view_h hView, bool enable)
 {
        return 0;
 }
 
-int maps_plugin_draw_map_empty(Evas* canvas, const int x, const int y,
-                              const int width, const int height)
+int maps_plugin_get_scalebar_empty(maps_view_h hView, bool *enabled)
 {
        return 0;
 }
 
-int maps_plugin_on_object_empty(const maps_view_object_h object,
-                               const maps_view_object_operation_e operation)
+int maps_plugin_draw_map_empty(maps_view_h hView, Evas* canvas, const int x, const int y, const int width, const int height)
 {
        return 0;
 }
 
-int maps_plugin_screen_to_geography_empty(const int x, const int y,
-                                         maps_coordinates_h *coordinates)
+int maps_plugin_on_object_empty(maps_view_h hView, const maps_view_object_h object, const maps_view_object_operation_e operation)
 {
        return 0;
 }
 
-int maps_plugin_geography_to_screen_empty(const maps_coordinates_h coordinates,
-                                         int* x, int* y)
+int maps_plugin_screen_to_geography_empty(maps_view_h hView, const int x, const int y, maps_coordinates_h *coordinates)
 {
        return 0;
 }
 
-int maps_plugin_get_min_zoom_level_empty(int *min_zoom_level)
+int maps_plugin_geography_to_screen_empty(maps_view_h hView, const maps_coordinates_h coordinates, int* x, int* y)
 {
        return 0;
 }
 
-int maps_plugin_get_max_zoom_level_empty(int *max_zoom_level)
+int maps_plugin_get_min_zoom_level_empty(maps_view_h hView, int *min_zoom_level)
 {
        return 0;
 }
 
-int maps_plugin_get_center_empty(maps_coordinates_h *coordinates)
+int maps_plugin_get_max_zoom_level_empty(maps_view_h hView, int *max_zoom_level)
+{
+       return 0;
+}
+
+int maps_plugin_get_center_empty(maps_view_h hView, maps_coordinates_h *coordinates)
 {
        return 0;
 }
@@ -304,7 +297,8 @@ plugin::interface_s empty_interface = {
        maps_plugin_cancel_request_empty,
 
        /* Mapping */
-       maps_plugin_set_map_view_empty,
+       maps_plugin_create_map_view_empty,
+       maps_plugin_destroy_map_view_empty,
        maps_plugin_render_map_empty,
        maps_plugin_move_center_empty,
        maps_plugin_set_scalebar_empty,
index 4113b07..dfabc29 100755 (executable)
@@ -198,9 +198,12 @@ maps_plugin_h plugin::binary_extractor::init(const provider_info &info,
                        "maps_plugin_cancel_request");
 
                /* Mapping */
-               new_plugin->interface.maps_plugin_set_map_view =
-                       (maps_plugin_set_map_view_f) gmod_find_sym(plugin,
-                       "maps_plugin_set_map_view");
+               new_plugin->interface.maps_plugin_create_map_view =
+                       (maps_plugin_create_map_view_f) gmod_find_sym(plugin,
+                       "maps_plugin_create_map_view");
+               new_plugin->interface.maps_plugin_destroy_map_view =
+                       (maps_plugin_destroy_map_view_f) gmod_find_sym(plugin,
+                       "maps_plugin_destroy_map_view");
                new_plugin->interface.maps_plugin_render_map =
                        (maps_plugin_render_map_f) gmod_find_sym(plugin,
                        "maps_plugin_render_map");
index f345a0c..940f26a 100644 (file)
@@ -110,32 +110,21 @@ typedef int (*maps_plugin_search_route_waypoints_f) (const maps_coordinates_h *
 typedef int (*maps_plugin_cancel_request_f) (int request_id);
 
 /* Mapping */
-typedef int (*maps_plugin_set_map_view_f) (const maps_view_h view,
-                                               maps_plugin_map_view_ready_cb callback);
-typedef int (*maps_plugin_render_map_f) (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);
-typedef int (*maps_plugin_move_center_f) (const int delta_x,
-                                               const int delta_y,
-                                               maps_plugin_render_map_cb callback,
-                                               void* user_data,
-                                               int* request_id);
-typedef int (*maps_plugin_set_scalebar_f) (bool enable);
-typedef int (*maps_plugin_get_scalebar_f) (bool *enabled);
-typedef int (*maps_plugin_draw_map_f) (Evas* canvas, const int x, const int y,
-                                               const int width, const int height);
-typedef int (*maps_plugin_on_object_f) (const maps_view_object_h object,
-                                               const maps_view_object_operation_e operation);
-typedef int (*maps_plugin_screen_to_geography_f) (const int x, const int y,
-                                               maps_coordinates_h* coordinates);
-typedef int (*maps_plugin_geography_to_screen_f) (const maps_coordinates_h coordinates,
-                                               int* x, int* y);
-typedef int (*maps_plugin_get_min_zoom_level_f) (int *min_zoom_level);
-typedef int (*maps_plugin_get_max_zoom_level_f) (int *max_zoom_level);
-typedef int (*maps_plugin_get_center_f) (maps_coordinates_h *coordinates);
+typedef int (*maps_plugin_create_map_view_f) (maps_view_h hView, maps_plugin_map_view_ready_cb callback);
+typedef int (*maps_plugin_destroy_map_view_f) (maps_view_h hView);
+typedef int (*maps_plugin_render_map_f) (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);
+typedef int (*maps_plugin_move_center_f) (maps_view_h hView, const int delta_x, const int delta_y, maps_plugin_render_map_cb callback,
+                                               void* user_data, int* request_id);
+typedef int (*maps_plugin_set_scalebar_f) (maps_view_h hView, bool enable);
+typedef int (*maps_plugin_get_scalebar_f) (maps_view_h hView, bool *enabled);
+typedef int (*maps_plugin_draw_map_f) (maps_view_h hView, Evas* canvas, const int x, const int y, const int width, const int height);
+typedef int (*maps_plugin_on_object_f) (maps_view_h hView, const maps_view_object_h object, const maps_view_object_operation_e operation);
+typedef int (*maps_plugin_screen_to_geography_f) (maps_view_h hView, const int x, const int y, maps_coordinates_h* coordinates);
+typedef int (*maps_plugin_geography_to_screen_f) (maps_view_h hView, const maps_coordinates_h coordinates, int* x, int* y);
+typedef int (*maps_plugin_get_min_zoom_level_f) (maps_view_h hView, int *min_zoom_level);
+typedef int (*maps_plugin_get_max_zoom_level_f) (maps_view_h hView, int *max_zoom_level);
+typedef int (*maps_plugin_get_center_f) (maps_view_h hView, maps_coordinates_h *coordinates);
 
 namespace plugin {
 
@@ -178,7 +167,8 @@ typedef struct _interface_s {
        maps_plugin_cancel_request_f maps_plugin_cancel_request;
 
        /* Mapping */
-       maps_plugin_set_map_view_f maps_plugin_set_map_view;
+       maps_plugin_create_map_view_f maps_plugin_create_map_view;
+       maps_plugin_destroy_map_view_f maps_plugin_destroy_map_view;
        maps_plugin_render_map_f maps_plugin_render_map;
        maps_plugin_move_center_f maps_plugin_move_center;
        maps_plugin_set_scalebar_f maps_plugin_set_scalebar;