110
110
typedef struct _CCSIntDesc CCSIntDesc;
111
111
typedef struct _CCSStrRestriction CCSStrRestriction;
112
112
typedef struct _CCSStrExtension CCSStrExtension;
113
typedef struct _CCSString CCSString;
114
115
CCSLIST_HDR (Plugin, CCSPlugin)
115
116
CCSLIST_HDR (Setting, CCSSetting)
116
CCSLIST_HDR (String, char)
117
CCSLIST_HDR (String, CCSString)
117
118
CCSLIST_HDR (Group, CCSGroup)
118
119
CCSLIST_HDR (SubGroup, CCSSubGroup)
119
120
CCSLIST_HDR (SettingValue, CCSSettingValue)
123
124
CCSLIST_HDR (StrRestriction, CCSStrRestriction)
124
125
CCSLIST_HDR (StrExtension, CCSStrExtension)
131
* References the settings object so it can be kept in a list and
132
* unreferenced later with freeObj (mixed with objects that need
133
* to be freed and need not be freed)
136
* Unreferences the settings object, when the reference count reaches
137
* zero, the object is freed
141
#define CCSREF_HDR(type,dtype) \
142
void ccs##type##Ref (dtype *); \
143
void ccs##type##Unref (dtype *);
145
CCSREF_HDR (Plugin, CCSPlugin)
146
CCSREF_HDR (Setting, CCSSetting)
147
CCSREF_HDR (String, CCSString)
148
CCSREF_HDR (Group, CCSGroup)
149
CCSREF_HDR (SubGroup, CCSSubGroup)
150
CCSREF_HDR (SettingValue, CCSSettingValue)
151
CCSREF_HDR (PluginConflict, CCSPluginConflict)
152
CCSREF_HDR (BackendInfo, CCSBackendInfo)
153
CCSREF_HDR (IntDesc, CCSIntDesc)
154
CCSREF_HDR (StrRestriction, CCSStrRestriction)
155
CCSREF_HDR (StrExtension, CCSStrExtension)
126
157
struct _CCSContext
128
159
CCSPluginList plugins; /* list of plugins settings
146
177
char *longDesc; /* backend's long description */
147
178
Bool integrationSupport; /* does the backend support DE integration? */
148
179
Bool profileSupport; /* does the backend support profiles? */
180
unsigned int refCount; /* reference count */
151
183
struct _CCSPlugin
202
235
char *name; /* sub group name in current locale */
203
236
CCSSettingList settings; /* list of settings in this sub group */
237
unsigned int refCount; /* reference count */
208
242
char *name; /* group name in current locale */
209
243
CCSSubGroupList subGroups; /* list of sub groups in this group */
244
unsigned int refCount; /* reference count */
212
247
typedef enum _CCSPluginConflictType
228
263
caused the conflict */
229
264
CCSPluginConflictType type; /* type of the conflict */
230
265
CCSPluginList plugins; /* list of conflicting plugins */
266
unsigned int refCount; /* reference count */
233
269
union _CCSSettingInfo;
274
unsigned int refCount;
235
277
struct _CCSIntDesc
237
279
int value; /* value the description is assigned to */
238
280
char *name; /* description */
281
unsigned int refCount; /* reference count */
241
284
struct _CCSStrRestriction
243
286
char *value; /* value the restriction is assigned to */
244
287
char *name; /* description */
288
unsigned int refCount; /* reference count */
247
291
struct _CCSStrExtension
249
293
char *basePlugin; /* plugin this extension extends */
250
294
CCSStringList baseSettings; /* list of settings this extension extends */
251
295
CCSStrRestrictionList restriction; /* list of added restriction items */
296
unsigned int refCount; /* reference count */
254
299
typedef struct _CCSSettingIntInfo
385
432
const char *longDesc; /* plugin category long description */
387
434
CCSStringList plugins; /* list of plugins in this category */
435
unsigned int refCount; /* reference count */
390
438
/* set basic metadata to TRUE and no additional
434
482
void ccsFreeIntDesc (CCSIntDesc *value);
435
483
void ccsFreeStrRestriction (CCSStrRestriction *restriction);
436
484
void ccsFreeStrExtension (CCSStrExtension *extension);
438
#define ccsFreeString(val) free(val)
485
void ccsFreeString (CCSString *str);
440
487
/* Setting setters. Set <setting> to value <data>. Return TRUE if new value
441
488
matches data. If the new value doesn't match the old value, the setting
442
489
is added to the context's changedSettings list. */
443
490
Bool ccsSetInt (CCSSetting *setting,
492
Bool processChanged);
445
493
Bool ccsSetFloat (CCSSetting *setting,
495
Bool processChanged);
447
496
Bool ccsSetBool (CCSSetting *setting,
498
Bool processChanged);
449
499
Bool ccsSetString (CCSSetting *setting,
501
Bool processChanged);
451
502
Bool ccsSetColor (CCSSetting *setting,
452
CCSSettingColorValue data);
503
CCSSettingColorValue data,
504
Bool processChanged);
453
505
Bool ccsSetMatch (CCSSetting *setting,
507
Bool processChanged);
455
508
Bool ccsSetKey (CCSSetting *setting,
456
CCSSettingKeyValue data);
509
CCSSettingKeyValue data,
510
Bool processChanged);
457
511
Bool ccsSetButton (CCSSetting *setting,
458
CCSSettingButtonValue data);
512
CCSSettingButtonValue data,
513
Bool processChanged);
459
514
Bool ccsSetEdge (CCSSetting *setting,
516
Bool processChanged);
461
517
Bool ccsSetBell (CCSSetting *setting,
519
Bool processChanged);
463
520
Bool ccsSetList (CCSSetting *setting,
464
CCSSettingValueList data);
521
CCSSettingValueList data,
522
Bool processChanged);
465
523
Bool ccsSetValue (CCSSetting *setting,
466
CCSSettingValue *data);
524
CCSSettingValue *data,
525
Bool processChanged);
468
527
/* Compares two setting values. Returns TRUE if values match,
469
528
FALSE otherwise. */
653
712
/* Reset all settings to defaults. Settings that were non-default
654
713
previously are added to the changedSettings list of the context. */
655
void ccsResetToDefault (CCSSetting * setting);
714
void ccsResetToDefault (CCSSetting * setting, Bool processChanged);
657
716
/* Exports a profile to a file. If skipDefaults is TRUE, only exports
658
717
non-default settings. Returns TRUE on successful export, FALSE otherwise. */
705
766
Bool ccsCreateDirFor (const char *fileName);
768
Bool ccsIniParseString (char *str,
707
770
Bool ccsIniGetString (IniDictionary *dictionary,
708
771
const char *section,
709
772
const char *entry,
775
Bool ccsIniParseInt (const char *str,
711
777
Bool ccsIniGetInt (IniDictionary *dictionary,
712
778
const char *section,
713
779
const char *entry,
782
Bool ccsIniParseFloat (const char *str,
715
784
Bool ccsIniGetFloat (IniDictionary *dictionary,
716
785
const char *section,
717
786
const char *entry,
789
Bool ccsIniParseBool (const char *str,
719
791
Bool ccsIniGetBool (IniDictionary *dictionary,
720
792
const char *section,
721
793
const char *entry,
796
Bool ccsIniParseColor (const char *str,
797
CCSSettingColorValue *value);
723
798
Bool ccsIniGetColor (IniDictionary *dictionary,
724
799
const char *section,
725
800
const char *entry,
726
801
CCSSettingColorValue *value);
803
Bool ccsIniParseKey (const char *str,
804
CCSSettingKeyValue *value);
727
805
Bool ccsIniGetKey (IniDictionary *dictionary,
728
806
const char *section,
729
807
const char *entry,
730
808
CCSSettingKeyValue *value);
810
Bool ccsIniParseButton (const char *str,
811
CCSSettingButtonValue *value);
731
812
Bool ccsIniGetButton (IniDictionary *dictionary,
732
813
const char *section,
733
814
const char *entry,
734
815
CCSSettingButtonValue *value);
817
Bool ccsIniParseEdge (const char *str,
818
unsigned int *value);
735
819
Bool ccsIniGetEdge (IniDictionary *dictionary,
736
820
const char *section,
737
821
const char *entry,
738
822
unsigned int *value);
739
824
Bool ccsIniGetBell (IniDictionary *dictionary,
740
825
const char *section,
741
826
const char *entry,
829
Bool ccsIniParseList (const char *str,
830
CCSSettingValueList *value,
743
832
Bool ccsIniGetList (IniDictionary *dictionary,
744
833
const char *section,
745
834
const char *entry,