Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / eail / eail_dynamic_content.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_dynamic_content.c
22  * @brief Implementation of EailDynamicContent - interface that is being used
23  * for handling children hierarchy updates by eail components
24 */
25
26 #include "eail_dynamic_content.h"
27
28 /**
29  *
30  * @returns GType for initialized interface
31  */
32 GType
33 eail_dynamic_content_get_type(void)
34 {
35    static volatile GType type_id__volatile = 0;
36
37    if (g_once_init_enter(&type_id__volatile))
38      {
39         GType type_id = g_type_register_static_simple(
40                                     G_TYPE_INTERFACE,
41                                     "EailDynamicContent",
42                                     sizeof(EailDynamicContentIface),
43                                     NULL,
44                                     0,
45                                     NULL,
46                                     0);
47
48         g_once_init_leave(&type_id__volatile, type_id);
49      }
50
51    return type_id__volatile;
52 }
53
54 /**
55  * @param parent object that suports EailDynamicContent interface
56  *
57  */
58 void eail_dynamic_content_update_hierarchy(EailDynamicContent *parent)
59 {
60    EailDynamicContentIface *iface;
61
62    g_return_if_fail(EAIL_IS_DYNAMIC_CONTENT(parent));
63
64    iface = EAIL_DYNAMIC_CONTENT_GET_IFACE(parent);
65
66    if (iface->update_hierarchy)
67      iface->update_hierarchy(parent);
68
69 }