~shnatsel/+junk/cairo-compmgr

« back to all changes in this revision

Viewing changes to src/ccm-preferences-page-plugin.c

  • Committer: Sergey "Shnatsel" Davidoff
  • Date: 2012-03-04 22:53:22 UTC
  • Revision ID: shnatsel@gmail.com-20120304225322-q2hz82j51yxv1qqw
fixed up build dependencies

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- */
 
2
/*
 
3
 * cairo-compmgr
 
4
 * Copyright (C) Nicolas Bruguier 2007-2010 <gandalfn@club-internet.fr>
 
5
 * 
 
6
 * cairo-compmgr is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Lesser General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2.1 of the License, or (at your option) any later version.
 
10
 * 
 
11
 * cairo-compmgr is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * Lesser General Public License for more details.
 
15
 * 
 
16
 * You should have received a copy of the GNU Lesser General Public
 
17
 * License along with cairo-compmgr.  If not, write to:
 
18
 *      The Free Software Foundation, Inc.,
 
19
 *      51 Franklin Street, Fifth Floor
 
20
 *      Boston, MA  02110-1301, USA.
 
21
 */
 
22
 
 
23
#include "ccm-preferences-page-plugin.h"
 
24
 
 
25
static void
 
26
ccm_preferences_page_plugin_base_init (gpointer g_class)
 
27
{
 
28
    static gboolean initialized = FALSE;
 
29
 
 
30
    if (!initialized)
 
31
    {
 
32
        initialized = TRUE;
 
33
    }
 
34
}
 
35
 
 
36
GType
 
37
ccm_preferences_page_plugin_get_type (void)
 
38
{
 
39
    static GType ccm_preferences_page_plugin_type = 0;
 
40
 
 
41
    if (!ccm_preferences_page_plugin_type)
 
42
    {
 
43
        const GTypeInfo ccm_preferences_page_plugin_info = {
 
44
            sizeof (CCMPreferencesPagePluginClass),
 
45
            ccm_preferences_page_plugin_base_init,
 
46
            NULL
 
47
        };
 
48
 
 
49
        ccm_preferences_page_plugin_type =
 
50
            g_type_register_static (G_TYPE_INTERFACE,
 
51
                                    "CCMPreferencesPagePlugin",
 
52
                                    &ccm_preferences_page_plugin_info, 0);
 
53
    }
 
54
 
 
55
    return ccm_preferences_page_plugin_type;
 
56
}
 
57
 
 
58
CCMPreferencesPagePlugin *
 
59
_ccm_preferences_page_plugin_get_root (CCMPreferencesPagePlugin * self)
 
60
{
 
61
    g_return_val_if_fail (CCM_IS_PREFERENCES_PAGE_PLUGIN (self), NULL);
 
62
 
 
63
    CCMPreferencesPagePlugin *plugin;
 
64
 
 
65
    for (plugin = self; CCM_IS_PLUGIN (plugin);
 
66
         plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin));
 
67
 
 
68
    return plugin;
 
69
}
 
70
 
 
71
void
 
72
ccm_preferences_page_plugin_init_general_section (CCMPreferencesPagePlugin * self,
 
73
                                                  CCMPreferencesPage * preferences,
 
74
                                                  GtkWidget * general_section)
 
75
{
 
76
    g_return_if_fail (CCM_IS_PREFERENCES_PAGE_PLUGIN (self));
 
77
    g_return_if_fail (preferences != NULL);
 
78
    g_return_if_fail (general_section != NULL);
 
79
 
 
80
    CCMPreferencesPagePlugin *plugin;
 
81
 
 
82
    for (plugin = self; CCM_IS_PLUGIN (plugin);
 
83
         plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin))
 
84
    {
 
85
        if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_general_section)
 
86
            break;
 
87
    }
 
88
 
 
89
    if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_general_section)
 
90
    {
 
91
        if (!_ccm_plugin_method_locked((GObject *) plugin,
 
92
                                       CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_general_section))
 
93
            CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_general_section (plugin,
 
94
                                                                                      preferences,
 
95
                                                                                      general_section);
 
96
    }
 
97
}
 
98
 
 
99
void
 
100
ccm_preferences_page_plugin_init_desktop_section (CCMPreferencesPagePlugin * self,
 
101
                                                  CCMPreferencesPage * preferences,
 
102
                                                  GtkWidget * desktop_section)
 
103
{
 
104
    g_return_if_fail (CCM_IS_PREFERENCES_PAGE_PLUGIN (self));
 
105
    g_return_if_fail (preferences != NULL);
 
106
    g_return_if_fail (desktop_section != NULL);
 
107
 
 
108
    CCMPreferencesPagePlugin *plugin;
 
109
 
 
110
    for (plugin = self; CCM_IS_PLUGIN (plugin);
 
111
         plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin))
 
112
    {
 
113
        if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_desktop_section)
 
114
            break;
 
115
    }
 
116
 
 
117
    if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_desktop_section)
 
118
    {
 
119
        if (!_ccm_plugin_method_locked ((GObject *) plugin,
 
120
                                        CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)-> init_desktop_section))
 
121
            CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_desktop_section (plugin,
 
122
                                                                                      preferences,
 
123
                                                                                      desktop_section);
 
124
    }
 
125
}
 
126
 
 
127
void
 
128
ccm_preferences_page_plugin_init_windows_section (CCMPreferencesPagePlugin * self,
 
129
                                                  CCMPreferencesPage * preferences,
 
130
                                                  GtkWidget * windows_section)
 
131
{
 
132
    g_return_if_fail (CCM_IS_PREFERENCES_PAGE_PLUGIN (self));
 
133
    g_return_if_fail (preferences != NULL);
 
134
    g_return_if_fail (windows_section != NULL);
 
135
 
 
136
    CCMPreferencesPagePlugin *plugin;
 
137
 
 
138
    for (plugin = self; CCM_IS_PLUGIN (plugin);
 
139
         plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin))
 
140
    {
 
141
        if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_windows_section)
 
142
            break;
 
143
    }
 
144
 
 
145
    if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->
 
146
        init_windows_section)
 
147
    {
 
148
        if (!_ccm_plugin_method_locked((GObject *) plugin,
 
149
                                       CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_windows_section))
 
150
            CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_windows_section (plugin,
 
151
                                                                                      preferences, 
 
152
                                                                                      windows_section);
 
153
    }
 
154
}
 
155
 
 
156
void
 
157
ccm_preferences_page_plugin_init_effects_section (CCMPreferencesPagePlugin * self,
 
158
                                                  CCMPreferencesPage * preferences,
 
159
                                                  GtkWidget * effects_section)
 
160
{
 
161
    g_return_if_fail (CCM_IS_PREFERENCES_PAGE_PLUGIN (self));
 
162
    g_return_if_fail (preferences != NULL);
 
163
    g_return_if_fail (effects_section != NULL);
 
164
 
 
165
    CCMPreferencesPagePlugin *plugin;
 
166
 
 
167
    for (plugin = self; CCM_IS_PLUGIN (plugin);
 
168
         plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin))
 
169
    {
 
170
        if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_effects_section)
 
171
            break;
 
172
    }
 
173
 
 
174
    if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_effects_section)
 
175
    {
 
176
        if (!_ccm_plugin_method_locked((GObject *) plugin,
 
177
                                       CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_effects_section))
 
178
            CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_effects_section (plugin, 
 
179
                                                                                      preferences, 
 
180
                                                                                      effects_section);
 
181
    }
 
182
}
 
183
 
 
184
void
 
185
ccm_preferences_page_plugin_init_accessibility_section (CCMPreferencesPagePlugin * self,
 
186
                                                        CCMPreferencesPage * preferences,
 
187
                                                        GtkWidget * accessibility_section)
 
188
{
 
189
    g_return_if_fail (CCM_IS_PREFERENCES_PAGE_PLUGIN (self));
 
190
    g_return_if_fail (preferences != NULL);
 
191
    g_return_if_fail (accessibility_section != NULL);
 
192
 
 
193
    CCMPreferencesPagePlugin *plugin;
 
194
 
 
195
    for (plugin = self; CCM_IS_PLUGIN (plugin);
 
196
         plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin))
 
197
    {
 
198
        if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_accessibility_section)
 
199
            break;
 
200
    }
 
201
 
 
202
    if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_effects_section)
 
203
    {
 
204
        if (!_ccm_plugin_method_locked ((GObject *) plugin,
 
205
                                        CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_accessibility_section))
 
206
            CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_accessibility_section (plugin, 
 
207
                                                                                            preferences,
 
208
                                                                                            accessibility_section);
 
209
    }
 
210
}
 
211
 
 
212
void
 
213
ccm_preferences_page_plugin_init_utilities_section (CCMPreferencesPagePlugin * self,
 
214
                                                    CCMPreferencesPage * preferences,
 
215
                                                    GtkWidget * utilities_section)
 
216
{
 
217
    g_return_if_fail (CCM_IS_PREFERENCES_PAGE_PLUGIN (self));
 
218
    g_return_if_fail (preferences != NULL);
 
219
    g_return_if_fail (utilities_section != NULL);
 
220
 
 
221
    CCMPreferencesPagePlugin *plugin;
 
222
 
 
223
    for (plugin = self; CCM_IS_PLUGIN (plugin);
 
224
         plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin))
 
225
    {
 
226
        if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_utilities_section)
 
227
            break;
 
228
    }
 
229
 
 
230
    if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_utilities_section)
 
231
    {
 
232
        if (!_ccm_plugin_method_locked ((GObject *) plugin,
 
233
                                        CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_utilities_section))
 
234
            CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_utilities_section (plugin,
 
235
                                                                                        preferences,
 
236
                                                                                        utilities_section);
 
237
    }
 
238
}