Merge lp:~smspillaz/compiz-libcompizconfig/compiz-libcompizconfig.context-funcs-behind-interface into lp:~compiz-team/compiz-libcompizconfig/0.9.8

Proposed by Sam Spilsbury
Status: Superseded
Proposed branch: lp:~smspillaz/compiz-libcompizconfig/compiz-libcompizconfig.context-funcs-behind-interface
Merge into: lp:~compiz-team/compiz-libcompizconfig/0.9.8
Prerequisite: lp:~smspillaz/compiz-libcompizconfig/compiz-libcompizconfig.refactor-context
Diff against target: 843 lines (+329/-84)
4 files modified
include/ccs.h (+58/-7)
src/ccs-private.h (+4/-2)
src/compiz.cpp (+14/-2)
src/main.c (+253/-73)
To merge this branch: bzr merge lp:~smspillaz/compiz-libcompizconfig/compiz-libcompizconfig.context-funcs-behind-interface
Reviewer Review Type Date Requested Status
Compiz Maintainers Pending
Review via email: mp+103995@code.launchpad.net

This proposal has been superseded by a proposal from 2012-04-29.

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-libcompizconfig under test. If you want to test the result of this work, you should probably look at testing

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 converts the context object to use the base object in its implementation and indirects all of the context object's api through an interface.

To post a comment you must log in.

Unmerged revisions

440. By Sam Spilsbury

Use the interface constructs in CCSObject to implement the interface

439. By Sam Spilsbury

Use the finalize func

438. By Sam Spilsbury

Merged refactor-context into context-funcs-behind-interface.

437. By Sam Spilsbury

Merged refactor-context into context-funcs-behind-interface.

436. By Sam Spilsbury

Migrate CCSContext to CCSObject

435. By Sam Spilsbury

Merge

434. By Sam Spilsbury

Merged refactor-context into context-funcs-behind-interface.

433. By Sam Spilsbury

Hide the private stuff behind the interface too

432. By Sam Spilsbury

Hide all of the public CCSContext API behind interface

431. By Sam Spilsbury

Made interfaces bindable

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/ccs.h'
2--- include/ccs.h 2012-04-28 18:57:21 +0000
3+++ include/ccs.h 2012-04-28 18:57:21 +0000
4@@ -169,8 +169,7 @@
5 unsigned int
6 ccsAllocateType ();
7
8-#define GET_INTERFACE_TYPE(Interface) \
9- ccs##Interface##GetType ();
10+#define GET_INTERFACE_TYPE(Interface) ccs##Interface##GetType ()
11
12 #define INTERFACE_TYPE(Interface) \
13 inline unsigned int ccs##Interface##GetType () \
14@@ -182,6 +181,8 @@
15 return type_id; \
16 }
17
18+#define GET_INTERFACE(CType,IType, o) (CType *) ccsObjectGetInterface ((CCSObject *) o, IType)
19+
20 /**
21 * reference counting
22 *
23@@ -232,6 +233,31 @@
24 typedef CCSSettingList (*CCSContextStealChangedSettings) (CCSContext *context);
25 typedef void * (*CCSContextGetPrivatePtr) (CCSContext *context);
26 typedef void (*CCSContextSetPrivatePtr) (CCSContext *context, void *ptr);
27+typedef Bool (*CCSContextLoadPlugin) (CCSContext *context, char *name);
28+typedef CCSPlugin * (*CCSContextFindPlugin) (CCSContext *context, const char *name);
29+typedef Bool (*CCSContextPluginIsActive) (CCSContext *context, char *name);
30+typedef CCSPluginList (*CCSContextGetActivePluginList) (CCSContext *context);
31+typedef CCSStringList (*CCSContextGetSortedPluginStringList) (CCSContext *context);
32+typedef Bool (*CCSContextSetBackend) (CCSContext *context, char *name);
33+typedef char * (*CCSContextGetBackend) (CCSContext *context);
34+typedef void (*CCSContextSetIntegrationEnabled) (CCSContext *context, Bool value);
35+typedef void (*CCSContextSetProfile) (CCSContext *context, char *name);
36+typedef void (*CCSContextSetPluginListAutoSort) (CCSContext *context, Bool value);
37+typedef char * (*CCSContextGetProfile) (CCSContext *context);
38+typedef Bool (*CCSContextGetIntegrationEnabled) (CCSContext *context);
39+typedef Bool (*CCSContextGetPluginListAutoSort) (CCSContext *context);
40+typedef void (*CCSContextProcessEvents) (CCSContext *context, unsigned int flags);
41+typedef void (*CCSContextReadSettings) (CCSContext *context);
42+typedef void (*CCSContextWriteSettings) (CCSContext *context);
43+typedef void (*CCSContextWriteChangedSettings) (CCSContext *context);
44+typedef Bool (*CCSContextExportToFile) (CCSContext *context, const char *fileName, Bool skipDefaults);
45+typedef Bool (*CCSContextImportFromFile) (CCSContext *context, const char *fileName, Bool overwriteNonDefault);
46+typedef CCSPluginConflictList (*CCSContextCanEnablePlugin) (CCSContext *context, CCSPlugin *plugin);
47+typedef CCSPluginConflictList (*CCSContextCanDisablePlugin) (CCSContext *context, CCSPlugin *plugin);
48+typedef CCSStringList (*CCSContextGetExistingProfiles) (CCSContext *context);
49+typedef void (*CCSContextDeleteProfile) (CCSContext *context, char *name);
50+typedef Bool (*CCSContextCheckForSettingsUpgrade) (CCSContext *context);
51+typedef void (*CCSContextLoadPlugins) (CCSContext *context);
52
53 struct _CCSContextInterface
54 {
55@@ -244,8 +270,35 @@
56 CCSContextStealChangedSettings contextStealChangedSettings;
57 CCSContextGetPrivatePtr contextGetPrivatePtr;
58 CCSContextSetPrivatePtr contextSetPrivatePtr;
59+ CCSContextLoadPlugin contextLoadPlugin;
60+ CCSContextFindPlugin contextFindPlugin;
61+ CCSContextPluginIsActive contextPluginIsActive;
62+ CCSContextGetActivePluginList contextGetActivePluginList;
63+ CCSContextGetSortedPluginStringList contextGetSortedPluginStringList;
64+ CCSContextSetBackend contextSetBackend;
65+ CCSContextGetBackend contextGetBackend;
66+ CCSContextSetIntegrationEnabled contextSetIntegrationEnabled;
67+ CCSContextSetProfile contextSetProfile;
68+ CCSContextSetPluginListAutoSort contextSetPluginListAutoSort;
69+ CCSContextGetProfile contextGetProfile;
70+ CCSContextGetIntegrationEnabled contextGetIntegrationEnabled;
71+ CCSContextGetPluginListAutoSort contextGetPluginListAutoSort;
72+ CCSContextProcessEvents contextProcessEvents;
73+ CCSContextReadSettings contextReadSettings;
74+ CCSContextWriteSettings contextWriteSettings;
75+ CCSContextWriteChangedSettings contextWriteChangedSettings;
76+ CCSContextExportToFile contextExportToFile;
77+ CCSContextImportFromFile contextImportFromFile;
78+ CCSContextCanEnablePlugin contextCanEnablePlugin;
79+ CCSContextCanDisablePlugin contextCanDisablePlugin;
80+ CCSContextGetExistingProfiles contextGetExistingProfiles;
81+ CCSContextDeleteProfile contextDeleteProfile;
82+ CCSContextCheckForSettingsUpgrade contextCheckForSettingsUpgrade;
83+ CCSContextLoadPlugins contextLoadPlugins;
84 };
85
86+inline unsigned int ccsCCSContextInterfaceGetType ();
87+
88 /* CCSContext accessor functions */
89 CCSPluginList ccsContextGetPlugins (CCSContext *);
90 CCSPluginCategory * ccsContextGetCategories (CCSContext *);
91@@ -264,10 +317,11 @@
92
93 struct _CCSContext
94 {
95- void *ccsPrivate; /* private pointer for compizconfig
96- internal usage */
97+ CCSObject object;
98 };
99
100+#define CCS_CONTEXT_INTERFACE_TYPE GET_INTERFACE_TYPE(CCSContextInterface)
101+
102 struct _CCSBackendInfo
103 {
104 char *name; /* name of the backend */
105@@ -1008,9 +1062,6 @@
106
107 CCSStrExtensionList ccsGetPluginStrExtensions (CCSPlugin *plugin);
108
109-/* Checks if settings need to be constrained */
110-Bool ccsContextNeedsConstraining (CCSContext *context);
111-
112 #ifdef __cplusplus
113 }
114 #endif
115
116=== modified file 'src/ccs-private.h'
117--- src/ccs-private.h 2012-04-28 18:57:21 +0000
118+++ src/ccs-private.h 2012-04-28 18:57:21 +0000
119@@ -26,7 +26,7 @@
120 #include <ccs-backend.h>
121
122 #define CONTEXT_PRIV(c) \
123- CCSContextPrivate *cPrivate = (CCSContextPrivate *) c->ccsPrivate;
124+ CCSContextPrivate *cPrivate = (CCSContextPrivate *) ccsObjectGetPrivate ((CCSObject *) c);
125 #define PLUGIN_PRIV(p) \
126 CCSPluginPrivate *pPrivate = (CCSPluginPrivate *) p->ccsPrivate;
127
128@@ -51,7 +51,6 @@
129
130 unsigned int screenNum; /* screen number this context is assigned to */
131 const CCSInterfaceTable *object_interfaces;
132- const CCSContextInterface *interface;
133 } CCSContextPrivate;
134
135 typedef struct _CCSPluginPrivate
136@@ -89,6 +88,9 @@
137 void ccsLoadPluginSettings (CCSPlugin * plugin);
138 void collateGroups (CCSPluginPrivate * p);
139
140+Bool ccsLoadPluginDefault (CCSContext *context, char *name);
141+void ccsLoadPluginsDefault (CCSContext *context);
142+
143 void ccsCheckFileWatches (void);
144
145 typedef enum {
146
147=== modified file 'src/compiz.cpp'
148--- src/compiz.cpp 2012-04-28 18:57:21 +0000
149+++ src/compiz.cpp 2012-04-28 18:57:21 +0000
150@@ -2991,7 +2991,7 @@
151 #endif
152
153 Bool
154-ccsLoadPlugin (CCSContext * context, char *name)
155+ccsLoadPluginDefault (CCSContext * context, char *name)
156 {
157 #ifdef USE_PROTOBUF
158 initPBLoading ();
159@@ -3021,8 +3021,14 @@
160 return (ccsFindPlugin (context, name) != NULL);
161 }
162
163+Bool
164+ccsLoadPlugin (CCSContext *context, char *name)
165+{
166+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextLoadPlugin) (context, name);
167+}
168+
169 void
170-ccsLoadPlugins (CCSContext * context)
171+ccsLoadPluginsDefault (CCSContext * context)
172 {
173 D (D_FULL, "Adding plugins\n");
174
175@@ -3056,6 +3062,12 @@
176 loadPluginsFromName (context, (char *)PLUGINDIR);
177 }
178
179+void
180+ccsLoadPlugins (CCSContext *context)
181+{
182+ (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextLoadPlugins) (context);
183+}
184+
185 static void
186 loadOptionsStringExtensionsFromXML (CCSPlugin * plugin,
187 void * pluginPBv,
188
189=== modified file 'src/main.c'
190--- src/main.c 2012-04-28 18:57:21 +0000
191+++ src/main.c 2012-04-28 18:57:21 +0000
192@@ -167,6 +167,8 @@
193 return start;
194 }
195
196+INTERFACE_TYPE (CCSContextInterface)
197+
198 Bool basicMetadata = FALSE;
199
200 void
201@@ -231,19 +233,22 @@
202 if (!context)
203 return NULL;
204
205- context->ccsPrivate = calloc (1, sizeof (CCSContextPrivate));
206- if (!context->ccsPrivate)
207+ CCSContextPrivate *ccsPrivate = calloc (1, sizeof (CCSContextPrivate));
208+ if (!ccsPrivate)
209 {
210 free (context);
211 return NULL;
212 }
213
214+ ccsObjectSetPrivate ((CCSObject *) context, (CCSPrivate *) ccsPrivate);
215+
216 CONTEXT_PRIV (context);
217
218 cPrivate->object_interfaces = object_interfaces;
219- cPrivate->interface = object_interfaces->contextInterface;
220 cPrivate->screenNum = screenNum;
221
222+ ccsObjectAddInterface ((CCSObject *) context, (CCSInterface *) object_interfaces->contextInterface, CCS_CONTEXT_INTERFACE_TYPE);
223+
224 initGeneralOptions (context);
225 cPrivate->configWatchId = ccsAddConfigWatch (context, configChangeNotify);
226
227@@ -336,89 +341,58 @@
228 return l;
229 }
230
231-static const CCSContextInterface ccsDefaultContextInterface =
232-{
233- ccsContextGetPluginsDefault,
234- ccsContextGetCategoriesDefault,
235- ccsContextGetChangedSettingsDefault,
236- ccsContextGetScreenNumDefault,
237- ccsContextAddChangedSettingDefault,
238- ccsContextClearChangedSettingsDefault,
239- ccsContextStealChangedSettingsDefault,
240- ccsContextGetPrivatePtrDefault,
241- ccsContextSetPrivatePtrDefault
242-};
243-
244 CCSPluginList
245 ccsContextGetPlugins (CCSContext *context)
246 {
247- CONTEXT_PRIV (context);
248-
249- return (*cPrivate->interface->contextGetPlugins) (context);
250+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextGetPlugins) (context);
251 }
252
253 CCSPluginCategory *
254 ccsContextGetCategories (CCSContext *context)
255 {
256- CONTEXT_PRIV (context);
257-
258- return (*cPrivate->interface->contextGetCategories) (context);
259+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextGetCategories) (context);
260 }
261
262 CCSSettingList
263 ccsContextGetChangedSettings (CCSContext *context)
264 {
265- CONTEXT_PRIV (context);
266-
267- return (*cPrivate->interface->contextGetChangedSettings) (context);
268+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextGetChangedSettings) (context);
269 }
270
271 unsigned int
272 ccsContextGetScreenNum (CCSContext *context)
273 {
274- CONTEXT_PRIV (context);
275-
276- return (*cPrivate->interface->contextGetScreenNum) (context);
277+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextGetScreenNum) (context);
278 }
279
280 Bool
281 ccsContextAddChangedSetting (CCSContext *context, CCSSetting *setting)
282 {
283- CONTEXT_PRIV (context);
284-
285- return (*cPrivate->interface->contextAddChangedSetting) (context, setting);
286+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextAddChangedSetting) (context, setting);
287 }
288
289 Bool
290 ccsContextClearChangedSettings (CCSContext *context)
291 {
292- CONTEXT_PRIV (context);
293-
294- return (*cPrivate->interface->contextClearChangedSettings) (context);
295+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextClearChangedSettings) (context);
296 }
297
298 CCSSettingList
299 ccsContextStealChangedSettings (CCSContext *context)
300 {
301- CONTEXT_PRIV (context);
302-
303- return (*cPrivate->interface->contextStealChangedSettings) (context);
304+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextStealChangedSettings) (context);
305 }
306
307 void *
308 ccsContextGetPrivatePtr (CCSContext *context)
309 {
310- CONTEXT_PRIV (context);
311-
312- return (*cPrivate->interface->contextGetPrivatePtr) (context);
313+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextGetPrivatePtr) (context);
314 }
315
316 void
317 ccsContextSetPrivatePtr (CCSContext *context, void *ptr)
318 {
319- CONTEXT_PRIV (context);
320-
321- return (*cPrivate->interface->contextSetPrivatePtr) (context, ptr);
322+ (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextSetPrivatePtr) (context, ptr);
323 }
324
325 void *
326@@ -512,7 +486,7 @@
327 }
328
329 CCSPlugin *
330-ccsFindPlugin (CCSContext * context, const char *name)
331+ccsFindPluginDefault (CCSContext * context, const char *name)
332 {
333 if (!name)
334 name = "";
335@@ -531,6 +505,12 @@
336 return NULL;
337 }
338
339+CCSPlugin *
340+ccsFindPlugin (CCSContext *context, const char *name)
341+{
342+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextFindPlugin) (context, name);
343+}
344+
345 CCSSetting *
346 ccsFindSetting (CCSPlugin * plugin, const char *name)
347 {
348@@ -559,7 +539,7 @@
349 }
350
351 Bool
352-ccsPluginIsActive (CCSContext * context, char *name)
353+ccsPluginIsActiveDefault (CCSContext * context, char *name)
354 {
355 CCSPlugin *plugin;
356
357@@ -572,6 +552,12 @@
358 return pPrivate->active;
359 }
360
361+Bool
362+ccsPluginIsActive (CCSContext *context, char *name)
363+{
364+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextPluginIsActive) (context, name);
365+}
366+
367
368 static void
369 subGroupAdd (CCSSetting * setting, CCSGroup * group)
370@@ -659,9 +645,7 @@
371
372 ccsPluginListFree (cPrivate->plugins, TRUE);
373
374- if (c->ccsPrivate)
375- free (c->ccsPrivate);
376-
377+ ccsObjectFinalize ((CCSObject *) c);
378 free (c);
379 }
380
381@@ -960,7 +944,7 @@
382 }
383
384 Bool
385-ccsSetBackend (CCSContext * context, char *name)
386+ccsSetBackendDefault (CCSContext * context, char *name)
387 {
388 Bool fallbackMode = FALSE;
389 CONTEXT_PRIV (context);
390@@ -1025,6 +1009,11 @@
391 return TRUE;
392 }
393
394+Bool
395+ccsSetBackend (CCSContext *context, char *name)
396+{
397+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextSetBackend) (context, name);
398+}
399
400 static Bool
401 ccsCompareLists (CCSSettingValueList l1, CCSSettingValueList l2,
402@@ -1983,7 +1972,7 @@
403 }
404
405 CCSPluginList
406-ccsGetActivePluginList (CCSContext * context)
407+ccsGetActivePluginListDefault (CCSContext * context)
408 {
409 CONTEXT_PRIV (context);
410
411@@ -2004,6 +1993,12 @@
412 return rv;
413 }
414
415+CCSPluginList
416+ccsGetActivePluginList (CCSContext *context)
417+{
418+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextGetActivePluginList) (context);
419+}
420+
421 static CCSPlugin *
422 findPluginInList (CCSPluginList list, char *name)
423 {
424@@ -2028,7 +2023,7 @@
425 } PluginSortHelper;
426
427 CCSStringList
428-ccsGetSortedPluginStringList (CCSContext * context)
429+ccsGetSortedPluginStringListDefault (CCSContext * context)
430 {
431 CCSPluginList ap = ccsGetActivePluginList (context);
432 CCSPluginList list;
433@@ -2188,8 +2183,14 @@
434 return rv;
435 }
436
437+CCSStringList
438+ccsGetSortedPluginStringList (CCSContext *context)
439+{
440+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextGetSortedPluginStringList) (context);
441+}
442+
443 char *
444-ccsGetBackend (CCSContext * context)
445+ccsGetBackendDefault (CCSContext * context)
446 {
447 if (!context)
448 return NULL;
449@@ -2202,8 +2203,14 @@
450 return cPrivate->backend->vTable->name;
451 }
452
453+char *
454+ccsGetBackend (CCSContext *context)
455+{
456+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextGetBackend) (context);
457+}
458+
459 Bool
460-ccsGetIntegrationEnabled (CCSContext * context)
461+ccsGetIntegrationEnabledDefault (CCSContext * context)
462 {
463 if (!context)
464 return FALSE;
465@@ -2213,8 +2220,17 @@
466 return cPrivate->deIntegration;
467 }
468
469+Bool
470+ccsGetIntegrationEnabled (CCSContext *context)
471+{
472+ if (!context)
473+ return FALSE;
474+
475+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextGetIntegrationEnabled) (context);
476+}
477+
478 char *
479-ccsGetProfile (CCSContext * context)
480+ccsGetProfileDefault (CCSContext * context)
481 {
482 if (!context)
483 return NULL;
484@@ -2224,8 +2240,17 @@
485 return cPrivate->profile;
486 }
487
488+char *
489+ccsGetProfile (CCSContext *context)
490+{
491+ if (!context)
492+ return NULL;
493+
494+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextGetProfile) (context);
495+}
496+
497 Bool
498-ccsGetPluginListAutoSort (CCSContext * context)
499+ccsGetPluginListAutoSortDefault (CCSContext * context)
500 {
501 if (!context)
502 return FALSE;
503@@ -2235,8 +2260,17 @@
504 return cPrivate->pluginListAutoSort;
505 }
506
507+Bool
508+ccsGetPluginListAutoSort (CCSContext *context)
509+{
510+ if (!context)
511+ return FALSE;
512+
513+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextGetPluginListAutoSort) (context);
514+}
515+
516 void
517-ccsSetIntegrationEnabled (CCSContext * context, Bool value)
518+ccsSetIntegrationEnabledDefault (CCSContext * context, Bool value)
519 {
520 CONTEXT_PRIV (context);
521
522@@ -2252,6 +2286,12 @@
523 ccsEnableFileWatch (cPrivate->configWatchId);
524 }
525
526+void
527+ccsSetIntegrationEnabled (CCSContext *context, Bool value)
528+{
529+ (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextSetIntegrationEnabled) (context, value);
530+}
531+
532 static void
533 ccsWriteAutoSortedPluginList (CCSContext *context)
534 {
535@@ -2279,7 +2319,7 @@
536 }
537
538 void
539-ccsSetPluginListAutoSort (CCSContext * context, Bool value)
540+ccsSetPluginListAutoSortDefault (CCSContext * context, Bool value)
541 {
542 CONTEXT_PRIV (context);
543
544@@ -2299,7 +2339,13 @@
545 }
546
547 void
548-ccsSetProfile (CCSContext * context, char *name)
549+ccsSetPluginListAutoSort (CCSContext *context, Bool value)
550+{
551+ (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextSetPluginListAutoSort) (context, value);
552+}
553+
554+void
555+ccsSetProfileDefault (CCSContext * context, char *name)
556 {
557 if (!name)
558 name = "";
559@@ -2321,7 +2367,13 @@
560 }
561
562 void
563-ccsProcessEvents (CCSContext * context, unsigned int flags)
564+ccsSetProfile (CCSContext *context, char *name)
565+{
566+ (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextSetProfile) (context, name);
567+}
568+
569+void
570+ccsProcessEventsDefault (CCSContext * context, unsigned int flags)
571 {
572 if (!context)
573 return;
574@@ -2335,7 +2387,16 @@
575 }
576
577 void
578-ccsReadSettings (CCSContext * context)
579+ccsProcessEvents (CCSContext *context, unsigned int flags)
580+{
581+ if (!context)
582+ return;
583+
584+ (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextProcessEvents) (context, flags);
585+}
586+
587+void
588+ccsReadSettingsDefault (CCSContext * context)
589 {
590 if (!context)
591 return;
592@@ -2372,6 +2433,15 @@
593 }
594
595 void
596+ccsReadSettings (CCSContext *context)
597+{
598+ if (!context)
599+ return;
600+
601+ (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextReadSettings) (context);
602+}
603+
604+void
605 ccsReadPluginSettings (CCSPlugin * plugin)
606 {
607 if (!plugin || !plugin->context)
608@@ -2403,7 +2473,7 @@
609 }
610
611 void
612-ccsWriteSettings (CCSContext * context)
613+ccsWriteSettingsDefault (CCSContext * context)
614 {
615 if (!context)
616 return;
617@@ -2443,7 +2513,16 @@
618 }
619
620 void
621-ccsWriteChangedSettings (CCSContext * context)
622+ccsWriteSettings (CCSContext *context)
623+{
624+ if (!context)
625+ return;
626+
627+ (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextWriteSettings) (context);
628+}
629+
630+void
631+ccsWriteChangedSettingsDefault (CCSContext * context)
632 {
633 if (!context)
634 return;
635@@ -2478,6 +2557,15 @@
636 ccsSettingListFree (cPrivate->changedSettings, FALSE);
637 }
638
639+void
640+ccsWriteChangedSettings (CCSContext *context)
641+{
642+ if (!context)
643+ return;
644+
645+ (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextWriteChangedSettings) (context);
646+}
647+
648 Bool
649 ccsIsEqualColor (CCSSettingColorValue c1, CCSSettingColorValue c2)
650 {
651@@ -2530,7 +2618,7 @@
652 }
653
654 CCSPluginConflictList
655-ccsCanEnablePlugin (CCSContext * context, CCSPlugin * plugin)
656+ccsCanEnablePluginDefault (CCSContext * context, CCSPlugin * plugin)
657 {
658 CCSPluginConflictList list = NULL;
659 CCSPluginList pl, pl2;
660@@ -2748,7 +2836,13 @@
661 }
662
663 CCSPluginConflictList
664-ccsCanDisablePlugin (CCSContext * context, CCSPlugin * plugin)
665+ccsCanEnablePlugin (CCSContext *context, CCSPlugin *plugin)
666+{
667+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextCanEnablePlugin) (context, plugin);
668+}
669+
670+CCSPluginConflictList
671+ccsCanDisablePluginDefault (CCSContext * context, CCSPlugin * plugin)
672 {
673 CCSPluginConflictList list = NULL;
674 CCSPluginConflict *conflict = NULL;
675@@ -2851,8 +2945,14 @@
676 return list;
677 }
678
679+CCSPluginConflictList
680+ccsCanDisablePlugin (CCSContext *context, CCSPlugin *plugin)
681+{
682+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextCanDisablePlugin) (context, plugin);
683+}
684+
685 CCSStringList
686-ccsGetExistingProfiles (CCSContext * context)
687+ccsGetExistingProfilesDefault (CCSContext * context)
688 {
689 if (!context)
690 return NULL;
691@@ -2868,8 +2968,17 @@
692 return NULL;
693 }
694
695+CCSStringList
696+ccsGetExistingProfiles (CCSContext *context)
697+{
698+ if (!context)
699+ return NULL;
700+
701+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextGetExistingProfiles) (context);
702+}
703+
704 void
705-ccsDeleteProfile (CCSContext * context, char *name)
706+ccsDeleteProfileDefault (CCSContext * context, char *name)
707 {
708 if (!context)
709 return;
710@@ -2892,6 +3001,15 @@
711 (*cPrivate->backend->vTable->deleteProfile) (context, name);
712 }
713
714+void
715+ccsDeleteProfile (CCSContext *context, char *name)
716+{
717+ if (!context)
718+ return;
719+
720+ (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextDeleteProfile) (context, name);
721+}
722+
723 static void
724 addBackendInfo (CCSBackendInfoList * bl, char *file)
725 {
726@@ -3020,9 +3138,9 @@
727 }
728
729 Bool
730-ccsExportToFile (CCSContext *context,
731- const char *fileName,
732- Bool skipDefaults)
733+ccsExportToFileDefault (CCSContext *context,
734+ const char *fileName,
735+ Bool skipDefaults)
736 {
737 IniDictionary *exportFile;
738 CCSPluginList p;
739@@ -3115,6 +3233,15 @@
740 return TRUE;
741 }
742
743+Bool
744+ccsExportToFile (CCSContext *context, const char *fileName, Bool skipDefaults)
745+{
746+ if (!context)
747+ return FALSE;
748+
749+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextExportToFile) (context, fileName, skipDefaults);
750+}
751+
752 /* + with a value will attempt to append or overwrite that value if there is no -
753 * - with a value will attempt to clear any value set to that to the default
754 * if there is no +
755@@ -3742,7 +3869,7 @@
756 }
757
758 Bool
759-ccsCheckForSettingsUpgrade (CCSContext *context)
760+ccsCheckForSettingsUpgradeDefault (CCSContext *context)
761 {
762 struct dirent **nameList;
763 int nFile, i;
764@@ -3822,9 +3949,9 @@
765 }
766
767 Bool
768-ccsImportFromFile (CCSContext *context,
769- const char *fileName,
770- Bool overwriteNonDefault)
771+ccsImportFromFileDefault (CCSContext *context,
772+ const char *fileName,
773+ Bool overwriteNonDefault)
774 {
775 IniDictionary *importFile;
776 CCSPluginList p;
777@@ -3986,6 +4113,21 @@
778 return TRUE;
779 }
780
781+Bool
782+ccsCheckForSettingsUpgrade (CCSContext *context)
783+{
784+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextCheckForSettingsUpgrade) (context);
785+}
786+
787+Bool
788+ccsImportFromFile (CCSContext *context, const char *fileName, Bool overwriteNonDefault)
789+{
790+ if (!context)
791+ return FALSE;
792+
793+ return (*(GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE, context))->contextImportFromFile) (context, fileName, overwriteNonDefault);
794+}
795+
796 CCSSettingList ccsGetPluginSettings (CCSPlugin *plugin)
797
798 {
799@@ -4049,6 +4191,44 @@
800 return pPrivate->stringExtensions;
801 }
802
803+static const CCSContextInterface ccsDefaultContextInterface =
804+{
805+ ccsContextGetPluginsDefault,
806+ ccsContextGetCategoriesDefault,
807+ ccsContextGetChangedSettingsDefault,
808+ ccsContextGetScreenNumDefault,
809+ ccsContextAddChangedSettingDefault,
810+ ccsContextClearChangedSettingsDefault,
811+ ccsContextStealChangedSettingsDefault,
812+ ccsContextGetPrivatePtrDefault,
813+ ccsContextSetPrivatePtrDefault,
814+ ccsLoadPluginDefault,
815+ ccsFindPluginDefault,
816+ ccsPluginIsActiveDefault,
817+ ccsGetActivePluginListDefault,
818+ ccsGetSortedPluginStringListDefault,
819+ ccsSetBackendDefault,
820+ ccsGetBackendDefault,
821+ ccsSetIntegrationEnabledDefault,
822+ ccsSetProfileDefault,
823+ ccsSetPluginListAutoSortDefault,
824+ ccsGetProfileDefault,
825+ ccsGetIntegrationEnabledDefault,
826+ ccsGetPluginListAutoSortDefault,
827+ ccsProcessEventsDefault,
828+ ccsReadSettingsDefault,
829+ ccsWriteSettingsDefault,
830+ ccsWriteChangedSettingsDefault,
831+ ccsExportToFileDefault,
832+ ccsImportFromFileDefault,
833+ ccsCanEnablePluginDefault,
834+ ccsCanDisablePluginDefault,
835+ ccsGetExistingProfilesDefault,
836+ ccsDeleteProfileDefault,
837+ ccsCheckForSettingsUpgradeDefault,
838+ ccsLoadPluginsDefault
839+};
840+
841 const CCSInterfaceTable ccsDefaultInterfaceTable =
842 {
843 &ccsDefaultContextInterface

Subscribers

People subscribed via source and target branches