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 EailTable implementation
24 #include <Elementary.h>
26 #include "eail_table.h"
29 * @brief Smart type used by elm_table to get internal content of the widget
31 #define TABLE_SMART_TYPE "Evas_Object_Table"
34 * @brief GObject definition of EailTable
36 * EailTable is extended EailWidget
38 G_DEFINE_TYPE(EailTable, eail_table, EAIL_TYPE_WIDGET);
41 * @brief Initialize EailTable
43 * Initialization of parent object, role etc.
45 * @param object AtkObject instance
46 * @param data user data passed to initialize
49 eail_table_initialize(AtkObject *object, gpointer data)
51 ATK_OBJECT_CLASS(eail_table_parent_class)->initialize(object, data);
53 object->role = ATK_ROLE_FILLER;
57 * @brief EailTable initialization
59 * @param table EailTable instance
62 eail_table_init(EailTable *table)
67 * @brief Gets a list of accessible children of widget
69 * Implementation of get_widget_children from EailWidget.
71 * @param widget EailTable instance
73 * @returns Eina_List representing the list of widget's children
76 eail_table_children_get(EailWidget *widget)
78 Evas_Object *table, *object;
79 Eina_List *smart_members;
81 g_return_val_if_fail(EAIL_IS_TABLE(widget), NULL);
83 object = eail_widget_get_widget(widget);
85 if (!object) return NULL;
87 smart_members = evas_object_smart_members_get(object);
88 /*table has one smart member it is Evas_Object_Table*/
89 table = eina_list_nth(smart_members, 0);
90 eina_list_free(smart_members);
92 if (evas_object_smart_type_check(table, TABLE_SMART_TYPE))
94 return evas_object_table_children_get(table);
101 * @brief EailTable class initialization
103 * @param klass EailTableClass instance
106 eail_table_class_init(EailTableClass *klass)
108 AtkObjectClass *atk_class = ATK_OBJECT_CLASS(klass);
109 EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
111 widget_class->get_widget_children = eail_table_children_get;
113 atk_class->initialize = eail_table_initialize;