1
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- */
4
* Copyright (C) Nicolas Bruguier 2007-2010 <gandalfn@club-internet.fr>
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.
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.
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.
23
#include "ccm-preferences-page-plugin.h"
26
ccm_preferences_page_plugin_base_init (gpointer g_class)
28
static gboolean initialized = FALSE;
37
ccm_preferences_page_plugin_get_type (void)
39
static GType ccm_preferences_page_plugin_type = 0;
41
if (!ccm_preferences_page_plugin_type)
43
const GTypeInfo ccm_preferences_page_plugin_info = {
44
sizeof (CCMPreferencesPagePluginClass),
45
ccm_preferences_page_plugin_base_init,
49
ccm_preferences_page_plugin_type =
50
g_type_register_static (G_TYPE_INTERFACE,
51
"CCMPreferencesPagePlugin",
52
&ccm_preferences_page_plugin_info, 0);
55
return ccm_preferences_page_plugin_type;
58
CCMPreferencesPagePlugin *
59
_ccm_preferences_page_plugin_get_root (CCMPreferencesPagePlugin * self)
61
g_return_val_if_fail (CCM_IS_PREFERENCES_PAGE_PLUGIN (self), NULL);
63
CCMPreferencesPagePlugin *plugin;
65
for (plugin = self; CCM_IS_PLUGIN (plugin);
66
plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin));
72
ccm_preferences_page_plugin_init_general_section (CCMPreferencesPagePlugin * self,
73
CCMPreferencesPage * preferences,
74
GtkWidget * general_section)
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);
80
CCMPreferencesPagePlugin *plugin;
82
for (plugin = self; CCM_IS_PLUGIN (plugin);
83
plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin))
85
if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_general_section)
89
if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_general_section)
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,
100
ccm_preferences_page_plugin_init_desktop_section (CCMPreferencesPagePlugin * self,
101
CCMPreferencesPage * preferences,
102
GtkWidget * desktop_section)
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);
108
CCMPreferencesPagePlugin *plugin;
110
for (plugin = self; CCM_IS_PLUGIN (plugin);
111
plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin))
113
if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_desktop_section)
117
if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_desktop_section)
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,
128
ccm_preferences_page_plugin_init_windows_section (CCMPreferencesPagePlugin * self,
129
CCMPreferencesPage * preferences,
130
GtkWidget * windows_section)
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);
136
CCMPreferencesPagePlugin *plugin;
138
for (plugin = self; CCM_IS_PLUGIN (plugin);
139
plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin))
141
if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_windows_section)
145
if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->
146
init_windows_section)
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,
157
ccm_preferences_page_plugin_init_effects_section (CCMPreferencesPagePlugin * self,
158
CCMPreferencesPage * preferences,
159
GtkWidget * effects_section)
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);
165
CCMPreferencesPagePlugin *plugin;
167
for (plugin = self; CCM_IS_PLUGIN (plugin);
168
plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin))
170
if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_effects_section)
174
if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_effects_section)
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,
185
ccm_preferences_page_plugin_init_accessibility_section (CCMPreferencesPagePlugin * self,
186
CCMPreferencesPage * preferences,
187
GtkWidget * accessibility_section)
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);
193
CCMPreferencesPagePlugin *plugin;
195
for (plugin = self; CCM_IS_PLUGIN (plugin);
196
plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin))
198
if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_accessibility_section)
202
if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_effects_section)
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,
208
accessibility_section);
213
ccm_preferences_page_plugin_init_utilities_section (CCMPreferencesPagePlugin * self,
214
CCMPreferencesPage * preferences,
215
GtkWidget * utilities_section)
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);
221
CCMPreferencesPagePlugin *plugin;
223
for (plugin = self; CCM_IS_PLUGIN (plugin);
224
plugin = CCM_PREFERENCES_PAGE_PLUGIN_PARENT (plugin))
226
if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_utilities_section)
230
if (CCM_PREFERENCES_PAGE_PLUGIN_GET_INTERFACE (plugin)->init_utilities_section)
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,