Merge lp:~muktupavels/compiz/remove-mate-integration into lp:compiz/0.9.13

Proposed by Alberts Muktupāvels
Status: Merged
Approved by: Dmitry Shachnev
Approved revision: 4201
Merged at revision: 4207
Proposed branch: lp:~muktupavels/compiz/remove-mate-integration
Merge into: lp:compiz/0.9.13
Diff against target: 5297 lines (+0/-5174)
23 files modified
compizconfig/integration/CMakeLists.txt (+0/-1)
compizconfig/integration/mate/CMakeLists.txt (+0/-42)
compizconfig/integration/mate/gsettings/CMakeLists.txt (+0/-54)
compizconfig/integration/mate/gsettings/include/ccs_mate_integration_gsettings_integrated_setting.h (+0/-40)
compizconfig/integration/mate/gsettings/include/ccs_mate_integration_gsettings_integrated_setting_factory.h (+0/-46)
compizconfig/integration/mate/gsettings/include/ccs_mate_integration_gsettings_wrapper_factory.h (+0/-44)
compizconfig/integration/mate/gsettings/src/ccs_mate_integration_gsettings_integrated_setting.c (+0/-355)
compizconfig/integration/mate/gsettings/src/ccs_mate_integration_gsettings_integrated_setting_factory.c (+0/-261)
compizconfig/integration/mate/gsettings/src/ccs_mate_integration_gsettings_wrapper_factory.c (+0/-136)
compizconfig/integration/mate/gsettings/tests/CMakeLists.txt (+0/-30)
compizconfig/integration/mate/gsettings/tests/compizconfig_test_ccs_mate_gsettings_integrated_setting.cpp (+0/-443)
compizconfig/integration/mate/include/ccs_mate_fwd.h (+0/-13)
compizconfig/integration/mate/include/ccs_mate_integrated_setting.h (+0/-64)
compizconfig/integration/mate/include/ccs_mate_integration.h (+0/-46)
compizconfig/integration/mate/include/ccs_mate_integration_constants.h (+0/-217)
compizconfig/integration/mate/include/ccs_mate_integration_types.h (+0/-19)
compizconfig/integration/mate/src/ccs_mate_integrated_setting.c (+0/-161)
compizconfig/integration/mate/src/ccs_mate_integration.c (+0/-815)
compizconfig/integration/mate/src/ccs_mate_integration_constants.c (+0/-1099)
compizconfig/integration/mate/tests/CMakeLists.txt (+0/-46)
compizconfig/integration/mate/tests/compizconfig_ccs_mock_mate_integrated_setting_composition.c (+0/-220)
compizconfig/integration/mate/tests/compizconfig_ccs_mock_mate_integrated_setting_composition.h (+0/-41)
compizconfig/integration/mate/tests/compizconfig_test_ccs_mate_integration.cpp (+0/-981)
To merge this branch: bzr merge lp:~muktupavels/compiz/remove-mate-integration
Reviewer Review Type Date Requested Status
Dmitry Shachnev Approve
Martin Wimpress  Pending
Review via email: mp+362761@code.launchpad.net

Commit message

compizconfig: remove unused MATE integration

Description of the change

MATE integration is not used at all. Either this is unfinished work or someone did not understand what he was doing...

GNOME integration is built as static library that is used by gsettings backend. For example ccsGNOMEIntegrationBackendNew is called in compizconfig/gsettings/src/gsettings.c.

To post a comment you must log in.
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

And there are almost no code changes compared to GNOME integration, it is mostly renaming functions from GNOME* to MATE*, removing some Unity-specific code, and removing the gschema.

Also it misses some fixes like the recent s/fullscreen/fullscreen-flash/ fix.

If someone wants to reintroduce this in the future, it is better to reuse existing code rather than duplicate it.

review: Approve
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

I think there could be multiple options:

- duplicate also gsettings backend as gsettings-mate, but that does not sound like good thing to just add MATE integration.

- Link MATE integration with gsettings backend and choose integration based on current desktop environment.

- Change integration setting in configuration from boolean to string or enum - None, GNOME and MATE. And if backend supports integration (ini backend does not) then it could return list with valid integrations that user can choose from in ccsm. Of course default provided by config.

Third option in my opinion could be best thing and second might work, but does not sound that good. Anyway MATE configuration currently has integration = false and I am not going to do this work... If anyone decides to do this work this can be reverted if needed.

4201. By Alberts Muktupāvels

Merge with lp:compiz.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'compizconfig/integration/CMakeLists.txt'
--- compizconfig/integration/CMakeLists.txt 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/CMakeLists.txt 2019-02-07 13:57:59 +0000
@@ -1,2 +1,1 @@
1add_subdirectory (gnome)1add_subdirectory (gnome)
2add_subdirectory (mate)
32
=== removed directory 'compizconfig/integration/mate'
=== removed file 'compizconfig/integration/mate/CMakeLists.txt'
--- compizconfig/integration/mate/CMakeLists.txt 2019-02-05 15:45:03 +0000
+++ compizconfig/integration/mate/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1add_subdirectory (gsettings)
2
3set (_deps
4 glib-2.0>=2.20.0
5 gio-2.0>=2.25.0)
6
7compiz_pkg_check_modules (COMPIZCONFIG_MATE_INTEGRATION ${_deps})
8
9if (COMPIZCONFIG_MATE_INTEGRATION_FOUND)
10
11 include_directories (${CMAKE_SOURCE_DIR}/compizconfig/libcompizconfig/include
12 ${CMAKE_SOURCE_DIR}/compizconfig/integration/mate/include
13 ${COMPIZCONFIG_MATE_INTEGRATION_INCLUDE_DIRS})
14
15 link_directories (${CMAKE_BINARY_DIR}/compizconfig/libcompizconfig
16 ${COMPIZCONFIG_MATE_INTEGRATION_LIBRARY_DIRS})
17
18 add_library (compizconfig_mate_integration_constants STATIC
19 ${CMAKE_CURRENT_SOURCE_DIR}/src/ccs_mate_integration_constants.c)
20
21 add_library (compizconfig_mate_integration STATIC
22 ${CMAKE_CURRENT_SOURCE_DIR}/src/ccs_mate_integration.c)
23
24 target_link_libraries (compizconfig_mate_integration
25 compizconfig_mate_integration_constants
26 compizconfig_mate_integrated_setting
27 compizconfig
28 ${COMPIZCONFIG_MATE_INTEGRATION_LIBRARIES})
29
30 add_library (compizconfig_mate_integrated_setting STATIC
31 ${CMAKE_CURRENT_SOURCE_DIR}/src/ccs_mate_integrated_setting.c)
32
33 target_link_libraries (compizconfig_mate_integrated_setting
34 compizconfig_mate_integration_constants
35 compizconfig
36 ${COMPIZCONFIG_MATE_INTEGRATION_LIBRARIES})
37
38 if (COMPIZ_BUILD_TESTING)
39 add_subdirectory (tests)
40 endif (COMPIZ_BUILD_TESTING)
41
42endif (COMPIZCONFIG_MATE_INTEGRATION_FOUND)
430
=== removed directory 'compizconfig/integration/mate/gsettings'
=== removed file 'compizconfig/integration/mate/gsettings/CMakeLists.txt'
--- compizconfig/integration/mate/gsettings/CMakeLists.txt 2019-02-05 15:45:03 +0000
+++ compizconfig/integration/mate/gsettings/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
1 set (_deps
2 glib-2.0>=2.20.0
3 gio-2.0>=2.25.0)
4
5 compiz_pkg_check_modules (COMPIZCONFIG_MATE_GSETTINGS_INTEGRATION ${_deps})
6
7 if (COMPIZCONFIG_MATE_GSETTINGS_INTEGRATION_FOUND)
8
9 include_directories (${CMAKE_SOURCE_DIR}/compizconfig/libcompizconfig/include
10 ${CMAKE_SOURCE_DIR}/compizconfig/gsettings/gsettings_backend_shared
11 ${CMAKE_SOURCE_DIR}/compizconfig/integration/mate/include
12 ${CMAKE_SOURCE_DIR}/compizconfig/integration/mate/gsettings/include
13 ${COMPIZCONFIG_MATE_GSETTINGS_INTEGRATION_INCLUDE_DIRS})
14
15 link_directories (${CMAKE_BINARY_DIR}/compizconfig/libcompizconfig
16 ${CMAKE_BINARY_DIR}/compizconfig/gsettings/gsettings_backend_shared
17 ${CMAKE_BINARY_DIR}/compizconfig/integration/mate
18 ${COMPIZCONFIG_MATE_GSETTINGS_INTEGRATION_LIBRARY_DIRS})
19
20 add_library (compizconfig_mate_integration_gsettings_integrated_setting STATIC
21 ${CMAKE_CURRENT_SOURCE_DIR}/src/ccs_mate_integration_gsettings_integrated_setting.c)
22
23 target_link_libraries (compizconfig_mate_integration_gsettings_integrated_setting
24 compizconfig_mate_integrated_setting
25 compizconfig_mate_integration_constants
26 compizconfig
27 compizconfig_gsettings_util
28 ${COMPIZCONFIG_MATE_GSETTINGS_INTEGRATION_LIBRARIES})
29
30 add_library (compizconfig_mate_integration_gsettings_setting_factory STATIC
31 ${CMAKE_CURRENT_SOURCE_DIR}/src/ccs_mate_integration_gsettings_integrated_setting_factory.c)
32
33 target_link_libraries (compizconfig_mate_integration_gsettings_setting_factory
34 compizconfig_gsettings_wrapper_factory_interface
35 compizconfig_mate_integration_constants
36 compizconfig_mate_integrated_setting
37 compizconfig_mate_integration_gsettings_integrated_setting
38 compizconfig
39 compizconfig_gsettings_util
40 ${COMPIZCONFIG_MATE_GSETTINGS_INTEGRATION_LIBRARIES})
41
42 add_library (compizconfig_mate_integration_gsettings_wrapper_factory STATIC
43 ${CMAKE_CURRENT_SOURCE_DIR}/src/ccs_mate_integration_gsettings_wrapper_factory.c)
44
45 target_link_libraries (compizconfig_mate_integration_gsettings_setting_factory
46 compizconfig_gsettings_wrapper_factory_interface
47 compizconfig
48 ${COMPIZCONFIG_MATE_GSETTINGS_INTEGRATION_LIBRARIES})
49
50 if (COMPIZ_BUILD_TESTING)
51 add_subdirectory (tests)
52 endif (COMPIZ_BUILD_TESTING)
53
54 endif (COMPIZCONFIG_MATE_GSETTINGS_INTEGRATION_FOUND)
550
=== removed directory 'compizconfig/integration/mate/gsettings/include'
=== removed file 'compizconfig/integration/mate/gsettings/include/ccs_mate_integration_gsettings_integrated_setting.h'
--- compizconfig/integration/mate/gsettings/include/ccs_mate_integration_gsettings_integrated_setting.h 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/gsettings/include/ccs_mate_integration_gsettings_integrated_setting.h 1970-01-01 00:00:00 +0000
@@ -1,40 +0,0 @@
1#ifndef _CCS_MATE_GSETTINGS_INTEGRATED_SETTING_H
2#define _CCS_MATE_GSETTINGS_INTEGRATED_SETTING_H
3
4#include <ccs-defs.h>
5#include <ccs-fwd.h>
6#include <ccs_mate_fwd.h>
7#include <ccs_gsettings_backend_fwd.h>
8
9COMPIZCONFIG_BEGIN_DECLS
10
11/**
12 * @brief ccsGSettingsIntegratedSettingNew
13 * @param base
14 * @param wrapper
15 * @param ai
16 * @return
17 *
18 * The GSettings implementation of CCSIntegratedSetting *, which will
19 * write using a CCSGSettingsWrapper * object when the read and write
20 * methods are called.
21 */
22CCSIntegratedSetting *
23ccsGSettingsIntegratedSettingNew (CCSMATEIntegratedSettingInfo *base,
24 CCSGSettingsWrapper *wrapper,
25 CCSObjectAllocationInterface *ai);
26
27/**
28 * @brief ccsGSettingsIntegratedSettingsTranslateOldMATEKeyForGSettings
29 * @param key the old style mate key to translate
30 * @return new-style key. Caller should free
31 *
32 * This translates old style keys (eg foo_bar) to new style keys
33 * foo-bar and special cases a few keys
34 */
35char *
36ccsGSettingsIntegratedSettingsTranslateOldMATEKeyForGSettings (const char *key);
37
38COMPIZCONFIG_END_DECLS
39
40#endif
410
=== removed file 'compizconfig/integration/mate/gsettings/include/ccs_mate_integration_gsettings_integrated_setting_factory.h'
--- compizconfig/integration/mate/gsettings/include/ccs_mate_integration_gsettings_integrated_setting_factory.h 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/gsettings/include/ccs_mate_integration_gsettings_integrated_setting_factory.h 1970-01-01 00:00:00 +0000
@@ -1,46 +0,0 @@
1#ifndef _CCS_MATE_GSETTINGS_INTEGRATED_SETTING_FACTORY_H
2#define _CCS_MATE_GSETTINGS_INTEGRATED_SETTING_FACTORY_H
3
4#include <ccs-defs.h>
5#include <ccs-fwd.h>
6#include <ccs_mate_fwd.h>
7#include <ccs_gsettings_backend_fwd.h>
8#include <gio/gio.h>
9
10COMPIZCONFIG_BEGIN_DECLS
11
12/**
13 * @brief ccsGSettingsIntegratedSettingsTranslateNewMATEKeyForCCS
14 * @param key the old style mate key to translate
15 * @return new-style key. Caller should free
16 *
17 * This translates new style keys (eg foo-bar) to old style keys
18 * foo_bar and special cases a few keys
19 */
20char *
21ccsGSettingsIntegratedSettingsTranslateNewMATEKeyForCCS (const char *key);
22
23/**
24 * @brief ccsGSettingsIntegratedSettingsChangeCallback
25 * @return callback for settings change data
26 *
27 * This returns the default callback used for settings changes
28 *
29 * TODO: This API doesn't make a whole lot of sense, but we need
30 * it if we want to inject CCSGSettingsWrapperFactory into
31 * ccsGSettingsIntegratedSettingFactoryNew.
32 *
33 * The return type is GCallback to hide the details of this function
34 * from callers
35 */
36GCallback
37ccsGSettingsIntegratedSettingsChangeCallback ();
38
39CCSIntegratedSettingFactory *
40ccsGSettingsIntegratedSettingFactoryNew (CCSGSettingsWrapperFactory *wrapperFactory,
41 CCSMATEValueChangeData *data,
42 CCSObjectAllocationInterface *ai);
43
44COMPIZCONFIG_END_DECLS
45
46#endif
470
=== removed file 'compizconfig/integration/mate/gsettings/include/ccs_mate_integration_gsettings_wrapper_factory.h'
--- compizconfig/integration/mate/gsettings/include/ccs_mate_integration_gsettings_wrapper_factory.h 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/gsettings/include/ccs_mate_integration_gsettings_wrapper_factory.h 1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
1/**
2 *
3 * GSettings libcompizconfig backend
4 *
5 * ccs_gsettings_wrapper_factory.h
6 *
7 * Copyright (c) 2012 Canonical Ltd
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Authored By:
20 * Sam Spilsbury <sam.spilsbury@canonical.com>
21 *
22 **/
23#ifndef _CCS_MATE_INTEGRATION_GSETTINGS_WRAPPER_FACTORY_H
24#define _CCS_MATE_INTEGRATION_GSETTINGS_WRAPPER_FACTORY_H
25
26#include <ccs-defs.h>
27
28COMPIZCONFIG_BEGIN_DECLS
29
30#include <gio/gio.h>
31
32#include <ccs-fwd.h>
33#include <ccs_gsettings_backend_fwd.h>
34#include <ccs_mate_fwd.h>
35
36CCSGSettingsWrapperFactory *
37ccsMATEIntegrationGSettingsWrapperFactoryDefaultImplNew (CCSObjectAllocationInterface *ai,
38 CCSGSettingsWrapperFactory *factory,
39 GCallback callback,
40 CCSMATEValueChangeData *data);
41
42COMPIZCONFIG_END_DECLS
43
44#endif
450
=== removed directory 'compizconfig/integration/mate/gsettings/src'
=== removed file 'compizconfig/integration/mate/gsettings/src/ccs_mate_integration_gsettings_integrated_setting.c'
--- compizconfig/integration/mate/gsettings/src/ccs_mate_integration_gsettings_integrated_setting.c 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/gsettings/src/ccs_mate_integration_gsettings_integrated_setting.c 1970-01-01 00:00:00 +0000
@@ -1,355 +0,0 @@
1#include <stdlib.h>
2#include <string.h>
3
4#include <gio/gio.h>
5
6#include <ccs.h>
7#include <ccs-backend.h>
8#include <ccs-object.h>
9
10#include <ccs_gsettings_interface.h>
11#include <gsettings_shared.h>
12
13#include "ccs_mate_integration_gsettings_integrated_setting.h"
14#include "ccs_mate_integrated_setting.h"
15#include "ccs_mate_integration_constants.h"
16
17
18/* CCSGSettingsIntegratedSetting implementation */
19typedef struct _CCSGSettingsIntegratedSettingPrivate CCSGSettingsIntegratedSettingPrivate;
20
21struct _CCSGSettingsIntegratedSettingPrivate
22{
23 CCSMATEIntegratedSettingInfo *mateIntegratedSetting;
24 CCSGSettingsWrapper *wrapper;
25};
26
27char *
28ccsGSettingsIntegratedSettingsTranslateOldMATEKeyForGSettings (const char *key)
29{
30 char *newKey = translateKeyForGSettings (key);
31
32 if (g_strcmp0 (newKey, "run-command-screenshot") == 0)
33 {
34 free (newKey);
35 newKey = strdup ("screenshot");
36 }
37 else if (g_strcmp0 (newKey, "run-command-window-screenshot") == 0)
38 {
39 free (newKey);
40 newKey = strdup ("window-screenshot");
41 }
42 else if (g_strcmp0 (newKey, "run-command-terminal") == 0)
43 {
44 free (newKey);
45 newKey = strdup ("terminal");
46 }
47
48 return newKey;
49}
50
51SpecialOptionType
52ccsGSettingsIntegratedSettingGetSpecialOptionType (CCSMATEIntegratedSettingInfo *setting)
53{
54 CCSGSettingsIntegratedSettingPrivate *priv = (CCSGSettingsIntegratedSettingPrivate *) ccsObjectGetPrivate (setting);
55
56 return ccsMATEIntegratedSettingInfoGetSpecialOptionType (priv->mateIntegratedSetting);
57}
58
59const char *
60ccsGSettingsIntegratedSettingGetMATEName (CCSMATEIntegratedSettingInfo *setting)
61{
62 CCSGSettingsIntegratedSettingPrivate *priv = (CCSGSettingsIntegratedSettingPrivate *) ccsObjectGetPrivate (setting);
63
64 return ccsMATEIntegratedSettingInfoGetMATEName (priv->mateIntegratedSetting);
65}
66
67CCSSettingValue *
68ccsGSettingsIntegratedSettingReadValue (CCSIntegratedSetting *setting, CCSSettingType type)
69{
70 CCSGSettingsIntegratedSettingPrivate *priv = (CCSGSettingsIntegratedSettingPrivate *) ccsObjectGetPrivate (setting);
71 CCSSettingValue *v = calloc (1, sizeof (CCSSettingValue));
72 const char *mateKeyName = ccsMATEIntegratedSettingInfoGetMATEName ((CCSMATEIntegratedSettingInfo *) setting);
73 char *gsettingsTranslatedName = ccsGSettingsIntegratedSettingsTranslateOldMATEKeyForGSettings (mateKeyName);
74
75 v->isListChild = FALSE;
76 v->parent = NULL;
77 v->refCount = 1;
78
79 GVariant *variant = ccsGSettingsWrapperGetValue (priv->wrapper, gsettingsTranslatedName);
80
81 if (!variant)
82 {
83 free (gsettingsTranslatedName);
84 free (v);
85 return NULL;
86 }
87
88 const GVariantType *variantType = G_VARIANT_TYPE (g_variant_get_type_string (variant));
89
90 switch (type)
91 {
92 case TypeInt:
93 if (!g_variant_type_equal (variantType, G_VARIANT_TYPE_INT32))
94 {
95 ccsError ("Expected integer value");
96 free (v);
97 v = NULL;
98 break;
99 }
100
101 v->value.asInt = readIntFromVariant (variant);
102 break;
103 case TypeBool:
104 if (!g_variant_type_equal (variantType, G_VARIANT_TYPE_BOOLEAN))
105 {
106 ccsError ("Expected boolean value");
107 free (v);
108 v = NULL;
109 break;
110 }
111
112 v->value.asBool = readBoolFromVariant (variant);
113 break;
114 case TypeString:
115 {
116 if (!g_variant_type_equal (variantType, G_VARIANT_TYPE_STRING))
117 {
118 ccsError ("Expected string value");
119 free (v);
120 v = NULL;
121 break;
122 }
123
124 const char *str = readStringFromVariant (variant);
125 v->value.asString = strdup (str ? str : "");
126 break;
127 }
128 case TypeKey:
129 {
130 if (!g_variant_type_equal (variantType, G_VARIANT_TYPE ("as")))
131 {
132 ccsError ("Expected array-of-string value");
133 free (v);
134 v = NULL;
135 break;
136 }
137
138 gsize len;
139 const gchar **strv = g_variant_get_strv (variant, &len);
140
141 if (strv)
142 v->value.asString = strdup (strv[0] ? strv[0] : "");
143 else
144 v->value.asString = strdup ("");
145
146 g_free (strv);
147 break;
148 }
149 default:
150 g_assert_not_reached ();
151 }
152
153 g_variant_unref (variant);
154 free (gsettingsTranslatedName);
155
156 return v;
157}
158
159void
160ccsGSettingsIntegratedSettingWriteValue (CCSIntegratedSetting *setting, CCSSettingValue *v, CCSSettingType type)
161{
162 CCSGSettingsIntegratedSettingPrivate *priv = (CCSGSettingsIntegratedSettingPrivate *) ccsObjectGetPrivate (setting);
163 const char *mateKeyName = ccsMATEIntegratedSettingInfoGetMATEName ((CCSMATEIntegratedSettingInfo *) setting);
164 char *gsettingsTranslatedName = ccsGSettingsIntegratedSettingsTranslateOldMATEKeyForGSettings (mateKeyName);
165
166 GVariant *variant = ccsGSettingsWrapperGetValue (priv->wrapper, gsettingsTranslatedName);
167 const GVariantType *variantType = g_variant_get_type (variant);
168 GVariant *newVariant = NULL;
169
170 if (!variant)
171 {
172 ccsError ("NULL encountered while reading GSettings value");
173 free (gsettingsTranslatedName);
174 return;
175 }
176
177 switch (type)
178 {
179 case TypeInt:
180 {
181 if (!g_variant_type_equal (variantType, G_VARIANT_TYPE_INT32))
182 ccsError ("Expected integer value");
183 else
184 {
185 int currentValue = readIntFromVariant (variant);
186
187 if ((currentValue != v->value.asInt))
188 writeIntToVariant (v->value.asInt, &newVariant);
189 }
190 }
191 break;
192 case TypeBool:
193 {
194 if (!g_variant_type_equal (variantType, G_VARIANT_TYPE_BOOLEAN))
195 ccsError ("Expected boolean value");
196 else
197 {
198 gboolean currentValue = readBoolFromVariant (variant);
199
200 if ((currentValue != v->value.asBool))
201 writeBoolToVariant (v->value.asBool, &newVariant);
202 }
203 }
204 break;
205 case TypeString:
206 {
207 if (!g_variant_type_equal (variantType, G_VARIANT_TYPE_STRING))
208 ccsError ("Expected string value");
209 else
210 {
211 const char *defaultValue = "";
212 const char *newValue = v->value.asString ? v->value.asString : defaultValue;
213 gsize len = 0;
214 const gchar *currentValue = g_variant_get_string (variant, &len);
215
216 if (currentValue)
217 {
218 if (strcmp (currentValue, newValue) != 0)
219 writeStringToVariant (newValue, &newVariant);
220 }
221 }
222 }
223 break;
224 case TypeKey:
225 {
226 if (!g_variant_type_equal (variantType, G_VARIANT_TYPE ("as")))
227 ccsError ("Expected array-of-string value");
228 else
229 {
230 const char *defaultValue = "";
231 GVariantBuilder strvBuilder;
232
233 g_variant_builder_init (&strvBuilder, G_VARIANT_TYPE ("as"));
234 g_variant_builder_add (&strvBuilder, "s", v->value.asString ? v->value.asString : defaultValue);
235 newVariant = g_variant_builder_end (&strvBuilder);
236 }
237 }
238 break;
239 default:
240 g_assert_not_reached ();
241 break;
242 }
243
244 /* g_settings_set_value consumes the reference */
245 if (newVariant)
246 ccsGSettingsWrapperSetValue (priv->wrapper, gsettingsTranslatedName, newVariant);
247
248 g_variant_unref (variant);
249 free (gsettingsTranslatedName);
250}
251
252const char *
253ccsGSettingsIntegratedSettingInfoPluginName (CCSIntegratedSettingInfo *setting)
254{
255 CCSGSettingsIntegratedSettingPrivate *priv = (CCSGSettingsIntegratedSettingPrivate *) ccsObjectGetPrivate (setting);
256
257 return ccsIntegratedSettingInfoPluginName ((CCSIntegratedSettingInfo *) priv->mateIntegratedSetting);
258}
259
260const char *
261ccsGSettingsIntegratedSettingInfoSettingName (CCSIntegratedSettingInfo *setting)
262{
263 CCSGSettingsIntegratedSettingPrivate *priv = (CCSGSettingsIntegratedSettingPrivate *) ccsObjectGetPrivate (setting);
264
265 return ccsIntegratedSettingInfoSettingName ((CCSIntegratedSettingInfo *) priv->mateIntegratedSetting);
266}
267
268CCSSettingType
269ccsGSettingsIntegratedSettingInfoGetType (CCSIntegratedSettingInfo *setting)
270{
271 CCSGSettingsIntegratedSettingPrivate *priv = (CCSGSettingsIntegratedSettingPrivate *) ccsObjectGetPrivate (setting);
272
273 return ccsIntegratedSettingInfoGetType ((CCSIntegratedSettingInfo *) priv->mateIntegratedSetting);
274}
275
276void
277ccsGSettingsIntegratedSettingFree (CCSIntegratedSetting *setting)
278{
279 CCSGSettingsIntegratedSettingPrivate *priv = (CCSGSettingsIntegratedSettingPrivate *) ccsObjectGetPrivate (setting);
280
281 if (priv->wrapper)
282 ccsGSettingsWrapperUnref (priv->wrapper);
283
284 ccsIntegratedSettingInfoUnref ((CCSIntegratedSettingInfo *) priv->mateIntegratedSetting);
285 ccsObjectFinalize (setting);
286
287 (*setting->object.object_allocation->free_) (setting->object.object_allocation->allocator, setting);
288}
289
290void
291ccsGSettingsIntegratedSettingInfoFree (CCSIntegratedSettingInfo *info)
292{
293 return ccsGSettingsIntegratedSettingFree ((CCSIntegratedSetting *) info);
294}
295
296void
297ccsGSettingsMATEIntegratedSettingInfoFree (CCSMATEIntegratedSettingInfo *info)
298{
299 return ccsGSettingsIntegratedSettingFree ((CCSIntegratedSetting *) info);
300}
301
302const CCSMATEIntegratedSettingInfoInterface ccsGSettingsMATEIntegratedSettingInterface =
303{
304 ccsGSettingsIntegratedSettingGetSpecialOptionType,
305 ccsGSettingsIntegratedSettingGetMATEName,
306 ccsGSettingsMATEIntegratedSettingInfoFree
307};
308
309const CCSIntegratedSettingInterface ccsGSettingsIntegratedSettingInterface =
310{
311 ccsGSettingsIntegratedSettingReadValue,
312 ccsGSettingsIntegratedSettingWriteValue,
313 ccsGSettingsIntegratedSettingFree
314};
315
316const CCSIntegratedSettingInfoInterface ccsGSettingsIntegratedSettingInfoInterface =
317{
318 ccsGSettingsIntegratedSettingInfoPluginName,
319 ccsGSettingsIntegratedSettingInfoSettingName,
320 ccsGSettingsIntegratedSettingInfoGetType,
321 ccsGSettingsIntegratedSettingInfoFree
322};
323
324CCSIntegratedSetting *
325ccsGSettingsIntegratedSettingNew (CCSMATEIntegratedSettingInfo *base,
326 CCSGSettingsWrapper *wrapper,
327 CCSObjectAllocationInterface *ai)
328{
329 CCSIntegratedSetting *setting = (*ai->calloc_) (ai->allocator, 1, sizeof (CCSIntegratedSetting));
330
331 if (!setting)
332 return NULL;
333
334 CCSGSettingsIntegratedSettingPrivate *priv = (*ai->calloc_) (ai->allocator, 1, sizeof (CCSGSettingsIntegratedSettingPrivate));
335
336 if (!priv)
337 {
338 (*ai->free_) (ai->allocator, priv);
339 return NULL;
340 }
341
342 priv->mateIntegratedSetting = base;
343 priv->wrapper = wrapper;
344
345 ccsGSettingsWrapperRef (priv->wrapper);
346
347 ccsObjectInit (setting, ai);
348 ccsObjectSetPrivate (setting, (CCSPrivate *) priv);
349 ccsObjectAddInterface (setting, (const CCSInterface *) &ccsGSettingsIntegratedSettingInterface, GET_INTERFACE_TYPE (CCSIntegratedSettingInterface));
350 ccsObjectAddInterface (setting, (const CCSInterface *) &ccsGSettingsIntegratedSettingInfoInterface, GET_INTERFACE_TYPE (CCSIntegratedSettingInfoInterface));
351 ccsObjectAddInterface (setting, (const CCSInterface *) &ccsGSettingsMATEIntegratedSettingInterface, GET_INTERFACE_TYPE (CCSMATEIntegratedSettingInfoInterface));
352 ccsIntegratedSettingRef (setting);
353
354 return setting;
355}
3560
=== removed file 'compizconfig/integration/mate/gsettings/src/ccs_mate_integration_gsettings_integrated_setting_factory.c'
--- compizconfig/integration/mate/gsettings/src/ccs_mate_integration_gsettings_integrated_setting_factory.c 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/gsettings/src/ccs_mate_integration_gsettings_integrated_setting_factory.c 1970-01-01 00:00:00 +0000
@@ -1,261 +0,0 @@
1#include <stdlib.h>
2#include <string.h>
3
4#include <gio/gio.h>
5
6#include <ccs.h>
7#include <ccs-backend.h>
8#include <ccs-object.h>
9
10#include <ccs_gsettings_interface.h>
11#include <ccs_gsettings_interface_wrapper.h>
12
13#include <gsettings_util.h>
14#include <ccs_gsettings_wrapper_factory_interface.h>
15
16#include "ccs_mate_integration.h"
17#include "ccs_mate_integrated_setting.h"
18#include "ccs_mate_integration_constants.h"
19#include "ccs_mate_integration_types.h"
20#include "ccs_mate_integration_gsettings_integrated_setting.h"
21#include "ccs_mate_integration_gsettings_integrated_setting_factory.h"
22
23char *
24ccsGSettingsIntegratedSettingsTranslateNewMATEKeyForCCS (const char *key)
25{
26 char *newKey = translateKeyForCCS (key);
27
28 if (g_strcmp0 (newKey, "screenshot") == 0)
29 {
30 free (newKey);
31 newKey = strdup ("run_command_screenshot");
32 }
33 else if (g_strcmp0 (newKey, "window_screenshot") == 0)
34 {
35 free (newKey);
36 newKey = strdup ("run_command_window_screenshot");
37 }
38 else if (g_strcmp0 (newKey, "terminal") == 0)
39 {
40 free (newKey);
41 newKey = strdup ("run_command_terminal");
42 }
43
44 return newKey;
45}
46
47typedef struct _CCSGSettingsIntegratedSettingFactoryPrivate CCSGSettingsIntegratedSettingFactoryPrivate;
48
49struct _CCSGSettingsIntegratedSettingFactoryPrivate
50{
51 CCSGSettingsWrapperFactory *wrapperFactory;
52 GHashTable *pluginsToSettingsGSettingsWrapperQuarksHashTable;
53 GHashTable *quarksToGSettingsWrappersHashTable;
54 GHashTable *pluginsToSettingsSpecialTypesHashTable;
55 GHashTable *pluginsToSettingNameMATENameHashTable;
56 CCSMATEValueChangeData *valueChangeData;
57};
58
59static void
60mateGSettingsValueChanged (GSettings *settings,
61 gchar *key,
62 gpointer user_data)
63{
64 CCSMATEValueChangeData *data = (CCSMATEValueChangeData *) user_data;
65 char *baseName = ccsGSettingsIntegratedSettingsTranslateNewMATEKeyForCCS (key);
66
67 /* We don't care if integration is not enabled */
68 if (!ccsGetIntegrationEnabled (data->context))
69 return;
70
71 CCSIntegratedSettingList settingList = ccsIntegratedSettingsStorageFindMatchingSettingsByPredicate (data->storage,
72 ccsMATEIntegrationFindSettingsMatchingPredicate,
73 baseName);
74
75 ccsIntegrationUpdateIntegratedSettings (data->integration,
76 data->context,
77 settingList);
78
79 g_free (baseName);
80
81}
82
83GCallback
84ccsGSettingsIntegratedSettingsChangeCallback ()
85{
86 return (GCallback) mateGSettingsValueChanged;
87}
88
89static CCSIntegratedSetting *
90createNewGSettingsIntegratedSetting (CCSGSettingsWrapper *wrapper,
91 const char *mateName,
92 const char *pluginName,
93 const char *settingName,
94 CCSSettingType type,
95 SpecialOptionType specialOptionType,
96 CCSObjectAllocationInterface *ai)
97{
98 CCSIntegratedSettingInfo *sharedIntegratedSettingInfo = ccsSharedIntegratedSettingInfoNew (pluginName, settingName, type, ai);
99
100 if (!sharedIntegratedSettingInfo)
101 return NULL;
102
103 CCSMATEIntegratedSettingInfo *mateIntegratedSettingInfo = ccsMATEIntegratedSettingInfoNew (sharedIntegratedSettingInfo, specialOptionType, mateName, ai);
104
105 if (!mateIntegratedSettingInfo)
106 {
107 ccsIntegratedSettingInfoUnref (sharedIntegratedSettingInfo);
108 return NULL;
109 }
110
111 CCSIntegratedSetting *gsettingsIntegratedSetting = ccsGSettingsIntegratedSettingNew (mateIntegratedSettingInfo, wrapper, ai);
112
113 if (!gsettingsIntegratedSetting)
114 {
115 ccsIntegratedSettingInfoUnref ((CCSIntegratedSettingInfo *) mateIntegratedSettingInfo);
116 return NULL;
117 }
118
119 return gsettingsIntegratedSetting;
120}
121
122static void
123ccsGSettingsWrapperUnrefWrapper (gpointer wrapper)
124{
125 ccsGSettingsWrapperUnref ((CCSGSettingsWrapper *) wrapper);
126}
127
128static GHashTable *
129initializeGSettingsWrappers (CCSGSettingsWrapperFactory *factory)
130{
131 const CCSGSettingsWrapperIntegratedSchemasQuarks *quarks = ccsMATEGSettingsWrapperQuarks ();
132 GHashTable *quarksToGSettingsWrappers = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, ccsGSettingsWrapperUnrefWrapper);
133
134 g_hash_table_insert (quarksToGSettingsWrappers, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED),
135 ccsGSettingsWrapperFactoryNewGSettingsWrapper (factory,
136 g_quark_to_string (quarks->ORG_COMPIZ_INTEGRATED),
137 factory->object.object_allocation));
138 g_hash_table_insert (quarksToGSettingsWrappers, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS),
139 ccsGSettingsWrapperFactoryNewGSettingsWrapper (factory,
140 g_quark_to_string (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS),
141 factory->object.object_allocation));
142 g_hash_table_insert (quarksToGSettingsWrappers, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_PREFERENCES),
143 ccsGSettingsWrapperFactoryNewGSettingsWrapper (factory,
144 g_quark_to_string (quarks->ORG_MATE_DESKTOP_WM_PREFERENCES),
145 factory->object.object_allocation));
146 g_hash_table_insert (quarksToGSettingsWrappers, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_DEFAULT_APPLICATIONS_TERMINAL),
147 ccsGSettingsWrapperFactoryNewGSettingsWrapper (factory,
148 g_quark_to_string (quarks->ORG_MATE_DESKTOP_DEFAULT_APPLICATIONS_TERMINAL),
149 factory->object.object_allocation));
150 g_hash_table_insert (quarksToGSettingsWrappers, GINT_TO_POINTER (quarks->ORG_MATE_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS),
151 ccsGSettingsWrapperFactoryNewGSettingsWrapper (factory,
152 g_quark_to_string (quarks->ORG_MATE_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS),
153 factory->object.object_allocation));
154
155 return quarksToGSettingsWrappers;
156}
157
158CCSIntegratedSetting *
159ccsGSettingsIntegratedSettingFactoryCreateIntegratedSettingForCCSSettingNameAndType (CCSIntegratedSettingFactory *factory,
160 CCSIntegration *integration,
161 const char *pluginName,
162 const char *settingName,
163 CCSSettingType type)
164{
165 CCSGSettingsIntegratedSettingFactoryPrivate *priv = (CCSGSettingsIntegratedSettingFactoryPrivate *) ccsObjectGetPrivate (factory);
166 GHashTable *settingsGSettingsWrapperQuarksHashTable = g_hash_table_lookup (priv->pluginsToSettingsGSettingsWrapperQuarksHashTable, pluginName);
167 GHashTable *settingsSpecialTypesHashTable = g_hash_table_lookup (priv->pluginsToSettingsSpecialTypesHashTable, pluginName);
168 GHashTable *settingsSettingNameMATENameHashTable = g_hash_table_lookup (priv->pluginsToSettingNameMATENameHashTable, pluginName);
169
170 if (!priv->quarksToGSettingsWrappersHashTable)
171 priv->quarksToGSettingsWrappersHashTable = initializeGSettingsWrappers (priv->wrapperFactory);
172
173 if (settingsGSettingsWrapperQuarksHashTable &&
174 settingsSpecialTypesHashTable &&
175 settingsSettingNameMATENameHashTable)
176 {
177 GQuark wrapperQuark = GPOINTER_TO_INT (g_hash_table_lookup (settingsGSettingsWrapperQuarksHashTable, settingName));
178 CCSGSettingsWrapper *wrapper = g_hash_table_lookup (priv->quarksToGSettingsWrappersHashTable, GINT_TO_POINTER (wrapperQuark));
179 SpecialOptionType specialType = (SpecialOptionType) GPOINTER_TO_INT (g_hash_table_lookup (settingsSpecialTypesHashTable, settingName));
180 const gchar *integratedName = g_hash_table_lookup (settingsSettingNameMATENameHashTable, settingName);
181
182 if (wrapper == NULL)
183 return NULL;
184
185 return createNewGSettingsIntegratedSetting (wrapper,
186 integratedName,
187 pluginName,
188 settingName,
189 type,
190 specialType,
191 factory->object.object_allocation);
192 }
193
194
195 return NULL;
196}
197
198void
199ccsGSettingsIntegratedSettingFactoryFree (CCSIntegratedSettingFactory *factory)
200{
201 CCSGSettingsIntegratedSettingFactoryPrivate *priv = (CCSGSettingsIntegratedSettingFactoryPrivate *) ccsObjectGetPrivate (factory);
202
203 if (priv->pluginsToSettingsGSettingsWrapperQuarksHashTable)
204 g_hash_table_unref (priv->pluginsToSettingsGSettingsWrapperQuarksHashTable);
205
206 if (priv->quarksToGSettingsWrappersHashTable)
207 g_hash_table_unref (priv->quarksToGSettingsWrappersHashTable);
208
209 if (priv->pluginsToSettingsSpecialTypesHashTable)
210 g_hash_table_unref (priv->pluginsToSettingsSpecialTypesHashTable);
211
212 if (priv->pluginsToSettingNameMATENameHashTable)
213 g_hash_table_unref (priv->pluginsToSettingNameMATENameHashTable);
214
215 ccsGSettingsWrapperFactoryUnref (priv->wrapperFactory);
216
217 ccsObjectFinalize (factory);
218 (*factory->object.object_allocation->free_) (factory->object.object_allocation->allocator, factory);
219}
220
221const CCSIntegratedSettingFactoryInterface ccsGSettingsIntegratedSettingFactoryInterface =
222{
223 ccsGSettingsIntegratedSettingFactoryCreateIntegratedSettingForCCSSettingNameAndType,
224 ccsGSettingsIntegratedSettingFactoryFree
225};
226
227CCSIntegratedSettingFactory *
228ccsGSettingsIntegratedSettingFactoryNew (CCSGSettingsWrapperFactory *wrapperFactory,
229 CCSMATEValueChangeData *valueChangeData,
230 CCSObjectAllocationInterface *ai)
231{
232 CCSIntegratedSettingFactory *factory = (*ai->calloc_) (ai->allocator, 1, sizeof (CCSIntegratedSettingFactory));
233
234 if (!factory)
235 return NULL;
236
237 CCSGSettingsIntegratedSettingFactoryPrivate *priv = (*ai->calloc_) (ai->allocator, 1, sizeof (CCSGSettingsIntegratedSettingFactoryPrivate));
238
239 if (!priv)
240 {
241 (*ai->free_) (ai->allocator, factory);
242 return NULL;
243 }
244
245 ccsGSettingsWrapperFactoryRef (wrapperFactory);
246
247 priv->wrapperFactory = wrapperFactory;
248 priv->pluginsToSettingsGSettingsWrapperQuarksHashTable = ccsMATEGSettingsIntegrationPopulateSettingNameToIntegratedSchemasQuarksHashTable ();
249 priv->pluginsToSettingsSpecialTypesHashTable = ccsMATEIntegrationPopulateSpecialTypesHashTables ();
250 priv->pluginsToSettingNameMATENameHashTable = ccsMATEIntegrationPopulateSettingNameToMATENameHashTables ();
251 priv->valueChangeData = valueChangeData;
252
253 ccsObjectInit (factory, ai);
254 ccsObjectSetPrivate (factory, (CCSPrivate *) priv);
255 ccsObjectAddInterface (factory, (const CCSInterface *) &ccsGSettingsIntegratedSettingFactoryInterface, GET_INTERFACE_TYPE (CCSIntegratedSettingFactoryInterface));
256
257 ccsObjectRef (factory);
258
259 return factory;
260}
261
2620
=== removed file 'compizconfig/integration/mate/gsettings/src/ccs_mate_integration_gsettings_wrapper_factory.c'
--- compizconfig/integration/mate/gsettings/src/ccs_mate_integration_gsettings_wrapper_factory.c 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/gsettings/src/ccs_mate_integration_gsettings_wrapper_factory.c 1970-01-01 00:00:00 +0000
@@ -1,136 +0,0 @@
1/**
2 *
3 * GSettings libcompizconfig backend
4 *
5 * ccs_mate_integration_gsettings_wrapper_factory.c
6 *
7 * Copyright (c) 2012 Canonical Ltd
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Authored By:
20 * Sam Spilsbury <sam.spilsbury@canonical.com>
21 *
22 **/
23#include <ccs-object.h>
24#include "ccs_gsettings_wrapper_factory.h"
25#include "ccs_gsettings_wrapper_factory_interface.h"
26#include "ccs_gsettings_interface.h"
27#include "ccs_gsettings_interface_wrapper.h"
28#include "ccs_mate_integration_gsettings_wrapper_factory.h"
29
30/* CCSGSettingsWrapperFactory implementation */
31typedef struct _CCSMATEIntegrationGSettingsWrapperFactoryPrivate CCSMATEIntegrationGSettingsWrapperFactoryPrivate;
32struct _CCSMATEIntegrationGSettingsWrapperFactoryPrivate
33{
34 CCSGSettingsWrapperFactory *wrapperFactory;
35 GCallback callback;
36
37 /* This is expected to stay alive during the
38 * lifetime of this object */
39 CCSMATEValueChangeData *data;
40};
41
42static void
43ccsMATEIntegrationGSettingsWrapperFree (CCSGSettingsWrapperFactory *wrapperFactory)
44{
45 CCSMATEIntegrationGSettingsWrapperFactoryPrivate *priv =
46 GET_PRIVATE (CCSMATEIntegrationGSettingsWrapperFactoryPrivate, wrapperFactory);
47
48 ccsGSettingsWrapperFactoryUnref (priv->wrapperFactory);
49
50 ccsObjectFinalize (wrapperFactory);
51 (*wrapperFactory->object.object_allocation->free_) (wrapperFactory->object.object_allocation->allocator,
52 wrapperFactory);
53}
54
55static void
56connectWrapperToChangedSignal (CCSGSettingsWrapper *wrapper,
57 CCSMATEIntegrationGSettingsWrapperFactoryPrivate *priv)
58{
59 ccsGSettingsWrapperConnectToChangedSignal (wrapper, priv->callback, priv->data);
60}
61
62static CCSGSettingsWrapper *
63ccsMATEIntegrationGSettingsWrapperFactoryNewGSettingsWrapper (CCSGSettingsWrapperFactory *factory,
64 const gchar *schemaName,
65 CCSObjectAllocationInterface *ai)
66{
67 CCSMATEIntegrationGSettingsWrapperFactoryPrivate *priv =
68 GET_PRIVATE (CCSMATEIntegrationGSettingsWrapperFactoryPrivate, factory);
69 CCSGSettingsWrapper *wrapper = ccsGSettingsWrapperFactoryNewGSettingsWrapper (priv->wrapperFactory,
70 schemaName,
71 factory->object.object_allocation);
72
73 if (wrapper != NULL)
74 connectWrapperToChangedSignal (wrapper, priv);
75
76 return wrapper;
77}
78
79static CCSGSettingsWrapper *
80ccsMATEIntegrationGSettingsWrapperFactoryNewGSettingsWrapperWithPath (CCSGSettingsWrapperFactory *factory,
81 const gchar *schemaName,
82 const gchar *path,
83 CCSObjectAllocationInterface *ai)
84{
85 CCSMATEIntegrationGSettingsWrapperFactoryPrivate *priv =
86 GET_PRIVATE (CCSMATEIntegrationGSettingsWrapperFactoryPrivate, factory);
87 CCSGSettingsWrapper *wrapper = ccsGSettingsWrapperFactoryNewGSettingsWrapperWithPath (priv->wrapperFactory,
88 schemaName,
89 path,
90 factory->object.object_allocation);
91
92 connectWrapperToChangedSignal (wrapper, priv);
93
94 return wrapper;
95}
96
97const CCSGSettingsWrapperFactoryInterface ccsMATEIntegrationGSettingsWrapperFactoryInterface =
98{
99 ccsMATEIntegrationGSettingsWrapperFactoryNewGSettingsWrapper,
100 ccsMATEIntegrationGSettingsWrapperFactoryNewGSettingsWrapperWithPath,
101 ccsMATEIntegrationGSettingsWrapperFree
102};
103
104CCSGSettingsWrapperFactory *
105ccsMATEIntegrationGSettingsWrapperFactoryDefaultImplNew (CCSObjectAllocationInterface *ai,
106 CCSGSettingsWrapperFactory *factory,
107 GCallback callback,
108 CCSMATEValueChangeData *data)
109{
110 CCSGSettingsWrapperFactory *wrapperFactory = (*ai->calloc_) (ai->allocator, 1, sizeof (CCSGSettingsWrapperFactory));
111
112 if (!wrapperFactory)
113 return NULL;
114
115 CCSMATEIntegrationGSettingsWrapperFactoryPrivate *priv = (*ai->calloc_) (ai->allocator, 1, sizeof (CCSMATEIntegrationGSettingsWrapperFactoryPrivate));
116
117 if (!priv)
118 {
119 (*ai->free_) (ai->allocator, wrapperFactory);
120 return NULL;
121 }
122
123 ccsGSettingsWrapperFactoryRef (factory);
124
125 priv->wrapperFactory = factory;
126 priv->callback = callback;
127 priv->data = data;
128
129 ccsObjectInit (wrapperFactory, ai);
130 ccsObjectAddInterface (wrapperFactory, (const CCSInterface *) &ccsMATEIntegrationGSettingsWrapperFactoryInterface, GET_INTERFACE_TYPE (CCSGSettingsWrapperFactoryInterface));
131 ccsObjectSetPrivate (wrapperFactory, (CCSPrivate *) priv);
132
133 ccsGSettingsWrapperFactoryRef (wrapperFactory);
134
135 return wrapperFactory;
136}
1370
=== removed directory 'compizconfig/integration/mate/gsettings/tests'
=== removed file 'compizconfig/integration/mate/gsettings/tests/CMakeLists.txt'
--- compizconfig/integration/mate/gsettings/tests/CMakeLists.txt 2015-07-30 19:56:19 +0000
+++ compizconfig/integration/mate/gsettings/tests/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,30 +0,0 @@
1include_directories (${GTEST_INCLUDE_DIRS})
2include_directories (${CMAKE_SOURCE_DIR}/include)
3include_directories (${CMAKE_SOURCE_DIR}/tests/shared)
4include_directories (${CMAKE_SOURCE_DIR}/tests/shared/glib)
5include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../../../../mocks/libcompizconfig)
6include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../../../../gsettings/tests)
7include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../../../../gsettings/mocks)
8include_directories (${CMAKE_SOURCE_DIR}/compizconfig/tests)
9link_directories (${CMAKE_INSTALL_PREFIX}/lib)
10link_directories (${CMAKE_CURRENT_BINARY_DIR}/../../mocks/libcompizconfig)
11link_directories (${CMAKE_CURRENT_BINARY_DIR}/../../tests/)
12link_directories (${CMAKE_CURRENT_BINARY_DIR}/../src/)
13
14set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
15
16add_executable (compizconfig_test_ccs_mate_gsettings_integrated_setting
17 ${CMAKE_CURRENT_SOURCE_DIR}/compizconfig_test_ccs_mate_gsettings_integrated_setting.cpp)
18
19target_link_libraries (compizconfig_test_ccs_mate_gsettings_integrated_setting
20 ${GTEST_BOTH_LIBRARIES}
21 ${GMOCK_LIBRARY}
22 ${GMOCK_MAIN_LIBRARY}
23 ${LIBCOMPIZCONFIG_LIBRARIES}
24 compizconfig
25 compizconfig_gsettings_settings_test_env
26 compizconfig_ccs_gsettings_wrapper_mock
27 compizconfig_mate_integration_gsettings_integrated_setting
28 compizconfig_gsettings_backend_interface)
29
30compiz_discover_tests (compizconfig_test_ccs_mate_gsettings_integrated_setting COVERAGE compizconfig_mate_integration_gsettings_integrated_setting)
310
=== removed file 'compizconfig/integration/mate/gsettings/tests/compizconfig_test_ccs_mate_gsettings_integrated_setting.cpp'
--- compizconfig/integration/mate/gsettings/tests/compizconfig_test_ccs_mate_gsettings_integrated_setting.cpp 2018-07-19 00:55:26 +0000
+++ compizconfig/integration/mate/gsettings/tests/compizconfig_test_ccs_mate_gsettings_integrated_setting.cpp 1970-01-01 00:00:00 +0000
@@ -1,443 +0,0 @@
1/*
2 * Compiz configuration system library
3 *
4 * Copyright (C) 2012 Canonical Ltd.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 * Authored By:
21 * Sam Spilsbury <sam.spilsbury@canonical.com>
22 */
23#include <gtest/gtest.h>
24#include <gmock/gmock.h>
25
26#include <map>
27#include <memory>
28#include <boost/shared_ptr.hpp>
29
30#include <glib_gslice_off_env.h>
31#include <gtest_shared_autodestroy.h>
32
33#include <ccs.h>
34#include <ccs-backend.h>
35#include <ccs_mate_integrated_setting.h>
36#include <ccs_mate_integration_gsettings_integrated_setting.h>
37#include <ccs_gsettings_wrapper_mock.h>
38
39using ::testing::Combine;
40using ::testing::Return;
41using ::testing::IsNull;
42using ::testing::ValuesIn;
43using ::testing::Values;
44using ::testing::Eq;
45using ::testing::WithArgs;
46using ::testing::_;
47
48namespace compiz
49{
50 namespace config
51 {
52 namespace integration
53 {
54 namespace test
55 {
56 const std::string KEYBINDING_ONE = "keybinding_one";
57 const std::string KEYBINDING_TWO = "keybinding_two";
58 const std::string STRING = "string";
59 const Bool BOOLEAN = TRUE;
60 const int INTEGER = 2;
61
62 const std::string STRING_ALT = "string_alt";
63 const Bool BOOLEAN_ALT = FALSE;
64 const int INTEGER_ALT = 1;
65
66 namespace variant_generators
67 {
68 GVariant * i ();
69 GVariant * s ();
70 GVariant * b ();
71 GVariant * as ();
72 GVariant * fromValue (CCSSettingValue *v, CCSSettingType type);
73 }
74
75 namespace value_generators
76 {
77 CCSSettingValue * integer ();
78 CCSSettingValue * string ();
79 CCSSettingValue * key ();
80 CCSSettingValue * boolean ();
81 }
82
83 namespace expectations
84 {
85 void integer (CCSSettingValue *);
86 void string (CCSSettingValue *);
87 void boolean (CCSSettingValue *);
88 void key (CCSSettingValue *);
89
90 void integerVariant (GVariant *, int);
91 void stringVariant (GVariant *, const std::string &);
92 void booleanVariant (GVariant *, bool);
93 void keyVariant (GVariant *, const std::string &);
94 }
95
96 typedef GVariant * (*VariantGenerator) ();
97 typedef CCSSettingValue * (*ValueGenerator) ();
98 typedef void (*Expectation) (CCSSettingValue *);
99
100 struct GSettingsIntegratedSettingInfo
101 {
102 VariantGenerator variantGenerator;
103 ValueGenerator valueGenerator;
104 Expectation expectation;
105 CCSSettingType settingType;
106 CCSSettingType returnType;
107 };
108
109 namespace impl
110 {
111 namespace ccit = compiz::config::integration::test;
112 namespace vg = compiz::config::integration::test::variant_generators;
113 namespace cvg = compiz::config::integration::test::value_generators;
114 namespace ex = compiz::config::integration::test::expectations;
115
116 ccit::GSettingsIntegratedSettingInfo settingsInfo[] =
117 {
118 { vg::i, cvg::integer, ex::integer, TypeInt, TypeInt },
119 { vg::b, cvg::boolean, ex::boolean, TypeBool, TypeBool },
120 { vg::s, cvg::string, ex::string, TypeString, TypeString },
121 { vg::as, cvg::key, ex::key, TypeKey, TypeString }
122 };
123 }
124 }
125 }
126 }
127}
128
129MATCHER_P (VariantEqual, lhs, "Variants Equal")
130{
131 return g_variant_equal (lhs, arg);
132}
133
134namespace
135{
136 std::map <CCSSettingType, SpecialOptionType> &
137 ccsTypeToSpecialType ()
138 {
139 static std::map <CCSSettingType, SpecialOptionType> types;
140 static bool initialized = false;
141
142 if (!initialized)
143 {
144 types[TypeInt] = OptionInt;
145 types[TypeBool] = OptionBool;
146 types[TypeString] = OptionString;
147 types[TypeKey] = OptionKey;
148 }
149
150 return types;
151 }
152}
153
154namespace ccit = compiz::config::integration::test;
155namespace cciti = compiz::config::integration::test::impl;
156namespace ccvg = compiz::config::integration::test::variant_generators;
157namespace ccvalg = compiz::config::integration::test::value_generators;
158namespace ccex = compiz::config::integration::test::expectations;
159
160typedef testing::tuple <CCSSettingType,
161 ccit::GSettingsIntegratedSettingInfo> CCSGSettingsIntegratedSettingTestInfo;
162
163class CCSGSettingsIntegratedSettingTest :
164 public ::testing::TestWithParam <CCSGSettingsIntegratedSettingTestInfo>
165{
166 public:
167
168 virtual void SetUp ();
169 virtual void TearDown ();
170
171 protected:
172
173 CompizGLibGSliceOffEnv env;
174 boost::shared_ptr <CCSGSettingsWrapper> mWrapper;
175 CCSGSettingsWrapperGMock *mWrapperMock;
176};
177
178GVariant *
179ccvg::fromValue (CCSSettingValue *v,
180 CCSSettingType type)
181{
182 switch (type)
183 {
184 case TypeInt:
185 return g_variant_new ("i", v->value.asInt);
186 break;
187 case TypeBool:
188 return g_variant_new ("b", v->value.asBool);
189 break;
190 case TypeString:
191 return g_variant_new ("s", v->value.asString);
192 break;
193 case TypeKey:
194 {
195 GVariantBuilder builder;
196 g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
197
198 /* Represented internally as strings */
199 std::string kb (v->value.asString);
200 if (kb == "Disabled")
201 kb[0] = 'd';
202
203 g_variant_builder_add (&builder, "s", kb.c_str ());
204 return g_variant_builder_end (&builder);
205 }
206 default:
207 break;
208 }
209
210 return NULL;
211}
212
213GVariant *
214ccvg::as ()
215{
216 GVariantBuilder builder;
217 g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
218 g_variant_builder_add (&builder, "s", ccit::KEYBINDING_ONE.c_str ());
219 g_variant_builder_add (&builder, "s", ccit::KEYBINDING_TWO.c_str ());
220
221 return g_variant_builder_end (&builder);
222}
223
224GVariant *
225ccvg::i ()
226{
227 return g_variant_new ("i", ccit::INTEGER);
228}
229
230GVariant *
231ccvg::b ()
232{
233 return g_variant_new ("b", ccit::BOOLEAN);
234}
235
236GVariant *
237ccvg::s ()
238{
239 return g_variant_new ("s", ccit::STRING.c_str ());
240}
241
242namespace
243{
244 CCSSettingValue * createSettingValue ()
245 {
246 CCSSettingValue *v = reinterpret_cast <CCSSettingValue *> (calloc (1, sizeof (CCSSettingValue)));
247
248 v->isListChild = FALSE;
249 v->parent = NULL;
250 v->refCount = 1;
251
252 return v;
253 }
254}
255
256CCSSettingValue *
257ccvalg::integer ()
258{
259 CCSSettingValue *v = createSettingValue ();
260 v->value.asInt = ccit::INTEGER_ALT;
261 return v;
262}
263
264CCSSettingValue *
265ccvalg::string ()
266{
267 CCSSettingValue *v = createSettingValue ();
268 v->value.asString = strdup (ccit::STRING_ALT.c_str ());
269 return v;
270}
271
272CCSSettingValue *
273ccvalg::key ()
274{
275 CCSSettingValue *v = createSettingValue ();
276 v->value.asString = strdup (ccit::KEYBINDING_TWO.c_str ());
277 return v;
278}
279
280CCSSettingValue *
281ccvalg::boolean ()
282{
283 CCSSettingValue *v = createSettingValue ();
284 v->value.asBool = ccit::BOOLEAN_ALT;
285 return v;
286}
287
288void
289ccex::boolean (CCSSettingValue *v)
290{
291 EXPECT_EQ (v->value.asBool, ccit::BOOLEAN);
292}
293
294void
295ccex::integer (CCSSettingValue *v)
296{
297 EXPECT_EQ (v->value.asInt, ccit::INTEGER);
298}
299
300void
301ccex::string (CCSSettingValue *v)
302{
303 EXPECT_EQ (v->value.asString, ccit::STRING);
304}
305
306void
307ccex::key (CCSSettingValue *v)
308{
309 EXPECT_EQ (v->value.asString, ccit::KEYBINDING_ONE);
310}
311
312void
313ccex::integerVariant (GVariant *v , int i)
314{
315 EXPECT_EQ (g_variant_get_int32 (v), i);
316}
317
318void
319ccex::stringVariant (GVariant *v, const std::string &s)
320{
321 gsize len;
322 EXPECT_EQ (g_variant_get_string (v, &len), s);
323}
324
325void
326ccex::booleanVariant (GVariant *v, bool b)
327{
328 EXPECT_EQ (g_variant_get_boolean (v), b);
329}
330
331void
332ccex::keyVariant (GVariant *v, const std::string &s)
333{
334 gsize len;
335 const gchar * const *strv = g_variant_get_strv (v, &len);
336 EXPECT_EQ (strv[0], s);
337}
338
339void
340CCSGSettingsIntegratedSettingTest::SetUp ()
341{
342 env.SetUpEnv ();
343 mWrapper.reset (ccsMockGSettingsWrapperNew (),
344 boost::bind (ccsMockGSettingsWrapperFree, _1));
345 mWrapperMock = reinterpret_cast <CCSGSettingsWrapperGMock *> (
346 ccsObjectGetPrivate (mWrapper.get ()));
347}
348
349void
350CCSGSettingsIntegratedSettingTest::TearDown ()
351{
352 mWrapper.reset ();
353 mWrapperMock = NULL;
354 env.TearDownEnv ();
355}
356
357TEST_P (CCSGSettingsIntegratedSettingTest, MatchedTypesReturnValueMismatchedTypesReturnNull)
358{
359 const std::string keyName ("mock");
360 const ccit::GSettingsIntegratedSettingInfo &integratedSettingInfo =
361 testing::get <1> (GetParam ());
362 const CCSSettingType createSettingType =
363 testing::get <0> (GetParam ());
364
365 /* The GSettings Integrated setting takes ownership of these */
366 CCSIntegratedSettingInfo *integratedSetting = ccsSharedIntegratedSettingInfoNew (keyName.c_str (),
367 keyName.c_str (),
368 integratedSettingInfo.settingType,
369 &ccsDefaultObjectAllocator);
370 SpecialOptionType specialType = ccsTypeToSpecialType ()[integratedSettingInfo.settingType];
371 CCSMATEIntegratedSettingInfo *mateIntegratedSetting = ccsMATEIntegratedSettingInfoNew (integratedSetting,
372 specialType,
373 keyName.c_str (),
374 &ccsDefaultObjectAllocator);
375 boost::shared_ptr <CCSIntegratedSetting> gsettingsIntegrated (AutoDestroy (ccsGSettingsIntegratedSettingNew (mateIntegratedSetting,
376 mWrapper.get (),
377 &ccsDefaultObjectAllocator),
378 ccsIntegratedSettingUnref));
379
380 GVariant *variant = (*integratedSettingInfo.variantGenerator) ();
381 EXPECT_CALL (*mWrapperMock, getValue (Eq (keyName))).WillOnce (Return (variant));
382
383 CCSSettingValue *value = ccsIntegratedSettingReadValue (gsettingsIntegrated.get (), createSettingType);
384
385 if (createSettingType == integratedSettingInfo.settingType)
386 (*integratedSettingInfo.expectation) (value);
387 else
388 EXPECT_THAT (value, IsNull ());
389
390 if (value)
391 ccsFreeSettingValueWithType (value, integratedSettingInfo.returnType);
392}
393
394ACTION (FreeVariant)
395{
396 g_variant_unref (arg0);
397}
398
399TEST_P (CCSGSettingsIntegratedSettingTest, MatchedTypesReturnValueMismatchedTypesResetOrWrite)
400{
401 const std::string keyName ("mock");
402 const ccit::GSettingsIntegratedSettingInfo &integratedSettingInfo =
403 testing::get <1> (GetParam ());
404 const CCSSettingType createSettingType =
405 testing::get <0> (GetParam ());
406
407 CCSIntegratedSettingInfo *integratedSetting = ccsSharedIntegratedSettingInfoNew (keyName.c_str (),
408 keyName.c_str (),
409 integratedSettingInfo.settingType,
410 &ccsDefaultObjectAllocator);
411 SpecialOptionType specialType = ccsTypeToSpecialType ()[integratedSettingInfo.settingType];
412 CCSMATEIntegratedSettingInfo *mateIntegratedSetting = ccsMATEIntegratedSettingInfoNew (integratedSetting,
413 specialType,
414 keyName.c_str (),
415 &ccsDefaultObjectAllocator);
416 boost::shared_ptr <CCSIntegratedSetting> gsettingsIntegrated (AutoDestroy (ccsGSettingsIntegratedSettingNew (mateIntegratedSetting,
417 mWrapper.get (),
418 &ccsDefaultObjectAllocator),
419 ccsIntegratedSettingUnref));
420
421 boost::shared_ptr <CCSSettingValue> value ((*integratedSettingInfo.valueGenerator) (),
422 boost::bind (ccsFreeSettingValueWithType,
423 _1,
424 integratedSettingInfo.returnType));
425 boost::shared_ptr <GVariant> variant = AutoDestroy (g_variant_ref ((*integratedSettingInfo.variantGenerator) ()),
426 g_variant_unref);
427 boost::shared_ptr <GVariant> newVariant = AutoDestroy (ccvg::fromValue (value.get (),
428 integratedSettingInfo.settingType),
429 g_variant_unref);
430 EXPECT_CALL (*mWrapperMock, getValue (Eq (keyName))).WillOnce (Return (variant.get ()));
431
432 if (createSettingType == integratedSettingInfo.settingType)
433 EXPECT_CALL (*mWrapperMock, setValue (Eq (keyName), VariantEqual (newVariant.get ())))
434 .WillOnce (WithArgs <1> (FreeVariant ()));
435 else
436 EXPECT_CALL (*mWrapperMock, resetKey (Eq (keyName)));
437
438 ccsIntegratedSettingWriteValue (gsettingsIntegrated.get (), value.get (), createSettingType);
439}
440
441INSTANTIATE_TEST_CASE_P (CCSGSettingsIntegratedSettingTestMismatchedValues, CCSGSettingsIntegratedSettingTest,
442 Combine (Values (TypeInt, TypeString, TypeBool, TypeKey),
443 ValuesIn (cciti::settingsInfo)));
4440
=== removed directory 'compizconfig/integration/mate/include'
=== removed file 'compizconfig/integration/mate/include/ccs_mate_fwd.h'
--- compizconfig/integration/mate/include/ccs_mate_fwd.h 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/include/ccs_mate_fwd.h 1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
1#ifndef _CCS_MATE_INTEGRATION_FWD_H
2#define _CCS_MATE_INTEGRATION_FWD_H
3
4#include <ccs-defs.h>
5
6COMPIZCONFIG_BEGIN_DECLS
7
8typedef struct _CCSMATEIntegratedSettingInfo CCSMATEIntegratedSettingInfo;
9typedef struct _CCSMATEValueChangeData CCSMATEValueChangeData;
10
11COMPIZCONFIG_END_DECLS
12
13#endif
140
=== removed file 'compizconfig/integration/mate/include/ccs_mate_integrated_setting.h'
--- compizconfig/integration/mate/include/ccs_mate_integrated_setting.h 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/include/ccs_mate_integrated_setting.h 1970-01-01 00:00:00 +0000
@@ -1,64 +0,0 @@
1#ifndef _CCS_MATE_INTEGRATED_SETTING_H
2#define _CCS_MATE_INTEGRATED_SETTING_H
3
4#include <ccs-defs.h>
5#include <ccs-fwd.h>
6#include <ccs_mate_fwd.h>
7
8#include "ccs_mate_integration_types.h"
9
10COMPIZCONFIG_BEGIN_DECLS
11
12typedef struct _CCSMATEIntegratedSettingInfoInterface CCSMATEIntegratedSettingInfoInterface;
13
14typedef SpecialOptionType (*CCSMATEIntegratedSettingInfoGetSpecialOptionType) (CCSMATEIntegratedSettingInfo *);
15typedef const char * (*CCSMATEIntegratedSettingInfoGetMATEName) (CCSMATEIntegratedSettingInfo *);
16typedef void (*CCSMATEIntegratedSettingInfoFree) (CCSMATEIntegratedSettingInfo *);
17
18struct _CCSMATEIntegratedSettingInfoInterface
19{
20 CCSMATEIntegratedSettingInfoGetSpecialOptionType getSpecialOptionType;
21 CCSMATEIntegratedSettingInfoGetMATEName getMATEName;
22 CCSMATEIntegratedSettingInfoFree free;
23};
24
25/**
26 * @brief The _CCSMATEIntegratedSetting struct
27 *
28 * CCSMATEIntegratedSetting represents an integrated setting in
29 * MATE - it builds upon CCSSharedIntegratedSetting (which it composes
30 * and implements) and also adds the concept of an MATE side keyname
31 * and option type for that keyname (as the types do not match 1-1)
32 */
33struct _CCSMATEIntegratedSettingInfo
34{
35 CCSObject object;
36};
37
38unsigned int ccsCCSMATEIntegratedSettingInfoInterfaceGetType ();
39
40Bool
41ccsMATEIntegrationFindSettingsMatchingPredicate (CCSIntegratedSetting *setting,
42 void *userData);
43
44SpecialOptionType
45ccsMATEIntegratedSettingInfoGetSpecialOptionType (CCSMATEIntegratedSettingInfo *);
46
47const char *
48ccsMATEIntegratedSettingInfoGetMATEName (CCSMATEIntegratedSettingInfo *);
49
50CCSMATEIntegratedSettingInfo *
51ccsMATEIntegratedSettingInfoNew (CCSIntegratedSettingInfo *base,
52 SpecialOptionType type,
53 const char *mateName,
54 CCSObjectAllocationInterface *ai);
55
56void
57ccsFreeMATEIntegratedSettingInfo (CCSMATEIntegratedSettingInfo *);
58
59CCSREF_HDR (MATEIntegratedSettingInfo, CCSMATEIntegratedSettingInfo);
60CCSLIST_HDR (MATEIntegratedSettingInfo, CCSMATEIntegratedSettingInfo);
61
62COMPIZCONFIG_END_DECLS
63
64#endif
650
=== removed file 'compizconfig/integration/mate/include/ccs_mate_integration.h'
--- compizconfig/integration/mate/include/ccs_mate_integration.h 2015-12-10 16:34:35 +0000
+++ compizconfig/integration/mate/include/ccs_mate_integration.h 1970-01-01 00:00:00 +0000
@@ -1,46 +0,0 @@
1#ifndef _CCS_COMPIZCONFIG_MATE_INTEGRATION
2#define _CCS_COMPIZCONFIG_MATE_INTEGRATION
3
4#include <ccs-defs.h>
5#include <ccs-fwd.h>
6#include <ccs_mate_fwd.h>
7#include "ccs_mate_integration_types.h"
8
9COMPIZCONFIG_BEGIN_DECLS
10
11struct _CCSMATEValueChangeData
12{
13 CCSIntegration *integration;
14 CCSIntegratedSettingsStorage *storage;
15 CCSIntegratedSettingFactory *factory;
16 CCSContext *context;
17};
18
19/**
20 * @brief ccsMATEIntegrationBackendNew
21 * @param backend
22 * @param context
23 * @param factory
24 * @param storage
25 * @param ai
26 * @return A new CCSIntegration
27 *
28 * The MATE implementation of desktop environment integration - requires
29 * a method to create new integrated settings, and a method to store them
30 * as well.
31 *
32 * CCSMATEIntegration is a pure composition in most respects - it just
33 * represents the process as to which settings should be written to
34 * what keys and vice versa, it doesn't represent how those keys should
35 * be written.
36 */
37CCSIntegration *
38ccsMATEIntegrationBackendNew (CCSBackend *backend,
39 CCSContext *context,
40 CCSIntegratedSettingFactory *factory,
41 CCSIntegratedSettingsStorage *storage,
42 CCSObjectAllocationInterface *ai);
43
44COMPIZCONFIG_END_DECLS
45
46#endif
470
=== removed file 'compizconfig/integration/mate/include/ccs_mate_integration_constants.h'
--- compizconfig/integration/mate/include/ccs_mate_integration_constants.h 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/include/ccs_mate_integration_constants.h 1970-01-01 00:00:00 +0000
@@ -1,217 +0,0 @@
1#ifndef _CCS_MATE_INTEGRATION_CONSTANTS_H
2#define _CCS_MATE_INTEGRATION_CONSTANTS_H
3
4#include <ccs-defs.h>
5#include <glib.h>
6
7COMPIZCONFIG_BEGIN_DECLS
8
9#include <ccs_mate_integration_types.h>
10
11#define METACITY "/apps/metacity"
12#define NUM_WATCHED_DIRS 3
13
14typedef struct _CCSSettingIntegratedSettingPair CCSSettingIntegratedSettingPair;
15struct _CCSSettingIntegratedSettingPair
16{
17 const char *compizName;
18 const char *mateName;
19};
20
21typedef struct _CCSMATEIntegratedSettingNames CCSMATEIntegratedSettingNames;
22struct _CCSMATEIntegratedSettingNames
23{
24 CCSSettingIntegratedSettingPair CORE_AUDIBLE_BELL;
25 CCSSettingIntegratedSettingPair CORE_CLICK_TO_FOCUS;
26 CCSSettingIntegratedSettingPair CORE_RAISE_ON_CLICK;
27 CCSSettingIntegratedSettingPair CORE_AUTORAISE_DELAY;
28 CCSSettingIntegratedSettingPair CORE_AUTORAISE;
29 CCSSettingIntegratedSettingPair THUMBNAIL_CURRENT_VIEWPORT;
30 CCSSettingIntegratedSettingPair MATECOMPAT_COMMAND_TERMINAL;
31 CCSSettingIntegratedSettingPair MATECOMPAT_COMMAND_WINDOW_SCREENSHOT;
32 CCSSettingIntegratedSettingPair MATECOMPAT_COMMAND_SCREENSHOT;
33 CCSSettingIntegratedSettingPair ROTATE_ROTATE_RIGHT_WINDOW_KEY;
34 CCSSettingIntegratedSettingPair ROTATE_ROTATE_LEFT_WINDOW_KEY;
35 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_12_WINDOW_KEY;
36 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_11_WINDOW_KEY;
37 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_10_WINDOW_KEY;
38 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_9_WINDOW_KEY;
39 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_8_WINDOW_KEY;
40 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_7_WINDOW_KEY;
41 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_6_WINDOW_KEY;
42 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_5_WINDOW_KEY;
43 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_4_WINDOW_KEY;
44 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_3_WINDOW_KEY;
45 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_2_WINDOW_KEY;
46 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_1_WINDOW_KEY;
47 CCSSettingIntegratedSettingPair PUT_PUT_BOTTOM_KEY;
48 CCSSettingIntegratedSettingPair PUT_PUT_TOP_KEY;
49 CCSSettingIntegratedSettingPair PUT_PUT_RIGHT_KEY;
50 CCSSettingIntegratedSettingPair PUT_PUT_LEFT_KEY;
51 CCSSettingIntegratedSettingPair PUT_PUT_BOTTOMRIGHT_KEY;
52 CCSSettingIntegratedSettingPair PUT_PUT_BOTTOMLEFT_KEY;
53 CCSSettingIntegratedSettingPair PUT_PUT_TOPRIGHT_KEY;
54 CCSSettingIntegratedSettingPair PUT_PUT_TOPLEFT_KEY;
55 CCSSettingIntegratedSettingPair WALL_DOWN_WINDOW_KEY;
56 CCSSettingIntegratedSettingPair WALL_UP_WINDOW_KEY;
57 CCSSettingIntegratedSettingPair WALL_RIGHT_WINDOW_KEY;
58 CCSSettingIntegratedSettingPair WALL_LEFT_WINDOW_KEY;
59 CCSSettingIntegratedSettingPair WALL_RIGHT_KEY;
60 CCSSettingIntegratedSettingPair WALL_LEFT_KEY;
61 CCSSettingIntegratedSettingPair WALL_DOWN_KEY;
62 CCSSettingIntegratedSettingPair WALL_UP_KEY;
63 CCSSettingIntegratedSettingPair VPSWITCH_SWITCH_TO_12_KEY;
64 CCSSettingIntegratedSettingPair VPSWITCH_SWITCH_TO_11_KEY;
65 CCSSettingIntegratedSettingPair VPSWITCH_SWITCH_TO_10_KEY;
66 CCSSettingIntegratedSettingPair VPSWITCH_SWITCH_TO_9_KEY;
67 CCSSettingIntegratedSettingPair VPSWITCH_SWITCH_TO_8_KEY;
68 CCSSettingIntegratedSettingPair VPSWITCH_SWITCH_TO_7_KEY;
69 CCSSettingIntegratedSettingPair VPSWITCH_SWITCH_TO_6_KEY;
70 CCSSettingIntegratedSettingPair VPSWITCH_SWITCH_TO_5_KEY;
71 CCSSettingIntegratedSettingPair VPSWITCH_SWITCH_TO_4_KEY;
72 CCSSettingIntegratedSettingPair VPSWITCH_SWITCH_TO_3_KEY;
73 CCSSettingIntegratedSettingPair VPSWITCH_SWITCH_TO_2_KEY;
74 CCSSettingIntegratedSettingPair VPSWITCH_SWITCH_TO_1_KEY;
75 CCSSettingIntegratedSettingPair ROTATE_ROTATE_RIGHT_KEY;
76 CCSSettingIntegratedSettingPair ROTATE_ROTATE_LEFT_KEY;
77 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_12_KEY;
78 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_11_KEY;
79 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_10_KEY;
80 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_9_KEY;
81 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_8_KEY;
82 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_7_KEY;
83 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_6_KEY;
84 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_5_KEY;
85 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_4_KEY;
86 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_3_KEY;
87 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_2_KEY;
88 CCSSettingIntegratedSettingPair ROTATE_ROTATE_TO_1_KEY;
89 CCSSettingIntegratedSettingPair COMMANDS_RUN_COMMAND11_KEY;
90 CCSSettingIntegratedSettingPair COMMANDS_RUN_COMMAND10_KEY;
91 CCSSettingIntegratedSettingPair COMMANDS_RUN_COMMAND9_KEY;
92 CCSSettingIntegratedSettingPair COMMANDS_RUN_COMMAND8_KEY;
93 CCSSettingIntegratedSettingPair COMMANDS_RUN_COMMAND7_KEY;
94 CCSSettingIntegratedSettingPair COMMANDS_RUN_COMMAND6_KEY;
95 CCSSettingIntegratedSettingPair COMMANDS_RUN_COMMAND5_KEY;
96 CCSSettingIntegratedSettingPair COMMANDS_RUN_COMMAND4_KEY;
97 CCSSettingIntegratedSettingPair COMMANDS_RUN_COMMAND3_KEY;
98 CCSSettingIntegratedSettingPair COMMANDS_RUN_COMMAND2_KEY;
99 CCSSettingIntegratedSettingPair COMMANDS_RUN_COMMAND1_KEY;
100 CCSSettingIntegratedSettingPair COMMANDS_RUN_COMMAND0_KEY;
101 CCSSettingIntegratedSettingPair COMMANDS_COMMAND11;
102 CCSSettingIntegratedSettingPair COMMANDS_COMMAND10;
103 CCSSettingIntegratedSettingPair COMMANDS_COMMAND9;
104 CCSSettingIntegratedSettingPair COMMANDS_COMMAND8;
105 CCSSettingIntegratedSettingPair COMMANDS_COMMAND7;
106 CCSSettingIntegratedSettingPair COMMANDS_COMMAND6;
107 CCSSettingIntegratedSettingPair COMMANDS_COMMAND5;
108 CCSSettingIntegratedSettingPair COMMANDS_COMMAND4;
109 CCSSettingIntegratedSettingPair COMMANDS_COMMAND3;
110 CCSSettingIntegratedSettingPair COMMANDS_COMMAND2;
111 CCSSettingIntegratedSettingPair COMMANDS_COMMAND1;
112 CCSSettingIntegratedSettingPair COMMANDS_COMMAND0;
113 CCSSettingIntegratedSettingPair EXTRAWM_TOGGLE_FULLSCREEN_KEY;
114 CCSSettingIntegratedSettingPair EXTRAWM_TOGGLE_STICKY_KEY;
115 CCSSettingIntegratedSettingPair STATICSWITCHER_PREV_KEY;
116 CCSSettingIntegratedSettingPair STATICSWITCHER_NEXT_KEY;
117 CCSSettingIntegratedSettingPair FADE_FULLSCREEN_VISUAL_BELL;
118 CCSSettingIntegratedSettingPair FADE_VISUAL_BELL;
119 CCSSettingIntegratedSettingPair NULL_RESIZE_WITH_RIGHT_BUTTON;
120 CCSSettingIntegratedSettingPair NULL_MOUSE_BUTTON_MODIFIER;
121 CCSSettingIntegratedSettingPair CORE_WINDOW_MENU_BUTTON;
122 CCSSettingIntegratedSettingPair RESIZE_INITIATE_BUTTON;
123 CCSSettingIntegratedSettingPair MOVE_INITIATE_BUTTON;
124 CCSSettingIntegratedSettingPair CORE_WINDOW_MENU_KEY;
125 CCSSettingIntegratedSettingPair RESIZE_INITIATE_KEY;
126 CCSSettingIntegratedSettingPair MOVE_INITIATE_KEY;
127 CCSSettingIntegratedSettingPair CORE_SHOW_DESKTOP_KEY;
128 CCSSettingIntegratedSettingPair CORE_TOGGLE_WINDOW_SHADED_KEY;
129 CCSSettingIntegratedSettingPair CORE_CLOSE_WINDOW_KEY;
130 CCSSettingIntegratedSettingPair CORE_LOWER_WINDOW_KEY;
131 CCSSettingIntegratedSettingPair CORE_RAISE_WINDOW_KEY;
132 CCSSettingIntegratedSettingPair CORE_MAXIMIZE_WINDOW_VERTICALLY_KEY;
133 CCSSettingIntegratedSettingPair CORE_MAXIMIZE_WINDOW_HORIZONTALLY_KEY;
134 CCSSettingIntegratedSettingPair CORE_UNMAXIMIZE_OR_MINIMIZE_WINDOW_KEY;
135 CCSSettingIntegratedSettingPair CORE_MAXIMIZE_WINDOW_KEY;
136 CCSSettingIntegratedSettingPair CORE_MINIMIZE_WINDOW_KEY;
137 CCSSettingIntegratedSettingPair CORE_TOGGLE_WINDOW_MAXIMIZED_KEY;
138 CCSSettingIntegratedSettingPair MATECOMPAT_RUN_COMMAND_TERMINAL_KEY;
139 CCSSettingIntegratedSettingPair MATECOMPAT_RUN_COMMAND_WINDOW_SCREENSHOT_KEY;
140 CCSSettingIntegratedSettingPair MATECOMPAT_RUN_COMMAND_SCREENSHOT_KEY;
141 CCSSettingIntegratedSettingPair MATECOMPAT_MAIN_MENU_KEY;
142 CCSSettingIntegratedSettingPair MATECOMPAT_RUN_KEY;
143};
144
145extern const CCSMATEIntegratedSettingNames ccsMATEIntegratedSettingNames;
146
147typedef struct _CCSGConfIntegrationCategoires CCSGConfIntegrationCategories;
148
149struct _CCSGConfIntegrationCategoires
150{
151 const char *GENERAL;
152 const char *APPS;
153 const char *DESKTOP;
154 const char *KEYBINDING_COMMANDS;
155 const char *WINDOW_KEYBINDINGS;
156 const char *GLOBAL_KEYBINDINGS;
157};
158
159extern const CCSGConfIntegrationCategories ccsGConfIntegrationCategories;
160
161typedef struct _CCSMATEIntegratedPluginNames CCSMATEIntegratedPluginNames;
162
163struct _CCSMATEIntegratedPluginNames
164{
165 const char *CORE;
166 const char *THUMBNAIL;
167 const char *MATECOMPAT;
168 const char *ROTATE;
169 const char *PUT;
170 const char *WALL;
171 const char *VPSWITCH;
172 const char *COMMANDS;
173 const char *EXTRAWM;
174 const char *RESIZE;
175 const char *MOVE;
176 const char *STATICSWITCHER;
177 const char *FADE;
178 const char *SPECIAL;
179};
180
181extern const CCSMATEIntegratedPluginNames ccsMATEIntegratedPluginNames;
182
183extern const char* watchedGConfMateDirectories[];
184
185typedef struct _CCSGSettingsWrapperIntegratedSchemasQuarks
186{
187 GQuark ORG_MATE_DESKTOP_WM_PREFERENCES;
188 GQuark ORG_MATE_DESKTOP_WM_KEYBINDINGS;
189 GQuark ORG_MATE_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS;
190 GQuark ORG_MATE_DESKTOP_DEFAULT_APPLICATIONS_TERMINAL;
191 GQuark ORG_COMPIZ_INTEGRATED;
192} CCSGSettingsWrapperIntegratedSchemasQuarks;
193
194const CCSGSettingsWrapperIntegratedSchemasQuarks *ccsMATEGSettingsWrapperQuarks ();
195
196GHashTable * ccsMATEIntegrationPopulateCategoriesHashTables ();
197GHashTable * ccsMATEIntegrationPopulateSpecialTypesHashTables ();
198GHashTable * ccsMATEIntegrationPopulateSettingNameToMATENameHashTables ();
199GHashTable * ccsMATEGSettingsIntegrationPopulateSettingNameToIntegratedSchemasQuarksHashTable ();
200
201/* We only have to use the #define here because
202 * C doesn't have a concept of "constants" setting
203 * the array size ...
204 */
205#define CCS_MATE_INTEGRATED_SETTINGS_LIST_SIZE 120
206
207typedef struct _CCSMATEIntegratedSettingsList
208{
209 const char *pluginName;
210 const char *settingName;
211} CCSMATEIntegratedSettingsList;
212
213const CCSMATEIntegratedSettingsList * ccsMATEIntegratedSettingsList ();
214
215COMPIZCONFIG_END_DECLS
216
217#endif
2180
=== removed file 'compizconfig/integration/mate/include/ccs_mate_integration_types.h'
--- compizconfig/integration/mate/include/ccs_mate_integration_types.h 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/include/ccs_mate_integration_types.h 1970-01-01 00:00:00 +0000
@@ -1,19 +0,0 @@
1#ifndef _CCS_MATE_INTEGRATION_TYPES_H
2#define _CCS_MATE_INTEGRATION_TYPES_H
3
4#include <ccs-defs.h>
5
6COMPIZCONFIG_BEGIN_DECLS
7
8typedef enum {
9 OptionInt,
10 OptionBool,
11 OptionKey,
12 OptionString,
13 OptionSpecial,
14} SpecialOptionType;
15
16COMPIZCONFIG_END_DECLS
17
18#endif
19
200
=== removed directory 'compizconfig/integration/mate/src'
=== removed file 'compizconfig/integration/mate/src/ccs_mate_integrated_setting.c'
--- compizconfig/integration/mate/src/ccs_mate_integrated_setting.c 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/src/ccs_mate_integrated_setting.c 1970-01-01 00:00:00 +0000
@@ -1,161 +0,0 @@
1#include <stdlib.h>
2#include <string.h>
3
4#include <glib.h>
5
6#include <ccs.h>
7#include <ccs-backend.h>
8#include <ccs-object.h>
9
10#include "ccs_mate_integrated_setting.h"
11#include "ccs_mate_integration_constants.h"
12
13INTERFACE_TYPE (CCSMATEIntegratedSettingInfoInterface);
14
15CCSREF_OBJ (MATEIntegratedSettingInfo, CCSMATEIntegratedSettingInfo);
16
17SpecialOptionType
18ccsMATEIntegratedSettingInfoGetSpecialOptionType (CCSMATEIntegratedSettingInfo *info)
19{
20 return (*(GET_INTERFACE (CCSMATEIntegratedSettingInfoInterface, info))->getSpecialOptionType) (info);
21}
22
23const char *
24ccsMATEIntegratedSettingInfoGetMATEName (CCSMATEIntegratedSettingInfo *info)
25{
26 return (*(GET_INTERFACE (CCSMATEIntegratedSettingInfoInterface, info))->getMATEName) (info);
27}
28
29/* CCSMATEIntegratedSettingDefaultImpl implementation */
30
31typedef struct _CCSMATEIntegratedSettingInfoDefaultImplPrivate CCSMATEIntegratedSettingInfoDefaultImplPrivate;
32
33struct _CCSMATEIntegratedSettingInfoDefaultImplPrivate
34{
35 SpecialOptionType type;
36 const char *mateName;
37 CCSIntegratedSettingInfo *sharedIntegratedSettingInfo;
38};
39
40Bool
41ccsMATEIntegrationFindSettingsMatchingPredicate (CCSIntegratedSetting *setting,
42 void *userData)
43{
44 const char *findMateName = (const char *) userData;
45 const char *mateNameOfSetting = ccsMATEIntegratedSettingInfoGetMATEName ((CCSMATEIntegratedSettingInfo *) setting);
46
47 if (strcmp (findMateName, mateNameOfSetting) == 0)
48 return TRUE;
49
50 return FALSE;
51}
52
53SpecialOptionType
54ccsMATEIntegratedSettingGetSpecialOptionDefault (CCSMATEIntegratedSettingInfo *info)
55{
56 CCSMATEIntegratedSettingInfoDefaultImplPrivate *priv = (CCSMATEIntegratedSettingInfoDefaultImplPrivate *) ccsObjectGetPrivate (info);
57
58 return priv->type;
59}
60
61const char *
62ccsMATEIntegratedSettingGetMATENameDefault (CCSMATEIntegratedSettingInfo *info)
63{
64 CCSMATEIntegratedSettingInfoDefaultImplPrivate *priv = (CCSMATEIntegratedSettingInfoDefaultImplPrivate *) ccsObjectGetPrivate (info);
65
66 return priv->mateName;
67}
68
69const char *
70ccsMATEIntegratedSettingInfoPluginName (CCSIntegratedSettingInfo *info)
71{
72 CCSMATEIntegratedSettingInfoDefaultImplPrivate *priv = (CCSMATEIntegratedSettingInfoDefaultImplPrivate *) ccsObjectGetPrivate (info);
73
74 return ccsIntegratedSettingInfoPluginName (priv->sharedIntegratedSettingInfo);
75}
76
77const char *
78ccsMATEIntegratedSettingInfoSettingName (CCSIntegratedSettingInfo *info)
79{
80 CCSMATEIntegratedSettingInfoDefaultImplPrivate *priv = (CCSMATEIntegratedSettingInfoDefaultImplPrivate *) ccsObjectGetPrivate (info);
81
82 return ccsIntegratedSettingInfoSettingName (priv->sharedIntegratedSettingInfo);
83}
84
85CCSSettingType
86ccsMATEIntegratedSettingInfoGetType (CCSIntegratedSettingInfo *info)
87{
88 CCSMATEIntegratedSettingInfoDefaultImplPrivate *priv = (CCSMATEIntegratedSettingInfoDefaultImplPrivate *) ccsObjectGetPrivate (info);
89
90 return ccsIntegratedSettingInfoGetType (priv->sharedIntegratedSettingInfo);
91}
92
93void
94ccsMATESharedIntegratedSettingInfoFree (CCSIntegratedSettingInfo *info)
95{
96 CCSMATEIntegratedSettingInfoDefaultImplPrivate *priv = (CCSMATEIntegratedSettingInfoDefaultImplPrivate *) ccsObjectGetPrivate (info);
97
98 ccsIntegratedSettingInfoUnref (priv->sharedIntegratedSettingInfo);
99 ccsObjectFinalize (info);
100
101 (*info->object.object_allocation->free_) (info->object.object_allocation->allocator, info);
102}
103
104static void
105ccsMATEIntegratedSettingInfoFree (CCSMATEIntegratedSettingInfo *info)
106{
107 ccsMATESharedIntegratedSettingInfoFree ((CCSIntegratedSettingInfo *) info);
108}
109
110CCSMATEIntegratedSettingInfoInterface ccsMATEIntegratedSettingInfoDefaultImplInterface =
111{
112 ccsMATEIntegratedSettingGetSpecialOptionDefault,
113 ccsMATEIntegratedSettingGetMATENameDefault,
114 ccsMATEIntegratedSettingInfoFree
115};
116
117const CCSIntegratedSettingInfoInterface ccsMATEIntegratedSettingInfoInterface =
118{
119 ccsMATEIntegratedSettingInfoPluginName,
120 ccsMATEIntegratedSettingInfoSettingName,
121 ccsMATEIntegratedSettingInfoGetType,
122 ccsMATESharedIntegratedSettingInfoFree
123};
124
125void
126ccsFreeMATEIntegratedSettingInfo (CCSMATEIntegratedSettingInfo *info)
127{
128 (*(GET_INTERFACE (CCSMATEIntegratedSettingInfoInterface, info))->free) (info);
129}
130
131CCSMATEIntegratedSettingInfo *
132ccsMATEIntegratedSettingInfoNew (CCSIntegratedSettingInfo *base,
133 SpecialOptionType type,
134 const char *mateName,
135 CCSObjectAllocationInterface *ai)
136{
137 CCSMATEIntegratedSettingInfo *info = (*ai->calloc_) (ai->allocator, 1, sizeof (CCSMATEIntegratedSettingInfo));
138
139 if (!info)
140 return NULL;
141
142 CCSMATEIntegratedSettingInfoDefaultImplPrivate *priv = (*ai->calloc_) (ai->allocator, 1, sizeof (CCSMATEIntegratedSettingInfoDefaultImplPrivate));
143
144 if (!priv)
145 {
146 (*ai->free_) (ai->allocator, info);
147 return NULL;
148 }
149
150 priv->sharedIntegratedSettingInfo = base;
151 priv->mateName = mateName;
152 priv->type = type;
153
154 ccsObjectInit (info, ai);
155 ccsObjectSetPrivate (info, (CCSPrivate *) priv);
156 ccsObjectAddInterface (info, (const CCSInterface *) &ccsMATEIntegratedSettingInfoInterface, GET_INTERFACE_TYPE (CCSIntegratedSettingInfoInterface));
157 ccsObjectAddInterface (info, (const CCSInterface *) &ccsMATEIntegratedSettingInfoDefaultImplInterface, GET_INTERFACE_TYPE (CCSMATEIntegratedSettingInfoInterface));
158 ccsIntegratedSettingInfoRef ((CCSIntegratedSettingInfo *) info);
159
160 return info;
161}
1620
=== removed file 'compizconfig/integration/mate/src/ccs_mate_integration.c'
--- compizconfig/integration/mate/src/ccs_mate_integration.c 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/src/ccs_mate_integration.c 1970-01-01 00:00:00 +0000
@@ -1,815 +0,0 @@
1/**
2 *
3 * compizconfig mate integration backend
4 *
5 * mate-integration.c
6 *
7 * Copyright (c) 2011 Canonical Ltd
8 *
9 * Based on the original compizconfig-backend-gconf
10 *
11 * Copyright (c) 2007 Danny Baumann <maniac@opencompositing.org>
12 *
13 * Parts of this code are taken from libberylsettings
14 * gconf backend, written by:
15 *
16 * Copyright (c) 2006 Robert Carr <racarr@opencompositing.org>
17 * Copyright (c) 2007 Dennis Kasprzyk <onestone@opencompositing.org>
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
28 *
29 * Authored By:
30 * Sam Spilsbury <sam.spilsbury@canonical.com>
31 *
32 **/
33#include <stdlib.h>
34#include <string.h>
35#include <ccs.h>
36#include <ccs-backend.h>
37#include <ccs-object.h>
38#include <gio/gio.h>
39#include "ccs_mate_integration.h"
40#include "ccs_mate_integration_constants.h"
41#include "ccs_mate_integrated_setting.h"
42
43typedef struct _CCSMATEIntegrationBackendPrivate CCMATEIntegrationBackendPrivate;
44
45struct _CCSMATEIntegrationBackendPrivate
46{
47 CCSBackend *backend;
48 CCSContext *context;
49 CCSIntegratedSettingFactory *factory;
50 CCSIntegratedSettingsStorage *storage;
51 Bool noWrites;
52};
53
54static CCSSetting *
55findDisplaySettingForPlugin (CCSContext *context,
56 const char *plugin,
57 const char *setting)
58{
59 CCSPlugin *p;
60 CCSSetting *s;
61
62 p = ccsFindPlugin (context, plugin);
63 if (!p)
64 return NULL;
65
66 s = ccsFindSetting (p, setting);
67 if (!s)
68 return NULL;
69
70 return s;
71}
72
73static void
74unregisterAllIntegratedOptions (CCSIntegration *integration)
75{
76 CCMATEIntegrationBackendPrivate *priv = (CCMATEIntegrationBackendPrivate *) ccsObjectGetPrivate (integration);
77
78 if (priv->storage)
79 ccsIntegratedSettingsStorageUnref (priv->storage);
80
81 if (priv->factory)
82 ccsIntegratedSettingFactoryUnref (priv->factory);
83
84 priv->storage = NULL;
85 priv->factory = NULL;
86}
87
88static void
89registerAllIntegratedOptions (CCSIntegration *integration)
90{
91 CCMATEIntegrationBackendPrivate *priv = (CCMATEIntegrationBackendPrivate *) ccsObjectGetPrivate (integration);
92
93 unsigned int i = 0;
94 const CCSMATEIntegratedSettingsList *array = ccsMATEIntegratedSettingsList ();
95
96 for (; i < CCS_MATE_INTEGRATED_SETTINGS_LIST_SIZE; ++i)
97 {
98 CCSIntegratedSetting *setting = ccsIntegratedSettingFactoryCreateIntegratedSettingForCCSSettingNameAndType (priv->factory,
99 integration,
100 array[i].pluginName,
101 array[i].settingName,
102 TypeInt);
103
104 ccsIntegratedSettingsStorageAddSetting (priv->storage, setting);
105 }
106}
107
108static CCSIntegratedSetting *
109ccsMATEIntegrationBackendGetIntegratedSetting (CCSIntegration *integration,
110 const char *pluginName,
111 const char *settingName)
112{
113 CCMATEIntegrationBackendPrivate *priv = (CCMATEIntegrationBackendPrivate *) ccsObjectGetPrivate (integration);
114
115 if (ccsIntegratedSettingsStorageEmpty (priv->storage))
116 registerAllIntegratedOptions (integration);
117
118 CCSIntegratedSettingList integratedSettings = ccsIntegratedSettingsStorageFindMatchingSettingsByPluginAndSettingName (priv->storage,
119 pluginName,
120 settingName);
121
122 if (integratedSettings)
123 {
124 /* At the moment, we only support the first setting out of
125 * the list. Assert the returned size is one */
126 g_assert (ccsIntegratedSettingListLength (integratedSettings) == 1);
127
128 CCSIntegratedSetting *integratedSetting = integratedSettings->data;
129 ccsIntegratedSettingListFree (integratedSettings, FALSE);
130
131 return integratedSetting;
132 }
133
134 return NULL;
135}
136
137static unsigned int
138getMateMouseButtonModifier (CCSIntegratedSetting *mouseButtonModifierSetting)
139{
140 unsigned int modMask = 0;
141 CCSSettingType type = TypeString;
142 CCSSettingValue *v = ccsIntegratedSettingReadValue (mouseButtonModifierSetting, type);
143
144 if (v)
145 {
146 modMask = ccsStringToModifiers (v->value.asString);
147
148 ccsFreeSettingValueWithType (v, type);
149 }
150
151 return modMask;
152}
153
154static unsigned int
155getButtonBindingForSetting (CCSContext *context,
156 const char *plugin,
157 const char *setting)
158{
159 CCSSetting *s;
160
161 s = findDisplaySettingForPlugin (context, plugin, setting);
162 if (!s)
163 return 0;
164
165 if (ccsSettingGetType (s) != TypeButton)
166 return 0;
167
168 return ccsSettingGetValue (s)->value.asButton.button;
169}
170
171static Bool
172ccsMATEIntegrationBackendReadISAndSetSettingForType (CCSIntegratedSetting *integratedSetting,
173 CCSSetting *setting,
174 CCSSettingValue **v,
175 CCSSettingType sourceType,
176 CCSSettingType destinationType)
177{
178 *v = ccsIntegratedSettingReadValue (integratedSetting, sourceType);
179
180 if (*v != NULL && (*v)->value.asString)
181 {
182 /* Conversion to key type option necessary */
183 if (destinationType == TypeKey)
184 {
185 CCSSettingKeyValue key;
186
187 memset (&key, 0, sizeof (CCSSettingKeyValue));
188 if (ccsStringToKeyBinding ((*v)->value.asString, &key))
189 {
190 /* Since we effectively change the type of the value here
191 * we need to free the old string value */
192 free ((*v)->value.asString);
193 ccsSetKey (setting, key, TRUE);
194 return TRUE;
195 }
196 else
197 {
198 /* We were not successful at converting strings to keybindings
199 * but we must free the string value anyways as we present
200 * this value to ccsSettingValueFreeWithType as a TypeKey
201 * intentionally made empty */
202 free ((*v)->value.asString);
203 return FALSE;
204 }
205 }
206 return TRUE;
207 }
208
209 return FALSE;
210}
211
212static Bool
213ccsMATEIntegrationBackendReadOptionIntoSetting (CCSIntegration *integration,
214 CCSContext *context,
215 CCSSetting *setting,
216 CCSIntegratedSetting *integratedSetting)
217{
218 Bool ret = FALSE;
219 CCSSettingValue *v = NULL;
220 CCSSettingType type = TypeNum;
221
222 CCMATEIntegrationBackendPrivate *priv = (CCMATEIntegrationBackendPrivate *) ccsObjectGetPrivate (integration);
223
224 if (ccsIntegratedSettingsStorageEmpty (priv->storage))
225 registerAllIntegratedOptions (integration);
226
227 if (!ccsSettingIsReadableByBackend (setting))
228 return FALSE;
229
230 switch (ccsMATEIntegratedSettingInfoGetSpecialOptionType ((CCSMATEIntegratedSettingInfo *) integratedSetting)) {
231 case OptionInt:
232 {
233 type = TypeInt;
234 v = ccsIntegratedSettingReadValue (integratedSetting, type);
235 if (!v)
236 break;
237 ccsSetInt (setting, v->value.asInt, TRUE);
238 ret = TRUE;
239 }
240 break;
241 case OptionBool:
242 {
243 type = TypeBool;
244 v = ccsIntegratedSettingReadValue (integratedSetting, type);
245 if (!v)
246 break;
247 ccsSetBool (setting, v->value.asBool, TRUE);
248 ret = TRUE;
249 }
250 break;
251 case OptionString:
252 {
253 type = TypeString;
254 v = ccsIntegratedSettingReadValue (integratedSetting, type);
255 if (!v)
256 break;
257 char *str = v->value.asString;
258
259 ccsSetString (setting, str, TRUE);
260 ret = TRUE;
261 }
262 break;
263 case OptionKey:
264 {
265 /* Some backends store keys differently so we need to let the backend know
266 * that we really intend to read a key and let it handle the conversion */
267 type = TypeKey;
268 if (ccsMATEIntegrationBackendReadISAndSetSettingForType (integratedSetting,
269 setting,
270 &v,
271 TypeKey,
272 type))
273 ret = TRUE;
274 }
275 break;
276 case OptionSpecial:
277 {
278 const char *settingName = ccsSettingGetName (setting);
279 const char *pluginName = ccsPluginGetName (ccsSettingGetParent (setting));
280
281 if (strcmp (settingName, "current_viewport") == 0)
282 {
283 type = TypeBool;
284 v = ccsIntegratedSettingReadValue (integratedSetting, type);
285
286 if (!v)
287 break;
288
289 Bool showAll = v->value.asBool;
290 ccsSetBool (setting, !showAll, TRUE);
291 ret = TRUE;
292 }
293 else if (strcmp (settingName, "fullscreen_visual_bell") == 0)
294 {
295 type = TypeString;
296 v = ccsIntegratedSettingReadValue (integratedSetting, type);
297 if (!v)
298 break;
299
300 const char *value = v->value.asString;
301 if (value)
302 {
303 Bool fullscreen;
304
305 fullscreen = strcmp (value, "fullscreen") == 0;
306 ccsSetBool (setting, fullscreen, TRUE);
307 ret = TRUE;
308 }
309 }
310 else if (strcmp (settingName, "click_to_focus") == 0)
311 {
312 type = TypeString;
313 v = ccsIntegratedSettingReadValue (integratedSetting, type);
314 if (!v)
315 break;
316
317 const char *focusMode = v->value.asString;
318
319 if (focusMode)
320 {
321 Bool clickToFocus = (strcmp (focusMode, "click") == 0);
322 ccsSetBool (setting, clickToFocus, TRUE);
323 ret = TRUE;
324 }
325 }
326 else if ((strcmp (settingName, "run_command_screenshot_key") == 0 ||
327 strcmp (settingName, "run_command_window_screenshot_key") == 0 ||
328 strcmp (settingName, "run_command_terminal_key") == 0))
329 {
330 /* These are always stored as strings, no matter what the backend is
331 * so the source type should be string */
332 type = TypeKey;
333 if (ccsMATEIntegrationBackendReadISAndSetSettingForType (integratedSetting,
334 setting,
335 &v,
336 TypeString,
337 type))
338 ret = TRUE;
339 }
340 else if (((strcmp (settingName, "initiate_button") == 0) &&
341 ((strcmp (pluginName, "move") == 0) ||
342 (strcmp (pluginName, "resize") == 0))) ||
343 ((strcmp (settingName, "window_menu_button") == 0) &&
344 (strcmp (pluginName, "core") == 0)))
345 {
346 gboolean resizeWithRightButton;
347 CCSSettingButtonValue button;
348
349 memset (&button, 0, sizeof (CCSSettingButtonValue));
350 ccsGetButton (setting, &button);
351
352 CCSIntegratedSettingList mouseModifierSetting =
353 ccsIntegratedSettingsStorageFindMatchingSettingsByPluginAndSettingName (priv->storage,
354 ccsMATEIntegratedPluginNames.SPECIAL,
355 ccsMATEIntegratedSettingNames.NULL_MOUSE_BUTTON_MODIFIER.compizName);
356
357 button.buttonModMask = getMateMouseButtonModifier (mouseModifierSetting->data);
358
359 CCSIntegratedSettingList resizeButtonSetting =
360 ccsIntegratedSettingsStorageFindMatchingSettingsByPluginAndSettingName (priv->storage,
361 ccsMATEIntegratedPluginNames.SPECIAL,
362 ccsMATEIntegratedSettingNames.NULL_RESIZE_WITH_RIGHT_BUTTON.compizName);
363
364 type = TypeBool;
365 v = ccsIntegratedSettingReadValue (resizeButtonSetting->data, type);
366
367 resizeWithRightButton =
368 v->value.asBool;
369
370 if (strcmp (settingName, "window_menu_button") == 0)
371 button.button = resizeWithRightButton ? 2 : 3;
372 else if (strcmp (pluginName, "resize") == 0)
373 button.button = resizeWithRightButton ? 3 : 2;
374 else
375 button.button = 1;
376
377 ccsSetButton (setting, button, TRUE);
378 ret = TRUE;
379
380 /* Free the returned lists */
381 ccsIntegratedSettingListFree (mouseModifierSetting, FALSE);
382 ccsIntegratedSettingListFree (resizeButtonSetting, FALSE);
383 }
384
385 }
386 break;
387 default:
388 break;
389 }
390
391 if (v)
392 ccsFreeSettingValueWithType (v, type);
393
394 return ret;
395}
396
397static Bool
398setMateMouseButtonModifier (CCSIntegratedSetting *setting,
399 unsigned int modMask)
400{
401 char *modifiers;
402 CCSSettingValue *v = calloc (1, sizeof (CCSSettingValue));
403
404 v->isListChild = FALSE;
405 v->parent = NULL;
406 v->refCount = 1;
407
408 modifiers = ccsModifiersToString (modMask);
409 if (!modifiers)
410 {
411 ccsFreeSettingValueWithType (v, TypeString);
412 return FALSE;
413 }
414
415 v->value.asString = modifiers;
416 ccsIntegratedSettingWriteValue (setting, v, TypeString);
417
418 ccsFreeSettingValueWithType (v, TypeString);
419
420 return TRUE;
421}
422
423static void
424setButtonBindingForSetting (CCSContext *context,
425 const char *plugin,
426 const char *setting,
427 unsigned int button,
428 unsigned int buttonModMask)
429{
430 CCSSetting *s;
431
432 s = findDisplaySettingForPlugin (context, plugin, setting);
433 if (!s)
434 return;
435
436 if (ccsSettingGetType (s) != TypeButton)
437 return;
438
439 CCSSettingButtonValue value = ccsSettingGetValue (s)->value.asButton;
440
441 if ((value.button != button) || (value.buttonModMask != buttonModMask))
442 {
443 value.button = button;
444 value.buttonModMask = buttonModMask;
445
446 ccsSetButton (s, value, TRUE);
447 }
448}
449
450static Bool
451ccsMATEIntegrationBackendKeyValueToStringValue (CCSSettingValue *keyValue,
452 CCSSettingValue *stringValue)
453{
454 char *newValue;
455
456 newValue = ccsKeyBindingToString (&keyValue->value.asKey);
457 if (newValue)
458 {
459 if (strcmp (newValue, "Disabled") == 0)
460 {
461 /* Metacity doesn't like "Disabled", it wants "disabled" */
462 newValue[0] = 'd';
463 }
464
465 stringValue->value.asString = newValue;
466
467 return TRUE;
468 }
469
470 return FALSE;
471}
472
473static void
474ccsMATEIntegrationBackendWriteOptionFromSetting (CCSIntegration *integration,
475 CCSContext *context,
476 CCSSetting *setting,
477 CCSIntegratedSetting *integratedSetting)
478{
479 GError *err = NULL;
480 CCSSettingType type = TypeNum;
481
482 CCMATEIntegrationBackendPrivate *priv = (CCMATEIntegrationBackendPrivate *) ccsObjectGetPrivate (integration);
483
484 if (ccsIntegratedSettingsStorageEmpty (priv->storage))
485 registerAllIntegratedOptions (integration);
486
487 if (priv->noWrites)
488 return;
489
490 /* Do not allow recursing back into writeIntegratedSetting */
491 ccsIntegrationDisallowIntegratedWrites (integration);
492
493 CCSSettingType sType = ccsSettingGetType (setting);
494 CCSSettingInfo *sInfo = ccsSettingGetInfo (setting);
495
496 CCSSettingValue *vSetting = ccsSettingGetValue (setting);
497 CCSSettingValue *v = ccsCopyValue (vSetting, sType, sInfo);
498
499 if (!v)
500 return;
501
502 switch (ccsMATEIntegratedSettingInfoGetSpecialOptionType ((CCSMATEIntegratedSettingInfo *) integratedSetting))
503 {
504 case OptionInt:
505 ccsIntegratedSettingWriteValue (integratedSetting, v, TypeInt);
506 break;
507 case OptionBool:
508 ccsIntegratedSettingWriteValue (integratedSetting, v, TypeBool);
509 break;
510 case OptionString:
511 ccsIntegratedSettingWriteValue (integratedSetting, v, TypeString);
512 break;
513 case OptionKey:
514 {
515 CCSSettingValue *newValue = calloc (1, sizeof (CCSSettingValue));
516
517 newValue->isListChild = FALSE;
518 newValue->parent = NULL;
519 newValue->refCount = 1;
520
521 if (ccsMATEIntegrationBackendKeyValueToStringValue (v, newValue))
522 {
523 /* Really this is a lie - the writer expects a string
524 * but it needs to know if its a key or a string */
525 type = TypeKey;
526 ccsIntegratedSettingWriteValue (integratedSetting, newValue, type);
527 }
528
529 if (newValue)
530 ccsFreeSettingValueWithType (newValue, TypeString);
531 }
532 break;
533 case OptionSpecial:
534 {
535 const char *settingName = ccsSettingGetName (setting);
536 const char *pluginName = ccsPluginGetName (ccsSettingGetParent (setting));
537 CCSSettingValue *newValue = calloc (1, sizeof (CCSSettingValue));
538
539 newValue->isListChild = FALSE;
540 newValue->parent = NULL;
541 newValue->refCount = 1;
542
543 if (strcmp (settingName, "current_viewport") == 0)
544 {
545 newValue->value.asBool = !v->value.asBool;
546 type = TypeBool;
547
548 ccsIntegratedSettingWriteValue (integratedSetting, newValue, type);
549 }
550 else if (strcmp (settingName, "fullscreen_visual_bell") == 0)
551 {
552 const char *newValueString = v->value.asBool ? "fullscreen" : "frame_flash";
553 newValue->value.asString = strdup (newValueString);
554 type = TypeString;
555
556 ccsIntegratedSettingWriteValue (integratedSetting, newValue, type);
557 }
558 else if (strcmp (settingName, "click_to_focus") == 0)
559 {
560 const char *newValueString = v->value.asBool ? "click" : "sloppy";
561 newValue->value.asString = strdup (newValueString);
562 type = TypeString;
563
564 ccsIntegratedSettingWriteValue (integratedSetting, newValue, type);
565 }
566 else if ((strcmp (settingName, "run_command_screenshot_key") == 0 ||
567 strcmp (settingName, "run_command_window_screenshot_key") == 0 ||
568 strcmp (settingName, "run_command_terminal_key") == 0))
569 {
570 if (ccsMATEIntegrationBackendKeyValueToStringValue (v, newValue))
571 {
572 /* These are actually stored as strings in the schemas */
573 type = TypeString;
574 ccsIntegratedSettingWriteValue (integratedSetting, newValue, type);
575 }
576
577 }
578 else if (((strcmp (settingName, "initiate_button") == 0) &&
579 ((strcmp (pluginName, "move") == 0) ||
580 (strcmp (pluginName, "resize") == 0))) ||
581 ((strcmp (settingName, "window_menu_button") == 0) &&
582 (strcmp (pluginName, "core") == 0)))
583 {
584 unsigned int modMask;
585 Bool resizeWithRightButton = FALSE;
586
587 if ((getButtonBindingForSetting (priv->context, "resize",
588 "initiate_button") == 3) ||
589 (getButtonBindingForSetting (priv->context, "core",
590 "window_menu_button") == 2))
591 {
592 resizeWithRightButton = TRUE;
593 }
594
595 CCSIntegratedSettingList resizeButtonSetting =
596 ccsIntegratedSettingsStorageFindMatchingSettingsByPluginAndSettingName (priv->storage,
597 ccsMATEIntegratedPluginNames.SPECIAL,
598 ccsMATEIntegratedSettingNames.NULL_RESIZE_WITH_RIGHT_BUTTON.compizName);
599
600 newValue->value.asBool = resizeWithRightButton;
601 type = TypeBool;
602
603 ccsIntegratedSettingWriteValue (resizeButtonSetting->data, newValue, type);
604
605 CCSIntegratedSettingList mouseModifierSetting =
606 ccsIntegratedSettingsStorageFindMatchingSettingsByPluginAndSettingName (priv->storage,
607 ccsMATEIntegratedPluginNames.SPECIAL,
608 ccsMATEIntegratedSettingNames.NULL_MOUSE_BUTTON_MODIFIER.compizName);
609
610 modMask = v->value.asButton.buttonModMask;
611 if (setMateMouseButtonModifier (mouseModifierSetting->data, modMask))
612 {
613 setButtonBindingForSetting (priv->context, "move",
614 "initiate_button", 1, modMask);
615 setButtonBindingForSetting (priv->context, "resize",
616 "initiate_button",
617 resizeWithRightButton ? 3 : 2,
618 modMask);
619 setButtonBindingForSetting (priv->context, "core",
620 "window_menu_button",
621 resizeWithRightButton ? 2 : 3,
622 modMask);
623 }
624
625 /* We own the returned lists, so free them */
626 ccsIntegratedSettingListFree (resizeButtonSetting, FALSE);
627 ccsIntegratedSettingListFree (mouseModifierSetting, FALSE);
628 }
629
630 if (newValue)
631 ccsFreeSettingValueWithType (newValue, type);
632 }
633 break;
634 }
635
636 if (err)
637 {
638 ccsError ("%s", err->message);
639 g_error_free (err);
640 }
641
642 if (v)
643 ccsFreeSettingValueWithType (v, sType);
644
645 /* we should immediately write changed settings */
646 ccsWriteChangedSettings (priv->context);
647 ccsIntegrationAllowIntegratedWrites (integration);
648}
649
650static void
651ccsMATEIntegrationBackendUpdateIntegratedSettings (CCSIntegration *integration,
652 CCSContext *context,
653 CCSIntegratedSettingList integratedSettings)
654{
655 CCMATEIntegrationBackendPrivate *priv = (CCMATEIntegrationBackendPrivate *) ccsObjectGetPrivate (integration);
656 Bool needInit = TRUE;
657
658 CCSIntegratedSettingList iter = integratedSettings;
659
660 while (iter)
661 {
662 CCSIntegratedSetting *integrated = iter->data;
663 const char *settingName = ccsIntegratedSettingInfoSettingName ((CCSIntegratedSettingInfo *)integrated);
664 const char *pluginName = ccsIntegratedSettingInfoPluginName ((CCSIntegratedSettingInfo *) integrated);
665
666 /* Special case for mouse button modifier etc */
667 if ((strcmp (settingName,
668 "mouse_button_modifier") == 0) ||
669 (strcmp (settingName,
670 "resize_with_right_button") == 0))
671 {
672 CCSSetting *s;
673
674 if (needInit)
675 {
676 ccsBackendReadInit (priv->backend, priv->context);
677 needInit = FALSE;
678 }
679
680 s = findDisplaySettingForPlugin (priv->context, "core",
681 "window_menu_button");
682 if (s)
683 ccsBackendReadSetting (priv->backend, priv->context, s);
684
685 s = findDisplaySettingForPlugin (priv->context, "move",
686 "initiate_button");
687 if (s)
688 ccsBackendReadSetting (priv->backend, priv->context, s);
689
690 s = findDisplaySettingForPlugin (priv->context, "resize",
691 "initiate_button");
692 if (s)
693 ccsBackendReadSetting (priv->backend, priv->context, s);
694 }
695 else
696 {
697 CCSPlugin *plugin = NULL;
698
699 plugin = ccsFindPlugin (priv->context, pluginName);
700 if (plugin)
701 {
702 CCSSetting *setting;
703 setting = ccsFindSetting (plugin, settingName);
704
705 if (setting)
706 {
707 if (needInit)
708 {
709 ccsBackendReadInit (priv->backend, priv->context);
710 needInit = FALSE;
711 }
712
713 ccsBackendReadSetting (priv->backend, priv->context, setting);
714 }
715 }
716 }
717
718 iter = iter->next;
719 }
720}
721
722static void
723ccsMATEIntegrationDisallowIntegratedWrites (CCSIntegration *integration)
724{
725 CCMATEIntegrationBackendPrivate *priv = (CCMATEIntegrationBackendPrivate *) ccsObjectGetPrivate (integration);
726 priv->noWrites = TRUE;
727}
728
729static void
730ccsMATEIntegrationAllowIntegratedWrites (CCSIntegration *integration)
731{
732 CCMATEIntegrationBackendPrivate *priv = (CCMATEIntegrationBackendPrivate *) ccsObjectGetPrivate (integration);
733 priv->noWrites = FALSE;
734}
735
736static void
737ccsMATEIntegrationBackendFree (CCSIntegration *integration)
738{
739 CCMATEIntegrationBackendPrivate *priv = (CCMATEIntegrationBackendPrivate *) ccsObjectGetPrivate (integration);
740
741 unregisterAllIntegratedOptions (integration);
742
743 priv->backend = NULL;
744
745 ccsObjectFinalize (integration);
746 free (integration);
747}
748
749const CCSIntegrationInterface ccsMATEIntegrationBackendInterface =
750{
751 ccsMATEIntegrationBackendGetIntegratedSetting,
752 ccsMATEIntegrationBackendReadOptionIntoSetting,
753 ccsMATEIntegrationBackendWriteOptionFromSetting,
754 ccsMATEIntegrationBackendUpdateIntegratedSettings,
755 ccsMATEIntegrationDisallowIntegratedWrites,
756 ccsMATEIntegrationAllowIntegratedWrites,
757 ccsMATEIntegrationBackendFree
758};
759
760static CCMATEIntegrationBackendPrivate *
761addPrivate (CCSIntegration *backend,
762 CCSObjectAllocationInterface *ai)
763{
764 CCMATEIntegrationBackendPrivate *priv = (*ai->calloc_) (ai->allocator, 1, sizeof (CCMATEIntegrationBackendPrivate));
765
766 if (!priv)
767 {
768 ccsObjectFinalize (backend);
769 free (backend);
770 }
771
772 ccsObjectSetPrivate (backend, (CCSPrivate *) priv);
773
774 return priv;
775}
776
777static CCSIntegration *
778ccsMATEIntegrationBackendNewCommon (CCSBackend *backend,
779 CCSContext *context,
780 CCSIntegratedSettingFactory *factory,
781 CCSIntegratedSettingsStorage *storage,
782 CCSObjectAllocationInterface *ai)
783{
784 CCSIntegration *integration = (*ai->calloc_) (ai->allocator, 1, sizeof (CCSIntegration));
785
786 if (!integration)
787 return NULL;
788
789 ccsObjectInit (integration, ai);
790
791 CCMATEIntegrationBackendPrivate *priv = addPrivate (integration, ai);
792 priv->backend = backend;
793 priv->context = context;
794 priv->factory = factory;
795 priv->storage = storage;
796 priv->noWrites = FALSE;
797
798 ccsObjectAddInterface (integration,
799 (const CCSInterface *) &ccsMATEIntegrationBackendInterface,
800 GET_INTERFACE_TYPE (CCSIntegrationInterface));
801
802 ccsIntegrationRef (integration);
803
804 return integration;
805}
806
807CCSIntegration *
808ccsMATEIntegrationBackendNew (CCSBackend *backend,
809 CCSContext *context,
810 CCSIntegratedSettingFactory *factory,
811 CCSIntegratedSettingsStorage *storage,
812 CCSObjectAllocationInterface *ai)
813{
814 return ccsMATEIntegrationBackendNewCommon (backend, context, factory, storage, ai);
815}
8160
=== removed file 'compizconfig/integration/mate/src/ccs_mate_integration_constants.c'
--- compizconfig/integration/mate/src/ccs_mate_integration_constants.c 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/src/ccs_mate_integration_constants.c 1970-01-01 00:00:00 +0000
@@ -1,1099 +0,0 @@
1#include <glib.h>
2#include "ccs_mate_integration_constants.h"
3
4const char * watchedGConfMateDirectories[] = {
5 METACITY,
6 "/desktop/mate/applications/terminal",
7 "/apps/panel/applets/window_list/prefs"
8};
9
10const CCSMATEIntegratedSettingNames ccsMATEIntegratedSettingNames =
11{
12 { "audible_bell", "audible_bell" },
13 { "click_to_focus", "focus_mode" },
14 { "raise_on_click", "raise_on_click" },
15 { "autoraise_delay", "auto_raise_delay" },
16 { "autoraise", "auto_raise" },
17 { "current_viewport", "display_all_workspaces" },
18 { "command_terminal", "exec" },
19 { "command_window_screenshot", "command_window_screenshot" },
20 { "command_screenshot", "command_screenshot" },
21 { "rotate_right_window_key", "move_to_workspace_right" },
22 { "rotate_left_window_key", "move_to_workspace_left" },
23 { "rotate_to_12_window_key", "move_to_workspace_12" },
24 { "rotate_to_11_window_key", "move_to_workspace_11" },
25 { "rotate_to_10_window_key", "move_to_workspace_10" },
26 { "rotate_to_9_window_key", "move_to_workspace_9" },
27 { "rotate_to_8_window_key", "move_to_workspace_8" },
28 { "rotate_to_7_window_key", "move_to_workspace_7" },
29 { "rotate_to_6_window_key", "move_to_workspace_6" },
30 { "rotate_to_5_window_key", "move_to_workspace_5" },
31 { "rotate_to_4_window_key", "move_to_workspace_4" },
32 { "rotate_to_3_window_key", "move_to_workspace_3" },
33 { "rotate_to_2_window_key", "move_to_workspace_2" },
34 { "rotate_to_1_window_key", "move_to_workspace_1" },
35 { "put_bottom_key", "move_to_side_s" },
36 { "put_top_key", "move_to_side_n" },
37 { "put_right_key", "move_to_side_e" },
38 { "put_left_key", "move_to_side_w" },
39 { "put_bottomright_key", "move_to_corner_se" },
40 { "put_bottomleft_key", "move_to_corner_sw" },
41 { "put_topright_key", "move_to_corner_ne" },
42 { "put_topleft_key", "move_to_corner_nw" },
43 { "down_window_key", "move_to_workspace_down" },
44 { "up_window_key", "move_to_workspace_up" },
45 { "right_window_key", "move_to_workspace_right" },
46 { "left_window_key", "move_to_workspace_left" },
47 { "right_key", "switch_to_workspace_right" },
48 { "left_key", "switch_to_workspace_left" },
49 { "down_key", "switch_to_workspace_down" },
50 { "up_key", "switch_to_workspace_up" },
51 { "switch_to_12_key", "switch_to_workspace_12" },
52 { "switch_to_11_key", "switch_to_workspace_11" },
53 { "switch_to_10_key", "switch_to_workspace_10" },
54 { "switch_to_9_key", "switch_to_workspace_9" },
55 { "switch_to_8_key", "switch_to_workspace_8" },
56 { "switch_to_7_key", "switch_to_workspace_7" },
57 { "switch_to_6_key", "switch_to_workspace_6" },
58 { "switch_to_5_key", "switch_to_workspace_5" },
59 { "switch_to_4_key", "switch_to_workspace_4" },
60 { "switch_to_3_key", "switch_to_workspace_3" },
61 { "switch_to_2_key", "switch_to_workspace_2" },
62 { "switch_to_1_key", "switch_to_workspace_1" },
63 { "rotate_right_key", "switch_to_workspace_right" },
64 { "rotate_left_key", "switch_to_workspace_left" },
65 { "rotate_to_12_key", "switch_to_workspace_12" },
66 { "rotate_to_11_key", "switch_to_workspace_11" },
67 { "rotate_to_10_key", "switch_to_workspace_10" },
68 { "rotate_to_9_key", "switch_to_workspace_9" },
69 { "rotate_to_8_key", "switch_to_workspace_8" },
70 { "rotate_to_7_key", "switch_to_workspace_7" },
71 { "rotate_to_6_key", "switch_to_workspace_6" },
72 { "rotate_to_5_key", "switch_to_workspace_5" },
73 { "rotate_to_4_key", "switch_to_workspace_4" },
74 { "rotate_to_3_key", "switch_to_workspace_3" },
75 { "rotate_to_2_key", "switch_to_workspace_2" },
76 { "rotate_to_1_key", "switch_to_workspace_1" },
77 { "run_command11_key", "run_command_12" },
78 { "run_command10_key", "run_command_11" },
79 { "run_command9_key", "run_command_10" },
80 { "run_command8_key", "run_command_9" },
81 { "run_command7_key", "run_command_8" },
82 { "run_command6_key", "run_command_7" },
83 { "run_command5_key", "run_command_6" },
84 { "run_command4_key", "run_command_5" },
85 { "run_command3_key", "run_command_4" },
86 { "run_command2_key", "run_command_3" },
87 { "run_command1_key", "run_command_2" },
88 { "run_command0_key", "run_command_1" },
89 { "command11", "command_12" },
90 { "command10", "command_11" },
91 { "command9", "command_10" },
92 { "command8", "command_9" },
93 { "command7", "command_8" },
94 { "command6", "command_7" },
95 { "command5", "command_6" },
96 { "command4", "command_5" },
97 { "command3", "command_4" },
98 { "command2", "command_3" },
99 { "command1", "command_2" },
100 { "command0", "command_1" },
101 { "toggle_fullscreen_key", "toggle_fullscreen" },
102 { "toggle_sticky_key", "toggle_on_all_workspaces" },
103 { "prev_key", "switch_windows_backward" },
104 { "next_key", "switch_windows" },
105 { "fullscreen_visual_bell", "visual_bell_type" },
106 { "visual_bell", "visual_bell" },
107 { "resize_with_right_button", "resize_with_right_button" },
108 { "mouse_button_modifier", "mouse_button_modifier" },
109 { "window_menu_button", "activate_window_menu" },
110 { "initiate_button", "begin_resize" },
111 { "initiate_button", "begin_move" },
112 { "window_menu_key", "activate_window_menu" },
113 { "initiate_key", "begin_resize" },
114 { "initiate_key", "begin_move" },
115 { "show_desktop_key", "show_desktop" },
116 { "toggle_window_shaded_key", "toggle_shaded" },
117 { "close_window_key", "close" },
118 { "lower_window_key", "lower" },
119 { "raise_window_key", "raise" },
120 { "maximize_window_vertically_key", "maximize_vertically" },
121 { "maximize_window_horizontally_key", "maximize_horizontally" },
122 { "unmaximize_or_minimize_window_key", "unmaximize" },
123 { "maximize_window_key", "maximize" },
124 { "minimize_window_key", "minimize" },
125 { "toggle_window_maximized_key", "toggle_maximized" },
126 { "run_command_terminal_key", "run_command_terminal" },
127 { "run_command_window_screenshot_key", "run_command_window_screenshot" },
128 { "run_command_screenshot_key", "run_command_screenshot" },
129 { "main_menu_key", "panel_main_menu" },
130 { "run_key", "panel_run_dialog" }
131};
132
133const CCSGConfIntegrationCategories ccsGConfIntegrationCategories =
134{
135 METACITY "/general/",
136 "/apps/panel/applets/window_list/prefs/",
137 "/desktop/mate/applications/terminal/",
138 METACITY "/keybinding_commands/",
139 METACITY "/window_keybindings/",
140 METACITY "/global_keybindings/"
141};
142
143const CCSMATEIntegratedPluginNames ccsMATEIntegratedPluginNames =
144{
145 "core",
146 "thumbnail",
147 "matecompat",
148 "rotate",
149 "put",
150 "wall",
151 "vpswitch",
152 "commands",
153 "extrawm",
154 "resize",
155 "move",
156 "staticswitcher",
157 "fade",
158 "__special"
159};
160
161static gpointer
162ccsMATEIntegrationInitializeIntegratedSettingsList (gpointer data)
163{
164 CCSMATEIntegratedSettingsList *array = (CCSMATEIntegratedSettingsList *) data;
165 const CCSMATEIntegratedPluginNames *plugins = &ccsMATEIntegratedPluginNames;
166 const CCSMATEIntegratedSettingNames *settings = &ccsMATEIntegratedSettingNames;
167
168 array[0].pluginName = plugins->CORE;
169 array[0].settingName = settings->CORE_AUDIBLE_BELL.compizName;
170 array[1].pluginName = plugins->CORE;
171 array[1].settingName = settings->CORE_CLICK_TO_FOCUS.compizName;
172 array[2].pluginName = plugins->CORE;
173 array[2].settingName = settings->CORE_RAISE_ON_CLICK.compizName;
174 array[3].pluginName = plugins->CORE;
175 array[3].settingName = settings->CORE_AUTORAISE_DELAY.compizName;
176 array[4].pluginName = plugins->CORE;
177 array[4].settingName = settings->CORE_AUTORAISE.compizName;
178 array[5].pluginName = plugins->THUMBNAIL;
179 array[5].settingName = settings->THUMBNAIL_CURRENT_VIEWPORT.compizName;
180 array[6].pluginName = plugins->MATECOMPAT;
181 array[6].settingName = settings->MATECOMPAT_COMMAND_TERMINAL.compizName;
182 array[7].pluginName = plugins->MATECOMPAT;
183 array[7].settingName = settings->MATECOMPAT_COMMAND_WINDOW_SCREENSHOT.compizName;
184 array[8].pluginName = plugins->MATECOMPAT;
185 array[8].settingName = settings->MATECOMPAT_COMMAND_SCREENSHOT.compizName;
186 array[9].pluginName = plugins->ROTATE;
187 array[9].settingName = settings->ROTATE_ROTATE_RIGHT_WINDOW_KEY.compizName;
188 array[10].pluginName = plugins->ROTATE;
189 array[10].settingName = settings->ROTATE_ROTATE_LEFT_WINDOW_KEY.compizName;
190 array[11].pluginName = plugins->ROTATE;
191 array[11].settingName = settings->ROTATE_ROTATE_TO_12_WINDOW_KEY.compizName;
192 array[12].pluginName = plugins->ROTATE;
193 array[12].settingName = settings->ROTATE_ROTATE_TO_11_WINDOW_KEY.compizName;
194 array[13].pluginName = plugins->ROTATE;
195 array[13].settingName = settings->ROTATE_ROTATE_TO_10_WINDOW_KEY.compizName;
196 array[14].pluginName = plugins->ROTATE;
197 array[14].settingName = settings->ROTATE_ROTATE_TO_9_WINDOW_KEY.compizName;
198 array[15].pluginName = plugins->ROTATE;
199 array[15].settingName = settings->ROTATE_ROTATE_TO_8_WINDOW_KEY.compizName;
200 array[16].pluginName = plugins->ROTATE;
201 array[16].settingName = settings->ROTATE_ROTATE_TO_7_WINDOW_KEY.compizName;
202 array[17].pluginName = plugins->ROTATE;
203 array[17].settingName = settings->ROTATE_ROTATE_TO_6_WINDOW_KEY.compizName;
204 array[18].pluginName = plugins->ROTATE;
205 array[18].settingName = settings->ROTATE_ROTATE_TO_5_WINDOW_KEY.compizName;
206 array[19].pluginName = plugins->ROTATE;
207 array[19].settingName = settings->ROTATE_ROTATE_TO_4_WINDOW_KEY.compizName;
208 array[20].pluginName = plugins->ROTATE;
209 array[20].settingName = settings->ROTATE_ROTATE_TO_3_WINDOW_KEY.compizName;
210 array[21].pluginName = plugins->ROTATE;
211 array[21].settingName = settings->ROTATE_ROTATE_TO_2_WINDOW_KEY.compizName;
212 array[22].pluginName = plugins->ROTATE;
213 array[22].settingName = settings->ROTATE_ROTATE_TO_1_WINDOW_KEY.compizName;
214 array[23].pluginName = plugins->PUT;
215 array[23].settingName = settings->PUT_PUT_BOTTOM_KEY.compizName;
216 array[24].pluginName = plugins->PUT;
217 array[24].settingName = settings->PUT_PUT_TOP_KEY.compizName;
218 array[25].pluginName = plugins->PUT;
219 array[25].settingName = settings->PUT_PUT_RIGHT_KEY.compizName;
220 array[26].pluginName = plugins->PUT;
221 array[26].settingName = settings->PUT_PUT_LEFT_KEY.compizName;
222 array[27].pluginName = plugins->PUT;
223 array[27].settingName = settings->PUT_PUT_BOTTOMRIGHT_KEY.compizName;
224 array[28].pluginName = plugins->PUT;
225 array[28].settingName = settings->PUT_PUT_BOTTOMLEFT_KEY.compizName;
226 array[29].pluginName = plugins->PUT;
227 array[29].settingName = settings->PUT_PUT_TOPRIGHT_KEY.compizName;
228 array[30].pluginName = plugins->PUT;
229 array[30].settingName = settings->PUT_PUT_TOPLEFT_KEY.compizName;
230 array[31].pluginName = plugins->WALL;
231 array[31].settingName = settings->WALL_DOWN_WINDOW_KEY.compizName;
232 array[32].pluginName = plugins->WALL;
233 array[32].settingName = settings->WALL_UP_WINDOW_KEY.compizName;
234 array[33].pluginName = plugins->WALL;
235 array[33].settingName = settings->WALL_RIGHT_WINDOW_KEY.compizName;
236 array[34].pluginName = plugins->WALL;
237 array[34].settingName = settings->WALL_LEFT_WINDOW_KEY.compizName;
238 array[35].pluginName = plugins->WALL;
239 array[35].settingName = settings->WALL_RIGHT_KEY.compizName;
240 array[36].pluginName = plugins->WALL;
241 array[36].settingName = settings->WALL_LEFT_KEY.compizName;
242 array[37].pluginName = plugins->WALL;
243 array[37].settingName = settings->WALL_DOWN_KEY.compizName;
244 array[38].pluginName = plugins->WALL;
245 array[38].settingName = settings->WALL_UP_KEY.compizName;
246 array[39].pluginName = plugins->VPSWITCH;
247 array[39].settingName = settings->VPSWITCH_SWITCH_TO_12_KEY.compizName;
248 array[40].pluginName = plugins->VPSWITCH;
249 array[40].settingName = settings->VPSWITCH_SWITCH_TO_11_KEY.compizName;
250 array[41].pluginName = plugins->VPSWITCH;
251 array[41].settingName = settings->VPSWITCH_SWITCH_TO_10_KEY.compizName;
252 array[42].pluginName = plugins->VPSWITCH;
253 array[42].settingName = settings->VPSWITCH_SWITCH_TO_9_KEY.compizName;
254 array[43].pluginName = plugins->VPSWITCH;
255 array[43].settingName = settings->VPSWITCH_SWITCH_TO_8_KEY.compizName;
256 array[44].pluginName = plugins->VPSWITCH;
257 array[44].settingName = settings->VPSWITCH_SWITCH_TO_7_KEY.compizName;
258 array[45].pluginName = plugins->VPSWITCH;
259 array[45].settingName = settings->VPSWITCH_SWITCH_TO_6_KEY.compizName;
260 array[46].pluginName = plugins->VPSWITCH;
261 array[46].settingName = settings->VPSWITCH_SWITCH_TO_5_KEY.compizName;
262 array[47].pluginName = plugins->VPSWITCH;
263 array[47].settingName = settings->VPSWITCH_SWITCH_TO_4_KEY.compizName;
264 array[48].pluginName = plugins->VPSWITCH;
265 array[48].settingName = settings->VPSWITCH_SWITCH_TO_3_KEY.compizName;
266 array[49].pluginName = plugins->VPSWITCH;
267 array[49].settingName = settings->VPSWITCH_SWITCH_TO_2_KEY.compizName;
268 array[50].pluginName = plugins->VPSWITCH;
269 array[50].settingName = settings->VPSWITCH_SWITCH_TO_1_KEY.compizName;
270 array[51].pluginName = plugins->ROTATE;
271 array[51].settingName = settings->ROTATE_ROTATE_RIGHT_KEY.compizName;
272 array[52].pluginName = plugins->ROTATE;
273 array[52].settingName = settings->ROTATE_ROTATE_LEFT_KEY.compizName;
274 array[53].pluginName = plugins->ROTATE;
275 array[53].settingName = settings->ROTATE_ROTATE_TO_12_KEY.compizName;
276 array[54].pluginName = plugins->ROTATE;
277 array[54].settingName = settings->ROTATE_ROTATE_TO_11_KEY.compizName;
278 array[55].pluginName = plugins->ROTATE;
279 array[55].settingName = settings->ROTATE_ROTATE_TO_10_KEY.compizName;
280 array[56].pluginName = plugins->ROTATE;
281 array[56].settingName = settings->ROTATE_ROTATE_TO_9_KEY.compizName;
282 array[57].pluginName = plugins->ROTATE;
283 array[57].settingName = settings->ROTATE_ROTATE_TO_8_KEY.compizName;
284 array[58].pluginName = plugins->ROTATE;
285 array[58].settingName = settings->ROTATE_ROTATE_TO_7_KEY.compizName;
286 array[59].pluginName = plugins->ROTATE;
287 array[59].settingName = settings->ROTATE_ROTATE_TO_6_KEY.compizName;
288 array[60].pluginName = plugins->ROTATE;
289 array[60].settingName = settings->ROTATE_ROTATE_TO_5_KEY.compizName;
290 array[61].pluginName = plugins->ROTATE;
291 array[61].settingName = settings->ROTATE_ROTATE_TO_4_KEY.compizName;
292 array[62].pluginName = plugins->ROTATE;
293 array[62].settingName = settings->ROTATE_ROTATE_TO_3_KEY.compizName;
294 array[63].pluginName = plugins->ROTATE;
295 array[63].settingName = settings->ROTATE_ROTATE_TO_2_KEY.compizName;
296 array[64].pluginName = plugins->ROTATE;
297 array[64].settingName = settings->ROTATE_ROTATE_TO_1_KEY.compizName;
298 array[65].pluginName = plugins->COMMANDS;
299 array[65].settingName = settings->COMMANDS_RUN_COMMAND11_KEY.compizName;
300 array[66].pluginName = plugins->COMMANDS;
301 array[66].settingName = settings->COMMANDS_RUN_COMMAND10_KEY.compizName;
302 array[67].pluginName = plugins->COMMANDS;
303 array[67].settingName = settings->COMMANDS_RUN_COMMAND9_KEY.compizName;
304 array[68].pluginName = plugins->COMMANDS;
305 array[68].settingName = settings->COMMANDS_RUN_COMMAND8_KEY.compizName;
306 array[69].pluginName = plugins->COMMANDS;
307 array[69].settingName = settings->COMMANDS_RUN_COMMAND7_KEY.compizName;
308 array[70].pluginName = plugins->COMMANDS;
309 array[70].settingName = settings->COMMANDS_RUN_COMMAND6_KEY.compizName;
310 array[71].pluginName = plugins->COMMANDS;
311 array[71].settingName = settings->COMMANDS_RUN_COMMAND5_KEY.compizName;
312 array[72].pluginName = plugins->COMMANDS;
313 array[72].settingName = settings->COMMANDS_RUN_COMMAND4_KEY.compizName;
314 array[73].pluginName = plugins->COMMANDS;
315 array[73].settingName = settings->COMMANDS_RUN_COMMAND3_KEY.compizName;
316 array[74].pluginName = plugins->COMMANDS;
317 array[74].settingName = settings->COMMANDS_RUN_COMMAND2_KEY.compizName;
318 array[75].pluginName = plugins->COMMANDS;
319 array[75].settingName = settings->COMMANDS_RUN_COMMAND1_KEY.compizName;
320 array[76].pluginName = plugins->COMMANDS;
321 array[76].settingName = settings->COMMANDS_RUN_COMMAND0_KEY.compizName;
322 array[77].pluginName = plugins->COMMANDS;
323 array[77].settingName = settings->COMMANDS_COMMAND11.compizName;
324 array[78].pluginName = plugins->COMMANDS;
325 array[78].settingName = settings->COMMANDS_COMMAND10.compizName;
326 array[79].pluginName = plugins->COMMANDS;
327 array[79].settingName = settings->COMMANDS_COMMAND9.compizName;
328 array[80].pluginName = plugins->COMMANDS;
329 array[80].settingName = settings->COMMANDS_COMMAND8.compizName;
330 array[81].pluginName = plugins->COMMANDS;
331 array[81].settingName = settings->COMMANDS_COMMAND7.compizName;
332 array[82].pluginName = plugins->COMMANDS;
333 array[82].settingName = settings->COMMANDS_COMMAND6.compizName;
334 array[83].pluginName = plugins->COMMANDS;
335 array[83].settingName = settings->COMMANDS_COMMAND5.compizName;
336 array[84].pluginName = plugins->COMMANDS;
337 array[84].settingName = settings->COMMANDS_COMMAND4.compizName;
338 array[85].pluginName = plugins->COMMANDS;
339 array[85].settingName = settings->COMMANDS_COMMAND3.compizName;
340 array[86].pluginName = plugins->COMMANDS;
341 array[86].settingName = settings->COMMANDS_COMMAND2.compizName;
342 array[87].pluginName = plugins->COMMANDS;
343 array[87].settingName = settings->COMMANDS_COMMAND1.compizName;
344 array[88].pluginName = plugins->COMMANDS;
345 array[88].settingName = settings->COMMANDS_COMMAND0.compizName;
346 array[89].pluginName = plugins->EXTRAWM;
347 array[89].settingName = settings->EXTRAWM_TOGGLE_FULLSCREEN_KEY.compizName;
348 array[90].pluginName = plugins->EXTRAWM;
349 array[90].settingName = settings->EXTRAWM_TOGGLE_STICKY_KEY.compizName;
350 array[91].pluginName = plugins->STATICSWITCHER;
351 array[91].settingName = settings->STATICSWITCHER_PREV_KEY.compizName;
352 array[92].pluginName = plugins->STATICSWITCHER;
353 array[92].settingName = settings->STATICSWITCHER_NEXT_KEY.compizName;
354 array[93].pluginName = plugins->FADE;
355 array[93].settingName = settings->FADE_FULLSCREEN_VISUAL_BELL.compizName;
356 array[94].pluginName = plugins->FADE;
357 array[94].settingName = settings->FADE_VISUAL_BELL.compizName;
358 array[95].pluginName = plugins->SPECIAL;
359 array[95].settingName = settings->NULL_RESIZE_WITH_RIGHT_BUTTON.compizName;
360 array[96].pluginName = plugins->SPECIAL;
361 array[96].settingName = settings->NULL_MOUSE_BUTTON_MODIFIER.compizName;
362 array[97].pluginName = plugins->CORE;
363 array[97].settingName = settings->CORE_WINDOW_MENU_BUTTON.compizName;
364 array[98].pluginName = plugins->RESIZE;
365 array[98].settingName = settings->RESIZE_INITIATE_BUTTON.compizName;
366 array[99].pluginName = plugins->MOVE;
367 array[99].settingName = settings->MOVE_INITIATE_BUTTON.compizName;
368 array[100].pluginName = plugins->CORE;
369 array[100].settingName = settings->CORE_WINDOW_MENU_KEY.compizName;
370 array[101].pluginName = plugins->RESIZE;
371 array[101].settingName = settings->RESIZE_INITIATE_KEY.compizName;
372 array[102].pluginName = plugins->MOVE;
373 array[102].settingName = settings->MOVE_INITIATE_KEY.compizName;
374 array[103].pluginName = plugins->CORE;
375 array[103].settingName = settings->CORE_SHOW_DESKTOP_KEY.compizName;
376 array[104].pluginName = plugins->CORE;
377 array[104].settingName = settings->CORE_TOGGLE_WINDOW_SHADED_KEY.compizName;
378 array[105].pluginName = plugins->CORE;
379 array[105].settingName = settings->CORE_CLOSE_WINDOW_KEY.compizName;
380 array[106].pluginName = plugins->CORE;
381 array[106].settingName = settings->CORE_LOWER_WINDOW_KEY.compizName;
382 array[107].pluginName = plugins->CORE;
383 array[107].settingName = settings->CORE_RAISE_WINDOW_KEY.compizName;
384 array[108].pluginName = plugins->CORE;
385 array[108].settingName = settings->CORE_MAXIMIZE_WINDOW_VERTICALLY_KEY.compizName;
386 array[109].pluginName = plugins->CORE;
387 array[109].settingName = settings->CORE_MAXIMIZE_WINDOW_HORIZONTALLY_KEY.compizName;
388 array[110].pluginName = plugins->CORE;
389 array[110].settingName = settings->CORE_UNMAXIMIZE_OR_MINIMIZE_WINDOW_KEY.compizName;
390 array[111].pluginName = plugins->CORE;
391 array[111].settingName = settings->CORE_MAXIMIZE_WINDOW_KEY.compizName;
392 array[112].pluginName = plugins->CORE;
393 array[112].settingName = settings->CORE_MINIMIZE_WINDOW_KEY.compizName;
394 array[113].pluginName = plugins->CORE;
395 array[113].settingName = settings->CORE_TOGGLE_WINDOW_MAXIMIZED_KEY.compizName;
396 array[114].pluginName = plugins->MATECOMPAT;
397 array[114].settingName = settings->MATECOMPAT_RUN_COMMAND_TERMINAL_KEY.compizName;
398 array[115].pluginName = plugins->MATECOMPAT;
399 array[115].settingName = settings->MATECOMPAT_RUN_COMMAND_WINDOW_SCREENSHOT_KEY.compizName;
400 array[116].pluginName = plugins->MATECOMPAT;
401 array[116].settingName = settings->MATECOMPAT_RUN_COMMAND_SCREENSHOT_KEY.compizName;
402 array[117].pluginName = plugins->MATECOMPAT;
403 array[117].settingName = settings->MATECOMPAT_MAIN_MENU_KEY.compizName;
404 array[118].pluginName = plugins->MATECOMPAT;
405 array[118].settingName = settings->MATECOMPAT_RUN_KEY.compizName;
406
407
408 return NULL;
409}
410
411const CCSMATEIntegratedSettingsList *
412ccsMATEIntegratedSettingsList ()
413{
414 static GOnce initIntegratedSettings = G_ONCE_INIT;
415 static CCSMATEIntegratedSettingsList settings[CCS_MATE_INTEGRATED_SETTINGS_LIST_SIZE];
416
417 g_once (&initIntegratedSettings, ccsMATEIntegrationInitializeIntegratedSettingsList, (gpointer) settings);
418
419 return settings;
420}
421
422gpointer
423ccsMATEGSettingsIntegrationInitializeIntegratedSchemasQuarks (gpointer data)
424{
425 CCSGSettingsWrapperIntegratedSchemasQuarks *quarks = (CCSGSettingsWrapperIntegratedSchemasQuarks *) data;
426
427 static const char *org_compiz_integrated = "org.compiz.integrated";
428 static const char *org_mate_desktop_wm_keybindings = "org.mate.Marco.global-keybindings";
429 static const char *org_mate_desktop_wm_preferences = "org.mate.Marco.general";
430 static const char *org_mate_settings_daemon_plugins_media_keys = "org.mate.SettingsDaemon.plugins.media-keys";
431 static const char *org_mate_desktop_default_applications_terminal = "org.mate.applications-terminal";
432
433 quarks->ORG_COMPIZ_INTEGRATED = g_quark_from_string (org_compiz_integrated);
434 quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS = g_quark_from_string (org_mate_desktop_wm_keybindings);
435 quarks->ORG_MATE_DESKTOP_WM_PREFERENCES = g_quark_from_string (org_mate_desktop_wm_preferences);
436 quarks->ORG_MATE_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS = g_quark_from_string (org_mate_settings_daemon_plugins_media_keys);
437 quarks->ORG_MATE_DESKTOP_DEFAULT_APPLICATIONS_TERMINAL = g_quark_from_string (org_mate_desktop_default_applications_terminal);
438
439 return NULL;
440}
441
442const CCSGSettingsWrapperIntegratedSchemasQuarks *
443ccsMATEGSettingsWrapperQuarks ()
444{
445 static GOnce initIntegratedSchemaQuarks = G_ONCE_INIT;
446 static CCSGSettingsWrapperIntegratedSchemasQuarks quarks;
447
448 g_once (&initIntegratedSchemaQuarks, ccsMATEGSettingsIntegrationInitializeIntegratedSchemasQuarks, (gpointer) &quarks);
449
450 return &quarks;
451}
452
453static void destroyHashTableInternal (void *ht)
454{
455 g_hash_table_unref ((GHashTable *) ht);
456}
457
458GHashTable *
459ccsMATEGSettingsIntegrationPopulateSettingNameToIntegratedSchemasQuarksHashTable ()
460{
461 GHashTable *masterHashTable = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, destroyHashTableInternal);
462 GHashTable *coreHashTable = g_hash_table_new (g_str_hash, g_str_equal);
463 GHashTable *thumbnailHashTable = g_hash_table_new (g_str_hash, g_str_equal);
464 GHashTable *matecompatHashTable = g_hash_table_new (g_str_hash, g_str_equal);
465 GHashTable *rotateHashTable = g_hash_table_new (g_str_hash, g_str_equal);
466 GHashTable *putHashTable = g_hash_table_new (g_str_hash, g_str_equal);
467 GHashTable *wallHashTable = g_hash_table_new (g_str_hash, g_str_equal);
468 GHashTable *vpswitchHashTable = g_hash_table_new (g_str_hash, g_str_equal);
469 GHashTable *commandsHashTable = g_hash_table_new (g_str_hash, g_str_equal);
470 GHashTable *extrawmHashTable = g_hash_table_new (g_str_hash, g_str_equal);
471 GHashTable *resizeHashTable = g_hash_table_new (g_str_hash, g_str_equal);
472 GHashTable *moveHashTable = g_hash_table_new (g_str_hash, g_str_equal);
473 GHashTable *staticswitcherHashTable = g_hash_table_new (g_str_hash, g_str_equal);
474 GHashTable *fadeHashTable = g_hash_table_new (g_str_hash, g_str_equal);
475 GHashTable *specialHashTable = g_hash_table_new (g_str_hash, g_str_equal);
476
477 const CCSMATEIntegratedSettingNames *names = &ccsMATEIntegratedSettingNames;
478 const CCSMATEIntegratedPluginNames *plugins = &ccsMATEIntegratedPluginNames;
479 const CCSGSettingsWrapperIntegratedSchemasQuarks *quarks = ccsMATEGSettingsWrapperQuarks ();
480
481 g_hash_table_insert (masterHashTable, (gpointer) plugins->CORE, coreHashTable);
482 g_hash_table_insert (masterHashTable, (gpointer) plugins->THUMBNAIL, thumbnailHashTable);
483 g_hash_table_insert (masterHashTable, (gpointer) plugins->MATECOMPAT, matecompatHashTable);
484 g_hash_table_insert (masterHashTable, (gpointer) plugins->ROTATE, rotateHashTable);
485 g_hash_table_insert (masterHashTable, (gpointer) plugins->PUT, putHashTable);
486 g_hash_table_insert (masterHashTable, (gpointer) plugins->WALL, wallHashTable);
487 g_hash_table_insert (masterHashTable, (gpointer) plugins->VPSWITCH, vpswitchHashTable);
488 g_hash_table_insert (masterHashTable, (gpointer) plugins->COMMANDS, commandsHashTable);
489 g_hash_table_insert (masterHashTable, (gpointer) plugins->EXTRAWM, extrawmHashTable);
490 g_hash_table_insert (masterHashTable, (gpointer) plugins->STATICSWITCHER, staticswitcherHashTable);
491 g_hash_table_insert (masterHashTable, (gpointer) plugins->FADE, fadeHashTable);
492 g_hash_table_insert (masterHashTable, (gpointer) plugins->RESIZE, resizeHashTable);
493 g_hash_table_insert (masterHashTable, (gpointer) plugins->MOVE, moveHashTable);
494 g_hash_table_insert (masterHashTable, (gpointer) plugins->SPECIAL, specialHashTable);
495
496 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUDIBLE_BELL.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_PREFERENCES));
497 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_CLICK_TO_FOCUS.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_PREFERENCES));
498 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_RAISE_ON_CLICK.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_PREFERENCES));
499 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUTORAISE_DELAY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_PREFERENCES));
500 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUTORAISE.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_PREFERENCES));
501 g_hash_table_insert (thumbnailHashTable, (gpointer) names->THUMBNAIL_CURRENT_VIEWPORT.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
502 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_COMMAND_TERMINAL.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_DEFAULT_APPLICATIONS_TERMINAL));
503 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_COMMAND_WINDOW_SCREENSHOT.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
504 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_COMMAND_SCREENSHOT.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
505 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_RIGHT_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
506 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_LEFT_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
507 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_12_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
508 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_11_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
509 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_10_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
510 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_9_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
511 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_8_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
512 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_7_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
513 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_6_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
514 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_5_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
515 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_4_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
516 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_3_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
517 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_2_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
518 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_1_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
519 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_BOTTOM_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
520 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_TOP_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
521 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_RIGHT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
522 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_LEFT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
523 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_BOTTOMRIGHT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
524 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_BOTTOMLEFT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
525 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_TOPRIGHT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
526 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_TOPLEFT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
527 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_DOWN_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
528 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_UP_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
529 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_RIGHT_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
530 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_LEFT_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
531 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_RIGHT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
532 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_LEFT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
533 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_DOWN_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
534 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_UP_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
535 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_12_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
536 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_11_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
537 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_10_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
538 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_9_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
539 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_8_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
540 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_7_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
541 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_6_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
542 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_5_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
543 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_4_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
544 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_3_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
545 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_2_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
546 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_1_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
547 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_RIGHT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
548 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_LEFT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
549 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_12_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
550 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_11_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
551 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_10_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
552 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_9_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
553 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_8_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
554 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_7_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
555 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_6_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
556 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_5_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
557 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_4_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
558 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_3_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
559 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_2_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
560 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_1_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
561 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND11_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
562 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND10_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
563 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND9_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
564 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND8_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
565 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND7_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
566 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND6_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
567 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND5_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
568 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND4_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
569 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND3_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
570 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND2_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
571 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND1_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
572 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND0_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
573 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND11.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
574 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND10.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
575 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND9.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
576 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND8.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
577 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND7.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
578 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND6.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
579 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND5.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
580 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND4.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
581 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND3.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
582 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND2.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
583 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND1.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
584 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND0.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED));
585 g_hash_table_insert (extrawmHashTable, (gpointer) names->EXTRAWM_TOGGLE_FULLSCREEN_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
586 g_hash_table_insert (extrawmHashTable, (gpointer) names->EXTRAWM_TOGGLE_STICKY_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
587 g_hash_table_insert (staticswitcherHashTable, (gpointer) names->STATICSWITCHER_PREV_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
588 g_hash_table_insert (staticswitcherHashTable, (gpointer) names->STATICSWITCHER_NEXT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
589 g_hash_table_insert (fadeHashTable, (gpointer) names->FADE_FULLSCREEN_VISUAL_BELL.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_PREFERENCES));
590 g_hash_table_insert (fadeHashTable, (gpointer) names->FADE_VISUAL_BELL.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_PREFERENCES));
591 g_hash_table_insert (specialHashTable, (gpointer) names->NULL_RESIZE_WITH_RIGHT_BUTTON.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_PREFERENCES));
592 g_hash_table_insert (specialHashTable, (gpointer) names->NULL_MOUSE_BUTTON_MODIFIER.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_PREFERENCES));
593 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_WINDOW_MENU_BUTTON.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
594 g_hash_table_insert (resizeHashTable, (gpointer) names->RESIZE_INITIATE_BUTTON.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
595 g_hash_table_insert (moveHashTable, (gpointer) names->MOVE_INITIATE_BUTTON.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
596 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_WINDOW_MENU_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
597 g_hash_table_insert (resizeHashTable, (gpointer) names->RESIZE_INITIATE_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
598 g_hash_table_insert (moveHashTable, (gpointer) names->MOVE_INITIATE_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
599 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_SHOW_DESKTOP_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
600 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_TOGGLE_WINDOW_SHADED_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
601 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_CLOSE_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
602 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_LOWER_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
603 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_RAISE_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
604 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_VERTICALLY_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
605 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_HORIZONTALLY_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
606 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_UNMAXIMIZE_OR_MINIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
607 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
608 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MINIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
609 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_TOGGLE_WINDOW_MAXIMIZED_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
610 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_COMMAND_TERMINAL_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS));
611 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_COMMAND_WINDOW_SCREENSHOT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS));
612 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_COMMAND_SCREENSHOT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS));
613 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_MAIN_MENU_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
614 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_KEY.compizName, GINT_TO_POINTER (quarks->ORG_MATE_DESKTOP_WM_KEYBINDINGS));
615
616 return masterHashTable;
617}
618
619GHashTable *
620ccsMATEIntegrationPopulateCategoriesHashTables ()
621{
622 GHashTable *masterHashTable = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, destroyHashTableInternal);
623 GHashTable *coreHashTable = g_hash_table_new (g_str_hash, g_str_equal);
624 GHashTable *thumbnailHashTable = g_hash_table_new (g_str_hash, g_str_equal);
625 GHashTable *matecompatHashTable = g_hash_table_new (g_str_hash, g_str_equal);
626 GHashTable *rotateHashTable = g_hash_table_new (g_str_hash, g_str_equal);
627 GHashTable *putHashTable = g_hash_table_new (g_str_hash, g_str_equal);
628 GHashTable *wallHashTable = g_hash_table_new (g_str_hash, g_str_equal);
629 GHashTable *vpswitchHashTable = g_hash_table_new (g_str_hash, g_str_equal);
630 GHashTable *commandsHashTable = g_hash_table_new (g_str_hash, g_str_equal);
631 GHashTable *extrawmHashTable = g_hash_table_new (g_str_hash, g_str_equal);
632 GHashTable *resizeHashTable = g_hash_table_new (g_str_hash, g_str_equal);
633 GHashTable *moveHashTable = g_hash_table_new (g_str_hash, g_str_equal);
634 GHashTable *staticswitcherHashTable = g_hash_table_new (g_str_hash, g_str_equal);
635 GHashTable *fadeHashTable = g_hash_table_new (g_str_hash, g_str_equal);
636 GHashTable *specialHashTable = g_hash_table_new (g_str_hash, g_str_equal);
637
638 const CCSMATEIntegratedSettingNames *names = &ccsMATEIntegratedSettingNames;
639 const CCSGConfIntegrationCategories *categories = &ccsGConfIntegrationCategories;
640 const CCSMATEIntegratedPluginNames *plugins = &ccsMATEIntegratedPluginNames;
641
642 g_hash_table_insert (masterHashTable, (gpointer) plugins->CORE, coreHashTable);
643 g_hash_table_insert (masterHashTable, (gpointer) plugins->THUMBNAIL, thumbnailHashTable);
644 g_hash_table_insert (masterHashTable, (gpointer) plugins->MATECOMPAT, matecompatHashTable);
645 g_hash_table_insert (masterHashTable, (gpointer) plugins->ROTATE, rotateHashTable);
646 g_hash_table_insert (masterHashTable, (gpointer) plugins->PUT, putHashTable);
647 g_hash_table_insert (masterHashTable, (gpointer) plugins->WALL, wallHashTable);
648 g_hash_table_insert (masterHashTable, (gpointer) plugins->VPSWITCH, vpswitchHashTable);
649 g_hash_table_insert (masterHashTable, (gpointer) plugins->COMMANDS, commandsHashTable);
650 g_hash_table_insert (masterHashTable, (gpointer) plugins->EXTRAWM, extrawmHashTable);
651 g_hash_table_insert (masterHashTable, (gpointer) plugins->STATICSWITCHER, staticswitcherHashTable);
652 g_hash_table_insert (masterHashTable, (gpointer) plugins->FADE, fadeHashTable);
653 g_hash_table_insert (masterHashTable, (gpointer) plugins->RESIZE, resizeHashTable);
654 g_hash_table_insert (masterHashTable, (gpointer) plugins->MOVE, moveHashTable);
655 g_hash_table_insert (masterHashTable, (gpointer) plugins->SPECIAL, specialHashTable);
656
657 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUDIBLE_BELL.compizName, (gpointer) categories->GENERAL);
658 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_CLICK_TO_FOCUS.compizName, (gpointer) categories->GENERAL);
659 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_RAISE_ON_CLICK.compizName, (gpointer) categories->GENERAL);
660 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUTORAISE_DELAY.compizName, (gpointer) categories->GENERAL);
661 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUTORAISE.compizName, (gpointer) categories->GENERAL);
662 g_hash_table_insert (thumbnailHashTable, (gpointer) names->THUMBNAIL_CURRENT_VIEWPORT.compizName, (gpointer) categories->APPS);
663 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_COMMAND_TERMINAL.compizName, (gpointer) categories->DESKTOP);
664 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_COMMAND_WINDOW_SCREENSHOT.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
665 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_COMMAND_SCREENSHOT.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
666 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_RIGHT_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
667 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_LEFT_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
668 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_12_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
669 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_11_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
670 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_10_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
671 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_9_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
672 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_8_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
673 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_7_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
674 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_6_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
675 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_5_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
676 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_4_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
677 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_3_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
678 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_2_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
679 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_1_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
680 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_BOTTOM_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
681 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_TOP_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
682 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_RIGHT_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
683 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_LEFT_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
684 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_BOTTOMRIGHT_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
685 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_BOTTOMLEFT_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
686 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_TOPRIGHT_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
687 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_TOPLEFT_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
688 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_DOWN_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
689 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_UP_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
690 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_RIGHT_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
691 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_LEFT_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
692 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_RIGHT_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
693 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_LEFT_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
694 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_DOWN_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
695 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_UP_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
696 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_12_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
697 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_11_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
698 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_10_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
699 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_9_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
700 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_8_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
701 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_7_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
702 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_6_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
703 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_5_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
704 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_4_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
705 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_3_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
706 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_2_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
707 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_1_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
708 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_RIGHT_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
709 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_LEFT_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
710 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_12_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
711 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_11_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
712 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_10_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
713 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_9_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
714 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_8_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
715 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_7_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
716 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_6_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
717 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_5_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
718 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_4_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
719 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_3_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
720 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_2_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
721 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_1_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
722 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND11_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
723 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND10_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
724 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND9_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
725 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND8_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
726 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND7_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
727 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND6_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
728 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND5_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
729 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND4_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
730 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND3_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
731 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND2_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
732 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND1_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
733 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND0_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
734 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND11.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
735 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND10.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
736 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND9.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
737 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND8.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
738 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND7.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
739 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND6.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
740 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND5.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
741 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND4.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
742 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND3.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
743 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND2.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
744 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND1.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
745 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND0.compizName, (gpointer) categories->KEYBINDING_COMMANDS);
746 g_hash_table_insert (extrawmHashTable, (gpointer) names->EXTRAWM_TOGGLE_FULLSCREEN_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
747 g_hash_table_insert (extrawmHashTable, (gpointer) names->EXTRAWM_TOGGLE_STICKY_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
748 g_hash_table_insert (staticswitcherHashTable, (gpointer) names->STATICSWITCHER_PREV_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
749 g_hash_table_insert (staticswitcherHashTable, (gpointer) names->STATICSWITCHER_NEXT_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
750 g_hash_table_insert (fadeHashTable, (gpointer) names->FADE_FULLSCREEN_VISUAL_BELL.compizName, (gpointer) categories->GENERAL);
751 g_hash_table_insert (fadeHashTable, (gpointer) names->FADE_VISUAL_BELL.compizName, (gpointer) categories->GENERAL);
752 g_hash_table_insert (specialHashTable, (gpointer) names->NULL_RESIZE_WITH_RIGHT_BUTTON.compizName, (gpointer) categories->GENERAL);
753 g_hash_table_insert (specialHashTable, (gpointer) names->NULL_MOUSE_BUTTON_MODIFIER.compizName, (gpointer) categories->GENERAL);
754 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_WINDOW_MENU_BUTTON.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
755 g_hash_table_insert (resizeHashTable, (gpointer) names->RESIZE_INITIATE_BUTTON.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
756 g_hash_table_insert (moveHashTable, (gpointer) names->MOVE_INITIATE_BUTTON.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
757 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_WINDOW_MENU_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
758 g_hash_table_insert (resizeHashTable, (gpointer) names->RESIZE_INITIATE_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
759 g_hash_table_insert (moveHashTable, (gpointer) names->MOVE_INITIATE_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
760 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_SHOW_DESKTOP_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
761 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_TOGGLE_WINDOW_SHADED_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
762 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_CLOSE_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
763 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_LOWER_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
764 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_RAISE_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
765 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_VERTICALLY_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
766 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_HORIZONTALLY_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
767 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_UNMAXIMIZE_OR_MINIMIZE_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
768 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
769 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MINIMIZE_WINDOW_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
770 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_TOGGLE_WINDOW_MAXIMIZED_KEY.compizName, (gpointer) categories->WINDOW_KEYBINDINGS);
771 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_COMMAND_TERMINAL_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
772 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_COMMAND_WINDOW_SCREENSHOT_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
773 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_COMMAND_SCREENSHOT_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
774 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_MAIN_MENU_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
775 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_KEY.compizName, (gpointer) categories->GLOBAL_KEYBINDINGS);
776
777 return masterHashTable;
778}
779
780
781GHashTable *
782ccsMATEIntegrationPopulateSpecialTypesHashTables ()
783{
784 GHashTable *masterHashTable = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, destroyHashTableInternal);
785 GHashTable *coreHashTable = g_hash_table_new (g_str_hash, g_str_equal);
786 GHashTable *thumbnailHashTable = g_hash_table_new (g_str_hash, g_str_equal);
787 GHashTable *matecompatHashTable = g_hash_table_new (g_str_hash, g_str_equal);
788 GHashTable *rotateHashTable = g_hash_table_new (g_str_hash, g_str_equal);
789 GHashTable *putHashTable = g_hash_table_new (g_str_hash, g_str_equal);
790 GHashTable *wallHashTable = g_hash_table_new (g_str_hash, g_str_equal);
791 GHashTable *vpswitchHashTable = g_hash_table_new (g_str_hash, g_str_equal);
792 GHashTable *commandsHashTable = g_hash_table_new (g_str_hash, g_str_equal);
793 GHashTable *extrawmHashTable = g_hash_table_new (g_str_hash, g_str_equal);
794 GHashTable *resizeHashTable = g_hash_table_new (g_str_hash, g_str_equal);
795 GHashTable *moveHashTable = g_hash_table_new (g_str_hash, g_str_equal);
796 GHashTable *staticswitcherHashTable = g_hash_table_new (g_str_hash, g_str_equal);
797 GHashTable *fadeHashTable = g_hash_table_new (g_str_hash, g_str_equal);
798 GHashTable *specialHashTable = g_hash_table_new (g_str_hash, g_str_equal);
799
800 const CCSMATEIntegratedSettingNames *names = &ccsMATEIntegratedSettingNames;
801 const CCSMATEIntegratedPluginNames *plugins = &ccsMATEIntegratedPluginNames;
802
803 g_hash_table_insert (masterHashTable, (gpointer) plugins->CORE, coreHashTable);
804 g_hash_table_insert (masterHashTable, (gpointer) plugins->THUMBNAIL, thumbnailHashTable);
805 g_hash_table_insert (masterHashTable, (gpointer) plugins->MATECOMPAT, matecompatHashTable);
806 g_hash_table_insert (masterHashTable, (gpointer) plugins->ROTATE, rotateHashTable);
807 g_hash_table_insert (masterHashTable, (gpointer) plugins->PUT, putHashTable);
808 g_hash_table_insert (masterHashTable, (gpointer) plugins->WALL, wallHashTable);
809 g_hash_table_insert (masterHashTable, (gpointer) plugins->VPSWITCH, vpswitchHashTable);
810 g_hash_table_insert (masterHashTable, (gpointer) plugins->COMMANDS, commandsHashTable);
811 g_hash_table_insert (masterHashTable, (gpointer) plugins->EXTRAWM, extrawmHashTable);
812 g_hash_table_insert (masterHashTable, (gpointer) plugins->STATICSWITCHER, staticswitcherHashTable);
813 g_hash_table_insert (masterHashTable, (gpointer) plugins->FADE, fadeHashTable);
814 g_hash_table_insert (masterHashTable, (gpointer) plugins->RESIZE, resizeHashTable);
815 g_hash_table_insert (masterHashTable, (gpointer) plugins->MOVE, moveHashTable);
816 g_hash_table_insert (masterHashTable, (gpointer) plugins->SPECIAL, specialHashTable);
817
818 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUDIBLE_BELL.compizName, GINT_TO_POINTER (OptionBool));
819 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_CLICK_TO_FOCUS.compizName, GINT_TO_POINTER (OptionSpecial));
820 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_RAISE_ON_CLICK.compizName, GINT_TO_POINTER (OptionBool));
821 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUTORAISE_DELAY.compizName, GINT_TO_POINTER (OptionInt));
822 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUTORAISE.compizName, GINT_TO_POINTER (OptionBool));
823 g_hash_table_insert (thumbnailHashTable, (gpointer) names->THUMBNAIL_CURRENT_VIEWPORT.compizName, GINT_TO_POINTER (OptionSpecial));
824 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_COMMAND_TERMINAL.compizName, GINT_TO_POINTER (OptionString));
825 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_COMMAND_WINDOW_SCREENSHOT.compizName, GINT_TO_POINTER (OptionString));
826 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_COMMAND_SCREENSHOT.compizName, GINT_TO_POINTER (OptionString));
827 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_RIGHT_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
828 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_LEFT_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
829 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_12_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
830 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_11_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
831 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_10_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
832 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_9_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
833 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_8_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
834 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_7_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
835 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_6_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
836 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_5_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
837 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_4_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
838 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_3_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
839 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_2_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
840 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_1_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
841 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_BOTTOM_KEY.compizName, GINT_TO_POINTER (OptionKey));
842 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_TOP_KEY.compizName, GINT_TO_POINTER (OptionKey));
843 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_RIGHT_KEY.compizName, GINT_TO_POINTER (OptionKey));
844 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_LEFT_KEY.compizName, GINT_TO_POINTER (OptionKey));
845 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_BOTTOMRIGHT_KEY.compizName, GINT_TO_POINTER (OptionKey));
846 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_BOTTOMLEFT_KEY.compizName, GINT_TO_POINTER (OptionKey));
847 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_TOPRIGHT_KEY.compizName, GINT_TO_POINTER (OptionKey));
848 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_TOPLEFT_KEY.compizName, GINT_TO_POINTER (OptionKey));
849 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_DOWN_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
850 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_UP_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
851 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_RIGHT_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
852 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_LEFT_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
853 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_RIGHT_KEY.compizName, GINT_TO_POINTER (OptionKey));
854 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_LEFT_KEY.compizName, GINT_TO_POINTER (OptionKey));
855 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_DOWN_KEY.compizName, GINT_TO_POINTER (OptionKey));
856 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_UP_KEY.compizName, GINT_TO_POINTER (OptionKey));
857 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_12_KEY.compizName, GINT_TO_POINTER (OptionKey));
858 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_11_KEY.compizName, GINT_TO_POINTER (OptionKey));
859 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_10_KEY.compizName, GINT_TO_POINTER (OptionKey));
860 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_9_KEY.compizName, GINT_TO_POINTER (OptionKey));
861 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_8_KEY.compizName, GINT_TO_POINTER (OptionKey));
862 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_7_KEY.compizName, GINT_TO_POINTER (OptionKey));
863 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_6_KEY.compizName, GINT_TO_POINTER (OptionKey));
864 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_5_KEY.compizName, GINT_TO_POINTER (OptionKey));
865 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_4_KEY.compizName, GINT_TO_POINTER (OptionKey));
866 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_3_KEY.compizName, GINT_TO_POINTER (OptionKey));
867 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_2_KEY.compizName, GINT_TO_POINTER (OptionKey));
868 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_1_KEY.compizName, GINT_TO_POINTER (OptionKey));
869 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_RIGHT_KEY.compizName, GINT_TO_POINTER (OptionKey));
870 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_LEFT_KEY.compizName, GINT_TO_POINTER (OptionKey));
871 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_12_KEY.compizName, GINT_TO_POINTER (OptionKey));
872 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_11_KEY.compizName, GINT_TO_POINTER (OptionKey));
873 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_10_KEY.compizName, GINT_TO_POINTER (OptionKey));
874 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_9_KEY.compizName, GINT_TO_POINTER (OptionKey));
875 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_8_KEY.compizName, GINT_TO_POINTER (OptionKey));
876 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_7_KEY.compizName, GINT_TO_POINTER (OptionKey));
877 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_6_KEY.compizName, GINT_TO_POINTER (OptionKey));
878 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_5_KEY.compizName, GINT_TO_POINTER (OptionKey));
879 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_4_KEY.compizName, GINT_TO_POINTER (OptionKey));
880 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_3_KEY.compizName, GINT_TO_POINTER (OptionKey));
881 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_2_KEY.compizName, GINT_TO_POINTER (OptionKey));
882 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_1_KEY.compizName, GINT_TO_POINTER (OptionKey));
883 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND11_KEY.compizName, GINT_TO_POINTER (OptionKey));
884 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND10_KEY.compizName, GINT_TO_POINTER (OptionKey));
885 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND9_KEY.compizName, GINT_TO_POINTER (OptionKey));
886 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND8_KEY.compizName, GINT_TO_POINTER (OptionKey));
887 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND7_KEY.compizName, GINT_TO_POINTER (OptionKey));
888 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND6_KEY.compizName, GINT_TO_POINTER (OptionKey));
889 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND5_KEY.compizName, GINT_TO_POINTER (OptionKey));
890 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND4_KEY.compizName, GINT_TO_POINTER (OptionKey));
891 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND3_KEY.compizName, GINT_TO_POINTER (OptionKey));
892 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND2_KEY.compizName, GINT_TO_POINTER (OptionKey));
893 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND1_KEY.compizName, GINT_TO_POINTER (OptionKey));
894 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND0_KEY.compizName, GINT_TO_POINTER (OptionKey));
895 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND11.compizName, GINT_TO_POINTER (OptionString));
896 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND10.compizName, GINT_TO_POINTER (OptionString));
897 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND9.compizName, GINT_TO_POINTER (OptionString));
898 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND8.compizName, GINT_TO_POINTER (OptionString));
899 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND7.compizName, GINT_TO_POINTER (OptionString));
900 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND6.compizName, GINT_TO_POINTER (OptionString));
901 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND5.compizName, GINT_TO_POINTER (OptionString));
902 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND4.compizName, GINT_TO_POINTER (OptionString));
903 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND3.compizName, GINT_TO_POINTER (OptionString));
904 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND2.compizName, GINT_TO_POINTER (OptionString));
905 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND1.compizName, GINT_TO_POINTER (OptionString));
906 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND0.compizName, GINT_TO_POINTER (OptionString));
907 g_hash_table_insert (extrawmHashTable, (gpointer) names->EXTRAWM_TOGGLE_FULLSCREEN_KEY.compizName, GINT_TO_POINTER (OptionKey));
908 g_hash_table_insert (extrawmHashTable, (gpointer) names->EXTRAWM_TOGGLE_STICKY_KEY.compizName, GINT_TO_POINTER (OptionKey));
909 g_hash_table_insert (staticswitcherHashTable, (gpointer) names->STATICSWITCHER_PREV_KEY.compizName, GINT_TO_POINTER (OptionKey));
910 g_hash_table_insert (staticswitcherHashTable, (gpointer) names->STATICSWITCHER_NEXT_KEY.compizName, GINT_TO_POINTER (OptionKey));
911 g_hash_table_insert (fadeHashTable, (gpointer) names->FADE_FULLSCREEN_VISUAL_BELL.compizName, GINT_TO_POINTER (OptionSpecial));
912 g_hash_table_insert (fadeHashTable, (gpointer) names->FADE_VISUAL_BELL.compizName, GINT_TO_POINTER (OptionBool));
913 g_hash_table_insert (specialHashTable, (gpointer) names->NULL_RESIZE_WITH_RIGHT_BUTTON.compizName, GINT_TO_POINTER (OptionSpecial));
914 g_hash_table_insert (specialHashTable, (gpointer) names->NULL_MOUSE_BUTTON_MODIFIER.compizName, GINT_TO_POINTER (OptionSpecial));
915 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_WINDOW_MENU_BUTTON.compizName, GINT_TO_POINTER (OptionSpecial));
916 g_hash_table_insert (resizeHashTable, (gpointer) names->RESIZE_INITIATE_BUTTON.compizName, GINT_TO_POINTER (OptionSpecial));
917 g_hash_table_insert (moveHashTable, (gpointer) names->MOVE_INITIATE_BUTTON.compizName, GINT_TO_POINTER (OptionSpecial));
918 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_WINDOW_MENU_KEY.compizName, GINT_TO_POINTER (OptionKey));
919 g_hash_table_insert (resizeHashTable, (gpointer) names->RESIZE_INITIATE_KEY.compizName, GINT_TO_POINTER (OptionKey));
920 g_hash_table_insert (moveHashTable, (gpointer) names->MOVE_INITIATE_KEY.compizName, GINT_TO_POINTER (OptionKey));
921 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_SHOW_DESKTOP_KEY.compizName, GINT_TO_POINTER (OptionKey));
922 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_TOGGLE_WINDOW_SHADED_KEY.compizName, GINT_TO_POINTER (OptionKey));
923 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_CLOSE_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
924 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_LOWER_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
925 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_RAISE_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
926 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_VERTICALLY_KEY.compizName, GINT_TO_POINTER (OptionKey));
927 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_HORIZONTALLY_KEY.compizName, GINT_TO_POINTER (OptionKey));
928 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_UNMAXIMIZE_OR_MINIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
929 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
930 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MINIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey));
931 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_TOGGLE_WINDOW_MAXIMIZED_KEY.compizName, GINT_TO_POINTER (OptionKey));
932 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_COMMAND_TERMINAL_KEY.compizName, GINT_TO_POINTER (OptionSpecial));
933 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_COMMAND_WINDOW_SCREENSHOT_KEY.compizName, GINT_TO_POINTER (OptionSpecial));
934 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_COMMAND_SCREENSHOT_KEY.compizName, GINT_TO_POINTER (OptionSpecial));
935 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_MAIN_MENU_KEY.compizName, GINT_TO_POINTER (OptionKey));
936 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_KEY.compizName, GINT_TO_POINTER (OptionKey));
937
938 return masterHashTable;
939}
940
941GHashTable *
942ccsMATEIntegrationPopulateSettingNameToMATENameHashTables ()
943{
944 GHashTable *masterHashTable = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, destroyHashTableInternal);
945 GHashTable *coreHashTable = g_hash_table_new (g_str_hash, g_str_equal);
946 GHashTable *thumbnailHashTable = g_hash_table_new (g_str_hash, g_str_equal);
947 GHashTable *matecompatHashTable = g_hash_table_new (g_str_hash, g_str_equal);
948 GHashTable *rotateHashTable = g_hash_table_new (g_str_hash, g_str_equal);
949 GHashTable *putHashTable = g_hash_table_new (g_str_hash, g_str_equal);
950 GHashTable *wallHashTable = g_hash_table_new (g_str_hash, g_str_equal);
951 GHashTable *vpswitchHashTable = g_hash_table_new (g_str_hash, g_str_equal);
952 GHashTable *commandsHashTable = g_hash_table_new (g_str_hash, g_str_equal);
953 GHashTable *extrawmHashTable = g_hash_table_new (g_str_hash, g_str_equal);
954 GHashTable *resizeHashTable = g_hash_table_new (g_str_hash, g_str_equal);
955 GHashTable *moveHashTable = g_hash_table_new (g_str_hash, g_str_equal);
956 GHashTable *staticswitcherHashTable = g_hash_table_new (g_str_hash, g_str_equal);
957 GHashTable *fadeHashTable = g_hash_table_new (g_str_hash, g_str_equal);
958 GHashTable *specialHashTable = g_hash_table_new (g_str_hash, g_str_equal);
959
960 const CCSMATEIntegratedSettingNames *names = &ccsMATEIntegratedSettingNames;
961 const CCSMATEIntegratedPluginNames *plugins = &ccsMATEIntegratedPluginNames;
962
963 g_hash_table_insert (masterHashTable, (gpointer) plugins->CORE, coreHashTable);
964 g_hash_table_insert (masterHashTable, (gpointer) plugins->THUMBNAIL, thumbnailHashTable);
965 g_hash_table_insert (masterHashTable, (gpointer) plugins->MATECOMPAT, matecompatHashTable);
966 g_hash_table_insert (masterHashTable, (gpointer) plugins->ROTATE, rotateHashTable);
967 g_hash_table_insert (masterHashTable, (gpointer) plugins->PUT, putHashTable);
968 g_hash_table_insert (masterHashTable, (gpointer) plugins->WALL, wallHashTable);
969 g_hash_table_insert (masterHashTable, (gpointer) plugins->VPSWITCH, vpswitchHashTable);
970 g_hash_table_insert (masterHashTable, (gpointer) plugins->COMMANDS, commandsHashTable);
971 g_hash_table_insert (masterHashTable, (gpointer) plugins->EXTRAWM, extrawmHashTable);
972 g_hash_table_insert (masterHashTable, (gpointer) plugins->STATICSWITCHER, staticswitcherHashTable);
973 g_hash_table_insert (masterHashTable, (gpointer) plugins->FADE, fadeHashTable);
974 g_hash_table_insert (masterHashTable, (gpointer) plugins->RESIZE, resizeHashTable);
975 g_hash_table_insert (masterHashTable, (gpointer) plugins->MOVE, moveHashTable);
976 g_hash_table_insert (masterHashTable, (gpointer) plugins->SPECIAL, specialHashTable);
977
978 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUDIBLE_BELL.compizName, (gpointer) names->CORE_AUDIBLE_BELL.mateName);
979 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_CLICK_TO_FOCUS.compizName, (gpointer) names->CORE_CLICK_TO_FOCUS.mateName);
980 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_RAISE_ON_CLICK.compizName, (gpointer) names->CORE_RAISE_ON_CLICK.mateName);
981 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUTORAISE_DELAY.compizName, (gpointer) names->CORE_AUTORAISE_DELAY.mateName);
982 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUTORAISE.compizName, (gpointer) names->CORE_AUTORAISE.mateName);
983 g_hash_table_insert (thumbnailHashTable, (gpointer) names->THUMBNAIL_CURRENT_VIEWPORT.compizName, (gpointer) names->THUMBNAIL_CURRENT_VIEWPORT.mateName);
984 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_COMMAND_TERMINAL.compizName, (gpointer) names->MATECOMPAT_COMMAND_TERMINAL.mateName);
985 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_COMMAND_WINDOW_SCREENSHOT.compizName, (gpointer) names->MATECOMPAT_COMMAND_WINDOW_SCREENSHOT.mateName);
986 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_COMMAND_SCREENSHOT.compizName, (gpointer) names->MATECOMPAT_COMMAND_SCREENSHOT.mateName);
987 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_RIGHT_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_RIGHT_WINDOW_KEY.mateName);
988 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_LEFT_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_LEFT_WINDOW_KEY.mateName);
989 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_12_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_12_WINDOW_KEY.mateName);
990 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_11_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_11_WINDOW_KEY.mateName);
991 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_10_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_10_WINDOW_KEY.mateName);
992 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_9_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_9_WINDOW_KEY.mateName);
993 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_8_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_8_WINDOW_KEY.mateName);
994 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_7_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_7_WINDOW_KEY.mateName);
995 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_6_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_6_WINDOW_KEY.mateName);
996 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_5_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_5_WINDOW_KEY.mateName);
997 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_4_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_4_WINDOW_KEY.mateName);
998 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_3_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_3_WINDOW_KEY.mateName);
999 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_2_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_2_WINDOW_KEY.mateName);
1000 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_1_WINDOW_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_1_WINDOW_KEY.mateName);
1001 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_BOTTOM_KEY.compizName, (gpointer) names->PUT_PUT_BOTTOM_KEY.mateName);
1002 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_TOP_KEY.compizName, (gpointer) names->PUT_PUT_TOP_KEY.mateName);
1003 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_RIGHT_KEY.compizName, (gpointer) names->PUT_PUT_RIGHT_KEY.mateName);
1004 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_LEFT_KEY.compizName, (gpointer) names->PUT_PUT_LEFT_KEY.mateName);
1005 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_BOTTOMRIGHT_KEY.compizName, (gpointer) names->PUT_PUT_BOTTOMRIGHT_KEY.mateName);
1006 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_BOTTOMLEFT_KEY.compizName, (gpointer) names->PUT_PUT_BOTTOMLEFT_KEY.mateName);
1007 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_TOPRIGHT_KEY.compizName, (gpointer) names->PUT_PUT_TOPRIGHT_KEY.mateName);
1008 g_hash_table_insert (putHashTable, (gpointer) names->PUT_PUT_TOPLEFT_KEY.compizName, (gpointer) names->PUT_PUT_TOPLEFT_KEY.mateName);
1009 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_DOWN_WINDOW_KEY.compizName, (gpointer) names->WALL_DOWN_WINDOW_KEY.mateName);
1010 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_UP_WINDOW_KEY.compizName, (gpointer) names->WALL_UP_WINDOW_KEY.mateName);
1011 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_RIGHT_WINDOW_KEY.compizName, (gpointer) names->WALL_RIGHT_WINDOW_KEY.mateName);
1012 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_LEFT_WINDOW_KEY.compizName, (gpointer) names->WALL_LEFT_WINDOW_KEY.mateName);
1013 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_RIGHT_KEY.compizName, (gpointer) names->WALL_RIGHT_KEY.mateName);
1014 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_LEFT_KEY.compizName, (gpointer) names->WALL_LEFT_KEY.mateName);
1015 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_DOWN_KEY.compizName, (gpointer) names->WALL_DOWN_KEY.mateName);
1016 g_hash_table_insert (wallHashTable, (gpointer) names->WALL_UP_KEY.compizName, (gpointer) names->WALL_UP_KEY.mateName);
1017 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_12_KEY.compizName, (gpointer) names->VPSWITCH_SWITCH_TO_12_KEY.mateName);
1018 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_11_KEY.compizName, (gpointer) names->VPSWITCH_SWITCH_TO_11_KEY.mateName);
1019 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_10_KEY.compizName, (gpointer) names->VPSWITCH_SWITCH_TO_10_KEY.mateName);
1020 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_9_KEY.compizName, (gpointer) names->VPSWITCH_SWITCH_TO_9_KEY.mateName);
1021 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_8_KEY.compizName, (gpointer) names->VPSWITCH_SWITCH_TO_8_KEY.mateName);
1022 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_7_KEY.compizName, (gpointer) names->VPSWITCH_SWITCH_TO_7_KEY.mateName);
1023 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_6_KEY.compizName, (gpointer) names->VPSWITCH_SWITCH_TO_6_KEY.mateName);
1024 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_5_KEY.compizName, (gpointer) names->VPSWITCH_SWITCH_TO_5_KEY.mateName);
1025 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_4_KEY.compizName, (gpointer) names->VPSWITCH_SWITCH_TO_4_KEY.mateName);
1026 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_3_KEY.compizName, (gpointer) names->VPSWITCH_SWITCH_TO_3_KEY.mateName);
1027 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_2_KEY.compizName, (gpointer) names->VPSWITCH_SWITCH_TO_2_KEY.mateName);
1028 g_hash_table_insert (vpswitchHashTable, (gpointer) names->VPSWITCH_SWITCH_TO_1_KEY.compizName, (gpointer) names->VPSWITCH_SWITCH_TO_1_KEY.mateName);
1029 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_RIGHT_KEY.compizName, (gpointer) names->ROTATE_ROTATE_RIGHT_KEY.mateName);
1030 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_LEFT_KEY.compizName, (gpointer) names->ROTATE_ROTATE_LEFT_KEY.mateName);
1031 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_12_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_12_KEY.mateName);
1032 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_11_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_11_KEY.mateName);
1033 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_10_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_10_KEY.mateName);
1034 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_9_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_9_KEY.mateName);
1035 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_8_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_8_KEY.mateName);
1036 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_7_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_7_KEY.mateName);
1037 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_6_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_6_KEY.mateName);
1038 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_5_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_5_KEY.mateName);
1039 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_4_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_4_KEY.mateName);
1040 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_3_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_3_KEY.mateName);
1041 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_2_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_2_KEY.mateName);
1042 g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_TO_1_KEY.compizName, (gpointer) names->ROTATE_ROTATE_TO_1_KEY.mateName);
1043 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND11_KEY.compizName, (gpointer) names->COMMANDS_RUN_COMMAND11_KEY.mateName);
1044 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND10_KEY.compizName, (gpointer) names->COMMANDS_RUN_COMMAND10_KEY.mateName);
1045 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND9_KEY.compizName, (gpointer) names->COMMANDS_RUN_COMMAND9_KEY.mateName);
1046 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND8_KEY.compizName, (gpointer) names->COMMANDS_RUN_COMMAND8_KEY.mateName);
1047 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND7_KEY.compizName, (gpointer) names->COMMANDS_RUN_COMMAND7_KEY.mateName);
1048 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND6_KEY.compizName, (gpointer) names->COMMANDS_RUN_COMMAND6_KEY.mateName);
1049 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND5_KEY.compizName, (gpointer) names->COMMANDS_RUN_COMMAND5_KEY.mateName);
1050 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND4_KEY.compizName, (gpointer) names->COMMANDS_RUN_COMMAND4_KEY.mateName);
1051 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND3_KEY.compizName, (gpointer) names->COMMANDS_RUN_COMMAND3_KEY.mateName);
1052 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND2_KEY.compizName, (gpointer) names->COMMANDS_RUN_COMMAND2_KEY.mateName);
1053 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND1_KEY.compizName, (gpointer) names->COMMANDS_RUN_COMMAND1_KEY.mateName);
1054 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_RUN_COMMAND0_KEY.compizName, (gpointer) names->COMMANDS_RUN_COMMAND0_KEY.mateName);
1055 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND11.compizName, (gpointer) names->COMMANDS_COMMAND11.mateName);
1056 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND10.compizName, (gpointer) names->COMMANDS_COMMAND10.mateName);
1057 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND9.compizName, (gpointer) names->COMMANDS_COMMAND9.mateName);
1058 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND8.compizName, (gpointer) names->COMMANDS_COMMAND8.mateName);
1059 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND7.compizName, (gpointer) names->COMMANDS_COMMAND7.mateName);
1060 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND6.compizName, (gpointer) names->COMMANDS_COMMAND6.mateName);
1061 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND5.compizName, (gpointer) names->COMMANDS_COMMAND5.mateName);
1062 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND4.compizName, (gpointer) names->COMMANDS_COMMAND4.mateName);
1063 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND3.compizName, (gpointer) names->COMMANDS_COMMAND3.mateName);
1064 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND2.compizName, (gpointer) names->COMMANDS_COMMAND2.mateName);
1065 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND1.compizName, (gpointer) names->COMMANDS_COMMAND1.mateName);
1066 g_hash_table_insert (commandsHashTable, (gpointer) names->COMMANDS_COMMAND0.compizName, (gpointer) names->COMMANDS_COMMAND0.mateName);
1067 g_hash_table_insert (extrawmHashTable, (gpointer) names->EXTRAWM_TOGGLE_FULLSCREEN_KEY.compizName, (gpointer) names->EXTRAWM_TOGGLE_FULLSCREEN_KEY.mateName);
1068 g_hash_table_insert (extrawmHashTable, (gpointer) names->EXTRAWM_TOGGLE_STICKY_KEY.compizName, (gpointer) names->EXTRAWM_TOGGLE_STICKY_KEY.mateName);
1069 g_hash_table_insert (staticswitcherHashTable, (gpointer) names->STATICSWITCHER_PREV_KEY.compizName, (gpointer) names->STATICSWITCHER_PREV_KEY.mateName);
1070 g_hash_table_insert (staticswitcherHashTable, (gpointer) names->STATICSWITCHER_NEXT_KEY.compizName, (gpointer) names->STATICSWITCHER_NEXT_KEY.mateName);
1071 g_hash_table_insert (fadeHashTable, (gpointer) names->FADE_FULLSCREEN_VISUAL_BELL.compizName, (gpointer) names->FADE_FULLSCREEN_VISUAL_BELL.mateName);
1072 g_hash_table_insert (fadeHashTable, (gpointer) names->FADE_VISUAL_BELL.compizName, (gpointer) names->FADE_VISUAL_BELL.mateName);
1073 g_hash_table_insert (specialHashTable, (gpointer) names->NULL_RESIZE_WITH_RIGHT_BUTTON.compizName, (gpointer) names->NULL_RESIZE_WITH_RIGHT_BUTTON.mateName);
1074 g_hash_table_insert (specialHashTable, (gpointer) names->NULL_MOUSE_BUTTON_MODIFIER.compizName, (gpointer) names->NULL_MOUSE_BUTTON_MODIFIER.mateName);
1075 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_WINDOW_MENU_BUTTON.compizName, (gpointer) names->CORE_WINDOW_MENU_BUTTON.mateName);
1076 g_hash_table_insert (resizeHashTable, (gpointer) names->RESIZE_INITIATE_BUTTON.compizName, (gpointer) names->RESIZE_INITIATE_BUTTON.mateName);
1077 g_hash_table_insert (moveHashTable, (gpointer) names->MOVE_INITIATE_BUTTON.compizName, (gpointer) names->MOVE_INITIATE_BUTTON.mateName);
1078 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_WINDOW_MENU_KEY.compizName, (gpointer) names->CORE_WINDOW_MENU_KEY.mateName);
1079 g_hash_table_insert (resizeHashTable, (gpointer) names->RESIZE_INITIATE_KEY.compizName, (gpointer) names->RESIZE_INITIATE_KEY.mateName);
1080 g_hash_table_insert (moveHashTable, (gpointer) names->MOVE_INITIATE_KEY.compizName, (gpointer) names->MOVE_INITIATE_KEY.mateName);
1081 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_SHOW_DESKTOP_KEY.compizName, (gpointer) names->CORE_SHOW_DESKTOP_KEY.mateName);
1082 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_TOGGLE_WINDOW_SHADED_KEY.compizName, (gpointer) names->CORE_TOGGLE_WINDOW_SHADED_KEY.mateName);
1083 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_CLOSE_WINDOW_KEY.compizName, (gpointer) names->CORE_CLOSE_WINDOW_KEY.mateName);
1084 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_LOWER_WINDOW_KEY.compizName, (gpointer) names->CORE_LOWER_WINDOW_KEY.mateName);
1085 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_RAISE_WINDOW_KEY.compizName, (gpointer) names->CORE_RAISE_WINDOW_KEY.mateName);
1086 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_VERTICALLY_KEY.compizName, (gpointer) names->CORE_MAXIMIZE_WINDOW_VERTICALLY_KEY.mateName);
1087 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_HORIZONTALLY_KEY.compizName, (gpointer) names->CORE_MAXIMIZE_WINDOW_HORIZONTALLY_KEY.mateName);
1088 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_UNMAXIMIZE_OR_MINIMIZE_WINDOW_KEY.compizName, (gpointer) names->CORE_UNMAXIMIZE_OR_MINIMIZE_WINDOW_KEY.mateName);
1089 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_KEY.compizName, (gpointer) names->CORE_MAXIMIZE_WINDOW_KEY.mateName);
1090 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MINIMIZE_WINDOW_KEY.compizName, (gpointer) names->CORE_MINIMIZE_WINDOW_KEY.mateName);
1091 g_hash_table_insert (coreHashTable, (gpointer) names->CORE_TOGGLE_WINDOW_MAXIMIZED_KEY.compizName, (gpointer) names->CORE_TOGGLE_WINDOW_MAXIMIZED_KEY.mateName);
1092 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_COMMAND_TERMINAL_KEY.compizName, (gpointer) names->MATECOMPAT_RUN_COMMAND_TERMINAL_KEY.mateName);
1093 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_COMMAND_WINDOW_SCREENSHOT_KEY.compizName, (gpointer) names->MATECOMPAT_RUN_COMMAND_WINDOW_SCREENSHOT_KEY.mateName);
1094 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_COMMAND_SCREENSHOT_KEY.compizName, (gpointer) names->MATECOMPAT_RUN_COMMAND_SCREENSHOT_KEY.mateName);
1095 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_MAIN_MENU_KEY.compizName, (gpointer) names->MATECOMPAT_MAIN_MENU_KEY.mateName);
1096 g_hash_table_insert (matecompatHashTable, (gpointer) names->MATECOMPAT_RUN_KEY.compizName, (gpointer) names->MATECOMPAT_RUN_KEY.mateName);
1097
1098 return masterHashTable;
1099}
11000
=== removed directory 'compizconfig/integration/mate/tests'
=== removed file 'compizconfig/integration/mate/tests/CMakeLists.txt'
--- compizconfig/integration/mate/tests/CMakeLists.txt 2015-07-30 19:56:19 +0000
+++ compizconfig/integration/mate/tests/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,46 +0,0 @@
1include_directories (${GTEST_INCLUDE_DIRS})
2include_directories (${CMAKE_SOURCE_DIR}/include)
3include_directories (${CMAKE_SOURCE_DIR}/tests/shared)
4include_directories (${CMAKE_SOURCE_DIR}/tests/shared/glib)
5include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../../../mocks/libcompizconfig)
6include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../../../gsettings/tests)
7include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../../../gsettings/mocks)
8include_directories (${CMAKE_SOURCE_DIR}/compizconfig/tests)
9link_directories (${CMAKE_INSTALL_PREFIX}/lib)
10
11set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
12
13add_library (compizconfig_ccs_mock_mate_integrated_setting_composition
14 ${CMAKE_CURRENT_SOURCE_DIR}/compizconfig_ccs_mock_mate_integrated_setting_composition.c)
15
16target_link_libraries (compizconfig_ccs_mock_mate_integrated_setting_composition
17 compizconfig_ccs_integrated_setting_mock
18 compizconfig_mate_integrated_setting
19 compizconfig)
20
21add_executable (compizconfig_test_ccs_mate_integration
22 ${CMAKE_CURRENT_SOURCE_DIR}/compizconfig_test_ccs_mate_integration.cpp)
23
24target_link_libraries (compizconfig_test_ccs_mate_integration
25 ${GTEST_BOTH_LIBRARIES}
26 ${GMOCK_LIBRARY}
27 ${GMOCK_MAIN_LIBRARY}
28 ${LIBCOMPIZCONFIG_LIBRARIES}
29 compizconfig
30 compizconfig_ccs_context_mock
31 compizconfig_ccs_backend_mock
32 compizconfig_ccs_setting_mock
33 compizconfig_ccs_plugin_mock
34 compizconfig_ccs_list_wrapper
35 compizconfig_ccs_setting_value_operators
36 compizconfig_ccs_setting_value_matcher
37 compizconfig_ccs_integrated_setting_mock
38 compizconfig_ccs_integrated_setting_factory_mock
39 compizconfig_ccs_integrated_setting_storage_mock
40 compizconfig_ccs_mock_mate_integrated_setting_composition
41 compizconfig_mate_integration)
42
43compiz_discover_tests (compizconfig_test_ccs_mate_integration
44 COVERAGE
45 compizconfig_mate_integration
46 compizconfig_mate_integration_constants)
470
=== removed file 'compizconfig/integration/mate/tests/compizconfig_ccs_mock_mate_integrated_setting_composition.c'
--- compizconfig/integration/mate/tests/compizconfig_ccs_mock_mate_integrated_setting_composition.c 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/tests/compizconfig_ccs_mock_mate_integrated_setting_composition.c 1970-01-01 00:00:00 +0000
@@ -1,220 +0,0 @@
1/*
2 * Compiz configuration system library
3 *
4 * Copyright (C) 2012 Canonical Ltd.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 * Authored By:
21 * Sam Spilsbury <sam.spilsbury@canonical.com>
22 */
23
24#include <ccs.h>
25#include <ccs-backend.h>
26#include <ccs_mate_integrated_setting.h>
27#include "compizconfig_ccs_mock_mate_integrated_setting_composition.h"
28
29typedef struct _CCSMockMATEIntegratedSettingCompositionPrivate
30{
31 CCSIntegratedSetting *integratedSetting;
32 CCSMATEIntegratedSettingInfo *mateIntegratedSettingInfo;
33 CCSIntegratedSettingInfo *integratedSettingInfo;
34} CCSMockMATEIntegratedSettingCompositionPrivate;
35
36static CCSIntegratedSetting *
37allocateCCSIntegratedSetting (CCSObjectAllocationInterface *allocator)
38{
39 CCSIntegratedSetting *setting =
40 (*allocator->calloc_) (allocator->allocator,
41 1,
42 sizeof (CCSIntegratedSetting));
43
44 ccsObjectInit (setting, allocator);
45
46 return setting;
47}
48
49static CCSMockMATEIntegratedSettingCompositionPrivate *
50allocatePrivate (CCSIntegratedSetting *integratedSetting,
51 CCSObjectAllocationInterface *allocator)
52{
53 CCSMockMATEIntegratedSettingCompositionPrivate *priv =
54 (*allocator->calloc_) (allocator->allocator,
55 1,
56 sizeof (CCSMockMATEIntegratedSettingCompositionPrivate));
57
58 if (!priv)
59 {
60 ccsObjectFinalize (integratedSetting);
61 (*allocator->free_) (allocator->allocator, integratedSetting);
62 return NULL;
63 }
64
65 return priv;
66}
67
68static SpecialOptionType
69ccsMockCompositionIntegratedSettingGetSpecialOptionType (CCSMATEIntegratedSettingInfo *setting)
70{
71 CCSMockMATEIntegratedSettingCompositionPrivate *priv = GET_PRIVATE (CCSMockMATEIntegratedSettingCompositionPrivate, setting);
72
73 return ccsMATEIntegratedSettingInfoGetSpecialOptionType (priv->mateIntegratedSettingInfo);
74}
75
76static const char *
77ccsMockCompositionIntegratedSettingGetMATEName (CCSMATEIntegratedSettingInfo *setting)
78{
79 CCSMockMATEIntegratedSettingCompositionPrivate *priv = GET_PRIVATE (CCSMockMATEIntegratedSettingCompositionPrivate, setting);
80
81 return ccsMATEIntegratedSettingInfoGetMATEName (priv->mateIntegratedSettingInfo);
82}
83
84static CCSSettingValue *
85ccsMockCompositionIntegratedSettingReadValue (CCSIntegratedSetting *setting, CCSSettingType type)
86{
87 CCSMockMATEIntegratedSettingCompositionPrivate *priv =
88 GET_PRIVATE (CCSMockMATEIntegratedSettingCompositionPrivate, setting);
89
90 return ccsIntegratedSettingReadValue (priv->integratedSetting, type);
91}
92
93static void
94ccsMockCompositionIntegratedSettingWriteValue (CCSIntegratedSetting *setting, CCSSettingValue *v, CCSSettingType type)
95{
96 CCSMockMATEIntegratedSettingCompositionPrivate *priv =
97 GET_PRIVATE (CCSMockMATEIntegratedSettingCompositionPrivate, setting);
98
99 ccsIntegratedSettingWriteValue (priv->integratedSetting, v, type);
100}
101
102static const char *
103ccsMockCompositionIntegratedSettingInfoPluginName (CCSIntegratedSettingInfo *setting)
104{
105 CCSMockMATEIntegratedSettingCompositionPrivate *priv = GET_PRIVATE (CCSMockMATEIntegratedSettingCompositionPrivate, setting);
106
107 return ccsIntegratedSettingInfoPluginName (priv->integratedSettingInfo);
108}
109
110static const char *
111ccsMockCompositionIntegratedSettingInfoSettingName (CCSIntegratedSettingInfo *setting)
112{
113 CCSMockMATEIntegratedSettingCompositionPrivate *priv = GET_PRIVATE (CCSMockMATEIntegratedSettingCompositionPrivate, setting);
114
115 return ccsIntegratedSettingInfoSettingName (priv->integratedSettingInfo);
116}
117
118static CCSSettingType
119ccsMockCompositionIntegratedSettingInfoGetType (CCSIntegratedSettingInfo *setting)
120{
121 CCSMockMATEIntegratedSettingCompositionPrivate *priv = GET_PRIVATE (CCSMockMATEIntegratedSettingCompositionPrivate, setting);
122
123 return ccsIntegratedSettingInfoGetType (priv->integratedSettingInfo);
124}
125
126static void
127ccsMockCompositionIntegratedSettingFree (CCSIntegratedSetting *integratedSetting)
128{
129 CCSMockMATEIntegratedSettingCompositionPrivate *priv =
130 GET_PRIVATE (CCSMockMATEIntegratedSettingCompositionPrivate, integratedSetting);
131
132 ccsIntegratedSettingUnref (priv->integratedSetting);
133 ccsMATEIntegratedSettingInfoUnref (priv->mateIntegratedSettingInfo);
134
135 ccsObjectFinalize (integratedSetting);
136 (*integratedSetting->object.object_allocation->free_)
137 (integratedSetting->object.object_allocation->allocator, integratedSetting);
138}
139
140static void
141ccsMockCompositionIntegratedSettingInfoFree (CCSIntegratedSettingInfo *info)
142{
143 return ccsMockCompositionIntegratedSettingFree ((CCSIntegratedSetting *) info);
144}
145
146static void
147ccsMockCompositionMATEIntegratedSettingInfoFree (CCSMATEIntegratedSettingInfo *info)
148{
149 return ccsMockCompositionIntegratedSettingFree ((CCSIntegratedSetting *) info);
150}
151
152const CCSMATEIntegratedSettingInfoInterface ccsMockCompositionMATEIntegratedSettingInfo =
153{
154 ccsMockCompositionIntegratedSettingGetSpecialOptionType,
155 ccsMockCompositionIntegratedSettingGetMATEName,
156 ccsMockCompositionMATEIntegratedSettingInfoFree
157};
158
159const CCSIntegratedSettingInterface ccsMockCompositionIntegratedSetting =
160{
161 ccsMockCompositionIntegratedSettingReadValue,
162 ccsMockCompositionIntegratedSettingWriteValue,
163 ccsMockCompositionIntegratedSettingFree
164};
165
166const CCSIntegratedSettingInfoInterface ccsMockCompositionIntegratedSettingInfo =
167{
168 ccsMockCompositionIntegratedSettingInfoPluginName,
169 ccsMockCompositionIntegratedSettingInfoSettingName,
170 ccsMockCompositionIntegratedSettingInfoGetType,
171 ccsMockCompositionIntegratedSettingInfoFree
172};
173
174CCSIntegratedSetting *
175ccsMockCompositionIntegratedSettingNew (CCSIntegratedSetting *integratedSetting,
176 CCSMATEIntegratedSettingInfo *mateInfo,
177 CCSIntegratedSettingInfo *settingInfo,
178 CCSObjectAllocationInterface *allocator)
179{
180 CCSIntegratedSetting *composition = allocateCCSIntegratedSetting (allocator);
181
182 if (!composition)
183 return NULL;
184
185 CCSMockMATEIntegratedSettingCompositionPrivate *priv = allocatePrivate (composition,
186 allocator);
187
188 if (!priv)
189 return NULL;
190
191 const CCSInterface *integratedSettingImpl =
192 (const CCSInterface *) (&ccsMockCompositionIntegratedSetting);
193 const CCSInterface *integratedSettingInfoImpl =
194 (const CCSInterface *) (&ccsMockCompositionIntegratedSettingInfo);
195 const CCSInterface *mateSettingImpl =
196 (const CCSInterface *) (&ccsMockCompositionMATEIntegratedSettingInfo);
197
198 priv->integratedSetting = integratedSetting;
199 priv->mateIntegratedSettingInfo = mateInfo;
200 priv->integratedSettingInfo = settingInfo;
201
202 ccsIntegratedSettingRef (priv->integratedSetting);
203 ccsMATEIntegratedSettingInfoRef (priv->mateIntegratedSettingInfo);
204
205 ccsObjectSetPrivate (composition, (CCSPrivate *) (priv));
206 ccsObjectAddInterface (composition,
207 integratedSettingImpl,
208 GET_INTERFACE_TYPE (CCSIntegratedSettingInterface));
209 ccsObjectAddInterface (composition,
210 integratedSettingInfoImpl,
211 GET_INTERFACE_TYPE (CCSIntegratedSettingInfoInterface));
212 ccsObjectAddInterface (composition,
213 mateSettingImpl,
214 GET_INTERFACE_TYPE (CCSMATEIntegratedSettingInfoInterface));
215
216 ccsObjectRef (composition);
217
218 return composition;
219}
220
2210
=== removed file 'compizconfig/integration/mate/tests/compizconfig_ccs_mock_mate_integrated_setting_composition.h'
--- compizconfig/integration/mate/tests/compizconfig_ccs_mock_mate_integrated_setting_composition.h 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/tests/compizconfig_ccs_mock_mate_integrated_setting_composition.h 1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
1/*
2 * Compiz configuration system library
3 *
4 * Copyright (C) 2012 Canonical Ltd.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 * Authored By:
21 * Sam Spilsbury <sam.spilsbury@canonical.com>
22 */
23#ifndef _COMPIZCONFIG_CCS_MOCK_MATE_INTEGRATED_SETTING_COMPOSITION_H
24#define _COMPIZCONFIG_CCS_MOCK_MATE_INTEGRATED_SETTING_COMPOSITION_H
25
26#include <ccs-defs.h>
27#include <ccs-fwd.h>
28#include <ccs_mate_fwd.h>
29
30COMPIZCONFIG_BEGIN_DECLS
31
32CCSIntegratedSetting *
33ccsMockCompositionIntegratedSettingNew (CCSIntegratedSetting *integratedSetting,
34 CCSMATEIntegratedSettingInfo *mateInfo,
35 CCSIntegratedSettingInfo *settingInfo,
36 CCSObjectAllocationInterface *allocator);
37
38COMPIZCONFIG_END_DECLS
39
40#endif
41
420
=== removed file 'compizconfig/integration/mate/tests/compizconfig_test_ccs_mate_integration.cpp'
--- compizconfig/integration/mate/tests/compizconfig_test_ccs_mate_integration.cpp 2015-02-04 22:20:18 +0000
+++ compizconfig/integration/mate/tests/compizconfig_test_ccs_mate_integration.cpp 1970-01-01 00:00:00 +0000
@@ -1,981 +0,0 @@
1/*
2 * Compiz configuration system library
3 *
4 * Copyright (C) 2012 Canonical Ltd.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 * Authored By:
21 * Sam Spilsbury <sam.spilsbury@canonical.com>
22 */
23#include <tr1/tuple>
24
25#include <gtest/gtest.h>
26#include <gmock/gmock.h>
27
28#include <boost/shared_ptr.hpp>
29#include <boost/make_shared.hpp>
30
31#include <gtest_shared_autodestroy.h>
32#include <gtest_unspecified_bool_type_matcher.h>
33
34#include <compizconfig_ccs_list_wrapper.h>
35#include <compizconfig_ccs_setting_value_operators.h>
36
37#include <ccs.h>
38#include <ccs-backend.h>
39#include <ccs_mate_integrated_setting.h>
40#include <ccs_mate_integration.h>
41#include <ccs_mate_integration_constants.h>
42#include <compizconfig_ccs_context_mock.h>
43#include <compizconfig_ccs_setting_mock.h>
44#include <compizconfig_ccs_plugin_mock.h>
45#include <compizconfig_ccs_backend_mock.h>
46#include <compizconfig_ccs_integrated_setting_factory_mock.h>
47#include <compizconfig_ccs_integrated_setting_storage_mock.h>
48#include <compizconfig_ccs_integrated_setting_mock.h>
49#include "compizconfig_ccs_mock_mate_integrated_setting_composition.h"
50#include "compizconfig_ccs_setting_value_matcher.h"
51
52namespace cc = compiz::config;
53namespace cci = compiz::config::impl;
54
55using ::testing::Pointee;
56using ::testing::Eq;
57using ::testing::Return;
58using ::testing::ReturnNull;
59using ::testing::SetArgPointee;
60using ::testing::DoAll;
61using ::testing::Values;
62using ::testing::WithParamInterface;
63using ::testing::_;
64
65namespace
66{
67 typedef std::tr1::tuple <CCSIntegratedSettingGMock &,
68 boost::shared_ptr <CCSIntegratedSetting> > IntegratedSettingWithMock;
69
70 typedef boost::shared_ptr <IntegratedSettingWithMock> IntegratedSettingWithMockPtr;
71
72 IntegratedSettingWithMockPtr
73 createIntegratedSettingCompositionFromMock (const std::string &plugin,
74 const std::string &setting,
75 CCSSettingType type,
76 SpecialOptionType mateType,
77 const std::string &mateName,
78 CCSObjectAllocationInterface *allocator)
79 {
80 CCSIntegratedSettingInfo *integratedSettingInfo =
81 ccsSharedIntegratedSettingInfoNew (plugin.c_str (),
82 setting.c_str (),
83 type,
84 allocator);
85 /* This takes ownership of integratedSettingInfo */
86 CCSMATEIntegratedSettingInfo *mateIntegratedSettingInfo =
87 ccsMATEIntegratedSettingInfoNew (integratedSettingInfo,
88 mateType,
89 mateName.c_str (),
90 allocator);
91 CCSIntegratedSetting *integratedSetting =
92 ccsMockIntegratedSettingNew (allocator);
93
94 CCSIntegratedSettingGMock *mockPtr = GET_PRIVATE (CCSIntegratedSettingGMock, integratedSetting)
95 CCSIntegratedSettingGMock &mock (*mockPtr);
96
97 boost::shared_ptr <CCSIntegratedSetting> composition =
98 AutoDestroy (ccsMockCompositionIntegratedSettingNew (integratedSetting,
99 mateIntegratedSettingInfo,
100 integratedSettingInfo,
101 allocator),
102 ccsIntegratedSettingUnref);
103
104 /* We want the composition to take ownership here, so unref the
105 * original members of the composition */
106 ccsMATEIntegratedSettingInfoUnref (mateIntegratedSettingInfo);
107 ccsIntegratedSettingUnref (integratedSetting);
108
109 return boost::make_shared <IntegratedSettingWithMock> (mock, composition);
110 }
111
112 CCSIntegratedSettingGMock &
113 Mock (IntegratedSettingWithMock &integratedSettingWithMocks)
114 {
115 return std::tr1::get <0> (integratedSettingWithMocks);
116 }
117
118 CCSIntegratedSetting *
119 Real (IntegratedSettingWithMock &integratedSettingWithMocks)
120 {
121 return std::tr1::get <1> (integratedSettingWithMocks).get ();
122 }
123
124 typedef std::tr1::tuple <CCSContextGMock &,
125 CCSBackendGMock &,
126 CCSIntegratedSettingsStorageGMock &,
127 CCSIntegratedSettingFactoryGMock &,
128 boost::shared_ptr <CCSContext> ,
129 boost::shared_ptr <CCSBackend> ,
130 CCSIntegratedSettingsStorage *,
131 CCSIntegratedSettingFactory *,
132 boost::shared_ptr <CCSIntegration> > CCSMATEIntegrationWithMocks;
133
134 CCSMATEIntegrationWithMocks
135 createIntegrationWithMocks (CCSObjectAllocationInterface *ai)
136 {
137 boost::shared_ptr <CCSContext> context (AutoDestroy (ccsMockContextNew (),
138 ccsFreeContext));
139 boost::shared_ptr <CCSBackend> backend (AutoDestroy (ccsMockBackendNew (),
140 ccsFreeMockBackend));
141 /* The MATE Integration backend takes ownership of these two */
142 CCSIntegratedSettingsStorage *storage (ccsMockIntegratedSettingsStorageNew (ai));
143 CCSIntegratedSettingFactory *factory (ccsMockIntegratedSettingFactoryNew (ai));
144 boost::shared_ptr <CCSIntegration> integration (AutoDestroy (ccsMATEIntegrationBackendNew (backend.get (),
145 context.get (),
146 factory,
147 storage,
148 ai),
149 ccsIntegrationUnref));
150
151 CCSContextGMock &gmockContext = *(reinterpret_cast <CCSContextGMock *> (ccsObjectGetPrivate (context.get ())));
152 CCSBackendGMock &gmockBackend = *(reinterpret_cast <CCSBackendGMock *> (ccsObjectGetPrivate (backend.get ())));
153 CCSIntegratedSettingsStorageGMock &gmockStorage = *(reinterpret_cast <CCSIntegratedSettingsStorageGMock *> (ccsObjectGetPrivate (storage)));
154 CCSIntegratedSettingFactoryGMock &gmockFactory = *(reinterpret_cast <CCSIntegratedSettingFactoryGMock *> (ccsObjectGetPrivate (factory)));
155
156 return CCSMATEIntegrationWithMocks (gmockContext,
157 gmockBackend,
158 gmockStorage,
159 gmockFactory,
160 context,
161 backend,
162 storage,
163 factory,
164 integration);
165 }
166
167 CCSIntegration *
168 Real (CCSMATEIntegrationWithMocks &integrationWithMocks)
169 {
170 return std::tr1::get <8> (integrationWithMocks).get ();
171 }
172
173 CCSContextGMock &
174 MockContext (CCSMATEIntegrationWithMocks &integrationWithMocks)
175 {
176 return std::tr1::get <0> (integrationWithMocks);
177 }
178
179 CCSIntegratedSettingsStorageGMock &
180 MockStorage (CCSMATEIntegrationWithMocks &integrationWithMocks)
181 {
182 return std::tr1::get <2> (integrationWithMocks);
183 }
184
185 void
186 IgnoreRegistration (CCSIntegratedSettingsStorageGMock &storage)
187 {
188 EXPECT_CALL (storage, empty ()).WillOnce (Return (FALSE));
189 }
190
191 void
192 AllowReadability (CCSSettingGMock &setting)
193 {
194 EXPECT_CALL (setting, isReadableByBackend ()).WillOnce (Return (TRUE));
195 }
196
197 void
198 ExpectWriteSettings (CCSContextGMock &context)
199 {
200 EXPECT_CALL (context, writeChangedSettings ());
201 }
202
203 void
204 SetNames (CCSSettingGMock &setting,
205 CCSPluginGMock &plugin,
206 const std::string &settingName,
207 const std::string &pluginName)
208 {
209 EXPECT_CALL (setting, getName ()).WillOnce (Return (settingName.c_str ()));
210 EXPECT_CALL (setting, getParent ());
211 EXPECT_CALL (plugin, getName ()).WillOnce (Return (pluginName.c_str ()));
212 }
213
214 void
215 SetTypeInfo (CCSSettingGMock &setting,
216 CCSSettingType type,
217 CCSSettingInfo *info)
218 {
219 EXPECT_CALL (setting, getType ()).WillOnce (Return (type));
220 EXPECT_CALL (setting, getInfo ()).WillOnce (Return (info));
221 }
222
223 CCSSettingValue *
224 MakeSettingValue ()
225 {
226 CCSSettingValue *v = reinterpret_cast <CCSSettingValue *> (calloc (1, sizeof (CCSSettingValue)));
227 v->parent = NULL;
228 v->isListChild = FALSE;
229 v->refCount = 1;
230
231 return v;
232 }
233
234 boost::shared_ptr <CCSSettingValue>
235 MakeAutoDestroySettingValue (CCSSettingType type)
236 {
237 CCSSettingValue *v = reinterpret_cast <CCSSettingValue *> (calloc (1, sizeof (CCSSettingValue)));
238 v->parent = NULL;
239 v->isListChild = FALSE;
240 v->refCount = 1;
241
242 return boost::shared_ptr <CCSSettingValue> (v,
243 boost::bind (ccsFreeSettingValueWithType, _1, type));
244 }
245
246 const std::string MOCK_PLUGIN ("mock");
247 const std::string MOCK_SETTING ("mock");
248 const std::string MOCK_MATE_NAME ("mock");
249 const CCSSettingType MOCK_SETTING_TYPE = TypeInt;
250 const SpecialOptionType MOCK_MATE_SETTING_TYPE = OptionInt;
251}
252
253TEST (CCSMATEIntegrationTest, TestConstructComposition)
254{
255 IntegratedSettingWithMockPtr settingWithMock (
256 createIntegratedSettingCompositionFromMock (MOCK_PLUGIN,
257 MOCK_SETTING,
258 MOCK_SETTING_TYPE,
259 MOCK_MATE_SETTING_TYPE,
260 MOCK_MATE_NAME,
261 &ccsDefaultObjectAllocator));
262}
263
264class CCSMATEIntegrationTestWithMocks :
265 public ::testing::Test
266{
267 public:
268
269 CCSMATEIntegrationTestWithMocks () :
270 mIntegration (createIntegrationWithMocks (&ccsDefaultObjectAllocator)),
271 mSetting (AutoDestroy (ccsMockSettingNew (),
272 ccsSettingUnref)),
273 mSettingMock ((*(reinterpret_cast <CCSSettingGMock *> (ccsObjectGetPrivate (mSetting.get ()))))),
274 mIntegratedSetting (),
275 mPlugin (AutoDestroy (ccsMockPluginNew (),
276 ccsPluginUnref)),
277 mPluginMock ((*(reinterpret_cast <CCSPluginGMock *> (ccsObjectGetPrivate (mPlugin.get ())))))
278 {
279 ON_CALL (mSettingMock, getParent ()).WillByDefault (Return (mPlugin.get ()));
280 }
281
282 protected:
283
284 CCSMATEIntegrationWithMocks mIntegration;
285 boost::shared_ptr <CCSSetting> mSetting;
286 CCSSettingGMock &mSettingMock;
287 IntegratedSettingWithMockPtr mIntegratedSetting;
288 boost::shared_ptr <CCSPlugin> mPlugin;
289 CCSPluginGMock &mPluginMock;
290};
291
292class CCSMATEIntegrationTestReadIntegrated :
293 public CCSMATEIntegrationTestWithMocks
294{
295 public:
296
297 virtual void SetUp ()
298 {
299 IgnoreRegistration (MockStorage (mIntegration));
300 AllowReadability (mSettingMock);
301 }
302};
303
304class CCSMATEIntegrationTestWriteIntegrated :
305 public CCSMATEIntegrationTestWithMocks
306{
307 public:
308
309 virtual void SetUp ()
310 {
311 IgnoreRegistration (MockStorage (mIntegration));
312 ExpectWriteSettings (MockContext (mIntegration));
313 }
314};
315
316TEST_F (CCSMATEIntegrationTestWithMocks, TestConstructMATEIntegration)
317{
318}
319
320TEST_F (CCSMATEIntegrationTestWithMocks, TestGetIntegratedSettingFromStorage)
321{
322 mIntegratedSetting = createIntegratedSettingCompositionFromMock (MOCK_PLUGIN,
323 MOCK_SETTING,
324 TypeBool,
325 OptionSpecial,
326 MOCK_MATE_NAME,
327 &ccsDefaultObjectAllocator);
328
329 CCSIntegratedSettingList returnIntegratedSettings =
330 ccsIntegratedSettingListAppend (NULL, Real (*mIntegratedSetting));
331 CCSIntegratedSettingsStorageGMock &mockStorage (MockStorage (mIntegration));
332
333 EXPECT_CALL (mockStorage, empty ()).WillOnce (Return (FALSE));
334 EXPECT_CALL (mockStorage, findMatchingSettingsByPluginAndSettingName (Eq (MOCK_PLUGIN),
335 Eq (MOCK_SETTING)))
336 .WillOnce (Return (returnIntegratedSettings));
337
338 EXPECT_EQ (Real (*mIntegratedSetting),
339 ccsIntegrationGetIntegratedSetting (Real (mIntegration),
340 MOCK_PLUGIN.c_str (),
341 MOCK_SETTING.c_str ()));
342}
343
344TEST_F (CCSMATEIntegrationTestReadIntegrated, TestReadInKeyOption)
345{
346 CCSSettingValue *v = MakeSettingValue ();
347 v->value.asString = strdup ("<Control>a");
348
349 mIntegratedSetting = createIntegratedSettingCompositionFromMock (MOCK_PLUGIN,
350 MOCK_SETTING,
351 TypeKey,
352 OptionKey,
353 MOCK_MATE_NAME,
354 &ccsDefaultObjectAllocator);
355
356 CCSSettingKeyValue keyValue;
357 ASSERT_TRUE (ccsStringToKeyBinding (v->value.asString, &keyValue));
358 EXPECT_CALL (Mock (*mIntegratedSetting), readValue (TypeKey)).WillOnce (Return (v));
359 EXPECT_CALL (mSettingMock, setKey (Eq (keyValue), IsTrue ()));
360
361 EXPECT_THAT (ccsIntegrationReadOptionIntoSetting (Real (mIntegration),
362 NULL,
363 mSetting.get (),
364 Real (*mIntegratedSetting)), IsTrue ());
365}
366
367TEST_F (CCSMATEIntegrationTestReadIntegrated, TestReadInSpecialOptionCurrentViewport)
368{
369 const std::string settingName ("current_viewport");
370 CCSSettingValue *v = MakeSettingValue ();
371 v->value.asBool = FALSE;
372
373 mIntegratedSetting = createIntegratedSettingCompositionFromMock (MOCK_PLUGIN,
374 settingName,
375 TypeBool,
376 OptionSpecial,
377 MOCK_MATE_NAME,
378 &ccsDefaultObjectAllocator);
379 SetNames (mSettingMock, mPluginMock, settingName, MOCK_PLUGIN);
380 EXPECT_CALL (Mock (*mIntegratedSetting), readValue (TypeBool)).WillOnce (Return (v));
381 EXPECT_CALL (mSettingMock, setBool (IsTrue (), IsTrue ()));
382
383 EXPECT_THAT (ccsIntegrationReadOptionIntoSetting (Real (mIntegration),
384 NULL,
385 mSetting.get (),
386 Real (*mIntegratedSetting)), IsTrue ());
387}
388
389TEST_F (CCSMATEIntegrationTestReadIntegrated, TestReadInSpecialOptionFullscreenVisualBell)
390{
391 const std::string settingName ("fullscreen_visual_bell");
392 CCSSettingValue *v = MakeSettingValue ();
393 v->value.asString = strdup ("fullscreen");
394
395 mIntegratedSetting = createIntegratedSettingCompositionFromMock (MOCK_PLUGIN,
396 settingName,
397 TypeString,
398 OptionSpecial,
399 MOCK_MATE_NAME,
400 &ccsDefaultObjectAllocator);
401 SetNames (mSettingMock, mPluginMock, settingName, MOCK_PLUGIN);
402 EXPECT_CALL (Mock (*mIntegratedSetting), readValue (TypeString)).WillOnce (Return (v));
403 EXPECT_CALL (mSettingMock, setBool (IsTrue (), IsTrue ()));
404
405 EXPECT_THAT (ccsIntegrationReadOptionIntoSetting (Real (mIntegration),
406 NULL,
407 mSetting.get (),
408 Real (*mIntegratedSetting)), IsTrue ());
409}
410
411TEST_F (CCSMATEIntegrationTestReadIntegrated, TestReadInSpecialOptionClickToFocus)
412{
413 const std::string settingName ("click_to_focus");
414 CCSSettingValue *v = MakeSettingValue ();
415 v->value.asString = strdup ("click");
416
417 mIntegratedSetting = createIntegratedSettingCompositionFromMock (MOCK_PLUGIN,
418 settingName,
419 TypeString,
420 OptionSpecial,
421 MOCK_MATE_NAME,
422 &ccsDefaultObjectAllocator);
423 SetNames (mSettingMock, mPluginMock, settingName, MOCK_PLUGIN);
424 EXPECT_CALL (Mock (*mIntegratedSetting), readValue (TypeString)).WillOnce (Return (v));
425 EXPECT_CALL (mSettingMock, setBool (IsTrue (), IsTrue ()));
426
427 EXPECT_THAT (ccsIntegrationReadOptionIntoSetting (Real (mIntegration),
428 NULL,
429 mSetting.get (),
430 Real (*mIntegratedSetting)), IsTrue ());
431}
432
433namespace
434{
435 struct IntegratedMediaKeysParam
436 {
437 public:
438
439 IntegratedMediaKeysParam (const std::string &settingName,
440 const std::string &integratedName,
441 const std::string &keyValueString) :
442 settingName (settingName),
443 integratedName (integratedName),
444 keyValueString (keyValueString)
445 {
446 EXPECT_TRUE (ccsStringToKeyBinding (keyValueString.c_str (),
447 &keyValue));
448 }
449
450 const std::string settingName;
451 const std::string integratedName;
452 const std::string keyValueString;
453 CCSSettingKeyValue keyValue;
454 };
455}
456
457namespace
458{
459 std::string RUN_COMMAND_SCREENSHOT_KEY ("run_command_screenshot_key");
460 std::string SCREENSHOT ("screenshot");
461 std::string SCREENSHOT_BINDING ("<Alt>Print");
462 std::string RUN_COMMAND_WINDOW_SCREENSHOT_KEY ("run_command_window_screenshot_key");
463 std::string WINDOW_SCREENSHOT ("window_screenshot");
464 std::string WINDOW_SCREENSHOT_BINDING ("<Control><Alt>Print");
465 std::string RUN_COMMAND_TERMINAL_KEY ("run_command_terminal_key");
466 std::string TERMINAL ("terminal");
467 std::string TERMINAL_BINDING ("<Control><Alt>t");
468}
469
470class CCSMATEIntegrationTestReadIntegratedMediaKeys :
471 public CCSMATEIntegrationTestReadIntegrated,
472 public WithParamInterface <IntegratedMediaKeysParam>
473{
474};
475
476TEST_P (CCSMATEIntegrationTestReadIntegratedMediaKeys, TestReadIntegratedMediaKey)
477{
478 const std::string settingName (GetParam ().settingName);
479 CCSSettingValue *v = MakeSettingValue ();
480 v->value.asString = strdup (GetParam ().keyValueString.c_str ());
481
482 mIntegratedSetting = createIntegratedSettingCompositionFromMock (MOCK_PLUGIN,
483 settingName,
484 TypeString,
485 OptionSpecial,
486 MOCK_MATE_NAME,
487 &ccsDefaultObjectAllocator);
488 SetNames (mSettingMock, mPluginMock, settingName, MOCK_PLUGIN);
489 EXPECT_CALL (Mock (*mIntegratedSetting), readValue (TypeString)).WillOnce (Return (v));
490 EXPECT_CALL (mSettingMock, setKey (Eq (GetParam ().keyValue), IsTrue ()));
491
492 EXPECT_THAT (ccsIntegrationReadOptionIntoSetting (Real (mIntegration),
493 NULL,
494 mSetting.get (),
495 Real (*mIntegratedSetting)), IsTrue ());
496}
497
498INSTANTIATE_TEST_CASE_P (CCSMATEMediaKeys, CCSMATEIntegrationTestReadIntegratedMediaKeys,
499 Values (IntegratedMediaKeysParam (RUN_COMMAND_SCREENSHOT_KEY,
500 SCREENSHOT,
501 SCREENSHOT_BINDING),
502 IntegratedMediaKeysParam (RUN_COMMAND_WINDOW_SCREENSHOT_KEY,
503 WINDOW_SCREENSHOT,
504 WINDOW_SCREENSHOT_BINDING),
505 IntegratedMediaKeysParam (RUN_COMMAND_TERMINAL_KEY,
506 TERMINAL,
507 TERMINAL_BINDING)));
508
509namespace
510{
511 const std::string DEFAULT_MOUSE_BUTTON_MODIFIERS_STRING ("<Alt>");
512 const std::string MATE_MOUSE_BUTTON_MODIFIERS_STRING ("<Super>");
513 const unsigned int DEFAULT_MOUSE_BUTTON_MODIFIERS =
514 ccsStringToModifiers (DEFAULT_MOUSE_BUTTON_MODIFIERS_STRING.c_str ());
515 const unsigned int MATE_MOUSE_BUTTON_MODIFIERS =
516 ccsStringToModifiers (MATE_MOUSE_BUTTON_MODIFIERS_STRING.c_str ());
517
518 const unsigned int LEFT_BUTTON = 1;
519 const unsigned int MIDDLE_BUTTON = 2;
520 const unsigned int RIGHT_BUTTON = 3;
521}
522
523class CCSMATEIntegrationTestWithMocksIntegratedMouseButtonModifiers
524{
525 public:
526
527 virtual ~CCSMATEIntegrationTestWithMocksIntegratedMouseButtonModifiers () {}
528
529 CCSMATEIntegrationTestWithMocksIntegratedMouseButtonModifiers () :
530 mIntegratedSettingMBM (AutoDestroy (ccsMockIntegratedSettingNew (&ccsDefaultObjectAllocator),
531 ccsIntegratedSettingUnref)),
532 mIntegratedSettingMBMMock (*(reinterpret_cast <CCSIntegratedSettingGMock *> (ccsObjectGetPrivate (mIntegratedSettingMBM.get ())))),
533 mIntegratedSettingResizeWithRB (AutoDestroy (ccsMockIntegratedSettingNew (&ccsDefaultObjectAllocator),
534 ccsIntegratedSettingUnref)),
535 mIntegratedSettingResizeWithRBMock (*(reinterpret_cast <CCSIntegratedSettingGMock *> (ccsObjectGetPrivate (mIntegratedSettingResizeWithRB.get ()))))
536 {
537 memset (&mButtonValue, 0, sizeof (CCSSettingButtonValue));
538
539 mButtonValue.button = MIDDLE_BUTTON;
540 mButtonValue.buttonModMask = DEFAULT_MOUSE_BUTTON_MODIFIERS;
541 mButtonValue.edgeMask = 0;
542 }
543
544 virtual void MateSetUp (CCSMATEIntegrationWithMocks &integration)
545 {
546 /* Create new lists as we expect the caller to free them once it
547 * has retreived them */
548 CCSIntegratedSettingList integratedSettingsMBM =
549 ccsIntegratedSettingListAppend (NULL, mIntegratedSettingMBM.get ());
550 CCSIntegratedSettingList integratedSettingsResizeWithRB =
551 ccsIntegratedSettingListAppend (NULL, mIntegratedSettingResizeWithRB.get ());
552
553 EXPECT_CALL (MockStorage (integration),
554 findMatchingSettingsByPluginAndSettingName (Eq (std::string (ccsMATEIntegratedPluginNames.SPECIAL)),
555 Eq (std::string (ccsMATEIntegratedSettingNames.NULL_MOUSE_BUTTON_MODIFIER.compizName))))
556 .WillOnce (Return (integratedSettingsMBM));
557 EXPECT_CALL (MockStorage (integration),
558 findMatchingSettingsByPluginAndSettingName (Eq (std::string (ccsMATEIntegratedPluginNames.SPECIAL)),
559 Eq (std::string (ccsMATEIntegratedSettingNames.NULL_RESIZE_WITH_RIGHT_BUTTON.compizName))))
560 .WillOnce (Return (integratedSettingsResizeWithRB));
561 }
562
563
564 protected:
565
566 boost::shared_ptr <CCSIntegratedSetting> mIntegratedSettingMBM;
567 CCSIntegratedSettingGMock &mIntegratedSettingMBMMock;
568 boost::shared_ptr <CCSIntegratedSetting> mIntegratedSettingResizeWithRB;
569 CCSIntegratedSettingGMock &mIntegratedSettingResizeWithRBMock;
570 CCSSettingButtonValue mButtonValue;
571};
572
573class CCSMATEIntegrationTestWithMocksReadIntegratedMouseButtonModifiers :
574 public CCSMATEIntegrationTestReadIntegrated,
575 public CCSMATEIntegrationTestWithMocksIntegratedMouseButtonModifiers
576{
577 public:
578
579 virtual void SetUp ()
580 {
581 CCSSettingValue *vRB = MakeSettingValue ();
582 CCSSettingValue *vMBM = MakeSettingValue ();
583 vRB->value.asBool = TRUE;
584 vMBM->value.asString = strdup (MATE_MOUSE_BUTTON_MODIFIERS_STRING.c_str ());
585
586 CCSMATEIntegrationTestReadIntegrated::SetUp ();
587 CCSMATEIntegrationTestWithMocksIntegratedMouseButtonModifiers::MateSetUp (mIntegration);
588
589 EXPECT_CALL (mSettingMock, getButton (_))
590 .WillOnce (DoAll (
591 SetArgPointee <0> (
592 mButtonValue),
593 Return (TRUE)));
594
595 /* Get the MATE Mouse button modifier */
596 EXPECT_CALL (mIntegratedSettingMBMMock, readValue (TypeString)).WillOnce (Return (vMBM));
597 EXPECT_CALL (mIntegratedSettingResizeWithRBMock, readValue (TypeBool)).WillOnce (Return (vRB));
598 }
599};
600
601class CCSMATEIntegrationTestWithMocksWriteIntegratedMouseButtonModifiers :
602 public CCSMATEIntegrationTestWriteIntegrated,
603 public CCSMATEIntegrationTestWithMocksIntegratedMouseButtonModifiers
604{
605 public:
606
607 CCSMATEIntegrationTestWithMocksWriteIntegratedMouseButtonModifiers () :
608 corePlugin (AutoDestroy (ccsMockPluginNew (),
609 ccsPluginUnref)),
610 corePluginMock (*(reinterpret_cast <CCSPluginGMock *> (ccsObjectGetPrivate (corePlugin.get ())))),
611 resizePlugin (AutoDestroy (ccsMockPluginNew (),
612 ccsPluginUnref)),
613 resizePluginMock (*(reinterpret_cast <CCSPluginGMock *> (ccsObjectGetPrivate (resizePlugin.get ())))),
614 movePlugin (AutoDestroy (ccsMockPluginNew (),
615 ccsPluginUnref)),
616 movePluginMock (*(reinterpret_cast <CCSPluginGMock *> (ccsObjectGetPrivate (movePlugin.get ())))),
617 resizeInitiateButtonSetting (AutoDestroy (ccsMockSettingNew (),
618 ccsSettingUnref)),
619 resizeInitiateButtonSettingMock (*(reinterpret_cast <CCSSettingGMock *> (ccsObjectGetPrivate (resizeInitiateButtonSetting.get ())))),
620 moveInitiateButtonSetting (AutoDestroy (ccsMockSettingNew (),
621 ccsSettingUnref)),
622 moveInitiateButtonSettingMock (*(reinterpret_cast <CCSSettingGMock *> (ccsObjectGetPrivate (moveInitiateButtonSetting.get ())))),
623 coreWindowMenuSetting (AutoDestroy (ccsMockSettingNew (),
624 ccsSettingUnref)),
625 coreWindowMenuSettingMock (*(reinterpret_cast <CCSSettingGMock *> (ccsObjectGetPrivate (coreWindowMenuSetting.get ())))),
626 resizeInitiateButton (MakeAutoDestroySettingValue (TypeButton)),
627 moveInitiateButton (MakeAutoDestroySettingValue (TypeButton)),
628 coreWindowMenuButton (MakeAutoDestroySettingValue (TypeButton))
629 {
630 resizeInitiateButton->value.asButton.button = LEFT_BUTTON;
631 resizeInitiateButton->value.asButton.buttonModMask = 0;
632 resizeInitiateButton->value.asButton.edgeMask = 0;
633 moveInitiateButton->value.asButton.button = LEFT_BUTTON;
634 moveInitiateButton->value.asButton.buttonModMask = DEFAULT_MOUSE_BUTTON_MODIFIERS;
635 moveInitiateButton->value.asButton.edgeMask = 0;
636 coreWindowMenuButton->value.asButton.button = MIDDLE_BUTTON;
637 coreWindowMenuButton->value.asButton.buttonModMask = 0;
638 coreWindowMenuButton->value.asButton.edgeMask = 0;
639 }
640
641 virtual void SetUp ()
642 {
643 CCSMATEIntegrationTestWriteIntegrated::SetUp ();
644 CCSMATEIntegrationTestWithMocksIntegratedMouseButtonModifiers::MateSetUp (mIntegration);
645 }
646
647 protected:
648
649 boost::shared_ptr <CCSPlugin> corePlugin;
650 CCSPluginGMock &corePluginMock;
651 boost::shared_ptr <CCSPlugin> resizePlugin;
652 CCSPluginGMock &resizePluginMock;
653 boost::shared_ptr <CCSPlugin> movePlugin;
654 CCSPluginGMock &movePluginMock;
655
656 boost::shared_ptr <CCSSetting> resizeInitiateButtonSetting;
657 CCSSettingGMock &resizeInitiateButtonSettingMock;
658 boost::shared_ptr <CCSSetting> moveInitiateButtonSetting;
659 CCSSettingGMock &moveInitiateButtonSettingMock;
660 boost::shared_ptr <CCSSetting> coreWindowMenuSetting;
661 CCSSettingGMock &coreWindowMenuSettingMock;
662
663 boost::shared_ptr <CCSSettingValue> resizeInitiateButton;
664 boost::shared_ptr <CCSSettingValue> moveInitiateButton;
665 boost::shared_ptr <CCSSettingValue> coreWindowMenuButton;
666};
667
668TEST_F (CCSMATEIntegrationTestWithMocksReadIntegratedMouseButtonModifiers, TestReadInSpecialOptionMoveInitiateButton)
669{
670 const std::string settingName ("initiate_button");
671 const std::string pluginName ("move");
672
673 CCSSettingButtonValue newButtonValue = mButtonValue;
674 newButtonValue.button = LEFT_BUTTON;
675 newButtonValue.buttonModMask = MATE_MOUSE_BUTTON_MODIFIERS;
676
677 mIntegratedSetting = createIntegratedSettingCompositionFromMock (pluginName,
678 settingName,
679 TypeBool,
680 OptionSpecial,
681 MOCK_MATE_NAME,
682 &ccsDefaultObjectAllocator);
683 SetNames (mSettingMock, mPluginMock, settingName, pluginName);
684
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches