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 EailPrefs implementation
25 #include <Elementary.h>
27 #include "eail_prefs.h"
28 #include "eail_factory.h"
29 #include "eail_priv.h"
32 * @brief EailPrefs GObject type definition
34 * EailPrefs is extended EAIL_TYPE_WIDGET
36 G_DEFINE_TYPE(EailPrefs, eail_prefs, EAIL_TYPE_WIDGET);
39 * @brief EailPrefs initializer
41 * @param obj AtkObject instance
42 * @param data initialization data
45 eail_prefs_initialize(AtkObject *obj, gpointer data)
47 ATK_OBJECT_CLASS(eail_prefs_parent_class)->initialize(obj, data);
48 obj->role = ATK_ROLE_REDUNDANT_OBJECT;
52 * @brief EailPrefs instance initializer
54 * @param prefs EailPrefs instance
57 eail_prefs_init(EailPrefs *prefs)
62 * @brief Gets the list of children of the prefs object
64 * @param parent parent widget
65 * @param [out] items list of object's children
67 static void eail_prefs_children_get(Evas_Object *parent,
74 list = evas_object_smart_members_get(parent);
77 for (n = 0; n < eina_list_count(list); ++n)
79 w = eina_list_nth(list, n);
80 if (elm_object_widget_check(w))
82 *items = eina_list_append(*items, w);
85 eail_prefs_children_get(w, items);
92 * @brief Gets the list of children for the specified widget
94 * @param widget EailWidget instance
96 * @returns Eina_List representing the widget's children
97 * or NULL if the widget's has no children
100 eail_prefs_get_widget_children(EailWidget *widget)
103 Eina_List *list = NULL;
105 g_return_val_if_fail(EAIL_IS_PREFS(widget), NULL);
107 w = eail_widget_get_widget(widget);
108 if (!widget) return NULL;
110 eail_prefs_children_get(w, &list);
116 * @brief EailPrefs class initializer
118 * Definition of basic callbacks for AtkObject.
120 * @param klass EailPrefsClass instance
123 eail_prefs_class_init(EailPrefsClass *klass)
125 AtkObjectClass *atk_class = ATK_OBJECT_CLASS(klass);
126 EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
128 atk_class->initialize = eail_prefs_initialize;
129 widget_class->get_widget_children = eail_prefs_get_widget_children;