Merge lp:~smspillaz/compiz-libcompizconfig/compiz-libcompizconfig.refactor-plugin into lp:~compiz-team/compiz-libcompizconfig/0.9.8
- compiz-libcompizconfig.refactor-plugin
- Merge into 0.9.8
Status: | Superseded |
---|---|
Proposed branch: | lp:~smspillaz/compiz-libcompizconfig/compiz-libcompizconfig.refactor-plugin |
Merge into: | lp:~compiz-team/compiz-libcompizconfig/0.9.8 |
Prerequisite: | lp:~smspillaz/compiz-libcompizconfig/compiz-libcompizconfig.context-funcs-behind-interface |
Diff against target: |
1314 lines (+324/-196) 6 files modified
backend/src/ini.c (+23/-23) include/ccs.h (+20/-25) plugin/ccp/src/ccp.cpp (+3/-3) src/ccs-private.h (+25/-0) src/compiz.cpp (+61/-57) src/main.c (+192/-88) |
To merge this branch: | bzr merge lp:~smspillaz/compiz-libcompizconfig/compiz-libcompizconfig.refactor-plugin |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Compiz Maintainers | Pending | ||
Review via email: mp+103996@code.launchpad.net |
This proposal has been superseded by a proposal from 2012-04-29.
Commit message
Description of the change
This is all about bug 990690.
!! - It probably isn't a good idea to test this branch in isolation, as it is part of a pipeline to get compiz-
lp:~smspillaz/compiz-libcompizconfig/compiz-libcompizconfig.mock-context
lp:~smspillaz/compiz-compizconfig-python/compiz-compizconfig-python.setting-api
lp:~smspillaz/compiz-compizconfig-gconf/compiz-compizconfig-gconf.adapt-to-new-interfaces
.. that's all !!
This branch takes all of the public members of the plugin struct and hides them behind a private pointer requiring indirection to access them
Unmerged revisions
- 442. By Sam Spilsbury
-
Merged context-
funcs-behind- interface into refactor-plugin. - 441. By Sam Spilsbury
-
Merged context-
funcs-behind- interface into refactor-plugin. - 440. By Sam Spilsbury
-
Merged context-
funcs-behind- interface into refactor-plugin. - 439. By Sam Spilsbury
-
Merged context-
funcs-behind- interface into refactor-plugin. - 438. By Sam Spilsbury
-
Merged context-
funcs-behind- interface into refactor-plugin. - 437. By Sam Spilsbury
-
Work correctly with protocol buffers
- 436. By Sam Spilsbury
-
Merged context-
funcs-behind- interface into refactor-plugin. - 435. By Sam Spilsbury
-
Bindability
- 434. By Sam Spilsbury
-
Hide details of CCSPlugin in priv, provide accesor functions
- 433. By Sam Spilsbury
-
Hide the private stuff behind the interface too
Preview Diff
1 | === modified file 'backend/src/ini.c' |
2 | --- backend/src/ini.c 2012-04-28 18:58:54 +0000 |
3 | +++ backend/src/ini.c 2012-04-28 18:58:54 +0000 |
4 | @@ -272,7 +272,7 @@ |
5 | case TypeString: |
6 | { |
7 | char *value; |
8 | - if (ccsIniGetString (data->iniFile, setting->parent->name, |
9 | + if (ccsIniGetString (data->iniFile, ccsPluginGetName (setting->parent), |
10 | keyName, &value)) |
11 | { |
12 | ccsSetString (setting, value, TRUE); |
13 | @@ -284,7 +284,7 @@ |
14 | case TypeMatch: |
15 | { |
16 | char *value; |
17 | - if (ccsIniGetString (data->iniFile, setting->parent->name, |
18 | + if (ccsIniGetString (data->iniFile, ccsPluginGetName (setting->parent), |
19 | keyName, &value)) |
20 | { |
21 | ccsSetMatch (setting, value, TRUE); |
22 | @@ -296,7 +296,7 @@ |
23 | case TypeInt: |
24 | { |
25 | int value; |
26 | - if (ccsIniGetInt (data->iniFile, setting->parent->name, |
27 | + if (ccsIniGetInt (data->iniFile, ccsPluginGetName (setting->parent), |
28 | keyName, &value)) |
29 | { |
30 | ccsSetInt (setting, value, TRUE); |
31 | @@ -307,7 +307,7 @@ |
32 | case TypeBool: |
33 | { |
34 | Bool value; |
35 | - if (ccsIniGetBool (data->iniFile, setting->parent->name, |
36 | + if (ccsIniGetBool (data->iniFile, ccsPluginGetName (setting->parent), |
37 | keyName, &value)) |
38 | { |
39 | ccsSetBool (setting, (value != 0), TRUE); |
40 | @@ -318,7 +318,7 @@ |
41 | case TypeFloat: |
42 | { |
43 | float value; |
44 | - if (ccsIniGetFloat (data->iniFile, setting->parent->name, |
45 | + if (ccsIniGetFloat (data->iniFile, ccsPluginGetName (setting->parent), |
46 | keyName, &value)) |
47 | { |
48 | ccsSetFloat (setting, value, TRUE); |
49 | @@ -330,7 +330,7 @@ |
50 | { |
51 | CCSSettingColorValue color; |
52 | |
53 | - if (ccsIniGetColor (data->iniFile, setting->parent->name, |
54 | + if (ccsIniGetColor (data->iniFile, ccsPluginGetName (setting->parent), |
55 | keyName, &color)) |
56 | { |
57 | ccsSetColor (setting, color, TRUE); |
58 | @@ -341,7 +341,7 @@ |
59 | case TypeKey: |
60 | { |
61 | CCSSettingKeyValue key; |
62 | - if (ccsIniGetKey (data->iniFile, setting->parent->name, |
63 | + if (ccsIniGetKey (data->iniFile, ccsPluginGetName (setting->parent), |
64 | keyName, &key)) |
65 | { |
66 | ccsSetKey (setting, key, TRUE); |
67 | @@ -352,7 +352,7 @@ |
68 | case TypeButton: |
69 | { |
70 | CCSSettingButtonValue button; |
71 | - if (ccsIniGetButton (data->iniFile, setting->parent->name, |
72 | + if (ccsIniGetButton (data->iniFile, ccsPluginGetName (setting->parent), |
73 | keyName, &button)) |
74 | { |
75 | ccsSetButton (setting, button, TRUE); |
76 | @@ -363,7 +363,7 @@ |
77 | case TypeEdge: |
78 | { |
79 | unsigned int edges; |
80 | - if (ccsIniGetEdge (data->iniFile, setting->parent->name, |
81 | + if (ccsIniGetEdge (data->iniFile, ccsPluginGetName (setting->parent), |
82 | keyName, &edges)) |
83 | { |
84 | ccsSetEdge (setting, edges, TRUE); |
85 | @@ -374,7 +374,7 @@ |
86 | case TypeBell: |
87 | { |
88 | Bool bell; |
89 | - if (ccsIniGetBell (data->iniFile, setting->parent->name, |
90 | + if (ccsIniGetBell (data->iniFile, ccsPluginGetName (setting->parent), |
91 | keyName, &bell)) |
92 | { |
93 | ccsSetBell (setting, bell, TRUE); |
94 | @@ -385,7 +385,7 @@ |
95 | case TypeList: |
96 | { |
97 | CCSSettingValueList value; |
98 | - if (ccsIniGetList (data->iniFile, setting->parent->name, |
99 | + if (ccsIniGetList (data->iniFile, ccsPluginGetName (setting->parent), |
100 | keyName, &value, setting)) |
101 | { |
102 | ccsSetList (setting, value, TRUE); |
103 | @@ -459,7 +459,7 @@ |
104 | |
105 | if (setting->isDefault) |
106 | { |
107 | - ccsIniRemoveEntry (data->iniFile, setting->parent->name, keyName); |
108 | + ccsIniRemoveEntry (data->iniFile, ccsPluginGetName (setting->parent), keyName); |
109 | free (keyName); |
110 | return; |
111 | } |
112 | @@ -470,7 +470,7 @@ |
113 | { |
114 | char *value; |
115 | if (ccsGetString (setting, &value)) |
116 | - ccsIniSetString (data->iniFile, setting->parent->name, |
117 | + ccsIniSetString (data->iniFile, ccsPluginGetName (setting->parent), |
118 | keyName, value); |
119 | } |
120 | break; |
121 | @@ -478,7 +478,7 @@ |
122 | { |
123 | char *value; |
124 | if (ccsGetMatch (setting, &value)) |
125 | - ccsIniSetString (data->iniFile, setting->parent->name, |
126 | + ccsIniSetString (data->iniFile, ccsPluginGetName (setting->parent), |
127 | keyName, value); |
128 | } |
129 | break; |
130 | @@ -486,7 +486,7 @@ |
131 | { |
132 | int value; |
133 | if (ccsGetInt (setting, &value)) |
134 | - ccsIniSetInt (data->iniFile, setting->parent->name, |
135 | + ccsIniSetInt (data->iniFile, ccsPluginGetName (setting->parent), |
136 | keyName, value); |
137 | } |
138 | break; |
139 | @@ -494,7 +494,7 @@ |
140 | { |
141 | float value; |
142 | if (ccsGetFloat (setting, &value)) |
143 | - ccsIniSetFloat (data->iniFile, setting->parent->name, |
144 | + ccsIniSetFloat (data->iniFile, ccsPluginGetName (setting->parent), |
145 | keyName, value); |
146 | } |
147 | break; |
148 | @@ -502,7 +502,7 @@ |
149 | { |
150 | Bool value; |
151 | if (ccsGetBool (setting, &value)) |
152 | - ccsIniSetBool (data->iniFile, setting->parent->name, |
153 | + ccsIniSetBool (data->iniFile, ccsPluginGetName (setting->parent), |
154 | keyName, value); |
155 | } |
156 | break; |
157 | @@ -510,7 +510,7 @@ |
158 | { |
159 | CCSSettingColorValue value; |
160 | if (ccsGetColor (setting, &value)) |
161 | - ccsIniSetColor (data->iniFile, setting->parent->name, |
162 | + ccsIniSetColor (data->iniFile, ccsPluginGetName (setting->parent), |
163 | keyName, value); |
164 | } |
165 | break; |
166 | @@ -518,7 +518,7 @@ |
167 | { |
168 | CCSSettingKeyValue value; |
169 | if (ccsGetKey (setting, &value)) |
170 | - ccsIniSetKey (data->iniFile, setting->parent->name, |
171 | + ccsIniSetKey (data->iniFile, ccsPluginGetName (setting->parent), |
172 | keyName, value); |
173 | } |
174 | break; |
175 | @@ -526,7 +526,7 @@ |
176 | { |
177 | CCSSettingButtonValue value; |
178 | if (ccsGetButton (setting, &value)) |
179 | - ccsIniSetButton (data->iniFile, setting->parent->name, |
180 | + ccsIniSetButton (data->iniFile, ccsPluginGetName (setting->parent), |
181 | keyName, value); |
182 | } |
183 | break; |
184 | @@ -534,7 +534,7 @@ |
185 | { |
186 | unsigned int value; |
187 | if (ccsGetEdge (setting, &value)) |
188 | - ccsIniSetEdge (data->iniFile, setting->parent->name, |
189 | + ccsIniSetEdge (data->iniFile, ccsPluginGetName (setting->parent), |
190 | keyName, value); |
191 | } |
192 | break; |
193 | @@ -542,7 +542,7 @@ |
194 | { |
195 | Bool value; |
196 | if (ccsGetBell (setting, &value)) |
197 | - ccsIniSetBell (data->iniFile, setting->parent->name, |
198 | + ccsIniSetBell (data->iniFile, ccsPluginGetName (setting->parent), |
199 | keyName, value); |
200 | } |
201 | break; |
202 | @@ -550,7 +550,7 @@ |
203 | { |
204 | CCSSettingValueList value; |
205 | if (ccsGetList (setting, &value)) |
206 | - ccsIniSetList (data->iniFile, setting->parent->name, |
207 | + ccsIniSetList (data->iniFile, ccsPluginGetName (setting->parent), |
208 | keyName, value, setting->info.forList.listType); |
209 | } |
210 | break; |
211 | |
212 | === modified file 'include/ccs.h' |
213 | --- include/ccs.h 2012-04-28 18:58:54 +0000 |
214 | +++ include/ccs.h 2012-04-28 18:58:54 +0000 |
215 | @@ -332,33 +332,28 @@ |
216 | unsigned int refCount; /* reference count */ |
217 | }; |
218 | |
219 | +char * ccsPluginGetName (CCSPlugin *plugin); |
220 | +char * ccsPluginGetShortDesc (CCSPlugin *plugin); |
221 | +char * ccsPluginGetLongDesc (CCSPlugin *plugin); |
222 | +char * ccsPluginGetHints (CCSPlugin *plugin); |
223 | +char * ccsPluginGetCategory (CCSPlugin *plugin); |
224 | + |
225 | +CCSStringList ccsPluginGetLoadAfter (CCSPlugin *plugin); |
226 | +CCSStringList ccsPluginGetLoadBefore (CCSPlugin *plugin); |
227 | +CCSStringList ccsPluginGetRequiresPlugins (CCSPlugin *plugin); |
228 | +CCSStringList ccsPluginGetConflictPlugins (CCSPlugin *plugin); |
229 | +CCSStringList ccsPluginGetProvidesFeatures (CCSPlugin *plugin); |
230 | +CCSStringList ccsPluginGetRequiresFeatures (CCSPlugin *plugin); |
231 | + |
232 | +void * ccsPluginGetPrivatePtr (CCSPlugin *plugin); |
233 | +void ccsPluginSetPrivatePtr (CCSPlugin *plugin, void *ptr); |
234 | + |
235 | +CCSContext * ccsPluginGetContext (CCSPlugin *plugin); |
236 | + |
237 | +void * ccsPluginGetProvidesFeaturesBindable (CCSPlugin *plugin); |
238 | + |
239 | struct _CCSPlugin |
240 | { |
241 | - char *name; /* plugin name */ |
242 | - char *shortDesc; /* plugin short description */ |
243 | - char *longDesc; /* plugin long description */ |
244 | - char *hints; /* currently unused */ |
245 | - char *category; /* plugin category name */ |
246 | - |
247 | - CCSStringList loadAfter; /* list of plugin names this plugin needs to |
248 | - be loaded after */ |
249 | - CCSStringList loadBefore; /* list of plugin names this plugin needs to |
250 | - be loaded before */ |
251 | - CCSStringList requiresPlugin; /* list of plugin names this plugin |
252 | - requires */ |
253 | - CCSStringList conflictPlugin; /* list of plugin names this plugin |
254 | - conflicts with */ |
255 | - CCSStringList conflictFeature; /* list of feature names this plugin |
256 | - conflicts with */ |
257 | - CCSStringList providesFeature; /* list of feature names this plugin |
258 | - provides */ |
259 | - CCSStringList requiresFeature; /* list of feature names this plugin |
260 | - requires */ |
261 | - |
262 | - void *privatePtr; /* private pointer that can be used |
263 | - by the caller */ |
264 | - CCSContext *context; /* context this plugin belongs to */ |
265 | - |
266 | void *ccsPrivate; /* private pointer for compizconfig |
267 | internal usage */ |
268 | unsigned int refCount; /* reference count */ |
269 | |
270 | === modified file 'plugin/ccp/src/ccp.cpp' |
271 | --- plugin/ccp/src/ccp.cpp 2012-04-28 18:58:54 +0000 |
272 | +++ plugin/ccp/src/ccp.cpp 2012-04-28 18:58:54 +0000 |
273 | @@ -202,7 +202,7 @@ |
274 | type = CompOption::TypeBool; |
275 | |
276 | if ((strcmp (s->name, "active_plugins") == 0) && |
277 | - (strcmp (s->parent->name, CORE_VTABLE_NAME) == 0)) |
278 | + (strcmp (ccsPluginGetName (s->parent), CORE_VTABLE_NAME) == 0)) |
279 | { |
280 | ccpConvertPluginList (s, list, v); |
281 | } |
282 | @@ -443,14 +443,14 @@ |
283 | s = l->data; |
284 | l = l->next; |
285 | |
286 | - p = CompPlugin::find (s->parent->name); |
287 | + p = CompPlugin::find (ccsPluginGetName (s->parent)); |
288 | |
289 | if (!p) |
290 | continue; |
291 | |
292 | o = CompOption::findOption (p->vTable->getOptions (), s->name); |
293 | if (o) |
294 | - setOptionFromContext (o, s->parent->name); |
295 | + setOptionFromContext (o, ccsPluginGetName (s->parent)); |
296 | D (D_FULL, "Setting Update \"%s\"\n", s->name); |
297 | } |
298 | |
299 | |
300 | === modified file 'src/ccs-private.h' |
301 | --- src/ccs-private.h 2012-04-28 18:58:54 +0000 |
302 | +++ src/ccs-private.h 2012-04-28 18:58:54 +0000 |
303 | @@ -55,6 +55,31 @@ |
304 | |
305 | typedef struct _CCSPluginPrivate |
306 | { |
307 | + char *name; /* plugin name */ |
308 | + char *shortDesc; /* plugin short description */ |
309 | + char *longDesc; /* plugin long description */ |
310 | + char *hints; /* currently unused */ |
311 | + char *category; /* plugin category name */ |
312 | + |
313 | + CCSStringList loadAfter; /* list of plugin names this plugin needs to |
314 | + be loaded after */ |
315 | + CCSStringList loadBefore; /* list of plugin names this plugin needs to |
316 | + be loaded before */ |
317 | + CCSStringList requiresPlugin; /* list of plugin names this plugin |
318 | + requires */ |
319 | + CCSStringList conflictPlugin; /* list of plugin names this plugin |
320 | + conflicts with */ |
321 | + CCSStringList conflictFeature; /* list of feature names this plugin |
322 | + conflicts with */ |
323 | + CCSStringList providesFeature; /* list of feature names this plugin |
324 | + provides */ |
325 | + CCSStringList requiresFeature; /* list of feature names this plugin |
326 | + requires */ |
327 | + |
328 | + void *privatePtr; /* private pointer that can be used |
329 | + by the caller */ |
330 | + CCSContext *context; /* context this plugin belongs to */ |
331 | + |
332 | CCSSettingList settings; |
333 | CCSGroupList groups; |
334 | Bool loaded; |
335 | |
336 | === modified file 'src/compiz.cpp' |
337 | --- src/compiz.cpp 2012-04-28 18:58:54 +0000 |
338 | +++ src/compiz.cpp 2012-04-28 18:58:54 +0000 |
339 | @@ -820,19 +820,21 @@ |
340 | static void |
341 | initRulesFromPB (CCSPlugin * plugin, const PluginInfoMetadata & pluginInfoPB) |
342 | { |
343 | - addStringsFromPB (&plugin->providesFeature, pluginInfoPB.feature ()); |
344 | + PLUGIN_PRIV (plugin) |
345 | + |
346 | + addStringsFromPB (&pPrivate->providesFeature, pluginInfoPB.feature ()); |
347 | |
348 | if (!pluginInfoPB.has_deps ()) |
349 | return; |
350 | |
351 | const DependenciesMetadata & deps = pluginInfoPB.deps (); |
352 | |
353 | - addStringsFromPB (&plugin->loadAfter, deps.after_plugin ()); |
354 | - addStringsFromPB (&plugin->loadBefore, deps.before_plugin ()); |
355 | - addStringsFromPB (&plugin->requiresPlugin, deps.require_plugin ()); |
356 | - addStringsFromPB (&plugin->requiresFeature, deps.require_feature ()); |
357 | - addStringsFromPB (&plugin->conflictPlugin, deps.conflict_plugin ()); |
358 | - addStringsFromPB (&plugin->conflictFeature, deps.conflict_feature ()); |
359 | + addStringsFromPB (&pPrivate->loadAfter, deps.after_plugin ()); |
360 | + addStringsFromPB (&pPrivate->loadBefore, deps.before_plugin ()); |
361 | + addStringsFromPB (&pPrivate->requiresPlugin, deps.require_plugin ()); |
362 | + addStringsFromPB (&pPrivate->requiresFeature, deps.require_feature ()); |
363 | + addStringsFromPB (&pPrivate->conflictPlugin, deps.conflict_plugin ()); |
364 | + addStringsFromPB (&pPrivate->conflictFeature, deps.conflict_feature ()); |
365 | } |
366 | |
367 | static void |
368 | @@ -884,28 +886,28 @@ |
369 | asprintf (&pPrivate->xmlPath, "/compiz/plugin[@name = '%s']", name); |
370 | } |
371 | |
372 | - plugin->context = context; |
373 | - plugin->name = strdup (name); |
374 | + pPrivate->context = context; |
375 | + pPrivate->name = strdup (name); |
376 | |
377 | if (!basicMetadata) |
378 | { |
379 | - plugin->shortDesc = |
380 | + pPrivate->shortDesc = |
381 | strdup (pluginInfoPB.has_short_desc () ? |
382 | pluginInfoPB.short_desc ().c_str () : |
383 | name); |
384 | - plugin->longDesc = |
385 | + pPrivate->longDesc = |
386 | strdup (pluginInfoPB.has_long_desc () ? |
387 | pluginInfoPB.long_desc ().c_str () : |
388 | name); |
389 | - plugin->category = strdup (pluginInfoPB.has_category () ? |
390 | + pPrivate->category = strdup (pluginInfoPB.has_category () ? |
391 | pluginInfoPB.category ().c_str () : |
392 | ""); |
393 | } |
394 | else |
395 | { |
396 | - plugin->shortDesc = strdup (name); |
397 | - plugin->longDesc = strdup (name); |
398 | - plugin->category = strdup (""); |
399 | + pPrivate->shortDesc = strdup (name); |
400 | + pPrivate->longDesc = strdup (name); |
401 | + pPrivate->category = strdup (""); |
402 | } |
403 | |
404 | initRulesFromPB (plugin, pluginInfoPB); |
405 | @@ -951,26 +953,26 @@ |
406 | pPrivate->xmlPath = strdup ("/compiz/core"); |
407 | } |
408 | |
409 | - plugin->context = context; |
410 | - plugin->name = strdup ("core"); |
411 | - plugin->category = strdup ("General"); |
412 | + pPrivate->context = context; |
413 | + pPrivate->name = strdup ("core"); |
414 | + pPrivate->category = strdup ("General"); |
415 | |
416 | if (!basicMetadata) |
417 | { |
418 | - plugin->shortDesc = |
419 | + pPrivate->shortDesc = |
420 | strdup (pluginInfoPB.has_short_desc () ? |
421 | pluginInfoPB.short_desc ().c_str () : |
422 | "General Options"); |
423 | |
424 | - plugin->longDesc = |
425 | + pPrivate->longDesc = |
426 | strdup (pluginInfoPB.has_long_desc () ? |
427 | pluginInfoPB.long_desc ().c_str () : |
428 | "General Compiz Options"); |
429 | } |
430 | else |
431 | { |
432 | - plugin->shortDesc = strdup ("General Options"); |
433 | - plugin->longDesc = strdup ("General Compiz Options"); |
434 | + pPrivate->shortDesc = strdup ("General Options"); |
435 | + pPrivate->longDesc = strdup ("General Compiz Options"); |
436 | } |
437 | |
438 | initRulesFromPB (plugin, pluginInfoPB); |
439 | @@ -2431,22 +2433,24 @@ |
440 | } |
441 | #endif |
442 | |
443 | - addStringsFromPath (&plugin->providesFeature, "feature", node, |
444 | + PLUGIN_PRIV (plugin); |
445 | + |
446 | + addStringsFromPath (&pPrivate->providesFeature, "feature", node, |
447 | featureListPBv); |
448 | |
449 | - addStringsFromPath (&plugin->loadAfter, |
450 | + addStringsFromPath (&pPrivate->loadAfter, |
451 | "deps/relation[@type = 'after']/plugin", node, |
452 | pluginAfterListPBv); |
453 | - addStringsFromPath (&plugin->loadBefore, |
454 | + addStringsFromPath (&pPrivate->loadBefore, |
455 | "deps/relation[@type = 'before']/plugin", node, |
456 | pluginBeforeListPBv); |
457 | - addStringsFromPath (&plugin->requiresPlugin, |
458 | + addStringsFromPath (&pPrivate->requiresPlugin, |
459 | "deps/requirement/plugin", node, requirePluginListPBv); |
460 | - addStringsFromPath (&plugin->requiresFeature, |
461 | + addStringsFromPath (&pPrivate->requiresFeature, |
462 | "deps/requirement/feature", node, requireFeatureListPBv); |
463 | - addStringsFromPath (&plugin->conflictPlugin, |
464 | + addStringsFromPath (&pPrivate->conflictPlugin, |
465 | "deps/conflict/plugin", node, conflictPluginListPBv); |
466 | - addStringsFromPath (&plugin->conflictFeature, |
467 | + addStringsFromPath (&pPrivate->conflictFeature, |
468 | "deps/conflict/feature", node, conflictFeatureListPBv); |
469 | } |
470 | |
471 | @@ -2457,10 +2461,10 @@ |
472 | if (!pluginInfoPB) |
473 | return; |
474 | |
475 | - pluginInfoPB->set_name (plugin->name); |
476 | - pluginInfoPB->set_short_desc (plugin->shortDesc); |
477 | - pluginInfoPB->set_long_desc (plugin->longDesc); |
478 | - pluginInfoPB->set_category (plugin->category); |
479 | + pluginInfoPB->set_name (ccsPluginGetName (plugin)); |
480 | + pluginInfoPB->set_short_desc (ccsPluginGetShortDesc (plugin)); |
481 | + pluginInfoPB->set_long_desc (ccsPluginGetLongDesc (plugin)); |
482 | + pluginInfoPB->set_category (ccsPluginGetCategory (plugin)); |
483 | } |
484 | #endif |
485 | |
486 | @@ -2521,23 +2525,23 @@ |
487 | pPrivate->xmlFile = strdup (file); |
488 | |
489 | asprintf (&pPrivate->xmlPath, "/compiz/plugin[@name = '%s']", name); |
490 | - plugin->context = context; |
491 | - plugin->name = strdup (name); |
492 | + pPrivate->context = context; |
493 | + pPrivate->name = strdup (name); |
494 | |
495 | if (!basicMetadata) |
496 | { |
497 | - plugin->shortDesc = |
498 | + pPrivate->shortDesc = |
499 | stringFromNodeDefTrans (node, "short/child::text()", name); |
500 | - plugin->longDesc = |
501 | + pPrivate->longDesc = |
502 | stringFromNodeDefTrans (node, "long/child::text()", name); |
503 | - plugin->category = |
504 | + pPrivate->category = |
505 | stringFromNodeDef (node, "category/child::text()", ""); |
506 | } |
507 | else |
508 | { |
509 | - plugin->shortDesc = strdup (name); |
510 | - plugin->longDesc = strdup (name); |
511 | - plugin->category = strdup (""); |
512 | + pPrivate->shortDesc = strdup (name); |
513 | + pPrivate->longDesc = strdup (name); |
514 | + pPrivate->category = strdup (""); |
515 | } |
516 | #ifdef USE_PROTOBUF |
517 | fillBasicInfoIntoPB (plugin, (PluginInfoMetadata *) pluginInfoPBv); |
518 | @@ -2588,23 +2592,23 @@ |
519 | pPrivate->xmlFile = strdup (file); |
520 | |
521 | pPrivate->xmlPath = strdup ("/compiz/plugin[@name='core']"); |
522 | - plugin->context = context; |
523 | - plugin->name = strdup ("core"); |
524 | - plugin->category = strdup ("General"); |
525 | + pPrivate->context = context; |
526 | + pPrivate->name = strdup ("core"); |
527 | + pPrivate->category = strdup ("General"); |
528 | |
529 | if (!basicMetadata) |
530 | { |
531 | - plugin->shortDesc = |
532 | + pPrivate->shortDesc = |
533 | stringFromNodeDefTrans (node, "short/child::text()", |
534 | "General Options"); |
535 | - plugin->longDesc = |
536 | + pPrivate->longDesc = |
537 | stringFromNodeDefTrans (node, "long/child::text()", |
538 | "General Compiz Options"); |
539 | } |
540 | else |
541 | { |
542 | - plugin->shortDesc = strdup ("General Options"); |
543 | - plugin->longDesc = strdup ("General Compiz Options"); |
544 | + pPrivate->shortDesc = strdup ("General Options"); |
545 | + pPrivate->longDesc = strdup ("General Compiz Options"); |
546 | } |
547 | #ifdef USE_PROTOBUF |
548 | fillBasicInfoIntoPB (plugin, (PluginInfoMetadata *) pluginInfoPBv); |
549 | @@ -2931,15 +2935,15 @@ |
550 | |
551 | plugin->ccsPrivate = (void *) pPrivate; |
552 | |
553 | - plugin->context = context; |
554 | - plugin->name = strdup (name); |
555 | + pPrivate->context = context; |
556 | + pPrivate->name = strdup (name); |
557 | |
558 | - if (!plugin->shortDesc) |
559 | - plugin->shortDesc = strdup (name); |
560 | - if (!plugin->longDesc) |
561 | - plugin->longDesc = strdup (name); |
562 | - if (!plugin->category) |
563 | - plugin->category = strdup (""); |
564 | + if (!pPrivate->shortDesc) |
565 | + pPrivate->shortDesc = strdup (name); |
566 | + if (!pPrivate->longDesc) |
567 | + pPrivate->longDesc = strdup (name); |
568 | + if (!pPrivate->category) |
569 | + pPrivate->category = strdup (""); |
570 | |
571 | pPrivate->loaded = TRUE; |
572 | collateGroups (pPrivate); |
573 | @@ -3118,7 +3122,7 @@ |
574 | return; |
575 | |
576 | pPrivate->loaded = TRUE; |
577 | - D (D_FULL, "Initializing %s options...", plugin->name); |
578 | + D (D_FULL, "Initializing %s options...", pPrivate->name); |
579 | |
580 | #ifdef USE_PROTOBUF |
581 | if (usingProtobuf && pPrivate->pbFilePath) |
582 | |
583 | === modified file 'src/main.c' |
584 | --- src/main.c 2012-04-28 18:58:54 +0000 |
585 | +++ src/main.c 2012-04-28 18:58:54 +0000 |
586 | @@ -496,7 +496,7 @@ |
587 | CCSPluginList l = cPrivate->plugins; |
588 | while (l) |
589 | { |
590 | - if (!strcmp (l->data->name, name)) |
591 | + if (!strcmp (ccsPluginGetName (l->data), name)) |
592 | return l->data; |
593 | |
594 | l = l->next; |
595 | @@ -655,22 +655,22 @@ |
596 | if (!p) |
597 | return; |
598 | |
599 | - free (p->name); |
600 | - free (p->shortDesc); |
601 | - free (p->longDesc); |
602 | - free (p->hints); |
603 | - free (p->category); |
604 | - |
605 | - ccsStringListFree (p->loadAfter, TRUE); |
606 | - ccsStringListFree (p->loadBefore, TRUE); |
607 | - ccsStringListFree (p->requiresPlugin, TRUE); |
608 | - ccsStringListFree (p->conflictPlugin, TRUE); |
609 | - ccsStringListFree (p->conflictFeature, TRUE); |
610 | - ccsStringListFree (p->providesFeature, TRUE); |
611 | - ccsStringListFree (p->requiresFeature, TRUE); |
612 | - |
613 | PLUGIN_PRIV (p); |
614 | |
615 | + free (pPrivate->name); |
616 | + free (pPrivate->shortDesc); |
617 | + free (pPrivate->longDesc); |
618 | + free (pPrivate->hints); |
619 | + free (pPrivate->category); |
620 | + |
621 | + ccsStringListFree (pPrivate->loadAfter, TRUE); |
622 | + ccsStringListFree (pPrivate->loadBefore, TRUE); |
623 | + ccsStringListFree (pPrivate->requiresPlugin, TRUE); |
624 | + ccsStringListFree (pPrivate->conflictPlugin, TRUE); |
625 | + ccsStringListFree (pPrivate->conflictFeature, TRUE); |
626 | + ccsStringListFree (pPrivate->providesFeature, TRUE); |
627 | + ccsStringListFree (pPrivate->requiresFeature, TRUE); |
628 | + |
629 | ccsSettingListFree (pPrivate->settings, TRUE); |
630 | ccsGroupListFree (pPrivate->groups, TRUE); |
631 | ccsStrExtensionListFree (pPrivate->stringExtensions, TRUE); |
632 | @@ -1276,7 +1276,7 @@ |
633 | ccsFreeSettingValue (setting->value); |
634 | |
635 | if (processChanged) |
636 | - ccsContextAddChangedSetting (setting->parent->context, setting); |
637 | + ccsContextAddChangedSetting (ccsPluginGetContext (setting->parent), setting); |
638 | } |
639 | |
640 | setting->value = &setting->defaultValue; |
641 | @@ -1366,7 +1366,7 @@ |
642 | setting->value->value.asInt = data; |
643 | |
644 | if (processChanged) |
645 | - ccsContextAddChangedSetting (setting->parent->context, setting); |
646 | + ccsContextAddChangedSetting (ccsPluginGetContext (setting->parent), setting); |
647 | |
648 | return TRUE; |
649 | } |
650 | @@ -1401,7 +1401,7 @@ |
651 | setting->value->value.asFloat = data; |
652 | |
653 | if (processChanged) |
654 | - ccsContextAddChangedSetting (setting->parent->context, setting); |
655 | + ccsContextAddChangedSetting (ccsPluginGetContext (setting->parent), setting); |
656 | |
657 | return TRUE; |
658 | } |
659 | @@ -1435,7 +1435,7 @@ |
660 | setting->value->value.asBool = data; |
661 | |
662 | if (processChanged) |
663 | - ccsContextAddChangedSetting (setting->parent->context, setting); |
664 | + ccsContextAddChangedSetting (ccsPluginGetContext (setting->parent), setting); |
665 | |
666 | return TRUE; |
667 | } |
668 | @@ -1471,7 +1471,7 @@ |
669 | setting->value->value.asString = strdup (data); |
670 | |
671 | if (processChanged) |
672 | - ccsContextAddChangedSetting (setting->parent->context, setting); |
673 | + ccsContextAddChangedSetting (ccsPluginGetContext (setting->parent), setting); |
674 | |
675 | return TRUE; |
676 | } |
677 | @@ -1504,7 +1504,7 @@ |
678 | setting->value->value.asColor = data; |
679 | |
680 | if (processChanged) |
681 | - ccsContextAddChangedSetting (setting->parent->context, setting); |
682 | + ccsContextAddChangedSetting (ccsPluginGetContext (setting->parent), setting); |
683 | |
684 | return TRUE; |
685 | } |
686 | @@ -1540,7 +1540,7 @@ |
687 | setting->value->value.asMatch = strdup (data); |
688 | |
689 | if (processChanged) |
690 | - ccsContextAddChangedSetting (setting->parent->context, setting); |
691 | + ccsContextAddChangedSetting (ccsPluginGetContext (setting->parent), setting); |
692 | |
693 | return TRUE; |
694 | } |
695 | @@ -1574,7 +1574,7 @@ |
696 | setting->value->value.asKey.keyModMask = data.keyModMask; |
697 | |
698 | if (processChanged) |
699 | - ccsContextAddChangedSetting (setting->parent->context, setting); |
700 | + ccsContextAddChangedSetting (ccsPluginGetContext (setting->parent), setting); |
701 | |
702 | return TRUE; |
703 | } |
704 | @@ -1609,7 +1609,7 @@ |
705 | setting->value->value.asButton.edgeMask = data.edgeMask; |
706 | |
707 | if (processChanged) |
708 | - ccsContextAddChangedSetting (setting->parent->context, setting); |
709 | + ccsContextAddChangedSetting (ccsPluginGetContext (setting->parent), setting); |
710 | |
711 | return TRUE; |
712 | } |
713 | @@ -1640,7 +1640,7 @@ |
714 | setting->value->value.asEdge = data; |
715 | |
716 | if (processChanged) |
717 | - ccsContextAddChangedSetting (setting->parent->context, setting); |
718 | + ccsContextAddChangedSetting (ccsPluginGetContext (setting->parent), setting); |
719 | |
720 | return TRUE; |
721 | } |
722 | @@ -1671,7 +1671,7 @@ |
723 | setting->value->value.asBell = data; |
724 | |
725 | if (processChanged) |
726 | - ccsContextAddChangedSetting (setting->parent->context, setting); |
727 | + ccsContextAddChangedSetting (ccsPluginGetContext (setting->parent), setting); |
728 | |
729 | return TRUE; |
730 | } |
731 | @@ -1781,17 +1781,17 @@ |
732 | setting->value->value.asList = ccsCopyList (data, setting); |
733 | |
734 | if ((strcmp (setting->name, "active_plugins") == 0) && |
735 | - (strcmp (setting->parent->name, "core") == 0) && processChanged) |
736 | + (strcmp (ccsPluginGetName (setting->parent), "core") == 0) && processChanged) |
737 | { |
738 | CCSStringList list; |
739 | |
740 | list = ccsGetStringListFromValueList (setting->value->value.asList); |
741 | - ccsSetActivePluginList (setting->parent->context, list); |
742 | + ccsSetActivePluginList (ccsPluginGetContext (setting->parent), list); |
743 | ccsStringListFree (list, TRUE); |
744 | } |
745 | |
746 | if (processChanged) |
747 | - ccsContextAddChangedSetting (setting->parent->context, setting); |
748 | + ccsContextAddChangedSetting (ccsPluginGetContext (setting->parent), setting); |
749 | |
750 | return TRUE; |
751 | } |
752 | @@ -1982,7 +1982,7 @@ |
753 | while (l) |
754 | { |
755 | PLUGIN_PRIV (l->data); |
756 | - if (pPrivate->active && strcmp (l->data->name, "ccp")) |
757 | + if (pPrivate->active && strcmp (ccsPluginGetName (l->data), "ccp")) |
758 | { |
759 | rv = ccsPluginListAppend (rv, l->data); |
760 | } |
761 | @@ -2007,7 +2007,7 @@ |
762 | |
763 | while (list) |
764 | { |
765 | - if (!strcmp (list->data->name, name)) |
766 | + if (!strcmp (ccsPluginGetName (list->data), name)) |
767 | return list->data; |
768 | |
769 | list = list->next; |
770 | @@ -2064,7 +2064,7 @@ |
771 | |
772 | for (i = 0; i < len; i++) |
773 | { |
774 | - CCSStringList l = plugins[i].plugin->loadAfter; |
775 | + CCSStringList l = ccsPluginGetLoadAfter (plugins[i].plugin); |
776 | while (l) |
777 | { |
778 | p = findPluginInList (ap, ((CCSString *)l->data)->value); |
779 | @@ -2075,13 +2075,13 @@ |
780 | l = l->next; |
781 | } |
782 | |
783 | - l = plugins[i].plugin->requiresPlugin; |
784 | + l = ccsPluginGetRequiresPlugins (plugins[i].plugin); |
785 | while (l) |
786 | { |
787 | Bool found = FALSE; |
788 | p = findPluginInList (ap, ((CCSString *)l->data)->value); |
789 | |
790 | - CCSStringList l2 = plugins[i].plugin->loadBefore; |
791 | + CCSStringList l2 = ccsPluginGetLoadBefore (plugins[i].plugin); |
792 | while (l2) |
793 | { |
794 | if (strcmp (((CCSString *)l2->data)->value, |
795 | @@ -2096,7 +2096,7 @@ |
796 | l = l->next; |
797 | } |
798 | |
799 | - l = plugins[i].plugin->loadBefore; |
800 | + l = ccsPluginGetLoadBefore (plugins[i].plugin); |
801 | while (l) |
802 | { |
803 | p = findPluginInList (ap, ((CCSString *)l->data)->value); |
804 | @@ -2139,7 +2139,7 @@ |
805 | |
806 | /* This is a special case to ensure that bench is the last plugin */ |
807 | if (len - removed > 1 && |
808 | - strcmp (plugins[i].plugin->name, "bench") == 0) |
809 | + strcmp (ccsPluginGetName (plugins[i].plugin), "bench") == 0) |
810 | continue; |
811 | |
812 | found = TRUE; |
813 | @@ -2153,7 +2153,7 @@ |
814 | |
815 | strPluginName = calloc (1, sizeof (CCSString)); |
816 | |
817 | - strPluginName->value = strdup (p->name); |
818 | + strPluginName->value = strdup (ccsPluginGetName (p)); |
819 | strPluginName->refCount = 1; |
820 | |
821 | rv = ccsStringListAppend (rv, strPluginName); |
822 | @@ -2444,10 +2444,10 @@ |
823 | void |
824 | ccsReadPluginSettings (CCSPlugin * plugin) |
825 | { |
826 | - if (!plugin || !plugin->context) |
827 | + if (!plugin || !ccsPluginGetContext (plugin)) |
828 | return; |
829 | |
830 | - CONTEXT_PRIV (plugin->context); |
831 | + CONTEXT_PRIV (ccsPluginGetContext (plugin)); |
832 | |
833 | if (!cPrivate->backend) |
834 | return; |
835 | @@ -2456,7 +2456,7 @@ |
836 | return; |
837 | |
838 | if (cPrivate->backend->vTable->readInit) |
839 | - if (!(*cPrivate->backend->vTable->readInit) (plugin->context)) |
840 | + if (!(*cPrivate->backend->vTable->readInit) (ccsPluginGetContext (plugin))) |
841 | return; |
842 | |
843 | PLUGIN_PRIV (plugin); |
844 | @@ -2464,12 +2464,12 @@ |
845 | CCSSettingList sl = pPrivate->settings; |
846 | while (sl) |
847 | { |
848 | - (*cPrivate->backend->vTable->readSetting) (plugin->context, sl->data); |
849 | + (*cPrivate->backend->vTable->readSetting) (ccsPluginGetContext (plugin), sl->data); |
850 | sl = sl->next; |
851 | } |
852 | |
853 | if (cPrivate->backend->vTable->readDone) |
854 | - (*cPrivate->backend->vTable->readDone) (plugin->context); |
855 | + (*cPrivate->backend->vTable->readDone) (ccsPluginGetContext (plugin)); |
856 | } |
857 | |
858 | void |
859 | @@ -2607,12 +2607,12 @@ |
860 | return FALSE; |
861 | |
862 | PLUGIN_PRIV (plugin); |
863 | - CONTEXT_PRIV (plugin->context); |
864 | + CONTEXT_PRIV (ccsPluginGetContext (plugin)); |
865 | |
866 | pPrivate->active = value; |
867 | |
868 | if (cPrivate->pluginListAutoSort) |
869 | - ccsWriteAutoSortedPluginList (plugin->context); |
870 | + ccsWriteAutoSortedPluginList (ccsPluginGetContext (plugin)); |
871 | |
872 | return TRUE; |
873 | } |
874 | @@ -2625,7 +2625,7 @@ |
875 | CCSStringList sl; |
876 | |
877 | /* look if the plugin to be loaded requires a plugin not present */ |
878 | - sl = plugin->requiresPlugin; |
879 | + sl = ccsPluginGetRequiresPlugins (plugin); |
880 | |
881 | CONTEXT_PRIV (context); |
882 | |
883 | @@ -2665,7 +2665,7 @@ |
884 | } |
885 | |
886 | /* look if the new plugin wants a non-present feature */ |
887 | - sl = plugin->requiresFeature; |
888 | + sl = ccsPluginGetRequiresFeatures (plugin); |
889 | |
890 | while (sl) |
891 | { |
892 | @@ -2674,7 +2674,7 @@ |
893 | |
894 | while (pl) |
895 | { |
896 | - CCSStringList featureList = pl->data->providesFeature; |
897 | + CCSStringList featureList = ccsPluginGetProvidesFeatures (pl->data); |
898 | |
899 | while (featureList) |
900 | { |
901 | @@ -2693,7 +2693,7 @@ |
902 | |
903 | while (pl) |
904 | { |
905 | - if (ccsPluginIsActive (context, pl->data->name)) |
906 | + if (ccsPluginIsActive (context, ccsPluginGetName (pl->data))) |
907 | { |
908 | ccsPluginListFree (pl2, FALSE); |
909 | break; |
910 | @@ -2722,7 +2722,7 @@ |
911 | } |
912 | |
913 | /* look if another plugin provides the same feature */ |
914 | - sl = plugin->providesFeature; |
915 | + sl = ccsPluginGetProvidesFeatures (plugin); |
916 | while (sl) |
917 | { |
918 | pl = cPrivate->plugins; |
919 | @@ -2730,9 +2730,9 @@ |
920 | |
921 | while (pl) |
922 | { |
923 | - if (ccsPluginIsActive (context, pl->data->name)) |
924 | + if (ccsPluginIsActive (context, ccsPluginGetName (pl->data))) |
925 | { |
926 | - CCSStringList featureList = pl->data->providesFeature; |
927 | + CCSStringList featureList = ccsPluginGetProvidesFeatures (pl->data); |
928 | |
929 | while (featureList) |
930 | { |
931 | @@ -2766,7 +2766,7 @@ |
932 | } |
933 | |
934 | /* look if another plugin provides a conflicting feature*/ |
935 | - sl = plugin->conflictFeature; |
936 | + sl = ccsPluginGetProvidesFeatures (plugin); |
937 | while (sl) |
938 | { |
939 | pl = cPrivate->plugins; |
940 | @@ -2774,9 +2774,9 @@ |
941 | |
942 | while (pl) |
943 | { |
944 | - if (ccsPluginIsActive (context, pl->data->name)) |
945 | + if (ccsPluginIsActive (context, ccsPluginGetName (pl->data))) |
946 | { |
947 | - CCSStringList featureList = pl->data->providesFeature; |
948 | + CCSStringList featureList = ccsPluginGetProvidesFeatures (pl->data); |
949 | while (featureList) |
950 | { |
951 | if (strcmp (((CCSString *)sl->data)->value, ((CCSString *)featureList->data)->value) == 0) |
952 | @@ -2809,7 +2809,7 @@ |
953 | } |
954 | |
955 | /* look if the plugin to be loaded conflict with a loaded plugin */ |
956 | - sl = plugin->conflictPlugin; |
957 | + sl = ccsPluginGetConflictPlugins (plugin); |
958 | |
959 | while (sl) |
960 | { |
961 | @@ -2861,14 +2861,14 @@ |
962 | if (pl->data == plugin) |
963 | continue; |
964 | |
965 | - if (!ccsPluginIsActive (context, pl->data->name)) |
966 | + if (!ccsPluginIsActive (context, ccsPluginGetName (pl->data))) |
967 | continue; |
968 | |
969 | - pluginList = pl->data->requiresPlugin; |
970 | + pluginList = ccsPluginGetRequiresPlugins (pl->data); |
971 | |
972 | while (pluginList) |
973 | { |
974 | - if (strcmp (plugin->name, ((CCSString *)pluginList->data)->value) == 0) |
975 | + if (strcmp (ccsPluginGetName (plugin), ((CCSString *)pluginList->data)->value) == 0) |
976 | { |
977 | if (!conflict) |
978 | { |
979 | @@ -2876,7 +2876,7 @@ |
980 | conflict->refCount = 1; |
981 | if (conflict) |
982 | { |
983 | - conflict->value = strdup (plugin->name); |
984 | + conflict->value = strdup (ccsPluginGetName (plugin)); |
985 | conflict->type = ConflictPluginNeeded; |
986 | } |
987 | } |
988 | @@ -2897,7 +2897,7 @@ |
989 | } |
990 | |
991 | /* look if a feature provided is required by another plugin */ |
992 | - sl = plugin->providesFeature; |
993 | + sl = ccsPluginGetProvidesFeatures (plugin); |
994 | while (sl) |
995 | { |
996 | pl = cPrivate->plugins; |
997 | @@ -2908,10 +2908,10 @@ |
998 | if (pl->data == plugin) |
999 | continue; |
1000 | |
1001 | - if (!ccsPluginIsActive (context, pl->data->name)) |
1002 | + if (!ccsPluginIsActive (context, ccsPluginGetName (pl->data))) |
1003 | continue; |
1004 | |
1005 | - pluginList = pl->data->requiresFeature; |
1006 | + pluginList = ccsPluginGetRequiresFeatures (pl->data); |
1007 | |
1008 | while (pluginList) |
1009 | { |
1010 | @@ -3176,47 +3176,47 @@ |
1011 | switch (setting->type) |
1012 | { |
1013 | case TypeBool: |
1014 | - ccsIniSetBool (exportFile, plugin->name, keyName, |
1015 | + ccsIniSetBool (exportFile, ccsPluginGetName (plugin), keyName, |
1016 | setting->value->value.asBool); |
1017 | break; |
1018 | case TypeInt: |
1019 | - ccsIniSetInt (exportFile, plugin->name, keyName, |
1020 | + ccsIniSetInt (exportFile, ccsPluginGetName (plugin), keyName, |
1021 | setting->value->value.asInt); |
1022 | break; |
1023 | case TypeFloat: |
1024 | - ccsIniSetFloat (exportFile, plugin->name, keyName, |
1025 | + ccsIniSetFloat (exportFile, ccsPluginGetName (plugin), keyName, |
1026 | setting->value->value.asFloat); |
1027 | break; |
1028 | case TypeString: |
1029 | - ccsIniSetString (exportFile, plugin->name, keyName, |
1030 | + ccsIniSetString (exportFile, ccsPluginGetName (plugin), keyName, |
1031 | setting->value->value.asString); |
1032 | break; |
1033 | case TypeKey: |
1034 | - ccsIniSetKey (exportFile, plugin->name, keyName, |
1035 | + ccsIniSetKey (exportFile, ccsPluginGetName (plugin), keyName, |
1036 | setting->value->value.asKey); |
1037 | break; |
1038 | case TypeButton: |
1039 | - ccsIniSetButton (exportFile, plugin->name, keyName, |
1040 | + ccsIniSetButton (exportFile, ccsPluginGetName (plugin), keyName, |
1041 | setting->value->value.asButton); |
1042 | break; |
1043 | case TypeEdge: |
1044 | - ccsIniSetEdge (exportFile, plugin->name, keyName, |
1045 | + ccsIniSetEdge (exportFile, ccsPluginGetName (plugin), keyName, |
1046 | setting->value->value.asEdge); |
1047 | break; |
1048 | case TypeBell: |
1049 | - ccsIniSetBell (exportFile, plugin->name, keyName, |
1050 | + ccsIniSetBell (exportFile, ccsPluginGetName (plugin), keyName, |
1051 | setting->value->value.asBell); |
1052 | break; |
1053 | case TypeColor: |
1054 | - ccsIniSetColor (exportFile, plugin->name, keyName, |
1055 | + ccsIniSetColor (exportFile, ccsPluginGetName (plugin), keyName, |
1056 | setting->value->value.asColor); |
1057 | break; |
1058 | case TypeMatch: |
1059 | - ccsIniSetString (exportFile, plugin->name, keyName, |
1060 | + ccsIniSetString (exportFile, ccsPluginGetName (plugin), keyName, |
1061 | setting->value->value.asMatch); |
1062 | break; |
1063 | case TypeList: |
1064 | - ccsIniSetList (exportFile, plugin->name, keyName, |
1065 | + ccsIniSetList (exportFile, ccsPluginGetName (plugin), keyName, |
1066 | setting->value->value.asList, |
1067 | setting->info.forList.listType); |
1068 | break; |
1069 | @@ -3256,7 +3256,7 @@ |
1070 | CCSSetting *setting) |
1071 | { |
1072 | char *keyName = NULL; |
1073 | - char *sectionName = strdup (setting->parent->name); |
1074 | + char *sectionName = strdup (ccsPluginGetName (setting->parent)); |
1075 | char *iniValue = NULL; |
1076 | |
1077 | CONTEXT_PRIV (context); |
1078 | @@ -3410,7 +3410,7 @@ |
1079 | CCSSetting *setting) |
1080 | { |
1081 | char *keyName = NULL; |
1082 | - char *sectionName = strdup (setting->parent->name); |
1083 | + char *sectionName = strdup (ccsPluginGetName (setting->parent)); |
1084 | char *iniValue = NULL; |
1085 | |
1086 | CONTEXT_PRIV (context); |
1087 | @@ -3996,7 +3996,7 @@ |
1088 | { |
1089 | Bool value; |
1090 | |
1091 | - if (ccsIniGetBool (importFile, plugin->name, |
1092 | + if (ccsIniGetBool (importFile, ccsPluginGetName (plugin), |
1093 | keyName, &value)) |
1094 | { |
1095 | ccsSetBool (setting, value, TRUE); |
1096 | @@ -4007,7 +4007,7 @@ |
1097 | { |
1098 | int value; |
1099 | |
1100 | - if (ccsIniGetInt (importFile, plugin->name, |
1101 | + if (ccsIniGetInt (importFile, ccsPluginGetName (plugin), |
1102 | keyName, &value)) |
1103 | ccsSetInt (setting, value, TRUE); |
1104 | } |
1105 | @@ -4016,7 +4016,7 @@ |
1106 | { |
1107 | float value; |
1108 | |
1109 | - if (ccsIniGetFloat (importFile, plugin->name, |
1110 | + if (ccsIniGetFloat (importFile, ccsPluginGetName (plugin), |
1111 | keyName, &value)) |
1112 | ccsSetFloat (setting, value, TRUE); |
1113 | } |
1114 | @@ -4025,7 +4025,7 @@ |
1115 | { |
1116 | char *value; |
1117 | |
1118 | - if (ccsIniGetString (importFile, plugin->name, |
1119 | + if (ccsIniGetString (importFile, ccsPluginGetName (plugin), |
1120 | keyName, &value)) |
1121 | { |
1122 | ccsSetString (setting, value, TRUE); |
1123 | @@ -4037,7 +4037,7 @@ |
1124 | { |
1125 | CCSSettingKeyValue value; |
1126 | |
1127 | - if (ccsIniGetKey (importFile, plugin->name, |
1128 | + if (ccsIniGetKey (importFile, ccsPluginGetName (plugin), |
1129 | keyName, &value)) |
1130 | ccsSetKey (setting, value, TRUE); |
1131 | } |
1132 | @@ -4046,7 +4046,7 @@ |
1133 | { |
1134 | CCSSettingButtonValue value; |
1135 | |
1136 | - if (ccsIniGetButton (importFile, plugin->name, |
1137 | + if (ccsIniGetButton (importFile, ccsPluginGetName (plugin), |
1138 | keyName, &value)) |
1139 | ccsSetButton (setting, value, TRUE); |
1140 | } |
1141 | @@ -4055,7 +4055,7 @@ |
1142 | { |
1143 | unsigned int value; |
1144 | |
1145 | - if (ccsIniGetEdge (importFile, plugin->name, |
1146 | + if (ccsIniGetEdge (importFile, ccsPluginGetName (plugin), |
1147 | keyName, &value)) |
1148 | ccsSetEdge (setting, value, TRUE); |
1149 | } |
1150 | @@ -4064,7 +4064,7 @@ |
1151 | { |
1152 | Bool value; |
1153 | |
1154 | - if (ccsIniGetBell (importFile, plugin->name, |
1155 | + if (ccsIniGetBell (importFile, ccsPluginGetName (plugin), |
1156 | keyName, &value)) |
1157 | ccsSetBell (setting, value, TRUE); |
1158 | } |
1159 | @@ -4073,7 +4073,7 @@ |
1160 | { |
1161 | CCSSettingColorValue value; |
1162 | |
1163 | - if (ccsIniGetColor (importFile, plugin->name, |
1164 | + if (ccsIniGetColor (importFile, ccsPluginGetName (plugin), |
1165 | keyName, &value)) |
1166 | ccsSetColor (setting, value, TRUE); |
1167 | } |
1168 | @@ -4081,7 +4081,7 @@ |
1169 | case TypeMatch: |
1170 | { |
1171 | char *value; |
1172 | - if (ccsIniGetString (importFile, plugin->name, |
1173 | + if (ccsIniGetString (importFile, ccsPluginGetName (plugin), |
1174 | keyName, &value)) |
1175 | { |
1176 | ccsSetMatch (setting, value, TRUE); |
1177 | @@ -4092,7 +4092,7 @@ |
1178 | case TypeList: |
1179 | { |
1180 | CCSSettingValueList value; |
1181 | - if (ccsIniGetList (importFile, plugin->name, |
1182 | + if (ccsIniGetList (importFile, ccsPluginGetName (plugin), |
1183 | keyName, &value, setting)) |
1184 | { |
1185 | ccsSetList (setting, value, TRUE); |
1186 | @@ -4128,6 +4128,110 @@ |
1187 | return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextImportFromFile) (context, fileName, overwriteNonDefault); |
1188 | } |
1189 | |
1190 | +char * |
1191 | +ccsPluginGetName (CCSPlugin *plugin) |
1192 | +{ |
1193 | + PLUGIN_PRIV (plugin); |
1194 | + |
1195 | + return pPrivate->name; |
1196 | +} |
1197 | + |
1198 | +char * ccsPluginGetShortDesc (CCSPlugin *plugin) |
1199 | +{ |
1200 | + PLUGIN_PRIV (plugin); |
1201 | + |
1202 | + return pPrivate->shortDesc; |
1203 | +} |
1204 | + |
1205 | +char * ccsPluginGetLongDesc (CCSPlugin *plugin) |
1206 | +{ |
1207 | + PLUGIN_PRIV (plugin); |
1208 | + |
1209 | + return pPrivate->longDesc; |
1210 | +} |
1211 | + |
1212 | +char * ccsPluginGetHints (CCSPlugin *plugin) |
1213 | +{ |
1214 | + PLUGIN_PRIV (plugin); |
1215 | + |
1216 | + return pPrivate->hints; |
1217 | +} |
1218 | + |
1219 | +char * ccsPluginGetCategory (CCSPlugin *plugin) |
1220 | +{ |
1221 | + PLUGIN_PRIV (plugin); |
1222 | + |
1223 | + return pPrivate->category; |
1224 | +} |
1225 | + |
1226 | +CCSStringList ccsPluginGetLoadAfter (CCSPlugin *plugin) |
1227 | +{ |
1228 | + PLUGIN_PRIV (plugin); |
1229 | + |
1230 | + return pPrivate->loadAfter; |
1231 | +} |
1232 | + |
1233 | +CCSStringList ccsPluginGetLoadBefore (CCSPlugin *plugin) |
1234 | +{ |
1235 | + PLUGIN_PRIV (plugin); |
1236 | + |
1237 | + return pPrivate->loadBefore; |
1238 | +} |
1239 | + |
1240 | +CCSStringList ccsPluginGetRequiresPlugins (CCSPlugin *plugin) |
1241 | +{ |
1242 | + PLUGIN_PRIV (plugin); |
1243 | + |
1244 | + return pPrivate->requiresPlugin; |
1245 | +} |
1246 | + |
1247 | +CCSStringList ccsPluginGetConflictPlugins (CCSPlugin *plugin) |
1248 | +{ |
1249 | + PLUGIN_PRIV (plugin); |
1250 | + |
1251 | + return pPrivate->conflictPlugin; |
1252 | +} |
1253 | + |
1254 | +CCSStringList ccsPluginGetProvidesFeatures (CCSPlugin *plugin) |
1255 | +{ |
1256 | + PLUGIN_PRIV (plugin); |
1257 | + |
1258 | + return pPrivate->providesFeature; |
1259 | +} |
1260 | + |
1261 | +void * ccsPluginGetProvidesFeaturesBindable (CCSPlugin *plugin) |
1262 | +{ |
1263 | + return (void *) ccsPluginGetProvidesFeatures (plugin); |
1264 | +} |
1265 | + |
1266 | +CCSStringList ccsPluginGetRequiresFeatures (CCSPlugin *plugin) |
1267 | +{ |
1268 | + PLUGIN_PRIV (plugin); |
1269 | + |
1270 | + return pPrivate->requiresFeature; |
1271 | +} |
1272 | + |
1273 | +void * ccsPluginGetPrivatePtr (CCSPlugin *plugin) |
1274 | +{ |
1275 | + PLUGIN_PRIV (plugin); |
1276 | + |
1277 | + return pPrivate->privatePtr; |
1278 | +} |
1279 | + |
1280 | +void ccsPluginSetPrivatePtr (CCSPlugin *plugin, void *ptr) |
1281 | +{ |
1282 | + PLUGIN_PRIV (plugin); |
1283 | + |
1284 | + pPrivate->privatePtr = ptr; |
1285 | +} |
1286 | + |
1287 | +CCSContext * ccsPluginGetContext (CCSPlugin *plugin) |
1288 | +{ |
1289 | + PLUGIN_PRIV (plugin); |
1290 | + |
1291 | + return pPrivate->context; |
1292 | +} |
1293 | + |
1294 | CCSSettingList ccsGetPluginSettings (CCSPlugin *plugin) |
1295 | |
1296 | { |
1297 | @@ -4154,7 +4258,7 @@ |
1298 | if (!setting) |
1299 | return FALSE; |
1300 | |
1301 | - CONTEXT_PRIV (setting->parent->context); |
1302 | + CONTEXT_PRIV (ccsPluginGetContext (setting->parent)); |
1303 | |
1304 | if (!cPrivate->backend) |
1305 | return FALSE; |
1306 | @@ -4170,7 +4274,7 @@ |
1307 | if (!setting) |
1308 | return FALSE; |
1309 | |
1310 | - CONTEXT_PRIV (setting->parent->context); |
1311 | + CONTEXT_PRIV (ccsPluginGetContext (setting->parent)); |
1312 | |
1313 | if (!cPrivate->backend) |
1314 | return FALSE; |