1 /*
2  * Compiz configuration system library
3  *
4  * Copyright (C) 2007  Dennis Kasprzyk <onestone@opencompositing.org>
5  * Copyright (C) 2007  Danny Baumann <maniac@opencompositing.org>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11 
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16 
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20  */
21 
22 #ifndef CCS_PRIVATE_H
23 #define CSS_PRIVATE_H
24 
25 #include <ccs.h>
26 #include <ccs-backend.h>
27 
28 #define CONTEXT_PRIV(c) \
29     CCSContextPrivate *cPrivate = (CCSContextPrivate *) c->ccsPrivate;
30 #define PLUGIN_PRIV(p) \
31     CCSPluginPrivate *pPrivate = (CCSPluginPrivate *) p->ccsPrivate;
32 
33 extern Bool basicMetadata;
34 
35 typedef struct _CCSContextPrivate
36 {
37     CCSBackend        *backend;
38 
39     char              *profile;
40     Bool	      deIntegration;
41     Bool              pluginListAutoSort;
42 
43     unsigned int      configWatchId;
44 } CCSContextPrivate;
45 
46 typedef struct _CCSPluginPrivate
47 {
48     CCSSettingList settings;
49     CCSGroupList   groups;
50     Bool 	   loaded;
51     Bool           active;
52     char *	   xmlFile;
53     char *	   xmlPath;
54 #ifdef USE_PROTOBUF
55     char *	   pbFilePath;
56 #endif
57 
58     CCSStrExtensionList stringExtensions;
59 } CCSPluginPrivate;
60 
61 void ccsLoadPlugins (CCSContext * context);
62 void ccsLoadPluginSettings (CCSPlugin * plugin);
63 void collateGroups (CCSPluginPrivate * p);
64 
65 void ccsCheckFileWatches (void);
66 
67 typedef enum {
68     OptionProfile,
69     OptionBackend,
70     OptionIntegration,
71     OptionAutoSort
72 } ConfigOption;
73 
74 Bool ccsReadConfig (ConfigOption option,
75 		    char         **value);
76 Bool ccsWriteConfig (ConfigOption option,
77 		     char         *value);
78 unsigned int ccsAddConfigWatch (CCSContext            *context,
79 				FileWatchCallbackProc callback);
80 
81 #endif
82