2 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
22 * @brief EailRoute implementation
25 #include <Elementary.h>
27 #include "eail_route.h"
29 static void atk_value_interface_init(AtkValueIface *iface);
32 * @brief Define EailRoute GObject type
34 G_DEFINE_TYPE_WITH_CODE(EailRoute,
37 G_IMPLEMENT_INTERFACE(ATK_TYPE_VALUE,
38 atk_value_interface_init));
41 * @brief EailRoute object initialization
43 * @param obj EailRoute object
44 * @param data user set additional initialization data
47 eail_route_initialize(AtkObject *obj, gpointer data)
49 ATK_OBJECT_CLASS(eail_route_parent_class)->initialize(obj, data);
51 obj->role = ATK_ROLE_IMAGE_MAP;
55 * @brief EailRoute instance initialization
57 * @param route EailRoute instance
60 eail_route_init(EailRoute *route)
65 * @brief GObject type initialization function
67 * @param klass EailRoute class
70 eail_route_class_init(EailRouteClass *klass)
72 AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
74 class->initialize = eail_route_initialize;
78 * Implementation of the *AtkValue* interface
82 * @brief Gets obj current value
84 * @param obj EailRoute instance
85 * @param value EailRoute current value
88 eail_route_get_current_value(AtkValue *obj,
91 double longitude_min, longitude_max;
92 double latitude_min, latitude_max;
96 widget = eail_widget_get_widget(EAIL_WIDGET(obj));
99 elm_route_longitude_min_max_get(widget, &longitude_min, &longitude_max);
100 elm_route_latitude_min_max_get(widget, &latitude_min, &latitude_max);
102 g_snprintf(buf, sizeof(buf), "<longitude><min>%0.6f</min><max>%0.6f</max></longitude>\n"
103 "<latitude><min>%0.6f</min><max>%0.6f</max></latitude>",
104 longitude_min, longitude_max, latitude_min, latitude_max);
106 memset(value, 0, sizeof(GValue));
107 g_value_init(value, G_TYPE_STRING);
108 g_value_set_string(value, buf);
112 * @brief AtkValue interface initialization
114 * @param iface an AtkValue interface
117 atk_value_interface_init(AtkValueIface *iface)
119 g_return_if_fail(iface != NULL);
121 iface->get_current_value = eail_route_get_current_value;