This file is indexed.

/usr/include/compizconfig/ccs.h is in libcompizconfig0-dev 1:0.9.13.1+18.04.20180302-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
/*
 * Compiz configuration system library
 *
 * Copyright (C) 2007  Dennis Kasprzyk <onestone@beryl-project.org>
 * Copyright (C) 2007  Danny Baumann <maniac@beryl-project.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef _CSS_H
#define _CSS_H

#include <stddef.h>  /* for NULL */
#include <ccs-defs.h>
#include <ccs-object.h>
#include <ccs-list.h>
#include <ccs-string.h>
#include <ccs-backend.h>
#include <ccs-setting-types.h>

COMPIZCONFIG_BEGIN_DECLS

#ifndef CCS_LOG_DOMAIN
#define CCS_LOG_DOMAIN NULL
#endif

#ifdef __GNUC__
#define ccsDebug(fmt, args...) \
        ccsLog (CCS_LOG_DOMAIN, ccsLogDebug, fmt, ##args)
#define ccsInfo(fmt, args...) \
        ccsLog (CCS_LOG_DOMAIN, ccsLogInfo, fmt, ##args)
#define ccsWarning(fmt, args...) \
        ccsLog (CCS_LOG_DOMAIN, ccsLogWarning, fmt, ##args)
#define ccsError(fmt, args...) \
        ccsLog (CCS_LOG_DOMAIN, ccsLogError, fmt, ##args)
#elif __STDC_VERSION__ >= 199901L
#define ccsDebug(fmt, ...) \
        ccsLog (CCS_LOG_DOMAIN, ccsLogDebug, fmt, __VA_ARGS__)
#define ccsInfo(fmt, ...) \
        ccsLog (CCS_LOG_DOMAIN, ccsLogInfo, fmt, __VA_ARGS__)
#define ccsWarning(fmt, ...) \
        ccsLog (CCS_LOG_DOMAIN, ccsLogWarning, fmt, __VA_ARGS__)
#define ccsError(fmt, ...) \
        ccsLog (CCS_LOG_DOMAIN, ccsLogError, fmt, __VA_ARGS__)
#endif

typedef enum
{
    ccsLogDebug,
    ccsLogInfo,
    ccsLogWarning,
    ccsLogError,
    _ccsLogLevels
} CCSLogLevel;

#define CCSLOGLEVEL_NAMES {"Debug", "Info", "Warning", "Error"}

void ccsLog (const char *domain, CCSLogLevel level, const char *fmt, ...);

typedef struct _CCSGroup	  CCSGroup;
typedef struct _CCSSubGroup	  CCSSubGroup;
typedef struct _CCSPluginCategory CCSPluginCategory;
typedef struct _CCSPluginConflict CCSPluginConflict;
typedef struct _CCSIntDesc	  CCSIntDesc;
typedef struct _CCSStrRestriction CCSStrRestriction;
typedef struct _CCSStrExtension   CCSStrExtension;

CCSLIST_HDR (Plugin, CCSPlugin)
CCSLIST_HDR (Setting, CCSSetting)
CCSLIST_HDR (Group, CCSGroup)
CCSLIST_HDR (SubGroup, CCSSubGroup)
CCSLIST_HDR (SettingValue, CCSSettingValue)
CCSLIST_HDR (PluginConflict, CCSPluginConflict)
CCSLIST_HDR (BackendInfo, CCSBackendInfo)
CCSLIST_HDR (IntDesc, CCSIntDesc)
CCSLIST_HDR (StrRestriction, CCSStrRestriction)
CCSLIST_HDR (StrExtension, CCSStrExtension)

CCSREF_HDR (Plugin, CCSPlugin)
CCSREF_HDR (Setting, CCSSetting)
CCSREF_HDR (String, CCSString)
CCSREF_HDR (Backend, CCSBackend)
CCSREF_HDR (DynamicBackend, CCSDynamicBackend)
CCSREF_HDR (Group, CCSGroup)
CCSREF_HDR (SubGroup, CCSSubGroup)
CCSREF_HDR (SettingValue, CCSSettingValue)
CCSREF_HDR (PluginConflict, CCSPluginConflict)
CCSREF_HDR (BackendInfo, CCSBackendInfo)
CCSREF_HDR (IntDesc, CCSIntDesc)
CCSREF_HDR (StrRestriction, CCSStrRestriction)
CCSREF_HDR (StrExtension, CCSStrExtension)

typedef struct _CCSContextInterface CCSContextInterface;
typedef struct _CCSPluginInterface CCSPluginInterface;
typedef struct _CCSSettingInterface CCSSettingInterface;

struct _CCSInterfaceTable
{
    const CCSContextInterface *contextInterface;
    const CCSPluginInterface *pluginInterface;
    const CCSSettingInterface *settingInterface;
    const CCSBackendInterface *dynamicBackendWrapperInterface;
    const CCSDynamicBackendInterface *dynamicBackendInterface;
};

extern const CCSInterfaceTable ccsDefaultInterfaceTable;

/* CCSContext interface */
typedef CCSPluginList (*CCSContextGetPluginsProc) (CCSContext *context);
typedef CCSPluginCategory * (*CCSContextGetCategories) (CCSContext *context);
typedef CCSSettingList (*CCSContextGetChangedSettings) (CCSContext *context);
typedef unsigned int (*CCSContextGetScreenNum) (CCSContext *context);
typedef Bool (*CCSContextAddChangedSetting) (CCSContext *context, CCSSetting *setting);
typedef Bool (*CCSContextClearChangedSettings) (CCSContext *context);
typedef CCSSettingList (*CCSContextStealChangedSettings) (CCSContext *context);
typedef void * (*CCSContextGetPrivatePtr) (CCSContext *context);
typedef void (*CCSContextSetPrivatePtr) (CCSContext *context, void *ptr);
typedef Bool (*CCSContextLoadPlugin) (CCSContext *context, char *name);
typedef CCSPlugin * (*CCSContextFindPlugin) (CCSContext *context, const char *name);
typedef Bool (*CCSContextPluginIsActive) (CCSContext *context, const char *name);
typedef CCSPluginList (*CCSContextGetActivePluginList) (CCSContext *context);
typedef CCSStringList (*CCSContextGetSortedPluginStringList) (CCSContext *context);
typedef Bool (*CCSContextSetBackend) (CCSContext *context, char *name);
typedef const char * (*CCSContextGetBackend) (CCSContext *context);
typedef void (*CCSContextSetIntegrationEnabled) (CCSContext *context, Bool value);
typedef void (*CCSContextSetProfile) (CCSContext *context, const char *name);
typedef void (*CCSContextSetPluginListAutoSort) (CCSContext *context, Bool value);
typedef const char * (*CCSContextGetProfile) (CCSContext *context);
typedef Bool (*CCSContextGetIntegrationEnabled) (CCSContext *context);
typedef Bool (*CCSContextGetPluginListAutoSort) (CCSContext *context);
typedef void (*CCSContextProcessEvents) (CCSContext *context, unsigned int flags);
typedef void (*CCSContextReadSettings) (CCSContext *context);
typedef void (*CCSContextWriteSettings) (CCSContext *context);
typedef void (*CCSContextWriteChangedSettings) (CCSContext *context);
typedef Bool (*CCSContextExportToFile) (CCSContext *context, const char *fileName, Bool skipDefaults);
typedef Bool (*CCSContextImportFromFile) (CCSContext *context, const char *fileName, Bool overwriteNonDefault);
typedef CCSPluginConflictList (*CCSContextCanEnablePlugin) (CCSContext *context, CCSPlugin *plugin);
typedef CCSPluginConflictList (*CCSContextCanDisablePlugin) (CCSContext *context, CCSPlugin *plugin);
typedef CCSStringList (*CCSContextGetExistingProfiles) (CCSContext *context);
typedef void (*CCSContextDeleteProfile) (CCSContext *context, char *name);
typedef Bool (*CCSContextCheckForSettingsUpgrade) (CCSContext *context);
typedef void (*CCSContextLoadPlugins) (CCSContext *context);
typedef void (*CCSContextDestructor) (CCSContext *context);

struct _CCSContextInterface
{
    CCSContextGetPluginsProc contextGetPlugins;
    CCSContextGetCategories contextGetCategories;
    CCSContextGetChangedSettings contextGetChangedSettings;
    CCSContextGetScreenNum contextGetScreenNum;
    CCSContextAddChangedSetting contextAddChangedSetting;
    CCSContextClearChangedSettings contextClearChangedSettings;
    CCSContextStealChangedSettings contextStealChangedSettings;
    CCSContextGetPrivatePtr contextGetPrivatePtr;
    CCSContextSetPrivatePtr contextSetPrivatePtr;
    CCSContextLoadPlugin contextLoadPlugin;
    CCSContextFindPlugin contextFindPlugin;
    CCSContextPluginIsActive contextPluginIsActive;
    CCSContextGetActivePluginList contextGetActivePluginList;
    CCSContextGetSortedPluginStringList contextGetSortedPluginStringList;
    CCSContextSetBackend contextSetBackend;
    CCSContextGetBackend contextGetBackend;
    CCSContextSetIntegrationEnabled contextSetIntegrationEnabled;
    CCSContextSetProfile contextSetProfile;
    CCSContextSetPluginListAutoSort contextSetPluginListAutoSort;
    CCSContextGetProfile contextGetProfile;
    CCSContextGetIntegrationEnabled contextGetIntegrationEnabled;
    CCSContextGetPluginListAutoSort contextGetPluginListAutoSort;
    CCSContextProcessEvents contextProcessEvents;
    CCSContextReadSettings contextReadSettings;
    CCSContextWriteSettings contextWriteSettings;
    CCSContextWriteChangedSettings contextWriteChangedSettings;
    CCSContextExportToFile contextExportToFile;
    CCSContextImportFromFile contextImportFromFile;
    CCSContextCanEnablePlugin contextCanEnablePlugin;
    CCSContextCanDisablePlugin contextCanDisablePlugin;
    CCSContextGetExistingProfiles contextGetExistingProfiles;
    CCSContextDeleteProfile contextDeleteProfile;
    CCSContextCheckForSettingsUpgrade contextCheckForSettingsUpgrade;
    CCSContextLoadPlugins contextLoadPlugins;
    CCSContextDestructor contextDestructor;
};

unsigned int ccsCCSContextInterfaceGetType ();

/* CCSContext accessor functions */
CCSPluginList ccsContextGetPlugins (CCSContext *);
CCSPluginCategory * ccsContextGetCategories (CCSContext *);
CCSSettingList ccsContextGetChangedSettings (CCSContext *);
unsigned int ccsContextGetScreenNum (CCSContext *);
Bool ccsContextAddChangedSetting (CCSContext *context, CCSSetting *setting);
Bool ccsContextClearChangedSettings (CCSContext *context);
CCSSettingList ccsContextStealChangedSettings (CCSContext *context);
void * ccsContextGetPrivatePtr (CCSContext *context);
void ccsContextSetPrivatePtr (CCSContext *context, void *ptr);

/* only for bindings */
void * ccsContextGetPluginsBindable (CCSContext *context);
void * ccsContextStealChangedSettingsBindable (CCSContext *context);
void * ccsContextGetChangedSettingsBindable (CCSContext *context);

struct _CCSContext
{
    CCSObject object;
};

/* CCSPluginInterface */
typedef const char * (*CCSPluginGetName) (CCSPlugin *plugin);
typedef const char * (*CCSPluginGetShortDesc) (CCSPlugin *plugin);
typedef const char * (*CCSPluginGetLongDesc) (CCSPlugin *plugin);
typedef const char * (*CCSPluginGetHints) (CCSPlugin *plugin);
typedef const char * (*CCSPluginGetCategory) (CCSPlugin *plugin);

typedef CCSStringList (*CCSPluginGetLoadAfter) (CCSPlugin *plugin);
typedef CCSStringList (*CCSPluginGetLoadBefore) (CCSPlugin *plugin);
typedef CCSStringList (*CCSPluginGetRequiresPlugins) (CCSPlugin *plugin);
typedef CCSStringList (*CCSPluginGetConflictPlugins) (CCSPlugin *plugin);
typedef CCSStringList (*CCSPluginGetProvidesFeatures) (CCSPlugin *plugin);
typedef CCSStringList (*CCSPluginGetRequiresFeatures) (CCSPlugin *plugin);

typedef void * (*CCSPluginGetPrivatePtr) (CCSPlugin *plugin);
typedef void (*CCSPluginSetPrivatePtr) (CCSPlugin *plugin, void *);

typedef CCSContext * (*CCSPluginGetContext) (CCSPlugin *plugin);

typedef CCSSetting * (*CCSPluginFindSetting) (CCSPlugin *plugin, const char *name);
typedef CCSSettingList (*CCSPluginGetPluginSettings) (CCSPlugin *plugin);
typedef CCSGroupList (*CCSPluginGetPluginGroups) (CCSPlugin *plugin);
typedef void (*CCSPluginReadPluginSettings) (CCSPlugin *plugin);
typedef CCSStrExtensionList (*CCSPluginGetPluginStrExtensions) (CCSPlugin *plugin);

typedef void (*CCSPluginDestructor) (CCSPlugin *plugin);

unsigned int ccsCCSPluginInterfaceGetType ();

struct _CCSPluginInterface
{
    CCSPluginGetName pluginGetName;
    CCSPluginGetShortDesc pluginGetShortDesc;
    CCSPluginGetLongDesc pluginGetLongDesc;
    CCSPluginGetHints pluginGetHints;
    CCSPluginGetCategory pluginGetCategory;
    CCSPluginGetLoadAfter pluginGetLoadAfter;
    CCSPluginGetLoadBefore pluginGetLoadBefore;
    CCSPluginGetRequiresPlugins pluginGetRequiresPlugins;
    CCSPluginGetConflictPlugins pluginGetConflictPlugins;
    CCSPluginGetProvidesFeatures pluginGetProvidesFeatures;
    CCSPluginGetRequiresFeatures pluginGetRequiresFeatures;
    CCSPluginGetPrivatePtr pluginGetPrivatePtr;
    CCSPluginSetPrivatePtr pluginSetPrivatePtr;
    CCSPluginGetContext pluginGetContext;
    CCSPluginFindSetting pluginFindSetting;
    CCSPluginGetPluginSettings pluginGetPluginSettings;
    CCSPluginGetPluginGroups pluginGetPluginGroups;
    CCSPluginReadPluginSettings pluginReadPluginSettings;
    CCSPluginGetPluginStrExtensions pluginGetPluginStrExtensions;
    CCSPluginDestructor pluginDestructor;
};

/* CCSPlugin accessor functions */
const char * ccsPluginGetName (CCSPlugin *plugin);
const char * ccsPluginGetShortDesc (CCSPlugin *plugin);
const char * ccsPluginGetLongDesc (CCSPlugin *plugin);
const char * ccsPluginGetHints (CCSPlugin *plugin);
const char * ccsPluginGetCategory (CCSPlugin *plugin);

CCSStringList ccsPluginGetLoadAfter (CCSPlugin *plugin);
CCSStringList ccsPluginGetLoadBefore (CCSPlugin *plugin);
CCSStringList ccsPluginGetRequiresPlugins (CCSPlugin *plugin);
CCSStringList ccsPluginGetConflictPlugins (CCSPlugin *plugin);
CCSStringList ccsPluginGetProvidesFeatures (CCSPlugin *plugin);
CCSStringList ccsPluginGetRequiresFeatures (CCSPlugin *plugin);

void * ccsPluginGetPrivatePtr (CCSPlugin *plugin);
void ccsPluginSetPrivatePtr (CCSPlugin *plugin, void *ptr);

CCSContext * ccsPluginGetContext (CCSPlugin *plugin);

void * ccsPluginGetProvidesFeaturesBindable (CCSPlugin *plugin);

struct _CCSPlugin
{
    CCSObject object;
};

struct _CCSSubGroup
{
    char           *name;    /* sub group name in current locale */
    CCSSettingList settings; /* list of settings in this sub group */
    unsigned int   refCount;	   /* reference count */
};

struct _CCSGroup
{
    char            *name;     /* group name in current locale */
    CCSSubGroupList subGroups; /* list of sub groups in this group */
    unsigned int    refCount;	   /* reference count */
};

typedef enum _CCSPluginConflictType
{
    /* produced on plugin activation */
    ConflictRequiresPlugin,
    ConflictRequiresFeature,
    ConflictFeature,
    ConflictPlugin,
    /* produced on plugin deactivation */
    ConflictFeatureNeeded,
    ConflictPluginNeeded,
    ConflictPluginError,
} CCSPluginConflictType;

struct _CCSPluginConflict
{
    char *                value;   /* item (plugin / feature) name that
				      caused the conflict */
    CCSPluginConflictType type;    /* type of the conflict */
    CCSPluginList         plugins; /* list of conflicting plugins */
    unsigned int 	  refCount;	   /* reference count */	
};

union _CCSSettingInfo;

struct _CCSIntDesc
{
    int  value; /* value the description is assigned to */
    char *name; /* description */
    unsigned int refCount;	   /* reference count */
};

struct _CCSStrRestriction
{
    char *value; /* value the restriction is assigned to */
    char *name;  /* description */
    unsigned int refCount;	   /* reference count */
};

struct _CCSStrExtension
{
    char *basePlugin;           /* plugin this extension extends */
    CCSStringList baseSettings; /* list of settings this extension extends */
    CCSStrRestrictionList restriction; /* list of added restriction items */
    unsigned int refCount;	   /* reference count */
};

typedef struct _CCSSettingIntInfo
{
    int            min;  /* minimum value for this setting */
    int            max;  /* maximum value */
    CCSIntDescList desc; /* list of item descriptions */
} CCSSettingIntInfo;

typedef struct _CCSSettingFloatInfo
{
    float min;       /* minimum value for this setting */
    float max;       /* maximum value */
    float precision; /* precision (allowed increment) */
} CCSSettingFloatInfo;

typedef struct _CCSSettingStringInfo
{
    CCSStrRestrictionList restriction;  /* list of restriction items */
    int                sortStartsAt; /* the restriction index to start sorting
					at (defaults to -1 for no sorting) */
    Bool               extensible;   /* whether extension is allowed for
					this setting */	
} CCSSettingStringInfo;

typedef struct _CCSSettingListInfo
{
    CCSSettingType        listType;  /* type of setting this list contains */
    union _CCSSettingInfo *listInfo; /* list of settings */
} CCSSettingListInfo;

typedef struct _CCSSettingActionInfo
{
    Bool internal; /* is this binding global or plugin internal*/
} CCSSettingActionInfo;

typedef union _CCSSettingInfo
{
    CCSSettingIntInfo    forInt;
    CCSSettingFloatInfo  forFloat;
    CCSSettingStringInfo forString;
    CCSSettingListInfo   forList;
    CCSSettingActionInfo forAction;
} CCSSettingInfo;

typedef struct _CCSSettingColorValueColor
{
    unsigned short red;
    unsigned short green;
    unsigned short blue;
    unsigned short alpha;
}

CCSSettingColorValueColor;

typedef struct _CCSSettingColorValueArray
{
    unsigned short array[4];
}

CCSSettingColorValueArray;

typedef union _CCSSettingColorValue
{
    CCSSettingColorValueColor color;
    CCSSettingColorValueArray array;
} CCSSettingColorValue;


typedef struct _CCSSettingKeyValue
{
    int          keysym;
    unsigned int keyModMask;
} CCSSettingKeyValue;

typedef struct _CCSSettingButtonValue
{
    int          button;
    unsigned int buttonModMask;
    unsigned int edgeMask;
} CCSSettingButtonValue;

typedef union _CCSSettingValueUnion
{
    Bool		  asBool;
    int			  asInt;
    float		  asFloat;
    char *		  asString;
    char *		  asMatch;
    CCSSettingColorValue  asColor;
    CCSSettingValueList   asList;
    CCSSettingKeyValue    asKey;
    CCSSettingButtonValue asButton;
    unsigned int	  asEdge;
    Bool		  asBell;
} CCSSettingValueUnion;

struct _CCSSettingValue
{
    CCSSettingValueUnion value;
    CCSSetting *	 parent;
    Bool		 isListChild;
    unsigned int	 refCount;	   /* reference count */
};

/* Interface for CCSSetting */
const char * ccsSettingGetName (CCSSetting *setting);
const char * ccsSettingGetShortDesc (CCSSetting *setting);
const char * ccsSettingGetLongDesc (CCSSetting *setting);
CCSSettingType ccsSettingGetType (CCSSetting *setting);
CCSSettingInfo * ccsSettingGetInfo (CCSSetting *setting);
const char * ccsSettingGetGroup (CCSSetting *setting);
const char * ccsSettingGetSubGroup (CCSSetting *setting);
const char * ccsSettingGetHints (CCSSetting *setting);
CCSSettingValue * ccsSettingGetDefaultValue (CCSSetting *setting);
CCSSettingValue *ccsSettingGetValue (CCSSetting *setting);
Bool ccsSettingGetIsDefault (CCSSetting *setting);
CCSPlugin * ccsSettingGetParent (CCSSetting *setting);
void * ccsSettingGetPrivatePtr (CCSSetting *setting);
void ccsSettingSetPrivatePtr (CCSSetting *setting, void *ptr);

/* Setting getters. Returns TRUE if the setting value was successfully
   copied into <data>, FALSE otherwise. */
Bool ccsGetInt (CCSSetting *setting,
		int        *data);
Bool ccsGetFloat (CCSSetting *setting,
		  float      *data);
Bool ccsGetBool (CCSSetting *setting,
		 Bool       *data);
Bool ccsGetString (CCSSetting *setting,
		   const char **data);
Bool ccsGetColor (CCSSetting           *setting,
		  CCSSettingColorValue *data);
Bool ccsGetMatch (CCSSetting *setting,
		  const char **data);
Bool ccsGetKey (CCSSetting         *setting,
		CCSSettingKeyValue *data);
Bool ccsGetButton (CCSSetting            *setting,
		   CCSSettingButtonValue *data);
Bool ccsGetEdge (CCSSetting  *setting,
		 unsigned int *data);
Bool ccsGetBell (CCSSetting *setting,
		 Bool       *data);
Bool ccsGetList (CCSSetting          *setting,
		 CCSSettingValueList *data);

typedef enum _CCSSetStatus
{
    SetFailed = -1,
    SetToDefault = 1,
    SetIsDefault = 2,
    SetToSameValue = 3,
    SetToNewValue = 4
} CCSSetStatus;

/* Setting setters. Set <setting> to value <data>. Return TRUE if new value
   matches data. If the new value doesn't match the old value, the setting
   is added to the context's changedSettings list. */
CCSSetStatus ccsSetInt (CCSSetting *setting,
			int        data,
			Bool	   processChanged);
CCSSetStatus ccsSetFloat (CCSSetting *setting,
			  float      data,
			  Bool	     processChanged);
CCSSetStatus ccsSetBool (CCSSetting *setting,
			 Bool       data,
			 Bool	    processChanged);
CCSSetStatus ccsSetString (CCSSetting *setting,
			   const char *data,
			   Bool	      processChanged);
CCSSetStatus ccsSetColor (CCSSetting           *setting,
			  CCSSettingColorValue data,
			  Bool		       processChanged);
CCSSetStatus ccsSetMatch (CCSSetting *setting,
			  const char *data,
			  Bool	     processChanged);
CCSSetStatus ccsSetKey (CCSSetting         *setting,
			CCSSettingKeyValue data,
			Bool		   processChanged);
CCSSetStatus ccsSetButton (CCSSetting            *setting,
			   CCSSettingButtonValue data,
			   Bool			 processChanged);
CCSSetStatus ccsSetEdge (CCSSetting   *setting,
			 unsigned int data,
			 Bool	      processChanged);
CCSSetStatus ccsSetBell (CCSSetting *setting,
			 Bool       data,
			 Bool	    processChanged);
CCSSetStatus ccsSetList (CCSSetting          *setting,
			 CCSSettingValueList data,
			 Bool	 processChanged);
CCSSetStatus ccsSetValue (CCSSetting      *setting,
			  CCSSettingValue *data,
			  Bool		  processChanged);

/* Reset all settings to defaults. Settings that were non-default
   previously are added to the changedSettings list of the context. */
void ccsResetToDefault (CCSSetting * setting, Bool processChanged);

/* Checks if a given setting is integrated in the desktop environment. */
Bool ccsSettingIsIntegrated (CCSSetting *setting);

/* Checks if a given setting is read-only. */
Bool ccsSettingIsReadOnly (CCSSetting *setting);

/* Checks if a setting is readable by backends */
Bool ccsSettingIsReadableByBackend (CCSSetting *setting);

typedef const char * (*CCSSettingGetName) (CCSSetting *);
typedef const char * (*CCSSettingGetShortDesc) (CCSSetting *);
typedef const char * (*CCSSettingGetLongDesc) (CCSSetting *);
typedef CCSSettingType (*CCSSettingGetType) (CCSSetting *);
typedef CCSSettingInfo * (*CCSSettingGetInfo) (CCSSetting *);
typedef const char * (*CCSSettingGetGroup) (CCSSetting *);
typedef const char * (*CCSSettingGetSubGroup) (CCSSetting *);
typedef const char * (*CCSSettingGetHints) (CCSSetting *);
typedef CCSSettingValue * (*CCSSettingGetDefaultValue) (CCSSetting *setting);
typedef CCSSettingValue * (*CCSSettingGetValue) (CCSSetting *setting);
typedef Bool (*CCSSettingGetIsDefault) (CCSSetting *);
typedef CCSPlugin * (*CCSSettingGetParent) (CCSSetting *);
typedef void * (*CCSSettingGetPrivatePtr) (CCSSetting *);
typedef void (*CCSSettingSetPrivatePtr) (CCSSetting *, void *);
typedef CCSSetStatus (*CCSSettingSetInt) (CCSSetting *setting, int data, Bool processChanged);
typedef CCSSetStatus (*CCSSettingSetFloat) (CCSSetting *setting, float data, Bool processChanged);
typedef CCSSetStatus (*CCSSettingSetBool) (CCSSetting *setting, Bool data, Bool processChanged);
typedef CCSSetStatus (*CCSSettingSetString) (CCSSetting *setting, const char * data, Bool processChanged);
typedef CCSSetStatus (*CCSSettingSetColor) (CCSSetting *setting, CCSSettingColorValue data, Bool processChanged);
typedef CCSSetStatus (*CCSSettingSetMatch) (CCSSetting *setting, const char * data, Bool processChanged);
typedef CCSSetStatus (*CCSSettingSetKey) (CCSSetting *setting, CCSSettingKeyValue data, Bool processChanged);
typedef CCSSetStatus (*CCSSettingSetButton) (CCSSetting *setting, CCSSettingButtonValue data, Bool processChanged);
typedef CCSSetStatus (*CCSSettingSetEdge) (CCSSetting *setting, unsigned int data, Bool processChanged);
typedef CCSSetStatus (*CCSSettingSetBell) (CCSSetting *setting, Bool data, Bool processChanged);
typedef CCSSetStatus (*CCSSettingSetList) (CCSSetting *setting, CCSSettingValueList data, Bool processChanged);
typedef CCSSetStatus (*CCSSettingSetValue) (CCSSetting *setting, CCSSettingValue *data, Bool processChanged);
typedef Bool (*CCSSettingGetInt) (CCSSetting *setting, int *data);
typedef Bool (*CCSSettingGetFloat) (CCSSetting *setting, float *data);
typedef Bool (*CCSSettingGetBool) (CCSSetting *setting, Bool *data);
typedef Bool (*CCSSettingGetString) (CCSSetting *setting, const char **data);
typedef Bool (*CCSSettingGetColor) (CCSSetting *setting, CCSSettingColorValue *data);
typedef Bool (*CCSSettingGetMatch) (CCSSetting *setting, const char **data);
typedef Bool (*CCSSettingGetKey) (CCSSetting *setting, CCSSettingKeyValue *data);
typedef Bool (*CCSSettingGetButton) (CCSSetting *setting, CCSSettingButtonValue *data);
typedef Bool (*CCSSettingGetEdge) (CCSSetting *setting, unsigned int *data);
typedef Bool (*CCSSettingGetBell) (CCSSetting *setting, Bool *data);
typedef Bool (*CCSSettingGetList) (CCSSetting *setting, CCSSettingValueList *data);
typedef void (*CCSSettingResetToDefault) (CCSSetting *setting, Bool processChanged);
typedef Bool (*CCSSettingIsIntegrated) (CCSSetting *setting);
typedef Bool (*CCSSettingIsReadOnly) (CCSSetting *setting);
typedef Bool (*CCSSettingIsReadableByBackend) (CCSSetting *setting);
typedef void (*CCSSettingDestructor) (CCSSetting *setting);

unsigned int ccsCCSSettingInterfaceGetType ();

struct _CCSSettingInterface
{
    CCSSettingGetName settingGetName;
    CCSSettingGetShortDesc settingGetShortDesc;
    CCSSettingGetLongDesc settingGetLongDesc;
    CCSSettingGetType settingGetType;
    CCSSettingGetInfo settingGetInfo;
    CCSSettingGetGroup settingGetGroup;
    CCSSettingGetSubGroup settingGetSubGroup;
    CCSSettingGetHints settingGetHints;
    CCSSettingGetDefaultValue settingGetDefaultValue;
    CCSSettingGetValue settingGetValue;
    CCSSettingGetIsDefault settingGetIsDefault;
    CCSSettingGetParent settingGetParent;
    CCSSettingGetPrivatePtr settingGetPrivatePtr;
    CCSSettingSetPrivatePtr settingSetPrivatePtr;
    CCSSettingSetInt settingSetInt;
    CCSSettingSetFloat settingSetFloat;
    CCSSettingSetBool settingSetBool;
    CCSSettingSetString settingSetString;
    CCSSettingSetColor settingSetColor;
    CCSSettingSetMatch settingSetMatch;
    CCSSettingSetKey settingSetKey;
    CCSSettingSetButton settingSetButton;
    CCSSettingSetEdge settingSetEdge;
    CCSSettingSetBell settingSetBell;
    CCSSettingSetList settingSetList;
    CCSSettingSetValue settingSetValue;
    CCSSettingGetInt settingGetInt;
    CCSSettingGetFloat settingGetFloat;
    CCSSettingGetBool settingGetBool;
    CCSSettingGetString settingGetString;
    CCSSettingGetColor settingGetColor;
    CCSSettingGetMatch settingGetMatch;
    CCSSettingGetKey settingGetKey;
    CCSSettingGetButton settingGetButton;
    CCSSettingGetEdge settingGetEdge;
    CCSSettingGetBell settingGetBell;
    CCSSettingGetList settingGetList;
    CCSSettingResetToDefault settingResetToDefault;
    CCSSettingIsIntegrated settingIsIntegrated;
    CCSSettingIsReadOnly settingIsReadOnly;
    CCSSettingIsReadableByBackend settingIsReadableByBackend;
    CCSSettingDestructor settingDestructor;
};

struct _CCSSetting
{
    CCSObject object;
};

typedef void (*CCSSettingDefaultValueInitializerFunc) (CCSSettingType  type,
						       CCSSettingInfo  *info,
						       CCSSettingValue *value,
						       void            *data);

typedef void (*CCSSettingInfoInitializerFunc) (CCSSettingType  type,
					       CCSSettingInfo  *info,
					       void            *data);

CCSSetting *
ccsSettingDefaultImplNew (CCSPlugin                             *plugin,
			  const char                            *name,
			  CCSSettingType                        type,
			  const char                            *shortDesc,
			  const char                            *longDesc,
			  const char                            *hints,
			  const char                            *group,
			  const char                            *subGroup,
			  CCSSettingDefaultValueInitializerFunc valueInit,
			  void                                  *valueInitData,
			  CCSSettingInfoInitializerFunc         infoInit,
			  void                                  *infoInitData,
			  CCSObjectAllocationInterface          *ai,
			  const CCSInterfaceTable               *interfaces);

struct _CCSPluginCategory
{
    const char *name;      /* plugin category name */
    const char *shortDesc; /* plugin category short description */
    const char *longDesc;  /* plugin category long description */

    CCSStringList plugins; /* list of plugins in this category */
    unsigned int refCount;	   /* reference count */
};

/* set basic metadata to TRUE and no additional
   metadata informations will be parsed */
void ccsSetBasicMetadata (Bool value);

/* Creates a new context for the given screen.
   All plugin settings are automatically enumerated. */
CCSContext* ccsContextNew (unsigned int screenNum, const CCSInterfaceTable *);

/* Function pointers for the input/export functions. Usually you
 * should just provide ccsImportFromFile and ccsExportToFile
 *
 * TODO: Using this as a crutch to isolate testing is not great
 * we should really replace it with a real separate class in future
 * but that is a lot of work and not really worth it for our purposes
 */
typedef CCSStringList (*CCSScanForProfilesProc) (const char *directory);

/* Creates a new context without auto-enumerating any plugin or setting.
   Behaves otherwise exactly like ccsContextNew. */
CCSContext* ccsEmptyContextNew (unsigned int            screenNum,
				CCSContextImportFromFile importFromFile,
				CCSScanForProfilesProc  scanForProfiles,
				CCSBackendLoader        *loader,
				CCSConfigFile           *config,
				const CCSInterfaceTable *);

/* Destroys the allocated context. */
void ccsContextDestroy (CCSContext * context);

/* Load the plugin and setting metadata for a given plugin.
   Returns TRUE on success, FALSE otherwise. */
Bool ccsLoadPlugin (CCSContext *context,
		    char       *name);

/* Searches for a plugin identified by its name in the context.
   Returns the plugin struct if it could be found, NULL otherwise. */
CCSPlugin* ccsFindPlugin (CCSContext *context,
			  const char *name);

/* Searches for a setting in a plugin.
   Returns the setting struct if the search was successful (setting with
   name <name> found), NULL otherwise. */
CCSSetting* ccsFindSetting (CCSPlugin    *plugin,
			    const char   *name);

/* Returns TRUE if the named plugin is in the context and marked as currently
   active in Compiz, FALSE otherwise. */
Bool ccsPluginIsActive(CCSContext *context, const char *name);

void ccsFreeContext (CCSContext *context);
void ccsFreePlugin (CCSPlugin *plugin);
void ccsFreeSetting (CCSSetting *setting);
void ccsFreeGroup (CCSGroup *group);
void ccsFreeSubGroup (CCSSubGroup *subGroup);
void ccsCleanupSettingInfo (CCSSettingInfo *info,
			 CCSSettingType type);
void ccsFreeSettingValue (CCSSettingValue *value);
void ccsFreeSettingValueWithType (CCSSettingValue *v,
				  CCSSettingType  type);
void ccsFreePluginConflict (CCSPluginConflict *value);
void ccsFreeBackendInfo (CCSBackendInfo *value);
void ccsFreeIntDesc (CCSIntDesc *value);
void ccsFreeStrRestriction (CCSStrRestriction *restriction);
void ccsFreeStrExtension (CCSStrExtension *extension);



/* Compares two setting values. Returns TRUE if values match,
   FALSE otherwise. */
Bool ccsIsEqualColor (CCSSettingColorValue c1,
		      CCSSettingColorValue c2);
Bool ccsIsEqualKey (CCSSettingKeyValue c1,
		    CCSSettingKeyValue c2);
Bool ccsIsEqualButton (CCSSettingButtonValue c1,
		       CCSSettingButtonValue c2);

/* Compares lists */
Bool ccsCompareLists (CCSSettingValueList l1, CCSSettingValueList l2,
		      CCSSettingListInfo info);

/* Retrieves a list of settings in a plugin */
CCSSettingList ccsGetPluginSettings (CCSPlugin *plugin);

/* Retrieves a list of setting groups in a plugin */
CCSGroupList ccsGetPluginGroups (CCSPlugin *plugin);

/* Converts a string list into a list of string settings.
   Return value needs to be freed by the caller. */
CCSSettingValueList ccsGetValueListFromStringList (CCSStringList list,
						   CCSSetting    *parent);
/* Converts a string setting value list into a string list.
   Return value needs to be freed by the caller. */
CCSStringList ccsGetStringListFromValueList (CCSSettingValueList list);

/* Converts a string list into a string array. If the return value is not
   NULL, the item count is copied into <num>. Return value needs to be freed
   by the caller. */
char** ccsGetStringArrayFromList (CCSStringList list,
				  int           *num);
/* Converts a string array with <num> items into a string list. Return value
   needs to be freed by the caller. */
CCSStringList ccsGetListFromStringArray (char **array,
					 int  num);

/* Converts a setting value list into an array of the setting item data type.
   Behaves similar to ccsGetStringArrayFromList. */
char** ccsGetStringArrayFromValueList (CCSSettingValueList list,
				       int                 *num);
char** ccsGetMatchArrayFromValueList (CCSSettingValueList list,
				      int                 *num);

int* ccsGetIntArrayFromValueList (CCSSettingValueList list,
				  int                 *num);
float* ccsGetFloatArrayFromValueList (CCSSettingValueList list,
				      int                 *num);
Bool * ccsGetBoolArrayFromValueList (CCSSettingValueList list,
				     int                 *num);
CCSSettingColorValue* ccsGetColorArrayFromValueList (CCSSettingValueList list,
	       					     int                 *num);

/* Deep copies value lists */
CCSSettingValueList
ccsCopyList (CCSSettingValueList l1, CCSSetting * setting);

/* Deep copy setting value */
CCSSettingValue *
ccsCopyValue (const CCSSettingValue *orig,
	      CCSSettingType        type,
	      CCSSettingInfo        *info);
Bool
ccsCopyValueInto (const CCSSettingValue *from,
		  CCSSettingValue       *to,
		  CCSSettingType        type,
		  CCSSettingInfo        *info);

/* Deep copy setting info */
void
ccsCopyInfo (const CCSSettingInfo *from, CCSSettingInfo *to, CCSSettingType type);

/* Converts an array of data items to a setting value list. Behaves similar
   to ccsGetListFromStringArray */
CCSSettingValueList ccsGetValueListFromStringArray (const char **array,
						    int        num,
						    CCSSetting *parent);
CCSSettingValueList ccsGetValueListFromMatchArray (const char  **array,
						   int        num,
						   CCSSetting *parent);
CCSSettingValueList ccsGetValueListFromIntArray (int        *array,
						 int        num,
						 CCSSetting *parent);
CCSSettingValueList ccsGetValueListFromFloatArray (float      *array,
						   int        num,
						   CCSSetting *parent);
CCSSettingValueList ccsGetValueListFromBoolArray (Bool       *array,
						  int        num,
						  CCSSetting *parent);
CCSSettingValueList ccsGetValueListFromColorArray (CCSSettingColorValue *array,
						   int                  num,
						   CCSSetting           *parent);

/* Retrieves a list of plugins marked as active in Compiz for this context */
CCSPluginList ccsGetActivePluginList (CCSContext *context);

/* Retrieves a list of plugin names which are active in Compiz for a given
   context, sorted as needed according to load after/before/etc. rules */
CCSStringList ccsGetSortedPluginStringList (CCSContext *context);

/* Switches the backend for a context. Returns TRUE on successful switch,
   FALSE otherwise. */
Bool ccsSetBackend (CCSContext *context,
		    char       *name);
/* Retrieves the name of the backend active for the context. */
const char * ccsGetBackend (CCSContext *context);

/* Enable/disable DE integration for a context. */
void ccsSetIntegrationEnabled (CCSContext *context,
			       Bool       value);

/* Sets the profile for a context. */
void ccsSetProfile (CCSContext *context,
		    const char *name);

/* Set plugin list autosort for a context. */
void ccsSetPluginListAutoSort (CCSContext *context,
			       Bool       value);

/* Retrieve current profile of the context. */
const char * ccsGetProfile (CCSContext *context);

/* Retrieves current DE integration status for a context */
Bool ccsGetIntegrationEnabled (CCSContext *context);

/* Retrieves the autosort setting for a context. */
Bool ccsGetPluginListAutoSort (CCSContext *context);

/* Changes the plugin activeness status in compiz. If plugin list autosort
   is enabled, automatically writes a new sorted plugin list to the
   active_plugins setting. If autosort is disabled, it's up to the caller
   to do that. */
Bool ccsPluginSetActive (CCSPlugin *plugin,
			 Bool      value);

/* functions parsing/creating an action string -
   the returned strings must be free'd after usage! */

char * ccsModifiersToString (unsigned int modMask);

char * ccsEdgesToString (unsigned int edge);

char * ccsEdgesToModString (unsigned int edge);

char * ccsKeyBindingToString (CCSSettingKeyValue *key);

char * ccsButtonBindingToString (CCSSettingButtonValue *button);

char * ccsColorToString (CCSSettingColorValue *color);

unsigned int ccsStringToModifiers (const char *binding);

unsigned int ccsStringToEdges (const char *edge);

unsigned int ccsModStringToEdges (const char *edge);

Bool ccsStringToKeyBinding (const char         *binding,
			    CCSSettingKeyValue *key);

Bool ccsStringToButtonBinding (const char            *binding,
			       CCSSettingButtonValue *button);

Bool ccsStringToColor (const char           *value,
		       CCSSettingColorValue *color);

/* flag values for ccsProcessEvents */
#define ProcessEventsNoGlibMainLoopMask (1 << 0)

void ccsProcessEvents (CCSContext   *context,
		       unsigned int flags);

/* Read all setting values from disk */
void ccsReadSettings (CCSContext *context);

/* Read setting values for a given plugin */
void ccsReadPluginSettings (CCSPlugin *plugin);

/* Write all settings to disk */
void ccsWriteSettings (CCSContext *context);

/* Write changed settings to disk */
void ccsWriteChangedSettings (CCSContext *context);

/* Exports a profile to a file. If skipDefaults is TRUE, only exports
   non-default settings. Returns TRUE on successful export, FALSE otherwise. */
Bool ccsExportToFile (CCSContext *context,
		      const char *fileName,
		      Bool skipDefaults);

/* Imports a profile from a file. If overwriteNonDefault is TRUE, also
   overwrites settings that were non-default before. Returns TRUE on success,
   FALSE otherwise. */
Bool ccsImportFromFile (CCSContext *context,
			const char *fileName,
			Bool       overwriteNonDefault);

/* File watch stuff */

typedef void (*FileWatchCallbackProc) (unsigned int watchId, void *closure);

unsigned int ccsAddFileWatch (const char            *fileName,
			      Bool                  enable,
			      FileWatchCallbackProc callback,
			      void                  *closure);

void ccsRemoveFileWatch (unsigned int watchId);
void ccsDisableFileWatch (unsigned int watchId);
void ccsEnableFileWatch (unsigned int watchId);

/* INI file stuff
 * FIXME: This should not be part of the
 * public API */

typedef struct _dictionary_
{
    /** Number of entries in dictionary */
    int n;
    /** Storage size */
    int size;
    /** List of string values */
    char **val;
    /** List of string keys */
    char **key ;
    /** List of hash values for keys */
    unsigned *hash;
} IniDictionary;

IniDictionary* ccsIniNew (void);
IniDictionary* ccsIniOpen (const char *fileName);
void ccsIniClose (IniDictionary *dictionary);
void ccsIniSave (IniDictionary *dictionary,
		 const char    *fileName);

Bool ccsCreateDirFor (const char *fileName);

Bool ccsIniParseString (char        *str,
			char	    **value);
Bool ccsIniGetString (IniDictionary *dictionary,
		      const char    *section,
		      const char    *entry,
		      char          **value);

Bool ccsIniParseInt (const char  *str,
		     int	 *value);
Bool ccsIniGetInt (IniDictionary *dictionary,
		   const char    *section,
		   const char    *entry,
		   int           *value);

Bool ccsIniParseFloat (const char  *str,
		       float	   *value);
Bool ccsIniGetFloat (IniDictionary *dictionary,
		     const char    *section,
		     const char    *entry,
		     float         *value);

Bool ccsIniParseBool (const char  *str,
		      Bool	  *value);
Bool ccsIniGetBool (IniDictionary *dictionary,
		    const char    *section,
		    const char    *entry,
		    Bool          *value);

Bool ccsIniParseColor (const char 	    *str,
		       CCSSettingColorValue *value);
Bool ccsIniGetColor (IniDictionary        *dictionary,
		     const char           *section,
		     const char           *entry,
		     CCSSettingColorValue *value);

Bool ccsIniParseKey (const char		*str,
		     CCSSettingKeyValue *value);
Bool ccsIniGetKey (IniDictionary        *dictionary,
		   const char           *section,
		   const char           *entry,
		   CCSSettingKeyValue   *value);

Bool ccsIniParseButton (const char	      *str,
			CCSSettingButtonValue *value);
Bool ccsIniGetButton (IniDictionary         *dictionary,
		      const char            *section,
		      const char            *entry,
		      CCSSettingButtonValue *value);

Bool ccsIniParseEdge (const char  *str,
		      unsigned int *value);
Bool ccsIniGetEdge (IniDictionary *dictionary,
		    const char    *section,
		    const char    *entry,
		    unsigned int  *value);
	
Bool ccsIniGetBell (IniDictionary *dictionary,
		    const char    *section,
		    const char    *entry,
		    Bool          *value);

Bool ccsIniParseList (const char	  *str,
		      CCSSettingValueList *value,
		      CCSSetting	  *parent);
Bool ccsIniGetList (IniDictionary       *dictionary,
		    const char          *section,
		    const char          *entry,
		    CCSSettingValueList *value,
		    CCSSetting          *parent);

void ccsIniSetString (IniDictionary *dictionary,
		      const char    *section,
		      const char    *entry,
		      const char    *value);
void ccsIniSetInt (IniDictionary *dictionary,
		   const char    *section,
		   const char    *entry,
		   int           value);
void ccsIniSetFloat (IniDictionary *dictionary,
		     const char    *section,
		     const char    *entry,
		     float         value);
void ccsIniSetBool (IniDictionary *dictionary,
		    const char    *section,
		    const char    *entry,
		    Bool          value);
void ccsIniSetColor (IniDictionary        *dictionary,
		     const char           *section,
		     const char           *entry,
		     CCSSettingColorValue value);
void ccsIniSetKey (IniDictionary      *dictionary,
		   const char         *section,
		   const char         *entry,
		   CCSSettingKeyValue value);
void ccsIniSetButton (IniDictionary         *dictionary,
		      const char            *section,
		      const char            *entry,
		      CCSSettingButtonValue value);
void ccsIniSetEdge (IniDictionary *dictionary,
		     const char   *section,
		     const char   *entry,
		     unsigned int value);
void ccsIniSetBell (IniDictionary *dictionary,
		    const char    *section,
		    const char    *entry,
		    Bool          value);
void ccsIniSetList (IniDictionary       *dictionary,
		    const char          *section,
		    const char          *entry,
		    CCSSettingValueList value,
		    CCSSettingType      listType);

void ccsIniRemoveEntry (IniDictionary *dictionary,
			const char    *section,
			const char    *entry);

/* Checks if a plugin can be enabled. Returns a list of conflicts that
   would occur when loading the plugin. A return value of NULL means that
   the plugin can be enabled without problems. */
CCSPluginConflictList ccsCanEnablePlugin (CCSContext *context,
					  CCSPlugin  *plugin);

/* Checks if a plugin can be disabled. The meaning of the return value is the
   same as for ccsCanEnablePlugin */
CCSPluginConflictList ccsCanDisablePlugin (CCSContext *context,
					   CCSPlugin *plugin);

/* Enumerates the available profiles for the current backend. */
CCSStringList ccsGetExistingProfiles (CCSContext * context);

/* Deletes the profile with the given name. */
void ccsDeleteProfile (CCSContext *context,
		       char       *name);

/* Copies backend info out from backend */
CCSBackendInfo *
ccsCopyBackendInfoFromBackend (CCSBackend	   *backend,
			       const CCSBackendInterface *backendInterface);

/* Enumerates the available backends. */
CCSBackendInfoList ccsGetExistingBackends (CCSContext *);

CCSStrExtensionList ccsGetPluginStrExtensions (CCSPlugin *plugin);

Bool
ccsCheckValueEq (const CCSSettingValue *rhs,
		 CCSSettingType	       rhsType,
		 CCSSettingInfo	       *rhsInfo,
		 const CCSSettingValue *lhs,
		 CCSSettingType	       lhsType,
		 CCSSettingInfo	       *lhsInfo);

COMPIZCONFIG_END_DECLS

#endif