1 /* Copyright (c) 2010-2014 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "overlay_constructor.h"
20 extern int _maps_view_object_create(const maps_view_object_type_e type, maps_view_object_h *object);
22 extern int _maps_view_object_overlay_set_object(maps_view_object_h overlay, Evas_Object *object);
24 extern int _maps_view_object_overlay_set_type(maps_view_object_h overlay, maps_view_overlay_type_e type);
26 maps_view_object_h view::overlay_constructor::construct(maps_coordinates_h coordinates,
27 Evas_Object *object, maps_view_overlay_type_e type)
29 if (!coordinates || !object) {
30 __error = MAPS_ERROR_INVALID_PARAMETER;
34 __error = MAPS_ERROR_NONE;
36 maps_view_object_h overlay = NULL;
38 /* 1. Create a visual object for marker */
39 __error = _maps_view_object_create(MAPS_VIEW_OBJECT_OVERLAY, &overlay);
40 if (__error != MAPS_ERROR_NONE)
43 /* 2. Set the overlay type */
44 __error = _maps_view_object_overlay_set_type(overlay, type);
45 if (__error != MAPS_ERROR_NONE)
48 /* 3. Set the evas object to the overlay */
49 __error = _maps_view_object_overlay_set_object(overlay, object);
50 if (__error != MAPS_ERROR_NONE)
53 /* 4. Move the overlay to the given coordinates */
54 __error = maps_view_object_overlay_set_coordinates(overlay, coordinates);
55 if (__error != MAPS_ERROR_NONE)
63 /* FAILURE: Releasing objects */
64 maps_view_object_destroy(overlay);