Merge lp:~compiz-team/compiz/compiz.fix_1050796 into lp:compiz/0.9.8
- compiz.fix_1050796
- Merge into 0.9.8
Status: | Merged |
---|---|
Approved by: | Daniel van Vugt |
Approved revision: | 3391 |
Merged at revision: | 3393 |
Proposed branch: | lp:~compiz-team/compiz/compiz.fix_1050796 |
Merge into: | lp:compiz/0.9.8 |
Prerequisite: | lp:~compiz-team/compiz/compiz.fix_1042041 |
Diff against target: |
991 lines (+463/-160) 12 files modified
compizconfig/integration/gnome/gsettings/include/ccs_gnome_integration_gsettings_integrated_setting.h (+11/-0) compizconfig/integration/gnome/gsettings/include/ccs_gnome_integration_gsettings_integrated_setting_factory.h (+11/-0) compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml (+0/-21) compizconfig/integration/gnome/gsettings/src/ccs_gnome_integration_gsettings_integrated_setting.c (+26/-2) compizconfig/integration/gnome/gsettings/src/ccs_gnome_integration_gsettings_integrated_setting_factory.c (+37/-1) compizconfig/integration/gnome/include/ccs_gnome_integration_constants.h (+2/-0) compizconfig/integration/gnome/src/ccs_gnome_integration.c (+97/-30) compizconfig/integration/gnome/src/ccs_gnome_integration_constants.c (+13/-9) compizconfig/integration/gnome/tests/compizconfig_ccs_mock_gnome_integrated_setting_composition.c (+0/-2) compizconfig/integration/gnome/tests/compizconfig_test_ccs_gnome_integration.cpp (+194/-48) compizconfig/libcompizconfig/include/ccs.h (+6/-0) compizconfig/libcompizconfig/src/main.c (+66/-47) |
To merge this branch: | bzr merge lp:~compiz-team/compiz/compiz.fix_1050796 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel van Vugt | Approve | ||
jenkins (community) | continuous-integration | Needs Fixing | |
Review via email: mp+126270@code.launchpad.net |
This proposal supersedes a proposal from 2012-09-25.
Commit message
Remove some options from org.compiz.
(LP: #1050796)
Description of the change
Remove some options from org.compiz.
jenkins (martin-mrazik+qa) wrote : Posted in a previous version of this proposal | # |
jenkins (martin-mrazik+qa) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:3390
http://
Executed test runs:
FAILURE: http://
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal | # |
Looks and works fine to me.
A couple of potential issues in ccsCopyValue:
1. This is not C: 872 + if (!value)
2. Unreachable code: 918 + return NULL;
But when and if those become a problem, the compiler will tell you.
Unity Merger (unity-merger) wrote : Posted in a previous version of this proposal | # |
The prerequisite lp:~compiz-team/compiz/compiz.fix_1042041 has not yet been merged into lp:compiz.
jenkins (martin-mrazik+qa) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:3391
http://
Executed test runs:
FAILURE: http://
jenkins (martin-mrazik+qa) wrote : | # |
FAILED: Continuous integration, rev:3391
http://
Executed test runs:
FAILURE: http://
Sam Spilsbury (smspillaz) wrote : | # |
Blocked on lp:~sil2100/compiz/ubuntu_g-c-c_dep
Daniel van Vugt (vanvugt) wrote : | # |
Still approved as per previous comments.
Preview Diff
1 | === modified file 'compizconfig/integration/gnome/gsettings/include/ccs_gnome_integration_gsettings_integrated_setting.h' | |||
2 | --- compizconfig/integration/gnome/gsettings/include/ccs_gnome_integration_gsettings_integrated_setting.h 2012-08-17 07:33:02 +0000 | |||
3 | +++ compizconfig/integration/gnome/gsettings/include/ccs_gnome_integration_gsettings_integrated_setting.h 2012-09-25 15:17:24 +0000 | |||
4 | @@ -26,6 +26,17 @@ | |||
5 | 26 | CCSGSettingsWrapper *wrapper, | 26 | CCSGSettingsWrapper *wrapper, |
6 | 27 | CCSObjectAllocationInterface *ai); | 27 | CCSObjectAllocationInterface *ai); |
7 | 28 | 28 | ||
8 | 29 | /** | ||
9 | 30 | * @brief ccsGSettingsIntegratedSettingsTranslateOldGNOMEKeyForGSettings | ||
10 | 31 | * @param key the old style gnome key to translate | ||
11 | 32 | * @return new-style key. Caller should free | ||
12 | 33 | * | ||
13 | 34 | * This translates old style keys (eg foo_bar) to new style keys | ||
14 | 35 | * foo-bar and special cases a few keys | ||
15 | 36 | */ | ||
16 | 37 | char * | ||
17 | 38 | ccsGSettingsIntegratedSettingsTranslateOldGNOMEKeyForGSettings (const char *key); | ||
18 | 39 | |||
19 | 29 | COMPIZCONFIG_END_DECLS | 40 | COMPIZCONFIG_END_DECLS |
20 | 30 | 41 | ||
21 | 31 | #endif | 42 | #endif |
22 | 32 | 43 | ||
23 | === modified file 'compizconfig/integration/gnome/gsettings/include/ccs_gnome_integration_gsettings_integrated_setting_factory.h' | |||
24 | --- compizconfig/integration/gnome/gsettings/include/ccs_gnome_integration_gsettings_integrated_setting_factory.h 2012-08-17 02:20:20 +0000 | |||
25 | +++ compizconfig/integration/gnome/gsettings/include/ccs_gnome_integration_gsettings_integrated_setting_factory.h 2012-09-25 15:17:24 +0000 | |||
26 | @@ -39,6 +39,17 @@ | |||
27 | 39 | 39 | ||
28 | 40 | unsigned int ccsCCSGNOMEIntegrationGSettingsWrapperFactoryInterfaceGetType (); | 40 | unsigned int ccsCCSGNOMEIntegrationGSettingsWrapperFactoryInterfaceGetType (); |
29 | 41 | 41 | ||
30 | 42 | /** | ||
31 | 43 | * @brief ccsGSettingsIntegratedSettingsTranslateNewGNOMEKeyForCCS | ||
32 | 44 | * @param key the old style gnome key to translate | ||
33 | 45 | * @return new-style key. Caller should free | ||
34 | 46 | * | ||
35 | 47 | * This translates new style keys (eg foo-bar) to old style keys | ||
36 | 48 | * foo_bar and special cases a few keys | ||
37 | 49 | */ | ||
38 | 50 | char * | ||
39 | 51 | ccsGSettingsIntegratedSettingsTranslateNewGNOMEKeyForCCS (const char *key); | ||
40 | 52 | |||
41 | 42 | CCSGSettingsWrapper * | 53 | CCSGSettingsWrapper * |
42 | 43 | ccsGNOMEIntegrationGSettingsWrapperFactoryNewGSettingsWrapper (CCSGNOMEIntegrationGSettingsWrapperFactory *factory, | 54 | ccsGNOMEIntegrationGSettingsWrapperFactoryNewGSettingsWrapper (CCSGNOMEIntegrationGSettingsWrapperFactory *factory, |
43 | 44 | const gchar *schemaName, | 55 | const gchar *schemaName, |
44 | 45 | 56 | ||
45 | === modified file 'compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml' | |||
46 | --- compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml 2012-09-05 23:26:55 +0000 | |||
47 | +++ compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml 2012-09-25 15:17:24 +0000 | |||
48 | @@ -4,18 +4,12 @@ | |||
49 | 4 | <key type="b" name="display-all-workspaces"> | 4 | <key type="b" name="display-all-workspaces"> |
50 | 5 | <default>true</default> | 5 | <default>true</default> |
51 | 6 | </key> | 6 | </key> |
52 | 7 | <key type="s" name="exec"> | ||
53 | 8 | <default>"gnome-terminal"</default> | ||
54 | 9 | </key> | ||
55 | 10 | <key type="s" name="command-window-screenshot"> | 7 | <key type="s" name="command-window-screenshot"> |
56 | 11 | <default>"gnome-screenshot -w"</default> | 8 | <default>"gnome-screenshot -w"</default> |
57 | 12 | </key> | 9 | </key> |
58 | 13 | <key type="s" name="command-screenshot"> | 10 | <key type="s" name="command-screenshot"> |
59 | 14 | <default>"gnome-screenshot"</default> | 11 | <default>"gnome-screenshot"</default> |
60 | 15 | </key> | 12 | </key> |
61 | 16 | <key type="s" name="command-terminal"> | ||
62 | 17 | <default>"gnome-terminal"</default> | ||
63 | 18 | </key> | ||
64 | 19 | <key type="as" name="run-command-12"> | 13 | <key type="as" name="run-command-12"> |
65 | 20 | <default>["Disabled"]</default> | 14 | <default>["Disabled"]</default> |
66 | 21 | </key> | 15 | </key> |
67 | @@ -88,21 +82,6 @@ | |||
68 | 88 | <key type="s" name="command-1"> | 82 | <key type="s" name="command-1"> |
69 | 89 | <default>""</default> | 83 | <default>""</default> |
70 | 90 | </key> | 84 | </key> |
71 | 91 | <key type="as" name="run-command-terminal"> | ||
72 | 92 | <default>["<Control><Alt>t"]</default> | ||
73 | 93 | </key> | ||
74 | 94 | <key type="as" name="run-command-window-screenshot"> | ||
75 | 95 | <default>["<Alt>Print"]</default> | ||
76 | 96 | </key> | ||
77 | 97 | <key type="as" name="run-command-screenshot"> | ||
78 | 98 | <default>["Print"]</default> | ||
79 | 99 | </key> | ||
80 | 100 | <key type="as" name="panel-main-menu"> | ||
81 | 101 | <default>["<Alt>F1"]</default> | ||
82 | 102 | </key> | ||
83 | 103 | <key type="as" name="panel-run-dialog"> | ||
84 | 104 | <default>["<Alt>F2"]</default> | ||
85 | 105 | </key> | ||
86 | 106 | <key type="as" name="show-hud"> | 85 | <key type="as" name="show-hud"> |
87 | 107 | <default>["<Alt>"]</default> | 86 | <default>["<Alt>"]</default> |
88 | 108 | </key> | 87 | </key> |
89 | 109 | 88 | ||
90 | === modified file 'compizconfig/integration/gnome/gsettings/src/ccs_gnome_integration_gsettings_integrated_setting.c' | |||
91 | --- compizconfig/integration/gnome/gsettings/src/ccs_gnome_integration_gsettings_integrated_setting.c 2012-09-24 10:44:29 +0000 | |||
92 | +++ compizconfig/integration/gnome/gsettings/src/ccs_gnome_integration_gsettings_integrated_setting.c 2012-09-25 15:17:24 +0000 | |||
93 | @@ -24,6 +24,30 @@ | |||
94 | 24 | CCSGSettingsWrapper *wrapper; | 24 | CCSGSettingsWrapper *wrapper; |
95 | 25 | }; | 25 | }; |
96 | 26 | 26 | ||
97 | 27 | char * | ||
98 | 28 | ccsGSettingsIntegratedSettingsTranslateOldGNOMEKeyForGSettings (const char *key) | ||
99 | 29 | { | ||
100 | 30 | char *newKey = translateKeyForGSettings (key); | ||
101 | 31 | |||
102 | 32 | if (g_strcmp0 (newKey, "run-command-screenshot") == 0) | ||
103 | 33 | { | ||
104 | 34 | free (newKey); | ||
105 | 35 | newKey = strdup ("screenshot"); | ||
106 | 36 | } | ||
107 | 37 | else if (g_strcmp0 (newKey, "run-command-window-screenshot") == 0) | ||
108 | 38 | { | ||
109 | 39 | free (newKey); | ||
110 | 40 | newKey = strdup ("window-screenshot"); | ||
111 | 41 | } | ||
112 | 42 | else if (g_strcmp0 (newKey, "run-command-terminal") == 0) | ||
113 | 43 | { | ||
114 | 44 | free (newKey); | ||
115 | 45 | newKey = strdup ("terminal"); | ||
116 | 46 | } | ||
117 | 47 | |||
118 | 48 | return newKey; | ||
119 | 49 | } | ||
120 | 50 | |||
121 | 27 | SpecialOptionType | 51 | SpecialOptionType |
122 | 28 | ccsGSettingsIntegratedSettingGetSpecialOptionType (CCSGNOMEIntegratedSettingInfo *setting) | 52 | ccsGSettingsIntegratedSettingGetSpecialOptionType (CCSGNOMEIntegratedSettingInfo *setting) |
123 | 29 | { | 53 | { |
124 | @@ -46,7 +70,7 @@ | |||
125 | 46 | CCSGSettingsIntegratedSettingPrivate *priv = (CCSGSettingsIntegratedSettingPrivate *) ccsObjectGetPrivate (setting); | 70 | CCSGSettingsIntegratedSettingPrivate *priv = (CCSGSettingsIntegratedSettingPrivate *) ccsObjectGetPrivate (setting); |
126 | 47 | CCSSettingValue *v = calloc (1, sizeof (CCSSettingValue)); | 71 | CCSSettingValue *v = calloc (1, sizeof (CCSSettingValue)); |
127 | 48 | const char *gnomeKeyName = ccsGNOMEIntegratedSettingInfoGetGNOMEName ((CCSGNOMEIntegratedSettingInfo *) setting); | 72 | const char *gnomeKeyName = ccsGNOMEIntegratedSettingInfoGetGNOMEName ((CCSGNOMEIntegratedSettingInfo *) setting); |
129 | 49 | char *gsettingsTranslatedName = translateKeyForGSettings (gnomeKeyName); | 73 | char *gsettingsTranslatedName = ccsGSettingsIntegratedSettingsTranslateOldGNOMEKeyForGSettings (gnomeKeyName); |
130 | 50 | 74 | ||
131 | 51 | v->isListChild = FALSE; | 75 | v->isListChild = FALSE; |
132 | 52 | v->parent = NULL; | 76 | v->parent = NULL; |
133 | @@ -137,7 +161,7 @@ | |||
134 | 137 | { | 161 | { |
135 | 138 | CCSGSettingsIntegratedSettingPrivate *priv = (CCSGSettingsIntegratedSettingPrivate *) ccsObjectGetPrivate (setting); | 162 | CCSGSettingsIntegratedSettingPrivate *priv = (CCSGSettingsIntegratedSettingPrivate *) ccsObjectGetPrivate (setting); |
136 | 139 | const char *gnomeKeyName = ccsGNOMEIntegratedSettingInfoGetGNOMEName ((CCSGNOMEIntegratedSettingInfo *) setting); | 163 | const char *gnomeKeyName = ccsGNOMEIntegratedSettingInfoGetGNOMEName ((CCSGNOMEIntegratedSettingInfo *) setting); |
138 | 140 | char *gsettingsTranslatedName = translateKeyForGSettings (gnomeKeyName); | 164 | char *gsettingsTranslatedName = ccsGSettingsIntegratedSettingsTranslateOldGNOMEKeyForGSettings (gnomeKeyName); |
139 | 141 | 165 | ||
140 | 142 | GVariant *variant = ccsGSettingsWrapperGetValue (priv->wrapper, gsettingsTranslatedName); | 166 | GVariant *variant = ccsGSettingsWrapperGetValue (priv->wrapper, gsettingsTranslatedName); |
141 | 143 | const GVariantType *variantType = g_variant_get_type (variant); | 167 | const GVariantType *variantType = g_variant_get_type (variant); |
142 | 144 | 168 | ||
143 | === modified file 'compizconfig/integration/gnome/gsettings/src/ccs_gnome_integration_gsettings_integrated_setting_factory.c' | |||
144 | --- compizconfig/integration/gnome/gsettings/src/ccs_gnome_integration_gsettings_integrated_setting_factory.c 2012-08-17 07:33:02 +0000 | |||
145 | +++ compizconfig/integration/gnome/gsettings/src/ccs_gnome_integration_gsettings_integrated_setting_factory.c 2012-09-25 15:17:24 +0000 | |||
146 | @@ -21,6 +21,30 @@ | |||
147 | 21 | 21 | ||
148 | 22 | INTERFACE_TYPE (CCSGNOMEIntegrationGSettingsWrapperFactoryInterface); | 22 | INTERFACE_TYPE (CCSGNOMEIntegrationGSettingsWrapperFactoryInterface); |
149 | 23 | 23 | ||
150 | 24 | char * | ||
151 | 25 | ccsGSettingsIntegratedSettingsTranslateNewGNOMEKeyForCCS (const char *key) | ||
152 | 26 | { | ||
153 | 27 | char *newKey = translateKeyForCCS (key); | ||
154 | 28 | |||
155 | 29 | if (g_strcmp0 (newKey, "screenshot") == 0) | ||
156 | 30 | { | ||
157 | 31 | free (newKey); | ||
158 | 32 | newKey = strdup ("run_command_screenshot"); | ||
159 | 33 | } | ||
160 | 34 | else if (g_strcmp0 (newKey, "window_screenshot") == 0) | ||
161 | 35 | { | ||
162 | 36 | free (newKey); | ||
163 | 37 | newKey = strdup ("run_command_window_screenshot"); | ||
164 | 38 | } | ||
165 | 39 | else if (g_strcmp0 (newKey, "terminal") == 0) | ||
166 | 40 | { | ||
167 | 41 | free (newKey); | ||
168 | 42 | newKey = strdup ("run_command_terminal"); | ||
169 | 43 | } | ||
170 | 44 | |||
171 | 45 | return newKey; | ||
172 | 46 | } | ||
173 | 47 | |||
174 | 24 | CCSGSettingsWrapper * | 48 | CCSGSettingsWrapper * |
175 | 25 | ccsGNOMEIntegrationGSettingsWrapperFactoryNewGSettingsWrapper (CCSGNOMEIntegrationGSettingsWrapperFactory *factory, | 49 | ccsGNOMEIntegrationGSettingsWrapperFactoryNewGSettingsWrapper (CCSGNOMEIntegrationGSettingsWrapperFactory *factory, |
176 | 26 | const gchar *schemaName, | 50 | const gchar *schemaName, |
177 | @@ -103,7 +127,7 @@ | |||
178 | 103 | gpointer user_data) | 127 | gpointer user_data) |
179 | 104 | { | 128 | { |
180 | 105 | CCSGNOMEValueChangeData *data = (CCSGNOMEValueChangeData *) user_data; | 129 | CCSGNOMEValueChangeData *data = (CCSGNOMEValueChangeData *) user_data; |
182 | 106 | char *baseName = translateKeyForCCS (key); | 130 | char *baseName = ccsGSettingsIntegratedSettingsTranslateNewGNOMEKeyForCCS (key); |
183 | 107 | 131 | ||
184 | 108 | /* We don't care if integration is not enabled */ | 132 | /* We don't care if integration is not enabled */ |
185 | 109 | if (!ccsGetIntegrationEnabled (data->context)) | 133 | if (!ccsGetIntegrationEnabled (data->context)) |
186 | @@ -185,6 +209,18 @@ | |||
187 | 185 | gnomeGSettingsValueChanged, | 209 | gnomeGSettingsValueChanged, |
188 | 186 | data, | 210 | data, |
189 | 187 | factory->object.object_allocation)); | 211 | factory->object.object_allocation)); |
190 | 212 | g_hash_table_insert (quarksToGSettingsWrappers, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_DEFAULT_APPLICATIONS_TERMINAL), | ||
191 | 213 | ccsGNOMEIntegrationGSettingsWrapperFactoryNewGSettingsWrapper (factory, | ||
192 | 214 | g_quark_to_string (quarks->ORG_GNOME_DESKTOP_DEFAULT_APPLICATIONS_TERMINAL), | ||
193 | 215 | gnomeGSettingsValueChanged, | ||
194 | 216 | data, | ||
195 | 217 | factory->object.object_allocation)); | ||
196 | 218 | g_hash_table_insert (quarksToGSettingsWrappers, GINT_TO_POINTER (quarks->ORG_GNOME_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS), | ||
197 | 219 | ccsGNOMEIntegrationGSettingsWrapperFactoryNewGSettingsWrapper (factory, | ||
198 | 220 | g_quark_to_string (quarks->ORG_GNOME_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS), | ||
199 | 221 | gnomeGSettingsValueChanged, | ||
200 | 222 | data, | ||
201 | 223 | factory->object.object_allocation)); | ||
202 | 188 | 224 | ||
203 | 189 | return quarksToGSettingsWrappers; | 225 | return quarksToGSettingsWrappers; |
204 | 190 | } | 226 | } |
205 | 191 | 227 | ||
206 | === modified file 'compizconfig/integration/gnome/include/ccs_gnome_integration_constants.h' | |||
207 | --- compizconfig/integration/gnome/include/ccs_gnome_integration_constants.h 2012-09-23 16:46:19 +0000 | |||
208 | +++ compizconfig/integration/gnome/include/ccs_gnome_integration_constants.h 2012-09-25 15:17:24 +0000 | |||
209 | @@ -188,6 +188,8 @@ | |||
210 | 188 | { | 188 | { |
211 | 189 | GQuark ORG_GNOME_DESKTOP_WM_PREFERENCES; | 189 | GQuark ORG_GNOME_DESKTOP_WM_PREFERENCES; |
212 | 190 | GQuark ORG_GNOME_DESKTOP_WM_KEYBINDINGS; | 190 | GQuark ORG_GNOME_DESKTOP_WM_KEYBINDINGS; |
213 | 191 | GQuark ORG_GNOME_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS; | ||
214 | 192 | GQuark ORG_GNOME_DESKTOP_DEFAULT_APPLICATIONS_TERMINAL; | ||
215 | 191 | GQuark ORG_COMPIZ_INTEGRATED; | 193 | GQuark ORG_COMPIZ_INTEGRATED; |
216 | 192 | } CCSGSettingsWrapperIntegratedSchemasQuarks; | 194 | } CCSGSettingsWrapperIntegratedSchemasQuarks; |
217 | 193 | 195 | ||
218 | 194 | 196 | ||
219 | === modified file 'compizconfig/integration/gnome/src/ccs_gnome_integration.c' | |||
220 | --- compizconfig/integration/gnome/src/ccs_gnome_integration.c 2012-09-24 03:55:38 +0000 | |||
221 | +++ compizconfig/integration/gnome/src/ccs_gnome_integration.c 2012-09-25 15:17:24 +0000 | |||
222 | @@ -160,6 +160,29 @@ | |||
223 | 160 | } | 160 | } |
224 | 161 | 161 | ||
225 | 162 | static Bool | 162 | static Bool |
226 | 163 | ccsGNOMEIntegrationBackendReadISAndSetSettingForType (CCSIntegratedSetting *integratedSetting, | ||
227 | 164 | CCSSetting *setting, | ||
228 | 165 | CCSSettingValue **v, | ||
229 | 166 | CCSSettingType type) | ||
230 | 167 | { | ||
231 | 168 | *v = ccsIntegratedSettingReadValue (integratedSetting, type); | ||
232 | 169 | |||
233 | 170 | if ((*v)->value.asString) | ||
234 | 171 | { | ||
235 | 172 | CCSSettingKeyValue key; | ||
236 | 173 | |||
237 | 174 | memset (&key, 0, sizeof (CCSSettingKeyValue)); | ||
238 | 175 | if (ccsStringToKeyBinding ((*v)->value.asString, &key)) | ||
239 | 176 | { | ||
240 | 177 | ccsSetKey (setting, key, TRUE); | ||
241 | 178 | return TRUE; | ||
242 | 179 | } | ||
243 | 180 | } | ||
244 | 181 | |||
245 | 182 | return FALSE; | ||
246 | 183 | } | ||
247 | 184 | |||
248 | 185 | static Bool | ||
249 | 163 | ccsGNOMEIntegrationBackendReadOptionIntoSetting (CCSIntegration *integration, | 186 | ccsGNOMEIntegrationBackendReadOptionIntoSetting (CCSIntegration *integration, |
250 | 164 | CCSContext *context, | 187 | CCSContext *context, |
251 | 165 | CCSSetting *setting, | 188 | CCSSetting *setting, |
252 | @@ -209,20 +232,11 @@ | |||
253 | 209 | case OptionKey: | 232 | case OptionKey: |
254 | 210 | { | 233 | { |
255 | 211 | type = TypeKey; | 234 | type = TypeKey; |
270 | 212 | v = ccsIntegratedSettingReadValue (integratedSetting, type); | 235 | if (ccsGNOMEIntegrationBackendReadISAndSetSettingForType (integratedSetting, |
271 | 213 | 236 | setting, | |
272 | 214 | if (v->value.asString) | 237 | &v, |
273 | 215 | { | 238 | type)) |
274 | 216 | CCSSettingKeyValue key; | 239 | ret = TRUE; |
261 | 217 | |||
262 | 218 | memset (&key, 0, sizeof (CCSSettingKeyValue)); | ||
263 | 219 | ccsGetKey (setting, &key); | ||
264 | 220 | if (ccsStringToKeyBinding (v->value.asString, &key)) | ||
265 | 221 | { | ||
266 | 222 | ccsSetKey (setting, key, TRUE); | ||
267 | 223 | ret = TRUE; | ||
268 | 224 | } | ||
269 | 225 | } | ||
275 | 226 | } | 240 | } |
276 | 227 | break; | 241 | break; |
277 | 228 | case OptionSpecial: | 242 | case OptionSpecial: |
278 | @@ -268,6 +282,17 @@ | |||
279 | 268 | ret = TRUE; | 282 | ret = TRUE; |
280 | 269 | } | 283 | } |
281 | 270 | } | 284 | } |
282 | 285 | else if ((strcmp (settingName, "run_command_screenshot_key") == 0 || | ||
283 | 286 | strcmp (settingName, "run_command_window_screenshot_key") == 0 || | ||
284 | 287 | strcmp (settingName, "run_command_terminal_key") == 0)) | ||
285 | 288 | { | ||
286 | 289 | type = TypeString; | ||
287 | 290 | if (ccsGNOMEIntegrationBackendReadISAndSetSettingForType (integratedSetting, | ||
288 | 291 | setting, | ||
289 | 292 | &v, | ||
290 | 293 | type)) | ||
291 | 294 | ret = TRUE; | ||
292 | 295 | } | ||
293 | 271 | else if (((strcmp (settingName, "initiate_button") == 0) && | 296 | else if (((strcmp (settingName, "initiate_button") == 0) && |
294 | 272 | ((strcmp (pluginName, "move") == 0) || | 297 | ((strcmp (pluginName, "move") == 0) || |
295 | 273 | (strcmp (pluginName, "resize") == 0))) || | 298 | (strcmp (pluginName, "resize") == 0))) || |
296 | @@ -373,6 +398,29 @@ | |||
297 | 373 | } | 398 | } |
298 | 374 | } | 399 | } |
299 | 375 | 400 | ||
300 | 401 | static Bool | ||
301 | 402 | ccsGNOMEIntegrationBackendKeyValueToStringValue (CCSSettingValue *keyValue, | ||
302 | 403 | CCSSettingValue *stringValue) | ||
303 | 404 | { | ||
304 | 405 | char *newValue; | ||
305 | 406 | |||
306 | 407 | newValue = ccsKeyBindingToString (&keyValue->value.asKey); | ||
307 | 408 | if (newValue) | ||
308 | 409 | { | ||
309 | 410 | if (strcmp (newValue, "Disabled") == 0) | ||
310 | 411 | { | ||
311 | 412 | /* Metacity doesn't like "Disabled", it wants "disabled" */ | ||
312 | 413 | newValue[0] = 'd'; | ||
313 | 414 | } | ||
314 | 415 | |||
315 | 416 | stringValue->value.asString = newValue; | ||
316 | 417 | |||
317 | 418 | return TRUE; | ||
318 | 419 | } | ||
319 | 420 | |||
320 | 421 | return FALSE; | ||
321 | 422 | } | ||
322 | 423 | |||
323 | 376 | static void | 424 | static void |
324 | 377 | ccsGNOMEIntegrationBackendWriteOptionFromSetting (CCSIntegration *integration, | 425 | ccsGNOMEIntegrationBackendWriteOptionFromSetting (CCSIntegration *integration, |
325 | 378 | CCSContext *context, | 426 | CCSContext *context, |
326 | @@ -393,7 +441,14 @@ | |||
327 | 393 | /* Do not allow recursing back into writeIntegratedSetting */ | 441 | /* Do not allow recursing back into writeIntegratedSetting */ |
328 | 394 | ccsIntegrationDisallowIntegratedWrites (integration); | 442 | ccsIntegrationDisallowIntegratedWrites (integration); |
329 | 395 | 443 | ||
331 | 396 | CCSSettingValue *v = ccsSettingGetValue (setting); | 444 | CCSSettingType sType = ccsSettingGetType (setting); |
332 | 445 | CCSSettingInfo *sInfo = ccsSettingGetInfo (setting); | ||
333 | 446 | |||
334 | 447 | CCSSettingValue *vSetting = ccsSettingGetValue (setting); | ||
335 | 448 | CCSSettingValue *v = ccsCopyValue (vSetting, sType, sInfo); | ||
336 | 449 | |||
337 | 450 | if (!v) | ||
338 | 451 | return; | ||
339 | 397 | 452 | ||
340 | 398 | switch (ccsGNOMEIntegratedSettingInfoGetSpecialOptionType ((CCSGNOMEIntegratedSettingInfo *) integratedSetting)) | 453 | switch (ccsGNOMEIntegratedSettingInfoGetSpecialOptionType ((CCSGNOMEIntegratedSettingInfo *) integratedSetting)) |
341 | 399 | { | 454 | { |
342 | @@ -408,25 +463,22 @@ | |||
343 | 408 | break; | 463 | break; |
344 | 409 | case OptionKey: | 464 | case OptionKey: |
345 | 410 | { | 465 | { |
357 | 411 | char *newValue; | 466 | CCSSettingValue *newValue = calloc (1, sizeof (CCSSettingValue)); |
358 | 412 | 467 | ||
359 | 413 | newValue = ccsKeyBindingToString (&(ccsSettingGetValue (setting)->value.asKey)); | 468 | newValue->isListChild = FALSE; |
360 | 414 | if (newValue) | 469 | newValue->parent = NULL; |
361 | 415 | { | 470 | newValue->refCount = 1; |
362 | 416 | if (strcmp (newValue, "Disabled") == 0) | 471 | |
363 | 417 | { | 472 | if (ccsGNOMEIntegrationBackendKeyValueToStringValue (v, newValue)) |
364 | 418 | /* Metacity doesn't like "Disabled", it wants "disabled" */ | 473 | { |
354 | 419 | newValue[0] = 'd'; | ||
355 | 420 | } | ||
356 | 421 | |||
365 | 422 | /* Really this is a lie - the writer expects a string | 474 | /* Really this is a lie - the writer expects a string |
366 | 423 | * but it needs to know if its a key or a string */ | 475 | * but it needs to know if its a key or a string */ |
367 | 424 | type = TypeKey; | 476 | type = TypeKey; |
372 | 425 | v->value.asString = newValue; | 477 | ccsIntegratedSettingWriteValue (integratedSetting, newValue, type); |
369 | 426 | |||
370 | 427 | ccsIntegratedSettingWriteValue (integratedSetting, v, type); | ||
371 | 428 | free (newValue); | ||
373 | 429 | } | 478 | } |
374 | 479 | |||
375 | 480 | if (newValue) | ||
376 | 481 | ccsFreeSettingValueWithType (newValue, TypeString); | ||
377 | 430 | } | 482 | } |
378 | 431 | break; | 483 | break; |
379 | 432 | case OptionSpecial: | 484 | case OptionSpecial: |
380 | @@ -462,6 +514,18 @@ | |||
381 | 462 | 514 | ||
382 | 463 | ccsIntegratedSettingWriteValue (integratedSetting, newValue, type); | 515 | ccsIntegratedSettingWriteValue (integratedSetting, newValue, type); |
383 | 464 | } | 516 | } |
384 | 517 | else if ((strcmp (settingName, "run_command_screenshot_key") == 0 || | ||
385 | 518 | strcmp (settingName, "run_command_window_screenshot_key") == 0 || | ||
386 | 519 | strcmp (settingName, "run_command_terminal_key") == 0)) | ||
387 | 520 | { | ||
388 | 521 | if (ccsGNOMEIntegrationBackendKeyValueToStringValue (v, newValue)) | ||
389 | 522 | { | ||
390 | 523 | /* These are actually stored as strings in the schemas */ | ||
391 | 524 | type = TypeString; | ||
392 | 525 | ccsIntegratedSettingWriteValue (integratedSetting, newValue, type); | ||
393 | 526 | } | ||
394 | 527 | |||
395 | 528 | } | ||
396 | 465 | else if (((strcmp (settingName, "initiate_button") == 0) && | 529 | else if (((strcmp (settingName, "initiate_button") == 0) && |
397 | 466 | ((strcmp (pluginName, "move") == 0) || | 530 | ((strcmp (pluginName, "move") == 0) || |
398 | 467 | (strcmp (pluginName, "resize") == 0))) || | 531 | (strcmp (pluginName, "resize") == 0))) || |
399 | @@ -520,6 +584,9 @@ | |||
400 | 520 | g_error_free (err); | 584 | g_error_free (err); |
401 | 521 | } | 585 | } |
402 | 522 | 586 | ||
403 | 587 | if (v) | ||
404 | 588 | ccsFreeSettingValueWithType (v, sType); | ||
405 | 589 | |||
406 | 523 | /* we should immediately write changed settings */ | 590 | /* we should immediately write changed settings */ |
407 | 524 | ccsWriteChangedSettings (priv->context); | 591 | ccsWriteChangedSettings (priv->context); |
408 | 525 | ccsIntegrationAllowIntegratedWrites (integration); | 592 | ccsIntegrationAllowIntegratedWrites (integration); |
409 | 526 | 593 | ||
410 | === modified file 'compizconfig/integration/gnome/src/ccs_gnome_integration_constants.c' | |||
411 | --- compizconfig/integration/gnome/src/ccs_gnome_integration_constants.c 2012-08-22 09:15:24 +0000 | |||
412 | +++ compizconfig/integration/gnome/src/ccs_gnome_integration_constants.c 2012-09-25 15:17:24 +0000 | |||
413 | @@ -431,10 +431,14 @@ | |||
414 | 431 | static const char *org_compiz_integrated = "org.compiz.integrated"; | 431 | static const char *org_compiz_integrated = "org.compiz.integrated"; |
415 | 432 | static const char *org_gnome_desktop_wm_keybindings = "org.gnome.desktop.wm.keybindings"; | 432 | static const char *org_gnome_desktop_wm_keybindings = "org.gnome.desktop.wm.keybindings"; |
416 | 433 | static const char *org_gnome_desktop_wm_preferences = "org.gnome.desktop.wm.preferences"; | 433 | static const char *org_gnome_desktop_wm_preferences = "org.gnome.desktop.wm.preferences"; |
417 | 434 | static const char *org_gnome_settings_daemon_plugins_media_keys = "org.gnome.settings-daemon.plugins.media-keys"; | ||
418 | 435 | static const char *org_gnome_desktop_default_applications_terminal = "org.gnome.desktop.default-applications.terminal"; | ||
419 | 434 | 436 | ||
420 | 435 | quarks->ORG_COMPIZ_INTEGRATED = g_quark_from_string (org_compiz_integrated); | 437 | quarks->ORG_COMPIZ_INTEGRATED = g_quark_from_string (org_compiz_integrated); |
421 | 436 | quarks->ORG_GNOME_DESKTOP_WM_KEYBINDINGS = g_quark_from_string (org_gnome_desktop_wm_keybindings); | 438 | quarks->ORG_GNOME_DESKTOP_WM_KEYBINDINGS = g_quark_from_string (org_gnome_desktop_wm_keybindings); |
422 | 437 | quarks->ORG_GNOME_DESKTOP_WM_PREFERENCES = g_quark_from_string (org_gnome_desktop_wm_preferences); | 439 | quarks->ORG_GNOME_DESKTOP_WM_PREFERENCES = g_quark_from_string (org_gnome_desktop_wm_preferences); |
423 | 440 | quarks->ORG_GNOME_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS = g_quark_from_string (org_gnome_settings_daemon_plugins_media_keys); | ||
424 | 441 | quarks->ORG_GNOME_DESKTOP_DEFAULT_APPLICATIONS_TERMINAL = g_quark_from_string (org_gnome_desktop_default_applications_terminal); | ||
425 | 438 | 442 | ||
426 | 439 | return NULL; | 443 | return NULL; |
427 | 440 | } | 444 | } |
428 | @@ -501,7 +505,7 @@ | |||
429 | 501 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUTORAISE_DELAY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_PREFERENCES)); | 505 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUTORAISE_DELAY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_PREFERENCES)); |
430 | 502 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUTORAISE.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_PREFERENCES)); | 506 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_AUTORAISE.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_PREFERENCES)); |
431 | 503 | g_hash_table_insert (thumbnailHashTable, (gpointer) names->THUMBNAIL_CURRENT_VIEWPORT.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); | 507 | g_hash_table_insert (thumbnailHashTable, (gpointer) names->THUMBNAIL_CURRENT_VIEWPORT.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); |
433 | 504 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_COMMAND_TERMINAL.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); | 508 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_COMMAND_TERMINAL.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_DEFAULT_APPLICATIONS_TERMINAL)); |
434 | 505 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_COMMAND_WINDOW_SCREENSHOT.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); | 509 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_COMMAND_WINDOW_SCREENSHOT.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); |
435 | 506 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_COMMAND_SCREENSHOT.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); | 510 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_COMMAND_SCREENSHOT.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); |
436 | 507 | g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_RIGHT_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_KEYBINDINGS)); | 511 | g_hash_table_insert (rotateHashTable, (gpointer) names->ROTATE_ROTATE_RIGHT_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_KEYBINDINGS)); |
437 | @@ -609,11 +613,11 @@ | |||
438 | 609 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_KEYBINDINGS)); | 613 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_KEYBINDINGS)); |
439 | 610 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MINIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_KEYBINDINGS)); | 614 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MINIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_KEYBINDINGS)); |
440 | 611 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_TOGGLE_WINDOW_MAXIMIZED_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_KEYBINDINGS)); | 615 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_TOGGLE_WINDOW_MAXIMIZED_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_KEYBINDINGS)); |
446 | 612 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_COMMAND_TERMINAL_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); | 616 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_COMMAND_TERMINAL_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS)); |
447 | 613 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_COMMAND_WINDOW_SCREENSHOT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); | 617 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_COMMAND_WINDOW_SCREENSHOT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS)); |
448 | 614 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_COMMAND_SCREENSHOT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); | 618 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_COMMAND_SCREENSHOT_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_SETTINGS_DAEMON_PLUGINS_MEDIA_KEYS)); |
449 | 615 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_MAIN_MENU_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); | 619 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_MAIN_MENU_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_KEYBINDINGS)); |
450 | 616 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_KEY.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); | 620 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_KEY.compizName, GINT_TO_POINTER (quarks->ORG_GNOME_DESKTOP_WM_KEYBINDINGS)); |
451 | 617 | g_hash_table_insert (unityshellHashTable, (gpointer) names->UNITYSHELL_SHOW_HUD.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); | 621 | g_hash_table_insert (unityshellHashTable, (gpointer) names->UNITYSHELL_SHOW_HUD.compizName, GINT_TO_POINTER (quarks->ORG_COMPIZ_INTEGRATED)); |
452 | 618 | 622 | ||
453 | 619 | return masterHashTable; | 623 | return masterHashTable; |
454 | @@ -937,9 +941,9 @@ | |||
455 | 937 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey)); | 941 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MAXIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey)); |
456 | 938 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MINIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey)); | 942 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_MINIMIZE_WINDOW_KEY.compizName, GINT_TO_POINTER (OptionKey)); |
457 | 939 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_TOGGLE_WINDOW_MAXIMIZED_KEY.compizName, GINT_TO_POINTER (OptionKey)); | 943 | g_hash_table_insert (coreHashTable, (gpointer) names->CORE_TOGGLE_WINDOW_MAXIMIZED_KEY.compizName, GINT_TO_POINTER (OptionKey)); |
461 | 940 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_COMMAND_TERMINAL_KEY.compizName, GINT_TO_POINTER (OptionKey)); | 944 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_COMMAND_TERMINAL_KEY.compizName, GINT_TO_POINTER (OptionSpecial)); |
462 | 941 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_COMMAND_WINDOW_SCREENSHOT_KEY.compizName, GINT_TO_POINTER (OptionKey)); | 945 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_COMMAND_WINDOW_SCREENSHOT_KEY.compizName, GINT_TO_POINTER (OptionSpecial)); |
463 | 942 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_COMMAND_SCREENSHOT_KEY.compizName, GINT_TO_POINTER (OptionKey)); | 946 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_COMMAND_SCREENSHOT_KEY.compizName, GINT_TO_POINTER (OptionSpecial)); |
464 | 943 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_MAIN_MENU_KEY.compizName, GINT_TO_POINTER (OptionKey)); | 947 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_MAIN_MENU_KEY.compizName, GINT_TO_POINTER (OptionKey)); |
465 | 944 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_KEY.compizName, GINT_TO_POINTER (OptionKey)); | 948 | g_hash_table_insert (gnomecompatHashTable, (gpointer) names->GNOMECOMPAT_RUN_KEY.compizName, GINT_TO_POINTER (OptionKey)); |
466 | 945 | g_hash_table_insert (unityshellHashTable, (gpointer) names->UNITYSHELL_SHOW_HUD.compizName, GINT_TO_POINTER (OptionKey)); | 949 | g_hash_table_insert (unityshellHashTable, (gpointer) names->UNITYSHELL_SHOW_HUD.compizName, GINT_TO_POINTER (OptionKey)); |
467 | 946 | 950 | ||
468 | === modified file 'compizconfig/integration/gnome/tests/compizconfig_ccs_mock_gnome_integrated_setting_composition.c' | |||
469 | --- compizconfig/integration/gnome/tests/compizconfig_ccs_mock_gnome_integrated_setting_composition.c 2012-09-23 16:46:19 +0000 | |||
470 | +++ compizconfig/integration/gnome/tests/compizconfig_ccs_mock_gnome_integrated_setting_composition.c 2012-09-25 15:17:24 +0000 | |||
471 | @@ -131,7 +131,6 @@ | |||
472 | 131 | 131 | ||
473 | 132 | ccsIntegratedSettingUnref (priv->integratedSetting); | 132 | ccsIntegratedSettingUnref (priv->integratedSetting); |
474 | 133 | ccsGNOMEIntegratedSettingInfoUnref (priv->gnomeIntegratedSettingInfo); | 133 | ccsGNOMEIntegratedSettingInfoUnref (priv->gnomeIntegratedSettingInfo); |
475 | 134 | ccsIntegratedSettingInfoUnref (priv->integratedSettingInfo); | ||
476 | 135 | 134 | ||
477 | 136 | ccsObjectFinalize (integratedSetting); | 135 | ccsObjectFinalize (integratedSetting); |
478 | 137 | (*integratedSetting->object.object_allocation->free_) | 136 | (*integratedSetting->object.object_allocation->free_) |
479 | @@ -202,7 +201,6 @@ | |||
480 | 202 | 201 | ||
481 | 203 | ccsIntegratedSettingRef (priv->integratedSetting); | 202 | ccsIntegratedSettingRef (priv->integratedSetting); |
482 | 204 | ccsGNOMEIntegratedSettingInfoRef (priv->gnomeIntegratedSettingInfo); | 203 | ccsGNOMEIntegratedSettingInfoRef (priv->gnomeIntegratedSettingInfo); |
483 | 205 | ccsIntegratedSettingInfoRef (priv->integratedSettingInfo); | ||
484 | 206 | 204 | ||
485 | 207 | ccsObjectSetPrivate (composition, (CCSPrivate *) (priv)); | 205 | ccsObjectSetPrivate (composition, (CCSPrivate *) (priv)); |
486 | 208 | ccsObjectAddInterface (composition, | 206 | ccsObjectAddInterface (composition, |
487 | 209 | 207 | ||
488 | === modified file 'compizconfig/integration/gnome/tests/compizconfig_test_ccs_gnome_integration.cpp' | |||
489 | --- compizconfig/integration/gnome/tests/compizconfig_test_ccs_gnome_integration.cpp 2012-09-24 03:44:08 +0000 | |||
490 | +++ compizconfig/integration/gnome/tests/compizconfig_test_ccs_gnome_integration.cpp 2012-09-25 15:17:24 +0000 | |||
491 | @@ -58,6 +58,8 @@ | |||
492 | 58 | using ::testing::ReturnNull; | 58 | using ::testing::ReturnNull; |
493 | 59 | using ::testing::SetArgPointee; | 59 | using ::testing::SetArgPointee; |
494 | 60 | using ::testing::DoAll; | 60 | using ::testing::DoAll; |
495 | 61 | using ::testing::Values; | ||
496 | 62 | using ::testing::WithParamInterface; | ||
497 | 61 | using ::testing::_; | 63 | using ::testing::_; |
498 | 62 | 64 | ||
499 | 63 | namespace | 65 | namespace |
500 | @@ -80,6 +82,7 @@ | |||
501 | 80 | setting.c_str (), | 82 | setting.c_str (), |
502 | 81 | type, | 83 | type, |
503 | 82 | allocator); | 84 | allocator); |
504 | 85 | /* This takes ownership of integratedSettingInfo */ | ||
505 | 83 | CCSGNOMEIntegratedSettingInfo *gnomeIntegratedSettingInfo = | 86 | CCSGNOMEIntegratedSettingInfo *gnomeIntegratedSettingInfo = |
506 | 84 | ccsGNOMEIntegratedSettingInfoNew (integratedSettingInfo, | 87 | ccsGNOMEIntegratedSettingInfoNew (integratedSettingInfo, |
507 | 85 | gnomeType, | 88 | gnomeType, |
508 | @@ -100,7 +103,6 @@ | |||
509 | 100 | 103 | ||
510 | 101 | /* We want the composition to take ownership here, so unref the | 104 | /* We want the composition to take ownership here, so unref the |
511 | 102 | * original members of the composition */ | 105 | * original members of the composition */ |
512 | 103 | ccsIntegratedSettingInfoUnref (integratedSettingInfo); | ||
513 | 104 | ccsGNOMEIntegratedSettingInfoUnref (gnomeIntegratedSettingInfo); | 106 | ccsGNOMEIntegratedSettingInfoUnref (gnomeIntegratedSettingInfo); |
514 | 105 | ccsIntegratedSettingUnref (integratedSetting); | 107 | ccsIntegratedSettingUnref (integratedSetting); |
515 | 106 | 108 | ||
516 | @@ -119,38 +121,37 @@ | |||
517 | 119 | return std::tr1::get <1> (integratedSettingWithMocks).get (); | 121 | return std::tr1::get <1> (integratedSettingWithMocks).get (); |
518 | 120 | } | 122 | } |
519 | 121 | 123 | ||
529 | 122 | typedef std::tr1::tuple <CCSContextGMock &, | 124 | typedef std::tr1::tuple <CCSContextGMock &, |
530 | 123 | CCSBackendGMock &, | 125 | CCSBackendGMock &, |
531 | 124 | CCSIntegratedSettingsStorageGMock &, | 126 | CCSIntegratedSettingsStorageGMock &, |
532 | 125 | CCSIntegratedSettingFactoryGMock &, | 127 | CCSIntegratedSettingFactoryGMock &, |
533 | 126 | boost::shared_ptr <CCSContext> , | 128 | boost::shared_ptr <CCSContext> , |
534 | 127 | boost::shared_ptr <CCSBackend> , | 129 | boost::shared_ptr <CCSBackend> , |
535 | 128 | boost::shared_ptr <CCSIntegratedSettingsStorage> , | 130 | CCSIntegratedSettingsStorage *, |
536 | 129 | boost::shared_ptr <CCSIntegratedSettingFactory> , | 131 | CCSIntegratedSettingFactory *, |
537 | 130 | boost::shared_ptr <CCSIntegration> > CCSGNOMEIntegrationWithMocks; | 132 | boost::shared_ptr <CCSIntegration> > CCSGNOMEIntegrationWithMocks; |
538 | 131 | 133 | ||
539 | 132 | CCSGNOMEIntegrationWithMocks | 134 | CCSGNOMEIntegrationWithMocks |
540 | 133 | createIntegrationWithMocks (CCSObjectAllocationInterface *ai) | 135 | createIntegrationWithMocks (CCSObjectAllocationInterface *ai) |
541 | 134 | { | 136 | { |
556 | 135 | boost::shared_ptr <CCSContext> context (AutoDestroy (ccsMockContextNew (), | 137 | boost::shared_ptr <CCSContext> context (AutoDestroy (ccsMockContextNew (), |
557 | 136 | ccsFreeContext)); | 138 | ccsFreeContext)); |
558 | 137 | boost::shared_ptr <CCSBackend> backend (AutoDestroy (ccsMockBackendNew (), | 139 | boost::shared_ptr <CCSBackend> backend (AutoDestroy (ccsMockBackendNew (), |
559 | 138 | ccsBackendUnref)); | 140 | ccsFreeMockBackend)); |
560 | 139 | boost::shared_ptr <CCSIntegratedSettingsStorage> storage (AutoDestroy (ccsMockIntegratedSettingsStorageNew (ai), | 141 | /* The GNOME Integration backend takes ownership of these two */ |
561 | 140 | ccsIntegratedSettingsStorageUnref)); | 142 | CCSIntegratedSettingsStorage *storage (ccsMockIntegratedSettingsStorageNew (ai)); |
562 | 141 | boost::shared_ptr <CCSIntegratedSettingFactory> factory (AutoDestroy (ccsMockIntegratedSettingFactoryNew (ai), | 143 | CCSIntegratedSettingFactory *factory (ccsMockIntegratedSettingFactoryNew (ai)); |
563 | 142 | ccsIntegratedSettingFactoryUnref)); | 144 | boost::shared_ptr <CCSIntegration> integration (AutoDestroy (ccsGNOMEIntegrationBackendNew (backend.get (), |
564 | 143 | boost::shared_ptr <CCSIntegration> integration (AutoDestroy (ccsGNOMEIntegrationBackendNew (backend.get (), | 145 | context.get (), |
565 | 144 | context.get (), | 146 | factory, |
566 | 145 | factory.get (), | 147 | storage, |
567 | 146 | storage.get (), | 148 | ai), |
568 | 147 | ai), | 149 | ccsIntegrationUnref)); |
555 | 148 | ccsIntegrationUnref)); | ||
569 | 149 | 150 | ||
570 | 150 | CCSContextGMock &gmockContext = *(reinterpret_cast <CCSContextGMock *> (ccsObjectGetPrivate (context.get ()))); | 151 | CCSContextGMock &gmockContext = *(reinterpret_cast <CCSContextGMock *> (ccsObjectGetPrivate (context.get ()))); |
571 | 151 | CCSBackendGMock &gmockBackend = *(reinterpret_cast <CCSBackendGMock *> (ccsObjectGetPrivate (backend.get ()))); | 152 | CCSBackendGMock &gmockBackend = *(reinterpret_cast <CCSBackendGMock *> (ccsObjectGetPrivate (backend.get ()))); |
574 | 152 | CCSIntegratedSettingsStorageGMock &gmockStorage = *(reinterpret_cast <CCSIntegratedSettingsStorageGMock *> (ccsObjectGetPrivate (storage.get ()))); | 153 | CCSIntegratedSettingsStorageGMock &gmockStorage = *(reinterpret_cast <CCSIntegratedSettingsStorageGMock *> (ccsObjectGetPrivate (storage))); |
575 | 153 | CCSIntegratedSettingFactoryGMock &gmockFactory = *(reinterpret_cast <CCSIntegratedSettingFactoryGMock *> (ccsObjectGetPrivate (factory.get ()))); | 154 | CCSIntegratedSettingFactoryGMock &gmockFactory = *(reinterpret_cast <CCSIntegratedSettingFactoryGMock *> (ccsObjectGetPrivate (factory))); |
576 | 154 | 155 | ||
577 | 155 | return CCSGNOMEIntegrationWithMocks (gmockContext, | 156 | return CCSGNOMEIntegrationWithMocks (gmockContext, |
578 | 156 | gmockBackend, | 157 | gmockBackend, |
579 | @@ -222,10 +223,19 @@ | |||
580 | 222 | EXPECT_CALL (plugin, getName ()).WillOnce (Return (pluginName.c_str ())); | 223 | EXPECT_CALL (plugin, getName ()).WillOnce (Return (pluginName.c_str ())); |
581 | 223 | } | 224 | } |
582 | 224 | 225 | ||
583 | 226 | void | ||
584 | 227 | SetTypeInfo (CCSSettingGMock &setting, | ||
585 | 228 | CCSSettingType type, | ||
586 | 229 | CCSSettingInfo *info) | ||
587 | 230 | { | ||
588 | 231 | EXPECT_CALL (setting, getType ()).WillOnce (Return (type)); | ||
589 | 232 | EXPECT_CALL (setting, getInfo ()).WillOnce (Return (info)); | ||
590 | 233 | } | ||
591 | 234 | |||
592 | 225 | CCSSettingValue * | 235 | CCSSettingValue * |
593 | 226 | MakeSettingValue () | 236 | MakeSettingValue () |
594 | 227 | { | 237 | { |
596 | 228 | CCSSettingValue *v = new CCSSettingValue; | 238 | CCSSettingValue *v = reinterpret_cast <CCSSettingValue *> (calloc (1, sizeof (CCSSettingValue))); |
597 | 229 | v->parent = NULL; | 239 | v->parent = NULL; |
598 | 230 | v->isListChild = FALSE; | 240 | v->isListChild = FALSE; |
599 | 231 | v->refCount = 1; | 241 | v->refCount = 1; |
600 | @@ -236,7 +246,7 @@ | |||
601 | 236 | boost::shared_ptr <CCSSettingValue> | 246 | boost::shared_ptr <CCSSettingValue> |
602 | 237 | MakeAutoDestroySettingValue (CCSSettingType type) | 247 | MakeAutoDestroySettingValue (CCSSettingType type) |
603 | 238 | { | 248 | { |
605 | 239 | CCSSettingValue *v = new CCSSettingValue; | 249 | CCSSettingValue *v = reinterpret_cast <CCSSettingValue *> (calloc (1, sizeof (CCSSettingValue))); |
606 | 240 | v->parent = NULL; | 250 | v->parent = NULL; |
607 | 241 | v->isListChild = FALSE; | 251 | v->isListChild = FALSE; |
608 | 242 | v->refCount = 1; | 252 | v->refCount = 1; |
609 | @@ -387,6 +397,82 @@ | |||
610 | 387 | 397 | ||
611 | 388 | namespace | 398 | namespace |
612 | 389 | { | 399 | { |
613 | 400 | struct IntegratedMediaKeysParam | ||
614 | 401 | { | ||
615 | 402 | public: | ||
616 | 403 | |||
617 | 404 | IntegratedMediaKeysParam (const std::string &settingName, | ||
618 | 405 | const std::string &integratedName, | ||
619 | 406 | const std::string &keyValueString) : | ||
620 | 407 | settingName (settingName), | ||
621 | 408 | integratedName (integratedName), | ||
622 | 409 | keyValueString (keyValueString) | ||
623 | 410 | { | ||
624 | 411 | EXPECT_TRUE (ccsStringToKeyBinding (keyValueString.c_str (), | ||
625 | 412 | &keyValue)); | ||
626 | 413 | } | ||
627 | 414 | |||
628 | 415 | const std::string settingName; | ||
629 | 416 | const std::string integratedName; | ||
630 | 417 | const std::string keyValueString; | ||
631 | 418 | CCSSettingKeyValue keyValue; | ||
632 | 419 | }; | ||
633 | 420 | } | ||
634 | 421 | |||
635 | 422 | namespace | ||
636 | 423 | { | ||
637 | 424 | std::string RUN_COMMAND_SCREENSHOT_KEY ("run_command_screenshot_key"); | ||
638 | 425 | std::string SCREENSHOT ("screenshot"); | ||
639 | 426 | std::string SCREENSHOT_BINDING ("<Alt>Print"); | ||
640 | 427 | std::string RUN_COMMAND_WINDOW_SCREENSHOT_KEY ("run_command_window_screenshot_key"); | ||
641 | 428 | std::string WINDOW_SCREENSHOT ("window_screenshot"); | ||
642 | 429 | std::string WINDOW_SCREENSHOT_BINDING ("<Control><Alt>Print"); | ||
643 | 430 | std::string RUN_COMMAND_TERMINAL_KEY ("run_command_terminal_key"); | ||
644 | 431 | std::string TERMINAL ("terminal"); | ||
645 | 432 | std::string TERMINAL_BINDING ("<Control><Alt>t"); | ||
646 | 433 | } | ||
647 | 434 | |||
648 | 435 | class CCSGNOMEIntegrationTestReadIntegratedMediaKeys : | ||
649 | 436 | public CCSGNOMEIntegrationTestReadIntegrated, | ||
650 | 437 | public WithParamInterface <IntegratedMediaKeysParam> | ||
651 | 438 | { | ||
652 | 439 | }; | ||
653 | 440 | |||
654 | 441 | TEST_P (CCSGNOMEIntegrationTestReadIntegratedMediaKeys, TestReadIntegratedMediaKey) | ||
655 | 442 | { | ||
656 | 443 | const std::string settingName (GetParam ().settingName); | ||
657 | 444 | CCSSettingValue *v = MakeSettingValue (); | ||
658 | 445 | v->value.asString = strdup (GetParam ().keyValueString.c_str ()); | ||
659 | 446 | |||
660 | 447 | mIntegratedSetting = createIntegratedSettingCompositionFromMock (MOCK_PLUGIN, | ||
661 | 448 | settingName, | ||
662 | 449 | TypeString, | ||
663 | 450 | OptionSpecial, | ||
664 | 451 | MOCK_GNOME_NAME, | ||
665 | 452 | &ccsDefaultObjectAllocator); | ||
666 | 453 | SetNames (mSettingMock, mPluginMock, settingName, MOCK_PLUGIN); | ||
667 | 454 | EXPECT_CALL (Mock (*mIntegratedSetting), readValue (TypeString)).WillOnce (Return (v)); | ||
668 | 455 | EXPECT_CALL (mSettingMock, setKey (Eq (GetParam ().keyValue), IsTrue ())); | ||
669 | 456 | |||
670 | 457 | EXPECT_THAT (ccsIntegrationReadOptionIntoSetting (Real (mIntegration), | ||
671 | 458 | NULL, | ||
672 | 459 | mSetting.get (), | ||
673 | 460 | Real (*mIntegratedSetting)), IsTrue ()); | ||
674 | 461 | } | ||
675 | 462 | |||
676 | 463 | INSTANTIATE_TEST_CASE_P (CCSGNOMEMediaKeys, CCSGNOMEIntegrationTestReadIntegratedMediaKeys, | ||
677 | 464 | Values (IntegratedMediaKeysParam (RUN_COMMAND_SCREENSHOT_KEY, | ||
678 | 465 | SCREENSHOT, | ||
679 | 466 | SCREENSHOT_BINDING), | ||
680 | 467 | IntegratedMediaKeysParam (RUN_COMMAND_WINDOW_SCREENSHOT_KEY, | ||
681 | 468 | WINDOW_SCREENSHOT, | ||
682 | 469 | WINDOW_SCREENSHOT_BINDING), | ||
683 | 470 | IntegratedMediaKeysParam (RUN_COMMAND_TERMINAL_KEY, | ||
684 | 471 | TERMINAL, | ||
685 | 472 | TERMINAL_BINDING))); | ||
686 | 473 | |||
687 | 474 | namespace | ||
688 | 475 | { | ||
689 | 390 | const std::string DEFAULT_MOUSE_BUTTON_MODIFIERS_STRING ("<Alt>"); | 476 | const std::string DEFAULT_MOUSE_BUTTON_MODIFIERS_STRING ("<Alt>"); |
690 | 391 | const std::string GNOME_MOUSE_BUTTON_MODIFIERS_STRING ("<Super>"); | 477 | const std::string GNOME_MOUSE_BUTTON_MODIFIERS_STRING ("<Super>"); |
691 | 392 | const unsigned int DEFAULT_MOUSE_BUTTON_MODIFIERS = | 478 | const unsigned int DEFAULT_MOUSE_BUTTON_MODIFIERS = |
692 | @@ -622,7 +708,8 @@ | |||
693 | 622 | newButtonValue.buttonModMask = 0; | 708 | newButtonValue.buttonModMask = 0; |
694 | 623 | 709 | ||
695 | 624 | /* Clear the old expectation */ | 710 | /* Clear the old expectation */ |
697 | 625 | ccsIntegratedSettingReadValue (mIntegratedSettingMBM.get (), TypeString); | 711 | ccsFreeSettingValueWithType (ccsIntegratedSettingReadValue (mIntegratedSettingMBM.get (), TypeString), |
698 | 712 | TypeString); | ||
699 | 626 | /* Now return null */ | 713 | /* Now return null */ |
700 | 627 | EXPECT_CALL (mIntegratedSettingMBMMock, readValue (TypeString)).WillOnce (ReturnNull ()); | 714 | EXPECT_CALL (mIntegratedSettingMBMMock, readValue (TypeString)).WillOnce (ReturnNull ()); |
701 | 628 | 715 | ||
702 | @@ -661,6 +748,7 @@ | |||
703 | 661 | MOCK_GNOME_NAME, | 748 | MOCK_GNOME_NAME, |
704 | 662 | &ccsDefaultObjectAllocator); | 749 | &ccsDefaultObjectAllocator); |
705 | 663 | SetNames (mSettingMock, mPluginMock, settingName, MOCK_PLUGIN); | 750 | SetNames (mSettingMock, mPluginMock, settingName, MOCK_PLUGIN); |
706 | 751 | SetTypeInfo (mSettingMock, TypeBool, &info); | ||
707 | 664 | 752 | ||
708 | 665 | EXPECT_CALL (mSettingMock, getValue ()).WillOnce (Return (compizValue.get ())); | 753 | EXPECT_CALL (mSettingMock, getValue ()).WillOnce (Return (compizValue.get ())); |
709 | 666 | EXPECT_CALL (Mock (*mIntegratedSetting), writeValue (Pointee (SettingValueMatch (*gnomeValue, | 754 | EXPECT_CALL (Mock (*mIntegratedSetting), writeValue (Pointee (SettingValueMatch (*gnomeValue, |
710 | @@ -690,6 +778,7 @@ | |||
711 | 690 | MOCK_GNOME_NAME, | 778 | MOCK_GNOME_NAME, |
712 | 691 | &ccsDefaultObjectAllocator); | 779 | &ccsDefaultObjectAllocator); |
713 | 692 | SetNames (mSettingMock, mPluginMock, settingName, MOCK_PLUGIN); | 780 | SetNames (mSettingMock, mPluginMock, settingName, MOCK_PLUGIN); |
714 | 781 | SetTypeInfo (mSettingMock, TypeBool, &info); | ||
715 | 693 | 782 | ||
716 | 694 | EXPECT_CALL (mSettingMock, getValue ()).WillOnce (Return (compizValue.get ())); | 783 | EXPECT_CALL (mSettingMock, getValue ()).WillOnce (Return (compizValue.get ())); |
717 | 695 | EXPECT_CALL (Mock (*mIntegratedSetting), writeValue (Pointee (SettingValueMatch (*gnomeValue, | 784 | EXPECT_CALL (Mock (*mIntegratedSetting), writeValue (Pointee (SettingValueMatch (*gnomeValue, |
718 | @@ -719,25 +808,81 @@ | |||
719 | 719 | MOCK_GNOME_NAME, | 808 | MOCK_GNOME_NAME, |
720 | 720 | &ccsDefaultObjectAllocator); | 809 | &ccsDefaultObjectAllocator); |
721 | 721 | SetNames (mSettingMock, mPluginMock, settingName, MOCK_PLUGIN); | 810 | SetNames (mSettingMock, mPluginMock, settingName, MOCK_PLUGIN); |
733 | 722 | 811 | SetTypeInfo (mSettingMock, TypeBool, &info); | |
734 | 723 | EXPECT_CALL (mSettingMock, getValue ()).WillOnce (Return (compizValue.get ())); | 812 | |
735 | 724 | EXPECT_CALL (Mock (*mIntegratedSetting), writeValue (Pointee (SettingValueMatch (*gnomeValue, | 813 | EXPECT_CALL (mSettingMock, getValue ()).WillOnce (Return (compizValue.get ())); |
736 | 725 | TypeString, | 814 | EXPECT_CALL (Mock (*mIntegratedSetting), writeValue (Pointee (SettingValueMatch (*gnomeValue, |
737 | 726 | &info)), | 815 | TypeString, |
738 | 727 | TypeString)); | 816 | &info)), |
739 | 728 | ccsIntegrationWriteSettingIntoOption (Real (mIntegration), | 817 | TypeString)); |
740 | 729 | NULL, | 818 | ccsIntegrationWriteSettingIntoOption (Real (mIntegration), |
741 | 730 | mSetting.get (), | 819 | NULL, |
742 | 731 | Real (*mIntegratedSetting)); | 820 | mSetting.get (), |
743 | 732 | } | 821 | Real (*mIntegratedSetting)); |
744 | 822 | } | ||
745 | 823 | |||
746 | 824 | class CCSGNOMEIntegrationTestWriteIntegratedMediaKeys : | ||
747 | 825 | public CCSGNOMEIntegrationTestWriteIntegrated, | ||
748 | 826 | public WithParamInterface <IntegratedMediaKeysParam> | ||
749 | 827 | { | ||
750 | 828 | }; | ||
751 | 829 | |||
752 | 830 | TEST_P (CCSGNOMEIntegrationTestWriteIntegratedMediaKeys, TestWriteIntegratedMediaKey) | ||
753 | 831 | { | ||
754 | 832 | const std::string settingName (GetParam ().settingName); | ||
755 | 833 | boost::shared_ptr <CCSSettingValue> compizValue (MakeAutoDestroySettingValue (TypeKey)); | ||
756 | 834 | boost::shared_ptr <CCSSettingValue> gnomeValue (MakeAutoDestroySettingValue (TypeString)); | ||
757 | 835 | CCSSettingInfo info; | ||
758 | 836 | |||
759 | 837 | compizValue->value.asKey = GetParam ().keyValue; | ||
760 | 838 | gnomeValue->value.asString = strdup (GetParam ().keyValueString.c_str ()); | ||
761 | 839 | |||
762 | 840 | mIntegratedSetting = createIntegratedSettingCompositionFromMock (MOCK_PLUGIN, | ||
763 | 841 | settingName, | ||
764 | 842 | TypeString, | ||
765 | 843 | OptionSpecial, | ||
766 | 844 | MOCK_GNOME_NAME, | ||
767 | 845 | &ccsDefaultObjectAllocator); | ||
768 | 846 | SetNames (mSettingMock, mPluginMock, settingName, MOCK_PLUGIN); | ||
769 | 847 | SetTypeInfo (mSettingMock, TypeKey, &info); | ||
770 | 848 | |||
771 | 849 | EXPECT_CALL (mSettingMock, getValue ()).WillOnce (Return (compizValue.get ())); | ||
772 | 850 | EXPECT_CALL (Mock (*mIntegratedSetting), writeValue (Pointee (SettingValueMatch (*gnomeValue, | ||
773 | 851 | TypeString, | ||
774 | 852 | &info)), | ||
775 | 853 | TypeString)); | ||
776 | 854 | ccsIntegrationWriteSettingIntoOption (Real (mIntegration), | ||
777 | 855 | NULL, | ||
778 | 856 | mSetting.get (), | ||
779 | 857 | Real (*mIntegratedSetting)); | ||
780 | 858 | } | ||
781 | 859 | |||
782 | 860 | INSTANTIATE_TEST_CASE_P (CCSGNOMEMediaKeys, CCSGNOMEIntegrationTestWriteIntegratedMediaKeys, | ||
783 | 861 | Values (IntegratedMediaKeysParam (RUN_COMMAND_SCREENSHOT_KEY, | ||
784 | 862 | SCREENSHOT, | ||
785 | 863 | SCREENSHOT_BINDING), | ||
786 | 864 | IntegratedMediaKeysParam (RUN_COMMAND_WINDOW_SCREENSHOT_KEY, | ||
787 | 865 | WINDOW_SCREENSHOT, | ||
788 | 866 | WINDOW_SCREENSHOT_BINDING), | ||
789 | 867 | IntegratedMediaKeysParam (RUN_COMMAND_TERMINAL_KEY, | ||
790 | 868 | TERMINAL, | ||
791 | 869 | TERMINAL_BINDING))); | ||
792 | 733 | 870 | ||
793 | 734 | /* | 871 | /* |
794 | 735 | * TODO: Break up the function that this test covers. Its way too complicated | 872 | * TODO: Break up the function that this test covers. Its way too complicated |
795 | 736 | */ | 873 | */ |
796 | 737 | TEST_F (CCSGNOMEIntegrationTestWithMocksWriteIntegratedMouseButtonModifiers, TestWriteMouseButtonModifier) | 874 | TEST_F (CCSGNOMEIntegrationTestWithMocksWriteIntegratedMouseButtonModifiers, TestWriteMouseButtonModifier) |
797 | 738 | { | 875 | { |
800 | 739 | const std::string settingName ("initiate_button"); | 876 | const std::string moveSettingName ("initiate_button"); |
801 | 740 | const std::string pluginName ("move"); | 877 | const std::string movePluginName ("move"); |
802 | 878 | const std::string resizeSettingName ("initiate_button"); | ||
803 | 879 | const std::string resizePluginName ("resize"); | ||
804 | 880 | const std::string coreSettingName ("window_menu_button"); | ||
805 | 881 | const std::string corePluginName ("core"); | ||
806 | 882 | |||
807 | 883 | const std::string settingName (moveSettingName); | ||
808 | 884 | const std::string pluginName (movePluginName); | ||
809 | 885 | |||
810 | 741 | CCSSettingInfo info; | 886 | CCSSettingInfo info; |
811 | 742 | 887 | ||
812 | 743 | mIntegratedSetting = createIntegratedSettingCompositionFromMock (pluginName, | 888 | mIntegratedSetting = createIntegratedSettingCompositionFromMock (pluginName, |
813 | @@ -747,19 +892,20 @@ | |||
814 | 747 | MOCK_GNOME_NAME, | 892 | MOCK_GNOME_NAME, |
815 | 748 | &ccsDefaultObjectAllocator); | 893 | &ccsDefaultObjectAllocator); |
816 | 749 | SetNames (mSettingMock, mPluginMock, settingName, pluginName); | 894 | SetNames (mSettingMock, mPluginMock, settingName, pluginName); |
817 | 895 | SetTypeInfo (mSettingMock, TypeButton, &info); | ||
818 | 750 | 896 | ||
821 | 751 | EXPECT_CALL (MockContext (mIntegration), findPlugin (Eq ("move"))).WillRepeatedly (Return (movePlugin.get ())); | 897 | EXPECT_CALL (MockContext (mIntegration), findPlugin (Eq (movePluginName))).WillRepeatedly (Return (movePlugin.get ())); |
822 | 752 | EXPECT_CALL (movePluginMock, findSetting (Eq ("initiate_button"))).WillRepeatedly (Return (moveInitiateButtonSetting.get ())); | 898 | EXPECT_CALL (movePluginMock, findSetting (Eq (moveSettingName))).WillRepeatedly (Return (moveInitiateButtonSetting.get ())); |
823 | 753 | EXPECT_CALL (moveInitiateButtonSettingMock, getType ()).WillRepeatedly (Return (TypeButton)); | 899 | EXPECT_CALL (moveInitiateButtonSettingMock, getType ()).WillRepeatedly (Return (TypeButton)); |
824 | 754 | EXPECT_CALL (moveInitiateButtonSettingMock, getValue ()).WillRepeatedly (Return (moveInitiateButton.get ())); | 900 | EXPECT_CALL (moveInitiateButtonSettingMock, getValue ()).WillRepeatedly (Return (moveInitiateButton.get ())); |
825 | 755 | 901 | ||
828 | 756 | EXPECT_CALL (MockContext (mIntegration), findPlugin (Eq ("resize"))).WillRepeatedly (Return (resizePlugin.get ())); | 902 | EXPECT_CALL (MockContext (mIntegration), findPlugin (Eq (resizePluginName))).WillRepeatedly (Return (resizePlugin.get ())); |
829 | 757 | EXPECT_CALL (resizePluginMock, findSetting (Eq ("initiate_button"))).WillRepeatedly (Return (resizeInitiateButtonSetting.get ())); | 903 | EXPECT_CALL (resizePluginMock, findSetting (Eq (resizeSettingName))).WillRepeatedly (Return (resizeInitiateButtonSetting.get ())); |
830 | 758 | EXPECT_CALL (resizeInitiateButtonSettingMock, getType ()).WillRepeatedly (Return (TypeButton)); | 904 | EXPECT_CALL (resizeInitiateButtonSettingMock, getType ()).WillRepeatedly (Return (TypeButton)); |
831 | 759 | EXPECT_CALL (resizeInitiateButtonSettingMock, getValue ()).WillRepeatedly (Return (resizeInitiateButton.get ())); | 905 | EXPECT_CALL (resizeInitiateButtonSettingMock, getValue ()).WillRepeatedly (Return (resizeInitiateButton.get ())); |
832 | 760 | 906 | ||
835 | 761 | EXPECT_CALL (MockContext (mIntegration), findPlugin (Eq ("core"))).WillRepeatedly (Return (corePlugin.get ())); | 907 | EXPECT_CALL (MockContext (mIntegration), findPlugin (Eq (corePluginName))).WillRepeatedly (Return (corePlugin.get ())); |
836 | 762 | EXPECT_CALL (corePluginMock, findSetting (Eq ("window_menu_button"))).WillRepeatedly (Return (coreWindowMenuSetting.get ())); | 908 | EXPECT_CALL (corePluginMock, findSetting (Eq (coreSettingName))).WillRepeatedly (Return (coreWindowMenuSetting.get ())); |
837 | 763 | EXPECT_CALL (coreWindowMenuSettingMock, getType ()).WillRepeatedly (Return (TypeButton)); | 909 | EXPECT_CALL (coreWindowMenuSettingMock, getType ()).WillRepeatedly (Return (TypeButton)); |
838 | 764 | EXPECT_CALL (coreWindowMenuSettingMock, getValue ()).WillRepeatedly (Return (coreWindowMenuButton.get ())); | 910 | EXPECT_CALL (coreWindowMenuSettingMock, getValue ()).WillRepeatedly (Return (coreWindowMenuButton.get ())); |
839 | 765 | 911 | ||
840 | 766 | 912 | ||
841 | === modified file 'compizconfig/libcompizconfig/include/ccs.h' | |||
842 | --- compizconfig/libcompizconfig/include/ccs.h 2012-09-10 01:06:55 +0000 | |||
843 | +++ compizconfig/libcompizconfig/include/ccs.h 2012-09-25 15:17:24 +0000 | |||
844 | @@ -772,6 +772,12 @@ | |||
845 | 772 | CCSSettingValueList | 772 | CCSSettingValueList |
846 | 773 | ccsCopyList (CCSSettingValueList l1, CCSSetting * setting); | 773 | ccsCopyList (CCSSettingValueList l1, CCSSetting * setting); |
847 | 774 | 774 | ||
848 | 775 | /* Deep copy setting value */ | ||
849 | 776 | CCSSettingValue * | ||
850 | 777 | ccsCopyValue (CCSSettingValue *orig, | ||
851 | 778 | CCSSettingType type, | ||
852 | 779 | CCSSettingInfo *info); | ||
853 | 780 | |||
854 | 775 | /* Converts an array of data items to a setting value list. Behaves similar | 781 | /* Converts an array of data items to a setting value list. Behaves similar |
855 | 776 | to ccsGetListFromStringArray */ | 782 | to ccsGetListFromStringArray */ |
856 | 777 | CCSSettingValueList ccsGetValueListFromStringArray (const char **array, | 783 | CCSSettingValueList ccsGetValueListFromStringArray (const char **array, |
857 | 778 | 784 | ||
858 | === modified file 'compizconfig/libcompizconfig/src/main.c' | |||
859 | --- compizconfig/libcompizconfig/src/main.c 2012-09-25 08:39:18 +0000 | |||
860 | +++ compizconfig/libcompizconfig/src/main.c 2012-09-25 15:17:24 +0000 | |||
861 | @@ -2461,64 +2461,83 @@ | |||
862 | 2461 | return TRUE; | 2461 | return TRUE; |
863 | 2462 | } | 2462 | } |
864 | 2463 | 2463 | ||
865 | 2464 | CCSSettingValue * | ||
866 | 2465 | ccsCopyValue (CCSSettingValue *orig, | ||
867 | 2466 | CCSSettingType type, | ||
868 | 2467 | CCSSettingInfo *info) | ||
869 | 2468 | { | ||
870 | 2469 | CCSSettingValue *value = calloc (1, sizeof (CCSSettingValue)); | ||
871 | 2470 | |||
872 | 2471 | if (!value) | ||
873 | 2472 | return NULL; | ||
874 | 2473 | |||
875 | 2474 | value->refCount = 1; | ||
876 | 2475 | value->parent = orig->parent; | ||
877 | 2476 | value->isListChild = orig->isListChild; | ||
878 | 2477 | |||
879 | 2478 | CCSSettingType vType = value->isListChild ? info->forList.listType : type; | ||
880 | 2479 | |||
881 | 2480 | switch (vType) | ||
882 | 2481 | { | ||
883 | 2482 | case TypeInt: | ||
884 | 2483 | value->value.asInt = orig->value.asInt; | ||
885 | 2484 | break; | ||
886 | 2485 | case TypeBool: | ||
887 | 2486 | value->value.asBool = orig->value.asBool; | ||
888 | 2487 | break; | ||
889 | 2488 | case TypeFloat: | ||
890 | 2489 | value->value.asFloat = orig->value.asFloat; | ||
891 | 2490 | break; | ||
892 | 2491 | case TypeString: | ||
893 | 2492 | value->value.asString = strdup (orig->value.asString); | ||
894 | 2493 | break; | ||
895 | 2494 | case TypeMatch: | ||
896 | 2495 | value->value.asMatch = strdup (orig->value.asMatch); | ||
897 | 2496 | break; | ||
898 | 2497 | case TypeKey: | ||
899 | 2498 | memcpy (&value->value.asKey, &orig->value.asKey, | ||
900 | 2499 | sizeof (CCSSettingKeyValue)); | ||
901 | 2500 | break; | ||
902 | 2501 | case TypeButton: | ||
903 | 2502 | memcpy (&value->value.asButton, &orig->value.asButton, | ||
904 | 2503 | sizeof (CCSSettingButtonValue)); | ||
905 | 2504 | break; | ||
906 | 2505 | case TypeEdge: | ||
907 | 2506 | value->value.asEdge = orig->value.asEdge; | ||
908 | 2507 | break; | ||
909 | 2508 | case TypeBell: | ||
910 | 2509 | value->value.asBell = orig->value.asBell; | ||
911 | 2510 | break; | ||
912 | 2511 | case TypeColor: | ||
913 | 2512 | memcpy (&value->value.asColor, &orig->value.asColor, | ||
914 | 2513 | sizeof (CCSSettingColorValue)); | ||
915 | 2514 | break; | ||
916 | 2515 | default: | ||
917 | 2516 | free (value); | ||
918 | 2517 | return NULL; | ||
919 | 2518 | break; | ||
920 | 2519 | } | ||
921 | 2520 | |||
922 | 2521 | return value; | ||
923 | 2522 | } | ||
924 | 2523 | |||
925 | 2464 | CCSSettingValueList | 2524 | CCSSettingValueList |
926 | 2465 | ccsCopyList (CCSSettingValueList l1, CCSSetting * setting) | 2525 | ccsCopyList (CCSSettingValueList l1, CCSSetting * setting) |
927 | 2466 | { | 2526 | { |
928 | 2467 | CCSSettingInfo *info = ccsSettingGetInfo (setting); | 2527 | CCSSettingInfo *info = ccsSettingGetInfo (setting); |
929 | 2528 | CCSSettingType type = ccsSettingGetType (setting); | ||
930 | 2468 | CCSSettingValueList l2 = NULL; | 2529 | CCSSettingValueList l2 = NULL; |
931 | 2469 | 2530 | ||
932 | 2470 | while (l1) | 2531 | while (l1) |
933 | 2471 | { | 2532 | { |
935 | 2472 | CCSSettingValue *value = calloc (1, sizeof (CCSSettingValue)); | 2533 | CCSSettingValue *value = ccsCopyValue (l1->data, |
936 | 2534 | type, | ||
937 | 2535 | info); | ||
938 | 2536 | |||
939 | 2537 | /* FIXME If l2 != NULL, we leak l2 */ | ||
940 | 2473 | if (!value) | 2538 | if (!value) |
941 | 2474 | return l2; | 2539 | return l2; |
942 | 2475 | 2540 | ||
943 | 2476 | value->refCount = 1; | ||
944 | 2477 | value->parent = setting; | ||
945 | 2478 | value->isListChild = TRUE; | ||
946 | 2479 | |||
947 | 2480 | switch (info->forList.listType) | ||
948 | 2481 | { | ||
949 | 2482 | case TypeInt: | ||
950 | 2483 | value->value.asInt = l1->data->value.asInt; | ||
951 | 2484 | break; | ||
952 | 2485 | case TypeBool: | ||
953 | 2486 | value->value.asBool = l1->data->value.asBool; | ||
954 | 2487 | break; | ||
955 | 2488 | case TypeFloat: | ||
956 | 2489 | value->value.asFloat = l1->data->value.asFloat; | ||
957 | 2490 | break; | ||
958 | 2491 | case TypeString: | ||
959 | 2492 | value->value.asString = strdup (l1->data->value.asString); | ||
960 | 2493 | break; | ||
961 | 2494 | case TypeMatch: | ||
962 | 2495 | value->value.asMatch = strdup (l1->data->value.asMatch); | ||
963 | 2496 | break; | ||
964 | 2497 | case TypeKey: | ||
965 | 2498 | memcpy (&value->value.asKey, &l1->data->value.asKey, | ||
966 | 2499 | sizeof (CCSSettingKeyValue)); | ||
967 | 2500 | break; | ||
968 | 2501 | case TypeButton: | ||
969 | 2502 | memcpy (&value->value.asButton, &l1->data->value.asButton, | ||
970 | 2503 | sizeof (CCSSettingButtonValue)); | ||
971 | 2504 | break; | ||
972 | 2505 | case TypeEdge: | ||
973 | 2506 | value->value.asEdge = l1->data->value.asEdge; | ||
974 | 2507 | break; | ||
975 | 2508 | case TypeBell: | ||
976 | 2509 | value->value.asBell = l1->data->value.asBell; | ||
977 | 2510 | break; | ||
978 | 2511 | case TypeColor: | ||
979 | 2512 | memcpy (&value->value.asColor, &l1->data->value.asColor, | ||
980 | 2513 | sizeof (CCSSettingColorValue)); | ||
981 | 2514 | break; | ||
982 | 2515 | default: | ||
983 | 2516 | /* FIXME If l2 != NULL, we leak l2 */ | ||
984 | 2517 | free (value); | ||
985 | 2518 | return NULL; | ||
986 | 2519 | break; | ||
987 | 2520 | } | ||
988 | 2521 | |||
989 | 2522 | l2 = ccsSettingValueListAppend (l2, value); | 2541 | l2 = ccsSettingValueListAppend (l2, value); |
990 | 2523 | l1 = l1->next; | 2542 | l1 = l1->next; |
991 | 2524 | } | 2543 | } |
FAILED: Continuous integration, rev:3389 jenkins. qa.ubuntu. com/job/ compiz- ci/110/ jenkins. qa.ubuntu. com/job/ compiz- ci/./build= pbuilder, distribution= quantal, flavor= amd64/110/ console
http://
Executed test runs:
FAILURE: http://