Merge lp:~mc-return/compiz/compiz.merge-replace-defines into lp:compiz/0.9.8

Proposed by MC Return
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 3353
Merged at revision: 3358
Proposed branch: lp:~mc-return/compiz/compiz.merge-replace-defines
Merge into: lp:compiz/0.9.8
Diff against target: 1482 lines (+298/-160)
84 files modified
gtk/window-decorator/gtk-window-decorator.c (+17/-0)
gtk/window-decorator/gtk-window-decorator.h (+13/-13)
include/core/screen.h (+9/-9)
kde/window-decorator-kde4/decorator.cpp (+11/-4)
kde/window-decorator-kde4/decorator.h (+5/-5)
libdecoration/decoration.c (+1/-1)
plugins/animation/include/animation/animation.h (+2/-1)
plugins/animation/src/animation.cpp (+5/-1)
plugins/animation/src/private.h (+1/-1)
plugins/animationaddon/src/animationaddon.cpp (+3/-0)
plugins/animationaddon/src/polygon.cpp (+2/-2)
plugins/animationaddon/src/private.h (+1/-1)
plugins/bench/src/bench.cpp (+2/-2)
plugins/blur/src/blur.cpp (+7/-1)
plugins/blur/src/blur.h (+4/-4)
plugins/ccp/src/ccp.cpp (+2/-2)
plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h (+2/-2)
plugins/compiztoolbox/src/compiztoolbox.cpp (+3/-0)
plugins/copytex/src/copytex.cpp (+3/-0)
plugins/copytex/src/copytex.h (+2/-2)
plugins/cubeaddon/src/cubeaddon.cpp (+10/-0)
plugins/cubeaddon/src/cubeaddon.h (+9/-9)
plugins/dbus/src/dbus.h (+4/-4)
plugins/decor/src/decor.h (+3/-3)
plugins/expo/src/expo.cpp (+1/-1)
plugins/firepaint/src/firepaint.cpp (+2/-0)
plugins/firepaint/src/firepaint.h (+1/-1)
plugins/grid/src/grid.h (+1/-1)
plugins/group/src/glow.cpp (+10/-0)
plugins/group/src/glow.h (+9/-9)
plugins/group/src/group.cpp (+3/-1)
plugins/group/src/group.h (+1/-1)
plugins/group/src/tab.cpp (+1/-1)
plugins/imgpng/src/imgpng.cpp (+2/-0)
plugins/imgpng/src/imgpng.h (+1/-1)
plugins/maximumize/src/maximumize.cpp (+4/-0)
plugins/maximumize/src/maximumize.h (+3/-3)
plugins/mousepoll/src/mousepoll.cpp (+3/-0)
plugins/mousepoll/src/private.h (+2/-2)
plugins/move/src/move.cpp (+5/-0)
plugins/move/src/move.h (+3/-3)
plugins/notification/src/notification.cpp (+3/-1)
plugins/notification/src/notification.h (+1/-1)
plugins/obs/src/obs.cpp (+4/-0)
plugins/obs/src/obs.h (+4/-4)
plugins/opacify/src/opacify.cpp (+2/-0)
plugins/opacify/src/opacify.h (+1/-1)
plugins/opengl/include/opengl/opengl.h (+7/-7)
plugins/opengl/src/opengl.cpp (+10/-0)
plugins/place/src/place.cpp (+2/-2)
plugins/place/src/smart/src/smart.cpp (+3/-3)
plugins/put/src/put.cpp (+4/-4)
plugins/resize/src/logic/include/resize-defs.h (+2/-2)
plugins/resize/src/logic/src/resize-logic.cpp (+4/-4)
plugins/resizeinfo/src/resizeinfo.cpp (+5/-0)
plugins/resizeinfo/src/resizeinfo.h (+3/-3)
plugins/ring/src/ring.cpp (+4/-0)
plugins/ring/src/ring.h (+2/-2)
plugins/rotate/src/rotate.cpp (+1/-1)
plugins/scaleaddon/src/scaleaddon.cpp (+1/-1)
plugins/shelf/src/shelf.cpp (+2/-0)
plugins/shelf/src/shelf.h (+1/-1)
plugins/shift/src/shift.cpp (+2/-0)
plugins/shift/src/shift.h (+1/-1)
plugins/showdesktop/src/showdesktop.cpp (+5/-0)
plugins/showdesktop/src/showdesktop.h (+4/-4)
plugins/splash/src/splash.cpp (+3/-0)
plugins/splash/src/splash.h (+2/-2)
plugins/staticswitcher/src/staticswitcher.cpp (+3/-0)
plugins/staticswitcher/src/staticswitcher.h (+2/-2)
plugins/switcher/src/switcher.cpp (+6/-0)
plugins/switcher/src/switcher.h (+4/-4)
plugins/td/src/3d.cpp (+2/-0)
plugins/td/src/3d.h (+1/-1)
plugins/text/src/text.cpp (+1/-1)
plugins/thumbnail/src/thumbnail.cpp (+2/-0)
plugins/thumbnail/src/thumbnail.h (+1/-1)
plugins/wall/src/wall.cpp (+4/-4)
plugins/water/src/water.cpp (+4/-0)
plugins/water/src/water.h (+2/-2)
plugins/wobbly/src/wobbly.h (+1/-1)
src/event.cpp (+3/-3)
src/screen.cpp (+5/-5)
src/timer/src/timer.cpp (+1/-1)
To merge this branch: bzr merge lp:~mc-return/compiz/compiz.merge-replace-defines
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
MC Return Needs Resubmitting
Review via email: mp+122865@code.launchpad.net

Commit message

Replaced #defines of standard variable types

Description of the change

Replaces #defines of standard variable types

To post a comment you must log in.
Revision history for this message
MC Return (mc-return) wrote :

If this is a good idea I could continue this...
I also noticed that PI for example is defined by several plug-ins. It could be made global, no ?

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

I vote continue. Daniel?

review: Approve
Revision history for this message
MC Return (mc-return) wrote :

Ready for review so far.
I've left out converting stuff like ABI_VERSION and may have missed some others - also for now I did replace just the #defines of short, int and string types, but this compiles and *should* work.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I think PI should be defined as value M_PI (from #include <math.h>). And *ABI* macros have to stay as macros so they can be used in preprocessing:
    #if SOMETHING_ABI >= N

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Scratch that. M_PI is not technically a C/C++ standard, so don't use it.

Revision history for this message
MC Return (mc-return) wrote :

> And *ABI*
> macros have to stay as macros so they can be used in preprocessing:
> #if SOMETHING_ABI >= N

Okay, did not touch any of the ABI #defines.

Revision history for this message
MC Return (mc-return) wrote :

> Scratch that. M_PI is not technically a C/C++ standard, so don't use it.

For now I did just change #defines of PI to "static const double PI = 3.14159265359f;".

Revision history for this message
MC Return (mc-return) wrote :

CI test start, please :)

review: Needs Resubmitting
Revision history for this message
Sam Spilsbury (smspillaz) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gtk/window-decorator/gtk-window-decorator.c'
2--- gtk/window-decorator/gtk-window-decorator.c 2012-08-27 15:40:30 +0000
3+++ gtk/window-decorator/gtk-window-decorator.c 2012-09-08 00:13:22 +0000
4@@ -43,6 +43,23 @@
5
6 #define SWITCHER_SPACE 40
7
8+const float STROKE_ALPHA = 0.6f;
9+
10+const unsigned short ICON_SPACE = 20;
11+
12+const float DOUBLE_CLICK_DISTANCE = 8.0f;
13+
14+const float SHADOW_RADIUS = 8.0f;
15+const float SHADOW_OPACITY = 0.5f;
16+const unsigned short SHADOW_OFFSET_X = 1;
17+const unsigned short SHADOW_OFFSET_Y = 1;
18+
19+const float META_OPACITY = 0.75f;
20+
21+const float META_ACTIVE_OPACITY = 1.0f;
22+
23+guint cmdline_options = 0;
24+
25 GdkPixmap *decor_normal_pixmap = NULL;
26 GdkPixmap *decor_active_pixmap = NULL;
27
28
29=== modified file 'gtk/window-decorator/gtk-window-decorator.h'
30--- gtk/window-decorator/gtk-window-decorator.h 2012-08-28 04:45:17 +0000
31+++ gtk/window-decorator/gtk-window-decorator.h 2012-09-08 00:13:22 +0000
32@@ -172,11 +172,11 @@
33 #define DBUS_INTERFACE "org.freedesktop.compiz"
34 #define DBUS_METHOD_GET "get"
35
36-#define STROKE_ALPHA 0.6
37-
38-#define ICON_SPACE 20
39-
40-#define DOUBLE_CLICK_DISTANCE 8.0
41+extern const float STROKE_ALPHA;
42+
43+extern const unsigned short ICON_SPACE;
44+
45+extern const float DOUBLE_CLICK_DISTANCE;
46
47 #define WM_MOVERESIZE_SIZE_TOPLEFT 0
48 #define WM_MOVERESIZE_SIZE_TOP 1
49@@ -190,18 +190,18 @@
50 #define WM_MOVERESIZE_SIZE_KEYBOARD 9
51 #define WM_MOVERESIZE_MOVE_KEYBOARD 10
52
53-#define SHADOW_RADIUS 8.0
54-#define SHADOW_OPACITY 0.5
55-#define SHADOW_OFFSET_X 1
56-#define SHADOW_OFFSET_Y 1
57+extern const float SHADOW_RADIUS;
58+extern const float SHADOW_OPACITY;
59+extern const unsigned short SHADOW_OFFSET_X;
60+extern const unsigned short SHADOW_OFFSET_Y;
61 #define SHADOW_COLOR_RED 0x0000
62 #define SHADOW_COLOR_GREEN 0x0000
63 #define SHADOW_COLOR_BLUE 0x0000
64
65-#define META_OPACITY 0.75
66-#define META_SHADE_OPACITY TRUE
67-#define META_ACTIVE_OPACITY 1.0
68-#define META_ACTIVE_SHADE_OPACITY TRUE
69+extern const float META_OPACITY;
70+#define META_SHADE_OPACITY TRUE;
71+extern const float META_ACTIVE_OPACITY;
72+#define META_ACTIVE_SHADE_OPACITY TRUE;
73
74 #define META_MAXIMIZED (WNCK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY | \
75 WNCK_WINDOW_STATE_MAXIMIZED_VERTICALLY)
76
77=== modified file 'include/core/screen.h'
78--- include/core/screen.h 2012-06-24 09:00:27 +0000
79+++ include/core/screen.h 2012-09-08 00:13:22 +0000
80@@ -69,15 +69,15 @@
81 #define NOTIFY_MOVE_MASK (1 << 2)
82 #define NOTIFY_MODIFY_MASK (1 << 3)
83
84-#define SCREEN_EDGE_LEFT 0
85-#define SCREEN_EDGE_RIGHT 1
86-#define SCREEN_EDGE_TOP 2
87-#define SCREEN_EDGE_BOTTOM 3
88-#define SCREEN_EDGE_TOPLEFT 4
89-#define SCREEN_EDGE_TOPRIGHT 5
90-#define SCREEN_EDGE_BOTTOMLEFT 6
91-#define SCREEN_EDGE_BOTTOMRIGHT 7
92-#define SCREEN_EDGE_NUM 8
93+#define SCREEN_EDGE_LEFT 0
94+#define SCREEN_EDGE_RIGHT 1
95+#define SCREEN_EDGE_TOP 2
96+#define SCREEN_EDGE_BOTTOM 3
97+#define SCREEN_EDGE_TOPLEFT 4
98+#define SCREEN_EDGE_TOPRIGHT 5
99+#define SCREEN_EDGE_BOTTOMLEFT 6
100+#define SCREEN_EDGE_BOTTOMRIGHT 7
101+#define SCREEN_EDGE_NUM 8
102
103 typedef boost::function<void (short int)> FdWatchCallBack;
104 typedef boost::function<void (const char *)> FileWatchCallBack;
105
106=== modified file 'kde/window-decorator-kde4/decorator.cpp'
107--- kde/window-decorator-kde4/decorator.cpp 2012-05-27 04:32:55 +0000
108+++ kde/window-decorator-kde4/decorator.cpp 2012-09-08 00:13:22 +0000
109@@ -46,10 +46,17 @@
110
111 #include <stdio.h>
112
113-#define SHADOW_RADIUS 8.0
114-#define SHADOW_OPACITY 0.5
115-#define SHADOW_OFFSET_X 1
116-#define SHADOW_OFFSET_Y 1
117+const unsigned int ROOT_OFF_X = 8192;
118+const unsigned int ROOT_OFF_Y = 8192;
119+
120+const unsigned short BLUR_TYPE_NONE = 0;
121+const unsigned short BLUR_TYPE_TITLEBAR = 1;
122+const unsigned short BLUR_TYPE_ALL = 2;
123+
124+static const float SHADOW_RADIUS = 8.0f;
125+static const float SHADOW_OPACITY = 0.5f;
126+static const unsigned short SHADOW_OFFSET_X = 1;
127+static const unsigned short SHADOW_OFFSET_Y = 1;
128 #define SHADOW_COLOR_RED 0x0000
129 #define SHADOW_COLOR_GREEN 0x0000
130 #define SHADOW_COLOR_BLUE 0x0000
131
132=== modified file 'kde/window-decorator-kde4/decorator.h'
133--- kde/window-decorator-kde4/decorator.h 2011-10-13 11:31:37 +0000
134+++ kde/window-decorator-kde4/decorator.h 2012-09-08 00:13:22 +0000
135@@ -43,8 +43,8 @@
136 #include "kdecoration_plugins.h"
137 #include "utils.h"
138
139-#define ROOT_OFF_X 8192
140-#define ROOT_OFF_Y 8192
141+extern const unsigned int ROOT_OFF_X;
142+extern const unsigned int ROOT_OFF_Y;
143
144 #define C(name) { 0, XC_ ## name }
145
146@@ -55,9 +55,9 @@
147
148 extern struct _cursor cursors[3][3];
149
150-#define BLUR_TYPE_NONE 0
151-#define BLUR_TYPE_TITLEBAR 1
152-#define BLUR_TYPE_ALL 2
153+extern const unsigned short BLUR_TYPE_NONE;
154+extern const unsigned short BLUR_TYPE_TITLEBAR;
155+extern const unsigned short BLUR_TYPE_ALL;
156
157 extern int blurType;
158
159
160=== modified file 'libdecoration/decoration.c'
161--- libdecoration/decoration.c 2012-08-20 05:40:55 +0000
162+++ libdecoration/decoration.c 2012-09-08 00:13:22 +0000
163@@ -3145,7 +3145,7 @@
164 Time dm_sn_timestamp)
165 {
166
167-#define N_TARGETS 4
168+static const unsigned short N_TARGETS = 4;
169
170 Atom conversion_targets[N_TARGETS];
171
172
173=== modified file 'plugins/animation/include/animation/animation.h'
174--- plugins/animation/include/animation/animation.h 2012-09-04 10:00:14 +0000
175+++ plugins/animation/include/animation/animation.h 2012-09-08 00:13:22 +0000
176@@ -39,7 +39,8 @@
177 AnimDirectionRandom,
178 AnimDirectionAuto
179 } AnimDirection;
180-#define LAST_ANIM_DIRECTION 5
181+
182+extern const unsigned short LAST_ANIM_DIRECTION;
183
184 class PrivateAnimScreen;
185 class PrivateAnimWindow;
186
187=== modified file 'plugins/animation/src/animation.cpp'
188--- plugins/animation/src/animation.cpp 2012-09-05 08:17:59 +0000
189+++ plugins/animation/src/animation.cpp 2012-09-08 00:13:22 +0000
190@@ -103,7 +103,11 @@
191
192 COMPIZ_PLUGIN_20090315 (animation, AnimPluginVTable);
193
194-#define FAKE_ICON_SIZE 4
195+static const unsigned short FAKE_ICON_SIZE = 4;
196+
197+const unsigned short LAST_ANIM_DIRECTION = 5;
198+
199+const unsigned short NUM_EFFECTS = 16;
200
201 const char *eventNames[AnimEventNum] =
202 {"Open", "Close", "Minimize", "Unminimize", "Shade", "Focus"};
203
204=== modified file 'plugins/animation/src/private.h'
205--- plugins/animation/src/private.h 2012-08-14 06:33:22 +0000
206+++ plugins/animation/src/private.h 2012-09-08 00:13:22 +0000
207@@ -89,7 +89,7 @@
208 extern AnimEffect AnimEffectWave;
209 extern AnimEffect AnimEffectZoom;
210
211-#define NUM_EFFECTS 16
212+extern const unsigned short NUM_EFFECTS;
213
214 extern int customOptionOptionIds[AnimEventNum];
215
216
217=== modified file 'plugins/animationaddon/src/animationaddon.cpp'
218--- plugins/animationaddon/src/animationaddon.cpp 2012-08-20 14:24:34 +0000
219+++ plugins/animationaddon/src/animationaddon.cpp 2012-09-08 00:13:22 +0000
220@@ -90,6 +90,9 @@
221
222 COMPIZ_PLUGIN_20090315 (animationaddon, AnimAddonPluginVTable);
223
224+// TODO Update this for each added animation effect! (total: 11)
225+const unsigned short NUM_EFFECTS = 11;
226+
227 AnimEffect animEffects[NUM_EFFECTS];
228
229 ExtensionPluginAnimAddon animAddonExtPluginInfo (CompString ("animationaddon"),
230
231=== modified file 'plugins/animationaddon/src/polygon.cpp'
232--- plugins/animationaddon/src/polygon.cpp 2012-05-21 08:50:26 +0000
233+++ plugins/animationaddon/src/polygon.cpp 2012-09-08 00:13:22 +0000
234@@ -37,7 +37,7 @@
235 #include <GL/glu.h>
236 #include "private.h"
237
238-#define MIN_WINDOW_GRID_SIZE 10
239+static const unsigned short MIN_WINDOW_GRID_SIZE = 10;
240
241 PolygonAnim::PolygonAnim (CompWindow *w,
242 WindowEvent curWindowEvent,
243@@ -1902,7 +1902,7 @@
244
245 float zradius = radius / ::screen->width ();
246
247-#define N_POINTS 8
248+static const unsigned short N_POINTS = 8;
249 // Corners of bounding cube
250 Point3d cubeCorners[N_POINTS];
251 cubeCorners[0].set (center.x () - radius, center.y () - radius,
252
253=== modified file 'plugins/animationaddon/src/private.h'
254--- plugins/animationaddon/src/private.h 2010-10-23 15:41:30 +0000
255+++ plugins/animationaddon/src/private.h 2012-09-08 00:13:22 +0000
256@@ -29,7 +29,7 @@
257 extern AnimEffect AnimEffectSkewer;
258
259 // TODO Update this for each added animation effect! (total: 11)
260-#define NUM_EFFECTS 11
261+extern const unsigned short NUM_EFFECTS;
262
263 // This must have the value of the first "effect setting" above
264 // in AnimAddonScreenOptions
265
266=== modified file 'plugins/bench/src/bench.cpp'
267--- plugins/bench/src/bench.cpp 2012-09-04 15:33:44 +0000
268+++ plugins/bench/src/bench.cpp 2012-09-08 00:13:22 +0000
269@@ -29,8 +29,8 @@
270
271 COMPIZ_PLUGIN_20090315 (bench, BenchPluginVTable)
272
273-#define TEX_WIDTH 512
274-#define TEX_HEIGHT 256
275+static const unsigned int TEX_WIDTH = 512;
276+static const unsigned short TEX_HEIGHT = 256;
277
278 void
279 BenchScreen::preparePaint (int msSinceLastPaint)
280
281=== modified file 'plugins/blur/src/blur.cpp'
282--- plugins/blur/src/blur.cpp 2010-10-24 14:42:07 +0000
283+++ plugins/blur/src/blur.cpp 2012-09-08 00:13:22 +0000
284@@ -27,6 +27,12 @@
285
286 COMPIZ_PLUGIN_20090315 (blur, BlurPluginVTable)
287
288+const unsigned short BLUR_GAUSSIAN_RADIUS_MAX = 15;
289+
290+const unsigned short BLUR_STATE_CLIENT = 0;
291+const unsigned short BLUR_STATE_DECOR = 1;
292+const unsigned short BLUR_STATE_NUM = 2;
293+
294 /* pascal triangle based kernel generator */
295 static int
296 blurCreateGaussianLinearKernel (int radius,
297@@ -1210,7 +1216,7 @@
298 return true;
299 }
300
301-#define MAX_VERTEX_PROJECT_COUNT 20
302+static const unsigned short MAX_VERTEX_PROJECT_COUNT = 20;
303
304 void
305 BlurWindow::projectRegion (CompOutput *output,
306
307=== modified file 'plugins/blur/src/blur.h'
308--- plugins/blur/src/blur.h 2012-01-18 16:26:45 +0000
309+++ plugins/blur/src/blur.h 2012-09-08 00:13:22 +0000
310@@ -38,7 +38,7 @@
311 #include <GL/glu.h>
312
313
314-#define BLUR_GAUSSIAN_RADIUS_MAX 15
315+extern const unsigned short BLUR_GAUSSIAN_RADIUS_MAX;
316
317 struct BlurFunction {
318
319@@ -56,9 +56,9 @@
320 decor_point_t p2;
321 };
322
323-#define BLUR_STATE_CLIENT 0
324-#define BLUR_STATE_DECOR 1
325-#define BLUR_STATE_NUM 2
326+extern const unsigned short BLUR_STATE_CLIENT;
327+extern const unsigned short BLUR_STATE_DECOR;
328+extern const unsigned short BLUR_STATE_NUM;
329
330 struct BlurState {
331 int threshold;
332
333=== modified file 'plugins/ccp/src/ccp.cpp'
334--- plugins/ccp/src/ccp.cpp 2012-08-15 02:17:36 +0000
335+++ plugins/ccp/src/ccp.cpp 2012-09-08 00:13:22 +0000
336@@ -22,8 +22,8 @@
337
338 COMPIZ_PLUGIN_20090315 (ccp, CcpPluginVTable)
339
340-#define CCP_UPDATE_MIN_TIMEOUT 250
341-#define CCP_UPDATE_MAX_TIMEOUT 4000
342+static const unsigned short CCP_UPDATE_MIN_TIMEOUT = 250;
343+static const unsigned short CCP_UPDATE_MAX_TIMEOUT = 4000;
344 #define CORE_VTABLE_NAME "core"
345
346
347
348=== modified file 'plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h'
349--- plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h 2012-01-31 17:01:32 +0000
350+++ plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h 2012-09-08 00:13:22 +0000
351@@ -161,7 +161,7 @@
352 CompWindow *window;
353 };
354
355-#define ICON_SIZE 48
356-#define MAX_ICON_SIZE 256
357+extern const unsigned short ICON_SIZE;
358+extern const unsigned int MAX_ICON_SIZE;
359
360 #endif
361
362=== modified file 'plugins/compiztoolbox/src/compiztoolbox.cpp'
363--- plugins/compiztoolbox/src/compiztoolbox.cpp 2012-08-14 06:33:22 +0000
364+++ plugins/compiztoolbox/src/compiztoolbox.cpp 2012-09-08 00:13:22 +0000
365@@ -29,6 +29,9 @@
366 #include <core/abiversion.h>
367 #include <core/propertywriter.h>
368
369+const unsigned short ICON_SIZE = 48;
370+const unsigned int MAX_ICON_SIZE = 256;
371+
372 bool openGLAvailable;
373
374 class CompizToolboxScreen :
375
376=== modified file 'plugins/copytex/src/copytex.cpp'
377--- plugins/copytex/src/copytex.cpp 2012-07-03 18:16:28 +0000
378+++ plugins/copytex/src/copytex.cpp 2012-09-08 00:13:22 +0000
379@@ -27,6 +27,9 @@
380
381 COMPIZ_PLUGIN_20090315 (copytex, CopytexPluginVTable)
382
383+const int MAX_SUB_TEX = 2048;
384+const unsigned int SHM_SIZE = MAX_SUB_TEX * MAX_SUB_TEX * 4;
385+
386 static GLTexture::Matrix _identity_matrix = {
387 1.0f, 0.0f,
388 0.0f, 1.0f,
389
390=== modified file 'plugins/copytex/src/copytex.h'
391--- plugins/copytex/src/copytex.h 2012-01-18 16:26:45 +0000
392+++ plugins/copytex/src/copytex.h 2012-09-08 00:13:22 +0000
393@@ -34,8 +34,8 @@
394 #include <sys/shm.h>
395 #include <sys/ipc.h>
396
397-#define MAX_SUB_TEX 2048
398-#define SHM_SIZE MAX_SUB_TEX * MAX_SUB_TEX * 4
399+extern const int MAX_SUB_TEX;
400+extern const unsigned int SHM_SIZE;
401
402 class CopyTexture;
403
404
405=== modified file 'plugins/cubeaddon/src/cubeaddon.cpp'
406--- plugins/cubeaddon/src/cubeaddon.cpp 2012-07-30 14:27:55 +0000
407+++ plugins/cubeaddon/src/cubeaddon.cpp 2012-09-08 00:13:22 +0000
408@@ -27,6 +27,16 @@
409
410 COMPIZ_PLUGIN_20090315 (cubeaddon, CubeaddonPluginVTable);
411
412+const unsigned short CUBEADDON_GRID_SIZE = 100;
413+const unsigned short CAP_ELEMENTS = 15;
414+const unsigned int CAP_NVERTEX = (((CAP_ELEMENTS * (CAP_ELEMENTS + 1)) + 2) * 3);
415+const unsigned int CAP_NIDX = (CAP_ELEMENTS * (CAP_ELEMENTS - 1) * 4);
416+
417+const unsigned int CAP_NIMGVERTEX = (((CAP_ELEMENTS + 1) * (CAP_ELEMENTS + 1)) * 5);
418+const unsigned int CAP_NIMGIDX = (CAP_ELEMENTS * CAP_ELEMENTS * 4);
419+
420+const float RAD2I1024 = 162.9746617f;
421+
422 /*
423 * Initiate a CubeCap
424 */
425
426=== modified file 'plugins/cubeaddon/src/cubeaddon.h'
427--- plugins/cubeaddon/src/cubeaddon.h 2010-09-30 11:47:10 +0000
428+++ plugins/cubeaddon/src/cubeaddon.h 2012-09-08 00:13:22 +0000
429@@ -39,15 +39,15 @@
430
431 #include "cubeaddon_options.h"
432
433-#define CUBEADDON_GRID_SIZE 100
434-#define CAP_ELEMENTS 15
435-#define CAP_NVERTEX (((CAP_ELEMENTS * (CAP_ELEMENTS + 1)) + 2) * 3)
436-#define CAP_NIDX (CAP_ELEMENTS * (CAP_ELEMENTS - 1) * 4)
437-
438-#define CAP_NIMGVERTEX (((CAP_ELEMENTS + 1) * (CAP_ELEMENTS + 1)) * 5)
439-#define CAP_NIMGIDX (CAP_ELEMENTS * CAP_ELEMENTS * 4)
440-
441-#define RAD2I1024 162.9746617
442+extern const unsigned short CUBEADDON_GRID_SIZE;
443+extern const unsigned short CAP_ELEMENTS;
444+extern const unsigned int CAP_NVERTEX;
445+extern const unsigned int CAP_NIDX;
446+
447+extern const unsigned int CAP_NIMGVERTEX;
448+extern const unsigned int CAP_NIMGIDX;
449+
450+extern const float RAD2I1024 = 162.9746617f;
451
452 class CubeaddonScreen :
453 public CompositeScreenInterface,
454
455=== modified file 'plugins/dbus/src/dbus.h'
456--- plugins/dbus/src/dbus.h 2012-06-24 09:00:27 +0000
457+++ plugins/dbus/src/dbus.h 2012-09-08 00:13:22 +0000
458@@ -53,10 +53,10 @@
459 #define COMPIZ_DBUS_CHANGED_SIGNAL_NAME "changed"
460 #define COMPIZ_DBUS_PLUGINS_CHANGED_SIGNAL_NAME "pluginsChanged"
461
462-#define DBUS_FILE_WATCH_CURRENT 0
463-#define DBUS_FILE_WATCH_PLUGIN 1
464-#define DBUS_FILE_WATCH_HOME 2
465-#define DBUS_FILE_WATCH_NUM 3
466+#define DBUS_FILE_WATCH_CURRENT 0
467+#define DBUS_FILE_WATCH_PLUGIN 1
468+#define DBUS_FILE_WATCH_HOME 2
469+#define DBUS_FILE_WATCH_NUM 3
470
471 class DbusScreen :
472 public PluginClassHandler <DbusScreen, CompScreen>,
473
474=== modified file 'plugins/decor/src/decor.h'
475--- plugins/decor/src/decor.h 2012-07-30 07:10:52 +0000
476+++ plugins/decor/src/decor.h 2012-09-08 00:13:22 +0000
477@@ -50,9 +50,9 @@
478 };
479
480 /* FIXME: Remove */
481-#define DECOR_BARE 0
482-#define DECOR_ACTIVE 1
483-#define DECOR_NUM 2
484+#define DECOR_BARE 0
485+#define DECOR_ACTIVE 1
486+#define DECOR_NUM 2
487
488 using namespace compiz::decor;
489
490
491=== modified file 'plugins/expo/src/expo.cpp'
492--- plugins/expo/src/expo.cpp 2012-08-22 01:21:08 +0000
493+++ plugins/expo/src/expo.cpp 2012-09-08 00:13:22 +0000
494@@ -1290,7 +1290,7 @@
495 return gWindow->glDraw (transform, eAttrib, region, mask);
496 }
497
498-#define EXPO_GRID_SIZE 100
499+static const unsigned short EXPO_GRID_SIZE = 100;
500
501 void
502 ExpoWindow::glAddGeometry (const GLTexture::MatrixList& matrices,
503
504=== modified file 'plugins/firepaint/src/firepaint.cpp'
505--- plugins/firepaint/src/firepaint.cpp 2012-09-04 15:33:44 +0000
506+++ plugins/firepaint/src/firepaint.cpp 2012-09-08 00:13:22 +0000
507@@ -23,6 +23,8 @@
508
509 COMPIZ_PLUGIN_20090315 (firepaint, FirePluginVTable);
510
511+const unsigned int NUM_ADD_POINTS = 1000;
512+
513 Particle::Particle () :
514 life (0),
515 fade (0),
516
517=== modified file 'plugins/firepaint/src/firepaint.h'
518--- plugins/firepaint/src/firepaint.h 2012-09-04 15:33:44 +0000
519+++ plugins/firepaint/src/firepaint.h 2012-09-08 00:13:22 +0000
520@@ -107,7 +107,7 @@
521 finiParticles ();
522 };
523
524-#define NUM_ADD_POINTS 1000
525+extern const unsigned int NUM_ADD_POINTS;
526
527 class FireScreen:
528 public PluginClassHandler <FireScreen, CompScreen>,
529
530=== modified file 'plugins/grid/src/grid.h'
531--- plugins/grid/src/grid.h 2012-05-27 04:32:55 +0000
532+++ plugins/grid/src/grid.h 2012-09-08 00:13:22 +0000
533@@ -30,7 +30,7 @@
534
535 #include "grid_options.h"
536
537-#define SNAPOFF_THRESHOLD 50
538+static const unsigned short SNAPOFF_THRESHOLD = 50;
539
540 namespace GridWindowType
541 {
542
543=== modified file 'plugins/group/src/glow.cpp'
544--- plugins/group/src/glow.cpp 2011-03-14 15:58:39 +0000
545+++ plugins/group/src/glow.cpp 2012-09-08 00:13:22 +0000
546@@ -27,6 +27,16 @@
547 #include "group.h"
548 #include "group_glow.h"
549
550+const unsigned short GLOWQUAD_TOPLEFT = 0;
551+const unsigned short GLOWQUAD_TOPRIGHT = 1;
552+const unsigned short GLOWQUAD_BOTTOMLEFT = 2;
553+const unsigned short GLOWQUAD_BOTTOMRIGHT = 3;
554+const unsigned short GLOWQUAD_TOP = 4;
555+const unsigned short GLOWQUAD_BOTTOM = 5;
556+const unsigned short GLOWQUAD_LEFT = 6;
557+const unsigned short GLOWQUAD_RIGHT = 7;
558+const unsigned short NUM_GLOWQUADS = 8;
559+
560 const GlowTextureProperties glowTextureProperties[2] = {
561 /* GlowTextureRectangular */
562 {glowTexRect, 32, 21},
563
564=== modified file 'plugins/group/src/glow.h'
565--- plugins/group/src/glow.h 2010-10-15 03:57:18 +0000
566+++ plugins/group/src/glow.h 2012-09-08 00:13:22 +0000
567@@ -29,15 +29,15 @@
568
569 #include "group.h"
570
571-#define GLOWQUAD_TOPLEFT 0
572-#define GLOWQUAD_TOPRIGHT 1
573-#define GLOWQUAD_BOTTOMLEFT 2
574-#define GLOWQUAD_BOTTOMRIGHT 3
575-#define GLOWQUAD_TOP 4
576-#define GLOWQUAD_BOTTOM 5
577-#define GLOWQUAD_LEFT 6
578-#define GLOWQUAD_RIGHT 7
579-#define NUM_GLOWQUADS 8
580+extern const unsigned short GLOWQUAD_TOPLEFT;
581+extern const unsigned short GLOWQUAD_TOPRIGHT;
582+extern const unsigned short GLOWQUAD_BOTTOMLEFT;
583+extern const unsigned short GLOWQUAD_BOTTOMRIGHT;
584+extern const unsigned short GLOWQUAD_TOP;
585+extern const unsigned short GLOWQUAD_BOTTOM;
586+extern const unsigned short GLOWQUAD_LEFT;
587+extern const unsigned short GLOWQUAD_RIGHT;
588+extern const unsigned short NUM_GLOWQUADS;
589
590 /* Represents a particular glow texture, so here
591 * we have hardcoded in the texture data, the offset
592
593=== modified file 'plugins/group/src/group.cpp'
594--- plugins/group/src/group.cpp 2012-07-30 09:53:16 +0000
595+++ plugins/group/src/group.cpp 2012-09-08 00:13:22 +0000
596@@ -26,6 +26,8 @@
597
598 #include "group.h"
599
600+const double PI = 3.14159265359f;
601+
602 /*
603 * GroupExp class
604 *
605@@ -1559,7 +1561,7 @@
606 */
607
608 /* the radius to determine if it was a click or a drag */
609-#define RADIUS 5
610+static const unsigned short RADIUS = 5;
611
612 void
613 GroupScreen::handleMotionEvent (int xRoot, int yRoot)
614
615=== modified file 'plugins/group/src/group.h'
616--- plugins/group/src/group.h 2012-09-04 15:33:44 +0000
617+++ plugins/group/src/group.h 2012-09-08 00:13:22 +0000
618@@ -85,7 +85,7 @@
619 * Constants
620 *
621 */
622-#define PI 3.1415926535897
623+extern const double PI;
624
625 /*
626 * Helpers
627
628=== modified file 'plugins/group/src/tab.cpp'
629--- plugins/group/src/tab.cpp 2012-07-30 12:58:44 +0000
630+++ plugins/group/src/tab.cpp 2012-09-08 00:13:22 +0000
631@@ -2187,7 +2187,7 @@
632 properly - however the best way would be if slot->mRegion was
633 sized including the border */
634
635-#define DAMAGE_BUFFER 20
636+static const unsigned short DAMAGE_BUFFER = 20;
637
638 /* If there is a front slot in this bar, then we need to damage
639 * areas just outside where the slot might be sitting */
640
641=== modified file 'plugins/imgpng/src/imgpng.cpp'
642--- plugins/imgpng/src/imgpng.cpp 2012-01-18 16:26:45 +0000
643+++ plugins/imgpng/src/imgpng.cpp 2012-09-08 00:13:22 +0000
644@@ -36,6 +36,8 @@
645
646 COMPIZ_PLUGIN_20090315 (imgpng, PngPluginVTable)
647
648+const unsigned short PNG_SIG_SIZE = 8;
649+
650 PngScreen::PngScreen (CompScreen *screen) :
651 PluginClassHandler<PngScreen, CompScreen> (screen)
652 {
653
654=== modified file 'plugins/imgpng/src/imgpng.h'
655--- plugins/imgpng/src/imgpng.h 2012-01-18 16:26:45 +0000
656+++ plugins/imgpng/src/imgpng.h 2012-09-08 00:13:22 +0000
657@@ -34,7 +34,7 @@
658
659 #include <iosfwd>
660
661-#define PNG_SIG_SIZE 8
662+extern const unsigned short PNG_SIG_SIZE;
663
664 class PngScreen :
665 public ScreenInterface,
666
667=== modified file 'plugins/maximumize/src/maximumize.cpp'
668--- plugins/maximumize/src/maximumize.cpp 2011-03-14 16:04:58 +0000
669+++ plugins/maximumize/src/maximumize.cpp 2012-09-08 00:13:22 +0000
670@@ -31,6 +31,10 @@
671
672 COMPIZ_PLUGIN_20090315 (maximumize, MaximumizePluginVTable);
673
674+/* Convenience constants to make the code more readable (hopefully) */
675+const short REDUCE = -1;
676+const unsigned short INCREASE = 1;
677+
678 /* Returns true if rectangles a and b intersect by at least 40 in both
679 * directions
680 */
681
682=== modified file 'plugins/maximumize/src/maximumize.h'
683--- plugins/maximumize/src/maximumize.h 2009-03-20 07:58:25 +0000
684+++ plugins/maximumize/src/maximumize.h 2012-09-08 00:13:22 +0000
685@@ -31,9 +31,9 @@
686
687 #include "maximumize_options.h"
688
689-/* Convenience macros to make the code more readable (hopefully) */
690-#define REDUCE -1
691-#define INCREASE 1
692+/* Convenience constants to make the code more readable (hopefully) */
693+extern const short REDUCE;
694+extern const unsigned short INCREASE;
695
696 typedef struct
697 {
698
699=== modified file 'plugins/mousepoll/src/mousepoll.cpp'
700--- plugins/mousepoll/src/mousepoll.cpp 2012-07-30 09:53:16 +0000
701+++ plugins/mousepoll/src/mousepoll.cpp 2012-09-08 00:13:22 +0000
702@@ -24,6 +24,9 @@
703
704 COMPIZ_PLUGIN_20090315 (mousepoll, MousepollPluginVTable);
705
706+const unsigned short MP_OPTION_MOUSE_POLL_INTERVAL = 0;
707+const unsigned short MP_OPTION_NUM = 1;
708+
709 bool
710 MousepollScreen::getMousePosition ()
711 {
712
713=== modified file 'plugins/mousepoll/src/private.h'
714--- plugins/mousepoll/src/private.h 2009-03-16 05:20:59 +0000
715+++ plugins/mousepoll/src/private.h 2012-09-08 00:13:22 +0000
716@@ -34,8 +34,8 @@
717 MP_DISPLAY_OPTION_NUM
718 } MousepollDisplayOptions;
719
720-#define MP_OPTION_MOUSE_POLL_INTERVAL 0
721-#define MP_OPTION_NUM 1
722+extern const unsigned short MP_OPTION_MOUSE_POLL_INTERVAL;
723+extern const unsigned short MP_OPTION_NUM;
724
725 class MousepollScreen :
726 public PluginClassHandler <MousepollScreen, CompScreen, COMPIZ_MOUSEPOLL_ABI>,
727
728=== modified file 'plugins/move/src/move.cpp'
729--- plugins/move/src/move.cpp 2012-04-19 12:06:05 +0000
730+++ plugins/move/src/move.cpp 2012-09-08 00:13:22 +0000
731@@ -34,6 +34,11 @@
732
733 COMPIZ_PLUGIN_20090315 (move, MovePluginVTable)
734
735+const unsigned short KEY_MOVE_INC = 24;
736+
737+const unsigned short SNAP_BACK = 20;
738+const unsigned short SNAP_OFF = 100;
739+
740 static bool
741 moveInitiate (CompAction *action,
742 CompAction::State state,
743
744=== modified file 'plugins/move/src/move.h'
745--- plugins/move/src/move.h 2012-02-01 17:49:07 +0000
746+++ plugins/move/src/move.h 2012-09-08 00:13:22 +0000
747@@ -34,10 +34,10 @@
748
749 #define NUM_KEYS (sizeof (mKeys) / sizeof (mKeys[0]))
750
751-#define KEY_MOVE_INC 24
752+extern const unsigned short KEY_MOVE_INC;
753
754-#define SNAP_BACK 20
755-#define SNAP_OFF 100
756+extern const unsigned short SNAP_BACK;
757+extern const unsigned short SNAP_OFF;
758
759 struct _MoveKeys {
760 const char *name;
761
762=== modified file 'plugins/notification/src/notification.cpp'
763--- plugins/notification/src/notification.cpp 2012-05-18 06:52:20 +0000
764+++ plugins/notification/src/notification.cpp 2012-09-08 00:13:22 +0000
765@@ -26,6 +26,8 @@
766
767 COMPIZ_PLUGIN_20090315 (notification, NotificationPluginVTable);
768
769+const std::string IMAGE_DIR(".compiz/images");
770+
771 /* libnotify 0.7 introduced proper NOTIFY_CHECK_VERSION macro */
772 #if defined(NOTIFY_CHECK_VERSION) && !defined(HAVE_LIBNOTIFY_0_6_1)
773 #if NOTIFY_CHECK_VERSION(0,6,1)
774@@ -58,7 +60,7 @@
775 in $PREFIX/share/compiz, not in the home dir */
776 iconUri = "file://";
777 iconUri += homeDir;
778- iconUri += "/" IMAGE_DIR "/compiz.png";
779+ iconUri += "/" + IMAGE_DIR + "/compiz.png";
780 logLevel = (char *) logLevelToString (level);
781
782 n = notify_notification_new (logLevel, message,
783
784=== modified file 'plugins/notification/src/notification.h'
785--- plugins/notification/src/notification.h 2009-03-16 01:57:00 +0000
786+++ plugins/notification/src/notification.h 2012-09-08 00:13:22 +0000
787@@ -29,7 +29,7 @@
788
789 #include "notification_options.h"
790
791-#define IMAGE_DIR ".compiz/images"
792+extern const std::string IMAGE_DIR;
793
794 class NotificationScreen :
795 public PluginClassHandler <NotificationScreen, CompScreen>,
796
797=== modified file 'plugins/obs/src/obs.cpp'
798--- plugins/obs/src/obs.cpp 2012-09-04 15:33:44 +0000
799+++ plugins/obs/src/obs.cpp 2012-09-08 00:13:22 +0000
800@@ -27,6 +27,10 @@
801
802 COMPIZ_PLUGIN_20090315 (obs, ObsPluginVTable);
803
804+const unsigned short MODIFIER_OPACITY = 0;
805+const unsigned short MODIFIER_SATURATION = 1;
806+const unsigned short MODIFIER_BRIGHTNESS = 2;
807+
808 void
809 ObsWindow::changePaintModifier (unsigned int modifier,
810 int direction)
811
812=== modified file 'plugins/obs/src/obs.h'
813--- plugins/obs/src/obs.h 2012-09-04 15:33:44 +0000
814+++ plugins/obs/src/obs.h 2012-09-08 00:13:22 +0000
815@@ -31,10 +31,10 @@
816
817 #include "obs_options.h"
818
819-#define MODIFIER_OPACITY 0
820-#define MODIFIER_SATURATION 1
821-#define MODIFIER_BRIGHTNESS 2
822-#define MODIFIER_COUNT 3
823+extern const unsigned short MODIFIER_OPACITY;
824+extern const unsigned short MODIFIER_SATURATION;
825+extern const unsigned short MODIFIER_BRIGHTNESS;
826+#define MODIFIER_COUNT 3
827
828 class ObsScreen :
829 public ScreenInterface,
830
831=== modified file 'plugins/opacify/src/opacify.cpp'
832--- plugins/opacify/src/opacify.cpp 2012-09-04 15:33:44 +0000
833+++ plugins/opacify/src/opacify.cpp 2012-09-08 00:13:22 +0000
834@@ -28,6 +28,8 @@
835
836 COMPIZ_PLUGIN_20090315 (opacify, OpacifyPluginVTable);
837
838+const unsigned short MAX_WINDOWS = 64;
839+
840 void
841 setFunctions (bool enabled)
842 {
843
844=== modified file 'plugins/opacify/src/opacify.h'
845--- plugins/opacify/src/opacify.h 2012-09-04 15:33:44 +0000
846+++ plugins/opacify/src/opacify.h 2012-09-08 00:13:22 +0000
847@@ -31,7 +31,7 @@
848 #include "opacify_options.h"
849
850 /* Size of the Window array storing passive windows. */
851-#define MAX_WINDOWS 64
852+extern const unsigned short MAX_WINDOWS;
853
854 class OpacifyScreen :
855 public PluginClassHandler <OpacifyScreen, CompScreen>,
856
857=== modified file 'plugins/opengl/include/opengl/opengl.h'
858--- plugins/opengl/include/opengl/opengl.h 2012-08-14 08:42:15 +0000
859+++ plugins/opengl/include/opengl/opengl.h 2012-09-08 00:13:22 +0000
860@@ -78,11 +78,11 @@
861 /**
862 * camera distance from screen, 0.5 * tan (FOV)
863 */
864-#define DEFAULT_Z_CAMERA 0.866025404f
865+extern const float DEFAULT_Z_CAMERA;
866
867-#define RED_SATURATION_WEIGHT 0.30f
868-#define GREEN_SATURATION_WEIGHT 0.59f
869-#define BLUE_SATURATION_WEIGHT 0.11f
870+extern const float RED_SATURATION_WEIGHT;
871+extern const float GREEN_SATURATION_WEIGHT;
872+extern const float BLUE_SATURATION_WEIGHT;
873
874 class PrivateGLScreen;
875 class PrivateGLWindow;
876@@ -571,9 +571,9 @@
877 };
878 #endif
879
880-#define NOTHING_TRANS_FILTER 0
881-#define SCREEN_TRANS_FILTER 1
882-#define WINDOW_TRANS_FILTER 2
883+extern const unsigned short NOTHING_TRANS_FILTER;
884+extern const unsigned short SCREEN_TRANS_FILTER;
885+extern const unsigned short WINDOW_TRANS_FILTER;
886
887
888 extern GLScreenPaintAttrib defaultScreenPaintAttrib;
889
890=== modified file 'plugins/opengl/src/opengl.cpp'
891--- plugins/opengl/src/opengl.cpp 2012-01-18 16:26:45 +0000
892+++ plugins/opengl/src/opengl.cpp 2012-09-08 00:13:22 +0000
893@@ -28,6 +28,16 @@
894 #include <core/pluginclasshandler.h>
895 #include "privates.h"
896
897+const float DEFAULT_Z_CAMERA = 0.866025404f;
898+
899+const float RED_SATURATION_WEIGHT = 0.30f;
900+const float GREEN_SATURATION_WEIGHT = 0.59f;
901+const float BLUE_SATURATION_WEIGHT = 0.11f;
902+
903+const unsigned short NOTHING_TRANS_FILTER = 0;
904+const unsigned short SCREEN_TRANS_FILTER = 1;
905+const unsigned short WINDOW_TRANS_FILTER = 2;
906+
907 CompOption::Vector &
908 GLScreen::getOptions ()
909 {
910
911=== modified file 'plugins/place/src/place.cpp'
912--- plugins/place/src/place.cpp 2012-09-05 23:54:21 +0000
913+++ plugins/place/src/place.cpp 2012-09-08 00:13:22 +0000
914@@ -943,7 +943,7 @@
915 /* arbitrary-ish threshold, honors user attempts to
916 * manually cascade.
917 */
918-#define CASCADE_FUZZ 15
919+static const unsigned short CASCADE_FUZZ = 15;
920
921 xThreshold = MAX (this->extents ().left, CASCADE_FUZZ);
922 yThreshold = MAX (this->extents ().top, CASCADE_FUZZ);
923@@ -988,7 +988,7 @@
924 cascadeX = MAX (0, workArea.x ());
925 cascadeY = MAX (0, workArea.y ());
926
927-#define CASCADE_INTERVAL 50 /* space between top-left corners of cascades */
928+static const unsigned short CASCADE_INTERVAL = 50; /* space between top-left corners of cascades */
929
930 cascadeStage += 1;
931 cascadeX += CASCADE_INTERVAL * cascadeStage;
932
933=== modified file 'plugins/place/src/smart/src/smart.cpp'
934--- plugins/place/src/smart/src/smart.cpp 2012-02-02 17:01:15 +0000
935+++ plugins/place/src/smart/src/smart.cpp 2012-09-08 00:13:22 +0000
936@@ -6,9 +6,9 @@
937 #endif
938
939 /* overlap types */
940-#define NONE 0
941-#define H_WRONG -1
942-#define W_WRONG -2
943+static const unsigned short NONE = 0;
944+static const short H_WRONG = -1;
945+static const short W_WRONG = -2;
946
947 namespace compiz
948 {
949
950=== modified file 'plugins/put/src/put.cpp'
951--- plugins/put/src/put.cpp 2011-03-14 15:53:05 +0000
952+++ plugins/put/src/put.cpp 2012-09-08 00:13:22 +0000
953@@ -106,10 +106,10 @@
954 * PS: Decorations are icky.
955 */
956
957-#define LEFT 0
958-#define RIGHT 1
959-#define TOP 2
960-#define BOTTOM 3
961+static const unsigned short LEFT = 0;
962+static const unsigned short RIGHT = 1;
963+static const unsigned short TOP = 2;
964+static const unsigned short BOTTOM = 3;
965
966 inline void
967 addToCorner (CompRect& rect,
968
969=== modified file 'plugins/resize/src/logic/include/resize-defs.h'
970--- plugins/resize/src/logic/include/resize-defs.h 2012-08-15 21:36:40 +0000
971+++ plugins/resize/src/logic/include/resize-defs.h 2012-09-08 00:13:22 +0000
972@@ -36,7 +36,7 @@
973
974 #define NUM_KEYS 4
975
976-#define MIN_KEY_WIDTH_INC 24
977-#define MIN_KEY_HEIGHT_INC 24
978+#define MIN_KEY_WIDTH_INC 24
979+#define MIN_KEY_HEIGHT_INC 24
980
981 #endif /* RESIZEDEFS_H */
982
983=== modified file 'plugins/resize/src/logic/src/resize-logic.cpp'
984--- plugins/resize/src/logic/src/resize-logic.cpp 2012-09-03 21:21:12 +0000
985+++ plugins/resize/src/logic/src/resize-logic.cpp 2012-09-08 00:13:22 +0000
986@@ -43,10 +43,10 @@
987
988 #define XWINDOWCHANGES_INIT {0, 0, 0, 0, 0, None, 0}
989
990-#define TOUCH_LEFT 1
991-#define TOUCH_RIGHT 2
992-#define TOUCH_TOP 3
993-#define TOUCH_BOTTOM 4
994+static const unsigned short TOUCH_LEFT = 1;
995+static const unsigned short TOUCH_RIGHT = 2;
996+static const unsigned short TOUCH_TOP = 3;
997+static const unsigned short TOUCH_BOTTOM = 4;
998
999 using namespace resize;
1000
1001
1002=== modified file 'plugins/resizeinfo/src/resizeinfo.cpp'
1003--- plugins/resizeinfo/src/resizeinfo.cpp 2012-07-30 07:10:52 +0000
1004+++ plugins/resizeinfo/src/resizeinfo.cpp 2012-09-08 00:13:22 +0000
1005@@ -25,6 +25,11 @@
1006
1007 COMPIZ_PLUGIN_20090315 (resizeinfo, InfoPluginVTable);
1008
1009+const unsigned short RESIZE_POPUP_WIDTH = 85;
1010+const unsigned short RESIZE_POPUP_HEIGHT = 50;
1011+
1012+const double PI = 3.14159265359f;
1013+
1014 /* Set up an InfoLayer to build a cairo->opengl texture pipeline */
1015 InfoLayer::~InfoLayer ()
1016 {
1017
1018=== modified file 'plugins/resizeinfo/src/resizeinfo.h'
1019--- plugins/resizeinfo/src/resizeinfo.h 2012-07-30 07:10:52 +0000
1020+++ plugins/resizeinfo/src/resizeinfo.h 2012-09-08 00:13:22 +0000
1021@@ -34,10 +34,10 @@
1022
1023 #include "resizeinfo_options.h"
1024
1025-#define RESIZE_POPUP_WIDTH 85
1026-#define RESIZE_POPUP_HEIGHT 50
1027+extern const unsigned short RESIZE_POPUP_WIDTH;
1028+extern const unsigned short RESIZE_POPUP_HEIGHT;
1029
1030-#define PI 3.1415926
1031+extern const double PI;
1032
1033 /* Cairo helper class */
1034
1035
1036=== modified file 'plugins/ring/src/ring.cpp'
1037--- plugins/ring/src/ring.cpp 2012-08-14 06:33:22 +0000
1038+++ plugins/ring/src/ring.cpp 2012-09-08 00:13:22 +0000
1039@@ -31,6 +31,10 @@
1040
1041 COMPIZ_PLUGIN_20090315 (ring, RingPluginVTable);
1042
1043+const double PI = 3.14159265359f;
1044+
1045+const unsigned short ICON_SIZE = 64;
1046+
1047 bool textAvailable;
1048
1049 static void
1050
1051=== modified file 'plugins/ring/src/ring.h'
1052--- plugins/ring/src/ring.h 2012-05-22 13:55:35 +0000
1053+++ plugins/ring/src/ring.h 2012-09-08 00:13:22 +0000
1054@@ -246,10 +246,10 @@
1055 adjustVelocity ();
1056 };
1057
1058-#define PI 3.1415926
1059+extern const double PI;
1060 #define DIST_ROT (3600 / mWindows.size ())
1061 #define DIST_ROT_w (3600 / rs->mWindows.size ())
1062-#define ICON_SIZE 64
1063+extern const unsigned short ICON_SIZE;
1064
1065 #define RING_SCREEN(s) \
1066 RingScreen *rs = RingScreen::get (s)
1067
1068=== modified file 'plugins/rotate/src/rotate.cpp'
1069--- plugins/rotate/src/rotate.cpp 2012-01-18 16:26:45 +0000
1070+++ plugins/rotate/src/rotate.cpp 2012-09-08 00:13:22 +0000
1071@@ -28,7 +28,7 @@
1072
1073 #include <math.h>
1074
1075-#define ROTATE_POINTER_SENSITIVITY_FACTOR 0.05f
1076+static const float ROTATE_POINTER_SENSITIVITY_FACTOR = 0.05f;
1077
1078 COMPIZ_PLUGIN_20090315 (rotate, RotatePluginVTable)
1079
1080
1081=== modified file 'plugins/scaleaddon/src/scaleaddon.cpp'
1082--- plugins/scaleaddon/src/scaleaddon.cpp 2012-07-30 07:10:52 +0000
1083+++ plugins/scaleaddon/src/scaleaddon.cpp 2012-09-08 00:13:22 +0000
1084@@ -545,8 +545,8 @@
1085 * inspired by smallwindows (smallwindows.sf.net) by Jens Egeblad
1086 * FIXME: broken.
1087 * */
1088-#define ORGANIC_STEP 0.05
1089 #if 0
1090+static const double ORGANIC_STEP = 0.05f;
1091 static int
1092 organicCompareWindows (const void *elem1,
1093 const void *elem2)
1094
1095=== modified file 'plugins/shelf/src/shelf.cpp'
1096--- plugins/shelf/src/shelf.cpp 2012-05-18 06:52:20 +0000
1097+++ plugins/shelf/src/shelf.cpp 2012-09-08 00:13:22 +0000
1098@@ -36,6 +36,8 @@
1099
1100 COMPIZ_PLUGIN_20090315 (shelf, ShelfPluginVTable);
1101
1102+const float SHELF_MIN_SIZE = 50.0f; // Minimum pixelsize a window can be scaled to
1103+
1104 /* Enables / Disables screen paint functions */
1105 static void
1106 toggleScreenFunctions (bool enabled)
1107
1108=== modified file 'plugins/shelf/src/shelf.h'
1109--- plugins/shelf/src/shelf.h 2010-08-04 16:09:38 +0000
1110+++ plugins/shelf/src/shelf.h 2012-09-08 00:13:22 +0000
1111@@ -221,7 +221,7 @@
1112 #define SHELF_SCREEN(w) \
1113 ShelfScreen *ss = ShelfScreen::get (w)
1114
1115-#define SHELF_MIN_SIZE 50.0f // Minimum pixelsize a window can be scaled to
1116+extern const float SHELF_MIN_SIZE; // Minimum pixelsize a window can be scaled to
1117
1118
1119 class ShelfPluginVTable :
1120
1121=== modified file 'plugins/shift/src/shift.cpp'
1122--- plugins/shift/src/shift.cpp 2012-08-14 06:33:22 +0000
1123+++ plugins/shift/src/shift.cpp 2012-09-08 00:13:22 +0000
1124@@ -37,6 +37,8 @@
1125
1126 COMPIZ_PLUGIN_20090315 (shift, ShiftPluginVTable);
1127
1128+const double PI = 3.14159265359f;
1129+
1130 bool textAvailable = false;
1131
1132 void
1133
1134=== modified file 'plugins/shift/src/shift.h'
1135--- plugins/shift/src/shift.h 2012-05-22 13:58:31 +0000
1136+++ plugins/shift/src/shift.h 2012-09-08 00:13:22 +0000
1137@@ -305,7 +305,7 @@
1138
1139 };
1140
1141-#define PI 3.1415926
1142+extern const double PI;
1143
1144 #define SHIFT_WINDOW(w) \
1145 ShiftWindow *sw = ShiftWindow::get (w)
1146
1147=== modified file 'plugins/showdesktop/src/showdesktop.cpp'
1148--- plugins/showdesktop/src/showdesktop.cpp 2012-05-18 06:52:20 +0000
1149+++ plugins/showdesktop/src/showdesktop.cpp 2012-09-08 00:13:22 +0000
1150@@ -37,6 +37,11 @@
1151
1152 COMPIZ_PLUGIN_20090315 (showdesktop, ShowdesktopPluginVTable);
1153
1154+const unsigned short SD_STATE_OFF = 0;
1155+const unsigned short SD_STATE_ACTIVATING = 1;
1156+const unsigned short SD_STATE_ON = 2;
1157+const unsigned short SD_STATE_DEACTIVATING = 3;
1158+
1159 /* non interfacing code, aka the logic of the plugin */
1160 bool
1161 ShowdesktopWindow::is ()
1162
1163=== modified file 'plugins/showdesktop/src/showdesktop.h'
1164--- plugins/showdesktop/src/showdesktop.h 2011-03-14 15:47:56 +0000
1165+++ plugins/showdesktop/src/showdesktop.h 2012-09-08 00:13:22 +0000
1166@@ -54,10 +54,10 @@
1167 #define MOVE_LEFT(w) ((WIN_X (w) + (WIN_W (w) / 2)) < (screen->width () / 2))
1168 #define MOVE_UP(w) ((WIN_Y (w) + (WIN_H (w) / 2)) < (screen->height () / 2))
1169
1170-#define SD_STATE_OFF 0
1171-#define SD_STATE_ACTIVATING 1
1172-#define SD_STATE_ON 2
1173-#define SD_STATE_DEACTIVATING 3
1174+extern const unsigned short SD_STATE_OFF;
1175+extern const unsigned short SD_STATE_ACTIVATING;
1176+extern const unsigned short SD_STATE_ON;
1177+extern const unsigned short SD_STATE_DEACTIVATING;
1178
1179 class ShowdesktopPlacer
1180 {
1181
1182=== modified file 'plugins/splash/src/splash.cpp'
1183--- plugins/splash/src/splash.cpp 2011-02-24 06:28:27 +0000
1184+++ plugins/splash/src/splash.cpp 2012-09-08 00:13:22 +0000
1185@@ -23,6 +23,9 @@
1186
1187 COMPIZ_PLUGIN_20090315 (splash, SplashPluginVTable);
1188
1189+const std::string SPLASH_BACKGROUND_DEFAULT("");
1190+const std::string SPLASH_LOGO_DEFAULT("");
1191+
1192 void
1193 SplashScreen::preparePaint (int ms)
1194 {
1195
1196=== modified file 'plugins/splash/src/splash.h'
1197--- plugins/splash/src/splash.h 2009-03-16 01:58:28 +0000
1198+++ plugins/splash/src/splash.h 2012-09-08 00:13:22 +0000
1199@@ -34,8 +34,8 @@
1200 #define MESH_W 16
1201 #define MESH_H 16
1202
1203-#define SPLASH_BACKGROUND_DEFAULT ""
1204-#define SPLASH_LOGO_DEFAULT ""
1205+extern const std::string SPLASH_BACKGROUND_DEFAULT;
1206+extern const std::string SPLASH_LOGO_DEFAULT;
1207
1208 class SplashScreen :
1209 public PluginClassHandler <SplashScreen, CompScreen>,
1210
1211=== modified file 'plugins/staticswitcher/src/staticswitcher.cpp'
1212--- plugins/staticswitcher/src/staticswitcher.cpp 2012-08-08 08:54:15 +0000
1213+++ plugins/staticswitcher/src/staticswitcher.cpp 2012-09-08 00:13:22 +0000
1214@@ -27,6 +27,9 @@
1215
1216 COMPIZ_PLUGIN_20090315 (staticswitcher, StaticSwitchPluginVTable)
1217
1218+const unsigned short PREVIEWSIZE = 150;
1219+const unsigned short BORDER = 10;
1220+
1221 void
1222 StaticSwitchScreen::updatePopupWindow ()
1223 {
1224
1225=== modified file 'plugins/staticswitcher/src/staticswitcher.h'
1226--- plugins/staticswitcher/src/staticswitcher.h 2012-07-30 07:10:52 +0000
1227+++ plugins/staticswitcher/src/staticswitcher.h 2012-09-08 00:13:22 +0000
1228@@ -159,8 +159,8 @@
1229
1230 #define MAX_ICON_SIZE 256
1231
1232-#define PREVIEWSIZE 150
1233-#define BORDER 10
1234+extern const unsigned short PREVIEWSIZE;
1235+extern const unsigned short BORDER;
1236
1237 #define SWITCH_SCREEN(s) \
1238 StaticSwitchScreen *ss = StaticSwitchScreen::get (s)
1239
1240=== modified file 'plugins/switcher/src/switcher.cpp'
1241--- plugins/switcher/src/switcher.cpp 2012-08-06 01:36:00 +0000
1242+++ plugins/switcher/src/switcher.cpp 2012-09-08 00:13:22 +0000
1243@@ -27,6 +27,12 @@
1244
1245 COMPIZ_PLUGIN_20090315 (switcher, SwitchPluginVTable)
1246
1247+const unsigned short WIDTH = 212;
1248+const unsigned short HEIGHT = 192;
1249+const unsigned short SPACE = 10;
1250+
1251+const unsigned short BOX_WIDTH = 3;
1252+
1253 #define XWINDOWCHANGES_INIT {0, 0, 0, 0, 0, None, 0}
1254
1255 static float _boxVertices[] =
1256
1257=== modified file 'plugins/switcher/src/switcher.h'
1258--- plugins/switcher/src/switcher.h 2010-12-07 15:25:17 +0000
1259+++ plugins/switcher/src/switcher.h 2012-09-08 00:13:22 +0000
1260@@ -154,11 +154,11 @@
1261 unsigned long decorations;
1262 } MwmHints;
1263
1264-#define WIDTH 212
1265-#define HEIGHT 192
1266-#define SPACE 10
1267+extern const unsigned short WIDTH;
1268+extern const unsigned short HEIGHT;
1269+extern const unsigned short SPACE;
1270
1271-#define BOX_WIDTH 3
1272+extern const unsigned short BOX_WIDTH;
1273
1274 #define WINDOW_WIDTH(count) (WIDTH * (count) + (SPACE << 1))
1275 #define WINDOW_HEIGHT (HEIGHT + (SPACE << 1))
1276
1277=== modified file 'plugins/td/src/3d.cpp'
1278--- plugins/td/src/3d.cpp 2012-07-30 10:15:41 +0000
1279+++ plugins/td/src/3d.cpp 2012-09-08 00:13:22 +0000
1280@@ -2,6 +2,8 @@
1281
1282 COMPIZ_PLUGIN_20090315 (td, TdPluginVTable);
1283
1284+const double PI = 3.14159265359f;
1285+
1286 void
1287 setFunctions (bool enabled)
1288 {
1289
1290=== modified file 'plugins/td/src/3d.h'
1291--- plugins/td/src/3d.h 2010-08-15 10:01:46 +0000
1292+++ plugins/td/src/3d.h 2012-09-08 00:13:22 +0000
1293@@ -43,7 +43,7 @@
1294
1295 #include "td_options.h"
1296
1297-#define PI 3.14159265359f
1298+extern const double PI;
1299
1300 class TdScreen :
1301 public PluginClassHandler <TdScreen, CompScreen>,
1302
1303=== modified file 'plugins/text/src/text.cpp'
1304--- plugins/text/src/text.cpp 2012-07-30 07:10:52 +0000
1305+++ plugins/text/src/text.cpp 2012-09-08 00:13:22 +0000
1306@@ -27,7 +27,7 @@
1307
1308 #include "private.h"
1309
1310-#define PI 3.14159265359f
1311+static const double PI = 3.14159265359f;
1312
1313 COMPIZ_PLUGIN_20090315 (text, TextPluginVTable);
1314
1315
1316=== modified file 'plugins/thumbnail/src/thumbnail.cpp'
1317--- plugins/thumbnail/src/thumbnail.cpp 2012-08-06 01:36:00 +0000
1318+++ plugins/thumbnail/src/thumbnail.cpp 2012-09-08 00:13:22 +0000
1319@@ -32,6 +32,8 @@
1320
1321 COMPIZ_PLUGIN_20090315 (thumbnail, ThumbPluginVTable);
1322
1323+const unsigned short TEXT_DISTANCE = 10;
1324+
1325 void
1326 ThumbScreen::freeThumbText (Thumbnail *t)
1327 {
1328
1329=== modified file 'plugins/thumbnail/src/thumbnail.h'
1330--- plugins/thumbnail/src/thumbnail.h 2012-07-30 07:10:52 +0000
1331+++ plugins/thumbnail/src/thumbnail.h 2012-09-08 00:13:22 +0000
1332@@ -58,7 +58,7 @@
1333 #define WIN_W(w) ((w)->width () + (w)->border ().left + (w)->border ().right)
1334 #define WIN_H(w) ((w)->height () + (w)->border ().top + (w)->border ().bottom)
1335
1336-#define TEXT_DISTANCE 10
1337+extern const unsigned short TEXT_DISTANCE;
1338
1339 bool textPluginLoaded;
1340
1341
1342=== modified file 'plugins/wall/src/wall.cpp'
1343--- plugins/wall/src/wall.cpp 2012-08-02 06:54:30 +0000
1344+++ plugins/wall/src/wall.cpp 2012-09-08 00:13:22 +0000
1345@@ -37,9 +37,9 @@
1346
1347 #include "wall.h"
1348
1349-#define PI 3.14159265359f
1350-#define VIEWPORT_SWITCHER_SIZE 100
1351-#define ARROW_SIZE 33
1352+static const double PI = 3.14159265359f;
1353+static const unsigned short VIEWPORT_SWITCHER_SIZE = 100;
1354+static const unsigned short ARROW_SIZE = 33;
1355
1356 #define getColorRGBA(name) \
1357 r = optionGet##name##Red() / 65535.0f;\
1358@@ -385,7 +385,7 @@
1359 }
1360
1361 /* movement remainder that gets ignored for direction calculation */
1362-#define IGNORE_REMAINDER 0.05
1363+static const float IGNORE_REMAINDER = 0.05f;
1364
1365 void
1366 WallScreen::determineMovementAngle ()
1367
1368=== modified file 'plugins/water/src/water.cpp'
1369--- plugins/water/src/water.cpp 2012-09-05 23:54:21 +0000
1370+++ plugins/water/src/water.cpp 2012-09-08 00:13:22 +0000
1371@@ -31,6 +31,10 @@
1372
1373 COMPIZ_PLUGIN_20090315 (water, WaterPluginVTable)
1374
1375+const unsigned int TEXTURE_SIZE = 256;
1376+
1377+const float K = 0.1964f;
1378+
1379 static int waterLastPointerX = 0;
1380 static int waterLastPointerY = 0;
1381
1382
1383=== modified file 'plugins/water/src/water.h'
1384--- plugins/water/src/water.h 2012-07-30 07:10:52 +0000
1385+++ plugins/water/src/water.h 2012-09-08 00:13:22 +0000
1386@@ -37,9 +37,9 @@
1387 #define WATER_SCREEN(s) \
1388 WaterScreen *ws = WaterScreen::get (s)
1389
1390-#define TEXTURE_SIZE 256
1391+extern const unsigned int TEXTURE_SIZE;
1392
1393-#define K 0.1964f
1394+extern const float K;
1395
1396 #define TEXTURE_NUM 3
1397 #define PROG_NUM 3
1398
1399=== modified file 'plugins/wobbly/src/wobbly.h'
1400--- plugins/wobbly/src/wobbly.h 2012-08-14 06:33:22 +0000
1401+++ plugins/wobbly/src/wobbly.h 2012-09-08 00:13:22 +0000
1402@@ -41,7 +41,7 @@
1403 CompWindowTypeMenuMask | \
1404 CompWindowTypeUtilMask)
1405
1406-#define GRID_WIDTH 4
1407+#define GRID_WIDTH 4
1408 #define GRID_HEIGHT 4
1409
1410 #define MODEL_MAX_SPRINGS (GRID_WIDTH * GRID_HEIGHT * 2)
1411
1412=== modified file 'src/event.cpp'
1413--- src/event.cpp 2012-08-07 04:17:07 +0000
1414+++ src/event.cpp 2012-09-08 00:13:22 +0000
1415@@ -1619,9 +1619,9 @@
1416 if (state & ~CompWindowStateHiddenMask)
1417 {
1418
1419-#define _NET_WM_STATE_REMOVE 0
1420-#define _NET_WM_STATE_ADD 1
1421-#define _NET_WM_STATE_TOGGLE 2
1422+static const unsigned short _NET_WM_STATE_REMOVE = 0;
1423+static const unsigned short _NET_WM_STATE_ADD = 1;
1424+static const unsigned short _NET_WM_STATE_TOGGLE = 2;
1425
1426 switch (event->xclient.data.l[0]) {
1427 case _NET_WM_STATE_REMOVE:
1428
1429=== modified file 'src/screen.cpp'
1430--- src/screen.cpp 2012-08-03 10:12:25 +0000
1431+++ src/screen.cpp 2012-09-08 00:13:22 +0000
1432@@ -80,7 +80,7 @@
1433
1434 #define MwmHintsFunctions (1L << 0)
1435 #define MwmHintsDecorations (1L << 1)
1436-#define PropMotifWmHintElements 3
1437+static const unsigned short PropMotifWmHintElements = 3;
1438
1439 typedef struct {
1440 unsigned long flags;
1441@@ -1148,7 +1148,7 @@
1442 Atom property)
1443 {
1444
1445-#define N_TARGETS 4
1446+static const unsigned short N_TARGETS = 4;
1447
1448 Atom conversionTargets[N_TARGETS];
1449
1450@@ -1272,8 +1272,8 @@
1451 eventManager.quit ();
1452 }
1453
1454-#define IMAGEDIR "images"
1455-#define HOMECOMPIZDIR ".compiz-1"
1456+static const std::string IMAGEDIR("images");
1457+static const std::string HOMECOMPIZDIR(".compiz-1");
1458
1459 bool
1460 CompScreenImpl::readImageFromFile (CompString &name,
1461@@ -2174,7 +2174,7 @@
1462 }
1463 }
1464
1465-#define STARTUP_TIMEOUT_DELAY 15000
1466+static const unsigned int STARTUP_TIMEOUT_DELAY = 15000;
1467
1468 bool
1469 cps::StartupSequence::handleStartupSequenceTimeout ()
1470
1471=== modified file 'src/timer/src/timer.cpp'
1472--- src/timer/src/timer.cpp 2012-08-08 02:22:12 +0000
1473+++ src/timer/src/timer.cpp 2012-09-08 00:13:22 +0000
1474@@ -79,7 +79,7 @@
1475 return new CompTimeoutSource (ctx);
1476 }
1477
1478-#define COMPIZ_TIMEOUT_WAIT 15
1479+static const unsigned short COMPIZ_TIMEOUT_WAIT = 15;
1480
1481 bool
1482 CompTimeoutSource::prepare (int &timeout)

Subscribers

People subscribed via source and target branches