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 EailMapbuf implementation
25 #include <Elementary.h>
27 #include "eail_mapbuf.h"
30 * @brief EailMapbuf type definition
32 G_DEFINE_TYPE(EailMapbuf, eail_mapbuf, EAIL_TYPE_WIDGET);
35 * @brief EailMapbuf initializer
37 * @param obj AtkObject instance
38 * @param data initialization data
41 eail_mapbuf_initialize(AtkObject *obj, gpointer data)
43 ATK_OBJECT_CLASS(eail_mapbuf_parent_class)->initialize(obj, data);
44 obj->role = ATK_ROLE_IMAGE_MAP;
47 * @brief Gets widget's children
49 * @param widget EailWidget instance
50 * @return Eina_List containing widget's children
53 eail_mapbuf_children_get(EailWidget *widget)
55 Eina_List *list = NULL;
56 Evas_Object *o, *object;
58 g_return_val_if_fail(EAIL_IS_WIDGET(widget), NULL);
60 object = eail_widget_get_widget(widget);
62 o = elm_object_part_content_get(object, "default");
65 list = eina_list_append(list, o);
70 * @brief Gets object's state set
72 * The caller must unreference it when it is no longed needed.
74 * @param object AtkObject instance
75 * @return AtkStateSet* containing object's state set
78 eail_mapbuf_ref_state_set(AtkObject *object)
80 AtkStateSet *state_set;
83 g_return_val_if_fail(EAIL_IS_MAPBUF(object), NULL);
84 widget = eail_widget_get_widget(EAIL_WIDGET(object));
85 if (!widget) return NULL;
88 ATK_OBJECT_CLASS(eail_mapbuf_parent_class)->ref_state_set(object);
89 if (elm_mapbuf_enabled_get(widget))
90 atk_state_set_add_state(state_set, ATK_STATE_ENABLED);
96 * @brief EailMapbuf instance initializer
98 * @param mapbuf EailMapbuf instance
101 eail_mapbuf_init(EailMapbuf *mapbuf)
106 * @brief EailMapbuf class initializer
108 * @param klass EailMapbufClass instance
111 eail_mapbuf_class_init(EailMapbufClass *klass)
113 AtkObjectClass *atk_class = ATK_OBJECT_CLASS(klass);
114 EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
116 atk_class->initialize = eail_mapbuf_initialize;
117 atk_class->ref_state_set = eail_mapbuf_ref_state_set;
119 widget_class->get_widget_children = eail_mapbuf_children_get;