Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / eail / eail_inwin.c
1 /*
2  * Copyright (c) 2013 Samsung Electronics Co., Ltd.
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 /**
21  * @file eail_inwin.c
22  * @brief EailInwin implementation
23  */
24
25 #include <Elementary.h>
26
27 #include "eail_inwin.h"
28 #include "eail_priv.h"
29
30 /**
31  * @brief Define EailInwin GObject type
32  */
33 G_DEFINE_TYPE(EailInwin, eail_inwin, EAIL_TYPE_WIDGET);
34
35 /**
36  * @brief EailInwin object initialization
37  *
38  * @param obj EailInwin object
39  * @param data additional initialization data
40  */
41 static void
42 eail_inwin_initialize(AtkObject *obj, gpointer data)
43 {
44    ATK_OBJECT_CLASS(eail_inwin_parent_class)->initialize(obj, data);
45
46    obj->role = ATK_ROLE_GLASS_PANE;
47 }
48
49 /**
50  * @brief Gets EailWidget's children
51  *
52  * Implementation of get_widget_children from EailWidget.
53  *
54  * @param widget EailInwin instance
55  *
56  * @return Eina_List representing a list of widget's children, or NULL if widget has no children
57  */
58 static Eina_List *
59 eail_inwin_get_widget_children(EailWidget *widget)
60 {
61    Eina_List *list = NULL;
62    Evas_Object *obj = eail_widget_get_widget(widget);
63
64    if (obj)
65      list = eina_list_append(list, elm_win_inwin_content_get(obj));
66
67    return list;
68 }
69
70 /**
71  * @brief EailInwin instance initialization
72  *
73  * @param inwin EailInwin instance
74  */
75 static void
76 eail_inwin_init(EailInwin *inwin)
77 {
78 }
79
80 /**
81  * @brief GObject type initialization function
82  *
83  * @param klass EailInwin class
84  */
85 static void
86 eail_inwin_class_init(EailInwinClass *klass)
87 {
88    AtkObjectClass *atk_class = ATK_OBJECT_CLASS(klass);
89    EailWidgetClass *widget_class = EAIL_WIDGET_CLASS(klass);
90
91    widget_class->get_widget_children = eail_inwin_get_widget_children;
92    atk_class->initialize = eail_inwin_initialize;
93 }