Merge lp:~timo-jyrinki/ubuntu/quantal/compiz/fix_expo into lp:ubuntu/quantal/compiz

Proposed by Timo Jyrinki
Status: Merged
Merged at revision: 3297
Proposed branch: lp:~timo-jyrinki/ubuntu/quantal/compiz/fix_expo
Merge into: lp:ubuntu/quantal/compiz
Diff against target: 5842 lines (+1/-2906)
3 files modified
debian/changelog (+0/-2)
debian/patches/100_expo_layout.patch (+0/-2903)
debian/patches/series (+1/-1)
To merge this branch: bzr merge lp:~timo-jyrinki/ubuntu/quantal/compiz/fix_expo
Reviewer Review Type Date Requested Status
Timo Jyrinki Needs Information
Ubuntu branches Pending
Review via email: mp+124114@code.launchpad.net

Description of the change

Fix the expo patch and enable it again. Now works.

To post a comment you must log in.
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

But still pending on FFe at LP: #1047067

review: Needs Information
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

FFe now approved.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-09-12 12:59:32 +0000
3+++ debian/changelog 2012-09-13 07:34:23 +0000
4@@ -64,8 +64,6 @@
5 * Drop dependency on libgconf2-dev, add gconf2 dependency to the
6 transitional package for migrations
7 * Add -DUSE_GCONF=OFF to debian/rules
8- * debian/patches/100_expo_layout.patch
9- - Disable temporarily until it really works
10 * debian/libdecoration0.symbols
11 - Add decor_shadow_options_cmp
12
13
14=== added file 'debian/patches/100_expo_layout.patch'
15--- debian/patches/100_expo_layout.patch 1970-01-01 00:00:00 +0000
16+++ debian/patches/100_expo_layout.patch 2012-09-13 07:34:23 +0000
17@@ -0,0 +1,2907 @@
18+Index: ubuntu/plugins/expo/expo.xml.in
19+===================================================================
20+--- ubuntu.orig/plugins/expo/expo.xml.in 2012-09-12 22:20:42.944758828 +0800
21++++ ubuntu/plugins/expo/expo.xml.in 2012-09-12 22:20:43.240760303 +0800
22+@@ -17,6 +17,7 @@
23+ <plugin>wobbly</plugin>
24+ <plugin>animation</plugin>
25+ <plugin>wallpaper</plugin>
26++ <plugin>imgpng</plugin>
27+ </relation>
28+ </deps>
29+ <options>
30+@@ -25,7 +26,7 @@
31+ <option name="expo_key" type="key">
32+ <_short>Expo key</_short>
33+ <_long>Engage wall expo mode key binding</_long>
34+- <default>&lt;Super&gt;e</default>
35++ <default>&lt;Super&gt;s</default>
36+ </option>
37+ <option name="expo_button" type="button">
38+ <_short>Expo button</_short>
39+@@ -35,8 +36,6 @@
40+ <option name="expo_edge" type="edge">
41+ <_short>Expo edge</_short>
42+ <_long>Engage wall expo mode edge binding</_long>
43+- <default>
44+- </default>
45+ </option>
46+ <option name="double_click_time" type="int">
47+ <_short>Double click time</_short>
48+@@ -79,7 +78,7 @@
49+ <option name="zoom_time" type="float">
50+ <_short>Zoom time</_short>
51+ <_long>Duration of the zoomout animation</_long>
52+- <default>0.5</default>
53++ <default>0.3</default>
54+ <min>0.1</min>
55+ <max>5.0</max>
56+ <precision>0.1</precision>
57+@@ -130,10 +129,24 @@
58+ <_name>Curve</_name>
59+ </desc>
60+ </option>
61++ <option name="x_offset" type="int">
62++ <_short>X Space</_short>
63++ <_long> Left Side screen space of expo in pixels</_long>
64++ <min>-1680</min>
65++ <max>1680</max>
66++ <default>64</default>
67++ </option>
68++ <option name="y_offset" type="int">
69++ <_short>Y Space</_short>
70++ <_long> Top Side screen space of expo in pixels</_long>
71++ <min>-100</min>
72++ <max>100</max>
73++ <default>24</default>
74++ </option>
75+ <option name="distance" type="float">
76+ <_short>Distance</_short>
77+ <_long>Distance of the expo wall</_long>
78+- <default>0.0</default>
79++ <default>0.005</default>
80+ <min>0.0</min>
81+ <max>1.0</max>
82+ <precision>0.01</precision>
83+@@ -141,7 +154,7 @@
84+ <option name="vp_distance" type="float">
85+ <_short>Viewport distance</_short>
86+ <_long>Distance between viewports</_long>
87+- <default>0.10</default>
88++ <default>0.2</default>
89+ <min>0.0</min>
90+ <max>1.0</max>
91+ <precision>0.01</precision>
92+@@ -192,7 +205,7 @@
93+ <option name="vp_brightness" type="float">
94+ <_short>Brightness</_short>
95+ <_long>Inactive viewport brightness.</_long>
96+- <default>75.0</default>
97++ <default>40.0</default>
98+ <min>0.0</min>
99+ <max>100.0</max>
100+ <precision>0.1</precision>
101+@@ -200,18 +213,28 @@
102+ <option name="vp_saturation" type="float">
103+ <_short>Saturation</_short>
104+ <_long>Inactive viewport saturation.</_long>
105+- <default>100.0</default>
106++ <default>40.0</default>
107+ <min>0.0</min>
108+ <max>100.0</max>
109+ <precision>0.1</precision>
110+ </option>
111++ <option name="selected_color" type="color">
112++ <_short>Selected Color</_short>
113++ <_long>Color to use when highlighting the selected viewport</_long>
114++ <default>
115++ <red>0xfbfb</red>
116++ <green>0x8b8b</green>
117++ <blue>0x0</blue>
118++ <alpha>0xffff</alpha>
119++ </default>
120++ </option>
121+ </subgroup>
122+ <subgroup>
123+ <short>Reflection</short>
124+ <option name="reflection" type="bool">
125+ <_short>Reflection</_short>
126+ <_long>Show a reflection of the viewports on the ground</_long>
127+- <default>true</default>
128++ <default>false</default>
129+ </option>
130+ <option name="ground_color1" type="color">
131+ <_short>Ground color(near)</_short>
132+@@ -244,7 +267,7 @@
133+ <option name="scale_factor" type="float">
134+ <_short>Reflection Scale</_short>
135+ <_long>Scale factor of the expo wall reflection</_long>
136+- <default>0.75</default>
137++ <default>1.0</default>
138+ <min>0.0</min>
139+ <max>2.0</max>
140+ <precision>0.01</precision>
141+Index: ubuntu/plugins/expo/src/expo.cpp
142+===================================================================
143+--- ubuntu.orig/plugins/expo/src/expo.cpp 2012-09-12 22:09:32.323735000 +0800
144++++ ubuntu/plugins/expo/src/expo.cpp 2012-09-12 22:29:50.643474721 +0800
145+@@ -27,6 +27,8 @@
146+
147+ #include "expo.h"
148+ #include "click-threshold.h"
149++#include "wall-offset.h"
150++#include "windows-on-viewport.h"
151+ #include <math.h>
152+ #ifndef USE_GLES
153+ #include <GL/glu.h>
154+@@ -73,11 +75,10 @@
155+
156+ if (dndState == DnDDuring || dndState == DnDStart)
157+ {
158+- if (dndWindow)
159++ if (dndWindows.size ())
160+ finishWindowMovement ();
161+
162+ dndState = DnDNone;
163+- dndWindow = NULL;
164+
165+ action->setState (action->state () & CompAction::StateInitButton);
166+ cScreen->damageScreen ();
167+@@ -113,7 +114,6 @@
168+ clickTime = 0;
169+
170+ dndState = DnDNone;
171+- dndWindow = NULL;
172+
173+ selectedVp = screen->vp ();
174+ lastSelectedVp = screen->vp ();
175+@@ -156,8 +156,8 @@
176+ else
177+ vpUpdateMode = VPUpdateMouseOver;
178+
179+- dndState = DnDNone;
180+- dndWindow = NULL;
181++ dndState = DnDNone;
182++ dndWindows.clear ();
183+
184+ screen->removeAction (&optionGetDndButton ());
185+ screen->removeAction (&optionGetExitButton ());
186+@@ -202,6 +202,8 @@
187+ if (!expoMode)
188+ return false;
189+
190++ lastSelectedVp = selectedVp;
191++
192+ newX = selectedVp.x () + 1;
193+ newY = selectedVp.y ();
194+
195+@@ -225,7 +227,7 @@
196+ CompAction::State state,
197+ CompOption::Vector& options)
198+ {
199+- int newX, newY;
200++ unsigned int newX, newY;
201+ Window xid = CompOption::getIntOptionNamed (options, "root", 0);
202+ if (xid != screen->root ())
203+ return false;
204+@@ -272,53 +274,39 @@
205+ void
206+ ExpoScreen::finishWindowMovement ()
207+ {
208+- dndWindow->syncPosition ();
209+- dndWindow->ungrabNotify ();
210+-
211+- screen->moveViewport (screen->vp ().x () - selectedVp.x (),
212+- screen->vp ().y () - selectedVp.y (), true);
213+-
214+- /* update saved window attributes in case we moved the
215+- window to a new viewport */
216+- if (dndWindow->saveMask () & CWX)
217+- {
218+- dndWindow->saveWc ().x = dndWindow->saveWc ().x % screen->width ();
219+- if (dndWindow->saveWc ().x < 0)
220+- dndWindow->saveWc ().x += screen->width ();
221+- }
222+- if (dndWindow->saveMask () & CWY)
223++ foreach (CompWindow *dndWindow, dndWindows)
224+ {
225+- dndWindow->saveWc ().y = dndWindow->saveWc ().y % screen->height ();
226+- if (dndWindow->saveWc ().y < 0)
227+- dndWindow->saveWc ().y += screen->height ();
228+- }
229+-
230+- /* update window attibutes to make sure a moved maximized window
231+- is properly snapped to the work area */
232+- if (dndWindow->state () & MAXIMIZE_STATE)
233+- dndWindow->updateAttributes (CompStackingUpdateModeNone);
234+-
235+-#if 0 /* FIXME: obsolete in the meantime? */
236+- {
237+- int lastOutput;
238+- int centerX, centerY;
239++ if (dndWindow->grabbed ())
240++ {
241++ dndWindow->syncPosition ();
242++ dndWindow->ungrabNotify ();
243+
244+- /* make sure we snap to the correct output */
245+- lastOutput = s->currentOutputDev;
246+- centerX = (WIN_X (w) + WIN_W (w) / 2) % s->width;
247+- if (centerX < 0)
248+- centerX += s->width;
249+- centerY = (WIN_Y (w) + WIN_H (w) / 2) % s->height;
250+- if (centerY < 0)
251+- centerY += s->height;
252++ screen->updateGrab (grabIndex, None);
253+
254+- s->currentOutputDev = outputDeviceForPoint (s, centerX, centerY);
255++ screen->moveViewport (screen->vp ().x () - selectedVp.x (),
256++ screen->vp ().y () - selectedVp.y (), true);
257+
258+- updateWindowAttributes (w, CompStackingUpdateModeNone);
259++ /* update saved window attributes in case we moved the
260++ window to a new viewport */
261++ if (dndWindow->saveMask () & CWX)
262++ {
263++ dndWindow->saveWc ().x = dndWindow->saveWc ().x % screen->width ();
264++ if (dndWindow->saveWc ().x < 0)
265++ dndWindow->saveWc ().x += screen->width ();
266++ }
267++ if (dndWindow->saveMask () & CWY)
268++ {
269++ dndWindow->saveWc ().y = dndWindow->saveWc ().y % screen->height ();
270++ if (dndWindow->saveWc ().y < 0)
271++ dndWindow->saveWc ().y += screen->height ();
272++ }
273+
274+- s->currentOutputDev = lastOutput;
275++ /* update window attibutes to make sure a moved maximized window
276++ is properly snapped to the work area */
277++ if (dndWindow->state () & MAXIMIZE_STATE)
278++ dndWindow->updateAttributes (CompStackingUpdateModeNone);
279++ }
280+ }
281+-#endif
282+ }
283+
284+ void
285+@@ -402,6 +390,80 @@
286+ screen->handleEvent (event);
287+ }
288+
289++bool
290++ExpoWindow::dragged () const
291++{
292++ ExpoScreen *es = ExpoScreen::get (screen);
293++
294++ return std::find (es->dndWindows.begin (), es->dndWindows.end (), window) != es->dndWindows.end ();
295++}
296++
297++const compiz::window::Geometry &
298++ExpoWindow::absoluteGeometry () const
299++{
300++ const compiz::window::Geometry &relativeGeometry (window->geometry ());
301++ mAbsoluteGeometry.set ((screen->vp ().x () * screen->width ()) + relativeGeometry.x (),
302++ (screen->vp ().y () * screen->height ()) + relativeGeometry.y (),
303++ relativeGeometry.width (),
304++ relativeGeometry.height (),
305++ relativeGeometry.border ());
306++
307++ return mAbsoluteGeometry;
308++}
309++
310++bool
311++ExpoWindow::isDesktopOrDock () const
312++{
313++ return window->type () == CompWindowTypeDesktopMask ||
314++ window->type () == CompWindowTypeDockMask;
315++}
316++
317++namespace cei = compiz::expo::impl;
318++
319++cei::CompizClientListGenerator::CompizClientListGenerator (CompScreen *screen) :
320++ mScreen (screen),
321++ mClientList (&mScreen->clientList (true)),
322++ mClientListIterator (mClientList->begin ())
323++{
324++}
325++
326++compiz::expo::ViewportMemberWindow *
327++cei::CompizClientListGenerator::nextClient ()
328++{
329++ if (mClientListIterator == mClientList->end ())
330++ return NULL;
331++
332++ compiz::expo::ViewportMemberWindow *vpMemberWindow = ExpoWindow::get (*mClientListIterator);
333++
334++ ++mClientListIterator;
335++
336++ return vpMemberWindow;
337++}
338++
339++bool
340++ExpoScreen::windowsOnVp (compiz::expo::ClientListGenerator &clientList,
341++ CompPoint &p,
342++ const CompPoint &unprojectedCursor,
343++ const CompSize &screenSize,
344++ CompScreen *screen)
345++{
346++ return false;
347++}
348++
349++namespace
350++{
351++ void fillInNewViewportActivityData (unsigned int vpCount,
352++ std::vector <float> &vpActivity)
353++ {
354++ if (vpActivity.size () < vpCount)
355++ {
356++ vpActivity.resize (vpCount);
357++ foreach (float& activity, vpActivity)
358++ activity = 1.0f;
359++ }
360++ }
361++}
362++
363+ void
364+ ExpoScreen::preparePaint (int msSinceLastPaint)
365+ {
366+@@ -412,33 +474,43 @@
367+ else
368+ expoCam = MAX (0.0, expoCam - val);
369+
370+- if (expoCam)
371++ if (dndState == DnDDuring)
372+ {
373+- unsigned int i, j, vp;
374+- unsigned int vpCount = screen->vpSize ().width () *
375+- screen->vpSize ().height ();
376++ foreach (CompWindow *w, dndWindows)
377++ ExpoWindow::get (w)->dndOpacity = MIN (1.0, ExpoWindow::get (w)->dndOpacity + val);
378++ }
379++ else if (dndState == DnDNone)
380++ {
381++ CompWindowList::iterator it = dndWindows.begin ();
382+
383+- if (vpActivity.size () < vpCount)
384++ while (it != dndWindows.end ())
385+ {
386+- vpActivity.resize (vpCount);
387+- foreach (float& activity, vpActivity)
388+- activity = 1.0f;
389+- }
390++ ExpoWindow::get ((*it))->dndOpacity = MAX (0.0, ExpoWindow::get ((*it))->dndOpacity - val);
391+
392+- for (i = 0; i < (unsigned int) screen->vpSize ().width (); i++)
393+- {
394+- for (j = 0; j < (unsigned int) screen->vpSize ().height (); j++)
395++ if (ExpoWindow::get ((*it))->dndOpacity <= 0.0f)
396+ {
397+- vp = (j * screen->vpSize ().width ()) + i;
398+-
399+- if (CompPoint (i, j) == selectedVp)
400+- vpActivity[vp] = MIN (1.0, vpActivity[vp] + val);
401+- else
402+- vpActivity[vp] = MAX (0.0, vpActivity[vp] - val);
403++ dndWindows.erase (it);
404++ it = dndWindows.begin ();
405+ }
406++ else
407++ it++;
408+ }
409++ }
410+
411+- for (i = 0; i < 360; i++)
412++ if (expoCam)
413++ {
414++ unsigned int vpCount = compiz::expo::countViewports (screen->vpSize ());
415++
416++ fillInNewViewportActivityData (vpCount, vpActivity);
417++ compiz::expo::fillInNewViewportActiveData (vpCount, vpActive);
418++
419++ for (unsigned int i = 0; i < vpCount; i++)
420++ if (vpActive[i])
421++ vpActivity[i] = MIN (1.0, vpActivity[i] + val);
422++ else
423++ vpActivity[i] = MAX (0.0, vpActivity[i] - val);
424++
425++ for (int i = 0; i < 360; i++)
426+ {
427+ float fi = (float) i;
428+
429+@@ -509,6 +581,31 @@
430+ cScreen->paint (outputs, mask);
431+ }
432+
433++namespace
434++{
435++ void updateViewportActiveStates (CompScreen *screen)
436++ {
437++ ExpoScreen *es = ExpoScreen::get (screen);
438++
439++ unsigned int vpCount = compiz::expo::countViewports (screen->vpSize ());
440++ fillInNewViewportActivityData (vpCount, es->vpActivity);
441++
442++ for (int i = 0; i < screen->vpSize ().width (); i++)
443++ {
444++ for (int j = 0; j < screen->vpSize ().height (); j++)
445++ {
446++ compiz::expo::impl::CompizClientListGenerator clientList (screen);
447++
448++ compiz::expo::activeViewportsForMembers (clientList,
449++ es->newCursor,
450++ screen->vpSize (),
451++ *screen,
452++ es->vpActive);
453++ }
454++ }
455++ }
456++}
457++
458+ void
459+ ExpoScreen::donePaint ()
460+ {
461+@@ -539,6 +636,11 @@
462+ foreach (float& vp, vpActivity)
463+ if (vp != 0.0 && vp != 1.0)
464+ cScreen->damageScreen ();
465++
466++ foreach (CompWindow *w, dndWindows)
467++ if (ExpoWindow::get (w)->dndOpacity != 0.0f &&
468++ ExpoWindow::get (w)->dndOpacity != 1.0f)
469++ cScreen->damageScreen ();
470+ }
471+
472+ if (grabIndex && expoCam <= 0.0f && !expoMode)
473+@@ -553,10 +655,25 @@
474+ switch (dndState) {
475+ case DnDDuring:
476+ {
477+- if (dndWindow)
478+- dndWindow->move (newCursor.x () - prevCursor.x (),
479+- newCursor.y () - prevCursor.y (),
480+- optionGetExpoImmediateMove ());
481++ if (dndWindows.size ())
482++ {
483++ foreach (CompWindow *dndWindow, dndWindows)
484++ {
485++ if (dndWindow->grabbed ())
486++ {
487++ ExpoWindow *ew = ExpoWindow::get (dndWindow);
488++
489++ /* No need to update twice */
490++ dndWindow->moveNotifySetEnabled (ew, false);
491++ dndWindow->move (newCursor.x () - prevCursor.x (),
492++ newCursor.y () - prevCursor.y (),
493++ optionGetExpoImmediateMove ());
494++ dndWindow->moveNotifySetEnabled (ew, true);
495++
496++ updateViewportActiveStates (screen);
497++ }
498++ }
499++ }
500+
501+ prevCursor = newCursor;
502+ cScreen->damageScreen ();
503+@@ -621,13 +738,13 @@
504+ break;
505+
506+ dndState = DnDDuring;
507+- dndWindow = w;
508++ dndWindows.push_back (w);
509+
510+ w->grabNotify (nx, ny, 0,
511+ CompWindowGrabMoveMask |
512+ CompWindowGrabButtonMask);
513+
514+- screen->updateGrab (grabIndex, dragCursor);
515++ screen->updateGrab (grabIndex, mMoveCursor);
516+
517+ w->raise ();
518+ w->moveInputFocusTo ();
519+@@ -762,6 +879,124 @@
520+ }
521+
522+ void
523++ExpoScreen::paintViewport (const GLScreenPaintAttrib& attrib,
524++ const GLMatrix& transform,
525++ const CompRegion& region,
526++ CompOutput *output,
527++ unsigned int mask,
528++ CompPoint vpPos,
529++ GLVector &vpCamPos,
530++ bool reflection)
531++{
532++ GLMatrix sTransform (transform);
533++ GLMatrix sTransform2, sTransform3;
534++ float sx = (float) screen->width () / output->width ();
535++ float sy = (float) screen->height () / output->height ();
536++ float vpp;
537++ float progress = sigmoidProgress (expoCam);
538++ unsigned int vp;
539++ CompPoint vpSize (screen->vpSize ().width (), screen->vpSize ().height ());
540++
541++ const float gapY = optionGetVpDistance () * 0.1f * expoCam;
542++ const float gapX = optionGetVpDistance () * 0.1f * screen->height () /
543++ screen->width () * expoCam;
544++
545++ /* not sure this will work with different resolutions */
546++ sTransform.translate (0.0, MAX (0, vpPos.y ()) * -(sy + gapY), 0.0f);
547++
548++ sTransform2 = sTransform;
549++
550++ /* not sure this will work with different resolutions */
551++ if (optionGetDeform () != DeformCurve)
552++ sTransform2.translate (MAX (0, vpPos.x ()) * (sx + gapX), 0.0f, 0.0);
553++
554++
555++ if (optionGetExpoAnimation () == ExpoAnimationVortex)
556++ sTransform2.rotate (360 * expoCam,
557++ 0.0f, 1.0f, 2.0f * expoCam);
558++
559++ sTransform3 = sTransform2;
560++
561++ sTransform3.translate (output->x () / output->width (),
562++ -output->y () / output->height (), 0.0);
563++
564++ cScreen->setWindowPaintOffset ((screen->vp ().x () - vpPos.x ()) *
565++ screen->width (),
566++ (screen->vp ().y () - vpPos.y ()) *
567++ screen->height ());
568++
569++ vp = (vpPos.y () * vpSize.x ()) + vpPos.x ();
570++
571++ vpp = (expoCam * vpActivity[vp]) + (1 - expoCam);
572++ vpp = sigmoidProgress (vpp);
573++
574++ vpBrightness = vpp + ((1.0 - vpp) *
575++ optionGetVpBrightness () / 100.0);
576++ vpSaturation = vpp + ((1.0 - vpp) *
577++ optionGetVpSaturation () / 100.0);
578++
579++ paintingVp = vpPos;
580++
581++ if (optionGetDeform () == DeformCurve)
582++ {
583++ float rotateX;
584++
585++ sTransform3.translate (-vpCamPos[GLVector::x], 0.0f,
586++ curveDistance - DEFAULT_Z_CAMERA);
587++
588++ rotateX = -vpPos.x () + interpolate (((float) vpSize.x () / 2.0) - 0.5,
589++ screen->vp ().x (), progress);
590++
591++ sTransform3.rotate (curveAngle * rotateX, 0.0, 1.0, 0.0);
592++
593++ sTransform3.translate (vpCamPos[GLVector::x], 0.0f,
594++ DEFAULT_Z_CAMERA - curveDistance);
595++ }
596++
597++ if (paintingDndWindow)
598++ cScreen->getWindowPaintListSetEnabled (this, true);
599++ gScreen->glPaintTransformedOutput (attrib, sTransform3,
600++ screen->region (), output,
601++ mask);
602++
603++ if (paintingDndWindow)
604++ cScreen->getWindowPaintListSetEnabled (this, false);
605++
606++ if (!reflection && !paintingDndWindow)
607++ {
608++ int cursor[2] = { pointerX, pointerY };
609++
610++ invertTransformedVertex (attrib, sTransform3,
611++ output, cursor);
612++
613++ if ((cursor[0] > 0) && (cursor[0] < (int) screen->width ()) &&
614++ (cursor[1] > 0) && (cursor[1] < (int) screen->height ()))
615++ {
616++ newCursor.setX (vpPos.x () * screen->width () + cursor[0]);
617++ newCursor.setY (vpPos.y () * screen->height () + cursor[1]);
618++
619++ if (anyClick || dndState != DnDNone)
620++ {
621++ /* Used to save last viewport interaction was in */
622++ selectedVp = vpPos;
623++ anyClick = false;
624++ }
625++ }
626++ }
627++
628++ /* Calculate the current viewport size */
629++ int tl[2] = { 0, 0 };
630++ int br[2] = { screen->width (), screen->height () };
631++
632++ invertTransformedVertex (attrib, sTransform3, output, tl);
633++ invertTransformedVertex (attrib, sTransform3, output, br);
634++
635++ viewport_size = CompSize (br[0] - tl[0], br[1] - tl[1]);
636++
637++ cScreen->setWindowPaintOffset (0, 0);
638++}
639++
640++void
641+ ExpoScreen::paintWall (const GLScreenPaintAttrib& attrib,
642+ const GLMatrix& transform,
643+ const CompRegion& region,
644+@@ -772,13 +1007,11 @@
645+ GLfloat vertexData[12];
646+ GLushort colorData[16];
647+ GLMatrix sTransformW, sTransform (transform);
648+- int i, j, vp;
649+ GLenum oldFilter = gScreen->textureFilter ();
650+-
651+- float sx = (float) screen->width () / output->width ();
652+- float sy = (float) screen->height () / output->height ();
653++ float sx = (float) screen->width () / output->width ();
654++ float sy = (float) screen->height () / output->height ();
655+ float biasZ;
656+- float oScale, rotation = 0.0f, progress, vpp;
657++ float oScale, rotation = 0.0f, progress;
658+ float aspectX = 1.0f, aspectY = 1.0f;
659+ GLVector cam;
660+ CompPoint vpSize (screen->vpSize ().width (), screen->vpSize ().height ());
661+@@ -910,9 +1143,24 @@
662+ sTransform.rotate (rotation, 0.0f, 1.0f, 0.0f);
663+ sTransform.scale (aspectX, aspectY, 1.0);
664+
665++ CompPoint offsetInScreenCoords (optionGetXOffset (),
666++ optionGetYOffset ());
667++ float offsetInWorldCoordX, offsetInWorldCoordY, worldScaleFactorX, worldScaleFactorY;
668++
669++ compiz::expo::calculateWallOffset (*output,
670++ offsetInScreenCoords,
671++ vpSize,
672++ *screen,
673++ offsetInWorldCoordX,
674++ offsetInWorldCoordY,
675++ worldScaleFactorX,
676++ worldScaleFactorY,
677++ sigmoidProgress (expoCam));
678++
679+ /* translate expo to center */
680+- sTransform.translate (vpSize.x () * sx * -0.5,
681+- vpSize.y () * sy * 0.5, 0.0f);
682++ sTransform.translate (vpSize.x () * sx * -0.5 + offsetInWorldCoordX,
683++ vpSize.y () * sy * 0.5 - offsetInWorldCoordY, 0.0f);
684++ sTransform.scale (worldScaleFactorX, worldScaleFactorY, 1.0f);
685+
686+ if (optionGetDeform () == DeformCurve)
687+ sTransform.translate ((vpSize.x () - 1) * sx * 0.5, 0.0, 0.0);
688+@@ -936,90 +1184,29 @@
689+
690+ expoActive = true;
691+
692+- for (j = 0; j < vpSize.y (); j++)
693+- {
694+- GLMatrix sTransform2 (sTransform), sTransform3;
695+-
696+- for (i = 0; i < vpSize.x (); i++)
697+- {
698+- if (optionGetExpoAnimation () == ExpoAnimationVortex)
699+- sTransform2.rotate (360 * expoCam,
700+- 0.0f, 1.0f, 2.0f * expoCam);
701+-
702+- sTransform3 = sTransform2;
703+-
704+- sTransform3.translate (output->x () / output->width (),
705+- -output->y () / output->height (), 0.0);
706+-
707+- cScreen->setWindowPaintOffset ((screen->vp ().x () - i) *
708+- screen->width (),
709+- (screen->vp ().y () - j) *
710+- screen->height ());
711+-
712+- vp = (j * vpSize.x ()) + i;
713+-
714+- vpp = (expoCam * vpActivity[vp]) + (1 - expoCam);
715+- vpp = sigmoidProgress (vpp);
716+-
717+- vpBrightness = vpp + ((1.0 - vpp) *
718+- optionGetVpBrightness () / 100.0);
719+- vpSaturation = vpp + ((1.0 - vpp) *
720+- optionGetVpSaturation () / 100.0);
721++ for (int j = 0; j < screen->vpSize ().height (); j++)
722++ for (int i = 0; i < screen->vpSize().width (); i++)
723++ paintViewport (attrib, sTransform, region, output, mask, CompPoint (i, j), vpCamPos, reflection);
724+
725+- paintingVp.set (i, j);
726++ paintingDndWindow = true;
727+
728+- if (optionGetDeform () == DeformCurve)
729+- {
730+- float rotateX;
731+-
732+- sTransform3.translate (-vpCamPos[GLVector::x], 0.0f,
733+- curveDistance - DEFAULT_Z_CAMERA);
734+-
735+- rotateX = -i + interpolate (((float) vpSize.x () / 2.0) - 0.5,
736+- screen->vp ().x (), progress);
737+-
738+- sTransform3.rotate (curveAngle * rotateX, 0.0, 1.0, 0.0);
739+-
740+- sTransform3.translate (vpCamPos[GLVector::x], 0.0f,
741+- DEFAULT_Z_CAMERA - curveDistance);
742+- }
743+-
744+- gScreen->glPaintTransformedOutput (attrib, sTransform3,
745+- screen->region (), output,
746+- mask);
747+-
748+- if (!reflection)
749+- {
750+- int cursor[2] = { pointerX, pointerY };
751++ foreach (CompWindow *dndWindow, dndWindows)
752++ {
753++ CompPoint vp;
754+
755+- invertTransformedVertex (attrib, sTransform3,
756+- output, cursor);
757++ screen->viewportForGeometry (dndWindow->geometry (), vp);
758+
759+- if ((cursor[0] > 0) && (cursor[0] < (int) screen->width ()) &&
760+- (cursor[1] > 0) && (cursor[1] < (int) screen->height ()))
761+- {
762+- newCursor.setX (i * screen->width () + cursor[0]);
763+- newCursor.setY (j * screen->height () + cursor[1]);
764++ while (vp.x () < 0)
765++ vp.setX (screen->vpSize ().width () + vp.x ());
766+
767+- if (anyClick || dndState != DnDNone)
768+- {
769+- /* Used to save last viewport interaction was in */
770+- lastSelectedVp = selectedVp;
771+- selectedVp.set (i, j);
772+- anyClick = false;
773+- }
774+- }
775+- }
776++ while (vp.y () < 0)
777++ vp.setY (screen->vpSize ().height () + vp.y ());
778+
779+- /* not sure this will work with different resolutions */
780+- if (optionGetDeform () != DeformCurve)
781+- sTransform2.translate (sx + gapX, 0.0f, 0.0);
782+- }
783+-
784+- /* not sure this will work with different resolutions */
785+- sTransform.translate (0.0, -(sy + gapY), 0.0f);
786++ paintViewport (attrib, sTransform, infiniteRegion, output, mask, vp, vpCamPos, reflection);
787+ }
788+
789++ paintingDndWindow = false;
790++
791+ // glNormal3f (0.0, 0.0, -1.0);
792+
793+ if (reflection)
794+@@ -1187,12 +1374,16 @@
795+
796+ expoActive = false;
797+
798+- cScreen->setWindowPaintOffset (0, 0);
799+-
800+ gScreen->glPaintTransformedOutputSetCurrentIndex (glPaintTransformedOutputIndex);
801+ gScreen->setTextureFilter (oldFilter);
802+ }
803+
804++const CompWindowList &
805++ExpoScreen::getWindowPaintList ()
806++{
807++ return dndWindows;
808++}
809++
810+ bool
811+ ExpoScreen::glPaintOutput (const GLScreenPaintAttrib& attrib,
812+ const GLMatrix& transform,
813+@@ -1243,10 +1434,15 @@
814+
815+ bool
816+ ExpoWindow::glDraw (const GLMatrix& transform,
817+- const GLWindowPaintAttrib &attrib,
818++ const GLWindowPaintAttrib &attrib,
819+ const CompRegion& region,
820+ unsigned int mask)
821+ {
822++ GLMatrix wTransform (transform);
823++ CompPoint vp;
824++
825++ screen->viewportForGeometry (window->geometry (), vp);
826++
827+ if (eScreen->expoCam == 0.0f)
828+ return gWindow->glDraw (transform, attrib, region, mask);
829+
830+@@ -1275,8 +1471,11 @@
831+ }
832+ }
833+
834+- eAttrib.brightness = attrib.brightness * eScreen->vpBrightness;
835+- eAttrib.saturation = attrib.saturation * eScreen->vpSaturation;
836++ if ((vp == eScreen->paintingVp || window->onAllViewports ()) && !eScreen->paintingDndWindow)
837++ {
838++ eAttrib.brightness = attrib.brightness * eScreen->vpBrightness;
839++ eAttrib.saturation = attrib.saturation * eScreen->vpSaturation;
840++ }
841+ }
842+ else
843+ {
844+@@ -1287,7 +1486,79 @@
845+ (1 - sigmoidProgress (eScreen->expoCam));
846+ }
847+
848+- return gWindow->glDraw (transform, eAttrib, region, mask);
849++ bool status = gWindow->glDraw (transform, eAttrib, region, mask);
850++
851++ if (window->type () & CompWindowTypeDesktopMask)
852++ {
853++ /* We want to set the geometry of the polka dots to the window
854++ * region */
855++ CompRegion reg = CompRegion (0, 0, window->width (), window->height ());
856++
857++ foreach(GLTexture * tex, eScreen->polkadots_texture)
858++ {
859++ GLTexture::MatrixList matl;
860++ GLTexture::Matrix mat = tex->matrix();
861++ CompRegion paintRegion(region);
862++
863++ float xScale = screen->width () / (float) eScreen->viewport_size.width ();
864++ float yScale = screen->height () / (float) eScreen->viewport_size.height ();
865++
866++ mat.xx *= xScale;
867++ mat.yy *= yScale;
868++
869++ /* Not sure what this does, but it is necessary
870++ * (adjusts for scale?) */
871++ mat.x0 -= mat.xx * reg.boundingRect().x1();
872++ mat.y0 -= mat.yy * reg.boundingRect().y1();
873++
874++ matl.push_back(mat);
875++
876++ if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
877++ paintRegion = infiniteRegion;
878++
879++ /* Now allow plugins to mess with the geometry of our
880++ * dim (so we get a nice render for things like
881++ * wobbly etc etc */
882++ gWindow->vertexBuffer ()->begin ();
883++ gWindow->glAddGeometry (matl, reg, paintRegion);
884++ if (gWindow->vertexBuffer ()->end ())
885++ {
886++ unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex ();
887++ eAttrib.opacity = attrib.opacity * (((1.0 - eScreen->vpBrightness) + (1.0 - eScreen->vpSaturation) / 2.0));
888++ /* Texture rendering set-up */
889++ //eScreen->gScreen->setTexEnvMode(GL_MODULATE);
890++ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
891++ /* Draw the dim texture with all of it's modified
892++ * geometry glory */
893++ gWindow->glDrawTextureSetCurrentIndex (MAXSHORT);
894++ gWindow->glDrawTexture (tex, transform, eAttrib, mask |
895++ PAINT_WINDOW_BLEND_MASK |
896++ PAINT_WINDOW_TRANSLUCENT_MASK |
897++ PAINT_WINDOW_TRANSFORMED_MASK);
898++ gWindow->glDrawTextureSetCurrentIndex (glDrawTextureIndex);
899++ /* Texture rendering tear-down */
900++ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
901++ eScreen->gScreen->setTexEnvMode (GL_REPLACE);
902++ }
903++ }
904++
905++ /* Paint the outline */
906++ if (mGlowQuads && eScreen->paintingVp == eScreen->selectedVp)
907++ {
908++ if (region.numRects ())
909++ {
910++ /* reset geometry and paint */
911++ gWindow->vertexBuffer ()->begin ();
912++ gWindow->vertexBuffer ()->end ();
913++
914++ paintGlow (transform, attrib, infiniteRegion, mask);
915++ }
916++ }
917++
918++ }
919++
920++ return status;
921++
922+ }
923+
924+ #define EXPO_GRID_SIZE 100
925+@@ -1425,11 +1696,17 @@
926+ const CompRegion& region,
927+ unsigned int mask)
928+ {
929++ GLMatrix wTransform (transform);
930++ GLWindowPaintAttrib wAttrib (attrib);
931++ CompRegion clip (region);
932++
933+ if (eScreen->expoActive)
934+ {
935+ float opacity = 1.0;
936+ bool hide;
937+ bool zoomAnim;
938++ CompPoint vp;
939++ screen->viewportForGeometry (window->geometry (), vp);
940+
941+ zoomAnim = eScreen->optionGetExpoAnimation () ==
942+ ExpoScreen::ExpoAnimationZoom;
943+@@ -1458,9 +1735,47 @@
944+
945+ if (opacity <= 0)
946+ mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
947++ else
948++ wAttrib.opacity = wAttrib.opacity * opacity;
949++
950++ /* Stretch maximized windows a little so that you don't
951++ * have an awkward gap */
952++
953++ if (window->state () & MAXIMIZE_STATE &&
954++ !window->border ().top)
955++ {
956++ CompOutput *o = &screen->outputDevs ()[screen->outputDeviceForGeometry(window->geometry())];
957++ float yS = 1.0 + ((o->height () / (float) window->height ()) - 1.0f) * sigmoidProgress (eScreen->expoCam);
958++ float xS = 1.0 + ((o->width () / (float) window->width ()) - 1.0f) * sigmoidProgress (eScreen->expoCam);
959++ wTransform.translate (window->x () + window->width (),
960++ window->y () + window->height (),
961++ 0.0f);
962++ wTransform.scale (xS, yS, 1.0f);
963++ wTransform.translate (-(window->x () + window->width ()),
964++ -(window->y () + window->height ()),
965++ 0.0f);
966++
967++ if (eScreen->paintingVp != vp)
968++ mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
969++
970++ mask |= PAINT_WINDOW_TRANSFORMED_MASK;
971++ }
972++
973++ if (std::find (eScreen->dndWindows.begin(), eScreen->dndWindows.end (), window) != eScreen->dndWindows.end ())
974++ {
975++ if (!eScreen->paintingDndWindow)
976++ {
977++ mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
978++ }
979++ else
980++ {
981++ mask |= PAINT_WINDOW_TRANSFORMED_MASK;
982++ clip = infiniteRegion;
983++ }
984++ }
985+ }
986+
987+- return gWindow->glPaint (attrib, transform, region, mask);
988++ return gWindow->glPaint (wAttrib, wTransform, clip, mask);
989+ }
990+
991+ bool
992+@@ -1489,7 +1804,7 @@
993+ expoActive (false),
994+ expoMode (false),
995+ dndState (DnDNone),
996+- dndWindow (NULL),
997++ dndWindows (0),
998+ origVp (s->vp ()),
999+ selectedVp (s->vp ()),
1000+ lastSelectedVp (s->vp ()),
1001+@@ -1497,14 +1812,21 @@
1002+ clickTime (0),
1003+ doubleClick (false),
1004+ vpNormals (360 * 3),
1005+- grabIndex (0)
1006+-{
1007++ grabIndex (0),
1008++ paintingDndWindow (false),
1009++ mGlowTextureProperties (&glowTextureProperties)
1010++{
1011++ CompString fname;
1012++ CompString pname = "expo";
1013++ CompSize size;
1014++
1015++
1016+ leftKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Left"));
1017+ rightKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Right"));
1018+ upKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Up"));
1019+ downKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Down"));
1020+
1021+- dragCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
1022++ mMoveCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
1023+
1024+ EXPOINITBIND (ExpoKey, doExpo);
1025+ EXPOTERMBIND (ExpoKey, termExpo);
1026+@@ -1522,12 +1844,58 @@
1027+ ScreenInterface::setHandler (screen, false);
1028+ CompositeScreenInterface::setHandler (cScreen, false);
1029+ GLScreenInterface::setHandler (gScreen, false);
1030++
1031++ outline_texture = GLTexture::imageDataToTexture (mGlowTextureProperties->textureData,
1032++ CompSize (mGlowTextureProperties->textureSize,
1033++ mGlowTextureProperties->textureSize),
1034++ GL_RGBA, GL_UNSIGNED_BYTE);
1035++ fname = "texture_tile.png";
1036++ polkadots_texture = GLTexture::readImageToTexture (fname, pname, polkadots_texture_size);
1037++
1038++ if (polkadots_texture.empty ())
1039++ compLogMessage ("expo", CompLogLevelWarn, "failed to bind image to texture");
1040++ else
1041++ {
1042++ foreach (GLTexture *tex, polkadots_texture)
1043++ {
1044++ tex->enable (GLTexture::Good);
1045++ glTexParameteri (tex->target (), GL_TEXTURE_WRAP_S, GL_REPEAT);
1046++ glTexParameteri (tex->target (), GL_TEXTURE_WRAP_T, GL_REPEAT);
1047++ tex->disable ();
1048++ }
1049++ }
1050+ }
1051+
1052+ ExpoScreen::~ExpoScreen ()
1053+ {
1054+- if (dragCursor != None)
1055+- XFreeCursor (screen->dpy (), dragCursor);
1056++ if (mMoveCursor)
1057++ XFreeCursor (screen->dpy (), mMoveCursor);
1058++}
1059++
1060++void
1061++ExpoWindow::moveNotify (int dx, int dy, bool immediate)
1062++{
1063++ window->moveNotify (dx, dy, immediate);
1064++
1065++ if (!ExpoScreen::get (screen)->expoActive)
1066++ return;
1067++
1068++ updateViewportActiveStates (screen);
1069++}
1070++
1071++void
1072++ExpoWindow::resizeNotify(int dx, int dy, int dw, int dh)
1073++{
1074++ window->resizeNotify (dx, dy, dw, dh);
1075++
1076++ /* mGlowQuads contains positional info, so we need to recalc that */
1077++ if (mGlowQuads)
1078++ {
1079++ /* FIXME: we need to find a more multitexture friendly way
1080++ * of doing this */
1081++ GLTexture::Matrix tMat = eScreen->outline_texture.at (0)->matrix ();
1082++ computeGlowQuads (&tMat);
1083++ }
1084+ }
1085+
1086+ ExpoWindow::ExpoWindow (CompWindow *w) :
1087+@@ -1535,10 +1903,28 @@
1088+ window (w),
1089+ cWindow (CompositeWindow::get (w)),
1090+ gWindow (GLWindow::get (w)),
1091+- eScreen (ExpoScreen::get (screen))
1092++ eScreen (ExpoScreen::get (screen)),
1093++ dndOpacity (0.0f),
1094++ mGlowQuads (NULL)
1095+ {
1096+ CompositeWindowInterface::setHandler (cWindow, false);
1097+ GLWindowInterface::setHandler (gWindow, false);
1098++ WindowInterface::setHandler (window, true);
1099++
1100++ if (window->type () & CompWindowTypeDesktopMask)
1101++ {
1102++ foreach (GLTexture *tex, eScreen->outline_texture)
1103++ {
1104++ GLTexture::Matrix mat = tex->matrix ();
1105++ computeGlowQuads (&mat);
1106++ }
1107++ }
1108++}
1109++
1110++ExpoWindow::~ExpoWindow ()
1111++{
1112++ eScreen->dndWindows.remove (window);
1113++ computeGlowQuads (NULL);
1114+ }
1115+
1116+ bool
1117+Index: ubuntu/plugins/expo/src/expo.h
1118+===================================================================
1119+--- ubuntu.orig/plugins/expo/src/expo.h 2012-09-08 17:26:40.599035911 +0800
1120++++ ubuntu/plugins/expo/src/expo.h 2012-09-12 22:20:43.276760475 +0800
1121+@@ -30,6 +30,44 @@
1122+ #include <opengl/opengl.h>
1123+
1124+ #include "expo_options.h"
1125++#include "glow.h"
1126++#include "viewport-member-window.h"
1127++#include "client-list-generator.h"
1128++
1129++#define WIN_REAL_X(w) (w->x () - w->border ().left)
1130++#define WIN_REAL_Y(w) (w->y () - w->border ().top)
1131++#define WIN_REAL_WIDTH(w) (w->width () + 2 * w->geometry ().border () + \
1132++ w->border ().left + w->border ().right)
1133++#define WIN_REAL_HEIGHT(w) (w->height () + 2 * w->geometry ().border () + \
1134++ w->border ().top + w->border ().bottom)
1135++
1136++namespace compiz
1137++{
1138++ namespace expo
1139++ {
1140++ namespace impl
1141++ {
1142++ namespace ce = compiz::expo;
1143++
1144++ class CompizClientListGenerator :
1145++ public ce::ClientListGenerator
1146++ {
1147++ public:
1148++
1149++ CompizClientListGenerator (CompScreen *screen);
1150++
1151++ void refreshClientList ();
1152++ ViewportMemberWindow * nextClient ();
1153++
1154++ private:
1155++
1156++ CompScreen *mScreen;
1157++ const CompWindowVector *mClientList;
1158++ CompWindowVector::const_iterator mClientListIterator;
1159++ };
1160++ }
1161++ }
1162++}
1163+
1164+ class ExpoScreen :
1165+ public ScreenInterface,
1166+@@ -51,8 +89,10 @@
1167+ bool glPaintOutput (const GLScreenPaintAttrib&, const GLMatrix&,
1168+ const CompRegion&, CompOutput *, unsigned int);
1169+ void glPaintTransformedOutput (const GLScreenPaintAttrib&,
1170+- const GLMatrix&, const CompRegion&,
1171+- CompOutput *, unsigned int);
1172++ const GLMatrix&, const CompRegion&,
1173++ CompOutput*, unsigned int);
1174++
1175++ const CompWindowList & getWindowPaintList ();
1176+
1177+ bool dndInit (CompAction *, CompAction::State, CompOption::Vector&);
1178+ bool dndFini (CompAction *, CompAction::State, CompOption::Vector&);
1179+@@ -62,6 +102,8 @@
1180+ bool nextVp (CompAction *, CompAction::State, CompOption::Vector&);
1181+ bool prevVp (CompAction *, CompAction::State, CompOption::Vector&);
1182+
1183++ CompPoint currentViewport ();
1184++
1185+ typedef enum {
1186+ DnDNone,
1187+ DnDDuring,
1188+@@ -82,7 +124,7 @@
1189+ bool expoMode;
1190+
1191+ DnDState dndState;
1192+- CompWindow *dndWindow;
1193++ CompWindowList dndWindows;
1194+
1195+ CompPoint prevCursor;
1196+ CompPoint newCursor;
1197+@@ -94,6 +136,7 @@
1198+ CompPoint paintingVp;
1199+
1200+ std::vector<float> vpActivity;
1201++ std::vector<bool> vpActive;
1202+ float vpBrightness;
1203+ float vpSaturation;
1204+
1205+@@ -113,6 +156,17 @@
1206+
1207+ CompScreen::GrabHandle grabIndex;
1208+
1209++ GLTexture::List polkadots_texture;
1210++ CompSize polkadots_texture_size;
1211++ CompSize viewport_size;
1212++
1213++ GLTexture::List outline_texture;
1214++ CompSize outline_texture_size;
1215++
1216++ bool paintingDndWindow;
1217++
1218++ const GlowTextureProperties *mGlowTextureProperties;
1219++
1220+ private:
1221+ void moveFocusViewport (int, int);
1222+ void finishWindowMovement ();
1223+@@ -123,24 +177,45 @@
1224+ void paintWall (const GLScreenPaintAttrib&, const GLMatrix&,
1225+ const CompRegion&, CompOutput *, unsigned int, bool);
1226+
1227++ void paintViewport (const GLScreenPaintAttrib& attrib,
1228++ const GLMatrix& transform,
1229++ const CompRegion& region,
1230++ CompOutput *output,
1231++ unsigned int mask,
1232++ CompPoint vpPos,
1233++ GLVector &vpCamPos,
1234++ bool reflection);
1235++
1236++ bool windowsOnVp (compiz::expo::ClientListGenerator &clientList,
1237++ CompPoint &p,
1238++ const CompPoint &unprojectedCursor,
1239++ const CompSize &screenSize,
1240++ CompScreen *screen);
1241++
1242+ KeyCode leftKey;
1243+ KeyCode rightKey;
1244+ KeyCode upKey;
1245+ KeyCode downKey;
1246+
1247+- Cursor dragCursor;
1248++ Cursor mMoveCursor;
1249+ };
1250+
1251+ class ExpoWindow :
1252++ public compiz::expo::ViewportMemberWindow,
1253+ public CompositeWindowInterface,
1254+ public GLWindowInterface,
1255++ public WindowInterface,
1256+ public PluginClassHandler<ExpoWindow, CompWindow>
1257+ {
1258+ public:
1259+ ExpoWindow (CompWindow *);
1260++ ~ExpoWindow ();
1261+
1262+ bool damageRect (bool, const CompRect&);
1263+
1264++ void resizeNotify (int dx, int dy, int dw, int dh);
1265++ void moveNotify (int dx, int dy, bool immediate);
1266++
1267+ bool glDraw (const GLMatrix&, const GLWindowPaintAttrib&,
1268+ const CompRegion&, unsigned int);
1269+ bool glPaint (const GLWindowPaintAttrib&, const GLMatrix&,
1270+@@ -150,11 +225,31 @@
1271+ unsigned int, unsigned int);
1272+ void glDrawTexture (GLTexture*, const GLMatrix&,
1273+ const GLWindowPaintAttrib&, unsigned int);
1274++ void
1275++ paintGlow (const GLMatrix &transform,
1276++ const GLWindowPaintAttrib &attrib,
1277++ const CompRegion &paintRegion,
1278++ unsigned int mask);
1279++
1280++ void
1281++ computeGlowQuads (GLTexture::Matrix *matrix);
1282+
1283+ CompWindow *window;
1284+ CompositeWindow *cWindow;
1285+ GLWindow *gWindow;
1286+ ExpoScreen *eScreen;
1287++
1288++ float dndOpacity;
1289++
1290++ GlowQuad *mGlowQuads;
1291++
1292++ private:
1293++
1294++ bool isDesktopOrDock () const;
1295++ bool dragged () const;
1296++ const compiz::window::Geometry & absoluteGeometry () const;
1297++
1298++ mutable compiz::window::Geometry mAbsoluteGeometry;
1299+ };
1300+
1301+ class ExpoPluginVTable :
1302+Index: ubuntu/plugins/expo/src/glow.cpp
1303+===================================================================
1304+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
1305++++ ubuntu/plugins/expo/src/glow.cpp 2012-09-12 22:20:43.280760497 +0800
1306+@@ -0,0 +1,429 @@
1307++/**
1308++ *
1309++ * Compiz group plugin
1310++ *
1311++ * glow.cpp
1312++ *
1313++ * Copyright : (C) 2006-2010 by Patrick Niklaus, Roi Cohen,
1314++ * Danny Baumann, Sam Spilsbury
1315++ * Authors: Patrick Niklaus <patrick.niklaus@googlemail.com>
1316++ * Roi Cohen <roico.beryl@gmail.com>
1317++ * Danny Baumann <maniac@opencompositing.org>
1318++ * Sam Spilsbury <smspillaz@gmail.com>
1319++ *
1320++ *
1321++ * This program is free software; you can redistribute it and/or
1322++ * modify it under the terms of the GNU General Public License
1323++ * as published by the Free Software Foundation; either version 2
1324++ * of the License, or (at your option) any later version.
1325++ *
1326++ * This program is distributed in the hope that it will be useful,
1327++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1328++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1329++ * GNU General Public License for more details.
1330++ *
1331++ **/
1332++
1333++#include "expo.h"
1334++#include "group_glow.h"
1335++
1336++const GlowTextureProperties glowTextureProperties = {
1337++ /* GlowTextureRectangular */
1338++ glowTexRect, 32, 21
1339++};
1340++
1341++/*
1342++ * GroupWindow::paintGlow
1343++ *
1344++ * Takes our glow texture, stretches the appropriate positions in the glow texture,
1345++ * adds those geometries (so plugins like wobby and deform this texture correctly)
1346++ * and then draws the glow texture with this geometry (plugins like wobbly and friends
1347++ * will automatically deform the texture based on our set geometry)
1348++ */
1349++
1350++void
1351++ExpoWindow::paintGlow (const GLMatrix &transform,
1352++ const GLWindowPaintAttrib &attrib,
1353++ const CompRegion &paintRegion,
1354++ unsigned int mask)
1355++{
1356++ CompRegion reg;
1357++ int i;
1358++ GLushort colorData[4];
1359++ const GLushort *selColorData = ExpoScreen::get (screen)->optionGetSelectedColor ();
1360++ float alpha = (float) selColorData[3] / 65535.0f;
1361++
1362++ /* Premultiply color */
1363++ colorData[0] = selColorData[0] * alpha;
1364++ colorData[1] = selColorData[1] * alpha;
1365++ colorData[2] = selColorData[2] * alpha;
1366++ colorData[3] = selColorData[3];
1367++
1368++ gWindow->vertexBuffer ()->begin ();
1369++
1370++ /* There are 8 glow parts of the glow texture which we wish to paint
1371++ * separately with different transformations
1372++ */
1373++ for (i = 0; i < NUM_GLOWQUADS; i++)
1374++ {
1375++ /* Using precalculated quads here */
1376++ reg = CompRegion (mGlowQuads[i].mBox);
1377++
1378++ if (reg.boundingRect ().x1 () < reg.boundingRect ().x2 () &&
1379++ reg.boundingRect ().y1 () < reg.boundingRect ().y2 ())
1380++ {
1381++ GLTexture::MatrixList matl;
1382++ reg = CompRegion (reg.boundingRect ().x1 (),
1383++ reg.boundingRect ().y1 (),
1384++ reg.boundingRect ().width (),
1385++ reg.boundingRect ().height ());
1386++
1387++ matl.push_back (mGlowQuads[i].mMatrix);
1388++ /* Add color data for all 6 vertices of the quad */
1389++ for (int n = 0; n < 6; n++)
1390++ gWindow->vertexBuffer ()->addColors (1, colorData);
1391++ gWindow->glAddGeometry (matl, reg, paintRegion);
1392++ }
1393++ }
1394++
1395++ if (gWindow->vertexBuffer ()->end ())
1396++ {
1397++ //GLScreen::get (screen)->setTexEnvMode (GL_MODULATE);
1398++ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1399++
1400++ /* we use PAINT_WINDOW_TRANSFORMED_MASK here to force
1401++ the usage of a good texture filter */
1402++ foreach (GLTexture *tex, ExpoScreen::get (screen)->outline_texture)
1403++ {
1404++ gWindow->glDrawTexture (tex, transform, attrib, mask |
1405++ PAINT_WINDOW_BLEND_MASK |
1406++ PAINT_WINDOW_TRANSLUCENT_MASK |
1407++ PAINT_WINDOW_TRANSFORMED_MASK);
1408++ }
1409++
1410++ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
1411++ GLScreen::get (screen)->setTexEnvMode (GL_REPLACE);
1412++ }
1413++}
1414++
1415++/*
1416++ * ExpoWindow::computeGlowQuads
1417++ *
1418++ * This function computures the matrix transformation required for each
1419++ * part of the glow texture which we wish to stretch to some rectangular
1420++ * dimentions
1421++ *
1422++ * There are eight quads different parts of the texture which we wish to
1423++ * paint here, the 4 sides and four corners, eg:
1424++ *
1425++ * ------------------
1426++ * | 1 | 4 | 6 |
1427++ * ------------- ------------------
1428++ * | 1 | 4 | 6 | | | | |
1429++ * ------------- | | | |
1430++ * | 2 | n | 7 | -> | 2 | n | 7 |
1431++ * ------------- | | | |
1432++ * | 3 | 5 | 8 | | | | |
1433++ * ------------- ------------------
1434++ * | 3 | 5 | 8 |
1435++ * ------------------
1436++ *
1437++ * In this example here, 2, 4, 5 and 7 are stretched, and the matrices for
1438++ * each quad rect adjusted accordingly for it's size compared to the original
1439++ * texture size.
1440++ *
1441++ * When we are adjusting the matrices here, the initial size of each corner has
1442++ * a size of of "1.0f", so according to 2x2 matrix rules,
1443++ * the scale factor is the inverse of the size of the glow (which explains
1444++ * while you will see here that matrix->xx is (1 / glowSize)
1445++ * where glowSize is the size the user specifies they want their glow to extend.
1446++ * (likewise, matrix->yy is adjusted similarly for corners and for top/bottom)
1447++ *
1448++ * matrix->x0 and matrix->y0 here are set to be the top left edge of the rect
1449++ * adjusted by the matrix scale factor (matrix->xx and matrix->yy)
1450++ *
1451++ */
1452++void
1453++ExpoWindow::computeGlowQuads (GLTexture::Matrix *matrix)
1454++{
1455++ CompRect *box;
1456++ int x1, x2, y1, y2;
1457++ GLTexture::Matrix *quadMatrix;
1458++ int glowSize, glowOffset;
1459++ CompWindow *w = window;
1460++
1461++ /* Passing NULL to this function frees the glow quads
1462++ * (so the window is not painted with glow) */
1463++
1464++ if (matrix)
1465++ {
1466++ if (!mGlowQuads)
1467++ mGlowQuads = new GlowQuad[NUM_GLOWQUADS];
1468++ if (!mGlowQuads)
1469++ return;
1470++ }
1471++ else
1472++ {
1473++ if (mGlowQuads)
1474++ {
1475++ delete[] mGlowQuads;
1476++ mGlowQuads = NULL;
1477++ }
1478++ return;
1479++ }
1480++
1481++ glowSize = 48;
1482++ glowOffset = (glowSize * ExpoScreen::get (screen)->mGlowTextureProperties->glowOffset /
1483++ ExpoScreen::get (screen)->mGlowTextureProperties->textureSize) + 1;
1484++
1485++ /* Top left corner */
1486++ box = &mGlowQuads[GLOWQUAD_TOPLEFT].mBox;
1487++ mGlowQuads[GLOWQUAD_TOPLEFT].mMatrix = *matrix;
1488++ quadMatrix = &mGlowQuads[GLOWQUAD_TOPLEFT].mMatrix;
1489++
1490++ /* Set the desired rect dimentions
1491++ * for the part of the glow we are painting */
1492++
1493++ x1 = WIN_REAL_X (w) - glowSize + glowOffset;
1494++ y1 = WIN_REAL_Y (w) - glowSize + glowOffset;
1495++
1496++ /* 2x2 Matrix here, adjust both x and y scale factors
1497++ * and the x and y position
1498++ *
1499++ * Scaling both parts of the texture in a positive direction
1500++ * here (left to right top to bottom)
1501++ *
1502++ * The base position (x0 and y0) here requires us to move backwards
1503++ * on the x and y dimentions by the calculated rect dimentions
1504++ * multiplied by the scale factors
1505++ */
1506++
1507++ quadMatrix->xx = 1.0f / glowSize;
1508++ quadMatrix->yy = 1.0f / (glowSize);
1509++ quadMatrix->x0 = -(x1 * quadMatrix->xx);
1510++ quadMatrix->y0 = -(y1 * quadMatrix->yy);
1511++
1512++ x2 = MIN (WIN_REAL_X (w) + glowOffset,
1513++ WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2));
1514++ y2 = MIN (WIN_REAL_Y (w) + glowOffset,
1515++ WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2));
1516++
1517++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
1518++
1519++ /* Top right corner */
1520++ box = &mGlowQuads[GLOWQUAD_TOPRIGHT].mBox;
1521++ mGlowQuads[GLOWQUAD_TOPRIGHT].mMatrix = *matrix;
1522++ quadMatrix = &mGlowQuads[GLOWQUAD_TOPRIGHT].mMatrix;
1523++
1524++ /* Set the desired rect dimentions
1525++ * for the part of the glow we are painting */
1526++
1527++ x1 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
1528++ y1 = WIN_REAL_Y (w) - glowSize + glowOffset;
1529++ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) + glowSize - glowOffset;
1530++
1531++ /* 2x2 Matrix here, adjust both x and y scale factors
1532++ * and the x and y position
1533++ *
1534++ * Scaling the y part of the texture in a positive direction
1535++ * and the x part in a negative direction here
1536++ * (right to left top to bottom)
1537++ *
1538++ * The base position (x0 and y0) here requires us to move backwards
1539++ * on the y dimention and forwards on x by the calculated rect dimentions
1540++ * multiplied by the scale factors (since we are moving forward on x we
1541++ * need the inverse of that which is 1 - x1 * xx
1542++ */
1543++
1544++ quadMatrix->xx = -1.0f / glowSize;
1545++ quadMatrix->yy = 1.0f / glowSize;
1546++ quadMatrix->x0 = 1.0 - (x1 * quadMatrix->xx);
1547++ quadMatrix->y0 = -(y1 * quadMatrix->yy);
1548++
1549++ x1 = MAX (WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset,
1550++ WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2));
1551++ y2 = MIN (WIN_REAL_Y (w) + glowOffset,
1552++ WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2));
1553++
1554++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
1555++
1556++ /* Bottom left corner */
1557++ box = &mGlowQuads[GLOWQUAD_BOTTOMLEFT].mBox;
1558++ mGlowQuads[GLOWQUAD_BOTTOMLEFT].mMatrix = *matrix;
1559++ quadMatrix = &mGlowQuads[GLOWQUAD_BOTTOMLEFT].mMatrix;
1560++
1561++ x1 = WIN_REAL_X (w) - glowSize + glowOffset;
1562++ y1 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
1563++ x2 = WIN_REAL_X (w) + glowOffset;
1564++ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) + glowSize - glowOffset;
1565++
1566++ /* 2x2 Matrix here, adjust both x and y scale factors
1567++ * and the x and y position
1568++ *
1569++ * Scaling the x part of the texture in a positive direction
1570++ * and the y part in a negative direction here
1571++ * (left to right bottom to top)
1572++ *
1573++ * The base position (x0 and y0) here requires us to move backwards
1574++ * on the x dimention and forwards on y by the calculated rect dimentions
1575++ * multiplied by the scale factors (since we are moving forward on x we
1576++ * need the inverse of that which is 1 - y1 * yy
1577++ */
1578++
1579++ quadMatrix->xx = 1.0f / glowSize;
1580++ quadMatrix->yy = -1.0f / glowSize;
1581++ quadMatrix->x0 = -(x1 * quadMatrix->xx);
1582++ quadMatrix->y0 = 1.0f - (y1 * quadMatrix->yy);
1583++
1584++ y1 = MAX (WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset,
1585++ WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2));
1586++ x2 = MIN (WIN_REAL_X (w) + glowOffset,
1587++ WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2));
1588++
1589++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
1590++
1591++ /* Bottom right corner */
1592++ box = &mGlowQuads[GLOWQUAD_BOTTOMRIGHT].mBox;
1593++ mGlowQuads[GLOWQUAD_BOTTOMRIGHT].mMatrix = *matrix;
1594++ quadMatrix = &mGlowQuads[GLOWQUAD_BOTTOMRIGHT].mMatrix;
1595++
1596++ x1 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
1597++ y1 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
1598++ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) + glowSize - glowOffset;
1599++ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) + glowSize - glowOffset;
1600++
1601++ /* 2x2 Matrix here, adjust both x and y scale factors
1602++ * and the x and y position
1603++ *
1604++ * Scaling the both parts of the texture in a negative direction
1605++ * (right to left bottom to top)
1606++ *
1607++ * The base position (x0 and y0) here requires us to move forwards
1608++ * on both dimentions by the calculated rect dimentions
1609++ * multiplied by the scale factors
1610++ */
1611++
1612++ quadMatrix->xx = -1.0f / glowSize;
1613++ quadMatrix->yy = -1.0f / glowSize;
1614++ quadMatrix->x0 = 1.0 - (x1 * quadMatrix->xx);
1615++ quadMatrix->y0 = 1.0 - (y1 * quadMatrix->yy);
1616++
1617++ x1 = MAX (WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset,
1618++ WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2));
1619++ y1 = MAX (WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset,
1620++ WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2));
1621++
1622++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
1623++
1624++ /* Top edge */
1625++ box = &mGlowQuads[GLOWQUAD_TOP].mBox;
1626++ mGlowQuads[GLOWQUAD_TOP].mMatrix = *matrix;
1627++ quadMatrix = &mGlowQuads[GLOWQUAD_TOP].mMatrix;
1628++
1629++ x1 = WIN_REAL_X (w) + glowOffset;
1630++ y1 = WIN_REAL_Y (w) - glowSize + glowOffset;
1631++ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
1632++ y2 = WIN_REAL_Y (w) + glowOffset;
1633++
1634++ /* 2x2 Matrix here, adjust both x and y scale factors
1635++ * and the x and y position
1636++ *
1637++ * No need to scale the x part of the texture here, but we
1638++ * are scaling on the y part in a positive direciton
1639++ *
1640++ * The base position (y0) here requires us to move backwards
1641++ * on the x dimention and forwards on y by the calculated rect dimentions
1642++ * multiplied by the scale factors
1643++ */
1644++
1645++ quadMatrix->xx = 0.0f;
1646++ quadMatrix->yy = 1.0f / glowSize;
1647++ quadMatrix->x0 = 1.0;
1648++ quadMatrix->y0 = -(y1 * quadMatrix->yy);
1649++
1650++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
1651++
1652++ /* Bottom edge */
1653++ box = &mGlowQuads[GLOWQUAD_BOTTOM].mBox;
1654++ mGlowQuads[GLOWQUAD_BOTTOM].mMatrix = *matrix;
1655++ quadMatrix = &mGlowQuads[GLOWQUAD_BOTTOM].mMatrix;
1656++
1657++ x1 = WIN_REAL_X (w) + glowOffset;
1658++ y1 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
1659++ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
1660++ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) + glowSize - glowOffset;
1661++
1662++ /* 2x2 Matrix here, adjust both x and y scale factors
1663++ * and the x and y position
1664++ *
1665++ * No need to scale the x part of the texture here, but we
1666++ * are scaling on the y part in a negative direciton
1667++ *
1668++ * The base position (y0) here requires us to move forwards
1669++ * on y by the calculated rect dimentions
1670++ * multiplied by the scale factors
1671++ */
1672++
1673++ quadMatrix->xx = 0.0f;
1674++ quadMatrix->yy = -1.0f / glowSize;
1675++ quadMatrix->x0 = 1.0;
1676++ quadMatrix->y0 = 1.0 - (y1 * quadMatrix->yy);
1677++
1678++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
1679++
1680++ /* Left edge */
1681++ box = &mGlowQuads[GLOWQUAD_LEFT].mBox;
1682++ mGlowQuads[GLOWQUAD_LEFT].mMatrix = *matrix;
1683++ quadMatrix = &mGlowQuads[GLOWQUAD_LEFT].mMatrix;
1684++
1685++ x1 = WIN_REAL_X (w) - glowSize + glowOffset;
1686++ y1 = WIN_REAL_Y (w) + glowOffset;
1687++ x2 = WIN_REAL_X (w) + glowOffset;
1688++ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
1689++
1690++ /* 2x2 Matrix here, adjust both x and y scale factors
1691++ * and the x and y position
1692++ *
1693++ * No need to scale the y part of the texture here, but we
1694++ * are scaling on the x part in a positive direciton
1695++ *
1696++ * The base position (x0) here requires us to move backwards
1697++ * on x by the calculated rect dimentions
1698++ * multiplied by the scale factors
1699++ */
1700++
1701++ quadMatrix->xx = 1.0f / glowSize;
1702++ quadMatrix->yy = 0.0f;
1703++ quadMatrix->x0 = -(x1 * quadMatrix->xx);
1704++ quadMatrix->y0 = 1.0;
1705++
1706++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
1707++
1708++ /* Right edge */
1709++ box = &mGlowQuads[GLOWQUAD_RIGHT].mBox;
1710++ mGlowQuads[GLOWQUAD_RIGHT].mMatrix = *matrix;
1711++ quadMatrix = &mGlowQuads[GLOWQUAD_RIGHT].mMatrix;
1712++
1713++ x1 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
1714++ y1 = WIN_REAL_Y (w) + glowOffset;
1715++ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) + glowSize - glowOffset;
1716++ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
1717++
1718++ /* 2x2 Matrix here, adjust both x and y scale factors
1719++ * and the x and y position
1720++ *
1721++ * No need to scale the y part of the texture here, but we
1722++ * are scaling on the x part in a negative direciton
1723++ *
1724++ * The base position (x0) here requires us to move forwards
1725++ * on x by the calculated rect dimentions
1726++ * multiplied by the scale factors
1727++ */
1728++
1729++ quadMatrix->xx = -1.0f / glowSize;
1730++ quadMatrix->yy = 0.0f;
1731++ quadMatrix->x0 = 1.0 - (x1 * quadMatrix->xx);
1732++ quadMatrix->y0 = 1.0;
1733++
1734++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
1735++}
1736+Index: ubuntu/plugins/expo/src/glow.h
1737+===================================================================
1738+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
1739++++ ubuntu/plugins/expo/src/glow.h 2012-09-12 22:20:43.280760497 +0800
1740+@@ -0,0 +1,66 @@
1741++/**
1742++ *
1743++ * Compiz group plugin
1744++ *
1745++ * glow.h
1746++ *
1747++ * Copyright : (C) 2006-2010 by Patrick Niklaus, Roi Cohen,
1748++ * Danny Baumann, Sam Spilsbury
1749++ * Authors: Patrick Niklaus <patrick.niklaus@googlemail.com>
1750++ * Roi Cohen <roico.beryl@gmail.com>
1751++ * Danny Baumann <maniac@opencompositing.org>
1752++ * Sam Spilsbury <smspillaz@gmail.com>
1753++ *
1754++ *
1755++ * This program is free software; you can redistribute it and/or
1756++ * modify it under the terms of the GNU General Public License
1757++ * as published by the Free Software Foundation; either version 2
1758++ * of the License, or (at your option) any later version.
1759++ *
1760++ * This program is distributed in the hope that it will be useful,
1761++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1762++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1763++ * GNU General Public License for more details.
1764++ *
1765++ **/
1766++
1767++#ifndef _EXPO_GLOW_H
1768++#define _EXPO_GLOW_H
1769++
1770++#define GLOWQUAD_TOPLEFT 0
1771++#define GLOWQUAD_TOPRIGHT 1
1772++#define GLOWQUAD_BOTTOMLEFT 2
1773++#define GLOWQUAD_BOTTOMRIGHT 3
1774++#define GLOWQUAD_TOP 4
1775++#define GLOWQUAD_BOTTOM 5
1776++#define GLOWQUAD_LEFT 6
1777++#define GLOWQUAD_RIGHT 7
1778++#define NUM_GLOWQUADS 8
1779++
1780++/* Represents a particular glow texture, so here
1781++ * we have hardcoded in the texture data, the offset
1782++ * and the size of the texture
1783++ */
1784++
1785++typedef struct _GlowTextureProperties {
1786++ char *textureData;
1787++ int textureSize;
1788++ int glowOffset;
1789++} GlowTextureProperties;
1790++
1791++/* Each glow quad contains a 2x2 scale + positional matrix
1792++ * (the 3rd column is not used since that is for matrix skew
1793++ * operations which we do not care about)
1794++ * and also a CompRect which describes the size and position of
1795++ * the quad on the glow
1796++ */
1797++
1798++class GlowQuad {
1799++ public:
1800++ CompRect mBox;
1801++ GLTexture::Matrix mMatrix;
1802++};
1803++
1804++extern const GlowTextureProperties glowTextureProperties;
1805++
1806++#endif
1807+Index: ubuntu/plugins/expo/src/group_glow.h
1808+===================================================================
1809+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
1810++++ ubuntu/plugins/expo/src/group_glow.h 2012-09-12 22:20:43.280760497 +0800
1811+@@ -0,0 +1,197 @@
1812++#ifndef _GROUP_GLOWTEX_H
1813++#define _GROUP_GLOWTEX_H
1814++
1815++/**
1816++ *
1817++ * Compiz group plugin
1818++ *
1819++ * group_glow.h
1820++ *
1821++ * Copyright : (C) 2006-2010 by Patrick Niklaus, Roi Cohen,
1822++ * Danny Baumann, Sam Spilsbury
1823++ * Authors: Patrick Niklaus <patrick.niklaus@googlemail.com>
1824++ * Roi Cohen <roico.beryl@gmail.com>
1825++ * Danny Baumann <maniac@opencompositing.org>
1826++ * Sam Spilsbury <smspillaz@gmail.com>
1827++ *
1828++ *
1829++ * This program is free software; you can redistribute it and/or
1830++ * modify it under the terms of the GNU General Public License
1831++ * as published by the Free Software Foundation; either version 2
1832++ * of the License, or (at your option) any later version.
1833++ *
1834++ * This program is distributed in the hope that it will be useful,
1835++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1836++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1837++ * GNU General Public License for more details.
1838++ *
1839++ **/
1840++
1841++/*
1842++ * glowTex
1843++ */
1844++
1845++static char glowTexRect[4097] = {
1846++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1847++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1848++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377"
1849++ "\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
1850++ "\377\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1851++ "\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
1852++ "\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377"
1853++ "\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6"
1854++ "\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377"
1855++ "\14\377\377\377\14\377\377\377\14\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1856++ "\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\14"
1857++ "\377\377\377\14\377\377\377\22\377\377\377\22\377\377\377\22\377\377\377"
1858++ "\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377"
1859++ "\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377"
1860++ "\35\377\377\377\35\377\377\377\35\377\377\377\35\377\377\377\35\377\377\377"
1861++ "\35\377\377\377\35\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
1862++ "\377\6\377\377\377\6\377\377\377\14\377\377\377\22\377\377\377\27\377\377"
1863++ "\377\27\377\377\377\35\377\377\377#\377\377\377'\377\377\377'\377\377\377"
1864++ "+\377\377\377+\377\377\377+\377\377\377+\377\377\377+\377\377\377+\377\377"
1865++ "\377+\377\377\377+\377\377\377+\377\377\3771\377\377\3771\377\377\3771\377"
1866++ "\377\3771\377\377\3771\377\377\3771\377\377\3771\0\0\0\0\0\0\0\0\0\0\0\0"
1867++ "\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\22\377\377\377"
1868++ "\27\377\377\377\35\377\377\377#\377\377\377+\377\377\3771\377\377\3776\377"
1869++ "\377\377<\377\377\377>\377\377\377C\377\377\377I\377\377\377I\377\377\377"
1870++ "I\377\377\377I\377\377\377I\377\377\377I\377\377\377I\377\377\377I\377\377"
1871++ "\377L\377\377\377L\377\377\377L\377\377\377L\377\377\377L\377\377\377L\377"
1872++ "\377\377L\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377"
1873++ "\377\377\22\377\377\377\27\377\377\377#\377\377\377+\377\377\3776\377\377"
1874++ "\377C\377\377\377L\377\377\377U\377\377\377]\377\377\377`\377\377\377d\377"
1875++ "\377\377h\377\377\377k\377\377\377k\377\377\377k\377\377\377k\377\377\377"
1876++ "k\377\377\377k\377\377\377k\377\377\377p\377\377\377p\377\377\377p\377\377"
1877++ "\377p\377\377\377p\377\377\377p\377\377\377p\0\0\0\0\0\0\0\0\0\0\0\0\377"
1878++ "\377\377\6\377\377\377\14\377\377\377\22\314\314\314\35\377\377\377'\377"
1879++ "\377\3771\377\377\377>\357\357\357P\377\377\377]\363\363\363k\365\365\365"
1880++ "v\365\365\365|\377\377\377\202\367\367\367\210\367\367\367\214\367\367\367"
1881++ "\216\367\367\367\221\367\367\367\221\367\367\367\221\367\367\367\221\367"
1882++ "\367\367\221\367\367\367\221\367\367\367\224\367\367\367\224\367\367\367"
1883++ "\224\367\367\367\224\367\367\367\224\367\367\367\224\367\367\367\224\0\0"
1884++ "\0\0\0\0\0\0\377\377\377\6\377\377\377\6\377\377\377\22\377\377\377\27\377"
1885++ "\377\377'\377\377\3776\377\377\377I\377\377\377Y\377\377\377k\376\376\376"
1886++ "y\377\377\377\210\377\377\377\224\377\377\377\235\377\377\377\245\377\377"
1887++ "\377\253\377\377\377\255\377\377\377\262\377\377\377\262\377\377\377\263"
1888++ "\377\377\377\263\377\377\377\263\377\377\377\263\377\377\377\263\377\377"
1889++ "\377\266\377\377\377\266\377\377\377\266\377\377\377\266\377\377\377\266"
1890++ "\377\377\377\266\377\377\377\266\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377"
1891++ "\14\377\377\377\27\377\377\377#\377\377\3771\377\377\377I\377\377\377]\377"
1892++ "\377\377r\377\377\377\205\377\377\377\231\377\377\377\247\377\377\377\263"
1893++ "\377\377\377\275\377\377\377\304\377\377\377\310\377\377\377\313\377\377"
1894++ "\377\316\377\377\377\320\377\377\377\320\377\377\377\320\377\377\377\320"
1895++ "\377\377\377\320\377\377\377\320\377\377\377\322\377\377\377\322\377\377"
1896++ "\377\322\377\377\377\322\377\377\377\322\377\377\377\322\377\377\377\322"
1897++ "\0\0\0\0\377\377\377\6\377\377\377\6\377\377\377\22\377\377\377\35\377\377"
1898++ "\377+\377\377\377>\377\377\377Y\377\377\377r\377\377\377\210\376\376\376"
1899++ "\237\377\377\377\262\377\377\377\302\377\377\377\313\377\377\377\324\377"
1900++ "\377\377\332\376\376\376\336\377\377\377\341\377\377\377\342\377\377\377"
1901++ "\344\377\377\377\344\377\377\377\344\377\377\377\344\377\377\377\344\377"
1902++ "\377\377\344\377\377\377\345\377\377\377\345\377\377\377\345\377\377\377"
1903++ "\345\377\377\377\345\377\377\377\345\377\377\377\345\0\0\0\0\377\377\377"
1904++ "\6\377\377\377\14\377\377\377\27\377\377\377#\377\377\3776\377\377\377P\377"
1905++ "\377\377k\377\377\377\205\376\376\376\237\372\372\372\266\377\377\377\307"
1906++ "\373\373\373\325\373\373\373\337\374\374\374\345\374\374\374\352\374\374"
1907++ "\374\355\374\374\374\357\374\374\374\360\374\374\374\361\374\374\374\361"
1908++ "\374\374\374\362\374\374\374\362\374\374\374\362\374\374\374\362\374\374"
1909++ "\374\362\374\374\374\362\374\374\374\362\374\374\374\362\374\374\374\362"
1910++ "\374\374\374\362\374\374\374\362\0\0\0\0\377\377\377\6\377\377\377\14\377"
1911++ "\377\377\35\377\377\377+\377\377\377C\377\377\377]\377\377\377|\377\377\377"
1912++ "\231\377\377\377\263\377\377\377\307\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1913++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1914++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377"
1915++ "\377\377\6\377\377\377\22\324\324\324#\377\377\3771\377\377\377L\363\363"
1916++ "\363k\377\377\377\210\377\377\377\247\377\377\377\302\377\377\377\325\0\0"
1917++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1918++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1919++ "\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\22\377\377"
1920++ "\377#\377\377\377<\377\377\377U\377\377\377v\377\377\377\226\377\377\377"
1921++ "\263\377\377\377\315\377\377\377\337\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1922++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1923++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
1924++ "\6\377\377\377\14\377\377\377\27\377\377\377'\377\377\377>\377\377\377]\377"
1925++ "\377\377|\370\370\370\237\377\377\377\275\373\373\373\325\377\377\377\345"
1926++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1927++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1928++ "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\27\377"
1929++ "\377\377+\377\377\377C\377\377\377`\377\377\377\202\377\377\377\247\377\377"
1930++ "\377\304\377\377\377\332\377\377\377\352\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1931++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1932++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
1933++ "\377\6\377\377\377\14\377\377\377\27\377\377\377+\377\377\377C\377\377\377"
1934++ "d\377\377\377\210\377\377\377\253\377\377\377\310\376\376\376\336\374\374"
1935++ "\374\355\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1936++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1937++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377"
1938++ "\35\377\377\377+\377\377\377I\377\377\377h\377\377\377\214\377\377\377\260"
1939++ "\377\377\377\313\374\374\374\342\374\374\374\357\0\0\0\0\0\0\0\0\0\0\0\0"
1940++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1941++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1942++ "\377\377\377\6\377\377\377\14\377\377\377\35\342\342\3421\377\377\377I\377"
1943++ "\377\377k\377\377\377\216\377\377\377\262\377\377\377\316\374\374\374\344"
1944++ "\377\377\377\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1945++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1946++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377"
1947++ "\377\377\35\377\377\3771\377\377\377L\377\377\377k\377\377\377\221\377\377"
1948++ "\377\263\377\377\377\320\377\377\377\344\377\377\377\361\0\0\0\0\0\0\0\0"
1949++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1950++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1951++ "\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377\377\3771\377\377"
1952++ "\377L\377\377\377k\377\377\377\221\377\377\377\263\377\377\377\320\377\377"
1953++ "\377\344\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1954++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1955++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377"
1956++ "\14\377\377\377\35\377\377\3771\377\377\377L\364\364\364p\377\377\377\221"
1957++ "\372\372\372\266\377\377\377\320\374\374\374\345\377\377\377\362\0\0\0\0"
1958++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1959++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1960++ "\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377\377\377"
1961++ "1\377\377\377L\377\377\377p\377\377\377\221\377\377\377\266\373\373\373\322"
1962++ "\377\377\377\345\377\377\377\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1963++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1964++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377"
1965++ "\377\377\14\377\377\377\35\377\377\3771\377\377\377L\377\377\377p\377\377"
1966++ "\377\221\377\377\377\266\373\373\373\322\377\377\377\345\377\377\377\362"
1967++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1968++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1969++ "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377"
1970++ "\377\3771\377\377\377L\377\377\377p\377\377\377\221\377\377\377\266\373\373"
1971++ "\373\322\377\377\377\345\377\377\377\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1972++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1973++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
1974++ "\377\6\377\377\377\14\377\377\377\35\377\377\3771\377\377\377L\377\377\377"
1975++ "p\367\367\367\224\377\377\377\266\377\377\377\322\377\377\377\345\374\374"
1976++ "\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1977++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1978++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377"
1979++ "\35\377\377\3771\377\377\377L\377\377\377p\367\367\367\224\377\377\377\266"
1980++ "\377\377\377\322\377\377\377\345\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0"
1981++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1982++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1983++ "\377\377\377\6\377\377\377\14\377\377\377\35\377\377\3771\377\377\377L\377"
1984++ "\377\377p\367\367\367\224\377\377\377\266\377\377\377\322\377\377\377\345"
1985++ "\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1986++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1987++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377"
1988++ "\377\377\35\377\377\3771\377\377\377L\377\377\377p\367\367\367\224\377\377"
1989++ "\377\266\377\377\377\322\377\377\377\345\374\374\374\362\0\0\0\0\0\0\0\0"
1990++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1991++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1992++ "\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377\377\3771\377\377"
1993++ "\377L\377\377\377p\367\367\367\224\377\377\377\266\377\377\377\322\377\377"
1994++ "\377\345\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1995++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
1996++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377"
1997++ "\14\377\377\377\35\377\377\3771\377\377\377L\377\377\377p\367\367\367\224"
1998++ "\377\377\377\266\377\377\377\322\377\377\377\345\374\374\374\362\0\0\0\0"
1999++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
2000++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
2001++ "\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377\377\377"
2002++ "1\377\377\377L\377\377\377p\367\367\367\224\377\377\377\266\377\377\377\322"
2003++ "\377\377\377\345\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
2004++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
2005++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
2006++};
2007++
2008++#endif
2009+Index: ubuntu/plugins/expo/src/wall_offset/CMakeLists.txt
2010+===================================================================
2011+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2012++++ ubuntu/plugins/expo/src/wall_offset/CMakeLists.txt 2012-09-12 22:20:43.280760497 +0800
2013+@@ -0,0 +1,33 @@
2014++include_directories (
2015++ ${CMAKE_CURRENT_SOURCE_DIR}/include
2016++ ${CMAKE_CURRENT_SOURCE_DIR}/src
2017++ ${Boost_INCLUDE_DIRS}
2018++ ${GLIBMM_INCLUDE_DIRS}
2019++)
2020++
2021++link_directories (${GLIBMM_LIBRARY_DIRS} ${COMPIZ_LIBRARY_DIRS})
2022++
2023++set (
2024++ PRIVATE_HEADERS
2025++ ${CMAKE_CURRENT_SOURCE_DIR}/include/wall-offset.h
2026++)
2027++
2028++set (
2029++ SRCS
2030++ ${CMAKE_CURRENT_SOURCE_DIR}/src/wall-offset.cpp
2031++)
2032++
2033++add_library (
2034++ compiz_expo_wall_offset STATIC
2035++ ${SRCS}
2036++ ${PRIVATE_HEADERS}
2037++)
2038++
2039++if (COMPIZ_BUILD_TESTING)
2040++ add_subdirectory ( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
2041++endif (COMPIZ_BUILD_TESTING)
2042++
2043++target_link_libraries (
2044++ compiz_expo_wall_offset
2045++ compiz_core
2046++)
2047+Index: ubuntu/plugins/expo/src/wall_offset/include/wall-offset.h
2048+===================================================================
2049+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2050++++ ubuntu/plugins/expo/src/wall_offset/include/wall-offset.h 2012-09-12 22:20:43.280760497 +0800
2051+@@ -0,0 +1,43 @@
2052++/**
2053++ * Copyright © 2012 Canonical Ltd.
2054++ *
2055++ * Authors:
2056++ * Sam Spilsbury <sam.spilsbury@canonical.com>
2057++ *
2058++ * This program is free software; you can redistribute it and/or
2059++ * modify it under the terms of the GNU General Public License
2060++ * as published by the Free Software Foundation; either version 2
2061++ * of the License, or (at your option) any later version.
2062++ *
2063++ * This program is distributed in the hope that it will be useful,
2064++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2065++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2066++ * GNU General Public License for more details.
2067++ *
2068++ **/
2069++
2070++#ifndef _COMPIZ_EXPO_WALL_OFFSET_H
2071++#define _COMPIZ_EXPO_WALL_OFFSET_H
2072++
2073++#include <core/point.h>
2074++#include <core/size.h>
2075++#include <core/rect.h>
2076++
2077++namespace compiz
2078++{
2079++ namespace expo
2080++ {
2081++ void
2082++ calculateWallOffset (const CompRect &output,
2083++ const CompPoint &offsetInScreenCoords,
2084++ const CompPoint &vpSize,
2085++ const CompSize &screenSize,
2086++ float &offsetInWorldX,
2087++ float &offsetInWorldY,
2088++ float &worldScaleFactorX,
2089++ float &worldScaleFactorY,
2090++ float animationProgress);
2091++ }
2092++}
2093++
2094++#endif
2095+Index: ubuntu/plugins/expo/src/wall_offset/src/wall-offset.cpp
2096+===================================================================
2097+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2098++++ ubuntu/plugins/expo/src/wall_offset/src/wall-offset.cpp 2012-09-12 22:20:43.280760497 +0800
2099+@@ -0,0 +1,55 @@
2100++/**
2101++ * Copyright © 2012 Canonical Ltd.
2102++ *
2103++ * Authors:
2104++ * Sam Spilsbury <sam.spilsbury@canonical.com>
2105++ *
2106++ * This program is free software; you can redistribute it and/or
2107++ * modify it under the terms of the GNU General Public License
2108++ * as published by the Free Software Foundation; either version 2
2109++ * of the License, or (at your option) any later version.
2110++ *
2111++ * This program is distributed in the hope that it will be useful,
2112++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2113++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2114++ * GNU General Public License for more details.
2115++ *
2116++ **/
2117++#include "wall-offset.h"
2118++
2119++namespace compiz
2120++{
2121++ namespace expo
2122++ {
2123++ void
2124++ calculateWallOffset (const CompRect &output,
2125++ const CompPoint &offsetInScreenCoords,
2126++ const CompPoint &vpSize,
2127++ const CompSize &screenSize,
2128++ float &offsetInWorldX,
2129++ float &offsetInWorldY,
2130++ float &worldScaleFactorX,
2131++ float &worldScaleFactorY,
2132++ float animationProgress)
2133++ {
2134++ const float sx = screenSize.width () / static_cast <float> (output.width ());
2135++ const float sy = screenSize.height () / static_cast <float> (output.height ());
2136++ offsetInWorldX = 0.0;
2137++ offsetInWorldY = 0.0;
2138++ worldScaleFactorX = 1.0f;
2139++ worldScaleFactorY = 1.0f;
2140++
2141++ if (output.left () == 0)
2142++ {
2143++ offsetInWorldX = ((vpSize.x () * sx) / ((float) output.width ()) * (offsetInScreenCoords.x ()) * animationProgress);
2144++ worldScaleFactorX = 1.0f - ((float) (offsetInScreenCoords.x ()) / (float) (output.width ())) * animationProgress;
2145++ }
2146++
2147++ if (output.top () == 0)
2148++ {
2149++ offsetInWorldY = ((vpSize.y () * sy) / ((float) output.height ()) * (offsetInScreenCoords.y ()) * animationProgress);
2150++ worldScaleFactorY = 1.0f - ((float) (offsetInScreenCoords.y ()) / (float) output.height ()) * animationProgress;
2151++ }
2152++ }
2153++ }
2154++}
2155+Index: ubuntu/plugins/expo/src/wall_offset/tests/CMakeLists.txt
2156+===================================================================
2157+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2158++++ ubuntu/plugins/expo/src/wall_offset/tests/CMakeLists.txt 2012-09-12 22:20:43.280760497 +0800
2159+@@ -0,0 +1,19 @@
2160++if (NOT GTEST_FOUND)
2161++ message ("Google Test not found - cannot build tests!")
2162++ set (COMPIZ_BUILD_TESTING OFF)
2163++endif (NOT GTEST_FOUND)
2164++
2165++include_directories (${GTEST_INCLUDE_DIRS})
2166++
2167++link_directories (${COMPIZ_LIBRARY_DIRS})
2168++
2169++add_executable (compiz_test_expo_wall_offset
2170++ ${CMAKE_CURRENT_SOURCE_DIR}/test-expo-wall-offset.cpp)
2171++
2172++target_link_libraries (compiz_test_expo_wall_offset
2173++ compiz_expo_wall_offset
2174++ ${GTEST_BOTH_LIBRARIES}
2175++ ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
2176++ )
2177++
2178++compiz_discover_tests (compiz_test_expo_wall_offset COVERAGE compiz_expo_wall_offset)
2179+Index: ubuntu/plugins/expo/src/wall_offset/tests/test-expo-wall-offset.cpp
2180+===================================================================
2181+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2182++++ ubuntu/plugins/expo/src/wall_offset/tests/test-expo-wall-offset.cpp 2012-09-12 22:20:43.280760497 +0800
2183+@@ -0,0 +1,263 @@
2184++/*
2185++ * Copyright © 2012 Canonical Ltd.
2186++ *
2187++ * Permission to use, copy, modify, distribute, and sell this software
2188++ * and its documentation for any purpose is hereby granted without
2189++ * fee, provided that the above copyright notice appear in all copies
2190++ * and that both that copyright notice and this permission notice
2191++ * appear in supporting documentation, and that the name of
2192++ * Canonical Ltd. not be used in advertising or publicity pertaining to
2193++ * distribution of the software without specific, written prior permission.
2194++ * Canonical Ltd. makes no representations about the suitability of this
2195++ * software for any purpose. It is provided "as is" without express or
2196++ * implied warranty.
2197++ *
2198++ * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
2199++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
2200++ * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
2201++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
2202++ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
2203++ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
2204++ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2205++ *
2206++ * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
2207++ */
2208++#include <tr1/tuple>
2209++#include <gtest/gtest.h>
2210++#include "wall-offset.h"
2211++
2212++using ::testing::WithParamInterface;
2213++using ::testing::ValuesIn;
2214++using ::testing::Combine;
2215++using ::testing::Range;
2216++
2217++class ExpoWallOffsetTest :
2218++ public ::testing::Test
2219++{
2220++ protected:
2221++
2222++ float offsetInWorldX;
2223++ float offsetInWorldY;
2224++ float worldScaleFactorX;
2225++ float worldScaleFactorY;
2226++};
2227++
2228++namespace
2229++{
2230++ const unsigned int nAnimationsBegin = 0;
2231++ const unsigned int nAnimationSteps = 20;
2232++
2233++ struct OffsetAnimationParameters
2234++ {
2235++ float offsetInWorldX;
2236++ float offsetInWorldY;
2237++ float worldScaleFactorX;
2238++ float worldScaleFactorY;
2239++ };
2240++
2241++ struct OffsetParameters
2242++ {
2243++ float offsetX;
2244++ float offsetY;
2245++ int vpSizeWidth;
2246++ int vpSizeHeight;
2247++ int screenWidth;
2248++ int screenHeight;
2249++ int outputWidth;
2250++ int outputHeight;
2251++ OffsetAnimationParameters animationParameters[20];
2252++ };
2253++
2254++ const OffsetParameters testingOffsetParameters[] =
2255++ {
2256++ {
2257++ 0,
2258++ 0,
2259++ 1,
2260++ 1,
2261++ 100,
2262++ 100,
2263++ 100,
2264++ 100,
2265++ {
2266++ { 0, 0, 1.0, 1.0 },
2267++ { 0, 0, 1.0, 1.0 },
2268++ { 0, 0, 1.0, 1.0 },
2269++ { 0, 0, 1.0, 1.0 },
2270++ { 0, 0, 1.0, 1.0 },
2271++ { 0, 0, 1.0, 1.0 },
2272++ { 0, 0, 1.0, 1.0 },
2273++ { 0, 0, 1.0, 1.0 },
2274++ { 0, 0, 1.0, 1.0 },
2275++ { 0, 0, 1.0, 1.0 },
2276++ { 0, 0, 1.0, 1.0 },
2277++ { 0, 0, 1.0, 1.0 },
2278++ { 0, 0, 1.0, 1.0 },
2279++ { 0, 0, 1.0, 1.0 },
2280++ { 0, 0, 1.0, 1.0 },
2281++ { 0, 0, 1.0, 1.0 },
2282++ { 0, 0, 1.0, 1.0 },
2283++ { 0, 0, 1.0, 1.0 },
2284++ { 0, 0, 1.0, 1.0 },
2285++ { 0, 0, 1.0, 1.0 }
2286++ }
2287++ },
2288++ /* Monitor 1280x800, Screen: 1280x800, Viewport Layout: 2x2, Offset: 32, 24 */
2289++ {
2290++ 32,
2291++ 24,
2292++ 2,
2293++ 2,
2294++ 1280,
2295++ 800,
2296++ 1280,
2297++ 800,
2298++ {
2299++ { 0, 0, 1, 1 },
2300++ { 0.0025000001769512892, 0.0011718750465661287, 0.99874997138977051, 0.99906247854232788 },
2301++ { 0.0050000003539025784, 0.0023437500931322575, 0.99750000238418579, 0.99812501668930054 },
2302++ { 0.0075000002980232239, 0.0035156251396983862, 0.9962499737739563, 0.99718749523162842 },
2303++ { 0.010000000707805157, 0.0046875001862645149, 0.99500000476837158, 0.9962499737739563 },
2304++ { 0.012500000186264515, 0.005859375, 0.99374997615814209, 0.99531251192092896 },
2305++ { 0.015000000596046448, 0.0070312502793967724, 0.99250000715255737, 0.99437499046325684 },
2306++ { 0.017500000074505806, 0.0082031246274709702, 0.99124997854232788, 0.99343752861022949 },
2307++ { 0.020000001415610313, 0.0093750003725290298, 0.99000000953674316, 0.99250000715255737 },
2308++ { 0.022499999031424522, 0.01054687425494194, 0.98874998092651367, 0.99156248569488525 },
2309++ { 0.02500000037252903, 0.01171875, 0.98750001192092896, 0.99062502384185791 },
2310++ { 0.027500001713633537, 0.01289062574505806, 0.98624998331069946, 0.98968750238418579 },
2311++ { 0.030000001192092896, 0.014062500558793545, 0.98500001430511475, 0.98874998092651367 },
2312++ { 0.032499998807907104, 0.015234374441206455, 0.98374998569488525, 0.98781251907348633 },
2313++ { 0.035000000149011612, 0.01640624925494194, 0.98250001668930054, 0.98687499761581421 },
2314++ { 0.037500001490116119, 0.017578125, 0.98124998807907104, 0.98593747615814209 },
2315++ { 0.040000002831220627, 0.01875000074505806, 0.98000001907348633, 0.98500001430511475 },
2316++ { 0.042500000447034836, 0.019921876490116119, 0.97874999046325684, 0.98406249284744263 },
2317++ { 0.044999998062849045, 0.021093748509883881, 0.97750002145767212, 0.98312497138977051 },
2318++ { 0.047499999403953552, 0.02226562425494194, 0.97624999284744263, 0.98218750953674316 }
2319++ }
2320++ },
2321++ /* Monitor 1280x1024, Screen: 2560x1024, Viewport Layout: 2x2, Offset: 32, 24 */
2322++ {
2323++ 32,
2324++ 24,
2325++ 2,
2326++ 2,
2327++ 2560,
2328++ 1024,
2329++ 1280,
2330++ 1024,
2331++ {
2332++ { 0, 0, 1, 1 },
2333++ { 0.0050000003539025784, 0.001500000013038516, 0.99874997138977051, 0.99906247854232788 },
2334++ { 0.010000000707805157, 0.0030000000260770321, 0.99750000238418579, 0.99812501668930054 },
2335++ { 0.015000000596046448, 0.0045000002719461918, 0.9962499737739563, 0.99718749523162842 },
2336++ { 0.020000001415610313, 0.0060000000521540642, 0.99500000476837158, 0.9962499737739563 },
2337++ { 0.02500000037252903, 0.0074999998323619366, 0.99374997615814209, 0.99531251192092896 },
2338++ { 0.030000001192092896, 0.0090000005438923836, 0.99250000715255737, 0.99437499046325684 },
2339++ { 0.035000000149011612, 0.010499999858438969, 0.99124997854232788, 0.99343752861022949 },
2340++ { 0.040000002831220627, 0.012000000104308128, 0.99000000953674316, 0.99250000715255737 },
2341++ { 0.044999998062849045, 0.013499999418854713, 0.98874998092651367, 0.99156248569488525 },
2342++ { 0.05000000074505806, 0.014999999664723873, 0.98750001192092896, 0.99062502384185791 },
2343++ { 0.055000003427267075, 0.016499999910593033, 0.98624998331069946, 0.98968750238418579 },
2344++ { 0.060000002384185791, 0.018000001087784767, 0.98500001430511475, 0.98874998092651367 },
2345++ { 0.064999997615814209, 0.019499998539686203, 0.98374998569488525, 0.98781251907348633 },
2346++ { 0.070000000298023224, 0.020999999716877937, 0.98250001668930054, 0.98687499761581421 },
2347++ { 0.075000002980232239, 0.022499999031424522, 0.98124998807907104, 0.98593747615814209 },
2348++ { 0.080000005662441254, 0.024000000208616257, 0.98000001907348633, 0.98500001430511475 },
2349++ { 0.085000000894069672, 0.025499999523162842, 0.97874999046325684, 0.98406249284744263 },
2350++ { 0.08999999612569809, 0.026999998837709427, 0.97750002145767212, 0.98312497138977051 },
2351++ { 0.094999998807907104, 0.028499998152256012, 0.97624999284744263, 0.98218750953674316 }
2352++ }
2353++ },
2354++ };
2355++
2356++ typedef std::tr1::tuple <OffsetParameters, unsigned int> AnimParam;
2357++}
2358++
2359++class ExpoWallOffsetTestAnimations :
2360++ public ExpoWallOffsetTest,
2361++ public ::testing::WithParamInterface <AnimParam>
2362++{
2363++ public:
2364++
2365++ void
2366++ RecordProperty (const char *name, float value)
2367++ {
2368++ ::testing::Message message;
2369++ message << value;
2370++ Test::RecordProperty (name, message.GetString ().c_str ());
2371++ }
2372++};
2373++
2374++TEST_P (ExpoWallOffsetTestAnimations, TestAnimationValues)
2375++{
2376++ const OffsetParameters &offset (std::tr1::get <0> (GetParam ()));
2377++ const unsigned int &index (std::tr1::get <1> (GetParam ()));
2378++
2379++ RecordProperty ("outputWidth", offset.outputWidth);
2380++ RecordProperty ("outputHeight", offset.outputHeight);
2381++ RecordProperty ("screenWidth", offset.screenWidth);
2382++ RecordProperty ("screenHeight", offset.screenHeight);
2383++ RecordProperty ("offsetX", offset.offsetX);
2384++ RecordProperty ("offsetY", offset.offsetY);
2385++
2386++ RecordProperty ("expected.offsetInWorldX", offset.animationParameters[index].offsetInWorldX);
2387++ RecordProperty ("expected.offsetInWorldY", offset.animationParameters[index].offsetInWorldY);
2388++ RecordProperty ("expected.worldScaleFactorX", offset.animationParameters[index].worldScaleFactorX);
2389++ RecordProperty ("expected.worldScaleFactorY", offset.animationParameters[index].worldScaleFactorY);
2390++
2391++ compiz::expo::calculateWallOffset (CompRect (0,
2392++ 0,
2393++ offset.outputWidth,
2394++ offset.outputWidth),
2395++ CompPoint (offset.offsetX,
2396++ offset.offsetY),
2397++ CompPoint (offset.vpSizeWidth,
2398++ offset.vpSizeHeight),
2399++ CompSize (offset.screenWidth,
2400++ offset.screenHeight),
2401++ offsetInWorldX,
2402++ offsetInWorldY,
2403++ worldScaleFactorX,
2404++ worldScaleFactorY,
2405++ index / static_cast <float> (nAnimationSteps));
2406++
2407++ RecordProperty ("offsetInWorldX", offsetInWorldX);
2408++ RecordProperty ("offsetInWorldY", offsetInWorldY);
2409++ RecordProperty ("worldScaleFactorX", worldScaleFactorX);
2410++ RecordProperty ("worldScaleFactorY", worldScaleFactorY);
2411++
2412++ EXPECT_EQ (offsetInWorldX, offset.animationParameters[index].offsetInWorldX);
2413++ EXPECT_EQ (offsetInWorldY, offset.animationParameters[index].offsetInWorldY);
2414++ EXPECT_EQ (worldScaleFactorX, offset.animationParameters[index].worldScaleFactorX);
2415++ EXPECT_EQ (worldScaleFactorY, offset.animationParameters[index].worldScaleFactorY);
2416++}
2417++
2418++TEST_F (ExpoWallOffsetTest, TestNoOffsetIfOutputIsNotOrigin)
2419++{
2420++ compiz::expo::calculateWallOffset (CompRect (1,
2421++ 1,
2422++ 100,
2423++ 100),
2424++ CompPoint (100,
2425++ 100),
2426++ CompPoint (1,
2427++ 1),
2428++ CompSize (100,
2429++ 100),
2430++ offsetInWorldX,
2431++ offsetInWorldY,
2432++ worldScaleFactorX,
2433++ worldScaleFactorY,
2434++ 1.0);
2435++
2436++ EXPECT_EQ (offsetInWorldX, 0.0f);
2437++ EXPECT_EQ (offsetInWorldY, 0.0f);
2438++ EXPECT_EQ (worldScaleFactorX, 1.0f);
2439++ EXPECT_EQ (worldScaleFactorY, 1.0f);
2440++}
2441++
2442++INSTANTIATE_TEST_CASE_P (ExpoAnimationOffsetTest,
2443++ ExpoWallOffsetTestAnimations,
2444++ Combine (ValuesIn (testingOffsetParameters),
2445++ Range (nAnimationsBegin,
2446++ nAnimationSteps)));
2447+Index: ubuntu/plugins/expo/CMakeLists.txt
2448+===================================================================
2449+--- ubuntu.orig/plugins/expo/CMakeLists.txt 2012-09-08 17:26:40.599035911 +0800
2450++++ ubuntu/plugins/expo/CMakeLists.txt 2012-09-12 22:20:43.300760590 +0800
2451+@@ -1,7 +1,16 @@
2452+ find_package (Compiz REQUIRED)
2453+ include (CompizPlugin)
2454+
2455++set (COMPIZ_EXPO_PLUGIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
2456++
2457+ add_subdirectory (src/click_threshold)
2458+ include_directories (src/click_threshold/include)
2459++add_subdirectory (src/wall_offset)
2460++include_directories (src/wall_offset/include)
2461++add_subdirectory (src/windows_on_viewport)
2462++include_directories (src/windows_on_viewport/include)
2463+
2464+-compiz_plugin (expo PLUGINDEPS composite opengl LIBRARIES compiz_expo_click_threshold)
2465++compiz_plugin (expo PLUGINDEPS composite opengl LIBRARIES
2466++ compiz_expo_click_threshold
2467++ compiz_expo_wall_offset
2468++ compiz_expo_windows_on_viewport)
2469+Index: ubuntu/plugins/expo/src/windows_on_viewport/CMakeLists.txt
2470+===================================================================
2471+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2472++++ ubuntu/plugins/expo/src/windows_on_viewport/CMakeLists.txt 2012-09-12 22:20:43.300760590 +0800
2473+@@ -0,0 +1,36 @@
2474++include_directories (
2475++ ${CMAKE_CURRENT_SOURCE_DIR}/include
2476++ ${CMAKE_CURRENT_SOURCE_DIR}/src
2477++ ${COMPIZ_INCLUDE_DIRS}
2478++ ${COMPIZ_EXPO_PLUGIN_SOURCE_DIR}
2479++ ${Boost_INCLUDE_DIRS}
2480++ ${GLIBMM_INCLUDE_DIRS}
2481++)
2482++
2483++link_directories (${GLIBMM_LIBRARY_DIRS} ${COMPIZ_LIBRARY_DIRS})
2484++
2485++set (
2486++ PRIVATE_HEADERS
2487++ ${CMAKE_CURRENT_SOURCE_DIR}/include/windows-on-viewport.h
2488++)
2489++
2490++set (
2491++ SRCS
2492++ ${CMAKE_CURRENT_SOURCE_DIR}/src/windows-on-viewport.cpp
2493++)
2494++
2495++add_library (
2496++ compiz_expo_windows_on_viewport STATIC
2497++ ${SRCS}
2498++ ${PRIVATE_HEADERS}
2499++)
2500++
2501++if (COMPIZ_BUILD_TESTING)
2502++ add_subdirectory ( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
2503++endif (COMPIZ_BUILD_TESTING)
2504++
2505++target_link_libraries (
2506++ compiz_expo_windows_on_viewport
2507++ compiz_window_geometry
2508++ compiz_core
2509++)
2510+Index: ubuntu/plugins/expo/src/windows_on_viewport/include/windows-on-viewport.h
2511+===================================================================
2512+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2513++++ ubuntu/plugins/expo/src/windows_on_viewport/include/windows-on-viewport.h 2012-09-12 22:31:06.807852402 +0800
2514+@@ -0,0 +1,43 @@
2515++/**
2516++ * Copyright © 2012 Canonical Ltd.
2517++ *
2518++ * Authors:
2519++ * Sam Spilsbury <sam.spilsbury@canonical.com>
2520++ *
2521++ * This program is free software; you can redistribute it and/or
2522++ * modify it under the terms of the GNU General Public License
2523++ * as published by the Free Software Foundation; either version 2
2524++ * of the License, or (at your option) any later version.
2525++ *
2526++ * This program is distributed in the hope that it will be useful,
2527++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2528++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2529++ * GNU General Public License for more details.
2530++ *
2531++ **/
2532++#ifndef _COMPIZ_EXPO_WINDOWS_ON_VIEWPORT_H
2533++#define _COMPIZ_EXPO_WINDOWS_ON_VIEWPORT_H
2534++
2535++#include <core/point.h>
2536++#include <core/size.h>
2537++#include <core/rect.h>
2538++#include "client-list-generator.h"
2539++
2540++namespace compiz
2541++{
2542++ namespace expo
2543++ {
2544++ unsigned int countViewports (const CompSize &vpSize);
2545++
2546++ void fillInNewViewportActiveData (unsigned int vpCount,
2547++ std::vector <bool> &vpActive);
2548++
2549++ void activeViewportsForMembers (compiz::expo::ClientListGenerator &clientList,
2550++ const CompPoint &cursor,
2551++ const CompSize &vpSize,
2552++ const CompSize &screenSize,
2553++ std::vector <bool> &viewportActiveStates);
2554++ }
2555++}
2556++
2557++#endif
2558+Index: ubuntu/plugins/expo/src/windows_on_viewport/src/windows-on-viewport.cpp
2559+===================================================================
2560+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2561++++ ubuntu/plugins/expo/src/windows_on_viewport/src/windows-on-viewport.cpp 2012-09-12 22:20:43.300760590 +0800
2562+@@ -0,0 +1,80 @@
2563++/**
2564++ * Copyright © 2012 Canonical Ltd.
2565++ *
2566++ * Authors:
2567++ * Sam Spilsbury <sam.spilsbury@canonical.com>
2568++ *
2569++ * This program is free software; you can redistribute it and/or
2570++ * modify it under the terms of the GNU General Public License
2571++ * as published by the Free Software Foundation; either version 2
2572++ * of the License, or (at your option) any later version.
2573++ *
2574++ * This program is distributed in the hope that it will be useful,
2575++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2576++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2577++ * GNU General Public License for more details.
2578++ *
2579++ **/
2580++#include <cstdio>
2581++#include <algorithm>
2582++#include "windows-on-viewport.h"
2583++#include "viewport-member-window.h"
2584++
2585++namespace compiz
2586++{
2587++ namespace expo
2588++ {
2589++ unsigned int countViewports (const CompSize &vpSize)
2590++ {
2591++ return vpSize.width () * vpSize.height ();
2592++ }
2593++
2594++ void fillInNewViewportActiveData (unsigned int vpCount,
2595++ std::vector <bool> &vpActive)
2596++ {
2597++ if (vpActive.size () < vpCount)
2598++ {
2599++ unsigned int last = vpActive.size () - 1;
2600++ vpActive.resize (vpCount);
2601++ for (unsigned int i = last; i < vpActive.size (); i++)
2602++ vpActive[i] = false;
2603++ }
2604++ }
2605++
2606++ void activeViewportsForMembers (compiz::expo::ClientListGenerator &clientList,
2607++ const CompPoint &cursor,
2608++ const CompSize &vpSize,
2609++ const CompSize &screenSize,
2610++ std::vector <bool> &viewportActiveStates)
2611++ {
2612++ compiz::expo::ViewportMemberWindow *vpMemberWindow = clientList.nextClient ();
2613++
2614++ fillInNewViewportActiveData (countViewports (vpSize), viewportActiveStates);
2615++ std::fill_n (viewportActiveStates.begin (), viewportActiveStates.size (), false);
2616++
2617++ while (vpMemberWindow)
2618++ {
2619++ if (!vpMemberWindow->isDesktopOrDock ())
2620++ {
2621++ CompPoint viewport;
2622++
2623++ /* If this is a dragged window, use the cursor position */
2624++ if (vpMemberWindow->dragged ())
2625++ viewport.set (cursor.x () / screenSize.width (),
2626++ cursor.y () / screenSize.height ());
2627++ else
2628++ {
2629++ const compiz::window::Geometry &geom = vpMemberWindow->absoluteGeometry ();
2630++ viewport.set (geom.centerX () / screenSize.width (),
2631++ geom.centerY () / screenSize.height ());
2632++ }
2633++
2634++ unsigned int vpIndex = vpSize.width () * viewport.y () + viewport.x ();
2635++ viewportActiveStates[vpIndex] = true;
2636++ }
2637++
2638++ vpMemberWindow = clientList.nextClient ();
2639++ }
2640++ }
2641++ }
2642++}
2643+Index: ubuntu/plugins/expo/src/windows_on_viewport/tests/CMakeLists.txt
2644+===================================================================
2645+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2646++++ ubuntu/plugins/expo/src/windows_on_viewport/tests/CMakeLists.txt 2012-09-12 22:20:43.300760590 +0800
2647+@@ -0,0 +1,22 @@
2648++if (NOT GTEST_FOUND)
2649++ message ("Google Test not found - cannot build tests!")
2650++ set (COMPIZ_BUILD_TESTING OFF)
2651++endif (NOT GTEST_FOUND)
2652++
2653++include_directories (${GTEST_INCLUDE_DIRS})
2654++include_directories (${CMAKE_EXPO_PLUGIN_SOURCE_DIR})
2655++
2656++link_directories (${COMPIZ_LIBRARY_DIRS})
2657++
2658++add_executable (compiz_test_expo_windows_on_viewport
2659++ ${CMAKE_CURRENT_SOURCE_DIR}/test-windows-on-viewport.cpp)
2660++
2661++target_link_libraries (compiz_test_expo_windows_on_viewport
2662++ compiz_expo_windows_on_viewport
2663++ ${GTEST_BOTH_LIBRARIES}
2664++ ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
2665++ ${GMOCK_LIBRARY}
2666++ ${GMOCK_MAIN_LIBRARY}
2667++ )
2668++
2669++compiz_discover_tests (compiz_test_expo_windows_on_viewport COVERAGE compiz_expo_windows_on_viewport)
2670+Index: ubuntu/plugins/expo/src/windows_on_viewport/tests/test-windows-on-viewport.cpp
2671+===================================================================
2672+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2673++++ ubuntu/plugins/expo/src/windows_on_viewport/tests/test-windows-on-viewport.cpp 2012-09-12 22:20:43.304760606 +0800
2674+@@ -0,0 +1,149 @@
2675++/*
2676++ * Copyright © 2012 Canonical Ltd.
2677++ *
2678++ * Permission to use, copy, modify, distribute, and sell this software
2679++ * and its documentation for any purpose is hereby granted without
2680++ * fee, provided that the above copyright notice appear in all copies
2681++ * and that both that copyright notice and this permission notice
2682++ * appear in supporting documentation, and that the name of
2683++ * Canonical Ltd. not be used in advertising or publicity pertaining to
2684++ * distribution of the software without specific, written prior permission.
2685++ * Canonical Ltd. makes no representations about the suitability of this
2686++ * software for any purpose. It is provided "as is" without express or
2687++ * implied warranty.
2688++ *
2689++ * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
2690++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
2691++ * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
2692++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
2693++ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
2694++ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
2695++ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2696++ *
2697++ * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
2698++ */
2699++#include <gtest/gtest.h>
2700++#include <gmock/gmock.h>
2701++#include "windows-on-viewport.h"
2702++#include "client-list-generator.h"
2703++#include "viewport-member-window.h"
2704++
2705++using ::testing::InSequence;
2706++using ::testing::Return;
2707++using ::testing::ReturnNull;
2708++using ::testing::ReturnRef;
2709++
2710++namespace
2711++{
2712++ namespace ce = compiz::expo;
2713++
2714++ class MockViewportMemberWindow :
2715++ public ce::ViewportMemberWindow
2716++ {
2717++ public:
2718++
2719++ MOCK_CONST_METHOD0 (absoluteGeometry, const compiz::window::Geometry & ());
2720++ MOCK_CONST_METHOD0 (isDesktopOrDock, bool ());
2721++ MOCK_CONST_METHOD0 (dragged, bool ());
2722++ };
2723++
2724++ class MockClientListGenerator :
2725++ public ce::ClientListGenerator
2726++ {
2727++ public:
2728++
2729++ MOCK_METHOD0 (nextClient, ce::ViewportMemberWindow * ());
2730++ };
2731++}
2732++
2733++class ExpoWindowsOnViewportTest :
2734++ public ::testing::Test
2735++{
2736++ protected:
2737++
2738++ MockClientListGenerator mockClientListGenerator;
2739++ std::vector <bool> activeStates;
2740++};
2741++
2742++namespace
2743++{
2744++ const CompSize vpSize (2, 2);
2745++ const CompSize screenSize (1000, 1000);
2746++}
2747++
2748++TEST_F (ExpoWindowsOnViewportTest, TestNoDocksMakeViewportsActive)
2749++{
2750++ MockViewportMemberWindow mockViewportMembers[1];
2751++ InSequence s;
2752++
2753++ EXPECT_CALL (mockClientListGenerator, nextClient ()).WillOnce (Return (&mockViewportMembers[0]));
2754++ EXPECT_CALL (mockViewportMembers[0], isDesktopOrDock ()).WillOnce (Return (true));
2755++ EXPECT_CALL (mockClientListGenerator, nextClient ()).WillOnce (ReturnNull ());
2756++
2757++ compiz::expo::activeViewportsForMembers (mockClientListGenerator,
2758++ CompPoint (1, 1),
2759++ vpSize,
2760++ screenSize,
2761++ activeStates);
2762++
2763++ ASSERT_EQ (activeStates.size (), vpSize.width () * vpSize.height ());
2764++ EXPECT_EQ (activeStates[0], false);
2765++ EXPECT_EQ (activeStates[1], false);
2766++ EXPECT_EQ (activeStates[2], false);
2767++ EXPECT_EQ (activeStates[3], false);
2768++}
2769++
2770++TEST_F (ExpoWindowsOnViewportTest, TestGrabbedWindowUsesCursorPosition)
2771++{
2772++ MockViewportMemberWindow mockViewportMembers[1];
2773++ InSequence s;
2774++
2775++ EXPECT_CALL (mockClientListGenerator, nextClient ()).WillOnce (Return (&mockViewportMembers[0]));
2776++ EXPECT_CALL (mockViewportMembers[0], isDesktopOrDock ()).WillOnce (Return (false));
2777++ EXPECT_CALL (mockViewportMembers[0], dragged ()).WillOnce (Return (true));
2778++ EXPECT_CALL (mockClientListGenerator, nextClient ()).WillOnce (ReturnNull ());
2779++
2780++ compiz::expo::activeViewportsForMembers (mockClientListGenerator,
2781++ CompPoint (screenSize.width () * 1.5,
2782++ screenSize.height () * 1.5),
2783++ vpSize,
2784++ screenSize,
2785++ activeStates);
2786++
2787++ ASSERT_EQ (activeStates.size (), vpSize.width () * vpSize.height ());
2788++ EXPECT_EQ (activeStates[0], false);
2789++ EXPECT_EQ (activeStates[1], false);
2790++ EXPECT_EQ (activeStates[2], false);
2791++ EXPECT_EQ (activeStates[3], true); // 2,2 has the cursor of a dragged window
2792++}
2793++
2794++TEST_F (ExpoWindowsOnViewportTest, TestUngrabbedWindowUsesGeometry)
2795++{
2796++ MockViewportMemberWindow mockViewportMembers[1];
2797++ InSequence s;
2798++
2799++ compiz::window::Geometry vpMemberGeometry1 (screenSize.width () * 1.1,
2800++ screenSize.height () * 1.1,
2801++ screenSize.width () / 2,
2802++ screenSize.height () / 2,
2803++ 0);
2804++
2805++ EXPECT_CALL (mockClientListGenerator, nextClient ()).WillOnce (Return (&mockViewportMembers[0]));
2806++ EXPECT_CALL (mockViewportMembers[0], isDesktopOrDock ()).WillOnce (Return (false));
2807++ EXPECT_CALL (mockViewportMembers[0], dragged ()).WillOnce (Return (false));
2808++ EXPECT_CALL (mockViewportMembers[0], absoluteGeometry ()).WillOnce (ReturnRef (vpMemberGeometry1));
2809++ EXPECT_CALL (mockClientListGenerator, nextClient ()).WillOnce (ReturnNull ());
2810++
2811++ compiz::expo::activeViewportsForMembers (mockClientListGenerator,
2812++ CompPoint (screenSize.width () * 1.5,
2813++ screenSize.height () * 1.5),
2814++ vpSize,
2815++ screenSize,
2816++ activeStates);
2817++
2818++ ASSERT_EQ (activeStates.size (), vpSize.width () * vpSize.height ());
2819++ EXPECT_EQ (activeStates[0], false);
2820++ EXPECT_EQ (activeStates[1], false);
2821++ EXPECT_EQ (activeStates[2], false);
2822++ EXPECT_EQ (activeStates[3], true); // 2,2 has a window on it
2823++}
2824+Index: ubuntu/plugins/expo/src/client-list-generator.h
2825+===================================================================
2826+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2827++++ ubuntu/plugins/expo/src/client-list-generator.h 2012-09-12 22:20:43.304760606 +0800
2828+@@ -0,0 +1,45 @@
2829++/*
2830++ * Copyright © 2012 Canonical Ltd.
2831++ *
2832++ * Permission to use, copy, modify, distribute, and sell this software
2833++ * and its documentation for any purpose is hereby granted without
2834++ * fee, provided that the above copyright notice appear in all copies
2835++ * and that both that copyright notice and this permission notice
2836++ * appear in supporting documentation, and that the name of
2837++ * Canonical Ltd. not be used in advertising or publicity pertaining to
2838++ * distribution of the software without specific, written prior permission.
2839++ * Canonical Ltd. makes no representations about the suitability of this
2840++ * software for any purpose. It is provided "as is" without express or
2841++ * implied warranty.
2842++ *
2843++ * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
2844++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
2845++ * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
2846++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
2847++ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
2848++ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
2849++ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2850++ *
2851++ * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
2852++ */
2853++#ifndef _COMPIZ_EXPO_CLIENT_LIST_GENERATOR_H
2854++#define _COMPIZ_EXPO_CLIENT_LIST_GENERATOR_H
2855++
2856++namespace compiz
2857++{
2858++ namespace expo
2859++ {
2860++ class ViewportMemberWindow;
2861++
2862++ class ClientListGenerator
2863++ {
2864++ public:
2865++
2866++ virtual ~ClientListGenerator () {};
2867++ virtual ViewportMemberWindow * nextClient () = 0;
2868++ };
2869++ }
2870++}
2871++#endif
2872++
2873++
2874+Index: ubuntu/plugins/expo/src/viewport-member-window.h
2875+===================================================================
2876+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2877++++ ubuntu/plugins/expo/src/viewport-member-window.h 2012-09-12 22:20:43.304760606 +0800
2878+@@ -0,0 +1,46 @@
2879++/*
2880++ * Copyright © 2012 Canonical Ltd.
2881++ *
2882++ * Permission to use, copy, modify, distribute, and sell this software
2883++ * and its documentation for any purpose is hereby granted without
2884++ * fee, provided that the above copyright notice appear in all copies
2885++ * and that both that copyright notice and this permission notice
2886++ * appear in supporting documentation, and that the name of
2887++ * Canonical Ltd. not be used in advertising or publicity pertaining to
2888++ * distribution of the software without specific, written prior permission.
2889++ * Canonical Ltd. makes no representations about the suitability of this
2890++ * software for any purpose. It is provided "as is" without express or
2891++ * implied warranty.
2892++ *
2893++ * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
2894++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
2895++ * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
2896++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
2897++ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
2898++ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
2899++ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2900++ *
2901++ * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
2902++ */
2903++#ifndef _COMPIZ_EXPO_VIEWPORT_MEMBER_WINDOW_H
2904++#define _COMPIZ_EXPO_VIEWPORT_MEMBER_WINDOW_H
2905++
2906++#include <core/windowgeometry.h>
2907++
2908++namespace compiz
2909++{
2910++ namespace expo
2911++ {
2912++ class ViewportMemberWindow
2913++ {
2914++ public:
2915++
2916++ virtual ~ViewportMemberWindow () {};
2917++ virtual const compiz::window::Geometry & absoluteGeometry () const = 0;
2918++ virtual bool dragged () const = 0;
2919++ virtual bool isDesktopOrDock () const = 0;
2920++ };
2921++ }
2922++}
2923++
2924++#endif
2925
2926=== removed file 'debian/patches/100_expo_layout.patch'
2927--- debian/patches/100_expo_layout.patch 2012-09-10 13:50:30 +0000
2928+++ debian/patches/100_expo_layout.patch 1970-01-01 00:00:00 +0000
2929@@ -1,2903 +0,0 @@
2930-Index: ubuntu/plugins/expo/expo.xml.in
2931-===================================================================
2932---- ubuntu.orig/plugins/expo/expo.xml.in 2012-09-08 11:51:32.971327571 +0800
2933-+++ ubuntu/plugins/expo/expo.xml.in 2012-09-08 11:51:33.103328227 +0800
2934-@@ -17,6 +17,7 @@
2935- <plugin>wobbly</plugin>
2936- <plugin>animation</plugin>
2937- <plugin>wallpaper</plugin>
2938-+ <plugin>imgpng</plugin>
2939- </relation>
2940- </deps>
2941- <options>
2942-@@ -25,7 +26,7 @@
2943- <option name="expo_key" type="key">
2944- <_short>Expo key</_short>
2945- <_long>Engage wall expo mode key binding</_long>
2946-- <default>&lt;Super&gt;e</default>
2947-+ <default>&lt;Super&gt;s</default>
2948- </option>
2949- <option name="expo_button" type="button">
2950- <_short>Expo button</_short>
2951-@@ -35,8 +36,6 @@
2952- <option name="expo_edge" type="edge">
2953- <_short>Expo edge</_short>
2954- <_long>Engage wall expo mode edge binding</_long>
2955-- <default>
2956-- </default>
2957- </option>
2958- <option name="double_click_time" type="int">
2959- <_short>Double click time</_short>
2960-@@ -79,7 +78,7 @@
2961- <option name="zoom_time" type="float">
2962- <_short>Zoom time</_short>
2963- <_long>Duration of the zoomout animation</_long>
2964-- <default>0.5</default>
2965-+ <default>0.3</default>
2966- <min>0.1</min>
2967- <max>5.0</max>
2968- <precision>0.1</precision>
2969-@@ -130,10 +129,24 @@
2970- <_name>Curve</_name>
2971- </desc>
2972- </option>
2973-+ <option name="x_offset" type="int">
2974-+ <_short>X Space</_short>
2975-+ <_long> Left Side screen space of expo in pixels</_long>
2976-+ <min>-1680</min>
2977-+ <max>1680</max>
2978-+ <default>64</default>
2979-+ </option>
2980-+ <option name="y_offset" type="int">
2981-+ <_short>Y Space</_short>
2982-+ <_long> Top Side screen space of expo in pixels</_long>
2983-+ <min>-100</min>
2984-+ <max>100</max>
2985-+ <default>24</default>
2986-+ </option>
2987- <option name="distance" type="float">
2988- <_short>Distance</_short>
2989- <_long>Distance of the expo wall</_long>
2990-- <default>0.0</default>
2991-+ <default>0.005</default>
2992- <min>0.0</min>
2993- <max>1.0</max>
2994- <precision>0.01</precision>
2995-@@ -141,7 +154,7 @@
2996- <option name="vp_distance" type="float">
2997- <_short>Viewport distance</_short>
2998- <_long>Distance between viewports</_long>
2999-- <default>0.10</default>
3000-+ <default>0.2</default>
3001- <min>0.0</min>
3002- <max>1.0</max>
3003- <precision>0.01</precision>
3004-@@ -192,7 +205,7 @@
3005- <option name="vp_brightness" type="float">
3006- <_short>Brightness</_short>
3007- <_long>Inactive viewport brightness.</_long>
3008-- <default>75.0</default>
3009-+ <default>40.0</default>
3010- <min>0.0</min>
3011- <max>100.0</max>
3012- <precision>0.1</precision>
3013-@@ -200,18 +213,28 @@
3014- <option name="vp_saturation" type="float">
3015- <_short>Saturation</_short>
3016- <_long>Inactive viewport saturation.</_long>
3017-- <default>100.0</default>
3018-+ <default>40.0</default>
3019- <min>0.0</min>
3020- <max>100.0</max>
3021- <precision>0.1</precision>
3022- </option>
3023-+ <option name="selected_color" type="color">
3024-+ <_short>Selected Color</_short>
3025-+ <_long>Color to use when highlighting the selected viewport</_long>
3026-+ <default>
3027-+ <red>0xfbfb</red>
3028-+ <green>0x8b8b</green>
3029-+ <blue>0x0</blue>
3030-+ <alpha>0xffff</alpha>
3031-+ </default>
3032-+ </option>
3033- </subgroup>
3034- <subgroup>
3035- <short>Reflection</short>
3036- <option name="reflection" type="bool">
3037- <_short>Reflection</_short>
3038- <_long>Show a reflection of the viewports on the ground</_long>
3039-- <default>true</default>
3040-+ <default>false</default>
3041- </option>
3042- <option name="ground_color1" type="color">
3043- <_short>Ground color(near)</_short>
3044-@@ -244,7 +267,7 @@
3045- <option name="scale_factor" type="float">
3046- <_short>Reflection Scale</_short>
3047- <_long>Scale factor of the expo wall reflection</_long>
3048-- <default>0.75</default>
3049-+ <default>1.0</default>
3050- <min>0.0</min>
3051- <max>2.0</max>
3052- <precision>0.01</precision>
3053-Index: ubuntu/plugins/expo/src/expo.cpp
3054-===================================================================
3055---- ubuntu.orig/plugins/expo/src/expo.cpp 2012-09-08 11:51:02.279175377 +0800
3056-+++ ubuntu/plugins/expo/src/expo.cpp 2012-09-08 15:18:15.744829608 +0800
3057-@@ -27,6 +27,8 @@
3058-
3059- #include "expo.h"
3060- #include "click-threshold.h"
3061-+#include "wall-offset.h"
3062-+#include "windows-on-viewport.h"
3063- #include <math.h>
3064- #ifndef USE_GLES
3065- #include <GL/glu.h>
3066-@@ -73,11 +75,10 @@
3067-
3068- if (dndState == DnDDuring || dndState == DnDStart)
3069- {
3070-- if (dndWindow)
3071-+ if (dndWindows.size ())
3072- finishWindowMovement ();
3073-
3074- dndState = DnDNone;
3075-- dndWindow = NULL;
3076-
3077- action->setState (action->state () & CompAction::StateInitButton);
3078- cScreen->damageScreen ();
3079-@@ -113,7 +114,6 @@
3080- clickTime = 0;
3081-
3082- dndState = DnDNone;
3083-- dndWindow = NULL;
3084-
3085- selectedVp = screen->vp ();
3086- lastSelectedVp = screen->vp ();
3087-@@ -156,8 +156,8 @@
3088- else
3089- vpUpdateMode = VPUpdateMouseOver;
3090-
3091-- dndState = DnDNone;
3092-- dndWindow = NULL;
3093-+ dndState = DnDNone;
3094-+ dndWindows.clear ();
3095-
3096- screen->removeAction (&optionGetDndButton ());
3097- screen->removeAction (&optionGetExitButton ());
3098-@@ -202,6 +202,8 @@
3099- if (!expoMode)
3100- return false;
3101-
3102-+ lastSelectedVp = selectedVp;
3103-+
3104- newX = selectedVp.x () + 1;
3105- newY = selectedVp.y ();
3106-
3107-@@ -225,7 +227,7 @@
3108- CompAction::State state,
3109- CompOption::Vector& options)
3110- {
3111-- int newX, newY;
3112-+ unsigned int newX, newY;
3113- Window xid = CompOption::getIntOptionNamed (options, "root", 0);
3114- if (xid != screen->root ())
3115- return false;
3116-@@ -272,53 +274,39 @@
3117- void
3118- ExpoScreen::finishWindowMovement ()
3119- {
3120-- dndWindow->syncPosition ();
3121-- dndWindow->ungrabNotify ();
3122--
3123-- screen->moveViewport (screen->vp ().x () - selectedVp.x (),
3124-- screen->vp ().y () - selectedVp.y (), true);
3125--
3126-- /* update saved window attributes in case we moved the
3127-- window to a new viewport */
3128-- if (dndWindow->saveMask () & CWX)
3129-- {
3130-- dndWindow->saveWc ().x = dndWindow->saveWc ().x % screen->width ();
3131-- if (dndWindow->saveWc ().x < 0)
3132-- dndWindow->saveWc ().x += screen->width ();
3133-- }
3134-- if (dndWindow->saveMask () & CWY)
3135-+ foreach (CompWindow *dndWindow, dndWindows)
3136- {
3137-- dndWindow->saveWc ().y = dndWindow->saveWc ().y % screen->height ();
3138-- if (dndWindow->saveWc ().y < 0)
3139-- dndWindow->saveWc ().y += screen->height ();
3140-- }
3141--
3142-- /* update window attibutes to make sure a moved maximized window
3143-- is properly snapped to the work area */
3144-- if (dndWindow->state () & MAXIMIZE_STATE)
3145-- dndWindow->updateAttributes (CompStackingUpdateModeNone);
3146--
3147--#if 0 /* FIXME: obsolete in the meantime? */
3148-- {
3149-- int lastOutput;
3150-- int centerX, centerY;
3151-+ if (dndWindow->grabbed ())
3152-+ {
3153-+ dndWindow->syncPosition ();
3154-+ dndWindow->ungrabNotify ();
3155-
3156-- /* make sure we snap to the correct output */
3157-- lastOutput = s->currentOutputDev;
3158-- centerX = (WIN_X (w) + WIN_W (w) / 2) % s->width;
3159-- if (centerX < 0)
3160-- centerX += s->width;
3161-- centerY = (WIN_Y (w) + WIN_H (w) / 2) % s->height;
3162-- if (centerY < 0)
3163-- centerY += s->height;
3164-+ screen->updateGrab (grabIndex, None);
3165-
3166-- s->currentOutputDev = outputDeviceForPoint (s, centerX, centerY);
3167-+ screen->moveViewport (screen->vp ().x () - selectedVp.x (),
3168-+ screen->vp ().y () - selectedVp.y (), true);
3169-
3170-- updateWindowAttributes (w, CompStackingUpdateModeNone);
3171-+ /* update saved window attributes in case we moved the
3172-+ window to a new viewport */
3173-+ if (dndWindow->saveMask () & CWX)
3174-+ {
3175-+ dndWindow->saveWc ().x = dndWindow->saveWc ().x % screen->width ();
3176-+ if (dndWindow->saveWc ().x < 0)
3177-+ dndWindow->saveWc ().x += screen->width ();
3178-+ }
3179-+ if (dndWindow->saveMask () & CWY)
3180-+ {
3181-+ dndWindow->saveWc ().y = dndWindow->saveWc ().y % screen->height ();
3182-+ if (dndWindow->saveWc ().y < 0)
3183-+ dndWindow->saveWc ().y += screen->height ();
3184-+ }
3185-
3186-- s->currentOutputDev = lastOutput;
3187-+ /* update window attibutes to make sure a moved maximized window
3188-+ is properly snapped to the work area */
3189-+ if (dndWindow->state () & MAXIMIZE_STATE)
3190-+ dndWindow->updateAttributes (CompStackingUpdateModeNone);
3191-+ }
3192- }
3193--#endif
3194- }
3195-
3196- void
3197-@@ -402,6 +390,80 @@
3198- screen->handleEvent (event);
3199- }
3200-
3201-+bool
3202-+ExpoWindow::dragged () const
3203-+{
3204-+ ExpoScreen *es = ExpoScreen::get (screen);
3205-+
3206-+ return std::find (es->dndWindows.begin (), es->dndWindows.end (), window) != es->dndWindows.end ();
3207-+}
3208-+
3209-+const compiz::window::Geometry &
3210-+ExpoWindow::absoluteGeometry () const
3211-+{
3212-+ const compiz::window::Geometry &relativeGeometry (window->geometry ());
3213-+ mAbsoluteGeometry.set ((screen->vp ().x () * screen->width ()) + relativeGeometry.x (),
3214-+ (screen->vp ().y () * screen->height ()) + relativeGeometry.y (),
3215-+ relativeGeometry.width (),
3216-+ relativeGeometry.height (),
3217-+ relativeGeometry.border ());
3218-+
3219-+ return mAbsoluteGeometry;
3220-+}
3221-+
3222-+bool
3223-+ExpoWindow::isDesktopOrDock () const
3224-+{
3225-+ return window->type () == CompWindowTypeDesktopMask ||
3226-+ window->type () == CompWindowTypeDockMask;
3227-+}
3228-+
3229-+namespace cei = compiz::expo::impl;
3230-+
3231-+cei::CompizClientListGenerator::CompizClientListGenerator (CompScreen *screen) :
3232-+ mScreen (screen),
3233-+ mClientList (&mScreen->clientList (true)),
3234-+ mClientListIterator (mClientList->begin ())
3235-+{
3236-+}
3237-+
3238-+compiz::expo::ViewportMemberWindow *
3239-+cei::CompizClientListGenerator::nextClient ()
3240-+{
3241-+ if (mClientListIterator == mClientList->end ())
3242-+ return NULL;
3243-+
3244-+ compiz::expo::ViewportMemberWindow *vpMemberWindow = ExpoWindow::get (*mClientListIterator);
3245-+
3246-+ ++mClientListIterator;
3247-+
3248-+ return vpMemberWindow;
3249-+}
3250-+
3251-+bool
3252-+ExpoScreen::windowsOnVp (compiz::expo::ClientListGenerator &clientList,
3253-+ CompPoint &p,
3254-+ const CompPoint &unprojectedCursor,
3255-+ const CompSize &screenSize,
3256-+ CompScreen *screen)
3257-+{
3258-+ return false;
3259-+}
3260-+
3261-+namespace
3262-+{
3263-+ void fillInNewViewportActivityData (unsigned int vpCount,
3264-+ std::vector <float> &vpActivity)
3265-+ {
3266-+ if (vpActivity.size () < vpCount)
3267-+ {
3268-+ vpActivity.resize (vpCount);
3269-+ foreach (float& activity, vpActivity)
3270-+ activity = 1.0f;
3271-+ }
3272-+ }
3273-+}
3274-+
3275- void
3276- ExpoScreen::preparePaint (int msSinceLastPaint)
3277- {
3278-@@ -412,33 +474,42 @@
3279- else
3280- expoCam = MAX (0.0, expoCam - val);
3281-
3282-- if (expoCam)
3283-+ if (dndState == DnDDuring)
3284- {
3285-- unsigned int i, j, vp;
3286-- unsigned int vpCount = screen->vpSize ().width () *
3287-- screen->vpSize ().height ();
3288-+ foreach (CompWindow *w, dndWindows)
3289-+ ExpoWindow::get (w)->dndOpacity = MIN (1.0, ExpoWindow::get (w)->dndOpacity + val);
3290-+ }
3291-+ else if (dndState == DnDNone)
3292-+ {
3293-+ CompWindowList::iterator it = dndWindows.begin ();
3294-
3295-- if (vpActivity.size () < vpCount)
3296-+ while (it != dndWindows.end ())
3297- {
3298-- vpActivity.resize (vpCount);
3299-- foreach (float& activity, vpActivity)
3300-- activity = 1.0f;
3301-- }
3302-+ ExpoWindow::get ((*it))->dndOpacity = MAX (0.0, ExpoWindow::get ((*it))->dndOpacity - val);
3303-
3304-- for (i = 0; i < (unsigned int) screen->vpSize ().width (); i++)
3305-- {
3306-- for (j = 0; j < (unsigned int) screen->vpSize ().height (); j++)
3307-+ if (ExpoWindow::get ((*it))->dndOpacity <= 0.0f)
3308- {
3309-- vp = (j * screen->vpSize ().width ()) + i;
3310--
3311-- if (CompPoint (i, j) == selectedVp)
3312-- vpActivity[vp] = MIN (1.0, vpActivity[vp] + val);
3313-- else
3314-- vpActivity[vp] = MAX (0.0, vpActivity[vp] - val);
3315-+ dndWindows.erase (it);
3316-+ it = dndWindows.begin ();
3317- }
3318-+ else
3319-+ it++;
3320- }
3321-+ }
3322-
3323-- for (i = 0; i < 360; i++)
3324-+ if (expoCam)
3325-+ {
3326-+ unsigned int vpCount = compiz::expo::countViewports (screen->vpSize ());
3327-+
3328-+ fillInNewViewportActivityData (vpCount, vpActivity);
3329-+
3330-+ for (unsigned int i = 0; i < vpCount; i++)
3331-+ if (vpActive[i])
3332-+ vpActivity[i] = MIN (1.0, vpActivity[i] + val);
3333-+ else
3334-+ vpActivity[i] = MAX (0.0, vpActivity[i] - val);
3335-+
3336-+ for (int i = 0; i < 360; i++)
3337- {
3338- float fi = (float) i;
3339-
3340-@@ -509,6 +580,31 @@
3341- cScreen->paint (outputs, mask);
3342- }
3343-
3344-+namespace
3345-+{
3346-+ void updateViewportActiveStates (CompScreen *screen)
3347-+ {
3348-+ ExpoScreen *es = ExpoScreen::get (screen);
3349-+
3350-+ unsigned int vpCount = compiz::expo::countViewports (screen->vpSize ());
3351-+ fillInNewViewportActivityData (vpCount, es->vpActivity);
3352-+
3353-+ for (int i = 0; i < screen->vpSize ().width (); i++)
3354-+ {
3355-+ for (int j = 0; j < screen->vpSize ().height (); j++)
3356-+ {
3357-+ compiz::expo::impl::CompizClientListGenerator clientList (screen);
3358-+
3359-+ compiz::expo::activeViewportsForMembers (clientList,
3360-+ es->newCursor,
3361-+ screen->vpSize (),
3362-+ *screen,
3363-+ es->vpActive);
3364-+ }
3365-+ }
3366-+ }
3367-+}
3368-+
3369- void
3370- ExpoScreen::donePaint ()
3371- {
3372-@@ -539,6 +635,11 @@
3373- foreach (float& vp, vpActivity)
3374- if (vp != 0.0 && vp != 1.0)
3375- cScreen->damageScreen ();
3376-+
3377-+ foreach (CompWindow *w, dndWindows)
3378-+ if (ExpoWindow::get (w)->dndOpacity != 0.0f &&
3379-+ ExpoWindow::get (w)->dndOpacity != 1.0f)
3380-+ cScreen->damageScreen ();
3381- }
3382-
3383- if (grabIndex && expoCam <= 0.0f && !expoMode)
3384-@@ -553,10 +654,25 @@
3385- switch (dndState) {
3386- case DnDDuring:
3387- {
3388-- if (dndWindow)
3389-- dndWindow->move (newCursor.x () - prevCursor.x (),
3390-- newCursor.y () - prevCursor.y (),
3391-- optionGetExpoImmediateMove ());
3392-+ if (dndWindows.size ())
3393-+ {
3394-+ foreach (CompWindow *dndWindow, dndWindows)
3395-+ {
3396-+ if (dndWindow->grabbed ())
3397-+ {
3398-+ ExpoWindow *ew = ExpoWindow::get (dndWindow);
3399-+
3400-+ /* No need to update twice */
3401-+ dndWindow->moveNotifySetEnabled (ew, false);
3402-+ dndWindow->move (newCursor.x () - prevCursor.x (),
3403-+ newCursor.y () - prevCursor.y (),
3404-+ optionGetExpoImmediateMove ());
3405-+ dndWindow->moveNotifySetEnabled (ew, true);
3406-+
3407-+ updateViewportActiveStates (screen);
3408-+ }
3409-+ }
3410-+ }
3411-
3412- prevCursor = newCursor;
3413- cScreen->damageScreen ();
3414-@@ -621,13 +737,13 @@
3415- break;
3416-
3417- dndState = DnDDuring;
3418-- dndWindow = w;
3419-+ dndWindows.push_back (w);
3420-
3421- w->grabNotify (nx, ny, 0,
3422- CompWindowGrabMoveMask |
3423- CompWindowGrabButtonMask);
3424-
3425-- screen->updateGrab (grabIndex, dragCursor);
3426-+ screen->updateGrab (grabIndex, mMoveCursor);
3427-
3428- w->raise ();
3429- w->moveInputFocusTo ();
3430-@@ -762,6 +878,124 @@
3431- }
3432-
3433- void
3434-+ExpoScreen::paintViewport (const GLScreenPaintAttrib& attrib,
3435-+ const GLMatrix& transform,
3436-+ const CompRegion& region,
3437-+ CompOutput *output,
3438-+ unsigned int mask,
3439-+ CompPoint vpPos,
3440-+ GLVector &vpCamPos,
3441-+ bool reflection)
3442-+{
3443-+ GLMatrix sTransform (transform);
3444-+ GLMatrix sTransform2, sTransform3;
3445-+ float sx = (float) screen->width () / output->width ();
3446-+ float sy = (float) screen->height () / output->height ();
3447-+ float vpp;
3448-+ float progress = sigmoidProgress (expoCam);
3449-+ unsigned int vp;
3450-+ CompPoint vpSize (screen->vpSize ().width (), screen->vpSize ().height ());
3451-+
3452-+ const float gapY = optionGetVpDistance () * 0.1f * expoCam;
3453-+ const float gapX = optionGetVpDistance () * 0.1f * screen->height () /
3454-+ screen->width () * expoCam;
3455-+
3456-+ /* not sure this will work with different resolutions */
3457-+ sTransform.translate (0.0, MAX (0, vpPos.y ()) * -(sy + gapY), 0.0f);
3458-+
3459-+ sTransform2 = sTransform;
3460-+
3461-+ /* not sure this will work with different resolutions */
3462-+ if (optionGetDeform () != DeformCurve)
3463-+ sTransform2.translate (MAX (0, vpPos.x ()) * (sx + gapX), 0.0f, 0.0);
3464-+
3465-+
3466-+ if (optionGetExpoAnimation () == ExpoAnimationVortex)
3467-+ sTransform2.rotate (360 * expoCam,
3468-+ 0.0f, 1.0f, 2.0f * expoCam);
3469-+
3470-+ sTransform3 = sTransform2;
3471-+
3472-+ sTransform3.translate (output->x () / output->width (),
3473-+ -output->y () / output->height (), 0.0);
3474-+
3475-+ cScreen->setWindowPaintOffset ((screen->vp ().x () - vpPos.x ()) *
3476-+ screen->width (),
3477-+ (screen->vp ().y () - vpPos.y ()) *
3478-+ screen->height ());
3479-+
3480-+ vp = (vpPos.y () * vpSize.x ()) + vpPos.x ();
3481-+
3482-+ vpp = (expoCam * vpActivity[vp]) + (1 - expoCam);
3483-+ vpp = sigmoidProgress (vpp);
3484-+
3485-+ vpBrightness = vpp + ((1.0 - vpp) *
3486-+ optionGetVpBrightness () / 100.0);
3487-+ vpSaturation = vpp + ((1.0 - vpp) *
3488-+ optionGetVpSaturation () / 100.0);
3489-+
3490-+ paintingVp = vpPos;
3491-+
3492-+ if (optionGetDeform () == DeformCurve)
3493-+ {
3494-+ float rotateX;
3495-+
3496-+ sTransform3.translate (-vpCamPos[GLVector::x], 0.0f,
3497-+ curveDistance - DEFAULT_Z_CAMERA);
3498-+
3499-+ rotateX = -vpPos.x () + interpolate (((float) vpSize.x () / 2.0) - 0.5,
3500-+ screen->vp ().x (), progress);
3501-+
3502-+ sTransform3.rotate (curveAngle * rotateX, 0.0, 1.0, 0.0);
3503-+
3504-+ sTransform3.translate (vpCamPos[GLVector::x], 0.0f,
3505-+ DEFAULT_Z_CAMERA - curveDistance);
3506-+ }
3507-+
3508-+ if (paintingDndWindow)
3509-+ cScreen->getWindowPaintListSetEnabled (this, true);
3510-+ gScreen->glPaintTransformedOutput (attrib, sTransform3,
3511-+ screen->region (), output,
3512-+ mask);
3513-+
3514-+ if (paintingDndWindow)
3515-+ cScreen->getWindowPaintListSetEnabled (this, false);
3516-+
3517-+ if (!reflection && !paintingDndWindow)
3518-+ {
3519-+ int cursor[2] = { pointerX, pointerY };
3520-+
3521-+ invertTransformedVertex (attrib, sTransform3,
3522-+ output, cursor);
3523-+
3524-+ if ((cursor[0] > 0) && (cursor[0] < (int) screen->width ()) &&
3525-+ (cursor[1] > 0) && (cursor[1] < (int) screen->height ()))
3526-+ {
3527-+ newCursor.setX (vpPos.x () * screen->width () + cursor[0]);
3528-+ newCursor.setY (vpPos.y () * screen->height () + cursor[1]);
3529-+
3530-+ if (anyClick || dndState != DnDNone)
3531-+ {
3532-+ /* Used to save last viewport interaction was in */
3533-+ selectedVp = vpPos;
3534-+ anyClick = false;
3535-+ }
3536-+ }
3537-+ }
3538-+
3539-+ /* Calculate the current viewport size */
3540-+ int tl[2] = { 0, 0 };
3541-+ int br[2] = { screen->width (), screen->height () };
3542-+
3543-+ invertTransformedVertex (attrib, sTransform3, output, tl);
3544-+ invertTransformedVertex (attrib, sTransform3, output, br);
3545-+
3546-+ viewport_size = CompSize (br[0] - tl[0], br[1] - tl[1]);
3547-+
3548-+ cScreen->setWindowPaintOffset (0, 0);
3549-+}
3550-+
3551-+void
3552- ExpoScreen::paintWall (const GLScreenPaintAttrib& attrib,
3553- const GLMatrix& transform,
3554- const CompRegion& region,
3555-@@ -772,13 +1006,11 @@
3556- GLfloat vertexData[12];
3557- GLushort colorData[16];
3558- GLMatrix sTransformW, sTransform (transform);
3559-- int i, j, vp;
3560- GLenum oldFilter = gScreen->textureFilter ();
3561--
3562-- float sx = (float) screen->width () / output->width ();
3563-- float sy = (float) screen->height () / output->height ();
3564-+ float sx = (float) screen->width () / output->width ();
3565-+ float sy = (float) screen->height () / output->height ();
3566- float biasZ;
3567-- float oScale, rotation = 0.0f, progress, vpp;
3568-+ float oScale, rotation = 0.0f, progress;
3569- float aspectX = 1.0f, aspectY = 1.0f;
3570- GLVector cam;
3571- CompPoint vpSize (screen->vpSize ().width (), screen->vpSize ().height ());
3572-@@ -910,9 +1142,24 @@
3573- sTransform.rotate (rotation, 0.0f, 1.0f, 0.0f);
3574- sTransform.scale (aspectX, aspectY, 1.0);
3575-
3576-+ CompPoint offsetInScreenCoords (optionGetXOffset (),
3577-+ optionGetYOffset ());
3578-+ float offsetInWorldCoordX, offsetInWorldCoordY, worldScaleFactorX, worldScaleFactorY;
3579-+
3580-+ compiz::expo::calculateWallOffset (*output,
3581-+ offsetInScreenCoords,
3582-+ vpSize,
3583-+ *screen,
3584-+ offsetInWorldCoordX,
3585-+ offsetInWorldCoordY,
3586-+ worldScaleFactorX,
3587-+ worldScaleFactorY,
3588-+ sigmoidProgress (expoCam));
3589-+
3590- /* translate expo to center */
3591-- sTransform.translate (vpSize.x () * sx * -0.5,
3592-- vpSize.y () * sy * 0.5, 0.0f);
3593-+ sTransform.translate (vpSize.x () * sx * -0.5 + offsetInWorldCoordX,
3594-+ vpSize.y () * sy * 0.5 - offsetInWorldCoordY, 0.0f);
3595-+ sTransform.scale (worldScaleFactorX, worldScaleFactorY, 1.0f);
3596-
3597- if (optionGetDeform () == DeformCurve)
3598- sTransform.translate ((vpSize.x () - 1) * sx * 0.5, 0.0, 0.0);
3599-@@ -936,90 +1183,29 @@
3600-
3601- expoActive = true;
3602-
3603-- for (j = 0; j < vpSize.y (); j++)
3604-- {
3605-- GLMatrix sTransform2 (sTransform), sTransform3;
3606--
3607-- for (i = 0; i < vpSize.x (); i++)
3608-- {
3609-- if (optionGetExpoAnimation () == ExpoAnimationVortex)
3610-- sTransform2.rotate (360 * expoCam,
3611-- 0.0f, 1.0f, 2.0f * expoCam);
3612--
3613-- sTransform3 = sTransform2;
3614--
3615-- sTransform3.translate (output->x () / output->width (),
3616-- -output->y () / output->height (), 0.0);
3617--
3618-- cScreen->setWindowPaintOffset ((screen->vp ().x () - i) *
3619-- screen->width (),
3620-- (screen->vp ().y () - j) *
3621-- screen->height ());
3622--
3623-- vp = (j * vpSize.x ()) + i;
3624--
3625-- vpp = (expoCam * vpActivity[vp]) + (1 - expoCam);
3626-- vpp = sigmoidProgress (vpp);
3627--
3628-- vpBrightness = vpp + ((1.0 - vpp) *
3629-- optionGetVpBrightness () / 100.0);
3630-- vpSaturation = vpp + ((1.0 - vpp) *
3631-- optionGetVpSaturation () / 100.0);
3632-+ for (int j = 0; j < screen->vpSize ().height (); j++)
3633-+ for (int i = 0; i < screen->vpSize().width (); i++)
3634-+ paintViewport (attrib, sTransform, region, output, mask, CompPoint (i, j), vpCamPos, reflection);
3635-
3636-- paintingVp.set (i, j);
3637-+ paintingDndWindow = true;
3638-
3639-- if (optionGetDeform () == DeformCurve)
3640-- {
3641-- float rotateX;
3642--
3643-- sTransform3.translate (-vpCamPos[GLVector::x], 0.0f,
3644-- curveDistance - DEFAULT_Z_CAMERA);
3645--
3646-- rotateX = -i + interpolate (((float) vpSize.x () / 2.0) - 0.5,
3647-- screen->vp ().x (), progress);
3648--
3649-- sTransform3.rotate (curveAngle * rotateX, 0.0, 1.0, 0.0);
3650--
3651-- sTransform3.translate (vpCamPos[GLVector::x], 0.0f,
3652-- DEFAULT_Z_CAMERA - curveDistance);
3653-- }
3654--
3655-- gScreen->glPaintTransformedOutput (attrib, sTransform3,
3656-- screen->region (), output,
3657-- mask);
3658--
3659-- if (!reflection)
3660-- {
3661-- int cursor[2] = { pointerX, pointerY };
3662-+ foreach (CompWindow *dndWindow, dndWindows)
3663-+ {
3664-+ CompPoint vp;
3665-
3666-- invertTransformedVertex (attrib, sTransform3,
3667-- output, cursor);
3668-+ screen->viewportForGeometry (dndWindow->geometry (), vp);
3669-
3670-- if ((cursor[0] > 0) && (cursor[0] < (int) screen->width ()) &&
3671-- (cursor[1] > 0) && (cursor[1] < (int) screen->height ()))
3672-- {
3673-- newCursor.setX (i * screen->width () + cursor[0]);
3674-- newCursor.setY (j * screen->height () + cursor[1]);
3675-+ while (vp.x () < 0)
3676-+ vp.setX (screen->vpSize ().width () + vp.x ());
3677-
3678-- if (anyClick || dndState != DnDNone)
3679-- {
3680-- /* Used to save last viewport interaction was in */
3681-- lastSelectedVp = selectedVp;
3682-- selectedVp.set (i, j);
3683-- anyClick = false;
3684-- }
3685-- }
3686-- }
3687-+ while (vp.y () < 0)
3688-+ vp.setY (screen->vpSize ().height () + vp.y ());
3689-
3690-- /* not sure this will work with different resolutions */
3691-- if (optionGetDeform () != DeformCurve)
3692-- sTransform2.translate (sx + gapX, 0.0f, 0.0);
3693-- }
3694--
3695-- /* not sure this will work with different resolutions */
3696-- sTransform.translate (0.0, -(sy + gapY), 0.0f);
3697-+ paintViewport (attrib, sTransform, infiniteRegion, output, mask, vp, vpCamPos, reflection);
3698- }
3699-
3700-+ paintingDndWindow = false;
3701-+
3702- // glNormal3f (0.0, 0.0, -1.0);
3703-
3704- if (reflection)
3705-@@ -1187,12 +1373,16 @@
3706-
3707- expoActive = false;
3708-
3709-- cScreen->setWindowPaintOffset (0, 0);
3710--
3711- gScreen->glPaintTransformedOutputSetCurrentIndex (glPaintTransformedOutputIndex);
3712- gScreen->setTextureFilter (oldFilter);
3713- }
3714-
3715-+const CompWindowList &
3716-+ExpoScreen::getWindowPaintList ()
3717-+{
3718-+ return dndWindows;
3719-+}
3720-+
3721- bool
3722- ExpoScreen::glPaintOutput (const GLScreenPaintAttrib& attrib,
3723- const GLMatrix& transform,
3724-@@ -1243,10 +1433,15 @@
3725-
3726- bool
3727- ExpoWindow::glDraw (const GLMatrix& transform,
3728-- const GLWindowPaintAttrib &attrib,
3729-+ const GLWindowPaintAttrib &attrib,
3730- const CompRegion& region,
3731- unsigned int mask)
3732- {
3733-+ GLMatrix wTransform (transform);
3734-+ CompPoint vp;
3735-+
3736-+ screen->viewportForGeometry (window->geometry (), vp);
3737-+
3738- if (eScreen->expoCam == 0.0f)
3739- return gWindow->glDraw (transform, attrib, region, mask);
3740-
3741-@@ -1275,8 +1470,11 @@
3742- }
3743- }
3744-
3745-- eAttrib.brightness = attrib.brightness * eScreen->vpBrightness;
3746-- eAttrib.saturation = attrib.saturation * eScreen->vpSaturation;
3747-+ if ((vp == eScreen->paintingVp || window->onAllViewports ()) && !eScreen->paintingDndWindow)
3748-+ {
3749-+ eAttrib.brightness = attrib.brightness * eScreen->vpBrightness;
3750-+ eAttrib.saturation = attrib.saturation * eScreen->vpSaturation;
3751-+ }
3752- }
3753- else
3754- {
3755-@@ -1287,7 +1485,79 @@
3756- (1 - sigmoidProgress (eScreen->expoCam));
3757- }
3758-
3759-- return gWindow->glDraw (transform, eAttrib, region, mask);
3760-+ bool status = gWindow->glDraw (transform, eAttrib, region, mask);
3761-+
3762-+ if (window->type () & CompWindowTypeDesktopMask)
3763-+ {
3764-+ /* We want to set the geometry of the polka dots to the window
3765-+ * region */
3766-+ CompRegion reg = CompRegion (0, 0, window->width (), window->height ());
3767-+
3768-+ foreach(GLTexture * tex, eScreen->polkadots_texture)
3769-+ {
3770-+ GLTexture::MatrixList matl;
3771-+ GLTexture::Matrix mat = tex->matrix();
3772-+ CompRegion paintRegion(region);
3773-+
3774-+ float xScale = screen->width () / (float) eScreen->viewport_size.width ();
3775-+ float yScale = screen->height () / (float) eScreen->viewport_size.height ();
3776-+
3777-+ mat.xx *= xScale;
3778-+ mat.yy *= yScale;
3779-+
3780-+ /* Not sure what this does, but it is necessary
3781-+ * (adjusts for scale?) */
3782-+ mat.x0 -= mat.xx * reg.boundingRect().x1();
3783-+ mat.y0 -= mat.yy * reg.boundingRect().y1();
3784-+
3785-+ matl.push_back(mat);
3786-+
3787-+ if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
3788-+ paintRegion = infiniteRegion;
3789-+
3790-+ /* Now allow plugins to mess with the geometry of our
3791-+ * dim (so we get a nice render for things like
3792-+ * wobbly etc etc */
3793-+ gWindow->vertexBuffer ()->begin ();
3794-+ gWindow->glAddGeometry (matl, reg, paintRegion);
3795-+ if (gWindow->vertexBuffer ()->end ())
3796-+ {
3797-+ unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex ();
3798-+ eAttrib.opacity = attrib.opacity * (((1.0 - eScreen->vpBrightness) + (1.0 - eScreen->vpSaturation) / 2.0));
3799-+ /* Texture rendering set-up */
3800-+ //eScreen->gScreen->setTexEnvMode(GL_MODULATE);
3801-+ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
3802-+ /* Draw the dim texture with all of it's modified
3803-+ * geometry glory */
3804-+ gWindow->glDrawTextureSetCurrentIndex (MAXSHORT);
3805-+ gWindow->glDrawTexture (tex, transform, eAttrib, mask |
3806-+ PAINT_WINDOW_BLEND_MASK |
3807-+ PAINT_WINDOW_TRANSLUCENT_MASK |
3808-+ PAINT_WINDOW_TRANSFORMED_MASK);
3809-+ gWindow->glDrawTextureSetCurrentIndex (glDrawTextureIndex);
3810-+ /* Texture rendering tear-down */
3811-+ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
3812-+ eScreen->gScreen->setTexEnvMode (GL_REPLACE);
3813-+ }
3814-+ }
3815-+
3816-+ /* Paint the outline */
3817-+ if (mGlowQuads && eScreen->paintingVp == eScreen->selectedVp)
3818-+ {
3819-+ if (region.numRects ())
3820-+ {
3821-+ /* reset geometry and paint */
3822-+ gWindow->vertexBuffer ()->begin ();
3823-+ gWindow->vertexBuffer ()->end ();
3824-+
3825-+ paintGlow (transform, attrib, infiniteRegion, mask);
3826-+ }
3827-+ }
3828-+
3829-+ }
3830-+
3831-+ return status;
3832-+
3833- }
3834-
3835- #define EXPO_GRID_SIZE 100
3836-@@ -1425,11 +1695,17 @@
3837- const CompRegion& region,
3838- unsigned int mask)
3839- {
3840-+ GLMatrix wTransform (transform);
3841-+ GLWindowPaintAttrib wAttrib (attrib);
3842-+ CompRegion clip (region);
3843-+
3844- if (eScreen->expoActive)
3845- {
3846- float opacity = 1.0;
3847- bool hide;
3848- bool zoomAnim;
3849-+ CompPoint vp;
3850-+ screen->viewportForGeometry (window->geometry (), vp);
3851-
3852- zoomAnim = eScreen->optionGetExpoAnimation () ==
3853- ExpoScreen::ExpoAnimationZoom;
3854-@@ -1458,9 +1734,47 @@
3855-
3856- if (opacity <= 0)
3857- mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
3858-+ else
3859-+ wAttrib.opacity = wAttrib.opacity * opacity;
3860-+
3861-+ /* Stretch maximized windows a little so that you don't
3862-+ * have an awkward gap */
3863-+
3864-+ if (window->state () & MAXIMIZE_STATE &&
3865-+ !window->border ().top)
3866-+ {
3867-+ CompOutput *o = &screen->outputDevs ()[screen->outputDeviceForGeometry(window->geometry())];
3868-+ float yS = 1.0 + ((o->height () / (float) window->height ()) - 1.0f) * sigmoidProgress (eScreen->expoCam);
3869-+ float xS = 1.0 + ((o->width () / (float) window->width ()) - 1.0f) * sigmoidProgress (eScreen->expoCam);
3870-+ wTransform.translate (window->x () + window->width (),
3871-+ window->y () + window->height (),
3872-+ 0.0f);
3873-+ wTransform.scale (xS, yS, 1.0f);
3874-+ wTransform.translate (-(window->x () + window->width ()),
3875-+ -(window->y () + window->height ()),
3876-+ 0.0f);
3877-+
3878-+ if (eScreen->paintingVp != vp)
3879-+ mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
3880-+
3881-+ mask |= PAINT_WINDOW_TRANSFORMED_MASK;
3882-+ }
3883-+
3884-+ if (std::find (eScreen->dndWindows.begin(), eScreen->dndWindows.end (), window) != eScreen->dndWindows.end ())
3885-+ {
3886-+ if (!eScreen->paintingDndWindow)
3887-+ {
3888-+ mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
3889-+ }
3890-+ else
3891-+ {
3892-+ mask |= PAINT_WINDOW_TRANSFORMED_MASK;
3893-+ clip = infiniteRegion;
3894-+ }
3895-+ }
3896- }
3897-
3898-- return gWindow->glPaint (attrib, transform, region, mask);
3899-+ return gWindow->glPaint (wAttrib, wTransform, clip, mask);
3900- }
3901-
3902- bool
3903-@@ -1489,7 +1803,7 @@
3904- expoActive (false),
3905- expoMode (false),
3906- dndState (DnDNone),
3907-- dndWindow (NULL),
3908-+ dndWindows (0),
3909- origVp (s->vp ()),
3910- selectedVp (s->vp ()),
3911- lastSelectedVp (s->vp ()),
3912-@@ -1497,14 +1811,21 @@
3913- clickTime (0),
3914- doubleClick (false),
3915- vpNormals (360 * 3),
3916-- grabIndex (0)
3917--{
3918-+ grabIndex (0),
3919-+ paintingDndWindow (false),
3920-+ mGlowTextureProperties (&glowTextureProperties)
3921-+{
3922-+ CompString fname;
3923-+ CompString pname = "expo";
3924-+ CompSize size;
3925-+
3926-+
3927- leftKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Left"));
3928- rightKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Right"));
3929- upKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Up"));
3930- downKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Down"));
3931-
3932-- dragCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
3933-+ mMoveCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
3934-
3935- EXPOINITBIND (ExpoKey, doExpo);
3936- EXPOTERMBIND (ExpoKey, termExpo);
3937-@@ -1522,12 +1843,58 @@
3938- ScreenInterface::setHandler (screen, false);
3939- CompositeScreenInterface::setHandler (cScreen, false);
3940- GLScreenInterface::setHandler (gScreen, false);
3941-+
3942-+ outline_texture = GLTexture::imageDataToTexture (mGlowTextureProperties->textureData,
3943-+ CompSize (mGlowTextureProperties->textureSize,
3944-+ mGlowTextureProperties->textureSize),
3945-+ GL_RGBA, GL_UNSIGNED_BYTE);
3946-+ fname = "texture_tile.png";
3947-+ polkadots_texture = GLTexture::readImageToTexture (fname, pname, polkadots_texture_size);
3948-+
3949-+ if (polkadots_texture.empty ())
3950-+ compLogMessage ("expo", CompLogLevelWarn, "failed to bind image to texture");
3951-+ else
3952-+ {
3953-+ foreach (GLTexture *tex, polkadots_texture)
3954-+ {
3955-+ tex->enable (GLTexture::Good);
3956-+ glTexParameteri (tex->target (), GL_TEXTURE_WRAP_S, GL_REPEAT);
3957-+ glTexParameteri (tex->target (), GL_TEXTURE_WRAP_T, GL_REPEAT);
3958-+ tex->disable ();
3959-+ }
3960-+ }
3961- }
3962-
3963- ExpoScreen::~ExpoScreen ()
3964- {
3965-- if (dragCursor != None)
3966-- XFreeCursor (screen->dpy (), dragCursor);
3967-+ if (mMoveCursor)
3968-+ XFreeCursor (screen->dpy (), mMoveCursor);
3969-+}
3970-+
3971-+void
3972-+ExpoWindow::moveNotify (int dx, int dy, bool immediate)
3973-+{
3974-+ window->moveNotify (dx, dy, immediate);
3975-+
3976-+ if (!ExpoScreen::get (screen)->expoActive)
3977-+ return;
3978-+
3979-+ updateViewportActiveStates (screen);
3980-+}
3981-+
3982-+void
3983-+ExpoWindow::resizeNotify(int dx, int dy, int dw, int dh)
3984-+{
3985-+ window->resizeNotify (dx, dy, dw, dh);
3986-+
3987-+ /* mGlowQuads contains positional info, so we need to recalc that */
3988-+ if (mGlowQuads)
3989-+ {
3990-+ /* FIXME: we need to find a more multitexture friendly way
3991-+ * of doing this */
3992-+ GLTexture::Matrix tMat = eScreen->outline_texture.at (0)->matrix ();
3993-+ computeGlowQuads (&tMat);
3994-+ }
3995- }
3996-
3997- ExpoWindow::ExpoWindow (CompWindow *w) :
3998-@@ -1535,10 +1902,28 @@
3999- window (w),
4000- cWindow (CompositeWindow::get (w)),
4001- gWindow (GLWindow::get (w)),
4002-- eScreen (ExpoScreen::get (screen))
4003-+ eScreen (ExpoScreen::get (screen)),
4004-+ dndOpacity (0.0f),
4005-+ mGlowQuads (NULL)
4006- {
4007- CompositeWindowInterface::setHandler (cWindow, false);
4008- GLWindowInterface::setHandler (gWindow, false);
4009-+ WindowInterface::setHandler (window, true);
4010-+
4011-+ if (window->type () & CompWindowTypeDesktopMask)
4012-+ {
4013-+ foreach (GLTexture *tex, eScreen->outline_texture)
4014-+ {
4015-+ GLTexture::Matrix mat = tex->matrix ();
4016-+ computeGlowQuads (&mat);
4017-+ }
4018-+ }
4019-+}
4020-+
4021-+ExpoWindow::~ExpoWindow ()
4022-+{
4023-+ eScreen->dndWindows.remove (window);
4024-+ computeGlowQuads (NULL);
4025- }
4026-
4027- bool
4028-Index: ubuntu/plugins/expo/src/expo.h
4029-===================================================================
4030---- ubuntu.orig/plugins/expo/src/expo.h 2012-09-08 11:51:02.279175377 +0800
4031-+++ ubuntu/plugins/expo/src/expo.h 2012-09-08 14:07:47.219861486 +0800
4032-@@ -30,6 +30,44 @@
4033- #include <opengl/opengl.h>
4034-
4035- #include "expo_options.h"
4036-+#include "glow.h"
4037-+#include "viewport-member-window.h"
4038-+#include "client-list-generator.h"
4039-+
4040-+#define WIN_REAL_X(w) (w->x () - w->border ().left)
4041-+#define WIN_REAL_Y(w) (w->y () - w->border ().top)
4042-+#define WIN_REAL_WIDTH(w) (w->width () + 2 * w->geometry ().border () + \
4043-+ w->border ().left + w->border ().right)
4044-+#define WIN_REAL_HEIGHT(w) (w->height () + 2 * w->geometry ().border () + \
4045-+ w->border ().top + w->border ().bottom)
4046-+
4047-+namespace compiz
4048-+{
4049-+ namespace expo
4050-+ {
4051-+ namespace impl
4052-+ {
4053-+ namespace ce = compiz::expo;
4054-+
4055-+ class CompizClientListGenerator :
4056-+ public ce::ClientListGenerator
4057-+ {
4058-+ public:
4059-+
4060-+ CompizClientListGenerator (CompScreen *screen);
4061-+
4062-+ void refreshClientList ();
4063-+ ViewportMemberWindow * nextClient ();
4064-+
4065-+ private:
4066-+
4067-+ CompScreen *mScreen;
4068-+ const CompWindowVector *mClientList;
4069-+ CompWindowVector::const_iterator mClientListIterator;
4070-+ };
4071-+ }
4072-+ }
4073-+}
4074-
4075- class ExpoScreen :
4076- public ScreenInterface,
4077-@@ -51,8 +89,10 @@
4078- bool glPaintOutput (const GLScreenPaintAttrib&, const GLMatrix&,
4079- const CompRegion&, CompOutput *, unsigned int);
4080- void glPaintTransformedOutput (const GLScreenPaintAttrib&,
4081-- const GLMatrix&, const CompRegion&,
4082-- CompOutput *, unsigned int);
4083-+ const GLMatrix&, const CompRegion&,
4084-+ CompOutput*, unsigned int);
4085-+
4086-+ const CompWindowList & getWindowPaintList ();
4087-
4088- bool dndInit (CompAction *, CompAction::State, CompOption::Vector&);
4089- bool dndFini (CompAction *, CompAction::State, CompOption::Vector&);
4090-@@ -62,6 +102,8 @@
4091- bool nextVp (CompAction *, CompAction::State, CompOption::Vector&);
4092- bool prevVp (CompAction *, CompAction::State, CompOption::Vector&);
4093-
4094-+ CompPoint currentViewport ();
4095-+
4096- typedef enum {
4097- DnDNone,
4098- DnDDuring,
4099-@@ -82,7 +124,7 @@
4100- bool expoMode;
4101-
4102- DnDState dndState;
4103-- CompWindow *dndWindow;
4104-+ CompWindowList dndWindows;
4105-
4106- CompPoint prevCursor;
4107- CompPoint newCursor;
4108-@@ -94,6 +136,7 @@
4109- CompPoint paintingVp;
4110-
4111- std::vector<float> vpActivity;
4112-+ std::vector<bool> vpActive;
4113- float vpBrightness;
4114- float vpSaturation;
4115-
4116-@@ -113,6 +156,17 @@
4117-
4118- CompScreen::GrabHandle grabIndex;
4119-
4120-+ GLTexture::List polkadots_texture;
4121-+ CompSize polkadots_texture_size;
4122-+ CompSize viewport_size;
4123-+
4124-+ GLTexture::List outline_texture;
4125-+ CompSize outline_texture_size;
4126-+
4127-+ bool paintingDndWindow;
4128-+
4129-+ const GlowTextureProperties *mGlowTextureProperties;
4130-+
4131- private:
4132- void moveFocusViewport (int, int);
4133- void finishWindowMovement ();
4134-@@ -123,24 +177,45 @@
4135- void paintWall (const GLScreenPaintAttrib&, const GLMatrix&,
4136- const CompRegion&, CompOutput *, unsigned int, bool);
4137-
4138-+ void paintViewport (const GLScreenPaintAttrib& attrib,
4139-+ const GLMatrix& transform,
4140-+ const CompRegion& region,
4141-+ CompOutput *output,
4142-+ unsigned int mask,
4143-+ CompPoint vpPos,
4144-+ GLVector &vpCamPos,
4145-+ bool reflection);
4146-+
4147-+ bool windowsOnVp (compiz::expo::ClientListGenerator &clientList,
4148-+ CompPoint &p,
4149-+ const CompPoint &unprojectedCursor,
4150-+ const CompSize &screenSize,
4151-+ CompScreen *screen);
4152-+
4153- KeyCode leftKey;
4154- KeyCode rightKey;
4155- KeyCode upKey;
4156- KeyCode downKey;
4157-
4158-- Cursor dragCursor;
4159-+ Cursor mMoveCursor;
4160- };
4161-
4162- class ExpoWindow :
4163-+ public compiz::expo::ViewportMemberWindow,
4164- public CompositeWindowInterface,
4165- public GLWindowInterface,
4166-+ public WindowInterface,
4167- public PluginClassHandler<ExpoWindow, CompWindow>
4168- {
4169- public:
4170- ExpoWindow (CompWindow *);
4171-+ ~ExpoWindow ();
4172-
4173- bool damageRect (bool, const CompRect&);
4174-
4175-+ void resizeNotify (int dx, int dy, int dw, int dh);
4176-+ void moveNotify (int dx, int dy, bool immediate);
4177-+
4178- bool glDraw (const GLMatrix&, const GLWindowPaintAttrib&,
4179- const CompRegion&, unsigned int);
4180- bool glPaint (const GLWindowPaintAttrib&, const GLMatrix&,
4181-@@ -150,11 +225,31 @@
4182- unsigned int, unsigned int);
4183- void glDrawTexture (GLTexture*, const GLMatrix&,
4184- const GLWindowPaintAttrib&, unsigned int);
4185-+ void
4186-+ paintGlow (const GLMatrix &transform,
4187-+ const GLWindowPaintAttrib &attrib,
4188-+ const CompRegion &paintRegion,
4189-+ unsigned int mask);
4190-+
4191-+ void
4192-+ computeGlowQuads (GLTexture::Matrix *matrix);
4193-
4194- CompWindow *window;
4195- CompositeWindow *cWindow;
4196- GLWindow *gWindow;
4197- ExpoScreen *eScreen;
4198-+
4199-+ float dndOpacity;
4200-+
4201-+ GlowQuad *mGlowQuads;
4202-+
4203-+ private:
4204-+
4205-+ bool isDesktopOrDock () const;
4206-+ bool dragged () const;
4207-+ const compiz::window::Geometry & absoluteGeometry () const;
4208-+
4209-+ mutable compiz::window::Geometry mAbsoluteGeometry;
4210- };
4211-
4212- class ExpoPluginVTable :
4213-Index: ubuntu/plugins/expo/src/glow.cpp
4214-===================================================================
4215---- /dev/null 1970-01-01 00:00:00.000000000 +0000
4216-+++ ubuntu/plugins/expo/src/glow.cpp 2012-09-08 11:51:33.107328243 +0800
4217-@@ -0,0 +1,429 @@
4218-+/**
4219-+ *
4220-+ * Compiz group plugin
4221-+ *
4222-+ * glow.cpp
4223-+ *
4224-+ * Copyright : (C) 2006-2010 by Patrick Niklaus, Roi Cohen,
4225-+ * Danny Baumann, Sam Spilsbury
4226-+ * Authors: Patrick Niklaus <patrick.niklaus@googlemail.com>
4227-+ * Roi Cohen <roico.beryl@gmail.com>
4228-+ * Danny Baumann <maniac@opencompositing.org>
4229-+ * Sam Spilsbury <smspillaz@gmail.com>
4230-+ *
4231-+ *
4232-+ * This program is free software; you can redistribute it and/or
4233-+ * modify it under the terms of the GNU General Public License
4234-+ * as published by the Free Software Foundation; either version 2
4235-+ * of the License, or (at your option) any later version.
4236-+ *
4237-+ * This program is distributed in the hope that it will be useful,
4238-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4239-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4240-+ * GNU General Public License for more details.
4241-+ *
4242-+ **/
4243-+
4244-+#include "expo.h"
4245-+#include "group_glow.h"
4246-+
4247-+const GlowTextureProperties glowTextureProperties = {
4248-+ /* GlowTextureRectangular */
4249-+ glowTexRect, 32, 21
4250-+};
4251-+
4252-+/*
4253-+ * GroupWindow::paintGlow
4254-+ *
4255-+ * Takes our glow texture, stretches the appropriate positions in the glow texture,
4256-+ * adds those geometries (so plugins like wobby and deform this texture correctly)
4257-+ * and then draws the glow texture with this geometry (plugins like wobbly and friends
4258-+ * will automatically deform the texture based on our set geometry)
4259-+ */
4260-+
4261-+void
4262-+ExpoWindow::paintGlow (const GLMatrix &transform,
4263-+ const GLWindowPaintAttrib &attrib,
4264-+ const CompRegion &paintRegion,
4265-+ unsigned int mask)
4266-+{
4267-+ CompRegion reg;
4268-+ int i;
4269-+ GLushort colorData[4];
4270-+ const GLushort *selColorData = ExpoScreen::get (screen)->optionGetSelectedColor ();
4271-+ float alpha = (float) selColorData[3] / 65535.0f;
4272-+
4273-+ /* Premultiply color */
4274-+ colorData[0] = selColorData[0] * alpha;
4275-+ colorData[1] = selColorData[1] * alpha;
4276-+ colorData[2] = selColorData[2] * alpha;
4277-+ colorData[3] = selColorData[3];
4278-+
4279-+ gWindow->vertexBuffer ()->begin ();
4280-+
4281-+ /* There are 8 glow parts of the glow texture which we wish to paint
4282-+ * separately with different transformations
4283-+ */
4284-+ for (i = 0; i < NUM_GLOWQUADS; i++)
4285-+ {
4286-+ /* Using precalculated quads here */
4287-+ reg = CompRegion (mGlowQuads[i].mBox);
4288-+
4289-+ if (reg.boundingRect ().x1 () < reg.boundingRect ().x2 () &&
4290-+ reg.boundingRect ().y1 () < reg.boundingRect ().y2 ())
4291-+ {
4292-+ GLTexture::MatrixList matl;
4293-+ reg = CompRegion (reg.boundingRect ().x1 (),
4294-+ reg.boundingRect ().y1 (),
4295-+ reg.boundingRect ().width (),
4296-+ reg.boundingRect ().height ());
4297-+
4298-+ matl.push_back (mGlowQuads[i].mMatrix);
4299-+ /* Add color data for all 6 vertices of the quad */
4300-+ for (int n = 0; n < 6; n++)
4301-+ gWindow->vertexBuffer ()->addColors (1, colorData);
4302-+ gWindow->glAddGeometry (matl, reg, paintRegion);
4303-+ }
4304-+ }
4305-+
4306-+ if (gWindow->vertexBuffer ()->end ())
4307-+ {
4308-+ //GLScreen::get (screen)->setTexEnvMode (GL_MODULATE);
4309-+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
4310-+
4311-+ /* we use PAINT_WINDOW_TRANSFORMED_MASK here to force
4312-+ the usage of a good texture filter */
4313-+ foreach (GLTexture *tex, ExpoScreen::get (screen)->outline_texture)
4314-+ {
4315-+ gWindow->glDrawTexture (tex, transform, attrib, mask |
4316-+ PAINT_WINDOW_BLEND_MASK |
4317-+ PAINT_WINDOW_TRANSLUCENT_MASK |
4318-+ PAINT_WINDOW_TRANSFORMED_MASK);
4319-+ }
4320-+
4321-+ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
4322-+ GLScreen::get (screen)->setTexEnvMode (GL_REPLACE);
4323-+ }
4324-+}
4325-+
4326-+/*
4327-+ * ExpoWindow::computeGlowQuads
4328-+ *
4329-+ * This function computures the matrix transformation required for each
4330-+ * part of the glow texture which we wish to stretch to some rectangular
4331-+ * dimentions
4332-+ *
4333-+ * There are eight quads different parts of the texture which we wish to
4334-+ * paint here, the 4 sides and four corners, eg:
4335-+ *
4336-+ * ------------------
4337-+ * | 1 | 4 | 6 |
4338-+ * ------------- ------------------
4339-+ * | 1 | 4 | 6 | | | | |
4340-+ * ------------- | | | |
4341-+ * | 2 | n | 7 | -> | 2 | n | 7 |
4342-+ * ------------- | | | |
4343-+ * | 3 | 5 | 8 | | | | |
4344-+ * ------------- ------------------
4345-+ * | 3 | 5 | 8 |
4346-+ * ------------------
4347-+ *
4348-+ * In this example here, 2, 4, 5 and 7 are stretched, and the matrices for
4349-+ * each quad rect adjusted accordingly for it's size compared to the original
4350-+ * texture size.
4351-+ *
4352-+ * When we are adjusting the matrices here, the initial size of each corner has
4353-+ * a size of of "1.0f", so according to 2x2 matrix rules,
4354-+ * the scale factor is the inverse of the size of the glow (which explains
4355-+ * while you will see here that matrix->xx is (1 / glowSize)
4356-+ * where glowSize is the size the user specifies they want their glow to extend.
4357-+ * (likewise, matrix->yy is adjusted similarly for corners and for top/bottom)
4358-+ *
4359-+ * matrix->x0 and matrix->y0 here are set to be the top left edge of the rect
4360-+ * adjusted by the matrix scale factor (matrix->xx and matrix->yy)
4361-+ *
4362-+ */
4363-+void
4364-+ExpoWindow::computeGlowQuads (GLTexture::Matrix *matrix)
4365-+{
4366-+ CompRect *box;
4367-+ int x1, x2, y1, y2;
4368-+ GLTexture::Matrix *quadMatrix;
4369-+ int glowSize, glowOffset;
4370-+ CompWindow *w = window;
4371-+
4372-+ /* Passing NULL to this function frees the glow quads
4373-+ * (so the window is not painted with glow) */
4374-+
4375-+ if (matrix)
4376-+ {
4377-+ if (!mGlowQuads)
4378-+ mGlowQuads = new GlowQuad[NUM_GLOWQUADS];
4379-+ if (!mGlowQuads)
4380-+ return;
4381-+ }
4382-+ else
4383-+ {
4384-+ if (mGlowQuads)
4385-+ {
4386-+ delete[] mGlowQuads;
4387-+ mGlowQuads = NULL;
4388-+ }
4389-+ return;
4390-+ }
4391-+
4392-+ glowSize = 48;
4393-+ glowOffset = (glowSize * ExpoScreen::get (screen)->mGlowTextureProperties->glowOffset /
4394-+ ExpoScreen::get (screen)->mGlowTextureProperties->textureSize) + 1;
4395-+
4396-+ /* Top left corner */
4397-+ box = &mGlowQuads[GLOWQUAD_TOPLEFT].mBox;
4398-+ mGlowQuads[GLOWQUAD_TOPLEFT].mMatrix = *matrix;
4399-+ quadMatrix = &mGlowQuads[GLOWQUAD_TOPLEFT].mMatrix;
4400-+
4401-+ /* Set the desired rect dimentions
4402-+ * for the part of the glow we are painting */
4403-+
4404-+ x1 = WIN_REAL_X (w) - glowSize + glowOffset;
4405-+ y1 = WIN_REAL_Y (w) - glowSize + glowOffset;
4406-+
4407-+ /* 2x2 Matrix here, adjust both x and y scale factors
4408-+ * and the x and y position
4409-+ *
4410-+ * Scaling both parts of the texture in a positive direction
4411-+ * here (left to right top to bottom)
4412-+ *
4413-+ * The base position (x0 and y0) here requires us to move backwards
4414-+ * on the x and y dimentions by the calculated rect dimentions
4415-+ * multiplied by the scale factors
4416-+ */
4417-+
4418-+ quadMatrix->xx = 1.0f / glowSize;
4419-+ quadMatrix->yy = 1.0f / (glowSize);
4420-+ quadMatrix->x0 = -(x1 * quadMatrix->xx);
4421-+ quadMatrix->y0 = -(y1 * quadMatrix->yy);
4422-+
4423-+ x2 = MIN (WIN_REAL_X (w) + glowOffset,
4424-+ WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2));
4425-+ y2 = MIN (WIN_REAL_Y (w) + glowOffset,
4426-+ WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2));
4427-+
4428-+ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
4429-+
4430-+ /* Top right corner */
4431-+ box = &mGlowQuads[GLOWQUAD_TOPRIGHT].mBox;
4432-+ mGlowQuads[GLOWQUAD_TOPRIGHT].mMatrix = *matrix;
4433-+ quadMatrix = &mGlowQuads[GLOWQUAD_TOPRIGHT].mMatrix;
4434-+
4435-+ /* Set the desired rect dimentions
4436-+ * for the part of the glow we are painting */
4437-+
4438-+ x1 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
4439-+ y1 = WIN_REAL_Y (w) - glowSize + glowOffset;
4440-+ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) + glowSize - glowOffset;
4441-+
4442-+ /* 2x2 Matrix here, adjust both x and y scale factors
4443-+ * and the x and y position
4444-+ *
4445-+ * Scaling the y part of the texture in a positive direction
4446-+ * and the x part in a negative direction here
4447-+ * (right to left top to bottom)
4448-+ *
4449-+ * The base position (x0 and y0) here requires us to move backwards
4450-+ * on the y dimention and forwards on x by the calculated rect dimentions
4451-+ * multiplied by the scale factors (since we are moving forward on x we
4452-+ * need the inverse of that which is 1 - x1 * xx
4453-+ */
4454-+
4455-+ quadMatrix->xx = -1.0f / glowSize;
4456-+ quadMatrix->yy = 1.0f / glowSize;
4457-+ quadMatrix->x0 = 1.0 - (x1 * quadMatrix->xx);
4458-+ quadMatrix->y0 = -(y1 * quadMatrix->yy);
4459-+
4460-+ x1 = MAX (WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset,
4461-+ WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2));
4462-+ y2 = MIN (WIN_REAL_Y (w) + glowOffset,
4463-+ WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2));
4464-+
4465-+ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
4466-+
4467-+ /* Bottom left corner */
4468-+ box = &mGlowQuads[GLOWQUAD_BOTTOMLEFT].mBox;
4469-+ mGlowQuads[GLOWQUAD_BOTTOMLEFT].mMatrix = *matrix;
4470-+ quadMatrix = &mGlowQuads[GLOWQUAD_BOTTOMLEFT].mMatrix;
4471-+
4472-+ x1 = WIN_REAL_X (w) - glowSize + glowOffset;
4473-+ y1 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
4474-+ x2 = WIN_REAL_X (w) + glowOffset;
4475-+ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) + glowSize - glowOffset;
4476-+
4477-+ /* 2x2 Matrix here, adjust both x and y scale factors
4478-+ * and the x and y position
4479-+ *
4480-+ * Scaling the x part of the texture in a positive direction
4481-+ * and the y part in a negative direction here
4482-+ * (left to right bottom to top)
4483-+ *
4484-+ * The base position (x0 and y0) here requires us to move backwards
4485-+ * on the x dimention and forwards on y by the calculated rect dimentions
4486-+ * multiplied by the scale factors (since we are moving forward on x we
4487-+ * need the inverse of that which is 1 - y1 * yy
4488-+ */
4489-+
4490-+ quadMatrix->xx = 1.0f / glowSize;
4491-+ quadMatrix->yy = -1.0f / glowSize;
4492-+ quadMatrix->x0 = -(x1 * quadMatrix->xx);
4493-+ quadMatrix->y0 = 1.0f - (y1 * quadMatrix->yy);
4494-+
4495-+ y1 = MAX (WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset,
4496-+ WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2));
4497-+ x2 = MIN (WIN_REAL_X (w) + glowOffset,
4498-+ WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2));
4499-+
4500-+ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
4501-+
4502-+ /* Bottom right corner */
4503-+ box = &mGlowQuads[GLOWQUAD_BOTTOMRIGHT].mBox;
4504-+ mGlowQuads[GLOWQUAD_BOTTOMRIGHT].mMatrix = *matrix;
4505-+ quadMatrix = &mGlowQuads[GLOWQUAD_BOTTOMRIGHT].mMatrix;
4506-+
4507-+ x1 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
4508-+ y1 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
4509-+ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) + glowSize - glowOffset;
4510-+ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) + glowSize - glowOffset;
4511-+
4512-+ /* 2x2 Matrix here, adjust both x and y scale factors
4513-+ * and the x and y position
4514-+ *
4515-+ * Scaling the both parts of the texture in a negative direction
4516-+ * (right to left bottom to top)
4517-+ *
4518-+ * The base position (x0 and y0) here requires us to move forwards
4519-+ * on both dimentions by the calculated rect dimentions
4520-+ * multiplied by the scale factors
4521-+ */
4522-+
4523-+ quadMatrix->xx = -1.0f / glowSize;
4524-+ quadMatrix->yy = -1.0f / glowSize;
4525-+ quadMatrix->x0 = 1.0 - (x1 * quadMatrix->xx);
4526-+ quadMatrix->y0 = 1.0 - (y1 * quadMatrix->yy);
4527-+
4528-+ x1 = MAX (WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset,
4529-+ WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2));
4530-+ y1 = MAX (WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset,
4531-+ WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2));
4532-+
4533-+ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
4534-+
4535-+ /* Top edge */
4536-+ box = &mGlowQuads[GLOWQUAD_TOP].mBox;
4537-+ mGlowQuads[GLOWQUAD_TOP].mMatrix = *matrix;
4538-+ quadMatrix = &mGlowQuads[GLOWQUAD_TOP].mMatrix;
4539-+
4540-+ x1 = WIN_REAL_X (w) + glowOffset;
4541-+ y1 = WIN_REAL_Y (w) - glowSize + glowOffset;
4542-+ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
4543-+ y2 = WIN_REAL_Y (w) + glowOffset;
4544-+
4545-+ /* 2x2 Matrix here, adjust both x and y scale factors
4546-+ * and the x and y position
4547-+ *
4548-+ * No need to scale the x part of the texture here, but we
4549-+ * are scaling on the y part in a positive direciton
4550-+ *
4551-+ * The base position (y0) here requires us to move backwards
4552-+ * on the x dimention and forwards on y by the calculated rect dimentions
4553-+ * multiplied by the scale factors
4554-+ */
4555-+
4556-+ quadMatrix->xx = 0.0f;
4557-+ quadMatrix->yy = 1.0f / glowSize;
4558-+ quadMatrix->x0 = 1.0;
4559-+ quadMatrix->y0 = -(y1 * quadMatrix->yy);
4560-+
4561-+ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
4562-+
4563-+ /* Bottom edge */
4564-+ box = &mGlowQuads[GLOWQUAD_BOTTOM].mBox;
4565-+ mGlowQuads[GLOWQUAD_BOTTOM].mMatrix = *matrix;
4566-+ quadMatrix = &mGlowQuads[GLOWQUAD_BOTTOM].mMatrix;
4567-+
4568-+ x1 = WIN_REAL_X (w) + glowOffset;
4569-+ y1 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
4570-+ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
4571-+ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) + glowSize - glowOffset;
4572-+
4573-+ /* 2x2 Matrix here, adjust both x and y scale factors
4574-+ * and the x and y position
4575-+ *
4576-+ * No need to scale the x part of the texture here, but we
4577-+ * are scaling on the y part in a negative direciton
4578-+ *
4579-+ * The base position (y0) here requires us to move forwards
4580-+ * on y by the calculated rect dimentions
4581-+ * multiplied by the scale factors
4582-+ */
4583-+
4584-+ quadMatrix->xx = 0.0f;
4585-+ quadMatrix->yy = -1.0f / glowSize;
4586-+ quadMatrix->x0 = 1.0;
4587-+ quadMatrix->y0 = 1.0 - (y1 * quadMatrix->yy);
4588-+
4589-+ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
4590-+
4591-+ /* Left edge */
4592-+ box = &mGlowQuads[GLOWQUAD_LEFT].mBox;
4593-+ mGlowQuads[GLOWQUAD_LEFT].mMatrix = *matrix;
4594-+ quadMatrix = &mGlowQuads[GLOWQUAD_LEFT].mMatrix;
4595-+
4596-+ x1 = WIN_REAL_X (w) - glowSize + glowOffset;
4597-+ y1 = WIN_REAL_Y (w) + glowOffset;
4598-+ x2 = WIN_REAL_X (w) + glowOffset;
4599-+ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
4600-+
4601-+ /* 2x2 Matrix here, adjust both x and y scale factors
4602-+ * and the x and y position
4603-+ *
4604-+ * No need to scale the y part of the texture here, but we
4605-+ * are scaling on the x part in a positive direciton
4606-+ *
4607-+ * The base position (x0) here requires us to move backwards
4608-+ * on x by the calculated rect dimentions
4609-+ * multiplied by the scale factors
4610-+ */
4611-+
4612-+ quadMatrix->xx = 1.0f / glowSize;
4613-+ quadMatrix->yy = 0.0f;
4614-+ quadMatrix->x0 = -(x1 * quadMatrix->xx);
4615-+ quadMatrix->y0 = 1.0;
4616-+
4617-+ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
4618-+
4619-+ /* Right edge */
4620-+ box = &mGlowQuads[GLOWQUAD_RIGHT].mBox;
4621-+ mGlowQuads[GLOWQUAD_RIGHT].mMatrix = *matrix;
4622-+ quadMatrix = &mGlowQuads[GLOWQUAD_RIGHT].mMatrix;
4623-+
4624-+ x1 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
4625-+ y1 = WIN_REAL_Y (w) + glowOffset;
4626-+ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) + glowSize - glowOffset;
4627-+ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
4628-+
4629-+ /* 2x2 Matrix here, adjust both x and y scale factors
4630-+ * and the x and y position
4631-+ *
4632-+ * No need to scale the y part of the texture here, but we
4633-+ * are scaling on the x part in a negative direciton
4634-+ *
4635-+ * The base position (x0) here requires us to move forwards
4636-+ * on x by the calculated rect dimentions
4637-+ * multiplied by the scale factors
4638-+ */
4639-+
4640-+ quadMatrix->xx = -1.0f / glowSize;
4641-+ quadMatrix->yy = 0.0f;
4642-+ quadMatrix->x0 = 1.0 - (x1 * quadMatrix->xx);
4643-+ quadMatrix->y0 = 1.0;
4644-+
4645-+ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
4646-+}
4647-Index: ubuntu/plugins/expo/src/glow.h
4648-===================================================================
4649---- /dev/null 1970-01-01 00:00:00.000000000 +0000
4650-+++ ubuntu/plugins/expo/src/glow.h 2012-09-08 11:51:33.107328243 +0800
4651-@@ -0,0 +1,66 @@
4652-+/**
4653-+ *
4654-+ * Compiz group plugin
4655-+ *
4656-+ * glow.h
4657-+ *
4658-+ * Copyright : (C) 2006-2010 by Patrick Niklaus, Roi Cohen,
4659-+ * Danny Baumann, Sam Spilsbury
4660-+ * Authors: Patrick Niklaus <patrick.niklaus@googlemail.com>
4661-+ * Roi Cohen <roico.beryl@gmail.com>
4662-+ * Danny Baumann <maniac@opencompositing.org>
4663-+ * Sam Spilsbury <smspillaz@gmail.com>
4664-+ *
4665-+ *
4666-+ * This program is free software; you can redistribute it and/or
4667-+ * modify it under the terms of the GNU General Public License
4668-+ * as published by the Free Software Foundation; either version 2
4669-+ * of the License, or (at your option) any later version.
4670-+ *
4671-+ * This program is distributed in the hope that it will be useful,
4672-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4673-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4674-+ * GNU General Public License for more details.
4675-+ *
4676-+ **/
4677-+
4678-+#ifndef _EXPO_GLOW_H
4679-+#define _EXPO_GLOW_H
4680-+
4681-+#define GLOWQUAD_TOPLEFT 0
4682-+#define GLOWQUAD_TOPRIGHT 1
4683-+#define GLOWQUAD_BOTTOMLEFT 2
4684-+#define GLOWQUAD_BOTTOMRIGHT 3
4685-+#define GLOWQUAD_TOP 4
4686-+#define GLOWQUAD_BOTTOM 5
4687-+#define GLOWQUAD_LEFT 6
4688-+#define GLOWQUAD_RIGHT 7
4689-+#define NUM_GLOWQUADS 8
4690-+
4691-+/* Represents a particular glow texture, so here
4692-+ * we have hardcoded in the texture data, the offset
4693-+ * and the size of the texture
4694-+ */
4695-+
4696-+typedef struct _GlowTextureProperties {
4697-+ char *textureData;
4698-+ int textureSize;
4699-+ int glowOffset;
4700-+} GlowTextureProperties;
4701-+
4702-+/* Each glow quad contains a 2x2 scale + positional matrix
4703-+ * (the 3rd column is not used since that is for matrix skew
4704-+ * operations which we do not care about)
4705-+ * and also a CompRect which describes the size and position of
4706-+ * the quad on the glow
4707-+ */
4708-+
4709-+class GlowQuad {
4710-+ public:
4711-+ CompRect mBox;
4712-+ GLTexture::Matrix mMatrix;
4713-+};
4714-+
4715-+extern const GlowTextureProperties glowTextureProperties;
4716-+
4717-+#endif
4718-Index: ubuntu/plugins/expo/src/group_glow.h
4719-===================================================================
4720---- /dev/null 1970-01-01 00:00:00.000000000 +0000
4721-+++ ubuntu/plugins/expo/src/group_glow.h 2012-09-08 11:51:33.107328243 +0800
4722-@@ -0,0 +1,197 @@
4723-+#ifndef _GROUP_GLOWTEX_H
4724-+#define _GROUP_GLOWTEX_H
4725-+
4726-+/**
4727-+ *
4728-+ * Compiz group plugin
4729-+ *
4730-+ * group_glow.h
4731-+ *
4732-+ * Copyright : (C) 2006-2010 by Patrick Niklaus, Roi Cohen,
4733-+ * Danny Baumann, Sam Spilsbury
4734-+ * Authors: Patrick Niklaus <patrick.niklaus@googlemail.com>
4735-+ * Roi Cohen <roico.beryl@gmail.com>
4736-+ * Danny Baumann <maniac@opencompositing.org>
4737-+ * Sam Spilsbury <smspillaz@gmail.com>
4738-+ *
4739-+ *
4740-+ * This program is free software; you can redistribute it and/or
4741-+ * modify it under the terms of the GNU General Public License
4742-+ * as published by the Free Software Foundation; either version 2
4743-+ * of the License, or (at your option) any later version.
4744-+ *
4745-+ * This program is distributed in the hope that it will be useful,
4746-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4747-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4748-+ * GNU General Public License for more details.
4749-+ *
4750-+ **/
4751-+
4752-+/*
4753-+ * glowTex
4754-+ */
4755-+
4756-+static char glowTexRect[4097] = {
4757-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4758-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4759-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377"
4760-+ "\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
4761-+ "\377\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4762-+ "\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
4763-+ "\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377"
4764-+ "\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6"
4765-+ "\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377"
4766-+ "\14\377\377\377\14\377\377\377\14\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4767-+ "\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\14"
4768-+ "\377\377\377\14\377\377\377\22\377\377\377\22\377\377\377\22\377\377\377"
4769-+ "\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377"
4770-+ "\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377"
4771-+ "\35\377\377\377\35\377\377\377\35\377\377\377\35\377\377\377\35\377\377\377"
4772-+ "\35\377\377\377\35\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
4773-+ "\377\6\377\377\377\6\377\377\377\14\377\377\377\22\377\377\377\27\377\377"
4774-+ "\377\27\377\377\377\35\377\377\377#\377\377\377'\377\377\377'\377\377\377"
4775-+ "+\377\377\377+\377\377\377+\377\377\377+\377\377\377+\377\377\377+\377\377"
4776-+ "\377+\377\377\377+\377\377\377+\377\377\3771\377\377\3771\377\377\3771\377"
4777-+ "\377\3771\377\377\3771\377\377\3771\377\377\3771\0\0\0\0\0\0\0\0\0\0\0\0"
4778-+ "\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\22\377\377\377"
4779-+ "\27\377\377\377\35\377\377\377#\377\377\377+\377\377\3771\377\377\3776\377"
4780-+ "\377\377<\377\377\377>\377\377\377C\377\377\377I\377\377\377I\377\377\377"
4781-+ "I\377\377\377I\377\377\377I\377\377\377I\377\377\377I\377\377\377I\377\377"
4782-+ "\377L\377\377\377L\377\377\377L\377\377\377L\377\377\377L\377\377\377L\377"
4783-+ "\377\377L\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377"
4784-+ "\377\377\22\377\377\377\27\377\377\377#\377\377\377+\377\377\3776\377\377"
4785-+ "\377C\377\377\377L\377\377\377U\377\377\377]\377\377\377`\377\377\377d\377"
4786-+ "\377\377h\377\377\377k\377\377\377k\377\377\377k\377\377\377k\377\377\377"
4787-+ "k\377\377\377k\377\377\377k\377\377\377p\377\377\377p\377\377\377p\377\377"
4788-+ "\377p\377\377\377p\377\377\377p\377\377\377p\0\0\0\0\0\0\0\0\0\0\0\0\377"
4789-+ "\377\377\6\377\377\377\14\377\377\377\22\314\314\314\35\377\377\377'\377"
4790-+ "\377\3771\377\377\377>\357\357\357P\377\377\377]\363\363\363k\365\365\365"
4791-+ "v\365\365\365|\377\377\377\202\367\367\367\210\367\367\367\214\367\367\367"
4792-+ "\216\367\367\367\221\367\367\367\221\367\367\367\221\367\367\367\221\367"
4793-+ "\367\367\221\367\367\367\221\367\367\367\224\367\367\367\224\367\367\367"
4794-+ "\224\367\367\367\224\367\367\367\224\367\367\367\224\367\367\367\224\0\0"
4795-+ "\0\0\0\0\0\0\377\377\377\6\377\377\377\6\377\377\377\22\377\377\377\27\377"
4796-+ "\377\377'\377\377\3776\377\377\377I\377\377\377Y\377\377\377k\376\376\376"
4797-+ "y\377\377\377\210\377\377\377\224\377\377\377\235\377\377\377\245\377\377"
4798-+ "\377\253\377\377\377\255\377\377\377\262\377\377\377\262\377\377\377\263"
4799-+ "\377\377\377\263\377\377\377\263\377\377\377\263\377\377\377\263\377\377"
4800-+ "\377\266\377\377\377\266\377\377\377\266\377\377\377\266\377\377\377\266"
4801-+ "\377\377\377\266\377\377\377\266\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377"
4802-+ "\14\377\377\377\27\377\377\377#\377\377\3771\377\377\377I\377\377\377]\377"
4803-+ "\377\377r\377\377\377\205\377\377\377\231\377\377\377\247\377\377\377\263"
4804-+ "\377\377\377\275\377\377\377\304\377\377\377\310\377\377\377\313\377\377"
4805-+ "\377\316\377\377\377\320\377\377\377\320\377\377\377\320\377\377\377\320"
4806-+ "\377\377\377\320\377\377\377\320\377\377\377\322\377\377\377\322\377\377"
4807-+ "\377\322\377\377\377\322\377\377\377\322\377\377\377\322\377\377\377\322"
4808-+ "\0\0\0\0\377\377\377\6\377\377\377\6\377\377\377\22\377\377\377\35\377\377"
4809-+ "\377+\377\377\377>\377\377\377Y\377\377\377r\377\377\377\210\376\376\376"
4810-+ "\237\377\377\377\262\377\377\377\302\377\377\377\313\377\377\377\324\377"
4811-+ "\377\377\332\376\376\376\336\377\377\377\341\377\377\377\342\377\377\377"
4812-+ "\344\377\377\377\344\377\377\377\344\377\377\377\344\377\377\377\344\377"
4813-+ "\377\377\344\377\377\377\345\377\377\377\345\377\377\377\345\377\377\377"
4814-+ "\345\377\377\377\345\377\377\377\345\377\377\377\345\0\0\0\0\377\377\377"
4815-+ "\6\377\377\377\14\377\377\377\27\377\377\377#\377\377\3776\377\377\377P\377"
4816-+ "\377\377k\377\377\377\205\376\376\376\237\372\372\372\266\377\377\377\307"
4817-+ "\373\373\373\325\373\373\373\337\374\374\374\345\374\374\374\352\374\374"
4818-+ "\374\355\374\374\374\357\374\374\374\360\374\374\374\361\374\374\374\361"
4819-+ "\374\374\374\362\374\374\374\362\374\374\374\362\374\374\374\362\374\374"
4820-+ "\374\362\374\374\374\362\374\374\374\362\374\374\374\362\374\374\374\362"
4821-+ "\374\374\374\362\374\374\374\362\0\0\0\0\377\377\377\6\377\377\377\14\377"
4822-+ "\377\377\35\377\377\377+\377\377\377C\377\377\377]\377\377\377|\377\377\377"
4823-+ "\231\377\377\377\263\377\377\377\307\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4824-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4825-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377"
4826-+ "\377\377\6\377\377\377\22\324\324\324#\377\377\3771\377\377\377L\363\363"
4827-+ "\363k\377\377\377\210\377\377\377\247\377\377\377\302\377\377\377\325\0\0"
4828-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4829-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4830-+ "\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\22\377\377"
4831-+ "\377#\377\377\377<\377\377\377U\377\377\377v\377\377\377\226\377\377\377"
4832-+ "\263\377\377\377\315\377\377\377\337\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4833-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4834-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
4835-+ "\6\377\377\377\14\377\377\377\27\377\377\377'\377\377\377>\377\377\377]\377"
4836-+ "\377\377|\370\370\370\237\377\377\377\275\373\373\373\325\377\377\377\345"
4837-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4838-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4839-+ "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\27\377"
4840-+ "\377\377+\377\377\377C\377\377\377`\377\377\377\202\377\377\377\247\377\377"
4841-+ "\377\304\377\377\377\332\377\377\377\352\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4842-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4843-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
4844-+ "\377\6\377\377\377\14\377\377\377\27\377\377\377+\377\377\377C\377\377\377"
4845-+ "d\377\377\377\210\377\377\377\253\377\377\377\310\376\376\376\336\374\374"
4846-+ "\374\355\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4847-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4848-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377"
4849-+ "\35\377\377\377+\377\377\377I\377\377\377h\377\377\377\214\377\377\377\260"
4850-+ "\377\377\377\313\374\374\374\342\374\374\374\357\0\0\0\0\0\0\0\0\0\0\0\0"
4851-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4852-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4853-+ "\377\377\377\6\377\377\377\14\377\377\377\35\342\342\3421\377\377\377I\377"
4854-+ "\377\377k\377\377\377\216\377\377\377\262\377\377\377\316\374\374\374\344"
4855-+ "\377\377\377\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4856-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4857-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377"
4858-+ "\377\377\35\377\377\3771\377\377\377L\377\377\377k\377\377\377\221\377\377"
4859-+ "\377\263\377\377\377\320\377\377\377\344\377\377\377\361\0\0\0\0\0\0\0\0"
4860-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4861-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4862-+ "\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377\377\3771\377\377"
4863-+ "\377L\377\377\377k\377\377\377\221\377\377\377\263\377\377\377\320\377\377"
4864-+ "\377\344\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4865-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4866-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377"
4867-+ "\14\377\377\377\35\377\377\3771\377\377\377L\364\364\364p\377\377\377\221"
4868-+ "\372\372\372\266\377\377\377\320\374\374\374\345\377\377\377\362\0\0\0\0"
4869-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4870-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4871-+ "\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377\377\377"
4872-+ "1\377\377\377L\377\377\377p\377\377\377\221\377\377\377\266\373\373\373\322"
4873-+ "\377\377\377\345\377\377\377\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4874-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4875-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377"
4876-+ "\377\377\14\377\377\377\35\377\377\3771\377\377\377L\377\377\377p\377\377"
4877-+ "\377\221\377\377\377\266\373\373\373\322\377\377\377\345\377\377\377\362"
4878-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4879-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4880-+ "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377"
4881-+ "\377\3771\377\377\377L\377\377\377p\377\377\377\221\377\377\377\266\373\373"
4882-+ "\373\322\377\377\377\345\377\377\377\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4883-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4884-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
4885-+ "\377\6\377\377\377\14\377\377\377\35\377\377\3771\377\377\377L\377\377\377"
4886-+ "p\367\367\367\224\377\377\377\266\377\377\377\322\377\377\377\345\374\374"
4887-+ "\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4888-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4889-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377"
4890-+ "\35\377\377\3771\377\377\377L\377\377\377p\367\367\367\224\377\377\377\266"
4891-+ "\377\377\377\322\377\377\377\345\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0"
4892-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4893-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4894-+ "\377\377\377\6\377\377\377\14\377\377\377\35\377\377\3771\377\377\377L\377"
4895-+ "\377\377p\367\367\367\224\377\377\377\266\377\377\377\322\377\377\377\345"
4896-+ "\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4897-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4898-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377"
4899-+ "\377\377\35\377\377\3771\377\377\377L\377\377\377p\367\367\367\224\377\377"
4900-+ "\377\266\377\377\377\322\377\377\377\345\374\374\374\362\0\0\0\0\0\0\0\0"
4901-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4902-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4903-+ "\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377\377\3771\377\377"
4904-+ "\377L\377\377\377p\367\367\367\224\377\377\377\266\377\377\377\322\377\377"
4905-+ "\377\345\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4906-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4907-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377"
4908-+ "\14\377\377\377\35\377\377\3771\377\377\377L\377\377\377p\367\367\367\224"
4909-+ "\377\377\377\266\377\377\377\322\377\377\377\345\374\374\374\362\0\0\0\0"
4910-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4911-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4912-+ "\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377\377\377"
4913-+ "1\377\377\377L\377\377\377p\367\367\367\224\377\377\377\266\377\377\377\322"
4914-+ "\377\377\377\345\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4915-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
4916-+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
4917-+};
4918-+
4919-+#endif
4920-Index: ubuntu/plugins/expo/src/wall_offset/CMakeLists.txt
4921-===================================================================
4922---- /dev/null 1970-01-01 00:00:00.000000000 +0000
4923-+++ ubuntu/plugins/expo/src/wall_offset/CMakeLists.txt 2012-09-08 14:56:23.698323512 +0800
4924-@@ -0,0 +1,33 @@
4925-+include_directories (
4926-+ ${CMAKE_CURRENT_SOURCE_DIR}/include
4927-+ ${CMAKE_CURRENT_SOURCE_DIR}/src
4928-+ ${Boost_INCLUDE_DIRS}
4929-+ ${GLIBMM_INCLUDE_DIRS}
4930-+)
4931-+
4932-+link_directories (${GLIBMM_LIBRARY_DIRS} ${COMPIZ_LIBRARY_DIRS})
4933-+
4934-+set (
4935-+ PRIVATE_HEADERS
4936-+ ${CMAKE_CURRENT_SOURCE_DIR}/include/wall-offset.h
4937-+)
4938-+
4939-+set (
4940-+ SRCS
4941-+ ${CMAKE_CURRENT_SOURCE_DIR}/src/wall-offset.cpp
4942-+)
4943-+
4944-+add_library (
4945-+ compiz_expo_wall_offset STATIC
4946-+ ${SRCS}
4947-+ ${PRIVATE_HEADERS}
4948-+)
4949-+
4950-+if (COMPIZ_BUILD_TESTING)
4951-+ add_subdirectory ( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
4952-+endif (COMPIZ_BUILD_TESTING)
4953-+
4954-+target_link_libraries (
4955-+ compiz_expo_wall_offset
4956-+ compiz_core
4957-+)
4958-Index: ubuntu/plugins/expo/src/wall_offset/include/wall-offset.h
4959-===================================================================
4960---- /dev/null 1970-01-01 00:00:00.000000000 +0000
4961-+++ ubuntu/plugins/expo/src/wall_offset/include/wall-offset.h 2012-09-08 11:51:33.107328243 +0800
4962-@@ -0,0 +1,43 @@
4963-+/**
4964-+ * Copyright © 2012 Canonical Ltd.
4965-+ *
4966-+ * Authors:
4967-+ * Sam Spilsbury <sam.spilsbury@canonical.com>
4968-+ *
4969-+ * This program is free software; you can redistribute it and/or
4970-+ * modify it under the terms of the GNU General Public License
4971-+ * as published by the Free Software Foundation; either version 2
4972-+ * of the License, or (at your option) any later version.
4973-+ *
4974-+ * This program is distributed in the hope that it will be useful,
4975-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4976-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4977-+ * GNU General Public License for more details.
4978-+ *
4979-+ **/
4980-+
4981-+#ifndef _COMPIZ_EXPO_WALL_OFFSET_H
4982-+#define _COMPIZ_EXPO_WALL_OFFSET_H
4983-+
4984-+#include <core/point.h>
4985-+#include <core/size.h>
4986-+#include <core/rect.h>
4987-+
4988-+namespace compiz
4989-+{
4990-+ namespace expo
4991-+ {
4992-+ void
4993-+ calculateWallOffset (const CompRect &output,
4994-+ const CompPoint &offsetInScreenCoords,
4995-+ const CompPoint &vpSize,
4996-+ const CompSize &screenSize,
4997-+ float &offsetInWorldX,
4998-+ float &offsetInWorldY,
4999-+ float &worldScaleFactorX,
5000-+ float &worldScaleFactorY,
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: