=== modified file 'RELEASING'
--- RELEASING 2012-05-16 17:40:13 +0000
+++ RELEASING 2013-07-21 23:03:28 +0000
@@ -47,7 +47,7 @@
* Check that no release exists with the current version
* Verify that make distcheck completes successfully
* Generate the final tar file
- * Generate an sha1sum file
+ * Generate a sha1sum file
* Sign the sha1sum using your GPG setup (asks for your GPG password)
* scp the three files to appear on
http://xorg.freedesktop.org/archive/individual/app
=== modified file 'compizconfig/ccsm/ccm/Settings.py'
--- compizconfig/ccsm/ccm/Settings.py 2013-05-13 13:32:59 +0000
+++ compizconfig/ccsm/ccm/Settings.py 2013-07-21 23:03:28 +0000
@@ -1475,7 +1475,7 @@
self.Widget = gtk.Frame()
self.Expander = gtk.Expander(name)
self.Widget.add(self.Expander)
- self.Expander.set_expanded(False)
+ self.Expander.set_expanded(True)
self.Child = gtk.VBox()
self.Expander.add(self.Child)
=== modified file 'compizconfig/gsettings/tests/test_gsettings_tests.cpp'
=== modified file 'gtk/window-decorator/events.c'
=== modified file 'gtk/window-decorator/metacity.c'
=== modified file 'kde/window-decorator-kde4/window.cpp'
=== modified file 'metadata/core.xml.in'
--- metadata/core.xml.in 2013-01-29 23:38:49 +0000
+++ metadata/core.xml.in 2013-07-21 23:03:28 +0000
@@ -2,7 +2,7 @@
<_short>General Options
- <_long>General compiz options
+ <_long>I am the mighty core - nothing works without me
<_short>Active Plugins
=== modified file 'plugins/addhelper/addhelper.xml.in'
--- plugins/addhelper/addhelper.xml.in 2012-10-15 10:31:51 +0000
+++ plugins/addhelper/addhelper.xml.in 2013-07-21 23:03:28 +0000
@@ -13,6 +13,7 @@
opengl
fade
decor
+ obs
@@ -40,7 +41,7 @@
<_short>Brightness
<_long>Brightness of faded windows
30
- 1
+ 0
100
@@ -54,7 +55,7 @@
<_short>Opacity
<_long>Opacity of faded windows
100
- 1
+ 0
100
=== modified file 'plugins/addhelper/src/addhelper.cpp'
--- plugins/addhelper/src/addhelper.cpp 2013-05-09 13:43:07 +0000
+++ plugins/addhelper/src/addhelper.cpp 2013-07-21 23:03:28 +0000
@@ -35,7 +35,6 @@
* the windows, including the active. Otherwise, it will dim
* and reset the active.
*/
-
void
AddScreen::walkWindows ()
{
@@ -48,17 +47,13 @@
aw->dim = false;
- if (!isToggle)
- continue;
-
- if (w->id () == screen->activeWindow ())
- continue;
-
- if (w->invisible () || w->destroyed () ||
- !w->isMapped () || w->minimized ())
- continue;
-
- if (!optionGetWindowTypes ().evaluate (w))
+ if (!isToggle ||
+ w->id () == screen->activeWindow () ||
+ w->invisible () ||
+ w->destroyed () ||
+ !w->isMapped () ||
+ w->minimized () ||
+ !optionGetWindowTypes ().evaluate (w))
continue;
aw->cWindow->addDamage ();
@@ -72,7 +67,7 @@
*/
bool
AddWindow::glPaint (const GLWindowPaintAttrib &attrib,
- const GLMatrix &transform,
+ const GLMatrix &transform,
const CompRegion ®ion,
unsigned int mask)
{
@@ -84,7 +79,7 @@
GLWindowPaintAttrib wAttrib = attrib;
/* applies the lowest value */
- wAttrib.opacity = (MIN (attrib.opacity, as->opacity));
+ wAttrib.opacity = (MIN (attrib.opacity, as->opacity));
wAttrib.brightness = (MIN (attrib.brightness, as->brightness));
wAttrib.saturation = (MIN (attrib.saturation, as->saturation));
@@ -92,10 +87,8 @@
return gWindow->glPaint (wAttrib, transform, region, mask);
}
else
- {
/* the window is not dimmed, so it's painted normal */
return gWindow->glPaint (attrib, transform, region, mask);
- }
}
/* Takes the inital event.
@@ -117,21 +110,23 @@
/* Takes the action and toggles us.
*/
-
bool
AddScreen::toggle (CompAction *action,
CompAction::State state,
CompOption::Vector options)
{
isToggle = !isToggle;
+
if (isToggle)
{
walkWindows ();
+
foreach (CompWindow *w, screen->windows ())
{
ADD_WINDOW (w);
aw->gWindow->glPaintSetEnabled (aw, true);
}
+
screen->handleEventSetEnabled (this, true);
}
else
@@ -142,11 +137,11 @@
aw->gWindow->glPaintSetEnabled (aw, false);
aw->cWindow->addDamage ();
}
+
screen->handleEventSetEnabled (this, false);
}
return true;
-
}
void
@@ -156,24 +151,30 @@
switch (num)
{
case AddhelperOptions::Brightness:
- brightness = (optionGetBrightness () * 0xffff) / 100;
- break;
+ brightness = (optionGetBrightness () * BRIGHT) / 100;
+// break;
+
case AddhelperOptions::Saturation:
- saturation = (optionGetSaturation () * 0xffff) / 100;
- break;
+ saturation = (optionGetSaturation () * COLOR) / 100;
+// break;
+
case AddhelperOptions::Opacity:
- opacity = (optionGetOpacity () * 0xffff) / 100;
+ opacity = (optionGetOpacity () * OPAQUE) / 100;
break;
+
case AddhelperOptions::Ononinit: // <- Turn AddHelper on on initiation
isToggle = optionGetOnoninit ();
+
if (isToggle)
{
walkWindows ();
+
foreach (CompWindow *w, screen->windows ())
{
ADD_WINDOW (w);
aw->gWindow->glPaintSetEnabled (aw, true);
}
+
screen->handleEventSetEnabled (this, true);
}
else
@@ -183,9 +184,11 @@
ADD_WINDOW (w);
aw->gWindow->glPaintSetEnabled (aw, false);
}
+
screen->handleEventSetEnabled (this, false);
}
break;
+
default:
break;
}
@@ -205,8 +208,9 @@
if (as->isToggle)
{
if (window->id () != screen->activeWindow () &&
- !window->overrideRedirect ())
+ !window->overrideRedirect ())
dim = true;
+
gWindow->glPaintSetEnabled (this, true);
}
}
@@ -220,26 +224,26 @@
AddScreen::AddScreen (CompScreen *screen) :
PluginClassHandler (screen),
cScreen (CompositeScreen::get (screen)),
- opacity ((optionGetOpacity () * 0xffff) / 100),
- brightness ((optionGetBrightness () * 0xffff) / 100),
- saturation ((optionGetSaturation () * 0xffff) / 100),
+ opacity ((optionGetOpacity () * OPAQUE) / 100),
+ brightness ((optionGetBrightness () * BRIGHT) / 100),
+ saturation ((optionGetSaturation () * COLOR) / 100),
isToggle (optionGetOnoninit ())
{
ScreenInterface::setHandler (screen, false);
optionSetToggleKeyInitiate (boost::bind (&AddScreen::toggle, this,
- _1, _2, _3));
+ _1, _2, _3));
optionSetBrightnessNotify (boost::bind (&AddScreen::optionChanged, this, _1,
_2));
optionSetSaturationNotify (boost::bind (&AddScreen::optionChanged, this, _1,
_2));
optionSetOpacityNotify (boost::bind (&AddScreen::optionChanged, this, _1,
- _2));
+ _2));
optionSetOnoninitNotify (boost::bind (&AddScreen::optionChanged, this, _1,
- _2));
+ _2));
}
-
+
bool
AddPluginVTable::init ()
{
=== modified file 'plugins/addhelper/src/addhelper.h'
--- plugins/addhelper/src/addhelper.h 2012-09-04 15:33:44 +0000
+++ plugins/addhelper/src/addhelper.h 2013-07-21 23:03:28 +0000
@@ -39,15 +39,16 @@
public AddhelperOptions
{
public:
+
AddScreen (CompScreen *screen);
- CompositeScreen *cScreen;
-
- GLushort opacity;
- GLushort brightness;
- GLushort saturation;
-
- bool isToggle;
+ CompositeScreen *cScreen;
+
+ GLushort opacity;
+ GLushort brightness;
+ GLushort saturation;
+
+ bool isToggle;
void
handleEvent (XEvent *event);
@@ -63,8 +64,6 @@
void
optionChanged (CompOption *options,
AddhelperOptions::Options num);
-
-
};
class AddWindow :
@@ -72,6 +71,7 @@
public GLWindowInterface
{
public:
+
AddWindow (CompWindow *window);
~AddWindow ();
@@ -85,7 +85,7 @@
glPaint (const GLWindowPaintAttrib &,
const GLMatrix &,
const CompRegion &,
- unsigned int );
+ unsigned int );
};
class AddPluginVTable :
=== modified file 'plugins/animation/src/animation.cpp'
--- plugins/animation/src/animation.cpp 2013-05-26 06:15:47 +0000
+++ plugins/animation/src/animation.cpp 2013-07-21 23:03:28 +0000
@@ -97,17 +97,16 @@
public CompPlugin::VTableForScreenAndWindow
{
public:
+
bool init ();
void fini ();
};
COMPIZ_PLUGIN_20090315 (animation, AnimPluginVTable);
-static const unsigned short FAKE_ICON_SIZE = 4;
-
-const unsigned short LAST_ANIM_DIRECTION = 5;
-
-const unsigned short NUM_EFFECTS = 16;
+static const unsigned short FAKE_ICON_SIZE = 4;
+const unsigned short LAST_ANIM_DIRECTION = 5;
+const unsigned short NUM_EFFECTS = 16;
const char *eventNames[AnimEventNum] =
{"Open", "Close", "Minimize", "Unminimize", "Shade", "Focus"};
@@ -167,11 +166,12 @@
// provided by a plugin, otherwise set it to None.
void
PrivateAnimScreen::updateEventEffects (AnimEvent e,
- bool forRandom,
- bool callPost)
+ bool forRandom,
+ bool callPost)
{
CompOption::Value::Vector *listVal;
EffectSet *effectSet;
+
if (forRandom)
{
listVal = &getOptions ()[(unsigned)randomEffectOptionIds[e]].value ().
@@ -184,6 +184,7 @@
list ();
effectSet = &mEventEffects[e];
}
+
unsigned int n = listVal->size ();
effectSet->effects.clear ();
@@ -191,7 +192,7 @@
AnimEffectVector &eventEffectsAllowed = mEventEffectsAllowed[e];
- for (unsigned int r = 0; r < n; r++) // for each row
+ for (unsigned int r = 0; r < n; ++r) // for each row
{
const CompString &animName = (*listVal)[r].s ();
@@ -208,7 +209,7 @@
if (callPost)
{
- foreach (ExtensionPluginInfo *extPlugin, mExtensionPlugins)
+ foreach (ExtensionPluginInfo *extPlugin, mExtensionPlugins)
extPlugin->postUpdateEventEffects (e, forRandom);
}
}
@@ -227,21 +228,27 @@
bool
PrivateAnimScreen::isAnimEffectInList (AnimEffect theEffect,
- EffectSet &effectList)
+ EffectSet &effectList)
{
for (unsigned int i = 0; i < effectList.effects.size (); ++i)
if (effectList.effects[i] == theEffect)
return true;
+
return false;
}
bool
PrivateAnimScreen::isAnimEffectPossibleForEvent (AnimEffect theEffect,
- AnimEvent event)
+ AnimEvent event)
{
// Check all rows to see if the effect is chosen there
unsigned int nRows = mEventEffects[event].effects.size ();
- for (unsigned int i = 0; i < nRows; ++i)
+<<<<<<< TREE
+ for (unsigned int i = 0; i < nRows; ++i)
+=======
+
+ for (unsigned int i = 0; i < nRows; ++i)
+>>>>>>> MERGE-SOURCE
{
AnimEffect chosenEffect = mEventEffects[event].effects[i];
// if chosen directly
@@ -253,6 +260,7 @@
isAnimEffectInList (theEffect, mRandomEffects[event]))
return true;
}
+
return false;
}
@@ -262,6 +270,7 @@
for (int e = 0; e < AnimEventNum; ++e)
if (isAnimEffectPossibleForEvent (theEffect, (AnimEvent)e))
return true;
+
return false;
}
@@ -275,9 +284,11 @@
{
AnimEffect chosenEffect = mEventEffects[(unsigned)AnimEventFocus].
effects[i];
+
if (chosenEffect->isRestackAnim)
return true;
}
+
return false;
}
@@ -297,7 +308,7 @@
void
PrivateAnimScreen::addExtension (ExtensionPluginInfo *extensionPluginInfo,
- bool shouldInitPersistentData)
+ bool shouldInitPersistentData)
{
mExtensionPlugins.push_back (extensionPluginInfo);
@@ -323,21 +334,29 @@
}
}
- for (int e = 0; e < AnimEventNum; ++e)
+<<<<<<< TREE
+ for (int e = 0; e < AnimEventNum; ++e)
+=======
+ for (int e = 0; e < AnimEventNum; ++e)
+ {
+>>>>>>> MERGE-SOURCE
if (eventEffectsNeedUpdate[e])
{
updateEventEffects ((AnimEvent)e, false, false);
+
if (e != AnimEventFocus)
updateEventEffects ((AnimEvent)e, true, false);
}
+ }
if (shouldInitPersistentData)
{
const CompWindowList &pl = pushLockedPaintList ();
+ AnimWindow *aw;
// Initialize persistent window data for the extension plugin
foreach (CompWindow *w, pl)
{
- AnimWindow *aw = AnimWindow::get (w);
+ aw = AnimWindow::get (w);
extensionPluginInfo->initPersistentData (aw);
}
@@ -357,9 +376,12 @@
// Stop all ongoing animations
const CompWindowList &pl = pushLockedPaintList ();
+ PrivateAnimWindow *aw;
+
foreach (CompWindow *w, pl)
{
- PrivateAnimWindow *aw = AnimWindow::get (w)->priv;
+ aw = AnimWindow::get (w)->priv;
+
if (aw->curAnimation ())
aw->postAnimationCleanUp ();
}
@@ -380,7 +402,6 @@
if (extensionPluginInfo->nEffects == 0)
return; // no animation effects -> we're done here
-
// Also delete the "allowed effect" entries for that plugin
for (int e = 0; e < AnimEventNum; ++e)
@@ -409,6 +430,7 @@
// Update event effects to complete removal
updateEventEffects ((AnimEvent)e, false);
+
if (e != AnimEventFocus)
updateEventEffects ((AnimEvent)e, true);
}
@@ -425,11 +447,11 @@
popLockedPaintList ();
}
-ExtensionPluginInfo::ExtensionPluginInfo (const CompString &name,
- unsigned int nEffects,
- AnimEffect *effects,
+ExtensionPluginInfo::ExtensionPluginInfo (const CompString &name,
+ unsigned int nEffects,
+ AnimEffect *effects,
CompOption::Vector *effectOptions,
- unsigned int firstEffectOptionIndex) :
+ unsigned int firstEffectOptionIndex) :
name (name),
nEffects (nEffects),
effects (effects),
@@ -440,11 +462,11 @@
// End of extension functions
-Animation::Animation (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+Animation::Animation (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
mWindow (w),
mAWindow (AnimWindow::get (w)),
mTotalTime (duration),
@@ -461,11 +483,11 @@
if (curWindowEvent == WindowEventShade ||
curWindowEvent == WindowEventUnshade)
{
- mDecorTopHeight = w->output ().top;
+ mDecorTopHeight = w->output ().top;
mDecorBottomHeight = w->output ().bottom;
}
- texturesCache = new GLTexture::List (GLWindow::get (w)->textures ());
+ texturesCache = new GLTexture::List (GLWindow::get (w)->textures ());
PrivateAnimScreen *as = mAWindow->priv->paScreen ();
mTimestep = as->optionGetTimeStep ();
@@ -494,26 +516,32 @@
switch (mCurWindowEvent) // the old event
{
- case WindowEventOpen:
- mCurWindowEvent = WindowEventClose;
- break;
- case WindowEventClose:
- mCurWindowEvent = WindowEventOpen;
- break;
- case WindowEventMinimize:
- mCurWindowEvent = WindowEventUnminimize;
- break;
- case WindowEventUnminimize:
- mCurWindowEvent = WindowEventMinimize;
- break;
- case WindowEventShade:
- mCurWindowEvent = WindowEventUnshade;
- break;
- case WindowEventUnshade:
- mCurWindowEvent = WindowEventShade;
- break;
- default:
- break;
+ case WindowEventOpen:
+ mCurWindowEvent = WindowEventClose;
+ break;
+
+ case WindowEventClose:
+ mCurWindowEvent = WindowEventOpen;
+ break;
+
+ case WindowEventMinimize:
+ mCurWindowEvent = WindowEventUnminimize;
+ break;
+
+ case WindowEventUnminimize:
+ mCurWindowEvent = WindowEventMinimize;
+ break;
+
+ case WindowEventShade:
+ mCurWindowEvent = WindowEventUnshade;
+ break;
+
+ case WindowEventUnshade:
+ mCurWindowEvent = WindowEventShade;
+ break;
+
+ default:
+ break;
}
// 1: forward, 2: backward (3 - progressDir is opposite direction)
@@ -521,13 +549,14 @@
switch (mCurWindowEvent) // the new event
{
- case WindowEventClose:
- case WindowEventMinimize:
- case WindowEventShade:
- progressDir = 2;
- break;
- default:
- break;
+ case WindowEventClose:
+ case WindowEventMinimize:
+ case WindowEventShade:
+ progressDir = 2;
+ break;
+
+ default:
+ break;
}
if (mOverrideProgressDir == 0)
@@ -536,11 +565,11 @@
mOverrideProgressDir = 0; // disable override
}
-PartialWindowAnim::PartialWindowAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+PartialWindowAnim::PartialWindowAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
mUseDrawRegion (false),
mDrawRegion ()
@@ -574,8 +603,9 @@
getOptions ()[(unsigned)customOptionOptionIds[e]].value ();
unsigned int nRows = valMatch.list ().size ();
- if (nRows != eventEffects->effects.size () ||
- nRows != valDuration.list ().size () ||
+
+ if (nRows != eventEffects->effects.size () ||
+ nRows != valDuration.list ().size () ||
nRows != valCustomOptions.list ().size ())
{
compLogMessage ("animation", CompLogLevelError,
@@ -605,15 +635,16 @@
AnimEffect
PrivateAnimScreen::getActualEffect (AnimEffect effect,
- AnimEvent animEvent)
+ AnimEvent animEvent)
{
- bool allRandom = optionGetAllRandom ();
+ bool allRandom = optionGetAllRandom ();
AnimEffectVector *randomEffects = &mRandomEffects[animEvent].effects;
- unsigned int nRandomEffects = randomEffects->size ();
+ unsigned int nRandomEffects = randomEffects->size ();
if ((effect == AnimEffectRandom) || allRandom)
{
unsigned int nFirstRandomEffect = 0;
+
if (nRandomEffects == 0) // no random animation selected, assume "all"
{
randomEffects = &mEventEffectsAllowed[animEvent];
@@ -622,8 +653,10 @@
nFirstRandomEffect = 2;
nRandomEffects = randomEffects->size () - 2;
}
+
unsigned int index = nFirstRandomEffect +
(unsigned int)(nRandomEffects * (double)rand () / RAND_MAX);
+
return (*randomEffects)[index];
}
else
@@ -634,12 +667,10 @@
/// to an actual direction (up, down, left, or right).
AnimDirection
Animation::getActualAnimDirection (AnimDirection dir,
- bool openDir)
+ bool openDir)
{
if (dir == AnimDirectionRandom)
- {
dir = (AnimDirection)(rand () % 4);
- }
else if (dir == AnimDirectionAuto)
{
CompRect outRect (mAWindow->savedRectsValid () ?
@@ -647,8 +678,8 @@
mWindow->outputRect ());
// away from icon
- int centerX = outRect.x () + outRect.width () / 2 ;
- int centerY = outRect.y () + outRect.height () / 2 ;
+ int centerX = outRect.centerX ();
+ int centerY = outRect.centerY ();
float relDiffX = ((float)centerX - mIcon.x ()) / outRect.width ();
float relDiffY = ((float)centerY - mIcon.y ()) / outRect.height ();
@@ -683,14 +714,13 @@
float
Animation::progressLinear ()
{
- float forwardProgress =
- 1 - mRemainingTime / (mTotalTime - mTimestep);
- forwardProgress = MIN (forwardProgress, 1);
- forwardProgress = MAX (forwardProgress, 0);
+ float forwardProgress = 1 - mRemainingTime / (mTotalTime - mTimestep);
+ forwardProgress = MIN (forwardProgress, 1);
+ forwardProgress = MAX (forwardProgress, 0);
- if (mCurWindowEvent == WindowEventOpen ||
- mCurWindowEvent == WindowEventUnminimize ||
- mCurWindowEvent == WindowEventUnshade ||
+ if (mCurWindowEvent == WindowEventOpen ||
+ mCurWindowEvent == WindowEventUnminimize ||
+ mCurWindowEvent == WindowEventUnshade ||
mCurWindowEvent == WindowEventFocus)
forwardProgress = 1 - forwardProgress;
@@ -700,19 +730,17 @@
float
Animation::progressEaseInEaseOut ()
{
- float forwardProgress =
- 1 - mRemainingTime / (mTotalTime - mTimestep);
- forwardProgress = MIN (forwardProgress, 1);
- forwardProgress = MAX (forwardProgress, 0);
+ float forwardProgress = 1 - mRemainingTime / (mTotalTime - mTimestep);
+ forwardProgress = MIN (forwardProgress, 1);
+ forwardProgress = MAX (forwardProgress, 0);
// Apply sigmoid and normalize
- forwardProgress =
- (sigmoid (forwardProgress) - sigmoid (0)) /
- (sigmoid (1) - sigmoid (0));
+ forwardProgress = (sigmoid (forwardProgress) - sigmoid (0)) /
+ (sigmoid (1) - sigmoid (0));
- if (mCurWindowEvent == WindowEventOpen ||
- mCurWindowEvent == WindowEventUnminimize ||
- mCurWindowEvent == WindowEventUnshade ||
+ if (mCurWindowEvent == WindowEventOpen ||
+ mCurWindowEvent == WindowEventUnminimize ||
+ mCurWindowEvent == WindowEventUnshade ||
mCurWindowEvent == WindowEventFocus)
forwardProgress = 1 - forwardProgress;
@@ -725,7 +753,9 @@
/// where minx and maxx are the
/// starting and ending points on the sigmoid.
float
-Animation::progressDecelerateCustom (float progress, float minx, float maxx)
+Animation::progressDecelerateCustom (float progress,
+ float minx,
+ float maxx)
{
float x = 1 - progress;
float s = 8;
@@ -770,16 +800,20 @@
if (source.x1 < target.x1)
target.x1 = source.x1;
+
if (source.x2 > target.x2)
target.x2 = source.x2;
+
if (source.y1 < target.y1)
target.y1 = source.y1;
+
if (source.y2 > target.y2)
target.y2 = source.y2;
}
void
-AnimWindow::expandBBWithPoint (float fx, float fy)
+AnimWindow::expandBBWithPoint (float fx,
+ float fy)
{
Box &target = priv->BB ();
@@ -794,6 +828,7 @@
target.y2 = y + 1;
return;
}
+
if (x < target.x1)
target.x1 = x;
else if (x > target.x2)
@@ -817,14 +852,19 @@
}
static bool
-project (float objx, float objy, float objz,
- const float modelview[16], const float projection[16],
- const GLint viewport[4],
- float *winx, float *winy, float *winz)
+project (float objx,
+ float objy,
+ float objz,
+ const float modelview[16],
+ const float projection[16],
+ const GLint viewport[4],
+ float *winx,
+ float *winy,
+ float *winz)
{
unsigned int i;
- float in[4];
- float out[4];
+ float in[4];
+ float out[4];
in[0] = objx;
in[1] = objy;
@@ -870,11 +910,11 @@
/// Either points or objects should be non-0.
bool
-AnimWindow::expandBBWithPoints3DTransform (CompOutput &output,
- GLMatrix &transform,
- const float *points,
+AnimWindow::expandBBWithPoints3DTransform (CompOutput &output,
+ GLMatrix &transform,
+ const float *points,
GridAnim::GridModel::GridObject *objects,
- unsigned int nPoints)
+ unsigned int nPoints)
{
GLfloat x, y, z;
GLint viewport[4] =
@@ -884,16 +924,16 @@
output.height ()};
const float *projection =
- GLScreen::get (::screen)->projectionMatrix ()->getMatrix ();
+ GLScreen::get (::screen)->projectionMatrix ()->getMatrix ();
if (points) // use points
{
- for (; nPoints; nPoints--, points += 3)
+ for (; nPoints; --nPoints, points += 3)
{
if (!project (points[0], points[1], points[2],
- transform.getMatrix (), projection,
- viewport,
- &x, &y, &z))
+ transform.getMatrix (), projection,
+ viewport,
+ &x, &y, &z))
return false;
expandBBWithPoint (x + 0.5, (::screen->height () - y) + 0.5);
@@ -902,14 +942,19 @@
else // use grid model objects
{
GridAnim::GridModel::GridObject *object = objects;
- for (; nPoints; --nPoints, ++object)
+<<<<<<< TREE
+ for (; nPoints; --nPoints, ++object)
+=======
+
+ for (; nPoints; --nPoints, ++object)
+>>>>>>> MERGE-SOURCE
{
if (!project (object->position ().x (),
- object->position ().y (),
- object->position ().z (),
- transform.getMatrix (), projection,
- viewport,
- &x, &y, &z))
+ object->position ().y (),
+ object->position ().z (),
+ transform.getMatrix (), projection,
+ viewport,
+ &x, &y, &z))
return false;
expandBBWithPoint (x + 0.5, (::screen->height () - y) + 0.5);
@@ -924,7 +969,8 @@
CompRect outRect (savedRectsValid () ?
savedOutRect () :
mWindow->outputRect ());
- Box windowBox = {
+ Box windowBox =
+ {
static_cast (outRect.x ()), static_cast (outRect.x () + outRect.width ()),
static_cast (outRect.y ()), static_cast (outRect.y () + outRect.height ())
};
@@ -941,8 +987,8 @@
void
Animation::prepareTransform (CompOutput &output,
- GLMatrix &resultTransform,
- GLMatrix &transform)
+ GLMatrix &resultTransform,
+ GLMatrix &transform)
{
GLMatrix sTransform;
sTransform.toScreenSpace (&output, -DEFAULT_Z_CAMERA);
@@ -954,9 +1000,9 @@
{
// Have a 1 pixel margin to prevent occasional 1 pixel line artifact
CompRegion region (priv->mBB.x1 - 1,
- priv->mBB.y1 - 1,
- priv->mBB.x2 - priv->mBB.x1 + 2,
- priv->mBB.y2 - priv->mBB.y1 + 2);
+ priv->mBB.y1 - 1,
+ priv->mBB.x2 - priv->mBB.x1 + 2,
+ priv->mBB.y2 - priv->mBB.y1 + 2);
priv->mStepRegion = region;
}
@@ -978,7 +1024,8 @@
}
bool
-AnimScreen::getMousePointerXY (short *x, short *y)
+AnimScreen::getMousePointerXY (short *x,
+ short *y)
{
Window w1, w2;
int xp, yp, xj, yj;
@@ -998,21 +1045,21 @@
PrivateAnimWindow::getState ()
{
Atom actual;
- int result, format;
+ int format;
unsigned long n, left;
unsigned char *data;
unsigned int retval = WithdrawnState;
- result = XGetWindowProperty (::screen->dpy (), mWindow->id (),
- Atoms::wmState, 0L,
- 1L, false,
- Atoms::wmState,
- &actual, &format, &n, &left, &data);
+ int result = XGetWindowProperty (::screen->dpy (), mWindow->id (),
+ Atoms::wmState, 0L,
+ 1L, false,
+ Atoms::wmState,
+ &actual, &format, &n, &left, &data);
if (result == Success && data)
{
if (n)
- memcpy (&retval, data, sizeof (int));
+ memcpy (&retval, data, sizeof (int));
XFree ((void *)data);
}
@@ -1039,6 +1086,7 @@
{
if (mExtensionPlugins.empty ())
initAnimationList ();
+
foreach (CompOption::Value &val, opt->value ().list ())
val.match ().update ();
}
@@ -1049,6 +1097,7 @@
{
if (mExtensionPlugins.empty ())
initAnimationList ();
+
updateOptionSets (getCorrespondingAnimEvent (num));
}
@@ -1058,6 +1107,7 @@
{
if (mExtensionPlugins.empty ())
initAnimationList ();
+
updateEventEffects (getCorrespondingAnimEvent (num), false);
}
@@ -1067,6 +1117,7 @@
{
if (mExtensionPlugins.empty ())
initAnimationList ();
+
updateEventEffects (getCorrespondingAnimEvent (num), true);
}
@@ -1076,22 +1127,21 @@
bool clearMatchingRow)
{
bool shouldDamageWindow = false;
-
+
notifyAnimation (false);
- if (mCurAnimation)
- {
- if (mCurAnimation->shouldDamageWindowOnEnd ())
- shouldDamageWindow = true;
- }
+ if (mCurAnimation &&
+ mCurAnimation->shouldDamageWindowOnEnd ())
+ shouldDamageWindow = true;
+
enablePainting (false);
if (shouldDamageWindow)
mAWindow->expandBBWithWindow ();
if (shouldDamageWindow ||
- (mCurAnimation &&
- !mCurAnimation->stepRegionUsed () &&
+ (mCurAnimation &&
+ !mCurAnimation->stepRegionUsed () &&
mAWindow->BB ()->x1 != MAXSHORT)) // BB intialized
mAWindow->resetStepRegionWithBB ();
@@ -1113,16 +1163,20 @@
mCurAnimSelectionRow = -1;
mFinishingAnim = true;
+
if (!destructing)
{
mIgnoreDamage = true;
+
while (mUnmapCnt > 0)
{
mWindow->unmap ();
--mUnmapCnt;
}
+
if (mUnmapCnt < 0)
mUnmapCnt = 0;
+
mIgnoreDamage = false;
}
@@ -1131,6 +1185,7 @@
mWindow->destroy ();
--mDestroyCnt;
}
+
mFinishingAnim = false;
foreach (ExtensionPluginInfo *extPlugin, mPAScreen->mExtensionPlugins)
@@ -1175,12 +1230,10 @@
return;
}
else
- {
// Animations have finished for all windows
// (Keep preparePaint enabled)
-
aScreen->enableCustomPaintList (false);
- }
+
cScreen->donePaintSetEnabled (this, activating);
gScreen->glPaintOutputSetEnabled (this, activating);
@@ -1200,49 +1253,56 @@
void
PrivateAnimWindow::notifyAnimation (bool activation)
{
- CompOption::Vector o (0);
-
if (!mCurAnimation)
return;
-
+
+ CompOption::Vector o (0);
+
o.push_back (CompOption ("root", CompOption::TypeInt));
o.push_back (CompOption ("window", CompOption::TypeInt));
o.push_back (CompOption ("type", CompOption::TypeString));
o.push_back (CompOption ("active", CompOption::TypeBool));
-
+
o[0].value ().set ((int) ::screen->root ());
o[1].value ().set ((int) mWindow->id ());
-
+
switch (mCurAnimation->curWindowEvent ())
{
case WindowEventOpen:
o[2].value ().set ("open");
break;
+
case WindowEventClose:
o[2].value ().set ("close");
break;
+
case WindowEventMinimize:
o[2].value ().set ("minimize");
break;
+
case WindowEventUnminimize:
o[2].value ().set ("unminimize");
break;
+
case WindowEventShade:
o[2].value ().set ("shade");
break;
+
case WindowEventUnshade:
o[2].value ().set ("unshade");
break;
+
case WindowEventFocus:
o[2].value ().set ("focus");
break;
+
case WindowEventNum:
case WindowEventNone:
default:
o[2].value ().set ("none");
break;
}
-
+
o[3].value ().set (activation);
screen->handleCompizEvent ("animation", "window_animation", o);
@@ -1254,6 +1314,7 @@
for (int i = 0; i < WatchedScreenPluginNum; ++i)
if (mPluginActive[i])
return true;
+
return false;
}
@@ -1261,6 +1322,7 @@
Animation::shouldSkipFrame (int msSinceLastPaintActual)
{
mTimeElapsedWithinTimeStep += msSinceLastPaintActual;
+
if (mTimeElapsedWithinTimeStep < mTimestep) // if timestep not yet completed
return true;
@@ -1304,7 +1366,7 @@
extPlugin->prePreparePaintGeneral ();
if (mAnimInProgress)
- {
+ {
int msSinceLastPaintActual;
const CompWindowList &pl = pushLockedPaintList ();
CompWindowList windowsFinishedAnimations;
@@ -1325,14 +1387,19 @@
mLastRedrawTime = curTime; // Store current time for next time
mLastRedrawTimeFresh = true;
+ CompWindow *w;
+ AnimWindow *animWin;
+ PrivateAnimWindow *aw;
+ Animation *curAnim;
+
/* Paint list includes destroyed windows */
for (CompWindowList::const_reverse_iterator rit = pl.rbegin ();
rit != pl.rend (); ++rit)
{
- CompWindow *w = (*rit);
- AnimWindow *animWin = AnimWindow::get (w);
- PrivateAnimWindow *aw = animWin->priv;
- Animation *curAnim = aw->curAnimation ();
+ w = (*rit);
+ animWin = AnimWindow::get (w);
+ aw = animWin->priv;
+ curAnim = aw->curAnimation ();
if (curAnim)
{
@@ -1393,6 +1460,7 @@
// so reset step region here with BB.
animWin->resetStepRegionWithBB ();
}
+
if (!(cScreen->damageMask () &
COMPOSITE_SCREEN_DAMAGE_ALL_MASK))
aw->damageThisAndLastStepRegion ();
@@ -1400,6 +1468,7 @@
}
bool finished = (curAnim->remainingTime () <= 0);
+
if (finished) // Animation is done
windowsFinishedAnimations.push_back (w);
}
@@ -1408,6 +1477,7 @@
foreach (CompWindow *w, pl)
{
PrivateAnimWindow *aw = AnimWindow::get (w)->priv;
+
if (aw->curAnimation ())
aw->curAnimation ()->postPreparePaint ();
}
@@ -1422,7 +1492,12 @@
if (mStartCountdown)
{
- --mStartCountdown;
+<<<<<<< TREE
+ --mStartCountdown;
+=======
+ --mStartCountdown;
+
+>>>>>>> MERGE-SOURCE
if (!mStartCountdown)
{
foreach (ExtensionPluginInfo *extPlugin, mExtensionPlugins)
@@ -1440,19 +1515,24 @@
CompWindowList windowsFinishedAnimations;
bool animStillInProgress = false;
+ CompWindow *w;
+ AnimWindow *animWin;
+ PrivateAnimWindow *aw;
+ Animation *curAnim;
/* Paint list includes destroyed windows */
for (CompWindowList::const_reverse_iterator rit = pl.rbegin ();
rit != pl.rend (); ++rit)
{
- CompWindow *w = (*rit);
- AnimWindow *animWin = AnimWindow::get (w);
- PrivateAnimWindow *aw = animWin->priv;
- Animation *curAnim = aw->curAnimation ();
+ w = (*rit);
+ animWin = AnimWindow::get (w);
+ aw = animWin->priv;
+ curAnim = aw->curAnimation ();
if (curAnim)
{
bool finished = (curAnim->remainingTime () <= 0);
+
if (finished) // Animation is done
windowsFinishedAnimations.push_back (w);
else
@@ -1518,16 +1598,16 @@
bool
Animation::shouldDamageWindowOnStart ()
{
- return (mCurWindowEvent == WindowEventClose ||
- mCurWindowEvent == WindowEventMinimize ||
+ return (mCurWindowEvent == WindowEventClose ||
+ mCurWindowEvent == WindowEventMinimize ||
mCurWindowEvent == WindowEventShade);
}
bool
Animation::shouldDamageWindowOnEnd ()
{
- return (mCurWindowEvent == WindowEventOpen ||
- mCurWindowEvent == WindowEventUnminimize ||
+ return (mCurWindowEvent == WindowEventOpen ||
+ mCurWindowEvent == WindowEventUnminimize ||
mCurWindowEvent == WindowEventUnshade);
}
@@ -1563,15 +1643,13 @@
}
void
-PrivateAnimWindow::glDrawTexture (GLTexture *texture,
- const GLMatrix &transform,
- const GLWindowPaintAttrib &attrib,
- unsigned int mask)
+PrivateAnimWindow::glDrawTexture (GLTexture *texture,
+ const GLMatrix &transform,
+ const GLWindowPaintAttrib &attrib,
+ unsigned int mask)
{
if (mCurAnimation)
- {
mCurAnimation->setCurPaintAttrib (attrib);
- }
gWindow->glDrawTexture (texture, transform, attrib, mask);
}
@@ -1586,16 +1664,14 @@
mCurAnimation->drawGeometry ();
}
else
- {
gWindow->glDrawGeometry ();
- }
}
#endif
void
-Animation::drawTexture (GLTexture *texture,
- const GLWindowPaintAttrib &attrib,
- unsigned int mask)
+Animation::drawTexture (GLTexture *texture,
+ const GLWindowPaintAttrib &attrib,
+ unsigned int mask)
{
mCurPaintAttrib = attrib;
}
@@ -1610,8 +1686,9 @@
bool
PrivateAnimWindow::glPaint (const GLWindowPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion, unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ unsigned int mask)
{
bool status;
@@ -1694,7 +1771,7 @@
{
if (!mLockedPaintListCnt)
{
- const CompWindowList &pl = cScreen->getWindowPaintList ();
+ const CompWindowList &pl = cScreen->getWindowPaintList ();
mLockedPaintList = &pl;
if (!mGetWindowPaintListEnableCnt)
@@ -1704,7 +1781,12 @@
}
}
- ++mLockedPaintListCnt;
+<<<<<<< TREE
+ ++mLockedPaintListCnt;
+=======
+ ++mLockedPaintListCnt;
+
+>>>>>>> MERGE-SOURCE
return *mLockedPaintList;
}
@@ -1734,6 +1816,7 @@
ExtensionPluginAnimation *extPlugin =
static_cast (mExtensionPlugins[0]);
+
return extPlugin->getWindowPaintList ();
}
@@ -1802,7 +1885,12 @@
{
::screen->handleCompizEvent (pluginName, eventName, options);
- for (int i = 0; i < WatchedScreenPluginNum; ++i)
+<<<<<<< TREE
+ for (int i = 0; i < WatchedScreenPluginNum; ++i)
+=======
+ for (int i = 0; i < WatchedScreenPluginNum; ++i)
+ {
+>>>>>>> MERGE-SOURCE
if (strcmp (pluginName, watchedScreenPlugins[i].pluginName) == 0)
{
if (strcmp (eventName,
@@ -1813,17 +1901,22 @@
if (!mPluginActive[i] &&
(i == WatchedPluginSwitcher ||
- i == WatchedPluginRing ||
- i == WatchedPluginShift ||
+ i == WatchedPluginRing ||
+ i == WatchedPluginShift ||
i == WatchedPluginScale))
- {
mSwitcherPostWait = 1;
- }
}
+
break;
}
+ }
- for (int i = 0; i < WatchedWindowPluginNum; ++i)
+<<<<<<< TREE
+ for (int i = 0; i < WatchedWindowPluginNum; ++i)
+=======
+ for (int i = 0; i < WatchedWindowPluginNum; ++i)
+ {
+>>>>>>> MERGE-SOURCE
if (strcmp (pluginName,
watchedWindowPlugins[i].pluginName) == 0)
{
@@ -1845,14 +1938,17 @@
false);
}
}
+
break;
}
+ }
}
/// Returns true for windows that don't have a pixmap or certain properties,
/// like the dimming layer of gksudo and x-session-manager.
inline bool
-PrivateAnimScreen::shouldIgnoreWindowForAnim (CompWindow *w, bool checkPixmap)
+PrivateAnimScreen::shouldIgnoreWindowForAnim (CompWindow *w,
+ bool checkPixmap)
{
AnimWindow *aw = AnimWindow::get (w);
@@ -1889,6 +1985,7 @@
if (shouldIgnoreWindowForAnim (w, true))
return;
+
int duration = 200;
AnimEffect chosenEffect =
getMatchingAnimSelection (w, AnimEventClose, &duration);
@@ -1921,9 +2018,7 @@
}
}*/
else
- {
aw->postAnimationCleanUpPrev (true, false);
- }
}
if (startingNew)
@@ -1989,35 +2084,35 @@
// Make sure non-animated closing windows get a damage.
if (!aw->curAnimation ())
- {
aw->mAWindow->expandBBWithWindow ();
- }
}
CompRect
-PrivateAnimScreen::getIcon (CompWindow *w, bool alwaysUseMouse)
+PrivateAnimScreen::getIcon (CompWindow *w,
+ bool alwaysUseMouse)
{
CompRect icon;
if (!alwaysUseMouse)
- {
icon = w->iconGeometry ();
- }
+
if (alwaysUseMouse ||
- (icon.x () == 0 &&
- icon.y () == 0 &&
+ (icon.x () == 0 &&
+ icon.y () == 0 &&
icon.width () == 0 &&
icon.height () == 0)) // that is, couldn't get icon from window
{
// Minimize to mouse pointer if there is no
// window list or if the window skips taskbar
short x, y;
+
if (!aScreen->getMousePointerXY (&x, &y))
{
// Use screen center if can't get mouse coords
x = ::screen->width () / 2;
y = ::screen->height () / 2;
}
+
icon.setX (x);
icon.setY (y);
icon.setWidth (FAKE_ICON_SIZE);
@@ -2053,7 +2148,7 @@
if (chosenEffect != AnimEffectNone)
{
- bool startingNew = true;
+ bool startingNew = true;
WindowEvent curWindowEvent = WindowEventNone;
if (aw->curAnimation ())
@@ -2062,9 +2157,7 @@
if (curWindowEvent != WindowEventNone)
{
if (curWindowEvent != WindowEventUnminimize)
- {
aw->postAnimationCleanUpPrev (false, false);
- }
else
{
startingNew = false;
@@ -2112,17 +2205,16 @@
if (chosenEffect != AnimEffectNone)
{
- bool startingNew = true;
+ bool startingNew = true;
WindowEvent curWindowEvent = WindowEventNone;
+
if (aw->curAnimation ())
curWindowEvent = aw->curAnimation ()->curWindowEvent ();
if (curWindowEvent != WindowEventNone)
{
if (curWindowEvent != WindowEventUnshade)
- {
aw->postAnimationCleanUpPrev (false, false);
- }
else
{
startingNew = false;
@@ -2169,6 +2261,7 @@
extPlugin->preInitiateOpenAnim (aw->mAWindow);
WindowEvent curWindowEvent = WindowEventNone;
+
if (aw->curAnimation ())
curWindowEvent = aw->curAnimation ()->curWindowEvent ();
@@ -2185,9 +2278,7 @@
if (curWindowEvent != WindowEventNone)
{
if (curWindowEvent != WindowEventClose)
- {
aw->postAnimationCleanUpPrev (false, false);
- }
else
{
startingNew = false;
@@ -2251,15 +2342,14 @@
// TODO Refactor the rest? (almost the same in other initiateX methods)
WindowEvent curWindowEvent = WindowEventNone;
+
if (aw->curAnimation ())
curWindowEvent = aw->curAnimation ()->curWindowEvent ();
if (curWindowEvent != WindowEventNone)
{
if (curWindowEvent != WindowEventMinimize)
- {
aw->postAnimationCleanUpPrev (false, false);
- }
else
{
startingNew = false;
@@ -2316,15 +2406,14 @@
bool playEffect = true;
WindowEvent curWindowEvent = WindowEventNone;
+
if (aw->curAnimation ())
curWindowEvent = aw->curAnimation ()->curWindowEvent ();
if (curWindowEvent != WindowEventNone)
{
if (curWindowEvent != WindowEventShade)
- {
aw->postAnimationCleanUpPrev (false, false);
- }
else
{
startingNew = false;
@@ -2363,8 +2452,8 @@
bool
PrivateAnimScreen::initiateFocusAnim (PrivateAnimWindow *aw)
{
- CompWindow *w = aw->mWindow;
- int duration = 200;
+ CompWindow *w = aw->mWindow;
+ int duration = 200;
if (aw->curAnimation () || otherPluginsActive () ||
// Check the "switcher post-wait" counter that effectively prevents
@@ -2407,19 +2496,19 @@
mUnshadePending = false;
mPAScreen->initiateUnshadeAnim (this);
}
- else if (mCurAnimation && mCurAnimation->inProgress () &&
+ else if (mCurAnimation && mCurAnimation->inProgress () &&
// Don't let transient window open anim be interrupted with a resize notify
- !(mCurAnimation->curWindowEvent () == WindowEventOpen &&
+ !(mCurAnimation->curWindowEvent () == WindowEventOpen &&
(mWindow->wmType () &
- (CompWindowTypeDropdownMenuMask |
- CompWindowTypePopupMenuMask |
- CompWindowTypeMenuMask |
- CompWindowTypeTooltipMask |
- CompWindowTypeNotificationMask |
- CompWindowTypeComboMask |
- CompWindowTypeDndMask))) &&
+ (CompWindowTypeDropdownMenuMask |
+ CompWindowTypePopupMenuMask |
+ CompWindowTypeMenuMask |
+ CompWindowTypeTooltipMask |
+ CompWindowTypeNotificationMask |
+ CompWindowTypeComboMask |
+ CompWindowTypeDndMask))) &&
// Ignore resize with dx=0, dy=0, dwidth=0, dheight=0
- !(dx == 0 && dy == 0 && dwidth == 0 && dheight == 0) &&
+ !(dx == 0 && dy == 0 && dwidth == 0 && dheight == 0) &&
!mCurAnimation->resizeUpdate (dx, dy, dwidth, dheight))
{
postAnimationCleanUp ();
@@ -2445,9 +2534,7 @@
break;
}
else
- {
aw->notifyAnimation (false);
- }
}
popLockedPaintList ();
@@ -2462,11 +2549,11 @@
bool immediate)
{
if (mCurAnimation && mCurAnimation->inProgress () &&
- (mGrabbed || !mCurAnimation->moveUpdate (dx, dy)))
+ (mGrabbed || !mCurAnimation->moveUpdate (dx, dy)))
{
// Stop the animation
- postAnimationCleanUp ();
- mPAScreen->updateAnimStillInProgress ();
+ postAnimationCleanUp ();
+ mPAScreen->updateAnimStillInProgress ();
}
mWindow->moveNotify (dx, dy, immediate);
@@ -2496,7 +2583,7 @@
const GLMatrix &matrix,
const CompRegion ®ion,
CompOutput *output,
- unsigned int mask)
+ unsigned int mask)
{
assert (mAnimInProgress);
@@ -2530,46 +2617,88 @@
AnimEffectUsedFor& AnimEffectUsedFor::exclude (AnimEvent event)
{
- switch (event) {
- case AnimEventOpen: open = false; break;
- case AnimEventClose: close = false; break;
- case AnimEventMinimize: minimize = false; break;
- case AnimEventUnminimize: unminimize = false; break;
- case AnimEventShade: shade = false; break;
- case AnimEventFocus: focus = false; break;
- default: break;
- }
- return *this;
+ switch (event)
+ {
+ case AnimEventOpen:
+ open = false;
+ break;
+
+ case AnimEventClose:
+ close = false;
+ break;
+
+ case AnimEventMinimize:
+ minimize = false;
+ break;
+
+ case AnimEventUnminimize:
+ unminimize = false;
+ break;
+
+ case AnimEventShade:
+ shade = false;
+ break;
+
+ case AnimEventFocus:
+ focus = false;
+ break;
+
+ default:
+ break;
+ }
+
+ return *this;
}
AnimEffectUsedFor& AnimEffectUsedFor::include (AnimEvent event)
{
- switch (event) {
- case AnimEventOpen: open = true; break;
- case AnimEventClose: close = true; break;
- case AnimEventMinimize: minimize = true; break;
- case AnimEventUnminimize: unminimize = true; break;
- case AnimEventShade: shade = true; break;
- case AnimEventFocus: focus = true; break;
- default: break;
- }
+ switch (event)
+ {
+ case AnimEventOpen:
+ open = true;
+ break;
+
+ case AnimEventClose:
+ close = true;
+ break;
+
+ case AnimEventMinimize:
+ minimize = true;
+ break;
+
+ case AnimEventUnminimize:
+ unminimize = true;
+ break;
+
+ case AnimEventShade:
+ shade = true;
+ break;
+
+ case AnimEventFocus:
+ focus = true;
+ break;
+
+ default:
+ break;
+ }
+
return *this;
}
-AnimEffectInfo::AnimEffectInfo (const char *name,
- AnimEffectUsedFor usedFor,
- CreateAnimFunc create,
- bool isRestackAnim) :
+AnimEffectInfo::AnimEffectInfo (const char *name,
+ AnimEffectUsedFor usedFor,
+ CreateAnimFunc create,
+ bool isRestackAnim) :
name (name),
create (create),
isRestackAnim (isRestackAnim)
{
- usedForEvents[AnimEventOpen] = usedFor.open;
- usedForEvents[AnimEventClose] = usedFor.close;
- usedForEvents[AnimEventMinimize] = usedFor.minimize;
+ usedForEvents[AnimEventOpen] = usedFor.open;
+ usedForEvents[AnimEventClose] = usedFor.close;
+ usedForEvents[AnimEventMinimize] = usedFor.minimize;
usedForEvents[AnimEventUnminimize] = usedFor.unminimize;
- usedForEvents[AnimEventShade] = usedFor.shade;
- usedForEvents[AnimEventFocus] = usedFor.focus;
+ usedForEvents[AnimEventShade] = usedFor.shade;
+ usedForEvents[AnimEventFocus] = usedFor.focus;
}
bool
@@ -2587,7 +2716,7 @@
AnimEffect animEffects[NUM_EFFECTS];
ExtensionPluginAnimation animExtensionPluginInfo (CompString ("animation"),
- NUM_EFFECTS, animEffects, 0,
+ NUM_EFFECTS, animEffects, 0,
NUM_NONEFFECT_OPTIONS);
ExtensionPluginInfo *
Animation::getExtensionPluginInfo ()
@@ -2695,86 +2824,86 @@
int i = 0;
animEffects[i++] = AnimEffectNone =
- new AnimEffectInfo ("animation:None",
- AnimEffectUsedFor::all(),
- 0);
+ new AnimEffectInfo ("animation:None",
+ AnimEffectUsedFor::all(),
+ 0);
animEffects[i++] = AnimEffectRandom =
- new AnimEffectInfo ("animation:Random",
- AnimEffectUsedFor::all().exclude(AnimEventFocus),
- 0);
+ new AnimEffectInfo ("animation:Random",
+ AnimEffectUsedFor::all().exclude(AnimEventFocus),
+ 0);
animEffects[i++] = AnimEffectCurvedFold =
- new AnimEffectInfo ("animation:Curved Fold",
- AnimEffectUsedFor::all().exclude(AnimEventFocus),
- &createAnimation);
-
+ new AnimEffectInfo ("animation:Curved Fold",
+ AnimEffectUsedFor::all().exclude(AnimEventFocus),
+ &createAnimation);
+
animEffects[i++] = AnimEffectDodge =
- new AnimEffectInfo ("animation:Dodge",
- AnimEffectUsedFor::none().include(AnimEventFocus),
- &createAnimation,
- true);
-
+ new AnimEffectInfo ("animation:Dodge",
+ AnimEffectUsedFor::none().include(AnimEventFocus),
+ &createAnimation,
+ true);
+
animEffects[i++] = AnimEffectDream =
- new AnimEffectInfo ("animation:Dream",
- AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
- &createAnimation);
+ new AnimEffectInfo ("animation:Dream",
+ AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
+ &createAnimation);
animEffects[i++] = AnimEffectFade =
- new AnimEffectInfo ("animation:Fade",
- AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
- &createAnimation);
-
+ new AnimEffectInfo ("animation:Fade",
+ AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
+ &createAnimation);
+
animEffects[i++] = AnimEffectFocusFade =
- new AnimEffectInfo ("animation:Focus Fade",
- AnimEffectUsedFor::none().include(AnimEventFocus),
- &createAnimation,
- true);
-
+ new AnimEffectInfo ("animation:Focus Fade",
+ AnimEffectUsedFor::none().include(AnimEventFocus),
+ &createAnimation,
+ true);
+
animEffects[i++] = AnimEffectGlide1 =
- new AnimEffectInfo ("animation:Glide 1",
- AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
- &createAnimation);
-
+ new AnimEffectInfo ("animation:Glide 1",
+ AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
+ &createAnimation);
+
animEffects[i++] = AnimEffectGlide2 =
- new AnimEffectInfo ("animation:Glide 2",
- AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
- &createAnimation);
-
+ new AnimEffectInfo ("animation:Glide 2",
+ AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
+ &createAnimation);
+
animEffects[i++] = AnimEffectHorizontalFolds =
- new AnimEffectInfo ("animation:Horizontal Folds",
- AnimEffectUsedFor::all().exclude(AnimEventFocus),
- &createAnimation);
-
+ new AnimEffectInfo ("animation:Horizontal Folds",
+ AnimEffectUsedFor::all().exclude(AnimEventFocus),
+ &createAnimation);
+
animEffects[i++] = AnimEffectMagicLamp =
- new AnimEffectInfo ("animation:Magic Lamp",
- AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
- &createAnimation);
-
+ new AnimEffectInfo ("animation:Magic Lamp",
+ AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
+ &createAnimation);
+
animEffects[i++] = AnimEffectMagicLampWavy =
- new AnimEffectInfo ("animation:Magic Lamp Wavy",
- AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
- &createAnimation);
-
+ new AnimEffectInfo ("animation:Magic Lamp Wavy",
+ AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
+ &createAnimation);
+
animEffects[i++] = AnimEffectRollUp =
- new AnimEffectInfo ("animation:Roll Up",
- AnimEffectUsedFor::none().include(AnimEventShade),
- &createAnimation);
-
+ new AnimEffectInfo ("animation:Roll Up",
+ AnimEffectUsedFor::none().include(AnimEventShade),
+ &createAnimation);
+
animEffects[i++] = AnimEffectSidekick =
- new AnimEffectInfo ("animation:Sidekick",
- AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
- &createAnimation);
-
+ new AnimEffectInfo ("animation:Sidekick",
+ AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
+ &createAnimation);
+
animEffects[i++] = AnimEffectWave =
- new AnimEffectInfo ("animation:Wave",
- AnimEffectUsedFor::all().exclude(AnimEventShade),
- &createAnimation);
-
+ new AnimEffectInfo ("animation:Wave",
+ AnimEffectUsedFor::all().exclude(AnimEventShade),
+ &createAnimation);
+
animEffects[i++] = AnimEffectZoom =
- new AnimEffectInfo ("animation:Zoom",
- AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
- &createAnimation);
+ new AnimEffectInfo ("animation:Zoom",
+ AnimEffectUsedFor::all().exclude(AnimEventFocus).exclude(AnimEventShade),
+ &createAnimation);
animExtensionPluginInfo.effectOptions = &getOptions ();
@@ -2813,18 +2942,14 @@
mPluginActive[i] = false;
if (w->minimized ())
- {
mState = mNewState = IconicState;
- }
else if (w->shaded ())
{
mState = mNewState = NormalState;
mNowShaded = true;
}
else
- {
mState = mNewState = getState ();
- }
WindowInterface::setHandler (mWindow, true);
GLWindowInterface::setHandler (gWindow, false);
@@ -2846,27 +2971,34 @@
mPAScreen->initiateMinimizeAnim (this);
mEventNotOpenClose = true;
break;
+
case CompWindowNotifyLeaveShowDesktopMode:
case CompWindowNotifyUnminimize:
mPAScreen->initiateUnminimizeAnim (this);
mEventNotOpenClose = true;
break;
+
case CompWindowNotifyShade:
mPAScreen->initiateShadeAnim (this);
mEventNotOpenClose = true;
break;
+
case CompWindowNotifyUnshade:
if (mNowShaded &&
mCurAnimation &&
mCurAnimation->curWindowEvent () == WindowEventShade)
mPAScreen->initiateUnshadeAnim (this); // reverse the shade anim
+
break;
+
case CompWindowNotifyClose:
if (!(mCurAnimation &&
(mCurAnimation->curWindowEvent () == WindowEventClose ||
mCurAnimation->curWindowEvent () == WindowEventUnminimize)))
mPAScreen->initiateCloseAnim (this);
+
break;
+
case CompWindowNotifyShow:
case CompWindowNotifyBeforeMap:
// Prevent dialog disappearing when a dialog is reopened during
@@ -2877,7 +3009,9 @@
mPAScreen->initiateOpenAnim (this);
mEventNotOpenClose = false;
}
+
break;
+
case CompWindowNotifyMap:
if (mNowShaded)
mUnshadePending = true;
@@ -2890,7 +3024,9 @@
mCurAnimation->curWindowEvent () == WindowEventOpen)))
mPAScreen->initiateOpenAnim (this);
mEventNotOpenClose = false;
+
break;
+
case CompWindowNotifyBeforeUnmap:
if (mCurAnimation && mCurAnimation->curWindowEvent () == WindowEventMinimize)
{
@@ -2898,9 +3034,11 @@
mWindow->incrementUnmapReference ();
}
break;
+
case CompWindowNotifyBeforeDestroy:
if (!mFinishingAnim)
{
+<<<<<<< TREE
if (mPAScreen->shouldIgnoreWindowForAnim (mWindow, true))
break;
@@ -2910,16 +3048,27 @@
break;
++mDestroyCnt;
+=======
+ if (mPAScreen->shouldIgnoreWindowForAnim (mWindow, true) ||
+ /* Don't increment the destroy reference count unless
+ * the window is already animated */
+ !mCurAnimation)
+ break;
+
+ ++mDestroyCnt;
+>>>>>>> MERGE-SOURCE
mWindow->incrementDestroyReference ();
}
+
break;
+
case CompWindowNotifyUnreparent:
- if (!mFinishingAnim)
- {
- if (mPAScreen->shouldIgnoreWindowForAnim (mWindow, false))
- break;
- }
+ if (!mFinishingAnim &&
+ mPAScreen->shouldIgnoreWindowForAnim (mWindow, false))
+ break;
+
break;
+
case CompWindowNotifyFocusChange:
if (!mPAScreen->mLastActiveWindow ||
mPAScreen->mLastActiveWindow != mWindow->id ())
@@ -2942,6 +3091,7 @@
}
break;
+
case CompWindowNotifyRestack:
{
// Prevent menu disappearing when a menu is reopened during
@@ -2956,18 +3106,17 @@
}
// Handle CompWindowNotifyRestack only when necessary.
- if (!mPAScreen->isRestackAnimPossible ())
- break;
-
- if (mPAScreen->mStartCountdown) // Don't animate at startup
+ if (!mPAScreen->isRestackAnimPossible () ||
+ mPAScreen->mStartCountdown) // Don't animate at startup
break;
foreach (ExtensionPluginInfo *extPlugin,
- mPAScreen->mExtensionPlugins)
+ mPAScreen->mExtensionPlugins)
extPlugin->handleRestackNotify (mAWindow);
break;
}
+
default:
break;
}
@@ -2983,8 +3132,8 @@
AnimEffect
AnimScreen::getMatchingAnimSelection (CompWindow *w,
- AnimEvent e,
- int *duration)
+ AnimEvent e,
+ int *duration)
{
return priv->getMatchingAnimSelection (w, e, duration);
}
@@ -3009,7 +3158,8 @@
/// If duration is 0, it should be set to a positive value later.
void
-AnimWindow::createFocusAnimation (AnimEffect effect, int duration)
+AnimWindow::createFocusAnimation (AnimEffect effect,
+ int duration)
{
priv->createFocusAnimation (effect, duration);
}
@@ -3017,8 +3167,8 @@
void
AnimWindow::deletePersistentData (const char *name)
{
- PersistentDataMap::iterator itData =
- persistentData.find (name);
+ PersistentDataMap::iterator itData = persistentData.find (name);
+
if (itData != persistentData.end ()) // if found
{
delete itData->second;
@@ -3027,13 +3177,13 @@
}
void
-PrivateAnimWindow::createFocusAnimation (AnimEffect effect, int duration)
+PrivateAnimWindow::createFocusAnimation (AnimEffect effect,
+ int duration)
{
- mCurAnimation =
- effect->create (mWindow, WindowEventFocus,
- duration,
- effect,
- CompRect ());
+ mCurAnimation = effect->create (mWindow, WindowEventFocus,
+ duration,
+ effect,
+ CompRect ());
enablePainting (true);
}
@@ -3069,6 +3219,7 @@
// Destroy each persistent data object
PersistentDataMap::iterator itData = persistentData.begin ();
+
for (; itData != persistentData.end (); ++itData)
delete itData->second;
=== modified file 'plugins/animation/src/curvedfold.cpp'
--- plugins/animation/src/curvedfold.cpp 2013-04-25 11:07:54 +0000
+++ plugins/animation/src/curvedfold.cpp 2013-07-21 23:03:28 +0000
@@ -63,11 +63,11 @@
return progressLinear ();
}
-CurvedFoldAnim::CurvedFoldAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+CurvedFoldAnim::CurvedFoldAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
FoldAnim::FoldAnim (w, curWindowEvent, duration, info, icon)
@@ -83,10 +83,10 @@
float
CurvedFoldAnim::getObjectZ (GridAnim::GridModel *mModel,
- float forwardProgress,
- float sinForProg,
- float relDistToCenter,
- float curveMaxAmp)
+ float forwardProgress,
+ float sinForProg,
+ float relDistToCenter,
+ float curveMaxAmp)
{
return -(sinForProg *
(1 - pow (pow (2 * relDistToCenter, 1.3), 2)) *
@@ -102,24 +102,20 @@
float forwardProgress = getActualProgress ();
CompRect winRect (mAWindow->savedRectsValid () ?
- mAWindow->saveWinRect () :
- mWindow->geometry ());
+ mAWindow->saveWinRect () : mWindow->geometry ());
CompRect inRect (mAWindow->savedRectsValid () ?
- mAWindow->savedInRect () :
- mWindow->borderRect ());
+ mAWindow->savedInRect () : mWindow->borderRect ());
CompRect outRect (mAWindow->savedRectsValid () ?
- mAWindow->savedOutRect () :
- mWindow->outputRect ());
+ mAWindow->savedOutRect () : mWindow->outputRect ());
CompWindowExtents outExtents (mAWindow->savedRectsValid () ?
- mAWindow->savedOutExtents () :
- mWindow->output ());
+ mAWindow->savedOutExtents () : mWindow->output ());
- int wx = winRect.x ();
- int wy = winRect.y ();
+ int wx = winRect.x ();
+ int wy = winRect.y ();
int wheight = winRect.height ();
- int oy = outRect.y ();
- int owidth = outRect.width ();
+ int oy = outRect.y ();
+ int owidth = outRect.width ();
int oheight = outRect.height ();
float curveMaxAmp = (0.4 * pow ((float)oheight /
@@ -130,7 +126,12 @@
GridModel::GridObject *object = mModel->objects ();
unsigned int n = mModel->numObjects ();
- for (unsigned int i = 0; i < n; ++i, ++object)
+<<<<<<< TREE
+ for (unsigned int i = 0; i < n; ++i, ++object)
+=======
+
+ for (unsigned int i = 0; i < n; ++i, ++object)
+>>>>>>> MERGE-SOURCE
{
Point3d &objPos = object->position ();
@@ -229,7 +230,12 @@
GridModel::GridObject *objects = mModel->objects ();
unsigned int n = mModel->numObjects ();
- for (unsigned int i = 0; i < n; ++i)
+<<<<<<< TREE
+ for (unsigned int i = 0; i < n; ++i)
+=======
+
+ for (unsigned int i = 0; i < n; ++i)
+>>>>>>> MERGE-SOURCE
{
Point3d &pos = objects[i].position ();
GLVector coords (pos.x (), pos.y (), 0, 1);
=== modified file 'plugins/animation/src/dodge.cpp'
--- plugins/animation/src/dodge.cpp 2013-04-25 11:07:54 +0000
+++ plugins/animation/src/dodge.cpp 2013-07-21 23:03:28 +0000
@@ -57,7 +57,8 @@
}
bool
-DodgeAnim::moveUpdate (int dx, int dy)
+DodgeAnim::moveUpdate (int dx,
+ int dy)
{
if (mDodgeData->isDodgeSubject &&
mDodgeDirection == DodgeDirectionXY)
@@ -73,16 +74,19 @@
// Update dodge amount for the dodgers of all subjects
// in the restack chain
RestackPersistentData *dataCur;
+
for (CompWindow *wCur = wBottommost; wCur;
wCur = dataCur->mMoreToBePaintedNext)
{
AnimWindow *awCur = AnimWindow::get (wCur);
dataCur = static_cast
(awCur->persistentData["restack"]);
+
if (!dataCur)
break;
Animation *curAnim = awCur->curAnimation ();
+
if (!curAnim || curAnim->info () != AnimEffectDodge)
continue;
@@ -99,14 +103,13 @@
DodgeAnim *animDodger =
dynamic_cast (adw->curAnimation ());
+
if (!animDodger)
continue;
if (animDodger->mDodgeSubjectWin &&
animDodger->mTransformProgress <= 0.5f)
- {
animDodger->updateDodgerDodgeAmount ();
- }
}
}
@@ -132,15 +135,11 @@
if (((mDodgeDirection == DodgeDirectionDown && newDodgeAmount > 0) ||
(mDodgeDirection == DodgeDirectionUp && newDodgeAmount < 0)) &&
abs (newDodgeAmount) > abs (mDodgeMaxAmountY))
- {
mDodgeMaxAmountY = newDodgeAmount;
- }
else if (((mDodgeDirection == DodgeDirectionRight && newDodgeAmount > 0) ||
(mDodgeDirection == DodgeDirectionLeft && newDodgeAmount < 0)) &&
abs (newDodgeAmount) > abs (mDodgeMaxAmountX))
- {
mDodgeMaxAmountX = newDodgeAmount;
- }
}
float
@@ -160,9 +159,10 @@
mTransformProgress = 0;
float forwardProgress = dodgeProgress ();
+
if (forwardProgress > mTransformStartProgress)
{
- // Compute transform progress and normalize
+ // Compute transform progress and normalize
mTransformProgress =
(forwardProgress - mTransformStartProgress) /
(1 - mTransformStartProgress);
@@ -182,31 +182,32 @@
DodgeAnim::postPreparePaint ()
{
// Only dodge subjects (with dodger chains) should be processed here
- if (!mDodgeData || !mDodgeData->isDodgeSubject ||
- !mDodgeData->dodgeChainStart)
- return;
-
- if (!mRestackData || !mRestackData->restackInfo ())
- return;
-
- if (mDodgeData->skipPostPrepareScreen)
+ if (!mDodgeData ||
+ !mDodgeData->isDodgeSubject ||
+ !mDodgeData->dodgeChainStart ||
+ !mRestackData ||
+ !mRestackData->restackInfo () ||
+ mDodgeData->skipPostPrepareScreen)
return;
// Find the bottommost subject in restack chain
CompWindow *wBottommost = mWindow;
RestackPersistentData *dataCur;
+
for (CompWindow *wCur = mRestackData->mMoreToBePaintedPrev; wCur;
- wCur = dataCur->mMoreToBePaintedPrev)
+ wCur = dataCur->mMoreToBePaintedPrev)
{
- wBottommost = wCur;
- dataCur = static_cast
- (AnimWindow::get (wCur)->persistentData["restack"]);
- if (!dataCur)
- break;
+ wBottommost = wCur;
+ dataCur = static_cast
+ (AnimWindow::get (wCur)->persistentData["restack"]);
+
+ if (!dataCur)
+ break;
}
+
AnimWindow *awBottommost = AnimWindow::get (wBottommost);
RestackPersistentData *restackDataBottommost =
- static_cast
+ static_cast
(awBottommost->persistentData["restack"]);
// Find the first dodging window that hasn't yet
@@ -215,11 +216,14 @@
// if subject is being lowered).
RestackPersistentData *restackDataDodger = NULL;
DodgePersistentData *dodgeDataDodger = NULL;
+
CompWindow *dw;
+
for (dw = mDodgeData->dodgeChainStart; dw;
dw = dodgeDataDodger->dodgeChainNext)
{
AnimWindow *adw = AnimWindow::get (dw);
+
restackDataDodger = static_cast
(adw->persistentData["restack"]);
dodgeDataDodger = static_cast
@@ -233,12 +237,13 @@
}
RestackInfo *bottommostRestackInfo = restackDataBottommost->restackInfo ();
+
if (!bottommostRestackInfo)
return;
if (bottommostRestackInfo->raised &&
// if mWindow's host should change
- dw != restackDataBottommost->mWinThisIsPaintedBefore)
+ dw != restackDataBottommost->mWinThisIsPaintedBefore)
{
if (restackDataBottommost->mWinThisIsPaintedBefore)
{
@@ -252,13 +257,12 @@
}
// if a dodger win. is still at <0.5 progress
if (dw && restackDataDodger)
- {
// Put subject right behind new host
restackDataDodger->mWinToBePaintedBeforeThis = wBottommost;
- }
+
// otherwise all dodger win.s have passed 0.5 progress
-
CompWindow *wCur = wBottommost;
+
while (wCur)
{
RestackPersistentData *dataCur =
@@ -281,14 +285,11 @@
if (dw && dodgeDataDodger)
{
if (dodgeDataDodger->dodgeChainPrev)
- {
wDodgeChainAbove = dodgeDataDodger->dodgeChainPrev;
- }
else
- {
// Use the wOldAbove of topmost subject
wDodgeChainAbove = mRestackData->restackInfo ()->wOldAbove;
- }
+
if (!wDodgeChainAbove)
compLogMessage ("animation", CompLogLevelError,
"%s: error at line %d", __FILE__, __LINE__);
@@ -318,6 +319,7 @@
// otherwise all dodger win.s have passed 0.5 progress
CompWindow *wCur = wBottommost;
+
while (wCur)
{
RestackPersistentData *dataCur =
@@ -335,7 +337,7 @@
{
// for dodging windows only, when subject is fixed
return !(mDodgeMode == AnimationOptions::DodgeModeFixedClickedWindow &&
- mDodgeData->isDodgeSubject);
+ mDodgeData->isDodgeSubject);
}
void
@@ -344,11 +346,11 @@
TransformAnim::updateBB (output);
}
-DodgeAnim::DodgeAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+DodgeAnim::DodgeAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
RestackAnim::RestackAnim (w, curWindowEvent, duration, info, icon),
TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
@@ -369,7 +371,7 @@
// Remove this window from its subject's dodger chain
if (mDodgeSubjectWin)
{
- CompWindow *w = mDodgeSubjectWin;
+ CompWindow *w = mDodgeSubjectWin;
AnimWindow *aw = AnimWindow::get (w);
Animation *curAnim = aw->curAnimation ();
DodgePersistentData *dodgeData = static_cast
@@ -389,10 +391,12 @@
AnimWindow *adw = AnimWindow::get (dw);
dodgeDataDodger = static_cast
(adw->persistentData["dodge"]);
+
if (dw == mWindow)
{
// Remove mWindow from the chain
CompWindow *dwNext = dodgeDataDodger->dodgeChainNext;
+
if (dwNext)
{
AnimWindow *adwNext = AnimWindow::get (dwNext);
@@ -402,7 +406,9 @@
dodgeDataDodgerNext->dodgeChainPrev =
dodgeDataDodger->dodgeChainPrev;
}
+
CompWindow *dwPrev = dodgeDataDodger->dodgeChainPrev;
+
if (dwPrev)
{
AnimWindow *adwPrev = AnimWindow::get (dwPrev);
@@ -412,9 +418,11 @@
dodgeDataDodgerPrev->dodgeChainNext =
dodgeDataDodger->dodgeChainNext;
}
+
if (dodgeData->dodgeChainStart == mWindow)
dodgeData->dodgeChainStart =
dodgeDataDodger->dodgeChainNext;
+
dodgeDataDodger->dodgeChainPrev = 0;
dodgeDataDodger->dodgeChainNext = 0;
}
@@ -431,12 +439,15 @@
// Update this window's dodgers so that they no longer point
// to this window as their subject
DodgePersistentData *dodgeDataDodger;
+
for (CompWindow *dw = dodgeData->dodgeChainStart; dw;
dw = dodgeDataDodger->dodgeChainNext)
{
AnimWindow *adw = AnimWindow::get (dw);
+
if (!adw)
break;
+
dodgeDataDodger = static_cast
(adw->persistentData["dodge"]);
@@ -445,6 +456,7 @@
if (curAnim && curAnim->info () == AnimEffectDodge)
{
DodgeAnim *animDodger = dynamic_cast (curAnim);
+
if (animDodger->mDodgeSubjectWin == mWindow)
animDodger->mDodgeSubjectWin = NULL;
}
@@ -463,8 +475,8 @@
}
int
-DodgeAnim::getDodgeAmount (CompRect &rect,
- CompWindow *dw,
+DodgeAnim::getDodgeAmount (CompRect &rect,
+ CompWindow *dw,
DodgeDirection dir)
{
CompRect dRect (dw->borderRect ().x () +
@@ -477,23 +489,29 @@
dw->outputRect ().height ()) / 2);
int amount = 0;
+
switch (dir)
{
case DodgeDirectionUp:
amount = (rect.y () - (dRect.y () + dRect.height ()));
break;
+
case DodgeDirectionDown:
amount = (rect.y () + rect.height () - dRect.y ());
break;
+
case DodgeDirectionLeft:
amount = (rect.x () - (dRect.x () + dRect.width ()));
break;
+
case DodgeDirectionRight:
amount = (rect.x () + rect.width () - dRect.x ());
break;
+
default:
break;
}
+
return amount;
}
@@ -501,41 +519,49 @@
DodgeAnim::processCandidate (CompWindow *candidateWin,
CompWindow *subjectWin,
CompRegion &candidateAndSubjectIntersection,
- int &numSelectedCandidates)
+ int &numSelectedCandidates)
{
AnimWindow *aCandidateWin = AnimWindow::get (candidateWin);
- AnimScreen *as = AnimScreen::get (::screen);
+ AnimScreen *as = AnimScreen::get (::screen);
if ((!aCandidateWin->curAnimation () ||
aCandidateWin->curAnimation ()->info () == AnimEffectDodge) &&
candidateWin != subjectWin) // don't let the subject dodge itself
{
// Mark this window for dodge
-
bool nonMatching = false;
+
if (as->getMatchingAnimSelection (candidateWin, AnimEventFocus, 0) !=
AnimEffectDodge)
nonMatching = true;
- ++numSelectedCandidates;
+<<<<<<< TREE
+ ++numSelectedCandidates;
+=======
+ ++numSelectedCandidates;
+
+>>>>>>> MERGE-SOURCE
DodgePersistentData *data = static_cast
(aCandidateWin->persistentData["dodge"]);
+
data->dodgeOrder = numSelectedCandidates;
+
if (nonMatching) // Use neg. values for non-matching windows
data->dodgeOrder *= -1;
}
}
void
-DodgeAnim::postInitiateRestackAnim (int numSelectedCandidates,
- int duration,
+DodgeAnim::postInitiateRestackAnim (int numSelectedCandidates,
+ int duration,
CompWindow *wStart,
CompWindow *wEnd,
- bool raised)
+ bool raised)
{
DodgePersistentData *dataSubject = mDodgeData;
+
if (!dataSubject)
- return;
+ return;
dataSubject->isDodgeSubject = true;
dataSubject->dodgeChainStart = 0;
@@ -564,11 +590,13 @@
// Initiate dodge for this window
bool stationaryDodger = false;
+
if (dataDodger->dodgeOrder < 0)
{
dataDodger->dodgeOrder *= -1; // Make it positive again
stationaryDodger = true;
}
+
if (!adw->curAnimation ())
{
// Create dodge animation for dodger
@@ -579,8 +607,7 @@
extPlugin->incrementCurRestackAnimCount ();
}
- DodgeAnim *animDodger =
- dynamic_cast (adw->curAnimation ());
+ DodgeAnim *animDodger = dynamic_cast (adw->curAnimation ());
animDodger->mDodgeSubjectWin = mWindow;
@@ -598,8 +625,7 @@
(1 - (float)dataDodger->dodgeOrder / numSelectedCandidates);
}
- float transformTotalProgress =
- 1 + animDodger->mTransformStartProgress;
+ float transformTotalProgress = 1 + animDodger->mTransformStartProgress;
if (maxTransformTotalProgress < transformTotalProgress)
maxTransformTotalProgress = transformTotalProgress;
@@ -625,17 +651,15 @@
static_cast
(AnimWindow::get (wDodgeChainLastVisited)->
persistentData["dodge"]);
+
if (raised)
- {
dataDodgeChainLastVisited->dodgeChainNext = dw;
- }
else
dataDodgeChainLastVisited->dodgeChainPrev = dw;
}
else if (raised) // mark chain start
- {
dataSubject->dodgeChainStart = dw;
- }
+
if (raised)
{
dataDodger->dodgeChainPrev = wDodgeChainLastVisited;
@@ -679,6 +703,7 @@
// Go through each dodger, calculating its dodge amount.
// dw: Dodger window
DodgePersistentData *dodgeDataDodger;
+
for (CompWindow *dw = mDodgeData->dodgeChainStart; dw;
dw = dodgeDataDodger->dodgeChainNext)
{
@@ -687,8 +712,8 @@
dodgeDataDodger = static_cast
(adw->persistentData["dodge"]);
- DodgeAnim *animDodger =
- dynamic_cast (adw->curAnimation ());
+ DodgeAnim *animDodger = dynamic_cast (adw->curAnimation ());
+
if (!animDodger)
continue;
@@ -703,9 +728,15 @@
int amountMinActual = dodgeAmount[0];
int amountMinAbs = abs (amountMinActual);
int iMin = 0;
+<<<<<<< TREE
for (int i=1; i < 4; ++i)
+=======
+
+ for (int i = 1; i < 4; ++i)
+>>>>>>> MERGE-SOURCE
{
int absAmount = abs (dodgeAmount[i]);
+
if (amountMinAbs > absAmount)
{
amountMinAbs = absAmount;
@@ -713,11 +744,13 @@
iMin = i;
}
}
+
if (iMin == DodgeDirectionUp ||
iMin == DodgeDirectionDown)
{
animDodger->mDodgeMaxAmountX = 0;
animDodger->mDodgeMaxAmountY = dodgeAmount[iMin];
+
if (mDodgeMode == AnimationOptions::DodgeModeAllMoving &&
maxDistY < amountMinAbs)
{
@@ -729,6 +762,7 @@
{
animDodger->mDodgeMaxAmountX = dodgeAmount[iMin];
animDodger->mDodgeMaxAmountY = 0;
+
if (mDodgeMode == AnimationOptions::DodgeModeAllMoving && maxDistX < amountMinAbs)
{
maxDistX = amountMinAbs;
@@ -786,13 +820,16 @@
AnimWindow *awCur = AnimWindow::get (wCur);
dataCur = static_cast
- (awCur->persistentData["restack"]);
+ (awCur->persistentData["restack"]);
+
if (!dataCur)
- break;
+ break;
Animation *curAnim = awCur->curAnimation ();
+
if (!curAnim || curAnim->info () != AnimEffectDodge)
continue;
+
DodgeAnim *dodgeAnim = dynamic_cast (curAnim);
dodgeAnim->mDodgeMaxAmountX = dodgeAmountX + offsetX;
@@ -808,6 +845,7 @@
// subject(s) is dodging in that axis (X or Y).
// dw: Dodger window
DodgePersistentData *dodgeDataDodger;
+
for (CompWindow *dw = mDodgeData->dodgeChainStart; dw;
dw = dodgeDataDodger->dodgeChainNext)
{
@@ -818,6 +856,7 @@
DodgeAnim *animDodger =
dynamic_cast (adw->curAnimation ());
+
if (!animDodger)
continue;
@@ -825,11 +864,9 @@
if (subjectDodgesInX && animDodger->mDodgeMaxAmountX != 0)
{
if (animDodger->mDodgeMaxAmountX *
- (animDodger->mDodgeMaxAmountX + dodgeAmountX) < 0)
- {
- // If the sign is going to change, just reset instead
+ (animDodger->mDodgeMaxAmountX + dodgeAmountX) < 0)
+ // If the sign is going to change, just reset instead
animDodger->mDodgeMaxAmountX = 0;
- }
else
animDodger->mDodgeMaxAmountX += dodgeAmountX;
}
@@ -838,13 +875,13 @@
if (subjectDodgesInY && animDodger->mDodgeMaxAmountY != 0)
{
if (animDodger->mDodgeMaxAmountY *
- (animDodger->mDodgeMaxAmountY + dodgeAmountY) < 0)
+ (animDodger->mDodgeMaxAmountY + dodgeAmountY) < 0)
{
- // If the sign is going to change, just reset instead
+ // If the sign is going to change, just reset instead
animDodger->mDodgeMaxAmountY = 0;
}
else
- animDodger->mDodgeMaxAmountY += dodgeAmountY;
+ animDodger->mDodgeMaxAmountY += dodgeAmountY;
}
}
}
@@ -873,4 +910,3 @@
dodgeChainNext (0)
{
}
-
=== modified file 'plugins/animation/src/dream.cpp'
--- plugins/animation/src/dream.cpp 2013-04-25 11:07:54 +0000
+++ plugins/animation/src/dream.cpp 2013-07-21 23:03:28 +0000
@@ -40,11 +40,11 @@
// ===================== Effect: Dream =========================
-DreamAnim::DreamAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+DreamAnim::DreamAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
GridZoomAnim::GridZoomAnim (w, curWindowEvent, duration, info, icon)
@@ -74,7 +74,7 @@
void
DreamAnim::initGrid ()
{
- mGridWidth = 2;
+ mGridWidth = 2;
mGridHeight = optValI (AnimationOptions::MagicLampWavyGridRes); // TODO new option
}
@@ -98,16 +98,21 @@
int wx = winRect.x ();
int wy = winRect.y ();
- int owidth = outRect.width ();
+ int owidth = outRect.width ();
int oheight = outRect.height ();
float waveAmpMax = MIN (oheight, owidth) * 0.125f;
- float waveWidth = 10.0f;
- float waveSpeed = 7.0f;
+ float waveWidth = 10.0f;
+ float waveSpeed = 7.0f;
GridModel::GridObject *object = mModel->objects ();
unsigned int n = mModel->numObjects ();
- for (unsigned int i = 0; i < n; ++i, ++object)
+<<<<<<< TREE
+ for (unsigned int i = 0; i < n; ++i, ++object)
+=======
+
+ for (unsigned int i = 0; i < n; ++i, ++object)
+>>>>>>> MERGE-SOURCE
{
Point3d &objPos = object->position ();
Point &objGridPos = object->gridPosition ();
@@ -132,8 +137,7 @@
objPos.setX (
origx +
forwardProgress * waveAmpMax * mModel->scale ().x () *
- sin (objGridPos.y () * M_PI * waveWidth +
- waveSpeed * forwardProgress));
+ sin (objGridPos.y () * M_PI * waveWidth + waveSpeed * forwardProgress));
}
}
@@ -153,4 +157,3 @@
mCurWindowEvent == WindowEventUnminimize) &&
optValB (AnimationOptions::DreamZoomToTaskbar));
}
-
=== modified file 'plugins/animation/src/extensionplugin.cpp'
--- plugins/animation/src/extensionplugin.cpp 2013-04-25 11:07:54 +0000
+++ plugins/animation/src/extensionplugin.cpp 2013-07-21 23:03:28 +0000
@@ -38,11 +38,11 @@
ExtensionPluginAnimation::ExtensionPluginAnimation
- (const CompString &name,
- unsigned int nEffects,
- AnimEffect *effects,
+ (const CompString &name,
+ unsigned int nEffects,
+ AnimEffect *effects,
CompOption::Vector *effectOptions,
- unsigned int firstEffectOptionIndex) :
+ unsigned int firstEffectOptionIndex) :
ExtensionPluginInfo (name, nEffects, effects, effectOptions,
firstEffectOptionIndex),
mAWinWasRestackedJustNow (false),
@@ -64,8 +64,8 @@
void
ExtensionPluginAnimation::cleanUpParentChildChainItem (AnimWindow *aw)
{
- PersistentDataMap::iterator itData =
- aw->persistentData.find ("restack");
+ PersistentDataMap::iterator itData = aw->persistentData.find ("restack");
+
if (itData != aw->persistentData.end ()) // if found
{
RestackPersistentData *restackData =
@@ -77,15 +77,18 @@
RestackPersistentData *dataOther = static_cast
(AnimWindow::get (restackData->mWinThisIsPaintedBefore)->
persistentData["restack"]);
+
if (dataOther)
dataOther->mWinToBePaintedBeforeThis = 0;
}
+
restackData->mWinThisIsPaintedBefore = 0;
restackData->mMoreToBePaintedPrev = 0;
restackData->mMoreToBePaintedNext = 0;
}
itData = aw->persistentData.find ("dodge");
+
if (itData != aw->persistentData.end ()) // if found
{
DodgePersistentData *dodgeData =
@@ -99,8 +102,9 @@
bool
ExtensionPluginAnimation::paintShouldSkipWindow (CompWindow *w)
{
- AnimWindow *aw = AnimWindow::get (w);
+ AnimWindow *aw = AnimWindow::get (w);
PersistentDataMap::iterator itData = aw->persistentData.find ("restack");
+
if (itData != aw->persistentData.end ()) // if found
{
RestackPersistentData *data =
@@ -115,6 +119,7 @@
dynamic_cast (aw->curAnimation ())->paintedElsewhere ())
return true;
}
+
return false;
}
@@ -123,6 +128,7 @@
ExtensionPluginAnimation::relevantForRestackAnim (CompWindow *w)
{
unsigned int wmType = w->wmType ();
+
if (!((wmType &
// these two are to be used as "host" windows
// to host the painting of windows being focused
@@ -144,30 +150,33 @@
if (!mAWinWasRestackedJustNow)
return;
- bool focusAnimInitiated = false;
- AnimScreen *as = AnimScreen::get (::screen);
+ bool focusAnimInitiated = false;
+ AnimScreen *as = AnimScreen::get (::screen);
// Go in reverse order so that restack chains are handled properly
for (CompWindowVector::reverse_iterator rit = mLastClientList.rbegin ();
rit != mLastClientList.rend (); ++rit)
{
- CompWindow *w = (*rit);
+ CompWindow *w = (*rit);
AnimWindow *aw = AnimWindow::get (w);
RestackPersistentData *data = static_cast
(aw->persistentData["restack"]);
+
if (!data)
continue;
+
RestackInfo *restackInfo = data->restackInfo ();
+
if (!restackInfo)
continue;
data->mIsSecondary = false;
- if (as->otherPluginsActive () ||
+ if (as->otherPluginsActive () ||
// Don't initiate focus anim for current dodgers
- aw->curAnimation () ||
+ aw->curAnimation () ||
// Don't initiate focus anim for windows being passed thru
- data->mWinPassingThrough ||
+ data->mWinPassingThrough ||
// Don't animate with stale restack info
!restackInfoStillGood (restackInfo))
{
@@ -177,11 +186,10 @@
// Find the first window at a higher stacking order than w
CompWindow *nw;
+
for (nw = w->next; nw; nw = nw->next)
- {
if (relevantForRestackAnim (nw))
break;
- }
// If w is being lowered, there has to be a window
// at a higher stacking position than w (like a panel)
@@ -208,7 +216,7 @@
if (dataNext && dataNext->restackInfo () &&
wontCreateCircularChain (w, nw))
{
- // Link the two
+ // Link the two
dataNext->mMoreToBePaintedPrev = w;
data->mMoreToBePaintedNext = nw;
@@ -233,10 +241,12 @@
AnimWindow *aw = AnimWindow::get (w);
RestackPersistentData *data = static_cast
(aw->persistentData["restack"]);
+
if (!data)
continue;
RestackInfo *restackInfo = data->restackInfo ();
+
if (restackInfo)
{
if (as->initiateFocusAnim (aw))
@@ -249,22 +259,24 @@
if (!focusAnimInitiated)
resetStackingInfo ();
- if (!focusAnimInitiated ||
- as->otherPluginsActive () ||
+ if (!focusAnimInitiated ||
+ as->otherPluginsActive () ||
!as->isAnimEffectPossible (AnimEffectDodge)) // Only dodge stuff below
return;
// Calculate dodge amounts
foreach (CompWindow *w, mLastClientList)
{
- AnimWindow *aw = AnimWindow::get (w);
- Animation *curAnim = aw->curAnimation ();
+ AnimWindow *aw = AnimWindow::get (w);
+ Animation *curAnim = aw->curAnimation ();
+
if (!curAnim || curAnim->info () != AnimEffectDodge)
continue;
// Only process subjects with a dodge chain
DodgePersistentData *dodgeData = static_cast
(aw->persistentData["dodge"]);
+
if (!dodgeData || !dodgeData->dodgeChainStart ||
!dodgeData->isDodgeSubject)
continue;
@@ -276,30 +288,36 @@
for (CompWindowVector::reverse_iterator rit = mLastClientList.rbegin ();
rit != mLastClientList.rend (); ++rit)
{
- CompWindow *w = (*rit);
- AnimWindow *aw = AnimWindow::get (w);
+ CompWindow *w = (*rit);
+ AnimWindow *aw = AnimWindow::get (w);
PersistentDataMap::iterator itData = aw->persistentData.find ("dodge");
+
if (itData == aw->persistentData.end ()) // if not found
continue;
DodgePersistentData *data = static_cast
(itData->second);
+
if (!data->isDodgeSubject)
continue;
bool dodgersAreOnlySubjects = true;
CompWindow *dw;
DodgePersistentData *dataDodger;
+
for (dw = data->dodgeChainStart; dw;
dw = dataDodger->dodgeChainNext)
{
dataDodger = static_cast
(AnimWindow::get (dw)->persistentData["dodge"]);
+
if (!dataDodger)
break;
+
if (!dataDodger->isDodgeSubject)
dodgersAreOnlySubjects = false;
}
+
if (dodgersAreOnlySubjects)
data->skipPostPrepareScreen = true;
}
@@ -312,24 +330,23 @@
// Only handle restack notifies when the window is (or was) on the client
// list (i.e. not for menus, combos, etc.).
- if (find (clients.begin (), clients.end (), aw->mWindow) ==
- clients.end () &&
- find (mLastClientList.begin (), mLastClientList.end (), aw->mWindow) ==
- mLastClientList.end ())
+ if (find (clients.begin (), clients.end (), aw->mWindow) == clients.end () &&
+ find (mLastClientList.begin (), mLastClientList.end (), aw->mWindow) ==
+ mLastClientList.end ())
return;
bool winOpenedClosed = false;
unsigned int n = clients.size ();
if (n != mLastClientList.size ())
- {
winOpenedClosed = true;
- }
+
// if restacking occurred and not window open/close
if (!winOpenedClosed)
{
RestackPersistentData *data = static_cast
(aw->persistentData["restack"]);
+
data->mConfigureNotified = true;
// Find which window is restacked
@@ -394,9 +411,9 @@
bool preferRaised = false;
bool onlyTwo = false;
- if (wChangeEnd &&
+ if (wChangeEnd &&
clients[(unsigned)changeEnd] ==
- mLastClientList[(unsigned)changeStart] &&
+ mLastClientList[(unsigned)changeStart] &&
clients[(unsigned)changeStart] ==
mLastClientList[(unsigned)changeEnd])
{
@@ -406,6 +423,7 @@
static_cast
(AnimWindow::get (wChangeEnd)->
persistentData["restack"]);
+
if (data->mConfigureNotified)
preferRaised = true;
@@ -417,6 +435,7 @@
RestackPersistentData *data =
static_cast
(AnimWindow::get (w2)->persistentData["restack"]);
+
data->mConfigureNotified = false;
}
@@ -445,11 +464,10 @@
wEnd = wChangeEnd;
wOldAbove = mLastClientList[(unsigned)(changeEnd + 1)];
}
+
for (; wOldAbove; wOldAbove = wOldAbove->next)
- {
if (!wOldAbove->destroyed ())
break;
- }
}
if (wRestacked && wStart && wEnd && wOldAbove)
@@ -500,7 +518,7 @@
void
ExtensionPluginAnimation::postUpdateEventEffects (AnimEvent e,
- bool forRandom)
+ bool forRandom)
{
AnimScreen *as = AnimScreen::get (::screen);
@@ -521,9 +539,11 @@
if (aw->persistentData.find ("restack") !=
aw->persistentData.end ())
continue;
+
aw->persistentData["restack"] = new RestackPersistentData ();
}
}
+
if (as->isAnimEffectPossible (AnimEffectDodge))
{
foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
@@ -533,6 +553,7 @@
if (aw->persistentData.find ("dodge") !=
aw->persistentData.end ())
continue;
+
aw->persistentData["dodge"] = new DodgePersistentData ();
}
}
@@ -550,19 +571,15 @@
if (as->isRestackAnimPossible () &&
// doesn't exist yet
aw->persistentData.find ("restack") == aw->persistentData.end ())
- {
aw->persistentData["restack"] = new RestackPersistentData ();
- }
+
if (as->isAnimEffectPossible (AnimEffectDodge) &&
// doesn't exist yet
aw->persistentData.find ("dodge") == aw->persistentData.end ())
- {
aw->persistentData["dodge"] = new DodgePersistentData ();
- }
+
if (aw->persistentData.find ("multi") == aw->persistentData.end ())
- {
aw->persistentData["multi"] = new MultiPersistentData ();
- }
}
void
@@ -595,9 +612,9 @@
bool
ExtensionPluginAnimation::restackInfoStillGood (RestackInfo *restackInfo)
{
- bool wStartGood = false;
- bool wEndGood = false;
- bool wOldAboveGood = false;
+ bool wStartGood = false;
+ bool wEndGood = false;
+ bool wOldAboveGood = false;
bool wRestackedGood = false;
foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
@@ -609,13 +626,17 @@
if (restackInfo->wStart == w)
wStartGood = true;
+
if (restackInfo->wEnd == w)
wEndGood = true;
+
if (restackInfo->wRestacked == w)
wRestackedGood = true;
+
if (restackInfo->wOldAbove == w)
wOldAboveGood = true;
}
+
return (wStartGood && wEndGood && wOldAboveGood && wRestackedGood);
}
@@ -626,13 +647,15 @@
foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
{
AnimWindow *aw = AnimWindow::get (w);
- PersistentDataMap::iterator itData =
- aw->persistentData.find ("restack");
+ PersistentDataMap::iterator itData = aw->persistentData.find ("restack");
+
if (itData != aw->persistentData.end ()) // if found
{
RestackPersistentData *data =
static_cast (itData->second);
+
data->mConfigureNotified = false;
+
if (data->restackInfo ())
data->resetRestackInfo ();
}
@@ -654,8 +677,8 @@
::screen->clientList ().end (), aw->mWindow) !=
::screen->clientList ().end ())
{
- resetStackingInfo ();
- updateLastClientList ();
+ resetStackingInfo ();
+ updateLastClientList ();
}
}
@@ -704,7 +727,9 @@
RestackPersistentData *dataBottommost = static_cast
(AnimWindow::get (wBottommost)->persistentData["restack"]);
+
CompWindow *wPrev = dataBottommost->mMoreToBePaintedPrev;
+
while (wPrev)
{
wBottommost = wPrev;
@@ -712,6 +737,7 @@
(AnimWindow::get (wPrev)->persistentData["restack"]);
wPrev = dataPrev->mMoreToBePaintedPrev;
}
+
return wBottommost;
}
@@ -720,14 +746,16 @@
CompWindow *
ExtensionPluginAnimation::getBottommostInRestackChain (CompWindow *wStartPoint)
{
- CompWindow *wBottommost = wStartPoint;
+ CompWindow *wBottommost = wStartPoint;
RestackPersistentData *dataCur;
+
for (CompWindow *wCur = wStartPoint; wCur;
wCur = dataCur->mMoreToBePaintedPrev)
{
wBottommost = wCur;
dataCur = static_cast
(AnimWindow::get (wCur)->persistentData["restack"]);
+
if (!dataCur)
break;
}
@@ -758,12 +786,18 @@
resetMarks ();
CompWindow *w =
- getBottommostInExtendedFocusChain (*CompositeScreen::get (::screen)->getWindowPaintList ().begin ());
+ getBottommostInExtendedFocusChain (*CompositeScreen::get (::screen)->getWindowPaintList ().begin ());
+
if (w)
{
RestackPersistentData *data = static_cast
(AnimWindow::get (w)->persistentData["restack"]);
- ++data->mVisitCount;
+<<<<<<< TREE
+ ++data->mVisitCount;
+=======
+
+ ++data->mVisitCount;
+>>>>>>> MERGE-SOURCE
}
return w;
}
@@ -781,6 +815,7 @@
data->mWalkerOverNewCopy = true;
return true;
}
+
return false;
}
@@ -796,13 +831,9 @@
{
// Within a chain? (not the 1st or 2nd window)
if (data->mMoreToBePaintedNext)
- {
wRet = data->mMoreToBePaintedNext;
- }
else if (data->mWinThisIsPaintedBefore) // 2nd one in chain?
- {
wRet = data->mWinThisIsPaintedBefore;
- }
}
else
data->mWalkerOverNewCopy = false;
@@ -823,6 +854,7 @@
++dataRet->mVisitCount;
}
+
return wRet;
}
@@ -830,9 +862,9 @@
ExtensionPluginAnimation::getWindowPaintList ()
{
mWindowList.clear ();
+
for (CompWindow *w = walkFirst (); w; w = walkNext (w))
mWindowList.push_back (w);
return mWindowList;
}
-
=== modified file 'plugins/animation/src/fade.cpp'
--- plugins/animation/src/fade.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animation/src/fade.cpp 2013-07-21 23:03:28 +0000
@@ -38,11 +38,11 @@
// ===================== Effect: Fade =========================
-FadeAnim::FadeAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+FadeAnim::FadeAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon)
{
}
@@ -58,4 +58,3 @@
{
mAWindow->expandBBWithWindow ();
}
-
=== modified file 'plugins/animation/src/focusfade.cpp'
--- plugins/animation/src/focusfade.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animation/src/focusfade.cpp 2013-07-21 23:03:28 +0000
@@ -55,14 +55,14 @@
FocusFadeAnim::computeOpacity (GLushort opacityInt)
{
float progress = 1 - progressLinear ();
- float opacity = opacityInt / (float)OPAQUE;
+ float opacity = opacityInt / (float)OPAQUE;
float multiplier;
bool newCopy = overNewCopy ();
// flip opacity behavior for the other side of the cross-fade
if (newCopy)
- progress = 1 - progress;
+ progress = 1 - progress;
if (mWindow->alpha () || (newCopy && opacity >= 0.91f))
multiplier = progressDecelerate (progress);
@@ -81,10 +81,10 @@
else
multiplier = progress;
- multiplier = 1 - multiplier;
+ multiplier = 1 - multiplier;
float finalOpacity = opacity * multiplier;
- finalOpacity = MIN (finalOpacity, 1);
- finalOpacity = MAX (finalOpacity, 0);
+ finalOpacity = MIN (finalOpacity, 1);
+ finalOpacity = MAX (finalOpacity, 0);
return (GLushort)(finalOpacity * OPAQUE);
}
@@ -99,7 +99,7 @@
FocusFadeAnim::processCandidate (CompWindow *candidateWin,
CompWindow *subjectWin,
CompRegion &candidateAndSubjectIntersection,
- int &numSelectedCandidates)
+ int &numSelectedCandidates)
{
AnimWindow *aCandidateWin = AnimWindow::get (candidateWin);
RestackPersistentData *data = static_cast
@@ -117,10 +117,12 @@
{
AnimWindow *aw = AnimWindow::get (w);
PersistentDataMap::iterator itData = aw->persistentData.find ("restack");
+
if (itData != aw->persistentData.end ()) // if found
{
RestackPersistentData *data =
static_cast (itData->second);
+
if (data->mWinPassingThrough == mWindow)
data->mWinPassingThrough = 0;
}
@@ -128,4 +130,3 @@
RestackAnim::cleanUp (closing, destructing);
}
-
=== modified file 'plugins/animation/src/glide.cpp'
--- plugins/animation/src/glide.cpp 2013-04-25 11:07:54 +0000
+++ plugins/animation/src/glide.cpp 2013-07-21 23:03:28 +0000
@@ -38,11 +38,11 @@
// ===================== Effect: Glide =========================
-GlideAnim::GlideAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+GlideAnim::GlideAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
ZoomAnim::ZoomAnim (w, curWindowEvent, duration, info, icon),
@@ -50,11 +50,11 @@
{
}
-Glide2Anim::Glide2Anim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+Glide2Anim::Glide2Anim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
GlideAnim::GlideAnim (w, curWindowEvent, duration, info, icon)
@@ -67,7 +67,7 @@
float *thickness)
{
*finalDistFac = optValF (AnimationOptions::Glide1AwayPosition);
- *finalRotAng = optValF (AnimationOptions::Glide1AwayAngle);
+ *finalRotAng = optValF (AnimationOptions::Glide1AwayAngle);
}
void
@@ -76,7 +76,7 @@
float *thickness)
{
*finalDistFac = optValF (AnimationOptions::Glide2AwayPosition);
- *finalRotAng = optValF (AnimationOptions::Glide2AwayAngle);
+ *finalRotAng = optValF (AnimationOptions::Glide2AwayAngle);
}
float
@@ -128,7 +128,7 @@
0, 0);
GLVector translation (0, 0, finalz * forwardProgress, 0);
- float rotAngle = finalRotAng * forwardProgress;
+ float rotAngle = finalRotAng * forwardProgress;
glideModRotAngle = fmodf (rotAngle + 720, 360.0f);
// put back to window position
=== modified file 'plugins/animation/src/grid.cpp'
--- plugins/animation/src/grid.cpp 2013-04-25 11:07:54 +0000
+++ plugins/animation/src/grid.cpp 2013-07-21 23:03:28 +0000
@@ -54,18 +54,18 @@
mGridPosition = gridPosition;
}
-GridAnim::GridModel::GridModel (CompWindow *w,
+GridAnim::GridModel::GridModel (CompWindow *w,
WindowEvent curWindowEvent,
- int height,
- int gridWidth,
- int gridHeight,
- int decorTopHeight,
- int decorBottomHeight) :
+ int height,
+ int gridWidth,
+ int gridHeight,
+ int decorTopHeight,
+ int decorBottomHeight) :
mScale (1.0f, 1.0f),
mScaleOrigin (0, 0)
{
mNumObjects = (unsigned)(gridWidth * gridHeight);
- mObjects = new GridObject[mNumObjects];
+ mObjects = new GridObject[mNumObjects];
initObjects (curWindowEvent,
height,
@@ -80,15 +80,17 @@
void
GridAnim::GridModel::initObjects (WindowEvent curWindowEvent,
- int height,
- int gridWidth, int gridHeight,
- int decorTopHeight, int decorBottomHeight)
+ int height,
+ int gridWidth,
+ int gridHeight,
+ int decorTopHeight,
+ int decorBottomHeight)
{
int gridX, gridY;
- int nGridCellsX, nGridCellsY;
+ int nGridCellsY;
// number of grid cells in x direction
- nGridCellsX = gridWidth - 1;
+ int nGridCellsX = gridWidth - 1;
if (curWindowEvent == WindowEventShade ||
curWindowEvent == WindowEventUnshade)
@@ -97,8 +99,7 @@
// One allocated for top, one for bottom.
nGridCellsY = gridHeight - 3;
- float winContentsHeight =
- height - decorTopHeight - decorBottomHeight;
+ float winContentsHeight = height - decorTopHeight - decorBottomHeight;
//Top
for (gridX = 0; gridX < gridWidth; ++gridX)
@@ -108,13 +109,12 @@
mObjects[gridX].setGridPosition (gridPos);
}
+ float inWinY, gridPosY;
// Window contents
for (gridY = 1; gridY < gridHeight - 1; ++gridY)
{
- float inWinY =
- (gridY - 1) * winContentsHeight / nGridCellsY +
- decorTopHeight;
- float gridPosY = inWinY / height;
+ inWinY = (gridY - 1) * winContentsHeight / nGridCellsY + decorTopHeight;
+ gridPosY = inWinY / height;
for (gridX = 0; gridX < gridWidth; ++gridX)
{
@@ -132,7 +132,7 @@
}
else
{
- int objIndex = 0;
+ int objIndex = 0;
// number of grid cells in y direction
nGridCellsY = gridHeight - 1;
@@ -145,7 +145,12 @@
Point gridPos ((float)gridX / nGridCellsX,
(float)gridY / nGridCellsY);
mObjects[objIndex].setGridPosition (gridPos);
- ++objIndex;
+<<<<<<< TREE
+ ++objIndex;
+=======
+
+ ++objIndex;
+>>>>>>> MERGE-SOURCE
}
}
}
@@ -156,7 +161,12 @@
float ty)
{
GridObject *object = mObjects;
- for (unsigned int i = 0; i < mNumObjects; ++i, ++object)
+<<<<<<< TREE
+ for (unsigned int i = 0; i < mNumObjects; ++i, ++object)
+=======
+
+ for (unsigned int i = 0; i < mNumObjects; ++i, ++object)
+>>>>>>> MERGE-SOURCE
{
object->mPosition.add (Point3d (tx, ty, 0));
}
@@ -166,7 +176,12 @@
GridAnim::updateBB (CompOutput &output)
{
GridModel::GridObject *object = mModel->mObjects;
- for (unsigned int i = 0; i < mModel->mNumObjects; ++i, ++object)
+<<<<<<< TREE
+ for (unsigned int i = 0; i < mModel->mNumObjects; ++i, ++object)
+=======
+
+ for (unsigned int i = 0; i < mModel->mNumObjects; ++i, ++object)
+>>>>>>> MERGE-SOURCE
{
mAWindow->expandBBWithPoint (object->position ().x () + 0.5,
object->position ().y () + 0.5);
@@ -180,11 +195,11 @@
mGridHeight = 2;
}
-GridAnim::GridAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+GridAnim::GridAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
mModel (NULL),
mUseQTexCoord (false)
@@ -259,13 +274,9 @@
mCurWindowEvent == WindowEventUnshade)
{
if (y1 < winContentsY) // if at top part
- {
gridH = mDecorTopHeight;
- }
else if (y2 > winContentsY + winContentsHeight) // if at bottom
- {
gridH = mDecorBottomHeight;
- }
else // in window contents (only in Y coords)
{
float winContentsHeight =
@@ -282,12 +293,12 @@
v = vertexBuffer->getVertices () + (oldCount * vSize);
vMax = vertexBuffer->getVertices () + (newCount * vSize);
+ float x, y, topiyFloat;
// For each vertex
for (; v < vMax; v += vSize)
{
- float x = v[0];
- float y = v[1];
- float topiyFloat;
+ x = v[0];
+ y = v[1];
if (y > y2)
y = y2;
@@ -301,31 +312,34 @@
topiyFloat = MIN (topiyFloat, 0.999); // avoid 1.0
}
else if (y2 > winContentsY + winContentsHeight) // if at bottom
- {
topiyFloat = (mGridHeight - 2) +
(mDecorBottomHeight ? (y - winContentsY -
winContentsHeight) /
mDecorBottomHeight : 0);
- }
else // in window contents (only in Y coords)
- {
topiyFloat = (mGridHeight - 3) *
(y - winContentsY) / winContentsHeight + 1;
- }
}
else
- {
topiyFloat = (mGridHeight - 1) * (y - oy) / oheight;
- }
+
// topiy should be at most (mGridHeight - 2)
int topiy = (int)(topiyFloat + 1e-4);
if (topiy == mGridHeight - 1)
+<<<<<<< TREE
--topiy;
int bottomiy = topiy + 1;
float iny = topiyFloat - topiy;
float inyRest = 1 - iny;
+=======
+ --topiy;
+
+ int bottomiy = topiy + 1;
+ float iny = topiyFloat - topiy;
+ float inyRest = 1 - iny;
+>>>>>>> MERGE-SOURCE
// End of calculations for y
@@ -335,8 +349,7 @@
x = x2;
// find containing grid cell (leftix rightix) x (topiy bottomiy)
- float leftixFloat =
- (mGridWidth - 1) * (x - ox) / owidth;
+ float leftixFloat = (mGridWidth - 1) * (x - ox) / owidth;
int leftix = (int)(leftixFloat + 1e-4);
if (leftix == mGridWidth - 1)
@@ -399,11 +412,11 @@
// Deprecated
}
-GridTransformAnim::GridTransformAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+GridTransformAnim::GridTransformAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
GridAnim::GridAnim (w, curWindowEvent, duration, info, icon),
@@ -443,7 +456,12 @@
{
GridModel::GridObject *object = mModel->objects ();
unsigned int n = mModel->numObjects ();
- for (unsigned int i = 0; i < n; ++i, ++object)
+<<<<<<< TREE
+ for (unsigned int i = 0; i < n; ++i, ++object)
+=======
+
+ for (unsigned int i = 0; i < n; ++i, ++object)
+>>>>>>> MERGE-SOURCE
{
GLVector coords (object->mPosition.x (),
object->mPosition.y (), 0, 1);
@@ -471,4 +489,3 @@
wTransform *= skewTransform;
}
}
-
=== modified file 'plugins/animation/src/horizontalfold.cpp'
--- plugins/animation/src/horizontalfold.cpp 2013-04-25 11:07:54 +0000
+++ plugins/animation/src/horizontalfold.cpp 2013-07-21 23:03:28 +0000
@@ -38,11 +38,11 @@
// ===================== Effect: Horizontal Folds =========================
-HorizontalFoldsAnim::HorizontalFoldsAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+HorizontalFoldsAnim::HorizontalFoldsAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
FoldAnim::FoldAnim (w, curWindowEvent, duration, info, icon)
@@ -53,6 +53,7 @@
HorizontalFoldsAnim::initGrid ()
{
mGridWidth = 2;
+
if (mCurWindowEvent == WindowEventShade ||
mCurWindowEvent == WindowEventUnshade)
mGridHeight = 3 + 2 *
@@ -64,10 +65,10 @@
float
HorizontalFoldsAnim::getObjectZ (GridAnim::GridModel *mModel,
- float forwardProgress,
- float sinForProg,
- float relDistToFoldCenter,
- float foldMaxAmp)
+ float forwardProgress,
+ float sinForProg,
+ float relDistToFoldCenter,
+ float foldMaxAmp)
{
return -(sinForProg *
foldMaxAmp *
@@ -101,17 +102,15 @@
int oheight = outRect.height ();
float winHeight = 0;
+
if (mCurWindowEvent == WindowEventShade ||
mCurWindowEvent == WindowEventUnshade)
- {
winHeight = winRect.height ();
- }
else
- {
winHeight = inRect.height ();
- }
- int nHalfFolds =
- 2.0 * optValI (AnimationOptions::HorizontalFoldsNumFolds);
+
+ int nHalfFolds = 2.0 * optValI (AnimationOptions::HorizontalFoldsNumFolds);
+
float foldMaxAmp =
0.3 * pow ((winHeight / nHalfFolds) / ::screen->height (), 0.3) *
optValF (AnimationOptions::HorizontalFoldsAmpMult);
@@ -122,7 +121,12 @@
GridModel::GridObject *object = mModel->objects ();
unsigned int n = mModel->numObjects ();
- for (unsigned int i = 0; i < n; ++i, ++object)
+<<<<<<< TREE
+ for (unsigned int i = 0; i < n; ++i, ++object)
+=======
+
+ for (unsigned int i = 0; i < n; ++i, ++object)
+>>>>>>> MERGE-SOURCE
{
Point3d &objPos = object->position ();
@@ -134,11 +138,10 @@
float origy = (wy +
(oheight * objGridY -
outExtents.top) * mModel->scale ().y ());
+
if (mCurWindowEvent == WindowEventShade ||
mCurWindowEvent == WindowEventUnshade)
- {
- // Execute shade mode
-
+ { // Execute shade mode
if (objGridY == 0)
{
objPos.setY (oy);
@@ -164,10 +167,8 @@
relDistToFoldCenter, foldMaxAmp));
}
}
- else
+ else // Execute normal mode
{
- // Execute normal mode
-
float relDistToFoldCenter = (rowNo % 2 == 0 ? 0.5 : 0);
objPos.setY (
@@ -201,4 +202,3 @@
mCurWindowEvent == WindowEventUnminimize) &&
optValB (AnimationOptions::HorizontalFoldsZoomToTaskbar));
}
-
=== modified file 'plugins/animation/src/magiclamp.cpp'
--- plugins/animation/src/magiclamp.cpp 2013-04-25 11:07:54 +0000
+++ plugins/animation/src/magiclamp.cpp 2013-07-21 23:03:28 +0000
@@ -52,11 +52,11 @@
mGridHeight = optValI (AnimationOptions::MagicLampWavyGridRes);
}
-MagicLampAnim::MagicLampAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+MagicLampAnim::MagicLampAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
GridAnim::GridAnim (w, curWindowEvent, duration, info, icon),
mTopLeftCornerObject (0),
@@ -72,21 +72,18 @@
mUseQTexCoord = true;
}
-MagicLampWavyAnim::MagicLampWavyAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+MagicLampWavyAnim::MagicLampWavyAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
MagicLampAnim::MagicLampAnim (w, curWindowEvent, duration, info, icon)
{
- unsigned int maxWaves;
- float waveAmpMin, waveAmpMax;
- float distance;
-
- maxWaves = (unsigned) optValI (AnimationOptions::MagicLampWavyMaxWaves);
- waveAmpMin = optValF (AnimationOptions::MagicLampWavyAmpMin);
- waveAmpMax = optValF (AnimationOptions::MagicLampWavyAmpMax);
+ unsigned int maxWaves = (unsigned) optValI (AnimationOptions::MagicLampWavyMaxWaves);
+ float waveAmpMin = optValF (AnimationOptions::MagicLampWavyAmpMin);
+ float waveAmpMax = optValF (AnimationOptions::MagicLampWavyAmpMax);
+ float distance;
if (waveAmpMax < waveAmpMin)
waveAmpMax = waveAmpMin;
@@ -96,19 +93,19 @@
CompRect outRect (mAWindow->savedRectsValid () ?
mAWindow->savedOutRect () :
w->outputRect ());
+
if (mTargetTop)
distance = outRect.y () + outRect.height () - mIcon.y ();
else
distance = mIcon.y () - outRect.y ();
- mNumWaves =
- 1 + (float)maxWaves *distance / ::screen->height ();
+ mNumWaves = 1 + (float)maxWaves * distance / ::screen->height ();
mWaves = new WaveParam[mNumWaves];
// Compute wave parameters
- int ampDirection = (RAND_FLOAT () < 0.5 ? 1 : -1);
+ int ampDirection = (RAND_FLOAT () < 0.5 ? 1 : -1);
float minHalfWidth = 0.22f;
float maxHalfWidth = 0.38f;
@@ -148,12 +145,11 @@
/// the whole window (like in MagicLampAnim with menus).
MagicLampAnim::~MagicLampAnim ()
{
- if (mCurWindowEvent == WindowEventOpen ||
- mCurWindowEvent == WindowEventUnminimize ||
- mCurWindowEvent == WindowEventUnshade)
- {
+ if (mCurWindowEvent == WindowEventOpen ||
+ mCurWindowEvent == WindowEventUnminimize ||
+ mCurWindowEvent == WindowEventUnshade)
mAWindow->expandBBWithWindow ();
- }
+
}
bool
@@ -176,8 +172,10 @@
{
float cosx = ((x - mWaves[i].pos) /
mWaves[i].halfWidth);
+
if (cosx < -1 || cosx > 1)
continue;
+
targetX += (mWaves[i].amp * mModel->scale ().x () *
(cos (cosx * M_PI) + 1) / 2);
}
@@ -196,6 +194,7 @@
mIcon.setX (x);
mIcon.setY (y);
}
+
float forwardProgress = progressLinear ();
float iconCloseEndY;
@@ -232,6 +231,7 @@
iconCloseEndY = mIcon.y () + mIcon.height ();
winFarEndY = outRect.y () + winh;
winVisibleCloseEndY = outRect.y ();
+
if (winVisibleCloseEndY < iconCloseEndY)
winVisibleCloseEndY = iconCloseEndY;
}
@@ -266,30 +266,29 @@
}
if (forwardProgress < preShapePhaseEnd)
- {
stretchProgress = forwardProgress / stretchPhaseEnd;
- }
else
{
if (forwardProgress < stretchPhaseEnd)
- {
stretchProgress = forwardProgress / stretchPhaseEnd;
- }
else
- {
postStretchProgress =
(forwardProgress - stretchPhaseEnd) / (1 - stretchPhaseEnd);
- }
}
// The other objects are squeezed into a horizontal line behind the icon
- int topmostMovingObjectIdx = -1;
+ int topmostMovingObjectIdx = -1;
int bottommostMovingObjectIdx = -1;
- unsigned int n = mModel->numObjects ();
- float fx = 0.0f;
+ unsigned int n = mModel->numObjects ();
+ float fx = 0.0f;
GridModel::GridObject *object = mModel->objects ();
- for (unsigned int i = 0; i < n; ++i, ++object)
+<<<<<<< TREE
+ for (unsigned int i = 0; i < n; ++i, ++object)
+=======
+
+ for (unsigned int i = 0; i < n; ++i, ++object)
+>>>>>>> MERGE-SOURCE
{
Point3d &objPos = object->position ();
float objGridX = object->gridPosition ().x ();
@@ -304,6 +303,7 @@
float iconY = (mIcon.y () + mIcon.height () * objGridY);
float stretchedPos;
+
if (mTargetTop)
stretchedPos = objGridY * origY + (1 - objGridY) * iconY;
else
@@ -311,23 +311,17 @@
// Compute current y position
if (forwardProgress < preShapePhaseEnd)
- {
objPos.setY ((1 - stretchProgress) * origY +
stretchProgress * stretchedPos);
- }
else
{
if (forwardProgress < stretchPhaseEnd)
- {
objPos.setY ((1 - stretchProgress) * origY +
stretchProgress * stretchedPos);
- }
else
- {
objPos.setY ((1 - postStretchProgress) * stretchedPos +
postStretchProgress *
(stretchedPos + (iconCloseEndY - winFarEndY)));
- }
}
if (mTargetTop)
@@ -378,7 +372,7 @@
// Compute current x position
if (forwardProgress < preShapePhaseEnd)
objPos.setX ((1 - preShapeProgress) * origX +
- preShapeProgress * targetX);
+ preShapeProgress * targetX);
else
objPos.setX (targetX);
@@ -388,8 +382,8 @@
if (stepRegionUsed ())
{
- // Pick objects that will act as the corners of rectangles subtracted
- // from this step's damaged region
+ // Pick objects that will act as the corners of rectangles subtracted
+ // from this step's damaged region
const float topCornerRowRatio =
(mTargetTop ? 0.55 : 0.35);// 0.46 0.42; // rectangle corner row ratio
@@ -398,6 +392,7 @@
if (topmostMovingObjectIdx < 0)
topmostMovingObjectIdx = 0;
+
if (bottommostMovingObjectIdx < 0)
bottommostMovingObjectIdx = (int)n - 2;
@@ -417,7 +412,12 @@
GridModel::GridObject *objects = mModel->objects ();
unsigned int n = mModel->numObjects ();
- for (unsigned int i = 0; i < n; ++i)
+<<<<<<< TREE
+ for (unsigned int i = 0; i < n; ++i)
+=======
+
+ for (unsigned int i = 0; i < n; ++i)
+>>>>>>> MERGE-SOURCE
{
Point3d &objPos = objects[i].position ();
mAWindow->expandBBWithPoint (objPos.x () + 0.5,
@@ -440,10 +440,10 @@
if (objects[0].position ().x () >
objects[n-2].position ().x ())
{
- // Top-left corner is empty
+ // Top-left corner is empty
- // Position of grid object to pick as the corner of the subtracted rect.
- Point3d &objPos = mTopLeftCornerObject->position ();
+ // Position of grid object to pick as the corner of the subtracted rect.
+ Point3d &objPos = mTopLeftCornerObject->position ();
region -= CompRect (BB->x1,
BB->y1,
objPos.x () - BB->x1,
@@ -451,9 +451,9 @@
}
else // Bottom-left corner is empty
{
- // Position of grid object to pick as the corner of the subtracted rect.
- Point3d &objPos = mBottomLeftCornerObject->position ();
- region -= CompRect (BB->x1,
+ // Position of grid object to pick as the corner of the subtracted rect.
+ Point3d &objPos = mBottomLeftCornerObject->position ();
+ region -= CompRect (BB->x1,
objPos.y (),
objPos.x () - BB->x1,
BB->y2);
@@ -461,22 +461,22 @@
// Right side
if (objects[1].position ().x () <
- objects[n-1].position ().x ())
+ objects[n-1].position ().x ())
{
// Top-right corner is empty
- // Position of grid object to pick as the corner of the subtracted rect.
- Point3d &objPos = (mTopLeftCornerObject + 1)->position ();
- region -= CompRect (objPos.x (),
+ // Position of grid object to pick as the corner of the subtracted rect.
+ Point3d &objPos = (mTopLeftCornerObject + 1)->position ();
+ region -= CompRect (objPos.x (),
BB->y1,
BB->x2,
objPos.y () - BB->y1);
}
else // Bottom-right corner is empty
{
- // Position of grid object to pick as the corner of the subtracted rect.
- Point3d &objPos = (mBottomLeftCornerObject + 1)->position ();
- region -= CompRect (objPos.x (),
+ // Position of grid object to pick as the corner of the subtracted rect.
+ Point3d &objPos = (mBottomLeftCornerObject + 1)->position ();
+ region -= CompRect (objPos.x (),
objPos.y (),
BB->x2,
BB->y2);
@@ -493,7 +493,7 @@
MagicLampAnim::adjustPointerIconSize ()
{
mIcon.setWidth (MAX (4, optValI
- (AnimationOptions::MagicLampOpenStartWidth)));
+ (AnimationOptions::MagicLampOpenStartWidth)));
// Adjust position so that the icon is centered at the original position.
mIcon.setX (mIcon.x () - mIcon.width () / 2);
@@ -503,9 +503,8 @@
MagicLampWavyAnim::adjustPointerIconSize ()
{
mIcon.setWidth (MAX (4, optValI
- (AnimationOptions::MagicLampWavyOpenStartWidth)));
+ (AnimationOptions::MagicLampWavyOpenStartWidth)));
// Adjust position so that the icon is centered at the original position.
mIcon.setX (mIcon.x () - mIcon.width () / 2);
}
-
=== modified file 'plugins/animation/src/options.cpp'
--- plugins/animation/src/options.cpp 2013-04-25 11:07:54 +0000
+++ plugins/animation/src/options.cpp 2013-07-21 23:03:28 +0000
@@ -81,7 +81,7 @@
bool
IdValuePair::matchesPluginOption (ExtensionPluginInfo *testPluginInfo,
- int testOptionId) const
+ int testOptionId) const
{
return (pluginInfo == testPluginInfo &&
optionId == testOptionId);
@@ -89,8 +89,8 @@
CompOption::Value &
AnimWindow::pluginOptVal (ExtensionPluginInfo *pluginInfo,
- unsigned int optionId,
- Animation *anim)
+ unsigned int optionId,
+ Animation *anim)
{
PrivateAnimWindow *aw = priv;
PrivateAnimScreen *as = aw->paScreen ();
@@ -114,24 +114,26 @@
OptionSet *
PrivateAnimScreen::getOptionSetForSelectedRow (PrivateAnimWindow *aw,
- Animation *anim)
+ Animation *anim)
{
- const AnimEvent event = win2AnimEventMap[anim->curWindowEvent ()];
- OptionSets &eventOptionSets = mEventOptionSets[event];
- OptionSet *setSelectedForRow = &eventOptionSets.sets[(unsigned int) aw->curAnimSelectionRow ()];
+ const AnimEvent event = win2AnimEventMap[anim->curWindowEvent ()];
+ OptionSets &eventOptionSets = mEventOptionSets[event];
+ OptionSet *setSelectedForRow = &eventOptionSets.sets[(unsigned int)
+ aw->curAnimSelectionRow ()];
return setSelectedForRow;
}
void
-PrivateAnimScreen::updateOptionSet (OptionSet *os,
+PrivateAnimScreen::updateOptionSet (OptionSet *os,
const char *optNamesValuesOrig)
{
- unsigned int len = strlen (optNamesValuesOrig);
- char *optNamesValues = (char *)calloc (len + 1, 1);
+ unsigned int len = strlen (optNamesValuesOrig);
+ char *optNamesValues = (char *)calloc (len + 1, 1);
// Find the first substring with no spaces in it
sscanf (optNamesValuesOrig, " %s ", optNamesValues);
+
if (!strlen (optNamesValues))
{
free (optNamesValues);
@@ -140,15 +142,14 @@
// Backup original, since strtok is destructive
strcpy (optNamesValues, optNamesValuesOrig);
- char *name;
- char *nameTrimmed = (char *)calloc (len + 1, 1);
- char *valueStr = 0;
- const char *betweenPairs = ",";
- const char *betweenOptVal = "=";
+ char *nameTrimmed = (char *)calloc (len + 1, 1);
+ char *valueStr = 0;
+ const char *betweenPairs = ",";
+ const char *betweenOptVal = "=";
// Count number of pairs
- char *pairToken = (char *)optNamesValuesOrig; // TODO do with CompString
- unsigned int nPairs = 1;
+ char *pairToken = (char *)optNamesValuesOrig; // TODO do with CompString
+ unsigned int nPairs = 1;
while ((pairToken = strchr (pairToken, betweenPairs[0])))
{
@@ -160,13 +161,19 @@
os->pairs.reserve (nPairs);
// Tokenize pairs
- name = strtok (optNamesValues, betweenOptVal);
+ char *name = strtok (optNamesValues, betweenOptVal);
int errorNo = -1;
unsigned int i;
- for (i = 0; name && i < nPairs; ++i)
+<<<<<<< TREE
+ for (i = 0; name && i < nPairs; ++i)
+=======
+
+ for (i = 0; name && i < nPairs; ++i)
+>>>>>>> MERGE-SOURCE
{
errorNo = 0;
+
if (strchr (name, betweenPairs[0])) // handle "a, b=4" case
{
errorNo = 1;
@@ -174,12 +181,15 @@
}
sscanf (name, " %s ", nameTrimmed);
+
if (!strlen (nameTrimmed))
{
errorNo = 2;
break;
}
+
valueStr = strtok (0, betweenPairs);
+
if (!valueStr)
{
errorNo = 3;
@@ -189,13 +199,16 @@
// TODO: Fix: Convert to "pluginname:option_name" format
// Warning: Assumes that option names in different extension plugins
// will be different.
- bool matched = false;
- const ExtensionPluginInfo *chosenExtensionPlugin = NULL;
- CompOption *o = 0;
- int optId = -1;
+ bool matched = false;
+ const ExtensionPluginInfo *chosenExtensionPlugin = NULL;
+ CompOption *o = 0;
+ int optId = -1;
+ unsigned int nOptions;
+
foreach (ExtensionPluginInfo *extensionPlugin, mExtensionPlugins)
{
- unsigned int nOptions = extensionPlugin->effectOptions->size ();
+ nOptions = extensionPlugin->effectOptions->size ();
+
for (optId = (int)extensionPlugin->firstEffectOptionIndex;
optId < (int)nOptions; ++optId)
{
@@ -208,14 +221,17 @@
break;
}
}
+
if (matched)
break;
}
+
if (!matched)
{
errorNo = 4;
break;
}
+
CompOption::Value v;
os->pairs.push_back (IdValuePair ());
@@ -224,8 +240,10 @@
pair->pluginInfo = chosenExtensionPlugin;
pair->optionId = optId;
int valueRead = -1;
+
switch (o->type ())
{
+<<<<<<< TREE
case CompOption::TypeBool:
int vb;
valueRead = sscanf (valueStr, " %d ", &vb);
@@ -289,8 +307,86 @@
default:
break;
}
+=======
+ case CompOption::TypeBool:
+ int vb;
+ valueRead = sscanf (valueStr, " %d ", &vb);
+
+ if (valueRead)
+ pair->value.set ((bool)vb);
+
+ break;
+
+ case CompOption::TypeInt:
+ {
+ int vi;
+ valueRead = sscanf (valueStr, " %d ", &vi);
+
+ if (valueRead > 0)
+ {
+ if (o->rest ().inRange (vi))
+ {
+ v.set (vi);
+ pair->value = v;
+ }
+ else
+ errorNo = 7;
+ }
+
+ break;
+ }
+ case CompOption::TypeFloat:
+ {
+ float vf;
+ valueRead = sscanf (valueStr, " %f ", &vf);
+
+ if (valueRead > 0)
+ {
+ if (o->rest ().inRange (vf))
+ {
+ v.set (vf);
+ pair->value = v;
+ }
+ else
+ errorNo = 7;
+ }
+
+ break;
+ }
+ case CompOption::TypeString:
+ {
+ v.set (CompString (valueStr));
+ valueRead = 1;
+ break;
+ }
+
+ case CompOption::TypeColor:
+ {
+ unsigned short vc[4];
+ valueRead = sscanf (valueStr, " #%2hx%2hx%2hx%2hx ",
+ &vc[0], &vc[1], &vc[2], &vc[3]);
+
+ if (valueRead == 4)
+ {
+ CompOption::Value *pairVal = &pair->value;
+ for (int j = 0; j < 4; ++j)
+ vc[j] = vc[j] << 8 | vc[j];
+ pairVal->set (vc);
+ }
+ else
+ errorNo = 6;
+
+ break;
+ }
+
+ default:
+ break;
+ }
+
+>>>>>>> MERGE-SOURCE
if (valueRead == 0)
errorNo = 6;
+
if (errorNo > 0)
break;
// If valueRead is -1 here, then it must be a
@@ -305,38 +401,44 @@
{
switch (errorNo)
{
- case -1:
- case 2:
- compLogMessage ("animation", CompLogLevelError,
- "Option name missing in \"%s\"",
- optNamesValuesOrig);
- break;
- case 1:
- case 3:
- compLogMessage ("animation", CompLogLevelError,
- "Option value missing in \"%s\"",
- optNamesValuesOrig);
- break;
- case 4:
- //compLogMessage ("animation", CompLogLevelError,
- // "Unknown option \"%s\" in \"%s\"",
- // nameTrimmed, optNamesValuesOrig);
- break;
- case 6:
- compLogMessage ("animation", CompLogLevelError,
- "Invalid value \"%s\" in \"%s\"",
- valueStr, optNamesValuesOrig);
- break;
- case 7:
- compLogMessage ("animation", CompLogLevelError,
- "Value \"%s\" out of range in \"%s\"",
- valueStr, optNamesValuesOrig);
- break;
- default:
- break;
+ case -1:
+ case 2:
+ compLogMessage ("animation", CompLogLevelError,
+ "Option name missing in \"%s\"",
+ optNamesValuesOrig);
+ break;
+
+ case 1:
+ case 3:
+ compLogMessage ("animation", CompLogLevelError,
+ "Option value missing in \"%s\"",
+ optNamesValuesOrig);
+ break;
+
+ case 4:
+ //compLogMessage ("animation", CompLogLevelError,
+ // "Unknown option \"%s\" in \"%s\"",
+ // nameTrimmed, optNamesValuesOrig);
+ break;
+
+ case 6:
+ compLogMessage ("animation", CompLogLevelError,
+ "Invalid value \"%s\" in \"%s\"",
+ valueStr, optNamesValuesOrig);
+ break;
+
+ case 7:
+ compLogMessage ("animation", CompLogLevelError,
+ "Value \"%s\" out of range in \"%s\"",
+ valueStr, optNamesValuesOrig);
+ break;
+
+ default:
+ break;
}
os->pairs.clear ();
}
+
free (optNamesValues);
free (nameTrimmed);
}
@@ -358,4 +460,3 @@
updateOptionSet (&oss->sets[i], (*listVal)[i].s ().c_str ());
}
}
-
=== modified file 'plugins/animation/src/private.h'
--- plugins/animation/src/private.h 2012-09-07 22:37:20 +0000
+++ plugins/animation/src/private.h 2013-07-21 23:03:28 +0000
@@ -21,27 +21,33 @@
class RestackInfo
{
public:
+
RestackInfo (CompWindow *wRestacked,
CompWindow *wStart,
CompWindow *wEnd,
CompWindow *wOldAbove,
- bool raised);
-
- CompWindow *wRestacked, *wStart, *wEnd, *wOldAbove;
- bool raised;
+ bool raised);
+
+ CompWindow *wRestacked;
+ CompWindow *wStart;
+ CompWindow *wEnd;
+ CompWindow *wOldAbove;
+
+ bool raised;
};
class IdValuePair
{
public:
+
IdValuePair () : pluginInfo (0), optionId (-1), value () {}
bool matchesPluginOption (ExtensionPluginInfo *pluginInfo,
- int optionId) const;
+ int optionId) const;
const ExtensionPluginInfo *pluginInfo;
- int optionId;
- CompOption::Value value;
+ int optionId;
+ CompOption::Value value;
};
typedef std::vector IdValuePairVector;
@@ -49,6 +55,7 @@
class OptionSet
{
public:
+
OptionSet () {}
IdValuePairVector pairs;
@@ -59,6 +66,7 @@
class OptionSets
{
public:
+
OptionSets () {}
OptionSetVector sets;
@@ -67,6 +75,7 @@
class EffectSet
{
public:
+
EffectSet () {}
AnimEffectVector effects;
@@ -120,15 +129,15 @@
// in PrivateAnimScreenOptions
#define NUM_NONEFFECT_OPTIONS AnimationOptions::CurvedFoldAmpMult
-
class ExtensionPluginAnimation : public ExtensionPluginInfo
{
public:
- ExtensionPluginAnimation (const CompString &name,
- unsigned int nEffects,
- AnimEffect *effects,
+
+ ExtensionPluginAnimation (const CompString &name,
+ unsigned int nEffects,
+ AnimEffect *effects,
CompOption::Vector *effectOptions,
- unsigned int firstEffectOptionIndex);
+ unsigned int firstEffectOptionIndex);
~ExtensionPluginAnimation ();
// Overriden methods from ExtensionPluginInfo
@@ -144,7 +153,7 @@
void initPersistentData (AnimWindow *aw);
void destroyPersistentData (AnimWindow *aw);
void postUpdateEventEffects (AnimEvent e,
- bool forRandom);
+ bool forRandom);
void cleanUpAnimation (bool closing,
bool destructing);
void postStartupCountdown ();
@@ -163,7 +172,8 @@
CompWindow * walkNext (CompWindow *w);
void incrementCurRestackAnimCount ();
void decrementCurRestackAnimCount ();
- bool wontCreateCircularChain (CompWindow *wCur, CompWindow *wNext);
+ bool wontCreateCircularChain (CompWindow *wCur,
+ CompWindow *wNext);
static void cleanUpParentChildChainItem (AnimWindow *aw);
static bool relevantForRestackAnim (CompWindow *w);
@@ -177,13 +187,13 @@
bool mAWinWasRestackedJustNow;
private:
- CompWindowVector mLastClientList; ///< Last known stacking order
- CompWindowVector mPrevClientList; ///< The stacking order before mLastClientList
- int mRestackAnimCount; ///< Count of how many windows are currently involved in
- ///< animations that require walker (dodge & focus fade).
+ CompWindowVector mLastClientList; ///< Last known stacking order
+ CompWindowVector mPrevClientList; ///< The stacking order before mLastClientList
+ int mRestackAnimCount; ///< Count of how many windows are currently involved in
+ ///< animations that require walker (dodge & focus fade).
std::vector mRestackedWindows;
- CompWindowList mWindowList;
+ CompWindowList mWindowList;
};
class PrivateAnimScreen :
@@ -196,48 +206,50 @@
friend class AnimWindow;
public:
- CompositeScreen *cScreen;
- GLScreen *gScreen;
- AnimScreen *aScreen;
+
+ CompositeScreen *cScreen;
+ GLScreen *gScreen;
+ AnimScreen *aScreen;
private:
- struct timeval mLastRedrawTime;
- bool mLastRedrawTimeFresh;
-
- bool mPluginActive[WatchedScreenPluginNum];
- int mSwitcherPostWait;
- int mStartCountdown;
+
+ struct timeval mLastRedrawTime;
+ bool mLastRedrawTimeFresh;
+
+ bool mPluginActive[WatchedScreenPluginNum];
+ int mSwitcherPostWait;
+ int mStartCountdown;
///< To mark windows as "created" if they were opened before compiz
///< was started and to prevent already opened windows from doing
///< open animation.
- Window mLastActiveWindow; ///< Last known active window
-
- bool mAnimInProgress; ///< Is an animation currently being played?
- bool mStartingNewPaintRound; ///< Is a new round of glPaints starting?
- bool mPrePaintWindowsBackToFrontEnabled;
-
- EffectSet mRandomEffects[AnimEventNum];
-
- OptionSets mEventOptionSets[AnimEventNum];
+ Window mLastActiveWindow; ///< Last known active window
+
+ bool mAnimInProgress; ///< Is an animation currently being played?
+ bool mStartingNewPaintRound; ///< Is a new round of glPaints starting?
+ bool mPrePaintWindowsBackToFrontEnabled;
+
+ EffectSet mRandomEffects[AnimEventNum];
+
+ OptionSets mEventOptionSets[AnimEventNum];
// Effect extension plugins
ExtensionPluginVector mExtensionPlugins;
// Possible effects for each event
- AnimEffectVector mEventEffectsAllowed[AnimEventNum];
+ AnimEffectVector mEventEffectsAllowed[AnimEventNum];
// List of chosen effects for each event
- EffectSet mEventEffects[AnimEventNum];
-
- CompOutput *mOutput;
-
- Window mActiveWindow;
- CompMatch mNeverAnimateMatch;
-
- const CompWindowList *mLockedPaintList;
- unsigned int mLockedPaintListCnt;
- unsigned int mGetWindowPaintListEnableCnt;
+ EffectSet mEventEffects[AnimEventNum];
+
+ CompOutput *mOutput;
+
+ Window mActiveWindow;
+ CompMatch mNeverAnimateMatch;
+
+ const CompWindowList *mLockedPaintList;
+ unsigned int mLockedPaintListCnt;
+ unsigned int mGetWindowPaintListEnableCnt;
void updateEventEffects (AnimEvent e,
bool forRandom,
@@ -245,25 +257,32 @@
void updateAllEventEffects ();
void updateOptionSets (AnimEvent e);
- void updateOptionSet (OptionSet *os, const char *optNamesValuesOrig);
+ void updateOptionSet (OptionSet *os,
+ const char *optNamesValuesOrig);
void activateEvent (bool activating);
bool isWinVisible (CompWindow *w);
AnimEvent getCorrespondingAnimEvent (AnimationOptions::Options optionId);
- void eventMatchesChanged (CompOption *opt, AnimationOptions::Options num);
- void eventOptionsChanged (CompOption *opt, AnimationOptions::Options num);
- void eventEffectsChanged (CompOption *opt, AnimationOptions::Options num);
- void eventRandomEffectsChanged (CompOption *opt, AnimationOptions::Options num);
+ void eventMatchesChanged (CompOption *opt,
+ AnimationOptions::Options num);
+ void eventOptionsChanged (CompOption *opt,
+ AnimationOptions::Options num);
+ void eventEffectsChanged (CompOption *opt,
+ AnimationOptions::Options num);
+ void eventRandomEffectsChanged (CompOption *opt,
+ AnimationOptions::Options num);
- CompRect getIcon (CompWindow *w, bool alwaysUseMouse);
+ CompRect getIcon (CompWindow *w,
+ bool alwaysUseMouse);
void updateAnimStillInProgress ();
bool isAnimEffectInList (AnimEffect theEffect,
- EffectSet &effectList);
+ EffectSet &effectList);
bool isAnimEffectPossibleForEvent (AnimEffect theEffect,
- AnimEvent event);
+ AnimEvent event);
public:
+
PrivateAnimScreen (CompScreen *s, AnimScreen *);
~PrivateAnimScreen ();
@@ -293,16 +312,17 @@
bool isAnimEffectPossible (AnimEffect theEffect);
inline CompOutput &output () { return *mOutput; }
AnimEffect getActualEffect (AnimEffect effect,
- AnimEvent animEvent);
- bool shouldIgnoreWindowForAnim (CompWindow *w, bool checkPixmap);
+ AnimEvent animEvent);
+ bool shouldIgnoreWindowForAnim (CompWindow *w,
+ bool checkPixmap);
OptionSet *getOptionSetForSelectedRow (PrivateAnimWindow *aw,
- Animation *anim);
+ Animation *anim);
void addExtension (ExtensionPluginInfo *extensionPluginInfo,
- bool shouldInitPersistentData);
+ bool shouldInitPersistentData);
void removeExtension (ExtensionPluginInfo *extensionPluginInfo);
AnimEffect getMatchingAnimSelection (CompWindow *w,
- AnimEvent e,
- int *duration);
+ AnimEvent e,
+ int *duration);
bool otherPluginsActive ();
void enablePrePaintWindowsBackToFront (bool enabled);
@@ -315,13 +335,14 @@
// GLScreenInterface methods
bool glPaintOutput (const GLScreenPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- CompOutput *,
- unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
// ScreenInterface methods
- void handleCompizEvent (const char * plugin, const char *event,
+ void handleCompizEvent (const char *plugin,
+ const char *event,
CompOption::Vector &options);
};
@@ -333,6 +354,7 @@
friend class AnimWindow;
public:
+
PrivateAnimWindow (CompWindow *, AnimWindow *aw);
~PrivateAnimWindow ();
@@ -351,41 +373,43 @@
GLWindow *gWindow;
private:
+
CompWindow *mWindow;
AnimWindow *mAWindow;
PrivateAnimScreen *mPAScreen;
- unsigned int mState;
- unsigned int mNewState;
-
- Animation *mCurAnimation;
-
- bool mUnshadePending;
- bool mEventNotOpenClose;
- bool mNowShaded;
- bool mGrabbed;
-
- int mUnmapCnt;
- int mDestroyCnt;
-
- bool mIgnoreDamage;
- bool mFinishingAnim;
-
- int mCurAnimSelectionRow;
- int mPrevAnimSelectionRow; ///< For the case when one event interrupts another
-
- Box mBB; ///< Bounding box of area to be damaged
-
- CompRegion mStepRegion; ///< Region to damage this step
- CompRegion mLastStepRegion; ///< Region damaged last step
-
- bool mPluginActive[WatchedWindowPluginNum];
+ unsigned int mState;
+ unsigned int mNewState;
+
+ Animation *mCurAnimation;
+
+ bool mUnshadePending;
+ bool mEventNotOpenClose;
+ bool mNowShaded;
+ bool mGrabbed;
+
+ int mUnmapCnt;
+ int mDestroyCnt;
+
+ bool mIgnoreDamage;
+ bool mFinishingAnim;
+
+ int mCurAnimSelectionRow;
+ int mPrevAnimSelectionRow; ///< For the case when one event interrupts another
+
+ Box mBB; ///< Bounding box of area to be damaged
+
+ CompRegion mStepRegion; ///< Region to damage this step
+ CompRegion mLastStepRegion; ///< Region damaged last step
+
+ bool mPluginActive[WatchedWindowPluginNum];
// Utility methods
unsigned int getState ();
void updateSelectionRow (unsigned int i);
- void postAnimationCleanUpPrev (bool closing, bool clearMatchingRow);
+ void postAnimationCleanUpPrev (bool closing,
+ bool clearMatchingRow);
void postAnimationCleanUpCustom (bool closing,
bool destructing,
bool clearMatchingRow);
@@ -395,20 +419,34 @@
void notifyAnimation (bool activation);
// WindowInterface methods
- void resizeNotify (int dx, int dy, int dwidth, int dheight);
- void moveNotify (int dx, int dy, bool immediate);
+ void resizeNotify (int dx,
+ int dy,
+ int dwidth,
+ int dheight);
+ void moveNotify (int dx,
+ int dy,
+ bool immediate);
void windowNotify (CompWindowNotify n);
- void grabNotify (int x, int y, unsigned int state, unsigned int mask);
+ void grabNotify (int x,
+ int y,
+ unsigned int state,
+ unsigned int mask);
void ungrabNotify ();
// GLWindowInterface methods
- bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
- const CompRegion &, unsigned int);
+ bool glPaint (const GLWindowPaintAttrib &,
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
void glAddGeometry (const GLTexture::MatrixList &,
- const CompRegion &, const CompRegion &,
- unsigned int = MAXSHORT, unsigned int = MAXSHORT);
- void glDrawTexture (GLTexture *texture, const GLMatrix &,
- const GLWindowPaintAttrib &, unsigned int);
+ const CompRegion &,
+ const CompRegion &,
+ unsigned int = MAXSHORT,
+ unsigned int = MAXSHORT);
+ void glDrawTexture (GLTexture *texture,
+ const GLMatrix &,
+ const GLWindowPaintAttrib &,
+ unsigned int );
//void glDrawGeometry ();
};
@@ -416,12 +454,14 @@
public GridAnim
{
public:
- RollUpAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+
+ RollUpAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon);
+ const CompRect &icon);
protected:
+
static const float kDurationFactor;
void initGrid ();
@@ -432,15 +472,17 @@
public GridAnim
{
public:
- MagicLampAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
+
+ MagicLampAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
virtual ~MagicLampAnim ();
protected:
- bool mTargetTop;
+
+ bool mTargetTop;
GridModel::GridObject *mTopLeftCornerObject;
GridModel::GridObject *mBottomLeftCornerObject;
@@ -451,30 +493,33 @@
void adjustPointerIconSize ();
virtual bool hasMovingEnd ();
- virtual void filterTargetX (float &targetX, float x) { }
+ virtual void filterTargetX (float &targetX,
+ float x) { }
};
class MagicLampWavyAnim :
public MagicLampAnim
{
public:
- MagicLampWavyAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
+
+ MagicLampWavyAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
~MagicLampWavyAnim ();
protected:
+
struct WaveParam
{
- float halfWidth;
- float amp;
- float pos;
+ float halfWidth;
+ float amp;
+ float pos;
};
unsigned int mNumWaves;
- WaveParam *mWaves;
+ WaveParam *mWaves;
void initGrid ();
void updateBB (CompOutput &output);
@@ -482,19 +527,21 @@
void adjustPointerIconSize ();
bool hasMovingEnd ();
- void filterTargetX (float &targetX, float x);
+ void filterTargetX (float &targetX,
+ float x);
};
class SidekickAnim :
public ZoomAnim
{
public:
- SidekickAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+ SidekickAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon);
+ const CompRect &icon);
protected:
+
float mNumRotations;
float getSpringiness ();
@@ -509,12 +556,14 @@
public GridTransformAnim
{
public:
- WaveAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+
+ WaveAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon);
+ const CompRect &icon);
protected:
+
void adjustDuration ();
void initGrid ();
inline bool using3D () { return true; }
@@ -528,13 +577,15 @@
public ZoomAnim
{
public:
- GlideAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+
+ GlideAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon);
+ const CompRect &icon);
protected:
+
void prePaintWindow ();
inline bool postPaintWindowUsed () { return true; }
void postPaintWindow ();
@@ -556,12 +607,14 @@
public GlideAnim
{
public:
- Glide2Anim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+
+ Glide2Anim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon);
+ const CompRect &icon);
protected:
+
bool zoomToIcon ();
void getParams (float *finalDistFac,
float *finalRotAng,
@@ -574,16 +627,23 @@
virtual public Animation
{
public:
- RestackAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+
+ RestackAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon);
+ const CompRect &icon);
+
void cleanUp (bool closing,
bool destructing);
+
bool initiateRestackAnim (int duration);
- inline bool moveUpdate (int dx, int dy) { return false; }
- static bool onSameRestackChain (CompWindow *wSubject, CompWindow *wOther);
+
+ inline bool moveUpdate (int dx,
+ int dy) { return false; }
+
+ static bool onSameRestackChain (CompWindow *wSubject,
+ CompWindow *wOther);
/// Find union of restack chain (group)
static CompRegion unionRestackChain (CompWindow *w);
@@ -595,12 +655,13 @@
virtual void processCandidate (CompWindow *candidateWin,
CompWindow *subjectWin,
CompRegion &candidateAndSubjectIntersection,
- int &numSelectedCandidates) {}
- virtual void postInitiateRestackAnim (int numSelectedCandidates,
- int duration,
+ int &numSelectedCandidates) {}
+
+ virtual void postInitiateRestackAnim (int numSelectedCandidates,
+ int duration,
CompWindow *wStart,
CompWindow *wEnd,
- bool raised) {}
+ bool raised) {}
// Other methods
bool overNewCopy (); ///< Is glPaint on the copy at the new position?
@@ -617,30 +678,33 @@
friend class DodgeAnim;
public:
+
RestackPersistentData ();
~RestackPersistentData ();
protected:
+
inline RestackInfo *restackInfo () { return mRestackInfo; }
void resetRestackInfo (bool alsoResetChain = false);
void setRestackInfo (CompWindow *wRestacked,
CompWindow *wStart,
CompWindow *wEnd,
CompWindow *wOldAbove,
- bool raised);
- void getHostedOnWin (CompWindow *wGuest, CompWindow *wHost);
+ bool raised);
+ void getHostedOnWin (CompWindow *wGuest,
+ CompWindow *wHost);
- RestackInfo *mRestackInfo; ///< restack info if window was restacked this paint round
- CompWindow *mWinToBePaintedBeforeThis; ///< Window which should be painted before this
- CompWindow *mWinThisIsPaintedBefore; ///< the inverse relation of mWinToBePaintedBeforeThis
- CompWindow *mMoreToBePaintedPrev;
- CompWindow *mMoreToBePaintedNext; ///< doubly linked list for windows underneath that
- ///< raise together with this one
- bool mConfigureNotified; ///< was mConfigureNotified before restack check
- CompWindow *mWinPassingThrough; ///< win. passing through this one during focus effect
- bool mWalkerOverNewCopy; ///< whether walker is on the copy at the new pos.
- int mVisitCount; ///< how many times walker/glPaint has visited this window
- bool mIsSecondary; ///< whether this is one of the secondary (non-topmost) in its restack chain
+ RestackInfo *mRestackInfo; ///< restack info if window was restacked this paint round
+ CompWindow *mWinToBePaintedBeforeThis; ///< Window which should be painted before this
+ CompWindow *mWinThisIsPaintedBefore; ///< the inverse relation of mWinToBePaintedBeforeThis
+ CompWindow *mMoreToBePaintedPrev;
+ CompWindow *mMoreToBePaintedNext; ///< doubly linked list for windows underneath that
+ ///< raise together with this one
+ bool mConfigureNotified; ///< was mConfigureNotified before restack check
+ CompWindow *mWinPassingThrough; ///< win. passing through this one during focus effect
+ bool mWalkerOverNewCopy; ///< whether walker is on the copy at the new pos.
+ int mVisitCount; ///< how many times walker/glPaint has visited this window
+ bool mIsSecondary; ///< whether this is one of the secondary (non-topmost) in its restack chain
};
class FocusFadeAnim :
@@ -648,20 +712,22 @@
public FadeAnim
{
public:
- FocusFadeAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+
+ FocusFadeAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon);
+ const CompRect &icon);
void updateAttrib (GLWindowPaintAttrib &attrib);
void cleanUp (bool closing,
bool destructing);
protected:
+
void processCandidate (CompWindow *candidateWin,
CompWindow *subjectWin,
CompRegion &candidateAndSubjectIntersection,
- int &numSelectedCandidates);
+ int &numSelectedCandidates);
GLushort computeOpacity (GLushort opacityInt);
};
@@ -682,15 +748,16 @@
public TransformAnim
{
public:
- DodgeAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+
+ DodgeAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon);
+ const CompRect &icon);
void cleanUp (bool closing,
bool destructing);
- static int getDodgeAmount (CompRect &rect,
- CompWindow *dw,
+ static int getDodgeAmount (CompRect &rect,
+ CompWindow *dw,
DodgeDirection dir);
void step ();
void updateTransform (GLMatrix &wTransform);
@@ -698,18 +765,20 @@
void updateBB (CompOutput &output);
void postPreparePaint ();
void calculateDodgeAmounts ();
- bool moveUpdate (int dx, int dy);
+ bool moveUpdate (int dx,
+ int dy);
protected:
+
void processCandidate (CompWindow *candidateWin,
CompWindow *subjectWin,
CompRegion &candidateAndSubjectIntersection,
- int &numSelectedCandidates);
- void postInitiateRestackAnim (int numSelectedCandidates,
- int duration,
+ int &numSelectedCandidates);
+ void postInitiateRestackAnim (int numSelectedCandidates,
+ int duration,
CompWindow *wStart,
CompWindow *wEnd,
- bool raised);
+ bool raised);
bool paintedElsewhere ();
void applyDodgeTransform ();
float dodgeProgress ();
@@ -733,14 +802,16 @@
friend class DodgeAnim;
public:
+
DodgePersistentData ();
private:
- int dodgeOrder; ///< dodge order (used temporarily)
+
+ int dodgeOrder; ///< dodge order (used temporarily)
// TODO mov the below members into DodgeAnim
- bool isDodgeSubject; ///< true if this window is the cause of dodging
- bool skipPostPrepareScreen;
+ bool isDodgeSubject; ///< true if this window is the cause of dodging
+ bool skipPostPrepareScreen;
CompWindow *dodgeChainStart;///< for the subject window
CompWindow *dodgeChainPrev; ///< for dodging windows
CompWindow *dodgeChainNext; ///< for dodging windows
@@ -750,12 +821,14 @@
public GridZoomAnim
{
public:
- DreamAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+
+ DreamAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon);
+ const CompRect &icon);
protected:
+
void init ();
void initGrid ();
void step ();
@@ -771,12 +844,14 @@
public GridZoomAnim
{
public:
- FoldAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+
+ FoldAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon);
+ const CompRect &icon);
protected:
+
inline bool using3D () { return true; }
float getFadeProgress ();
void updateWindowAttrib (GLWindowPaintAttrib &attrib);
@@ -787,21 +862,23 @@
public FoldAnim
{
public:
- CurvedFoldAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+
+ CurvedFoldAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon);
+ const CompRect &icon);
protected:
+
void initGrid ();
void step ();
void updateBB (CompOutput &output);
bool zoomToIcon ();
float getObjectZ (GridAnim::GridModel *mModel,
- float forwardProgress,
- float sinForProg,
- float relDistToCenter,
- float curveMaxAmp);
+ float forwardProgress,
+ float sinForProg,
+ float relDistToCenter,
+ float curveMaxAmp);
bool requiresTransformedWindow () const { return true; }
};
@@ -809,19 +886,21 @@
public FoldAnim
{
public:
- HorizontalFoldsAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+
+ HorizontalFoldsAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon);
+ const CompRect &icon);
protected:
+
void initGrid ();
void step ();
bool zoomToIcon ();
float getObjectZ (GridAnim::GridModel *mModel,
- float forwardProgress,
- float sinForProg,
- float relDistToFoldCenter,
- float foldMaxAmp);
+ float forwardProgress,
+ float sinForProg,
+ float relDistToFoldCenter,
+ float foldMaxAmp);
bool requiresTransformedWindow () const { return true; }
};
=== modified file 'plugins/animation/src/restack.cpp'
--- plugins/animation/src/restack.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animation/src/restack.cpp 2013-07-21 23:03:28 +0000
@@ -38,11 +38,11 @@
// ===================== Restack =========================
-RestackAnim::RestackAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+RestackAnim::RestackAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon)
{
mRestackData = static_cast
@@ -59,6 +59,7 @@
// Look for still playing windows in parent-child chain
CompWindow *wCur = mRestackData->mMoreToBePaintedNext;
+
while (wCur)
{
AnimWindow *awCur = AnimWindow::get (wCur);
@@ -69,13 +70,16 @@
thereIsUnfinishedChainElem = true;
break;
}
+
RestackPersistentData *dataCur = static_cast
(awCur->persistentData["restack"]);
wCur = dataCur->mMoreToBePaintedNext;
}
+
if (!thereIsUnfinishedChainElem)
{
wCur = mRestackData->mMoreToBePaintedPrev;
+
while (wCur)
{
AnimWindow *awCur = AnimWindow::get (wCur);
@@ -86,6 +90,7 @@
thereIsUnfinishedChainElem = true;
break;
}
+
RestackPersistentData *dataCur =
static_cast
(awCur->persistentData["restack"]);
@@ -97,6 +102,7 @@
{
// Finish off all windows in parent-child chain
CompWindow *wCur = mRestackData->mMoreToBePaintedNext;
+
while (wCur)
{
AnimWindow *awCur = AnimWindow::get (wCur);
@@ -107,7 +113,9 @@
static_cast
(getExtensionPluginInfo ())->cleanUpParentChildChainItem (awCur);
}
+
wCur = mWindow;
+
while (wCur)
{
AnimWindow *awCur = AnimWindow::get (wCur);
@@ -128,12 +136,12 @@
bool
RestackAnim::initiateRestackAnim (int duration)
{
- CompWindow *wStart = 0;
- CompWindow *wEnd = 0;
+ CompWindow *wStart = 0;
+ CompWindow *wEnd = 0;
CompWindow *wOldAbove = 0;
if (!mRestackData)
- return false;
+ return false;
ExtensionPluginAnimation *extPlugin =
static_cast (getExtensionPluginInfo ());
@@ -148,12 +156,12 @@
if (mRestackData->mIsSecondary)
{
if (!mRestackData->mMoreToBePaintedNext)
- return false;
+ return false;
- AnimWindow *awAbove =
- AnimWindow::get (mRestackData->mMoreToBePaintedNext);
- RestackPersistentData *dataAbove = static_cast
- (awAbove->persistentData["restack"]);
+ AnimWindow *awAbove =
+ AnimWindow::get (mRestackData->mMoreToBePaintedNext);
+ RestackPersistentData *dataAbove = static_cast
+ (awAbove->persistentData["restack"]);
mTotalTime = awAbove->curAnimation ()->totalTime ();
mRemainingTime = mTotalTime;
@@ -162,7 +170,7 @@
{
// Host this subject instead, on the above subject's host
mRestackData->getHostedOnWin (mWindow,
- dataAbove->mWinThisIsPaintedBefore);
+ dataAbove->mWinThisIsPaintedBefore);
}
// do basic secondary subject initialization
postInitiateRestackAnim (0, 0, 0, 0, false);
@@ -175,10 +183,10 @@
if (restackInfo)
{
- wStart = restackInfo->wStart;
- wEnd = restackInfo->wEnd;
+ wStart = restackInfo->wStart;
+ wEnd = restackInfo->wEnd;
wOldAbove = restackInfo->wOldAbove;
- raised = restackInfo->raised;
+ raised = restackInfo->raised;
}
// Find union region of all windows that will be
@@ -199,6 +207,7 @@
{
RestackPersistentData *dataCand = static_cast
(AnimWindow::get (wCand)->persistentData["restack"]);
+
if (!extPlugin->relevantForRestackAnim (wCand))
continue;
@@ -227,16 +236,13 @@
}
if (fadeRegion.isEmpty ())
- {
// empty intersection -> won't be drawn
return false;
- }
+
if (wOldAbove)
- {
// Store this window in the next window
// so that this is drawn before that, i.e. in its old place
mRestackData->getHostedOnWin (mWindow, wOldAbove);
- }
postInitiateRestackAnim (numSelectedCandidates, duration,
wStart, wEnd, raised);
@@ -245,13 +251,16 @@
if (mRestackData->mMoreToBePaintedPrev)
{
RestackPersistentData *dataCur;
+
for (CompWindow *wCur = mRestackData->mMoreToBePaintedPrev; wCur;
wCur = dataCur->mMoreToBePaintedPrev)
{
dataCur = static_cast
(AnimWindow::get (wCur)->persistentData["restack"]);
+
if (!dataCur)
break;
+
dataCur->mIsSecondary = true;
}
}
@@ -259,16 +268,20 @@
}
bool
-RestackAnim::onSameRestackChain (CompWindow *wSubject, CompWindow *wOther)
+RestackAnim::onSameRestackChain (CompWindow *wSubject,
+ CompWindow *wOther)
{
RestackPersistentData *dataCur;
+
for (CompWindow *wCur = wSubject; wCur;
wCur = dataCur->mMoreToBePaintedNext)
{
if (wOther == wCur)
return true;
+
dataCur = static_cast
(AnimWindow::get (wCur)->persistentData["restack"]);
+
if (!dataCur)
break;
}
@@ -281,8 +294,10 @@
{
if (wOther == wCur)
return true;
+
dataCur = static_cast
(AnimWindow::get (wCur)->persistentData["restack"]);
+
if (!dataCur)
break;
}
@@ -306,25 +321,28 @@
CompRegion unionRegion;
RestackPersistentData *dataCur;
+
for (CompWindow *wCur = w; wCur;
wCur = dataCur->mMoreToBePaintedNext)
{
unionRegion += wCur->borderRect ();
dataCur = static_cast
(AnimWindow::get (wCur)->persistentData["restack"]);
+
if (!dataCur)
break;
}
RestackPersistentData *dataSubj = static_cast
- (AnimWindow::get (w)->
- persistentData["restack"]);
+ (AnimWindow::get (w)->
+ persistentData["restack"]);
for (CompWindow *wCur = dataSubj->mMoreToBePaintedPrev; wCur;
wCur = dataCur->mMoreToBePaintedPrev)
{
unionRegion += wCur->borderRect ();
dataCur = static_cast
(AnimWindow::get (wCur)->persistentData["restack"]);
+
if (!dataCur)
break;
}
@@ -336,12 +354,12 @@
CompWindow *wStart,
CompWindow *wEnd,
CompWindow *wOldAbove,
- bool raised) :
+ bool raised) :
wRestacked (wRestacked),
- wStart (wStart),
- wEnd (wEnd),
- wOldAbove (wOldAbove),
- raised (raised)
+ wStart (wStart),
+ wEnd (wEnd),
+ wOldAbove (wOldAbove),
+ raised (raised)
{
}
@@ -374,9 +392,9 @@
if (alsoResetChain)
{
- // Reset chain connections as this is not on a chain
- mMoreToBePaintedNext = 0;
- mMoreToBePaintedPrev = 0;
+ // Reset chain connections as this is not on a chain
+ mMoreToBePaintedNext = 0;
+ mMoreToBePaintedPrev = 0;
}
}
@@ -385,12 +403,12 @@
CompWindow *wStart,
CompWindow *wEnd,
CompWindow *wOldAbove,
- bool raised)
+ bool raised)
{
if (mRestackInfo)
delete mRestackInfo;
- mRestackInfo =
- new RestackInfo (wRestacked, wStart, wEnd, wOldAbove, raised);
+
+ mRestackInfo = new RestackInfo (wRestacked, wStart, wEnd, wOldAbove, raised);
}
/// Make this window be hosted on (i.e. drawn before) the given window.
@@ -402,4 +420,3 @@
dataHost->mWinToBePaintedBeforeThis = wGuest;
mWinThisIsPaintedBefore = wHost;
}
-
=== modified file 'plugins/animation/src/rollup.cpp'
--- plugins/animation/src/rollup.cpp 2013-04-25 11:07:54 +0000
+++ plugins/animation/src/rollup.cpp 2013-07-21 23:03:28 +0000
@@ -40,11 +40,11 @@
const float RollUpAnim::kDurationFactor = 1.67;
-RollUpAnim::RollUpAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+RollUpAnim::RollUpAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, kDurationFactor * duration, info,
icon),
GridAnim::GridAnim (w, curWindowEvent, kDurationFactor * duration, info,
@@ -56,6 +56,7 @@
RollUpAnim::initGrid ()
{
mGridWidth = 2;
+
if (mCurWindowEvent == WindowEventShade ||
mCurWindowEvent == WindowEventUnshade)
mGridHeight = 4;
@@ -73,14 +74,19 @@
mAWindow->savedOutRect () :
mWindow->outputRect ());
- int ox = outRect.x ();
- int oy = outRect.y ();
- int owidth = outRect.width ();
+ int ox = outRect.x ();
+ int oy = outRect.y ();
+ int owidth = outRect.width ();
int oheight = outRect.height ();
GridModel::GridObject *object = mModel->objects ();
unsigned int n = mModel->numObjects ();
- for (unsigned int i = 0; i < n; ++i, ++object)
+<<<<<<< TREE
+ for (unsigned int i = 0; i < n; ++i, ++object)
+=======
+
+ for (unsigned int i = 0; i < n; ++i, ++object)
+>>>>>>> MERGE-SOURCE
{
// Executing shade mode
@@ -91,16 +97,12 @@
float objGridY = object->gridPosition ().y ();
if (objGridY == 0)
- {
objPos.setY (oy);
- }
else if (objGridY == 1)
- {
objPos.setY (
(1 - forwardProgress) * (oy + oheight * objGridY) +
forwardProgress * (oy +
mDecorTopHeight + mDecorBottomHeight));
- }
else
{
// find position in window contents
@@ -122,6 +124,7 @@
else
{
objPos.setY (oy + mDecorTopHeight);
+
if (!fixedInterior)
object->offsetTexCoordForQuadAfter ().
setY ((forwardProgress - relPosInWinContents) *
@@ -147,4 +150,3 @@
objPos.setX (origx);
}
}
-
=== modified file 'plugins/animation/src/transform.cpp'
--- plugins/animation/src/transform.cpp 2012-05-25 04:06:13 +0000
+++ plugins/animation/src/transform.cpp 2013-07-21 23:03:28 +0000
@@ -36,11 +36,11 @@
#include "private.h"
-TransformAnim::TransformAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+TransformAnim::TransformAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
mTransformStartProgress (0.0f),
mTransformProgress (0.0f)
@@ -112,8 +112,8 @@
void
TransformAnim::applyPerspectiveSkew (CompOutput &output,
- GLMatrix &transform,
- Point ¢er)
+ GLMatrix &transform,
+ Point ¢er)
{
GLfloat skewx = -(((center.x () - output.region ()->extents.x1) -
output.width () / 2) * 1.15);
@@ -143,4 +143,3 @@
inRect.y () + inRect.height () / 2);
return center;
}
-
=== modified file 'plugins/animation/src/wave.cpp'
--- plugins/animation/src/wave.cpp 2013-04-25 11:07:54 +0000
+++ plugins/animation/src/wave.cpp 2013-07-21 23:03:28 +0000
@@ -40,11 +40,11 @@
// ===================== Effect: Wave =========================
-WaveAnim::WaveAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+WaveAnim::WaveAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
GridTransformAnim::GridTransformAnim (w, curWindowEvent, duration, info,
@@ -86,11 +86,11 @@
mAWindow->savedOutExtents () :
mWindow->output ());
- int wx = winRect.x ();
- int wy = winRect.y ();
+ int wx = winRect.x ();
+ int wy = winRect.y ();
- int oy = outRect.y ();
- int owidth = outRect.width ();
+ int oy = outRect.y ();
+ int owidth = outRect.width ();
int oheight = outRect.height ();
float waveHalfWidth = (oheight * mModel->scale ().y () *
@@ -105,7 +105,12 @@
GridModel::GridObject *object = mModel->objects ();
unsigned int n = mModel->numObjects ();
- for (unsigned int i = 0; i < n; ++i, ++object)
+<<<<<<< TREE
+ for (unsigned int i = 0; i < n; ++i, ++object)
+=======
+
+ for (unsigned int i = 0; i < n; ++i, ++object)
+>>>>>>> MERGE-SOURCE
{
Point3d &objPos = object->position ();
@@ -141,4 +146,3 @@
objPos.setX (origx);
}
}
-
=== modified file 'plugins/animation/src/zoomside.cpp'
--- plugins/animation/src/zoomside.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animation/src/zoomside.cpp 2013-07-21 23:03:28 +0000
@@ -38,15 +38,15 @@
// ===================== Effect: Zoom and Sidekick =========================
-const float ZoomAnim::kDurationFactor = 1.33;
-const float ZoomAnim::kSpringyDurationFactor = 1.82;
+const float ZoomAnim::kDurationFactor = 1.33;
+const float ZoomAnim::kSpringyDurationFactor = 1.82;
const float ZoomAnim::kNonspringyDurationFactor = 1.67;
-ZoomAnim::ZoomAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+ZoomAnim::ZoomAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
FadeAnim::FadeAnim (w, curWindowEvent, duration, info, icon)
@@ -57,16 +57,16 @@
if (isZoomFromCenter ())
{
- mIcon.setX (outRect.x () + outRect.width () / 2 - mIcon.width () / 2);
+ mIcon.setX (outRect.x () + outRect.width () / 2 - mIcon.width () / 2);
mIcon.setY (outRect.y () + outRect.height () / 2 - mIcon.height () / 2);
}
}
-SidekickAnim::SidekickAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+SidekickAnim::SidekickAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
ZoomAnim::ZoomAnim (w, curWindowEvent, duration, info, icon)
@@ -138,41 +138,37 @@
if ((mCurWindowEvent == WindowEventUnminimize ||
mCurWindowEvent == WindowEventOpen) &&
getSpringiness () > 1e-4)
- {
mTotalTime *= kSpringyDurationFactor;
- }
else if (mCurWindowEvent == WindowEventOpen ||
mCurWindowEvent == WindowEventClose)
- {
mTotalTime *= kNonspringyDurationFactor;
- }
else
- {
mTotalTime *= kDurationFactor;
- }
+
mRemainingTime = mTotalTime;
}
void
ZoomAnim::getZoomProgress (float *pMoveProgress,
float *pScaleProgress,
- bool neverSpringy)
+ bool neverSpringy)
{
- float forwardProgress =
- 1 - mRemainingTime /
- (mTotalTime - mTimestep);
+ float forwardProgress = 1 - mRemainingTime / (mTotalTime - mTimestep);
+
forwardProgress = MIN (forwardProgress, 1);
forwardProgress = MAX (forwardProgress, 0);
- float x = forwardProgress;
- bool backwards = false;
- int animProgressDir = 1;
+ float x = forwardProgress;
+ bool backwards = false;
+ int animProgressDir = 1;
if (mCurWindowEvent == WindowEventUnminimize ||
mCurWindowEvent == WindowEventOpen)
animProgressDir = 2;
+
if (mOverrideProgressDir != 0)
animProgressDir = mOverrideProgressDir;
+
if ((animProgressDir == 1 &&
(mCurWindowEvent == WindowEventUnminimize ||
mCurWindowEvent == WindowEventOpen)) ||
@@ -180,15 +176,14 @@
(mCurWindowEvent == WindowEventMinimize ||
mCurWindowEvent == WindowEventClose)))
backwards = true;
+
if (backwards)
x = 1 - x;
- float dampBase = (pow (1-pow (x,1.2)*0.5,10)-pow (0.5,10))/(1-pow (0.5,10));
- float nonSpringyProgress =
- 1 - pow (progressDecelerateCustom (1 - x, .5f, .8f), 1.7f);
+ float dampBase = (pow (1 - pow (x, 1.2) * 0.5, 10) - pow (0.5, 10)) / (1 - pow (0.5, 10));
+ float nonSpringyProgress = 1 - pow (progressDecelerateCustom (1 - x, .5f, .8f), 1.7f);
- float damping =
- pow (dampBase, 0.5);
+ float damping = pow (dampBase, 0.5);
float damping2 =
((pow (1-(pow (x,0.7)*0.5),10)-pow (0.5,10))/(1-pow (0.5,10))) *
@@ -199,9 +194,7 @@
if ((mCurWindowEvent == WindowEventUnminimize ||
mCurWindowEvent == WindowEventOpen) &&
!neverSpringy)
- {
springiness = getSpringiness ();
- }
float springyMoveProgress =
cos (2*M_PI*pow (x,1)*1.25) * damping * damping2;
@@ -212,9 +205,7 @@
if (springiness > 1e-4f)
{
if (x > 0.2)
- {
springyMoveProgress *= springiness;
- }
else
{
// interpolate between (springyMoveProgress * springiness)
@@ -225,30 +216,33 @@
(1 - progressUpto02) * springyMoveProgress +
progressUpto02 * springyMoveProgress * springiness;
}
+
moveProgress = 1 - springyMoveProgress;
}
else
- {
moveProgress = nonSpringyProgress;
- }
+
if (mCurWindowEvent == WindowEventUnminimize ||
mCurWindowEvent == WindowEventOpen)
moveProgress = 1 - moveProgress;
+
if (backwards)
moveProgress = 1 - moveProgress;
float scProgress = nonSpringyProgress;
+
if (mCurWindowEvent == WindowEventUnminimize ||
mCurWindowEvent == WindowEventOpen)
scProgress = 1 - scProgress;
+
if (backwards)
scProgress = 1 - scProgress;
- scaleProgress =
- pow (scProgress, 1.25);
+ scaleProgress = pow (scProgress, 1.25);
if (pMoveProgress)
*pMoveProgress = moveProgress;
+
if (pScaleProgress)
*pScaleProgress = scaleProgress;
}
@@ -262,8 +256,10 @@
}
void
-ZoomAnim::getCenterScaleFull (Point *pCurCenter, Point *pCurScale,
- Point *pWinCenter, Point *pIconCenter,
+ZoomAnim::getCenterScaleFull (Point *pCurCenter,
+ Point *pCurScale,
+ Point *pWinCenter,
+ Point *pIconCenter,
float *pMoveProgress)
{
CompRect outRect (mAWindow->savedRectsValid () ?
@@ -296,12 +292,16 @@
// Copy calculated variables
if (pCurCenter)
*pCurCenter = curCenter;
+
if (pCurScale)
*pCurScale = curScale;
+
if (pWinCenter)
*pWinCenter = winCenter;
+
if (pIconCenter)
*pIconCenter = iconCenter;
+
if (pMoveProgress)
*pMoveProgress = moveProgress;
}
@@ -311,6 +311,7 @@
{
if (!zoomToIcon ())
return;
+
Point curCenter;
Point curScale;
Point winCenter;
@@ -337,6 +338,7 @@
{
mTransform.translate (winCenter.x (), winCenter.y (), 0);
float tx, ty;
+
if (shouldAvoidParallelogramLook ())
{
// avoid parallelogram look
@@ -351,6 +353,7 @@
tx = (curCenter.x () - winCenter.x ()) / curScale.x ();
ty = (curCenter.y () - winCenter.y ()) / curScale.y ();
}
+
mTransform.translate (tx, ty, 0);
applyExtraTransform (moveProgress);
mTransform.translate (-winCenter.x (), -winCenter.y (), 0);
@@ -372,7 +375,8 @@
}
void
-ZoomAnim::getCenterScale (Point *pCurCenter, Point *pCurScale)
+ZoomAnim::getCenterScale (Point *pCurCenter,
+ Point *pCurScale)
{
getCenterScaleFull (pCurCenter, pCurScale, NULL, NULL, NULL);
}
@@ -396,9 +400,7 @@
Point center;
if (zoomToIcon ())
- {
getCenterScale (¢er, 0);
- }
else
{
float forwardProgress = progressLinear ();
@@ -419,18 +421,16 @@
mDecorTopHeight));
}
else // i.e. (un)minimizing without zooming
- {
center.setY (inRect.y () + inRect.height () / 2.0);
- }
}
return center;
}
-GridZoomAnim::GridZoomAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+GridZoomAnim::GridZoomAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
GridTransformAnim::GridTransformAnim (w, curWindowEvent, duration, info,
@@ -448,4 +448,3 @@
mRemainingTime = mTotalTime;
}
}
-
=== modified file 'plugins/animationaddon/src/airplane.cpp'
--- plugins/animationaddon/src/airplane.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/airplane.cpp 2013-07-21 23:03:28 +0000
@@ -41,11 +41,11 @@
const float AirplaneAnim::kDurationFactor = 1.82;
-AirplaneAnim::AirplaneAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon) :
+AirplaneAnim::AirplaneAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, kDurationFactor * duration, info,
icon),
PolygonAnim::PolygonAnim (w, curWindowEvent, kDurationFactor * duration,
@@ -73,11 +73,12 @@
winLimitsH = BORDER_H (mWindow);
unsigned int numpol = 8;
+
if (mPolygons.size () != numpol)
{
freePolygonObjects ();
- for (unsigned int i = 0; i < numpol; i++)
+ for (unsigned int i = 0; i < numpol; ++i)
mPolygons.push_back (new AirplanePolygonObject);
}
@@ -143,86 +144,93 @@
switch (i)
{
- case 0:
- topLeftX = -H2;
- topLeftY = 0;
- bottomLeftX = -H2;
- bottomLeftY = H2;
- bottomRightX = -H3;
- bottomRightY = H2;
- topRightX = -H3;
- topRightY = H6;
- break;
- case 1:
- topLeftX = -H3;
- topLeftY = H6;
- bottomLeftX = -H3;
- bottomLeftY = H2;
- bottomRightX = 0;
- bottomRightY = H2;
- topRightX = 0;
- topRightY = H2;
- break;
- case 2:
- topLeftX = -H3;
- topLeftY = H6;
- bottomLeftX = 0;
- bottomLeftY = H2;
- bottomRightX = W - H2;
- bottomRightY = H2;
- topRightX = W - H2;
- topRightY = H6;
- break;
- case 3:
- topLeftX = -H2;
- topLeftY = 0;
- bottomLeftX = -H3;
- bottomLeftY = H6;
- bottomRightX = W - H2;
- bottomRightY = H6;
- topRightX = W - H2;
- topRightY = 0;
- break;
- case 4:
- topLeftX = -H3;
- topLeftY = -H6;
- bottomLeftX = -H2;
- bottomLeftY = 0;
- bottomRightX = W - H2;
- bottomRightY = 0;
- topRightX = W - H2;
- topRightY = -H6;
- break;
- case 5:
- topLeftX = 0;
- topLeftY = -H2;
- bottomLeftX = -H3;
- bottomLeftY = -H6;
- bottomRightX = W - H2;
- bottomRightY = -H6;
- topRightX = W - H2;
- topRightY = -H2;
- break;
- case 6:
- topLeftX = -H3;
- topLeftY = -H2;
- bottomLeftX = -H3;
- bottomLeftY = -H6;
- bottomRightX = -H3;
- bottomRightY = -H6;
- topRightX = 0;
- topRightY = -H2;
- break;
- default:
- topLeftX = -H2;
- topLeftY = -H2;
- bottomLeftX = -H2;
- bottomLeftY = 0;
- bottomRightX = -H3;
- bottomRightY = -H6;
- topRightX = -H3;
- topRightY = -H2;
- break;
+ case 0:
+ topLeftX = -H2;
+ topLeftY = 0;
+ bottomLeftX = -H2;
+ bottomLeftY = H2;
+ bottomRightX = -H3;
+ bottomRightY = H2;
+ topRightX = -H3;
+ topRightY = H6;
+ break;
+
+ case 1:
+ topLeftX = -H3;
+ topLeftY = H6;
+ bottomLeftX = -H3;
+ bottomLeftY = H2;
+ bottomRightX = 0;
+ bottomRightY = H2;
+ topRightX = 0;
+ topRightY = H2;
+ break;
+
+ case 2:
+ topLeftX = -H3;
+ topLeftY = H6;
+ bottomLeftX = 0;
+ bottomLeftY = H2;
+ bottomRightX = W - H2;
+ bottomRightY = H2;
+ topRightX = W - H2;
+ topRightY = H6;
+ break;
+
+ case 3:
+ topLeftX = -H2;
+ topLeftY = 0;
+ bottomLeftX = -H3;
+ bottomLeftY = H6;
+ bottomRightX = W - H2;
+ bottomRightY = H6;
+ topRightX = W - H2;
+ topRightY = 0;
+ break;
+
+ case 4:
+ topLeftX = -H3;
+ topLeftY = -H6;
+ bottomLeftX = -H2;
+ bottomLeftY = 0;
+ bottomRightX = W - H2;
+ bottomRightY = 0;
+ topRightX = W - H2;
+ topRightY = -H6;
+ break;
+
+ case 5:
+ topLeftX = 0;
+ topLeftY = -H2;
+ bottomLeftX = -H3;
+ bottomLeftY = -H6;
+ bottomRightX = W - H2;
+ bottomRightY = -H6;
+ topRightX = W - H2;
+ topRightY = -H2;
+ break;
+
+ case 6:
+ topLeftX = -H3;
+ topLeftY = -H2;
+ bottomLeftX = -H3;
+ bottomLeftY = -H6;
+ bottomRightX = -H3;
+ bottomRightY = -H6;
+ topRightX = 0;
+ topRightY = -H2;
+ break;
+
+ default:
+ topLeftX = -H2;
+ topLeftY = -H2;
+ bottomLeftX = -H2;
+ bottomLeftY = 0;
+ bottomRightX = -H3;
+ bottomRightY = -H6;
+ topRightX = -H3;
+ topRightY = -H2;
+ break;
}
// 4 front, 4 back vertices
@@ -273,6 +281,7 @@
// 16 indices for 4 sides (for quad strip)
p->sideIndices = (GLushort *) calloc (4 * 4, sizeof (GLushort));
+
if (!p->sideIndices)
{
compLogMessage ("animation", CompLogLevelError,
@@ -319,7 +328,7 @@
p->boundingBox.y2 = ceil (p->centerPos.y () + bottomLeftY);
}
- i++;
+ ++i;
}
return true;
}
@@ -416,7 +425,6 @@
p->rotAxisB.set (1.00, 0, 0);
p->finalRotAngB = -84;
-
break;
case 3:
@@ -435,7 +443,6 @@
p->rotAxisOffsetB.set (0, 0, 0);
p->rotAxisB.set (0, 0, 0);
p->finalRotAngB = 0;
-
break;
case 4:
@@ -454,7 +461,6 @@
p->rotAxisOffsetB.set (0, 0, 0);
p->rotAxisB.set (0, 0, 0);
p->finalRotAngB = 0;
-
break;
case 5:
@@ -471,7 +477,6 @@
p->rotAxisOffsetB.set (0, -H6, 0);
p->rotAxisB.set (1.00, 0, 0);
p->finalRotAngB = 84;
-
break;
case 6:
@@ -486,7 +491,6 @@
p->rotAxisOffsetB.set (0, -H6, 0);
p->rotAxisB.set (1.00, 0, 0);
p->finalRotAngB = 84;
-
break;
case 7:
@@ -505,7 +509,7 @@
break;
}
- i++;
+ ++i;
}
if (airplanePathLength >= 1)
@@ -557,30 +561,36 @@
// Phase1: folding: flaps, center, wings.
{
float moveProgress1 = forwardProgress - p->moveStartTime;
+
if (p->moveDuration > 0)
moveProgress1 /= p->moveDuration;
else
moveProgress1 = 0;
+
if (moveProgress1 < 0)
moveProgress1 = 0;
else if (moveProgress1 > 1)
moveProgress1 = 1;
float moveProgress2 = forwardProgress - p->moveStartTime2;
+
if (p->moveDuration2 > 0)
moveProgress2 /= p->moveDuration2;
else
moveProgress2 = 0;
+
if (moveProgress2 < 0)
moveProgress2 = 0;
else if (moveProgress2 > 1)
moveProgress2 = 1;
float moveProgress3 = forwardProgress - p->moveStartTime3;
+
if (p->moveDuration3 > 0)
moveProgress3 /= p->moveDuration3;
else
moveProgress3 = 0;
+
if (moveProgress3 < 0)
moveProgress3 = 0;
else if (moveProgress3 > 1)
@@ -599,16 +609,20 @@
// Phase2: rotate and fly
{
float moveProgress4 = forwardProgress - p->moveStartTime4;
+
if (p->moveDuration4 > 0)
moveProgress4 /= p->moveDuration4;
+
if (moveProgress4 < 0)
moveProgress4 = 0;
else if (moveProgress4 > 1)
moveProgress4 = 1;
float moveProgress5 = forwardProgress - (p->moveStartTime4 + .01);
+
if (p->moveDuration5 > 0)
moveProgress5 /= p->moveDuration5;
+
if (moveProgress5 < 0)
moveProgress5 = 0;
else if (moveProgress5 > 1)
@@ -630,13 +644,14 @@
if (((mCurWindowEvent == WindowEventMinimize ||
mCurWindowEvent == WindowEventUnminimize) &&
- airplaneFly2TaskBar) ||
+ airplaneFly2TaskBar) ||
mCurWindowEvent == WindowEventOpen ||
mCurWindowEvent == WindowEventClose)
{
// flying path ends at icon/pointer
int sign = 1;
+
if (mCurWindowEvent == WindowEventUnminimize ||
mCurWindowEvent == WindowEventOpen)
sign = -1;
@@ -661,6 +676,7 @@
else
p->centerPosFly.setY (
screen->height () * .4 * sin (p->flyTheta / 3.4));
+
if (p->centerPosStart.y () < screen->height () * .33)
p->centerPosFly.setY (p->centerPosFly.y () * -1);
}
@@ -672,14 +688,10 @@
if (mCurWindowEvent == WindowEventMinimize ||
mCurWindowEvent == WindowEventClose)
- {
p->flyFinalRotation.setZ (p->flyFinalRotation.z () * -1);
- }
else if (mCurWindowEvent == WindowEventUnminimize ||
mCurWindowEvent == WindowEventOpen)
- {
p->centerPosFly.setX (p->centerPosFly.x () * -1);
- }
p->flyRotation.setZ (p->flyFinalRotation.z ());
@@ -715,7 +727,6 @@
glTranslatef (-p->rotAxisOffsetA.x (), -p->rotAxisOffsetA.y (),
-p->rotAxisOffsetA.z ());
-
// Move by "rotation axis offset B"
glTranslatef (p->rotAxisOffsetB.x (), p->rotAxisOffsetB.y (),
p->rotAxisOffsetB.z ());
@@ -729,13 +740,12 @@
-p->rotAxisOffsetB.z ());
}
-
/* TODO: Damage a region, not the whole screen */
void
AirplaneAnim::updateBB (CompOutput &)
{
Box screenBox = {0, static_cast (screen->width ()), 0, static_cast (screen->height ()) };
-
+
mAWindow->expandBBWithBox (screenBox);
}
@@ -753,6 +763,7 @@
free (p->vertices);
p->vertices = NULL;
}
+
if (p->sideIndices)
{
free (p->sideIndices);
@@ -764,6 +775,6 @@
mPolygons.pop_back ();
}
-
+
mPolygons.clear ();
}
=== modified file 'plugins/animationaddon/src/animationaddon.cpp'
--- plugins/animationaddon/src/animationaddon.cpp 2013-05-09 13:43:07 +0000
+++ plugins/animationaddon/src/animationaddon.cpp 2013-07-21 23:03:28 +0000
@@ -105,11 +105,11 @@
return &animAddonExtPluginInfo;
}
-BaseAddonAnim::BaseAddonAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+BaseAddonAnim::BaseAddonAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
mIntenseTimeStep (AnimAddonScreen::get (::screen)->getIntenseTimeStep ()),
mCScreen (CompositeScreen::get (::screen)),
@@ -140,8 +140,8 @@
{
int i = 0;
AnimEffectUsedFor usedFor = AnimEffectUsedFor::all()
- .exclude(AnimEventFocus)
- .exclude(AnimEventShade);
+ .exclude(AnimEventFocus)
+ .exclude(AnimEventShade);
animEffects[i++] = AnimEffectAirplane =
new AnimEffectInfo ("animationaddon:Airplane", usedFor,
@@ -200,7 +200,7 @@
as->removeExtension (&animAddonExtPluginInfo);
- for (int i = 0; i < NUM_EFFECTS; i++)
+ for (int i = 0; i < NUM_EFFECTS; ++i)
{
delete animEffects[i];
animEffects[i] = NULL;
@@ -226,7 +226,7 @@
bool
AnimAddonScreen::setOption (const CompString &name,
- CompOption::Value &value)
+ CompOption::Value &value)
{
return priv->setOption (name, value);
}
@@ -248,16 +248,14 @@
// We need to interrupt and clean up the animation currently being played
// by animationaddon for this window (if any)
if (curAnim->remainingTime () > 0 &&
- curAnim->getExtensionPluginInfo ()->name ==
- CompString ("animationaddon"))
- {
+ curAnim->getExtensionPluginInfo ()->name == CompString ("animationaddon"))
aWindow->postAnimationCleanUp ();
- }
}
bool
AnimAddonPluginVTable::init ()
{
+<<<<<<< TREE
if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI) &&
@@ -270,6 +268,19 @@
}
return false;
+=======
+ CompPrivate p;
+ p.uval = ANIMATIONADDON_ABI;
+ ::screen->storeValue ("animationaddon_ABI", p);
+
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
+ CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
+ CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI) &&
+ CompPlugin::checkPluginABI ("animation", ANIMATION_ABI))
+ return true;
+
+ return false;
+>>>>>>> MERGE-SOURCE
}
void
=== modified file 'plugins/animationaddon/src/beamup.cpp'
--- plugins/animationaddon/src/beamup.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/beamup.cpp 2013-07-21 23:03:28 +0000
@@ -38,11 +38,11 @@
// ===================== Effect: Beam Up =========================
-BeamUpAnim::BeamUpAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon) :
+BeamUpAnim::BeamUpAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
ParticleAnim::ParticleAnim (w, curWindowEvent, duration, info, icon)
{
@@ -63,10 +63,10 @@
}
void
-BeamUpAnim::genNewBeam (int x,
- int y,
- int width,
- int height,
+BeamUpAnim::genNewBeam (int x,
+ int y,
+ int width,
+ int height,
float size,
float time)
{
@@ -96,7 +96,8 @@
maxNew = numParticles;
Particle *part = &ps.particles ()[0];
- for (unsigned i = 0; i < numParticles && maxNew > 0; i++, part++)
+
+ for (unsigned i = 0; i < numParticles && maxNew > 0; ++i, ++part)
{
if (part->life <= 0.0f)
{
@@ -140,9 +141,7 @@
maxNew -= 1;
}
else
- {
part->xg = (part->x < part->xo) ? 1.0 : -1.0;
- }
}
}
@@ -156,13 +155,14 @@
float timestep = mIntenseTimeStep;
mRemainingTime -= timestep;
+
if (mRemainingTime <= 0)
mRemainingTime = 0; // avoid sub-zero values
float newProgress = 1 - mRemainingTime / (mTotalTime - timestep);
- bool creating = (mCurWindowEvent == WindowEventOpen ||
- mCurWindowEvent == WindowEventUnminimize ||
+ bool creating = (mCurWindowEvent == WindowEventOpen ||
+ mCurWindowEvent == WindowEventUnminimize ||
mCurWindowEvent == WindowEventUnshade);
if (creating)
@@ -180,21 +180,20 @@
mDrawRegion = CompRegion (rect);
}
else
- {
mDrawRegion = emptyRegion;
- }
mUseDrawRegion = (fabs (newProgress) > 1e-5);
if (mRemainingTime > 0)
{
genNewBeam (outRect.x (), outRect.y () + (outRect.height () / 2),
- outRect.width (),
- creating ? (1 - newProgress / 2) * outRect.height ()
- : (1 - newProgress) * outRect.height (),
+ outRect.width (),
+ creating ? (1 - newProgress / 2) * outRect.height ()
+ : (1 - newProgress) * outRect.height (),
outRect.width () / 40.0,
mTimeSinceLastPaint);
}
+
if (mRemainingTime <= 0 && mParticleSystems[0].active ())
// force animation to continue until particle systems are done
mRemainingTime = 0.001f;
@@ -205,9 +204,10 @@
int nParticles = particles.size ();
Particle *part = &particles[0];
- for (int i = 0; i < nParticles; i++, part++)
+ for (int i = 0; i < nParticles; ++i, ++part)
part->xg = (part->x < part->xo) ? 1.0 : -1.0;
}
+
mParticleSystems[0].setOrigin (outRect.x (), outRect.y ());
}
@@ -215,9 +215,10 @@
BeamUpAnim::updateAttrib (GLWindowPaintAttrib &attrib)
{
float forwardProgress = 0;
+
if (mTotalTime - mIntenseTimeStep != 0)
- forwardProgress =
- 1 - (mRemainingTime) / (mTotalTime - mIntenseTimeStep);
+ forwardProgress = 1 - (mRemainingTime) / (mTotalTime - mIntenseTimeStep);
+
forwardProgress = MIN(forwardProgress, 1);
forwardProgress = MAX(forwardProgress, 0);
//float forwardProgress = progressLinear ();
=== modified file 'plugins/animationaddon/src/burn.cpp'
--- plugins/animationaddon/src/burn.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/burn.cpp 2013-07-21 23:03:28 +0000
@@ -38,18 +38,18 @@
// ===================== Effect: Burn =========================
-BurnAnim::BurnAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon) :
+BurnAnim::BurnAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
ParticleAnim::ParticleAnim (w, curWindowEvent, duration, info, icon)
{
mDirection =
- getActualAnimDirection ((AnimDirection) optValI
- (AnimationaddonOptions::FireDirection),
- false);
+ getActualAnimDirection ((AnimDirection) optValI
+ (AnimationaddonOptions::FireDirection),
+ false);
if (optValB (AnimationaddonOptions::FireConstantSpeed))
{
@@ -79,12 +79,12 @@
}
void
-BurnAnim::genNewFire (int x,
- int y,
- int width,
- int height,
- float size,
- float time)
+BurnAnim::genNewFire (int x,
+ int y,
+ int width,
+ int height,
+ float size,
+ float time)
{
ParticleSystem &ps = mParticleSystems[mFirePSId];
@@ -111,7 +111,7 @@
max_new = numParticles / 5;
Particle *part = &ps.particles ()[0];
- for (unsigned i = 0; i < numParticles && max_new > 0; i++, part++)
+ for (unsigned i = 0; i < numParticles && max_new > 0; ++i, ++part)
{
if (part->life <= 0.0f)
{
@@ -172,18 +172,16 @@
max_new -= 1;
}
else
- {
part->xg = (part->x < part->xo) ? 1.0 : -1.0;
- }
}
}
void
-BurnAnim::genNewSmoke (int x,
- int y,
- int width,
- int height,
+BurnAnim::genNewSmoke (int x,
+ int y,
+ int width,
+ int height,
float size,
float time)
{
@@ -205,7 +203,8 @@
max_new = numParticles;
Particle *part = &ps.particles ()[0];
- for (unsigned i = 0; i < numParticles && max_new > 0; i++, part++)
+
+ for (unsigned i = 0; i < numParticles && max_new > 0; ++i, ++part)
{
if (part->life <= 0.0f)
{
@@ -254,9 +253,7 @@
max_new -= 1;
}
else
- {
part->xg = (part->x < part->xo) ? size : sizeNeg;
- }
}
}
@@ -272,18 +269,17 @@
float stepSize;
mRemainingTime -= timestep;
+
if (mRemainingTime <= 0)
mRemainingTime = 0; // avoid sub-zero values
float newProgress = 1 - (mRemainingTime) / (mTotalTime - timestep);
stepSize = newProgress - old;
- if (mCurWindowEvent == WindowEventOpen ||
- mCurWindowEvent == WindowEventUnminimize ||
+ if (mCurWindowEvent == WindowEventOpen ||
+ mCurWindowEvent == WindowEventUnminimize ||
mCurWindowEvent == WindowEventUnshade)
- {
newProgress = 1 - newProgress;
- }
if (mRemainingTime > 0)
{
@@ -291,33 +287,37 @@
switch (mDirection)
{
- case AnimDirectionUp:
- rect = CompRect (0, 0,
- outRect.width (),
- outRect.height () -
- (newProgress * outRect.height ()));
- break;
- case AnimDirectionRight:
- rect = CompRect (newProgress * outRect.width (),
- 0,
- outRect.width () -
- (newProgress * outRect.width ()),
- outRect.height ());
- break;
- case AnimDirectionLeft:
- rect = CompRect (0, 0,
- outRect.width () -
- (newProgress * outRect.width ()),
- outRect.height ());
- break;
- case AnimDirectionDown:
- default:
- rect = CompRect (0,
- newProgress * outRect.height (),
- outRect.width (),
- outRect.height () -
- (newProgress * outRect.height ()));
- break;
+ case AnimDirectionUp:
+ rect = CompRect (0, 0,
+ outRect.width (),
+ outRect.height () -
+ (newProgress * outRect.height ()));
+ break;
+
+ case AnimDirectionRight:
+ rect = CompRect (newProgress * outRect.width (),
+ 0,
+ outRect.width () -
+ (newProgress * outRect.width ()),
+ outRect.height ());
+ break;
+
+ case AnimDirectionLeft:
+ rect = CompRect (0, 0,
+ outRect.width () -
+ (newProgress * outRect.width ()),
+ outRect.height ());
+ break;
+
+ case AnimDirectionDown:
+ default:
+ rect = CompRect (0,
+ newProgress * outRect.height (),
+ outRect.width (),
+ outRect.height () -
+ (newProgress * outRect.height ()));
+ break;
+
}
rect.setX (rect.x () + outRect.x ());
rect.setY (rect.y () + outRect.y ());
@@ -325,70 +325,72 @@
mDrawRegion = CompRegion (rect);
}
else
- {
mDrawRegion = emptyRegion;
- }
+
mUseDrawRegion = (fabs (newProgress) > 1e-5);
if (mRemainingTime > 0)
{
switch (mDirection)
{
- case AnimDirectionUp:
- if (mHasSmoke)
- genNewSmoke (outRect.x (),
- outRect.y () + ((1 - newProgress) * outRect.height ()),
- outRect.width (), 1, outRect.width () / 40.0,
- mTimeSinceLastPaint);
- genNewFire (outRect.x (),
- outRect.y () + ((1 - newProgress) * outRect.height ()),
- outRect.width (), (stepSize) * outRect.height (),
- outRect.width () / 40.0,
- mTimeSinceLastPaint);
- break;
- case AnimDirectionLeft:
- if (mHasSmoke)
- genNewSmoke (outRect.x () + ((1 - newProgress) * outRect.width ()),
- outRect.y (),
- (stepSize) * outRect.width (),
- outRect.height (), outRect.height () / 40.0,
- mTimeSinceLastPaint);
- genNewFire (outRect.x () + ((1 - newProgress) * outRect.width ()),
- outRect.y (), (stepSize) * outRect.width (),
- outRect.height (), outRect.height () / 40.0,
- mTimeSinceLastPaint);
- break;
- case AnimDirectionRight:
- if (mHasSmoke)
- genNewSmoke (outRect.x () + (newProgress * outRect.width ()),
- outRect.y (),
- (stepSize) * outRect.width (),
- outRect.height (), outRect.height () / 40.0,
- mTimeSinceLastPaint);
- genNewFire (outRect.x () + (newProgress * outRect.width ()),
- outRect.y (), (stepSize) * outRect.width (),
- outRect.height (), outRect.height () / 40.0,
- mTimeSinceLastPaint);
- break;
- case AnimDirectionDown:
- default:
- if (mHasSmoke)
- genNewSmoke (outRect.x (),
- outRect.y () + (newProgress * outRect.height ()),
- outRect.width (), 1, outRect.width () / 40.0,
- mTimeSinceLastPaint);
- genNewFire (outRect.x (),
- outRect.y () + (newProgress * outRect.height ()),
- outRect.width (), (stepSize) * outRect.height (),
- outRect.width () / 40.0,
- mTimeSinceLastPaint);
- break;
+ case AnimDirectionUp:
+ if (mHasSmoke)
+ genNewSmoke (outRect.x (),
+ outRect.y () + ((1 - newProgress) * outRect.height ()),
+ outRect.width (), 1, outRect.width () / 40.0,
+ mTimeSinceLastPaint);
+ genNewFire (outRect.x (),
+ outRect.y () + ((1 - newProgress) * outRect.height ()),
+ outRect.width (), (stepSize) * outRect.height (),
+ outRect.width () / 40.0,
+ mTimeSinceLastPaint);
+ break;
+
+ case AnimDirectionLeft:
+ if (mHasSmoke)
+ genNewSmoke (outRect.x () + ((1 - newProgress) * outRect.width ()),
+ outRect.y (),
+ (stepSize) * outRect.width (),
+ outRect.height (), outRect.height () / 40.0,
+ mTimeSinceLastPaint);
+ genNewFire (outRect.x () + ((1 - newProgress) * outRect.width ()),
+ outRect.y (), (stepSize) * outRect.width (),
+ outRect.height (), outRect.height () / 40.0,
+ mTimeSinceLastPaint);
+ break;
+
+ case AnimDirectionRight:
+ if (mHasSmoke)
+ genNewSmoke (outRect.x () + (newProgress * outRect.width ()),
+ outRect.y (),
+ (stepSize) * outRect.width (),
+ outRect.height (), outRect.height () / 40.0,
+ mTimeSinceLastPaint);
+ genNewFire (outRect.x () + (newProgress * outRect.width ()),
+ outRect.y (), (stepSize) * outRect.width (),
+ outRect.height (), outRect.height () / 40.0,
+ mTimeSinceLastPaint);
+ break;
+
+ case AnimDirectionDown:
+ default:
+ if (mHasSmoke)
+ genNewSmoke (outRect.x (),
+ outRect.y () + (newProgress * outRect.height ()),
+ outRect.width (), 1, outRect.width () / 40.0,
+ mTimeSinceLastPaint);
+ genNewFire (outRect.x (),
+ outRect.y () + (newProgress * outRect.height ()),
+ outRect.width (), (stepSize) * outRect.height (),
+ outRect.width () / 40.0,
+ mTimeSinceLastPaint);
+ break;
+
}
-
}
+
if (mRemainingTime <= 0 &&
- (mParticleSystems[0].active () ||
- (mHasSmoke && mParticleSystems[1].active ())))
+ (mParticleSystems[0].active () || (mHasSmoke && mParticleSystems[1].active ())))
// force animation to continue until particle systems are done
mRemainingTime = timestep;
@@ -397,6 +399,7 @@
if (mRemainingTime > 0)
{
int nParticles;
+
if (mHasSmoke)
{
float partxg = outRect.width () / 40.0;
@@ -406,7 +409,7 @@
nParticles = particles.size ();
part = &particles[0];
- for (int i = 0; i < nParticles; i++, part++)
+ for (int i = 0; i < nParticles; ++i, ++part)
part->xg = (part->x < part->xo) ? partxg : partxgNeg;
mParticleSystems[mSmokePSId].setOrigin (outRect.x (), outRect.y ());
@@ -416,9 +419,9 @@
nParticles = particles.size ();
part = &particles[0];
- for (int i = 0; i < nParticles; i++, part++)
+ for (int i = 0; i < nParticles; ++i, ++part)
part->xg = (part->x < part->xo) ? 1.0 : -1.0;
}
+
mParticleSystems[mFirePSId].setOrigin (outRect.x (), outRect.y ());
}
-
=== modified file 'plugins/animationaddon/src/dissolve.cpp'
--- plugins/animationaddon/src/dissolve.cpp 2010-08-23 03:24:20 +0000
+++ plugins/animationaddon/src/dissolve.cpp 2013-07-21 23:03:28 +0000
@@ -16,11 +16,11 @@
#include "private.h"
-DissolveSingleAnim::DissolveSingleAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+DissolveSingleAnim::DissolveSingleAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, duration, info, icon),
TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon)
{
@@ -40,20 +40,25 @@
DissolveSingleAnim::updateTransform (GLMatrix &transform)
{
int layer = MultiAnim ::getCurrAnimNumber (mAWindow);
-
- switch (layer) {
+
+ switch (layer)
+ {
case 1:
transform.translate (3.*getDissolveSingleProgress (), 0.f, 0.f);
break;
+
case 2:
transform.translate (-3.*getDissolveSingleProgress (), 0.f, 0.f);
break;
+
case 3:
transform.translate (0.f, 3.*getDissolveSingleProgress (), 0.f);
break;
+
case 4:
transform.translate (0.f, -3.*getDissolveSingleProgress (), 0.f);
break;
+
default:
break;
}
=== modified file 'plugins/animationaddon/src/domino.cpp'
--- plugins/animationaddon/src/domino.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/domino.cpp 2013-07-21 23:03:28 +0000
@@ -40,11 +40,11 @@
const float DominoAnim::kDurationFactor = 1.25;
-DominoAnim::DominoAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon) :
+DominoAnim::DominoAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, kDurationFactor * duration, info,
icon),
PolygonAnim::PolygonAnim (w, curWindowEvent, kDurationFactor * duration,
@@ -55,11 +55,11 @@
mCorrectPerspective = CorrectPerspectivePolygon;
}
-RazrAnim::RazrAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+RazrAnim::RazrAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, kDurationFactor * duration, info,
icon),
DominoAnim::DominoAnim (w, curWindowEvent, duration, info, icon)
@@ -82,7 +82,7 @@
true);
int defaultGridSize = 20;
- float minCellSize = 30;
+ float minCellSize = 30.0f;
int gridSizeX;
int gridSizeY;
int fallDirGridSize;
@@ -107,10 +107,13 @@
gridSizeX = (int)(outRect.width () / minCellSize);
else
gridSizeX = defaultGridSize;
+
gridCellW = outRect.width () / gridSizeX;
gridSizeY = (int)(outRect.height () / (gridCellW * cellAspectRatio));
+
if (gridSizeY == 0)
gridSizeY = 1;
+
gridCellH = outRect.height () / gridSizeY;
fallDirGridSize = gridSizeY;
}
@@ -118,17 +121,22 @@
{
if (minCellSize > outRect.height ())
minCellSize = outRect.height ();
+
if (outRect.height () / defaultGridSize < minCellSize)
gridSizeY = (int)(outRect.height () / minCellSize);
else
gridSizeY = defaultGridSize;
+
gridCellH = outRect.height () / gridSizeY;
gridSizeX = (int)(outRect.width () / (gridCellH * cellAspectRatio));
+
if (gridSizeX == 0)
gridSizeX = 1;
+
gridCellW = outRect.width () / gridSizeX;
fallDirGridSize = gridSizeX;
}
+
minDistStartEdge = (1.0 / fallDirGridSize) / 2;
float thickness = MIN (gridCellW, gridCellH) / 3.5;
@@ -150,6 +158,7 @@
{
case AnimDirectionDown:
rotAxisX = -1;
+
if (isRazr)
rotAxisOff.setY (-gridCellHalfH);
else
@@ -157,9 +166,12 @@
posY = -(gridCellHalfH + thickness);
posZ = gridCellHalfH - thickness / 2;
}
+
break;
+
case AnimDirectionLeft:
rotAxisY = -1;
+
if (isRazr)
rotAxisOff.setX (gridCellHalfW);
else
@@ -167,10 +179,13 @@
posX = gridCellHalfW + thickness;
posZ = gridCellHalfW - thickness / 2;
}
+
nFallingColumns = gridSizeY;
break;
+
case AnimDirectionUp:
rotAxisX = 1;
+
if (isRazr)
rotAxisOff.setY (gridCellHalfH);
else
@@ -178,9 +193,12 @@
posY = gridCellHalfH + thickness;
posZ = gridCellHalfH - thickness / 2;
}
+
break;
+
case AnimDirectionRight:
rotAxisY = 1;
+
if (isRazr)
rotAxisOff.setX (-gridCellHalfW);
else
@@ -188,6 +206,7 @@
posX = -(gridCellHalfW + thickness);
posZ = gridCellHalfW - thickness / 2;
}
+
nFallingColumns = gridSizeY;
break;
}
@@ -209,7 +228,7 @@
float riseTimeRandSeed[nFallingColumns];
- for (int i = 0; i < nFallingColumns; i++)
+ for (int i = 0; i < nFallingColumns; ++i)
riseTimeRandSeed[i] = RAND_FLOAT ();
foreach (PolygonObject *p, mPolygons)
@@ -231,30 +250,36 @@
distStartEdge = p->centerRelPos.y ();
distPerpEdge = p->centerRelPos.x ();
break;
+
case AnimDirectionRight:
distStartEdge = 1 - p->centerRelPos.x ();
distPerpEdge = p->centerRelPos.y ();
break;
+
case AnimDirectionDown:
distStartEdge = 1 - p->centerRelPos.y ();
distPerpEdge = p->centerRelPos.x ();
break;
+
case AnimDirectionLeft:
distStartEdge = p->centerRelPos.x ();
distPerpEdge = p->centerRelPos.y ();
break;
+
+ default:
+ break;
}
- float riseTimeRand =
- riseTimeRandSeed[(int)(distPerpEdge * nFallingColumns)] *
- riseTimeRandMax;
+ float riseTimeRand = riseTimeRandSeed[(int)(distPerpEdge * nFallingColumns)] *
+ riseTimeRandMax;
p->moveDuration = riseDuration;
float mult = 1;
+
if (fallDirGridSize > 1)
- mult = ((distStartEdge - minDistStartEdge) /
- (1 - 2 * minDistStartEdge));
+ mult = ((distStartEdge - minDistStartEdge) / (1 - 2 * minDistStartEdge));
+
if (isRazr)
{
p->moveStartTime = mult *
@@ -274,8 +299,10 @@
p->moveStartTime + riseDuration - riseTimeRand + 0.03;
p->finalRotAng = -90;
}
+
if (p->fadeStartTime > 1 - fadeDuration)
p->fadeStartTime = 1 - fadeDuration;
+
p->fadeDuration = fadeDuration;
}
}
=== modified file 'plugins/animationaddon/src/explode.cpp'
--- plugins/animationaddon/src/explode.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/explode.cpp 2013-07-21 23:03:28 +0000
@@ -40,11 +40,11 @@
const float ExplodeAnim::kDurationFactor = 1.43;
-ExplodeAnim::ExplodeAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon) :
+ExplodeAnim::ExplodeAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, kDurationFactor * duration, info,
icon),
PolygonAnim::PolygonAnim (w, curWindowEvent, kDurationFactor * duration,
@@ -62,26 +62,29 @@
{
switch (optValI (AnimationaddonOptions::ExplodeTessellation))
{
- case AnimationaddonOptions::ExplodeTessellationRectangular:
- if (!tessellateIntoRectangles (optValI (AnimationaddonOptions::ExplodeGridx),
- optValI (AnimationaddonOptions::ExplodeGridy),
- optValF (AnimationaddonOptions::ExplodeThickness)))
- return;
- break;
- case AnimationaddonOptions::ExplodeTessellationHexagonal:
- if (!tessellateIntoHexagons (optValI (AnimationaddonOptions::ExplodeGridx),
- optValI (AnimationaddonOptions::ExplodeGridy),
- optValF (AnimationaddonOptions::ExplodeThickness)))
- return;
- break;
- case AnimationaddonOptions::ExplodeTessellationGlass:
- if (!tessellateIntoGlass (optValI (AnimationaddonOptions::ExplodeSpokes),
- optValI (AnimationaddonOptions::ExplodeTiers),
- optValF (AnimationaddonOptions::ExplodeThickness)))
- return;
- break;
- default:
- return;
+ case AnimationaddonOptions::ExplodeTessellationRectangular:
+ if (!tessellateIntoRectangles (optValI (AnimationaddonOptions::ExplodeGridx),
+ optValI (AnimationaddonOptions::ExplodeGridy),
+ optValF (AnimationaddonOptions::ExplodeThickness)))
+ return;
+ break;
+
+ case AnimationaddonOptions::ExplodeTessellationHexagonal:
+ if (!tessellateIntoHexagons (optValI (AnimationaddonOptions::ExplodeGridx),
+ optValI (AnimationaddonOptions::ExplodeGridy),
+ optValF (AnimationaddonOptions::ExplodeThickness)))
+ return;
+ break;
+
+ case AnimationaddonOptions::ExplodeTessellationGlass:
+ if (!tessellateIntoGlass (optValI (AnimationaddonOptions::ExplodeSpokes),
+ optValI (AnimationaddonOptions::ExplodeTiers),
+ optValF (AnimationaddonOptions::ExplodeThickness)))
+ return;
+ break;
+
+ default:
+ return;
}
double sqrt2 = sqrt (2);
@@ -103,9 +106,8 @@
float moveMult = 1 - distToCenter;
moveMult = moveMult < 0 ? 0 : moveMult;
float zbias = 0.1;
- float z = speed * 10 *
- (zbias + RAND_FLOAT () *
- pow (moveMult, 0.5));
+ float z = speed * 10 * (zbias + RAND_FLOAT () *
+ pow (moveMult, 0.5));
p->finalRelPos.set (x, y, z);
p->finalRotAng = RAND_FLOAT () * 540 - 270;
=== modified file 'plugins/animationaddon/src/fold.cpp'
--- plugins/animationaddon/src/fold.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/fold.cpp 2013-07-21 23:03:28 +0000
@@ -35,11 +35,11 @@
const float FoldAnim::kDurationFactor = 1.82;
-FoldAnim::FoldAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
+FoldAnim::FoldAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
const AnimEffect info,
- const CompRect &icon) :
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, kDurationFactor * duration, info,
icon),
PolygonAnim::PolygonAnim (w, curWindowEvent, kDurationFactor * duration,
@@ -112,7 +112,7 @@
p->fadeStartTime = start + fduration;
p->fadeDuration = fduration;
- j++;
+ ++j;
}
else
{
@@ -145,7 +145,7 @@
p->moveStartTime = start;
p->moveDuration = duration;
- i++;
+ ++i;
}
mDoDepthTest = true;
mDoLighting = true;
@@ -156,7 +156,7 @@
void
FoldAnim::stepPolygon (PolygonObject *p,
- float forwardProgress)
+ float forwardProgress)
{
int dir = optValI (AnimationaddonOptions::FoldDir) == 0 ? 1 : -1;
@@ -250,4 +250,3 @@
const_x / 2.0f));
}
}
-
=== modified file 'plugins/animationaddon/src/glide3.cpp'
--- plugins/animationaddon/src/glide3.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/glide3.cpp 2013-07-21 23:03:28 +0000
@@ -40,17 +40,16 @@
const float Glide3Anim::kDurationFactor = 1.82;
-Glide3Anim::Glide3Anim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon) :
+Glide3Anim::Glide3Anim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
Animation::Animation (w, curWindowEvent, kDurationFactor * duration, info,
icon),
PolygonAnim::PolygonAnim (w, curWindowEvent, kDurationFactor * duration,
- info, icon)
+ info, icon)
{
-
}
void
@@ -72,11 +71,12 @@
foreach (PolygonObject *p, mPolygons)
{
- p->rotAxis.set (1, 0, 0);
- p->finalRelPos.set (0, 0, finalDistFac * 0.8 * DEFAULT_Z_CAMERA * screen->width ());
+ p->rotAxis.set (1, 0, 0);
+ p->finalRelPos.set (0, 0, finalDistFac * 0.8 * DEFAULT_Z_CAMERA * screen->width ());
p->finalRotAng = finalRotAng;
}
+
mAllFadeDuration = 1.0f;
mBackAndSidesFadeDur = 0.2f;
mDoLighting = true;
=== modified file 'plugins/animationaddon/src/leafspread.cpp'
--- plugins/animationaddon/src/leafspread.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/leafspread.cpp 2013-07-21 23:03:28 +0000
@@ -66,12 +66,12 @@
mWindow->outputRect ());
float fadeDuration = 0.26;
- float life = 0.4;
- float spreadFac = 3.5;
- float randYMax = 0.07;
- float winFacX = outRect.width () / 800.0;
- float winFacY = outRect.height () / 800.0;
- float winFacZ = (outRect.height () + outRect.width ()) / 2.0 / 800.0;
+ float life = 0.4;
+ float spreadFac = 3.5;
+ float randYMax = 0.07;
+ float winFacX = outRect.width () / 800.0;
+ float winFacY = outRect.height () / 800.0;
+ float winFacZ = (outRect.height () + outRect.width ()) / 2.0 / 800.0;
float screenSizeFactor = (0.8 * DEFAULT_Z_CAMERA * ::screen->width ());
@@ -84,22 +84,21 @@
float xx = 2 * (p->centerRelPos.x () - 0.5);
float yy = 2 * (p->centerRelPos.y () - 0.5);
- float x = speed * winFacX * spreadFac * (xx +
- 0.5 * (RAND_FLOAT () - 0.5));
- float y = speed * winFacY * spreadFac * (yy +
- 0.5 * (RAND_FLOAT () - 0.5));
+ float x = speed * winFacX * spreadFac * (xx + 0.5 * (RAND_FLOAT () - 0.5));
+ float y = speed * winFacY * spreadFac * (yy + 0.5 * (RAND_FLOAT () - 0.5));
float z = speed * winFacZ * 7 * ((RAND_FLOAT () - 0.5) / 0.5);
p->finalRelPos.set (x, y, z);
- p->moveStartTime =
- p->centerRelPos.y () * (1 - fadeDuration - randYMax) +
- randYMax * RAND_FLOAT ();
+ p->moveStartTime = p->centerRelPos.y () * (1 - fadeDuration - randYMax) +
+ randYMax * RAND_FLOAT ();
p->moveDuration = 1;
p->fadeStartTime = p->moveStartTime + life;
+
if (p->fadeStartTime > 1 - fadeDuration)
p->fadeStartTime = 1 - fadeDuration;
+
p->fadeDuration = fadeDuration;
p->finalRotAng = 150;
=== modified file 'plugins/animationaddon/src/particle.cpp'
--- plugins/animationaddon/src/particle.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/particle.cpp 2013-07-21 23:03:28 +0000
@@ -50,9 +50,9 @@
}
ParticleSystem::ParticleSystem (int numParticles,
- float slowDown,
- float darkenAmount,
- GLuint blendMode) :
+ float slowDown,
+ float darkenAmount,
+ GLuint blendMode) :
mParticles (numParticles),
mSlowDown (slowDown),
mDarkenAmount (darkenAmount),
@@ -81,7 +81,8 @@
}
void
-ParticleSystem::draw (int offsetX, int offsetY)
+ParticleSystem::draw (int offsetX,
+ int offsetY)
{
// TODO
// The part below should ideally be done in ParticleSystem constructor
@@ -99,17 +100,23 @@
glPushMatrix ();
glTranslated (offsetX - mX, offsetY - mY, 0);
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
if (mTex)
{
glBindTexture (GL_TEXTURE_2D, mTex);
glEnable (GL_TEXTURE_2D);
}
+
mGScreen->setTexEnvMode (GL_MODULATE);
mVerticesCache.resize (4 * 3 * mParticles.size ());
mCoordsCache.resize (4 * 2 * mParticles.size ());
mColorsCache.resize (4 * 4 * mParticles.size ());
+
if (mDarkenAmount > 0)
mDColorsCache.resize (4 * 4 * mParticles.size ());
@@ -310,10 +317,10 @@
}
void
-ParticleAnim::initLightDarkParticles (int numLightParticles,
- int numDarkParticles,
- float lightSlowDown,
- float darkSlowDown)
+ParticleAnim::initLightDarkParticles (int numLightParticles,
+ int numDarkParticles,
+ float lightSlowDown,
+ float darkSlowDown)
{
if (numLightParticles > 0)
mParticleSystems.push_back (new ParticleSystem (numLightParticles,
@@ -326,4 +333,3 @@
0.5f,
GL_ONE));
}
-
=== modified file 'plugins/animationaddon/src/polygon.cpp'
--- plugins/animationaddon/src/polygon.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/polygon.cpp 2013-07-21 23:03:28 +0000
@@ -89,11 +89,14 @@
{
if (p->vertices)
free (p->vertices);
+
if (p->sideIndices)
free (p->sideIndices);
+
if (p->normals)
free (p->normals);
}
+
if (p->effectParameters)
delete p->effectParameters;
@@ -122,9 +125,9 @@
// Tessellates window into extruded rectangular objects
bool
-PolygonAnim::tessellateIntoRectangles (int gridSizeX,
- int gridSizeY,
- float thickness)
+PolygonAnim::tessellateIntoRectangles (int gridSizeX,
+ int gridSizeY,
+ float thickness)
{
// boundaries of polygon tessellation
int winLimitsX;
@@ -153,19 +156,22 @@
winLimitsW = inRect.width ();
winLimitsH = inRect.height ();
}
+
float minRectSize = MIN_WINDOW_GRID_SIZE;
float rectW = winLimitsW / (float)gridSizeX;
float rectH = winLimitsH / (float)gridSizeY;
if (rectW < minRectSize)
gridSizeX = winLimitsW / minRectSize; // int div.
+
if (rectH < minRectSize)
gridSizeY = winLimitsH / minRectSize; // int div.
freePolygonObjects ();
mPolygons.clear ();
- for (int i = 0; i < gridSizeX * gridSizeY; i++)
+
+ for (int i = 0; i < gridSizeX * gridSizeY; ++i)
{
mPolygons.push_back (new PolygonObject);
}
@@ -182,11 +188,11 @@
float halfThick = mThickness / 2;
vector::iterator it = mPolygons.begin ();
- for (int y = 0; y < gridSizeY; y++)
+ for (int y = 0; y < gridSizeY; ++y)
{
float posY = winLimitsY + cellH * (y + 0.5);
- for (int x = 0; x < gridSizeX; x++, it++)
+ for (int x = 0; x < gridSizeX; x++, ++it)
{
PolygonObject *p = *it;
p->centerPos.set (winLimitsX + cellW * (x + 0.5), posY, -halfThick);
@@ -202,6 +208,7 @@
// 4 front, 4 back vertices
p->vertices = (GLfloat *)calloc (8 * 3, sizeof (GLfloat));
+
if (!p->vertices)
{
compLogMessage ("animationaddon", CompLogLevelError,
@@ -212,6 +219,7 @@
// Vertex normals
p->normals = (GLfloat *)calloc (8 * 3, sizeof (GLfloat));
+
if (!p->normals)
{
compLogMessage ("animationaddon", CompLogLevelError,
@@ -258,6 +266,7 @@
// 16 indices for 4 sides (for quads)
p->sideIndices = (GLushort *)calloc (4 * 4, sizeof (GLushort));
+
if (!p->sideIndices)
{
compLogMessage ("animationaddon", CompLogLevelError,
@@ -339,8 +348,8 @@
// Tessellates window into extruded hexagon objects
bool
-PolygonAnim::tessellateIntoHexagons (int gridSizeX,
- int gridSizeY,
+PolygonAnim::tessellateIntoHexagons (int gridSizeX,
+ int gridSizeY,
float thickness)
{
// boundaries of polygon tessellation
@@ -370,6 +379,7 @@
winLimitsW = inRect.width ();
winLimitsH = inRect.height ();
}
+
float minSize = 20;
float hexW = winLimitsW / (float)gridSizeX;
float hexH = winLimitsH / (float)gridSizeY;
@@ -380,7 +390,8 @@
gridSizeY = winLimitsH / minSize; // int div.
freePolygonObjects ();
- for (int i = 0; i < (gridSizeY + 1) * gridSizeX + ((gridSizeY + 1 ) / 2); i++)
+
+ for (int i = 0; i < (gridSizeY + 1) * gridSizeX + ((gridSizeY + 1 ) / 2); ++i)
mPolygons.push_back (new PolygonObject);
thickness /= ::screen->width ();
@@ -396,7 +407,7 @@
float halfThick = mThickness / 2;
vector::iterator it = mPolygons.begin ();
- for (int y = 0; y < gridSizeY+1; y++)
+ for (int y = 0; y < gridSizeY+1; ++y)
{
float posY = winLimitsY + cellH * (y);
int numPolysinRow = (y%2==0) ? gridSizeX : (gridSizeX + 1);
@@ -424,7 +435,7 @@
bottomY = twoThirdsH;
}
- for (int x = 0; x < numPolysinRow; x++, it++)
+ for (int x = 0; x < numPolysinRow; ++x, ++it)
{
PolygonObject *p = *it;
// Clip odd rows when necessary
@@ -470,6 +481,7 @@
// 6 front, 6 back vertices
p->vertices = (GLfloat *)calloc (6 * 2 * 3, sizeof (GLfloat));
+
if (!p->vertices)
{
compLogMessage ("animationaddon", CompLogLevelError,
@@ -480,6 +492,7 @@
// Vertex normals
p->normals = (GLfloat *)calloc (6 * 2 * 3, sizeof (GLfloat));
+
if (!p->normals)
{
compLogMessage ("animationaddon", CompLogLevelError,
@@ -543,6 +556,7 @@
// 24 indices per 6 sides (for quads)
p->sideIndices = (GLushort *)calloc (4 * 6, sizeof (GLushort));
+
if (!p->sideIndices)
{
compLogMessage ("animationaddon", CompLogLevelError,
@@ -566,6 +580,7 @@
nor[11 * 3 + 0] = -1; // Flat shading only uses 1st vertex's normal
nor[11 * 3 + 1] = -1; // in a polygon, vertex 11 for this face.
nor[11 * 3 + 2] = 0;
+
if (y == 0) // top half cropped
nor[11 * 3 + 0] = 0;
@@ -586,6 +601,7 @@
nor[2 * 3 + 0] = -1;
nor[2 * 3 + 1] = 1;
nor[2 * 3 + 2] = 0;
+
if (y == gridSizeY) // bottom half cropped
nor[2 * 3 + 0] = 0;
@@ -597,6 +613,7 @@
nor[3 * 3 + 0] = 1;
nor[3 * 3 + 1] = 1;
nor[3 * 3 + 2] = 0;
+
if (y == gridSizeY) // bottom half cropped
nor[3 * 3 + 0] = 0;
@@ -617,6 +634,7 @@
nor[5 * 3 + 0] = 1;
nor[5 * 3 + 1] = -1;
nor[5 * 3 + 2] = 0;
+
if (y == 0) // top half cropped
nor[5 * 3 + 0] = 0;
@@ -661,8 +679,8 @@
* glass or spiderweb appearance.
*/
bool
-PolygonAnim::tessellateIntoGlass (int spokeMultiplier,
- int numTiers,
+PolygonAnim::tessellateIntoGlass (int spokeMultiplier,
+ int numTiers,
float thickness)
{
int numSpokes = 4 * spokeMultiplier;
@@ -673,7 +691,7 @@
Spoke spokes[numSpokes];
memset (spokes, 0, sizeof (Spoke) * numSpokes);
- for (int i = 0; i < numSpokes; i++)
+ for (int i = 0; i < numSpokes; ++i)
{
spokes[i].spokeVertex =
(SpokeVertex *) calloc (numTiers, sizeof (SpokeVertex));
@@ -720,13 +738,11 @@
float range;
//calculate the vertex positions
- for (int i = 0; i < numSpokes; i++)
+ for (int i = 0; i < numSpokes; ++i)
{
/* The spokes must go into the corners. The remaining spokes fit between the corner spokes */
if ((i % spokeMultiplier) == 0)
- {
spokes[i].direction = cornerAngle[i / spokeMultiplier];
- }
else
{
range = cornerAngle[((i / spokeMultiplier) + 1) % 4 ] -
@@ -754,6 +770,7 @@
topBottomLength = ((winLimitsY + winLimitsH)- centerY);
topBottomLength /= sinf (spokes[i].direction);
+
if (topBottomLength < 0) topBottomLength *= -1;
//calculate left right length
@@ -775,7 +792,7 @@
float percent = 1.0 / ((float) numTiers);
//calculate spoke vertexes
- for (int j = 0 ; j < numTiers; j++)
+ for (int j = 0 ; j < numTiers; ++j)
{
spokes[i].spokeVertex[j].dist = percent * (j + 1) * spokes[i].length;
@@ -786,13 +803,12 @@
}
}
-
Shard shards[numSpokes][numTiers];
//calculate the center and bounds of each polygon
- for (int i = 0; i < numSpokes; i++)
+ for (int i = 0; i < numSpokes; ++i)
{
- for (int j = 0; j < numTiers; j++)
+ for (int j = 0; j < numTiers; ++j)
{
switch (j)
{
@@ -817,8 +833,6 @@
break;
-
-
default:
//the other tiers are 4 sided polygons
shards[i][j].isTriangle = false;
@@ -854,12 +868,12 @@
break;
}
}
-
}
//set up polygons
freePolygonObjects ();
- for (int i = 0; i < numSpokes * numTiers; i++)
+
+ for (int i = 0; i < numSpokes * numTiers; ++i)
mPolygons.push_back (new PolygonObject);
thickness /= ::screen->width ();
@@ -869,9 +883,9 @@
float halfThick = mThickness / 2;
vector::iterator it = mPolygons.begin ();
- for (int yc = 0; yc < numSpokes; yc++) //spokes
+ for (int yc = 0; yc < numSpokes; ++yc) //spokes
{
- for (int xc = 0; xc < numTiers; xc++, it++) //tiers
+ for (int xc = 0; xc < numTiers; ++xc, ++it) //tiers
{
PolygonObject *p = *it;
p->centerPos.set (shards[yc][xc].centerX,
@@ -891,6 +905,7 @@
// 4 front, 4 back vertices
p->vertices = (GLfloat *)calloc (8 * 3, sizeof (GLfloat));
+
if (!p->vertices)
{
compLogMessage ("animationaddon",
@@ -901,6 +916,7 @@
// Vertex normals
p->normals = (GLfloat *)calloc (8 * 3, sizeof (GLfloat));
+
if (!p->normals)
{
compLogMessage ("animationaddon",
@@ -948,6 +964,7 @@
// 16 indices for 4 sides (for quads)
p->sideIndices = (GLushort *)calloc (4 * 4, sizeof (GLushort));
+
if (!p->sideIndices)
{
compLogMessage ("animationaddon",
@@ -1027,7 +1044,7 @@
powf ((shards[yc][xc].centerY - shards[yc][xc].pt3Y), 2) +
powf (thickness,2));
- for (int k = 0; k < 4; k++)
+ for (int k = 0; k < 4; ++k)
{
if (dist[k] > longestDist)
longestDist = dist[k];
@@ -1049,10 +1066,10 @@
void
PolygonAnim::addGeometry (const GLTexture::MatrixList &matrix,
- const CompRegion ®ion,
- const CompRegion &clipRegion,
- unsigned int maxGridWidth,
- unsigned int maxGridHeight)
+ const CompRegion ®ion,
+ const CompRegion &clipRegion,
+ unsigned int maxGridWidth,
+ unsigned int maxGridHeight)
{
// TODO
// if polygon set is not valid or effect is not 3D (glide w/thickness=0)
@@ -1087,10 +1104,11 @@
{
// get rid of the clips from here (aw->nClipsPassed) to the end
Clip4Polygons *curClip = c;
- for (unsigned i = mNumClipsPassed; i < mClips.size (); i++, curClip++)
- foreach (PolygonClipInfo *pci,
- curClip->intersectingPolygonInfos)
+
+ for (unsigned i = mNumClipsPassed; i < mClips.size (); ++i, ++curClip)
+ foreach (PolygonClipInfo *pci, curClip->intersectingPolygonInfos)
delete pci;
+
mClips.resize (mNumClipsPassed);
dontStoreClips = false;
}
@@ -1148,8 +1166,9 @@
}
mClips.push_back (newClip);
- mNumClipsPassed++;
+ ++mNumClipsPassed;
}
+
mClipsUpdated = true;
}
@@ -1171,7 +1190,8 @@
int numClips = mClips.size ();
Clip4Polygons *c = &mClips[mFirstNondrawnClip];
- for (int j = mFirstNondrawnClip; j < numClips; j++, c++)
+
+ for (int j = mFirstNondrawnClip; j < numClips; ++j, ++c)
{
CompRect &cb = c->box;
int nFrontVerticesTilThisPoly = 0; // only used when intersectsMostPolygons is true
@@ -1213,12 +1233,13 @@
vTexCoords = &pci->vertexTexCoords[0];
}
- for (int k = 0; k < nSides; k++)
+ for (int k = 0; k < nSides; ++k)
{
float x = p->vertices[3 * k] + p->centerPosStart.x ();
float y = p->vertices[3 * k + 1] + p->centerPosStart.y ();
GLfloat tx;
GLfloat ty;
+
if (c->texMatrix.xy != 0.0f || c->texMatrix.yx != 0.0f)
{ // "non-rect" coordinates
tx = COMP_TEX_COORD_XY (c->texMatrix, x, y);
@@ -1240,6 +1261,7 @@
vTexCoords[ti] = tx;
vTexCoords[ti + 1] = ty;
}
+
nFrontVerticesTilThisPoly += nSides;
}
}
@@ -1248,9 +1270,9 @@
// Correct perspective appearance by skewing
void
PolygonAnim::getPerspectiveCorrectionMat (const PolygonObject *p,
- GLfloat *mat,
- GLMatrix *matf,
- const CompOutput &output)
+ GLfloat *mat,
+ GLMatrix *matf,
+ const CompOutput &output)
{
Point center;
CompRect outRect (mAWindow->savedRectsValid () ?
@@ -1339,15 +1361,15 @@
inline void
PolygonAnim::drawPolygonClipIntersection (const PolygonObject *p,
- const Clip4Polygons &c,
- const GLfloat *vertexTexCoords,
- int pass,
- float forwardProgress,
- GLdouble clipPlanes[4][4],
- const CompOutput &output,
- float newOpacity,
- bool decelerates,
- GLfloat skewMat[16])
+ const Clip4Polygons &c,
+ const GLfloat *vertexTexCoords,
+ int pass,
+ float forwardProgress,
+ GLdouble clipPlanes[4][4],
+ const CompOutput &output,
+ float newOpacity,
+ bool decelerates,
+ GLfloat skewMat[16])
{
int nSides = p->nSides;
float newOpacityPolygon = newOpacity;
@@ -1367,10 +1389,13 @@
p->fadeDuration);
else
opacityFac = 1 - fadePassedBy / p->fadeDuration;
+
if (opacityFac < 0)
opacityFac = 0;
+
if (opacityFac > 1)
opacityFac = 1;
+
newOpacityPolygon = newOpacity * opacityFac;
}
}
@@ -1430,19 +1455,18 @@
glClipPlane (GL_CLIP_PLANE2, clipPlanes[2]);
glClipPlane (GL_CLIP_PLANE3, clipPlanes[3]);
- for (int k = 0; k < 4; k++)
+ for (int k = 0; k < 4; ++k)
glEnable (GL_CLIP_PLANE0 + k);
- bool fadeBackAndSides =
- mBackAndSidesFadeDur > 0 &&
- forwardProgress <= mBackAndSidesFadeDur;
+
+ bool fadeBackAndSides = mBackAndSidesFadeDur > 0 &&
+ forwardProgress <= mBackAndSidesFadeDur;
float newOpacityPolygon2 = newOpacityPolygon;
if (fadeBackAndSides)
{
// Fade-in opacity for back face and sides
- newOpacityPolygon2 *=
- (forwardProgress / mBackAndSidesFadeDur);
+ newOpacityPolygon2 *= (forwardProgress / mBackAndSidesFadeDur);
}
GLFragment::Attrib attrib = mCurPaintAttrib;
@@ -1452,23 +1476,27 @@
// Draw back face
glVertexPointer (3, GL_FLOAT, 0, p->vertices + 3 * nSides);
+
if (mThickness > 0)
glNormalPointer (GL_FLOAT, 0, p->normals + 3 * nSides);
else
glNormal3f (0.0f, 0.0f, -1.0f);
+
glTexCoordPointer (2, GL_FLOAT, 0, &vertexTexCoords[2 * nSides]);
glDrawArrays (GL_POLYGON, 0, nSides);
// Vertex coords
glVertexPointer (3, GL_FLOAT, 0, p->vertices);
+
if (mThickness > 0)
glNormalPointer (GL_FLOAT, 0, p->normals);
else
glNormal3f (0.0f, 0.0f, 1.0f);
+
glTexCoordPointer (2, GL_FLOAT, 0, vertexTexCoords);
// Draw quads for sides
- for (int k = 0; k < nSides; k++)
+ for (int k = 0; k < nSides; ++k)
{
// GL_QUADS uses a different vertex normal than the first
// so I use GL_POLYGON to make sure the normals are right.
@@ -1485,9 +1513,11 @@
attrib.setOpacity (newOpacityPolygon * OPAQUE);
prepareDrawingForAttrib (attrib);
}
+
// Draw front face
glDrawArrays (GL_POLYGON, 0, nSides);
- for (int k = 0; k < 4; k++)
+
+ for (int k = 0; k < 4; ++k)
glDisable (GL_CLIP_PLANE0 + k);
glPopMatrix ();
@@ -1496,17 +1526,16 @@
void
PolygonAnim::drawGeometry ()
{
- mNumDrawGeometryCalls++;
+ ++mNumDrawGeometryCalls;
// draw windows only on current viewport unless it's on all viewports
CompPoint pnt = mCScreen->windowPaintOffset ();
+
if ((pnt.x () != 0 || pnt.y () != 0) &&
!mWindow->onAllViewports ())
- {
return;
// since this is not the viewport the window was drawn
// just before animation started
- }
// TODO
// if polygon set is not valid or effect is not 3D (glide w/thickness=0)
@@ -1517,9 +1546,7 @@
if (mFirstNondrawnClip < 0 ||
mFirstNondrawnClip >= numClips)
- {
return;
- }
if (mClipsUpdated)
processIntersectingPolygons ();
@@ -1527,9 +1554,7 @@
int lastClip; // last clip to draw
if (mClipsUpdated)
- {
lastClip = numClips - 1;
- }
else
{
assert (!mLastClipInGroup.empty());
@@ -1604,6 +1629,7 @@
if (GL::canDoSaturated && mCurPaintAttrib.getSaturation () != COLOR)
{
saturationFull = false;
+
if (GL::canDoSlightlySaturated &&
mCurPaintAttrib.getSaturation () > 0)
{
@@ -1625,7 +1651,11 @@
bool decelerates = deceleratingMotion ();
glPushAttrib (GL_BLEND);
- glEnable (GL_BLEND);
+
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
if (saturationFull)
mGScreen->setTexEnvMode (GL_MODULATE);
@@ -1645,36 +1675,40 @@
mAllFadeDuration);
else
opacityFac = 1 - fadePassedBy / mAllFadeDuration;
+
if (opacityFac < 0)
opacityFac = 0;
+
if (opacityFac > 1)
opacityFac = 1;
+
newOpacity = opacity * opacityFac;
}
}
const CompOutput *output =
- static_cast (getExtensionPluginInfo ())->
- output ();
+ static_cast (getExtensionPluginInfo ())->output ();
GLfloat skewMat[16];
+
if (mCorrectPerspective == CorrectPerspectiveWindow)
getPerspectiveCorrectionMat (NULL, skewMat, NULL, *output);
// pass: 0: draw opaque ones
// 1: draw transparent ones
- for (int pass = 0; pass < 2; pass++)
+ for (int pass = 0; pass < 2; ++pass)
{
Clip4Polygons *c = &mClips[mFirstNondrawnClip];
- for (int j = mFirstNondrawnClip; j <= lastClip; j++, c++)
+ for (int j = mFirstNondrawnClip; j <= lastClip; ++j, ++c)
{
if (c->intersectsMostPolygons)
{
const GLfloat *vTexCoords = &c->polygonVertexTexCoords[0];
+
foreach (const PolygonObject *p, mPolygons)
{
drawPolygonClipIntersection (p, *c,
- vTexCoords,
+ vTexCoords,
pass, forwardProgress,
clipPlanes, *output,
newOpacity,
@@ -1689,7 +1723,7 @@
c->intersectingPolygonInfos)
{
drawPolygonClipIntersection (pci->p, *c,
- &pci->vertexTexCoords[0],
+ &pci->vertexTexCoords[0],
pass, forwardProgress,
clipPlanes, *output,
newOpacity,
@@ -1780,17 +1814,18 @@
if (p->moveDuration > 0)
moveProgress /= p->moveDuration;
+
if (moveProgress < 0)
moveProgress = 0;
else if (moveProgress > 1)
moveProgress = 1;
p->centerPos.setX (moveProgress * p->finalRelPos.x () +
- p->centerPosStart.x ());
+ p->centerPosStart.x ());
p->centerPos.setY (moveProgress * p->finalRelPos.y () +
- p->centerPosStart.y ());
+ p->centerPosStart.y ());
p->centerPos.setZ (1.0f / ::screen->width () *
- moveProgress * p->finalRelPos.z () + p->centerPosStart.z ());
+ moveProgress * p->finalRelPos.z () + p->centerPosStart.z ());
p->rotAngle = moveProgress * p->finalRotAng + p->rotAngleStart;
}
@@ -1799,7 +1834,7 @@
// but slightly ac/decelerates movement
void
PolygonAnim::deceleratingAnimStepPolygon (PolygonObject *p,
- float forwardProgress)
+ float forwardProgress)
{
// TODO: Refactor
@@ -1807,6 +1842,7 @@
if (p->moveDuration > 0)
moveProgress /= p->moveDuration;
+
if (moveProgress < 0)
moveProgress = 0;
else if (moveProgress > 1)
@@ -1815,11 +1851,11 @@
moveProgress = progressDecelerate (moveProgress);
p->centerPos.setX (moveProgress * p->finalRelPos.x () +
- p->centerPosStart.x ());
+ p->centerPosStart.x ());
p->centerPos.setY (moveProgress * p->finalRelPos.y () +
- p->centerPosStart.y ());
+ p->centerPosStart.y ());
p->centerPos.setZ (1.0f / ::screen->width () *
- moveProgress * p->finalRelPos.z () + p->centerPosStart.z ());
+ moveProgress * p->finalRelPos.z () + p->centerPosStart.z ());
p->rotAngle = moveProgress * p->finalRotAng + p->rotAngleStart;
}
@@ -1845,25 +1881,30 @@
const float *screenProjection = gScreen->projectionMatrix ();
GLdouble dModel[16];
GLdouble dProjection[16];
- for (int i = 0; i < 16; i++)
+
+ for (int i = 0; i < 16; ++i)
{
dProjection[i] = screenProjection[i];
}
+
GLint viewport[4] =
{output.region ()->extents.x1,
output.region ()->extents.y1,
output.width (),
output.height ()};
+
GLdouble px, py, pz;
GLMatrix *modelViewTransform = &wTransform;
GLMatrix skewMat;
+
if (mCorrectPerspective == CorrectPerspectiveWindow)
{
getPerspectiveCorrectionMat (NULL, NULL, &skewMat, output);
wTransform2 = wTransform * skewMat;
}
+
if (mCorrectPerspective == CorrectPerspectiveWindow ||
mCorrectPerspective == CorrectPerspectivePolygon)
modelViewTransform = &wTransform2;
@@ -1879,7 +1920,8 @@
// if modelViewTransform == wTransform2, then
// it changes for each polygon
const float *modelViewMatrix = modelViewTransform->getMatrix ();
- for (int j = 0; j < 16; j++)
+
+ for (int j = 0; j < 16; ++j)
dModel[j] = modelViewMatrix[j];
Point3d center = p->centerPos;
@@ -1922,7 +1964,8 @@
cubeCorners[7].set (center.x () + radius, center.y () + radius,
center.z () - zradius);
Point3d *pnt = cubeCorners;
- for (int j = 0; j < N_POINTS; j++, pnt++)
+
+ for (int j = 0; j < N_POINTS; ++j, ++pnt)
{
if (!gluProject (pnt->x (), pnt->y (), pnt->z (),
dModel, dProjection, viewport,
@@ -1972,6 +2015,7 @@
// Find out if an animation running now uses depth test
bool depthUsed = false;
+
foreach (CompWindow *w, ::screen->windows ())
{
AnimWindow *aw = AnimWindow::get (w);
@@ -1981,6 +2025,7 @@
anim->getExtensionPluginInfo ()->name == pluginName)
{
BaseAddonAnim *animBase = dynamic_cast (anim);
+
if (animBase->needsDepthTest ())
{
depthUsed = true;
@@ -1988,6 +2033,7 @@
}
}
}
+
if (depthUsed)
{
glClearDepth (1000.0f);
=== modified file 'plugins/animationaddon/src/private.h'
--- plugins/animationaddon/src/private.h 2012-09-07 22:37:20 +0000
+++ plugins/animationaddon/src/private.h 2013-07-21 23:03:28 +0000
@@ -37,183 +37,199 @@
class ExtensionPluginAnimAddon : public ExtensionPluginInfo
{
-public:
- ExtensionPluginAnimAddon (const CompString &name,
- unsigned int nEffects,
- AnimEffect *effects,
- CompOption::Vector *effectOptions,
- unsigned int firstEffectOptionIndex) :
- ExtensionPluginInfo (name, nEffects, effects, effectOptions,
- firstEffectOptionIndex) {}
- ~ExtensionPluginAnimAddon () {}
-
- void prePaintOutput (CompOutput *output);
- const CompOutput *output () { return mOutput; }
-
-private:
- const CompOutput *mOutput;
+ public:
+
+ ExtensionPluginAnimAddon (const CompString &name,
+ unsigned int nEffects,
+ AnimEffect *effects,
+ CompOption::Vector *effectOptions,
+ unsigned int firstEffectOptionIndex) :
+ ExtensionPluginInfo (name, nEffects, effects, effectOptions,
+ firstEffectOptionIndex) {}
+ ~ExtensionPluginAnimAddon () {}
+
+ void prePaintOutput (CompOutput *output);
+
+ const CompOutput *output () { return mOutput; }
+
+ private:
+
+ const CompOutput *mOutput;
};
class PrivateAnimAddonScreen :
- public AnimationaddonOptions
+ public AnimationaddonOptions
{
- friend class AnimAddonScreen;
-
-public:
- PrivateAnimAddonScreen (CompScreen *);
- ~PrivateAnimAddonScreen ();
-
-protected:
- void initAnimationList ();
-
- CompOutput &mOutput;
+ friend class AnimAddonScreen;
+
+ public:
+
+ PrivateAnimAddonScreen (CompScreen *);
+ ~PrivateAnimAddonScreen ();
+
+ protected:
+
+ void initAnimationList ();
+
+ CompOutput &mOutput;
};
class AnimAddonWindow :
- public PluginClassHandler
+ public PluginClassHandler
{
-public:
- AnimAddonWindow (CompWindow *);
- ~AnimAddonWindow ();
-
-protected:
- CompWindow *mWindow; ///< Window being animated.
- AnimWindow *aWindow;
+ public:
+
+ AnimAddonWindow (CompWindow *);
+ ~AnimAddonWindow ();
+
+ protected:
+
+ CompWindow *mWindow; ///< Window being animated.
+ AnimWindow *aWindow;
};
-
// Particle-based animations
class BeamUpAnim : public ParticleAnim
{
-public:
- BeamUpAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
-
-protected:
- void init ();
- void step ();
- void genNewBeam (int x,
- int y,
- int width,
- int height,
- float size,
- float time);
- void updateAttrib (GLWindowPaintAttrib &wAttrib);
-
- float mLife;
- unsigned short *mColor;
- float mSize;
- int mSpacing;
- float mSlowdown;
+ public:
+
+ BeamUpAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
+
+ protected:
+
+ void init ();
+
+ void step ();
+
+ void genNewBeam (int x,
+ int y,
+ int width,
+ int height,
+ float size,
+ float time);
+
+ void updateAttrib (GLWindowPaintAttrib &wAttrib);
+
+ float mLife;
+ unsigned short *mColor;
+ float mSize;
+ int mSpacing;
+ float mSlowdown;
};
class BurnAnim : public ParticleAnim
{
public:
- BurnAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
+
+ BurnAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
protected:
- void step ();
- void genNewFire (int x,
- int y,
- int width,
- int height,
- float size,
- float time);
- void genNewSmoke (int x,
- int y,
- int width,
- int height,
+
+ void step ();
+ void genNewFire (int x,
+ int y,
+ int width,
+ int height,
+ float size,
+ float time);
+
+ void genNewSmoke (int x,
+ int y,
+ int width,
+ int height,
float size,
float time);
- int mDirection;
- bool mMysticalFire;
- float mLife;
+ int mDirection;
+ bool mMysticalFire;
+ float mLife;
unsigned short *mColor;
- float mSize;
- bool mHasSmoke;
+ float mSize;
+ bool mHasSmoke;
- unsigned int mFirePSId;
- unsigned int mSmokePSId;
+ unsigned int mFirePSId;
+ unsigned int mSmokePSId;
};
// Polygon-based animations
class ExplodeAnim : public PolygonAnim
{
-public:
- ExplodeAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
-
- void init ();
-
-protected:
- static const float kDurationFactor;
+ public:
+
+ ExplodeAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
+
+ void init ();
+
+ protected:
+
+ static const float kDurationFactor;
};
/// Extended polygon object for airplane folding and flying airplane fold phase.
class AirplanePolygonObject : public PolygonObject
{
-public:
-
- Vector3d rotAxisA; // Rotation axis vector A
- Vector3d rotAxisB; // Rotation axis vector B
-
- Point3d rotAxisOffsetA; // Rotation axis translate amount A
- Point3d rotAxisOffsetB; // Rotation axis translate amount B
-
- float rotAngleA; // Rotation angle A
- float finalRotAngA; // Final rotation angle A
-
- float rotAngleB; // Rotation angle B
- float finalRotAngB; // Final rotation angle B
-
- // airplane fly phase:
-
- Vector3d centerPosFly; // center position (offset) during the flying phases
-
- Vector3d flyRotation; // airplane rotation during the flying phases
- Vector3d flyFinalRotation; // airplane rotation during the flying phases
-
- float flyScale; // Scale for airplane flying effect
- float flyFinalScale; // Final Scale for airplane flying effect
-
- float flyTheta; // Theta parameter for fly rotations and positions
-
- float moveStartTime2; // Movement starts at this time ([0-1] range)
- float moveDuration2; // Movement lasts this long ([0-1] range)
-
- float moveStartTime3; // Movement starts at this time ([0-1] range)
- float moveDuration3; // Movement lasts this long ([0-1] range)
-
- float moveStartTime4; // Movement starts at this time ([0-1] range)
- float moveDuration4; // Movement lasts this long ([0-1] range)
-
- float moveStartTime5; // Movement starts at this time ([0-1] range)
- float moveDuration5; // Movement lasts this long ([0-1] range)
+ public:
+
+ Vector3d rotAxisA; // Rotation axis vector A
+ Vector3d rotAxisB; // Rotation axis vector B
+
+ Point3d rotAxisOffsetA; // Rotation axis translate amount A
+ Point3d rotAxisOffsetB; // Rotation axis translate amount B
+
+ float rotAngleA; // Rotation angle A
+ float finalRotAngA; // Final rotation angle A
+
+ float rotAngleB; // Rotation angle B
+ float finalRotAngB; // Final rotation angle B
+
+ // airplane fly phase:
+
+ Vector3d centerPosFly; // center position (offset) during the flying phases
+
+ Vector3d flyRotation; // airplane rotation during the flying phases
+ Vector3d flyFinalRotation; // airplane rotation during the flying phases
+
+ float flyScale; // Scale for airplane flying effect
+ float flyFinalScale; // Final Scale for airplane flying effect
+
+ float flyTheta; // Theta parameter for fly rotations and positions
+
+ float moveStartTime2; // Movement starts at this time ([0-1] range)
+ float moveDuration2; // Movement lasts this long ([0-1] range)
+
+ float moveStartTime3; // Movement starts at this time ([0-1] range)
+ float moveDuration3; // Movement lasts this long ([0-1] range)
+
+ float moveStartTime4; // Movement starts at this time ([0-1] range)
+ float moveDuration4; // Movement lasts this long ([0-1] range)
+
+ float moveStartTime5; // Movement starts at this time ([0-1] range)
+ float moveDuration5; // Movement lasts this long ([0-1] range)
};
class AirplaneAnim :
- public PolygonAnim
+ public PolygonAnim
{
public:
AirplaneAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
~AirplaneAnim ();
@@ -238,133 +254,144 @@
static const float kDurationFactor;
};
-
class DominoAnim : public PolygonAnim
{
-public:
- DominoAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
-
- void init ();
-
-protected:
- static const float kDurationFactor;
+ public:
+
+ DominoAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
+
+ void init ();
+
+ protected:
+
+ static const float kDurationFactor;
};
class RazrAnim : public DominoAnim
{
-public:
- RazrAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
+ public:
+
+ RazrAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
};
-
class FoldAnim : public PolygonAnim
{
-public:
- FoldAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
-
- void init ();
-
- void stepPolygon (PolygonObject *p, float);
-
- static const float kDurationFactor;
+ public:
+
+ FoldAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
+
+ void init ();
+
+ void stepPolygon (PolygonObject *p, float);
+
+ static const float kDurationFactor;
};
class Glide3Anim : public PolygonAnim
{
-public:
- Glide3Anim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
-
- bool deceleratingMotion () { return true; }
-
- static const float kDurationFactor;
-
- void
- init ();
+ public:
+
+ Glide3Anim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
+
+ bool deceleratingMotion () { return true; }
+
+ static const float kDurationFactor;
+
+ void
+ init ();
};
class LeafSpreadAnim : public PolygonAnim
{
-public:
- LeafSpreadAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
-
- void init ();
-
-protected:
- static const float kDurationFactor;
+ public:
+
+ LeafSpreadAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
+
+ void init ();
+
+ protected:
+
+ static const float kDurationFactor;
};
class SkewerAnim : public PolygonAnim
{
-public:
- SkewerAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
-
- void init ();
- void stepPolygon (PolygonObject *p,
- float forwardProgress);
-
-protected:
- static const float kDurationFactor;
+ public:
+
+ SkewerAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
+
+ void init ();
+ void stepPolygon (PolygonObject *p,
+ float forwardProgress);
+
+ protected:
+
+ static const float kDurationFactor;
};
/* TODO: Make a MultiAnim */
class DissolveSingleAnim :
- virtual public Animation,
- virtual public TransformAnim
+ virtual public Animation,
+ virtual public TransformAnim
{
-public:
- DissolveSingleAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon);
-
- void step () { TransformAnim::step (); }
-
- void updateBB (CompOutput &output);
- bool updateBBUsed () { return true; }
-
- void updateTransform (GLMatrix &);
-
- void updateAttrib (GLWindowPaintAttrib &wAttrib);
- virtual float getDissolveSingleProgress () { return progressLinear (); }
+ public:
+
+ DissolveSingleAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
+
+ void step () { TransformAnim::step (); }
+
+ void updateBB (CompOutput &output);
+
+ bool updateBBUsed () { return true; }
+
+ void updateTransform (GLMatrix &);
+
+ void updateAttrib (GLWindowPaintAttrib &wAttrib);
+
+ virtual float getDissolveSingleProgress () { return progressLinear (); }
};
class DissolveAnim :
- public MultiAnim
+ public MultiAnim
{
-public:
- DissolveAnim (CompWindow *w,
- WindowEvent curWindowEvent,
- float duration,
- const AnimEffect info,
- const CompRect &icon) :
- MultiAnim ::MultiAnim
- (w, curWindowEvent, duration, info, icon)
- {
- }
+ public:
+
+ DissolveAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
+ MultiAnim ::MultiAnim
+ (w, curWindowEvent, duration, info, icon)
+ {
+ }
};
=== modified file 'plugins/animationaddon/src/skewer.cpp'
--- plugins/animationaddon/src/skewer.cpp 2013-02-27 11:33:10 +0000
+++ plugins/animationaddon/src/skewer.cpp 2013-07-21 23:03:28 +0000
@@ -61,41 +61,50 @@
// left
dir[(*c)++] = 0;
break;
+
case 1:
// right
dir[(*c)++] = 1;
break;
+
case 2:
// left-right
dir[(*c)++] = 0;
dir[(*c)++] = 1;
break;
+
case 3:
// up
dir[(*c)++] = 2;
break;
+
case 4:
// downs
dir[(*c)++] = 3;
break;
+
case 5:
// up-down
dir[(*c)++] = 2;
dir[(*c)++] = 3;
break;
+
case 6:
// in
dir[(*c)++] = 4;
break;
+
case 7:
// out
dir[(*c)++] = 5;
break;
+
case 8:
// in-out
dir[(*c)++] = 4;
dir[(*c)++] = 5;
break;
+
case 9:
// random
getDirection (dir, c, floor (RAND_FLOAT () * 8));
@@ -123,11 +132,8 @@
if (!tessellateIntoHexagons (gridSizeX, gridSizeY, thickness))
return;
}
- else
- {
- if (!tessellateIntoRectangles (gridSizeX, gridSizeY, thickness))
- return;
- }
+ else if (!tessellateIntoRectangles (gridSizeX, gridSizeY, thickness))
+ return;
int numPolygons = mPolygons.size ();
int times[numPolygons];
@@ -135,8 +141,7 @@
int maxZ = .8 * DEFAULT_Z_CAMERA * ::screen->width ();
- int i;
- for (i = 0; i < numPolygons; i++)
+ for (int i = 0; i < numPolygons; ++i)
times[i] = i;
foreach (PolygonObject *p, mPolygons)
@@ -198,7 +203,7 @@
p->fadeDuration = 1 - p->fadeStartTime;
times[rand_time] = times[last_time]; // copy last one over times[rand_time]
- last_time--; //descrease last_time
+ --last_time; //descrease last_time
}
}
=== modified file 'plugins/annotate/src/annotate.cpp'
--- plugins/annotate/src/annotate.cpp 2013-07-19 03:04:12 +0000
+++ plugins/annotate/src/annotate.cpp 2013-07-21 23:03:28 +0000
@@ -45,6 +45,7 @@
{
if (!cairo)
{
+<<<<<<< TREE
XRenderPictFormat *format;
Screen *xScreen;
@@ -58,6 +59,17 @@
pixmap = XCreatePixmap (screen->dpy (), screen->root (), w, h, 32);
+=======
+ Screen *xScreen = ScreenOfDisplay (screen->dpy (), screen->screenNum ());
+
+ int w = screen->width ();
+ int h = screen->height ();
+
+ XRenderPictFormat *format = XRenderFindStandardFormat (screen->dpy (),
+ PictStandardARGB32);
+
+ pixmap = XCreatePixmap (screen->dpy (), screen->root (), w, h, 32);
+>>>>>>> MERGE-SOURCE
texture = GLTexture::bindPixmapToTexture (pixmap, w, h, 32);
if (texture.empty ())
@@ -82,8 +94,9 @@
if (cairoBuffer.size ())
{
- cairo_t *cr = cairo_create (surface);
- int stride = cairo_format_stride_for_width (CAIRO_FORMAT_ARGB32, w);
+ cairo_t *cr = cairo_create (surface);
+ int stride = cairo_format_stride_for_width (
+ CAIRO_FORMAT_ARGB32, w);
cairo_surface_t *raw_source =
cairo_image_surface_create_for_data ((unsigned char *)
cairoBuffer.c_str (),
@@ -221,8 +234,12 @@
unsigned short *strokeColor,
double strokeWidth)
{
+<<<<<<< TREE
REGION reg;
cairo_t *cr = cairoContext ();
+=======
+ cairo_t *cr = cairoContext ();
+>>>>>>> MERGE-SOURCE
if (cr)
{
@@ -241,6 +258,8 @@
cairo_stroke (cr);
cairo_restore (cr);
+ REGION reg;
+
reg.rects = ®.extents;
reg.numRects = 1;
@@ -299,6 +318,7 @@
if (cr)
{
+<<<<<<< TREE
const char *tool;
unsigned short *fillColor, *strokeColor;
@@ -325,6 +345,31 @@
double y = CompOption::getFloatOptionNamed (options, "y", 0);
double w = CompOption::getFloatOptionNamed (options, "w", 100);
double h = CompOption::getFloatOptionNamed (options, "h", 100);
+=======
+ const char *tool = CompOption::getStringOptionNamed (options, "tool", "line").c_str ();
+
+ cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+ cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
+
+ unsigned short *fillColor = optionGetFillColor ();
+ fillColor = CompOption::getColorOptionNamed (options, "fill_color",
+ fillColor);
+
+ unsigned short *strokeColor = optionGetStrokeColor ();
+ strokeColor = CompOption::getColorOptionNamed (options,
+ "stroke_color", strokeColor);
+
+ double strokeWidth = optionGetStrokeWidth ();
+ strokeWidth = CompOption::getFloatOptionNamed (options, "stroke_width",
+ strokeWidth);
+
+ if (strcasecmp (tool, "rectangle") == 0)
+ {
+ double x = CompOption::getFloatOptionNamed (options, "x", 0);
+ double y = CompOption::getFloatOptionNamed (options, "y", 0);
+ double w = CompOption::getFloatOptionNamed (options, "w", 100);
+ double h = CompOption::getFloatOptionNamed (options, "h", 100);
+>>>>>>> MERGE-SOURCE
drawRectangle (x, y, w, h, fillColor, strokeColor,
strokeWidth);
@@ -392,7 +437,7 @@
bool
AnnoScreen::terminate (CompAction *action,
CompAction::State state,
- CompOption::Vector& options)
+ CompOption::Vector &options)
{
if (grabIndex)
{
@@ -405,35 +450,35 @@
switch (drawMode)
{
- case LineMode:
- drawLine (initialPointerX, initialPointerY,
- lineVector.x (), lineVector.y (),
- optionGetStrokeWidth (),
- optionGetStrokeColor ());
- break;
-
- case RectangleMode:
- drawRectangle (rectangle.x (),
- rectangle.y (),
- rectangle.width (),
- rectangle.height (),
- optionGetFillColor (),
- optionGetStrokeColor (),
- optionGetStrokeWidth ());
- break;
-
- case EllipseMode:
- drawEllipse (ellipse.center.x (),
- ellipse.center.y (),
- ellipse.radiusX,
- ellipse.radiusY,
- optionGetFillColor (),
- optionGetStrokeColor (),
- optionGetStrokeWidth ());
- break;
-
- default:
- break;
+ case LineMode:
+ drawLine (initialPointerX, initialPointerY,
+ lineVector.x (), lineVector.y (),
+ optionGetStrokeWidth (),
+ optionGetStrokeColor ());
+ break;
+
+ case RectangleMode:
+ drawRectangle (rectangle.x (),
+ rectangle.y (),
+ rectangle.width (),
+ rectangle.height (),
+ optionGetFillColor (),
+ optionGetStrokeColor (),
+ optionGetStrokeWidth ());
+ break;
+
+ case EllipseMode:
+ drawEllipse (ellipse.center.x (),
+ ellipse.center.y (),
+ ellipse.radiusX,
+ ellipse.radiusY,
+ optionGetFillColor (),
+ optionGetStrokeColor (),
+ optionGetStrokeWidth ());
+ break;
+
+ default:
+ break;
}
drawMode = NoMode;
@@ -628,7 +673,10 @@
/* This replaced prepareXCoords (s, output, -DEFAULT_Z_CAMERA) */
sTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA);
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
if (content && !region.isEmpty ())
{
@@ -705,6 +753,7 @@
switch (drawMode)
{
+<<<<<<< TREE
case LineMode:
glLineWidth (optionGetStrokeWidth ());
@@ -819,28 +868,144 @@
offset) * sinf (angle * DEG2RAD));
vertexData[1] = ellipse.center.y () + ((ellipse.radiusY -
offset) * cosf (angle * DEG2RAD));
+=======
+ case LineMode:
+ glLineWidth (optionGetStrokeWidth ());
+
+ streamingBuffer->begin (GL_LINES);
+
+ streamingBuffer->addColors (1, optionGetStrokeColor ());
+
+ vertexData[0] = initialPointerX;
+ vertexData[1] = initialPointerY;
+>>>>>>> MERGE-SOURCE
vertexData[2] = 0.0f;
- vertexData[3] = ellipse.center.x () + ((ellipse.radiusX +
- offset) * sinf (angle * DEG2RAD));
- vertexData[4] = ellipse.center.y () + ((ellipse.radiusY +
- offset) * cosf (angle * DEG2RAD));
+ vertexData[3] = lineVector.x ();
+ vertexData[4] = lineVector.y ();
vertexData[5] = 0.0f;
streamingBuffer->addVertices (2, vertexData);
- }
-
- vertexData[0] = ellipse.center.x ();
- vertexData[1] = ellipse.center.y () + ellipse.radiusY + offset;
- streamingBuffer->addVertices (1, vertexData);
-
- streamingBuffer->end ();
- streamingBuffer->render (sTransform);
- break;
-
- default:
- break;
+
+ streamingBuffer->end ();
+ streamingBuffer->render (sTransform);
+ break;
+
+ case RectangleMode:
+ vertexData[0] = rectangle.x1 ();
+ vertexData[1] = rectangle.y1 ();
+ vertexData[2] = 0.0f;
+ vertexData[3] = rectangle.x1 ();
+ vertexData[4] = rectangle.y2 ();
+ vertexData[5] = 0.0f;
+ vertexData[6] = rectangle.x2 ();
+ vertexData[7] = rectangle.y1 ();
+ vertexData[8] = 0.0f;
+ vertexData[9] = rectangle.x2 ();
+ vertexData[10] = rectangle.y2 ();
+ vertexData[11] = 0.0f;
+
+ /* fill rectangle */
+ streamingBuffer->begin (GL_TRIANGLE_STRIP);
+
+ streamingBuffer->addColors (1, optionGetFillColor ());
+ streamingBuffer->addVertices (4, vertexData);
+
+ streamingBuffer->end ();
+ streamingBuffer->render (sTransform);
+
+ /* draw rectangle outline */
+ vertexData[0] = rectangle.x1 ();
+ vertexData[1] = rectangle.y1 ();
+ vertexData[2] = 0.0f;
+ vertexData[3] = rectangle.x2 ();
+ vertexData[4] = rectangle.y1 ();
+ vertexData[5] = 0.0f;
+ vertexData[6] = rectangle.x2 ();
+ vertexData[7] = rectangle.y2 ();
+ vertexData[8] = 0.0f;
+ vertexData[9] = rectangle.x1 ();
+ vertexData[10] = rectangle.y2 ();
+ vertexData[11] = 0.0f;
+
+ glLineWidth (optionGetStrokeWidth ());
+
+ streamingBuffer->begin (GL_LINE_LOOP);
+
+ streamingBuffer->addColors (1, optionGetStrokeColor ());
+ streamingBuffer->addVertices (4, vertexData);
+
+ streamingBuffer->end ();
+ streamingBuffer->render (sTransform);
+
+ break;
+
+ case EllipseMode:
+ /* fill ellipse */
+ streamingBuffer->begin (GL_TRIANGLE_FAN);
+
+ streamingBuffer->addColors (1, optionGetFillColor ());
+
+ vertexData[0] = ellipse.center.x ();
+ vertexData[1] = ellipse.center.y ();
+ vertexData[2] = 0.0f;
+ streamingBuffer->addVertices (1, vertexData);
+
+ for (angle = 0; angle <= 360; angle += 1)
+ {
+ vertexData[0] = ellipse.center.x () +
+ (ellipse.radiusX * sinf (angle * DEG2RAD));
+ vertexData[1] = ellipse.center.y () +
+ (ellipse.radiusY * cosf (angle * DEG2RAD));
+ streamingBuffer->addVertices (1, vertexData);
+ }
+
+ vertexData[0] = ellipse.center.x ();
+ vertexData[1] = ellipse.center.y () + ellipse.radiusY;
+ streamingBuffer->addVertices (1, vertexData);
+
+ streamingBuffer->end ();
+ streamingBuffer->render (sTransform);
+
+ /* draw ellipse outline */
+ glLineWidth (optionGetStrokeWidth ());
+
+ streamingBuffer->begin (GL_TRIANGLE_STRIP);
+
+ streamingBuffer->addColors (1, optionGetStrokeColor ());
+
+ vertexData[0] = ellipse.center.x ();
+ vertexData[1] = ellipse.center.y () + ellipse.radiusY - offset;
+ vertexData[2] = 0.0f;
+ streamingBuffer->addVertices (1, vertexData);
+
+ for (angle = 360; angle >= 0; angle -= 1)
+ {
+ vertexData[0] = ellipse.center.x () + ((ellipse.radiusX -
+ offset) * sinf (angle * DEG2RAD));
+ vertexData[1] = ellipse.center.y () + ((ellipse.radiusY -
+ offset) * cosf (angle * DEG2RAD));
+ vertexData[2] = 0.0f;
+ vertexData[3] = ellipse.center.x () + ((ellipse.radiusX +
+ offset) * sinf (angle * DEG2RAD));
+ vertexData[4] = ellipse.center.y () + ((ellipse.radiusY +
+ offset) * cosf (angle * DEG2RAD));
+ vertexData[5] = 0.0f;
+ streamingBuffer->addVertices (2, vertexData);
+ }
+
+ vertexData[0] = ellipse.center.x ();
+ vertexData[1] = ellipse.center.y () + ellipse.radiusY + offset;
+ streamingBuffer->addVertices (1, vertexData);
+
+ streamingBuffer->end ();
+ streamingBuffer->render (sTransform);
+ break;
+
+ default:
+ break;
}
- glDisable (GL_BLEND);
+ if (!glBlendEnabled)
+ glDisable (GL_BLEND);
}
return status;
@@ -858,71 +1023,71 @@
switch (drawMode)
{
- case EraseMode:
- drawLine (annoLastPointerX, annoLastPointerY,
- xRoot, yRoot,
- optionGetEraseWidth (), clearColor);
- break;
-
- case FreeDrawMode:
- drawLine (annoLastPointerX, annoLastPointerY,
- xRoot, yRoot,
- optionGetStrokeWidth (),
- optionGetStrokeColor ());
- break;
-
- case LineMode:
- lineVector.setX (xRoot);
- lineVector.setY (yRoot);
-
- damageRect.setGeometry (MIN(initialPointerX, lineVector.x ()),
- MIN(initialPointerY, lineVector.y ()),
- abs (lineVector.x () - initialPointerX),
- abs (lineVector.y () - initialPointerY));
- break;
-
- case RectangleMode:
- if (optionGetDrawShapesFromCenter ())
- rectangle.setGeometry (initialPointerX -
- abs (xRoot - initialPointerX),
- initialPointerY -
- abs (yRoot - initialPointerY),
- (abs (xRoot - initialPointerX)) * 2,
- (abs (yRoot - initialPointerY)) * 2);
- else
- rectangle.setGeometry (MIN(initialPointerX, xRoot),
- MIN(initialPointerY, yRoot),
- abs (xRoot - initialPointerX),
- abs (yRoot - initialPointerY));
-
- damageRect = rectangle;
- break;
-
- case EllipseMode:
- if (optionGetDrawShapesFromCenter ())
- {
- ellipse.center.setX (initialPointerX);
- ellipse.center.setY (initialPointerY);
- }
- else
- {
- ellipse.center.setX (initialPointerX +
- (xRoot - initialPointerX) / 2);
- ellipse.center.setY (initialPointerY +
- (yRoot - initialPointerY) / 2);
- }
-
- ellipse.radiusX = abs (xRoot - ellipse.center.x ());
- ellipse.radiusY = abs (yRoot - ellipse.center.y ());
-
- damageRect = CompRect (ellipse.center.x () - ellipse.radiusX,
- ellipse.center.y () - ellipse.radiusY,
- ellipse.radiusX * 2,
- ellipse.radiusY * 2);
- break;
-
- default:
- break;
+ case EraseMode:
+ drawLine (annoLastPointerX, annoLastPointerY,
+ xRoot, yRoot,
+ optionGetEraseWidth (), clearColor);
+ break;
+
+ case FreeDrawMode:
+ drawLine (annoLastPointerX, annoLastPointerY,
+ xRoot, yRoot,
+ optionGetStrokeWidth (),
+ optionGetStrokeColor ());
+ break;
+
+ case LineMode:
+ lineVector.setX (xRoot);
+ lineVector.setY (yRoot);
+
+ damageRect.setGeometry (MIN(initialPointerX, lineVector.x ()),
+ MIN(initialPointerY, lineVector.y ()),
+ abs (lineVector.x () - initialPointerX),
+ abs (lineVector.y () - initialPointerY));
+ break;
+
+ case RectangleMode:
+ if (optionGetDrawShapesFromCenter ())
+ rectangle.setGeometry (initialPointerX -
+ abs (xRoot - initialPointerX),
+ initialPointerY -
+ abs (yRoot - initialPointerY),
+ (abs (xRoot - initialPointerX)) * 2,
+ (abs (yRoot - initialPointerY)) * 2);
+ else
+ rectangle.setGeometry (MIN(initialPointerX, xRoot),
+ MIN(initialPointerY, yRoot),
+ abs (xRoot - initialPointerX),
+ abs (yRoot - initialPointerY));
+
+ damageRect = rectangle;
+ break;
+
+ case EllipseMode:
+ if (optionGetDrawShapesFromCenter ())
+ {
+ ellipse.center.setX (initialPointerX);
+ ellipse.center.setY (initialPointerY);
+ }
+ else
+ {
+ ellipse.center.setX (initialPointerX +
+ (xRoot - initialPointerX) / 2);
+ ellipse.center.setY (initialPointerY +
+ (yRoot - initialPointerY) / 2);
+ }
+
+ ellipse.radiusX = abs (xRoot - ellipse.center.x ());
+ ellipse.radiusY = abs (yRoot - ellipse.center.y ());
+
+ damageRect = CompRect (ellipse.center.x () - ellipse.radiusX,
+ ellipse.center.y () - ellipse.radiusY,
+ ellipse.radiusX * 2,
+ ellipse.radiusY * 2);
+ break;
+
+ default:
+ break;
}
if (cScreen && (drawMode == LineMode ||
@@ -980,14 +1145,14 @@
AnnoScreen::AnnoScreen (CompScreen *screen) :
PluginClassHandler (screen),
- cScreen (CompositeScreen::get (screen)),
- gScreen (GLScreen::get (screen)),
+ cScreen (CompositeScreen::get (screen)),
+ gScreen (GLScreen::get (screen)),
grabIndex (0),
- pixmap (None),
- surface (NULL),
- cairo (NULL),
- content (false),
- damage (None)
+ pixmap (None),
+ surface (NULL),
+ cairo (NULL),
+ content (false),
+ damage (None)
{
ScreenInterface::setHandler (screen, false);
GLScreenInterface::setHandler (gScreen, false);
=== modified file 'plugins/bench/src/bench.cpp'
--- plugins/bench/src/bench.cpp 2013-05-09 13:43:07 +0000
+++ plugins/bench/src/bench.cpp 2013-07-21 23:03:28 +0000
@@ -29,7 +29,7 @@
COMPIZ_PLUGIN_20090315 (bench, BenchPluginVTable)
-static const unsigned int TEX_WIDTH = 512;
+static const unsigned int TEX_WIDTH = 512;
static const unsigned short TEX_HEIGHT = 256;
void
@@ -41,12 +41,13 @@
int timediff = TIMEVALDIFFU (&now, &mLastRedraw);
mSample[mFrames % MAX_SAMPLES] = timediff;
timediff /= 1000;
- mFrames++;
+ ++mFrames;
mLastRedraw = now;
if (optionGetOutputConsole () && mActive)
{
int dTime = timer::timeval_diff (&now, &mLastPrint);
+
if (dTime > optionGetConsoleUpdateTime () * 1000)
{
int dFrames = mFrames - mLastPrintFrames;
@@ -61,6 +62,7 @@
if (mActive)
{
mAlpha += timediff / 1000.0;
+
if (mAlpha >= 1.0f)
{
mAlpha = 1.0f;
@@ -79,6 +81,7 @@
* of the screen.
*/
damageSelf ();
+
if (mTimer.minTime () != MIN_MS_PER_UPDATE)
mTimer.setTimes (MIN_MS_PER_UPDATE);
}
@@ -92,7 +95,9 @@
gScreen->glPaintOutputSetEnabled (this, false);
mTimer.stop ();
}
+
mAlpha -= timediff / 1000.0;
+
if (mAlpha < 0.0f)
mAlpha = 0.0f;
}
@@ -111,21 +116,22 @@
*/
{
const int usPerAverage = SECONDS_PER_AVERAGE * 1000000;
- int i = (mFrames + MAX_SAMPLES - 1) % MAX_SAMPLES;
- int lastSample = 0;
- int timeSum = 0;
- int count = 0;
- int maxCount = MIN (MAX_SAMPLES, mFrames);
+ int i = (mFrames + MAX_SAMPLES - 1) % MAX_SAMPLES;
+ int lastSample = 0;
+ int timeSum = 0;
+ int count = 0;
+ int maxCount = MIN (MAX_SAMPLES, mFrames);
while (timeSum < usPerAverage && count < maxCount)
{
lastSample = mSample[i];
timeSum += lastSample;
i = (i + MAX_SAMPLES - 1) % MAX_SAMPLES;
- count++;
+ ++count;
}
float fps = 0.0f;
+
if (timeSum < usPerAverage)
{
if (timeSum > 0)
@@ -134,8 +140,10 @@
else
{
fps = (float)(count - 1);
+
if (lastSample > 0)
fps += (float)(usPerAverage - (timeSum - lastSample)) / lastSample;
+
fps /= SECONDS_PER_AVERAGE;
}
@@ -149,12 +157,9 @@
CompOutput *output,
unsigned int mask)
{
- bool status;
- bool isSet;
- unsigned int fps;
GLMatrix sTransform (transform);
- status = gScreen->glPaintOutput (sAttrib, transform, region, output, mask);
+ bool status = gScreen->glPaintOutput (sAttrib, transform, region, output, mask);
if (mAlpha <= 0.0 || !optionGetOutputScreen ())
return status;
@@ -168,7 +173,11 @@
glPushMatrix ();
glLoadMatrixf (sTransform.getMatrix ());
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f (1.0, 1.0, 1.0, mAlpha);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
@@ -244,9 +253,9 @@
glTranslatef (72, 45, 0);
glEnable (GL_TEXTURE_2D);
- isSet = false;
+ bool isSet = false;
- fps = (avgFps * 100.0);
+ unsigned int fps = (avgFps * 100.0);
fps = MIN (999999, fps);
for (unsigned int pos = 100000; pos >= 1; pos /= 10)
@@ -274,6 +283,9 @@
glPopAttrib();
glGetError();
+ if (!glBlendEnabled)
+ glDisable (GL_BLEND);
+
return status;
}
@@ -297,8 +309,7 @@
mOldLimiterMode ((CompositeFPSLimiterMode)
BenchOptions::FpsLimiterModeDefaultLimiter)
{
- optionSetInitiateKeyInitiate (boost::bind (&BenchScreen::initiate, this,
- _3));
+ optionSetInitiateKeyInitiate (boost::bind (&BenchScreen::initiate, this, _3));
optionSetFpsLimiterModeNotify
(boost::bind (&BenchScreen::limiterModeChanged, this, _1));
@@ -306,8 +317,7 @@
CompositeScreenInterface::setHandler (cScreen, false);
GLScreenInterface::setHandler (gScreen, false);
- mRect.setGeometry (optionGetPositionX (), optionGetPositionY (),
- TEX_WIDTH, TEX_HEIGHT);
+ mRect.setGeometry (optionGetPositionX (), optionGetPositionY (), TEX_WIDTH, TEX_HEIGHT);
mTimer.setCallback (boost::bind (&BenchScreen::timedOut, this));
glGenTextures (10, mNumTex);
@@ -317,7 +327,7 @@
glEnable (GL_TEXTURE_2D);
- for (int i = 0; i < 10; i++)
+ for (int i = 0; i < 10; ++i)
{
//Bind the texture
glBindTexture (GL_TEXTURE_2D, mNumTex[i]);
@@ -397,10 +407,8 @@
BenchScreen::~BenchScreen ()
{
if (mActive)
- {
- // Restore FPS limiter mode
- cScreen->setFPSLimiterMode (mOldLimiterMode);
- }
+ // Restore FPS limiter mode
+ cScreen->setFPSLimiterMode (mOldLimiterMode);
glDeleteLists (mDList, 2);
@@ -429,33 +437,31 @@
mActive = !mActive;
mActive &= optionGetOutputScreen () || optionGetOutputConsole ();
- Window xid;
-
- xid = (Window) CompOption::getIntOptionNamed (options, "root");
+ Window xid = (Window) CompOption::getIntOptionNamed (options, "root");
if (xid != ::screen->root ())
return false;
if (mActive)
{
- // Store current FPS limiter mode
- mOldLimiterMode = cScreen->FPSLimiterMode ();
+ // Store current FPS limiter mode
+ mOldLimiterMode = cScreen->FPSLimiterMode ();
- cScreen->setFPSLimiterMode ((CompositeFPSLimiterMode)
- optionGetFpsLimiterMode ());
+ cScreen->setFPSLimiterMode ((CompositeFPSLimiterMode)optionGetFpsLimiterMode ());
cScreen->preparePaintSetEnabled (this, true);
gScreen->glPaintOutputSetEnabled (this, true);
- for (int t = 0; t < MAX_SAMPLES; t++)
+ for (int t = 0; t < MAX_SAMPLES; ++t)
mSample[t] = 0;
}
else
{
- // Restore FPS limiter mode
- cScreen->setFPSLimiterMode (mOldLimiterMode);
+ // Restore FPS limiter mode
+ cScreen->setFPSLimiterMode (mOldLimiterMode);
mTimer.stop ();
}
+
mTimer.start (1000 / FADE_FPS);
mFrames = 0;
=== modified file 'plugins/bench/src/bench.h'
--- plugins/bench/src/bench.h 2012-09-04 15:33:44 +0000
+++ plugins/bench/src/bench.h 2013-07-21 23:03:28 +0000
@@ -58,16 +58,18 @@
public BenchOptions
{
public:
+
BenchScreen (CompScreen *screen);
~BenchScreen ();
CompositeScreen *cScreen;
GLScreen *gScreen;
- GLuint mDList;
- float mAlpha;
+ GLuint mDList;
+ float mAlpha;
- enum {
+ enum
+ {
MAX_FPS = 500,
FADE_FPS = 50,
SECONDS_PER_AVERAGE = 2,
@@ -75,21 +77,21 @@
MIN_MS_PER_UPDATE = 1000
};
- bool mFakedDamage;
- CompRect mRect;
- CompTimer mTimer;
-
- int mSample[MAX_SAMPLES];
- int mFrames;
- int mLastPrintFrames;
-
- struct timeval mLastPrint;
- struct timeval mLastRedraw;
-
- GLuint mNumTex[10];
- GLuint mBackTex;
-
- bool mActive;
+ bool mFakedDamage;
+ CompRect mRect;
+ CompTimer mTimer;
+
+ int mSample[MAX_SAMPLES];
+ int mFrames;
+ int mLastPrintFrames;
+
+ struct timeval mLastPrint;
+ struct timeval mLastRedraw;
+
+ GLuint mNumTex[10];
+ GLuint mBackTex;
+
+ bool mActive;
CompositeFPSLimiterMode mOldLimiterMode;
@@ -111,8 +113,10 @@
void preparePaint (int msSinceLastPaint);
bool glPaintOutput (const GLScreenPaintAttrib &,
- const GLMatrix &, const CompRegion &,
- CompOutput *, unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
};
class BenchPluginVTable :
@@ -122,4 +126,3 @@
bool init ();
};
-
=== modified file 'plugins/bicubic/src/bicubic.cpp'
--- plugins/bicubic/src/bicubic.cpp 2013-05-09 13:43:07 +0000
+++ plugins/bicubic/src/bicubic.cpp 2013-07-21 23:03:28 +0000
@@ -60,7 +60,7 @@
"hgX", "hgY", "cs00", "cs01", "cs10", "cs11"
};
- for (unsigned int i = 0; i < sizeof (filterTemp) / sizeof (filterTemp[0]); i++)
+ for (unsigned int i = 0; i < sizeof (filterTemp) / sizeof (filterTemp[0]); ++i)
data->addTempHeaderOp (filterTemp[i].c_str());
=== modified file 'plugins/blur/src/blur.cpp'
--- plugins/blur/src/blur.cpp 2013-05-09 13:43:07 +0000
+++ plugins/blur/src/blur.cpp 2013-07-21 23:03:28 +0000
@@ -55,11 +55,11 @@
ar1[0] = 1.0;
ar1[1] = 1.0;
- for (i = 3; i <= size; i++)
+ for (i = 3; i <= size; ++i)
{
ar2[0] = 1;
- for (j = 1; j < i - 1; j++)
+ for (j = 1; j < i - 1; ++j)
ar2[j] = (ar1[j - 1] + ar1[j]) * factor;
ar2[i - 1] = 1;
@@ -70,13 +70,13 @@
}
/* normalize */
- for (i = 0; i < size; i++)
+ for (i = 0; i < size; ++i)
sum += ar1[i];
if (sum != 0.0f)
sum = 1.0f / sum;
- for (i = 0; i < size; i++)
+ for (i = 0; i < size; ++i)
ar1[i] *= sum;
i = 0;
@@ -90,7 +90,7 @@
j = 1;
}
- for (; i < mySize; i++)
+ for (; i < mySize; ++i)
{
pos[i] = radius - j;
pos[i] -= ar1[j + 1] / (ar1[j] + ar1[j + 1]);
@@ -331,7 +331,7 @@
data += 2;
- for (i = 0; i < (n - 2) / 6; i++)
+ for (i = 0; i < (n - 2) / 6; ++i)
{
box.p1.gravity = *data++;
box.p1.x = *data++;
@@ -453,7 +453,7 @@
y2 > d.y1 ())
{
damage.shrink (-filterRadius, -filterRadius);
- count++;
+ ++count;
}
}
}
@@ -586,7 +586,7 @@
static const char *temp[] = { "offset0", "offset1", "sum" };
unsigned int i;
- for (i = 0; i < sizeof (temp) / sizeof (temp[0]); i++)
+ for (i = 0; i < sizeof (temp) / sizeof (temp[0]); ++i)
data.addTempHeaderOp (temp[i]);
data.addDataOp (
@@ -666,7 +666,7 @@
int numIndirectOp;
int base, end, ITCbase;
- for (i = 0; (unsigned int) i < sizeof (temp) / sizeof (temp[0]); i++)
+ for (i = 0; (unsigned int) i < sizeof (temp) / sizeof (temp[0]); ++i)
data.addTempHeaderOp (temp[i]);
if (saturation < 100)
@@ -681,7 +681,7 @@
for (i = 0;
(unsigned int) i < sizeof (filterTemp) / sizeof (filterTemp[0]);
- i++)
+ ++i)
data.addTempHeaderOp (filterTemp[i]);
data.addFetchOp ("output", NULL, target);
@@ -740,13 +740,13 @@
multiple indirection steps */
j = (numIndirect > 1) ? 0 : numITC;
- for (i = 0; i < numIndirectOp * 2; i++)
+ for (i = 0; i < numIndirectOp * 2; ++i)
{
snprintf (str, 1024, "pix_%d", i);
data.addTempHeaderOp (str);
}
- for (i = j * 2; i < numIndirectOp * 2; i++)
+ for (i = j * 2; i < numIndirectOp * 2; ++i)
{
snprintf (str, 1024, "coord_%d", i);
data.addTempHeaderOp (str);
@@ -768,14 +768,14 @@
"MUL sum, sum, %f;",
param + 1, amp[numTexop]);
- for (j = 0; j < numIndirect; j++)
+ for (j = 0; j < numIndirect; ++j)
{
base = j * numIndirectOp;
end = MIN ((j + 1) * numIndirectOp, numTexop) - base;
ITCbase = MAX (numITC - base, 0);
- for (i = ITCbase; i < end; i++)
+ for (i = ITCbase; i < end; ++i)
{
data.addDataOp (
"ADD coord_%d, fCoord, {0.0, %g, 0.0, 0.0};"
@@ -784,7 +784,7 @@
(i * 2) + 1, pos[base + i] * ty);
}
- for (i = 0; i < ITCbase; i++)
+ for (i = 0; i < ITCbase; ++i)
{
data.addDataOp (
"TXP pix_%d, fragment.texcoord[%d], texture[%d], %s;"
@@ -795,7 +795,7 @@
unit + 1, targetString);
}
- for (i = ITCbase; i < end; i++)
+ for (i = ITCbase; i < end; ++i)
{
data.addDataOp (
"TEX pix_%d, coord_%d, texture[%d], %s;"
@@ -806,7 +806,7 @@
unit + 1, targetString);
}
- for (i = 0; i < end * 2; i++)
+ for (i = 0; i < end * 2; ++i)
{
data.addDataOp (
"MAD sum, pix_%d, %f, sum;",
@@ -885,7 +885,7 @@
viewport[2] = output->width ();
viewport[3] = output->height ();
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 16; ++i)
{
dModel[i] = transform.getMatrix ()[i];
dProjection[i] = gScreen->projectionMatrix ()[i];
@@ -977,10 +977,10 @@
multiple indirection steps */
j = (numIndirect > 1) ? 0 : numITC;
- for (i = 0; i < numIndirectOp; i++)
+ for (i = 0; i < numIndirectOp; ++i)
str += sprintf (str,"TEMP pix_%d, pix_%d;", i * 2, (i * 2) + 1);
- for (i = j; i < numIndirectOp; i++)
+ for (i = j; i < numIndirectOp; ++i)
str += sprintf (str,"TEMP coord_%d, coord_%d;", i * 2, (i * 2) + 1);
str += sprintf (str,
@@ -998,28 +998,28 @@
ITCbase = MAX (numITC - base, 0);
- for (i = ITCbase; i < end; i++)
+ for (i = ITCbase; i < end; ++i)
str += sprintf (str,
"ADD coord_%d, texcoord, {%g, 0.0, 0.0, 0.0};"
"SUB coord_%d, texcoord, {%g, 0.0, 0.0, 0.0};",
i * 2, pos[base + i] * tx,
(i * 2) + 1, pos[base + i] * tx);
- for (i = 0; i < ITCbase; i++)
+ for (i = 0; i < ITCbase; ++i)
str += sprintf (str,
"TEX pix_%d, fragment.texcoord[%d], texture[0], %s;"
"TEX pix_%d, fragment.texcoord[%d], texture[0], %s;",
i * 2, ((i + base) * 2) + 1, targetString,
(i * 2) + 1, ((i + base) * 2) + 2, targetString);
- for (i = ITCbase; i < end; i++)
+ for (i = ITCbase; i < end; ++i)
str += sprintf (str,
"TEX pix_%d, coord_%d, texture[0], %s;"
"TEX pix_%d, coord_%d, texture[0], %s;",
i * 2, i * 2, targetString,
(i * 2) + 1, (i * 2) + 1, targetString);
- for (i = 0; i < end * 2; i++)
+ for (i = 0; i < end * 2; ++i)
str += sprintf (str,
"MAD sum, pix_%d, %f, sum;",
i, amp[base + (i / 2)]);
@@ -1145,7 +1145,7 @@
{
y = screen->height () - pBox->y2;
- for (i = 0; i < iTC; i++)
+ for (i = 0; i < iTC; ++i)
{
(*GL::multiTexCoord2f) (GL_TEXTURE1_ARB + (i * 2),
tx * (pBox->x1 + pos[i]),
@@ -1158,7 +1158,7 @@
glTexCoord2f (tx * pBox->x1, ty * y);
glVertex2i (pBox->x1, y);
- for (i = 0; i < iTC; i++)
+ for (i = 0; i < iTC; ++i)
{
(*GL::multiTexCoord2f) (GL_TEXTURE1_ARB + (i * 2),
tx * (pBox->x2 + pos[i]),
@@ -1173,7 +1173,7 @@
y = screen->height () - pBox->y1;
- for (i = 0; i < iTC; i++)
+ for (i = 0; i < iTC; ++i)
{
(*GL::multiTexCoord2f) (GL_TEXTURE1_ARB + (i * 2),
tx * (pBox->x2 + pos[i]),
@@ -1186,7 +1186,7 @@
glTexCoord2f (tx * pBox->x2, ty * y);
glVertex2i (pBox->x2, y);
- for (i = 0; i < iTC; i++)
+ for (i = 0; i < iTC; ++i)
{
(*GL::multiTexCoord2f) (GL_TEXTURE1_ARB + (i * 2),
tx * (pBox->x1 + pos[i]),
@@ -1199,7 +1199,7 @@
glTexCoord2f (tx * pBox->x1, ty * y);
glVertex2i (pBox->x1, y);
- pBox++;
+ ++pBox;
}
glEnd ();
@@ -1250,7 +1250,7 @@
/* we need to find the best value here */
if (nVertices <= MAX_VERTEX_PROJECT_COUNT)
{
- for (i = 0; i < nVertices; i++)
+ for (i = 0; i < nVertices; ++i)
{
if (gm->indexCount)
{
@@ -1275,7 +1275,7 @@
minZ = 1000000;
maxZ = -1000000;
- for (i = 0; i < gm->vCount; i++)
+ for (i = 0; i < gm->vCount; ++i)
{
v = vert + (stride * i);
@@ -1323,7 +1323,9 @@
nVertices * nQuadCombine))
return;
- for (i = 0; i < nVertices / 4; i++)
+ int x1, y1, x2, y2;
+
+ for (i = 0; i < nVertices / 4; ++i)
{
scr = scrv + (i * 4 * 2);
@@ -1347,15 +1349,12 @@
maxY = scr[j + 1];
}
- int x1, y1, x2, y2;
-
- x1 = minX - bScreen->filterRadius;
- y1 = screen->height () - maxY - bScreen->filterRadius;
- x2 = maxX + bScreen->filterRadius + 0.5f;
- y2 = screen->height () - minY + bScreen->filterRadius + 0.5f;
-
-
- bScreen->tmpRegion3 += CompRect (x1, y1, x2 - x1, y2 - y1);
+ x1 = minX - bScreen->filterRadius;
+ y1 = screen->height () - maxY - bScreen->filterRadius;
+ x2 = maxX + bScreen->filterRadius + 0.5f;
+ y2 = screen->height () - minY + bScreen->filterRadius + 0.5f;
+
+ bScreen->tmpRegion3 += CompRect (x1, y1, x2 - x1, y2 - y1);
}
}
@@ -1494,7 +1493,7 @@
bScreen->fboStatus = false;
- for (i = 0; i < textures; i++)
+ for (i = 0; i < textures; ++i)
{
if (!bScreen->texture[i])
glGenTextures (1, &bScreen->texture[i]);
@@ -1838,7 +1837,7 @@
GLMatrix tm, rm;
float s_gen[4], t_gen[4], q_gen[4];
- for (unsigned int i = 0; i < 16; i++)
+ for (unsigned int i = 0; i < 16; ++i)
tm[i] = 0;
tm[0] = (bScreen->output->width () / 2.0) *
bScreen->tx;
@@ -1856,7 +1855,7 @@
tm *= bScreen->mvp;
- for (int i = 0; i < iTC; i++)
+ for (int i = 0; i < iTC; ++i)
{
(*GL::activeTexture) (GL_TEXTURE0_ARB +
gWindow->geometry ().texUnits + (i * 2));
@@ -2009,7 +2008,7 @@
{
int i;
for (i = gWindow->geometry ().texUnits;
- i < gWindow->geometry ().texUnits + (2 * iTC); i++)
+ i < gWindow->geometry ().texUnits + (2 * iTC); ++i)
{
(*GL::activeTexture) (GL_TEXTURE0_ARB + i);
glDisable (GL_TEXTURE_GEN_S);
@@ -2061,7 +2060,7 @@
{
int i;
- for (i = 0; i < BLUR_STATE_NUM; i++)
+ for (i = 0; i < BLUR_STATE_NUM; ++i)
{
if (event->xproperty.atom == blurAtom[i])
{
@@ -2242,7 +2241,7 @@
blurTime = 1000.0f / optionGetBlurSpeed ();
blurOcclusion = optionGetOcclusion ();
- for (int i = 0; i < 2; i++)
+ for (int i = 0; i < 2; ++i)
texture[i] = 0;
glGetIntegerv (GL_STENCIL_BITS, &stencilBits);
@@ -2287,7 +2286,7 @@
if (fbo)
(*GL::deleteFramebuffers) (1, &fbo);
- for (int i = 0; i < 2; i++)
+ for (int i = 0; i < 2; ++i)
if (texture[i])
glDeleteTextures (1, &texture[i]);
@@ -2303,7 +2302,7 @@
pulse (false),
focusBlur (false)
{
- for (int i = 0; i < BLUR_STATE_NUM; i++)
+ for (int i = 0; i < BLUR_STATE_NUM; ++i)
{
state[i].threshold = 0;
state[i].clipped = false;
=== modified file 'plugins/blur/src/blur.h'
--- plugins/blur/src/blur.h 2012-09-07 22:37:20 +0000
+++ plugins/blur/src/blur.h 2013-07-21 23:03:28 +0000
@@ -211,6 +211,7 @@
int clientThreshold);
public:
+
CompWindow *window;
CompositeWindow *cWindow;
GLWindow *gWindow;
=== modified file 'plugins/clone/src/clone.cpp'
--- plugins/clone/src/clone.cpp 2013-05-09 13:43:07 +0000
+++ plugins/clone/src/clone.cpp 2013-07-21 23:03:28 +0000
@@ -71,12 +71,11 @@
fClone = new Clone ();
XSetWindowAttributes attr;
- int x, y;
attr.override_redirect = true;
- x = (int) screen->outputDevs ()[dst].x1 ();
- y = (int) screen->outputDevs ()[dst].y1 ();
+ int x = (int) screen->outputDevs ()[dst].x1 ();
+ int y = (int) screen->outputDevs ()[dst].y1 ();
fClone->input =
XCreateWindow (screen->dpy (),
@@ -140,10 +139,9 @@
CompOutput *dstOutput = &(screen->outputDevs () [iClone->dst]);
CompRegion dstOutputRegion (*dstOutput);
CompRegion srcOutputRegion (*srcOutput);
- int dx, dy;
- dx = dstOutput->x1 () - srcOutput->x1 ();
- dy = dstOutput->y1 () - srcOutput->y1 ();
+ int dx = dstOutput->x1 () - srcOutput->x1 ();
+ int dy = dstOutput->y1 () - srcOutput->y1 ();
if (cScreen->damageMask () & COMPOSITE_SCREEN_DAMAGE_REGION_MASK)
{
@@ -165,9 +163,7 @@
}
}
else
- {
iClone->region = srcOutputRegion;
- }
}
}
@@ -190,15 +186,15 @@
bool
CloneScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- CompOutput *output,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ CompOutput *output,
+ unsigned int mask)
{
- bool status;
- unsigned int dstForThisOutput, outputId = 0;
- CompRegion sRegion = region;
+ bool status;
+ unsigned int dstForThisOutput, outputId = 0;
+ CompRegion sRegion = region;
dstForThisOutput = outputId =
((unsigned int) output->id () != (unsigned int) ~0) ?
@@ -235,20 +231,15 @@
if (grab)
{
- GLMatrix sTransform = transform;
- GLenum filter;
- float zoom1, zoom2x, zoom2y, x1, y1, x2, y2;
- float zoomX, zoomY;
- int dx, dy;
-
- zoom1 = 160.0f / screen->outputDevs ()[src].height ();
-
- x1 = x - (screen->outputDevs ()[src].x1 () * zoom1);
- y1 = y - (screen->outputDevs ()[src].y1 () * zoom1);
+ float zoom1 = 160.0f / screen->outputDevs ()[src].height ();
+ float x1 = x - (screen->outputDevs ()[src].x1 () * zoom1);
+ float y1 = y - (screen->outputDevs ()[src].y1 () * zoom1);
x1 -= (screen->outputDevs ()[src].width () * zoom1) / 2;
y1 -= (screen->outputDevs ()[src].height () * zoom1) / 2;
+ float zoom2x, zoom2y, x2, y2;
+
if (grabHandle)
{
x2 = screen->outputDevs ()[grabbedOutput].x1 () -
@@ -280,11 +271,13 @@
if (y2 < 0.0f)
y2 *= zoom2y;
- dx = x1 * (1.0f - offset) + x2 * offset;
- dy = y1 * (1.0f - offset) + y2 * offset;
-
- zoomX = zoom1 * (1.0f - offset) + zoom2x * offset;
- zoomY = zoom1 * (1.0f - offset) + zoom2y * offset;
+ int dx = x1 * (1.0f - offset) + x2 * offset;
+ int dy = y1 * (1.0f - offset) + y2 * offset;
+
+ float zoomX = zoom1 * (1.0f - offset) + zoom2x * offset;
+ float zoomY = zoom1 * (1.0f - offset) + zoom2y * offset;
+
+ GLMatrix sTransform = transform;
sTransform.translate (-0.5f, -0.5f, -DEFAULT_Z_CAMERA);
sTransform.scale (1.0f / screen->outputDevs ()[outputId].width (),
@@ -295,7 +288,7 @@
0.0f);
sTransform.scale (zoomX, zoomY, 1.0f);
- filter = gScreen->textureFilter ();
+ GLenum filter = gScreen->textureFilter ();
if (offset == 0.0f)
gScreen->setTextureFilter (GL_LINEAR_MIPMAP_LINEAR);
@@ -307,15 +300,14 @@
GLMatrix gTransform = transform;
gTransform.translate (-100, 0, 0);
CLONE_WINDOW (w);
+
if (w->destroyed ())
continue;
- if (!w->shaded ())
- {
- if (!w->isViewable () || !cw->cWindow->damaged ())
- continue;
- }
-
+ if (!w->shaded () &&
+ (!w->isViewable () || !cw->cWindow->damaged ()))
+ continue;
+
cw->gWindow->glPaint (cw->gWindow->paintAttrib (), sTransform,
srcOutputRegion,
PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK);
@@ -329,9 +321,9 @@
bool
CloneWindow::glPaint (const GLWindowPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ unsigned int mask)
{
CLONE_SCREEN (screen);
@@ -348,11 +340,12 @@
CompOption::Vector options)
{
std::list ::iterator it = clones.begin ();
+
if (grab || screen->otherGrabExist ("clone", NULL))
- return false;
+ return false;
if (!grabHandle)
- grabHandle = screen->pushGrab (None, "clone");
+ grabHandle = screen->pushGrab (None, "clone");
grab = true;
@@ -364,15 +357,13 @@
/* trace source */
while (it != clones.end ())
{
- if ((*it)->dst == src)
- {
+ if ((*it)->dst == src)
+ {
src = (*it)->src;
it = clones.begin ();
- }
- else
- {
+ }
+ else
++it;
- }
}
togglePaintFunctions (this, true);
@@ -381,7 +372,6 @@
action->setState (action->state () | CompAction::StateTermButton);
return true;
-
}
bool
@@ -391,17 +381,15 @@
{
if (grabHandle)
{
- int x, y;
-
- screen->removeGrab (grabHandle, NULL);
+ screen->removeGrab (grabHandle, NULL);
grabHandle = NULL;
- x = CompOption::getIntOptionNamed (options, "x", 0);
- y = CompOption::getIntOptionNamed (options, "y", 0);
-
- dst = screen->outputDeviceForPoint (x, y);
-
- cScreen->damageScreen ();
+ int x = CompOption::getIntOptionNamed (options, "x", 0);
+ int y = CompOption::getIntOptionNamed (options, "y", 0);
+
+ dst = screen->outputDeviceForPoint (x, y);
+
+ cScreen->damageScreen ();
}
action->setState (action->state () & ~(CompAction::StateTermKey |
@@ -422,31 +410,34 @@
CompWindow *w;
w = screen->findWindow (clone->input);
+
if (!w)
return;
struts = new CompStruts ();
+
if (!struts)
return;
wStruts = w->struts ();
+
if (wStruts)
delete wStruts;
- struts->left.x = 0;
- struts->left.y = 0;
- struts->left.width = 0;
- struts->left.height = screen->height ();
-
- struts->right.x = screen->width ();
- struts->right.y = 0;
- struts->right.width = 0;
- struts->right.height = screen->height ();
-
- struts->top.x = 0;
- struts->top.y = 0;
- struts->top.width = screen->width ();
- struts->top.height = 0;
+ struts->left.x = 0;
+ struts->left.y = 0;
+ struts->left.width = 0;
+ struts->left.height = screen->height ();
+
+ struts->right.x = screen->width ();
+ struts->right.y = 0;
+ struts->right.width = 0;
+ struts->right.height = screen->height ();
+
+ struts->top.x = 0;
+ struts->top.y = 0;
+ struts->top.width = screen->width ();
+ struts->top.height = 0;
struts->bottom.x = 0;
struts->bottom.y = screen->height ();
@@ -503,12 +494,14 @@
handleMotionEvent (p);
}
break;
+
case EnterNotify:
case LeaveNotify:
{
CompPoint p (pointerX, pointerY);
handleMotionEvent (p);
}
+
default:
break;
@@ -526,6 +519,7 @@
setStrutsForCloneWindow (iClone);
}
}
+
default:
break;
}
@@ -581,9 +575,7 @@
CloneScreen::~CloneScreen ()
{
while (!clones.empty ())
- {
clones.pop_front ();
- }
}
bool
@@ -594,5 +586,9 @@
CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
return true;
+<<<<<<< TREE
return false;
+=======
+ return false;
+>>>>>>> MERGE-SOURCE
}
=== modified file 'plugins/clone/src/clone.h'
--- plugins/clone/src/clone.h 2012-01-31 17:01:32 +0000
+++ plugins/clone/src/clone.h 2013-07-21 23:03:28 +0000
@@ -41,10 +41,11 @@
class Clone
{
public:
- int src;
- int dst;
+
+ int src;
+ int dst;
CompRegion region;
- Window input;
+ Window input;
};
class CloneScreen :
@@ -55,23 +56,26 @@
public GLScreenInterface
{
public:
+
CloneScreen (CompScreen *);
~CloneScreen ();
- CompositeScreen *cScreen;
- GLScreen *gScreen;
+ CompositeScreen *cScreen;
+ GLScreen *gScreen;
CompScreen::GrabHandle grabHandle;
- bool grab;
-
- float offset;
-
- bool transformed;
-
- std::list clones;
- int x, y;
- int grabbedOutput;
- int src, dst;
+ bool grab;
+
+ float offset;
+
+ bool transformed;
+
+ std::list clones;
+ int x;
+ int y;
+ int grabbedOutput;
+ int src;
+ int dst;
void
handleEvent (XEvent *);
@@ -81,10 +85,10 @@
bool
glPaintOutput (const GLScreenPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- CompOutput *,
- unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
void
donePaint ();
@@ -99,8 +103,8 @@
bool
initiate (CompAction *action,
- CompAction::State state,
- CompOption::Vector options);
+ CompAction::State state,
+ CompOption::Vector options);
bool
terminate (CompAction *action,
@@ -120,16 +124,17 @@
public GLWindowInterface
{
public:
+
CloneWindow (CompWindow *window);
CompositeWindow *cWindow;
- GLWindow *gWindow;
+ GLWindow *gWindow;
bool
glPaint (const GLWindowPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- unsigned int mask);
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ unsigned int mask);
};
#define CLONE_SCREEN(s) \
=== modified file 'plugins/colorfilter/src/colorfilter.cpp'
--- plugins/colorfilter/src/colorfilter.cpp 2013-05-09 13:43:07 +0000
+++ plugins/colorfilter/src/colorfilter.cpp 2013-07-21 23:03:28 +0000
@@ -32,10 +32,8 @@
ColorfilterScreen::findFragmentFunction (int id)
{
foreach (ColorfilterFunction *function, filtersFunctions)
- {
if (function->id == (unsigned int) id)
return function;
- }
return NULL;
}
@@ -43,7 +41,8 @@
/* Actions handling functions ----------------------------------------------- */
void
-toggleWindowFunctions (ColorfilterWindow *cfw, bool enabled)
+toggleWindowFunctions (ColorfilterWindow *cfw,
+ bool enabled)
{
cfw->gWindow->glDrawTextureSetEnabled (cfw, enabled);
}
@@ -90,16 +89,18 @@
ColorfilterScreen::switchFilter ()
{
GLFragment::FunctionId id;
- ColorfilterFunction *function;
+ ColorfilterFunction *function;
/* % (count + 1) because of the cumulative filters mode */
currentFilter = (currentFilter + 1) % (filtersFunctions.size () + 1);
+
if (currentFilter == 0)
compLogMessage ("colorfilter", CompLogLevelInfo,
"Cumulative filters mode");
else
{
id = filtersFunctions.at (currentFilter - 1)->id;
+
if (id)
{
function = findFragmentFunction (id);
@@ -118,6 +119,7 @@
foreach (CompWindow *w, screen->windows ())
{
FILTER_WINDOW (w);
+
if (cfw->isFiltered)
cfw->cWindow->addDamage ();
}
@@ -185,6 +187,7 @@
while (!filtersFunctions.empty ())
{
ColorfilterFunction *function = filtersFunctions.back ();
+
if (function->id)
GLFragment::destroyFragmentFunction (function->id);
@@ -203,12 +206,11 @@
int
ColorfilterScreen::loadFilters (GLTexture *texture)
{
- int target, loaded, count;
+ int target;
GLFragment::FunctionId function;
- CompString name, file;
- CompOption::Value::Vector filters;
- FragmentParser *parser = new FragmentParser ();
- ColorfilterFunction *func;
+ CompString name, file;
+ FragmentParser *parser = new FragmentParser ();
+ ColorfilterFunction *func;
/* Free previously loaded filters and malloc */
unloadFilters ();
@@ -216,8 +218,8 @@
filtersLoaded = true;
/* Fetch filters filenames */
- filters = optionGetFilters ();
- count = filters.size ();
+ CompOption::Value::Vector filters = optionGetFilters ();
+ int count = filters.size ();
//filtersFunctions.resize (count);
@@ -228,11 +230,13 @@
target = COMP_FETCH_TARGET_RECT;
/* Load each filter one by one */
- loaded = 0;
- for (int i = 0; i < count; i++)
+ int loaded = 0;
+
+ for (int i = 0; i < count; ++i)
{
name = CompString (basename (filters.at (i).s ().c_str ()));
file = filters.at (i).s ();
+
if (name.empty ())
{
name.clear ();
@@ -245,6 +249,7 @@
function = parser->loadFragmentProgram (file, name, target);
func = new ColorfilterFunction ();
+
if (!func)
continue;
@@ -252,8 +257,9 @@
func->id = function;
filtersFunctions.push_back (func);
+
if (func && function)
- loaded++;
+ ++loaded;
}
/* Warn if there was at least one loading failure */
@@ -266,6 +272,7 @@
foreach (CompWindow *w, screen->windows ())
{
FILTER_WINDOW (w);
+
if (cfw->isFiltered)
cfw->cWindow->addDamage (w);
}
@@ -279,9 +286,9 @@
* Wrapper that enables filters if the window is filtered
*/
void
-ColorfilterWindow::glDrawTexture (GLTexture *texture,
+ColorfilterWindow::glDrawTexture (GLTexture *texture,
GLFragment::Attrib &attrib,
- unsigned int mask)
+ unsigned int mask)
{
GLFragment::FunctionId function;
@@ -316,12 +323,14 @@
if (shouldFilter) // ???
{
GLFragment::Attrib fa = attrib;
+
if (cfs->currentFilter == 0) /* Cumulative filters mode */
{
/* Enable each filter one by one */
foreach (ColorfilterFunction *func, cfs->filtersFunctions)
{
function = func->id;
+
if (function)
fa.addFunction (function);
}
@@ -332,15 +341,14 @@
/* Enable the currently selected filter if possible (i.e. if it
* was successfully loaded) */
function = cfs->filtersFunctions.at (cfs->currentFilter - 1)->id;
+
if (function)
fa.addFunction (function);
}
gWindow->glDrawTexture (texture, fa, mask);
}
else /* Not filtering */
- {
gWindow->glDrawTexture (texture, attrib, mask);
- }
}
/*
@@ -370,11 +378,10 @@
foreach (CompWindow *w, screen->windows ())
{
FILTER_WINDOW (w);
+
if (optionGetFilterMatch ().evaluate (w) &&
isFiltered && !cfw->isFiltered)
- {
cfw->toggle ();
- }
}
}
@@ -382,17 +389,18 @@
* Exclude match settings update callback
*/
void
-ColorfilterScreen::excludeMatchsChanged (CompOption *opt,
+ColorfilterScreen::excludeMatchsChanged (CompOption *opt,
ColorfilterOptions::Options num)
{
+ bool isExcluded;
+
/* Re-check every window against new match settings */
foreach (CompWindow *w, screen->windows ())
{
- bool isExcluded;
-
FILTER_WINDOW (w);
isExcluded = optionGetExcludeMatch ().evaluate (w);
+
if (isExcluded && cfw->isFiltered)
cfw->toggle ();
else if (!isExcluded && isFiltered && !cfw->isFiltered)
@@ -405,7 +413,7 @@
* Filters list setting update callback
*/
void
-ColorfilterScreen::filtersChanged (CompOption *opt,
+ColorfilterScreen::filtersChanged (CompOption *opt,
ColorfilterOptions::Options num)
{
/* Just set the filtersLoaded boolean to false, unloadFilters will be
@@ -417,7 +425,7 @@
* Damage decorations after the "Filter Decorations" setting got changed
*/
void
-ColorfilterScreen::damageDecorations (CompOption *opt,
+ColorfilterScreen::damageDecorations (CompOption *opt,
ColorfilterOptions::Options num)
{
cScreen->damageScreen ();
@@ -425,9 +433,9 @@
ColorfilterScreen::ColorfilterScreen (CompScreen *screen) :
PluginClassHandler (screen),
- cScreen (CompositeScreen::get (screen)),
- gScreen (GLScreen::get (screen)),
- isFiltered (false),
+ cScreen (CompositeScreen::get (screen)),
+ gScreen (GLScreen::get (screen)),
+ isFiltered (false),
currentFilter (0),
filtersLoaded (false)
{
@@ -463,9 +471,9 @@
ColorfilterWindow::ColorfilterWindow (CompWindow *window) :
PluginClassHandler (window),
- window (window),
- cWindow (CompositeWindow::get (window)),
- gWindow (GLWindow::get (window)),
+ window (window),
+ cWindow (CompositeWindow::get (window)),
+ gWindow (GLWindow::get (window)),
isFiltered (false)
{
GLWindowInterface::setHandler (gWindow, false);
@@ -484,10 +492,22 @@
"support, the plugin will continue to load but nothing"\
"will happen");
- if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
- CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
- CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
- return true;
-
- return false;
+<<<<<<< TREE
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
+ CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
+ CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
+ return true;
+
+ return false;
+=======
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
+ CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
+ CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
+ return true;
+
+ compLogMessage ("colorfilter", CompLogLevelError, "Required plugins "\
+ "'opengl' and 'composite' are not loaded");
+
+ return false;
+>>>>>>> MERGE-SOURCE
}
=== modified file 'plugins/colorfilter/src/colorfilter.h'
--- plugins/colorfilter/src/colorfilter.h 2012-09-04 15:33:44 +0000
+++ plugins/colorfilter/src/colorfilter.h 2013-07-21 23:03:28 +0000
@@ -38,7 +38,7 @@
public:
GLFragment::FunctionId id;
- CompString name;
+ CompString name;
};
class ColorfilterScreen :
@@ -51,7 +51,7 @@
~ColorfilterScreen ();
CompositeScreen *cScreen;
- GLScreen *gScreen;
+ GLScreen *gScreen;
bool isFiltered;
int currentFilter; /* 0 : cumulative mode
@@ -62,7 +62,7 @@
* is set to TRUE and filters will be loaded on next filtered window
* texture painting */
- bool filtersLoaded;
+ bool filtersLoaded;
std::vector filtersFunctions;
ColorfilterFunction *
@@ -99,24 +99,20 @@
windowAdd (CompWindow *w);
void
- matchsChanged (CompOption *opt,
+ matchsChanged (CompOption *opt,
ColorfilterOptions::Options num);
void
- excludeMatchsChanged (CompOption *opt,
+ excludeMatchsChanged (CompOption *opt,
ColorfilterOptions::Options num);
void
- filtersChanged (CompOption *opt,
+ filtersChanged (CompOption *opt,
ColorfilterOptions::Options num);
void
- damageDecorations (CompOption *opt,
+ damageDecorations (CompOption *opt,
ColorfilterOptions::Options num);
-
-
-
-
};
#define FILTER_SCREEN(s) \
@@ -131,16 +127,16 @@
ColorfilterWindow (CompWindow *);
~ColorfilterWindow ();
- CompWindow *window;
+ CompWindow *window;
CompositeWindow *cWindow;
- GLWindow *gWindow;
+ GLWindow *gWindow;
- bool isFiltered;
+ bool isFiltered;
void
- glDrawTexture (GLTexture *texture,
- GLFragment::Attrib &attrib,
- unsigned int mask);
+ glDrawTexture (GLTexture *texture,
+ GLFragment::Attrib &attrib,
+ unsigned int mask);
void
toggle ();
=== modified file 'plugins/colorfilter/src/parser.cpp'
--- plugins/colorfilter/src/parser.cpp 2012-08-03 10:12:25 +0000
+++ plugins/colorfilter/src/parser.cpp 2013-07-21 23:03:28 +0000
@@ -48,10 +48,11 @@
FragmentParser::ltrim (const CompString &string)
{
size_t pos = 0;
+
while (!(pos >= string.size ()))
{
if (isspace (string.at (pos)))
- pos++;
+ ++pos;
else
break;
}
@@ -75,7 +76,7 @@
if (!isalnum (name.at (pos)))
name[pos] = '_';
- pos++;
+ ++pos;
}
}
@@ -86,9 +87,7 @@
FragmentParser::programReadSource (const CompString &fname)
{
std::ifstream fp;
- int length;
- char *buffer;
- CompString data, path, home = CompString (getenv ("HOME"));
+ CompString path, home = CompString (getenv ("HOME"));
/* Try to open file fname as is */
fp.open (fname.c_str ());
@@ -110,25 +109,23 @@
/* If failed again & again, abort */
if (!fp.is_open ())
- {
return CompString ("");
- }
/* get length of file: */
fp.seekg (0, std::ios::end);
- length = fp.tellg ();
- length++;
+ int length = fp.tellg ();
+ ++length;
fp.seekg (0, std::ios::beg);
/* allocate memory */
- buffer = new char [length];
+ char *buffer = new char [length];
/* read data as a block: */
fp.read (buffer, length - 1);
buffer[length - 1] = '\0';
fp.close ();
- data = buffer;
+ CompString data = buffer;
delete[] buffer;
@@ -147,20 +144,17 @@
FragmentParser::getFirstArgument (const CompString &line,
size_t &pos)
{
- CompString arg;
- CompString string;
- size_t next, orig;
- int length;
- CompString retArg;
-
if (pos >= line.size ())
return CompString ("");
/* Left trim */
- string = FragmentParser::ltrim (line.substr (pos));
+ CompString string = FragmentParser::ltrim (line.substr (pos));
+ CompString retArg;
+ size_t next;
+ int length;
- orig = pos;
- pos = 0;
+ size_t orig = pos;
+ pos = 0;
/* Find next comma or semicolon (which isn't that useful since we
* are working on tokens delimited by semicolons) */
@@ -169,11 +163,13 @@
{
size_t temp;
length = next - pos;
+
if (!length)
{
pos = orig + 1;
return getFirstArgument (line, pos);
}
+
if ((temp = string.find ("{", pos) != std::string::npos) && temp < next &&
(temp = string.find ("}", pos) != std::string::npos) && temp > next)
{
@@ -188,7 +184,7 @@
length = string.substr (pos).size ();
/* Allocate, copy and end string */
- arg = string.substr (pos, length);
+ CompString arg = string.substr (pos, length);
/* Increment source pointer */
if ((orig + arg.size () + 1) <= line.size ())
@@ -207,24 +203,20 @@
FragmentParser::FragmentOffset *
FragmentParser::programAddOffsetFromAddOp (const CompString &source)
{
- FragmentOffset offset;
- CompString op;
- size_t pos = 0;
- CompString name;
- CompString offsetString;
- CompString temp;
+ if (source.size () < 5)
+ return NULL;
+
std::list ::iterator it = offsets.begin ();
- if (source.size () < 5)
- return NULL;
-
- op = source;
+ CompString op = source;
+ size_t pos = 0;
pos += 3;
- name = getFirstArgument (op, pos);
+ CompString name = getFirstArgument (op, pos);
+
if (name.empty ())
return NULL;
- temp = getFirstArgument (op, pos);
+ CompString temp = getFirstArgument (op, pos);
/* If an offset with the same name is
* already registered, skip this one */
@@ -235,11 +227,14 @@
/* Just use the end of the op as the offset */
pos += 1;
- offsetString = ltrim (op.substr (pos));
+ CompString offsetString = ltrim (op.substr (pos));
+
if (offsetString.empty ())
return NULL;
- offset.name = name;
+ FragmentOffset offset;
+
+ offset.name = name;
offset.offset = offsetString;
offsets.push_back (offset);
@@ -278,23 +273,24 @@
*/
void
FragmentParser::programParseSource (GLFragment::FunctionData *data,
- int target, CompString &source)
+ int target,
+ CompString &source)
{
CompString line, next;
CompString current;
+ CompString origcurrent;
CompString strtok;
- size_t pos = 0, strippos = 0;
- int length, oplength, type;
+ size_t nPos, strippos = 0;
+ int length, oplength, type;
CompString arg1, arg2, temp;
/* Find the header, skip it, and start parsing from there */
- pos = source.find ("!!ARBfp1.0", pos);
+ size_t pos = source.find ("!!ARBfp1.0", pos);
+
if (pos != std::string::npos)
- {
pos += 9;
- }
/* Strip comments */
while ((strippos = source.find ("#", strippos)) != std::string::npos)
@@ -319,11 +315,11 @@
/* Parse each instruction */
while (!(pos >= (source.size () - 1)))
{
- size_t nPos = source.find (";", pos + 1);
- line = source.substr (pos + 1, nPos - pos);
- CompString origcurrent = current = ltrim (line);
+ nPos = source.find (";", pos + 1);
+ line = source.substr (pos + 1, nPos - pos);
+ origcurrent = current = ltrim (line);
/* Find instruction type */
- type = NoOp;
+ type = NoOp;
/* Data ops */
if (current.substr (0, 3) == "END")
@@ -385,7 +381,9 @@
else
type = DataOp;
}
+
size_t cpos = 0;
+
switch (type)
{
/* Data op : just copy paste the
@@ -393,7 +391,8 @@
case DataOp:
data->addDataOp (current.c_str ());
break;
- /* Parse arguments one by one */
+
+ /* Parse arguments one by one */
case TempOp:
case AttribOp:
case ParamOp:
@@ -401,8 +400,10 @@
if (type == TempOp) oplength = 4;
else if (type == ParamOp) oplength = 5;
else if (type == AttribOp) oplength = 6;
- length = current.size ();
- if (length < oplength + 2) break;
+ length = current.size ();
+
+ if (length < oplength + 2)
+ break;
cpos = oplength + 1;
@@ -422,6 +423,7 @@
}
}
break;
+
case FetchOp:
{
/* Example : TEX tmp, coord, texture[0], RECT;
@@ -448,6 +450,7 @@
}
}
break;
+
case ColorOp:
{
if (current.substr (0, 3) == "MUL") /* MUL op, 2 ops */
@@ -456,15 +459,9 @@
* MOV arg1, fragment.color, arg2 */
cpos += 3;
- if (!(arg1 = getFirstArgument (current, cpos)).size ())
- {
- break;
- }
-
- if (!(temp = getFirstArgument (current, cpos)).size ())
- break;
-
- if (!(arg2 = getFirstArgument (current, cpos)).size ())
+ if (!(arg1 = getFirstArgument (current, cpos)).size () ||
+ !(temp = getFirstArgument (current, cpos)).size () ||
+ !(arg2 = getFirstArgument (current, cpos)).size ())
break;
data->addColorOp (arg1.c_str (), arg2.c_str ());
@@ -480,11 +477,14 @@
}
break;
}
+
default:
break;
}
+
pos = nPos;
}
+
programFreeOffset ();
}
@@ -492,21 +492,24 @@
* Build a Compiz Fragment Function from a source string
*/
GLFragment::FunctionId
-FragmentParser::buildFragmentProgram (CompString &source,
+FragmentParser::buildFragmentProgram (CompString &source,
const CompString &name,
- int target)
+ int target)
{
- GLFragment::FunctionData *data;
- int handle;
/* Create the function data */
- data = new GLFragment::FunctionData ();
+ GLFragment::FunctionData *data = new GLFragment::FunctionData ();
+
if (!data)
return 0;
+
/* Parse the source and fill the function data */
programParseSource (data, target, source);
+
/* Create the function */
- handle = data->createFragmentFunction (name.c_str ());
+ int handle = data->createFragmentFunction (name.c_str ());
+
delete data;
+
return handle;
}
@@ -515,20 +518,18 @@
*/
GLFragment::FunctionId
FragmentParser::loadFragmentProgram (const CompString &file,
- CompString &name,
- int target)
+ CompString &name,
+ int target)
{
- CompString source;
GLFragment::FunctionId handle;
/* Clean fragment program name */
programCleanName (name);
/* Read the source file */
- source = programReadSource (file);
+ CompString source = programReadSource (file);
+
if (source.empty ())
- {
return 0;
- }
/* Build the Compiz Fragment Program */
handle = buildFragmentProgram (source,
=== modified file 'plugins/compiztoolbox/src/compiztoolbox.cpp'
--- plugins/compiztoolbox/src/compiztoolbox.cpp 2013-05-12 08:13:05 +0000
+++ plugins/compiztoolbox/src/compiztoolbox.cpp 2013-07-21 23:03:28 +0000
@@ -39,6 +39,7 @@
public CompiztoolboxOptions
{
public:
+
CompizToolboxScreen (CompScreen *);
};
@@ -46,6 +47,7 @@
public CompPlugin::VTableForScreen
{
public:
+
bool init ();
void fini ();
};
@@ -70,13 +72,15 @@
"XDG_VIDEOS_DIR"
};
const char *varName = varNames[userDir];
- size_t varLength = strlen (varName);
+ size_t varLength = strlen (varName);
char *home = getenv ("HOME");
+
if (!(home && strlen (home)))
return "";
char *configHome = getenv ("XDG_CONFIG_HOME");
+
if (configHome && strlen (configHome))
{
userDirsFilePath = configHome;
@@ -88,7 +92,9 @@
userDirsFilePath =
userDirsFilePath + "/.config" + userDirsPathSuffix;
}
+
userDirsFile.open (userDirsFilePath.c_str (), std::ifstream::in);
+
if (!userDirsFile.is_open ())
return "";
@@ -101,6 +107,7 @@
getline (userDirsFile, line);
size_t varPos = line.find (varName);
+
if (varPos != CompString::npos) // if found
{
userDirsFile.close ();
@@ -120,17 +127,16 @@
return value;
}
}
+
userDirsFile.close ();
+
return "";
}
-
void
BaseSwitchScreen::setSelectedWindowHint (bool focus)
{
Window selectedWindowId = None;
- CompOption::Vector opts;
- CompOption::Value v;
if (selectedWindow && !selectedWindow->destroyed ())
{
@@ -144,15 +150,15 @@
selectedWindow->moveInputFocusTo ();
}
- v = CompOption::Value ((int) selectedWindowId);
- opts = selectWinAtom.getReadTemplate ();
+ CompOption::Value v = CompOption::Value ((int) selectedWindowId);
+ CompOption::Vector opts = selectWinAtom.getReadTemplate ();
opts.at (0).set (v);
selectWinAtom.updateProperty (popupWindow, opts, XA_WINDOW);
}
void
-BaseSwitchScreen::getMinimizedAndMatch (bool &minimizedOption,
+BaseSwitchScreen::getMinimizedAndMatch (bool &minimizedOption,
CompMatch *&matchOption)
{
minimizedOption = false;
@@ -162,7 +168,7 @@
bool
BaseSwitchWindow::isSwitchWin (bool removing)
{
- bool minimizedOption;
+ bool minimizedOption;
CompMatch *matchOption;
baseScreen->getMinimizedAndMatch (minimizedOption, matchOption);
@@ -178,52 +184,37 @@
return false;
}
else
- {
return false;
- }
}
- if (!window->isFocussable ())
- return false;
-
- if (window->overrideRedirect ())
+ if (!window->isFocussable () ||
+ window->overrideRedirect ())
return false;
if (baseScreen->selection == Panels)
{
- if (!(window->type () &
- (CompWindowTypeDockMask | CompWindowTypeDesktopMask)))
- return false;
- }
- else
- {
- if (window->wmType () &
- (CompWindowTypeDockMask | CompWindowTypeDesktopMask))
- return false;
-
- if (window->state () & CompWindowStateSkipTaskbarMask)
- return false;
-
- if (matchOption && !matchOption->evaluate (window))
- return false;
- }
+ if (!(window->type () & (CompWindowTypeDockMask | CompWindowTypeDesktopMask)))
+ return false;
+ }
+ else if (window->wmType () & (CompWindowTypeDockMask | CompWindowTypeDesktopMask) ||
+ window->state () & CompWindowStateSkipTaskbarMask ||
+ (matchOption && !matchOption->evaluate (window)))
+ return false;
if (!removing && baseScreen->selection == CurrentViewport)
{
if (!window->mapNum () || !window->isViewable ())
{
const CompWindow::Geometry &sg = window->serverGeometry ();
- if (sg.x () + sg.width () <= 0 ||
- sg.y () + sg.height () <= 0 ||
+
+ if (sg.x () + sg.width () <= 0 ||
+ sg.y () + sg.height () <= 0 ||
sg.x () >= (int) ::screen->width () ||
sg.y () >= (int) ::screen->height ())
return false;
}
- else
- {
- if (!window->focus ())
+ else if (!window->focus ())
return false;
- }
}
return true;
@@ -282,10 +273,12 @@
if (toNext)
{
++it;
+
if (it == windows.end ())
w = windows.front ();
else
w = *it;
+
nextIdx = (cur + 1) % windows.size ();
}
else
@@ -294,6 +287,7 @@
w = windows.back ();
else
w = *--it;
+
nextIdx = (cur + windows.size () - 1) % windows.size ();
}
@@ -332,9 +326,8 @@
if (popupWindow)
{
- CompWindow *popup;
+ CompWindow *popup = ::screen->findWindow (popupWindow);
- popup = ::screen->findWindow (popupWindow);
if (popup)
CompositeWindow::get (popup)->addDamage ();
@@ -359,28 +352,27 @@
Visual *
BaseSwitchScreen::findArgbVisual (Display *dpy, int scr)
{
- XVisualInfo *xvi;
- XVisualInfo temp;
- int nvi;
- int i;
- XRenderPictFormat *format;
- Visual *visual;
+ XVisualInfo temp;
+ int nvi;
+ XRenderPictFormat *format;
temp.screen = scr;
temp.depth = 32;
temp.c_class = TrueColor;
- xvi = XGetVisualInfo (dpy,
- VisualScreenMask |
- VisualDepthMask |
- VisualClassMask,
- &temp,
- &nvi);
+ XVisualInfo *xvi = XGetVisualInfo (dpy,
+ VisualScreenMask |
+ VisualDepthMask |
+ VisualClassMask,
+ &temp,
+ &nvi);
+
if (!xvi)
return 0;
- visual = 0;
- for (i = 0; i < nvi; i++)
+ Visual *visual = 0;
+
+ for (int i = 0; i < nvi; ++i)
{
format = XRenderFindVisualFormat (dpy, xvi[i].visual);
if (format->type == PictTypeDirect && format->direct.alphaMask)
@@ -409,12 +401,12 @@
if (!openGLAvailable)
return;
- GLWindowPaintAttrib sAttrib (attrib);
- IconMode iconMode;
- int wx, wy;
- float width, height;
- GLTexture *icon = NULL;
- const CompWindow::Geometry &g = window->geometry ();
+ GLWindowPaintAttrib sAttrib (attrib);
+ IconMode iconMode;
+ int wx, wy;
+ float width, height;
+ GLTexture *icon = NULL;
+ const CompWindow::Geometry &g = window->geometry ();
mask |= PAINT_WINDOW_TRANSFORMED_MASK;
@@ -423,25 +415,20 @@
else
iconMode = getIconMode ();
- if (window->mapNum ())
- {
- if (gWindow->textures ().empty ())
- gWindow->bind ();
- }
+ if (window->mapNum () &&
+ gWindow->textures ().empty ())
+ gWindow->bind ();
if (iconMode != ShowIconOnly)
{
- GLenum filter;
GLMatrix wTransform (transform);
- int ww, wh;
- int addWindowGeometryIndex =
- gWindow->glAddGeometryGetCurrentIndex ();
+ int addWindowGeometryIndex = gWindow->glAddGeometryGetCurrentIndex ();
width = width1;
height = height1;
- ww = window->borderRect ().width ();
- wh = window->borderRect ().height ();
+ int ww = window->borderRect ().width ();
+ int wh = window->borderRect ().height ();
if (ww > width)
sAttrib.xScale = width / ww;
@@ -477,7 +464,7 @@
sAttrib.yTranslate / sAttrib.yScale - g.y (),
0.0f);
- filter = gScreen->textureFilter ();
+ GLenum filter = gScreen->textureFilter ();
if (baseScreen->getMipmap ())
gScreen->setTextureFilter (GL_LINEAR_MIPMAP_LINEAR);
@@ -494,6 +481,7 @@
if (iconMode != HideIcon)
{
icon = gWindow->getIcon (MAX_ICON_SIZE, MAX_ICON_SIZE);
+
if (icon)
updateIconTexturedWindow (sAttrib, wx, wy, x, y, icon);
}
@@ -508,6 +496,7 @@
/* if none found, try a large one */
if (!icon)
icon = gWindow->getIcon (MAX_ICON_SIZE, MAX_ICON_SIZE);
+
if (!icon)
icon = gScreen->defaultIcon ();
@@ -560,9 +549,8 @@
if (baseScreen->grabIndex)
{
- CompWindow *popup;
+ CompWindow *popup = ::screen->findWindow (baseScreen->popupWindow);
- popup = ::screen->findWindow (baseScreen->popupWindow);
if (popup)
{
foreach (CompWindow *w, baseScreen->windows)
@@ -582,18 +570,18 @@
void
BaseSwitchScreen::updateForegroundColor ()
{
- Atom actual;
- int result, format;
+ if (!popupWindow)
+ return;
+
+ Atom actual;
+ int format;
unsigned long n, left;
unsigned char *propData;
- if (!popupWindow)
- return;
-
- result = XGetWindowProperty (::screen->dpy (), popupWindow,
- selectFgColorAtom, 0L, 4L, false,
- XA_INTEGER, &actual, &format,
- &n, &left, &propData);
+ int result = XGetWindowProperty (::screen->dpy (), popupWindow,
+ selectFgColorAtom, 0L, 4L, false,
+ XA_INTEGER, &actual, &format,
+ &n, &left, &propData);
if (result == Success && n && propData)
{
@@ -625,7 +613,8 @@
{
CompWindow *w = NULL;
- switch (event->type) {
+ switch (event->type)
+ {
case DestroyNotify:
/* We need to get the CompWindow * for event->xdestroywindow.window
here because in the ::screen->handleEvent call below, that
@@ -633,27 +622,30 @@
able to find the CompWindow after that. */
w = ::screen->findWindow (event->xdestroywindow.window);
break;
+
default:
break;
}
::screen->handleEvent (event);
- switch (event->type) {
+ switch (event->type)
+ {
case UnmapNotify:
w = ::screen->findWindow (event->xunmap.window);
windowRemove (w);
break;
+
case DestroyNotify:
windowRemove (w);
break;
+
case PropertyNotify:
if (event->xproperty.atom == selectFgColorAtom)
- {
if (event->xproperty.window == popupWindow)
updateForegroundColor ();
- }
break;
+
default:
break;
}
@@ -669,8 +661,8 @@
ignoreSwitcher (false)
{
CompOption::Vector atomTemplate;
- CompOption::Value v;
- CompOption o;
+ CompOption::Value v;
+ CompOption o;
if (openGLAvailable)
{
@@ -685,8 +677,8 @@
atomTemplate);
selectFgColorAtom =
- XInternAtom (::screen->dpy (),
- DECOR_SWITCH_FOREGROUND_COLOR_ATOM_NAME, 0);
+ XInternAtom (::screen->dpy (),
+ DECOR_SWITCH_FOREGROUND_COLOR_ATOM_NAME, 0);
fgColor[0] = 0;
fgColor[1] = 0;
@@ -704,7 +696,6 @@
cWindow = CompositeWindow::get (w);
gScreen = GLScreen::get (screen);
}
-
}
CompizToolboxScreen::CompizToolboxScreen (CompScreen *screen) :
@@ -715,6 +706,7 @@
bool
CompizToolboxPluginVTable::init ()
{
+<<<<<<< TREE
if (CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
openGLAvailable = true;
@@ -728,8 +720,26 @@
screen->storeValue ("compiztoolbox_ABI", p);
return true;
}
-
- return false;
+=======
+ CompPrivate p;
+ p.uval = COMPIZ_COMPIZTOOLBOX_ABI;
+ screen->storeValue ("compiztoolbox_ABI", p);
+>>>>>>> MERGE-SOURCE
+
+<<<<<<< TREE
+ return false;
+=======
+ openGLAvailable = true;
+
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
+ CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
+ CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
+ return true;
+
+ openGLAvailable = false;
+
+ return false;
+>>>>>>> MERGE-SOURCE
}
void
=== modified file 'plugins/composite/src/composite.cpp'
=== modified file 'plugins/composite/src/pixmapbinding/include/pixmapbinding.h'
--- plugins/composite/src/pixmapbinding/include/pixmapbinding.h 2012-06-22 04:38:21 +0000
+++ plugins/composite/src/pixmapbinding/include/pixmapbinding.h 2013-07-21 23:03:28 +0000
@@ -169,11 +169,11 @@
typedef boost::function NewPixmapReadyCallback;
- PixmapBinding (const NewPixmapReadyCallback &,
- WindowPixmapGetInterface *,
+ PixmapBinding (const NewPixmapReadyCallback &,
+ WindowPixmapGetInterface *,
WindowAttributesGetInterface *,
- PixmapFreezerInterface *,
- ServerGrabInterface *);
+ PixmapFreezerInterface *,
+ ServerGrabInterface *);
~PixmapBinding ();
@@ -186,17 +186,16 @@
private:
- std::auto_ptr mPixmap;
- CompSize mSize;
- bool needsRebind;
- bool bindFailed;
- NewPixmapReadyCallback newPixmapReadyCallback;
+ std::auto_ptr mPixmap;
+ CompSize mSize;
+ bool needsRebind;
+ bool bindFailed;
+ NewPixmapReadyCallback newPixmapReadyCallback;
- WindowPixmapGetInterface *windowPixmapRetreiver;
+ WindowPixmapGetInterface *windowPixmapRetreiver;
WindowAttributesGetInterface *windowAttributesRetreiver;
- PixmapFreezerInterface *pixmapFreezer;
- ServerGrabInterface *serverGrab;
-
+ PixmapFreezerInterface *pixmapFreezer;
+ ServerGrabInterface *serverGrab;
};
#endif
=== modified file 'plugins/composite/src/pixmapbinding/src/pixmapbinding.cpp'
--- plugins/composite/src/pixmapbinding/src/pixmapbinding.cpp 2012-06-22 04:38:21 +0000
+++ plugins/composite/src/pixmapbinding/src/pixmapbinding.cpp 2013-07-21 23:03:28 +0000
@@ -31,10 +31,10 @@
#include "pixmapbinding.h"
PixmapBinding::PixmapBinding (const NewPixmapReadyCallback &cb,
- WindowPixmapGetInterface *pmg,
- WindowAttributesGetInterface *wag,
- PixmapFreezerInterface *pf,
- ServerGrabInterface *sg) :
+ WindowPixmapGetInterface *pmg,
+ WindowAttributesGetInterface *wag,
+ PixmapFreezerInterface *pf,
+ ServerGrabInterface *sg) :
mPixmap (),
mSize (),
needsRebind (true),
@@ -86,7 +86,8 @@
ServerLock mLock (serverGrab);
windowAttributesRetreiver->getAttributes (attr);
- if (attr.map_state != IsViewable ||
+
+ if (attr.map_state != IsViewable ||
(attr.width == 0 && attr.border_width == 0) ||
(attr.height == 0 && attr.border_width == 0))
{
=== modified file 'plugins/composite/src/privates.h'
--- plugins/composite/src/privates.h 2012-09-20 09:35:40 +0000
+++ plugins/composite/src/privates.h 2013-07-21 23:03:28 +0000
@@ -47,6 +47,7 @@
public CompositeOptions
{
public:
+
PrivateCompositeScreen (CompositeScreen *cs);
~PrivateCompositeScreen ();
@@ -70,51 +71,62 @@
CompositeScreen *cScreen;
- int compositeEvent, compositeError, compositeOpcode;
- int damageEvent, damageError;
- int fixesEvent, fixesError, fixesVersion;
-
- bool shapeExtension;
- int shapeEvent, shapeError;
-
- bool randrExtension;
- int randrEvent, randrError;
-
- CompRegion damage;
- unsigned long damageMask;
-
- CompRegion tmpRegion;
-
- Window overlay;
- Window output;
-
- std::list exposeRects;
-
- CompPoint windowPaintOffset;
-
- int overlayWindowCount;
- bool outputShapeChanged;
-
- struct timeval lastRedraw;
- int redrawTime;
- int optimalRedrawTime;
- bool scheduled, painting, reschedule;
-
- bool slowAnimations;
-
- CompTimer paintTimer;
+ int compositeEvent;
+ int compositeError;
+ int compositeOpcode;
+
+ int damageEvent;
+ int damageError;
+
+ int fixesEvent;
+ int fixesError;
+ int fixesVersion;
+
+ bool shapeExtension;
+ int shapeEvent;
+ int shapeError;
+
+ bool randrExtension;
+ int randrEvent;
+ int randrError;
+
+ CompRegion damage;
+ unsigned long damageMask;
+
+ CompRegion tmpRegion;
+
+ Window overlay;
+ Window output;
+
+ std::list exposeRects;
+
+ CompPoint windowPaintOffset;
+
+ int overlayWindowCount;
+ bool outputShapeChanged;
+
+ struct timeval lastRedraw;
+ int redrawTime;
+ int optimalRedrawTime;
+ bool scheduled;
+ bool painting;
+ bool reschedule;
+
+ bool slowAnimations;
+
+ CompTimer paintTimer;
compiz::composite::PaintHandler *pHnd;
- CompositeFPSLimiterMode FPSLimiterMode;
-
- CompWindowList withDestroyedWindows;
-
- Atom cmSnAtom;
- Window newCmSnOwner;
+ CompositeFPSLimiterMode FPSLimiterMode;
+
+ CompWindowList withDestroyedWindows;
+
+ Atom cmSnAtom;
+ Window newCmSnOwner;
/* Map Damage handle to its bounding box */
- std::map damages;
+ std::map damages;
};
class PrivateCompositeWindow :
@@ -125,12 +137,20 @@
public PixmapFreezerInterface
{
public:
+
PrivateCompositeWindow (CompWindow *w, CompositeWindow *cw);
~PrivateCompositeWindow ();
void windowNotify (CompWindowNotify n);
- void resizeNotify (int dx, int dy, int dwidth, int dheight);
- void moveNotify (int dx, int dy, bool now);
+
+ void resizeNotify (int dx,
+ int dy,
+ int dwidth,
+ int dheight);
+
+ void moveNotify (int dx,
+ int dy,
+ bool now);
Pixmap pixmap () const;
bool bind ();
@@ -147,25 +167,26 @@
int height);
public:
+
CompWindow *window;
CompositeWindow *cWindow;
CompositeScreen *cScreen;
- PixmapBinding mPixmapBinding;
-
- Damage damage;
-
- bool damaged;
- bool redirected;
- bool overlayWindow;
-
- unsigned short opacity;
- unsigned short brightness;
- unsigned short saturation;
-
- XRectangle *damageRects;
- int sizeDamage;
- int nDamage;
+ PixmapBinding mPixmapBinding;
+
+ Damage damage;
+
+ bool damaged;
+ bool redirected;
+ bool overlayWindow;
+
+ unsigned short opacity;
+ unsigned short brightness;
+ unsigned short saturation;
+
+ XRectangle *damageRects;
+ int sizeDamage;
+ int nDamage;
private:
=== modified file 'plugins/composite/src/screen.cpp'
--- plugins/composite/src/screen.cpp 2013-04-19 11:03:09 +0000
+++ plugins/composite/src/screen.cpp 2013-07-21 23:03:28 +0000
@@ -74,18 +74,21 @@
if (event->xproperty.atom == Atoms::winOpacity)
{
w = screen->findWindow (event->xproperty.window);
+
if (w)
CompositeWindow::get (w)->updateOpacity ();
}
else if (event->xproperty.atom == Atoms::winBrightness)
{
w = screen->findWindow (event->xproperty.window);
+
if (w)
CompositeWindow::get (w)->updateBrightness ();
}
else if (event->xproperty.atom == Atoms::winSaturation)
{
w = screen->findWindow (event->xproperty.window);
+
if (w)
CompositeWindow::get (w)->updateSaturation ();
}
@@ -96,9 +99,16 @@
event->type == shapeEvent + ShapeNotify)
{
w = screen->findWindow (((XShapeEvent *) event)->window);
- if (w &&
- w->mapNum ())
- CompositeWindow::get (w)->addDamage ();
+<<<<<<< TREE
+ if (w &&
+ w->mapNum ())
+ CompositeWindow::get (w)->addDamage ();
+=======
+
+ if (w &&
+ w->mapNum ())
+ CompositeWindow::get (w)->addDamage ();
+>>>>>>> MERGE-SOURCE
}
else if (event->type == damageEvent + XDamageNotify)
{
@@ -120,6 +130,7 @@
if (event->xclient.message_type == Atoms::winOpacity)
{
w = screen->findWindow (event->xclient.window);
+
if (w && (w->type () & CompWindowTypeDesktopMask) == 0)
{
unsigned short opacity = event->xclient.data.l[0] >> 16;
@@ -131,6 +142,7 @@
else if (event->xclient.message_type == Atoms::winBrightness)
{
w = screen->findWindow (event->xclient.window);
+
if (w)
{
unsigned short brightness = event->xclient.data.l[0] >> 16;
@@ -142,6 +154,7 @@
else if (event->xclient.message_type == Atoms::winSaturation)
{
w = screen->findWindow (event->xclient.window);
+
if (w)
{
unsigned short saturation = event->xclient.data.l[0] >> 16;
@@ -266,39 +279,39 @@
}
PrivateCompositeScreen::PrivateCompositeScreen (CompositeScreen *cs) :
- cScreen (cs),
- compositeEvent (0),
- compositeError (0),
- compositeOpcode (0),
- damageEvent (0),
- damageError (0),
- fixesEvent (0),
- fixesError (0),
- fixesVersion (0),
- shapeExtension (false),
- shapeEvent (0),
- shapeError (0),
- randrExtension (false),
- randrEvent (0),
- randrError (0),
- damageMask (COMPOSITE_SCREEN_DAMAGE_ALL_MASK),
- overlay (None),
- output (None),
- exposeRects (),
- windowPaintOffset (0, 0),
+ cScreen (cs),
+ compositeEvent (0),
+ compositeError (0),
+ compositeOpcode (0),
+ damageEvent (0),
+ damageError (0),
+ fixesEvent (0),
+ fixesError (0),
+ fixesVersion (0),
+ shapeExtension (false),
+ shapeEvent (0),
+ shapeError (0),
+ randrExtension (false),
+ randrEvent (0),
+ randrError (0),
+ damageMask (COMPOSITE_SCREEN_DAMAGE_ALL_MASK),
+ overlay (None),
+ output (None),
+ exposeRects (),
+ windowPaintOffset (0, 0),
overlayWindowCount (0),
outputShapeChanged (false),
- redrawTime (1000 / FALLBACK_REFRESH_RATE),
- optimalRedrawTime (1000 / FALLBACK_REFRESH_RATE),
- scheduled (false),
- painting (false),
- reschedule (false),
- slowAnimations (false),
- pHnd (NULL),
- FPSLimiterMode (CompositeFPSLimiterModeDefault),
+ redrawTime (1000 / FALLBACK_REFRESH_RATE),
+ optimalRedrawTime (1000 / FALLBACK_REFRESH_RATE),
+ scheduled (false),
+ painting (false),
+ reschedule (false),
+ slowAnimations (false),
+ pHnd (NULL),
+ FPSLimiterMode (CompositeFPSLimiterModeDefault),
withDestroyedWindows (),
- cmSnAtom (0),
- newCmSnOwner (None)
+ cmSnAtom (0),
+ newCmSnOwner (None)
{
gettimeofday (&lastRedraw, 0);
// wrap outputChangeNotify
@@ -394,14 +407,12 @@
bool
CompositeScreen::registerPaintHandler (compiz::composite::PaintHandler *pHnd)
{
- Display *dpy;
+ if (priv->pHnd)
+ return false;
WRAPABLE_HND_FUNCTN_RETURN (bool, registerPaintHandler, pHnd);
- dpy = screen->dpy ();
-
- if (priv->pHnd)
- return false;
+ Display *dpy = screen->dpy ();
CompScreen::checkForError (dpy);
@@ -438,11 +449,9 @@
void
CompositeScreen::unregisterPaintHandler ()
{
- Display *dpy;
-
WRAPABLE_HND_FUNCTN (unregisterPaintHandler)
- dpy = screen->dpy ();
+ Display *dpy = screen->dpy ();
foreach (CompWindow *w, screen->windows ())
{
@@ -495,11 +504,11 @@
void
CompositeScreen::damageRegion (const CompRegion ®ion)
{
+ if (priv->damageMask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK)
+ return;
+
WRAPABLE_HND_FUNCTN (damageRegion, region);
- if (priv->damageMask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK)
- return;
-
priv->damage += region;
priv->damageMask |= COMPOSITE_SCREEN_DAMAGE_REGION_MASK;
@@ -534,9 +543,8 @@
if (priv->pHnd)
{
Display *dpy = screen->dpy ();
- XserverRegion region;
- region = XFixesCreateRegion (dpy, NULL, 0);
+ XserverRegion region = XFixesCreateRegion (dpy, NULL, 0);
XFixesSetWindowShapeRegion (dpy,
priv->output,
@@ -575,11 +583,9 @@
if (priv->pHnd)
{
Display *dpy = screen->dpy ();
- XserverRegion region;
CompRegion tmpRegion (screen->region ());
- for (CompWindowList::reverse_iterator rit =
- screen->windows ().rbegin ();
+ for (CompWindowList::reverse_iterator rit = screen->windows ().rbegin ();
rit != screen->windows ().rend (); ++rit)
if (CompositeWindow::get (*rit)->overlayWindow ())
tmpRegion -= (*rit)->region ();
@@ -587,8 +593,7 @@
XShapeCombineRegion (dpy, priv->output, ShapeBounding,
0, 0, tmpRegion.handle (), ShapeSet);
-
- region = XFixesCreateRegion (dpy, NULL, 0);
+ XserverRegion region = XFixesCreateRegion (dpy, NULL, 0);
XFixesSetWindowShapeRegion (dpy,
priv->output,
@@ -637,7 +642,8 @@
}
void
-CompositeScreen::setWindowPaintOffset (int x, int y)
+CompositeScreen::setWindowPaintOffset (int x,
+ int y)
{
priv->windowPaintOffset = CompPoint (x, y);
}
@@ -782,11 +788,12 @@
/* substract top most overlay window region */
if (priv->overlayWindowCount)
{
- for (CompWindowList::reverse_iterator rit =
- screen->windows ().rbegin ();
+ CompWindow *w;
+
+ for (CompWindowList::reverse_iterator rit = screen->windows ().rbegin ();
rit != screen->windows ().rend (); ++rit)
{
- CompWindow *w = (*rit);
+ w = (*rit);
if (w->destroyed () || w->invisible ())
continue;
@@ -833,14 +840,22 @@
CompOutput::ptrList outputs (0);
+<<<<<<< TREE
if (priv->optionGetForceIndependentOutputPainting () ||
!screen->hasOverlappingOutputs ())
{
+=======
+ if (priv->optionGetForceIndependentOutputPainting () ||
+ !screen->hasOverlappingOutputs ())
+>>>>>>> MERGE-SOURCE
foreach (CompOutput &o, screen->outputDevs ())
{
outputs.push_back (&o);
+<<<<<<< TREE
}
}
+=======
+>>>>>>> MERGE-SOURCE
else
outputs.push_back (&screen->fullscreenOutput ());
@@ -864,6 +879,7 @@
priv->lastRedraw = tv;
priv->painting = false;
priv->scheduled = false;
+
if (priv->reschedule)
priv->scheduleRepaint ();
@@ -944,10 +960,13 @@
CompRect rect;
foreach (CompRect rect, exposeRects)
- {
cScreen->damageRegion (CompRegion (rect));
+<<<<<<< TREE
}
+=======
+
+>>>>>>> MERGE-SOURCE
exposeRects.clear ();
}
}
=== modified file 'plugins/composite/src/window.cpp'
--- plugins/composite/src/window.cpp 2013-04-13 13:53:39 +0000
+++ plugins/composite/src/window.cpp 2013-07-21 23:03:28 +0000
@@ -65,7 +65,7 @@
if (!priv->redirected)
{
- priv->cScreen->overlayWindowCount ()--;
+ --priv->cScreen->overlayWindowCount ();
if (priv->cScreen->overlayWindowCount () < 1)
priv->cScreen->showOutputWindow ();
@@ -101,24 +101,24 @@
PrivateCompositeWindow::PrivateCompositeWindow (CompWindow *w,
CompositeWindow *cw) :
- window (w),
- cWindow (cw),
- cScreen (CompositeScreen::get (screen)),
+ window (w),
+ cWindow (cw),
+ cScreen (CompositeScreen::get (screen)),
mPixmapBinding (boost::function (),
this,
this,
this,
screen->serverGrabInterface ()),
- damage (None),
- damaged (false),
- redirected (cScreen->compositingActive ()),
- overlayWindow (false),
- opacity (OPAQUE),
- brightness (BRIGHT),
- saturation (COLOR),
- damageRects (0),
- sizeDamage (0),
- nDamage (0)
+ damage (None),
+ damaged (false),
+ redirected (cScreen->compositingActive ()),
+ overlayWindow (false),
+ opacity (OPAQUE),
+ brightness (BRIGHT),
+ saturation (COLOR),
+ damageRects (0),
+ sizeDamage (0),
+ nDamage (0)
{
WindowInterface::setHandler (w);
}
@@ -185,8 +185,8 @@
* currently using it for animations
*/
bool pendingUnmap = !window->mapNum () && window->isViewable ();
- bool hidden = window->state () & CompWindowStateHiddenMask;
- bool animated = window->hasUnmapReference ();
+ bool hidden = window->state () & CompWindowStateHiddenMask;
+ bool animated = window->hasUnmapReference ();
return (pendingUnmap || hidden) && animated;
}
@@ -223,7 +223,7 @@
if (priv->overlayWindow)
{
- priv->cScreen->overlayWindowCount ()--;
+ --priv->cScreen->overlayWindowCount ();
priv->overlayWindow = false;
}
@@ -241,9 +241,9 @@
release ();
- priv->redirected = false;
+ priv->redirected = false;
priv->overlayWindow = true;
- priv->cScreen->overlayWindowCount ()++;
+ ++priv->cScreen->overlayWindowCount ();
if (priv->cScreen->overlayWindowCount () > 0)
priv->cScreen->updateOutputWindow ();
@@ -310,8 +310,13 @@
if (priv->window->shaded () ||
(priv->window->isViewable ()))
{
+<<<<<<< TREE
const CompWindow::Geometry &geom = priv->window->geometry ();
const CompWindowExtents &output = priv->window->output ();
+=======
+ const CompWindow::Geometry &geom = priv->window->geometry ();
+ const CompWindowExtents &output = priv->window->output ();
+>>>>>>> MERGE-SOURCE
/* top */
int x1 = -output.left - geom.border ();
@@ -418,7 +423,8 @@
priv->damageRects[priv->nDamage].y = de->area.y;
priv->damageRects[priv->nDamage].width = de->area.width;
priv->damageRects[priv->nDamage].height = de->area.height;
- priv->nDamage++;
+
+ ++priv->nDamage;
}
else
priv->handleDamageRect (this, de->area.x, de->area.y,
@@ -565,9 +571,8 @@
case CompWindowNotifySyncAlarm:
{
- XRectangle *rects;
+ XRectangle *rects = damageRects;
- rects = damageRects;
while (nDamage--)
{
PrivateCompositeWindow::handleDamageRect (cWindow,
@@ -587,7 +592,10 @@
}
void
-PrivateCompositeWindow::resizeNotify (int dx, int dy, int dwidth, int dheight)
+PrivateCompositeWindow::resizeNotify (int dx,
+ int dy,
+ int dwidth,
+ int dheight)
{
window->resizeNotify (dx, dy, dwidth, dheight);
@@ -611,10 +619,13 @@
}
void
-PrivateCompositeWindow::moveNotify (int dx, int dy, bool now)
+PrivateCompositeWindow::moveNotify (int dx,
+ int dy,
+ bool now)
{
if (window->shaded () || (window->isViewable ()))
{
+<<<<<<< TREE
int x = window->geometry ().x ();
int y = window->geometry ().y ();
@@ -624,6 +635,15 @@
window->output ().right - dx;
int y2 = y + window->geometry ().height () +
window->output ().bottom - dy;
+=======
+ int x = window->geometry ().x ();
+ int y = window->geometry ().y ();
+
+ int x1 = x - window->output ().left - dx;
+ int y1 = y - window->output ().top - dy;
+ int x2 = x + window->geometry ().width () + window->output ().right - dx;
+ int y2 = y + window->geometry ().height () + window->output ().bottom - dy;
+>>>>>>> MERGE-SOURCE
cScreen->damageRegion (CompRegion (CompRect (x1, y1, x2 - x1, y2 - y1)));
}
@@ -634,5 +654,6 @@
}
bool
-CompositeWindowInterface::damageRect (bool initial, const CompRect &rect)
+CompositeWindowInterface::damageRect (bool initial,
+ const CompRect &rect)
WRAPABLE_DEF (damageRect, initial, rect)
=== modified file 'plugins/copytex/src/copytex.cpp'
--- plugins/copytex/src/copytex.cpp 2013-05-09 13:43:07 +0000
+++ plugins/copytex/src/copytex.cpp 2013-07-21 23:03:28 +0000
@@ -30,7 +30,8 @@
const int MAX_SUB_TEX = 2048;
const unsigned int SHM_SIZE = MAX_SUB_TEX * MAX_SUB_TEX * 4;
-static GLTexture::Matrix _identity_matrix = {
+static GLTexture::Matrix _identity_matrix =
+{
1.0f, 0.0f,
0.0f, 1.0f,
0.0f, 0.0f
@@ -47,15 +48,19 @@
return GLTexture::List ();
CopyPixmap::Ptr cp (CopyPixmap::create (pixmap, width, height, depth));
+
if (!cp->textures.size ())
return GLTexture::List ();
else
{
GLTexture::List tl (cp->textures.size ());
- for (unsigned int i = 0; i < cp->textures.size (); i++)
+
+ for (unsigned int i = 0; i < cp->textures.size (); ++i)
tl[i] = cp->textures[i];
- return tl;
+
+ return tl;
}
+
return GLTexture::List ();
}
@@ -65,9 +70,9 @@
int height,
int depth)
{
- int maxTS = MIN (MAX_SUB_TEX, GL::maxTextureSize);
- int nWidth = ceil ((float) width / (float) maxTS);
- int nHeight = ceil ((float) height / (float) maxTS);
+ int maxTS = MIN (MAX_SUB_TEX, GL::maxTextureSize);
+ int nWidth = ceil ((float) width / (float) maxTS);
+ int nHeight = ceil ((float) height / (float) maxTS);
CopyPixmap::Ptr cp (new CopyPixmap (pixmap, width, height, depth));
cp->textures.resize (nWidth * nHeight);
@@ -83,7 +88,6 @@
MIN (w, maxTS),
MIN (h, maxTS)));
-
cp->damage = XDamageCreate (screen->dpy (), cp->pixmap, XDamageReportBoundingBox);
CopytexScreen::get (screen)->pixmaps[cp->damage] = cp;
@@ -91,12 +95,12 @@
}
CopyPixmap::CopyPixmap (Pixmap pixmap,
- int width,
- int height,
- int depth) :
+ int width,
+ int height,
+ int depth) :
pixmap (pixmap),
damage (None),
- depth (depth)
+ depth (depth)
{
}
@@ -104,13 +108,14 @@
{
if (damage)
XDamageDestroy (screen->dpy (), damage);
+
if (CopytexScreen::get (screen))
CopytexScreen::get (screen)->pixmaps.erase (damage);
}
CopyTexture::CopyTexture (CopyPixmap::Ptr cp, CompRect dim) :
- cp (cp),
- dim (dim),
+ cp (cp),
+ dim (dim),
damage (0, 0, dim.width (), dim.height ())
{
GLenum target;
@@ -170,23 +175,20 @@
void
CopyTexture::update ()
{
+ if (!damage.width () || !damage.height ())
+ return;
+
COPY_SCREEN (screen);
- char *addr = 0;
- Pixmap tmpPix;
- XImage *image = 0;
-
XGCValues gcv;
- GC gc;
-
- if (!damage.width () || !damage.height ())
- return;
gcv.graphics_exposures = false;
gcv.subwindow_mode = IncludeInferiors;
- gc = XCreateGC (screen->dpy (), cp->pixmap,
+ GC gc = XCreateGC (screen->dpy (), cp->pixmap,
GCGraphicsExposures | GCSubwindowMode, &gcv);
+ Pixmap tmpPix;
+
if (cs->useShm)
tmpPix = XShmCreatePixmap (screen->dpy (), cp->pixmap,
cs->shmInfo.shmaddr, &cs->shmInfo,
@@ -201,6 +203,9 @@
damage.width (), damage.height (), 0, 0);
XSync (screen->dpy (), false);
+ char *addr = 0;
+ XImage *image = 0;
+
if (cs->useShm)
addr = cs->shmInfo.shmaddr;
else
@@ -224,6 +229,7 @@
glBindTexture (target (), 0);
XFreePixmap (screen->dpy (), tmpPix);
XFreeGC (screen->dpy (), gc);
+
if (image)
XDestroyImage (image);
@@ -247,12 +253,13 @@
CopytexScreen::handleEvent (XEvent *event)
{
screen->handleEvent (event);
+
if (event->type == damageNotify)
{
XDamageNotifyEvent *de = (XDamageNotifyEvent *) event;
- std::map::iterator it =
- pixmaps.find (de->damage);
+ std::map::iterator it = pixmaps.find (de->damage);
+
if (it != pixmaps.end ())
{
CopyPixmap::Ptr cp = it->second;
@@ -277,22 +284,23 @@
if (x1 < x2 && y1 < y2)
t->damage.setGeometry (x1, y1, x2 - x1, y2 - y1);
-
}
}
}
}
-
CopytexScreen::CopytexScreen (CompScreen *screen) :
PluginClassHandler (screen)
{
useShm = false;
+
if (XShmQueryExtension (screen->dpy ()))
{
int i;
Bool b;
+
XShmQueryVersion (screen->dpy (), &i, &i, &b);
+
if (b)
useShm = true;
}
@@ -300,6 +308,7 @@
if (useShm)
{
shmInfo.shmid = shmget (IPC_PRIVATE, SHM_SIZE, IPC_CREAT | 0600);
+
if (shmInfo.shmid < 0)
{
compLogMessage ("copytex", CompLogLevelError,
@@ -311,6 +320,7 @@
if (useShm)
{
shmInfo.shmaddr = (char *) shmat (shmInfo.shmid, 0, 0);
+
if (shmInfo.shmaddr == ((char *)-1))
{
shmctl (shmInfo.shmid, IPC_RMID, 0);
@@ -323,6 +333,7 @@
if (useShm)
{
shmInfo.readOnly = false;
+
if (!XShmAttach (screen->dpy (), &shmInfo))
{
shmdt (shmInfo.shmaddr);
@@ -333,13 +344,12 @@
}
}
- damageNotify = CompositeScreen::get (screen)->damageEvent () +
- XDamageNotify;
+ damageNotify = CompositeScreen::get (screen)->damageEvent () + XDamageNotify;
ScreenInterface::setHandler (screen);
hnd = GLScreen::get (screen)->
- registerBindPixmap (CopyPixmap::bindPixmapToTexture);
+ registerBindPixmap (CopyPixmap::bindPixmapToTexture);
}
CopytexScreen::~CopytexScreen ()
@@ -350,6 +360,7 @@
shmdt (shmInfo.shmaddr);
shmctl (shmInfo.shmid, IPC_RMID, 0);
}
+
GLScreen::get (screen)->unregisterBindPixmap (hnd);
}
=== modified file 'plugins/copytex/src/copytex.h'
--- plugins/copytex/src/copytex.h 2012-09-18 11:32:20 +0000
+++ plugins/copytex/src/copytex.h 2013-07-21 23:03:28 +0000
@@ -34,13 +34,15 @@
#include
#include
-extern const int MAX_SUB_TEX;
+extern const int MAX_SUB_TEX;
extern const unsigned int SHM_SIZE;
class CopyTexture;
-class CopyPixmap {
+class CopyPixmap
+{
public:
+
typedef std::vector Textures;
typedef boost::shared_ptr Ptr;
@@ -59,22 +61,25 @@
compiz::opengl::PixmapSource source);
public:
+
Textures textures;
- Pixmap pixmap;
- Damage damage;
- int depth;
+ Pixmap pixmap;
+ Damage damage;
+ int depth;
private:
CopyPixmap (Pixmap pixmap,
- int width,
- int height,
- int depth);
+ int width,
+ int height,
+ int depth);
};
-class CopyTexture : public GLTexture {
+class CopyTexture : public GLTexture
+{
public:
+
CopyTexture (boost::shared_ptr cp, CompRect dim);
~CopyTexture ();
@@ -88,6 +93,7 @@
}
public:
+
CopyPixmap::Ptr cp;
CompRect dim;
CompRect damage;
@@ -98,19 +104,20 @@
public PluginClassHandler
{
public:
+
CopytexScreen (CompScreen *screen);
~CopytexScreen ();
void handleEvent (XEvent *);
- bool useShm;
- XShmSegmentInfo shmInfo;
+ bool useShm;
+ XShmSegmentInfo shmInfo;
- int damageNotify;
+ int damageNotify;
std::map pixmaps;
- GLTexture::BindPixmapHandle hnd;
+ GLTexture::BindPixmapHandle hnd;
};
#define COPY_SCREEN(s) \
@@ -120,6 +127,6 @@
public CompPlugin::VTableForScreen
{
public:
+
bool init ();
-
};
=== modified file 'plugins/crashhandler/src/crashhandler.cpp'
--- plugins/crashhandler/src/crashhandler.cpp 2013-05-09 13:43:07 +0000
+++ plugins/crashhandler/src/crashhandler.cpp 2013-07-21 23:03:28 +0000
@@ -44,7 +44,7 @@
if (sig == SIGSEGV || sig == SIGFPE || sig == SIGILL || sig == SIGABRT)
{
- CrashScreen *cs = CrashScreen::get (screen);
+ CrashScreen *cs = CrashScreen::get (screen);
static int count = 0;
if (++count > 1 || !cs)
@@ -77,11 +77,11 @@
exit (0);
}
}
+
exit (ret ? ret : 1);
}
}
-
void
CrashScreen::optionChanged (CompOption *opt,
CrashhandlerOptions::Options num)
@@ -105,7 +105,9 @@
signal (SIGILL, SIG_DFL);
signal (SIGABRT, SIG_DFL);
}
+
break;
+
default:
break;
}
@@ -135,8 +137,8 @@
CrashScreen::~CrashScreen ()
{
signal (SIGSEGV, SIG_DFL);
- signal (SIGFPE, SIG_DFL);
- signal (SIGILL, SIG_DFL);
+ signal (SIGFPE, SIG_DFL);
+ signal (SIGILL, SIG_DFL);
signal (SIGABRT, SIG_DFL);
}
=== modified file 'plugins/cube/src/cube.cpp'
--- plugins/cube/src/cube.cpp 2013-05-31 10:56:27 +0000
+++ plugins/cube/src/cube.cpp 2013-07-21 23:03:28 +0000
@@ -30,7 +30,7 @@
#include
#include
-#include
+#include "privates.h"
class CubePluginVTable :
public CompPlugin::VTableForScreenAndWindow
@@ -238,7 +238,26 @@
PrivateCubeScreen::updateGeometry (int sides,
int invert)
{
+<<<<<<< TREE
+=======
+ /* This will never happen, but we want to calm down the static
+ * code analyzer Coverity
+ * for details, see: https://bugs.launchpad.net/compiz/+bug/1101541
+ */
+ if (!sides)
+ return false;
+
+ sides *= mNOutput;
+
+ GLfloat mps = M_PI / sides;
+ GLfloat tmps = 2 * mps;
+ GLfloat distance = 0.5f / tanf (mps);
+ GLfloat radius = 0.5f / sinf (mps);
+ GLfloat normInvert = 0.5f * invert;
+ int i, n = (sides + 2) * 2;
+>>>>>>> MERGE-SOURCE
GLfloat *v;
+<<<<<<< TREE
int i;
sides *= mNOutput;
@@ -247,10 +266,13 @@
GLfloat radius = 0.5f / sinf (M_PI / sides);
int n = (sides + 2) * 2;
+=======
+>>>>>>> MERGE-SOURCE
if (mNVertices != n)
{
v = (GLfloat *) realloc (mVertices, sizeof (GLfloat) * n * 3);
+
if (!v)
return false;
@@ -261,14 +283,14 @@
v = mVertices;
*v++ = 0.0f;
- *v++ = 0.5 * invert;
+ *v++ = normInvert;
*v++ = 0.0f;
for (i = 0; i <= sides; ++i)
{
- *v++ = radius * sinf (i * 2 * M_PI / sides + M_PI / sides);
- *v++ = 0.5 * invert;
- *v++ = radius * cosf (i * 2 * M_PI / sides + M_PI / sides);
+ *v++ = radius * sinf (i * tmps + mps);
+ *v++ = normInvert;
+ *v++ = radius * cosf (i * tmps + mps);
}
*v++ = 0.0f;
@@ -277,9 +299,9 @@
for (i = sides; i >= 0; --i)
{
- *v++ = radius * sinf (i * 2 * M_PI / sides + M_PI / sides);
- *v++ = -0.5 * invert;
- *v++ = radius * cosf (i * 2 * M_PI / sides + M_PI / sides);
+ *v++ = radius * sinf (i * tmps + mps);
+ *v++ = -normInvert;
+ *v++ = radius * cosf (i * tmps + mps);
}
mInvert = invert;
@@ -381,12 +403,10 @@
mNOutput = j;
- if (mNOutput == 1)
- {
- if (screen->outputDevs ()[0].width () != screen->width () ||
- screen->outputDevs ()[0].height () != screen->height ())
- mFullscreenOutput = true;
- }
+ if (mNOutput == 1 &&
+ (screen->outputDevs ()[0].width () != screen->width () ||
+ screen->outputDevs ()[0].height () != screen->height ()))
+ mFullscreenOutput = true;
}
void
@@ -406,6 +426,7 @@
GLfloat MaxUShortFloat = static_cast
(std::numeric_limits ::max ());
GLfloat aaafTextureData[128][128][3];
+<<<<<<< TREE
GLfloat fRStart = optionGetSkydomeGradientStartColorRed () / MaxUShortFloat;
GLfloat fGStart = optionGetSkydomeGradientStartColorGreen () / MaxUShortFloat;
@@ -424,6 +445,26 @@
GLfloat fB = fBStart;
for (int iX = 127; iX >= 0; --iX)
+=======
+
+ GLfloat fRStart = optionGetSkydomeGradientStartColorRed () / MaxUShortFloat;
+ GLfloat fGStart = optionGetSkydomeGradientStartColorGreen () / MaxUShortFloat;
+ GLfloat fBStart = optionGetSkydomeGradientStartColorBlue () / MaxUShortFloat;
+
+ GLfloat fREnd = optionGetSkydomeGradientEndColorRed () / MaxUShortFloat;
+ GLfloat fGEnd = optionGetSkydomeGradientEndColorGreen () / MaxUShortFloat;
+ GLfloat fBEnd = optionGetSkydomeGradientEndColorBlue () / MaxUShortFloat;
+
+ GLfloat fRStep = (fREnd - fRStart) / 128.0f;
+ GLfloat fGStep = (fGEnd - fGStart) / 128.0f;
+ GLfloat fBStep = (fBStart - fBEnd) / 128.0f;
+
+ GLfloat fR = fRStart;
+ GLfloat fG = fGStart;
+ GLfloat fB = fBStart;
+
+ for (int iX = 127; iX >= 0; --iX)
+>>>>>>> MERGE-SOURCE
{
fR += fRStep;
fG += fGStep;
@@ -519,6 +560,7 @@
iSlicesEnd = 44; /* max. 128 */
}
+<<<<<<< TREE
GLfloat fStepX = 1.0 / (GLfloat) (iSlicesEnd - iSlicesStart);
GLfloat fStepY = 1.0 / (GLfloat) (iStacksEnd - iStacksStart);
@@ -526,6 +568,16 @@
return;
if (!fillCircleTable (&sint1, &cost1, -iSlices))
+=======
+ GLfloat fStepX = 1.0 / (GLfloat) (iSlicesEnd - iSlicesStart);
+ GLfloat fStepY = 1.0 / (GLfloat) (iStacksEnd - iStacksStart);
+
+ GLfloat oneMinusFStepX = 1.0f - fStepX;
+ GLfloat oneMinusFStepY = 1.0f - fStepY;
+
+ if (!mSky.size () ||
+ !fillCircleTable (&sint1, &cost1, -iSlices))
+>>>>>>> MERGE-SOURCE
return;
if (!fillCircleTable (&sint2, &cost2, iStacks * 2))
@@ -536,10 +588,10 @@
}
afTexCoordX[0] = 1.0f;
- afTexCoordY[0] = 1.0f - fStepY;
- afTexCoordX[1] = 1.0f - fStepX;
- afTexCoordY[1] = 1.0f - fStepY;
- afTexCoordX[2] = 1.0f - fStepX;
+ afTexCoordY[0] = oneMinusFStepY;
+ afTexCoordX[1] = oneMinusFStepX;
+ afTexCoordY[1] = oneMinusFStepY;
+ afTexCoordX[2] = oneMinusFStepX;
afTexCoordY[2] = 1.0f;
afTexCoordX[3] = 1.0f;
afTexCoordY[3] = 1.0f;
@@ -551,13 +603,16 @@
mSky[0]->enable (GLTexture::Good);
+ GLfloat mSkyWidth = mSkySize.width ();
+ GLfloat mSkyHeight = mSkySize.height ();
+
glBegin (GL_QUADS);
for (int i = iStacksStart; i < iStacksEnd; ++i)
{
afTexCoordX[0] = 1.0f;
- afTexCoordX[1] = 1.0f - fStepX;
- afTexCoordX[2] = 1.0f - fStepX;
+ afTexCoordX[1] = oneMinusFStepX;
+ afTexCoordX[2] = oneMinusFStepX;
afTexCoordX[3] = 1.0f;
for (int j = iSlicesStart; j < iSlicesEnd; ++j)
@@ -569,8 +624,8 @@
y = sint1[j];
glTexCoord2f (
- COMP_TEX_COORD_X (mSky[0]->matrix (), afTexCoordX[3] * mSkySize.width ()),
- COMP_TEX_COORD_Y (mSky[0]->matrix (), afTexCoordY[3] * mSkySize.height ()));
+ COMP_TEX_COORD_X (mSky[0]->matrix (), afTexCoordX[3] * mSkyWidth),
+ COMP_TEX_COORD_Y (mSky[0]->matrix (), afTexCoordY[3] * mSkyHeight));
glVertex3f (x * r * fRadius, y * r * fRadius, z * fRadius);
/* top-right */
@@ -580,8 +635,8 @@
y = sint1[j];
glTexCoord2f (
- COMP_TEX_COORD_X (mSky[0]->matrix (), afTexCoordX[0] * mSkySize.width ()),
- COMP_TEX_COORD_Y (mSky[0]->matrix (), afTexCoordY[0] * mSkySize.height ()));
+ COMP_TEX_COORD_X (mSky[0]->matrix (), afTexCoordX[0] * mSkyWidth),
+ COMP_TEX_COORD_Y (mSky[0]->matrix (), afTexCoordY[0] * mSkyHeight));
glVertex3f (x * r * fRadius, y * r * fRadius, z * fRadius);
/* top-left */
@@ -591,8 +646,8 @@
y = sint1[j + 1];
glTexCoord2f (
- COMP_TEX_COORD_X (mSky[0]->matrix (), afTexCoordX[1] * mSkySize.width ()),
- COMP_TEX_COORD_Y (mSky[0]->matrix (), afTexCoordY[1] * mSkySize.height ()));
+ COMP_TEX_COORD_X (mSky[0]->matrix (), afTexCoordX[1] * mSkyWidth),
+ COMP_TEX_COORD_Y (mSky[0]->matrix (), afTexCoordY[1] * mSkyHeight));
glVertex3f (x * r * fRadius, y * r * fRadius, z * fRadius);
/* bottom-left */
@@ -602,8 +657,8 @@
y = sint1[j + 1];
glTexCoord2f (
- COMP_TEX_COORD_X (mSky[0]->matrix (), afTexCoordX[2] * mSkySize.width ()),
- COMP_TEX_COORD_Y (mSky[0]->matrix (), afTexCoordY[2] * mSkySize.height ()));
+ COMP_TEX_COORD_X (mSky[0]->matrix (), afTexCoordX[2] * mSkyWidth),
+ COMP_TEX_COORD_Y (mSky[0]->matrix (), afTexCoordY[2] * mSkyHeight));
glVertex3f (x * r * fRadius, y * r * fRadius, z * fRadius);
afTexCoordX[0] -= fStepX;
@@ -628,7 +683,6 @@
free (cost1);
free (sint2);
free (cost2);
-
#endif
}
@@ -640,7 +694,7 @@
bool rv = CubeOptions::setOption (name, value);
if (!rv || !CompOption::findOption (getOptions (), name, &index))
- return false;
+ return false;
switch (index)
{
@@ -697,8 +751,8 @@
void
PrivateCubeScreen::preparePaint (int msSinceLastPaint)
{
- int opt;
- float x, progress;
+ int opt;
+ float x, progress;
unsigned short *topColor, *bottomColor;
if (mGrabIndex)
@@ -730,12 +784,13 @@
mUnfold = 0.0f;
}
+
break;
}
}
}
- memset (mCleared, 0, sizeof (Bool) * screen->outputDevs ().size ());
+ memset (mCleared, 0, sizeof (Bool) * screen->outputDevs ().size ());
memset (mCapsPainted, 0, sizeof (Bool) * screen->outputDevs ().size ());
/* Transparency handling */
@@ -755,20 +810,19 @@
if (mDesktopOpacity != mToOpacity ||
(progress > 0.0 && progress < 1.0))
{
- mDesktopOpacity =
- (optionGetInactiveOpacity () -
- ((optionGetInactiveOpacity () -
- mOptions[mLastOpacityIndex].value ().f ()) * progress))
- / 100.0f * OPAQUE;
+ float inactiveOpacity = optionGetInactiveOpacity ();
+ mDesktopOpacity = (inactiveOpacity -
+ ((inactiveOpacity - mOptions[mLastOpacityIndex].value ().f ()) *
+ progress)) / 100.0f * OPAQUE;
}
topColor = optionGetTopColor ();
bottomColor = optionGetBottomColor ();
mPaintAllViewports = (mDesktopOpacity != OPAQUE ||
- topColor[3] != OPAQUE ||
- bottomColor[3] != OPAQUE);
+ topColor[3] != OPAQUE ||
+ bottomColor[3] != OPAQUE);
cScreen->preparePaint (msSinceLastPaint);
}
@@ -803,6 +857,7 @@
{
mask &= ~PAINT_SCREEN_REGION_MASK;
mask |= PAINT_SCREEN_TRANSFORMED_MASK;
+ mask |= PAINT_WINDOW_TRANSFORMED_MASK;
}
mSrcOutput = ((unsigned int) output->id () != (unsigned int) ~0) ?
@@ -838,7 +893,11 @@
sTransform.translate (priv->mOutputXOffset, -priv->mOutputYOffset, 0.0f);
sTransform.scale (priv->mOutputXScale, priv->mOutputYScale, 1.0f);
+<<<<<<< TREE
GLMatrix mvp = pm * sTransform;
+=======
+ GLMatrix mvp = pm * sTransform;
+>>>>>>> MERGE-SOURCE
GLVector pntA = mvp * points[0];
@@ -876,11 +935,15 @@
{
WRAPABLE_HND_FUNCTN_RETURN (bool, cubeShouldPaintViewport, sAttrib, transform, output, order)
+<<<<<<< TREE
float pointZ = priv->mInvert * priv->mDistance;
+=======
+ float pointZ = priv->mInvert * priv->mDistance;
+>>>>>>> MERGE-SOURCE
std::vector vPoints;
vPoints.push_back (GLVector (-0.5, 0.0, pointZ, 1.0));
- vPoints.push_back (GLVector (0.0, 0.5, pointZ, 1.0));
- vPoints.push_back (GLVector (0.0, 0.0, pointZ, 1.0));
+ vPoints.push_back (GLVector (0.0, 0.5, pointZ, 1.0));
+ vPoints.push_back (GLVector ( 0.0, 0.0, pointZ, 1.0));
bool ftb = cubeCheckOrientation (sAttrib, transform, output, vPoints);
@@ -895,8 +958,12 @@
PaintOrder paintOrder,
int dx)
{
+<<<<<<< TREE
if (!cubeScreen->cubeShouldPaintViewport (sAttrib, transform, outputPtr,
paintOrder))
+=======
+ if (!cubeScreen->cubeShouldPaintViewport (sAttrib, transform, outputPtr, paintOrder))
+>>>>>>> MERGE-SOURCE
return;
int output = ((unsigned int) outputPtr->id () != (unsigned int) ~0) ?
@@ -910,12 +977,21 @@
int cubeOutput = mOutputMask[output];
/* convert from window movement to viewport movement */
+<<<<<<< TREE
int dView = -dx;
cubeOutput += dView;
dView = cubeOutput / mNOutput;
cubeOutput = cubeOutput % mNOutput;
+=======
+ int dView = -dx;
+
+ cubeOutput += dView;
+
+ dView = cubeOutput / mNOutput;
+ cubeOutput = cubeOutput % mNOutput;
+>>>>>>> MERGE-SOURCE
if (cubeOutput < 0)
{
@@ -965,7 +1041,12 @@
int origXMoveAdd = 0; // dx for the viewport we start painting with (back-most).
int iFirstSign; /* 1 if we do xMove += i first and
- -1 if we do xMove -= i first. */
+<<<<<<< TREE
+ -1 if we do xMove -= i first. */
+=======
+ -1 if we do xMove -= i first. */
+ float halfHsize = hsize / 2.0;
+>>>>>>> MERGE-SOURCE
if (mInvert == 1)
{
@@ -977,12 +1058,12 @@
if ((sa.xRotate < 0.0f && hsize % 2 == 1) ||
(sa.xRotate > 0.0f && hsize % 2 == 0))
{
- origXMoveAdd = hsize / 2;
- iFirstSign = 1;
+ origXMoveAdd = halfHsize;
+ iFirstSign = 1;
}
else
{
- origXMoveAdd = -hsize / 2;
+ origXMoveAdd = -halfHsize;
iFirstSign = -1;
}
}
@@ -992,15 +1073,22 @@
if (sa.xRotate > 0.0f)
iFirstSign = -1;
else
- iFirstSign = 1;
+ iFirstSign = 1;
}
+<<<<<<< TREE
int xMoveAdd;
for (int i = 0; i <= hsize / 2; ++i)
+=======
+ int xMoveAdd;
+ float tsSize = 360.0f / size;
+
+ for (int i = 0; i <= halfHsize; ++i)
+>>>>>>> MERGE-SOURCE
{
/* move to the correct viewport (back to front). */
- xMoveAdd = origXMoveAdd; /* move to farthest viewport. */
+ xMoveAdd = origXMoveAdd; /* move to farthest viewport. */
xMoveAdd += iFirstSign * i; /* move i more viewports to
the right / left. */
@@ -1008,18 +1096,17 @@
We paint the viewports around xMove viewport.
Adding or subtracting hsize from xMove has no effect on
what viewport we paint, but can make shorter paths. */
- if (xMoveAdd < -hsize / 2)
+ if (xMoveAdd < -halfHsize)
xMoveAdd += hsize;
- else if (xMoveAdd > hsize / 2)
+ else if (xMoveAdd > halfHsize)
xMoveAdd -= hsize;
/* Paint the viewport. */
xMove += xMoveAdd;
- sa.yRotate -= mInvert * xMoveAdd * 360.0f / size;
- moveViewportAndPaint (sa, transform, outputPtr, mask,
- paintOrder, xMove);
- sa.yRotate += mInvert * xMoveAdd * 360.0f / size;
+ sa.yRotate -= mInvert * xMoveAdd * tsSize;
+ moveViewportAndPaint (sa, transform, outputPtr, mask, paintOrder, xMove);
+ sa.yRotate += mInvert * xMoveAdd * tsSize;
xMove -= xMoveAdd;
@@ -1027,22 +1114,22 @@
if (i == 0 || i * 2 == hsize)
continue;
- xMoveAdd = origXMoveAdd; /* move to farthest viewport. */
+ xMoveAdd = origXMoveAdd; /* move to farthest viewport. */
xMoveAdd -= iFirstSign * i; /* move i more viewports to the
left / right (opposite side
from the one chosen first) */
- if (xMoveAdd < -hsize / 2)
+ if (xMoveAdd < -halfHsize)
xMoveAdd += hsize;
- else if (xMoveAdd > hsize / 2)
+ else if (xMoveAdd > halfHsize)
xMoveAdd -= hsize;
xMove += xMoveAdd;
- sa.yRotate -= mInvert * xMoveAdd * 360.0f / size;
+ sa.yRotate -= mInvert * xMoveAdd * tsSize;
moveViewportAndPaint (sa, transform, outputPtr, mask,
paintOrder, xMove);
- sa.yRotate += mInvert * xMoveAdd * 360.0f / size;
+ sa.yRotate += mInvert * xMoveAdd * tsSize;
xMove -= xMoveAdd;
}
@@ -1066,7 +1153,7 @@
{
WRAPABLE_HND_FUNCTN (cubeClearTargetOutput, xRotate, vRotate)
- if (priv->mSky.size () > 0)
+ if (!priv->mSky.empty ())
{
priv->gScreen->setLighting (false);
#ifndef USE_GLES
@@ -1098,15 +1185,31 @@
{
WRAPABLE_HND_FUNCTN (cubePaintTop, sAttrib, transform, output, size, normal)
+<<<<<<< TREE
GLScreenPaintAttrib sa = sAttrib;
GLMatrix sTransform = transform;
+=======
+ GLScreenPaintAttrib sa = sAttrib;
+ GLMatrix sTransform = transform;
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+>>>>>>> MERGE-SOURCE
priv->gScreen->setLighting (true);
+<<<<<<< TREE
unsigned short *color = priv->optionGetTopColor ();
int opacity = priv->mDesktopOpacity * color[3] / 0xffff;
+=======
+ unsigned short *color = priv->optionGetTopColor ();
+ int opacity = priv->mDesktopOpacity * color[3] / 0xffff;
+>>>>>>> MERGE-SOURCE
+<<<<<<< TREE
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
+=======
+ GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
+>>>>>>> MERGE-SOURCE
std::vector colorData;
colorData.push_back (color[0] * opacity / 0xffff);
@@ -1126,7 +1229,10 @@
#ifndef USE_GLES
priv->gScreen->setTexEnvMode (GL_MODULATE);
#endif
- glEnable (GL_BLEND);
+ // just enable blending if it is disabled
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
@@ -1150,7 +1256,11 @@
priv->mTexture[0]->disable ();
priv->gScreen->setTexEnvMode (GL_REPLACE);
- glDisable (GL_BLEND);
+
+ // just disable blending if it was disabled before
+ if (!glBlendEnabled)
+ glDisable (GL_BLEND);
+
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
}
@@ -1163,9 +1273,16 @@
{
WRAPABLE_HND_FUNCTN (cubePaintBottom, sAttrib, transform, output, size, normal)
+<<<<<<< TREE
GLScreenPaintAttrib sa = sAttrib;
GLMatrix sTransform = transform;
+=======
+ GLScreenPaintAttrib sa = sAttrib;
+ GLMatrix sTransform = transform;
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+>>>>>>> MERGE-SOURCE
priv->gScreen->setLighting (true);
unsigned short *color = priv->optionGetBottomColor ();
@@ -1191,7 +1308,10 @@
#ifndef USE_GLES
priv->gScreen->setTexEnvMode (GL_MODULATE);
#endif
- glEnable (GL_BLEND);
+ // just enable blending if it is disabled
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
@@ -1206,7 +1326,11 @@
streamingBuffer->render (sTransform);
priv->gScreen->setTexEnvMode (GL_REPLACE);
- glDisable (GL_BLEND);
+
+ // just disable blending if it was disabled before
+ if (!glBlendEnabled)
+ glDisable (GL_BLEND);
+
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
}
@@ -1234,12 +1358,14 @@
glTranslatef (mOutputXOffset, -mOutputYOffset, 0.0f);
glScalef (mOutputXScale, mOutputYScale, 1.0f);
+ GLdouble mDist2 = 0.5 / mDistance;
+
if (mInvert == 1)
{
- GLdouble clipPlane0[] = { 1.0, 0.0, 0.5 / mDistance, 0.0 };
- GLdouble clipPlane1[] = { -1.0, 0.0, 0.5 / mDistance, 0.0 };
- GLdouble clipPlane2[] = { 0.0, -1.0, 0.5 / mDistance, 0.0 };
- GLdouble clipPlane3[] = { 0.0, 1.0, 0.5 / mDistance, 0.0 };
+ GLdouble clipPlane0[] = { 1.0, 0.0, mDist2, 0.0 };
+ GLdouble clipPlane1[] = { -1.0, 0.0, mDist2, 0.0 };
+ GLdouble clipPlane2[] = { 0.0, -1.0, mDist2, 0.0 };
+ GLdouble clipPlane3[] = { 0.0, 1.0, mDist2, 0.0 };
glClipPlane (GL_CLIP_PLANE0, clipPlane0);
glClipPlane (GL_CLIP_PLANE1, clipPlane1);
glClipPlane (GL_CLIP_PLANE2, clipPlane2);
@@ -1247,10 +1373,10 @@
}
else
{
- GLdouble clipPlane0[] = { -1.0, 0.0, -0.5 / mDistance, 0.0 };
- GLdouble clipPlane1[] = { 1.0, 0.0, -0.5 / mDistance, 0.0 };
- GLdouble clipPlane2[] = { 0.0, 1.0, -0.5 / mDistance, 0.0 };
- GLdouble clipPlane3[] = { 0.0, -1.0, -0.5 / mDistance, 0.0 };
+ GLdouble clipPlane0[] = { -1.0, 0.0, -mDist2, 0.0 };
+ GLdouble clipPlane1[] = { 1.0, 0.0, -mDist2, 0.0 };
+ GLdouble clipPlane2[] = { 0.0, 1.0, -mDist2, 0.0 };
+ GLdouble clipPlane3[] = { 0.0, -1.0, -mDist2, 0.0 };
glClipPlane (GL_CLIP_PLANE0, clipPlane0);
glClipPlane (GL_CLIP_PLANE1, clipPlane1);
glClipPlane (GL_CLIP_PLANE2, clipPlane2);
@@ -1304,7 +1430,11 @@
updateGeometry (screen->vpSize ().width (), mInvert);
}
+<<<<<<< TREE
int cullNorm;
+=======
+ int cullNorm;
+>>>>>>> MERGE-SOURCE
glGetIntegerv (GL_CULL_FACE_MODE, &cullNorm);
int cullInv = (cullNorm == GL_BACK)? GL_FRONT : GL_BACK;
@@ -1312,6 +1442,7 @@
if (!mFullscreenOutput)
{
+<<<<<<< TREE
mOutputXScale = (float) screen->width () / outputPtr->width ();
mOutputYScale = (float) screen->height () / outputPtr->height ();
@@ -1323,6 +1454,19 @@
(outputPtr->y1 () +
outputPtr->y2 ()) / 2.0f) /
(float) outputPtr->height ();
+=======
+ float outputWidth = outputPtr->width ();
+ float outputHeight = outputPtr->height ();
+
+ mOutputXScale = (float) screen->width () / outputWidth;
+ mOutputYScale = (float) screen->height () / outputHeight;
+
+ mOutputXOffset = (screen->width () / 2.0f -
+ (outputPtr->x1 () + outputPtr->x2 ()) / 2.0f) / outputWidth;
+
+ mOutputYOffset = (screen->height () / 2.0f -
+ (outputPtr->y1 () + outputPtr->y2 ()) / 2.0f) / outputHeight;
+>>>>>>> MERGE-SOURCE
}
else
{
@@ -1341,8 +1485,13 @@
if (!mCleared[output])
{
+<<<<<<< TREE
float rRotate = xRotate - ((screen->vp ().x () *360.0f) /
screen->vpSize ().width ());
+=======
+ float rRotate = xRotate - ((screen->vp ().x () * 360.0f) /
+ screen->vpSize ().width ());
+>>>>>>> MERGE-SOURCE
cubeScreen->cubeClearTargetOutput (rRotate, vRotate);
mCleared[output] = true;
@@ -1363,8 +1512,8 @@
sa.zTranslate = -mInvert * (0.5f / tanf (M_PI / size));
- /* distance we move the camera back when unfolding the cube.
- currently hardcoded to 1.5 but it should probably be optional. */
+ /* Distance we move the camera back when unfolding the cube.
+ TODO: Currently hardcoded to 1.5, make this configurable via CCSM. */
sa.zCamera -= mUnfold * 1.5f;
}
else
@@ -1389,6 +1538,8 @@
sa.xRotate = sa.xRotate / size * hsize;
+ GLenum oldFilter = gScreen->textureFilter ();
+
if (mGrabIndex && optionGetMipmap ())
gScreen->setTextureFilter (GL_LINEAR_MIPMAP_LINEAR);
@@ -1400,8 +1551,12 @@
paintOrder = FTB;
glCullFace (cullInv);
}
+<<<<<<< TREE
else
/* Inside cube - start with BTF faces */
+=======
+ else /* Inside cube - start with BTF faces */
+>>>>>>> MERGE-SOURCE
paintOrder = BTF;
if (mInvert == -1 || cubeScreen->cubeShouldPaintAllViewports ())
@@ -1413,10 +1568,17 @@
if (wasCulled && cubeScreen->cubeShouldPaintAllViewports ())
glDisable (GL_CULL_FACE);
+<<<<<<< TREE
bool paintCaps = !mGrabIndex && (hsize > 2) && !mCapsPainted[output] &&
(mInvert != 1 || mDesktopOpacity != OPAQUE ||
cubeScreen->cubeShouldPaintAllViewports () || sa.vRotate != 0.0f ||
sa.yTranslate != 0.0f);
+=======
+ bool paintCaps = !mGrabIndex && hsize > 2 && !mCapsPainted[output] &&
+ (mInvert != 1 || mDesktopOpacity != OPAQUE ||
+ cubeScreen->cubeShouldPaintAllViewports () || sa.vRotate != 0.0f ||
+ sa.yTranslate != 0.0f);
+>>>>>>> MERGE-SOURCE
if (paintCaps)
{
@@ -1430,19 +1592,28 @@
bottom.push_back (GLVector (0.0, -0.5, -0.5, 1.0));
bottom.push_back (GLVector (0.0, -0.5, 0.0, 1.0));
+<<<<<<< TREE
Bool topDir = cubeScreen->cubeCheckOrientation (sa, transform, outputPtr, top);
Bool bottomDir = cubeScreen->cubeCheckOrientation (sa, transform, outputPtr, bottom);
mCapsPainted[output] = TRUE;
Bool allCaps = cubeScreen->cubeShouldPaintAllViewports () || mInvert != 1;
+=======
+ bool topDir = cubeScreen->cubeCheckOrientation (sa, transform, outputPtr, top);
+ bool bottomDir = cubeScreen->cubeCheckOrientation (sa, transform, outputPtr, bottom);
+
+ mCapsPainted[output] = true;
+
+ bool allCaps = cubeScreen->cubeShouldPaintAllViewports () || mInvert != 1;
+>>>>>>> MERGE-SOURCE
if (topDir && bottomDir)
{
if (allCaps)
{
- cubeScreen->cubePaintBottom (sa, transform, outputPtr, hsize, GLVector (0.0f, -1.0f, 0.0f, 1.0f));
- cubeScreen->cubePaintInside (sa, transform, outputPtr, hsize, GLVector (0.0f, 0.0f, -1.0f, 1.0f));
+ cubeScreen->cubePaintBottom (sa, transform, outputPtr, hsize, GLVector (0.0f, -1.0f, 0.0f, 1.0f));
+ cubeScreen->cubePaintInside (sa, transform, outputPtr, hsize, GLVector (0.0f, 0.0f, -1.0f, 1.0f));
}
cubeScreen->cubePaintTop (sa, transform, outputPtr, hsize, GLVector (0.0f, -1.0f, 0.0f, 1.0f));
@@ -1451,7 +1622,7 @@
{
if (allCaps)
{
- cubeScreen->cubePaintTop (sa, transform, outputPtr, hsize, GLVector (0.0f, 1.0f, 0.0f, 1.0f));
+ cubeScreen->cubePaintTop (sa, transform, outputPtr, hsize, GLVector (0.0f, 1.0f, 0.0f, 1.0f));
cubeScreen->cubePaintInside (sa, transform, outputPtr, hsize, GLVector (0.0f, 0.0f, -1.0f, 1.0f));
}
@@ -1459,9 +1630,9 @@
}
else if (allCaps)
{
- cubeScreen->cubePaintTop (sa, transform, outputPtr, hsize, GLVector (0.0f, 1.0f, 0.0f, 1.0f));
- cubeScreen->cubePaintBottom (sa, transform, outputPtr, hsize, GLVector (0.0f, -1.0f, 0.0f, 1.0f));
- cubeScreen->cubePaintInside (sa, transform, outputPtr, hsize, GLVector (0.0f, 0.0f, -1.0f, 1.0f));
+ cubeScreen->cubePaintTop (sa, transform, outputPtr, hsize, GLVector (0.0f, 1.0f, 0.0f, 1.0f));
+ cubeScreen->cubePaintBottom (sa, transform, outputPtr, hsize, GLVector (0.0f, -1.0f, 0.0f, 1.0f));
+ cubeScreen->cubePaintInside (sa, transform, outputPtr, hsize, GLVector (0.0f, 0.0f, -1.0f, 1.0f));
}
}
@@ -1484,14 +1655,18 @@
glCullFace (cullNorm);
+<<<<<<< TREE
GLenum filter = gScreen->textureFilter ();
gScreen->setTextureFilter (filter);
+=======
+ gScreen->setTextureFilter (oldFilter);
+>>>>>>> MERGE-SOURCE
}
bool
PrivateCubeWindow::glPaint (const GLWindowPaintAttrib &attrib,
const GLMatrix &transform,
- const CompRegion ®ion,
+ const CompRegion ®ion,
unsigned int mask)
{
@@ -1499,8 +1674,7 @@
(attrib.opacity != cubeScreen->priv->mDesktopOpacity))
{
GLWindowPaintAttrib wAttrib = attrib;
-
- wAttrib.opacity = cubeScreen->priv->mDesktopOpacity;
+ wAttrib.opacity = cubeScreen->priv->mDesktopOpacity;
return gWindow->glPaint (wAttrib, transform, region, mask);
}
@@ -1616,50 +1790,56 @@
PrivateCubeScreen::PrivateCubeScreen (CompScreen *s) :
cScreen (CompositeScreen::get (s)),
gScreen (GLScreen::get (s)),
- cubeScreen (CubeScreen::get (s))
+ cubeScreen (CubeScreen::get (s)),
+ mInvert (1),
+ mXRotations (0),
+ mPaintOrder (BTF),
+ mRotationState (CubeScreen::RotationNone),
+ mPaintAllViewports (false),
+ mDistance (0.0f),
+ mTc (),
+ mGrabIndex (0),
+ mSrcOutput (0),
+ mUnfolded (false),
+ mUnfold (0.0f),
+ mUnfoldVelocity (0.0f),
+ mVertices (NULL),
+ mNVertices (0),
+ mSkyListId (0),
+ mPw (0),
+ mPh (0),
+ mSkySize (0, 0),
+ mTexture (0),
+ mSky (0),
+ mImgCurFile (0),
+ mNOutput (1),
+ mOutput (),
+ mOutputMask (),
+ mCleared (),
+ mCapsPainted (),
+ mFullscreenOutput (true),
+ mOutputXScale (1.0f),
+ mOutputYScale (1.0f),
+ mOutputXOffset (0.0f),
+ mOutputYOffset (0.0f),
+ mDesktopOpacity (OPAQUE),
+ mToOpacity (OPAQUE),
+ mLastOpacityIndex (CubeOptions::InactiveOpacity),
+ mRecalcOutput (false),
+ mReversedWindowList (0)
{
+<<<<<<< TREE
mPw = 0;
mPh = 0;
mInvert = 1;
for (int i = 0; i < 8; ++i)
+=======
+ for (int i = 0; i < 8; ++i)
+>>>>>>> MERGE-SOURCE
mTc[i] = 0.0f;
- mNVertices = 0;
- mVertices = NULL;
-
- mGrabIndex = 0;
-
- mSrcOutput = 0;
-
- mSkyListId = 0;
-
- mImgCurFile = 0;
-
- mUnfolded = false;
- mUnfold = 0.0f;
-
- mUnfoldVelocity = 0.0f;
-
- mPaintAllViewports = false;
- mFullscreenOutput = true;
-
- mOutputXScale = 1.0f;
- mOutputYScale = 1.0f;
- mOutputXOffset = 0.0f;
- mOutputYOffset = 0.0f;
-
- mRotationState = CubeScreen::RotationNone;
-
- mDesktopOpacity = OPAQUE;
- mPaintOrder = BTF;
-
- mLastOpacityIndex = CubeOptions::InactiveOpacity;
-
-
- mRecalcOutput = false;
-
memset (mCleared, 0, sizeof (mCleared));
updateOutputs ();
@@ -1685,7 +1865,6 @@
#endif
}
-
template class PluginClassHandler;
PrivateCubeWindow::PrivateCubeWindow (CompWindow *w) :
=== modified file 'plugins/cube/src/privates.h'
--- plugins/cube/src/privates.h 2013-05-18 17:26:05 +0000
+++ plugins/cube/src/privates.h 2013-07-21 23:03:28 +0000
@@ -49,11 +49,19 @@
void paint (CompOutput::ptrList &outputs, unsigned int);
+<<<<<<< TREE
bool glPaintOutput (const GLScreenPaintAttrib &,
const GLMatrix &,
const CompRegion &,
CompOutput *,
unsigned int );
+=======
+ bool glPaintOutput (const GLScreenPaintAttrib &,
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
+>>>>>>> MERGE-SOURCE
void glPaintTransformedOutput (const GLScreenPaintAttrib &,
const GLMatrix &,
=== modified file 'plugins/cubeaddon/src/cubeaddon.cpp'
--- plugins/cubeaddon/src/cubeaddon.cpp 2013-05-09 13:43:07 +0000
+++ plugins/cubeaddon/src/cubeaddon.cpp 2013-07-21 23:03:28 +0000
@@ -34,23 +34,33 @@
*/
CubeaddonScreen::CubeCap::CubeCap ()
{
- mCurrent = 0;
- mLoaded = false;
+ mCurrent = 0;
+ mLoaded = false;
}
/*
* Attempt to load current cap image (if any)
*/
void
-CubeaddonScreen::CubeCap::load (bool scale, bool aspect, bool clamp)
+CubeaddonScreen::CubeCap::load (bool scale,
+ bool aspect,
+ bool clamp)
{
/* we need to clear the texture, if no texture files are specified */
if (mFiles.empty ())
+<<<<<<< TREE
{
mTexture.clear ();
mLoaded = false;
mCurrent = 0;
+=======
+ {
+ mTexture.clear ();
+ mLoaded = false;
+ mCurrent = 0;
+
+>>>>>>> MERGE-SOURCE
return;
}
@@ -64,7 +74,7 @@
mLoaded = false;
CompString imgName = mFiles[mCurrent].s ();
- CompString pname = "cubeaddon";
+ CompString pname = "cubeaddon";
mTexture = GLTexture::readImageToTexture (imgName, pname, tSize);
if (mTexture.empty ())
@@ -78,10 +88,10 @@
mLoaded = true;
mTexMat.reset ();
- mTexMat[0] = mTexture[0]->matrix ().xx;
- mTexMat[1] = mTexture[0]->matrix ().yx;
- mTexMat[4] = mTexture[0]->matrix ().xy;
- mTexMat[5] = mTexture[0]->matrix ().yy;
+ mTexMat[0] = mTexture[0]->matrix ().xx;
+ mTexMat[1] = mTexture[0]->matrix ().yx;
+ mTexMat[4] = mTexture[0]->matrix ().xy;
+ mTexMat[5] = mTexture[0]->matrix ().yy;
mTexMat[12] = mTexture[0]->matrix ().x0;
mTexMat[13] = mTexture[0]->matrix ().y0;
@@ -135,6 +145,7 @@
glTexParameteri (mTexture[0]->target (), GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri (mTexture[0]->target (), GL_TEXTURE_WRAP_T, GL_REPEAT);
}
+
mTexture[0]->disable ();
}
@@ -144,63 +155,93 @@
* Switch cap, load it and damage screen if possible
*/
bool
-CubeaddonScreen::changeCap (bool top, int change)
+CubeaddonScreen::changeCap (bool top,
+ int change)
{
+<<<<<<< TREE
CubeCap *cap = (top)? &mTopCap : &mBottomCap;
int count = cap->mFiles.size ();
/* mCurrent just changes in this case */
if (count && change)
+=======
+ CubeCap *cap = (top)? &mTopCap : &mBottomCap;
+ int count = cap->mFiles.size ();
+
+ /* mCurrent just changes in this case */
+ if (count && change)
+>>>>>>> MERGE-SOURCE
cap->mCurrent = (cap->mCurrent + change + count) % count;
-
- if (top)
- {
- cap->load (optionGetTopScale (), optionGetTopAspect (),
- optionGetTopClamp ());
- }
- else
- {
- cap->load (optionGetBottomScale (), optionGetBottomAspect (),
- optionGetBottomClamp ());
- cap->mTexMat.scale (1.0, -1.0, 1.0);
- }
+<<<<<<< TREE
+
+ if (top)
+ {
+ cap->load (optionGetTopScale (), optionGetTopAspect (),
+ optionGetTopClamp ());
+ }
+ else
+ {
+ cap->load (optionGetBottomScale (), optionGetBottomAspect (),
+ optionGetBottomClamp ());
+ cap->mTexMat.scale (1.0, -1.0, 1.0);
+ }
+ cScreen->damageScreen ();
+=======
+
+ if (top)
+ cap->load (optionGetTopScale (), optionGetTopAspect (),
+ optionGetTopClamp ());
+ else
+ {
+ cap->load (optionGetBottomScale (), optionGetBottomAspect (),
+ optionGetBottomClamp ());
+ cap->mTexMat.scale (1.0, -1.0, 1.0);
+ }
+>>>>>>> MERGE-SOURCE
+
cScreen->damageScreen ();
return false;
}
bool
-CubeaddonScreen::setOption (const CompString &name, CompOption::Value &value)
+CubeaddonScreen::setOption (const CompString &name,
+ CompOption::Value &value)
{
unsigned int index;
bool rv = CubeaddonOptions::setOption (name, value);
if (!rv || !CompOption::findOption (getOptions (), name, &index))
- return false;
+ return false;
- switch (index) {
+ switch (index)
+ {
case CubeaddonOptions::TopImages :
mTopCap.mFiles = optionGetTopImages ();
- mTopCap.mCurrent = 0;
- changeCap (true, 0);
+ mTopCap.mCurrent = 0;
+ changeCap (true, 0);
break;
+
case CubeaddonOptions::BottomImages :
mBottomCap.mFiles = optionGetBottomImages ();
- mBottomCap.mCurrent = 0;
- changeCap (false, 0);
+ mBottomCap.mCurrent = 0;
+ changeCap (false, 0);
break;
+
case CubeaddonOptions::TopScale :
case CubeaddonOptions::TopAspect :
case CubeaddonOptions::TopClamp :
- changeCap (true, 0);
+ changeCap (true, 0);
break;
+
case CubeaddonOptions::BottomScale :
case CubeaddonOptions::BottomAspect :
case CubeaddonOptions::BottomClamp :
- changeCap (false, 0);
+ changeCap (false, 0);
break;
+
default:
break;
}
@@ -211,7 +252,15 @@
void
CubeaddonScreen::drawBasicGround ()
{
+<<<<<<< TREE
glEnable (GL_BLEND);
+=======
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
+>>>>>>> MERGE-SOURCE
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
float i = optionGetIntensity () * 2;
@@ -221,9 +270,9 @@
GLfloat ground1Vertices[] =
{
-0.5, -0.5, 0.0,
- 0.5, -0.5, 0.0,
- -0.5, 0.0, 0.0,
- 0.5, 0.0, 0.0
+ 0.5, -0.5, 0.0,
+ -0.5, 0.0, 0.0,
+ 0.5, 0.0, 0.0
};
unsigned short maxG1Color = MAX (0.0f, 1.0f - i) * 65535;
@@ -242,17 +291,22 @@
streamingBuffer->addVertices (4, ground1Vertices);
streamingBuffer->addColors (4, ground1Colors);
+
if (streamingBuffer->end ())
streamingBuffer->render (transform);
- if (optionGetGroundSize () > 0.0)
+ float groundSize = optionGetGroundSize ();
+
+ if (groundSize)
{
+ GLfloat gSY = static_cast (groundSize - 0.5f);
+
GLfloat ground2Vertices[] =
{
-0.5, -0.5, 0.0,
- 0.5, -0.5, 0.0,
- -0.5, static_cast (-0.5 + optionGetGroundSize ()), 0.0,
- 0.5, static_cast (-0.5 + optionGetGroundSize ()), 0.0
+ 0.5, -0.5, 0.0,
+ -0.5, gSY, 0.0,
+ 0.5, gSY, 0.0
};
streamingBuffer->begin (GL_TRIANGLE_STRIP);
@@ -261,12 +315,15 @@
streamingBuffer->addColors (1, optionGetGroundColor2 ());
streamingBuffer->addColors (1, optionGetGroundColor2 ());
streamingBuffer->addVertices (4, ground2Vertices);
+
if (streamingBuffer->end ())
streamingBuffer->render (transform);
}
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- glDisable (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glDisable (GL_BLEND);
}
bool
@@ -285,24 +342,25 @@
}
void
-CubeaddonScreen::cubeGetRotation (float &x, float &v, float &progress)
+CubeaddonScreen::cubeGetRotation (float &x,
+ float &v,
+ float &progress)
{
-
cubeScreen->cubeGetRotation (x, v, progress);
if (optionGetMode () == ModeAbove && v > 0.0 && mReflection)
{
mVRot = v;
- v = 0.0;
+ v = 0.0;
}
else
mVRot = 0.0;
}
void
-CubeaddonScreen::cubeClearTargetOutput (float xRotate, float vRotate)
+CubeaddonScreen::cubeClearTargetOutput (float xRotate,
+ float vRotate)
{
-
if (mReflection)
glCullFace (GL_BACK);
@@ -324,14 +382,24 @@
if (rv || cubeScreen->unfolded ())
return rv;
+ GLfloat cSDistance = cubeScreen->distance ();
+ GLfloat cSDistanceSquared = cSDistance * cSDistance;
+
if (mDeform > 0.0 && optionGetDeformation () == DeformationCylinder)
{
float z[3];
+<<<<<<< TREE
z[0] = cubeScreen->invert () * cubeScreen->distance ();
z[1] = z[0] + (0.25 / cubeScreen->distance ());
z[2] = cubeScreen->invert () *
sqrtf (0.25 + (cubeScreen->distance () * cubeScreen->distance ()));
+=======
+ z[0] = cubeScreen->invert () * cSDistance;
+ z[1] = z[0] + (0.25 / cSDistance);
+ z[2] = cubeScreen->invert () *
+ sqrtf (0.25 + cSDistanceSquared);
+>>>>>>> MERGE-SOURCE
std::vector vPoints[3];
@@ -352,16 +420,16 @@
bool ftb3 = cubeScreen->cubeCheckOrientation (sAttrib, transform,
output, vPoints[2]);
- rv = (order == FTB && (ftb1 || ftb2 || ftb3)) ||
+ rv = (order == FTB && ( ftb1 || ftb2 || ftb3)) ||
(order == BTF && (!ftb1 || !ftb2 || !ftb3));
}
else if (mDeform > 0.0 && optionGetDeformation () == DeformationSphere)
{
float z[4];
- z[0] = sqrtf (0.5 + (cubeScreen->distance () * cubeScreen->distance ()));
- z[1] = z[0] + (0.25 / cubeScreen->distance ());
- z[2] = sqrtf (0.25 + (cubeScreen->distance () * cubeScreen->distance ()));
+ z[0] = sqrtf (0.5 + cSDistanceSquared);
+ z[1] = z[0] + (0.25 / cSDistance);
+ z[2] = sqrtf (0.25 + cSDistanceSquared);
z[3] = z[2] + 0.5;
std::vector vPoints[4];
@@ -388,7 +456,7 @@
bool ftb4 = cubeScreen->cubeCheckOrientation (sAttrib, transform,
output, vPoints[3]);
- rv = (order == FTB && (ftb1 || ftb2 || ftb3 || ftb4)) ||
+ rv = (order == FTB && (ftb1 || ftb2 || ftb3 || ftb4)) ||
(order == BTF && (!ftb1 || !ftb2 || !ftb3 || !ftb4));
}
@@ -405,12 +473,17 @@
{
GLScreenPaintAttrib sa;
GLMatrix sTransform;
+<<<<<<< TREE
+=======
+ GLVertexBuffer *streamingBuffer;
+>>>>>>> MERGE-SOURCE
int cullNorm, cullInv;
bool wasCulled = glIsEnabled (GL_CULL_FACE);
float cInv = (top) ? 1.0: -1.0;
+ float tsSize = 360.0f / static_cast (size);
CubeCap *cap;
bool cAspect;
- unsigned short *color;
+ unsigned short *color;
glGetIntegerv (GL_CULL_FACE_MODE, &cullNorm);
cullInv = (cullNorm == GL_BACK)? GL_FRONT : GL_BACK;
@@ -420,9 +493,18 @@
else
color = cubeScreen->bottomColor ();
+<<<<<<< TREE
int opacity = cubeScreen->desktopOpacity () * color[3] / 0xffff;
glEnable (GL_BLEND);
+=======
+ int opacity = cubeScreen->desktopOpacity () * color[3] / 0xffff;
+
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+>>>>>>> MERGE-SOURCE
if (top)
{
@@ -437,21 +519,36 @@
glEnable(GL_CULL_FACE);
+<<<<<<< TREE
for (int l = 0; l < ((cubeScreen->invert () == 1) ? 2 : 1); l++)
+=======
+ unsigned int vertexIndex;
+ float normalizedOpacity = opacity / static_cast (OPAQUE);
+ float premultColors[] =
+ {
+ (color[0] / OPAQUE) * normalizedOpacity,
+ (color[1] / OPAQUE) * normalizedOpacity,
+ (color[2] / OPAQUE) * normalizedOpacity
+ };
+
+ for (int l = 0; l < ((cubeScreen->invert () == 1) ? 2 : 1); ++l)
+>>>>>>> MERGE-SOURCE
{
glCullFace(((l == 1) ^ top) ? cullInv : cullNorm);
+<<<<<<< TREE
for (int i = 0; i < size; i++)
+=======
+ for (int i = 0; i < size; ++i)
+>>>>>>> MERGE-SOURCE
{
- GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
+ streamingBuffer = GLVertexBuffer::streamingBuffer ();
streamingBuffer->begin (GL_TRIANGLE_FAN);
if (optionGetDeformation () == DeformationSphere &&
optionGetDeformCaps ())
- {
streamingBuffer->addNormals (CAP_NVERTEX / 3, (l == 0) ? mCapFill : mCapFillNorm);
- }
else
{
GLfloat nonDeformNormals[] = { 0.0f, (l == 0) ? 1.0f : -1.0f, 0.0f };
@@ -460,20 +557,24 @@
sa = sAttrib;
sTransform = transform;
+
if (cubeScreen->invert () == 1)
{
- sa.yRotate += (360.0f / size) * cubeScreen->xRotations ();
+ sa.yRotate += tsSize * cubeScreen->xRotations ();
+
if (!adjust)
- sa.yRotate -= (360.0f / size) * screen->vp ().x ();
+ sa.yRotate -= tsSize * screen->vp ().x ();
}
else
{
sa.yRotate += 180.0f;
- sa.yRotate -= (360.0f / size) * cubeScreen->xRotations ();
+ sa.yRotate -= tsSize * cubeScreen->xRotations ();
+
if (!adjust)
- sa.yRotate += (360.0f / size) * screen->vp ().x ();
+ sa.yRotate += tsSize * screen->vp ().x ();
}
- sa.yRotate += (360.0f / size) * i;
+
+ sa.yRotate += tsSize * i;
gScreen->glApplyTransform (sa, output, &sTransform);
@@ -482,25 +583,18 @@
cTransform.scale (cubeScreen->outputXScale (), cubeScreen->outputYScale (), 1.0f);
cTransform.scale (1.0, cInv, 1.0);
- float normalizedOpacity = opacity / static_cast (OPAQUE);
- float premultColors[] =
- {
- (color[0] / OPAQUE) * normalizedOpacity,
- (color[1] / OPAQUE) * normalizedOpacity,
- (color[2] / OPAQUE) * normalizedOpacity
- };
-
streamingBuffer->color4f (premultColors[0],
premultColors[1],
premultColors[2],
normalizedOpacity);
streamingBuffer->addVertices (CAP_ELEMENTS + 2, mCapFill);
+
if (streamingBuffer->end ())
streamingBuffer->render (cTransform);
if (optionGetDeformation () == DeformationSphere &&
- optionGetDeformCaps ())
+ optionGetDeformCaps ())
{
#ifndef USE_GLES
streamingBuffer->begin (GL_QUADS);
@@ -516,7 +610,7 @@
for (unsigned int i = 0; i < CAP_NIDX; ++i)
{
- unsigned int vertexIndex = idx[i] * 3;
+ vertexIndex = idx[i] * 3;
*(capVerticesPtr++) = (mCapFill[vertexIndex]);
*(capVerticesPtr++) = (mCapFill[vertexIndex + 1]);
@@ -533,7 +627,7 @@
if (cap->mLoaded)
{
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
- GLMatrix texMat = cap->mTexMat;
+ GLMatrix texMat = cap->mTexMat;
if (cubeScreen->invert () != 1)
texMat.scale (-1.0, 1.0, 1.0);
@@ -547,17 +641,18 @@
normalizedOpacity,
normalizedOpacity);
- cap->mTexture[0]->enable (GLTexture::Good);
+ cap->mTexture[0]->enable (GLTexture::Good);
if (cAspect)
{
- float scale, xScale = 1.0, yScale = 1.0;
- scale = (float)output->width () / (float)output->height ();
+ float xScale = 1.0, yScale = 1.0;
+ float scale = (float)output->width () / (float)output->height ();
+ float aScale = 1.0 / scale;
if (output->width () > output->height ())
{
xScale = 1.0;
- yScale = 1.0 / scale;
+ yScale = aScale;
}
else
{
@@ -567,32 +662,34 @@
if (optionGetTopScale ())
{
- scale = xScale;
+ scale = xScale;
xScale = 1.0 / yScale;
- yScale = 1.0 / scale;
+ yScale = aScale;
}
texMat.scale (xScale, yScale, 1.0);
}
- texMat.rotate (-(360.0f / size) * i, 0.0, 0.0, 1.0);
+ texMat.rotate (-tsSize * i, 0.0, 0.0, 1.0);
GLVector sGen (texMat[0], texMat[8], texMat[4], texMat[12]);
GLVector tGen (texMat[1], texMat[9], texMat[5], texMat[13]);
/* Generate texCoords for the top section of the
* cap */
- GLfloat texCoords[(CAP_ELEMENTS + 2) * 2];
- GLfloat *texCoordsPtr = texCoords;
+ GLfloat texCoords[(CAP_ELEMENTS + 2) * 2];
+ GLfloat *texCoordsPtr = texCoords;
+ float s, t;
- for (unsigned int i = 0; i < CAP_ELEMENTS + 2; i++)
+ for (unsigned int i = 0; i < CAP_ELEMENTS + 2; ++i)
{
GLVector v (mCapFill[i * 3],
mCapFill[i * 3 + 1],
mCapFill[i * 3 + 2],
1.0f);
- float s = v * sGen;
- float t = v * tGen;
+
+ s = v * sGen;
+ t = v * tGen;
*(texCoordsPtr++) = s;
*(texCoordsPtr++) = t;
@@ -601,11 +698,12 @@
streamingBuffer->addTexCoords (0, CAP_NVERTEX / 3, &texCoords[0]);
streamingBuffer->addVertices (CAP_NVERTEX / 3, mCapFill);
streamingBuffer->setMaxVertices (CAP_ELEMENTS + 2);
+
if (streamingBuffer->end ())
streamingBuffer->render (cTransform);
if (optionGetDeformation () == DeformationSphere &&
- optionGetDeformCaps ())
+ optionGetDeformCaps ())
{
#ifndef USE_GLES
streamingBuffer->begin (GL_QUADS);
@@ -632,13 +730,14 @@
GLushort *idx = mCapFillIdx;
GLfloat capVertices[CAP_NIDX * 3];
GLfloat texCoords[CAP_NIDX * 2];
+ GLfloat *capVerticesPtr = capVertices;
+ GLfloat *texCoordsPtr = texCoords;
- GLfloat *capVerticesPtr = capVertices;
- GLfloat *texCoordsPtr = texCoords;
+ unsigned int vertexIndex;
for (unsigned int i = 0; i < CAP_NIDX; ++i)
{
- unsigned int vertexIndex = idx[i] * 3;
+ vertexIndex = idx[i] * 3;
GLVector v (mCapFill[vertexIndex],
mCapFill[vertexIndex + 1],
@@ -653,8 +752,8 @@
* texCoord.s = dot (vec4 (obj, 1.0), sGenPlane)
* texCoord.t = dot (vec4 (obj, 1.0), tGenPlane)
*/
- float s = v * sGen;
- float t = v * tGen;
+ s = v * sGen;
+ t = v * tGen;
*(texCoordsPtr++) = s;
*(texCoordsPtr++) = t;
@@ -673,9 +772,11 @@
}
}
- glDisable (GL_BLEND);
+ if (!glBlendEnabled)
+ glDisable (GL_BLEND);
glCullFace (cullNorm);
+
if (!wasCulled)
glDisable (GL_CULL_FACE);
}
@@ -717,9 +818,15 @@
/* the original bottom cap will work for the non-deformed cube only */
(optionGetDeformation () == DeformationNone))
cubeScreen->cubePaintBottom (sAttrib, transform, output, size, normal);
+<<<<<<< TREE
else
paintCap (sAttrib, transform, output, size,
false, optionGetAdjustBottom ());
+=======
+ else
+ paintCap (sAttrib, transform, output, size,
+ false, optionGetAdjustBottom ());
+>>>>>>> MERGE-SOURCE
}
void
@@ -731,57 +838,50 @@
{
if (caScreen->mDeform > 0.0)
{
- GLVertexBuffer *vb = gWindow->vertexBuffer ();
- int i, oldVCount = vb->countVertices ();
- GLfloat *v;
- int offX = 0, offY = 0;
- int sx1, sx2, sw, sy1, sy2, sh;
- float radSquare, last[2][4];
- float inv = (cubeScreen->invert () == 1) ? 1.0 : -1.0;
-
- float ang, sx1g, sx2g, sy1g, sy2g;
-
- CubeScreen::MultioutputMode cMOM = cubeScreen->multioutputMode ();
- int caD = caScreen->optionGetDeformation ();
- float cDist = cubeScreen->distance ();
-
+ CubeScreen::MultioutputMode cMOM = cubeScreen->multioutputMode ();
+ int caD = caScreen->optionGetDeformation ();
+ float cDist = cubeScreen->distance ();
+ float radSquare;
if (caD == CubeaddonScreen::DeformationCylinder || cubeScreen->unfolded ())
- {
- radSquare = (cDist * cDist) + 0.25;
- }
+ radSquare = cDist * cDist + 0.25;
else
{
maxGridHeight = MIN (CUBEADDON_GRID_SIZE, maxGridHeight);
- radSquare = (cDist * cDist) + 0.5;
+ radSquare = cDist * cDist + 0.5;
}
gWindow->glAddGeometry (matrix, region, clip,
MIN (CUBEADDON_GRID_SIZE, maxGridWidth),
maxGridHeight);
- vb = gWindow->vertexBuffer ();
+ GLVertexBuffer *vb = gWindow->vertexBuffer ();
+ int oldVCount = vb->countVertices ();
- v = vb->getVertices ();
- v += vb->getVertexStride () - 3;
- v += vb->getVertexStride () * oldVCount;
+ GLfloat *v = vb->getVertices ();
+ v += vb->getVertexStride () - 3;
+ v += vb->getVertexStride () * oldVCount;
+
+ int offX = 0, offY = 0;
if (!window->onAllViewports ())
{
CompPoint offset = caScreen->cScreen->windowPaintOffset ();
- offset = window->getMovementForOffset (offset);
- offX = offset.x ();
- offY = offset.y ();
+ offset = window->getMovementForOffset (offset);
+ offX = offset.x ();
+ offY = offset.y ();
}
-
+
+ int sx1, sx2, sw, sy1, sy2, sh;
+
if (cMOM == CubeScreen::OneBigCube)
{
sx1 = 0;
sx2 = screen->width ();
- sw = screen->width ();
+ sw = sx2;
sy1 = 0;
sy2 = screen->height ();
- sh = screen->height ();
+ sh = sy2;
}
else if (cMOM == CubeScreen::MultipleCubes)
{
@@ -798,10 +898,10 @@
{
sx1 = 0;
sx2 = screen->width ();
- sw = screen->width ();
+ sw = sx2;
sy1 = 0;
sy2 = screen->height ();
- sh = screen->height ();
+ sh = sy2;
}
else
{
@@ -814,26 +914,29 @@
}
}
- sx1g = sx1 - CUBEADDON_GRID_SIZE;
- sx2g = sx2 + CUBEADDON_GRID_SIZE;
- sy1g = sy1 - CUBEADDON_GRID_SIZE;
- sy2g = sy2 + CUBEADDON_GRID_SIZE;
+ float sx1g = sx1 - CUBEADDON_GRID_SIZE;
+ float sx2g = sx2 + CUBEADDON_GRID_SIZE;
+ float sy1g = sy1 - CUBEADDON_GRID_SIZE;
+ float sy2g = sy2 + CUBEADDON_GRID_SIZE;
+ float inv = (cubeScreen->invert () == 1) ? 1.0 : -1.0;
+ float last[2][4];
+ float ang;
+ int i;
if (caD == CubeaddonScreen::DeformationCylinder || cubeScreen->unfolded ())
{
float lastX = std::numeric_limits ::min (), lastZ = 0.0;
- for (i = oldVCount; i < vb->countVertices (); i++)
+ for (i = oldVCount; i < vb->countVertices (); ++i)
{
if (v[0] == lastX)
- {
v[2] = lastZ;
- }
else if (v[0] + offX >= sx1g &&
v[0] + offY < sx2g)
{
ang = (((v[0] + offX - sx1) / (float)sw) - 0.5);
ang *= ang;
+
if (ang < radSquare)
{
v[2] = sqrtf (radSquare - ang) - cDist;
@@ -849,12 +952,13 @@
}
else
{
-
last[0][0] = -1000000000.0;
last[1][0] = -1000000000.0;
- int cLast = 0;
- for (i = oldVCount; i < vb->countVertices (); i++)
+ int cLast = 0;
+ float vpx, vpy;
+
+ for (i = oldVCount; i < vb->countVertices (); ++i)
{
if (last[0][0] == v[0] && last[0][1] == v[1])
{
@@ -871,8 +975,8 @@
continue;
}
- float vpx = v[0] + offX;
- float vpy = v[1] + offY;
+ vpx = v[0] + offX;
+ vpy = v[1] + offY;
if (vpx >= sx1g && vpx < sx2g &&
vpy >= sy1g && vpy < sy2g)
@@ -883,8 +987,8 @@
float a2 = (((vpy - sy1) / (float)sh) - 0.5);
a2 *= a2;
- ang = atanf (a1 / cDist);
- a2 = sqrtf (radSquare - a2);
+ ang = atanf (a1 / cDist);
+ a2 = sqrtf (radSquare - a2);
int iang = (((int)(ang * RAD2I1024)) + 1024) & 0x3ff;
v[2] += ((caScreen->mCosT [iang] * a2) - cDist) * caScreen->mDeform * inv;
@@ -898,9 +1002,7 @@
}
}
else
- {
gWindow->glAddGeometry (matrix, region, clip, maxGridWidth, maxGridHeight);
- }
}
bool
@@ -919,11 +1021,19 @@
offset = window->getMovementForOffset (offset);
}
+<<<<<<< TREE
int x1 = window->x () - window->output ().left + offset.x ();
int x2 = window->x () + window->width () + window->output ().right + offset.x ();
if (x1 < 0 && x2 < 0)
return false;
if (x1 > screen->width () && x2 > screen->width ())
+=======
+ int x1 = window->x () - window->output ().left + offset.x ();
+ int x2 = window->x () + window->width () + window->output ().right + offset.x ();
+
+ if ((x1 < 0 && x2 < 0) ||
+ (x1 > screen->width () && x2 > screen->width ()))
+>>>>>>> MERGE-SOURCE
return false;
}
@@ -944,8 +1054,8 @@
float x, y;
GLfloat *v, *n;
- GLVertexBuffer *vb = gWindow->vertexBuffer ();
- CubeScreen::MultioutputMode cMOM = cubeScreen->multioutputMode ();
+ GLVertexBuffer *vb = gWindow->vertexBuffer ();
+ CubeScreen::MultioutputMode cMOM = cubeScreen->multioutputMode ();
float cDist = cubeScreen->distance ();
float inv = (cubeScreen->invert () == 1) ? 1.0: -1.0;
@@ -956,14 +1066,14 @@
if ((int) caScreen->mWinNormSize < vertexCount * 3)
{
delete [] caScreen->mWinNormals;
- caScreen->mWinNormals = new GLfloat[vertexCount * 3];
+ caScreen->mWinNormals = new GLfloat[vertexCount * 3];
caScreen->mWinNormSize = vertexCount * 3;
}
if (!window->onAllViewports ())
{
CompPoint offset = caScreen->cScreen->windowPaintOffset ();
- offset = window->getMovementForOffset (offset);
+ offset = window->getMovementForOffset (offset);
offX = offset.x ();
offY = offset.y ();
}
@@ -972,10 +1082,10 @@
{
sx1 = 0;
sx2 = screen->width ();
- sw = screen->width ();
+ sw = sx2;
sy1 = 0;
sy2 = screen->height ();
- sh = screen->height ();
+ sh = sy2;
}
else if (cMOM == CubeScreen::MultipleCubes)
{
@@ -1013,7 +1123,7 @@
if (cubeScreen->paintOrder () == FTB)
{
- for (i = 0; i < vertexCount; i++)
+ for (i = 0; i < vertexCount; ++i)
{
x = (((v[0] + offX - sx1) / (float)sw) - 0.5);
y = (((v[1] + offY - sy1) / (float)sh) - 0.5);
@@ -1027,7 +1137,7 @@
}
else
{
- for (i = 0; i < vertexCount; i++)
+ for (i = 0; i < vertexCount; ++i)
{
x = (((v[0] + offX - sx1) / (float)sw) - 0.5);
y = (((v[1] + offY - sy1) / (float)sh) - 0.5);
@@ -1054,9 +1164,10 @@
CubeaddonScreen::cubeShouldPaintAllViewports ()
{
bool status = cubeScreen->cubeShouldPaintAllViewports ();
- return (!optionGetDrawTop () ||
+
+ return (!optionGetDrawTop () ||
!optionGetDrawBottom () ||
- (mDeform > 0.0) ||
+ (mDeform > 0.0) ||
status);
}
@@ -1067,16 +1178,16 @@
CompOutput *output,
unsigned int mask)
{
- GLMatrix sTransform = transform;
- float cDist = cubeScreen->distance ();
- float cDist2 = cubeScreen->distance () * cubeScreen->distance ();
+ GLMatrix sTransform = transform;
+ float cDist = cubeScreen->distance ();
+ float cDist2 = cDist * cDist;
- if (optionGetDeformation () != DeformationNone &&
- screen->vpSize ().width () * cubeScreen->nOutput () > 2 &&
- screen->desktopWindowCount () &&
+ if (optionGetDeformation () != DeformationNone &&
+ screen->vpSize ().width () * cubeScreen->nOutput () > 2 &&
+ screen->desktopWindowCount () &&
(cubeScreen->rotationState () == CubeScreen::RotationManual ||
(cubeScreen->rotationState () == CubeScreen::RotationChange &&
- !optionGetCylinderManualOnly ()) || mWasDeformed) &&
+ !optionGetCylinderManualOnly ()) || mWasDeformed) &&
(!cubeScreen->unfolded () || optionGetUnfoldDeformation ()))
{
float x, progress;
@@ -1088,25 +1199,25 @@
optionGetDeformation () == DeformationSphere)
{
float scale, val = optionGetSphereAspect () * mDeform;
+ float oWidth = static_cast (output->width ());
+ float oHeight = static_cast (output->height ());
- if (output->width () > output->height ())
+ if (oWidth > oHeight)
{
- scale = (float)output->height () / (float)output->width ();
+ scale = oHeight / oWidth;
scale = (scale * val) + 1.0 - val;
sTransform.scale (scale, 1.0, 1.0);
}
else
{
- scale = (float)output->width () / (float)output->height ();
+ scale = oWidth / oHeight;
scale = (scale * val) + 1.0 - val;
sTransform.scale (1.0, scale, 1.0);
}
}
}
else
- {
mDeform = 0.0;
- }
cubeScreen->cubeShouldPaintAllViewportsSetEnabled (this, true);
@@ -1116,40 +1227,42 @@
changeCap (false, 0);
}
- if (mDeform != mCapDeform || mCapDistance != cDist ||
- mCapDeformType != optionGetDeformation ())
+ if (mDeform != mCapDeform ||
+ mCapDistance != cDist ||
+ mCapDeformType != optionGetDeformation ())
{
- float *quad;
- int j;
- float rS, r, x, y, z;
+ float *quad;
+ int j, jPlus1;
+ float rS = cDist2 + 0.5;
+ float r, x, y, z;
+
if (optionGetDeformation () != DeformationSphere ||
!optionGetDeformCaps ())
{
- rS = cDist2 + 0.5;
-
mCapFill[0] = 0.0;
mCapFill[1] = 0.5;
mCapFill[2] = 0.0;
- mCapFillNorm[0] = 0.0;
+ mCapFillNorm[0] = 0.0;
mCapFillNorm[1] = -1.0;
- mCapFillNorm[2] = 0.0;
+ mCapFillNorm[2] = 0.0;
+ y = 0.5;
z = cDist;
r = 0.25 + cDist2;
- for (j = 0; j <= CAP_ELEMENTS; j++)
+ for (j = 0; j <= CAP_ELEMENTS; ++j)
{
- x = -0.5 + ((float)j / (float)CAP_ELEMENTS);
- z = ((sqrtf(r - (x * x)) - cDist) * mDeform) + cDist;
- y = 0.5;
+ x = -0.5 + ((float)j / (float)CAP_ELEMENTS);
+ z = ((sqrtf(r - (x * x)) - cDist) * mDeform) + cDist;
+ jPlus1 = j + 1;
- quad = &mCapFill[(1 + j) * 3];
+ quad = &mCapFill[jPlus1 * 3];
quad[0] = x;
quad[1] = y;
quad[2] = z;
- quad = &mCapFillNorm[(1 + j) * 3];
+ quad = &mCapFillNorm[jPlus1 * 3];
quad[0] = -x;
quad[1] = -y;
@@ -1158,35 +1271,49 @@
}
else
{
+<<<<<<< TREE
float w;
rS = cDist2 + 0.5;
+=======
+ float w, halfW, xSq, cDistW, rMinusXSq;
+ int iCapElem;
+>>>>>>> MERGE-SOURCE
mCapFill[0] = 0.0;
mCapFill[1] = ((sqrtf (rS) - 0.5) * mDeform) + 0.5;
mCapFill[2] = 0.0;
- mCapFillNorm[0] = 0.0;
+ mCapFillNorm[0] = 0.0;
mCapFillNorm[1] = -1.0;
- mCapFillNorm[2] = 0.0;
+ mCapFillNorm[2] = 0.0;
+<<<<<<< TREE
for (int i = 0; i < CAP_ELEMENTS; i++)
+=======
+ for (int i = 0; i < CAP_ELEMENTS; ++i)
+>>>>>>> MERGE-SOURCE
{
- w = (float)(i + 1) / (float)CAP_ELEMENTS;
-
- r = (((w / 2.0) * (w / 2.0)) + (cDist2 * w * w));
-
- for (j = 0; j <= CAP_ELEMENTS; j++)
+ w = (float)(i + 1) / (float)CAP_ELEMENTS;
+ halfW = w / 2.0f;
+ r = (halfW * halfW) + (cDist2 * w * w);
+
+ for (j = 0; j <= CAP_ELEMENTS; ++j)
{
- x = - (w / 2.0) + ((float)j * w / (float)CAP_ELEMENTS);
- z = ((sqrtf(r - (x * x)) - (cDist * w)) * mDeform) + (cDist * w);
- y = ((sqrtf(rS - (x * x) - (r - (x * x))) - 0.5) * mDeform) + 0.5;
+ x = -halfW + ((float)j * w / (float)CAP_ELEMENTS);
+ xSq = x * x;
+ cDistW = cDist * w;
+ rMinusXSq = r - xSq;
+ z = ((sqrtf(rMinusXSq) - cDistW) * mDeform) + cDistW;
+ y = ((sqrtf(rS - xSq - rMinusXSq) - 0.5) * mDeform) + 0.5;
+ iCapElem = i * (CAP_ELEMENTS + 1);
+ jPlus1 = j + 1;
- quad = &mCapFill[(1 + (i * (CAP_ELEMENTS + 1)) + j) * 3];
+ quad = &mCapFill[(jPlus1 + iCapElem) * 3];
quad[0] = x;
quad[1] = y;
quad[2] = z;
- quad = &mCapFillNorm[(1 + (i * (CAP_ELEMENTS + 1)) + j) * 3];
+ quad = &mCapFillNorm[(jPlus1 + iCapElem) * 3];
quad[0] = -x;
quad[1] = -y;
@@ -1202,7 +1329,7 @@
if (cubeScreen->invert () == 1 && mFirst && optionGetReflection ())
{
- mFirst = false;
+ mFirst = false;
mReflection = true;
if (screen->grabExist ("cube"))
@@ -1221,62 +1348,68 @@
}
else
{
- GLMatrix rTransform = sTransform;
- GLMatrix pTransform;
- float angle = 360.0 / ((float) screen->vpSize ().width () *
- cubeScreen->nOutput ());
- float xRot, vRot, xRotate, xRotate2, vRotate, p;
- float rYTrans;
- GLVector point (-0.5, -0.5, cDist, 1.0);
- GLVector point2 (-0.5, 0.5, cDist, 1.0);
- float deform = 0.0f;
+ GLMatrix rTransform = sTransform;
+ float xRot, vRot, p;
cubeScreen->cubeGetRotation (xRot, vRot, p);
mBackVRotate = 0.0;
- xRotate = xRot;
- xRotate2 = xRot;
- vRotate = vRot;
+ float xRotate = xRot;
+ float xRotate2 = xRot;
+ float vRotate = vRot;
if (vRotate < 0.0)
xRotate += 180;
- vRotate = fmod (fabs (vRotate), 180.0);
- xRotate = fmod (fabs (xRotate), angle);
- xRotate2 = fmod (fabs (xRotate2), angle);
+ float angle = 360.0 / ((float) screen->vpSize ().width () *
+ cubeScreen->nOutput ());
+ float halfAngle = angle / 2.0f;
+ float degToRad = M_PI / 180.0f;
+
+ vRotate = fmod (fabs (vRotate), 180.0);
+ xRotate = fmod (fabs (xRotate), angle);
+ xRotate2 = fmod (fabs (xRotate2), angle);
if (vRotate >= 90.0)
vRotate = 180.0 - vRotate;
- if (xRotate >= angle / 2.0)
+ if (xRotate >= halfAngle)
xRotate = angle - xRotate;
- if (xRotate2 >= angle / 2.0)
+ if (xRotate2 >= halfAngle)
xRotate2 = angle - xRotate2;
- xRotate = (mDeform * angle * 0.5) +
+ xRotate = (mDeform * halfAngle) +
((1.0 - mDeform) * xRotate);
- xRotate2 = (mDeform * angle * 0.5) +
+ xRotate2 = (mDeform * halfAngle) +
((1.0 - mDeform) * xRotate2);
+ GLVector point (-0.5, -0.5, cDist, 1.0);
+ GLVector point2 (-0.5, 0.5, cDist, 1.0);
+ GLMatrix pTransform;
+
pTransform.reset ();
pTransform.rotate (xRotate, 0.0f, 1.0f, 0.0f);
- pTransform.rotate (vRotate, cosf (xRotate * (M_PI / 180.0f)),
- 0.0f, sinf (xRotate * (M_PI / 180.0f)));
+ pTransform.rotate (vRotate, cosf (xRotate * degToRad),
+ 0.0f, sinf (xRotate * degToRad));
point = pTransform * point;
pTransform.reset ();
pTransform.rotate (xRotate2, 0.0f, 1.0f, 0.0f);
- pTransform.rotate (vRotate, cosf (xRotate2 * (M_PI / 180.0f)),
- 0.0f, sinf (xRotate2 * (M_PI / 180.0f)));
+ pTransform.rotate (vRotate, cosf (xRotate2 * degToRad),
+ 0.0f, sinf (xRotate2 * degToRad));
point2 = pTransform * point2;
- switch (optionGetMode ()) {
+ float rYTrans;
+
+ switch (optionGetMode ())
+ {
case ModeJumpyReflection:
mYTrans = 0.0;
+
if (optionGetDeformation () == DeformationSphere &&
optionGetDeformCaps () && optionGetDrawBottom ())
rYTrans = sqrt (0.5 + cDist2) * -2.0;
@@ -1295,19 +1428,20 @@
optionGetDeformCaps () && optionGetDrawBottom ())
{
mYTrans = mCapFill[1] - 0.5;
- rYTrans = -mCapFill[1] - 0.5;
+ rYTrans = -mYTrans;
}
else if (optionGetDeformation () == DeformationSphere &&
- vRotate > atan (cDist * 2) / (M_PI / 180.0f))
+ vRotate > atan (cDist * 2) / degToRad)
{
- mYTrans = sqrt (0.5 + cDist2) - 0.5;
- rYTrans = -sqrt (0.5 + cDist2) - 0.5;
+ mYTrans = sqrt (0.5 + cDist2) - 0.5;
+ rYTrans = -mYTrans;
}
else
{
mYTrans = -point[1] - 0.5;
- rYTrans = point[1] - 0.5;
+ rYTrans = -mYTrans;
}
+
break;
}
@@ -1321,17 +1455,20 @@
if (optionGetMode () == ModeAbove)
mZTrans = 0.0;
+ float deform = 0.0f;
+
if (optionGetDeformation () == DeformationCylinder)
deform = (sqrt (0.25 + cDist2) - cDist) * -mDeform;
else if (optionGetDeformation () == DeformationSphere)
- deform = (sqrt (0.5 + cDist2) - cDist) * -mDeform;
+ deform = (sqrt (0.5 + cDist2) - cDist) * -mDeform;
if (mDeform > 0.0)
- mZTrans = deform;
+ mZTrans = deform;
if (optionGetMode () == ModeAbove && mVRot > 0.0)
{
mBackVRotate = mVRot;
+
if (optionGetDeformation () == DeformationSphere &&
optionGetDeformCaps () && optionGetDrawBottom ())
{
@@ -1340,7 +1477,7 @@
}
else
{
- mYTrans = 0.0;
+ mYTrans = 0.0;
rYTrans = -1.0;
}
@@ -1374,23 +1511,32 @@
unsigned short col1[4], col2[4];
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
-
- GLMatrix gTransform;
-
- glEnable (GL_BLEND);
+ GLMatrix gTransform;
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
gTransform.translate (0, 0, -DEFAULT_Z_CAMERA);
+<<<<<<< TREE
float i = optionGetIntensity () * 2;
float c = optionGetIntensity ();
+=======
+ float c = optionGetIntensity ();
+ float i = c * 2;
+
+ GLfloat halfV = v / 2.0f;
+>>>>>>> MERGE-SOURCE
GLfloat vertices[] =
{
- 0.5f, v / 2.0f, 0.0f,
- -0.5f, v / 2.0f, 0.0f,
+ 0.5f, halfV, 0.0f,
+ -0.5f, halfV, 0.0f,
-0.5f, -0.5f, 0.0f,
- 0.5f, -0.5f, 0.0f
+ 0.5f, -0.5f, 0.0f
};
unsigned short cMax = MAX (0.0, 1.0 - i) + (v * c);
@@ -1407,10 +1553,15 @@
streamingBuffer->begin (GL_TRIANGLE_STRIP);
streamingBuffer->addColors (4, colors);
streamingBuffer->addVertices (4, vertices);
+
if (streamingBuffer->end ())
streamingBuffer->render (gTransform);
+<<<<<<< TREE
for (int j = 0; j < 4; j++)
+=======
+ for (int j = 0; j < 4; ++j)
+>>>>>>> MERGE-SOURCE
{
col1[j] = (1.0 - v) * optionGetGroundColor1 () [j] +
(v * (optionGetGroundColor1 () [j] +
@@ -1422,14 +1573,14 @@
if (optionGetGroundSize () > 0.0)
{
+ GLfloat gsf = -0.5f + static_cast (((1 - v) *
+ optionGetGroundSize ()) + v);
GLfloat vertices[] =
{
-0.5f, -0.5f, 0.0f,
- 0.5f, -0.5f, 0.0f,
- 0.5f, -0.5f +
- static_cast (((1 - v) * optionGetGroundSize ()) + v),
- -0.5f, -0.5f +
- static_cast (((1 - v) * optionGetGroundSize ()) + v)
+ 0.5f, -0.5f, 0.0f,
+ 0.5f, gsf,
+ -0.5f, gsf
};
GLushort colors[] =
@@ -1449,7 +1600,9 @@
}
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- glDisable (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glDisable (GL_BLEND);
}
else
drawBasicGround ();
@@ -1516,19 +1669,24 @@
mReflection (false),
mFirst (true),
mLast (0),
- mYTrans (0.0),
- mZTrans (0.0),
- mDeform (0.0),
+ mYTrans (0.0f),
+ mZTrans (0.0f),
+ mDeform (0.0f),
mWinNormals (0),
mWinNormSize (0),
- mCapDeform (-1.0),
+ mCapDeform (-1.0f),
mCapDistance (cubeScreen->distance ())
{
- GLushort *idx;
+ GLushort *idx = mCapFillIdx;
+<<<<<<< TREE
idx = mCapFillIdx;
for (int i = 0; i < CAP_ELEMENTS - 1; i++)
for (int j = 0; j < CAP_ELEMENTS; j++)
+=======
+ for (int i = 0; i < CAP_ELEMENTS - 1; ++i)
+ for (int j = 0; j < CAP_ELEMENTS; ++j)
+>>>>>>> MERGE-SOURCE
{
idx[0] = 1 + (i * (CAP_ELEMENTS + 1)) + j;
idx[1] = 1 + ((i + 1) * (CAP_ELEMENTS + 1)) + j;
@@ -1537,13 +1695,13 @@
idx += 4;
}
- mTopCap.mFiles = optionGetTopImages ();
+ mTopCap.mFiles = optionGetTopImages ();
mBottomCap.mFiles = optionGetBottomImages ();
-
- for (int i = 0; i < 1024; i++)
+
+ for (int i = 0; i < 1024; ++i)
{
- mSinT[i] = sinf(i / RAD2I1024);
- mCosT[i] = cosf(i / RAD2I1024);
+ mSinT[i] = sinf (i / RAD2I1024);
+ mCosT[i] = cosf (i / RAD2I1024);
}
changeCap (true, 0);
=== modified file 'plugins/cubeaddon/src/cubeaddon.h'
--- plugins/cubeaddon/src/cubeaddon.h 2013-01-04 05:52:46 +0000
+++ plugins/cubeaddon/src/cubeaddon.h 2013-07-21 23:03:28 +0000
@@ -40,14 +40,14 @@
#include "cubeaddon_options.h"
const unsigned short CUBEADDON_GRID_SIZE = 100;
-const unsigned short CAP_ELEMENTS = 15;
-const unsigned int CAP_NVERTEX = (((CAP_ELEMENTS * (CAP_ELEMENTS + 1)) + 2) * 3);
-const unsigned int CAP_NIDX = (CAP_ELEMENTS * (CAP_ELEMENTS - 1) * 4);
-
-const unsigned int CAP_NIMGVERTEX = (((CAP_ELEMENTS + 1) * (CAP_ELEMENTS + 1)) * 5);
-const unsigned int CAP_NIMGIDX = (CAP_ELEMENTS * CAP_ELEMENTS * 4);
-
-const float RAD2I1024 = 162.9746617f;
+const unsigned short CAP_ELEMENTS = 15;
+const unsigned int CAP_NVERTEX = (((CAP_ELEMENTS * (CAP_ELEMENTS + 1)) + 2) * 3);
+const unsigned int CAP_NIDX = (CAP_ELEMENTS * (CAP_ELEMENTS - 1) * 4);
+
+const unsigned int CAP_NIMGVERTEX = (((CAP_ELEMENTS + 1) * (CAP_ELEMENTS + 1)) * 5);
+const unsigned int CAP_NIMGIDX = (CAP_ELEMENTS * CAP_ELEMENTS * 4);
+
+const float RAD2I1024 = 162.9746617f;
class CubeaddonScreen :
public CompositeScreenInterface,
@@ -57,36 +57,51 @@
public CubeaddonOptions
{
public:
+
CubeaddonScreen (CompScreen *);
~CubeaddonScreen ();
- bool setOption (const CompString &name, CompOption::Value &value);
+ bool setOption (const CompString &name,
+ CompOption::Value &value);
void donePaint ();
- bool glPaintOutput (const GLScreenPaintAttrib&, const GLMatrix&,
- const CompRegion&, CompOutput *, unsigned int);
- void glPaintTransformedOutput (const GLScreenPaintAttrib&,
- const GLMatrix&, const CompRegion&,
- CompOutput *, unsigned int);
-
-
- void cubeGetRotation (float &x, float &v, float &progress);
- void cubeClearTargetOutput (float xRotate, float vRotate);
+ bool glPaintOutput (const GLScreenPaintAttrib &,
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
+
+ void glPaintTransformedOutput (const GLScreenPaintAttrib &,
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
+
+ void cubeGetRotation (float &x,
+ float &v,
+ float &progress);
+
+ void cubeClearTargetOutput (float xRotate,
+ float vRotate);
+
void cubePaintTop (const GLScreenPaintAttrib &sAttrib,
const GLMatrix &transform,
CompOutput *output,
int size,
const GLVector &normal);
+
void cubePaintBottom (const GLScreenPaintAttrib &sAttrib,
const GLMatrix &transform,
CompOutput *output,
int size,
const GLVector &normal);
+
bool cubeCheckOrientation (const GLScreenPaintAttrib &sAttrib,
const GLMatrix &transform,
CompOutput *output,
std::vector &points);
+
bool cubeShouldPaintViewport (const GLScreenPaintAttrib &sAttrib,
const GLMatrix &transform,
CompOutput *output,
@@ -97,24 +112,31 @@
class CubeCap
{
public:
+
CubeCap ();
- void load (bool scale, bool aspect, bool clamp);
+ void load (bool scale,
+ bool aspect,
+ bool clamp);
- int mCurrent;
- CompOption::Value::Vector mFiles;
-
- bool mLoaded;
-
- GLTexture::List mTexture;
- GLMatrix mTexMat;
+ int mCurrent;
+ CompOption::Value::Vector mFiles;
+
+ bool mLoaded;
+
+ GLTexture::List mTexture;
+ GLMatrix mTexMat;
};
friend class CubeaddonWindow;
private:
- bool changeCap (bool top, int change);
+
+ bool changeCap (bool top,
+ int change);
+
void drawBasicGround ();
+
void paintCap (const GLScreenPaintAttrib &sAttrib,
const GLMatrix &transform,
CompOutput *output,
@@ -129,35 +151,35 @@
CubeScreen *cubeScreen;
- bool mReflection;
- bool mFirst;
-
- CompOutput *mLast;
-
- float mYTrans;
- float mZTrans;
-
- float mBackVRotate;
- float mVRot;
-
- float mDeform;
- bool mWasDeformed;
-
- GLfloat *mWinNormals;
- unsigned int mWinNormSize;
-
- GLfloat mCapFill[CAP_NVERTEX];
- GLfloat mCapFillNorm[CAP_NVERTEX];
- GLushort mCapFillIdx[CAP_NIDX];
- float mCapDeform;
- float mCapDistance;
- int mCapDeformType;
-
- CubeCap mTopCap;
- CubeCap mBottomCap;
+ bool mReflection;
+ bool mFirst;
+
+ CompOutput *mLast;
+
+ float mYTrans;
+ float mZTrans;
+
+ float mBackVRotate;
+ float mVRot;
+
+ float mDeform;
+ bool mWasDeformed;
+
+ GLfloat *mWinNormals;
+ unsigned int mWinNormSize;
+
+ GLfloat mCapFill[CAP_NVERTEX];
+ GLfloat mCapFillNorm[CAP_NVERTEX];
+ GLushort mCapFillIdx[CAP_NIDX];
+ float mCapDeform;
+ float mCapDistance;
+ int mCapDeformType;
+
+ CubeCap mTopCap;
+ CubeCap mBottomCap;
- float mSinT[1024];
- float mCosT[1024];
+ float mSinT[1024];
+ float mCosT[1024];
};
class CubeaddonWindow :
@@ -165,17 +187,24 @@
public PluginClassHandler
{
public:
+
CubeaddonWindow (CompWindow *);
- bool glDraw (const GLMatrix&, const GLWindowPaintAttrib&,
- const CompRegion&, unsigned int);
- void glAddGeometry (const GLTexture::MatrixList&,
- const CompRegion&, const CompRegion&,
- unsigned int, unsigned int);
- void glDrawTexture (GLTexture *,
- const GLMatrix &matrix,
+ bool glDraw (const GLMatrix &,
+ const GLWindowPaintAttrib &,
+ const CompRegion &,
+ unsigned int );
+
+ void glAddGeometry (const GLTexture::MatrixList &,
+ const CompRegion &,
+ const CompRegion &,
+ unsigned int ,
+ unsigned int );
+
+ void glDrawTexture (GLTexture *,
+ const GLMatrix &matrix,
const GLWindowPaintAttrib& attrib,
- unsigned int);
+ unsigned int );
CompWindow *window;
GLWindow *gWindow;
=== modified file 'plugins/dbus/src/dbus.cpp'
--- plugins/dbus/src/dbus.cpp 2013-07-04 02:09:26 +0000
+++ plugins/dbus/src/dbus.cpp 2013-07-21 23:03:28 +0000
@@ -180,9 +180,7 @@
p = CompPlugin::find (path[0].c_str ());
if (!p)
- {
return emptyList;
- }
if (p->vTable->getOptions ().empty ())
return emptyList;
@@ -190,6 +188,7 @@
return p->vTable->getOptions ();
}
+<<<<<<< TREE
bool
DbusScreen::sendIntrospectResponse (DBusConnection *connection,
DBusMessage *message,
@@ -214,6 +213,112 @@
dbus_message_unref (reply);
return true;
+=======
+#if INTROSPECTION_XML_ENABLED
+/* functions to create introspection XML */
+static void
+dbusIntrospectStartInterface (xmlTextWriterPtr writer)
+{
+ xmlTextWriterStartElement (writer, BAD_CAST "interface");
+ xmlTextWriterWriteAttribute (writer, BAD_CAST "name",
+ BAD_CAST COMPIZ_DBUS_SERVICE_NAME);
+}
+
+static void
+dbusIntrospectEndInterface (xmlTextWriterPtr writer)
+{
+ xmlTextWriterEndElement (writer);
+}
+
+static void
+dbusIntrospectAddArgument (xmlTextWriterPtr writer,
+ char *type,
+ char *direction)
+{
+ xmlTextWriterStartElement (writer, BAD_CAST "arg");
+ xmlTextWriterWriteAttribute (writer, BAD_CAST "type", BAD_CAST type);
+ xmlTextWriterWriteAttribute (writer, BAD_CAST "direction",
+ BAD_CAST direction);
+ xmlTextWriterEndElement (writer);
+}
+
+static void
+dbusIntrospectAddMethod (xmlTextWriterPtr writer,
+ char *name,
+ int nArgs,
+ ...)
+{
+ va_list var_args;
+ char *type, *direction;
+
+ xmlTextWriterStartElement (writer, BAD_CAST "method");
+ xmlTextWriterWriteAttribute (writer, BAD_CAST "name", BAD_CAST name);
+
+ va_start (var_args, nArgs);
+ while (nArgs)
+ {
+ type = va_arg (var_args, char *);
+ direction = va_arg (var_args, char *);
+ dbusIntrospectAddArgument (writer, type, direction);
+ --nArgs;
+ }
+ va_end (var_args);
+
+ xmlTextWriterEndElement (writer);
+}
+
+static void
+dbusIntrospectAddSignal (xmlTextWriterPtr writer,
+ char *name,
+ int nArgs,
+ ...)
+{
+ va_list var_args;
+ char *type;
+
+ xmlTextWriterStartElement (writer, BAD_CAST "signal");
+ xmlTextWriterWriteAttribute (writer, BAD_CAST "name", BAD_CAST name);
+
+ va_start (var_args, nArgs);
+ while (nArgs)
+ {
+ type = va_arg (var_args, char *);
+ dbusIntrospectAddArgument (writer, type, "out");
+ --nArgs;
+ }
+ va_end (var_args);
+
+ xmlTextWriterEndElement (writer);
+}
+
+static void
+dbusIntrospectAddNode (xmlTextWriterPtr writer,
+ char *name)
+{
+ xmlTextWriterStartElement (writer, BAD_CAST "node");
+ xmlTextWriterWriteAttribute (writer, BAD_CAST "name", BAD_CAST name);
+ xmlTextWriterEndElement (writer);
+}
+
+static void
+dbusIntrospectStartRoot (xmlTextWriterPtr writer)
+{
+ xmlTextWriterStartElement (writer, BAD_CAST "node");
+
+ xmlTextWriterStartElement (writer, BAD_CAST "interface");
+ xmlTextWriterWriteAttribute (writer, BAD_CAST "name",
+ BAD_CAST "org.freedesktop.DBus.Introspectable");
+
+ dbusIntrospectAddMethod (writer, "Introspect", 1, "s", "out");
+
+ xmlTextWriterEndElement (writer);
+}
+
+static void
+dbusIntrospectEndRoot (xmlTextWriterPtr writer)
+{
+ xmlTextWriterEndDocument (writer);
+>>>>>>> MERGE-SOURCE
}
/* introspection handlers */
@@ -221,6 +326,7 @@
DbusScreen::handleRootIntrospectMessage (DBusConnection *connection,
DBusMessage *message)
{
+<<<<<<< TREE
IntrospectionResponse response;
response.startInterface ();
@@ -247,6 +353,74 @@
return sendIntrospectResponse (connection, message, response);
+=======
+ xmlTextWriterPtr writer;
+ xmlBufferPtr buf;
+
+ buf = xmlBufferCreate ();
+ writer = xmlNewTextWriterMemory (buf, 0);
+
+ dbusIntrospectStartRoot (writer);
+ dbusIntrospectStartInterface (writer);
+
+ dbusIntrospectAddMethod (writer, COMPIZ_DBUS_GET_PLUGINS_MEMBER_NAME, 1,
+ "as", "out");
+ dbusIntrospectAddMethod (writer,
+ COMPIZ_DBUS_GET_PLUGIN_METADATA_MEMBER_NAME, 7,
+ "s", "in", "s", "out", "s", "out", "s", "out",
+ "b", "out", "as", "out", "as", "out");
+ dbusIntrospectAddSignal (writer,
+ COMPIZ_DBUS_PLUGINS_CHANGED_SIGNAL_NAME, 0);
+
+ dbusIntrospectEndInterface (writer);
+
+ const CompPlugin::List &plugins = CompPlugins::getPlugins ();
+ CompPlugin::List::const_iterator it = plugins.begin ();
+ if (it != plugins.end ())
+ for (; it != plugins.end (); ++it)
+ {
+ CompPlugin::VTable *v = it->vTable;
+ if (v)
+ dbusIntrospectAddNode (writer, v->name ().c_str());
+ }
+ else
+ {
+ xmlFreeTextWriter (writer);
+ xmlBufferFree (buf);
+ return false;
+ }
+
+ dbusIntrospectEndRoot (writer);
+
+ xmlFreeTextWriter (writer);
+
+ DBusMessage *reply = dbus_message_new_method_return (message);
+ if (!reply)
+ {
+ xmlBufferFree (buf);
+ return false;
+ }
+
+ DBusMessageIter args;
+ dbus_message_iter_init_append (reply, &args);
+
+ if (!dbus_message_iter_append_basic (&args, DBUS_TYPE_STRING,
+ &buf->content))
+ {
+ xmlBufferFree (buf);
+ return false;
+ }
+
+ xmlBufferFree (buf);
+
+ if (!dbus_connection_send (connection, reply, NULL))
+ return false;
+
+ dbus_connection_flush (connection);
+ dbus_message_unref (reply);
+
+ return true;
+>>>>>>> MERGE-SOURCE
}
/* MULTIDPYERROR: only works with one or less displays present */
@@ -284,7 +458,40 @@
}
}
+<<<<<<< TREE
return sendIntrospectResponse (connection, message, response);
+=======
+ dbusIntrospectEndRoot (writer);
+
+ xmlFreeTextWriter (writer);
+
+ DBusMessage *reply = dbus_message_new_method_return (message);
+ if (!reply)
+ {
+ xmlBufferFree (buf);
+ return false;
+ }
+
+ DBusMessageIter args;
+ dbus_message_iter_init_append (reply, &args);
+
+ if (!dbus_message_iter_append_basic (&args, DBUS_TYPE_STRING,
+ &buf->content))
+ {
+ xmlBufferFree (buf);
+ return false;
+ }
+
+ xmlBufferFree (buf);
+
+ if (!dbus_connection_send (connection, reply, NULL))
+ return false;
+
+ dbus_connection_flush (connection);
+ dbus_message_unref (reply);
+
+ return true;
+>>>>>>> MERGE-SOURCE
}
bool
@@ -307,6 +514,7 @@
response.startInterface ();
if (option)
+<<<<<<< TREE
{
restrictionType = option->type ();
if (restrictionType == CompOption::TypeList)
@@ -397,7 +605,208 @@
return sendIntrospectResponse (connection, message, response);
}
-
+=======
+ while (nOptions--)
+ {
+ dbusIntrospectAddNode (writer, option->name);
+ ++option;
+ }
+
+ dbusIntrospectEndRoot (writer);
+
+ xmlFreeTextWriter (writer);
+
+ DBusMessage *reply = dbus_message_new_method_return (message);
+ if (!reply)
+ {
+ xmlBufferFree (buf);
+ return false;
+ }
+
+ DBusMessageIter args;
+ dbus_message_iter_init_append (reply, &args);
+
+ if (!dbus_message_iter_append_basic (&args, DBUS_TYPE_STRING,
+ &buf->content))
+ {
+ xmlBufferFree (buf);
+ return false;
+ }
+
+ xmlBufferFree (buf);
+
+ if (!dbus_connection_send (connection, reply, NULL))
+ return false;
+
+ dbus_connection_flush (connection);
+ dbus_message_unref (reply);
+
+ return true;
+}
+
+static bool
+dbusHandleOptionIntrospectMessage (DBusConnection *connection,
+ DBusMessage *message,
+ char **path)
+{
+ CompOption *option;
+ int nOptions;
+ CompOptionType restrictionType;
+ bool metadataHandled;
+ char type[3];
+ bool isList = false;
+
+ xmlBufferPtr buf = xmlBufferCreate ();
+ xmlTextWriterPtr writer = xmlNewTextWriterMemory (buf, 0);
+
+ dbusIntrospectStartRoot (writer);
+ dbusIntrospectStartInterface (writer);
+
+ option = dbusGetOptionsFromPath (path, NULL, NULL, &nOptions);
+ if (!option)
+ {
+ xmlFreeTextWriter (writer);
+ xmlBufferFree (buf);
+ return false;
+ }
+
+ while (nOptions--)
+ {
+ if (strcmp (option->name, path[2]) == 0)
+ {
+ restrictionType = option->type;
+ if (restrictionType == CompOptionTypeList)
+ {
+ restrictionType = option->value.list.type;
+ isList = true;
+ }
+
+ metadataHandled = false;
+ switch (restrictionType)
+ {
+ case CompOptionTypeInt:
+ if (isList)
+ strcpy (type, "ai");
+ else
+ strcpy (type, "i");
+
+ dbusIntrospectAddMethod (writer,
+ COMPIZ_DBUS_GET_METADATA_MEMBER_NAME,
+ 6, "s", "out", "s", "out",
+ "b", "out", "s", "out",
+ "i", "out", "i", "out");
+ metadataHandled = true;
+ break;
+
+ case CompOptionTypeFloat:
+ if (isList)
+ strcpy (type, "ad");
+ else
+ strcpy (type, "d");
+
+ dbusIntrospectAddMethod (writer,
+ COMPIZ_DBUS_GET_METADATA_MEMBER_NAME,
+ 7, "s", "out", "s", "out",
+ "b", "out", "s", "out",
+ "d", "out", "d", "out",
+ "d", "out");
+ metadataHandled = true;
+ break;
+
+ case CompOptionTypeString:
+ if (isList)
+ strcpy (type, "as");
+ else
+ strcpy (type, "s");
+
+ dbusIntrospectAddMethod (writer,
+ COMPIZ_DBUS_GET_METADATA_MEMBER_NAME,
+ 5, "s", "out", "s", "out",
+ "b", "out", "s", "out",
+ "as", "out");
+ metadataHandled = true;
+ break;
+
+ case CompOptionTypeBool:
+ case CompOptionTypeBell:
+ if (isList)
+ strcpy (type, "ab");
+ else
+ strcpy (type, "b");
+
+ break;
+
+ case CompOptionTypeColor:
+ case CompOptionTypeKey:
+ case CompOptionTypeButton:
+ case CompOptionTypeEdge:
+ case CompOptionTypeMatch:
+ if (isList)
+ strcpy (type, "as");
+ else
+ strcpy (type, "s");
+ break;
+
+ default:
+ continue;
+ }
+
+ dbusIntrospectAddMethod (writer,
+ COMPIZ_DBUS_GET_MEMBER_NAME, 1,
+ type, "out");
+ dbusIntrospectAddMethod (writer,
+ COMPIZ_DBUS_SET_MEMBER_NAME, 1,
+ type, "in");
+ dbusIntrospectAddSignal (writer,
+ COMPIZ_DBUS_CHANGED_SIGNAL_NAME, 1,
+ type, "out");
+
+ if (!metadataHandled)
+ dbusIntrospectAddMethod (writer,
+ COMPIZ_DBUS_GET_METADATA_MEMBER_NAME,
+ 4, "s", "out", "s", "out",
+ "b", "out", "s", "out");
+ break;
+ }
+
+ ++option;
+ }
+
+ dbusIntrospectEndInterface (writer);
+ dbusIntrospectEndRoot (writer);
+
+ xmlFreeTextWriter (writer);
+
+ DBusMessage *reply = dbus_message_new_method_return (message);
+ if (!reply)
+ {
+ xmlBufferFree (buf);
+ return false;
+ }
+
+ DBusMessageIter args;
+ dbus_message_iter_init_append (reply, &args);
+
+ if (!dbus_message_iter_append_basic (&args, DBUS_TYPE_STRING,
+ &buf->content))
+ {
+ xmlBufferFree (buf);
+ return false;
+ }
+
+ xmlBufferFree (buf);
+
+ if (!dbus_connection_send (connection, reply, NULL))
+ return false;
+
+ dbus_connection_flush (connection);
+ dbus_message_unref (reply);
+
+ return true;
+}
+
+#endif
+>>>>>>> MERGE-SOURCE
/*
* Activate can be used to trigger any existing action. Arguments
@@ -501,6 +910,7 @@
value.set (tmp ? true : false);
}
break;
+
case DBUS_TYPE_INT32:
{
int tmp;
@@ -509,6 +919,7 @@
value.set (tmp);
}
break;
+
case DBUS_TYPE_DOUBLE:
{
double tmp;
@@ -517,6 +928,7 @@
value.set ((float) tmp);
}
break;
+
case DBUS_TYPE_STRING:
{
char *s;
@@ -585,7 +997,6 @@
if (dbus_message_iter_get_arg_type (iter) == type)
{
dbus_message_iter_get_basic (iter, value);
-
return true;
}
@@ -608,6 +1019,7 @@
value.set (b ? true : false);
}
break;
+
case CompOption::TypeInt:
{
int i;
@@ -616,6 +1028,7 @@
value.set (i);
}
break;
+
case CompOption::TypeFloat:
{
double d;
@@ -624,6 +1037,7 @@
value.set ((float) d);
}
break;
+
case CompOption::TypeString:
{
char *s;
@@ -632,6 +1046,7 @@
value.set (CompString (s));
}
break;
+
case CompOption::TypeColor:
{
char *s;
@@ -644,6 +1059,7 @@
value.set (c);
}
break;
+
case CompOption::TypeKey:
{
char *s;
@@ -656,6 +1072,7 @@
value.set (action);
}
break;
+
case CompOption::TypeButton:
{
char *s;
@@ -668,6 +1085,7 @@
value.set (action);
}
break;
+
case CompOption::TypeEdge:
{
char *s;
@@ -680,6 +1098,7 @@
value.set (action);
}
break;
+
case CompOption::TypeBell:
{
bool bell;
@@ -693,6 +1112,7 @@
}
}
break;
+
case CompOption::TypeMatch:
{
char *s;
@@ -701,6 +1121,7 @@
value.set (CompMatch (s));
}
break;
+
default:
success = false;
break;
@@ -771,18 +1192,15 @@
if (getOptionValue (&aiter,
option.value ().listType (),
tmpValue))
- {
option.value ().list ().push_back (tmpValue);
- }
+
} while (dbus_message_iter_next (&aiter));
status = true;
}
}
else if (dbus_message_iter_init (message, &iter))
- {
status = getOptionValue (&iter, option.type (), value);
- }
if (status)
{
@@ -824,6 +1242,7 @@
DBUS_TYPE_INVALID);
}
break;
+
case CompOption::TypeInt:
{
int i = value.i ();
@@ -832,6 +1251,7 @@
DBUS_TYPE_INVALID);
}
break;
+
case CompOption::TypeFloat:
{
double d = value.f ();
@@ -840,6 +1260,7 @@
DBUS_TYPE_INVALID);
}
break;
+
case CompOption::TypeString:
{
CompString string = value.s ();
@@ -849,6 +1270,7 @@
DBUS_TYPE_INVALID);
}
break;
+
case CompOption::TypeColor:
{
CompString color = CompOption::colorToString (value.c ());
@@ -858,6 +1280,7 @@
DBUS_TYPE_INVALID);
}
break;
+
case CompOption::TypeKey:
{
CompString key = value.action ().keyToString ();
@@ -867,6 +1290,7 @@
DBUS_TYPE_INVALID);
}
break;
+
case CompOption::TypeButton:
{
CompString button = value.action ().buttonToString ();
@@ -876,6 +1300,7 @@
DBUS_TYPE_INVALID);
}
break;
+
case CompOption::TypeEdge:
{
CompString edge = value.action ().edgeMaskToString ();
@@ -885,6 +1310,7 @@
DBUS_TYPE_INVALID);
}
break;
+
case CompOption::TypeBell:
{
bool bell = value.action ().bell () ? true : false;
@@ -893,6 +1319,7 @@
DBUS_TYPE_INVALID);
}
break;
+
case CompOption::TypeMatch:
{
CompString match = value.match ().toString ();
@@ -919,13 +1346,16 @@
case CompOption::TypeInt:
sig[0] = DBUS_TYPE_INT32;
break;
+
case CompOption::TypeFloat:
sig[0] = DBUS_TYPE_DOUBLE;
break;
+
case CompOption::TypeBool:
case CompOption::TypeBell:
sig[0] = DBUS_TYPE_BOOLEAN;
break;
+
default:
sig[0] = DBUS_TYPE_STRING;
break;
@@ -947,18 +1377,21 @@
dbus_message_iter_append_basic (&listIter, sig[0], &i);
}
break;
+
case CompOption::TypeFloat:
{
float f = val.f ();
dbus_message_iter_append_basic (&listIter, sig[0], &f);
}
break;
+
case CompOption::TypeBool:
{
bool b = val.b () ? true : false;
dbus_message_iter_append_basic (&listIter, sig[0], &b);
}
break;
+
case CompOption::TypeString:
{
CompString string = val.s ();
@@ -966,6 +1399,7 @@
dbus_message_iter_append_basic (&listIter, sig[0], &s);
}
break;
+
case CompOption::TypeKey:
{
CompString key = val.action ().keyToString ();
@@ -973,6 +1407,7 @@
dbus_message_iter_append_basic (&listIter, sig[0], &s);
}
break;
+
case CompOption::TypeButton:
{
CompString button = val.action ().buttonToString ();
@@ -980,6 +1415,7 @@
dbus_message_iter_append_basic (&listIter, sig[0], &s);
}
break;
+
case CompOption::TypeEdge:
{
CompString edge = val.action ().edgeMaskToString ();
@@ -987,12 +1423,14 @@
dbus_message_iter_append_basic (&listIter, sig[0], &s);
}
break;
+
case CompOption::TypeBell:
{
bool bell = val.action ().bell () ? true : false;
dbus_message_iter_append_basic (&listIter, sig[0], &bell);
}
break;
+
case CompOption::TypeMatch:
{
CompString match = val.match ().toString ();
@@ -1000,6 +1438,7 @@
dbus_message_iter_append_basic (&listIter, sig[0], &s);
}
break;
+
case CompOption::TypeColor:
{
CompString color = CompOption::colorToString (val.c ());
@@ -1007,6 +1446,7 @@
dbus_message_iter_append_basic (&listIter, sig[0], &s);
}
break;
+
default:
break;
}
@@ -1045,14 +1485,12 @@
DBusMessage *reply = NULL;
foreach (CompOption& option, options)
- {
if (option.name () == path[2])
{
reply = dbus_message_new_method_return (message);
appendOptionValue (reply, option.type (), option.value ());
break;
}
- }
if (!reply)
reply = dbus_message_new_error (message,
@@ -1201,26 +1639,28 @@
DBUS_TYPE_INT32, &option->rest.i.max,
DBUS_TYPE_INVALID);
break;
+
case CompOptionTypeFloat: {
- double min, max, precision;
- min = option->rest.f.min;
- max = option->rest.f.max;
- precision = option->rest.f.precision;
+ double min = option->rest.f.min;
+ double max = option->rest.f.max;
+ double precision = option->rest.f.precision;
dbus_message_append_args (reply,
DBUS_TYPE_DOUBLE, &min,
DBUS_TYPE_DOUBLE, &max,
DBUS_TYPE_DOUBLE, &precision,
DBUS_TYPE_INVALID);
- } break;
+ }
+ break;
+
default:
break;
}
break;
}
- option++;
+ ++option;
}
if (!reply)
@@ -1282,10 +1722,8 @@
reply = dbus_message_new_method_return (message);
if (loadedPlugin)
- {
if (!(*p->vTable->init) (p))
initializedPlugin = false;
- }
if (initializedPlugin && p->vTable->getMetadata)
{
@@ -1400,10 +1838,13 @@
if (dbus_message_is_method_call (message,
DBUS_INTERFACE_INTROSPECTABLE,
"Introspect"))
+<<<<<<< TREE
{
if (handlePluginIntrospectMessage (connection, message))
+=======
+ if (handlePluginIntrospectMessage (connection, message, path))
+>>>>>>> MERGE-SOURCE
return DBUS_HANDLER_RESULT_HANDLED;
- }
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
@@ -1413,53 +1854,53 @@
if (dbus_message_is_method_call (message,
DBUS_INTERFACE_INTROSPECTABLE,
"Introspect"))
- {
if (handleScreenIntrospectMessage (connection, message, path))
return DBUS_HANDLER_RESULT_HANDLED;
+<<<<<<< TREE
}
+=======
+
+#endif
+>>>>>>> MERGE-SOURCE
if (dbus_message_is_method_call (message, COMPIZ_DBUS_INTERFACE,
COMPIZ_DBUS_LIST_MEMBER_NAME))
- {
if (handleListMessage (connection, message, path))
return DBUS_HANDLER_RESULT_HANDLED;
- }
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
/* option message */
if (dbus_message_is_method_call (message, DBUS_INTERFACE_INTROSPECTABLE,
"Introspect"))
- {
status = handleOptionIntrospectMessage (connection, message, path);
+<<<<<<< TREE
}
+=======
+
+#endif
+>>>>>>> MERGE-SOURCE
if (dbus_message_is_method_call (message, COMPIZ_DBUS_INTERFACE,
COMPIZ_DBUS_ACTIVATE_MEMBER_NAME))
- {
status = handleActionMessage (connection, message, path, true);
- }
+
else if (dbus_message_is_method_call (message, COMPIZ_DBUS_INTERFACE,
COMPIZ_DBUS_DEACTIVATE_MEMBER_NAME))
- {
status = handleActionMessage (connection, message, path, false);
- }
+
else if (dbus_message_is_method_call (message, COMPIZ_DBUS_INTERFACE,
COMPIZ_DBUS_SET_MEMBER_NAME))
- {
status = handleSetOptionMessage (connection, message, path);
- }
+
else if (dbus_message_is_method_call (message, COMPIZ_DBUS_INTERFACE,
COMPIZ_DBUS_GET_MEMBER_NAME))
- {
status = handleGetOptionMessage (connection, message, path);
- }
+
#if GETMETADATA_ENABLED
else if (dbus_message_is_method_call (message, COMPIZ_DBUS_INTERFACE,
COMPIZ_DBUS_GET_METADATA_MEMBER_NAME))
- {
status = handleGetMetadataMessage (connection, message, path);
- }
#endif
if (status)
@@ -1561,9 +2002,7 @@
CompOption::Vector &options = getOptionsFromPath (path);
if (options.empty ())
- {
return false;
- }
foreach (CompOption& option, options)
{
@@ -1816,7 +2255,7 @@
DbusScreen::~DbusScreen ()
{
- for (int i = 0; i < DBUS_FILE_WATCH_NUM; i++)
+ for (int i = 0; i < DBUS_FILE_WATCH_NUM; ++i)
screen->removeFileWatch (fileWatch[i]);
screen->removeWatchFd (watchFdHandle);
=== modified file 'plugins/decor/src/decor.cpp'
--- plugins/decor/src/decor.cpp 2013-07-15 04:21:45 +0000
+++ plugins/decor/src/decor.cpp 2013-07-21 23:03:28 +0000
@@ -245,7 +245,7 @@
if (updateMatrix)
updateDecorationScale ();
- for (int i = 0; i < wd->nQuad; i++)
+ for (int i = 0; i < wd->nQuad; ++i)
{
box.setGeometry (wd->quad[i].box.x1,
wd->quad[i].box.y1,
@@ -262,7 +262,11 @@
if (gWindow->vertexBuffer ()->end ())
{
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
gWindow->glDrawTexture (wd->decor->texture->textures[0], transform,
attrib, mask);
glDisable (GL_BLEND);
@@ -280,7 +284,10 @@
if (updateMatrix)
updateDecorationScale ();
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
if (gWindow->textures ().size () == 1)
{
@@ -295,7 +302,7 @@
{
if (updateReg)
updateWindowRegions ();
- for (unsigned int i = 0; i < gWindow->textures ().size (); i++)
+ for (unsigned int i = 0; i < gWindow->textures ().size (); ++i)
{
ml[0] = gWindow->matrices ()[i];
gWindow->vertexBuffer ()->begin ();
@@ -306,7 +313,7 @@
}
}
- glDisable (GL_BLEND);
+// glDisable (GL_BLEND);
}
}
@@ -389,7 +396,7 @@
foreach (DecorTexture *t, textures)
if (t->pixmap->getPixmap () == pixmap)
{
- t->refCount++;
+ ++t->refCount;
return t;
}
@@ -418,7 +425,8 @@
void
DecorScreen::releaseTexture (DecorTexture *texture)
{
- texture->refCount--;
+ --texture->refCount;
+
if (texture->refCount)
return;
@@ -627,7 +635,7 @@
{
int left = 0, right = minWidth, top = 0, bottom = minHeight;
- for (unsigned int i = 0; i < nQuad; i++)
+ for (unsigned int i = 0; i < nQuad; ++i)
{
computeQuadBox (&(quad[i]), minWidth, minHeight, &x1, &y1, &x2, &y2,
NULL, NULL);
@@ -826,7 +834,7 @@
}
/* Create a new decoration for each individual item on the property */
- for (int i = 0; i < decor_property_get_num (prop); i++)
+ for (int i = 0; i < decor_property_get_num (prop); ++i)
{
if (std::find (skip.begin (), skip.end (), i) != skip.end ())
continue;
@@ -964,7 +972,7 @@
wd->quad = NULL;
}
- d->refCount++;
+ ++d->refCount;
wd->decor = d;
wd->nQuad = nQuad;
@@ -1010,7 +1018,7 @@
if (!wd)
return;
- for (int i = 0; i < wd->nQuad; i++)
+ for (int i = 0; i < wd->nQuad; ++i)
{
/* Set the quad matrix to the texture matrix */
wd->quad[i].matrix = wd->decor->texture->textures[0]->matrix ();
@@ -1090,7 +1098,7 @@
if (!wd)
return;
- for (int i = 0; i < wd->nQuad; i++)
+ for (int i = 0; i < wd->nQuad; ++i)
{
int x, y;
unsigned int width = window->size ().width ();
@@ -1170,7 +1178,7 @@
{ CompWindowTypeUtilMask, DECOR_WINDOW_TYPE_UTILITY}
};
- for (unsigned int i = 0; i < nTypeStates; i++)
+ for (unsigned int i = 0; i < nTypeStates; ++i)
{
if ((decorType & typeStates[i].decorFlag) && (w->type () & typeStates[i].compFlag))
return true;
@@ -1209,11 +1217,9 @@
if (screen->activeWindow () == w->id ())
decorState &= ~(DECOR_WINDOW_STATE_FOCUS);
- for (unsigned int i = 0; i < nStateStates; i++)
- {
- if ((decorState & stateStates[i].decorFlag) && (w->state () & stateStates[i].compFlag))
- decorState &= ~(stateStates[i].decorFlag);
- }
+ for (unsigned int i = 0; i < nStateStates; ++i)
+ if ((decorState & stateStates[i].decorFlag) && (w->state () & stateStates[i].compFlag))
+ decorState &= ~(stateStates[i].decorFlag);
return (decorState == 0);
}
@@ -1253,7 +1259,7 @@
{ DECOR_WINDOW_ACTION_BELOW, CompWindowActionBelowMask },
};
- for (unsigned int i = 0; i < nActionStates; i++)
+ for (unsigned int i = 0; i < nActionStates; ++i)
{
if ((decorActions & actionStates[i].decorFlag) && (w->type () & actionStates[i].compFlag))
decorActions &= ~(actionStates[i].decorFlag);
@@ -1872,7 +1878,7 @@
rects[i].height = input.top;
if (rects[i].width && rects[i].height)
- i++;
+ ++i;
rects[i].x = 0;
rects[i].y = input.top;
@@ -1880,7 +1886,7 @@
rects[i].height = height - input.top - input.bottom;
if (rects[i].width && rects[i].height)
- i++;
+ ++i;
rects[i].x = width - input.right;
rects[i].y = input.top;
@@ -1888,7 +1894,7 @@
rects[i].height = height - input.top - input.bottom;
if (rects[i].width && rects[i].height)
- i++;
+ ++i;
rects[i].x = 0;
rects[i].y = height - input.bottom;
@@ -1896,7 +1902,7 @@
rects[i].height = input.bottom;
if (rects[i].width && rects[i].height)
- i++;
+ ++i;
XShapeCombineRectangles (screen->dpy (), inputFrame,
ShapeInput, 0, 0, rects, i,
@@ -2014,7 +2020,7 @@
rects[i].height = input.top;
if (rects[i].width && rects[i].height)
- i++;
+ ++i;
rects[i].x = 0;
rects[i].y = input.top;
@@ -2022,7 +2028,7 @@
rects[i].height = height - input.top - input.bottom;
if (rects[i].width && rects[i].height)
- i++;
+ ++i;
rects[i].x = width - input.right;
rects[i].y = input.top;
@@ -2030,7 +2036,7 @@
rects[i].height = height - input.top - input.bottom;
if (rects[i].width && rects[i].height)
- i++;
+ ++i;
rects[i].x = 0;
rects[i].y = height - input.bottom;
@@ -2038,7 +2044,7 @@
rects[i].height = input.bottom;
if (rects[i].width && rects[i].height)
- i++;
+ ++i;
XShapeCombineRectangles (screen->dpy (), outputFrame,
ShapeBounding, 0, 0, rects, i,
@@ -2099,7 +2105,7 @@
{
Atom *ret = (Atom *) data;
- for (unsigned long i = 0; i < n; i++)
+ for (unsigned long i = 0; i < n; ++i)
{
if (ret[i] == decorTypePixmapAtom)
dmSupports |= WINDOW_DECORATION_TYPE_PIXMAP;
@@ -2129,7 +2135,7 @@
if (dmWin)
{
- for (i = 0; i < DECOR_NUM; i++)
+ for (i = 0; i < DECOR_NUM; ++i)
{
decor[i].updateDecoration (screen->root (), decorAtom[i], &mRequestor);
}
@@ -2137,7 +2143,7 @@
else
{
/* No decorator active, destroy all decorations */
- for (i = 0; i < DECOR_NUM; i++)
+ for (i = 0; i < DECOR_NUM; ++i)
{
decor[i].clear ();
@@ -2203,7 +2209,7 @@
if (regions.size () != gWindow->textures ().size ())
regions.resize (gWindow->textures ().size ());
- for (unsigned int i = 0; i < gWindow->textures ().size (); i++)
+ for (unsigned int i = 0; i < gWindow->textures ().size (); ++i)
{
regions[i] = CompRegion (*gWindow->textures ()[i]);
regions[i].translate (input.x (), input.y ());
@@ -2537,7 +2543,7 @@
else
{
/* A default decoration changed */
- for (int i = 0; i < DECOR_NUM; i++)
+ for (int i = 0; i < DECOR_NUM; ++i)
{
if (event->xproperty.atom == decorAtom[i])
{
@@ -2614,7 +2620,7 @@
if (!shapeRects || !n)
break;
- for (int i = 0; i < n; i++)
+ for (int i = 0; i < n; ++i)
dw->frameRegion +=
CompRegion (shapeRects[i].x,
shapeRects[i].y,
@@ -2640,7 +2646,7 @@
if (!n || !shapeRects)
break;
- for (int i = 0; i < n; i++)
+ for (int i = 0; i < n; ++i)
dw->frameRegion +=
CompRegion (shapeRects[i].x,
shapeRects[i].y,
@@ -2835,7 +2841,7 @@
{
if (wd)
{
- for (int i = 0; i < wd->nQuad; i++)
+ for (int i = 0; i < wd->nQuad; ++i)
{
wd->quad[i].box.x1 += dx;
wd->quad[i].box.y1 += dy;
@@ -3107,7 +3113,7 @@
*/
DecorScreen::~DecorScreen ()
{
- for (unsigned int i = 0; i < DECOR_NUM; i++)
+ for (unsigned int i = 0; i < DECOR_NUM; ++i)
decor[i].clear ();
screen->addSupportedAtomsSetEnabled (this, false);
=== modified file 'plugins/expo/src/expo.cpp'
--- plugins/expo/src/expo.cpp 2013-07-14 10:38:09 +0000
+++ plugins/expo/src/expo.cpp 2013-07-21 23:03:28 +0000
@@ -333,6 +333,7 @@
break;
anyClick = true;
+<<<<<<< TREE
if (clickTime == 0)
clickTime = event->xbutton.time;
@@ -386,6 +387,64 @@
default:
break;
+=======
+
+ if (clickTime == 0)
+ clickTime = event->xbutton.time;
+ else if (event->xbutton.time - clickTime <=
+ static_cast (optionGetDoubleClickTime ()) &&
+ lastSelectedVp == selectedVp)
+ doubleClick = true;
+ else
+ {
+ clickTime = event->xbutton.time;
+ doubleClick = false;
+ }
+
+ cScreen->damageScreen ();
+ prevClickPoint = CompPoint (event->xbutton.x, event->xbutton.y);
+ }
+
+ break;
+
+ case ButtonRelease:
+ if (expoMode &&
+ event->xbutton.button == Button1 &&
+ event->xbutton.root == screen->root ())
+ {
+ CompPoint pointer (event->xbutton.x_root, event->xbutton.y_root);
+
+ if (!screen->workArea ().contains (pointer))
+ break;
+
+ if (event->xbutton.time - clickTime >
+ (unsigned int)optionGetDoubleClickTime ())
+ {
+ clickTime = 0;
+ doubleClick = false;
+ }
+ else if (doubleClick ||
+ compiz::expo::clickMovementInThreshold(prevClickPoint.x (),
+ prevClickPoint.y (),
+ event->xbutton.x,
+ event->xbutton.y))
+ {
+ /* TODO: What action to take if expo_key is not defined ? */
+ CompAction &action = optionGetExpoKey ();
+
+ clickTime = 0;
+ doubleClick = false;
+
+ termExpo (&action, 0, noOptions ());
+ anyClick = true;
+ }
+ }
+
+ break;
+
+ default:
+ break;
+>>>>>>> MERGE-SOURCE
}
screen->handleEvent (event);
@@ -958,8 +1017,13 @@
sTransform3 = sTransform2;
+<<<<<<< TREE
sTransform3.translate ( output->x () / static_cast (output->width ()),
-output->y () / static_cast (output->height ()), 0.0);
+=======
+ sTransform3.translate ( output->x () / output->width (),
+ -output->y () / output->height (), 0.0);
+>>>>>>> MERGE-SOURCE
cScreen->setWindowPaintOffset ((screen->vp ().x () - i) *
screen->width (),
@@ -1254,8 +1318,12 @@
if (expoCam <= 0 || (expoCam > 0.0 && expoCam < 1.0 &&
optionGetExpoAnimation () != ExpoAnimationZoom))
+<<<<<<< TREE
gScreen->glPaintTransformedOutput (attrib, transform, region,
output, mask);
+=======
+ gScreen->glPaintTransformedOutput (attrib, transform, region, output, mask);
+>>>>>>> MERGE-SOURCE
else
gScreen->clearOutput (output, GL_COLOR_BUFFER_BIT);
=== modified file 'plugins/expo/src/expo.h'
=== modified file 'plugins/extrawm/src/extrawm.cpp'
--- plugins/extrawm/src/extrawm.cpp 2013-05-09 13:43:07 +0000
+++ plugins/extrawm/src/extrawm.cpp 2013-07-21 23:03:28 +0000
@@ -33,10 +33,8 @@
/* check if the window is already there */
for (it = attentionWindows.begin (); it != attentionWindows.end (); ++it)
- {
if (*it == w)
return;
- }
attentionWindows.push_back (w);
}
@@ -53,13 +51,12 @@
XWMHints *hints;
bool urgent = false;
- if (w->overrideRedirect ())
- return;
-
- if (w->wmType () & (CompWindowTypeDockMask | CompWindowTypeDesktopMask))
+ if (w->overrideRedirect () ||
+ w->wmType () & (CompWindowTypeDockMask | CompWindowTypeDesktopMask))
return;
hints = XGetWMHints (screen->dpy (), w->id ());
+
if (hints)
{
if (hints->flags & XUrgencyHint)
@@ -94,15 +91,11 @@
{
CompWindow *w = *it;
- if (!w->mapNum () || !w->isViewable ())
- {
- if (!w->minimized () &&
- !w->inShowDesktopMode () &&
- !w->shaded ())
- {
- continue;
- }
- }
+ if ((!w->mapNum () || !w->isViewable ()) &&
+ !w->minimized () &&
+ !w->inShowDesktopMode () &&
+ !w->shaded ())
+ continue;
w->activate ();
break;
@@ -118,10 +111,9 @@
CompOption::Vector &options)
{
CompWindow *w;
- Window xid;
- xid = CompOption::getIntOptionNamed (options, "window");
- w = screen->findWindow (xid);
+ Window xid = CompOption::getIntOptionNamed (options, "window");
+ w = screen->findWindow (xid);
if (w)
screen->sendWindowActivationRequest (w->id ());
@@ -135,11 +127,8 @@
{
unsigned int newState = w->state ();
- if (w->overrideRedirect ())
- return;
-
- /* It would be a bug, to put a shaded window to fullscreen. */
- if (w->shaded ())
+ /* It would be a bug, to fullscreen a shaded or override-redirected window. */
+ if (w->overrideRedirect () || w->shaded ())
return;
state = w->constrainWindowState (state, w->actions ());
@@ -161,9 +150,8 @@
CompOption::Vector &options)
{
CompWindow *w;
- Window xid;
- xid = CompOption::getIntOptionNamed (options, "window");
+ Window xid = CompOption::getIntOptionNamed (options, "window");
w = screen->findWindow (xid);
if (w && (w->actions () & CompWindowActionFullscreenMask))
@@ -182,10 +170,9 @@
CompOption::Vector &options)
{
CompWindow *w;
- Window xid;
- xid = CompOption::getIntOptionNamed (options, "window");
- w = screen->findTopLevelWindow (xid);
+ Window xid = CompOption::getIntOptionNamed (options, "window");
+ w = screen->findTopLevelWindow (xid);
if (!compositeAvailable)
{
@@ -216,10 +203,9 @@
CompOption::Vector &options)
{
CompWindow *w;
- Window xid;
- xid = CompOption::getIntOptionNamed (options, "window");
- w = screen->findTopLevelWindow (xid);
+ Window xid = CompOption::getIntOptionNamed (options, "window");
+ w = screen->findTopLevelWindow (xid);
if (w)
{
@@ -239,10 +225,9 @@
CompOption::Vector &options)
{
CompWindow *w;
- Window xid;
- xid = CompOption::getIntOptionNamed (options, "window");
- w = screen->findTopLevelWindow (xid);
+ Window xid = CompOption::getIntOptionNamed (options, "window");
+ w = screen->findTopLevelWindow (xid);
if (w && (w->actions () & CompWindowActionStickMask))
{
@@ -259,7 +244,8 @@
{
screen->handleEvent (event);
- switch (event->type) {
+ switch (event->type)
+ {
case PropertyNotify:
if (event->xproperty.atom == XA_WM_HINTS)
{
@@ -270,6 +256,7 @@
updateAttentionWindow (w);
}
break;
+
default:
break;
}
@@ -315,13 +302,27 @@
bool
ExtraWMPluginVTable::init ()
{
+<<<<<<< TREE
if (CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI))
compositeAvailable = true;
else
+=======
+ if (!CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI))
+>>>>>>> MERGE-SOURCE
compositeAvailable = false;
-
- if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
- return true;
-
- return false;
+<<<<<<< TREE
+
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
+ return true;
+
+ return false;
+=======
+ else
+ compositeAvailable = true;
+
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
+ return true;
+
+ return false;
+>>>>>>> MERGE-SOURCE
}
=== modified file 'plugins/ezoom/ezoom.xml.in'
--- plugins/ezoom/ezoom.xml.in 2013-04-23 21:34:35 +0000
+++ plugins/ezoom/ezoom.xml.in 2013-07-21 23:03:28 +0000
@@ -156,7 +156,7 @@
<_short>Fitting
<_short>Fit the window to the zoom level
- <_long>Resize the window so it matches the current zoom level.
+ <_long>Resize the window so it matches the current zoom level.
=== modified file 'plugins/ezoom/src/ezoom.cpp'
--- plugins/ezoom/src/ezoom.cpp 2013-05-15 15:44:02 +0000
+++ plugins/ezoom/src/ezoom.cpp 2013-07-21 23:03:28 +0000
@@ -132,9 +132,15 @@
if (!outputIsZoomArea (out))
return false;
+<<<<<<< TREE
if (zs->zooms.at (out).currentZoom != 1.0f ||
zs->zooms.at (out).newZoom != 1.0f ||
zs->zooms.at (out).zVelocity != 0.0f)
+=======
+ if (zs->zooms.at (out).currentZoom != 1.0f ||
+ zs->zooms.at (out).newZoom != 1.0f ||
+ zs->zooms.at (out).zVelocity != 0.0f)
+>>>>>>> MERGE-SOURCE
return true;
return false;
@@ -142,7 +148,8 @@
/* Returns the distance to the defined edge in zoomed pixels. */
int
-EZoomScreen::distanceToEdge (int out, EZoomScreen::ZoomEdge edge)
+EZoomScreen::distanceToEdge (int out,
+ EZoomScreen::ZoomEdge edge)
{
CompOutput *o = &screen->outputDevs ().at (out);
@@ -157,11 +164,12 @@
o->region ()->extents.y1, &x1, &y1);
switch (edge)
{
+ case WEST: return o->region ()->extents.x1 - x1;
case NORTH: return o->region ()->extents.y1 - y1;
+ case EAST: return x2 - o->region ()->extents.x2;
case SOUTH: return y2 - o->region ()->extents.y2;
- case EAST: return x2 - o->region ()->extents.x2;
- case WEST: return o->region ()->extents.x1 - x1;
}
+
return 0; // Never reached.
}
@@ -170,7 +178,7 @@
EZoomScreen::ZoomArea::updateActualTranslates ()
{
xtrans = -realXTranslate * (1.0f - currentZoom);
- ytrans = realYTranslate * (1.0f - currentZoom);
+ ytrans = realYTranslate * (1.0f - currentZoom);
}
/* Returns true if the head in question is currently moving.
@@ -181,9 +189,15 @@
bool
EZoomScreen::isInMovement (int out)
{
+<<<<<<< TREE
if (zooms.at (out).currentZoom == 1.0f &&
zooms.at (out).newZoom == 1.0f &&
zooms.at (out).zVelocity == 0.0f)
+=======
+ if (zooms.at (out).currentZoom == 1.0f &&
+ zooms.at (out).newZoom == 1.0f &&
+ zooms.at (out).zVelocity == 0.0f)
+>>>>>>> MERGE-SOURCE
return false;
if (zooms.at (out).currentZoom != zooms.at (out).newZoom ||
@@ -210,6 +224,8 @@
yTranslate (0.0f),
realXTranslate (0.0f),
realYTranslate (0.0f),
+ xtrans (0.0f),
+ ytrans (0.0f),
locked (false)
{
updateActualTranslates ();
@@ -227,30 +243,45 @@
yTranslate (0.0f),
realXTranslate (0.0f),
realYTranslate (0.0f),
+ xtrans (0.0f),
+ ytrans (0.0f),
locked (false)
{
}
-/* Adjust the velocity in the z-direction. */
+<<<<<<< TREE
+/* Adjust the velocity in the z-direction. */
+=======
+
+/* Adjust the velocity in the z-direction. */
+>>>>>>> MERGE-SOURCE
void
-EZoomScreen::adjustZoomVelocity (int out, float chunk)
+EZoomScreen::adjustZoomVelocity (int out,
+ float chunk)
{
+<<<<<<< TREE
float d = (zooms.at (out).newZoom - zooms.at (out).currentZoom) * 75.0f;
float adjust = d * 0.002f;
float amount = fabs (d);
+=======
+ float d = (zooms.at (out).newZoom - zooms.at (out).currentZoom) * 75.0f;
+ float adjust = d * 0.002f;
+ float amount = fabs (d);
+
+>>>>>>> MERGE-SOURCE
if (amount < 1.0f)
amount = 1.0f;
else if (amount > 5.0f)
amount = 5.0f;
- zooms.at (out).zVelocity =
- (amount * zooms.at (out).zVelocity + adjust) / (amount + 1.0f);
+ zooms.at (out).zVelocity = (amount * zooms.at (out).zVelocity + adjust) /
+ (amount + 1.0f);
if (fabs (d) < 0.1f && fabs (zooms.at (out).zVelocity) < 0.005f)
{
zooms.at (out).currentZoom = zooms.at (out).newZoom;
- zooms.at (out).zVelocity = 0.0f;
+ zooms.at (out).zVelocity = 0.0f;
}
else
zooms.at (out).currentZoom += (zooms.at (out).zVelocity * chunk) /
@@ -260,7 +291,8 @@
/* Adjust the X/Y velocity based on target translation and real
* translation. */
void
-EZoomScreen::adjustXYVelocity (int out, float chunk)
+EZoomScreen::adjustXYVelocity (int out,
+ float chunk)
{
zooms.at (out).xVelocity /= 1.25f;
zooms.at (out).yVelocity /= 1.25f;
@@ -295,8 +327,8 @@
{
zooms.at (out).realXTranslate = zooms.at (out).xTranslate;
zooms.at (out).realYTranslate = zooms.at (out).yTranslate;
- zooms.at (out).xVelocity = 0.0f;
- zooms.at (out).yVelocity = 0.0f;
+ zooms.at (out).xVelocity = 0.0f;
+ zooms.at (out).yVelocity = 0.0f;
return;
}
@@ -312,8 +344,13 @@
{
if (grabbed)
{
+<<<<<<< TREE
float amount = msSinceLastPaint * 0.05f * optionGetSpeed ();
int steps = amount / (0.5f * optionGetTimestep ());
+=======
+ float amount = msSinceLastPaint * 0.05f * optionGetSpeed ();
+ int steps = amount / (0.5f * optionGetTimestep ());
+>>>>>>> MERGE-SOURCE
if (!steps)
steps = 1;
@@ -344,6 +381,7 @@
}
}
}
+
if (optionGetZoomMode () == EzoomOptions::ZoomModeSyncMouse)
syncCenterToMouse ();
}
@@ -380,18 +418,27 @@
CompOutput *output,
CompRect box)
{
+<<<<<<< TREE
GLMatrix zTransform (transform);
int inx1, inx2, iny1, iny2;
int out = output->id ();
GLushort colorData[4];
GLushort *color;
GLfloat vertexData[12];
+=======
+ GLMatrix zTransform (transform);
+ int inx1, inx2, iny1, iny2;
+ int out = output->id ();
+ GLushort colorData[4];
+ GLfloat vertexData[12];
+>>>>>>> MERGE-SOURCE
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
zTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA);
convertToZoomed (out, box.x1 (), box.y1 (), &inx1, &iny1);
convertToZoomed (out, box.x2 (), box.y2 (), &inx2, &iny2);
+<<<<<<< TREE
/* We can move in both directions from our starting point
* so we need to calculate the right coordinates first. */
int x1 = MIN (inx1, inx2);
@@ -411,6 +458,31 @@
colorData[1] = alpha * color[1];
colorData[2] = alpha * color[2];
colorData[3] = alpha * MaxUShortFloat;
+=======
+ /* We can move in both directions from our starting point
+ * so we need to calculate the right coordinates first. */
+ int x1 = MIN (inx1, inx2);
+ int y1 = MIN (iny1, iny2);
+ int x2 = MAX (inx1, inx2);
+ int y2 = MAX (iny1, iny2);
+
+ const float MaxUShortFloat = std::numeric_limits ::max ();
+
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ /* just enable blending if it is disabled */
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
+ /* Draw filled rectangle */
+ float alpha = optionGetZoomBoxFillColorAlpha () / MaxUShortFloat;
+ GLushort *color = optionGetZoomBoxFillColor ();
+
+ colorData[0] = alpha * color[0];
+ colorData[1] = alpha * color[1];
+ colorData[2] = alpha * color[2];
+ colorData[3] = alpha * MaxUShortFloat;
+>>>>>>> MERGE-SOURCE
vertexData[0] = x1;
vertexData[1] = y1;
@@ -465,6 +537,7 @@
streamingBuffer->end ();
streamingBuffer->render (zTransform);
+<<<<<<< TREE
glDisable (GL_BLEND);
@@ -473,6 +546,18 @@
y1 - 1,
x2 - x1 + 1,
y2 - y1 + 1));
+=======
+
+ /* just disable blending if it was disabled before */
+ if (!glBlendEnabled)
+ glDisable (GL_BLEND);
+
+ /* Damage the zoom selection box region during draw. */
+ cScreen->damageRegion (CompRegion (x1 - 1,
+ y1 - 1,
+ x2 - x1 + 1,
+ y2 - y1 + 1));
+>>>>>>> MERGE-SOURCE
}
/* Apply the zoom if we are grabbed.
@@ -490,7 +575,7 @@
if (isActive (out))
{
- GLScreenPaintAttrib sa = attrib;
+ GLScreenPaintAttrib sa = attrib;
GLMatrix zTransform = transform;
mask &= ~PAINT_SCREEN_REGION_MASK;
@@ -508,12 +593,18 @@
status = gScreen->glPaintOutput (sa, zTransform, region, output, mask);
drawCursor (output, transform);
+ }
+ else
+ status = gScreen->glPaintOutput (attrib, transform, region, output, mask);
+<<<<<<< TREE
}
else
status = gScreen->glPaintOutput (attrib, transform, region, output,
mask);
+=======
+>>>>>>> MERGE-SOURCE
if (grabIndex)
drawBox (transform, output, box);
@@ -557,7 +648,9 @@
* that is, it's the point that's the same regardless of zoom level.
*/
void
-EZoomScreen::setCenter (int x, int y, bool instant)
+EZoomScreen::setCenter (int x,
+ int y,
+ bool instant)
{
int out = screen->outputDeviceForPoint (x, y);
CompOutput *o = &screen->outputDevs ().at (out);
@@ -626,10 +719,17 @@
void
EZoomScreen::areaToWindow (CompWindow *w)
{
+<<<<<<< TREE
int left = w->serverX () - w->border ().left;
int width = w->width () + w->border ().left + w->border ().right;
int top = w->serverY () - w->border ().top;
int height = w->height () + w->border ().top + w->border ().bottom;
+=======
+ int left = w->serverX () - w->border ().left;
+ int top = w->serverY () - w->border ().top;
+ int width = w->width () + w->border ().left + w->border ().right;
+ int height = w->height () + w->border ().top + w->border ().bottom;
+>>>>>>> MERGE-SOURCE
setZoomArea (left, top, width, height, false);
}
@@ -637,16 +737,19 @@
/* Pans the zoomed area vertically/horizontally by * value * zs->panFactor
* TODO: Fix output. */
void
-EZoomScreen::panZoom (int xvalue, int yvalue)
+EZoomScreen::panZoom (int xvalue,
+ int yvalue)
{
- for (unsigned int out = 0; out < zooms.size (); ++out)
+<<<<<<< TREE
+ for (unsigned int out = 0; out < zooms.size (); ++out)
+=======
+ float panFactor = optionGetPanFactor ();
+
+ for (unsigned int out = 0; out < zooms.size (); ++out)
+>>>>>>> MERGE-SOURCE
{
- zooms.at (out).xTranslate +=
- optionGetPanFactor () * xvalue *
- zooms.at (out).currentZoom;
- zooms.at (out).yTranslate +=
- optionGetPanFactor () * yvalue *
- zooms.at (out).currentZoom;
+ zooms.at (out).xTranslate += panFactor * xvalue * zooms.at (out).currentZoom;
+ zooms.at (out).yTranslate += panFactor * yvalue * zooms.at (out).currentZoom;
}
constrainZoomTranslate ();
@@ -660,14 +763,15 @@
{
pollHandle.start ();
lastChange = time(NULL);
- mouse = MousePoller::getCurrentPosition ();
+ mouse = MousePoller::getCurrentPosition ();
}
/* Sets the zoom (or scale) level.
* Cleans up if we are suddenly zoomed out.
*/
void
-EZoomScreen::setScale (int out, float value)
+EZoomScreen::setScale (int out,
+ float value)
{
if (zooms.at (out).locked)
return;
@@ -758,21 +862,38 @@
*resultY = y;
}
+<<<<<<< TREE
CompOutput *o = &screen->outputDevs ()[out];
ZoomArea &za = zooms.at (out);
+=======
+ CompOutput *o = &screen->outputDevs ()[out];
+ ZoomArea &za = zooms.at (out);
+ int oWidth = o->width ();
+ int oHeight = o->height ();
+ int halfOWidth = oWidth / 2;
+ int halfOHeight = oHeight / 2;
+>>>>>>> MERGE-SOURCE
x -= o->x1 ();
y -= o->y1 ();
*resultX = x - (za.realXTranslate *
- (1.0f - za.currentZoom) * o->width ()) - o->width () / 2;
+ (1.0f - za.currentZoom) * oWidth) - halfOWidth;
*resultX /= za.currentZoom;
- *resultX += o->width () / 2;
+ *resultX += halfOWidth;
*resultX += o->x1 ();
*resultY = y - (za.realYTranslate *
+<<<<<<< TREE
(1.0f - za.currentZoom) * o->height ()) - o->height () / 2;
+=======
+ (1.0f - za.currentZoom) * oHeight) - halfOHeight;
+>>>>>>> MERGE-SOURCE
*resultY /= za.currentZoom;
+<<<<<<< TREE
*resultY += o->height () / 2;
+=======
+ *resultY += halfOHeight;
+>>>>>>> MERGE-SOURCE
*resultY += o->y1 ();
}
@@ -784,28 +905,40 @@
int *resultX,
int *resultY)
{
- CompOutput *o = &screen->outputDevs ().at (out);
-
if (!outputIsZoomArea (out))
{
*resultX = x;
*resultY = y;
}
- ZoomArea &za = zooms.at (out);
+ CompOutput *o = &screen->outputDevs ().at (out);
+ ZoomArea &za = zooms.at (out);
+ int oWidth = o->width ();
+ int oHeight = o->height ();
+ int halfOWidth = oWidth / 2;
+ int halfOHeight = oHeight / 2;
x -= o->x1 ();
y -= o->y1 ();
+<<<<<<< TREE
*resultX = x - (za.xTranslate *
(1.0f - za.newZoom) * o->width ()) - o->width () / 2;
+=======
+
+ *resultX = x - (za.xTranslate * (1.0f - za.newZoom) * oWidth) - halfOWidth;
+>>>>>>> MERGE-SOURCE
*resultX /= za.newZoom;
- *resultX += o->width () / 2;
+ *resultX += halfOWidth;
*resultX += o->x1 ();
+<<<<<<< TREE
*resultY = y - (za.yTranslate *
(1.0f - za.newZoom) * o->height ()) - o->height () / 2;
+=======
+ *resultY = y - (za.yTranslate * (1.0f - za.newZoom) * oHeight) - halfOHeight;
+>>>>>>> MERGE-SOURCE
*resultY /= za.newZoom;
- *resultY += o->height () / 2;
+ *resultY += halfOHeight;
*resultY += o->y1 ();
}
@@ -814,7 +947,9 @@
* Returns false if the point isn't on a actively zoomed head
* or the area is locked. */
bool
-EZoomScreen::ensureVisibility (int x, int y, int margin)
+EZoomScreen::ensureVisibility (int x,
+ int y,
+ int margin)
{
int out = screen->outputDeviceForPoint (x, y);
@@ -870,6 +1005,7 @@
int margin,
ZoomGravity gravity)
{
+<<<<<<< TREE
int out = screen->outputDeviceForPoint (x1 + (x2 - x1 / 2), y1 + (y2 - y1 / 2));
CompOutput *o = &screen->outputDevs ().at (out);
@@ -879,6 +1015,17 @@
if (widthOkay &&
heightOkay)
{
+=======
+ int out = screen->outputDeviceForPoint (x1 + (x2 - x1 / 2), y1 + (y2 - y1 / 2));
+ CompOutput *o = &screen->outputDevs ().at (out);
+
+ bool widthOkay = (float)(x2-x1) / (float)o->width () < zooms.at (out).newZoom;
+ bool heightOkay = (float)(y2-y1) / (float)o->height () < zooms.at (out).newZoom;
+
+ if (widthOkay &&
+ heightOkay)
+ {
+>>>>>>> MERGE-SOURCE
ensureVisibility (x1, y1, margin);
ensureVisibility (x2, y2, margin);
return;
@@ -1154,10 +1301,21 @@
scaleFactor = 1.0f / optionGetScaleMouseStatic ();
sTransform.scale (scaleFactor, scaleFactor, 1.0f);
+<<<<<<< TREE
int x = -cursor.hotX;
int y = -cursor.hotY;
glEnable (GL_BLEND);
+=======
+ int x = -cursor.hotX;
+ int y = -cursor.hotY;
+
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
+>>>>>>> MERGE-SOURCE
glBindTexture (GL_TEXTURE_2D, cursor.texture);
streamingBuffer->begin (GL_TRIANGLE_STRIP);
@@ -1221,7 +1379,12 @@
}
XFixesCursorImage *ci = XFixesGetCursorImage (dpy);
+<<<<<<< TREE
unsigned char *pixels;
+=======
+ unsigned char *pixels;
+ unsigned long pix;
+>>>>>>> MERGE-SOURCE
if (ci)
{
@@ -1239,8 +1402,8 @@
for (i = 0; i < ci->width * ci->height; ++i)
{
- unsigned long pix = ci->pixels[i];
- pixels[i * 4] = pix & 0xff;
+ pix = ci->pixels[i];
+ pixels[i * 4] = pix & 0xff;
pixels[(i * 4) + 1] = (pix >> 8) & 0xff;
pixels[(i * 4) + 2] = (pix >> 16) & 0xff;
pixels[(i * 4) + 3] = (pix >> 24) & 0xff;
@@ -1264,8 +1427,8 @@
for (i = 0; i < cursor->width * cursor->height; ++i)
{
- unsigned long pix = 0x00ffffff;
- pixels[i * 4] = pix & 0xff;
+ pix = 0x00ffffff;
+ pixels[i * 4] = pix & 0xff;
pixels[(i * 4) + 1] = (pix >> 8) & 0xff;
pixels[(i * 4) + 2] = (pix >> 16) & 0xff;
pixels[(i * 4) + 3] = (pix >> 24) & 0xff;
@@ -1319,16 +1482,23 @@
/* Force cursor hiding and mouse panning if this output is locked
* and cursor hiding is not enabled and we are syncing the mouse
*/
+<<<<<<< TREE
if (!optionGetScaleMouse () &&
(optionGetZoomMode () == EzoomOptions::ZoomModeSyncMouse &&
optionGetHideOriginalMouse () &&
!zooms.at (out).locked))
+=======
+ if (!optionGetScaleMouse () &&
+ optionGetZoomMode () == EzoomOptions::ZoomModeSyncMouse &&
+ optionGetHideOriginalMouse () &&
+ !zooms.at (out).locked)
+>>>>>>> MERGE-SOURCE
return;
if (!cursorInfoSelected)
{
cursorInfoSelected = true;
- XFixesSelectCursorInput (screen->dpy (), screen->root (),
+ XFixesSelectCursorInput (screen->dpy (), screen->root (),
XFixesDisplayCursorNotifyMask);
updateCursor (&cursor);
}
@@ -1358,6 +1528,7 @@
CompAction::State state,
CompOption::Vector options)
{
+<<<<<<< TREE
int x1 = CompOption::getIntOptionNamed (options, "x1", -1);
int y1 = CompOption::getIntOptionNamed (options, "y1", -1);
int x2 = CompOption::getIntOptionNamed (options, "x2", -1);
@@ -1365,14 +1536,26 @@
bool scale = CompOption::getBoolOptionNamed (options, "scale", false);
bool restrain = CompOption::getBoolOptionNamed (options, "restrain", false);
+=======
+ int x1 = CompOption::getIntOptionNamed (options, "x1", -1);
+ int y1 = CompOption::getIntOptionNamed (options, "y1", -1);
+>>>>>>> MERGE-SOURCE
if (x1 < 0 || y1 < 0)
- return false;
+<<<<<<< TREE
+ return false;
+=======
+ return false;
+
+ int x2 = CompOption::getIntOptionNamed (options, "x2", -1);
+ int y2 = CompOption::getIntOptionNamed (options, "y2", -1);
+>>>>>>> MERGE-SOURCE
if (x2 < 0)
x2 = x1 + 1;
if (y2 < 0)
+<<<<<<< TREE
y2 = y1 + 1;
int out = screen->outputDeviceForPoint (x1, y1);
@@ -1389,6 +1572,25 @@
if (restrain)
restrainCursor (out);
+=======
+ y2 = y1 + 1;
+
+ bool scale = CompOption::getBoolOptionNamed (options, "scale", false);
+ bool restrain = CompOption::getBoolOptionNamed (options, "restrain", false);
+ int out = screen->outputDeviceForPoint (x1, y1);
+ int width = x2 - x1;
+ int height = y2 - y1;
+
+ setZoomArea (x1, y1, width, height, false);
+ CompOutput *o = &screen->outputDevs (). at(out);
+
+ if (scale && width && height)
+ setScaleBigger (out, width / static_cast (o->width ()),
+ height / static_cast (o->height ()));
+
+ if (restrain)
+ restrainCursor (out);
+>>>>>>> MERGE-SOURCE
toggleFunctions (true);
@@ -1429,6 +1631,7 @@
ensureVisibility (x1, y1, margin);
if (x2 >= 0 && y2 >= 0)
+<<<<<<< TREE
ensureVisibility (x2, y2, margin);
CompOutput *o = &screen->outputDevs (). at(out);
@@ -1440,6 +1643,19 @@
setScaleBigger (out, width / static_cast (o->width ()),
height / static_cast (o->height ()));
+=======
+ ensureVisibility (x2, y2, margin);
+
+ CompOutput *o = &screen->outputDevs (). at(out);
+
+ int width = x2 - x1;
+ int height = y2 - y1;
+
+ if (scale && width && height)
+ setScaleBigger (out, width / static_cast (o->width ()),
+ height / static_cast (o->height ()));
+
+>>>>>>> MERGE-SOURCE
if (restrain)
restrainCursor (out);
@@ -1493,6 +1709,7 @@
}
else
box.setHeight (pointerY - clickPos.y ());
+<<<<<<< TREE
int x = MIN (box.x1 (), box.x2 ());
int y = MIN (box.y1 (), box.y2 ());
@@ -1506,6 +1723,21 @@
setScaleBigger (out, width / static_cast (o->width ()),
height / static_cast (o->height ()));
setZoomArea (x, y, width, height, false);
+=======
+
+ int x = MIN (box.x1 (), box.x2 ());
+ int y = MIN (box.y1 (), box.y2 ());
+ int width = MAX (box.x1 (), box.x2 ()) - x;
+ int height = MAX (box.y1 (), box.y2 ()) - y;
+
+ CompWindow::Geometry outGeometry (x, y, width, height, 0);
+
+ int out = screen->outputDeviceForGeometry (outGeometry);
+ CompOutput *o = &screen->outputDevs (). at (out);
+ setScaleBigger (out, width / static_cast (o->width ()),
+ height / static_cast (o->height ()));
+ setZoomArea (x, y, width, height, false);
+>>>>>>> MERGE-SOURCE
}
toggleFunctions (true);
@@ -1526,9 +1758,7 @@
!isInMovement (out))
setCenter (pointerX, pointerY, true);
- setScale (out,
- zooms.at (out).newZoom /
- optionGetZoomFactor ());
+ setScale (out, zooms.at (out).newZoom / optionGetZoomFactor ());
toggleFunctions (true);
@@ -1619,6 +1849,7 @@
if (!w)
return true;
+<<<<<<< TREE
int width = w->width () + w->border ().left + w->border ().right;
int height = w->height () + w->border ().top + w->border ().bottom;
@@ -1627,6 +1858,16 @@
setScaleBigger (out, width / static_cast (o->width ()),
height / static_cast (o->height ()));
+=======
+
+ int width = w->width () + w->border ().left + w->border ().right;
+ int height = w->height () + w->border ().top + w->border ().bottom;
+ int out = screen->outputDeviceForGeometry (w->geometry ());
+ CompOutput *o = &screen->outputDevs ().at (out);
+
+ setScaleBigger (out, width / static_cast (o->width ()),
+ height / static_cast (o->height ()));
+>>>>>>> MERGE-SOURCE
areaToWindow (w);
toggleFunctions (true);
@@ -1635,10 +1876,17 @@
bool
EZoomScreen::zoomPan (CompAction *action,
+<<<<<<< TREE
CompAction::State state,
CompOption::Vector options,
float horizAmount,
float vertAmount)
+=======
+ CompAction::State state,
+ CompOption::Vector options,
+ float horizAmount,
+ float vertAmount)
+>>>>>>> MERGE-SOURCE
{
panZoom (horizAmount, vertAmount);
@@ -1649,8 +1897,8 @@
*/
bool
EZoomScreen::zoomCenterMouse (CompAction *action,
- CompAction::State state,
- CompOption::Vector options)
+ CompAction::State state,
+ CompOption::Vector options)
{
int out = screen->outputDeviceForPoint (pointerX, pointerY);
@@ -1682,6 +1930,7 @@
unsigned int mask = CWWidth | CWHeight;
XWindowChanges xwc;
+<<<<<<< TREE
int out = screen->outputDeviceForGeometry (w->geometry ());
xwc.x = w->serverX ();
@@ -1689,6 +1938,16 @@
xwc.width = (int) (screen->outputDevs ().at (out).width () *
zooms.at (out).currentZoom -
(int) ((w->border ().left + w->border ().right)));
+=======
+
+ int out = screen->outputDeviceForGeometry (w->geometry ());
+ xwc.x = w->serverX ();
+ xwc.y = w->serverY ();
+
+ xwc.width = (int) (screen->outputDevs ().at (out).width () *
+ zooms.at (out).currentZoom -
+ (int) ((w->border ().left + w->border ().right)));
+>>>>>>> MERGE-SOURCE
xwc.height = (int) (screen->outputDevs ().at (out).height () *
zooms.at (out).currentZoom -
(int) ((w->border ().top + w->border ().bottom)));
@@ -1750,8 +2009,8 @@
bool
EZoomScreen::terminate (CompAction *action,
- CompAction::State state,
- CompOption::Vector options)
+ CompAction::State state,
+ CompOption::Vector options)
{
int out = screen->outputDeviceForPoint (pointerX, pointerY);
@@ -1765,8 +2024,8 @@
action->setState (action->state () & ~(CompAction::StateTermKey |
CompAction::StateTermButton));
+
return false;
-
}
/* Focus-track related event handling.
@@ -1812,11 +2071,19 @@
if (optionGetFocusFitWindow ())
{
+<<<<<<< TREE
int width = w->width () + w->border ().left + w->border ().right;
int height = w->height () + w->border ().top + w->border ().bottom;
float scale = MAX (width / static_cast (screen->outputDevs ().at(out).width ()),
height / static_cast (screen->outputDevs ().at (out).height ()));
+=======
+ int width = w->width () + w->border ().left + w->border ().right;
+ int height = w->height () + w->border ().top + w->border ().bottom;
+ float scale = MAX (width / static_cast (screen->outputDevs ().at (out).width ()),
+ height / static_cast (screen->outputDevs ().at (out).height ()));
+
+>>>>>>> MERGE-SOURCE
if (scale > optionGetAutoscaleMin ())
setScale (out, scale);
}
@@ -1853,6 +2120,7 @@
cScreen->damageScreen ();
}
+
break;
case FocusIn:
@@ -1868,6 +2136,7 @@
if (cursor.isSet)
updateCursor (&cursor);
}
+
break;
}
=== modified file 'plugins/fadedesktop/src/fadedesktop.cpp'
--- plugins/fadedesktop/src/fadedesktop.cpp 2013-05-09 13:43:07 +0000
+++ plugins/fadedesktop/src/fadedesktop.cpp 2013-07-21 23:03:28 +0000
@@ -42,20 +42,11 @@
{
FD_SCREEN (screen);
- if (!window->managed ())
- return false;
-
- if (window->grabbed ())
- return false;
-
- if (window->wmType () & (CompWindowTypeDesktopMask |
- CompWindowTypeDockMask))
- return false;
-
- if (window->state () & CompWindowStateSkipPagerMask)
- return false;
-
- if (!fs->optionGetWindowMatch ().evaluate (window))
+ if (!window->managed () ||
+ window->grabbed () ||
+ (window->wmType () & (CompWindowTypeDesktopMask | CompWindowTypeDockMask)) ||
+ window->state () & CompWindowStateSkipPagerMask ||
+ !fs->optionGetWindowMatch ().evaluate (window))
return false;
return true;
@@ -65,6 +56,7 @@
FadedesktopScreen::preparePaint (int msSinceLastPaint)
{
fadeTime -= msSinceLastPaint;
+
if (fadeTime < 0)
fadeTime = 0;
@@ -91,7 +83,7 @@
windowFadeTime = optionGetFadetime () - fadeTime;
fw->opacity = fw->cWindow->opacity () *
- (windowFadeTime / optionGetFadetime ());
+ (windowFadeTime / optionGetFadetime ());
}
}
}
@@ -119,8 +111,10 @@
w->hide ();
fw->isHidden = true;
}
+
fw->fading = false;
}
+
if (w->inShowDesktopMode ())
isStillSD = true;
}
@@ -133,9 +127,7 @@
activateEvent (false);
}
else
- {
cScreen->damageScreen ();
- }
}
cScreen->donePaint ();
@@ -172,9 +164,9 @@
foreach (CompWindow *w, screen->windows ())
{
FD_WINDOW (w);
+
if (fw->isFadedesktopWindow ())
{
-
fw->fading = true;
w->setShowDesktopMode (true);
fw->opacity = fw->cWindow->opacity ();
@@ -216,9 +208,7 @@
fw->fading = true;
}
else if (fw->fading)
- {
cw->setShowDesktopMode (false);
- }
}
cScreen->damageScreen ();
=== modified file 'plugins/fadedesktop/src/fadedesktop.h'
--- plugins/fadedesktop/src/fadedesktop.h 2009-03-16 01:54:49 +0000
+++ plugins/fadedesktop/src/fadedesktop.h 2013-07-21 23:03:28 +0000
@@ -36,12 +36,14 @@
{
public:
- typedef enum {
+ typedef enum
+ {
Off,
Out,
On,
In
} State;
+
public:
FadedesktopScreen (CompScreen *);
@@ -55,10 +57,10 @@
void leaveShowDesktopMode (CompWindow *w);
CompositeScreen *cScreen;
- GLScreen *gScreen;
+ GLScreen *gScreen;
- State state;
- int fadeTime;
+ State state;
+ int fadeTime;
};
class FadedesktopWindow :
@@ -73,18 +75,18 @@
bool isFadedesktopWindow ();
bool glPaint (const GLWindowPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
- CompWindow *window;
+ CompWindow *window;
CompositeWindow *cWindow;
- GLWindow *gWindow;
-
- bool fading;
- bool isHidden;
-
- GLushort opacity;
+ GLWindow *gWindow;
+
+ bool fading;
+ bool isHidden;
+
+ GLushort opacity;
};
#define FD_SCREEN(s) \
=== modified file 'plugins/firepaint/firepaint.xml.in'
--- plugins/firepaint/firepaint.xml.in 2013-07-04 17:08:01 +0000
+++ plugins/firepaint/firepaint.xml.in 2013-07-21 23:03:28 +0000
@@ -37,17 +37,39 @@
<_long>Mouse button shortcut to remove all fire particles.
-
- <_short>Background Brightness
- <_long>The brightness of the background during Firepaint (in percent).
- 50.0
- 0.0
- 100.0
- 5.0
-
-
-
- <_short>Particle Settings
+<<<<<<< TREE
+
+ <_short>Background Brightness
+ <_long>The brightness of the background during Firepaint (in percent).
+ 50.0
+ 0.0
+ 100.0
+ 5.0
+
+
+
+ <_short>Particle Settings
+=======
+
+ <_short>Background Brightness
+ <_long>The brightness of the background during Firepaint (in percent).
+ 50.0
+ 0.0
+ 100.0
+ 5.0
+
+
+ <_short>Background Saturation
+ <_long>The saturation of the background during Firepaint (in percent).
+ 100.0
+ 0.0
+ 100.0
+ 5.0
+
+
+
+ <_short>Particle Settings
+>>>>>>> MERGE-SOURCE
<_short>Add Particle
<_long>Adds a fire particle at position (x, y), where x and y are floats.
=== modified file 'plugins/firepaint/src/firepaint.cpp'
--- plugins/firepaint/src/firepaint.cpp 2013-07-07 10:17:58 +0000
+++ plugins/firepaint/src/firepaint.cpp 2013-07-21 23:03:28 +0000
@@ -102,7 +102,11 @@
}
void
+<<<<<<< TREE
ParticleSystem::drawParticles(const GLMatrix &transform)
+=======
+ParticleSystem::drawParticles (const GLMatrix &transform)
+>>>>>>> MERGE-SOURCE
{
int i, j, k, l;
@@ -462,7 +466,11 @@
glBindTexture (GL_TEXTURE_2D, 0);
ps.slowdown = optionGetFireSlowdown ();
+<<<<<<< TREE
ps.darken = 0.5f; /* TODO: Magic number */
+=======
+ ps.darken = bg; /* TODO: Magic number */
+>>>>>>> MERGE-SOURCE
ps.blendMode = GL_ONE;
}
@@ -471,6 +479,7 @@
if (!points.empty ())
{
+<<<<<<< TREE
int rVal2;
float rVal, size = 4;
float fireLife = optionGetFireLife ();
@@ -479,6 +488,17 @@
bool mystFire = optionGetFireMystical ();
float max_new = MIN ((int) ps.particles.size (), (int) points.size () * 2) *
((float) time / 50.0f) * (1.05f - fireLife);
+=======
+ GLint rVal2;
+ GLfloat rVal;
+ GLfloat size = 4.0f;
+ GLfloat fireLife = optionGetFireLife ();
+ GLfloat fireWidth = optionGetFireSize ();
+ GLfloat fireHeight = fireWidth * 1.5f;
+ GLboolean mystFire = optionGetFireMystical ();
+ GLfloat max_new = MIN ((int) ps.particles.size (), (int) points.size () * 2) *
+ ((float) time / 50.0f) * (1.05f - fireLife);
+>>>>>>> MERGE-SOURCE
for (unsigned int i = 0; i < ps.particles.size () && max_new > 0; ++i)
{
@@ -487,16 +507,22 @@
if (part.life <= 0.0f)
{
/* give gt new life */
- rVal = (float) (random () & 0xff) / 255.0;
+ rVal = (GLfloat) (random () & 0xff) / 255.0f;
part.life = 1.0f;
/* Random Fade Value */
part.fade = (rVal * (1 - fireLife) +
(0.2f * (1.01 - fireLife)));
/* set size */
+<<<<<<< TREE
part.width = fireWidth;
part.height = fireHeight;
rVal = (float) (random () & 0xff) / 255.0;
+=======
+ part.width = fireWidth;
+ part.height = fireHeight;
+ rVal = (GLfloat) (random () & 0xff) / 255.0f;
+>>>>>>> MERGE-SOURCE
part.w_mod = size * rVal;
part.h_mod = size * rVal;
@@ -510,31 +536,40 @@
part.zo = part.z;
/* set speed and direction */
- rVal = (float) (random () & 0xff) / 255.0;
+ rVal = (GLfloat) (random () & 0xff) / 255.0f;
part.xi = ( (rVal * 20.0) - 10.0f);
- rVal = (float) (random () & 0xff) / 255.0;
+ rVal = (GLfloat) (random () & 0xff) / 255.0f;
part.yi = ( (rVal * 20.0) - 15.0f);
part.zi = 0.0f;
- rVal = (float) (random () & 0xff) / 255.0;
+ rVal = (GLfloat) (random () & 0xff) / 255.0f;
if (mystFire)
{
/* Random colors! (aka Mystical Fire) */
- rVal = (float) (random () & 0xff) / 255.0;
+ rVal = (GLfloat) (random () & 0xff) / 255.0f;
part.r = rVal;
- rVal = (float) (random () & 0xff) / 255.0;
+ rVal = (GLfloat) (random () & 0xff) / 255.0f;
part.g = rVal;
- rVal = (float) (random () & 0xff) / 255.0;
+ rVal = (GLfloat) (random () & 0xff) / 255.0f;
part.b = rVal;
}
else
{
+<<<<<<< TREE
part.r = optionGetFireColorRed () / 0xffff -
(rVal / 1.7 * optionGetFireColorRed () / 0xffff);
part.g = optionGetFireColorGreen () / 0xffff -
(rVal / 1.7 * optionGetFireColorGreen () / 0xffff);
part.b = optionGetFireColorBlue () / 0xffff -
(rVal / 1.7 * optionGetFireColorBlue () / 0xffff);
+=======
+ part.r = optionGetFireColorRed () / 0xffff -
+ (rVal / 1.7 * optionGetFireColorRed () / 0xffff);
+ part.g = optionGetFireColorGreen () / 0xffff -
+ (rVal / 1.7 * optionGetFireColorGreen () / 0xffff);
+ part.b = optionGetFireColorBlue () / 0xffff -
+ (rVal / 1.7 * optionGetFireColorBlue () / 0xffff);
+>>>>>>> MERGE-SOURCE
}
/* set transparency */
@@ -584,9 +619,17 @@
CompOutput *output,
unsigned int mask)
{
+<<<<<<< TREE
bool status = gScreen->glPaintOutput (attrib, transform, region, output, mask);
if ((!init && ps.active) || brightness < 1.0)
+=======
+ return false;
+ bool status = gScreen->glPaintOutput (attrib, transform, region, output, mask);
+ brightness = 1.0f;
+
+ if ((!init && ps.active) && brightness < 1.0)
+>>>>>>> MERGE-SOURCE
{
GLMatrix sTransform = transform;
@@ -694,7 +737,7 @@
cScreen (CompositeScreen::get (screen)),
gScreen (GLScreen::get (screen)),
init (true),
- brightness (1.0),
+ brightness (1.0f),
grabIndex (0)
{
ScreenInterface::setHandler (screen, false);
=== modified file 'plugins/firepaint/src/firepaint.h'
--- plugins/firepaint/src/firepaint.h 2013-07-04 15:07:44 +0000
+++ plugins/firepaint/src/firepaint.h 2013-07-21 23:03:28 +0000
@@ -68,7 +68,6 @@
float zo; /* orginal Z position */
};
-
class ParticleSystem
{
public:
@@ -149,9 +148,9 @@
donePaint ();
void
- fireAddPoint (int x,
- int y,
- bool requireGrab);
+ fireAddPoint (int x,
+ int y,
+ bool requireGrab);
bool
addParticle (CompAction *action,
=== modified file 'plugins/freewins/src/action.cpp'
--- plugins/freewins/src/action.cpp 2013-03-26 22:02:39 +0000
+++ plugins/freewins/src/action.cpp 2013-07-21 23:03:28 +0000
@@ -60,35 +60,27 @@
CompAction::State state,
CompOption::Vector options)
{
- CompWindow* w;
- CompWindow *useW;
- Window xid;
-
- xid = CompOption::getIntOptionNamed (options, "window", 0);
-
- w = screen->findWindow (xid);
- useW = screen->findWindow (xid);
+ Window xid = CompOption::getIntOptionNamed (options, "window", 0);
+ CompWindow *w = screen->findWindow (xid);
+ CompWindow *useW = w;
if (w)
{
-
foreach (FWWindowInputInfo *info, mTransformedWindows)
{
- if (info->ipw)
- if (w->id () == info->ipw)
+ if (info->ipw &&
+ w->id () == info->ipw)
/* The window we just grabbed was actually
* an IPW, get the real window instead
*/
- useW = getRealWindow (w);
+ useW = getRealWindow (w);
}
mRotateCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
- if (!screen->otherGrabExist ("freewins", 0))
- if (!mGrabIndex)
- {
- mGrabIndex = screen->pushGrab (0, "freewins");
- }
+ if (!screen->otherGrabExist ("freewins", 0) &&
+ !mGrabIndex)
+ mGrabIndex = screen->pushGrab (0, "freewins");
}
if (useW)
@@ -98,7 +90,7 @@
FREEWINS_WINDOW (useW);
int x = CompOption::getIntOptionNamed (options, "x",
- useW->x () + (useW->width () / 2));
+ useW->x () + (useW->width () / 2));
int y = CompOption::getIntOptionNamed (options, "y",
useW->y () + (useW->height () / 2));
@@ -106,7 +98,7 @@
mGrabWindow = useW;
- fww->mGrab = grabRotate;
+ fww->mGrab = grabRotate;
/* Save current scales and angles */
@@ -134,23 +126,23 @@
switch (optionGetZAxisRotation ())
{
case ZAxisRotationAlways3d:
- fww->mCan3D = TRUE;
- fww->mCan2D = FALSE;
+ fww->mCan3D = true;
+ fww->mCan2D = false;
break;
case ZAxisRotationAlways2d:
- fww->mCan3D = FALSE;
- fww->mCan2D = TRUE;
+ fww->mCan3D = false;
+ fww->mCan2D = true;
break;
case ZAxisRotationDetermineOnClick:
case ZAxisRotationSwitch:
- fww->determineZAxisClick (pointerX, pointerY, FALSE);
+ fww->determineZAxisClick (pointerX, pointerY, false);
break;
case ZAxisRotationInterchangeable:
- fww->mCan3D = TRUE;
- fww->mCan2D = TRUE;
+ fww->mCan3D = true;
+ fww->mCan2D = true;
break;
default:
@@ -179,9 +171,9 @@
break;
case RotationAxisOppositeToClick:
- fww->calculateInputOrigin (useW->x () + useW->width () - mClick_root_x,
+ fww->calculateInputOrigin (useW->x () + useW->width () - mClick_root_x,
useW->y () + useW->height () - mClick_root_y);
- fww->calculateOutputOrigin (useW->x () + useW->width () - mClick_root_x,
+ fww->calculateOutputOrigin (useW->x () + useW->width () - mClick_root_x,
useW->y () + useW->height () - mClick_root_y);
break;
}
@@ -191,17 +183,17 @@
CompWindowGrabButtonMask);
/* Shape the window beforehand and avoid a stale grab */
- if (fww->canShape ())
- if (fww->handleWindowInputInfo ())
- fww->adjustIPW ();
+ if (fww->canShape () &&
+ fww->handleWindowInputInfo ())
+ fww->adjustIPW ();
cScreen->damageScreen ();
if (state & CompAction::StateInitButton)
action->setState (action->state () | CompAction::StateTermButton);
-
}
}
+
return true;
}
@@ -213,9 +205,14 @@
if (mGrabWindow && mGrabIndex)
{
FREEWINS_WINDOW (mGrabWindow);
+
if (fww->mGrab == grabRotate)
{
int distX, distY;
+ int grabWinRealX, grabWinRealY;
+ int grabWinRealCenterX, grabWinRealCenterY;
+ int grabWinOutX, grabWinOutY;
+ int grabWinOutCenterX, grabWinOutCenterY;
fww->window->ungrabNotify ();
@@ -223,35 +220,48 @@
{
case RotationAxisClickPoint:
case RotationAxisOppositeToClick:
+ grabWinRealX = mGrabWindow->x () - mGrabWindow->border ().left;
+ grabWinRealY = mGrabWindow->y () - mGrabWindow->border ().top;
+ grabWinRealCenterX = (mGrabWindow->width () + mGrabWindow->border ().left +
+ mGrabWindow->border ().right) / 2.0f;
+ grabWinRealCenterY = (mGrabWindow->height () + mGrabWindow->border ().top +
+ mGrabWindow->border ().bottom) / 2.0f;
+
+ grabWinOutX = mGrabWindow->x () - mGrabWindow->output ().left;
+ grabWinOutY = mGrabWindow->y () - mGrabWindow->output ().top;
+ grabWinOutCenterX = (mGrabWindow->width () + mGrabWindow->output ().left +
+ mGrabWindow->output ().right) / 2.0f;
+ grabWinOutCenterY = (mGrabWindow->height () + mGrabWindow->output ().top +
+ mGrabWindow->output ().bottom) / 2.0f;
distX = (fww->mOutputRect.x1 () +
(fww->mOutputRect.width ()) / 2.0f) -
- (WIN_REAL_X (mGrabWindow) +
- WIN_REAL_W (mGrabWindow) / 2.0f);
+ (grabWinRealX +
+ grabWinRealCenterX);
distY = (fww->mOutputRect.y1 () +
(fww->mOutputRect.height ()) / 2.0f) -
- (WIN_REAL_Y (mGrabWindow) +
- WIN_REAL_H (mGrabWindow) / 2.0f);
+ (grabWinRealX +
+ grabWinRealCenterY);
mGrabWindow->move (distX, distY, true);
- fww->calculateInputOrigin (WIN_REAL_X (mGrabWindow) +
- WIN_REAL_W (mGrabWindow) / 2.0f,
- WIN_REAL_Y (mGrabWindow) +
- WIN_REAL_H (mGrabWindow) / 2.0f);
- fww->calculateOutputOrigin (WIN_OUTPUT_X (mGrabWindow) +
- WIN_OUTPUT_W (mGrabWindow) / 2.0f,
- WIN_OUTPUT_Y (mGrabWindow) +
- WIN_OUTPUT_H (mGrabWindow) / 2.0f);
-
+ fww->calculateInputOrigin (grabWinRealX +
+ grabWinRealCenterX,
+ grabWinRealY +
+ grabWinRealCenterY);
+ fww->calculateOutputOrigin (grabWinOutX +
+ grabWinOutCenterX,
+ grabWinOutY +
+ grabWinOutCenterY);
break;
+
default:
break;
}
- if (fww->canShape ())
- if (fww->handleWindowInputInfo ())
- fww->adjustIPW ();
+ if (fww->canShape () &&
+ fww->handleWindowInputInfo ())
+ fww->adjustIPW ();
screen->removeGrab (mGrabIndex, 0);
mGrabIndex = 0;
@@ -265,51 +275,47 @@
return false;
}
-
-/*static void FWMoveWindowToCorrectPosition (CompWindow *w, float distX, float distY)
+#if 0
+static void FWMoveWindowToCorrectPosition (CompWindow *w,
+ float distX,
+ float distY)
{
-
- FREEWINS_WINDOW (w); action->setState (action->state () & ~(CompAction::StateTermKey |
+ FREEWINS_WINDOW (w);
+ action->setState (action->state () & ~(CompAction::StateTermKey |
CompAction::StateTermButton));
fprintf(stderr, "distX is %f distY is %f midX and midY are %f %f\n", distX, distY, fww->mIMidX, fww->mIMidY);
- moveWindow (w, distX * (1 + (1 - fww->mTransform.scaleX)), distY * (1 + (1 - fww->mTransform.scaleY)), TRUE, FALSE);
-
- syncWindowPosition (w);
-}*/
-
+ moveWindow (w, distX * (1 + (1 - fww->mTransform.scaleX)), distY * (1 + (1 - fww->mTransform.scaleY)), true, false);
+}
+#endif
/* Initiate Scaling */
bool
FWScreen::initiateFWScale (CompAction *action,
CompAction::State state,
CompOption::Vector options)
{
- CompWindow* w;
- CompWindow *useW;
- Window xid;
-
- xid = CompOption::getIntOptionNamed (options, "window", 0);
- w = screen->findWindow (xid);
- useW = screen->findWindow (xid);
+ Window xid = CompOption::getIntOptionNamed (options, "window", 0);
+ CompWindow *w = screen->findWindow (xid);
+ CompWindow *useW = w;
if (w)
{
foreach (FWWindowInputInfo *info, mTransformedWindows)
{
- if (info->ipw)
- if (w->id () == info->ipw)
+ if (info->ipw &&
+ w->id () == info->ipw)
/* The window we just grabbed was actually
* an IPW, get the real window instead
*/
- useW = getRealWindow (w);
+ useW = getRealWindow (w);
}
mRotateCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
- if (!screen->otherGrabExist ("freewins", 0))
- if (!mGrabIndex)
- mGrabIndex = screen->pushGrab (mRotateCursor, "freewins");
+ if (!screen->otherGrabExist ("freewins", 0) &&
+ !mGrabIndex)
+ mGrabIndex = screen->pushGrab (mRotateCursor, "freewins");
}
if (useW)
@@ -389,6 +395,9 @@
break;
}
break;
+
+ default:
+ break;
}
fww->mGrab = grabScale;
@@ -400,17 +409,16 @@
cScreen->damageScreen ();
/* Shape the window beforehand and avoid a stale grab */
- if (fww->canShape ())
- if (fww->handleWindowInputInfo ())
- fww->adjustIPW ();
-
+ if (fww->canShape () &&
+ fww->handleWindowInputInfo ())
+ fww->adjustIPW ();
if (state & CompAction::StateInitButton)
action->setState (action->state () | CompAction::StateTermButton);
}
}
- return TRUE;
+ return true;
}
bool
@@ -421,16 +429,17 @@
if (mGrabWindow && mGrabIndex)
{
FREEWINS_WINDOW (mGrabWindow);
+
if (fww->mGrab == grabScale)
{
fww->window->ungrabNotify ();
+ int distX, distY;
+
switch (optionGetScaleMode ())
{
- int distX, distY;
-
case ScaleModeToOppositeCorner:
- distX = (fww->mOutputRect.x1 () + (fww->mOutputRect.width () / 2.0f) - (WIN_REAL_X (mGrabWindow) + WIN_REAL_W (mGrabWindow) / 2.0f));
+ distX = (fww->mOutputRect.x1 () + (fww->mOutputRect.width () / 2.0f) - (WIN_REAL_X (mGrabWindow) + WIN_REAL_W (mGrabWindow) / 2.0f));
distY = (fww->mOutputRect.y1 () + (fww->mOutputRect.width () / 2.0f) - (WIN_REAL_Y (mGrabWindow) + WIN_REAL_H (mGrabWindow) / 2.0f));
mGrabWindow->move (distX, distY, true);
@@ -461,7 +470,7 @@
action->setState (action->state () & ~(CompAction::StateTermKey |
CompAction::StateTermButton));
- return FALSE;
+ return false;
}
/* Repetitive Stuff */
@@ -504,7 +513,6 @@
mAnimate.destScaleX = mTransform.scaleX + dsu;
mAnimate.destScaleY = mTransform.scaleY + dsd;
-
}
}
@@ -517,26 +525,25 @@
bool
FWScreen::rotate (CompAction *action,
CompAction::State state,
- CompOption::Vector options, int dx, int dy, int dz)
+ CompOption::Vector options,
+ int dx,
+ int dy,
+ int dz)
{
CompWindow *w = screen->findWindow (CompOption::getIntOptionNamed (options,
- "window",
- 0));
+ "window", 0));
+
foreach (FWWindowInputInfo *info, mTransformedWindows)
- {
if (info->ipw == w->id ())
- {
w = getRealWindow (w);
- }
- }
FREEWINS_WINDOW (w);
fww->setPrepareRotation (dx, dy, dz, 0, 0);
- if (fww->canShape ())
- if (fww->handleWindowInputInfo ())
- fww->adjustIPW ();
+ if (fww->canShape () &&
+ fww->handleWindowInputInfo ())
+ fww->adjustIPW ();
return true;
}
@@ -545,27 +552,23 @@
FWScreen::scale (CompAction *action,
CompAction::State state,
CompOption::Vector options,
- int scale)
+ int scale)
{
CompWindow *w = screen->findWindow (CompOption::getIntOptionNamed (options,
- "window",
- 0));
+ "window", 0));
+
foreach (FWWindowInputInfo *info, mTransformedWindows)
- {
if (info->ipw == w->id ())
- {
w = getRealWindow (w);
- }
- }
FREEWINS_WINDOW (w);
fww->setPrepareRotation (0, 0, 0, scale, scale);
fww->cWindow->addDamage ();
- if (fww->canShape ())
- if (fww->handleWindowInputInfo ())
- fww->adjustIPW ();
+ if (fww->canShape () &&
+ fww->handleWindowInputInfo ())
+ fww->adjustIPW ();
if (!optionGetAllowNegative ())
{
@@ -588,15 +591,11 @@
CompOption::Vector options)
{
CompWindow *w = screen->findWindow (CompOption::getIntOptionNamed (options,
- "window",
- 0));
+ "window", 0));
+
foreach (FWWindowInputInfo *info, mTransformedWindows)
- {
if (info->ipw == w->id ())
- {
w = getRealWindow (w);
- }
- }
if (w)
{
@@ -608,16 +607,16 @@
(1 - fww->mTransform.scaleY));
fww->cWindow->addDamage ();
- fww->mTransformed = FALSE;
+ fww->mTransformed = false;
if (fww->canShape ())
if (fww->handleWindowInputInfo ())
fww->adjustIPW ();
- fww->mResetting = TRUE;
+ fww->mResetting = true;
}
- return TRUE;
+ return true;
}
/* Callable action to rotate a window to the angle provided
@@ -631,9 +630,7 @@
CompAction::State state,
CompOption::Vector options)
{
- CompWindow *w;
-
- w = screen->findWindow (CompOption::getIntOptionNamed (options, "window", 0));
+ CompWindow *w = screen->findWindow (CompOption::getIntOptionNamed (options, "window", 0));
if (w)
{
@@ -650,9 +647,7 @@
}
else
- {
return false;
- }
return true;
}
@@ -668,9 +663,7 @@
CompAction::State state,
CompOption::Vector options)
{
- CompWindow *w;
-
- w = screen->findWindow (CompOption::getIntOptionNamed (options, "window", 0));
+ CompWindow *w = screen->findWindow (CompOption::getIntOptionNamed (options, "window", 0));
if (w)
{
@@ -684,12 +677,9 @@
y,
z, 0, 0);
fww->cWindow->addDamage ();
-
}
else
- {
return false;
- }
return true;
}
@@ -704,9 +694,7 @@
CompAction::State state,
CompOption::Vector options)
{
- CompWindow *w;
-
- w = screen->findWindow (CompOption::getIntOptionNamed (options, "window", 0));
+ CompWindow *w = screen->findWindow (CompOption::getIntOptionNamed (options, "window", 0));
if (w)
{
@@ -718,14 +706,16 @@
fww->setPrepareRotation (0, 0, 0,
x - fww->mAnimate.destScaleX,
y - fww->mAnimate.destScaleY);
- if (fww->canShape ())
- if (fww->handleWindowInputInfo ())
- fww->adjustIPW ();
+
+ if (fww->canShape () &&
+ fww->handleWindowInputInfo ())
+ fww->adjustIPW ();
/* Stop scale at threshold specified */
if (!optionGetAllowNegative ())
{
float minScale = optionGetMinScale ();
+
if (fww->mAnimate.destScaleX < minScale)
fww->mAnimate.destScaleX = minScale;
@@ -740,9 +730,7 @@
}
else
- {
return false;
- }
return true;
}
@@ -757,5 +745,5 @@
cScreen->damageScreen ();
- return TRUE;
+ return true;
}
=== modified file 'plugins/freewins/src/events.cpp'
--- plugins/freewins/src/events.cpp 2013-03-26 22:02:39 +0000
+++ plugins/freewins/src/events.cpp 2013-07-21 23:03:28 +0000
@@ -61,17 +61,18 @@
window->activate ();
mGrab = grabResize;
fws->mRotateCursor = XCreateFontCursor (screen->dpy (), XC_plus);
- if(!screen->otherGrabExist ("freewins", "resize", 0))
- if(!fws->mGrabIndex)
- {
- unsigned int mods = 0;
- mods &= CompNoMask;
- fws->mGrabIndex = screen->pushGrab (fws->mRotateCursor, "resize");
- window->grabNotify (window->x () + (window->width () / 2),
- window->y () + (window->height () / 2), mods,
- CompWindowGrabMoveMask | CompWindowGrabButtonMask);
- fws->mGrabWindow = window;
- }
+
+ if(!screen->otherGrabExist ("freewins", "resize", 0) &&
+ !fws->mGrabIndex)
+ {
+ unsigned int mods = 0;
+ mods &= CompNoMask;
+ fws->mGrabIndex = screen->pushGrab (fws->mRotateCursor, "resize");
+ window->grabNotify (window->x () + (window->width () / 2),
+ window->y () + (window->height () / 2), mods,
+ CompWindowGrabMoveMask | CompWindowGrabButtonMask);
+ fws->mGrabWindow = window;
+ }
}
void
@@ -82,13 +83,14 @@
window->activate ();
mGrab = grabMove;
fws->mRotateCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
+
if(!screen->otherGrabExist ("freewins", "resize", 0))
if(!fws->mGrabIndex)
{
unsigned int mods = 0;
mods &= CompNoMask;
fws->mGrabIndex = screen->pushGrab (fws->mRotateCursor, "resize");
- window->grabNotify (window->x () + (window->width () / 2),
+ window->grabNotify (window->x () + (window->width () / 2),
window->y () + (window->height () / 2), mods,
CompWindowGrabResizeMask | CompWindowGrabButtonMask);
fws->mGrabWindow = window;
@@ -101,12 +103,12 @@
{
FREEWINS_SCREEN (screen);
+ if (!fws->mGrabIndex)
+ return;
+
int dx = x - lastPointerX;
int dy = y - lastPointerY;
- if (!fws->mGrabIndex)
- return;
-
window->move (dx, dy, fws->optionGetImmediateMoves ());
}
@@ -236,7 +238,7 @@
}
else if (fws->optionGetZAxisRotation () == FreewinsOptions::ZAxisRotationSwitch)
- determineZAxisClick (pointerX, pointerY, TRUE);
+ determineZAxisClick (pointerX, pointerY, true);
dx *= 360;
dy *= 360;
@@ -559,17 +561,17 @@
snapMods = mSnapMask;
if ((stateEvent->mods & snapMods) == snapMods)
- mSnap = TRUE;
+ mSnap = true;
else
- mSnap = FALSE;
+ mSnap = false;
if (mInvertMask)
invertMods = mInvertMask;
if ((stateEvent->mods & invertMods) == invertMods)
- mInvert = TRUE;
+ mInvert = true;
else
- mInvert = FALSE;
+ mInvert = false;
}
}
=== modified file 'plugins/freewins/src/freewins.h'
--- plugins/freewins/src/freewins.h 2013-02-20 14:24:30 +0000
+++ plugins/freewins/src/freewins.h 2013-07-21 23:03:28 +0000
@@ -94,16 +94,16 @@
#define WIN_OCORNER1(w) GLVector oc1 = GLVector (WIN_OUTPUT_X (w), WIN_OUTPUT_Y (w), 0.0f, 1.0f);
#define WIN_OCORNER2(w) GLVector oc2 = GLVector (WIN_OUTPUT_X (w) + WIN_OUTPUT_W (w), WIN_OUTPUT_Y (w), 0.0f, 1.0f);
#define WIN_OCORNER3(w) GLVector oc3 = GLVector (WIN_OUTPUT_X (w), WIN_OUTPUT_Y (w) + WIN_OUTPUT_H (w), 0.0f, 1.0f);
-#define WIN_OCORNER4(w) GLVector oc4 = GLVector ( WIN_OUTPUT_X (w) + WIN_OUTPUT_W (w), WIN_OUTPUT_Y (w) + WIN_OUTPUT_H (w), 0.0f, 1.0f);
+#define WIN_OCORNER4(w) GLVector oc4 = GLVector (WIN_OUTPUT_X (w) + WIN_OUTPUT_W (w), WIN_OUTPUT_Y (w) + WIN_OUTPUT_H (w), 0.0f, 1.0f);
/* ------ Structures and Enums ------------------------------------------*/
/* Enums */
typedef enum _StartCorner
{
- CornerTopLeft = 0,
- CornerTopRight = 1,
- CornerBottomLeft = 2,
+ CornerTopLeft = 0,
+ CornerTopRight = 1,
+ CornerBottomLeft = 2,
CornerBottomRight = 3
} StartCorner;
@@ -118,7 +118,7 @@
typedef enum _Direction
{
- UpDown = 0,
+ UpDown = 0,
LeftRight = 1
} Direction;
@@ -140,7 +140,8 @@
~FWWindowInputInfo ();
public:
- CompWindow *w;
+
+ CompWindow *w;
Window ipw;
@@ -183,14 +184,14 @@
{
public:
FWTransformedWindowInfo () :
- angX (0),
- angY (0),
- angZ (0),
- scaleX (1.0f),
- scaleY (1.0f),
- unsnapAngX (0),
- unsnapAngY (0),
- unsnapAngZ (0),
+ angX (0),
+ angY (0),
+ angZ (0),
+ scaleX (1.0f),
+ scaleY (1.0f),
+ unsnapAngX (0),
+ unsnapAngY (0),
+ unsnapAngZ (0),
unsnapScaleX (0),
unsnapScaleY (0) {}
@@ -220,17 +221,17 @@
public:
FWAnimationInfo () :
- oldAngX (0),
- oldAngY (0),
- oldAngZ (0),
- oldScaleX (1.0f),
- oldScaleY (1.0f),
- destAngX (0),
- destAngY (0),
- destAngZ (0),
+ oldAngX (0),
+ oldAngY (0),
+ oldAngZ (0),
+ oldScaleX (1.0f),
+ oldScaleY (1.0f),
+ destAngX (0),
+ destAngY (0),
+ destAngZ (0),
destScaleX (1.0f),
destScaleY (1.0f),
- steps (0) {}
+ steps (0) {}
// Old values to animate from
float oldAngX;
@@ -263,40 +264,43 @@
FWScreen (CompScreen *screen);
- CompositeScreen *cScreen;
- GLScreen *gScreen;
+ CompositeScreen *cScreen;
+ GLScreen *gScreen;
std::list mTransformedWindows;
- int mClick_root_x;
- int mClick_root_y;
-
- CompWindow *mGrabWindow;
- CompWindow *mHoverWindow;
- CompWindow *mLastGrabWindow;
-
- bool mAxisHelp;
- bool mSnap;
- bool mInvert;
- int mSnapMask;
- int mInvertMask;
-
- Cursor mRotateCursor;
-
- CompScreen::GrabHandle mGrabIndex;
+ int mClick_root_x;
+ int mClick_root_y;
+
+ CompWindow *mGrabWindow;
+ CompWindow *mHoverWindow;
+ CompWindow *mLastGrabWindow;
+
+ bool mAxisHelp;
+ bool mSnap;
+ bool mInvert;
+
+ int mSnapMask;
+ int mInvertMask;
+
+ Cursor mRotateCursor;
+
+ CompScreen::GrabHandle mGrabIndex;
void preparePaint (int);
+
bool glPaintOutput (const GLScreenPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- CompOutput *,
- unsigned int );
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
+
void donePaint ();
void handleEvent (XEvent *);
void
- optionChanged (CompOption *option,
+ optionChanged (CompOption *option,
FreewinsOptions::Options num);
void
@@ -325,13 +329,16 @@
bool
rotate (CompAction *action,
CompAction::State state,
- CompOption::Vector options, int dx, int dy, int dz);
+ CompOption::Vector options,
+ int dx,
+ int dy,
+ int dz);
bool
- scale (CompAction *action,
- CompAction::State state,
- CompOption::Vector options,
- int scale);
+ scale (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector options,
+ int scale);
bool
resetFWTransform (CompAction *action,
CompAction::State state,
@@ -378,10 +385,18 @@
void
modifyMatrix (GLMatrix &transform,
- float angX, float angY, float angZ,
- float tX, float tY, float tZ,
- float scX, float scY, float scZ,
- float adjustX, float adjustY, bool paint);
+ float angX,
+ float angY,
+ float angZ,
+ float tX,
+ float tY,
+ float tZ,
+ float scX,
+ float scY,
+ float scZ,
+ float adjustX,
+ float adjustY,
+ bool paint);
CompRect
createSizedRect (float xScreen1,
@@ -409,81 +424,86 @@
FWWindow (CompWindow *w);
~FWWindow ();
- CompWindow *window;
+ CompWindow *window;
CompositeWindow *cWindow;
- GLWindow *gWindow;
+ GLWindow *gWindow;
bool glPaint (const GLWindowPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- unsigned int );
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
- bool damageRect (bool initial,
+ bool damageRect (bool initial,
const CompRect &);
- void moveNotify (int, int, bool);
- void resizeNotify (int, int, int, int);
-
- float mIMidX;
- float mIMidY;
-
- float mOMidX; /* These will be removed */
- float mOMidY;
-
- float mAdjustX;
- float mAdjustY;
-
- float mRadius;
+ void moveNotify (int ,
+ int ,
+ bool );
+ void resizeNotify (int ,
+ int ,
+ int ,
+ int );
+
+ float mIMidX;
+ float mIMidY;
+
+ float mOMidX; /* These will be removed */
+ float mOMidY;
+
+ float mAdjustX;
+ float mAdjustY;
+
+ float mRadius;
// Used for determining window movement
- int mOldWinX;
- int mOldWinY;
+ int mOldWinX;
+ int mOldWinY;
// Used for resize
- int mWinH;
- int mWinW;
+ int mWinH;
+ int mWinW;
- Direction mDirection;
+ Direction mDirection;
// Used to determine starting point
- StartCorner mCorner;
+ StartCorner mCorner;
// Transformation info
FWTransformedWindowInfo mTransform;
// Animation Info
- FWAnimationInfo mAnimate;
+ FWAnimationInfo mAnimate;
// Input Info
- FWWindowInputInfo *mInput;
+ FWWindowInputInfo *mInput;
//Output Info
- FWWindowOutputInfo mOutput;
+ FWWindowOutputInfo mOutput;
- CompRect mOutputRect;
- CompRect mInputRect;
+ CompRect mOutputRect;
+ CompRect mInputRect;
// Used to determine whether to animate the window
- bool mResetting;
- bool mIsAnimating;
+ bool mResetting;
+ bool mIsAnimating;
// Used to determine whether rotating on X and Y axis, or just on Z
- bool mCan2D; // These need to be removed
- bool mCan3D;
-
- bool mTransformed; // So does this in favor of FWWindowInputInfo
-
- FWGrabType mGrab;
+ bool mCan2D; // These need to be removed
+ bool mCan3D;
+
+ bool mTransformed; // So does this in favor of FWWindowInputInfo
+
+ FWGrabType mGrab;
void
shapeIPW ();
void
saveInputShape (XRectangle **retRects,
- int *retCount,
- int *retOrdering);
+ int *retCount,
+ int *retOrdering);
void
adjustIPW ();
@@ -517,14 +537,14 @@
void
handleRotateMotionEvent (float dx,
float dy,
- int x,
- int y);
+ int x,
+ int y);
void
handleScaleMotionEvent (float dx,
float dy,
- int x,
- int y);
+ int x,
+ int y);
void
handleButtonReleaseEvent ();
@@ -546,10 +566,12 @@
float dsd);
void
- calculateInputOrigin (float x, float y);
+ calculateInputOrigin (float x,
+ float y);
void
- calculateOutputOrigin (float x, float y);
+ calculateOutputOrigin (float x,
+ float y);
void
calculateOutputRect ();
@@ -564,8 +586,8 @@
GLVector c4);
void
- determineZAxisClick (int px,
- int py,
+ determineZAxisClick (int px,
+ int py,
bool motion);
bool
canShape ();
=== modified file 'plugins/freewins/src/input.cpp'
--- plugins/freewins/src/input.cpp 2013-02-20 14:24:30 +0000
+++ plugins/freewins/src/input.cpp 2013-07-21 23:03:28 +0000
@@ -62,16 +62,13 @@
{
if (mInput)
{
- Window xipw = mInput->ipw;
+ Window xipw = mInput->ipw;
CompWindow *ipw = screen->findWindow (xipw);
if (ipw)
{
- cairo_t *cr;
- int width, height;
-
- width = mInputRect.width ();
- height = mInputRect.height ();
+ int width = mInputRect.width ();
+ int height = mInputRect.height ();
Pixmap b = XCreatePixmap (screen->dpy (), xipw, width, height, 1);
@@ -81,7 +78,7 @@
DefaultScreenOfDisplay (screen->dpy ()),
width, height);
- cr = cairo_create (bitmap);
+ cairo_t *cr = cairo_create (bitmap);
cairo_save (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
@@ -89,41 +86,34 @@
cairo_restore (cr);
/* Move to our first corner (TopLeft) */
-
cairo_move_to (cr,
mOutput.shapex1 - MIN(mInputRect.x1 (), mInputRect.x2 ()),
mOutput.shapey1 - MIN(mInputRect.y1 (), mInputRect.y2 ()));
/* Line to TopRight */
-
cairo_line_to (cr,
mOutput.shapex2 - MIN(mInputRect.x1 (), mInputRect.x2 ()),
mOutput.shapey2 - MIN(mInputRect.y1 (), mInputRect.y2 ()));
/* Line to BottomRight */
-
cairo_line_to (cr,
mOutput.shapex4 - MIN(mInputRect.x1 (), mInputRect.x2 ()),
mOutput.shapey4 - MIN(mInputRect.y1 (), mInputRect.y2 ()));
/* Line to BottomLeft */
-
cairo_line_to (cr,
mOutput.shapex3 - MIN(mInputRect.x1 (), mInputRect.x2 ()),
mOutput.shapey3 - MIN(mInputRect.y1 (), mInputRect.y2 ()));
/* Line to TopLeft */
-
cairo_line_to (cr,
mOutput.shapex1 - MIN(mInputRect.x1 (), mInputRect.x2 ()),
mOutput.shapey1 - MIN(mInputRect.y1 (), mInputRect.y2 ()));
/* Ensure it's all closed up */
-
cairo_close_path (cr);
/* Fill in the box */
-
cairo_set_source_rgb (cr, 1.0f, 1.0f, 1.0f);
cairo_fill (cr);
@@ -157,14 +147,12 @@
void
FWWindow::saveInputShape (XRectangle **retRects,
- int *retCount,
- int *retOrdering)
+ int *retCount,
+ int *retOrdering)
{
- XRectangle *rects;
- int count = 0, ordering;
- Display *dpy = screen->dpy ();
-
- rects = XShapeGetRectangles (dpy, window->id (), ShapeInput, &count, &ordering);
+ int count = 0, ordering;
+ Display *dpy = screen->dpy ();
+ XRectangle *rects = XShapeGetRectangles (dpy, window->id (), ShapeInput, &count, &ordering);
/* check if the returned shape exactly matches the window shape -
if that is true, the window currently has no set input shape */
@@ -175,10 +163,8 @@
window->serverGeometry ().border ())) &&
(rects[0].height == (window->serverHeight () +
window->serverGeometry (). border ())))
- {
count = 0;
- }
-
+
*retRects = rects;
*retCount = count;
*retOrdering = ordering;
@@ -202,13 +188,12 @@
{
XWindowChanges xwc;
Display *dpy = screen->dpy ();
- float f_width, f_height;
if (!mInput || !mInput->ipw)
return;
- f_width = mInputRect.width ();
- f_height = mInputRect.height ();
+ float f_width = mInputRect.width ();
+ float f_height = mInputRect.height ();
xwc.x = mInputRect.x ();
xwc.y = mInputRect.y ();
@@ -230,55 +215,52 @@
void
FWScreen::adjustIPWStacking ()
{
-
foreach (FWWindowInputInfo *run, mTransformedWindows)
- {
if (!run->w->prev || run->w->prev->id () != run->ipw)
FWWindow::get (run->w)->adjustIPW ();
- }
}
/* Create an input prevention window */
void
FWWindow::createIPW ()
{
- Window ipw;
+ if (!mInput || mInput->ipw)
+ return;
+
XSetWindowAttributes attrib;
XWindowChanges xwc;
- if (!mInput || mInput->ipw)
- return;
-
attrib.override_redirect = true;
//attrib.event_mask = 0;
- xwc.x = mInputRect.x ();
- xwc.y = mInputRect.y ();
- xwc.width = mInputRect.width ();
+ xwc.x = mInputRect.x ();
+ xwc.y = mInputRect.y ();
+ xwc.width = mInputRect.width ();
xwc.height = mInputRect.height ();
- ipw = XCreateWindow (screen->dpy (),
- screen->root (),
- xwc.x, xwc.y, xwc.width, xwc.height, 0, CopyFromParent, InputOnly,
- CopyFromParent, CWOverrideRedirect, &attrib);
+ Window ipw = XCreateWindow (screen->dpy (),
+ screen->root (),
+ xwc.x, xwc.y, xwc.width, xwc.height,
+ 0, CopyFromParent, InputOnly,
+ CopyFromParent, CWOverrideRedirect, &attrib);
XMapWindow (screen->dpy (), ipw);
- //XConfigureWindow (screen->dpy (), ipw, CWStackMode | CWX | CWY | CWWidth | CWHeight, &xwc);
+ XConfigureWindow (screen->dpy (), ipw, CWStackMode | CWX | CWY | CWWidth | CWHeight, &xwc);
mInput->ipw = ipw;
- //shapeIPW ();
+ shapeIPW ();
}
FWWindowInputInfo::FWWindowInputInfo (CompWindow *window) :
- w (window),
- ipw (None),
- inputRects (NULL),
- nInputRects (0),
- inputRectOrdering (0),
- frameInputRects (NULL),
- frameNInputRects (0),
+ w (window),
+ ipw (None),
+ inputRects (NULL),
+ nInputRects (0),
+ inputRectOrdering (0),
+ frameInputRects (NULL),
+ frameNInputRects (0),
frameInputRectOrdering (0)
{
}
@@ -308,6 +290,7 @@
else if (mTransformed && !mInput)
{
mInput = new FWWindowInputInfo (window);
+
if (!mInput)
return false;
@@ -325,19 +308,17 @@
void
FWWindow::shapeInput ()
{
- Window frame;
- Display *dpy = screen->dpy();
+ Display *dpy = screen->dpy();
saveInputShape (&mInput->inputRects,
&mInput->nInputRects,
&mInput->inputRectOrdering);
- frame = window->frame();
+ Window frame = window->frame();
+
if (frame)
- {
saveInputShape (&mInput->frameInputRects, &mInput->frameNInputRects,
&mInput->frameInputRectOrdering);
- }
else
{
mInput->frameInputRects = NULL;
@@ -349,7 +330,7 @@
XShapeSelectInput (dpy, window->id(), NoEventMask);
XShapeCombineRectangles (dpy, window->id(), ShapeInput, 0, 0,
NULL, 0, ShapeSet, 0);
-
+
if (frame)
XShapeCombineRectangles (dpy, window->frame(), ShapeInput, 0, 0,
NULL, 0, ShapeSet, 0);
@@ -369,29 +350,21 @@
Display *dpy = screen->dpy ();
if (mInput->nInputRects)
- {
XShapeCombineRectangles (dpy, window->id(), ShapeInput, 0, 0,
mInput->inputRects, mInput->nInputRects,
ShapeSet, mInput->inputRectOrdering);
- }
else
- {
XShapeCombineMask (dpy, window->id(), ShapeInput, 0, 0, None, ShapeSet);
- }
if (mInput->frameNInputRects >= 0)
{
if (mInput->frameNInputRects)
- {
XShapeCombineRectangles (dpy, window->frame(), ShapeInput, 0, 0,
mInput->frameInputRects,
mInput->frameNInputRects,
ShapeSet,
mInput->frameInputRectOrdering);
- }
else
- {
XShapeCombineMask (dpy, window->frame(), ShapeInput, 0, 0, None, ShapeSet);
- }
}
}
=== modified file 'plugins/freewins/src/paint.cpp'
--- plugins/freewins/src/paint.cpp 2013-02-20 14:24:30 +0000
+++ plugins/freewins/src/paint.cpp 2013-07-21 23:03:28 +0000
@@ -49,7 +49,6 @@
#include "freewins.h"
-
/* ------ Window and Output Painting ------------------------------------*/
/* Damage util function */
@@ -62,14 +61,16 @@
/* Animation Prep */
void
-FWScreen::preparePaint (int ms)
+FWScreen::preparePaint (int ms)
{
+ float speed = optionGetSpeed ();
+ float specialspeed = (20.1 - speed) * 100.0f;
+
/* FIXME: should only loop over all windows if at least one animation is running */
foreach (CompWindow *w, screen->windows ())
{
FREEWINS_WINDOW (w);
- float speed = optionGetSpeed ();
- fww->mAnimate.steps = ((float) ms / ((20.1 - speed) * 100));
+ fww->mAnimate.steps = (float)ms / specialspeed;
if (fww->mAnimate.steps < 0.005)
fww->mAnimate.steps = 0.005;
@@ -82,25 +83,25 @@
*/
/* Don't animate if the window is saved */
- fww->mTransform.angX += (float) fww->mAnimate.steps * (fww->mAnimate.destAngX - fww->mTransform.angX) * speed;
- fww->mTransform.angY += (float) fww->mAnimate.steps * (fww->mAnimate.destAngY - fww->mTransform.angY) * speed;
- fww->mTransform.angZ += (float) fww->mAnimate.steps * (fww->mAnimate.destAngZ - fww->mTransform.angZ) * speed;
-
- fww->mTransform.scaleX += (float) fww->mAnimate.steps * (fww->mAnimate.destScaleX - fww->mTransform.scaleX) * speed;
- fww->mTransform.scaleY += (float) fww->mAnimate.steps * (fww->mAnimate.destScaleY - fww->mTransform.scaleY) * speed;
-
- if (((fww->mTransform.angX >= fww->mAnimate.destAngX - 0.05 &&
- fww->mTransform.angX <= fww->mAnimate.destAngX + 0.05 ) &&
- (fww->mTransform.angY >= fww->mAnimate.destAngY - 0.05 &&
- fww->mTransform.angY <= fww->mAnimate.destAngY + 0.05 ) &&
- (fww->mTransform.angZ >= fww->mAnimate.destAngZ - 0.05 &&
- fww->mTransform.angZ <= fww->mAnimate.destAngZ + 0.05 ) &&
- (fww->mTransform.scaleX >= fww->mAnimate.destScaleX - 0.00005 &&
- fww->mTransform.scaleX <= fww->mAnimate.destScaleX + 0.00005 ) &&
- (fww->mTransform.scaleY >= fww->mAnimate.destScaleY - 0.00005 &&
- fww->mTransform.scaleY <= fww->mAnimate.destScaleY + 0.00005 )))
+ fww->mTransform.angX += (float)fww->mAnimate.steps * (fww->mAnimate.destAngX - fww->mTransform.angX) * speed;
+ fww->mTransform.angY += (float)fww->mAnimate.steps * (fww->mAnimate.destAngY - fww->mTransform.angY) * speed;
+ fww->mTransform.angZ += (float)fww->mAnimate.steps * (fww->mAnimate.destAngZ - fww->mTransform.angZ) * speed;
+
+ fww->mTransform.scaleX += (float)fww->mAnimate.steps * (fww->mAnimate.destScaleX - fww->mTransform.scaleX) * speed;
+ fww->mTransform.scaleY += (float)fww->mAnimate.steps * (fww->mAnimate.destScaleY - fww->mTransform.scaleY) * speed;
+
+ if (fww->mTransform.angX >= fww->mAnimate.destAngX - 0.05 &&
+ fww->mTransform.angX <= fww->mAnimate.destAngX + 0.05 &&
+ fww->mTransform.angY >= fww->mAnimate.destAngY - 0.05 &&
+ fww->mTransform.angY <= fww->mAnimate.destAngY + 0.05 &&
+ fww->mTransform.angZ >= fww->mAnimate.destAngZ - 0.05 &&
+ fww->mTransform.angZ <= fww->mAnimate.destAngZ + 0.05 &&
+ fww->mTransform.scaleX >= fww->mAnimate.destScaleX - 0.00005 &&
+ fww->mTransform.scaleX <= fww->mAnimate.destScaleX + 0.00005 &&
+ fww->mTransform.scaleY >= fww->mAnimate.destScaleY - 0.00005 &&
+ fww->mTransform.scaleY <= fww->mAnimate.destScaleY + 0.00005)
{
- fww->mResetting = FALSE;
+ fww->mResetting = false;
fww->mTransform.angX = fww->mAnimate.destAngX;
fww->mTransform.angY = fww->mAnimate.destAngY;
@@ -114,8 +115,8 @@
fww->mTransform.unsnapScaleX = fww->mAnimate.destScaleX;
fww->mTransform.unsnapScaleY = fww->mAnimate.destScaleX;
}
- //else
- // fww->damageArea ();
+// else
+// fww->damageArea ();
}
cScreen->preparePaint (ms);
@@ -124,9 +125,9 @@
/* Paint the window rotated or scaled */
bool
FWWindow::glPaint (const GLWindowPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ unsigned int mask)
{
GLMatrix wTransform (transform);
@@ -138,21 +139,25 @@
FREEWINS_SCREEN (screen);
+ int winRealX = window->x () - window->border ().left;
+ int winRealY = window->y () - window->border ().top;
+
/* Has something happened? */
-
+
/* Check to see if we are painting on a transformed screen */
/* Enable this code when we can animate between the two states */
- if ((mTransform.angX != 0.0 ||
- mTransform.angY != 0.0 ||
- mTransform.angZ != 0.0 ||
- mTransform.scaleX != 1.0 ||
- mTransform.scaleY != 1.0 ||
- mOldWinX != WIN_REAL_X (window) ||
- mOldWinY != WIN_REAL_Y (window)) && fws->optionGetShapeWindowTypes ().evaluate (window))
+ if ((mTransform.angX ||
+ mTransform.angY ||
+ mTransform.angZ ||
+ mTransform.scaleX != 1.0 ||
+ mTransform.scaleY != 1.0 ||
+ mOldWinX != winRealX ||
+ mOldWinY != winRealY ) &&
+ fws->optionGetShapeWindowTypes ().evaluate (window))
{
- mOldWinX = WIN_REAL_X (window);
- mOldWinY = WIN_REAL_Y (window);
+ mOldWinX = winRealX;
+ mOldWinY = winRealY;
/* Figure out where our 'origin' is, don't allow the origin to
* be where we clicked if the window is not grabbed, etc
@@ -183,11 +188,11 @@
if (fws->optionGetAutoZoom ())
{
- float apparantWidth = mOutputRect.width ();
+ float apparantWidth = mOutputRect.width ();
float apparantHeight = mOutputRect.height ();
- autoScaleX = (float) WIN_OUTPUT_W (window) / (float) apparantWidth;
- autoScaleY = (float) WIN_OUTPUT_H (window) / (float) apparantHeight;
+ autoScaleX = (float) WIN_OUTPUT_W (window) / apparantWidth;
+ autoScaleY = (float) WIN_OUTPUT_H (window) / apparantHeight;
if (autoScaleX >= 1.0f)
autoScaleX = 1.0f;
@@ -199,7 +204,6 @@
/* Because we modified the scale after calculating
* the output rect, we need to recalculate again */
calculateOutputRect ();
-
}
/*
float scaleX = autoScaleX - (1 - mTransform.scaleX);
@@ -213,8 +217,8 @@
if (mGrab != grabRotate && mGrab != grabScale)
{
- calculateInputOrigin (WIN_REAL_X (window) + WIN_REAL_W (window) / 2.0f,
- WIN_REAL_Y (window) + WIN_REAL_H (window) / 2.0f);
+ calculateInputOrigin (winRealX + WIN_REAL_W (window) / 2.0f,
+ winRealY + WIN_REAL_H (window) / 2.0f);
calculateOutputOrigin (WIN_OUTPUT_X (window) + WIN_OUTPUT_W (window) / 2.0f,
WIN_OUTPUT_Y (window) + WIN_OUTPUT_H (window) / 2.0f);
}
@@ -228,27 +232,27 @@
mIMidX, mIMidY , 0.0f,
mTransform.scaleX,
mTransform.scaleY,
- 1.0f, adjustX, adjustY, TRUE);
+ 1.0f, adjustX, adjustY, true);
/* Create rects for input after we've dealt with output */
calculateInputRect ();
/* Determine if the window is inverted */
- Bool xInvert = FALSE;
- Bool yInvert = FALSE;
+ bool xInvert = false;
+ bool yInvert = false;
+ bool needsInvert = false;
- Bool needsInvert = FALSE;
float renX = fabs (fmodf (mTransform.angX, 360.0f));
float renY = fabs (fmodf (mTransform.angY, 360.0f));
if (90 < renX && renX < 270)
- xInvert = TRUE;
+ xInvert = true;
if (90 < renY && renY < 270)
- yInvert = TRUE;
+ yInvert = true;
if ((xInvert || yInvert) && !(xInvert && yInvert))
- needsInvert = TRUE;
+ needsInvert = true;
if (needsInvert)
glCullFace (invertCull);
@@ -257,48 +261,46 @@
if (needsInvert)
glCullFace (currentCull);
-
}
else
- {
status = gWindow->glPaint (attrib, wTransform, region, mask);
- }
// Check if there are rotated windows
- if (!((mTransform.angX >= 0.0f - 0.05 &&
- mTransform.angX <= 0.0f + 0.05 ) &&
- (mTransform.angY >= 0.0f - 0.05 &&
- mTransform.angY <= 0.0f + 0.05 ) &&
- (mTransform.angZ >= 0.0f - 0.05 &&
- mTransform.angZ <= 0.0f + 0.05 ) &&
- (mTransform.scaleX >= 1.0f - 0.00005 &&
- mTransform.scaleX <= 1.0f + 0.00005 ) &&
- (mTransform.scaleY >= 1.0f - 0.00005 &&
- mTransform.scaleY <= 1.0f + 0.00005 )) && !mTransformed)
- mTransformed = TRUE;
+ if (!(mTransform.angX >= 0.0f - 0.05 &&
+ mTransform.angX <= 0.0f + 0.05 &&
+ mTransform.angY >= 0.0f - 0.05 &&
+ mTransform.angY <= 0.0f + 0.05 &&
+ mTransform.angZ >= 0.0f - 0.05 &&
+ mTransform.angZ <= 0.0f + 0.05 &&
+ mTransform.scaleX >= 1.0f - 0.00005 &&
+ mTransform.scaleX <= 1.0f + 0.00005 &&
+ mTransform.scaleY >= 1.0f - 0.00005 &&
+ mTransform.scaleY <= 1.0f + 0.00005) && !mTransformed)
+ mTransformed = true;
else if (mTransformed)
- mTransformed = FALSE;
+ mTransformed = false;
/* There is still animation to be done */
- if (!(((mTransform.angX >= mAnimate.destAngX - 0.05 &&
- mTransform.angX <= mAnimate.destAngX + 0.05 ) &&
- (mTransform.angY >= mAnimate.destAngY - 0.05 &&
- mTransform.angY <= mAnimate.destAngY + 0.05 ) &&
- (mTransform.angZ >= mAnimate.destAngZ - 0.05 &&
- mTransform.angZ <= mAnimate.destAngZ + 0.05 ) &&
- (mTransform.scaleX >= mAnimate.destScaleX - 0.00005 &&
- mTransform.scaleX <= mAnimate.destScaleX + 0.00005 ) &&
- (mTransform.scaleY >= mAnimate.destScaleY - 0.00005 &&
- mTransform.scaleY <= mAnimate.destScaleY + 0.00005 ))))
+ if (!(mTransform.angX >= mAnimate.destAngX - 0.05 &&
+ mTransform.angX <= mAnimate.destAngX + 0.05 &&
+ mTransform.angY >= mAnimate.destAngY - 0.05 &&
+ mTransform.angY <= mAnimate.destAngY + 0.05 &&
+ mTransform.angZ >= mAnimate.destAngZ - 0.05 &&
+ mTransform.angZ <= mAnimate.destAngZ + 0.05 &&
+ mTransform.scaleX >= mAnimate.destScaleX - 0.00005 &&
+ mTransform.scaleX <= mAnimate.destScaleX + 0.00005 &&
+ mTransform.scaleY >= mAnimate.destScaleY - 0.00005 &&
+ mTransform.scaleY <= mAnimate.destScaleY + 0.00005))
{
damageArea ();
- mIsAnimating = TRUE;
+ mIsAnimating = true;
}
else if (mIsAnimating) /* We're done animating now, and we were animating */
{
if (handleWindowInputInfo ())
adjustIPW ();
- mIsAnimating = FALSE;
+
+ mIsAnimating = false;
}
return status;
@@ -307,10 +309,10 @@
/* Paint the window axis help onto the screen */
bool
FWScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- CompOutput *output,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ CompOutput *output,
+ unsigned int mask)
{
GLMatrix zTransform (transform);
@@ -321,9 +323,9 @@
if (mAxisHelp && mHoverWindow)
{
- int j;
- float x = WIN_REAL_X(mHoverWindow) + WIN_REAL_W(mHoverWindow)/2.0;
- float y = WIN_REAL_Y(mHoverWindow) + WIN_REAL_H(mHoverWindow)/2.0;
+ int j;
+ float x = WIN_REAL_X(mHoverWindow) + WIN_REAL_W(mHoverWindow) / 2.0;
+ float y = WIN_REAL_Y(mHoverWindow) + WIN_REAL_H(mHoverWindow) / 2.0;
FREEWINS_WINDOW (mHoverWindow);
@@ -342,9 +344,14 @@
if (optionGetShowCircle () && optionGetRotationAxis () == RotationAxisAlwaysCentre)
{
glColor4usv (optionGetCircleColor ());
- glEnable (GL_BLEND);
+
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
glBegin (GL_POLYGON);
+
for (j = 0; j < 360; j += 10)
glVertex3f ( x + zRad * cos(D2R(j)), y + zRad * sin(D2R(j)), 0.0 );
glEnd ();
@@ -354,15 +361,16 @@
glLineWidth (3.0);
glBegin (GL_LINE_LOOP);
+
for (j = 360; j >= 0; j -= 10)
glVertex3f ( x + zRad * cos(D2R(j)), y + zRad * sin(D2R(j)), 0.0 );
glEnd ();
glBegin (GL_LINE_LOOP);
+
for (j = 360; j >= 0; j -= 10)
glVertex3f( x + fww->mRadius * cos(D2R(j)), y + fww->mRadius * sin(D2R(j)), 0.0 );
glEnd ();
-
}
/* Draw the 'gizmo' */
@@ -380,15 +388,17 @@
glLineWidth (4.0f);
- for (int i = 0; i < 3; i++)
+ for (int i = 0; i < 3; ++i)
{
glPushMatrix ();
glColor4f (1.0 * (i==0), 1.0 * (i==1), 1.0 * (i==2), 1.0);
glRotatef (90.0, 1.0 * (i==0), 1.0 * (i==1), 1.0 * (i==2));
glBegin (GL_LINE_LOOP);
+
for (j=360; j>=0; j -= 10)
glVertex3f ( cos (D2R (j)), sin (D2R (j)), 0.0 );
+
glEnd ();
glPopMatrix ();
}
@@ -401,7 +411,11 @@
if (optionGetShowRegion ())
{
glDisableClientState (GL_TEXTURE_COORD_ARRAY);
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
glColor4us (0x2fff, 0x2fff, 0x4fff, 0x4fff);
glRecti (fww->mInputRect.x1 (), fww->mInputRect.y1 (), fww->mInputRect.x2 (), fww->mInputRect.y2 ());
glColor4us (0x2fff, 0x2fff, 0x4fff, 0x9fff);
@@ -418,8 +432,8 @@
if (optionGetShowCross ())
{
-
glColor4usv (optionGetCrossLineColor ());
+
glBegin(GL_LINES);
glVertex3f(x, y - (WIN_REAL_H (mHoverWindow) / 2), 0.0f);
glVertex3f(x, y + (WIN_REAL_H (mHoverWindow) / 2), 0.0f);
@@ -454,6 +468,7 @@
glEnd ();
}
}
+
if (wasCulled)
glEnable(GL_CULL_FACE);
@@ -467,7 +482,6 @@
void
FWScreen::donePaint ()
{
-
if (mAxisHelp && mHoverWindow)
{
FREEWINS_WINDOW (mHoverWindow);
@@ -505,7 +519,7 @@
/* Damage the Window Rect */
bool
-FWWindow::damageRect (bool initial,
+FWWindow::damageRect (bool initial,
const CompRect &rect)
{
FREEWINS_SCREEN(screen);
=== modified file 'plugins/freewins/src/util.cpp'
--- plugins/freewins/src/util.cpp 2013-02-20 14:24:30 +0000
+++ plugins/freewins/src/util.cpp 2013-07-21 23:03:28 +0000
@@ -49,7 +49,6 @@
#include "freewins.h"
-
/* ------ Utility Functions ---------------------------------------------*/
/* Rotate and project individual vectors */
@@ -97,31 +96,41 @@
0, 0, 0, 1
*/
- transform[8] = v * transform[12];
- transform[9] = v * transform[13];
+ transform[8] = v * transform[12];
+ transform[9] = v * transform[13];
transform[10] = v * transform[14];
transform[11] = v * transform[15];
}
void
FWScreen::modifyMatrix (GLMatrix &transform,
- float angX, float angY, float angZ,
- float tX, float tY, float tZ,
- float scX, float scY, float scZ,
- float adjustX, float adjustY, bool paint)
+ float angX,
+ float angY,
+ float angZ,
+ float tX,
+ float tY,
+ float tZ,
+ float scX,
+ float scY,
+ float scZ,
+ float adjustX,
+ float adjustY,
+ bool paint)
{
/* Create our transformation Matrix */
transform.translate (tX, tY, 0.0);
+
if (paint)
perspectiveDistortAndResetZ (transform);
else
transform.scale (1.0f, 1.0f, 1.0f / screen->width ());
+
transform.rotate (angX, 1.0f, 0.0f, 0.0f);
transform.rotate (angY, 0.0f, 1.0f, 0.0f);
transform.rotate (angZ, 0.0f, 0.0f, 1.0f);
transform.scale (scX, 1.0f, 0.0f);
transform.scale (1.0f, scY, 0.0f);
- transform.translate (-(tX), -(tY), 0.0f);
+ transform.translate (-tX, -tY, 0.0f);
}
/*
@@ -342,7 +351,6 @@
mOutput.shapey3 = yScreen3;
mOutput.shapey4 = yScreen4;
-
return fws->createSizedRect(xScreen1, xScreen2, xScreen3, xScreen4,
yScreen1, yScreen2, yScreen3, yScreen4);
}
@@ -370,19 +378,19 @@
}
void
-FWWindow::calculateInputOrigin (float x, float y)
+FWWindow::calculateInputOrigin (float x,
+ float y)
{
mIMidX = x;
mIMidY = y;
}
void
-FWWindow::calculateOutputOrigin (float x, float y)
+FWWindow::calculateOutputOrigin (float x,
+ float y)
{
- float dx, dy;
-
- dx = x - WIN_OUTPUT_X (window);
- dy = y - WIN_OUTPUT_Y (window);
+ float dx = x - WIN_OUTPUT_X (window);
+ float dy = y - WIN_OUTPUT_Y (window);
mOMidX = WIN_OUTPUT_X (window) + dx * mTransform.scaleX;
mOMidY = WIN_OUTPUT_Y (window) + dy * mTransform.scaleY;
@@ -392,9 +400,7 @@
/*static int FWMakeIntoOutOfThreeSixty (int value)
{
while (value > 0)
- {
value -= 360;
- }
if (value < 0)
value += 360;
@@ -404,15 +410,14 @@
/* Determine if we clicked in the z-axis region */
void
-FWWindow::determineZAxisClick (int px,
- int py,
+FWWindow::determineZAxisClick (int px,
+ int py,
bool motion)
{
- bool directionChange = FALSE;
+ bool directionChange = false;
if (!mCan2D && motion)
{
-
static int steps;
/* Check if we are going in a particular 3D direction
@@ -440,35 +445,35 @@
direction = UpDown;
if (direction != oldDirection)
- directionChange = TRUE;
+ directionChange = true;
direction = oldDirection;
}
- steps++;
+ ++steps;
}
else
- directionChange = TRUE;
+ directionChange = true;
if (directionChange)
{
float clickRadiusFromCenter;
- int x = (WIN_REAL_X(window) + WIN_REAL_W(window)/2.0);
- int y = (WIN_REAL_Y(window) + WIN_REAL_H(window)/2.0);
+ int x = (WIN_REAL_X(window) + WIN_REAL_W(window) / 2.0);
+ int y = (WIN_REAL_Y(window) + WIN_REAL_H(window) / 2.0);
clickRadiusFromCenter = sqrt(pow((x - px), 2) + pow((y - py), 2));
if (clickRadiusFromCenter > mRadius * (FWScreen::get (screen)->optionGetTdPercent () / 100))
{
- mCan2D = TRUE;
- mCan3D = FALSE;
+ mCan2D = true;
+ mCan3D = false;
}
else
{
- mCan2D = FALSE;
- mCan3D = TRUE;
+ mCan2D = false;
+ mCan3D = true;
}
}
}
@@ -479,29 +484,21 @@
{
FREEWINS_SCREEN (screen);
- if (!fws->optionGetDoShapeInput ())
- return FALSE;
-
- if (!screen->XShape ())
- return FALSE;
-
- if (!fws->optionGetShapeWindowTypes ().evaluate (window))
- return FALSE;
-
- return TRUE;
+ if (!fws->optionGetDoShapeInput () ||
+ !screen->XShape () ||
+ !fws->optionGetShapeWindowTypes ().evaluate (window))
+ return false;
+
+ return true;
}
/* Checks if w is a ipw and returns the real window */
CompWindow *
FWScreen::getRealWindow (CompWindow *w)
{
- FWWindowInputInfo *info;
-
- foreach (info, mTransformedWindows)
- {
+ foreach (FWWindowInputInfo *info, mTransformedWindows)
if (w->id () == info->ipw)
return info->w;
- }
return NULL;
}
=== modified file 'plugins/gears/gears.xml.in'
--- plugins/gears/gears.xml.in 2012-10-15 10:31:51 +0000
+++ plugins/gears/gears.xml.in 2013-07-21 23:03:28 +0000
@@ -15,5 +15,37 @@
opengl
+
+
+ <_short>Gear1 Color
+ <_long>Color and opacity of gear one.
+
+ 0xffff
+ 0x0000
+ 0x0000
+ 0xffff
+
+
+
+ <_short>Gear2 Color
+ <_long>Color and opacity of gear two.
+
+ 0x0000
+ 0xffff
+ 0x0000
+ 0xffff
+
+
+
+ <_short>Gear3 Color
+ <_long>Color and opacity of gear three.
+
+ 0x0000
+ 0x0000
+ 0xffff
+ 0xffff
+
+
+
=== modified file 'plugins/gears/src/gears.cpp'
--- plugins/gears/src/gears.cpp 2013-05-09 13:43:07 +0000
+++ plugins/gears/src/gears.cpp 2013-07-21 23:03:28 +0000
@@ -36,29 +36,29 @@
GLint teeth,
GLfloat tooth_depth)
{
- GLint i;
- GLfloat r0, r1, r2, maxr2, minr2;
- GLfloat angle, da;
+ GLint i;
+ GLfloat r2;
+ GLfloat angle;
GLfloat u, v, len;
- r0 = inner_radius;
- r1 = outer_radius - tooth_depth / 2.0;
- maxr2 = r2 = outer_radius + tooth_depth / 2.0;
- minr2 = r2;
+ GLfloat r0 = inner_radius;
+ GLfloat r1 = outer_radius - tooth_depth / 2.0;
+ GLfloat maxr2 = r2 = outer_radius + tooth_depth / 2.0;
+ GLfloat minr2 = r2;
- da = 2.0 * M_PI / teeth / 4.0;
+ GLfloat da = 2.0 * M_PI / teeth / 4.0;
glShadeModel (GL_SMOOTH);
/* draw inside radius cylinder */
glBegin (GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++)
+ for (i = 0; i <= teeth; ++i)
{
angle = i * 2.0 * M_PI / teeth;
glNormal3f (-cos (angle), -sin (angle), 0.0);
glVertex3f (r0 * cos (angle), r0 * sin (angle), -width * 0.5);
- glVertex3f (r0 * cos (angle), r0 * sin (angle), width * 0.5);
+ glVertex3f (r0 * cos (angle), r0 * sin (angle), width * 0.5);
}
glEnd();
@@ -70,7 +70,7 @@
/* draw front face */
glBegin (GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++)
+ for (i = 0; i <= teeth; ++i)
{
angle = i * 2.0 * M_PI / teeth;
glVertex3f (r0 * cos (angle), r0 * sin (angle), width * 0.5);
@@ -89,7 +89,7 @@
/* draw front sides of teeth */
glBegin (GL_QUADS);
- for (i = 0; i < teeth; i++)
+ for (i = 0; i < teeth; ++i)
{
angle = i * 2.0 * M_PI / teeth;
@@ -111,7 +111,7 @@
/* draw back face */
glBegin (GL_QUAD_STRIP);
- for (i = 0; i <= teeth; i++)
+ for (i = 0; i <= teeth; ++i)
{
angle = i * 2.0 * M_PI / teeth;
glVertex3f (r1 * cos (angle), r1 * sin (angle), -width * 0.5);
@@ -131,7 +131,7 @@
glBegin (GL_QUADS);
da = 2.0 * M_PI / teeth / 4.0;
- for (i = 0; i < teeth; i++)
+ for (i = 0; i < teeth; ++i)
{
angle = i * 2.0 * M_PI / teeth;
@@ -151,7 +151,7 @@
/* draw outward faces of teeth */
glBegin (GL_QUAD_STRIP);
- for (i = 0; i < teeth; i++)
+ for (i = 0; i < teeth; ++i)
{
angle = i * 2.0 * M_PI / teeth;
@@ -183,15 +183,15 @@
r2 = maxr2;
- glVertex3f (r1 * cos (0), r1 * sin (0), width * 0.5);
+ glVertex3f (r1 * cos (0), r1 * sin (0), width * 0.5);
glVertex3f (r1 * cos (0), r1 * sin (0), -width * 0.5);
glEnd();
}
void
-GearsScreen::cubeClearTargetOutput (float xRotate,
- float vRotate)
+GearsScreen::cubeClearTargetOutput (float xRotate,
+ float vRotate)
{
csScreen->cubeClearTargetOutput (xRotate, vRotate);
@@ -204,9 +204,25 @@
int size,
const GLVector &normal)
{
+ /* we do not want to paint 3d gears if the camera is inside
+ * the cube, because the gears would obstruct our view */
+ if (csScreen->invert () == -1)
+ {
+ /* it is enough to print the warning once */
+ if (!warningPrinted)
+ {
+ compLogMessage ("gears", CompLogLevelWarn, "Gears are disabled when viewing the cube from the inside");
+ warningPrinted = true;
+ }
+
+ return;
+ }
// CUBE_SCREEN (screen);
- static GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+ GLboolean glDepthEnabled = glIsEnabled (GL_DEPTH_TEST);
+
+// static GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
GLScreenPaintAttrib sA = sAttrib;
@@ -228,9 +244,7 @@
glPushAttrib (GL_COLOR_BUFFER_BIT | GL_TEXTURE_BIT);
- glDisable (GL_BLEND);
-
- if (!glIsEnabled (GL_CULL_FACE) )
+ if (!glIsEnabled (GL_CULL_FACE))
{
enabledCull = true;
glEnable (GL_CULL_FACE);
@@ -243,14 +257,28 @@
glScalef (0.05, 0.05, 0.05);
glColor4usv (defaultColor);
+ /* just enable global states if they are disabled and
+ * just disable them if they are enabled */
+ if (glBlendEnabled)
+ glDisable (GL_BLEND);
+
+ if (!glDepthEnabled)
+ glEnable (GL_DEPTH_TEST);
+
glEnable (GL_NORMALIZE);
glEnable (GL_LIGHTING);
glEnable (GL_LIGHT1);
+// glEnable (GL_SPECULAR);
glDisable (GL_COLOR_MATERIAL);
+<<<<<<< TREE
glEnable (GL_DEPTH_TEST);
glDepthMask (GL_TRUE);
glDepthFunc (GL_LESS);
+=======
+ glDepthMask (GL_TRUE);
+ glDepthFunc (GL_LESS);
+>>>>>>> MERGE-SOURCE
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glPushMatrix();
@@ -271,7 +299,7 @@
glCallList (gear3);
glPopMatrix();
- glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, white);
+// glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, white);
glPopMatrix();
@@ -282,8 +310,11 @@
if (!gScreen->lighting ())
glDisable (GL_LIGHTING);
- glDisable (GL_DEPTH_TEST);
+ // we disable GL_DEPTH_TEST only, if it was disabled before
+ if (!glDepthEnabled)
+ glDisable (GL_DEPTH_TEST);
+ // we only disable GL_CULL_FACE if we enabled it ourselves
if (enabledCull)
glDisable (GL_CULL_FACE);
@@ -297,17 +328,16 @@
void
GearsScreen::preparePaint (int ms)
{
-
contentRotation += ms * 360.0 / 20000.0;
- contentRotation = fmod (contentRotation, 360.0);
- angle += ms * 360.0 / 8000.0;
- angle = fmod (angle, 360.0);
- a1 += ms * 360.0 / 3000.0;
- a1 = fmod (a1, 360.0);
- a2 += ms * 360.0 / 2000.0;
- a2 = fmod (a2, 360.0);
- a3 += ms * 360.0 / 1000.0;
- a3 = fmod (a3, 360.0);
+ contentRotation = fmod (contentRotation, 360.0);
+ angle += ms * 360.0 / 8000.0;
+ angle = fmod (angle, 360.0);
+ a1 += ms * 360.0 / 3000.0;
+ a1 = fmod (a1, 360.0);
+ a2 += ms * 360.0 / 2000.0;
+ a2 = fmod (a2, 360.0);
+ a3 += ms * 360.0 / 1000.0;
+ a3 = fmod (a3, 360.0);
cScreen->preparePaint (ms);
}
@@ -326,26 +356,60 @@
GearsScreen::GearsScreen (CompScreen *screen) :
PluginClassHandler (screen),
- screen (screen),
- cScreen (CompositeScreen::get (screen)),
- gScreen (GLScreen::get (screen)),
- csScreen (CubeScreen::get (screen)),
- damage(false),
- contentRotation(0.0),
- angle(0.0),
- a1(0.0),
- a2(0.0),
- a3(0.0)
+ screen (screen),
+ cScreen (CompositeScreen::get (screen)),
+ gScreen (GLScreen::get (screen)),
+ csScreen (CubeScreen::get (screen)),
+ damage (false),
+ warningPrinted (false),
+ contentRotation (0.0),
+ angle (0.0),
+ a1 (0.0),
+ a2 (0.0),
+ a3 (0.0)
{
- ScreenInterface::setHandler (screen);
+ ScreenInterface::setHandler (screen);
CompositeScreenInterface::setHandler (cScreen);
- GLScreenInterface::setHandler (gScreen);
- CubeScreenInterface::setHandler (csScreen);
-
+ GLScreenInterface::setHandler (gScreen);
+ CubeScreenInterface::setHandler (csScreen);
+
+ GLushort *colorGear1 = optionGetGear1Color ();
+ GLushort *colorGear2 = optionGetGear2Color ();
+ GLushort *colorGear3 = optionGetGear3Color ();
+ GLfloat colorDataG1[4];
+ GLfloat colorDataG2[4];
+ GLfloat colorDataG3[4];
+
+ colorDataG1[0] = (float) (colorGear1[0] / COLOR);
+ colorDataG1[1] = (float) (colorGear1[1] / COLOR);
+ colorDataG1[2] = (float) (colorGear1[2] / COLOR);
+ colorDataG1[3] = (float) (colorGear1[3] / COLOR);
+ colorDataG2[0] = (float) (colorGear2[0] / COLOR);
+ colorDataG2[1] = (float) (colorGear2[1] / COLOR);
+ colorDataG2[2] = (float) (colorGear2[2] / COLOR);
+ colorDataG2[3] = (float) (colorGear2[3] / COLOR);
+ colorDataG3[0] = (float) (colorGear3[0] / COLOR);
+ colorDataG3[1] = (float) (colorGear3[1] / COLOR);
+ colorDataG3[2] = (float) (colorGear3[2] / COLOR);
+ colorDataG3[3] = (float) (colorGear3[3] / COLOR);
+// const GLushort colorGear2[4] = optionGetGear2Color ();
+// const GLushort colorGear3[4] = optionGetGear3Color ();
+
+
+// const GLfloat colorDataGear1[4] = { (GLfloat)optionGetGear1Color ()};
+// const GLfloat colorDataGear2[4] = { (GLfloat)optionGetGear2Color ()};
+// const GLfloat colorDataGear3[4] = { (GLfloat)optionGetGear3Color ()};
+
+// float alpha = optionGetGear1ColorAlpha () / OPAQUE;
+// GLushort *color = optionGetGear1Color ();
+
+// GLfloat red[4] = (float) color;
static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 };
- static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
- static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
- static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
+ GLfloat gear1color[4] = { colorDataG1[0], colorDataG1[1], colorDataG1[2], colorDataG1[3] };
+ GLfloat gear2color[4] = { colorDataG2[0], colorDataG2[1], colorDataG2[2], colorDataG2[3] };
+ GLfloat gear3color[4] = { colorDataG3[0], colorDataG3[1], colorDataG3[2], colorDataG3[3] };
+// static GLfloat green[4] = { 1.0, 1.0, 0.2, 0.5 };
+// static GLfloat blue[4] = { 0.2, 0.2, 1.0, 0.7 };
static GLfloat ambientLight[] = { 0.3f, 0.3f, 0.3f, 0.3f };
static GLfloat diffuseLight[] = { 0.5f, 0.5f, 0.5f, 0.5f };
@@ -353,21 +417,25 @@
glLightfv (GL_LIGHT1, GL_DIFFUSE, diffuseLight);
glLightfv (GL_LIGHT1, GL_POSITION, pos);
+// glDeleteLists (gear1, 1);
+// glDeleteLists (gear2, 1);
+// glDeleteLists (gear3, 1);
+
gear1 = glGenLists (1);
glNewList (gear1, GL_COMPILE);
- glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
+ glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gear1color);
gear (1.0, 4.0, 1.0, 20, 0.7);
glEndList();
gear2 = glGenLists (1);
glNewList (gear2, GL_COMPILE);
- glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
+ glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gear2color);
gear (0.5, 2.0, 2.0, 10, 0.7);
glEndList();
gear3 = glGenLists (1);
glNewList (gear3, GL_COMPILE);
- glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
+ glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gear3color);
gear (1.3, 2.0, 0.5, 10, 0.7);
glEndList();
}
=== modified file 'plugins/gears/src/gears.h'
--- plugins/gears/src/gears.h 2013-02-02 23:01:02 +0000
+++ plugins/gears/src/gears.h 2013-07-21 23:03:28 +0000
@@ -54,7 +54,7 @@
CompScreen *screen;
CompositeScreen *cScreen;
- GLScreen *gScreen;
+ GLScreen *gScreen;
CubeScreen *csScreen;
void
@@ -75,19 +75,22 @@
private:
- bool damage;
+ bool damage;
+ bool warningPrinted;
- float contentRotation;
- GLuint gear1, gear2, gear3;
- float angle;
- float a1, a2, a3;
+ float contentRotation;
+ GLuint gear1;
+ GLuint gear2;
+ GLuint gear3;
+ float angle;
+ float a1;
+ float a2;
+ float a3;
};
-
#define GET_GEARS_SCREEN (screen) \
GearsScreen *es = GearsScreen::get (screen);
-
class GearsPluginVTable :
public CompPlugin::VTableForScreen
{
@@ -95,5 +98,3 @@
bool init ();
};
-
-
=== modified file 'plugins/gnomecompat/src/gnomecompat.cpp'
--- plugins/gnomecompat/src/gnomecompat.cpp 2013-05-09 13:43:07 +0000
+++ plugins/gnomecompat/src/gnomecompat.cpp 2013-07-21 23:03:28 +0000
@@ -33,9 +33,7 @@
CompOption::Vector& options,
CompOption *commandOption)
{
- Window xid;
-
- xid = CompOption::getIntOptionNamed (options, "root", 0);
+ Window xid = CompOption::getIntOptionNamed (options, "root", 0);
if (xid != screen->root ())
return false;
@@ -48,15 +46,13 @@
GnomeCompatScreen::panelAction (CompOption::Vector& options,
Atom actionAtom)
{
- Window xid;
XEvent event;
- Time time;
- xid = CompOption::getIntOptionNamed (options, "root", 0);
+ Window xid = CompOption::getIntOptionNamed (options, "root", 0);
if (xid != screen->root ())
return;
- time = CompOption::getIntOptionNamed (options, "time", CurrentTime);
+ Time time = CompOption::getIntOptionNamed (options, "time", CurrentTime);
/* we need to ungrab the keyboard here, otherwise the panel main
menu won't popup as it wants to grab the keyboard itself */
=== modified file 'plugins/grid/src/grabhandler/include/grabhandler.h'
--- plugins/grid/src/grabhandler/include/grabhandler.h 2012-09-25 08:28:11 +0000
+++ plugins/grid/src/grabhandler/include/grabhandler.h 2013-07-21 23:03:28 +0000
@@ -56,8 +56,8 @@
private:
- unsigned int mMask;
- GrabActiveFunc mGrabActive;
+ unsigned int mMask;
+ GrabActiveFunc mGrabActive;
};
}
=== modified file 'plugins/grid/src/grabhandler/tests/CMakeLists.txt'
=== modified file 'plugins/grid/src/grid.cpp'
--- plugins/grid/src/grid.cpp 2013-07-12 19:04:03 +0000
+++ plugins/grid/src/grid.cpp 2013-07-21 23:03:28 +0000
@@ -36,9 +36,15 @@
static int const CURVE_ANIMATION = 35;
void
+<<<<<<< TREE
GridScreen::handleCompizEvent(const char *plugin,
const char *event,
CompOption::Vector& o)
+=======
+GridScreen::handleCompizEvent(const char *plugin,
+ const char *event,
+ CompOption::Vector &o)
+>>>>>>> MERGE-SOURCE
{
if (strcmp(event, "start_viewport_switch") == 0)
mSwitchingVp = true;
@@ -49,18 +55,18 @@
}
CompRect
-GridScreen::slotToRect (CompWindow *w,
- const CompRect& slot)
+GridScreen::slotToRect (CompWindow *w,
+ const CompRect &slot)
{
return CompRect (slot.x () + w->border ().left,
slot.y () + w->border ().top,
- slot.width () - (w->border ().left + w->border ().right),
- slot.height () - (w->border ().top + w->border ().bottom));
+ slot.width () - (w->border ().left + w->border ().right),
+ slot.height () - (w->border ().top + w->border ().bottom));
}
CompRect
-GridScreen::constrainSize (CompWindow *w,
- const CompRect& slot)
+GridScreen::constrainSize (CompWindow *w,
+ const CompRect &slot)
{
int cw, ch;
CompRect result = slotToRect (w, slot);
@@ -73,6 +79,7 @@
if (dx > 0)
result.setX (result.x () - dx);
+
if (dy > 0)
result.setY (result.y () - dy);
@@ -93,7 +100,9 @@
}
int
-applyProgress (int a, int b, float progress)
+applyProgress (int a,
+ int b,
+ float progress)
{
return a < b ?
b - (ABS (a - b) * progress) :
@@ -118,20 +127,28 @@
}
bool
+<<<<<<< TREE
GridScreen::initiateCommon (CompAction *action,
CompAction::State state,
CompOption::Vector &option,
unsigned int where,
bool resize,
bool key)
+=======
+GridScreen::initiateCommon (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &option,
+ unsigned int where,
+ bool resize,
+ bool key)
+>>>>>>> MERGE-SOURCE
{
- CompWindow *cw = 0;
-
- Window xid = CompOption::getIntOptionNamed (option, "window");
- cw = screen->findWindow (xid);
+ Window xid = CompOption::getIntOptionNamed (option, "window");
+ CompWindow *cw = screen->findWindow (xid);
if (cw)
{
+<<<<<<< TREE
XWindowChanges xwc;
bool maximizeH = where & (GridBottom | GridTop | GridMaximize);
bool maximizeV = where & (GridLeft | GridRight | GridMaximize);
@@ -146,6 +163,22 @@
(maximizeH && !(cw->actions () & CompWindowActionMaximizeHorzMask)) ||
(maximizeV && !(cw->actions () & CompWindowActionMaximizeVertMask)) ||
where & GridUnknown)
+=======
+ XWindowChanges xwc = XWINDOWCHANGES_INIT;
+ bool maximizeH = where & (GridBottom | GridTop | GridMaximize);
+ bool maximizeV = where & (GridLeft | GridRight | GridMaximize);
+
+ bool horzMaximizedGridPosition = where & (GridTop | GridBottom);
+ bool vertMaximizedGridPosition = where & (GridLeft | GridRight);
+ bool anyMaximizedGridPosition = horzMaximizedGridPosition ||
+ vertMaximizedGridPosition ||
+ where & GridMaximize;
+
+ if (!(cw->actions () & CompWindowActionResizeMask) ||
+ (maximizeH && !(cw->actions () & CompWindowActionMaximizeHorzMask)) ||
+ (maximizeV && !(cw->actions () & CompWindowActionMaximizeVertMask)) ||
+ where & GridUnknown)
+>>>>>>> MERGE-SOURCE
return false;
GRID_WINDOW (cw);
@@ -187,11 +220,19 @@
* have to worry about them. Don't mark the window as a
* gridded one.
*/
+<<<<<<< TREE
gw->isGridResized = false;
gw->isGridHorzMaximized = false;
gw->isGridVertMaximized = false;
for (unsigned int i = 0; i < animations.size (); ++i)
+=======
+ gw->isGridResized = false;
+ gw->isGridHorzMaximized = false;
+ gw->isGridVertMaximized = false;
+
+ for (unsigned int i = 0; i < animations.size (); ++i)
+>>>>>>> MERGE-SOURCE
animations.at (i).fadingOut = true;
return true;
@@ -251,7 +292,7 @@
gw->lastTarget & where)
{
int slotWidth25 = workarea.width () / 4;
- int slotWidth33 = (workarea.width () / 3) + cw->border ().left;
+ int slotWidth33 = workarea.width () / 3 + cw->border ().left;
int slotWidth17 = slotWidth33 - slotWidth25;
int slotWidth66 = workarea.width () - slotWidth33;
int slotWidth75 = workarea.width () - slotWidth25;
@@ -371,15 +412,16 @@
/* TODO: animate move+resize */
if (resize)
{
- unsigned int valueMask = CWX | CWY | CWWidth | CWHeight;
- gw->lastTarget = where;
- gw->currentSize = CompRect (wc.x, wc.y, wc.width, wc.height);
+ unsigned int valueMask = CWX | CWY | CWWidth | CWHeight;
+ gw->lastTarget = where;
+ gw->currentSize = CompRect (wc.x, wc.y, wc.width, wc.height);
CompWindowExtents lastBorder = gw->window->border ();
gw->sizeHintsFlags = 0;
if (!optionGetCycleSizes ())
{
+<<<<<<< TREE
/* Special cases for left/right and top/bottom gridded windows, where we
* actually vertically respective horizontally semi-maximize the window
*/
@@ -428,13 +470,69 @@
gw->isGridResized = true;
gw->isGridHorzMaximized = false;
gw->isGridVertMaximized = false;
+=======
+ /* Special cases for left/right and top/bottom gridded windows, where we
+ * actually vertically respective horizontally semi-maximize the window
+ */
+ if (horzMaximizedGridPosition || vertMaximizedGridPosition)
+ {
+ /* First restore the window to its original size */
+ XWindowChanges rwc;
+
+ rwc.x = gw->originalSize.x ();
+ rwc.y = gw->originalSize.y ();
+ rwc.width = gw->originalSize.width ();
+ rwc.height = gw->originalSize.height ();
+
+ cw->configureXWindow (CWX | CWY | CWWidth | CWHeight, &rwc);
+
+ /* GridLeft || GridRight == isGridVertMaximized */
+ if (vertMaximizedGridPosition)
+ {
+ gw->isGridVertMaximized = true;
+ gw->isGridHorzMaximized = false;
+ gw->isGridResized = false;
+
+ /* Semi-maximize the window vertically */
+ cw->maximize (CompWindowStateMaximizedVertMask);
+ }
+ /* GridTop || GridBottom == isGridHorzMaximized */
+ else /* (horzMaximizedGridPosition) */
+ {
+ gw->isGridHorzMaximized = true;
+ gw->isGridVertMaximized = false;
+ gw->isGridResized = false;
+
+ /* Semi-maximize the window horizontally */
+ cw->maximize (CompWindowStateMaximizedHorzMask);
+ }
+
+ /* Be evil */
+ if (cw->sizeHints ().flags & PResizeInc)
+ {
+ gw->sizeHintsFlags |= PResizeInc;
+ gw->window->sizeHints ().flags &= ~(PResizeInc);
+ }
+ }
+ else /* GridCorners || GridCenter */
+ {
+ gw->isGridResized = true;
+ gw->isGridHorzMaximized = false;
+ gw->isGridVertMaximized = false;
+>>>>>>> MERGE-SOURCE
}
}
else /* if (optionGetCycleSizes ()) */
{
+<<<<<<< TREE
gw->isGridResized = true;
gw->isGridHorzMaximized = false;
gw->isGridVertMaximized = false;
+=======
+ gw->isGridResized = true;
+ gw->isGridHorzMaximized = false;
+ gw->isGridVertMaximized = false;
+>>>>>>> MERGE-SOURCE
}
int dw = (lastBorder.left + lastBorder.right) -
@@ -445,7 +543,7 @@
(gw->window->border ().top +
gw->window->border ().bottom);
- xwc.width += dw;
+ xwc.width += dw;
xwc.height += dh;
/* Make window the size that we want */
@@ -482,6 +580,7 @@
const GLMatrix &transform,
CompOutput *output)
{
+<<<<<<< TREE
CompRect rect;
GLMatrix sTransform (transform);
std::vector::iterator iter;
@@ -490,6 +589,17 @@
GLushort colorData[4];
GLushort *color;
GLboolean isBlendingEnabled;
+=======
+ CompRect rect;
+ GLMatrix sTransform (transform);
+ GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
+ GLfloat vertexData[12];
+ GLushort colorData[4];
+ GLushort *color;
+ float curve, alpha;
+
+ const float MaxUShortFloat = std::numeric_limits ::max ();
+>>>>>>> MERGE-SOURCE
const float MaxUShortFloat = std::numeric_limits ::max ();
@@ -500,15 +610,23 @@
sTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA);
- glGetBooleanv (GL_BLEND, &isBlendingEnabled);
- glEnable (GL_BLEND);
-
- for (iter = animations.begin (); iter != animations.end () && animating; ++iter)
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
+ for (std::vector::iterator iter = animations.begin ();
+ iter != animations.end () && animating; ++iter)
{
- Animation& anim = *iter;
+ Animation &anim = *iter;
+<<<<<<< TREE
float curve = powf (CURVE_ANIMATION, -anim.progress);
float alpha = (optionGetFillColorAlpha () / MaxUShortFloat) * anim.opacity;
+=======
+ curve = powf (CURVE_ANIMATION, -anim.progress);
+ alpha = (optionGetFillColorAlpha () / MaxUShortFloat) * anim.opacity;
+>>>>>>> MERGE-SOURCE
color = optionGetFillColor ();
colorData[0] = alpha * color[0];
@@ -542,7 +660,7 @@
/* Set outline rect smaller to avoid damage issues */
anim.currentRect.setGeometry (anim.currentRect.x () + 1,
anim.currentRect.y () + 1,
- anim.currentRect.width () - 2,
+ anim.currentRect.width () - 2,
anim.currentRect.height () - 2);
/* draw outline */
@@ -610,7 +728,7 @@
/* Set outline rect smaller to avoid damage issues */
rect.setGeometry (rect.x () + 1,
rect.y () + 1,
- rect.width () - 2,
+ rect.width () - 2,
rect.height () - 2);
/* draw outline */
@@ -641,8 +759,7 @@
streamingBuffer->render (sTransform);
}
- if (!isBlendingEnabled)
- glDisable (GL_BLEND);
+ glDisable (GL_BLEND);
}
bool
@@ -672,7 +789,7 @@
}
unsigned int mask;
- int type;
+ int type;
};
}
@@ -754,8 +871,11 @@
void
GridScreen::handleEvent (XEvent *event)
{
+<<<<<<< TREE
CompWindow *w;
+=======
+>>>>>>> MERGE-SOURCE
screen->handleEvent (event);
if (event->type != MotionNotify || !mGrabWindow)
@@ -828,9 +948,8 @@
if (lastEdge != edge)
{
- bool check = false;
+ lastSlot = desiredSlot;
unsigned int target = typeToMask (edgeToGridType ());
- lastSlot = desiredSlot;
if (edge == NoEdge || target == GridUnknown)
desiredSlot.setGeometry (0, 0, 0, 0);
@@ -838,7 +957,7 @@
if (cScreen)
cScreen->damageRegion (desiredSlot);
- check = initiateCommon (NULL, 0, o, target, false, false);
+ bool check = initiateCommon (NULL, 0, o, target, false, false);
if (cScreen)
cScreen->damageRegion (desiredSlot);
@@ -856,13 +975,13 @@
if (cw)
{
animations.push_back (Animation ());
- int current = animations.size () - 1;
- animations.at (current).fromRect = cw->serverBorderRect ();
- animations.at (current).currentRect = cw->serverBorderRect ();
- animations.at (current).duration = optionGetAnimationDuration ();
- animations.at (current).timer = animations.at (current).duration;
- animations.at (current).targetRect = desiredSlot;
- animations.at (current).window = cw->id();
+ int current = animations.size () - 1;
+ animations.at (current).fromRect = cw->serverBorderRect ();
+ animations.at (current).currentRect = cw->serverBorderRect ();
+ animations.at (current).duration = optionGetAnimationDuration ();
+ animations.at (current).timer = animations.at (current).duration;
+ animations.at (current).targetRect = desiredSlot;
+ animations.at (current).window = cw->id();
if (lastEdge == NoEdge || !animating)
{
@@ -879,7 +998,7 @@
lastEdge = edge;
}
- w = screen->findWindow (CompOption::getIntOptionNamed (o, "window"));
+ CompWindow *w = screen->findWindow (CompOption::getIntOptionNamed (o, "window"));
if (w)
{
@@ -898,18 +1017,25 @@
}
void
-GridWindow::validateResizeRequest (unsigned int &xwcm,
+GridWindow::validateResizeRequest (unsigned int &xwcm,
XWindowChanges *xwc,
- unsigned int source)
+ unsigned int source)
{
window->validateResizeRequest (xwcm, xwc, source);
/* Don't allow non-pagers to change
* the size of the window, the user
+<<<<<<< TREE
* specified this size */
if (isGridHorzMaximized || isGridVertMaximized)
if (source != ClientTypePager)
xwcm = 0;
+=======
+ * specified this size */
+ if ((isGridHorzMaximized || isGridVertMaximized) &&
+ source != ClientTypePager)
+ xwcm = 0;
+>>>>>>> MERGE-SOURCE
}
void
@@ -963,13 +1089,15 @@
}
gScreen->lastResizeEdge = gScreen->edge;
- gScreen->edge = NoEdge;
+ gScreen->edge = NoEdge;
window->ungrabNotify ();
}
void
-GridWindow::moveNotify (int dx, int dy, bool immediate)
+GridWindow::moveNotify (int dx,
+ int dy,
+ bool immediate)
{
window->moveNotify (dx, dy, immediate);
@@ -1010,6 +1138,7 @@
!(window->state () & MAXIMIZE_STATE))
{
lastTarget = GridUnknown;
+<<<<<<< TREE
if (!window->grabbed ())
{
@@ -1031,6 +1160,13 @@
(lastState & MAXIMIZE_STATE) == CompWindowStateMaximizedHorzMask) ||
(isGridVertMaximized &&
(lastState & MAXIMIZE_STATE) == CompWindowStateMaximizedVertMask))
+=======
+
+ if ((isGridHorzMaximized &&
+ (lastState & MAXIMIZE_STATE) == CompWindowStateMaximizedHorzMask) ||
+ (isGridVertMaximized &&
+ (lastState & MAXIMIZE_STATE) == CompWindowStateMaximizedVertMask))
+>>>>>>> MERGE-SOURCE
gScreen->restoreWindow(0, 0, gScreen->o);
}
else if (!(lastState & MAXIMIZE_STATE) &&
@@ -1055,24 +1191,43 @@
CompAction::State state,
CompOption::Vector &option)
{
+<<<<<<< TREE
XWindowChanges xwc;
int xwcm = 0;
CompWindow *cw = screen->findWindow (screen->activeWindow ());
+=======
+ CompWindow *cw = screen->findWindow (screen->activeWindow ());
+>>>>>>> MERGE-SOURCE
if (!cw)
return false;
GRID_WINDOW (cw);
- /* We have nothing to do here */
- if (!gw->isGridResized &&
- !gw->isGridVertMaximized &&
- !gw->isGridHorzMaximized)
- return false;
-
- else if (!gw->isGridResized &&
- gw->isGridHorzMaximized &&
- !gw->isGridVertMaximized)
+<<<<<<< TREE
+ /* We have nothing to do here */
+ if (!gw->isGridResized &&
+ !gw->isGridVertMaximized &&
+ !gw->isGridHorzMaximized)
+ return false;
+
+ else if (!gw->isGridResized &&
+ gw->isGridHorzMaximized &&
+ !gw->isGridVertMaximized)
+=======
+ XWindowChanges xwc = XWINDOWCHANGES_INIT;
+ int xwcm = 0;
+
+ /* We have nothing to do here */
+ if (!gw->isGridResized &&
+ !gw->isGridVertMaximized &&
+ !gw->isGridHorzMaximized)
+ return false;
+
+ else if (!gw->isGridResized &&
+ gw->isGridHorzMaximized &&
+ !gw->isGridVertMaximized)
+>>>>>>> MERGE-SOURCE
{
/* Window has been horizontally maximized by grid. We only need
* to restore Y and height - core handles X and width. */
@@ -1107,6 +1262,7 @@
if (cw == mGrabWindow)
{
+<<<<<<< TREE
/* The windows x-center is different in this case. */
if (optionGetSnapbackWindows ())
xwc.x = pointerX - (gw->originalSize.width () / 2);
@@ -1124,6 +1280,30 @@
*
* The best solution is to resize it in place. */
xwcm = CWWidth | CWHeight;
+=======
+ /* The windows x-center is different in this case. */
+ if (optionGetSnapbackWindows ())
+ {
+ xwc.x = pointerX - gw->originalSize.width () / 2;
+ xwc.y = pointerY + cw->border ().top / 2;
+ }
+ else /* the user does not want the original size back */
+ {
+ /* this one is quite tricky to get right */
+ xwc.x = pointerX - gw->pointerBufDx - gw->currentSize.width () / 2;
+ xwc.y = pointerY - gw->pointerBufDy + cw->border ().top / 2;
+ }
+ }
+ else if (cw->grabbed () && screen->grabExist ("expo"))
+ {
+ /* We're restoring a window inside expo by dragging. This is a bit
+ * tricky. Pointer location is absolute to the screen, not relative
+ * to expo viewport. So we can't use pointer location to calculate
+ * the position of the restore window.
+ *
+ * The best solution is to resize it in place. */
+ xwcm = CWWidth | CWHeight;
+>>>>>>> MERGE-SOURCE
}
else
{
@@ -1157,11 +1337,19 @@
gw->isGridResized = false;
cw->configureXWindow (xwcm, &xwc);
+<<<<<<< TREE
gw->currentSize = CompRect ();
gw->pointerBufDx = 0;
gw->pointerBufDy = 0;
+=======
+
+ gw->currentSize = CompRect ();
+ gw->pointerBufDx = 0;
+ gw->pointerBufDy = 0;
+
+>>>>>>> MERGE-SOURCE
if (cw->state () & MAXIMIZE_STATE)
cw->maximize(0);
@@ -1174,9 +1362,8 @@
void
GridScreen::preparePaint (int msSinceLastPaint)
{
- std::vector::iterator iter;
-
- for (iter = animations.begin (); iter != animations.end (); ++iter)
+ for (std::vector::iterator iter = animations.begin ();
+ iter != animations.end (); ++iter)
{
Animation& anim = *iter;
anim.timer -= msSinceLastPaint;
@@ -1216,9 +1403,14 @@
void
GridScreen::donePaint ()
{
+<<<<<<< TREE
std::vector::iterator iter;
for (iter = animations.begin (); iter != animations.end ();)
+=======
+ for (std::vector::iterator iter = animations.begin ();
+ iter != animations.end ();)
+>>>>>>> MERGE-SOURCE
{
Animation& anim = *iter;
@@ -1255,16 +1447,16 @@
Animation::Animation ()
{
- progress = 0.0f;
- fromRect = CompRect (0, 0, 0, 0);
- targetRect = CompRect (0, 0, 0, 0);
+ progress = 0.0f;
+ fromRect = CompRect (0, 0, 0, 0);
+ targetRect = CompRect (0, 0, 0, 0);
currentRect = CompRect (0, 0, 0, 0);
- opacity = 0.0f;
- timer = 0.0f;
- duration = 0;
- complete = false;
- fadingOut = false;
- window = 0;
+ opacity = 0.0f;
+ timer = 0.0f;
+ duration = 0;
+ complete = false;
+ fadingOut = false;
+ window = 0;
}
GridScreen::GridScreen (CompScreen *screen) :
@@ -1358,18 +1550,16 @@
{
bool status = gWindow->glPaint (attrib, matrix, region, mask);
- std::vector::iterator iter;
-
- for (iter = gScreen->animations.begin ();
+ for (std::vector::iterator iter = gScreen->animations.begin ();
iter != gScreen->animations.end () && gScreen->animating; ++iter)
{
Animation& anim = *iter;
if (anim.timer > 0.0f && anim.window == window->id())
{
- GLWindowPaintAttrib wAttrib(attrib);
- GLMatrix wTransform (matrix);
- unsigned int wMask(mask);
+ GLWindowPaintAttrib wAttrib (attrib);
+ GLMatrix wTransform (matrix);
+ unsigned int wMask (mask);
float curve = powf (CURVE_ANIMATION, -anim.progress);
wAttrib.opacity *= curve;
@@ -1408,10 +1598,17 @@
bool
GridPluginVTable::init ()
{
+<<<<<<< TREE
if (CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
return true;
+=======
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
+ CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
+ CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
+ return true;
+>>>>>>> MERGE-SOURCE
return false;
}
=== modified file 'plugins/grid/src/grid.h'
--- plugins/grid/src/grid.h 2013-04-30 00:18:41 +0000
+++ plugins/grid/src/grid.h 2013-07-21 23:03:28 +0000
@@ -30,6 +30,11 @@
#include "grid_options.h"
+<<<<<<< TREE
+=======
+#define XWINDOWCHANGES_INIT {0, 0, 0, 0, 0, None, 0}
+
+>>>>>>> MERGE-SOURCE
namespace GridWindowType
{
static const unsigned int GridUnknown = (1 << 0);
@@ -224,11 +229,16 @@
const CompRegion &,
unsigned int );
- void grabNotify (int, int, unsigned int, unsigned int);
+ void grabNotify (int ,
+ int ,
+ unsigned int ,
+ unsigned int );
void ungrabNotify ();
- void moveNotify (int, int, bool);
+ void moveNotify (int ,
+ int ,
+ bool );
void stateChangeNotify (unsigned int);
=== modified file 'plugins/group/src/glow.cpp'
--- plugins/group/src/glow.cpp 2012-12-30 11:13:36 +0000
+++ plugins/group/src/glow.cpp 2013-07-21 23:03:28 +0000
@@ -102,7 +102,7 @@
/* There are 8 glow parts of the glow texture which we wish to paint
* separately with different transformations
*/
- for (i = 0; i < NUM_GLOWQUADS; i++)
+ for (i = 0; i < NUM_GLOWQUADS; ++i)
{
/* Using precalculated quads here */
reg = CompRegion (mGlowQuads[i].mBox);
=== modified file 'plugins/group/src/paint.cpp'
--- plugins/group/src/paint.cpp 2012-07-30 09:53:16 +0000
+++ plugins/group/src/paint.cpp 2013-07-21 23:03:28 +0000
@@ -513,7 +513,12 @@
glLoadMatrixf (sTransform.getMatrix ());
glDisableClientState (GL_TEXTURE_COORD_ARRAY);
- glEnable (GL_BLEND);
+
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
glColor4usv (gs->optionGetFillColor ());
glRecti (x1, y2, x2, y1);
=== modified file 'plugins/group/src/selection.cpp'
--- plugins/group/src/selection.cpp 2012-12-04 15:34:01 +0000
+++ plugins/group/src/selection.cpp 2013-07-21 23:03:28 +0000
@@ -45,7 +45,7 @@
buf = window->region ().intersected (src);
/* buf area */
- for (int i = 0; i < buf.numRects (); i++)
+ for (int i = 0; i < buf.numRects (); ++i)
{
CompRect box = buf.rects ().at (i);
area += (box.width ()) * (box.height ()); /* width * height */
=== modified file 'plugins/group/src/tab.cpp'
--- plugins/group/src/tab.cpp 2013-03-26 22:02:39 +0000
+++ plugins/group/src/tab.cpp 2013-07-21 23:03:28 +0000
@@ -1242,7 +1242,7 @@
* use screen->width () * screen->height () since that doesn't
* account for weird multihead configs, where there are gaps
* or different screen sizes and the like. */
- for (unsigned int i = 0;i < screen->outputDevs ().size (); i++)
+ for (unsigned int i = 0;i < screen->outputDevs ().size (); ++i)
region = CompRegion (screen->outputDevs ()[i]).united (region);
foreach (CompWindow *w, screen->windows ())
@@ -1849,11 +1849,11 @@
/* Count from left to the current top tab */
if (group->mTabBar->mTopTab)
for (; (*it) && ((*it) != group->mTabBar->mTopTab);
- ++it, distanceOld++);
+ ++it, ++distanceOld);
/* Count from left to the requested top tab */
for (it = group->mTabBar->mSlots.begin (); (*it) && ((*it) != topTab);
- ++it, distanceNew++);
+ ++it, ++distanceNew);
if (distanceNew < distanceOld)
group->mTabBar->mChangeAnimationDirection = 1; /*left */
@@ -2151,7 +2151,7 @@
slot->mSpeed = 0;
slot->mMsSinceLastMove = 0;
- currentSlot++;
+ ++currentSlot;
}
/* Left and right spring points are the left and right parts
=== modified file 'plugins/imgsvg/src/imgsvg.cpp'
--- plugins/imgsvg/src/imgsvg.cpp 2013-05-16 11:55:17 +0000
+++ plugins/imgsvg/src/imgsvg.cpp 2013-07-21 23:03:28 +0000
@@ -302,15 +302,23 @@
}
}
+<<<<<<< TREE
GLTexture::Filter saveFilter;
CompRegion r (rect);
for (unsigned int j = 0; j < context->texture[1].textures.size (); ++j)
+=======
+ GLTexture::Filter saveFilter;
+
+
+ for (unsigned int j = 0; j < context->texture[1].textures.size (); ++j)
+>>>>>>> MERGE-SOURCE
{
matrix[0] = context->texture[1].matrices[j];
saveFilter = gScreen->filter (SCREEN_TRANS_FILTER);
gScreen->setFilter (SCREEN_TRANS_FILTER, GLTexture::Good);
+ CompRegion r (rect);
gWindow->vertexBuffer ()->begin ();
gWindow->glAddGeometry (matrix, r, reg);
=== modified file 'plugins/kdecompat/src/kdecompat.cpp'
--- plugins/kdecompat/src/kdecompat.cpp 2013-05-11 09:30:49 +0000
+++ plugins/kdecompat/src/kdecompat.cpp 2013-07-21 23:03:28 +0000
@@ -58,13 +58,13 @@
while (mUnmapCnt)
{
window->unmap ();
- mUnmapCnt--;
+ --mUnmapCnt;
}
while (mDestroyCnt)
{
window->destroy ();
- mDestroyCnt--;
+ --mDestroyCnt;
}
}
@@ -288,7 +288,12 @@
}
else
{
- icon = gWindow->getIcon (512, 512);
+<<<<<<< TREE
+ icon = gWindow->getIcon (512, 512);
+=======
+ icon = gWindow->getIcon (512, 512);
+
+>>>>>>> MERGE-SOURCE
if (!icon)
icon = ks->gScreen->defaultIcon ();
@@ -491,12 +496,12 @@
{
if (destroy)
{
- mDestroyCnt++;
+ ++mDestroyCnt;
window->incrementDestroyReference ();
}
else
{
- mUnmapCnt++;
+ ++mUnmapCnt;
window->incrementUnmapReference ();
}
@@ -622,7 +627,7 @@
ks->mPresentWindow = window;
ks->mPresentWindowList.clear ();
- for (unsigned int i = 0; i < n; i++)
+ for (unsigned int i = 0; i < n; ++i)
ks->mPresentWindowList.push_back (property[i]);
ks->mScaleTimeout.setCallback (
=== modified file 'plugins/loginout/src/loginout.cpp'
--- plugins/loginout/src/loginout.cpp 2013-05-09 13:43:07 +0000
+++ plugins/loginout/src/loginout.cpp 2013-07-21 23:03:28 +0000
@@ -38,13 +38,13 @@
{
lw->gWindow->glPaintSetEnabled (lw, true);
lw->gWindow->glDrawSetEnabled (lw, true);
- numLoginWin++;
+ ++numLoginWin;
}
else
{
lw->gWindow->glPaintSetEnabled (lw, false);
lw->gWindow->glDrawSetEnabled (lw, false);
- numLoginWin--;
+ --numLoginWin;
}
cScreen->damageScreen ();
}
@@ -56,13 +56,13 @@
{
lw->gWindow->glPaintSetEnabled (lw, true);
lw->gWindow->glDrawSetEnabled (lw, true);
- numLogoutWin++;
+ ++numLogoutWin;
}
else
{
lw->gWindow->glPaintSetEnabled (lw, false);
lw->gWindow->glDrawSetEnabled (lw, false);
- numLogoutWin--;
+ --numLogoutWin;
}
cScreen->damageScreen ();
}
@@ -298,12 +298,12 @@
if (login)
{
- ls->numLoginWin--;
+ --ls->numLoginWin;
ls->cScreen->damageScreen ();
}
if (logout)
{
- ls->numLogoutWin--;
+ --ls->numLogoutWin;
ls->cScreen->damageScreen ();
}
}
=== modified file 'plugins/mag/src/mag.cpp'
--- plugins/mag/src/mag.cpp 2013-05-09 13:43:07 +0000
+++ plugins/mag/src/mag.cpp 2013-07-21 23:03:28 +0000
@@ -28,13 +28,10 @@
MagScreen::cleanup ()
{
if (overlay.size ())
- {
overlay.clear ();
- }
+
if (mask.size ())
- {
mask.clear ();
- }
if (program)
{
@@ -71,10 +68,11 @@
GL::bindProgram (GL_FRAGMENT_PROGRAM_ARB, program);
GL::programString (GL_FRAGMENT_PROGRAM_ARB,
- GL_PROGRAM_FORMAT_ASCII_ARB,
- bufSize, buffer);
+ GL_PROGRAM_FORMAT_ASCII_ARB,
+ bufSize, buffer);
glGetIntegerv (GL_PROGRAM_ERROR_POSITION_ARB, &errorPos);
+
if (glGetError () != GL_NO_ERROR || errorPos != -1)
{
compLogMessage ("mag", CompLogLevelError,
@@ -85,6 +83,7 @@
return false;
}
+
GL::bindProgram (GL_FRAGMENT_PROGRAM_ARB, 0);
return true;
@@ -99,11 +98,12 @@
CompString overlay_s = optionGetOverlay ();
CompString mask_s = optionGetMask ();
CompString pname ("mag");
+
if (!GL::multiTexCoord2f)
return false;
overlay = GLTexture::readImageToTexture (overlay_s, pname,
- overlaySize);
+ overlaySize);
if (!overlay.size ())
{
@@ -148,22 +148,27 @@
switch (optionGetMode ())
{
- case ModeImageOverlay:
- if (loadImages ())
- mode = MagOptions::ModeImageOverlay;
- else
- mode = MagOptions::ModeSimple;
- break;
- case MagOptions::ModeFisheye:
- if (loadFragmentProgram ())
- mode = MagOptions::ModeFisheye;
- else
- mode = MagOptions::ModeSimple;
- break;
- default:
- mode = MagOptions::ModeSimple;
+ case ModeImageOverlay:
+ if (loadImages ())
+ mode = MagOptions::ModeImageOverlay;
+ else
+ mode = MagOptions::ModeSimple;
+
+ break;
+
+ case MagOptions::ModeFisheye:
+ if (loadFragmentProgram ())
+ mode = MagOptions::ModeFisheye;
+ else
+ mode = MagOptions::ModeSimple;
+
+ break;
+
+ default:
+ mode = MagOptions::ModeSimple;
+ break;
}
-
+
if (zoom != 1.0)
cScreen->damageScreen ();
}
@@ -177,8 +182,8 @@
switch (mode)
{
- case MagOptions::ModeSimple:
- {
+ case MagOptions::ModeSimple:
+ {
int b;
w = optionGetBoxWidth ();
h = optionGetBoxHeight ();
@@ -192,8 +197,9 @@
region = tmpRegion;
}
- break;
- case MagOptions::ModeImageOverlay:
+ break;
+
+ case MagOptions::ModeImageOverlay:
{
x = posX - optionGetXOffset ();
y = posY - optionGetYOffset ();
@@ -204,9 +210,10 @@
region = tmpRegion;
}
- break;
- case MagOptions::ModeFisheye:
- {
+ break;
+
+ case MagOptions::ModeFisheye:
+ {
int radius = optionGetRadius ();
int x2, y2;
@@ -221,9 +228,10 @@
region = tmpRegion;
}
- break;
- default:
- break;
+ break;
+
+ default:
+ break;
}
cScreen->damageRegion (region);
@@ -243,13 +251,11 @@
int
MagScreen::adjustZoom (float chunk)
{
- float dx, adjust, amount;
- float change;
-
- dx = zTarget - zoom;
-
- adjust = dx * 0.15f;
- amount = fabs(dx) * 1.5f;
+ float dx = zTarget - zoom;
+
+ float adjust = dx * 0.15f;
+ float amount = fabs(dx) * 1.5f;
+
if (amount < 0.2f)
amount = 0.2f;
else if (amount > 2.0f)
@@ -264,12 +270,11 @@
return false;
}
- change = zVelocity * chunk;
- if (!change)
- {
- if (zVelocity)
- change = (dx > 0) ? 0.01 : -0.01;
- }
+ float change = zVelocity * chunk;
+
+ if (!change &&
+ zVelocity)
+ change = (dx > 0) ? 0.01 : -0.01;
zoom += change;
@@ -281,20 +286,18 @@
{
if (adjust)
{
- int steps;
- float amount, chunk;
-
- amount = time * 0.35f * optionGetSpeed ();
- steps = amount / (0.5f * optionGetTimestep ());
+ float amount = time * 0.35f * optionGetSpeed ();
+ int steps = amount / (0.5f * optionGetTimestep ());
if (!steps)
steps = 1;
- chunk = amount / (float) steps;
+ float chunk = amount / (float) steps;
while (steps--)
{
adjust = adjustZoom (chunk);
+
if (adjust)
break;
}
@@ -310,6 +313,7 @@
posY = pos.y ();
poller.start ();
}
+
doDamageRegion ();
}
@@ -319,7 +323,6 @@
void
MagScreen::donePaint ()
{
-
if (adjust)
doDamageRegion ();
@@ -330,7 +333,7 @@
glTexImage2D (target, 0, GL_RGB, 0, 0, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
- width = 0;
+ width = 0;
height = 0;
glBindTexture (target, 0);
@@ -343,8 +346,8 @@
cScreen->donePaintSetEnabled (this, false);
gScreen->glPaintOutputSetEnabled (this, false);
- if (poller.active ())
- poller.stop ();
+ if (poller.active ())
+ poller.stop ();
}
cScreen->donePaint ();
@@ -353,39 +356,38 @@
void
MagScreen::paintSimple ()
{
- float pw, ph, bw, bh;
- int x1, x2, y1, y2;
float vc[4];
float tc[4];
- int w, h, cw, ch, cx, cy;
- bool kScreen;
unsigned short *color;
- float tmp;
GLMatrix projection;
GLMatrix modelview;
GLVertexBuffer *vb = GLVertexBuffer::streamingBuffer ();
const GLWindowPaintAttrib attrib = { OPAQUE, BRIGHT, COLOR, 0, 0, 0, 0 };
- w = optionGetBoxWidth ();
- h = optionGetBoxHeight ();
-
- kScreen = optionGetKeepScreen ();
-
- x1 = posX - (w / 2);
+ int w = optionGetBoxWidth ();
+ int h = optionGetBoxHeight ();
+
+ bool kScreen = optionGetKeepScreen ();
+
+ int x1 = posX - (w / 2);
+
if (kScreen)
x1 = MAX (0, MIN (x1, screen->width () - w));
- x2 = x1 + w;
- y1 = posY - (h / 2);
+
+ int x2 = x1 + w;
+ int y1 = posY - (h / 2);
+
if (kScreen)
y1 = MAX (0, MIN (y1, screen->height () - h));
- y2 = y1 + h;
+
+ int y2 = y1 + h;
- cw = ceil ((float)w / (zoom * 2.0)) * 2.0;
- ch = ceil ((float)h / (zoom * 2.0)) * 2.0;
- cw = MIN (w, cw + 2);
- ch = MIN (h, ch + 2);
- cx = (w - cw) / 2;
- cy = (h - ch) / 2;
+ int cw = ceil ((float)w / (zoom * 2.0)) * 2.0;
+ int ch = ceil ((float)h / (zoom * 2.0)) * 2.0;
+ cw = MIN (w, cw + 2);
+ ch = MIN (h, ch + 2);
+ int cx = (w - cw) / 2;
+ int cy = (h - ch) / 2;
cx = MAX (0, MIN (w - cw, cx));
cy = MAX (0, MIN (h - ch, cy));
@@ -395,6 +397,7 @@
cx = 0;
cw = w;
}
+
if (y1 != (posY - (h / 2)))
{
cy = 0;
@@ -414,16 +417,14 @@
glCopyTexSubImage2D (target, 0, cx, cy,
x1 + cx, screen->height () - y2 + cy, cw, ch);
+ float pw = 1.0f;
+ float ph = 1.0f;
+
if (target == GL_TEXTURE_2D)
{
pw = 1.0 / width;
ph = 1.0 / height;
}
- else
- {
- pw = 1.0;
- ph = 1.0;
- }
vc[0] = ((x1 * 2.0) / screen->width ()) - 1.0;
vc[1] = ((x2 * 2.0) / screen->width ()) - 1.0;
@@ -448,14 +449,16 @@
modelview.translate ((float)((screen->width () / 2) - posX) * 2 / screen->width (),
(float)((screen->height () / 2) - posY) * 2 / -screen->height (), 0.0);
- GLfloat vertices[] = {
+ GLfloat vertices[] =
+ {
vc[0], vc[2], 0,
vc[0], vc[3], 0,
vc[1], vc[2], 0,
vc[1], vc[3], 0,
};
- GLfloat texcoords[] = {
+ GLfloat texcoords[] =
+ {
tc[0], tc[2],
tc[0], tc[3],
tc[1], tc[2],
@@ -492,12 +495,17 @@
#endif
/* Draw zoom box border */
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- tmp = MIN (1.0, (zoom - 1) * 3.0);
+ float tmp = MIN (1.0, (zoom - 1) * 3.0);
- bw = bh = optionGetBorder ();
+ float bw = optionGetBorder ();
+ float bh = bw;
bw = bw * 2.0 / screen->width ();
bh = bh * 2.0 / screen->height ();
@@ -534,8 +542,8 @@
/* Restore blending state */
#if USE_GLES
- if (!isBlendingEnabled)
- glDisable (GL_BLEND);
+// if (!isBlendingEnabled)
+// glDisable (GL_BLEND);
glBlendFuncSeparate (blendSrcRGB, blendDstRGB, blendSrcAlpha, blendDstAlpha);
#else
glPopAttrib ();
@@ -625,16 +633,19 @@
tc[2] *= ph;
tc[3] *= ph;
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
glColor4usv (defaultColor);
- glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+// glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
GL::activeTexture (GL_TEXTURE1_ARB);
foreach (GLTexture *tex, mask)
{
tex->enable (GLTexture::Good);
- glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+// glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBegin (GL_QUADS);
GL::multiTexCoord2f (GL_TEXTURE0_ARB, tc[0], tc[2]);
@@ -674,7 +685,7 @@
foreach (GLTexture *tex, overlay)
{
tex->enable (GLTexture::Fast);
- glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+// glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBegin (GL_QUADS);
glTexCoord2f (COMP_TEX_COORD_X (tex->matrix (), 0),
@@ -695,7 +706,7 @@
}
glColor4usv (defaultColor);
- glDisable (GL_BLEND);
+// glDisable (GL_BLEND);
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glPopMatrix();
=== modified file 'plugins/maximumize/src/maximumize.cpp'
--- plugins/maximumize/src/maximumize.cpp 2013-05-09 13:43:07 +0000
+++ plugins/maximumize/src/maximumize.cpp 2013-07-21 23:03:28 +0000
@@ -32,8 +32,8 @@
COMPIZ_PLUGIN_20090315 (maximumize, MaximumizePluginVTable);
/* Convenience constants to make the code more readable (hopefully) */
-const short REDUCE = -1;
-const unsigned short INCREASE = 1;
+const short REDUCE = -1;
+const unsigned short INCREASE = 1;
/* Returns true if rectangles a and b intersect by at least 40 in both
* directions
@@ -42,13 +42,10 @@
MaximumizeScreen::substantialOverlap (const CompRect& a,
const CompRect& b)
{
- if (a.x2 () <= b.x1 () + 40)
- return false;
- if (b.x2 () <= a.x1 () + 40)
- return false;
- if (a.y2 () <= b.y1 () + 40)
- return false;
- if (b.y2 () <= a.y1 () + 40)
+ if (a.x2 () <= b.x1 () + 40 ||
+ b.x2 () <= a.x1 () + 40 ||
+ a.y2 () <= b.y1 () + 40 ||
+ b.y2 () <= a.y1 () + 40)
return false;
return true;
@@ -65,6 +62,7 @@
const CompRect& output)
{
CompRegion newRegion (output);
+ CompRegion tmpRegion;
CompRect tmpRect, windowRect;
if (optionGetIgnoreOverlapping ())
@@ -72,15 +70,9 @@
foreach (CompWindow *w, screen->windows ())
{
- CompRegion tmpRegion;
-
- if (w->id () == window->id ())
- continue;
-
- if (w->invisible () /*|| w->hidden */|| w->minimized ())
- continue;
-
- if (w->wmType () & CompWindowTypeDesktopMask)
+ if (w->id () == window->id () ||
+ w->invisible () /*|| w->hidden */|| w->minimized () ||
+ w->wmType () & CompWindowTypeDesktopMask)
continue;
if (w->wmType () & CompWindowTypeDockMask)
@@ -97,20 +89,16 @@
continue;
}
- if (optionGetIgnoreSticky () &&
- (w->state () & CompWindowStateStickyMask) &&
+ if (optionGetIgnoreSticky () &&
+ (w->state () & CompWindowStateStickyMask) &&
!(w->wmType () & CompWindowTypeDockMask))
- {
continue;
- }
tmpRect = w->serverBorderRect ();
if (optionGetIgnoreOverlapping () &&
substantialOverlap (tmpRect, windowRect))
- {
continue;
- }
tmpRegion += tmpRect;
newRegion -= tmpRegion;
@@ -121,13 +109,11 @@
/* Returns true if box a has a larger area than box b. */
bool
-MaximumizeScreen::boxCompare (const CompRect& a,
- const CompRect& b)
+MaximumizeScreen::boxCompare (const CompRect &a,
+ const CompRect &b)
{
- int areaA, areaB;
-
- areaA = a.width () * a.height ();
- areaB = b.width () * b.height ();
+ int areaA = a.width () * a.height ();
+ int areaB = b.width () * b.height ();
return (areaA > areaB);
}
@@ -150,34 +136,41 @@
Corner corner,
const short inc)
{
- switch (corner) {
+ switch (corner)
+ {
case X1:
rect.setX (rect.x () + inc);
break;
+
case X2:
rect.setWidth (rect.width () + inc);
break;
+
case Y1:
rect.setY (rect.y () + inc);
break;
+
case Y2:
rect.setHeight (rect.height () + inc);
break;
+
+ default:
+ break;
}
}
#define CHECKREC \
r.contains (CompRect (tmp.x1 () - w->border ().left, \
tmp.y1 () - w->border ().top, \
- tmp.width () + w->border ().right + w->border ().left, \
+ tmp.width () + w->border ().right + w->border ().left, \
tmp.height () + w->border ().bottom + w->border ().top))
void
-MaximumizeScreen::growGeneric (CompWindow *w,
- CompRect& tmp,
- const CompRegion& r,
- Corner corner,
- const short inc)
+MaximumizeScreen::growGeneric (CompWindow *w,
+ CompRect &tmp,
+ const CompRegion &r,
+ Corner corner,
+ const short inc)
{
bool touch = false;
@@ -194,10 +187,10 @@
/* Grow a box in the left/right directions as much as possible without
* overlapping other relevant windows. */
void
-MaximumizeScreen::growWidth (CompWindow *w,
- CompRect& tmp,
- const CompRegion& r,
- const MaxSet& mset)
+MaximumizeScreen::growWidth (CompWindow *w,
+ CompRect &tmp,
+ const CompRegion &r,
+ const MaxSet &mset)
{
if (mset.left)
growGeneric (w, tmp, r, X1, REDUCE);
@@ -209,14 +202,14 @@
/* Grow box in the up/down direction as much as possible without
* overlapping other relevant windows. */
void
-MaximumizeScreen::growHeight (CompWindow *w,
- CompRect& tmp,
- const CompRegion& r,
- const MaxSet& mset)
+MaximumizeScreen::growHeight (CompWindow *w,
+ CompRect &tmp,
+ const CompRegion &r,
+ const MaxSet &mset)
{
if (mset.down)
growGeneric (w, tmp, r, Y2, INCREASE);
-
+
if (mset.up)
growGeneric (w, tmp, r, Y1, REDUCE);
}
@@ -226,11 +219,11 @@
* then Y. This is because it gives different results.
*/
CompRect
-MaximumizeScreen::extendBox (CompWindow *w,
- const CompRect& tmp,
- const CompRegion& r,
- bool xFirst,
- const MaxSet& mset)
+MaximumizeScreen::extendBox (CompWindow *w,
+ const CompRect &tmp,
+ const CompRegion &r,
+ bool xFirst,
+ const MaxSet &mset)
{
CompRect result = tmp;
@@ -254,9 +247,9 @@
*/
void
-MaximumizeScreen::setBoxWidth (CompRect& box,
- const int width,
- const MaxSet& mset)
+MaximumizeScreen::setBoxWidth (CompRect &box,
+ const int width,
+ const MaxSet &mset)
{
int original = box.width ();
int increment;
@@ -274,16 +267,16 @@
}
void
-MaximumizeScreen::setBoxHeight (CompRect& box,
- const int height,
- const MaxSet& mset)
+MaximumizeScreen::setBoxHeight (CompRect &box,
+ const int height,
+ const MaxSet &mset)
{
- int original = box.height ();
- int increment;
-
if (!mset.down && !mset.up)
return ;
+ int original = box.height ();
+ int increment;
+
if (mset.up != mset.down)
increment = original - height;
else
@@ -297,20 +290,19 @@
* allowed, whichever is bigger.
*/
CompRect
-MaximumizeScreen::minimumize (CompWindow *w,
- const CompRect& box,
- const MaxSet& mset)
+MaximumizeScreen::minimumize (CompWindow *w,
+ const CompRect &box,
+ const MaxSet &mset)
{
- const int minWidth = w->sizeHints ().min_width;
+ const int minWidth = w->sizeHints ().min_width;
const int minHeight = w->sizeHints ().min_height;
- int width, height;
- CompRect result = box;
+ CompRect result = box;
/* unmaximize first */
w->maximize (0);
- width = result.width ();
- height = result.height ();
+ int width = result.width ();
+ int height = result.height ();
if (width / 4 < minWidth)
setBoxWidth (result, minWidth, mset);
@@ -330,17 +322,17 @@
* FIXME: should be somewhat cleaner.
*/
CompRect
-MaximumizeScreen::findRect (CompWindow *w,
- const CompRegion& r,
- const MaxSet& mset)
+MaximumizeScreen::findRect (CompWindow *w,
+ const CompRegion &r,
+ const MaxSet &mset)
{
- CompRect windowBox, ansA, ansB, orig;
+ CompRect windowBox;
windowBox.setGeometry (w->serverX (),
w->serverY (),
w->serverWidth (),
w->serverHeight ());
- orig = windowBox;
+ CompRect orig = windowBox;
if (mset.shrink)
windowBox = minimumize (w, windowBox, mset);
@@ -348,43 +340,34 @@
if (!mset.grow)
return windowBox;
- ansA = extendBox (w, windowBox, r, true, mset);
- ansB = extendBox (w, windowBox, r, false, mset);
+ CompRect ansA = extendBox (w, windowBox, r, true, mset);
+ CompRect ansB = extendBox (w, windowBox, r, false, mset);
if (!optionGetAllowShrink ())
{
if (boxCompare (orig, ansA) && boxCompare (orig, ansB))
return orig;
- }
- else
- {
- /* Order is essential here. */
- if (!boxCompare (ansA, windowBox) && !boxCompare (ansB, windowBox))
- return orig;
- }
-
+ } /* Order is essential here. */
+ else if (!boxCompare (ansA, windowBox) && !boxCompare (ansB, windowBox))
+ return orig;
if (boxCompare (ansA, ansB))
return ansA;
else
return ansB;
-
}
/* Calls out to compute the resize */
unsigned int
MaximumizeScreen::computeResize (CompWindow *w,
XWindowChanges *xwc,
- const MaxSet& mset)
+ const MaxSet &mset)
{
int outputDevice = w->outputDevice ();
- const CompOutput& output = screen->outputDevs ()[outputDevice];
- CompRegion region;
- unsigned int mask = 0;
- CompRect box;
-
- region = findEmptyRegion (w, output);
- box = findRect (w, region, mset);
+ const CompOutput &output = screen->outputDevs ()[outputDevice];
+ unsigned int mask = 0;
+ CompRegion region = findEmptyRegion (w, output);
+ CompRect box = findRect (w, region, mset);
if (box.x1 () != w->serverX ())
mask |= CWX;
@@ -414,19 +397,15 @@
MaximumizeScreen::triggerGeneral (CompAction *action,
CompAction::State state,
CompOption::Vector &options,
- bool grow)
+ bool grow)
{
- Window xid;
- CompWindow *w;
+ Window xid = CompOption::getIntOptionNamed (options, "window");
+ CompWindow *w = screen->findWindow (xid);
- xid = CompOption::getIntOptionNamed (options, "window");
- w = screen->findWindow (xid);
if (w)
{
- int width, height;
- unsigned int mask;
XWindowChanges xwc;
- MaxSet mset;
+ MaxSet mset;
MAX_SCREEN (screen);
@@ -441,9 +420,12 @@
mset.grow = grow;
mset.shrink = true;
- mask = computeResize (w, &xwc, mset);
+ unsigned int mask = computeResize (w, &xwc, mset);
+
if (mask)
{
+ int width, height;
+
if (w->constrainNewWindowSize (xwc.width, xwc.height,
&width, &height))
{
@@ -469,23 +451,20 @@
MaximumizeScreen::triggerDirection (CompAction *action,
CompAction::State state,
CompOption::Vector &options,
- bool left,
- bool right,
- bool up,
- bool down,
- bool grow)
+ bool left,
+ bool right,
+ bool up,
+ bool down,
+ bool grow)
{
- Window xid;
- CompWindow *w;
+ Window xid = CompOption::getIntOptionNamed (options, "window");
+ CompWindow *w = screen->findWindow (xid);
- xid = CompOption::getIntOptionNamed (options, "window");
- w = screen->findWindow (xid);
if (w)
{
int width, height;
- unsigned int mask;
XWindowChanges xwc;
- MaxSet mset;
+ MaxSet mset;
if (screen->otherGrabExist (0))
return false;
@@ -497,7 +476,8 @@
mset.grow = grow;
mset.shrink = !grow;
- mask = computeResize (w, &xwc, mset);
+ unsigned int mask = computeResize (w, &xwc, mset);
+
if (mask)
{
if (w->constrainNewWindowSize (xwc.width, xwc.height,
=== modified file 'plugins/maximumize/src/maximumize.h'
--- plugins/maximumize/src/maximumize.h 2012-09-07 22:48:26 +0000
+++ plugins/maximumize/src/maximumize.h 2013-07-21 23:03:28 +0000
@@ -32,17 +32,17 @@
#include "maximumize_options.h"
/* Convenience constants to make the code more readable (hopefully) */
-extern const short REDUCE;
+extern const short REDUCE;
extern const unsigned short INCREASE;
typedef struct
{
- bool left;
- bool right;
- bool up;
- bool down;
- bool shrink; // Shrink and grow can both be executed.
- bool grow; // Shrink will run first.
+ bool left;
+ bool right;
+ bool up;
+ bool down;
+ bool shrink; // Shrink and grow can both be executed.
+ bool grow; // Shrink will run first.
} MaxSet;
class MaximumizeScreen :
@@ -57,19 +57,22 @@
triggerGeneral (CompAction *action,
CompAction::State state,
CompOption::Vector &options,
- bool grow);
+ bool grow);
bool
triggerDirection (CompAction *action,
CompAction::State state,
CompOption::Vector &options,
- bool left,
- bool right,
- bool up,
- bool down,
- bool grow);
+ bool left,
+ bool right,
+ bool up,
+ bool down,
+ bool grow);
+
private:
- typedef enum {
+
+ typedef enum
+ {
X1,
X2,
Y1,
@@ -77,72 +80,72 @@
} Corner;
bool
- substantialOverlap (const CompRect& a,
- const CompRect& b);
+ substantialOverlap (const CompRect &a,
+ const CompRect &b);
CompRegion
- findEmptyRegion (CompWindow *window,
- const CompRect& output);
+ findEmptyRegion (CompWindow *window,
+ const CompRect &output);
bool
- boxCompare (const CompRect& a,
- const CompRect& b);
+ boxCompare (const CompRect &a,
+ const CompRect &b);
void
- growGeneric (CompWindow *w,
- CompRect& tmp,
- const CompRegion& r,
- Corner corner,
- const short inc);
+ growGeneric (CompWindow *w,
+ CompRect& tmp,
+ const CompRegion &r,
+ Corner corner,
+ const short inc);
inline void
- addToCorner (CompRect& rect,
+ addToCorner (CompRect &rect,
Corner corner,
const short inc);
inline void
- growWidth (CompWindow *w,
- CompRect& tmp,
- const CompRegion& r,
- const MaxSet& mset);
+ growWidth (CompWindow *w,
+ CompRect& tmp,
+ const CompRegion &r,
+ const MaxSet &mset);
inline void
- growHeight (CompWindow *w,
- CompRect& tmp,
- const CompRegion& r,
- const MaxSet& mset);
-
- CompRect
- extendBox (CompWindow *w,
- const CompRect& tmp,
- const CompRegion& r,
- bool xFirst,
- const MaxSet& mset);
-
- void
- setBoxWidth (CompRect& box,
- const int width,
- const MaxSet& mset);
-
- void
- setBoxHeight (CompRect& box,
- const int height,
- const MaxSet& mset);
-
- CompRect
- minimumize (CompWindow *w,
- const CompRect& box,
- const MaxSet& mset);
-
- CompRect
- findRect (CompWindow *w,
- const CompRegion& r,
- const MaxSet& mset);
+ growHeight (CompWindow *w,
+ CompRect &tmp,
+ const CompRegion &r,
+ const MaxSet &mset);
+
+ CompRect
+ extendBox (CompWindow *w,
+ const CompRect &tmp,
+ const CompRegion &r,
+ bool xFirst,
+ const MaxSet &mset);
+
+ void
+ setBoxWidth (CompRect &box,
+ const int width,
+ const MaxSet &mset);
+
+ void
+ setBoxHeight (CompRect &box,
+ const int height,
+ const MaxSet &mset);
+
+ CompRect
+ minimumize (CompWindow *w,
+ const CompRect &box,
+ const MaxSet &mset);
+
+ CompRect
+ findRect (CompWindow *w,
+ const CompRegion &r,
+ const MaxSet &mset);
unsigned int
computeResize (CompWindow *w,
XWindowChanges *xwc,
- const MaxSet& mset);
+ const MaxSet &mset);
};
#define MAX_SCREEN(s) \
@@ -155,6 +158,3 @@
bool init ();
};
-
-
-
=== modified file 'plugins/mblur/src/mblur.cpp'
--- plugins/mblur/src/mblur.cpp 2013-05-09 13:43:07 +0000
+++ plugins/mblur/src/mblur.cpp 2013-07-21 23:03:28 +0000
@@ -169,7 +169,10 @@
if (!update)
{
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
glBlendFunc (GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA);
alpha = (timer / 500.0) *
@@ -194,7 +197,7 @@
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- glDisable (GL_BLEND);
+// glDisable (GL_BLEND);
// copy new screen to motion blur texture
glCopyTexSubImage2D (target, 0, 0, 0, 0, 0, screen->width (), screen->height ());
@@ -248,10 +251,10 @@
void
MblurScreen::glPaintTransformedOutput (const GLScreenPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- CompOutput *output,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ CompOutput *output,
+ unsigned int mask)
{
if (optionGetOnTransformedScreen () &&
(mask & PAINT_SCREEN_TRANSFORMED_MASK) )
=== modified file 'plugins/mousepoll/src/private.h'
=== modified file 'plugins/move/src/move.cpp'
--- plugins/move/src/move.cpp 2013-06-28 01:10:57 +0000
+++ plugins/move/src/move.cpp 2013-07-21 23:03:28 +0000
@@ -39,14 +39,24 @@
CompAction::State state,
CompOption::Vector &options)
{
+<<<<<<< TREE
CompWindow *w;
+=======
+>>>>>>> MERGE-SOURCE
MOVE_SCREEN (screen);
+<<<<<<< TREE
Window xid = CompOption::getIntOptionNamed (options, "window");
w = screen->findWindow (xid);
+=======
+ Window xid = CompOption::getIntOptionNamed (options, "window");
+
+ CompWindow *w = screen->findWindow (xid);
+
+>>>>>>> MERGE-SOURCE
if (w && (w->actions () & CompWindowActionMoveMask))
{
CompScreen *s = screen;
@@ -213,18 +223,27 @@
static Region
moveGetYConstrainRegion (CompScreen *s)
{
+<<<<<<< TREE
CompWindow *w;
REGION r;
CompRect workArea;
BoxRec extents;
-
- Region region = XCreateRegion ();
-
+=======
+ Region region = XCreateRegion ();
+>>>>>>> MERGE-SOURCE
+
+<<<<<<< TREE
+ Region region = XCreateRegion ();
+
+=======
+>>>>>>> MERGE-SOURCE
if (!region)
return NULL;
- r.rects = &r.extents;
- r.numRects = r.size = 1;
+ REGION r;
+
+ r.rects = &r.extents;
+ r.numRects = r.size = 1;
r.extents.x1 = MINSHORT;
r.extents.y1 = 0;
@@ -238,14 +257,17 @@
XUnionRegion (&r, region, region);
- for (unsigned int i = 0; i < s->outputDevs ().size (); i++)
+ CompRect workArea;
+ BoxRec extents;
+
+ for (unsigned int i = 0; i < s->outputDevs ().size (); ++i)
{
XUnionRegion (s->outputDevs ()[i].region (), region, region);
workArea = s->getWorkareaForOutput (i);
- extents = s->outputDevs ()[i].region ()->extents;
+ extents = s->outputDevs ()[i].region ()->extents;
- foreach (w, s->windows ())
+ foreach (CompWindow *w, s->windows ())
{
if (!w->mapNum ())
continue;
@@ -297,13 +319,14 @@
static void
moveHandleMotionEvent (CompScreen *s,
- int xRoot,
- int yRoot)
+ int xRoot,
+ int yRoot)
{
MOVE_SCREEN (s);
if (ms->grab)
{
+<<<<<<< TREE
int dx, dy;
CompWindow *w;
@@ -313,6 +336,15 @@
int wY = w->geometry ().y ();
int wWidth = w->geometry ().widthIncBorders ();
int wHeight = w->geometry ().heightIncBorders ();
+=======
+ int dx, dy;
+ CompWindow *w = ms->w;
+
+ int wX = w->geometry ().x ();
+ int wY = w->geometry ().y ();
+ int wWidth = w->geometry ().widthIncBorders ();
+ int wHeight = w->geometry ().heightIncBorders ();
+>>>>>>> MERGE-SOURCE
ms->x += xRoot - lastPointerX;
ms->y += yRoot - lastPointerY;
@@ -321,7 +353,11 @@
dx = dy = 0;
else
{
+<<<<<<< TREE
int min, max;
+=======
+ int min, max;
+>>>>>>> MERGE-SOURCE
dx = ms->x;
dy = ms->y;
@@ -338,6 +374,7 @@
region */
if (ms->region)
{
+<<<<<<< TREE
int x = wX + dx - w->border ().left;
int y = wY + dy - w->border ().top;
int width = wWidth + w->border ().left + w->border ().right;
@@ -346,6 +383,16 @@
int status = XRectInRegion (ms->region, x, y,
(unsigned int) width,
(unsigned int) height);
+=======
+ int x = wX + dx - w->border ().left;
+ int y = wY + dy - w->border ().top;
+ int width = wWidth + w->border ().left + w->border ().right;
+ int height = w->border ().top ? w->border ().top : 1;
+
+ int status = XRectInRegion (ms->region, x, y,
+ (unsigned int) width,
+ (unsigned int) height);
+>>>>>>> MERGE-SOURCE
/* only constrain movement if previous position was valid */
if (ms->status == RectangleIn)
@@ -389,6 +436,7 @@
if (w->state () & CompWindowStateMaximizedVertMask)
{
+<<<<<<< TREE
if (abs (yRoot - workArea.y () - ms->snapOffY) >= snapoffDistance)
{
if (!s->otherGrabExist ("move", NULL))
@@ -481,6 +529,83 @@
return;
}
+=======
+ if (abs (yRoot - workArea.y () - ms->snapOffY) >= snapoffDistance &&
+ !s->otherGrabExist ("move", NULL))
+ {
+ int width = w->serverGeometry ().width ();
+
+ w->saveMask () |= CWX | CWY;
+
+ if (w->saveMask () & CWWidth)
+ width = w->saveWc ().width;
+
+ w->saveWc ().x = xRoot - (width >> 1);
+ w->saveWc ().y = yRoot + (w->border ().top >> 1);
+
+ ms->x = ms->y = 0;
+
+ w->maximize (0);
+
+ ms->snapOffY = ms->snapBackY;
+
+ return;
+ }
+ }
+ else if (ms->origState & CompWindowStateMaximizedVertMask &&
+ ms->optionGetSnapbackSemimaximized ())
+ {
+ if (abs (yRoot - workArea.y () - ms->snapBackY) < snapbackDistance &&
+ !s->otherGrabExist ("move", NULL))
+ {
+ w->maximize (ms->origState);
+ s->warpPointer (0, -snapbackDistance);
+
+ return;
+ }
+ }
+ else if (w->state () & CompWindowStateMaximizedHorzMask)
+ {
+ if (abs (xRoot - workArea.x () - ms->snapOffX) >= snapoffDistance &&
+ !s->otherGrabExist ("move", NULL))
+ {
+ int width = w->serverGeometry ().width ();
+
+ w->saveMask () |= CWX | CWY;
+
+ if (w->saveMask () & CWWidth)
+ width = w->saveWc ().width;
+
+ w->saveWc ().x = xRoot - (width >> 1);
+ w->saveWc ().y = yRoot + (w->border ().top >> 1);
+
+ ms->x = ms->y = 0;
+
+ w->maximize (0);
+
+ ms->snapOffX = ms->snapBackX;
+
+ return;
+ }
+ }
+ else if (ms->origState & CompWindowStateMaximizedHorzMask &&
+ ms->optionGetSnapbackSemimaximized ())
+ {
+ /* TODO: Snapping back horizontally just works for the left side
+ * of the screen for now
+ */
+ if (abs (xRoot - workArea.x () - ms->snapBackX) < snapbackDistance &&
+ !s->otherGrabExist ("move", NULL))
+ {
+ w->maximize (ms->origState);
+
+ /* TODO: Here we should warp the pointer back, but this somehow interrupts
+ * the horizontal maximizing, we should fix it and reenable this warp:
+ * s->warpPointer (workArea.width () / 2 - snapbackDistance, 0);
+ */
+
+ return;
+>>>>>>> MERGE-SOURCE
}
}
}
@@ -498,9 +623,15 @@
if (w->state () & CompWindowStateMaximizedHorzMask)
{
+<<<<<<< TREE
if (wX > (int) s->width () ||
wX + w->size ().width () < 0 ||
wX + wWidth < 0)
+=======
+ if (wX > (int) s->width () ||
+ wX + w->size ().width () < 0 ||
+ wX + wWidth < 0)
+>>>>>>> MERGE-SOURCE
return;
min = workArea.x () + w->border ().left;
@@ -531,20 +662,40 @@
{
case ButtonPress:
case ButtonRelease:
- if (event->xbutton.root == screen->root () &&
- grab &&
- (releaseButton == -1 ||
- releaseButton == (int) event->xbutton.button))
- moveTerminate (&optionGetInitiateButton (),
- CompAction::StateTermButton,
- noOptions ());
+<<<<<<< TREE
+ if (event->xbutton.root == screen->root () &&
+ grab &&
+ (releaseButton == -1 ||
+ releaseButton == (int) event->xbutton.button))
+ moveTerminate (&optionGetInitiateButton (),
+ CompAction::StateTermButton,
+ noOptions ());
+=======
+ if (event->xbutton.root == screen->root () &&
+ grab &&
+ (releaseButton == -1 ||
+ releaseButton == (int) event->xbutton.button))
+ moveTerminate (&optionGetInitiateButton (),
+ CompAction::StateTermButton,
+ noOptions ());
+
+>>>>>>> MERGE-SOURCE
break;
case KeyPress:
+<<<<<<< TREE
if (event->xkey.root == screen->root () &&
grab)
for (unsigned int i = 0; i < NUM_KEYS; i++)
if (event->xkey.keycode == key[i])
+=======
+ if (event->xkey.root == screen->root () &&
+ grab)
+ {
+ for (unsigned int i = 0; i < NUM_KEYS; ++i)
+ {
+ if (event->xkey.keycode == key[i])
+>>>>>>> MERGE-SOURCE
{
int moveIncrement = optionGetKeyMoveInc ();
@@ -554,6 +705,12 @@
mKeys[i].dy * moveIncrement);
break;
}
+<<<<<<< TREE
+=======
+ }
+ }
+
+>>>>>>> MERGE-SOURCE
break;
case MotionNotify:
@@ -579,8 +736,8 @@
if (type == WmMoveResizeMove ||
type == WmMoveResizeMoveKeyboard)
{
- CompWindow *w;
- w = screen->findWindow (event->xclient.window);
+ CompWindow *w = screen->findWindow (event->xclient.window);
+
if (w)
{
CompOption::Vector o;
@@ -628,6 +785,7 @@
CompAction::StateCancel, noOptions ());
}
}
+
break;
case DestroyNotify:
@@ -636,6 +794,7 @@
moveTerminate (&optionGetInitiateButton (), 0, noOptions ());
moveTerminate (&optionGetInitiateKey (), 0, noOptions ());
}
+
break;
case UnmapNotify:
@@ -644,8 +803,14 @@
moveTerminate (&optionGetInitiateButton (), 0, noOptions ());
moveTerminate (&optionGetInitiateKey (), 0, noOptions ());
}
- break;
-
+<<<<<<< TREE
+ break;
+
+=======
+
+ break;
+
+>>>>>>> MERGE-SOURCE
default:
break;
}
@@ -696,27 +861,27 @@
MoveScreen::MoveScreen (CompScreen *screen) :
PluginClassHandler (screen),
- cScreen (CompositeScreen::get (screen)),
- w (0),
- region (NULL),
- status (RectangleOut),
- releaseButton (0),
- grab (NULL),
+ cScreen (CompositeScreen::get (screen)),
+ w (0),
+ region (NULL),
+ status (RectangleOut),
+ releaseButton (0),
+ grab (NULL),
hasCompositing (false),
- yConstrained (false)
+ yConstrained (false)
{
updateOpacity ();
- for (unsigned int i = 0; i < NUM_KEYS; i++)
+ for (unsigned int i = 0; i < NUM_KEYS; ++i)
key[i] = XKeysymToKeycode (screen->dpy (),
XStringToKeysym (mKeys[i].name));
moveCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
+
if (cScreen)
{
CompositeScreenInterface::setHandler (cScreen);
- hasCompositing =
- cScreen->compositingActive ();
+ hasCompositing = cScreen->compositingActive ();
}
optionSetOpacityNotify (boost::bind (&MoveScreen::updateOpacity, this));
=== modified file 'plugins/move/src/move.h'
--- plugins/move/src/move.h 2013-04-13 21:59:11 +0000
+++ plugins/move/src/move.h 2013-07-21 23:03:28 +0000
@@ -58,7 +58,7 @@
MoveScreen (CompScreen *screen);
~MoveScreen ();
- CompositeScreen *cScreen;
+ CompositeScreen *cScreen;
void updateOpacity ();
@@ -67,21 +67,22 @@
bool registerPaintHandler (compiz::composite::PaintHandler *pHnd);
void unregisterPaintHandler ();
- CompWindow *w;
- int savedX;
- int savedY;
- int x;
- int y;
- Region region;
- int status;
- KeyCode key[NUM_KEYS];
-
- int releaseButton;
-
- GLushort moveOpacity;
+ CompWindow *w;
+ int savedX;
+ int savedY;
+ int x;
+ int y;
+ Region region;
+ int status;
+ KeyCode key[NUM_KEYS];
+
+ int releaseButton;
+
+ GLushort moveOpacity;
CompScreen::GrabHandle grab;
+<<<<<<< TREE
Cursor moveCursor;
unsigned int origState;
@@ -95,6 +96,21 @@
bool hasCompositing;
bool yConstrained;
+=======
+ Cursor moveCursor;
+
+ unsigned int origState;
+
+ int snapOffX;
+ int snapBackX;
+
+ int snapOffY;
+ int snapBackY;
+
+ bool hasCompositing;
+
+ bool yConstrained;
+>>>>>>> MERGE-SOURCE
};
class MoveWindow :
@@ -102,6 +118,7 @@
public PluginClassHandler
{
public:
+
MoveWindow (CompWindow *window) :
PluginClassHandler (window),
window (window),
@@ -112,12 +129,14 @@
GLWindowInterface::setHandler (gWindow, false);
};
- bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
- const CompRegion &, unsigned int);
+ bool glPaint (const GLWindowPaintAttrib &,
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
- CompWindow *window;
- GLWindow *gWindow;
- CompositeWindow *cWindow;
+ CompWindow *window;
+ GLWindow *gWindow;
+ CompositeWindow *cWindow;
compiz::window::configure_buffers::Releasable::Ptr releasable;
};
@@ -135,4 +154,3 @@
bool init ();
};
-
=== modified file 'plugins/neg/src/neg.cpp'
--- plugins/neg/src/neg.cpp 2013-05-09 13:43:07 +0000
+++ plugins/neg/src/neg.cpp 2013-07-21 23:03:28 +0000
@@ -67,11 +67,9 @@
}
else
{
- Window xid;
- CompWindow *w;
+ Window xid = CompOption::getIntOptionNamed (options, "window");
+ CompWindow *w = screen->findWindow (xid);
- xid = CompOption::getIntOptionNamed (options, "window");
- w = screen->findWindow (xid);
if (w)
NegWindow::get (w)->toggle ();
}
@@ -80,13 +78,13 @@
}
void
-NegWindow::glDrawTexture (GLTexture *texture,
- const GLMatrix &transform,
- const GLWindowPaintAttrib &attrib,
- unsigned int mask)
+NegWindow::glDrawTexture (GLTexture *texture,
+ const GLMatrix &transform,
+ const GLWindowPaintAttrib &attrib,
+ unsigned int mask)
{
- bool doNeg = false;
- GLTexture *tex = NULL;
+ bool doNeg = false;
+ GLTexture *tex = NULL;
NEG_SCREEN (screen);
@@ -100,7 +98,7 @@
else
{
doNeg = false;
- for (unsigned int i = 0; i < gWindow->textures ().size (); i++)
+ for (unsigned int i = 0; i < gWindow->textures ().size (); ++i)
{
tex = gWindow->textures ()[i];
doNeg = (texture->name () == tex->name ());
@@ -260,8 +258,8 @@
texture->disable ();
/* set texture mode back to replace */
- glTexEnvi (GL_TEXTURE_ENV,
- GL_TEXTURE_ENV_MODE, GL_REPLACE);
+// glTexEnvi (GL_TEXTURE_ENV,
+// GL_TEXTURE_ENV_MODE, GL_REPLACE);
/* re-activate last texture */
GL::activeTexture (GL_TEXTURE2_ARB);
@@ -269,15 +267,14 @@
else
{
/* fully opaque and bright */
-
gWindow->glDrawTexture (texture, transform, attrib, mask);
}
/* disable the current texture */
texture->disable ();
- /* set the texture mode back to replace */
- glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ /* set the texture mode back to replace */
+// glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
/* re-activate last texture */
GL::activeTexture (GL_TEXTURE1_ARB);
@@ -298,11 +295,11 @@
constant[3] * attrib.brightness / 65535.0f;
constant[0] =
- 0.5f + 0.5f * RED_SATURATION_WEIGHT * constant[0];
+ 0.5f + 0.5f * RED_SATURATION_WEIGHT * constant[0];
constant[1] =
0.5f + 0.5f * GREEN_SATURATION_WEIGHT * constant[1];
constant[2] =
- 0.5f + 0.5f * BLUE_SATURATION_WEIGHT * constant[2];
+ 0.5f + 0.5f * BLUE_SATURATION_WEIGHT * constant[2];
glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, constant);
@@ -313,7 +310,7 @@
texture->disable ();
/* set the texture mode back to replace */
- glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+// glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
/* re-activate last texture */
GL::activeTexture (GL_TEXTURE0_ARB);
@@ -421,12 +418,15 @@
}
}
break;
+
case NegOptions::NegDecorations:
{
foreach (CompWindow *w, screen->windows ())
if (NegWindow::get (w)->isNeg)
NegWindow::get (w)->cWindow->addDamage ();
}
+ break;
+
default:
break;
}
@@ -455,7 +455,6 @@
_1, _2));
}
-
NegWindow::NegWindow (CompWindow *window) :
PluginClassHandler (window),
=== modified file 'plugins/opengl/include/opengl/doublebuffer.h'
--- plugins/opengl/include/opengl/doublebuffer.h 2012-11-08 09:17:39 +0000
+++ plugins/opengl/include/opengl/doublebuffer.h 2013-07-21 23:03:28 +0000
@@ -18,16 +18,17 @@
class DoubleBuffer
{
public:
+
DoubleBuffer (const impl::GLXSwapIntervalEXTFunc &swapIntervalFunc,
const impl::GLXWaitVideoSyncSGIFunc &waitVideoSyncFunc);
virtual ~DoubleBuffer ();
- virtual void swap () const = 0;
- virtual bool blitAvailable () const = 0;
- virtual void blit (const CompRegion ®ion) const = 0;
- virtual bool fallbackBlitAvailable () const = 0;
+ virtual void swap () const = 0;
+ virtual bool blitAvailable () const = 0;
+ virtual void blit (const CompRegion ®ion) const = 0;
+ virtual bool fallbackBlitAvailable () const = 0;
virtual void fallbackBlit (const CompRegion ®ion) const = 0;
- virtual void copyFrontToBack () const = 0;
+ virtual void copyFrontToBack () const = 0;
typedef enum
{
@@ -56,13 +57,18 @@
FrameThrottledInternally
} FrameThrottleState;
- void set (Setting name, bool value);
- void render (const CompRegion ®ion, bool fullscreen);
+ void set (Setting name,
+ bool value);
+
+ void render (const CompRegion ®ion,
+ bool fullscreen);
+
void vsync (FrontbufferRedrawType redrawType);
bool hardwareVSyncFunctional ();
protected:
+
bool setting[_NSETTINGS];
private:
@@ -72,7 +78,7 @@
virtual bool enableBlockingVideoSync (FrontbufferRedrawType, FrameThrottleState &);
virtual void disableBlockingVideoSync ();
- SyncType syncType;
+ SyncType syncType;
FrameThrottleState bufferFrameThrottleState;
unsigned int blockingVSyncUnthrottledFrames;
=== modified file 'plugins/opengl/include/opengl/opengl.h'
--- plugins/opengl/include/opengl/opengl.h 2013-04-27 05:54:57 +0000
+++ plugins/opengl/include/opengl/opengl.h 2013-07-21 23:03:28 +0000
@@ -87,77 +87,79 @@
class PrivateGLScreen;
class PrivateGLWindow;
-extern GLushort defaultColor[4];
+extern GLushort defaultColor[4];
#ifndef GLX_EXT_texture_from_pixmap
-#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
-#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
-#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
-#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
-#define GLX_Y_INVERTED_EXT 0x20D4
-#define GLX_TEXTURE_FORMAT_EXT 0x20D5
-#define GLX_TEXTURE_TARGET_EXT 0x20D6
-#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
-#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
-#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
-#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
-#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
-#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
-#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
-#define GLX_TEXTURE_1D_EXT 0x20DB
-#define GLX_TEXTURE_2D_EXT 0x20DC
-#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
-#define GLX_FRONT_LEFT_EXT 0x20DE
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+#define GLX_TEXTURE_FORMAT_EXT 0x20D5
+#define GLX_TEXTURE_TARGET_EXT 0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
+#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+#define GLX_TEXTURE_1D_EXT 0x20DB
+#define GLX_TEXTURE_2D_EXT 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
+#define GLX_FRONT_LEFT_EXT 0x20DE
#endif
-namespace GL {
+namespace GL
+{
#ifdef USE_GLES
- typedef EGLImageKHR (*EGLCreateImageKHRProc) (EGLDisplay dpy,
- EGLContext ctx,
- EGLenum target,
- EGLClientBuffer buffer,
- const EGLint *attrib_list);
- typedef EGLBoolean (*EGLDestroyImageKHRProc) (EGLDisplay dpy,
- EGLImageKHR image);
-
- typedef void (*GLEGLImageTargetTexture2DOESProc) (GLenum target,
- GLeglImageOES image);
-
- typedef EGLBoolean (*EGLPostSubBufferNVProc) (EGLDisplay dpy,
- EGLSurface surface,
- EGLint x, EGLint y,
- EGLint width, EGLint height);
-
+typedef EGLImageKHR (*EGLCreateImageKHRProc) (EGLDisplay dpy,
+ EGLContext ctx,
+ EGLenum target,
+ EGLClientBuffer buffer,
+ const EGLint *attrib_list);
+
+typedef EGLBoolean (*EGLDestroyImageKHRProc) (EGLDisplay dpy,
+ EGLImageKHR image);
+
+typedef void (*GLEGLImageTargetTexture2DOESProc) (GLenum target,
+ GLeglImageOES image);
+
+typedef EGLBoolean (*EGLPostSubBufferNVProc) (EGLDisplay dpy,
+ EGLSurface surface,
+ EGLint x,
+ EGLint y,
+ EGLint width,
+ EGLint height);
#else
typedef void (*FuncPtr) (void);
typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
- typedef void (*GLXBindTexImageProc) (Display *display,
- GLXDrawable drawable,
- int buffer,
- int *attribList);
- typedef void (*GLXReleaseTexImageProc) (Display *display,
- GLXDrawable drawable,
- int buffer);
- typedef void (*GLXQueryDrawableProc) (Display *display,
- GLXDrawable drawable,
- int attribute,
- unsigned int *value);
-
- typedef void (*GLXCopySubBufferProc) (Display *display,
- GLXDrawable drawable,
- int x,
- int y,
- int width,
- int height);
-
- typedef int (*GLXGetVideoSyncProc) (unsigned int *count);
- typedef int (*GLXWaitVideoSyncProc) (int divisor,
- int remainder,
- unsigned int *count);
- typedef int (*GLXSwapIntervalProc) (int interval);
-
+typedef void (*GLXBindTexImageProc) (Display *display,
+ GLXDrawable drawable,
+ int buffer,
+ int *attribList);
+typedef void (*GLXReleaseTexImageProc) (Display *display,
+ GLXDrawable drawable,
+ int buffer);
+typedef void (*GLXQueryDrawableProc) (Display *display,
+ GLXDrawable drawable,
+ int attribute,
+ unsigned int *value);
+
+typedef void (*GLXCopySubBufferProc) (Display *display,
+ GLXDrawable drawable,
+ int x,
+ int y,
+ int width,
+ int height);
+
+typedef int (*GLXGetVideoSyncProc) (unsigned int *count);
+typedef int (*GLXWaitVideoSyncProc) (int divisor,
+ int remainder,
+ unsigned int *count);
+typedef int (*GLXSwapIntervalProc) (int interval);
#ifndef GLX_VERSION_1_3
typedef struct __GLXFBConfigRec *GLXFBConfig;
@@ -413,77 +415,85 @@
extern GLDisableVertexAttribArrayProc disableVertexAttribArray;
extern GLVertexAttribPointerProc vertexAttribPointer;
- extern GLGenRenderbuffersProc genRenderbuffers;
- extern GLDeleteRenderbuffersProc deleteRenderbuffers;
- extern GLBindRenderbufferProc bindRenderbuffer;
+ extern GLGenRenderbuffersProc genRenderbuffers;
+ extern GLDeleteRenderbuffersProc deleteRenderbuffers;
+ extern GLBindRenderbufferProc bindRenderbuffer;
extern GLFramebufferRenderbufferProc framebufferRenderbuffer;
- extern GLRenderbufferStorageProc renderbufferStorage;
+ extern GLRenderbufferStorageProc renderbufferStorage;
#ifndef USE_GLES
- extern GLCreateShaderObjectARBProc createShaderObjectARB;
+ extern GLCreateShaderObjectARBProc createShaderObjectARB;
extern GLCreateProgramObjectARBProc createProgramObjectARB;
- extern GLShaderSourceARBProc shaderSourceARB;
- extern GLCompileShaderARBProc compileShaderARB;
- extern GLValidateProgramARBProc validateProgramARB;
- extern GLDeleteObjectARBProc deleteObjectARB;
- extern GLAttachObjectARBProc attachObjectARB;
- extern GLLinkProgramARBProc linkProgramARB;
- extern GLUseProgramObjectARBProc useProgramObjectARB;
- extern GLGetUniformLocationARBProc getUniformLocationARB;
- extern GLGetAttribLocationARBProc getAttribLocationARB;
+ extern GLShaderSourceARBProc shaderSourceARB;
+ extern GLCompileShaderARBProc compileShaderARB;
+ extern GLValidateProgramARBProc validateProgramARB;
+ extern GLDeleteObjectARBProc deleteObjectARB;
+ extern GLAttachObjectARBProc attachObjectARB;
+ extern GLLinkProgramARBProc linkProgramARB;
+ extern GLUseProgramObjectARBProc useProgramObjectARB;
+ extern GLGetUniformLocationARBProc getUniformLocationARB;
+ extern GLGetAttribLocationARBProc getAttribLocationARB;
extern GLGetObjectParameterivProc getObjectParameteriv;
- extern GLGetInfoLogProc getInfoLog;
+ extern GLGetInfoLogProc getInfoLog;
#endif
#ifdef USE_GLES
static const GLenum FRAMEBUFFER_BINDING = GL_FRAMEBUFFER_BINDING;
- static const GLenum FRAMEBUFFER = GL_FRAMEBUFFER;
- static const GLenum RENDERBUFFER = GL_RENDERBUFFER;
- static const GLenum COLOR_ATTACHMENT0 = GL_COLOR_ATTACHMENT0;
- static const GLenum DEPTH_ATTACHMENT = GL_DEPTH_ATTACHMENT;
- static const GLenum STENCIL_ATTACHMENT = GL_STENCIL_ATTACHMENT;
- static const GLenum DEPTH24_STENCIL8 = GL_DEPTH24_STENCIL8_OES;
+ static const GLenum FRAMEBUFFER = GL_FRAMEBUFFER;
+ static const GLenum RENDERBUFFER = GL_RENDERBUFFER;
+ static const GLenum COLOR_ATTACHMENT0 = GL_COLOR_ATTACHMENT0;
+ static const GLenum DEPTH_ATTACHMENT = GL_DEPTH_ATTACHMENT;
+ static const GLenum STENCIL_ATTACHMENT = GL_STENCIL_ATTACHMENT;
+ static const GLenum DEPTH24_STENCIL8 = GL_DEPTH24_STENCIL8_OES;
/* OpenGL|ES does not support different draw/read framebuffers */
+<<<<<<< TREE
static const GLenum DRAW_FRAMEBUFFER = GL_FRAMEBUFFER;
static const GLenum READ_FRAMEBUFFER = GL_FRAMEBUFFER;
static const GLenum DRAW_FRAMEBUFFER_BINDING = FRAMEBUFFER_BINDING;
static const GLenum READ_FRAMEBUFFER_BINDING = FRAMEBUFFER_BINDING;
+=======
+ static const GLenum DRAW_FRAMEBUFFER = GL_FRAMEBUFFER;
+ static const GLenum READ_FRAMEBUFFER = GL_FRAMEBUFFER;
+ static const GLenum DRAW_FRAMEBUFFER_BINDING = FRAMEBUFFER_BINDING;
+ static const GLenum READ_FRAMEBUFFER_BINDING = FRAMEBUFFER_BINDING;
+>>>>>>> MERGE-SOURCE
- static const GLenum FRAMEBUFFER_COMPLETE = GL_FRAMEBUFFER_COMPLETE;
- static const GLenum FRAMEBUFFER_UNDEFINED = 0;
- static const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+ static const GLenum FRAMEBUFFER_COMPLETE = GL_FRAMEBUFFER_COMPLETE;
+ static const GLenum FRAMEBUFFER_UNDEFINED = 0;
+ static const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
static const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
- static const GLenum FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0;
- static const GLenum FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0;
- static const GLenum FRAMEBUFFER_UNSUPPORTED = GL_FRAMEBUFFER_UNSUPPORTED;
- static const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0;
- static const GLenum FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0;
- static const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS;
+ static const GLenum FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0;
+ static const GLenum FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0;
+ static const GLenum FRAMEBUFFER_UNSUPPORTED = GL_FRAMEBUFFER_UNSUPPORTED;
+ static const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0;
+ static const GLenum FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0;
+ static const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS;
static const GLenum ARRAY_BUFFER = GL_ARRAY_BUFFER;
- static const GLenum STATIC_DRAW = GL_STATIC_DRAW;
- static const GLenum STREAM_DRAW = GL_STREAM_DRAW;
+ static const GLenum STATIC_DRAW = GL_STATIC_DRAW;
+ static const GLenum STREAM_DRAW = GL_STREAM_DRAW;
static const GLenum DYNAMIC_DRAW = GL_DYNAMIC_DRAW;
static const GLenum INFO_LOG_LENGTH = GL_INFO_LOG_LENGTH;
- static const GLenum COMPILE_STATUS = GL_COMPILE_STATUS;
- static const GLenum LINK_STATUS = GL_LINK_STATUS;
+ static const GLenum COMPILE_STATUS = GL_COMPILE_STATUS;
+ static const GLenum LINK_STATUS = GL_LINK_STATUS;
static const GLenum FRAGMENT_SHADER = GL_FRAGMENT_SHADER;
- static const GLenum VERTEX_SHADER = GL_VERTEX_SHADER;
+ static const GLenum VERTEX_SHADER = GL_VERTEX_SHADER;
#else
static const GLenum FRAMEBUFFER_BINDING = GL_FRAMEBUFFER_BINDING_EXT;
- static const GLenum FRAMEBUFFER = GL_FRAMEBUFFER_EXT;
- static const GLenum RENDERBUFFER = GL_RENDERBUFFER;
- static const GLenum COLOR_ATTACHMENT0 = GL_COLOR_ATTACHMENT0_EXT;
- static const GLenum DEPTH_ATTACHMENT = GL_DEPTH_ATTACHMENT_EXT;
- static const GLenum STENCIL_ATTACHMENT = GL_STENCIL_ATTACHMENT_EXT;
- static const GLenum DEPTH24_STENCIL8 = GL_DEPTH24_STENCIL8_EXT;
+ static const GLenum FRAMEBUFFER = GL_FRAMEBUFFER_EXT;
+ static const GLenum RENDERBUFFER = GL_RENDERBUFFER;
+ static const GLenum COLOR_ATTACHMENT0 = GL_COLOR_ATTACHMENT0_EXT;
+ static const GLenum DEPTH_ATTACHMENT = GL_DEPTH_ATTACHMENT_EXT;
+ static const GLenum STENCIL_ATTACHMENT = GL_STENCIL_ATTACHMENT_EXT;
+ static const GLenum DEPTH24_STENCIL8 = GL_DEPTH24_STENCIL8_EXT;
+<<<<<<< TREE
static const GLenum DRAW_FRAMEBUFFER = GL_DRAW_FRAMEBUFFER_EXT;
static const GLenum READ_FRAMEBUFFER = GL_READ_FRAMEBUFFER_EXT;
static const GLenum DRAW_FRAMEBUFFER_BINDING = GL_DRAW_FRAMEBUFFER_BINDING_EXT;
@@ -491,24 +501,33 @@
static const GLenum FRAMEBUFFER_COMPLETE = GL_FRAMEBUFFER_COMPLETE_EXT;
static const GLenum FRAMEBUFFER_UNDEFINED = GL_FRAMEBUFFER_UNDEFINED;
static const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT;
+=======
+ static const GLenum DRAW_FRAMEBUFFER = GL_DRAW_FRAMEBUFFER_EXT;
+ static const GLenum READ_FRAMEBUFFER = GL_READ_FRAMEBUFFER_EXT;
+ static const GLenum DRAW_FRAMEBUFFER_BINDING = GL_DRAW_FRAMEBUFFER_BINDING_EXT;
+ static const GLenum READ_FRAMEBUFFER_BINDING = GL_READ_FRAMEBUFFER_BINDING_EXT;
+ static const GLenum FRAMEBUFFER_COMPLETE = GL_FRAMEBUFFER_COMPLETE_EXT;
+ static const GLenum FRAMEBUFFER_UNDEFINED = GL_FRAMEBUFFER_UNDEFINED;
+ static const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT;
+>>>>>>> MERGE-SOURCE
static const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT;
- static const GLenum FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT;
- static const GLenum FRAMEBUFFER_INCOMPLETE_READ_BUFFER = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT;
- static const GLenum FRAMEBUFFER_UNSUPPORTED = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
- static const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT;
- static const GLenum FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT;
- static const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0;
+ static const GLenum FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT;
+ static const GLenum FRAMEBUFFER_INCOMPLETE_READ_BUFFER = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT;
+ static const GLenum FRAMEBUFFER_UNSUPPORTED = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ static const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT;
+ static const GLenum FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT;
+ static const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0;
static const GLenum ARRAY_BUFFER = GL_ARRAY_BUFFER_ARB;
- static const GLenum STATIC_DRAW = GL_STATIC_DRAW_ARB;
- static const GLenum STREAM_DRAW = GL_STREAM_DRAW_ARB;
+ static const GLenum STATIC_DRAW = GL_STATIC_DRAW_ARB;
+ static const GLenum STREAM_DRAW = GL_STREAM_DRAW_ARB;
static const GLenum DYNAMIC_DRAW = GL_DYNAMIC_DRAW_ARB;
static const GLenum INFO_LOG_LENGTH = GL_OBJECT_INFO_LOG_LENGTH_ARB;
- static const GLenum COMPILE_STATUS = GL_OBJECT_COMPILE_STATUS_ARB;
- static const GLenum LINK_STATUS = GL_OBJECT_LINK_STATUS_ARB;
+ static const GLenum COMPILE_STATUS = GL_OBJECT_COMPILE_STATUS_ARB;
+ static const GLenum LINK_STATUS = GL_OBJECT_LINK_STATUS_ARB;
static const GLenum FRAGMENT_SHADER = GL_FRAGMENT_SHADER_ARB;
- static const GLenum VERTEX_SHADER = GL_VERTEX_SHADER_ARB;
+ static const GLenum VERTEX_SHADER = GL_VERTEX_SHADER_ARB;
#endif
@@ -553,7 +572,8 @@
#endif
};
-struct GLScreenPaintAttrib {
+struct GLScreenPaintAttrib
+{
GLfloat xRotate;
GLfloat yRotate;
GLfloat vRotate;
@@ -566,7 +586,8 @@
#define MAX_DEPTH 32
#ifndef USE_GLES
-struct GLFBConfig {
+struct GLFBConfig
+{
GLXFBConfig fbConfig;
int yInverted;
int mipmap;
@@ -647,9 +668,9 @@
CompOutput *output,
GLMatrix *mask);
- virtual void glEnableOutputClipping (const GLMatrix &,
+ virtual void glEnableOutputClipping (const GLMatrix &,
const CompRegion &,
- CompOutput *);
+ CompOutput *);
virtual void glDisableOutputClipping ();
virtual GLMatrix *projectionMatrix ();
@@ -669,9 +690,9 @@
/**
* Hookable function used by plugins to determine stenciling mask
*/
- virtual void glBufferStencil (const GLMatrix &matrix,
- GLVertexBuffer &vertexBuffer,
- CompOutput *output);
+ virtual void glBufferStencil (const GLMatrix &matrix,
+ GLVertexBuffer &vertexBuffer,
+ CompOutput *output);
};
@@ -925,7 +946,7 @@
const GLTexture::List & textures () const;
/**
- * Returns the matrices for the tiled textures for this windwo
+ * Returns the matrices for the tiled textures for this window
*/
const GLTexture::MatrixList & matrices () const;
@@ -971,4 +992,3 @@
};
#endif
-
=== modified file 'plugins/opengl/include/opengl/program.h'
--- plugins/opengl/include/opengl/program.h 2012-05-17 10:41:21 +0000
+++ plugins/opengl/include/opengl/program.h 2013-07-21 23:03:28 +0000
@@ -40,6 +40,7 @@
class GLProgram
{
public:
+
GLProgram (CompString &vertexShader, CompString &fragmentShader);
~GLProgram ();
@@ -47,29 +48,50 @@
void bind ();
void unbind ();
- bool setUniform (const char *name, GLfloat value);
- bool setUniform (const char *name, GLint value);
- bool setUniform (const char *name, const GLMatrix &value);
- bool setUniform2f (const char *name, GLfloat x, GLfloat y);
- bool setUniform3f (const char *name, GLfloat x, GLfloat y, GLfloat z);
+ bool setUniform (const char *name,
+ GLfloat value);
+
+ bool setUniform (const char *name,
+ GLint value);
+
+ bool setUniform (const char *name,
+ const GLMatrix &value);
+
+ bool setUniform2f (const char *name,
+ GLfloat x,
+ GLfloat y);
+
+ bool setUniform3f (const char *name,
+ GLfloat x,
+ GLfloat y,
+ GLfloat z);
+
bool setUniform4f (const char *name,
- GLfloat x,
- GLfloat y,
- GLfloat z,
- GLfloat w);
- bool setUniform2i (const char *name, GLint x, GLint y);
- bool setUniform3i (const char *name, GLint x, GLint y, GLint z);
+ GLfloat x,
+ GLfloat y,
+ GLfloat z,
+ GLfloat w);
+
+ bool setUniform2i (const char *name,
+ GLint x,
+ GLint y);
+
+ bool setUniform3i (const char *name,
+ GLint x,
+ GLint y,
+ GLint z);
+
bool setUniform4i (const char *name,
- GLint x,
- GLint y,
- GLint z,
- GLint w);
+ GLint x,
+ GLint y,
+ GLint z,
+ GLint w);
GLuint attributeLocation (const char *name);
private:
+
PrivateProgram *priv;
};
#endif // _COMPIZ_GLPROGRAM_H
-
=== modified file 'plugins/opengl/include/opengl/programcache.h'
--- plugins/opengl/include/opengl/programcache.h 2012-05-17 10:41:21 +0000
+++ plugins/opengl/include/opengl/programcache.h 2013-07-21 23:03:28 +0000
@@ -38,9 +38,11 @@
class GLProgramCache
{
private:
+
PrivateProgramCache *priv;
public:
+
GLProgramCache (size_t);
~GLProgramCache ();
@@ -48,4 +50,3 @@
};
#endif // _COMPIZ_GLPROGRAMCACHE_H
-
=== modified file 'plugins/opengl/include/opengl/texture.h'
--- plugins/opengl/include/opengl/texture.h 2012-09-18 11:32:20 +0000
+++ plugins/opengl/include/opengl/texture.h 2013-07-21 23:03:28 +0000
@@ -73,15 +73,18 @@
/**
* Class which represents an openGL texture
*/
-class GLTexture : public CompRect {
+class GLTexture : public CompRect
+{
public:
- typedef enum {
+ typedef enum
+ {
Fast,
Good
} Filter;
- typedef struct {
+ typedef struct
+ {
float xx; float yx;
float xy; float yy;
float x0; float y0;
@@ -93,9 +96,10 @@
* Class which represents a list of openGL textures,
* usually used for texture tiling
*/
- class List : public std::vector {
-
+ class List : public std::vector
+ {
public:
+
List ();
List (unsigned int);
List (const List &);
@@ -224,12 +228,14 @@
friend class PrivateTexture;
protected:
+
GLTexture ();
virtual ~GLTexture ();
void setData (GLenum target, Matrix &m, bool mipmap);
private:
+
PrivateTexture *priv;
};
=== modified file 'plugins/opengl/include/opengl/vector.h'
--- plugins/opengl/include/opengl/vector.h 2012-05-17 10:41:21 +0000
+++ plugins/opengl/include/opengl/vector.h 2013-07-21 23:03:28 +0000
@@ -30,9 +30,12 @@
* Class which describes a point or vector
* in 3D space
*/
-class GLVector {
+class GLVector
+{
public:
- typedef enum {
+
+ typedef enum
+ {
x,
y,
z,
@@ -105,6 +108,7 @@
GLVector& homogenize ();
private:
+
friend GLVector operator+ (const GLVector& lhs,
const GLVector& rhs);
friend GLVector operator- (const GLVector& lhs,
=== modified file 'plugins/opengl/src/blacklist/blacklist.cpp'
--- plugins/opengl/src/blacklist/blacklist.cpp 2012-12-12 07:24:34 +0000
+++ plugins/opengl/src/blacklist/blacklist.cpp 2013-07-21 23:03:28 +0000
@@ -30,8 +30,10 @@
namespace compiz {
namespace opengl {
-bool blacklisted (const char *blacklistRegex, const char *glVendor,
- const char *glRenderer, const char *glVersion)
+bool blacklisted (const char *blacklistRegex,
+ const char *glVendor,
+ const char *glRenderer,
+ const char *glVersion)
{
bool matches = false;
@@ -42,16 +44,16 @@
// Ensure the regex contains something other than spaces, or ignore.
const char *p = blacklistRegex;
while (*p == ' ')
- p++;
+ ++p;
if (*p && !regcomp (&re, blacklistRegex, REG_EXTENDED))
{
char driver[1024];
snprintf (driver, sizeof driver, "%s\n%s\n%s",
- glVendor ? glVendor : "",
- glRenderer ? glRenderer : "",
- glVersion ? glVersion : "");
+ glVendor ? glVendor : "",
+ glRenderer ? glRenderer : "",
+ glVersion ? glVersion : "");
if (!regexec (&re, driver, 0, NULL, 0))
matches = true;
=== modified file 'plugins/opengl/src/blacklist/blacklist.h'
--- plugins/opengl/src/blacklist/blacklist.h 2012-12-12 07:24:34 +0000
+++ plugins/opengl/src/blacklist/blacklist.h 2013-07-21 23:03:28 +0000
@@ -29,8 +29,10 @@
namespace compiz {
namespace opengl {
-bool blacklisted (const char *blacklistRegex, const char *glVendor,
- const char *glRenderer, const char *glVersion);
+bool blacklisted (const char *blacklistRegex,
+ const char *glVendor,
+ const char *glRenderer,
+ const char *glVersion);
} // namespace opengl
} // namespace compiz
=== modified file 'plugins/opengl/src/doublebuffer/src/double-buffer.cpp'
--- plugins/opengl/src/doublebuffer/src/double-buffer.cpp 2012-11-09 06:13:00 +0000
+++ plugins/opengl/src/doublebuffer/src/double-buffer.cpp 2013-07-21 23:03:28 +0000
@@ -66,7 +66,7 @@
void
DoubleBuffer::render (const CompRegion ®ion,
- bool fullscreen)
+ bool fullscreen)
{
if (fullscreen)
{
@@ -77,9 +77,7 @@
if (setting[NEED_PERSISTENT_BACK_BUFFER] &&
!setting[HAVE_PERSISTENT_BACK_BUFFER])
- {
copyFrontToBack ();
- }
}
else
{
@@ -124,7 +122,7 @@
/* Accumulate throttle */
if (throttleState == ExternalFrameThrottlingRequired)
- blockingVSyncUnthrottledFrames++;
+ ++blockingVSyncUnthrottledFrames;
else
blockingVSyncUnthrottledFrames = 0;
=== modified file 'plugins/opengl/src/framebufferobject.cpp'
--- plugins/opengl/src/framebufferobject.cpp 2012-08-06 09:44:49 +0000
+++ plugins/opengl/src/framebufferobject.cpp 2013-07-21 23:03:28 +0000
@@ -32,6 +32,7 @@
PrivateGLFramebufferObject () :
fboId (0),
pushedId (0),
+ rbStencilId (0),
glTex (NULL),
status (-1)
{
@@ -40,14 +41,14 @@
void pushFBO ();
void popFBO ();
- GLuint fboId;
- GLuint pushedId;
- GLuint rbStencilId;
- GLTexture *glTex;
-
- GLint status;
-
- static GLuint boundId;
+ GLuint fboId;
+ GLuint pushedId;
+ GLuint rbStencilId;
+ GLTexture *glTex;
+
+ GLint status;
+
+ static GLuint boundId;
static std::map idMap;
};
@@ -58,6 +59,7 @@
PrivateGLFramebufferObject::pushFBO ()
{
pushedId = boundId;
+
if (boundId != fboId)
{
(*GL::bindFramebuffer) (GL::FRAMEBUFFER, fboId);
@@ -94,22 +96,24 @@
(*GL::deleteFramebuffers) (1, &priv->fboId);
(*GL::deleteRenderbuffers) (1, &priv->rbStencilId);
-
delete priv;
}
bool
-GLFramebufferObject::allocate (const CompSize &size, const char *image,
- GLenum format, GLenum type)
+GLFramebufferObject::allocate (const CompSize &size,
+ const char *image,
+ GLenum format,
+ GLenum type)
{
priv->status = -1;
- if (!priv->glTex ||
- size.width () != priv->glTex->width () ||
- size.height () != priv->glTex->height ())
+ if (!priv->glTex ||
+ size.width () != priv->glTex->width () ||
+ size.height () != priv->glTex->height ())
{
if (priv->glTex)
GLTexture::decRef (priv->glTex);
+
priv->glTex = NULL;
GLTexture::List list = GLTexture::imageDataToTexture (image, size,
@@ -130,12 +134,12 @@
priv->pushFBO ();
(*GL::framebufferTexture2D) (GL::FRAMEBUFFER, GL::COLOR_ATTACHMENT0,
- priv->glTex->target (),
- priv->glTex->name (), 0);
+ priv->glTex->target (),
+ priv->glTex->name (), 0);
priv->status = (*GL::checkFramebufferStatus) (GL::DRAW_FRAMEBUFFER);
+ priv->popFBO ();
- priv->popFBO ();
return true;
}
@@ -146,8 +150,8 @@
if (priv->boundId != 0)
{
- std::map::iterator it;
- it = PrivateGLFramebufferObject::idMap.find (priv->boundId);
+ std::map::iterator it =
+ PrivateGLFramebufferObject::idMap.find (priv->boundId);
if (it != PrivateGLFramebufferObject::idMap.end ())
old = it->second;
@@ -209,8 +213,9 @@
return true;
compLogMessage ("opengl", CompLogLevelError,
- "FBO is incomplete: %s (0x%04x)",
- getFboErrorString (priv->status), priv->status);
+ "FBO is incomplete: %s (0x%04x)",
+ getFboErrorString (priv->status), priv->status);
+
return false;
}
=== modified file 'plugins/opengl/src/fsregion/fsregion.cpp'
--- plugins/opengl/src/fsregion/fsregion.cpp 2013-05-08 15:04:46 +0000
+++ plugins/opengl/src/fsregion/fsregion.cpp 2013-07-21 23:03:28 +0000
@@ -29,16 +29,16 @@
namespace opengl {
FullscreenRegion::FullscreenRegion (const CompRect &output) :
- untouched (output),
- orig (output),
+ untouched (output),
+ orig (output),
allOutputs (output)
{
}
-FullscreenRegion::FullscreenRegion (const CompRect &output,
- const CompRegion &all) :
- untouched (output),
- orig (output),
+FullscreenRegion::FullscreenRegion (const CompRect &output,
+ const CompRegion &all) :
+ untouched (output),
+ orig (output),
allOutputs (all)
{
}
@@ -48,12 +48,17 @@
{
bool fullscreen = false;
+<<<<<<< TREE
if (!(flags & (Desktop | Alpha | NoOcclusionDetection)) &&
region == untouched &&
region == orig)
{
+=======
+ if (!(flags & (Desktop | Alpha)) &&
+ region == untouched &&
+ region == orig)
+>>>>>>> MERGE-SOURCE
fullscreen = true;
- }
untouched -= region;
=== modified file 'plugins/opengl/src/fsregion/fsregion.h'
--- plugins/opengl/src/fsregion/fsregion.h 2013-05-08 15:04:46 +0000
+++ plugins/opengl/src/fsregion/fsregion.h 2013-07-21 23:03:28 +0000
@@ -34,23 +34,31 @@
class FullscreenRegion
{
public:
+
typedef enum
{
Desktop = 1,
+<<<<<<< TREE
Alpha = 2,
NoOcclusionDetection = 3
+=======
+ Alpha = 2
+>>>>>>> MERGE-SOURCE
} WinFlag;
typedef unsigned int WinFlags;
FullscreenRegion (const CompRect &output);
- FullscreenRegion (const CompRect &output, const CompRegion &all);
+ FullscreenRegion (const CompRect &output,
+ const CompRegion &all);
// isCoveredBy is called for windows from TOP to BOTTOM
- bool isCoveredBy (const CompRegion ®ion, WinFlags flags = 0);
+ bool isCoveredBy (const CompRegion ®ion,
+ WinFlags flags = 0);
bool allowRedirection (const CompRegion ®ion);
private:
+
CompRegion untouched;
CompRegion orig;
CompRegion allOutputs;
=== modified file 'plugins/opengl/src/matrix.cpp'
--- plugins/opengl/src/matrix.cpp 2012-12-04 15:28:56 +0000
+++ plugins/opengl/src/matrix.cpp 2013-07-21 23:03:28 +0000
@@ -59,7 +59,8 @@
/**
* Identity matrix.
*/
-static const float identity[16] = {
+static const float identity[16] =
+{
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
@@ -88,7 +89,7 @@
const float *a,
const float *b)
{
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
{
const float ai0 = A(i,0), ai1 = A(i,1), ai2 = A(i,2), ai3 = A(i,3);
@@ -144,10 +145,10 @@
operator* (const GLMatrix& lhs,
const GLVector& rhs)
{
- GLVector result;
+ GLVector result;
const float *a = lhs.m;
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
{
result[i] = A(i,0) * rhs[0] + A(i,1) * rhs[1] +
A(i,2) * rhs[2] + A(i,3) * rhs[3];
@@ -202,13 +203,14 @@
+ m[4]*m[2]*m[9] + m[8]*m[1]*m[6] - m[8]*m[2]*m[5];
det = m[0]*inv[0] + m[1]*inv[4] + m[2]*inv[8] + m[3]*inv[12];
+
if (det == 0)
- return false;
+ return false;
det = 1.0f / det;
- for (int i = 0; i < 16; i++)
- m[i] = inv[i] * det;
+ for (int i = 0; i < 16; ++i)
+ m[i] = inv[i] * det;
return true;
}
@@ -223,20 +225,18 @@
*/
void
GLMatrix::rotate (const float angle,
- const float xRot,
- const float yRot,
- const float zRot)
+ const float xRot,
+ const float yRot,
+ const float zRot)
{
float x = xRot, y = yRot, z = zRot;
- float s, c;
float matrix[16];
- bool optimized;
- s = (float) sin (angle * DEG2RAD);
- c = (float) cos (angle * DEG2RAD);
+ float s = (float) sin (angle * DEG2RAD);
+ float c = (float) cos (angle * DEG2RAD);
memcpy (matrix, identity, sizeof (matrix));
- optimized = false;
+ bool optimized = false;
#define M(row, col) matrix[col * 4 + row]
@@ -250,6 +250,7 @@
/* rotate only around z-axis */
M(0,0) = c;
M(1,1) = c;
+
if (z < 0.0f)
{
M(0,1) = s;
@@ -268,6 +269,7 @@
/* rotate only around y-axis */
M(0,0) = c;
M(2,2) = c;
+
if (y < 0.0f)
{
M(0,2) = -s;
@@ -288,6 +290,7 @@
/* rotate only around x-axis */
M(1,1) = c;
M(2,2) = c;
+
if (x < 0.0f)
{
M(1,2) = s;
@@ -316,7 +319,6 @@
y /= mag;
z /= mag;
-
/*
* Arbitrary axis rotation matrix.
*
@@ -410,8 +412,8 @@
}
void
-GLMatrix::rotate (const float angle,
- const GLVector& vector)
+GLMatrix::rotate (const float angle,
+ const GLVector& vector)
{
rotate (angle,
vector[GLVector::x],
@@ -431,8 +433,8 @@
*/
void
GLMatrix::scale (const float x,
- const float y,
- const float z)
+ const float y,
+ const float z)
{
m[0] *= x; m[4] *= y; m[8] *= z;
m[1] *= x; m[5] *= y; m[9] *= z;
@@ -460,8 +462,8 @@
*/
void
GLMatrix::translate (const float x,
- const float y,
- const float z)
+ const float y,
+ const float z)
{
m[12] = m[0] * x + m[4] * y + m[8] * z + m[12];
m[13] = m[1] * x + m[5] * y + m[9] * z + m[13];
=== modified file 'plugins/opengl/src/opengl.cpp'
--- plugins/opengl/src/opengl.cpp 2013-05-26 06:15:47 +0000
+++ plugins/opengl/src/opengl.cpp 2013-07-21 23:03:28 +0000
@@ -28,15 +28,15 @@
#include
#include "privates.h"
-const float DEFAULT_Z_CAMERA = 0.866025404f;
-
-const float RED_SATURATION_WEIGHT = 0.30f;
-const float GREEN_SATURATION_WEIGHT = 0.59f;
-const float BLUE_SATURATION_WEIGHT = 0.11f;
-
-const unsigned short NOTHING_TRANS_FILTER = 0;
-const unsigned short SCREEN_TRANS_FILTER = 1;
-const unsigned short WINDOW_TRANS_FILTER = 2;
+const float DEFAULT_Z_CAMERA = 0.866025404f;
+
+const float RED_SATURATION_WEIGHT = 0.30f;
+const float GREEN_SATURATION_WEIGHT = 0.59f;
+const float BLUE_SATURATION_WEIGHT = 0.11f;
+
+const unsigned short NOTHING_TRANS_FILTER = 0;
+const unsigned short SCREEN_TRANS_FILTER = 1;
+const unsigned short WINDOW_TRANS_FILTER = 2;
CompOption::Vector &
GLScreen::getOptions ()
@@ -62,7 +62,8 @@
if (!rv || !CompOption::findOption (getOptions (), name, &index))
return false;
- switch (index) {
+ switch (index)
+ {
case OpenglOptions::TextureFilter:
cScreen->damageScreen ();
@@ -71,6 +72,7 @@
else
textureFilter = GL_LINEAR;
break;
+
default:
break;
}
=== modified file 'plugins/opengl/src/paint.cpp'
--- plugins/opengl/src/paint.cpp 2013-06-28 01:10:57 +0000
+++ plugins/opengl/src/paint.cpp 2013-07-21 23:03:28 +0000
@@ -45,11 +45,13 @@
using namespace compiz::opengl;
-GLScreenPaintAttrib defaultScreenPaintAttrib = {
+GLScreenPaintAttrib defaultScreenPaintAttrib =
+{
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -DEFAULT_Z_CAMERA
};
-GLWindowPaintAttrib GLWindow::defaultPaintAttrib = {
+GLWindowPaintAttrib GLWindow::defaultPaintAttrib =
+{
OPAQUE, BRIGHT, COLOR, 1.0f, 1.0f, 0.0f, 0.0f
};
@@ -76,12 +78,7 @@
const CompRegion ®ion,
bool transformed)
{
- GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
- GLfloat vertexData[18];
- GLushort colorData[4];
-
- BoxPtr pBox = const_cast (region.handle ())->rects;
- int n, nBox = const_cast (region.handle ())->numRects;
+ int nBox = const_cast (region.handle ())->numRects;
if (!nBox)
return;
@@ -89,9 +86,7 @@
if (screen->desktopWindowCount ())
{
if (!backgroundTextures.empty ())
- {
backgroundTextures.clear ();
- }
backgroundLoaded = false;
@@ -105,10 +100,15 @@
backgroundLoaded = true;
}
+ GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
+ GLfloat vertexData[18];
+ GLushort colorData[4];
+ BoxPtr pBox = const_cast (region.handle ())->rects;
+ int n = nBox;
+
if (backgroundTextures.empty ())
{
streamingBuffer->begin (GL_TRIANGLES);
- n = nBox;
while (n--)
{
@@ -134,7 +134,7 @@
streamingBuffer->addVertices (6, vertexData);
- pBox++;
+ ++pBox;
}
colorData[0] = colorData[1] = colorData[2] = 0;
@@ -146,9 +146,7 @@
}
else
{
- n = nBox;
-
- for (unsigned int i = 0; i < backgroundTextures.size (); i++)
+ for (unsigned int i = 0; i < backgroundTextures.size (); ++i)
{
GLfloat textureData[12];
GLTexture *bg = backgroundTextures[i];
@@ -208,7 +206,7 @@
streamingBuffer->addVertices (6, vertexData);
streamingBuffer->addTexCoords (0, 6, textureData);
- pBox++;
+ ++pBox;
}
streamingBuffer->end ();
@@ -230,10 +228,10 @@
/* This function currently always performs occlusion detection to
- minimize paint regions. OpenGL precision requirements are no good
- enough to guarantee that the results from using occlusion detection
+ minimize paint regions. OpenGL precision requirements are not good
+ enough to guarantee that the result from using occlusion detection
is the same as without. It's likely not possible to see any
- difference with most hardware but occlusion detection in the
+ difference with most hardware, but occlusion detection in the
transformed screen case should be made optional for those who do
see a difference. */
void
@@ -242,19 +240,17 @@
CompOutput *output,
unsigned int mask)
{
- CompRegion tmpRegion (region);
- CompWindow *w;
- GLWindow *gw;
- int windowMask, odMask;
- bool status, unredirectFS;
- bool withOffset = false;
- GLMatrix vTransform;
- CompPoint offXY;
+ CompRegion tmpRegion (region);
+ CompWindow *w;
+ GLWindow *gw;
+ int odMask;
+ int windowMask = 0;
+ bool status, unredirectFS;
+ bool withOffset = false;
+ GLMatrix vTransform;
+ CompPoint offXY;
std::set unredirected;
- CompWindowList pl;
- CompWindowList::reverse_iterator rit;
-
unredirectFS = CompositeScreen::get (screen)->
getOption ("unredirect_fullscreen_windows")->value ().b ();
@@ -267,29 +263,24 @@
bool blacklisted = driverIsBlacklisted (blacklist.c_str ());
if (mask & PAINT_SCREEN_TRANSFORMED_MASK)
- {
- windowMask = PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK;
- }
- else
- {
- windowMask = 0;
- }
+ windowMask = PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK;
/*
* We need to COPY the PaintList for now because there seem to be some
* odd cases where the master list might change during the below loops.
* (LP: #958540)
*/
- pl = cScreen->getWindowPaintList ();
+ CompWindowList pl = cScreen->getWindowPaintList ();
if (!(mask & PAINT_SCREEN_NO_OCCLUSION_DETECTION_MASK))
{
FullscreenRegion fs (*output, screen->region ());
/* detect occlusions */
- for (rit = pl.rbegin (); rit != pl.rend (); ++rit)
+ for (CompWindowList::reverse_iterator rit = pl.rbegin ();
+ rit != pl.rend (); ++rit)
{
- w = (*rit);
+ w = (*rit);
gw = GLWindow::get (w);
if (w->destroyed ())
@@ -305,6 +296,7 @@
gw->priv->clip = region;
continue;
}
+
if (!w->isViewable ())
continue;
}
@@ -319,8 +311,7 @@
!w->onAllViewports ())
{
withOffset = true;
-
- offXY = w->getMovementForOffset (cScreen->windowPaintOffset ());
+ offXY = w->getMovementForOffset (cScreen->windowPaintOffset ());
vTransform = transform;
vTransform.translate (offXY.x (), offXY.y (), 0);
@@ -328,22 +319,21 @@
gw->priv->clip.translate (-offXY.x (), -offXY. y ());
odMask |= PAINT_WINDOW_WITH_OFFSET_MASK;
- status = gw->glPaint (gw->paintAttrib (), vTransform,
- tmpRegion, odMask);
+ status = gw->glPaint (gw->paintAttrib (), vTransform,
+ tmpRegion, odMask);
}
else
{
withOffset = false;
- status = gw->glPaint (gw->paintAttrib (), transform, tmpRegion,
- odMask);
+ status = gw->glPaint (gw->paintAttrib (), transform, tmpRegion,
+ odMask);
}
if (status)
{
if (withOffset)
- {
tmpRegion -= w->region ().translated (offXY);
- }
+
else
tmpRegion -= w->region ();
}
@@ -373,37 +363,31 @@
* take effect until it is un-fullscreened again. But that's better
* than the high price of regex matching on every frame.
*/
- if (unredirectFS &&
- !blacklisted &&
- !(mask & PAINT_SCREEN_TRANSFORMED_MASK) &&
- !(mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK) &&
- fs.isCoveredBy (w->region (), flags) &&
+ if (unredirectFS &&
+ !blacklisted &&
+ !(mask & PAINT_SCREEN_TRANSFORMED_MASK) &&
+ !(mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK) &&
+ fs.isCoveredBy (w->region (), flags) &&
(!cw->redirected () || unredirectable.evaluate (w)))
- {
unredirected.insert (w);
- }
- else
+
+ else if (!cw->redirected ())
{
- if (!cw->redirected ())
+ if (fs.allowRedirection (w->region ()))
{
- if (fs.allowRedirection (w->region ()))
- {
- // 1. GLWindow::release to force gw->priv->needsRebind
- gw->release ();
-
- // 2. GLWindow::bind, which redirects the window,
- // rebinds the pixmap, and then rebinds the pixmap
- // to a texture.
- gw->bind ();
-
- // 3. Your window is now redirected again with the
- // latest pixmap contents.
- }
- else
- {
- unredirected.insert (w);
- }
+ // 1. GLWindow::release to force gw->priv->needsRebind
+ gw->release ();
+
+ // 2. GLWindow::bind, which redirects the window,
+ // rebinds the pixmap, and then rebinds the pixmap
+ // to a texture.
+ gw->bind ();
+
+ // 3. Your window is now redirected again with the
+ // latest pixmap contents.
}
+ else
+ unredirected.insert (w);
}
}
}
@@ -414,8 +398,8 @@
if (!(mask & PAINT_SCREEN_NO_BACKGROUND_MASK))
paintBackground (transform,
- tmpRegion,
- (mask & PAINT_SCREEN_TRANSFORMED_MASK));
+ tmpRegion,
+ (mask & PAINT_SCREEN_TRANSFORMED_MASK));
/* paint all windows from bottom to top */
foreach (w, pl)
@@ -423,26 +407,29 @@
if (w->destroyed ())
continue;
- gw = GLWindow::get (w);
+ gw = GLWindow::get (w);
+<<<<<<< TREE
/* Release any queued ConfigureWindow requests now */
gw->priv->configureLock->release ();
+=======
+ /* Release any queued ConfigureWindow requests now */
+ gw->priv->configureLock->release ();
+>>>>>>> MERGE-SOURCE
if (unredirected.find (w) != unredirected.end ())
continue;
- if (!w->shaded ())
- {
- if (!w->isViewable ())
- continue;
- }
+ if (!w->shaded () &&
+ !w->isViewable ())
+ continue;
const CompRegion &clip =
(!(mask & PAINT_SCREEN_NO_OCCLUSION_DETECTION_MASK)) ?
gw->clip () : region;
if ((cScreen->windowPaintOffset ().x () != 0 ||
- cScreen->windowPaintOffset ().y () != 0) &&
+ cScreen->windowPaintOffset ().y () != 0 ) &&
!w->onAllViewports ())
{
offXY = w->getMovementForOffset (cScreen->windowPaintOffset ());
@@ -450,12 +437,10 @@
vTransform = transform;
vTransform.translate (offXY.x (), offXY.y (), 0);
gw->glPaint (gw->paintAttrib (), vTransform, clip,
- windowMask | PAINT_WINDOW_WITH_OFFSET_MASK);
+ windowMask | PAINT_WINDOW_WITH_OFFSET_MASK);
}
else
- {
gw->glPaint (gw->paintAttrib (), transform, clip, windowMask);
- }
}
}
@@ -488,20 +473,20 @@
WRAPABLE_HND_FUNCTN (glEnableOutputClipping, transform, region, output)
// Bottom-left corner of the output:
- const GLint x = output->x1 ();
- const GLint y = screen->height () - output->y2 ();
- const GLsizei w = output->width ();
- const GLsizei h = output->height ();
+ const GLint x = output->x1 ();
+ const GLint y = screen->height () - output->y2 ();
+ const GLsizei w = output->width ();
+ const GLsizei h = output->height ();
// Transformed (only scale and translation is supported!)
- const float *t = transform.getMatrix ();
- const GLfloat scalex = t[0], scaley = t[5], transx = t[12], transy = t[13];
+ const float *t = transform.getMatrix ();
+ const GLfloat scalex = t[0], scaley = t[5], transx = t[12], transy = t[13];
const GLfloat centrex = x + w / 2.0f;
const GLfloat centrey = y + h / 2.0f;
- GLfloat scaledw = fabs (w * scalex);
- GLfloat scaledh = fabs (h * scaley);
- GLfloat tx = centrex - (scaledw / 2.0f) + transx * w;
- GLfloat ty = centrey - (scaledh / 2.0f) + transy * h;
+ GLfloat scaledw = fabs (w * scalex);
+ GLfloat scaledh = fabs (h * scaley);
+ GLfloat tx = centrex - (scaledw / 2.0f) + transx * w;
+ GLfloat ty = centrey - (scaledh / 2.0f) + transy * h;
glScissor (tx, ty, roundf (scaledw), roundf (scaledh));
glEnable (GL_SCISSOR_TEST);
@@ -516,22 +501,22 @@
}
void
-GLScreen::glBufferStencil (const GLMatrix &matrix,
- GLVertexBuffer &vertexBuffer,
- CompOutput *output)
+GLScreen::glBufferStencil (const GLMatrix &matrix,
+ GLVertexBuffer &vertexBuffer,
+ CompOutput *output)
{
WRAPABLE_HND_FUNCTN (glBufferStencil, matrix, vertexBuffer, output);
- GLfloat x = output->x ();
- GLfloat y = screen->height () - output->y2 ();
+ GLfloat x = output->x ();
+ GLfloat y = screen->height () - output->y2 ();
GLfloat x2 = output->x () + output->width ();
GLfloat y2 = screen->height () - output->y2 () + output->height ();
GLfloat vertices[] =
{
- x, y, 0,
- x, y2, 0,
- x2, y, 0,
+ x, y, 0,
+ x, y2, 0,
+ x2, y, 0,
x2, y2, 0
};
@@ -576,8 +561,8 @@
priv->paintOutputRegion (sTransform, region, output, mask);
glDisableOutputClipping ();
}
- else if ( (GL::fboEnabled && GL::fboStencilSupported) ||
- GL::stencilBuffer )
+ else if ((GL::fboEnabled && GL::fboStencilSupported) ||
+ GL::stencilBuffer )
{
sTransform.toScreenSpace (output, -sAttrib.zTranslate);
@@ -656,7 +641,7 @@
* windows are getting transformed (and so the unredirected window
* needs to be redirected again).
*/
- if (!region.isEmpty () ||
+ if (!region.isEmpty () ||
(mask & PAINT_SCREEN_FULL_MASK) ||
(mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK))
priv->paintOutputRegion (sTransform, region, output, mask);
@@ -671,9 +656,7 @@
return true;
}
else
- {
return false;
- }
}
void
@@ -683,9 +666,9 @@
{
WRAPABLE_HND_FUNCTN (glPaintCompositedOutput, region, fbo, mask)
- GLMatrix sTransform;
- const GLTexture::Matrix & texmatrix = fbo->tex ()->matrix ();
- GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
+ GLMatrix sTransform;
+ const GLTexture::Matrix &texmatrix = fbo->tex ()->matrix ();
+ GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
streamingBuffer->begin (GL_TRIANGLES);
@@ -696,7 +679,8 @@
GLfloat ty1 = 1.0 - COMP_TEX_COORD_Y (texmatrix, 0.0f);
GLfloat ty2 = 1.0 - COMP_TEX_COORD_Y (texmatrix, screen->height ());
- const GLfloat vertexData[] = {
+ const GLfloat vertexData[] =
+ {
0.0f, 0.0f, 0.0f,
0.0f, (float)screen->height (), 0.0f,
(float)screen->width (), 0.0f, 0.0f,
@@ -706,7 +690,8 @@
(float)screen->width (), 0.0f, 0.0f,
};
- const GLfloat textureData[] = {
+ const GLfloat textureData[] =
+ {
tx1, ty1,
tx1, ty2,
tx2, ty1,
@@ -721,7 +706,7 @@
else
{
BoxPtr pBox = const_cast (region.handle ())->rects;
- int nBox = const_cast (region.handle ())->numRects;
+ int nBox = const_cast (region.handle ())->numRects;
while (nBox--)
{
@@ -730,7 +715,8 @@
GLfloat ty1 = 1.0 - COMP_TEX_COORD_Y (texmatrix, pBox->y1);
GLfloat ty2 = 1.0 - COMP_TEX_COORD_Y (texmatrix, pBox->y2);
- const GLfloat vertexData[] = {
+ const GLfloat vertexData[] =
+ {
(float)pBox->x1, (float)pBox->y1, 0.0f,
(float)pBox->x1, (float)pBox->y2, 0.0f,
(float)pBox->x2, (float)pBox->y1, 0.0f,
@@ -740,7 +726,8 @@
(float)pBox->x2, (float)pBox->y1, 0.0f,
};
- const GLfloat textureData[] = {
+ const GLfloat textureData[] =
+ {
tx1, ty1,
tx1, ty2,
tx2, ty1,
@@ -751,7 +738,8 @@
streamingBuffer->addVertices (6, &vertexData[0]);
streamingBuffer->addTexCoords (0, 6, &textureData[0]);
- pBox++;
+
+ ++pBox;
}
}
@@ -763,16 +751,17 @@
}
static void
-addSingleQuad (GLVertexBuffer *vertexBuffer,
- const GLTexture::MatrixList &matrix,
- unsigned int nMatrix,
- int x1,
- int y1,
- int x2,
- int y2,
- bool rect)
+addSingleQuad (GLVertexBuffer *vertexBuffer,
+ const GLTexture::MatrixList &matrix,
+ unsigned int nMatrix,
+ int x1,
+ int y1,
+ int x2,
+ int y2,
+ bool rect)
{
- GLfloat vertexData[18] = {
+ GLfloat vertexData[18] =
+ {
(float)x1, (float)y1, 0.0,
(float)x1, (float)y2, 0.0,
(float)x2, (float)y1, 0.0,
@@ -780,52 +769,58 @@
(float)x1, (float)y2, 0.0,
(float)x2, (float)y2, 0.0
};
+
vertexBuffer->addVertices (6, vertexData);
+ unsigned int it;
if (rect)
{
- unsigned int it;
- for (it = 0; it < nMatrix; it++)
- {
- GLfloat data[2];
- const GLTexture::Matrix &mat = matrix[it];
- data[0] = COMP_TEX_COORD_X (mat, x1);
- data[1] = COMP_TEX_COORD_Y (mat, y1);
- vertexBuffer->addTexCoords (it, 1, data);
- }
- for (it = 0; it < nMatrix; it++)
- {
- GLfloat data[2];
- const GLTexture::Matrix &mat = matrix[it];
- data[0] = COMP_TEX_COORD_X (mat, x1);
- data[1] = COMP_TEX_COORD_Y (mat, y2);
- vertexBuffer->addTexCoords (it, 1, data);
- }
- for (it = 0; it < nMatrix; it++)
- {
- GLfloat data[2];
- const GLTexture::Matrix &mat = matrix[it];
- data[0] = COMP_TEX_COORD_X (mat, x2);
- data[1] = COMP_TEX_COORD_Y (mat, y1);
- vertexBuffer->addTexCoords (it, 1, data);
- }
- for (it = 0; it < nMatrix; it++)
- {
- GLfloat data[2];
- const GLTexture::Matrix &mat = matrix[it];
- data[0] = COMP_TEX_COORD_X (mat, x2);
- data[1] = COMP_TEX_COORD_Y (mat, y1);
- vertexBuffer->addTexCoords (it, 1, data);
- }
- for (it = 0; it < nMatrix; it++)
- {
- GLfloat data[2];
- const GLTexture::Matrix &mat = matrix[it];
- data[0] = COMP_TEX_COORD_X (mat, x1);
- data[1] = COMP_TEX_COORD_Y (mat, y2);
- vertexBuffer->addTexCoords (it, 1, data);
- }
- for (it = 0; it < nMatrix; it++)
+ for (it = 0; it < nMatrix; ++it)
+ {
+ GLfloat data[2];
+ const GLTexture::Matrix &mat = matrix[it];
+ data[0] = COMP_TEX_COORD_X (mat, x1);
+ data[1] = COMP_TEX_COORD_Y (mat, y1);
+ vertexBuffer->addTexCoords (it, 1, data);
+ }
+
+ for (it = 0; it < nMatrix; ++it)
+ {
+ GLfloat data[2];
+ const GLTexture::Matrix &mat = matrix[it];
+ data[0] = COMP_TEX_COORD_X (mat, x1);
+ data[1] = COMP_TEX_COORD_Y (mat, y2);
+ vertexBuffer->addTexCoords (it, 1, data);
+ }
+
+ for (it = 0; it < nMatrix; ++it)
+ {
+ GLfloat data[2];
+ const GLTexture::Matrix &mat = matrix[it];
+ data[0] = COMP_TEX_COORD_X (mat, x2);
+ data[1] = COMP_TEX_COORD_Y (mat, y1);
+ vertexBuffer->addTexCoords (it, 1, data);
+ }
+
+ for (it = 0; it < nMatrix; ++it)
+ {
+ GLfloat data[2];
+ const GLTexture::Matrix &mat = matrix[it];
+ data[0] = COMP_TEX_COORD_X (mat, x2);
+ data[1] = COMP_TEX_COORD_Y (mat, y1);
+ vertexBuffer->addTexCoords (it, 1, data);
+ }
+
+ for (it = 0; it < nMatrix; ++it)
+ {
+ GLfloat data[2];
+ const GLTexture::Matrix &mat = matrix[it];
+ data[0] = COMP_TEX_COORD_X (mat, x1);
+ data[1] = COMP_TEX_COORD_Y (mat, y2);
+ vertexBuffer->addTexCoords (it, 1, data);
+ }
+
+ for (it = 0; it < nMatrix; ++it)
{
GLfloat data[2];
const GLTexture::Matrix &mat = matrix[it];
@@ -836,8 +831,7 @@
}
else
{
- unsigned int it;
- for (it = 0; it < nMatrix; it++)
+ for (it = 0; it < nMatrix; ++it)
{
GLfloat data[2];
const GLTexture::Matrix &mat = matrix[it];
@@ -845,39 +839,44 @@
data[1] = COMP_TEX_COORD_YX (mat, x1, y1);
vertexBuffer->addTexCoords (it, 1, data);
}
- for (it = 0; it < nMatrix; it++)
- {
- GLfloat data[2];
- const GLTexture::Matrix &mat = matrix[it];
- data[0] = COMP_TEX_COORD_XY (mat, x1, y2);
- data[1] = COMP_TEX_COORD_YX (mat, x1, y2);
- vertexBuffer->addTexCoords (it, 1, data);
- }
- for (it = 0; it < nMatrix; it++)
- {
- GLfloat data[2];
- const GLTexture::Matrix &mat = matrix[it];
- data[0] = COMP_TEX_COORD_XY (mat, x2, y1);
- data[1] = COMP_TEX_COORD_YX (mat, x2, y1);
- vertexBuffer->addTexCoords (it, 1, data);
- }
- for (it = 0; it < nMatrix; it++)
- {
- GLfloat data[2];
- const GLTexture::Matrix &mat = matrix[it];
- data[0] = COMP_TEX_COORD_XY (mat, x2, y1);
- data[1] = COMP_TEX_COORD_YX (mat, x2, y1);
- vertexBuffer->addTexCoords (it, 1, data);
- }
- for (it = 0; it < nMatrix; it++)
- {
- GLfloat data[2];
- const GLTexture::Matrix &mat = matrix[it];
- data[0] = COMP_TEX_COORD_XY (mat, x1, y2);
- data[1] = COMP_TEX_COORD_YX (mat, x1, y2);
- vertexBuffer->addTexCoords (it, 1, data);
- }
- for (it = 0; it < nMatrix; it++)
+
+ for (it = 0; it < nMatrix; ++it)
+ {
+ GLfloat data[2];
+ const GLTexture::Matrix &mat = matrix[it];
+ data[0] = COMP_TEX_COORD_XY (mat, x1, y2);
+ data[1] = COMP_TEX_COORD_YX (mat, x1, y2);
+ vertexBuffer->addTexCoords (it, 1, data);
+ }
+
+ for (it = 0; it < nMatrix; ++it)
+ {
+ GLfloat data[2];
+ const GLTexture::Matrix &mat = matrix[it];
+ data[0] = COMP_TEX_COORD_XY (mat, x2, y1);
+ data[1] = COMP_TEX_COORD_YX (mat, x2, y1);
+ vertexBuffer->addTexCoords (it, 1, data);
+ }
+
+ for (it = 0; it < nMatrix; ++it)
+ {
+ GLfloat data[2];
+ const GLTexture::Matrix &mat = matrix[it];
+ data[0] = COMP_TEX_COORD_XY (mat, x2, y1);
+ data[1] = COMP_TEX_COORD_YX (mat, x2, y1);
+ vertexBuffer->addTexCoords (it, 1, data);
+ }
+
+ for (it = 0; it < nMatrix; ++it)
+ {
+ GLfloat data[2];
+ const GLTexture::Matrix &mat = matrix[it];
+ data[0] = COMP_TEX_COORD_XY (mat, x1, y2);
+ data[1] = COMP_TEX_COORD_YX (mat, x1, y2);
+ vertexBuffer->addTexCoords (it, 1, data);
+ }
+
+ for (it = 0; it < nMatrix; ++it)
{
GLfloat data[2];
const GLTexture::Matrix &mat = matrix[it];
@@ -889,16 +888,16 @@
}
static void
-addQuads (GLVertexBuffer *vertexBuffer,
- const GLTexture::MatrixList &matrix,
- unsigned int nMatrix,
- int x1,
- int y1,
- int x2,
- int y2,
- bool rect,
- unsigned int maxGridWidth,
- unsigned int maxGridHeight)
+addQuads (GLVertexBuffer *vertexBuffer,
+ const GLTexture::MatrixList &matrix,
+ unsigned int nMatrix,
+ int x1,
+ int y1,
+ int x2,
+ int y2,
+ bool rect,
+ unsigned int maxGridWidth,
+ unsigned int maxGridHeight)
{
if (maxGridWidth == 0 || maxGridHeight == 0)
return;
@@ -909,9 +908,7 @@
1 + (y2 - y1 - 1) / (int) maxGridHeight;
if (nQuadsX == 1 && nQuadsY == 1)
- {
addSingleQuad (vertexBuffer, matrix, nMatrix, x1, y1, x2, y2, rect);
- }
else
{
int quadWidth = 1 + (x2 - x1 - 1) / nQuadsX; // ceil. division
@@ -942,30 +939,30 @@
{
WRAPABLE_HND_FUNCTN (glAddGeometry, matrix, region, clip)
- BoxRec full;
int nMatrix = matrix.size ();
+ BoxRec full = clip.handle ()->extents;
- full = clip.handle ()->extents;
if (region.handle ()->extents.x1 > full.x1)
full.x1 = region.handle ()->extents.x1;
+
if (region.handle ()->extents.y1 > full.y1)
full.y1 = region.handle ()->extents.y1;
+
if (region.handle ()->extents.x2 < full.x2)
full.x2 = region.handle ()->extents.x2;
+
if (region.handle ()->extents.y2 < full.y2)
full.y2 = region.handle ()->extents.y2;
if (full.x1 < full.x2 && full.y1 < full.y2)
{
- BoxPtr pBox;
- int nBox;
BoxPtr pClip;
int nClip;
BoxRec cbox;
int it, x1, y1, x2, y2;
bool rect = true;
- for (it = 0; it < nMatrix; it++)
+ for (it = 0; it < nMatrix; ++it)
{
if (matrix[it].xy != 0.0f || matrix[it].yx != 0.0f)
{
@@ -974,8 +971,8 @@
}
}
- pBox = const_cast (region.handle ())->rects;
- nBox = const_cast (region.handle ())->numRects;
+ BoxPtr pBox = const_cast (region.handle ())->rects;
+ int nBox = const_cast (region.handle ())->numRects;
while (nBox--)
{
@@ -984,7 +981,7 @@
x2 = pBox->x2;
y2 = pBox->y2;
- pBox++;
+ ++pBox;
if (x1 < full.x1)
x1 = full.x1;
@@ -1014,14 +1011,17 @@
{
cbox = *pClip;
- pClip++;
+ ++pClip;
if (cbox.x1 < x1)
cbox.x1 = x1;
+
if (cbox.y1 < y1)
cbox.y1 = y1;
+
if (cbox.x2 > x2)
cbox.x2 = x2;
+
if (cbox.y2 > y2)
cbox.y2 = y2;
@@ -1157,9 +1157,7 @@
GL::activeTexture (GL_TEXTURE2_ARB);
}
else
- {
w->vertexBuffer ()->render (transform, attrib);
- }
texture->disable ();
@@ -1221,9 +1219,7 @@
gs->setTexEnvMode (GL_REPLACE);
}
else
- {
w->vertexBuffer ()->render (transform, attrib);
- }
}
else if (attrib.brightness != BRIGHT)
{
@@ -1237,9 +1233,7 @@
gs->setTexEnvMode (GL_REPLACE);
}
else
- {
w->vertexBuffer ()->render (transform, attrib);
- }
texture->disable ();
}
@@ -1247,10 +1241,10 @@
#endif
void
-GLWindow::glDrawTexture (GLTexture *texture,
+GLWindow::glDrawTexture (GLTexture *texture,
const GLMatrix &transform,
const GLWindowPaintAttrib &attrib,
- unsigned int mask)
+ unsigned int mask)
{
WRAPABLE_HND_FUNCTN (glDrawTexture, texture, transform, attrib, mask)
@@ -1287,21 +1281,19 @@
}
bool
-GLWindow::glDraw (const GLMatrix &transform,
+GLWindow::glDraw (const GLMatrix &transform,
const GLWindowPaintAttrib &attrib,
- const CompRegion ®ion,
- unsigned int mask)
+ const CompRegion ®ion,
+ unsigned int mask)
{
WRAPABLE_HND_FUNCTN_RETURN (bool, glDraw, transform,
attrib, region, mask)
const CompRegion ® = (mask & PAINT_WINDOW_TRANSFORMED_MASK) ?
- infiniteRegion : region;
-
- if (reg.isEmpty ())
- return true;
-
- if (!priv->window->isViewable () ||
+ infiniteRegion : region;
+
+ if (reg.isEmpty () ||
+ !priv->window->isViewable () ||
!priv->cWindow->damaged ())
return true;
@@ -1327,11 +1319,12 @@
if (priv->updateState & PrivateGLWindow::UpdateRegion)
priv->updateWindowRegions ();
- for (unsigned int i = 0; i < priv->textures.size (); i++)
+ for (unsigned int i = 0; i < priv->textures.size (); ++i)
{
ml[0] = priv->matrices[i];
priv->vertexBuffer->begin ();
glAddGeometry (ml, priv->regions[i], reg);
+
if (priv->vertexBuffer->end ())
glDrawTexture (priv->textures[i], transform, attrib, mask);
}
@@ -1347,8 +1340,6 @@
{
WRAPABLE_HND_FUNCTN_RETURN (bool, glPaint, attrib, transform, region, mask)
- bool status;
-
priv->lastPaint = attrib;
if (priv->window->alpha () || attrib.opacity != OPAQUE)
@@ -1358,16 +1349,10 @@
if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)
{
- if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
- return false;
-
- if (mask & PAINT_WINDOW_NO_CORE_INSTANCE_MASK)
- return false;
-
- if (mask & PAINT_WINDOW_TRANSLUCENT_MASK)
- return false;
-
- if (priv->window->shaded ())
+ if (mask & PAINT_WINDOW_TRANSFORMED_MASK ||
+ mask & PAINT_WINDOW_NO_CORE_INSTANCE_MASK ||
+ mask & PAINT_WINDOW_TRANSLUCENT_MASK ||
+ priv->window->shaded ())
return false;
return true;
@@ -1376,7 +1361,7 @@
if (mask & PAINT_WINDOW_NO_CORE_INSTANCE_MASK)
return true;
- status = glDraw (transform, attrib, region, mask);
+ bool status = glDraw (transform, attrib, region, mask);
return status;
}
=== modified file 'plugins/opengl/src/privates.h'
--- plugins/opengl/src/privates.h 2013-01-03 16:05:26 +0000
+++ plugins/opengl/src/privates.h 2013-07-21 23:03:28 +0000
@@ -59,7 +59,7 @@
protected:
- Display *mDpy;
+ Display *mDpy;
const CompSize &mSize;
};
@@ -70,9 +70,9 @@
{
public:
- GLXDoubleBuffer (Display *,
- const CompSize &,
- Window);
+ GLXDoubleBuffer (Display *,
+ const CompSize &,
+ Window );
void swap () const;
bool blitAvailable () const;
@@ -93,9 +93,9 @@
{
public:
- EGLDoubleBuffer (Display *,
- const CompSize &,
- EGLSurface const &);
+ EGLDoubleBuffer (Display *,
+ const CompSize &,
+ EGLSurface const &);
void swap () const;
bool blitAvailable () const;
@@ -106,7 +106,7 @@
private:
- EGLSurface const & mSurface;
+ EGLSurface const &mSurface;
};
#endif
@@ -114,6 +114,7 @@
class GLIcon
{
public:
+
GLIcon () : icon (NULL) {}
CompIcon *icon;
@@ -126,10 +127,12 @@
public OpenglOptions
{
public:
+
PrivateGLScreen (GLScreen *gs);
~PrivateGLScreen ();
- bool setOption (const CompString &name, CompOption::Value &value);
+ bool setOption (const CompString &name,
+ CompOption::Value &value);
void handleEvent (XEvent *event);
@@ -149,7 +152,7 @@
bool compositingActive ();
void paintBackground (const GLMatrix &transform,
- const CompRegion ®ion,
+ const CompRegion ®ion,
bool transformed);
void paintOutputRegion (const GLMatrix &transform,
@@ -165,67 +168,70 @@
public:
- GLScreen *gScreen;
- CompositeScreen *cScreen;
+ GLScreen *gScreen;
+ CompositeScreen *cScreen;
- GLenum textureFilter;
+ GLenum textureFilter;
#ifndef USE_GLES
- GLFBConfig glxPixmapFBConfigs[MAX_DEPTH + 1];
+ GLFBConfig glxPixmapFBConfigs[MAX_DEPTH + 1];
#endif
- GLTexture::List backgroundTextures;
- bool backgroundLoaded;
-
- GLTexture::Filter filter[3];
-
- CompPoint rasterPos;
-
- GLMatrix *projection;
-
- bool clearBuffers;
- bool lighting;
+ GLTexture::List backgroundTextures;
+ bool backgroundLoaded;
+
+ GLTexture::Filter filter[3];
+
+ CompPoint rasterPos;
+
+ GLMatrix *projection;
+
+ bool clearBuffers;
+ bool lighting;
#ifdef USE_GLES
- EGLContext ctx;
- EGLSurface surface;
- EGLDoubleBuffer doubleBuffer;
+ EGLContext ctx;
+ EGLSurface surface;
+ EGLDoubleBuffer doubleBuffer;
#else
- GLXContext ctx;
+ GLXContext ctx;
- GL::GLXGetProcAddressProc getProcAddress;
- GLXDoubleBuffer doubleBuffer;
+ GL::GLXGetProcAddressProc getProcAddress;
+ GLXDoubleBuffer doubleBuffer;
#endif
- GLFramebufferObject *scratchFbo;
- CompRegion outputRegion;
+ GLFramebufferObject *scratchFbo;
+ CompRegion outputRegion;
- XRectangle lastViewport;
- bool refreshSubBuffer;
- unsigned int lastMask;
+ XRectangle lastViewport;
+ bool refreshSubBuffer;
+ unsigned int lastMask;
std::vector bindPixmap;
- bool hasCompositing;
- bool commonFrontbuffer;
- bool incorrectRefreshRate; // hack for NVIDIA specifying an incorrect
- // refresh rate, causing us to miss vblanks
+ bool hasCompositing;
+ bool commonFrontbuffer;
+ bool incorrectRefreshRate; // hack for NVIDIA specifying an incorrect
+ // refresh rate, causing us to miss vblanks
+ // TODO: check if this hack is still needed
GLIcon defaultIcon;
- Window saveWindow; // hack for broken applications, see:
- // https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/807487
-
- GLProgramCache *programCache;
- GLShaderCache shaderCache;
- GLVertexBuffer::AutoProgram *autoProgram;
-
- Pixmap rootPixmapCopy;
- CompSize rootPixmapSize;
-
- const char *glVendor, *glRenderer, *glVersion;
-
- mutable CompString prevRegex;
- mutable bool prevBlacklisted;
+ Window saveWindow; // hack for broken applications, see:
+ // https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/807487
+
+ GLProgramCache *programCache;
+ GLShaderCache shaderCache;
+ GLVertexBuffer::AutoProgram *autoProgram;
+
+ Pixmap rootPixmapCopy;
+ CompSize rootPixmapSize;
+
+ const char *glVendor;
+ const char *glRenderer;
+ const char *glVersion;
+
+ mutable CompString prevRegex;
+ mutable bool prevBlacklisted;
};
class PrivateGLWindow :
@@ -238,55 +244,64 @@
static const unsigned int UpdateMatrix = 1 << 1;
public:
+
PrivateGLWindow (CompWindow *w, GLWindow *gw);
~PrivateGLWindow ();
void windowNotify (CompWindowNotify n);
- void resizeNotify (int dx, int dy, int dwidth, int dheight);
- void moveNotify (int dx, int dy, bool now);
+
+ void resizeNotify (int dx,
+ int dy,
+ int dwidth,
+ int dheight);
+
+ void moveNotify (int dx,
+ int dy,
+ bool now);
+
void updateFrameRegion (CompRegion ®ion);
void setWindowMatrix ();
+
void updateWindowRegions ();
void clearTextures ();
- CompWindow *window;
- GLWindow *gWindow;
- CompositeWindow *cWindow;
- GLScreen *gScreen;
-
- GLTexture::List textures;
- GLTexture::MatrixList matrices;
- CompRegion::Vector regions;
- unsigned int updateState;
- bool needsRebind;
-
- CompRegion clip;
-
- bool bindFailed;
- bool overlayWindow;
-
- GLushort opacity;
- GLushort brightness;
- GLushort saturation;
-
- GLWindowPaintAttrib paint;
- GLWindowPaintAttrib lastPaint;
-
- unsigned int lastMask;
-
- GLVertexBuffer *vertexBuffer;
+ CompWindow *window;
+ GLWindow *gWindow;
+ CompositeWindow *cWindow;
+ GLScreen *gScreen;
+
+ GLTexture::List textures;
+ GLTexture::MatrixList matrices;
+ CompRegion::Vector regions;
+ unsigned int updateState;
+ bool needsRebind;
+
+ CompRegion clip;
+
+ bool bindFailed;
+ bool overlayWindow;
+
+ GLushort opacity;
+ GLushort brightness;
+ GLushort saturation;
+
+ GLWindowPaintAttrib paint;
+ GLWindowPaintAttrib lastPaint;
+
+ unsigned int lastMask;
+
+ GLVertexBuffer *vertexBuffer;
// map of shaders, plugin name is key, pair of vertex and fragment
// shader source code is value
std::list shaders;
- GLVertexBuffer::AutoProgram *autoProgram;
+ GLVertexBuffer::AutoProgram *autoProgram;
- std::list icons;
+ std::list icons;
compiz::window::configure_buffers::Releasable::Ptr configureLock;
};
#endif
-
=== modified file 'plugins/opengl/src/privatetexture.h'
--- plugins/opengl/src/privatetexture.h 2012-09-18 11:32:20 +0000
+++ plugins/opengl/src/privatetexture.h 2013-07-21 23:03:28 +0000
@@ -47,8 +47,10 @@
class GLScreen;
class GLDisplay;
-class PrivateTexture {
+class PrivateTexture
+{
public:
+
PrivateTexture (GLTexture *);
~PrivateTexture ();
@@ -59,6 +61,7 @@
GLenum type);
public:
+
GLTexture *texture;
GLuint name;
GLenum target;
@@ -72,8 +75,10 @@
};
#ifdef USE_GLES
-class EglTexture : public GLTexture {
+class EglTexture : public GLTexture
+{
public:
+
EglTexture ();
~EglTexture ();
@@ -86,21 +91,26 @@
compiz::opengl::PixmapSource source);
public:
- bool damaged;
- Damage damage;
- bool updateMipMap;
+
+ bool damaged;
+ Damage damage;
+ bool updateMipMap;
};
extern std::map boundPixmapTex;
#else
-class TfpTexture : public GLTexture {
+class TfpTexture : public GLTexture
+{
public:
+
TfpTexture ();
~TfpTexture ();
void enable (Filter filter);
+
bool bindTexImage (const GLXPixmap &);
+
void releaseTexImage ();
static List bindPixmapToTexture (Pixmap pixmap,
@@ -110,6 +120,7 @@
compiz::opengl::PixmapSource source);
public:
+
Pixmap x11Pixmap;
GLXPixmap pixmap;
bool damaged;
=== modified file 'plugins/opengl/src/privatevertexbuffer.h'
--- plugins/opengl/src/privatevertexbuffer.h 2012-07-25 09:46:54 +0000
+++ plugins/opengl/src/privatevertexbuffer.h 2013-07-21 23:03:28 +0000
@@ -41,17 +41,20 @@
class AbstractUniform
{
public:
- void virtual set(GLProgram* program) = 0;
+
+ void virtual set (GLProgram *program) = 0;
};
template < typename T, int C >
class Uniform: public AbstractUniform
{
public:
- Uniform(const char *_name, ... );
- void set(GLProgram* program);
+
+ Uniform (const char *_name, ... );
+ void set (GLProgram* program);
public:
+
T a[C];
std::string name;
};
@@ -60,15 +63,17 @@
Uniform< T, C >::Uniform(const char *_name, ... )
{
va_list arg_list;
- va_start( arg_list, _name );
+ va_start (arg_list, _name);
name = _name;
- for( int i = 0; i < C; i++ )
+
+ for (int i = 0; i < C; ++i)
a[i] = va_arg( arg_list, T );
+
va_end( arg_list );
}
template < typename T, int C >
-void Uniform< T, C >::set(GLProgram* prog)
+void Uniform< T, C >::set (GLProgram *prog)
{
const char* n = name.c_str();
@@ -78,24 +83,24 @@
{
switch (C)
{
- case 1: prog->setUniform (n, (GLfloat) a[0]); break;
- case 2: prog->setUniform2f (n, a[0], a[1]); break;
- case 3: prog->setUniform3f (n, a[0], a[1], a[2]); break;
+ case 1: prog->setUniform (n, (GLfloat) a[0]); break;
+ case 2: prog->setUniform2f (n, a[0], a[1]); break;
+ case 3: prog->setUniform3f (n, a[0], a[1], a[2]); break;
case 4: prog->setUniform4f (n, a[0], a[1], a[2], a[3]); break;
}
- } else if (typeid(a[0]) == typeid(int))
+ }
+ else if (typeid(a[0]) == typeid(int))
{
switch (C)
{
- case 1: prog->setUniform (n, (GLint) a[0]); break;
- case 2: prog->setUniform2i (n, a[0], a[1]); break;
- case 3: prog->setUniform3i (n, a[0], a[1], a[2]); break;
+ case 1: prog->setUniform (n, (GLint) a[0]); break;
+ case 2: prog->setUniform2i (n, a[0], a[1]); break;
+ case 3: prog->setUniform3i (n, a[0], a[1], a[2]); break;
case 4: prog->setUniform4i (n, a[0], a[1], a[2], a[3]); break;
}
- } else
- {
+ }
+ else
compLogMessage ("opengl", CompLogLevelError, "Unknown uniform type!");
- }
}
class GLVertexBuffer;
@@ -103,47 +108,50 @@
class PrivateVertexBuffer
{
public:
+
PrivateVertexBuffer ();
~PrivateVertexBuffer ();
int render (const GLMatrix *projection,
const GLMatrix *modelview,
const GLWindowPaintAttrib *attrib);
+
int legacyRender (const GLMatrix &projection,
const GLMatrix &modelview,
const GLWindowPaintAttrib &attrib);
public:
- static GLVertexBuffer *streamingBuffer;
-
- std::vector vertexData;
- std::vector normalData;
- std::vector colorData;
+
+ static GLVertexBuffer *streamingBuffer;
+
+ std::vector vertexData;
+ std::vector normalData;
+ std::vector colorData;
enum
{
MAX_TEXTURES = 4
};
- std::vector textureData[MAX_TEXTURES];
- GLuint nTextures;
-
- GLfloat color[4];
-
- GLuint vertexOffset;
- GLint maxVertices;
-
- GLProgram *program;
- GLenum primitiveType;
- GLenum usage;
-
- GLuint vertexBuffer;
- GLuint normalBuffer;
- GLuint colorBuffer;
- GLuint textureBuffers[4];
+
+ std::vector textureData[MAX_TEXTURES];
+ GLuint nTextures;
+
+ GLfloat color[4];
+
+ GLuint vertexOffset;
+ GLint maxVertices;
+
+ GLProgram *program;
+ GLenum primitiveType;
+ GLenum usage;
+
+ GLuint vertexBuffer;
+ GLuint normalBuffer;
+ GLuint colorBuffer;
+ GLuint textureBuffers[4];
std::vector uniforms;
- GLVertexBuffer::AutoProgram *autoProgram;
+ GLVertexBuffer::AutoProgram *autoProgram;
};
#endif //_VERTEXBUFFER_PRIVATE_H
-
=== modified file 'plugins/opengl/src/program.cpp'
--- plugins/opengl/src/program.cpp 2012-12-04 12:15:34 +0000
+++ plugins/opengl/src/program.cpp 2013-07-21 23:03:28 +0000
@@ -37,15 +37,14 @@
void printShaderInfoLog (GLuint shader)
{
- GLint length = 0;
- GLint chars = 0;
+ GLint length = 0;
+ GLint chars = 0;
(*GL::getShaderiv) (shader, GL::INFO_LOG_LENGTH, &length);
if (length > 0)
{
- GLchar *infoLog;
- infoLog = new GLchar[length];
+ GLchar *infoLog = new GLchar[length];
(*GL::getShaderInfoLog) (shader, length, &chars, infoLog);
std::cout << infoLog << std::endl;
delete[] infoLog;
@@ -54,27 +53,26 @@
void printProgramInfoLog(GLuint program)
{
- GLint length = 0;
- GLint chars = 0;
+ GLint length = 0;
+ GLint chars = 0;
(*GL::getProgramiv) (program, GL::INFO_LOG_LENGTH, &length);
if (length > 0)
{
- GLchar *infoLog;
- infoLog = new GLchar[length];
+ GLchar *infoLog = new GLchar[length];
(*GL::getProgramInfoLog) (program, length, &chars, infoLog);
std::cout << infoLog << std::endl;
delete[] infoLog;
}
}
-static bool compileShader (GLuint *shader, GLenum type, CompString &source)
+static bool compileShader (GLuint *shader,
+ GLenum type,
+ CompString &source)
{
- const GLchar *data;
GLint status;
-
- data = (GLchar *)source.c_str ();
+ const GLchar *data = (GLchar *)source.c_str ();
*shader = (*GL::createShader) (type);
(*GL::shaderSource) (*shader, 1, &data, NULL);
@@ -88,9 +86,9 @@
priv (new PrivateProgram ())
{
GLuint vertex, fragment;
- GLint status;
+ GLint status;
- priv->valid = false;
+ priv->valid = false;
priv->program = (*GL::createProgram) ();
if (!compileShader (&vertex, GL::VERTEX_SHADER, vertexShader))
@@ -114,6 +112,7 @@
(*GL::validateProgram) (priv->program);
(*GL::getProgramiv) (priv->program, GL::LINK_STATUS, &status);
+
if (status == GL_FALSE)
{
printProgramInfoLog (priv->program);
@@ -147,9 +146,11 @@
(*GL::useProgram) (0);
}
-bool GLProgram::setUniform (const char *name, GLfloat value)
+bool GLProgram::setUniform (const char *name,
+ GLfloat value)
{
GLint location = (*GL::getUniformLocation) (priv->program, name);
+
if (location == -1)
return false;
@@ -157,9 +158,11 @@
return true;
}
-bool GLProgram::setUniform (const char *name, GLint value)
+bool GLProgram::setUniform (const char *name,
+ GLint value)
{
GLint location = (*GL::getUniformLocation) (priv->program, name);
+
if (location == -1)
return false;
@@ -167,9 +170,11 @@
return true;
}
-bool GLProgram::setUniform (const char *name, const GLMatrix &value)
+bool GLProgram::setUniform (const char *name,
+ const GLMatrix &value)
{
GLint location = (*GL::getUniformLocation) (priv->program, name);
+
if (location == -1)
return false;
@@ -178,10 +183,11 @@
}
bool GLProgram::setUniform2f (const char *name,
- GLfloat x,
- GLfloat y)
+ GLfloat x,
+ GLfloat y)
{
GLint location = (*GL::getUniformLocation) (priv->program, name);
+
if (location == -1)
return false;
@@ -190,11 +196,12 @@
}
bool GLProgram::setUniform3f (const char *name,
- GLfloat x,
- GLfloat y,
- GLfloat z)
+ GLfloat x,
+ GLfloat y,
+ GLfloat z)
{
GLint location = (*GL::getUniformLocation) (priv->program, name);
+
if (location == -1)
return false;
@@ -203,12 +210,13 @@
}
bool GLProgram::setUniform4f (const char *name,
- GLfloat x,
- GLfloat y,
- GLfloat z,
- GLfloat w)
+ GLfloat x,
+ GLfloat y,
+ GLfloat z,
+ GLfloat w)
{
GLint location = (*GL::getUniformLocation) (priv->program, name);
+
if (location == -1)
return false;
@@ -217,10 +225,11 @@
}
bool GLProgram::setUniform2i (const char *name,
- GLint x,
- GLint y)
+ GLint x,
+ GLint y)
{
GLint location = (*GL::getUniformLocation) (priv->program, name);
+
if (location == -1)
return false;
@@ -229,11 +238,12 @@
}
bool GLProgram::setUniform3i (const char *name,
- GLint x,
- GLint y,
- GLint z)
+ GLint x,
+ GLint y,
+ GLint z)
{
GLint location = (*GL::getUniformLocation) (priv->program, name);
+
if (location == -1)
return false;
@@ -242,12 +252,13 @@
}
bool GLProgram::setUniform4i (const char *name,
- GLint x,
- GLint y,
- GLint z,
- GLint w)
+ GLint x,
+ GLint y,
+ GLint z,
+ GLint w)
{
GLint location = (*GL::getUniformLocation) (priv->program, name);
+
if (location == -1)
return false;
@@ -259,4 +270,3 @@
{
return (*GL::getAttribLocation) (priv->program, name);
}
-
=== modified file 'plugins/opengl/src/programcache.cpp'
--- plugins/opengl/src/programcache.cpp 2013-01-10 08:19:56 +0000
+++ plugins/opengl/src/programcache.cpp 2013-07-21 23:03:28 +0000
@@ -31,58 +31,50 @@
typedef std::pair, access_history_t::iterator> value;
static GLProgram *
-compileProgram (std::string name, std::list shaders)
+compileProgram (std::string name,
+ std::list shaders)
{
- std::list::const_iterator it;
std::string vertex_shader;
std::string fragment_shader;
- std::string vertex_functions = "";
- std::string vertex_function_calls = "";
- std::string fragment_functions = "";
+ std::string vertex_functions = "";
+ std::string vertex_function_calls = "";
+ std::string fragment_functions = "";
std::string fragment_function_calls = "";
- int vpos, vcallpos, fpos, fcallpos;
- for (it = shaders.begin (); it != shaders.end (); ++it)
+ for (std::list::const_iterator it = shaders.begin ();
+ it != shaders.end (); ++it)
{
//find the special shaders to put the rest in
if ((*it)->vertexShader.find ("@VERTEX_FUNCTIONS@") != std::string::npos)
- {
vertex_shader = (*it)->vertexShader;
- }
- else
+
+ else if ((*it)->vertexShader.length ())
{
- if ((*it)->vertexShader.length ())
- {
- vertex_functions += (*it)->vertexShader;
- vertex_function_calls += (*it)->name + "_vertex();\n";
- }
+ vertex_functions += (*it)->vertexShader;
+ vertex_function_calls += (*it)->name + "_vertex();\n";
}
if ((*it)->fragmentShader.find ("@FRAGMENT_FUNCTIONS@") != std::string::npos)
- {
fragment_shader = (*it)->fragmentShader;
- }
- else
+
+ else if ((*it)->fragmentShader.length ())
{
- if ((*it)->fragmentShader.length ())
- {
- fragment_functions += (*it)->fragmentShader;
- fragment_function_calls += (*it)->name + "_fragment();\n";
- }
+ fragment_functions += (*it)->fragmentShader;
+ fragment_function_calls += (*it)->name + "_fragment();\n";
}
}
// put shader functions and function calls into the main shader
- vpos = vertex_shader.find ("@VERTEX_FUNCTIONS@");
+ int vpos = vertex_shader.find ("@VERTEX_FUNCTIONS@");
vertex_shader.replace (vpos, 18, vertex_functions);
- vcallpos = vertex_shader.find ("@VERTEX_FUNCTION_CALLS@");
+ int vcallpos = vertex_shader.find ("@VERTEX_FUNCTION_CALLS@");
vertex_shader.replace (vcallpos, 23, vertex_function_calls);
- fpos = fragment_shader.find ("@FRAGMENT_FUNCTIONS@");
+ int fpos = fragment_shader.find ("@FRAGMENT_FUNCTIONS@");
fragment_shader.replace (fpos, 20, fragment_functions);
- fcallpos = fragment_shader.find ("@FRAGMENT_FUNCTION_CALLS@");
+ int fcallpos = fragment_shader.find ("@FRAGMENT_FUNCTION_CALLS@");
fragment_shader.replace (fcallpos, 25, fragment_function_calls);
return new GLProgram (vertex_shader, fragment_shader);
@@ -91,13 +83,16 @@
class PrivateProgramCache
{
public:
+
PrivateProgramCache (size_t);
const size_t capacity;
access_history_t access_history;
std::map cache;
- void insert (std::string, GLProgram *);
+ void insert (std::string ,
+ GLProgram *);
+
void evict ();
};
@@ -114,10 +109,10 @@
GLProgram* GLProgramCache::operator () (std::list shaders)
{
- std::list::const_iterator name_it;
std::string name;
- for (name_it = shaders.begin(); name_it != shaders.end(); ++name_it)
+ for (std::list::const_iterator name_it = shaders.begin();
+ name_it != shaders.end(); ++name_it)
{
if (name.length () == 0)
name += (*name_it)->name;
@@ -136,8 +131,8 @@
else
{
priv->access_history.splice (priv->access_history.end (),
- priv->access_history,
- (*it).second.second);
+ priv->access_history,
+ (*it).second.second);
(*it).second.second = priv->access_history.rbegin ().base ();
return (*it).second.first.get ();
@@ -149,7 +144,8 @@
{
}
-void PrivateProgramCache::insert (std::string name, GLProgram *program)
+void PrivateProgramCache::insert (std::string name,
+ GLProgram *program)
{
assert (cache.find (name) == cache.end ());
@@ -173,4 +169,3 @@
cache.erase (it);
access_history.pop_front ();
}
-
=== modified file 'plugins/opengl/src/screen.cpp'
--- plugins/opengl/src/screen.cpp 2013-05-15 10:47:42 +0000
+++ plugins/opengl/src/screen.cpp 2013-07-21 23:03:28 +0000
@@ -54,18 +54,18 @@
class DetectionWorkaround
{
public:
- DetectionWorkaround ()
- {
- program_invocation_short_name[0] = 'C';
- }
- ~DetectionWorkaround ()
- {
- program_invocation_short_name[0] = 'c';
- }
+
+ DetectionWorkaround ()
+ {
+ program_invocation_short_name[0] = 'C';
+ }
+ ~DetectionWorkaround ()
+ {
+ program_invocation_short_name[0] = 'c';
+ }
};
#endif
-
using namespace compiz::opengl;
namespace GL {
@@ -75,124 +75,124 @@
GLEGLImageTargetTexture2DOESProc eglImageTargetTexture;
- EGLPostSubBufferNVProc postSubBuffer = NULL;
+ EGLPostSubBufferNVProc postSubBuffer = NULL;
#else
typedef int (*GLXSwapIntervalProc) (int interval);
- GLXBindTexImageProc bindTexImage = NULL;
- GLXReleaseTexImageProc releaseTexImage = NULL;
- GLXQueryDrawableProc queryDrawable = NULL;
- GLXCopySubBufferProc copySubBuffer = NULL;
- GLXGetVideoSyncProc getVideoSync = NULL;
- GLXWaitVideoSyncProc waitVideoSync = NULL;
- GLXSwapIntervalProc swapInterval = NULL;
- GLXGetFBConfigsProc getFBConfigs = NULL;
- GLXGetFBConfigAttribProc getFBConfigAttrib = NULL;
- GLXCreatePixmapProc createPixmap = NULL;
- GLXDestroyPixmapProc destroyPixmap = NULL;
- GLGenProgramsProc genPrograms = NULL;
- GLDeleteProgramsProc deletePrograms = NULL;
- GLBindProgramProc bindProgram = NULL;
- GLProgramStringProc programString = NULL;
- GLProgramParameter4fProc programEnvParameter4f = NULL;
- GLProgramParameter4fProc programLocalParameter4f = NULL;
+ GLXBindTexImageProc bindTexImage = NULL;
+ GLXReleaseTexImageProc releaseTexImage = NULL;
+ GLXQueryDrawableProc queryDrawable = NULL;
+ GLXCopySubBufferProc copySubBuffer = NULL;
+ GLXGetVideoSyncProc getVideoSync = NULL;
+ GLXWaitVideoSyncProc waitVideoSync = NULL;
+ GLXSwapIntervalProc swapInterval = NULL;
+ GLXGetFBConfigsProc getFBConfigs = NULL;
+ GLXGetFBConfigAttribProc getFBConfigAttrib = NULL;
+ GLXCreatePixmapProc createPixmap = NULL;
+ GLXDestroyPixmapProc destroyPixmap = NULL;
+ GLGenProgramsProc genPrograms = NULL;
+ GLDeleteProgramsProc deletePrograms = NULL;
+ GLBindProgramProc bindProgram = NULL;
+ GLProgramStringProc programString = NULL;
+ GLProgramParameter4fProc programEnvParameter4f = NULL;
+ GLProgramParameter4fProc programLocalParameter4f = NULL;
#endif
- GLActiveTextureProc activeTexture = NULL;
- GLClientActiveTextureProc clientActiveTexture = NULL;
- GLMultiTexCoord2fProc multiTexCoord2f = NULL;
-
- GLGenFramebuffersProc genFramebuffers = NULL;
- GLDeleteFramebuffersProc deleteFramebuffers = NULL;
- GLBindFramebufferProc bindFramebuffer = NULL;
- GLCheckFramebufferStatusProc checkFramebufferStatus = NULL;
- GLFramebufferTexture2DProc framebufferTexture2D = NULL;
- GLGenerateMipmapProc generateMipmap = NULL;
-
- GLBindBufferProc bindBuffer = NULL;
- GLDeleteBuffersProc deleteBuffers = NULL;
- GLGenBuffersProc genBuffers = NULL;
- GLBufferDataProc bufferData = NULL;
- GLBufferSubDataProc bufferSubData = NULL;
-
- GLGetShaderivProc getShaderiv = NULL;
- GLGetShaderInfoLogProc getShaderInfoLog = NULL;
- GLGetProgramivProc getProgramiv = NULL;
- GLGetProgramInfoLogProc getProgramInfoLog = NULL;
- GLCreateShaderProc createShader = NULL;
- GLShaderSourceProc shaderSource = NULL;
- GLCompileShaderProc compileShader = NULL;
- GLCreateProgramProc createProgram = NULL;
- GLAttachShaderProc attachShader = NULL;
- GLLinkProgramProc linkProgram = NULL;
- GLValidateProgramProc validateProgram = NULL;
- GLDeleteShaderProc deleteShader = NULL;
- GLDeleteProgramProc deleteProgram = NULL;
- GLUseProgramProc useProgram = NULL;
- GLGetUniformLocationProc getUniformLocation = NULL;
- GLUniform1fProc uniform1f = NULL;
- GLUniform1iProc uniform1i = NULL;
- GLUniform2fProc uniform2f = NULL;
- GLUniform2iProc uniform2i = NULL;
- GLUniform3fProc uniform3f = NULL;
- GLUniform3iProc uniform3i = NULL;
- GLUniform4fProc uniform4f = NULL;
- GLUniform4iProc uniform4i = NULL;
- GLUniformMatrix4fvProc uniformMatrix4fv = NULL;
- GLGetAttribLocationProc getAttribLocation = NULL;
+ GLActiveTextureProc activeTexture = NULL;
+ GLClientActiveTextureProc clientActiveTexture = NULL;
+ GLMultiTexCoord2fProc multiTexCoord2f = NULL;
+
+ GLGenFramebuffersProc genFramebuffers = NULL;
+ GLDeleteFramebuffersProc deleteFramebuffers = NULL;
+ GLBindFramebufferProc bindFramebuffer = NULL;
+ GLCheckFramebufferStatusProc checkFramebufferStatus = NULL;
+ GLFramebufferTexture2DProc framebufferTexture2D = NULL;
+ GLGenerateMipmapProc generateMipmap = NULL;
+
+ GLBindBufferProc bindBuffer = NULL;
+ GLDeleteBuffersProc deleteBuffers = NULL;
+ GLGenBuffersProc genBuffers = NULL;
+ GLBufferDataProc bufferData = NULL;
+ GLBufferSubDataProc bufferSubData = NULL;
+
+ GLGetShaderivProc getShaderiv = NULL;
+ GLGetShaderInfoLogProc getShaderInfoLog = NULL;
+ GLGetProgramivProc getProgramiv = NULL;
+ GLGetProgramInfoLogProc getProgramInfoLog = NULL;
+ GLCreateShaderProc createShader = NULL;
+ GLShaderSourceProc shaderSource = NULL;
+ GLCompileShaderProc compileShader = NULL;
+ GLCreateProgramProc createProgram = NULL;
+ GLAttachShaderProc attachShader = NULL;
+ GLLinkProgramProc linkProgram = NULL;
+ GLValidateProgramProc validateProgram = NULL;
+ GLDeleteShaderProc deleteShader = NULL;
+ GLDeleteProgramProc deleteProgram = NULL;
+ GLUseProgramProc useProgram = NULL;
+ GLGetUniformLocationProc getUniformLocation = NULL;
+ GLUniform1fProc uniform1f = NULL;
+ GLUniform1iProc uniform1i = NULL;
+ GLUniform2fProc uniform2f = NULL;
+ GLUniform2iProc uniform2i = NULL;
+ GLUniform3fProc uniform3f = NULL;
+ GLUniform3iProc uniform3i = NULL;
+ GLUniform4fProc uniform4f = NULL;
+ GLUniform4iProc uniform4i = NULL;
+ GLUniformMatrix4fvProc uniformMatrix4fv = NULL;
+ GLGetAttribLocationProc getAttribLocation = NULL;
#ifndef USE_GLES
- GLCreateShaderObjectARBProc createShaderObjectARB = NULL;
- GLCreateProgramObjectARBProc createProgramObjectARB = NULL;
- GLCompileShaderARBProc compileShaderARB = NULL;
- GLShaderSourceARBProc shaderSourceARB = NULL;
- GLValidateProgramARBProc validateProgramARB = NULL;
- GLDeleteObjectARBProc deleteObjectARB = NULL;
- GLAttachObjectARBProc attachObjectARB = NULL;
- GLLinkProgramARBProc linkProgramARB = NULL;
- GLUseProgramObjectARBProc useProgramObjectARB = NULL;
- GLGetUniformLocationARBProc getUniformLocationARB = NULL;
- GLGetAttribLocationARBProc getAttribLocationARB = NULL;
- GLGetObjectParameterivProc getObjectParameteriv = NULL;
- GLGetInfoLogProc getInfoLog = NULL;
+ GLCreateShaderObjectARBProc createShaderObjectARB = NULL;
+ GLCreateProgramObjectARBProc createProgramObjectARB = NULL;
+ GLCompileShaderARBProc compileShaderARB = NULL;
+ GLShaderSourceARBProc shaderSourceARB = NULL;
+ GLValidateProgramARBProc validateProgramARB = NULL;
+ GLDeleteObjectARBProc deleteObjectARB = NULL;
+ GLAttachObjectARBProc attachObjectARB = NULL;
+ GLLinkProgramARBProc linkProgramARB = NULL;
+ GLUseProgramObjectARBProc useProgramObjectARB = NULL;
+ GLGetUniformLocationARBProc getUniformLocationARB = NULL;
+ GLGetAttribLocationARBProc getAttribLocationARB = NULL;
+ GLGetObjectParameterivProc getObjectParameteriv = NULL;
+ GLGetInfoLogProc getInfoLog = NULL;
#endif
- GLEnableVertexAttribArrayProc enableVertexAttribArray = NULL;
+ GLEnableVertexAttribArrayProc enableVertexAttribArray = NULL;
GLDisableVertexAttribArrayProc disableVertexAttribArray = NULL;
- GLVertexAttribPointerProc vertexAttribPointer = NULL;
-
- GLGenRenderbuffersProc genRenderbuffers = NULL;
- GLDeleteRenderbuffersProc deleteRenderbuffers = NULL;
- GLFramebufferRenderbufferProc framebufferRenderbuffer = NULL;
- GLBindRenderbufferProc bindRenderbuffer = NULL;
- GLRenderbufferStorageProc renderbufferStorage = NULL;
-
- bool textureFromPixmap = true;
- bool textureRectangle = false;
- bool textureNonPowerOfTwo = false;
- bool textureNonPowerOfTwoMipmap = false;
- bool textureEnvCombine = false;
- bool textureEnvCrossbar = false;
- bool textureBorderClamp = false;
- bool textureCompression = false;
- GLint maxTextureSize = 0;
- bool fboSupported = false;
- bool fboEnabled = false;
- bool fboStencilSupported = false;
- bool vboSupported = false;
- bool vboEnabled = false;
- bool shaders = false;
- GLint maxTextureUnits = 1;
-
- bool canDoSaturated = false;
- bool canDoSlightlySaturated = false;
-
- unsigned int vsyncCount = 0;
-
- bool stencilBuffer = false;
+ GLVertexAttribPointerProc vertexAttribPointer = NULL;
+
+ GLGenRenderbuffersProc genRenderbuffers = NULL;
+ GLDeleteRenderbuffersProc deleteRenderbuffers = NULL;
+ GLFramebufferRenderbufferProc framebufferRenderbuffer = NULL;
+ GLBindRenderbufferProc bindRenderbuffer = NULL;
+ GLRenderbufferStorageProc renderbufferStorage = NULL;
+
+ bool textureFromPixmap = true;
+ bool textureRectangle = false;
+ bool textureNonPowerOfTwo = false;
+ bool textureNonPowerOfTwoMipmap = false;
+ bool textureEnvCombine = false;
+ bool textureEnvCrossbar = false;
+ bool textureBorderClamp = false;
+ bool textureCompression = false;
+ GLint maxTextureSize = 0;
+ bool fboSupported = false;
+ bool fboEnabled = false;
+ bool fboStencilSupported = false;
+ bool vboSupported = false;
+ bool vboEnabled = false;
+ bool shaders = false;
+ GLint maxTextureUnits = 1;
+
+ bool canDoSaturated = false;
+ bool canDoSlightlySaturated = false;
+
+ unsigned int vsyncCount = 0;
+
+ bool stencilBuffer = false;
#ifndef USE_GLES
GLuint createShaderARBWrapper (GLenum type)
@@ -205,7 +205,10 @@
return static_cast ((GL::createProgramObjectARB) ());
}
- void shaderSourceARBWrapper (GLuint shader, GLsizei count, const GLchar **string, const GLint *length)
+ void shaderSourceARBWrapper (GLuint shader,
+ GLsizei count,
+ const GLchar **string,
+ const GLint *length)
{
(GL::shaderSourceARB) (static_cast (shader), count, string, length);
}
@@ -230,7 +233,8 @@
(GL::deleteObjectARB) (static_cast (program));
}
- void attachShaderARBWrapper (GLuint program, GLuint shader)
+ void attachShaderARBWrapper (GLuint program,
+ GLuint shader)
{
(GL::attachObjectARB) (static_cast (program), static_cast (shader));
}
@@ -245,32 +249,44 @@
(GL::useProgramObjectARB) (static_cast (program));
}
- int getUniformLocationARBWrapper (GLuint program, const GLchar *name)
+ int getUniformLocationARBWrapper (GLuint program,
+ const GLchar *name)
{
return (GL::getUniformLocationARB) (static_cast (program), name);
}
- int getAttribLocationARBWrapper (GLuint program, const GLchar *name)
+ int getAttribLocationARBWrapper (GLuint program,
+ const GLchar *name)
{
return (GL::getAttribLocationARB) (static_cast (program), name);
}
- void getProgramInfoLogARBWrapper (GLuint object, int maxLen, int *len, char *log)
- {
- (GL::getInfoLog) (static_cast (object), maxLen, len, log);
- }
-
- void getShaderInfoLogARBWrapper (GLuint object, int maxLen, int *len, char *log)
- {
- (GL::getInfoLog) (static_cast (object), maxLen, len, log);
- }
-
- void getShaderivARBWrapper (GLuint object, GLenum type, int *param)
+ void getProgramInfoLogARBWrapper (GLuint object,
+ int maxLen,
+ int *len,
+ char *log)
+ {
+ (GL::getInfoLog) (static_cast (object), maxLen, len, log);
+ }
+
+ void getShaderInfoLogARBWrapper (GLuint object,
+ int maxLen,
+ int *len,
+ char *log)
+ {
+ (GL::getInfoLog) (static_cast (object), maxLen, len, log);
+ }
+
+ void getShaderivARBWrapper (GLuint object,
+ GLenum type,
+ int *param)
{
(GL::getObjectParameteriv) (static_cast (object), type, param);
}
- void getProgramivARBWrapper (GLuint object, GLenum type, int *param)
+ void getProgramivARBWrapper (GLuint object,
+ GLenum type,
+ int *param)
{
(GL::getObjectParameteriv) (static_cast (object), type, param);
}
@@ -286,14 +302,15 @@
class GLScreenAutoProgram : public GLVertexBuffer::AutoProgram
{
public:
+
GLScreenAutoProgram (GLScreen *gScreen) : gScreen(gScreen) {}
GLProgram *getProgram (GLShaderParameters ¶ms)
{
- const GLShaderData *shaderData = gScreen->getShaderData (params);
- std::list tempShaders;
- tempShaders.push_back (shaderData);
- return gScreen->getProgram (tempShaders);
+ const GLShaderData *shaderData = gScreen->getShaderData (params);
+ std::list tempShaders;
+ tempShaders.push_back (shaderData);
+ return gScreen->getProgram (tempShaders);
}
GLScreen *gScreen;
@@ -341,13 +358,14 @@
{
namespace opengl
{
-void swapIntervalEGL (Display *display, int interval)
+void swapIntervalEGL (Display *display,
+ int interval)
{
eglSwapInterval (eglGetDisplay (display), interval);
}
-int waitVSyncEGL (int wait,
- int remainder,
+int waitVSyncEGL (int wait,
+ int remainder,
unsigned int *count)
{
/* not supported */
@@ -365,37 +383,37 @@
DetectionWorkaround workaround;
#endif
- #ifdef USE_GLES
- Display *xdpy;
- Window overlay;
- EGLDisplay dpy;
- EGLConfig config;
- EGLint major, minor;
- const char *eglExtensions, *glExtensions;
- XWindowAttributes attr;
- EGLint count, visualid;
- EGLConfig configs[1024];
- CompOption::Vector o (0);
-
- const EGLint config_attribs[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- EGL_RED_SIZE, 1,
- EGL_GREEN_SIZE, 1,
- EGL_BLUE_SIZE, 1,
- EGL_ALPHA_SIZE, 0,
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
- EGL_CONFIG_CAVEAT, EGL_NONE,
- EGL_STENCIL_SIZE, 1,
- EGL_NONE
- };
-
- const EGLint context_attribs[] = {
- EGL_CONTEXT_CLIENT_VERSION, 2,
- EGL_NONE
- };
-
- xdpy = screen->dpy ();
- dpy = eglGetDisplay ((EGLNativeDisplayType)xdpy);
+#ifdef USE_GLES
+ Window overlay;
+ EGLint major, minor;
+ const char *eglExtensions, *glExtensions;
+ XWindowAttributes attr;
+ EGLint count;
+ EGLConfig configs[1024];
+ CompOption::Vector o (0);
+
+ const EGLint config_attribs[] =
+ {
+ EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_ALPHA_SIZE, 0,
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+ EGL_CONFIG_CAVEAT, EGL_NONE,
+ EGL_STENCIL_SIZE, 1,
+ EGL_NONE
+ };
+
+ const EGLint context_attribs[] =
+ {
+ EGL_CONTEXT_CLIENT_VERSION, 2,
+ EGL_NONE
+ };
+
+ Display *xdpy = screen->dpy ();
+ EGLDisplay dpy = eglGetDisplay ((EGLNativeDisplayType)xdpy);
+
if (!eglInitialize (dpy, &major, &minor))
{
screen->handleCompizEvent ("opengl", "fatal_fallback", o);
@@ -416,6 +434,7 @@
return false;
}
+<<<<<<< TREE
EGLint val;
int msaaBuffers = MAXSHORT;
int msaaSamples = MAXSHORT;
@@ -442,14 +461,46 @@
config = configs[i];
break;
+=======
+ EGLint val;
+ int msaaBuffers = MAXSHORT;
+ int msaaSamples = MAXSHORT;
+ EGLint visualid = XVisualIDFromVisual (attr.visual);
+ EGLConfig config = configs[0];
+
+ for (int i = 0; i < count; ++i)
+ {
+ eglGetConfigAttrib (dpy, configs[i], EGL_SAMPLE_BUFFERS, &val);
+
+ if (val > msaaBuffers)
+ continue;
+
+ msaaBuffers = val;
+
+ eglGetConfigAttrib (dpy, configs[i], EGL_SAMPLES, &val);
+
+ if (val > msaaSamples)
+ continue;
+
+ msaaSamples = val;
+
+ eglGetConfigAttrib (dpy, configs[i], EGL_NATIVE_VISUAL_ID, &val);
+
+ if (val != visualid)
+ continue;
+
+ config = configs[i];
+ break;
+>>>>>>> MERGE-SOURCE
}
overlay = CompositeScreen::get (screen)->overlay ();
priv->surface = eglCreateWindowSurface (dpy, config, overlay, 0);
+
if (priv->surface == EGL_NO_SURFACE)
{
compLogMessage ("opengl", CompLogLevelFatal,
- "eglCreateWindowSurface failed");
+ "eglCreateWindowSurface failed");
screen->handleCompizEvent ("opengl", "fatal_fallback", o);
return false;
}
@@ -458,6 +509,7 @@
eglSurfaceAttrib (dpy, priv->surface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED);
priv->ctx = eglCreateContext (dpy, config, EGL_NO_CONTEXT, context_attribs);
+
if (priv->ctx == EGL_NO_CONTEXT)
{
compLogMessage ("opengl", CompLogLevelFatal, "eglCreateContext failed");
@@ -474,7 +526,7 @@
}
eglExtensions = (const char *) eglQueryString (dpy, EGL_EXTENSIONS);
- glExtensions = (const char *) glGetString (GL_EXTENSIONS);
+ glExtensions = (const char *) glGetString (GL_EXTENSIONS);
if (!glExtensions || !eglExtensions)
{
@@ -484,15 +536,15 @@
return false;
}
- GL::textureFromPixmap = true;
+ GL::textureFromPixmap = true;
GL::textureNonPowerOfTwo = true;
- GL::fboSupported = true;
- GL::fboEnabled = true;
- GL::vboSupported = true;
- GL::vboEnabled = true;
- GL::shaders = true;
- GL::stencilBuffer = true;
- GL::maxTextureUnits = 4;
+ GL::fboSupported = true;
+ GL::fboEnabled = true;
+ GL::vboSupported = true;
+ GL::vboEnabled = true;
+ GL::shaders = true;
+ GL::stencilBuffer = true;
+ GL::maxTextureUnits = 4;
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &GL::maxTextureSize);
GL::createImage = (GL::EGLCreateImageKHRProc)
@@ -503,7 +555,7 @@
eglGetProcAddress ("glEGLImageTargetTexture2DOES");
if (!strstr (eglExtensions, "EGL_KHR_image_pixmap") ||
- !strstr (glExtensions, "GL_OES_EGL_image") ||
+ !strstr (glExtensions, "GL_OES_EGL_image") ||
!GL::createImage || !GL::destroyImage || !GL::eglImageTargetTexture)
{
compLogMessage ("opengl", CompLogLevelFatal,
@@ -531,7 +583,7 @@
eglGetProcAddress ("eglPostSubBufferNV");
GL::fboStencilSupported = GL::fboSupported &&
- strstr (glExtensions, "GL_OES_packed_depth_stencil");
+ strstr (glExtensions, "GL_OES_packed_depth_stencil");
if (!GL::fboSupported &&
!GL::postSubBuffer)
@@ -542,59 +594,64 @@
return false;
}
- GL::activeTexture = glActiveTexture;
- GL::genFramebuffers = glGenFramebuffers;
- GL::deleteFramebuffers = glDeleteFramebuffers;
- GL::bindFramebuffer = glBindFramebuffer;
- GL::checkFramebufferStatus = glCheckFramebufferStatus;
- GL::framebufferTexture2D = glFramebufferTexture2D;
- GL::generateMipmap = glGenerateMipmap;
-
- GL::bindBuffer = glBindBuffer;
- GL::deleteBuffers = glDeleteBuffers;
- GL::genBuffers = glGenBuffers;
- GL::bufferData = glBufferData;
- GL::bufferSubData = glBufferSubData;
-
- GL::getShaderiv = glGetShaderiv;
- GL::getShaderInfoLog = glGetShaderInfoLog;
- GL::getProgramiv = glGetProgramiv;
- GL::getProgramInfoLog = glGetProgramInfoLog;
- GL::createShader = glCreateShader;
- GL::shaderSource = (GL::GLShaderSourceProc) glShaderSource;
- GL::compileShader = glCompileShader;
- GL::createProgram = glCreateProgram;
- GL::attachShader = glAttachShader;
- GL::linkProgram = glLinkProgram;
- GL::validateProgram = glValidateProgram;
- GL::deleteShader = glDeleteShader;
- GL::deleteProgram = glDeleteProgram;
- GL::useProgram = glUseProgram;
- GL::getUniformLocation = glGetUniformLocation;
- GL::uniform1f = glUniform1f;
- GL::uniform1i = glUniform1i;
- GL::uniform2f = glUniform2f;
- GL::uniform2i = glUniform2i;
- GL::uniform3f = glUniform3f;
- GL::uniform3i = glUniform3i;
- GL::uniform4f = glUniform4f;
- GL::uniform4i = glUniform4i;
- GL::uniformMatrix4fv = glUniformMatrix4fv;
- GL::getAttribLocation = glGetAttribLocation;
-
- GL::enableVertexAttribArray = glEnableVertexAttribArray;
+ GL::activeTexture = glActiveTexture;
+ GL::genFramebuffers = glGenFramebuffers;
+ GL::deleteFramebuffers = glDeleteFramebuffers;
+ GL::bindFramebuffer = glBindFramebuffer;
+ GL::checkFramebufferStatus = glCheckFramebufferStatus;
+ GL::framebufferTexture2D = glFramebufferTexture2D;
+ GL::generateMipmap = glGenerateMipmap;
+
+ GL::bindBuffer = glBindBuffer;
+ GL::deleteBuffers = glDeleteBuffers;
+ GL::genBuffers = glGenBuffers;
+ GL::bufferData = glBufferData;
+ GL::bufferSubData = glBufferSubData;
+
+ GL::getShaderiv = glGetShaderiv;
+ GL::getShaderInfoLog = glGetShaderInfoLog;
+ GL::getProgramiv = glGetProgramiv;
+ GL::getProgramInfoLog = glGetProgramInfoLog;
+ GL::createShader = glCreateShader;
+ GL::shaderSource = (GL::GLShaderSourceProc) glShaderSource;
+ GL::compileShader = glCompileShader;
+ GL::createProgram = glCreateProgram;
+ GL::attachShader = glAttachShader;
+ GL::linkProgram = glLinkProgram;
+ GL::validateProgram = glValidateProgram;
+ GL::deleteShader = glDeleteShader;
+ GL::deleteProgram = glDeleteProgram;
+ GL::useProgram = glUseProgram;
+ GL::getUniformLocation = glGetUniformLocation;
+ GL::uniform1f = glUniform1f;
+ GL::uniform1i = glUniform1i;
+ GL::uniform2f = glUniform2f;
+ GL::uniform2i = glUniform2i;
+ GL::uniform3f = glUniform3f;
+ GL::uniform3i = glUniform3i;
+ GL::uniform4f = glUniform4f;
+ GL::uniform4i = glUniform4i;
+ GL::uniformMatrix4fv = glUniformMatrix4fv;
+ GL::getAttribLocation = glGetAttribLocation;
+
+ GL::enableVertexAttribArray = glEnableVertexAttribArray;
GL::disableVertexAttribArray = glDisableVertexAttribArray;
- GL::vertexAttribPointer = glVertexAttribPointer;
+ GL::vertexAttribPointer = glVertexAttribPointer;
- GL::genRenderbuffers = glGenRenderbuffers;
- GL::deleteRenderbuffers = glDeleteRenderbuffers;
- GL::bindRenderbuffer = glBindRenderbuffer;
- GL::framebufferRenderbuffer = glFramebufferRenderbuffer;
- GL::renderbufferStorage = glRenderbufferStorage;
+ GL::genRenderbuffers = glGenRenderbuffers;
+ GL::deleteRenderbuffers = glDeleteRenderbuffers;
+ GL::bindRenderbuffer = glBindRenderbuffer;
+ GL::framebufferRenderbuffer = glFramebufferRenderbuffer;
+ GL::renderbufferStorage = glRenderbufferStorage;
glClearColor (0.0, 0.0, 0.0, 1.0);
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- glEnable (GL_BLEND);
+
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
glEnable (GL_CULL_FACE);
priv->updateView ();
@@ -612,15 +669,16 @@
#else
- Display *dpy = screen->dpy ();
- const char *glExtensions;
- GLfloat globalAmbient[] = { 0.1f, 0.1f, 0.1f, 0.1f };
- GLfloat ambientLight[] = { 0.0f, 0.0f, 0.0f, 0.0f };
- GLfloat diffuseLight[] = { 0.9f, 0.9f, 0.9f, 0.9f };
- GLfloat light0Position[] = { -0.5f, 0.5f, -9.0f, 1.0f };
+ Display *dpy = screen->dpy ();
+ const char *glExtensions;
+ GLfloat globalAmbient[] = { 0.1f, 0.1f, 0.1f, 0.1f };
+ GLfloat ambientLight[] = { 0.0f, 0.0f, 0.0f, 0.0f };
+ GLfloat diffuseLight[] = { 0.9f, 0.9f, 0.9f, 0.9f };
+ GLfloat light0Position[] = { -0.5f, 0.5f, -9.0f, 1.0f };
CompOption::Vector o (0);
priv->ctx = glXCreateContext (dpy, visinfo, NULL, True);
+
if (!priv->ctx)
{
compLogMessage ("opengl", CompLogLevelWarn,
@@ -648,6 +706,7 @@
glXMakeCurrent (dpy, CompositeScreen::get (screen)->output (), priv->ctx);
glExtensions = (const char *) glGetString (GL_EXTENSIONS);
+
if (!glExtensions)
{
compLogMessage ("opengl", CompLogLevelFatal,
@@ -656,13 +715,13 @@
return false;
}
- const char *glVendor = (const char *) glGetString (GL_VENDOR);
+ const char *glVendor = (const char *) glGetString (GL_VENDOR);
const char *glRenderer = (const char *) glGetString (GL_RENDERER);
- const char *glVersion = (const char *) glGetString (GL_VERSION);
+ const char *glVersion = (const char *) glGetString (GL_VERSION);
- priv->glVendor = glVendor;
+ priv->glVendor = glVendor;
priv->glRenderer = glRenderer;
- priv->glVersion = glVersion;
+ priv->glVersion = glVersion;
if (glRenderer != NULL &&
(strcmp (glRenderer, "Software Rasterizer") == 0 ||
@@ -675,8 +734,9 @@
return false;
}
- priv->commonFrontbuffer = true;
+ priv->commonFrontbuffer = true;
priv->incorrectRefreshRate = false;
+
if (glRenderer != NULL && strstr (glRenderer, "on llvmpipe"))
{
/*
@@ -691,7 +751,7 @@
if (glVendor != NULL && strstr (glVendor, "NVIDIA"))
{
- /*
+ /* TODO: Check if this is still necessary:
* NVIDIA provides an incorrect refresh rate, we need to
* force 60Hz */
priv->incorrectRefreshRate = true;
@@ -699,6 +759,7 @@
if (strstr (glExtensions, "GL_ARB_texture_non_power_of_two"))
GL::textureNonPowerOfTwo = true;
+
GL::textureNonPowerOfTwoMipmap = GL::textureNonPowerOfTwo;
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &GL::maxTextureSize);
@@ -714,6 +775,7 @@
GLint maxTextureSize;
glGetIntegerv (GL_MAX_RECTANGLE_TEXTURE_SIZE_NV, &maxTextureSize);
+
if (maxTextureSize > GL::maxTextureSize)
GL::maxTextureSize = maxTextureSize;
}
@@ -731,7 +793,7 @@
{
GL::textureEnvCombine = true;
- /* XXX: GL_NV_texture_env_combine4 need special code but it seams to
+ /* XXX: GL_NV_texture_env_combine4 need special code but it seems to
be working anyway for now... */
if (strstr (glExtensions, "GL_ARB_texture_env_crossbar") ||
strstr (glExtensions, "GL_NV_texture_env_combine4"))
@@ -743,6 +805,7 @@
GL::textureBorderClamp = true;
GL::maxTextureUnits = 1;
+
if (strstr (glExtensions, "GL_ARB_multitexture"))
{
GL::activeTexture = (GL::GLActiveTextureProc)
@@ -781,18 +844,17 @@
GL::renderbufferStorage = (GL::GLRenderbufferStorageProc)
getProcAddress ("glRenderbufferStorageEXT");
- if (GL::genFramebuffers &&
- GL::deleteFramebuffers &&
- GL::bindFramebuffer &&
- GL::checkFramebufferStatus &&
- GL::framebufferTexture2D &&
- GL::generateMipmap &&
- GL::genRenderbuffers &&
- GL::deleteRenderbuffers &&
- GL::bindRenderbuffer &&
- GL::framebufferRenderbuffer &&
- GL::renderbufferStorage
- )
+ if (GL::genFramebuffers &&
+ GL::deleteFramebuffers &&
+ GL::bindFramebuffer &&
+ GL::checkFramebufferStatus &&
+ GL::framebufferTexture2D &&
+ GL::generateMipmap &&
+ GL::genRenderbuffers &&
+ GL::deleteRenderbuffers &&
+ GL::bindRenderbuffer &&
+ GL::framebufferRenderbuffer &&
+ GL::renderbufferStorage)
GL::fboSupported = true;
}
@@ -822,53 +884,53 @@
priv->updateRenderMode ();
- if (strstr (glExtensions, "GL_ARB_fragment_shader") &&
- strstr (glExtensions, "GL_ARB_vertex_shader") &&
- strstr (glExtensions, "GL_ARB_shader_objects") &&
+ if (strstr (glExtensions, "GL_ARB_fragment_shader") &&
+ strstr (glExtensions, "GL_ARB_vertex_shader") &&
+ strstr (glExtensions, "GL_ARB_shader_objects") &&
strstr (glExtensions, "GL_ARB_shading_language_100"))
{
- GL::getShaderiv = (GL::GLGetShaderivProc) GL::getShaderivARBWrapper;
- GL::getShaderInfoLog = (GL::GLGetShaderInfoLogProc) GL::getShaderInfoLogARBWrapper;
- GL::getProgramiv = (GL::GLGetProgramivProc) GL::getProgramivARBWrapper;
- GL::getProgramInfoLog = (GL::GLGetProgramInfoLogProc) GL::getProgramInfoLogARBWrapper;
- GL::getObjectParameteriv = (GL::GLGetObjectParameterivProc) getProcAddress ("glGetObjectParameterivARB");
- GL::getInfoLog = (GL::GLGetInfoLogProc) getProcAddress ("glGetInfoLogARB");
- GL::createShader = (GL::GLCreateShaderProc) GL::createShaderARBWrapper;
- GL::createShaderObjectARB = (GL::GLCreateShaderObjectARBProc) getProcAddress ("glCreateShaderObjectARB");
- GL::shaderSource = (GL::GLShaderSourceProc) GL::shaderSourceARBWrapper;
- GL::shaderSourceARB = (GL::GLShaderSourceARBProc) getProcAddress ("glShaderSourceARB");
- GL::compileShader = (GL::GLCompileShaderProc) GL::compileShaderARBWrapper;
- GL::compileShaderARB = (GL::GLCompileShaderARBProc) getProcAddress ("glCompileShaderARB");
- GL::createProgram = (GL::GLCreateProgramProc) GL::createProgramARBWrapper;
- GL::createProgramObjectARB = (GL::GLCreateProgramObjectARBProc) getProcAddress ("glCreateProgramObjectARB");
- GL::attachShader = GL::attachShaderARBWrapper;
- GL::attachObjectARB = (GL::GLAttachObjectARBProc) getProcAddress ("glAttachObjectARB");
- GL::linkProgram = GL::linkProgramARBWrapper;
- GL::linkProgramARB = (GL::GLLinkProgramARBProc) getProcAddress ("glLinkProgramARB");
- GL::validateProgram = GL::validateProgramARBWrapper;
- GL::validateProgramARB = (GL::GLValidateProgramARBProc) getProcAddress ("glValidateProgramARB");
- GL::deleteShader = GL::deleteShaderARBWrapper;
- GL::deleteProgram = GL::deleteProgramARBWrapper;
- GL::deleteObjectARB = (GL::GLDeleteObjectARBProc) getProcAddress ("glDeleteObjectARB");
- GL::useProgram = GL::useProgramARBWrapper;
- GL::useProgramObjectARB = (GL::GLUseProgramObjectARBProc) getProcAddress ("glUseProgramObjectARB");
- GL::getUniformLocation = GL::getUniformLocationARBWrapper;
- GL::getUniformLocationARB = (GL::GLGetUniformLocationARBProc) getProcAddress ("glGetUniformLocationARB");
- GL::uniform1f = (GL::GLUniform1fProc) getProcAddress ("glUniform1fARB");
- GL::uniform1i = (GL::GLUniform1iProc) getProcAddress ("glUniform1iARB");
- GL::uniform2f = (GL::GLUniform2fProc) getProcAddress ("glUniform2fARB");
- GL::uniform2i = (GL::GLUniform2iProc) getProcAddress ("glUniform2iARB");
- GL::uniform3f = (GL::GLUniform3fProc) getProcAddress ("glUniform3fARB");
- GL::uniform3i = (GL::GLUniform3iProc) getProcAddress ("glUniform3iARB");
- GL::uniform4f = (GL::GLUniform4fProc) getProcAddress ("glUniform4fARB");
- GL::uniform4i = (GL::GLUniform4iProc) getProcAddress ("glUniform4iARB");
- GL::uniformMatrix4fv = (GL::GLUniformMatrix4fvProc) getProcAddress ("glUniformMatrix4fvARB");
- GL::getAttribLocation = (GL::GLGetAttribLocationProc) GL::getAttribLocationARBWrapper;
- GL::getAttribLocationARB = (GL::GLGetAttribLocationARBProc) getProcAddress ("glGetAttribLocationARB");
+ GL::getShaderiv = (GL::GLGetShaderivProc) GL::getShaderivARBWrapper;
+ GL::getShaderInfoLog = (GL::GLGetShaderInfoLogProc) GL::getShaderInfoLogARBWrapper;
+ GL::getProgramiv = (GL::GLGetProgramivProc) GL::getProgramivARBWrapper;
+ GL::getProgramInfoLog = (GL::GLGetProgramInfoLogProc) GL::getProgramInfoLogARBWrapper;
+ GL::getObjectParameteriv = (GL::GLGetObjectParameterivProc) getProcAddress ("glGetObjectParameterivARB");
+ GL::getInfoLog = (GL::GLGetInfoLogProc) getProcAddress ("glGetInfoLogARB");
+ GL::createShader = (GL::GLCreateShaderProc) GL::createShaderARBWrapper;
+ GL::createShaderObjectARB = (GL::GLCreateShaderObjectARBProc) getProcAddress ("glCreateShaderObjectARB");
+ GL::shaderSource = (GL::GLShaderSourceProc) GL::shaderSourceARBWrapper;
+ GL::shaderSourceARB = (GL::GLShaderSourceARBProc) getProcAddress ("glShaderSourceARB");
+ GL::compileShader = (GL::GLCompileShaderProc) GL::compileShaderARBWrapper;
+ GL::compileShaderARB = (GL::GLCompileShaderARBProc) getProcAddress ("glCompileShaderARB");
+ GL::createProgram = (GL::GLCreateProgramProc) GL::createProgramARBWrapper;
+ GL::createProgramObjectARB = (GL::GLCreateProgramObjectARBProc) getProcAddress ("glCreateProgramObjectARB");
+ GL::attachShader = GL::attachShaderARBWrapper;
+ GL::attachObjectARB = (GL::GLAttachObjectARBProc) getProcAddress ("glAttachObjectARB");
+ GL::linkProgram = GL::linkProgramARBWrapper;
+ GL::linkProgramARB = (GL::GLLinkProgramARBProc) getProcAddress ("glLinkProgramARB");
+ GL::validateProgram = GL::validateProgramARBWrapper;
+ GL::validateProgramARB = (GL::GLValidateProgramARBProc) getProcAddress ("glValidateProgramARB");
+ GL::deleteShader = GL::deleteShaderARBWrapper;
+ GL::deleteProgram = GL::deleteProgramARBWrapper;
+ GL::deleteObjectARB = (GL::GLDeleteObjectARBProc) getProcAddress ("glDeleteObjectARB");
+ GL::useProgram = GL::useProgramARBWrapper;
+ GL::useProgramObjectARB = (GL::GLUseProgramObjectARBProc) getProcAddress ("glUseProgramObjectARB");
+ GL::getUniformLocation = GL::getUniformLocationARBWrapper;
+ GL::getUniformLocationARB = (GL::GLGetUniformLocationARBProc) getProcAddress ("glGetUniformLocationARB");
+ GL::uniform1f = (GL::GLUniform1fProc) getProcAddress ("glUniform1fARB");
+ GL::uniform1i = (GL::GLUniform1iProc) getProcAddress ("glUniform1iARB");
+ GL::uniform2f = (GL::GLUniform2fProc) getProcAddress ("glUniform2fARB");
+ GL::uniform2i = (GL::GLUniform2iProc) getProcAddress ("glUniform2iARB");
+ GL::uniform3f = (GL::GLUniform3fProc) getProcAddress ("glUniform3fARB");
+ GL::uniform3i = (GL::GLUniform3iProc) getProcAddress ("glUniform3iARB");
+ GL::uniform4f = (GL::GLUniform4fProc) getProcAddress ("glUniform4fARB");
+ GL::uniform4i = (GL::GLUniform4iProc) getProcAddress ("glUniform4iARB");
+ GL::uniformMatrix4fv = (GL::GLUniformMatrix4fvProc) getProcAddress ("glUniformMatrix4fvARB");
+ GL::getAttribLocation = (GL::GLGetAttribLocationProc) GL::getAttribLocationARBWrapper;
+ GL::getAttribLocationARB = (GL::GLGetAttribLocationARBProc) getProcAddress ("glGetAttribLocationARB");
- GL::enableVertexAttribArray = (GL::GLEnableVertexAttribArrayProc) getProcAddress ("glEnableVertexAttribArrayARB");
+ GL::enableVertexAttribArray = (GL::GLEnableVertexAttribArrayProc) getProcAddress ("glEnableVertexAttribArrayARB");
GL::disableVertexAttribArray = (GL::GLDisableVertexAttribArrayProc) getProcAddress ("glDisableVertexAttribArrayARB");
- GL::vertexAttribPointer = (GL::GLVertexAttribPointerProc) getProcAddress ("glVertexAttribPointerARB");
+ GL::vertexAttribPointer = (GL::GLVertexAttribPointerProc) getProcAddress ("glVertexAttribPointerARB");
GL::shaders = true;
}
@@ -886,6 +948,7 @@
if (GL::textureEnvCombine && GL::maxTextureUnits >= 2)
{
GL::canDoSaturated = true;
+
if (GL::textureEnvCrossbar && GL::maxTextureUnits >= 4)
GL::canDoSlightlySaturated = true;
}
@@ -905,7 +968,6 @@
priv->lighting = false;
-
priv->filter[NOTHING_TRANS_FILTER] = GLTexture::Fast;
priv->filter[SCREEN_TRANS_FILTER] = GLTexture::Good;
priv->filter[WINDOW_TRANS_FILTER] = GLTexture::Good;
@@ -936,13 +998,13 @@
DetectionWorkaround workaround;
#endif
- XVisualInfo *visinfo = NULL;
+ XVisualInfo *visinfo = NULL;
#ifndef USE_GLES
- Display *dpy = s->dpy ();
- XVisualInfo templ;
- GLXFBConfig *fbConfigs;
- int defaultDepth, nvisinfo, nElements, value, i;
- const char *glxExtensions;
+ Display *dpy = s->dpy ();
+ XVisualInfo templ;
+ GLXFBConfig *fbConfigs;
+ int defaultDepth, nvisinfo, nElements, value;
+ const char *glxExtensions;
XWindowAttributes attr;
CompOption::Vector o (0);
@@ -956,6 +1018,7 @@
templ.visualid = XVisualIDFromVisual (attr.visual);
visinfo = XGetVisualInfo (dpy, VisualIDMask, &templ, &nvisinfo);
+
if (!nvisinfo)
{
compLogMessage ("opengl", CompLogLevelFatal,
@@ -968,6 +1031,7 @@
defaultDepth = visinfo->depth;
glXGetConfig (dpy, visinfo, GLX_USE_GL, &value);
+
if (!value)
{
compLogMessage ("opengl", CompLogLevelFatal,
@@ -979,6 +1043,7 @@
}
glXGetConfig (dpy, visinfo, GLX_DOUBLEBUFFER, &value);
+
if (!value)
{
compLogMessage ("opengl", CompLogLevelFatal,
@@ -994,8 +1059,8 @@
if (glxExtensions == NULL)
{
compLogMessage ("opengl", CompLogLevelFatal,
- "glXQueryExtensionsString is NULL for screen %d",
- s->screenNum ());
+ "glXQueryExtensionsString is NULL for screen %d",
+ s->screenNum ());
screen->handleCompizEvent ("opengl", "fatal_fallback", o);
setFailed ();
return;
@@ -1010,25 +1075,17 @@
return;
}
- priv->getProcAddress = (GL::GLXGetProcAddressProc)
- getProcAddress ("glXGetProcAddressARB");
- GL::bindTexImage = (GL::GLXBindTexImageProc)
- getProcAddress ("glXBindTexImageEXT");
- GL::releaseTexImage = (GL::GLXReleaseTexImageProc)
- getProcAddress ("glXReleaseTexImageEXT");
- GL::queryDrawable = (GL::GLXQueryDrawableProc)
- getProcAddress ("glXQueryDrawable");
- GL::getFBConfigs = (GL::GLXGetFBConfigsProc)
- getProcAddress ("glXGetFBConfigs");
- GL::getFBConfigAttrib = (GL::GLXGetFBConfigAttribProc)
- getProcAddress ("glXGetFBConfigAttrib");
- GL::createPixmap = (GL::GLXCreatePixmapProc)
- getProcAddress ("glXCreatePixmap");
- GL::destroyPixmap = (GL::GLXDestroyPixmapProc)
- getProcAddress ("glXDestroyPixmap");
+ priv->getProcAddress = (GL::GLXGetProcAddressProc) getProcAddress ("glXGetProcAddressARB");
+ GL::bindTexImage = (GL::GLXBindTexImageProc) getProcAddress ("glXBindTexImageEXT");
+ GL::releaseTexImage = (GL::GLXReleaseTexImageProc) getProcAddress ("glXReleaseTexImageEXT");
+ GL::queryDrawable = (GL::GLXQueryDrawableProc) getProcAddress ("glXQueryDrawable");
+ GL::getFBConfigs = (GL::GLXGetFBConfigsProc) getProcAddress ("glXGetFBConfigs");
+ GL::getFBConfigAttrib = (GL::GLXGetFBConfigAttribProc) getProcAddress ("glXGetFBConfigAttrib");
+ GL::createPixmap = (GL::GLXCreatePixmapProc) getProcAddress ("glXCreatePixmap");
+ GL::destroyPixmap = (GL::GLXDestroyPixmapProc) getProcAddress ("glXDestroyPixmap");
if (!strstr (glxExtensions, "GLX_EXT_texture_from_pixmap") ||
- !GL::bindTexImage || !GL::releaseTexImage)
+ !GL::bindTexImage || !GL::releaseTexImage)
{
compLogMessage ("opengl", CompLogLevelFatal,
"GLX_EXT_texture_from_pixmap is missing");
@@ -1051,38 +1108,48 @@
}
if (strstr (glxExtensions, "GLX_MESA_copy_sub_buffer"))
- GL::copySubBuffer = (GL::GLXCopySubBufferProc)
- getProcAddress ("glXCopySubBufferMESA");
+ GL::copySubBuffer = (GL::GLXCopySubBufferProc) getProcAddress ("glXCopySubBufferMESA");
if (strstr (glxExtensions, "GLX_SGI_video_sync"))
{
- GL::getVideoSync = (GL::GLXGetVideoSyncProc)
- getProcAddress ("glXGetVideoSyncSGI");
-
- GL::waitVideoSync = (GL::GLXWaitVideoSyncProc)
- getProcAddress ("glXWaitVideoSyncSGI");
+ GL::getVideoSync = (GL::GLXGetVideoSyncProc) getProcAddress ("glXGetVideoSyncSGI");
+ GL::waitVideoSync = (GL::GLXWaitVideoSyncProc) getProcAddress ("glXWaitVideoSyncSGI");
}
if (strstr (glxExtensions, "GLX_SGI_swap_control"))
{
- GL::swapInterval = (GL::GLXSwapIntervalProc)
- getProcAddress ("glXSwapIntervalSGI");
+ GL::swapInterval = (GL::GLXSwapIntervalProc) getProcAddress ("glXSwapIntervalSGI");
}
fbConfigs = (*GL::getFBConfigs) (dpy, s->screenNum (), &nElements);
GL::stencilBuffer = false;
- for (i = 0; i <= MAX_DEPTH; i++)
+ int alpha;
+ int db = MAXSHORT;
+ int stencil = MAXSHORT;
+ int depth = MAXSHORT;
+ int msaaBuffers = MAXSHORT;
+ int msaaSamples = MAXSHORT;
+ int mipmap = 0;
+ int rgba = 0;
+ int visualDepth;
+ XVisualInfo *vi;
+
+ for (int i = 0; i <= MAX_DEPTH; ++i)
{
+<<<<<<< TREE
int j, db, stencil, depth, alpha, mipmap, msaaBuffers, msaaSamples, rgba;
+=======
+>>>>>>> MERGE-SOURCE
priv->glxPixmapFBConfigs[i].fbConfig = NULL;
priv->glxPixmapFBConfigs[i].mipmap = 0;
priv->glxPixmapFBConfigs[i].yInverted = 0;
priv->glxPixmapFBConfigs[i].textureFormat = 0;
priv->glxPixmapFBConfigs[i].textureTargets = 0;
+<<<<<<< TREE
db = MAXSHORT;
stencil = MAXSHORT;
depth = MAXSHORT;
@@ -1092,11 +1159,12 @@
rgba = 0;
for (j = 0; j < nElements; j++)
+=======
+ for (int j = 0; j < nElements; ++j)
+>>>>>>> MERGE-SOURCE
{
- XVisualInfo *vi;
- int visualDepth;
-
vi = glXGetVisualFromFBConfig (dpy, fbConfigs[j]);
+
if (vi == NULL)
continue;
@@ -1107,14 +1175,14 @@
if (visualDepth != i)
continue;
- (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
- GLX_ALPHA_SIZE, &alpha);
- (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
- GLX_BUFFER_SIZE, &value);
+ (*GL::getFBConfigAttrib) (dpy, fbConfigs[j], GLX_ALPHA_SIZE, &alpha);
+ (*GL::getFBConfigAttrib) (dpy, fbConfigs[j], GLX_BUFFER_SIZE, &value);
+
if (value != i && (value - alpha) != i)
continue;
value = 0;
+
if (i == 32)
{
(*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
@@ -1165,21 +1233,39 @@
depth = value;
(*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
- GLX_SAMPLE_BUFFERS, &value);
- if (value > msaaBuffers)
- continue;
-
- msaaBuffers = value;
-
- (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
- GLX_SAMPLES, &value);
- if (value > msaaSamples)
- continue;
-
- msaaSamples = value;
-
- (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
- GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &value);
+<<<<<<< TREE
+ GLX_SAMPLE_BUFFERS, &value);
+ if (value > msaaBuffers)
+ continue;
+
+ msaaBuffers = value;
+
+ (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
+ GLX_SAMPLES, &value);
+ if (value > msaaSamples)
+ continue;
+
+ msaaSamples = value;
+
+ (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
+ GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &value);
+=======
+ GLX_SAMPLE_BUFFERS, &value);
+ if (value > msaaBuffers)
+ continue;
+
+ msaaBuffers = value;
+
+ (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
+ GLX_SAMPLES, &value);
+ if (value > msaaSamples)
+ continue;
+
+ msaaSamples = value;
+
+ (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
+ GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &value);
+>>>>>>> MERGE-SOURCE
if (value < mipmap)
continue;
@@ -1194,14 +1280,12 @@
GLX_BIND_TO_TEXTURE_TARGETS_EXT, &value);
priv->glxPixmapFBConfigs[i].textureTargets = value;
-
- priv->glxPixmapFBConfigs[i].fbConfig = fbConfigs[j];
- priv->glxPixmapFBConfigs[i].mipmap = mipmap;
+ priv->glxPixmapFBConfigs[i].fbConfig = fbConfigs[j];
+ priv->glxPixmapFBConfigs[i].mipmap = mipmap;
}
- if (i == defaultDepth)
- if (stencil != MAXSHORT)
- GL::stencilBuffer = true;
+ if (i == defaultDepth && stencil != MAXSHORT)
+ GL::stencilBuffer = true;
}
if (nElements)
@@ -1227,12 +1311,14 @@
CompositeScreen::get (screen)->unregisterPaintHandler ();
#ifdef USE_GLES
- Display *xdpy = screen->dpy ();
- EGLDisplay dpy = eglGetDisplay (xdpy);
+ Display *xdpy = screen->dpy ();
+ EGLDisplay dpy = eglGetDisplay (xdpy);
eglMakeCurrent (dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+
if (priv->ctx != EGL_NO_CONTEXT)
eglDestroyContext (dpy, priv->ctx);
+
eglDestroySurface (dpy, priv->surface);
eglTerminate (dpy);
eglReleaseThread ();
@@ -1248,12 +1334,14 @@
delete priv;
}
-PrivateGLScreen::PrivateGLScreen (GLScreen *gs) :
+PrivateGLScreen::PrivateGLScreen (GLScreen *gs) :
gScreen (gs),
cScreen (CompositeScreen::get (screen)),
textureFilter (GL_LINEAR),
+ glxPixmapFBConfigs (),
backgroundTextures (),
backgroundLoaded (false),
+ filter (),
rasterPos (0, 0),
projection (NULL),
clearBuffers (true),
@@ -1268,15 +1356,17 @@
#endif
scratchFbo (NULL),
outputRegion (),
+ lastViewport (),
refreshSubBuffer (false),
lastMask (0),
bindPixmap (),
hasCompositing (false),
commonFrontbuffer (true),
incorrectRefreshRate (false),
+ saveWindow (),
programCache (new GLProgramCache (30)),
shaderCache (),
- autoProgram (new GLScreenAutoProgram(gs)),
+ autoProgram (new GLScreenAutoProgram (gs)),
rootPixmapCopy (None),
rootPixmapSize (),
glVendor (NULL),
@@ -1293,15 +1383,13 @@
delete projection;
delete programCache;
delete autoProgram;
+
if (rootPixmapCopy)
XFreePixmap (screen->dpy (), rootPixmapCopy);
-
}
GLushort defaultColor[4] = { 0xffff, 0xffff, 0xffff, 0xffff };
-
-
GLenum
GLScreen::textureFilter ()
{
@@ -1321,11 +1409,14 @@
screen->handleEvent (event);
- switch (event->type) {
+ switch (event->type)
+ {
case ConfigureNotify:
if (event->xconfigure.window == screen->root ())
updateScreenBackground ();
+
break;
+
case PropertyNotify:
if (event->xproperty.atom == Atoms::xBackground[0] ||
event->xproperty.atom == Atoms::xBackground[1])
@@ -1338,15 +1429,18 @@
event->xproperty.atom == Atoms::winSaturation)
{
w = screen->findWindow (event->xproperty.window);
+
if (w)
GLWindow::get (w)->updatePaintAttribs ();
}
else if (event->xproperty.atom == Atoms::wmIcon)
{
w = screen->findWindow (event->xproperty.window);
+
if (w)
GLWindow::get (w)->priv->icons.clear ();
}
+
break;
default:
@@ -1362,9 +1456,7 @@
boundPixmapTex.find (de->damage);
#endif
if (it != boundPixmapTex.end ())
- {
it->second->damaged = true;
- }
/* XXX: It would be nice if we could also update
* the background of the root window when the root
@@ -1374,6 +1466,7 @@
* be recopying the root window pixmap all the time
* which is no good, so don't do that */
}
+
break;
}
}
@@ -1384,7 +1477,6 @@
clearOutput (targetOutput, mask);
}
-
static void
frustum (GLfloat *m,
GLfloat left,
@@ -1394,14 +1486,12 @@
GLfloat nearval,
GLfloat farval)
{
- GLfloat x, y, a, b, c, d;
-
- x = (2.0 * nearval) / (right - left);
- y = (2.0 * nearval) / (top - bottom);
- a = (right + left) / (right - left);
- b = (top + bottom) / (top - bottom);
- c = -(farval + nearval) / ( farval - nearval);
- d = -(2.0 * farval * nearval) / (farval - nearval);
+ GLfloat x = (2.0 * nearval) / (right - left);
+ GLfloat y = (2.0 * nearval) / (top - bottom);
+ GLfloat a = (right + left) / (right - left);
+ GLfloat b = (top + bottom) / (top - bottom);
+ GLfloat c = -(farval + nearval) / (farval - nearval);
+ GLfloat d = -(2.0 * farval * nearval) / (farval - nearval);
#define M(row,col) m[col * 4 + row]
M(0,0) = x; M(0,1) = 0.0f; M(0,2) = a; M(0,3) = 0.0f;
@@ -1419,12 +1509,10 @@
GLfloat zNear,
GLfloat zFar)
{
- GLfloat xmin, xmax, ymin, ymax;
-
- ymax = zNear * tan (fovy * M_PI / 360.0);
- ymin = -ymax;
- xmin = ymin * aspect;
- xmax = ymax * aspect;
+ GLfloat ymax = zNear * tan (fovy * M_PI / 360.0);
+ GLfloat ymin = -ymax;
+ GLfloat xmin = ymin * aspect;
+ GLfloat xmax = ymax * aspect;
frustum (m, xmin, xmax, ymin, ymax, zNear, zFar);
}
@@ -1450,6 +1538,7 @@
if (projection != NULL)
delete projection;
+
projection = new GLMatrix (projection_array);
#ifndef USE_GLES
@@ -1478,6 +1567,7 @@
if (scratchFbo)
scratchFbo->allocate (*screen, NULL, GL_BGRA);
+
updateView ();
}
@@ -1500,6 +1590,7 @@
{
dlerror ();
funcPtr = (GL::FuncPtr) dlsym (dlhand, name);
+
if (dlerror () != NULL)
funcPtr = NULL;
}
@@ -1512,18 +1603,18 @@
void
PrivateGLScreen::updateScreenBackground ()
{
- Display *dpy = screen->dpy ();
- Atom pixmapAtom, actualType;
- int actualFormat, i, status;
+ Display *dpy = screen->dpy ();
+ Atom actualType;
+ int actualFormat, status;
unsigned int width = 1, height = 1, depth = 0;
unsigned long nItems;
unsigned long bytesAfter;
unsigned char *prop;
- Pixmap pixmap = None;
-
- pixmapAtom = XInternAtom (dpy, "PIXMAP", false);
-
- for (i = 0; pixmap == 0 && i < 2; i++)
+ Pixmap pixmap = None;
+
+ Atom pixmapAtom = XInternAtom (dpy, "PIXMAP", false);
+
+ for (int i = 0; pixmap == 0 && i < 2; ++i)
{
status = XGetWindowProperty (dpy, screen->root (),
Atoms::xBackground[i],
@@ -1544,15 +1635,13 @@
if (p)
{
unsigned int ui;
- int i;
- Window w;
+ int i;
+ Window w;
if (XGetGeometry (dpy, p, &w, &i, &i,
- &width, &height, &ui, &depth))
- {
- if ((int) depth == screen->attrib ().depth)
- pixmap = p;
- }
+ &width, &height, &ui, &depth) &&
+ (int) depth == screen->attrib ().depth)
+ pixmap = p;
}
}
@@ -1564,17 +1653,14 @@
{
backgroundTextures =
GLTexture::bindPixmapToTexture (pixmap, width, height, depth);
+
if (backgroundTextures.empty ())
- {
compLogMessage ("core", CompLogLevelWarn,
"Couldn't bind background pixmap 0x%x to "
"texture", (int) pixmap);
- }
}
else
- {
backgroundTextures.clear ();
- }
if (backgroundTextures.empty ())
{
@@ -1584,7 +1670,7 @@
GC gc;
gcv.graphics_exposures = false;
- gcv.subwindow_mode = IncludeInferiors;
+ gcv.subwindow_mode = IncludeInferiors;
gc = XCreateGC (screen->dpy (), screen->root (),
GCGraphicsExposures | GCSubwindowMode, &gcv);
@@ -1605,11 +1691,9 @@
DefaultDepth (screen->dpy (), DefaultScreen (screen->dpy ())));
if (backgroundTextures.empty ())
- {
compLogMessage ("core", CompLogLevelWarn,
"Couldn't bind background pixmap 0x%x to "
"texture", (int) screen->width ());
- }
}
if (rootPixmapCopy)
@@ -1619,9 +1703,7 @@
XSync (screen->dpy (), false);
}
else
- {
backgroundTextures.clear ();
- }
XFreeGC(dpy, gc);
}
@@ -1711,7 +1793,7 @@
void
GLScreenInterface::glBufferStencil(const GLMatrix &matrix,
GLVertexBuffer &vertexBuffer,
- CompOutput *output)
+ CompOutput *output)
WRAPABLE_DEF (glBufferStencil, matrix, vertexBuffer, output)
GLMatrix *
@@ -1747,7 +1829,8 @@
}
void
-GLScreen::setFilter (int num, GLTexture::Filter filter)
+GLScreen::setFilter (int num,
+ GLTexture::Filter filter)
{
priv->filter[num] = filter;
}
@@ -1766,9 +1849,9 @@
{
BoxPtr pBox = &output->region ()->extents;
- if (pBox->x1 != 0 ||
- pBox->y1 != 0 ||
- pBox->x2 != (int) screen->width () ||
+ if (pBox->x1 != 0 ||
+ pBox->y1 != 0 ||
+ pBox->x2 != (int) screen->width () ||
pBox->y2 != (int) screen->height ())
{
glEnable (GL_SCISSOR_TEST);
@@ -1780,9 +1863,7 @@
glDisable (GL_SCISSOR_TEST);
}
else
- {
glClear (mask);
- }
}
void
@@ -1825,7 +1906,7 @@
const compiz::opengl::impl::GLXSwapIntervalEXTFunc &swapIntervalFunc,
const compiz::opengl::impl::GLXWaitVideoSyncSGIFunc &waitVideoSyncFunc) :
compiz::opengl::DoubleBuffer (swapIntervalFunc, waitVideoSyncFunc),
- mDpy (d),
+ mDpy (d),
mSize (s)
{
}
@@ -1914,6 +1995,7 @@
glLoadIdentity ();
glDrawBuffer (GL_FRONT);
+
foreach (const CompRect &r, blitRects)
{
int x = r.x1 ();
@@ -1921,6 +2003,7 @@
glRasterPos2i (x, y);
glCopyPixels (x, y, w, h, GL_COLOR);
}
+
glDrawBuffer (GL_BACK);
glPopMatrix ();
@@ -1929,7 +2012,6 @@
glMatrixMode (GL_MODELVIEW);
glFlush ();
-
}
#else
@@ -1960,7 +2042,7 @@
EGLDoubleBuffer::blit (const CompRegion ®ion) const
{
CompRect::vector blitRects (region.rects ());
- int y = 0;
+ int y = 0;
foreach (const CompRect &r, blitRects)
{
@@ -1997,35 +2079,45 @@
unsigned int mask,
const CompRegion ®ion)
{
- if (clearBuffers)
- {
- if (mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK)
- glClear (GL_COLOR_BUFFER_BIT);
- }
+ if (clearBuffers &&
+ mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK)
+ glClear (GL_COLOR_BUFFER_BIT);
// Disable everything that we don't usually need and could slow us down
- glDisable (GL_BLEND);
- glDisable (GL_STENCIL_TEST);
- glDisable (GL_DEPTH_TEST);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+ GLboolean glStencilEnabled = glIsEnabled (GL_STENCIL_TEST);
+ GLboolean glDepthEnabled = glIsEnabled (GL_DEPTH_TEST);
+
+ // just disable global states if they are enabled
+ if (glBlendEnabled)
+ glDisable (GL_BLEND);
+
+ if (glStencilEnabled)
+ glDisable (GL_STENCIL_TEST);
+
+ if (glDepthEnabled)
+ glDisable (GL_DEPTH_TEST);
+
glDepthMask (GL_FALSE);
glStencilMask (0);
GLFramebufferObject *oldFbo = NULL;
- bool useFbo = false;
+ bool useFbo = false;
/* Clear the color buffer where appropriate */
if (GL::fboEnabled && scratchFbo)
{
oldFbo = scratchFbo->bind ();
useFbo = scratchFbo->checkStatus () && scratchFbo->tex ();
+
if (!useFbo)
GLFramebufferObject::rebind (oldFbo);
}
#ifdef UNSAFE_ARM_SGX_FIXME
- refreshSubBuffer = ((lastMask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK) &&
- !(mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK) &&
- (mask & COMPOSITE_SCREEN_DAMAGE_REGION_MASK));
+ refreshSubBuffer = ((lastMask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK) &&
+ !(mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK) &&
+ (mask & COMPOSITE_SCREEN_DAMAGE_REGION_MASK));
if (refreshSubBuffer)
{
@@ -2035,16 +2127,18 @@
// Posting a fullscreen damage region to the SGX seems to reset the
// framebuffer, causing the screen to blackout.
cScreen->damageRegion (CompRegion (screen->fullscreenOutput ()) -
- CompRegion (CompRect(0, 0, 1, 1)));
+ CompRegion (CompRect(0, 0, 1, 1)));
}
#endif
CompRegion tmpRegion = (mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK) ?
- screen->region () : region;
+ screen->region () : region;
+
+ XRectangle r;
+ GLMatrix identity;
foreach (CompOutput *output, outputs)
{
- XRectangle r;
targetOutput = output;
r.x = output->x1 ();
@@ -2063,8 +2157,6 @@
if (mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK)
{
- GLMatrix identity;
-
gScreen->glPaintOutput (defaultScreenPaintAttrib,
identity,
CompRegion (*output), output,
@@ -2073,8 +2165,6 @@
}
else if (mask & COMPOSITE_SCREEN_DAMAGE_REGION_MASK)
{
- GLMatrix identity;
-
#ifdef UNSAFE_ARM_SGX_FIXME
/*
* FIXME:
@@ -2134,10 +2224,10 @@
}
bool alwaysSwap = optionGetAlwaysSwapBuffers ();
- bool fullscreen = useFbo ||
- alwaysSwap ||
- ((mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK) &&
- commonFrontbuffer);
+ bool fullscreen = useFbo ||
+ alwaysSwap ||
+ ((mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK) &&
+ commonFrontbuffer);
doubleBuffer.set (DoubleBuffer::VSYNC, optionGetSyncToVblank ());
doubleBuffer.set (DoubleBuffer::HAVE_PERSISTENT_BACK_BUFFER, useFbo);
@@ -2184,6 +2274,7 @@
{
bool wasFboEnabled = GL::fboEnabled;
updateRenderMode ();
+
if (wasFboEnabled != GL::fboEnabled)
CompositeScreen::get (screen)->damageScreen ();
}
@@ -2198,8 +2289,9 @@
if (prevRegex != regex)
{
prevBlacklisted = blacklisted (regex, glVendor, glRenderer, glVersion);
- prevRegex = regex;
+ prevRegex = regex;
}
+
return prevBlacklisted;
}
@@ -2207,9 +2299,11 @@
GLScreen::registerBindPixmap (GLTexture::BindPixmapProc proc)
{
priv->bindPixmap.push_back (proc);
+
if (!priv->hasCompositing &&
CompositeScreen::get (screen)->registerPaintHandler (priv))
priv->hasCompositing = true;
+
return priv->bindPixmap.size () - 1;
}
@@ -2217,10 +2311,13 @@
GLScreen::unregisterBindPixmap (GLTexture::BindPixmapHandle hnd)
{
bool hasBP = false;
+
priv->bindPixmap[hnd].clear ();
- for (unsigned int i = 0; i < priv->bindPixmap.size (); i++)
+
+ for (unsigned int i = 0; i < priv->bindPixmap.size (); ++i)
if (!priv->bindPixmap[i].empty ())
hasBP = true;
+
if (!hasBP && priv->hasCompositing)
{
CompositeScreen::get (screen)->unregisterPaintHandler ();
@@ -2240,10 +2337,9 @@
CompIcon *i = screen->defaultIcon ();
CompSize size;
- if (!i)
- return NULL;
-
- if (!i->width () || !i->height ())
+ if (!i ||
+ !i->width () ||
+ !i->height ())
return NULL;
if (priv->defaultIcon.icon == i)
@@ -2272,4 +2368,3 @@
priv->rasterPos.setX (0);
priv->rasterPos.setY (0);
}
-
=== modified file 'plugins/opengl/src/shadercache.cpp'
--- plugins/opengl/src/shadercache.cpp 2013-01-09 10:45:16 +0000
+++ plugins/opengl/src/shadercache.cpp 2013-07-21 23:03:28 +0000
@@ -33,9 +33,10 @@
class GLShaderParametersComparer
{
public:
+
bool operator()(const GLShaderParameters &left, const GLShaderParameters &right) const
{
- return left.hash() < right.hash();
+ return left.hash() < right.hash();
}
};
@@ -48,6 +49,7 @@
class PrivateShaderCache
{
public:
+
PrivateShaderCache() {}
ShaderMapType::const_iterator addShaderData(const GLShaderParameters ¶ms);
@@ -65,12 +67,12 @@
int
GLShaderParameters::hash() const
{
- return static_cast(opacity) |
- (static_cast(brightness) << 1) |
- (static_cast(saturation) << 2) |
- (static_cast(color) << 3) |
- (static_cast(normal) << 5) |
- (static_cast(numTextures) << 8);
+ return static_cast(opacity) |
+ (static_cast(brightness) << 1) |
+ (static_cast(saturation) << 2) |
+ (static_cast(color) << 3) |
+ (static_cast(normal) << 5) |
+ (static_cast(numTextures) << 8);
}
std::string
@@ -78,14 +80,15 @@
{
std::stringstream ss;
- ss << (opacity ? "t" : "f");
+ ss << (opacity ? "t" : "f");
ss << (brightness ? "t" : "f");
ss << (saturation ? "t" : "f");
- ss << (color == GLShaderVariableNone ? "n" :
- color == GLShaderVariableUniform ? "u" : "v");
-
- ss << (normal == GLShaderVariableNone ? "n" :
- normal == GLShaderVariableUniform ? "u" : "v");
+ ss << (color == GLShaderVariableNone ?
+ "n" : color == GLShaderVariableUniform ? "u" : "v");
+
+ ss << (normal == GLShaderVariableNone ?
+ "n" : normal == GLShaderVariableUniform ? "u" : "v");
+
ss << numTextures;
return ss.str();
@@ -113,7 +116,7 @@
// Try to find a cached shader pair that matches the parameters.
// If we don't have it cached, create it.
if ((iter = priv->shaderMap.find (params)) == priv->shaderMap.end ())
- iter = priv->addShaderData (params);
+ iter = priv->addShaderData (params);
return iter->second;
}
@@ -127,12 +130,13 @@
{
GLShaderData shaderData;
- shaderData.name = params.id ();
+ shaderData.name = params.id ();
shaderData.fragmentShader = createFragmentShader (params);
- shaderData.vertexShader = createVertexShader (params);
+ shaderData.vertexShader = createVertexShader (params);
std::pair ret =
- shaderMap.insert(std::pair(params,shaderData));
+ shaderMap.insert(std::pair(params,shaderData));
return ret.first;
}
@@ -150,35 +154,35 @@
std::stringstream ss;
ss << "#ifdef GL_ES\n" <<
- "precision mediump float;\n" <<
- "#endif\n";
+ "precision mediump float;\n" <<
+ "#endif\n";
ss << "uniform mat4 modelview;\n" <<
- "uniform mat4 projection;\n";
+ "uniform mat4 projection;\n";
ss << "attribute vec3 position;\n" <<
- "attribute vec3 normal;\n" <<
- "attribute vec4 color;\n" <<
- "attribute vec2 texCoord0;\n" <<
- "attribute vec2 texCoord1;\n" <<
- "attribute vec2 texCoord2;\n" <<
- "attribute vec2 texCoord3;\n";
+ "attribute vec3 normal;\n" <<
+ "attribute vec4 color;\n" <<
+ "attribute vec2 texCoord0;\n" <<
+ "attribute vec2 texCoord1;\n" <<
+ "attribute vec2 texCoord2;\n" <<
+ "attribute vec2 texCoord3;\n";
ss << "@VERTEX_FUNCTIONS@\n";
if (params.color == GLShaderVariableVarying)
- ss << "varying vec4 vColor;\n";
+ ss << "varying vec4 vColor;\n";
- for (int i = 0; i < params.numTextures; i++)
- ss << "varying vec2 vTexCoord" << i << ";\n";
+ for (int i = 0; i < params.numTextures; ++i)
+ ss << "varying vec2 vTexCoord" << i << ";\n";
ss << "void main() {\n";
- for (int i = 0; i < params.numTextures; i++)
- ss << "vTexCoord" << i << " = texCoord" << i <<";\n";
+ for (int i = 0; i < params.numTextures; ++i)
+ ss << "vTexCoord" << i << " = texCoord" << i <<";\n";
if (params.color == GLShaderVariableVarying)
- ss << "vColor = color;\n";
+ ss << "vColor = color;\n";
ss << "gl_Position = projection * modelview * vec4(position, 1.0);\n";
@@ -199,50 +203,52 @@
{
std::stringstream ss;
ss << "#ifdef GL_ES\n" <<
- "precision mediump float;\n" <<
- "#endif\n";
+ "precision mediump float;\n" <<
+ "#endif\n";
ss << "uniform vec3 paintAttrib;\n";
- for (int i = 0; i < params.numTextures; i++) {
- ss << "uniform sampler2D texture" << i << ";\n";
- ss << "varying vec2 vTexCoord" << i << ";\n";
+ for (int i = 0; i < params.numTextures; ++i)
+ {
+ ss << "uniform sampler2D texture" << i << ";\n";
+ ss << "varying vec2 vTexCoord" << i << ";\n";
}
if (params.color == GLShaderVariableUniform)
- ss << "uniform vec4 singleColor;\n";
+ ss << "uniform vec4 singleColor;\n";
else if (params.color == GLShaderVariableVarying)
- ss << "varying vec4 vColor;\n";
+ ss << "varying vec4 vColor;\n";
ss << "@FRAGMENT_FUNCTIONS@\n";
ss << "void main() {\n vec4 color = ";
if (params.color == GLShaderVariableUniform)
- ss << "singleColor *";
+ ss << "singleColor *";
else if (params.color == GLShaderVariableVarying)
- ss << "vColor *";
+ ss << "vColor *";
- for (int i = 0; i < params.numTextures; i++)
- ss << " texture2D(texture" << i << ", vTexCoord" << i << ") *";
+ for (int i = 0; i < params.numTextures; ++i)
+ ss << " texture2D(texture" << i << ", vTexCoord" << i << ") *";
ss << " 1.0;\n";
- if (params.saturation) {
+ if (params.saturation)
+ {
ss << "vec3 desaturated = color.rgb * vec3 (0.30, 0.59, 0.11);\n" <<
"desaturated = vec3 (dot (desaturated, color.rgb));\n" <<
"color.rgb = color.rgb * vec3 (paintAttrib.z) + desaturated *\n" <<
" vec3 (1.0 - paintAttrib.z);\n";
}
- if (params.brightness) {
+ if (params.brightness)
+ {
ss << "color.rgb = color.rgb * paintAttrib.y" <<
(params.opacity ? " * paintAttrib.x;\n" : ";\n") <<
(params.opacity ? "color.a = color.a * paintAttrib.x;\n" : "");
}
- else if (params.opacity) {
+ else if (params.opacity)
ss << "color = color * paintAttrib.x;\n";
- }
ss << "gl_FragColor = color;\n";
ss << "@FRAGMENT_FUNCTION_CALLS@\n}";
=== modified file 'plugins/opengl/src/texture.cpp'
--- plugins/opengl/src/texture.cpp 2012-09-19 12:18:34 +0000
+++ plugins/opengl/src/texture.cpp 2013-07-21 23:03:28 +0000
@@ -48,7 +48,8 @@
std::map boundPixmapTex;
#endif
-static GLTexture::Matrix _identity_matrix = {
+static GLTexture::Matrix _identity_matrix =
+{
1.0f, 0.0f,
0.0f, 1.0f,
0.0f, 0.0f
@@ -62,14 +63,14 @@
GLTexture::List::List (unsigned int size) :
std::vector (size)
{
- for (unsigned int i = 0; i < size; i++)
+ for (unsigned int i = 0; i < size; ++i)
at (i) = NULL;
}
GLTexture::List::List (const GLTexture::List &c) :
std::vector (c.size ())
{
- for (unsigned int i = 0; i < c.size (); i++)
+ for (unsigned int i = 0; i < c.size (); ++i)
{
at (i) = c[i];
GLTexture::incRef (c[i]);
@@ -88,11 +89,13 @@
{
this->clear ();
resize (c.size ());
- for (unsigned int i = 0; i < c.size (); i++)
+
+ for (unsigned int i = 0; i < c.size (); ++i)
{
at (i) = c[i];
GLTexture::incRef (c[i]);
}
+
return *this;
}
@@ -102,6 +105,7 @@
foreach (GLTexture *t, *this)
if (t)
GLTexture::decRef (t);
+
std::vector ::clear ();
}
@@ -119,15 +123,15 @@
PrivateTexture::PrivateTexture (GLTexture *texture) :
texture (texture),
- name (0),
- target (GL_TEXTURE_2D),
- filter (GL_NEAREST),
- wrap (GL_CLAMP_TO_EDGE),
- matrix (_identity_matrix),
- mipmap (true),
+ name (0),
+ target (GL_TEXTURE_2D),
+ filter (GL_NEAREST),
+ wrap (GL_CLAMP_TO_EDGE),
+ matrix (_identity_matrix),
+ mipmap (true),
mipmapSupport (false),
- initial (true),
- refCount (1)
+ initial (true),
+ refCount (1)
{
glGenTextures (1, &name);
}
@@ -135,9 +139,7 @@
PrivateTexture::~PrivateTexture ()
{
if (name)
- {
glDeleteTextures (1, &name);
- }
}
GLuint
@@ -235,13 +237,11 @@
}
}
- if (priv->filter == GL_LINEAR_MIPMAP_LINEAR)
+ if (priv->filter == GL_LINEAR_MIPMAP_LINEAR &&
+ priv->initial)
{
- if (priv->initial)
- {
- GL::generateMipmap (priv->target);
- priv->initial = false;
- }
+ GL::generateMipmap (priv->target);
+ priv->initial = false;
}
}
@@ -255,10 +255,12 @@
}
void
-GLTexture::setData (GLenum target, Matrix &m, bool mipmap)
+GLTexture::setData (GLenum target,
+ Matrix &m,
+ bool mipmap)
{
- priv->target = target;
- priv->matrix = m;
+ priv->target = target;
+ priv->matrix = m;
priv->mipmapSupport = mipmap;
}
@@ -307,37 +309,36 @@
GLTexture::List rv (1);
GLTexture *t = new GLTexture ();
- rv[0] = t;
+ rv[0] = t;
GLTexture::Matrix matrix = _identity_matrix;
- GLint internalFormat;
GLenum target;
bool mipmap;
bool pot = POWER_OF_TWO (width) && POWER_OF_TWO (height);
#ifdef USE_GLES
- target = GL_TEXTURE_2D;
+ target = GL_TEXTURE_2D;
matrix.xx = 1.0f / width;
matrix.yy = 1.0f / height;
matrix.y0 = 0.0f;
- mipmap = GL::textureNonPowerOfTwoMipmap || pot;
+ mipmap = GL::textureNonPowerOfTwoMipmap || pot;
#else
if (GL::textureNonPowerOfTwo || pot)
{
- target = GL_TEXTURE_2D;
+ target = GL_TEXTURE_2D;
matrix.xx = 1.0f / width;
matrix.yy = 1.0f / height;
matrix.y0 = 0.0f;
- mipmap = GL::generateMipmap && (GL::textureNonPowerOfTwoMipmap || pot);
+ mipmap = GL::generateMipmap && (GL::textureNonPowerOfTwoMipmap || pot);
}
else
{
- target = GL_TEXTURE_RECTANGLE_NV;
+ target = GL_TEXTURE_RECTANGLE_NV;
matrix.xx = 1.0f;
matrix.yy = 1.0f;
matrix.y0 = 0.0f;
- mipmap = false;
+ mipmap = false;
}
#endif
@@ -348,22 +349,21 @@
#ifdef USE_GLES
// For GLES2 no format conversion is allowed, i.e., format must equal internalFormat
- internalFormat = format;
+ GLint internalFormat = format;
#else
- internalFormat = GL_RGBA;
+ GLint internalFormat = GL_RGBA;
#endif
#ifndef USE_GLES
- CompOption *opt;
- opt = GLScreen::get (screen)->getOption ("texture_compression");
+ CompOption *opt = GLScreen::get (screen)->getOption ("texture_compression");
+
if (opt->value ().b () && GL::textureCompression)
internalFormat = GL_COMPRESSED_RGBA_ARB;
#endif
glBindTexture (target, t->name ());
- glTexImage2D (target, 0, internalFormat, width, height, 0,
- format, type, image);
+ glTexImage2D (target, 0, internalFormat, width, height, 0, format, type, image);
glBindTexture (target, 0);
@@ -393,7 +393,6 @@
format, type);
}
-
GLTexture::List
GLTexture::readImageToTexture (CompString &imageFileName,
CompString &pluginName,
@@ -404,8 +403,7 @@
if (!screen->readImageFromFile (imageFileName, pluginName, size, image) || !image)
return GLTexture::List ();
- GLTexture::List rv =
- GLTexture::imageBufferToTexture ((char *)image, size);
+ GLTexture::List rv = GLTexture::imageBufferToTexture ((char *)image, size);
free (image);
@@ -415,7 +413,8 @@
void
GLTexture::decRef (GLTexture *tex)
{
- tex->priv->refCount--;
+ --tex->priv->refCount;
+
if (tex->priv->refCount <= 0)
delete tex;
}
@@ -423,7 +422,7 @@
void
GLTexture::incRef (GLTexture *tex)
{
- tex->priv->refCount++;
+ ++tex->priv->refCount;
}
GLTexture::List
@@ -439,16 +438,18 @@
{
if (!proc.empty ())
rv = proc (pixmap, width, height, depth, source);
+
if (rv.size ())
return rv;
}
+
return GLTexture::List ();
}
#ifdef USE_GLES
EglTexture::EglTexture () :
- damaged (true),
- damage (None),
+ damaged (true),
+ damage (None),
updateMipMap (true)
{
}
@@ -474,7 +475,7 @@
compiz::opengl::PixmapSource source)
{
if ((int) width > GL::maxTextureSize || (int) height > GL::maxTextureSize ||
- !GL::textureFromPixmap)
+ !GL::textureFromPixmap)
return GLTexture::List ();
GLTexture::List rv (1);
@@ -482,14 +483,15 @@
EGLImageKHR eglImage = NULL;
GLTexture::Matrix matrix = _identity_matrix;
- const EGLint img_attribs[] = {
+ const EGLint img_attribs[] =
+ {
EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
EGL_NONE
};
eglImage = GL::createImage (eglGetDisplay (screen->dpy ()),
- EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR,
- (EGLClientBuffer)pixmap, img_attribs);
+ EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR,
+ (EGLClientBuffer)pixmap, img_attribs);
if (eglImage == EGL_NO_IMAGE_KHR)
{
@@ -533,7 +535,7 @@
{
glBindTexture (target (), name ());
GLTexture::enable (filter);
-
+
if (damaged)
updateMipMap = true;
@@ -542,6 +544,7 @@
GL::generateMipmap (target ());
updateMipMap = false;
}
+
damaged = false;
}
#else
@@ -564,6 +567,7 @@
&uiReturn,
&uiReturn))
return false;
+
return true;
}
@@ -592,10 +596,12 @@
}
TfpTexture::TfpTexture () :
+ x11Pixmap (0),
pixmap (0),
damaged (true),
damage (None),
- updateMipMap (true)
+ updateMipMap (true),
+ source (cgl::InternallyManaged)
{
}
@@ -654,9 +660,7 @@
GLenum texTarget = GL_TEXTURE_2D;
GLXPixmap glxPixmap = None;
GLTexture::Matrix matrix = _identity_matrix;
- bool mipmap = false;
- GLFBConfig *config =
- GLScreen::get (screen)->glxPixmapFBConfig (depth);
+ GLFBConfig *config = GLScreen::get (screen)->glxPixmapFBConfig (depth);
int attribs[7], i = 0;
if (!config->fbConfig)
@@ -677,14 +681,14 @@
TEXTURE_2D target is specified and GL_texture_non_power_of_two
is not supported, then allow the server to choose the texture target. */
if (config->textureTargets & GLX_TEXTURE_2D_BIT_EXT &&
- (GL::textureNonPowerOfTwo || pot))
+ (GL::textureNonPowerOfTwo || pot))
target = GLX_TEXTURE_2D_EXT;
else if (config->textureTargets & GLX_TEXTURE_RECTANGLE_BIT_EXT)
target = GLX_TEXTURE_RECTANGLE_EXT;
- mipmap = config->mipmap &&
- GL::generateMipmap != NULL &&
- (pot || GL::textureNonPowerOfTwoMipmap);
+ bool mipmap = config->mipmap &&
+ GL::generateMipmap != NULL &&
+ (pot || GL::textureNonPowerOfTwoMipmap);
attribs[i++] = GLX_MIPMAP_TEXTURE_EXT;
attribs[i++] = mipmap;
@@ -735,11 +739,13 @@
(*GL::queryDrawable) (screen->dpy (), glxPixmap,
GLX_TEXTURE_TARGET_EXT, &target);
- switch (target) {
+ switch (target)
+ {
case GLX_TEXTURE_2D_EXT:
texTarget = GL_TEXTURE_2D;
matrix.xx = 1.0f / width;
+
if (config->yInverted)
{
matrix.yy = 1.0f / height;
@@ -751,10 +757,12 @@
matrix.y0 = 1.0f;
}
break;
+
case GLX_TEXTURE_RECTANGLE_EXT:
texTarget = GL_TEXTURE_RECTANGLE_ARB;
matrix.xx = 1.0f;
+
if (config->yInverted)
{
matrix.yy = 1.0f;
@@ -766,6 +774,7 @@
matrix.y0 = height;
}
break;
+
default:
compLogMessage ("core", CompLogLevelWarn,
"pixmap 0x%x can't be bound to texture",
@@ -780,9 +789,9 @@
tex = new TfpTexture ();
tex->setData (texTarget, matrix, mipmap);
tex->setGeometry (0, 0, width, height);
- tex->pixmap = glxPixmap;
+ tex->pixmap = glxPixmap;
tex->x11Pixmap = pixmap;
- tex->source = source;
+ tex->source = source;
rv[0] = tex;
@@ -823,7 +832,7 @@
(*GL::generateMipmap) (target ());
updateMipMap = false;
}
+
damaged = false;
}
#endif
-
=== modified file 'plugins/opengl/src/vector.cpp'
--- plugins/opengl/src/vector.cpp 2012-12-04 15:28:01 +0000
+++ plugins/opengl/src/vector.cpp 2013-07-21 23:03:28 +0000
@@ -56,9 +56,9 @@
}
GLVector::GLVector (float x,
- float y,
- float z,
- float w)
+ float y,
+ float z,
+ float w)
{
v[0] = x;
v[1] = y;
@@ -93,53 +93,53 @@
}
GLVector&
-GLVector::operator+= (const GLVector& rhs)
+GLVector::operator+= (const GLVector &rhs)
{
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
v[i] += rhs[i];
return *this;
}
GLVector
-operator+ (const GLVector& lhs,
- const GLVector& rhs)
+operator+ (const GLVector &lhs,
+ const GLVector &rhs)
{
GLVector result;
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
result[i] = lhs[i] + rhs[i];
return result;
}
GLVector&
-GLVector::operator-= (const GLVector& rhs)
+GLVector::operator-= (const GLVector &rhs)
{
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
v[i] -= rhs[i];
return *this;
}
GLVector
-operator- (const GLVector& lhs,
- const GLVector& rhs)
+operator- (const GLVector &lhs,
+ const GLVector &rhs)
{
GLVector result;
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
result[i] = lhs[i] - rhs[i];
return result;
}
GLVector
-operator- (const GLVector& vector)
+operator- (const GLVector &vector)
{
GLVector result;
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
result[i] = -vector[i];
return result;
@@ -148,39 +148,39 @@
GLVector&
GLVector::operator*= (const float k)
{
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
v[i] *= k;
return *this;
}
float
-operator* (const GLVector& lhs,
- const GLVector& rhs)
+operator* (const GLVector &lhs,
+ const GLVector &rhs)
{
float result = 0;
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
result += lhs[i] * rhs[i];
return result;
}
GLVector
-operator* (const float k,
- const GLVector& vector)
+operator* (const float k,
+ const GLVector &vector)
{
GLVector result;
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
result[i] = k * vector[i];
return result;
}
GLVector
-operator* (const GLVector& vector,
- const float k)
+operator* (const GLVector &vector,
+ const float k)
{
return k * vector;
}
@@ -188,34 +188,34 @@
GLVector&
GLVector::operator/= (const float k)
{
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
v[i] /= k;
return *this;
}
GLVector
-operator/ (const GLVector& vector,
- const float k)
+operator/ (const GLVector &vector,
+ const float k)
{
GLVector result;
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
result[i] = vector[i] / k;
return result;
}
GLVector&
-GLVector::operator^= (const GLVector& vector)
+GLVector::operator^= (const GLVector &vector)
{
*this = *this ^ vector;
return *this;
}
GLVector
-operator^ (const GLVector& lhs,
- const GLVector& rhs)
+operator^ (const GLVector &lhs,
+ const GLVector &rhs)
{
GLVector result;
@@ -232,6 +232,7 @@
{
if (v[3] != 0.0)
return 1.0;
+
return sqrt ((v[0] * v[0]) + (v[1] * v[1]) + (v[2] * v[2]));
}
@@ -244,8 +245,9 @@
if (normal == 1.0)
return *this;
- for (unsigned int i = 0; i < 3; i++)
+ for (unsigned int i = 0; i < 3; ++i)
v[i] /= normal;
+
return *this;
}
@@ -255,7 +257,7 @@
if (v[3] ==0)
return *this;
- for (unsigned int i = 0; i < 4; i++)
+ for (unsigned int i = 0; i < 4; ++i)
v[i] /= v[3];
return *this;
=== modified file 'plugins/opengl/src/vertexbuffer.cpp'
--- plugins/opengl/src/vertexbuffer.cpp 2013-03-31 19:27:26 +0000
+++ plugins/opengl/src/vertexbuffer.cpp 2013-07-21 23:03:28 +0000
@@ -58,10 +58,11 @@
GLVertexBuffer::GLVertexBuffer (GLenum usage) :
priv (new PrivateVertexBuffer ())
{
- if (usage != GL::STATIC_DRAW &&
- usage != GL::DYNAMIC_DRAW &&
- usage != GL::STREAM_DRAW)
+ if (usage != GL::STATIC_DRAW &&
+ usage != GL::DYNAMIC_DRAW &&
+ usage != GL::STREAM_DRAW)
usage = GL::STATIC_DRAW;
+
priv->usage = usage;
colorDefault ();
}
@@ -74,8 +75,8 @@
GLVertexBuffer *GLVertexBuffer::streamingBuffer ()
{
if (PrivateVertexBuffer::streamingBuffer == NULL)
- PrivateVertexBuffer::streamingBuffer = new GLVertexBuffer
- (GL::STREAM_DRAW);
+ PrivateVertexBuffer::streamingBuffer = new GLVertexBuffer (GL::STREAM_DRAW);
+
return PrivateVertexBuffer::streamingBuffer;
}
@@ -84,14 +85,15 @@
priv->primitiveType = primitiveType;
priv->vertexData.clear ();
- priv->vertexOffset = 0;
- priv->maxVertices = -1;
+ priv->vertexOffset = 0;
+ priv->maxVertices = -1;
priv->normalData.clear ();
priv->colorData.clear ();
priv->uniforms.clear ();
priv->nTextures = 0;
- for (int i = 0; i < PrivateVertexBuffer::MAX_TEXTURES; i++)
+
+ for (int i = 0; i < PrivateVertexBuffer::MAX_TEXTURES; ++i)
priv->textureData[i].clear ();
}
@@ -105,15 +107,15 @@
GL::bindBuffer (GL_ARRAY_BUFFER, priv->vertexBuffer);
GL::bufferData (GL_ARRAY_BUFFER,
- sizeof(GLfloat) * priv->vertexData.size (),
- &priv->vertexData[0], priv->usage);
+ sizeof(GLfloat) * priv->vertexData.size (),
+ &priv->vertexData[0], priv->usage);
if (priv->normalData.size ())
{
GL::bindBuffer (GL_ARRAY_BUFFER, priv->normalBuffer);
GL::bufferData (GL_ARRAY_BUFFER,
- sizeof(GLfloat) * priv->normalData.size (),
- &priv->normalData[0], priv->usage);
+ sizeof(GLfloat) * priv->normalData.size (),
+ &priv->normalData[0], priv->usage);
}
if (!priv->colorData.size ())
@@ -129,16 +131,16 @@
{
GL::bindBuffer (GL_ARRAY_BUFFER, priv->colorBuffer);
GL::bufferData (GL_ARRAY_BUFFER,
- sizeof(GLfloat) * priv->colorData.size (),
- &priv->colorData[0], priv->usage);
+ sizeof(GLfloat) * priv->colorData.size (),
+ &priv->colorData[0], priv->usage);
}
- for (GLuint i = 0; i < priv->nTextures; i++)
+ for (GLuint i = 0; i < priv->nTextures; ++i)
{
GL::bindBuffer (GL_ARRAY_BUFFER, priv->textureBuffers[i]);
GL::bufferData (GL_ARRAY_BUFFER,
- sizeof(GLfloat) * priv->textureData[i].size (),
- &priv->textureData[i][0], priv->usage);
+ sizeof(GLfloat) * priv->textureData[i].size (),
+ &priv->textureData[i][0], priv->usage);
}
GL::bindBuffer (GL_ARRAY_BUFFER, 0);
@@ -146,14 +148,13 @@
return true;
}
-void GLVertexBuffer::addVertices (GLuint nVertices, const GLfloat *vertices)
+void GLVertexBuffer::addVertices (GLuint nVertices,
+ const GLfloat *vertices)
{
priv->vertexData.reserve (priv->vertexData.size () + (nVertices * 3));
- for (GLuint i = 0; i < nVertices * 3; i++)
- {
+ for (GLuint i = 0; i < nVertices * 3; ++i)
priv->vertexData.push_back (vertices[i]);
- }
}
GLfloat *GLVertexBuffer::getVertices() const
@@ -181,27 +182,28 @@
priv->maxVertices = vMax;
}
-void GLVertexBuffer::addNormals (GLuint nNormals, const GLfloat *normals)
+void GLVertexBuffer::addNormals (GLuint nNormals,
+ const GLfloat *normals)
{
priv->normalData.reserve (priv->normalData.size () + (nNormals * 3));
- for (GLuint i = 0; i < nNormals * 3; i++)
- {
+ for (GLuint i = 0; i < nNormals * 3; ++i)
priv->normalData.push_back (normals[i]);
- }
}
-void GLVertexBuffer::addColors (GLuint nColors, const GLushort *colors)
+void GLVertexBuffer::addColors (GLuint nColors,
+ const GLushort *colors)
{
priv->colorData.reserve (priv->colorData.size () + (nColors * 4));
- for (GLuint i = 0; i < nColors * 4; i++)
- {
+ for (GLuint i = 0; i < nColors * 4; ++i)
priv->colorData.push_back (colors[i] / 65535.0f);
- }
}
-void GLVertexBuffer::color4f (GLfloat r, GLfloat g, GLfloat b, GLfloat a)
+void GLVertexBuffer::color4f (GLfloat r,
+ GLfloat g,
+ GLfloat b,
+ GLfloat a)
{
priv->color[0] = r;
priv->color[1] = g;
@@ -217,9 +219,9 @@
priv->color[3] = defaultColor[3] / 65535.0;
}
-void GLVertexBuffer::addTexCoords (GLuint texture,
- GLuint nTexcoords,
- const GLfloat *texcoords)
+void GLVertexBuffer::addTexCoords (GLuint texture,
+ GLuint nTexcoords,
+ const GLfloat *texcoords)
{
if (texture >= PrivateVertexBuffer::MAX_TEXTURES)
return;
@@ -230,32 +232,35 @@
std::vector &data = priv->textureData[texture];
data.reserve (data.size () + (nTexcoords * 2));
- for (GLuint i = 0; i < nTexcoords * 2; i++)
+ for (GLuint i = 0; i < nTexcoords * 2; ++i)
data.push_back (texcoords[i]);
}
-void GLVertexBuffer::addUniform (const char *name, GLfloat value)
+void GLVertexBuffer::addUniform (const char *name,
+ GLfloat value)
{
// we're casting to double here to make our template va_arg happy
Uniform* uniform = new Uniform(name, (double)value);
priv->uniforms.push_back (uniform);
}
-void GLVertexBuffer::addUniform (const char *name, GLint value)
+void GLVertexBuffer::addUniform (const char *name,
+ GLint value)
{
Uniform* uniform = new Uniform(name, value);
priv->uniforms.push_back (uniform);
}
-bool GLVertexBuffer::addUniform (const char *name, const GLMatrix &value)
+bool GLVertexBuffer::addUniform (const char *name,
+ const GLMatrix &value)
{
//#warning Add 'addUniform' support to GLMatrix type !
return true;
}
void GLVertexBuffer::addUniform2f (const char *name,
- GLfloat x,
- GLfloat y)
+ GLfloat x,
+ GLfloat y)
{
// we're casting to double here to make our template va_arg happy
Uniform* uniform = new Uniform(name,
@@ -265,9 +270,9 @@
}
void GLVertexBuffer::addUniform3f (const char *name,
- GLfloat x,
- GLfloat y,
- GLfloat z)
+ GLfloat x,
+ GLfloat y,
+ GLfloat z)
{
// we're casting to double here to make our template va_arg happy
Uniform* uniform = new Uniform(name,
@@ -278,10 +283,10 @@
}
void GLVertexBuffer::addUniform4f (const char *name,
- GLfloat x,
- GLfloat y,
- GLfloat z,
- GLfloat w)
+ GLfloat x,
+ GLfloat y,
+ GLfloat z,
+ GLfloat w)
{
// we're casting to double here to make our template va_arg happy
Uniform* uniform = new Uniform(name,
@@ -293,27 +298,27 @@
}
void GLVertexBuffer::addUniform2i (const char *name,
- GLint x,
- GLint y)
+ GLint x,
+ GLint y)
{
Uniform* uniform = new Uniform(name, x, y);
priv->uniforms.push_back (uniform);
}
void GLVertexBuffer::addUniform3i (const char *name,
- GLint x,
- GLint y,
- GLint z)
+ GLint x,
+ GLint y,
+ GLint z)
{
Uniform* uniform = new Uniform(name, x, y, z);
priv->uniforms.push_back (uniform);
}
void GLVertexBuffer::addUniform4i (const char *name,
- GLint x,
- GLint y,
- GLint z,
- GLint w)
+ GLint x,
+ GLint y,
+ GLint z,
+ GLint w)
{
Uniform* uniform = new Uniform(name, x, y, z, w);
priv->uniforms.push_back (uniform);
@@ -345,9 +350,9 @@
}
int GLVertexBuffer::render (const GLMatrix &modelview,
- const GLWindowPaintAttrib &attrib)
+ const GLWindowPaintAttrib &attrib)
{
- GLScreen *gScreen = GLScreen::get (screen);
+ GLScreen *gScreen = GLScreen::get (screen);
GLMatrix *projection = gScreen->projectionMatrix ();
return render (*projection, modelview, attrib);
@@ -356,10 +361,12 @@
#if 0
#define PRINT_MATRIX(m) printMatrix ((m), #m)
-static void printMatrix (const GLMatrix &matrix, const char *title = NULL)
+static void printMatrix (const GLMatrix &matrix,
+ const char *title = NULL)
{
const float *m = matrix.getMatrix();
printf ("--- %s ---\n", title ? title : "?");
+
for (int y = 0; y < 4; y++)
printf ("[%5.1f %5.1f %5.1f %5.1f]\n", m[y], m[y+4], m[y+8], m[y+12]);
}
@@ -368,8 +375,8 @@
#endif
int GLVertexBuffer::render (const GLMatrix &projection,
- const GLMatrix &modelview,
- const GLWindowPaintAttrib &attrib)
+ const GLMatrix &modelview,
+ const GLWindowPaintAttrib &attrib)
{
if (!priv->vertexData.size ())
return -1;
@@ -385,9 +392,12 @@
PrivateVertexBuffer::PrivateVertexBuffer () :
nTextures (0),
+ color (),
vertexOffset (0),
maxVertices (-1),
program (NULL),
+ primitiveType (GL_TRIANGLES),
+ usage (GL::STATIC_DRAW),
autoProgram (0)
{
if (!GL::genBuffers)
@@ -406,39 +416,43 @@
if (vertexBuffer)
GL::deleteBuffers (1, &vertexBuffer);
+
if (normalBuffer)
GL::deleteBuffers (1, &normalBuffer);
+
if (colorBuffer)
GL::deleteBuffers (1, &colorBuffer);
+
if (textureBuffers[0])
GL::deleteBuffers (4, &textureBuffers[0]);
}
int PrivateVertexBuffer::render (const GLMatrix *projection,
- const GLMatrix *modelview,
- const GLWindowPaintAttrib *attrib)
+ const GLMatrix *modelview,
+ const GLWindowPaintAttrib *attrib)
{
- GLfloat attribs[3] = {1, 1, 1};
- GLint positionIndex = -1;
- GLint normalIndex = -1;
- GLint colorIndex = -1;
+ GLfloat attribs[3] = {1, 1, 1};
+ GLint positionIndex = -1;
+ GLint normalIndex = -1;
+ GLint colorIndex = -1;
GLint texCoordIndex[4] = {-1, -1, -1, -1};
- GLProgram *tmpProgram = program;
+ GLProgram *tmpProgram = program;
// If we don't have an explicitly set program, try to get one
// using the AutoProgram callback object.
- if (tmpProgram == NULL && autoProgram) {
+ if (tmpProgram == NULL && autoProgram)
+ {
// Convert attrib to shader parameters
GLShaderParameters params;
- params.opacity = attrib->opacity != OPAQUE;
+ params.opacity = attrib->opacity != OPAQUE;
params.brightness = attrib->brightness != BRIGHT;
params.saturation = attrib->saturation != COLOR;
params.color = colorData.size () == 4 ? GLShaderVariableUniform :
- colorData.size () > 4 ? GLShaderVariableVarying :
- GLShaderVariableNone;
+ colorData.size () > 4 ? GLShaderVariableVarying :
+ GLShaderVariableNone;
params.normal = normalData.size () <= 4 ? GLShaderVariableUniform :
- GLShaderVariableVarying;
+ GLShaderVariableVarying;
params.numTextures = nTextures;
// Get a program matching the parameters
@@ -452,10 +466,9 @@
}
tmpProgram->bind ();
+
if (!tmpProgram->valid ())
- {
return -1;
- }
if (projection)
tmpProgram->setUniform ("projection", *projection);
@@ -471,15 +484,13 @@
//use default normal
if (normalData.empty ())
- {
tmpProgram->setUniform3f ("singleNormal", 0.0f, 0.0f, -1.0f);
- }
+
// special case a single normal and apply it to the entire operation
else if (normalData.size () == 3)
- {
tmpProgram->setUniform3f ("singleNormal",
- normalData[0], normalData[1], normalData[2]);
- }
+ normalData[0], normalData[1], normalData[2]);
+
else if (normalData.size () > 3)
{
normalIndex = tmpProgram->attributeLocation ("normal");
@@ -491,10 +502,9 @@
// special case a single color and apply it to the entire operation
if (colorData.size () == 4)
- {
tmpProgram->setUniform4f ("singleColor", colorData[0],
- colorData[1], colorData[2], colorData[3]);
- }
+ colorData[1], colorData[2], colorData[3]);
+
else if (colorData.size () > 4)
{
colorIndex = tmpProgram->attributeLocation ("color");
@@ -504,10 +514,10 @@
(*GL::bindBuffer) (GL::ARRAY_BUFFER, 0);
}
- for (int i = nTextures - 1; i >= 0; i--)
+ char name[10];
+
+ for (int i = nTextures - 1; i >= 0; --i)
{
- char name[10];
-
snprintf (name, 10, "texCoord%d", i);
texCoordIndex[i] = tmpProgram->attributeLocation (name);
@@ -521,30 +531,26 @@
}
// set per-plugin uniforms
- for (unsigned int i = 0; i < uniforms.size (); i++)
- {
+ for (unsigned int i = 0; i < uniforms.size (); ++i)
uniforms[i]->set (tmpProgram);
- }
//convert paint attribs to 0-1 range
if (attrib)
{
- attribs[0] = attrib->opacity / 65535.0f;
+ attribs[0] = attrib->opacity / 65535.0f;
attribs[1] = attrib->brightness / 65535.0f;
attribs[2] = attrib->saturation / 65535.0f;
tmpProgram->setUniform3f ("paintAttrib", attribs[0], attribs[1], attribs[2]);
}
-
glDrawArrays (primitiveType, vertexOffset, maxVertices > 0 ?
- std::min (static_cast (vertexData.size () / 3),
- maxVertices) :
- vertexData.size () / 3);
+ std::min (static_cast (vertexData.size () / 3),
+ maxVertices) :
+ vertexData.size () / 3);
+
for (int i = 0; i < 4; ++i)
- {
if (texCoordIndex[i] != -1)
(*GL::disableVertexAttribArray) (texCoordIndex[i]);
- }
if (colorIndex != -1)
(*GL::disableVertexAttribArray) (colorIndex);
@@ -560,8 +566,8 @@
}
int PrivateVertexBuffer::legacyRender (const GLMatrix &projection,
- const GLMatrix &modelview,
- const GLWindowPaintAttrib &attrib)
+ const GLMatrix &modelview,
+ const GLWindowPaintAttrib &attrib)
{
#ifndef USE_GLES
glMatrixMode (GL_PROJECTION);
@@ -577,14 +583,12 @@
//use default normal
if (normalData.empty ())
- {
glNormal3f (0.0f, 0.0f, -1.0f);
- }
+
// special case a single normal and apply it to the entire operation
else if (normalData.size () == 3)
- {
glNormal3fv (&normalData[0]);
- }
+
else if (normalData.size () > 3)
{
glEnableClientState (GL_NORMAL_ARRAY);
@@ -593,16 +597,15 @@
// special case a single color and apply it to the entire operation
if (colorData.size () == 4)
- {
glColor4fv (&colorData[0]);
- }
+
else if (colorData.size () > 4)
{
glEnableClientState (GL_COLOR_ARRAY);
glColorPointer (4, GL_FLOAT, 0, &colorData[0]);
}
- for (int i = nTextures - 1; i >= 0; i--)
+ for (int i = nTextures - 1; i >= 0; --i)
{
GL::clientActiveTexture (GL_TEXTURE0_ARB + i);
glEnableClientState (GL_TEXTURE_COORD_ARRAY);
@@ -615,7 +618,7 @@
glDisableClientState (GL_NORMAL_ARRAY);
glDisableClientState (GL_COLOR_ARRAY);
- for (int i = nTextures; i > 0; i--)
+ for (int i = nTextures; i > 0; --i)
{
GL::clientActiveTexture (GL_TEXTURE0_ARB + i);
glDisableClientState (GL_TEXTURE_COORD_ARRAY);
@@ -632,4 +635,3 @@
return 0;
}
-
=== modified file 'plugins/opengl/src/window.cpp'
--- plugins/opengl/src/window.cpp 2013-06-10 08:57:12 +0000
+++ plugins/opengl/src/window.cpp 2013-07-21 23:03:28 +0000
@@ -42,7 +42,6 @@
priv->paint.saturation = cw->saturation ();
priv->lastPaint = priv->paint;
-
}
GLWindow::~GLWindow ()
@@ -50,13 +49,13 @@
delete priv;
}
-
/**
* Callback object to create GLPrograms automatically when using GLVertexBuffer.
*/
class GLWindowAutoProgram : public GLVertexBuffer::AutoProgram
{
public:
+
GLWindowAutoProgram (PrivateGLWindow *pWindow) : pWindow(pWindow) {}
GLProgram *getProgram (GLShaderParameters ¶ms)
@@ -69,30 +68,29 @@
}
PrivateGLWindow *pWindow;
-
};
PrivateGLWindow::PrivateGLWindow (CompWindow *w,
GLWindow *gw) :
- window (w),
- gWindow (gw),
- cWindow (CompositeWindow::get (w)),
- gScreen (GLScreen::get (screen)),
- textures (),
- regions (),
- updateState (UpdateRegion | UpdateMatrix),
- needsRebind (true),
- clip (),
- bindFailed (false),
- vertexBuffer (new GLVertexBuffer ()),
- autoProgram(new GLWindowAutoProgram(this)),
- icons (),
+ window (w),
+ gWindow (gw),
+ cWindow (CompositeWindow::get (w)),
+ gScreen (GLScreen::get (screen)),
+ textures (),
+ regions (),
+ updateState (UpdateRegion | UpdateMatrix),
+ needsRebind (true),
+ clip (),
+ bindFailed (false),
+ vertexBuffer (new GLVertexBuffer ()),
+ autoProgram (new GLWindowAutoProgram(this)),
+ icons (),
configureLock (w->obtainLockOnConfigureRequests ())
{
- paint.xScale = 1.0f;
- paint.yScale = 1.0f;
- paint.xTranslate = 0.0f;
- paint.yTranslate = 0.0f;
+ paint.xScale = 1.0f;
+ paint.yScale = 1.0f;
+ paint.xTranslate = 0.0f;
+ paint.yTranslate = 0.0f;
WindowInterface::setHandler (w);
CompositeWindowInterface::setHandler (cWindow);
@@ -117,7 +115,7 @@
if (textures.size () != matrices.size ())
matrices.resize (textures.size ());
- for (unsigned int i = 0; i < textures.size (); i++)
+ for (unsigned int i = 0; i < textures.size (); ++i)
{
matrices[i] = textures[i]->matrix ();
matrices[i].x0 -= (input.x () * matrices[i].xx);
@@ -169,9 +167,9 @@
compLogMessage ("opengl", CompLogLevelWarn,
"This window tried to create an absurdly large window %i x %i\n", priv->cWindow->size ().width (), priv->cWindow->size ().height ());
compLogMessage ("opengl", CompLogLevelWarn,
- "Unforunately, that's not supported on your hardware, because you have a maximum texture size of %i", GL::maxTextureSize);
+ "Unfortunately, that's not supported on your hardware, because you have a maximum texture size of %i", GL::maxTextureSize);
compLogMessage ("opengl", CompLogLevelWarn, "you should probably file a bug against that application");
- compLogMessage ("opengl", CompLogLevelWarn, "for now, we're going to hide tht window so that it doesn't break your desktop\n");
+ compLogMessage ("opengl", CompLogLevelWarn, "for now, we're going to hide that window so that it doesn't break your desktop\n");
XReparentWindow (screen->dpy (), priv->window->id (), GLScreen::get (screen)->priv->saveWindow, 0, 0);
}
@@ -179,10 +177,14 @@
}
else
{
+<<<<<<< TREE
bool immediatelyUpdateMatricesAndRegions =
priv->textures.size () != textures.size ();
priv->textures = textures;
+=======
+ priv->textures = textures;
+>>>>>>> MERGE-SOURCE
priv->needsRebind = false;
/* If the number of textures changed, we should immediately
@@ -218,10 +220,10 @@
WRAPABLE_DEF (glPaint, attrib, transform, region, mask)
bool
-GLWindowInterface::glDraw (const GLMatrix &transform,
+GLWindowInterface::glDraw (const GLMatrix &transform,
const GLWindowPaintAttrib &attrib,
- const CompRegion ®ion,
- unsigned int mask)
+ const CompRegion ®ion,
+ unsigned int mask)
WRAPABLE_DEF (glDraw, transform, attrib, region, mask)
void
@@ -234,10 +236,10 @@
maxGridWidth, maxGridHeight)
void
-GLWindowInterface::glDrawTexture (GLTexture *texture,
+GLWindowInterface::glDrawTexture (GLTexture *texture,
const GLMatrix &transform,
const GLWindowPaintAttrib &attrib,
- unsigned int mask)
+ unsigned int mask)
WRAPABLE_DEF (glDrawTexture, texture, transform, attrib, mask)
const CompRegion &
@@ -258,9 +260,11 @@
return priv->lastPaint;
}
-
void
-PrivateGLWindow::resizeNotify (int dx, int dy, int dwidth, int dheight)
+PrivateGLWindow::resizeNotify (int dx,
+ int dy,
+ int dwidth,
+ int dheight)
{
window->resizeNotify (dx, dy, dwidth, dheight);
updateState |= PrivateGLWindow::UpdateMatrix | PrivateGLWindow::UpdateRegion;
@@ -268,7 +272,9 @@
}
void
-PrivateGLWindow::moveNotify (int dx, int dy, bool now)
+PrivateGLWindow::moveNotify (int dx,
+ int dy,
+ bool now)
{
window->moveNotify (dx, dy, now);
updateState |= PrivateGLWindow::UpdateMatrix;
@@ -288,6 +294,7 @@
case CompWindowNotifyFrameUpdate:
gWindow->release ();
break;
+
default:
break;
}
@@ -331,25 +338,25 @@
}
GLTexture *
-GLWindow::getIcon (int width, int height)
+GLWindow::getIcon (int width,
+ int height)
{
GLIcon icon;
CompIcon *i = priv->window->getIcon (width, height);
- if (!i)
- return NULL;
-
- if (!i->width () || !i->height ())
+ if (!i ||
+ !i->width () ||
+ !i->height ())
return NULL;
foreach (GLIcon &icon, priv->icons)
if (icon.icon == i)
return icon.textures[0];
- icon.icon = i;
+ icon.icon = i;
icon.textures = GLTexture::imageBufferToTexture ((char *) i->data (), *i);
- if (icon.textures.size () > 1 || icon.textures.size () == 0)
+ if (icon.textures.size () > 1 || icon.textures.empty ())
return NULL;
priv->icons.push_back (icon);
@@ -359,12 +366,12 @@
void
GLWindow::addShaders (std::string name,
- std::string vertex_shader,
- std::string fragment_shader)
+ std::string vertex_shader,
+ std::string fragment_shader)
{
- GLShaderData *data = new GLShaderData;
- data->name = name;
- data->vertexShader = vertex_shader;
+ GLShaderData *data = new GLShaderData;
+ data->name = name;
+ data->vertexShader = vertex_shader;
data->fragmentShader = fragment_shader;
priv->shaders.push_back(data);
@@ -384,12 +391,14 @@
if (regions.size () != textures.size ())
regions.resize (textures.size ());
- for (unsigned int i = 0; i < textures.size (); i++)
+
+ for (unsigned int i = 0; i < textures.size (); ++i)
{
regions[i] = CompRegion (*textures[i]);
regions[i].translate (input.x (), input.y ());
regions[i] &= window->region ();
}
+
updateState &= ~(UpdateRegion);
}
=== modified file 'plugins/place/src/constrain-to-workarea/src/constrain-to-workarea.cpp'
--- plugins/place/src/constrain-to-workarea/src/constrain-to-workarea.cpp 2013-06-26 21:59:35 +0000
+++ plugins/place/src/constrain-to-workarea/src/constrain-to-workarea.cpp 2013-07-21 23:03:28 +0000
@@ -26,7 +26,7 @@
{
namespace place
{
-unsigned int clampGeometrySizeOnly = (1 << 0);
+unsigned int clampGeometrySizeOnly = (1 << 0);
unsigned int clampGeometryToViewport = (1 << 1);
}
}
@@ -41,19 +41,20 @@
unsigned int flags,
const CompSize &screenSize)
{
- int x, y, left, right, bottom, top;
+ int x, y;
if (flags & clampGeometryToViewport)
{
- /* left, right, top, bottom target coordinates, clamed to viewport
+ /* left, right, top, bottom target coordinates, clamped to viewport
* sizes as we don't need to validate movements to other viewports;
* we are only interested in inner-viewport movements */
-
x = g.x () % screenSize.width ();
+
if ((x + g.width ()) < 0)
x += screenSize.width ();
y = g.y () % screenSize.height ();
+
if ((y + g.height ()) < 0)
y += screenSize.height ();
}
@@ -63,12 +64,11 @@
y = g.y ();
}
- left = x - border.left;
- right = left + g.widthIncBorders () + (border.left +
- border.right);
- top = y - border.top;
- bottom = top + g.heightIncBorders () + (border.top +
- border.bottom);
+ int left = x - border.left;
+ int right = left + g.widthIncBorders () + (border.left + border.right);
+
+ int top = y - border.top;
+ int bottom = top + g.heightIncBorders () + (border.top + border.bottom);
if ((right - left) > workArea.width ())
{
@@ -140,9 +140,16 @@
CompPoint &
cp::constrainPositionToWorkArea (CompPoint &pos,
+<<<<<<< TREE
const cw::Geometry &serverGeometry,
const CompWindowExtents &border,
const CompRect &workArea)
+=======
+ const cw::Geometry &serverGeometry,
+ const CompWindowExtents &border,
+ const CompRect &workArea,
+ bool staticGravity)
+>>>>>>> MERGE-SOURCE
{
CompWindowExtents extents;
int delta;
@@ -157,18 +164,22 @@
border.bottom);
delta = workArea.right () - extents.right;
+
if (delta < 0)
extents.left += delta;
delta = workArea.left () - extents.left;
+
if (delta > 0)
extents.left += delta;
delta = workArea.bottom () - extents.bottom;
+
if (delta < 0)
extents.top += delta;
delta = workArea.top () - extents.top;
+
if (delta > 0)
extents.top += delta;
=== modified file 'plugins/place/src/place.cpp'
--- plugins/place/src/place.cpp 2013-06-28 01:10:57 +0000
+++ plugins/place/src/place.cpp 2013-07-21 23:03:28 +0000
@@ -73,10 +73,8 @@
{
foreach (CompWindow *w, screen->windows ())
{
- if (!w->managed ())
- continue;
-
- if (w->wmType () & (CompWindowTypeDockMask |
+ if (!w->managed () ||
+ w->wmType () & (CompWindowTypeDockMask |
CompWindowTypeDesktopMask))
continue;
@@ -121,6 +119,7 @@
if (window->state () & CompWindowStateAboveMask)
state |= compiz::place::WindowAbove;
+
if (window->state () & CompWindowStateBelowMask)
state |= compiz::place::WindowBelow;
@@ -147,14 +146,10 @@
if ((window->actions () & MAXIMIZE_STATE) == MAXIMIZE_STATE &&
(window->mwmDecor () & (MwmDecorAll | MwmDecorTitle)) &&
- !(window->state () & CompWindowStateFullscreenMask))
- {
- if (og.width () >= workArea.width () &&
- og.height () >= workArea.height ())
- {
- sendMaximizationRequest ();
- }
- }
+ !(window->state () & CompWindowStateFullscreenMask) &&
+ og.width () >= workArea.width () &&
+ og.height () >= workArea.height ())
+ sendMaximizationRequest ();
}
bool
@@ -195,7 +190,6 @@
this, width, height));
mResChangeFallbackHandle.start ();
}
-
}
void
@@ -223,25 +217,25 @@
}
}
break;
+
case PropertyNotify:
if (event->xproperty.atom == Atoms::wmStrut ||
- event->xproperty.atom == Atoms::wmStrutPartial)
+ event->xproperty.atom == Atoms::wmStrutPartial)
{
- CompWindow *w;
-
- w = screen->findWindow (event->xproperty.window);
- if (w)
- {
- if (!mStrutWindows.empty ())
- {
- mStrutWindows.remove (w);
- /* Only do when handling screen size change.
+ CompWindow *w;
+
+ w = screen->findWindow (event->xproperty.window);
+
+ if (w &&
+ !mStrutWindows.empty ())
+ {
+ mStrutWindows.remove (w);
+ /* Only do when handling screen size change.
ps->strutWindowCount is 0 at any other time */
- if (mStrutWindows.empty ())
- doHandleScreenSizeChange (screen->width (),
- screen->height ()); /* 2nd pass */
- }
- }
+ if (mStrutWindows.empty ())
+ doHandleScreenSizeChange (screen->width (),
+ screen->height ()); /* 2nd pass */
+ }
}
}
}
@@ -252,10 +246,8 @@
compareLeftmost (compiz::place::Placeable *a,
compiz::place::Placeable *b)
{
- int ax, bx;
-
- ax = a->geometry ().x () - a->extents ().left;
- bx = b->geometry ().x () - a->extents ().left;
+ int ax = a->geometry ().x () - a->extents ().left;
+ int bx = b->geometry ().x () - a->extents ().left;
return (ax <= bx);
}
@@ -264,10 +256,8 @@
compareTopmost (compiz::place::Placeable *a,
compiz::place::Placeable *b)
{
- int ay, by;
-
- ay = a->geometry ().y () - a->extents ().top;
- by = b->geometry ().y () - a->extents ().top;
+ int ay = a->geometry ().y () - a->extents ().top;
+ int by = b->geometry ().y () - a->extents ().top;
return (ay <= by);
}
@@ -276,19 +266,15 @@
compareNorthWestCorner (compiz::place::Placeable *a,
compiz::place::Placeable *b)
{
- int fromOriginA;
- int fromOriginB;
- int ax, ay, bx, by;
-
- ax = a->geometry ().x () - a->extents ().left;
- bx = b->geometry ().x () - a->extents ().left;
-
- ay = a->geometry ().y () - a->extents ().top;
- by = b->geometry ().y () - a->extents ().top;
+ int ax = a->geometry ().x () - a->extents ().left;
+ int bx = b->geometry ().x () - a->extents ().left;
+
+ int ay = a->geometry ().y () - a->extents ().top;
+ int by = b->geometry ().y () - a->extents ().top;
/* probably there's a fast good-enough-guess we could use here. */
- fromOriginA = sqrt (ax * ax + ay * ay);
- fromOriginB = sqrt (bx * bx + by * by);
+ int fromOriginA = sqrt (ax * ax + ay * ay);
+ int fromOriginB = sqrt (bx * bx + by * by);
return (fromOriginA <= fromOriginB);
}
@@ -307,10 +293,9 @@
if (!ps->mStrutWindows.empty() && window->struts())
{
ps->mStrutWindows.remove(window);
+
if (ps->mStrutWindows.empty())
- {
ps->doHandleScreenSizeChange(screen->width(), screen->height());
- }
}
}
@@ -324,19 +309,21 @@
return status;
doPlacement (pos);
+
if (matchViewport (viewport))
{
- int x, y;
-
viewport.setX (MAX (MIN (viewport.x (),
screen->vpSize ().width () - 1), 0));
viewport.setY (MAX (MIN (viewport.y (),
screen->vpSize ().height () - 1), 0));
- x = pos.x () % screen->width ();
+ int x = pos.x () % screen->width ();
+
if (x < 0)
x += screen->width ();
- y = pos.y () % screen->height ();
+
+ int y = pos.y () % screen->height ();
+
if (y < 0)
y += screen->height ();
@@ -353,11 +340,20 @@
bool onlyValidateSize,
bool clampToViewport)
{
+<<<<<<< TREE
CompWindow::Geometry geom (xwc->x, xwc->y, xwc->width, xwc->height,
window->serverGeometry ().border ());
CompPoint pos (geom.pos ());
+=======
+ int x, y;
+ CompWindow::Geometry geom;
+
+ geom.set (xwc->x, xwc->y, xwc->width, xwc->height,
+ window->serverGeometry ().border ());
+>>>>>>> MERGE-SOURCE
if (clampToViewport)
+<<<<<<< TREE
pos = cp::getViewportRelativeCoordinates(geom, *screen);
CompWindowExtents edgePositions = cp::getWindowEdgePositions (pos,
@@ -366,18 +362,44 @@
int output = screen->outputDeviceForGeometry (geom);
CompRect workArea = screen->getWorkareaForOutput (output);
-
- if (clampToViewport &&
- xwc->width >= workArea.width () &&
- xwc->height >= workArea.height ())
- {
- if ((window->actions () & MAXIMIZE_STATE) == MAXIMIZE_STATE &&
- (window->mwmDecor () & (MwmDecorAll | MwmDecorTitle)) &&
- !(window->state () & CompWindowStateFullscreenMask))
- {
- sendMaximizationRequest ();
- }
- }
+=======
+ {
+ /* left, right, top, bottom target coordinates, clamed to viewport
+ * sizes as we don't need to validate movements to other viewports;
+ * we are only interested in inner-viewport movements */
+
+ x = geom.x () % screen->width ();
+ if ((geom.x2 ()) < 0)
+ x += screen->width ();
+
+ y = geom.y () % screen->height ();
+ if ((geom.y2 ()) < 0)
+ y += screen->height ();
+ }
+ else
+ {
+ x = geom.x ();
+ y = geom.y ();
+ }
+
+ int left = x - window->border ().left;
+ int right = left + geom.widthIncBorders () + (window->border ().left +
+ window->border ().right);
+ int top = y - window->border ().top;
+ int bottom = top + geom.heightIncBorders () + (window->border ().top +
+ window->border ().bottom);
+
+ int output = screen->outputDeviceForGeometry (geom);
+ CompRect workArea = screen->getWorkareaForOutput (output);
+>>>>>>> MERGE-SOURCE
+
+ if (clampToViewport &&
+ xwc->width >= workArea.width () &&
+ xwc->height >= workArea.height () &&
+ (window->actions () & MAXIMIZE_STATE) == MAXIMIZE_STATE &&
+ (window->mwmDecor () & (MwmDecorAll | MwmDecorTitle)) &&
+ !(window->state () & CompWindowStateFullscreenMask))
+ sendMaximizationRequest ();
cp::clampHorizontalEdgePositionsToWorkArea (edgePositions, workArea);
cp::clampVerticalEdgePositionsToWorkArea (edgePositions, workArea);
@@ -431,6 +453,7 @@
window->validateResizeRequest (mask, xwc, source);
+<<<<<<< TREE
if (!mask)
return;
@@ -443,9 +466,16 @@
return;
if (window->wmType () & (CompWindowTypeDockMask |
+=======
+ if (!mask ||
+ source == ClientTypePager ||
+ window->state () & CompWindowStateFullscreenMask ||
+ window->wmType () & (CompWindowTypeDockMask |
+>>>>>>> MERGE-SOURCE
CompWindowTypeDesktopMask))
return;
+<<<<<<< TREE
/* do nothing if the window was already (at least partially) offscreen
* and already placed */
bool onscreen =
@@ -455,6 +485,13 @@
screen->height ()).contains (window->geometry ());
if (window->placed () && !onscreen)
+=======
+ /* do nothing if the window was already (at least partially) offscreen */
+ if (window->serverX () < 0 ||
+ window->serverX () + window->serverWidth () > screen->width () ||
+ window->serverY () < 0 ||
+ window->serverY () + window->serverHeight () > screen->height ())
+>>>>>>> MERGE-SOURCE
return;
if (hasUserDefinedPosition (false))
@@ -463,13 +500,11 @@
sizeOnly = true;
doValidateResizeRequest (mask, xwc, sizeOnly, true);
-
}
void
PlaceScreen::addSupportedAtoms (std::vector &atoms)
{
-
atoms.push_back (fullPlacementAtom);
screen->addSupportedAtoms (atoms);
@@ -478,34 +513,29 @@
void
PlaceWindow::doPlacement (CompPoint &pos)
{
- CompRect workArea;
- CompPoint targetVp;
PlacementStrategy strategy;
bool keepInWorkarea;
- int mode;
if (matchPosition (pos, keepInWorkarea))
- {
strategy = keepInWorkarea ? ConstrainOnly : NoPlacement;
- }
else
{
strategy = getStrategy ();
+
if (strategy == NoPlacement)
return;
}
- mode = getPlacementMode ();
+ int mode = getPlacementMode ();
const CompOutput &output = getPlacementOutput (mode, strategy, pos);
- workArea = output.workArea ();
+ CompRect workArea = output.workArea ();
- targetVp = window->initialViewport ();
+ CompPoint targetVp = window->initialViewport ();
if (strategy == PlaceOverParent)
{
- CompWindow *parent;
+ CompWindow *parent = screen->findWindow (window->transientFor ());
- parent = screen->findWindow (window->transientFor ());
if (parent)
{
/* center over parent horizontally */
@@ -530,16 +560,13 @@
strategy = ConstrainOnly;
}
else
- {
strategy = NoPlacement;
- }
}
}
if (strategy == PlaceCenteredOnScreen)
{
/* center window on current output device */
-
pos.setX (output.x () +
(output.width () - window->serverGeometry ().width ()) /2);
pos.setY (output.y () +
@@ -549,9 +576,9 @@
}
workArea.setX (workArea.x () +
- (targetVp.x () - screen->vp ().x ()) * screen->width ());
+ (targetVp.x () - screen->vp ().x ()) * screen->width ());
workArea.setY (workArea.y () +
- (targetVp.y () - screen->vp ().y ()) * screen->height ());
+ (targetVp.y () - screen->vp ().y ()) * screen->height ());
if (strategy == PlaceOnly || strategy == PlaceAndConstrain)
{
@@ -566,44 +593,49 @@
placeables.push_back (static_cast (pw));
}
- switch (mode) {
+ switch (mode)
+ {
case PlaceOptions::ModeCascade:
- placeCascade (workArea, pos);
- break;
- case PlaceOptions::ModeCentered:
- placeCentered (workArea, pos);
- break;
- case PlaceOptions::ModeRandom:
- placeRandom (workArea, pos);
- break;
- case PlaceOptions::ModePointer:
- placePointer (workArea, pos);
- break;
- case PlaceOptions::ModeMaximize:
- sendMaximizationRequest ();
- break;
- case PlaceOptions::ModeSmart:
- placeSmart (pos, placeables);
- break;
+ placeCascade (workArea, pos);
+ break;
+
+ case PlaceOptions::ModeCentered:
+ placeCentered (workArea, pos);
+ break;
+
+ case PlaceOptions::ModeRandom:
+ placeRandom (workArea, pos);
+ break;
+
+ case PlaceOptions::ModePointer:
+ placePointer (workArea, pos);
+ break;
+
+ case PlaceOptions::ModeMaximize:
+ sendMaximizationRequest ();
+ break;
+
+ case PlaceOptions::ModeSmart:
+ placeSmart (pos, placeables);
+ break;
}
/* When placing to the fullscreen output, constrain to one
output nevertheless */
if ((unsigned int) output.id () == (unsigned int) ~0)
{
- int id;
CompWindow::Geometry geom (window->serverGeometry ());
geom.setPos (pos);
- id = screen->outputDeviceForGeometry (geom);
+ int id = screen->outputDeviceForGeometry (geom);
workArea = screen->getWorkareaForOutput (id);
workArea.setX (workArea.x () +
- (targetVp.x () - screen->vp ().x ()) *
+ (targetVp.x () - screen->vp ().x ()) *
screen->width ());
workArea.setY (workArea.y () +
- (targetVp.y () - screen->vp ().y ()) *
+ (targetVp.y () - screen->vp ().y ()) *
screen->height ());
}
@@ -613,14 +645,10 @@
*/
if ((window->actions () & MAXIMIZE_STATE) == MAXIMIZE_STATE &&
(window->mwmDecor () & (MwmDecorAll | MwmDecorTitle)) &&
- !(window->state () & CompWindowStateFullscreenMask))
- {
- if (window->serverWidth () >= workArea.width () &&
- window->serverHeight () >= workArea.height ())
- {
- sendMaximizationRequest ();
- }
- }
+ !(window->state () & CompWindowStateFullscreenMask) &&
+ window->serverWidth () >= workArea.width () &&
+ window->serverHeight () >= workArea.height ())
+ sendMaximizationRequest ();
}
if (strategy == ConstrainOnly || strategy == PlaceAndConstrain)
@@ -639,16 +667,11 @@
*/
foreach (CompWindow *w, screen->windows ())
{
- if (!windowIsPlaceRelevant (w))
- continue;
-
- if (w->type () & (CompWindowTypeFullscreenMask |
- CompWindowTypeUnknownMask))
- continue;
-
- if (w->serverX () >= workArea.right () ||
- w->serverX () + w->serverGeometry ().width () <= workArea.x () ||
- w->serverY () >= workArea.bottom () ||
+ if (!windowIsPlaceRelevant (w) ||
+ w->type () & (CompWindowTypeFullscreenMask | CompWindowTypeUnknownMask) ||
+ w->serverX () >= workArea.right () ||
+ w->serverX () + w->serverGeometry ().width () <= workArea.x () ||
+ w->serverY () >= workArea.bottom () ||
w->serverY () + w->serverGeometry ().height () <= workArea.y ())
continue;
@@ -656,12 +679,10 @@
}
if (!cascadeFindFirstFit (placeables, workArea, pos))
- {
/* if the window wasn't placed at the origin of screen,
* cascade it onto the current screen
*/
cascadeFindNext (placeables, workArea, pos);
- }
}
void
@@ -678,16 +699,16 @@
PlaceWindow::placeRandom (const CompRect &workArea,
CompPoint &pos)
{
- int remainX, remainY;
-
pos.setX (workArea.x ());
pos.setY (workArea.y ());
- remainX = workArea.width () - window->serverGeometry ().width ();
+ int remainX = workArea.width () - window->serverGeometry ().width ();
+
if (remainX > 0)
pos.setX (pos.x () + (rand () % remainX));
- remainY = workArea.height () - window->serverGeometry ().height ();
+ int remainY = workArea.height () - window->serverGeometry ().height ();
+
if (remainY > 0)
pos.setY (pos.y () + (rand () % remainY));
}
@@ -709,7 +730,7 @@
using namespace compiz::place;
void
-PlaceWindow::placeSmart (CompPoint &pos,
+PlaceWindow::placeSmart (CompPoint &pos,
const compiz::place::Placeable::Vector &placeables)
{
compiz::place::smart (this, pos, placeables);
@@ -719,15 +740,12 @@
centerTileRectInArea (CompRect &rect,
const CompRect &workArea)
{
- int fluff;
-
/* The point here is to tile a window such that "extra"
* space is equal on either side (i.e. so a full screen
* of windows tiled this way would center the windows
* as a group)
*/
-
- fluff = (workArea.width () % (rect.width () + 1)) / 2;
+ int fluff = (workArea.width () % (rect.width () + 1)) / 2;
rect.setX (workArea.x () + fluff);
fluff = (workArea.height () % (rect.height () + 1)) / 3;
@@ -735,7 +753,7 @@
}
static bool
-rectOverlapsWindow (const CompRect &rect,
+rectOverlapsWindow (const CompRect &rect,
const compiz::place::Placeable::Vector &placeables)
{
CompRect dest;
@@ -750,6 +768,7 @@
sbr.setBottom (sbr.bottom () - other->extents ().bottom);
intersect = rect & sbr;
+
if (!intersect.isEmpty ())
return true;
}
@@ -767,8 +786,8 @@
*/
bool
PlaceWindow::cascadeFindFirstFit (const Placeable::Vector &placeables,
- const CompRect &workArea,
- CompPoint &pos)
+ const CompRect &workArea,
+ CompPoint &pos)
{
/* This algorithm is limited - it just brute-force tries
* to fit the window in a small number of locations that are aligned
@@ -777,16 +796,14 @@
* of each existing window, aligned with the left/top of the
* existing window in each of those cases.
*/
- bool retval = false;
- Placeable::Vector belowSorted, rightSorted;
/* Below each window */
- belowSorted = placeables;
+ Placeable::Vector belowSorted = placeables;
std::sort (belowSorted.begin (), belowSorted.end (), compareLeftmost);
std::sort (belowSorted.begin (), belowSorted.end (), compareTopmost);
/* To the right of each window */
- rightSorted = placeables;
+ Placeable::Vector rightSorted = placeables;
std::sort (belowSorted.begin (), belowSorted.end (), compareTopmost);
std::sort (belowSorted.begin (), belowSorted.end (), compareLeftmost);
@@ -799,6 +816,8 @@
centerTileRectInArea (rect, workArea);
+ bool retval = false;
+
if (workArea.contains (rect) && !rectOverlapsWindow (rect, placeables))
{
pos.setX (rect.x () + this->extents ().left);
@@ -808,11 +827,11 @@
if (!retval)
{
+ CompRect outerRect;
+
/* try below each window */
foreach (Placeable *p, belowSorted)
{
- CompRect outerRect;
-
if (retval)
break;
@@ -838,11 +857,11 @@
if (!retval)
{
+ CompRect outerRect;
+
/* try to the right of each window */
foreach (Placeable *p, rightSorted)
{
- CompRect outerRect;
-
if (retval)
break;
@@ -871,17 +890,10 @@
void
PlaceWindow::cascadeFindNext (const Placeable::Vector &placeables,
- const CompRect &workArea,
- CompPoint &pos)
+ const CompRect &workArea,
+ CompPoint &pos)
{
- Placeable::Vector sorted;
- Placeable::Vector::iterator iter;
- int cascadeX, cascadeY;
- int xThreshold, yThreshold;
- int winWidth, winHeight;
- int cascadeStage;
-
- sorted = placeables;
+ Placeable::Vector sorted = placeables;
std::sort (sorted.begin (), sorted.end (), compareNorthWestCorner);
/* This is a "fuzzy" cascade algorithm.
@@ -891,35 +903,34 @@
*/
/* arbitrary-ish threshold, honors user attempts to
- * manually cascade.
+ * manually cascade. TODO: Find something better than
+ * a magic number here
*/
-static const unsigned short CASCADE_FUZZ = 15;
+ static const unsigned short CASCADE_FUZZ = 15;
- xThreshold = MAX (this->extents ().left, CASCADE_FUZZ);
- yThreshold = MAX (this->extents ().top, CASCADE_FUZZ);
+ int xThreshold = MAX (this->extents ().left, CASCADE_FUZZ);
+ int yThreshold = MAX (this->extents ().top, CASCADE_FUZZ);
/* Find furthest-SE origin of all workspaces.
* cascade_x, cascade_y are the target position
* of NW corner of window frame.
*/
-
- cascadeX = MAX (0, workArea.x ());
- cascadeY = MAX (0, workArea.y ());
+ int cascadeX = MAX (0, workArea.x ());
+ int cascadeY = MAX (0, workArea.y ());
/* Find first cascade position that's not used. */
-
- winWidth = window->serverWidth ();
- winHeight = window->serverHeight ();
-
- cascadeStage = 0;
- for (iter = sorted.begin (); iter != sorted.end (); ++iter)
+ int winWidth = window->serverWidth ();
+ int winHeight = window->serverHeight ();
+
+ int cascadeStage = 0;
+
+ for (Placeable::Vector::iterator iter = sorted.begin (); iter != sorted.end (); ++iter)
{
Placeable *p = *iter;
- int wx, wy;
/* we want frame position, not window position */
- wx = p->geometry ().x () - p->extents ().left;
- wy = p->geometry ().y () - p->extents ().top;
+ int wx = p->geometry ().x () - p->extents ().left;
+ int wy = p->geometry ().y () - p->extents ().top;
if (abs (wx - cascadeX) < xThreshold &&
abs (wy - cascadeY) < yThreshold)
@@ -987,16 +998,14 @@
if (acceptPPosition && (window->sizeHints ().flags & PPosition))
return true;
- if ((window->type () & CompWindowTypeNormalMask) ||
- ps->optionGetWorkarounds ())
- {
+ if (((window->type () & CompWindowTypeNormalMask) ||
+ ps->optionGetWorkarounds () ) &&
/* Only accept USPosition on non-normal windows if workarounds are
* enabled because apps claiming the user set -geometry for a
* dialog or dock are most likely wrong
*/
- if (window->sizeHints ().flags & USPosition)
- return true;
- }
+ window->sizeHints ().flags & USPosition)
+ return true;
return false;
}
@@ -1010,25 +1019,18 @@
CompWindowTypeToolbarMask |
CompWindowTypeMenuMask |
CompWindowTypeFullscreenMask |
- CompWindowTypeUnknownMask))
- {
+ CompWindowTypeUnknownMask ) ||
+ window->wmType () & (CompWindowTypeDockMask |
+ CompWindowTypeDesktopMask ) )
/* assume the app knows best how to place these */
return NoPlacement;
- }
-
- if (window->wmType () & (CompWindowTypeDockMask |
- CompWindowTypeDesktopMask))
- {
- /* see above */
- return NoPlacement;
- }
if (hasUserDefinedPosition (true))
return ConstrainOnly;
- if (window->transientFor () &&
- (window->type () & (CompWindowTypeDialogMask |
- CompWindowTypeModalDialogMask)))
+ if (window->transientFor () &&
+ (window->type () & (CompWindowTypeDialogMask |
+ CompWindowTypeModalDialogMask)))
{
CompWindow *parent = screen->findWindow (window->transientFor ());
@@ -1039,15 +1041,13 @@
if (window->type () & (CompWindowTypeDialogMask |
CompWindowTypeModalDialogMask |
CompWindowTypeSplashMask))
- {
return PlaceCenteredOnScreen;
- }
return PlaceAndConstrain;
}
const CompOutput &
-PlaceWindow::getPlacementOutput (int mode,
+PlaceWindow::getPlacementOutput (int mode,
PlacementStrategy strategy,
CompPoint pos)
{
@@ -1059,16 +1059,17 @@
if (screen->outputDevs ().size () == 1)
return screen->outputDevs ().at (0);
- switch (strategy) {
+ switch (strategy)
+ {
case PlaceOverParent:
{
- CompWindow *parent;
+ CompWindow *parent = screen->findWindow (window->transientFor ());
- parent = screen->findWindow (window->transientFor ());
if (parent)
output = parent->outputDevice ();
}
break;
+
case ConstrainOnly:
{
CompWindow::Geometry geom = window->serverGeometry ();
@@ -1077,6 +1078,7 @@
output = screen->outputDeviceForGeometry (geom);
}
break;
+
default:
break;
}
@@ -1089,28 +1091,30 @@
if (mode == PlaceOptions::ModePointer)
multiMode = PlaceOptions::MultioutputModeUseOutputDeviceWithPointer;
- switch (multiMode) {
+ switch (multiMode)
+ {
case PlaceOptions::MultioutputModeUseActiveOutputDevice:
return screen->currentOutputDev ();
break;
+
case PlaceOptions::MultioutputModeUseOutputDeviceWithPointer:
{
CompPoint p;
+
if (PlaceScreen::get (screen)->getPointerPosition (p))
- {
output = screen->outputDeviceForPoint (p.x (), p.y ());
- }
}
break;
+
case PlaceOptions::MultioutputModeUseOutputDeviceOfFocussedWindow:
- {
- CompWindow *active;
-
- active = screen->findWindow (screen->activeWindow ());
- if (active)
- output = active->outputDevice ();
- }
+ CompWindow *active;
+
+ active = screen->findWindow (screen->activeWindow ());
+
+ if (active)
+ output = active->outputDevice ();
break;
+
case PlaceOptions::MultioutputModePlaceAcrossAllOutputs:
/* only place on fullscreen output if not placing centered, as the
constraining will move the window away from the center otherwise */
@@ -1130,11 +1134,10 @@
{
CompOption::Value::Vector& matches = ps->optionGetModeMatches ();
CompOption::Value::Vector& modes = ps->optionGetModeModes ();
- int i, min;
-
- min = MIN (matches.size (), modes.size ());
-
- for (i = 0; i < min; i++)
+
+ int min = MIN (matches.size (), modes.size ());
+
+ for (int i = 0; i < min; ++i)
if (matches[i].match ().evaluate (window))
return modes[i].i ();
@@ -1146,22 +1149,26 @@
CompPoint &pos)
{
pos = cp::constrainPositionToWorkArea (pos,
+<<<<<<< TREE
window->serverGeometry (),
window->border (),
workArea);
+=======
+ window->serverGeometry (),
+ window->border (),
+ workArea,
+ staticGravity);
+>>>>>>> MERGE-SOURCE
}
bool
PlaceWindow::windowIsPlaceRelevant (CompWindow *w)
{
- if (w->id () == window->id ())
- return false;
- if (!w->isViewable () && !w->shaded ())
- return false;
- if (w->overrideRedirect ())
- return false;
- if (w->wmType () & (CompWindowTypeDockMask | CompWindowTypeDesktopMask))
+ if (w->id () == window->id () ||
+ (!w->isViewable () && !w->shaded ()) ||
+ w->overrideRedirect () ||
+ w->wmType () & (CompWindowTypeDockMask | CompWindowTypeDesktopMask))
return false;
return true;
@@ -1193,18 +1200,16 @@
bool
PlaceScreen::getPointerPosition (CompPoint &p)
{
- Window wDummy;
- int iDummy;
+ Window wDummy;
+ int iDummy;
unsigned int uiDummy;
- int x, y;
- bool ret;
+ int x, y;
/* this means a server roundtrip, which kind of sucks; this
* this code should be removed as soon as we have software cursor
* rendering and thus a cache pointer co-ordinate */
-
- ret = XQueryPointer (screen->dpy (), screen->root (), &wDummy, &wDummy,
- &x, &y, &iDummy, &iDummy, &uiDummy);
+ bool ret = XQueryPointer (screen->dpy (), screen->root (), &wDummy, &wDummy,
+ &x, &y, &iDummy, &iDummy, &uiDummy);
p.set (x, y);
@@ -1219,15 +1224,13 @@
CompOption::Value::Vector *constrainValues,
bool *keepInWorkarea)
{
- unsigned int i, min;
-
if (window->type () & CompWindowTypeDesktopMask)
return false;
- min = MIN (matches.size (), xValues.size ());
+ unsigned int min = MIN (matches.size (), xValues.size ());
min = MIN (min, yValues.size ());
- for (i = 0; i < min; i++)
+ for (unsigned int i = 0; i < min; ++i)
{
if (matches[i].match ().evaluate (window))
{
@@ -1281,8 +1284,8 @@
}
void
-PlaceWindow::grabNotify (int x,
- int y,
+PlaceWindow::grabNotify (int x,
+ int y,
unsigned int state,
unsigned int mask)
{
=== modified file 'plugins/place/src/screen-size-change/src/screen-size-change.cpp'
--- plugins/place/src/screen-size-change/src/screen-size-change.cpp 2013-04-07 08:45:50 +0000
+++ plugins/place/src/screen-size-change/src/screen-size-change.cpp 2013-07-21 23:03:28 +0000
@@ -37,23 +37,28 @@
compiz::place::ScreenSizeChangeObject::adjustForSize (const CompSize &oldSize,
const CompSize &newSize)
{
- int vpX, vpY;
compiz::window::Geometry g, vpRelRect;
+<<<<<<< TREE
int pivotX, pivotY;
+=======
+>>>>>>> MERGE-SOURCE
g = getGeometry ();
compiz::window::Geometry og (g);
- pivotX = g.x ();
- pivotY = g.y ();
+ int pivotX = g.x ();
+ int pivotY = g.y ();
/* FIXME: Should use saved geometry for maximized / fullscreen windows */
/* calculate target vp x, y index for window's pivot point */
- vpX = pivotX / oldSize.width ();
+ int vpX = pivotX / oldSize.width ();
+
if (pivotX < 0)
vpX -= 1;
- vpY = pivotY / oldSize.height ();
+
+ int vpY = pivotY / oldSize.height ();
+
if (pivotY < 0)
vpY -= 1;
=== modified file 'plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp'
--- plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp 2013-04-16 04:24:22 +0000
+++ plugins/place/src/screen-size-change/tests/screen-size-change/src/test-place-screen-size-change.cpp 2013-07-21 23:03:28 +0000
@@ -70,6 +70,7 @@
unsigned int top,
unsigned int bottom);
+<<<<<<< TREE
void setGeometry (const cw::Geometry &g);
cw::Geometry sizeAdjustTest (const CompSize &oldSize,
const CompSize &newSize);
@@ -169,6 +170,22 @@
}
StubScreenSizeChangeObject::StubScreenSizeChangeObject (const cw::Geometry &g) :
+=======
+ void setGeometry (const compiz::window::Geometry &g);
+ compiz::window::Geometry sizeAdjustTest (const CompSize &oldSize,
+ const CompSize &newSize,
+ CompRect &workArea);
+
+ private:
+
+ CompPoint mCurrentVp;
+ CompRect mCurrentWorkArea;
+ compiz::window::extents::Extents mCurrentExtents;
+ compiz::window::Geometry mCurrentGeometry;
+};
+
+MockScreenSizeChangeObject::MockScreenSizeChangeObject (const compiz::window::Geometry &g) :
+>>>>>>> MERGE-SOURCE
ScreenSizeChangeObject (g),
mCurrentVp (0, 0),
mCurrentWorkArea (50, 50, 1000, 1000),
@@ -244,6 +261,7 @@
mCurrentGeometry = g;
}
+<<<<<<< TREE
cw::Geometry
StubScreenSizeChangeObject::sizeAdjustTest (const CompSize &oldSize,
const CompSize &newSize)
@@ -252,7 +270,44 @@
0,
newSize.width (),
newSize.height ());
-
+=======
+void
+reserveStruts (CompRect &workArea)
+{
+ workArea.setLeft (workArea.left () + 24);
+ workArea.setTop (workArea.top () + 24);
+ workArea.setBottom (workArea.bottom () - 24);
+}
+
+compiz::window::Geometry
+MockScreenSizeChangeObject::sizeAdjustTest (const CompSize &oldSize,
+ const CompSize &newSize,
+ CompRect &workArea)
+{
+ /* Reserve top, bottom and left parts of the screen for
+ * fake "24px" panels */
+ reserveStruts (workArea);
+
+ setWorkArea (workArea);
+
+ compiz::window::Geometry g = adjustForSize (oldSize, newSize);
+
+ return g;
+}
+
+
+TEST_F(CompPlaceScreenSizeChangeTestScreenSizeChange, TestScreenSizeChange)
+{
+ CompSize current, old;
+ compiz::window::Geometry g (200, 250, 300, 400, 0);
+ compiz::window::Geometry expected;
+
+ MockScreenSizeChangeObject ms (g);
+
+ current = CompSize (1280, 800);
+>>>>>>> MERGE-SOURCE
+
+<<<<<<< TREE
/* Reserve top, bottom and left parts of the screen for
* fake "24px" panels */
reserveStruts (workArea, MOCK_STRUT_SIZE);
@@ -319,9 +374,27 @@
WINDOW_WIDTH,
WINDOW_HEIGHT,
0));
+=======
+ CompRect workArea;
+
+ /* First test that changing the screen size
+ * to something smaller here doesn't cause our
+ * (small) window to be moved */
+
+ old = current;
+ current = CompSize (1024, 768);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ expected = compiz::window::Geometry (200, 250, 300, 400, 0);
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+>>>>>>> MERGE-SOURCE
/* Making the screen size bigger with no
* saved geometry should cause the window not to move */
+<<<<<<< TREE
cw::Geometry expectedWindowGeometryAfterChange =
GetInitialWindowGeometry ();
@@ -369,9 +442,33 @@
/* Unplug a "monitor" */
ChangeScreenSizeAndAdjustWindow (CompSize (MONITOR_WIDTH, MONITOR_HEIGHT));
+=======
+ old = current;
+ current = CompSize (2048, 768);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+
+ /* Move the window to the other "monitor" */
+ ms.setGeometry (compiz::window::Geometry (1025, 250, 300, 400, 0));
+
+ /* Unplug a "monitor" */
+ old = current;
+ current = CompSize (1024, 768);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ expected = compiz::window::Geometry (724, 250, 300, 400, 0);
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+>>>>>>> MERGE-SOURCE
/* Re-plug the monitor - window should go back
* to the same position */
+<<<<<<< TREE
cw::Geometry windowGeometryAfterChange =
ChangeScreenSizeAndAdjustWindow (CompSize (DUAL_MONITOR_WIDTH, MONITOR_HEIGHT));
@@ -401,8 +498,20 @@
/* Re-plug the monitor */
ChangeScreenSizeAndAdjustWindow (CompSize (DUAL_MONITOR_WIDTH,
MONITOR_HEIGHT));
+=======
+ old = current;
+ current = CompSize (2048, 768);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ expected = compiz::window::Geometry (1025, 250, 300, 400, 0);
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+>>>>>>> MERGE-SOURCE
/* Plug 2 monitors downwards, no change */
+<<<<<<< TREE
cw::Geometry windowGeometryAfterChange =
ChangeScreenSizeAndAdjustWindow (CompSize (DUAL_MONITOR_WIDTH,
DUAL_MONITOR_HEIGHT));
@@ -473,8 +582,32 @@
/* Unplug bottom "monitor" */
ChangeScreenSizeAndAdjustWindow (CompSize (DUAL_MONITOR_WIDTH,
MONITOR_HEIGHT));
+=======
+ old = current;
+ current = CompSize (2048, 1536);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+
+ /* Move the window to the bottom "monitor" */
+ ms.setGeometry (compiz::window::Geometry (1025, 791, 300, 400, 0));
+
+ /* Unplug bottom "monitor" */
+ old = current;
+ current = CompSize (2048, 768);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ expected = compiz::window::Geometry (1025, 344, 300, 400, 0);
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+>>>>>>> MERGE-SOURCE
/* Re-plug bottom "monitor" */
+<<<<<<< TREE
cw::Geometry windowGeometryAfterChange =
ChangeScreenSizeAndAdjustWindow (CompSize (DUAL_MONITOR_WIDTH,
DUAL_MONITOR_HEIGHT));
@@ -492,7 +625,34 @@
/* Unplug a "monitor" */
SetInitialScreenSize (CompSize (DUAL_MONITOR_WIDTH,
DUAL_MONITOR_HEIGHT));
+=======
+ old = current;
+ current = CompSize (2048, 1356);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ expected = compiz::window::Geometry (1025, 791, 300, 400, 0);
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+
+}
+
+TEST_F(CompPlaceScreenSizeChangeTestScreenSizeChange, TestScreenChangeWindowsOnSecondViewport)
+{
+ CompSize current, old;
+ compiz::window::Geometry g (1025, 791, 300, 400, 0);
+ compiz::window::Geometry expected;
+
+ MockScreenSizeChangeObject ms (g);
+
+ current = CompSize (2048, 1356);
+
+ CompRect workArea;
+
+>>>>>>> MERGE-SOURCE
/* Move the entire window right a viewport */
+<<<<<<< TREE
SetWindowGeometry (cw::Geometry (DUAL_MONITOR_WIDTH +
MONITOR_WIDTH +
WINDOW_X,
@@ -508,6 +668,10 @@
WINDOW_WIDTH,
WINDOW_HEIGHT,
0);
+=======
+ g.setPos (g.pos () + CompPoint (current.width (), 0));
+ ms.setGeometry (g);
+>>>>>>> MERGE-SOURCE
/* Now change the screen resolution again - the window should
* move to be within the constrained size of its current
@@ -532,6 +696,7 @@
0));
/* Unplug a "monitor" */
+<<<<<<< TREE
ChangeScreenSizeAndAdjustWindow (CompSize (MONITOR_WIDTH,
DUAL_MONITOR_HEIGHT));
@@ -700,3 +865,119 @@
= GetInitialWindowGeometry ();
EXPECT_EQ (expectedWindowGeometryAfterChange, windowGeometryAfterChange);
}
+=======
+ old = current;
+ current = CompSize (1024, 1356);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ expected = compiz::window::Geometry (current.width () + 724, 791, 300, 400, 0);
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+
+ /* Replug the monitor, make sure that the geometry is restored */
+ old = current;
+ current = CompSize (2048, 1356);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ expected = compiz::window::Geometry (current.width () + 1025, 791, 300, 400, 0);
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+
+ /* Replug the monitor and move the window to where it fits on the first
+ * monitor on the second viewport, then make sure it doesn't move */
+ old = CompSize (2048, 1356);
+ current = CompSize (1024, 1356);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ g.setPos (CompPoint (old.width () + 25, 791));
+ ms.setGeometry (g);
+ /* clear the saved geometry */
+ ms.unset();
+
+ expected = compiz::window::Geometry (current.width () + 25, 791, 300, 400, 0);
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+
+ old = current;
+ current = CompSize (2048, 1356);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ expected = compiz::window::Geometry (current.width () + 25, 791, 300, 400, 0);
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+}
+
+TEST_F(CompPlaceScreenSizeChangeTestScreenSizeChange, TestScreenChangeWindowsOnPreviousViewport)
+{
+ CompSize current, old;
+ compiz::window::Geometry g (0, 0, 300, 400, 0);
+ compiz::window::Geometry expected;
+
+ MockScreenSizeChangeObject ms (g);
+
+ current = CompSize (2048, 1356);
+
+ CompRect workArea;
+
+ /* Deal with the case where the position is negative, which means
+ * it's actually wrapped around to the rightmost viewport
+ */
+ g.setPos (CompPoint (-300, 200));
+ ms.setGeometry (g);
+
+ expected = g;
+
+ /* Unplug the right "monitor" */
+ old = current;
+ current = CompSize (1024, 1356);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+
+ /* Re-plug the right "monitor" */
+ old = current;
+ current = CompSize (2048, 1356);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+
+ /* Move the window to the left monitor, verify that it survives an
+ * unplug/plug cycle
+ */
+ g.setPos (CompPoint (-1324, 200));
+ ms.setGeometry (g);
+
+ old = current;
+ current = CompSize (1024, 1356);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ expected = compiz::window::Geometry (-300, 200, 300, 400, 0);
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+
+ old = current;
+ current = CompSize (2048, 1356);
+ workArea = CompRect (0, 0, current.width (), current.height ());
+
+ expected = compiz::window::Geometry (-1324, 200, 300, 400, 0);
+
+ g = ms.sizeAdjustTest (old, current, workArea);
+
+ EXPECT_EQ (expected, g);
+
+}
+>>>>>>> MERGE-SOURCE
=== modified file 'plugins/place/src/smart/src/smart.cpp'
--- plugins/place/src/smart/src/smart.cpp 2012-09-05 16:42:03 +0000
+++ plugins/place/src/smart/src/smart.cpp 2013-07-21 23:03:28 +0000
@@ -159,7 +159,7 @@
/* else ==> not enough x dimension (overlap was wrong on horizontal) */
else if (overlap == W_WRONG)
{
- xTmp = placeable->workArea ().x ();
+ xTmp = placeable->workArea ().x ();
int possible = placeable->workArea ().bottom ();
if (possible - ch > yTmp)
@@ -181,6 +181,7 @@
possible = yb;
basket = yt - ch;
+
if (basket > yTmp && possible > basket)
possible = basket;
}
=== modified file 'plugins/put/src/put.cpp'
--- plugins/put/src/put.cpp 2013-05-11 14:06:54 +0000
+++ plugins/put/src/put.cpp 2013-07-21 23:03:28 +0000
@@ -92,10 +92,8 @@
PutScreen::boxCompare (const CompRect& a,
const CompRect& b)
{
- int areaA, areaB;
-
- areaA = a.width () * a.height ();
- areaB = b.width () * b.height ();
+ int areaA = a.width () * a.height ();
+ int areaB = b.width () * b.height ();
return (areaA > areaB);
}
@@ -116,16 +114,20 @@
unsigned int corner,
const short inc)
{
- switch (corner) {
+ switch (corner)
+ {
case LEFT:
rect.setX (rect.x () + inc);
break;
+
case RIGHT:
rect.setWidth (rect.width () + inc);
break;
+
case TOP:
rect.setY (rect.y () + inc);
break;
+
case BOTTOM:
rect.setHeight (rect.height () + inc);
break;
@@ -147,7 +149,8 @@
tmp.width () + LEFT_BORDER (w) + RIGHT_BORDER (w), \
tmp.height () + TOP_BORDER (w) + BOTTOM_BORDER (w)))
- while (CHECKREC) {
+ while (CHECKREC)
+ {
addToCorner (tmp, corner, direction);
touch = true;
}
@@ -181,7 +184,7 @@
if (right)
expandCorner (w, result, r, RIGHT, 1);
- counter++;
+ ++counter;
}
if ((xFirst && counter == 1) || (!xFirst && counter == 0))
@@ -192,7 +195,7 @@
if (up)
expandCorner (w, result, r, TOP, -1);
- counter++;
+ ++counter;
}
}
@@ -211,15 +214,15 @@
bool up,
bool down)
{
- CompRect windowBox, ansA, ansB, orig;
+ CompRect windowBox;
windowBox.setGeometry (w->serverX (), w->serverY (),
w->serverWidth (), w->serverHeight ());
- orig = windowBox;
+ CompRect orig = windowBox;
- ansA = extendBox (w, windowBox, r, true, left, right, up, down);
- ansB = extendBox (w, windowBox, r, false, left, right, up, down);
+ CompRect ansA = extendBox (w, windowBox, r, true, left, right, up, down);
+ CompRect ansB = extendBox (w, windowBox, r, false, left, right, up, down);
if (boxCompare (orig, ansA) && boxCompare (orig, ansB))
return orig;
@@ -228,7 +231,6 @@
return ansA;
else
return ansB;
-
}
/* Calls out to compute the resize */
@@ -241,12 +243,10 @@
bool down)
{
unsigned int mask = 0;
- CompRect box;
- CompRegion region;
int outputDevice = w->outputDevice ();
- region = emptyRegion (w, screen->outputDevs ()[outputDevice]);
- box = findRect (w, region, left, right, up, down);
+ CompRegion region = emptyRegion (w, screen->outputDevs ()[outputDevice]);
+ CompRect box = findRect (w, region, left, right, up, down);
if (box.x () != w->serverX ())
mask |= CWX;
@@ -273,24 +273,22 @@
*/
/*
- * calculate the velocity for the moving window
+ * Calculate the velocity for the moving window
*/
int
PutScreen::adjustVelocity (CompWindow *w)
{
- float dx, dy, adjust, amount;
- float x1, y1;
-
PUT_WINDOW (w);
- x1 = pw->targetX;
- y1 = pw->targetY;
-
- dx = x1 - (w->x () + pw->tx);
- dy = y1 - (w->y () + pw->ty);
-
- adjust = dx * 0.15f;
- amount = fabs (dx) * 1.5;
+ float x1 = pw->targetX;
+ float y1 = pw->targetY;
+
+ float dx = x1 - (w->x () + pw->tx);
+ float dy = y1 - (w->y () + pw->ty);
+
+ float adjust = dx * 0.15f;
+ float amount = fabs (dx) * 1.5;
+
if (amount < 0.5f)
amount = 0.5f;
else if (amount > 5.0f)
@@ -300,6 +298,7 @@
adjust = dy * 0.15f;
amount = fabs (dy) * 1.5f;
+
if (amount < 0.5f)
amount = 0.5f;
else if (amount > 5.0f)
@@ -317,6 +316,7 @@
pw->ty = y1 - w->y ();
return 0;
}
+
return 1;
}
@@ -358,25 +358,24 @@
CompOption::Vector &option)
{
CompScreen *s = screen;
- int x, y, dx, dy, posX, posY;
- int viewport, output;
+ int dx, dy;
CompRect workArea;
CompPoint result;
PUT_SCREEN (s);
PUT_WINDOW (w);
- posX = CompOption::getIntOptionNamed (option,"x", 0);
- posY = CompOption::getIntOptionNamed (option,"y", 0);
+ int posX = CompOption::getIntOptionNamed (option,"x", 0);
+ int posY = CompOption::getIntOptionNamed (option,"y", 0);
/* get the output device number from the options list */
- output = CompOption::getIntOptionNamed (option,"output", -1);
+ int output = CompOption::getIntOptionNamed (option,"output", -1);
+
/* no output in options list -> use the current output */
if (output == -1)
{
/* no output given, so use the current output if
this wasn't a double tap */
-
if (ps->lastType != type || ps->lastWindow != w->id ())
output = getOutputForWindow (w);
}
@@ -404,45 +403,54 @@
if (PUT_ONLY_EMPTY (type))
{
- unsigned int mask;
XWindowChanges xwc;
bool left, right, up, down;
left = right = up = down = false;
- switch (type) {
+ switch (type)
+ {
case PutEmptyBottomLeft:
left = down = true;
break;
+
case PutEmptyBottom:
down = true;
break;
+
case PutEmptyBottomRight:
right = down = true;
break;
+
case PutEmptyLeft:
left = true;
break;
+
case PutEmptyCenter:
left = right = up = down = true;
break;
+
case PutEmptyRight:
right = true;
break;
+
case PutEmptyTopLeft:
left = up = true;
break;
+
case PutEmptyTop:
up = true;
break;
+
case PutEmptyTopRight:
right = up = true;
break;
+
default:
break;
}
- mask = computeResize (w, &xwc, left,right,up,down);
+ unsigned int mask = computeResize (w, &xwc, left, right, up, down);
if (mask)
{
if (w->constrainNewWindowSize (xwc.width, xwc.height,
@@ -453,161 +461,181 @@
workArea.setGeometry (xwc.x, xwc.y, xwc.width, xwc.height);
}
/* the windows location */
- x = w->x () + pw->tx;
- y = w->y () + pw->ty;
-
- switch (type) {
- case PutEmptyCenter:
- case PutCenter:
- /* center of the screen */
- dx = (workArea.width () / 2) - HALF_WIDTH (w) -
- w->serverGeometry ().border () - (x - workArea.x ());
- dy = (workArea.height () / 2) - HALF_HEIGHT (w) -
- w->serverGeometry ().border () - (y - workArea.y ());
- break;
- case PutLeft:
- /* center of the left edge */
- dx = -(x - workArea.x ()) + LEFT_BORDER (w) + ps->optionGetPadLeft ();
- dy = (workArea.height () / 2) - HALF_HEIGHT (w) -
- (y - workArea.y ());
- break;
- case PutEmptyLeft:
- /* center of the left edge */
- workArea.setX (workArea.x () - LEFT_BORDER (w));
- dx = -(x - workArea.x ()) + LEFT_BORDER (w) + ps->optionGetPadLeft ();
- dy = (workArea.height () / 2) - HALF_HEIGHT (w) -
- (y - workArea.y ());
- break;
- case PutTopLeft:
- /* top left corner */
- dx = -(x - workArea.x ()) + LEFT_BORDER (w) + ps->optionGetPadLeft ();
- dy = -(y - workArea.y ()) + TOP_BORDER (w) + ps->optionGetPadTop ();
- break;
- case PutEmptyTopLeft:
- /* top left corner */
- workArea.setX (workArea.x () - LEFT_BORDER (w));
- workArea.setY (workArea.y () - TOP_BORDER (w));
- dx = -(x - workArea.x ()) + LEFT_BORDER (w) + ps->optionGetPadLeft ();
- dy = -(y - workArea.y ()) + TOP_BORDER (w) + ps->optionGetPadTop ();
- break;
- case PutTop:
- /* center of top edge */
- dx = (workArea.width () / 2) - HALF_WIDTH (w) -
- (x - workArea.x ());
- dy = -(y - workArea.y ()) + TOP_BORDER (w) + ps->optionGetPadTop ();
- break;
- case PutEmptyTop:
- /* center of top edge */
- workArea.setY (workArea.x () - TOP_BORDER (w));
- dx = (workArea.width () / 2) - HALF_WIDTH (w) -
- (x - workArea.x ());
- dy = -(y - workArea.y ()) + TOP_BORDER (w) + ps->optionGetPadTop ();
- break;
- case PutTopRight:
- /* top right corner */
- dx = workArea.width () - w->serverWidth () - (x - workArea.x ()) -
- RIGHT_BORDER (w) - ps->optionGetPadRight ();
- dy = -(y - workArea.y ()) + TOP_BORDER (w) + ps->optionGetPadTop ();
- break;
- case PutEmptyTopRight:
- /* top right corner */
- workArea.setX (workArea.x () + RIGHT_BORDER (w));
- workArea.setY (workArea.y () - TOP_BORDER (w));
- dx = workArea.width () - w->serverWidth () - (x - workArea.x ()) -
- RIGHT_BORDER (w) - ps->optionGetPadRight ();
- dy = -(y - workArea.y ()) + TOP_BORDER (w) + ps->optionGetPadTop ();
- break;
- case PutRight:
- /* center of right edge */
- dx = workArea.width () - w->serverWidth () - (x - workArea.x ()) -
- RIGHT_BORDER (w) - ps->optionGetPadRight ();
- dy = (workArea.height () / 2) - HALF_HEIGHT (w) -
- (y - workArea.y ());
- break;
- case PutEmptyRight:
- /* center of right edge */
- workArea.setX (workArea.x () + RIGHT_BORDER (w));
- dx = workArea.width () - w->serverWidth () - (x - workArea.x ()) -
- RIGHT_BORDER (w) - ps->optionGetPadRight ();
- dy = (workArea.height () / 2) - HALF_HEIGHT (w) -
- (y - workArea.y ());
- break;
- case PutBottomRight:
- /* bottom right corner */
- dx = workArea.width () - w->serverWidth () - (x - workArea.x ()) -
- RIGHT_BORDER (w) - ps->optionGetPadRight ();
- dy = workArea.height () - w->serverHeight () - (y - workArea.y ()) -
- BOTTOM_BORDER (w) - ps->optionGetPadBottom ();
- break;
- case PutEmptyBottomRight:
- /* bottom right corner */
- workArea.setX (workArea.x () + RIGHT_BORDER (w));
- workArea.setY (workArea.y () + BOTTOM_BORDER (w));
- dx = workArea.width () - w->serverWidth () - (x - workArea.x ()) -
- RIGHT_BORDER (w) - ps->optionGetPadRight ();
- dy = workArea.height () - w->serverHeight () - (y - workArea.y ()) -
- BOTTOM_BORDER (w)- ps->optionGetPadBottom ();
- break;
- case PutBottom:
- /* center of bottom edge */
- dx = (workArea.width () / 2) - HALF_WIDTH (w) -
- (x - workArea.x ());
- dy = workArea.height () - w->serverHeight () - (y - workArea.y ()) -
- BOTTOM_BORDER (w) - ps->optionGetPadBottom ();
- break;
- case PutEmptyBottom:
- /* center of bottom edge */
- workArea.setY (workArea.y () + BOTTOM_BORDER (w));
- dx = (workArea.width () / 2) - HALF_WIDTH (w) -
- (x - workArea.x ());
- dy = workArea.height () - w->serverHeight () - (y - workArea.y ()) -
- BOTTOM_BORDER (w) - ps->optionGetPadBottom ();
- break;
- case PutBottomLeft:
- /* bottom left corner */
- dx = -(x - workArea.x ()) + LEFT_BORDER (w) + ps->optionGetPadLeft ();
- dy = workArea.height () - w->serverHeight () - (y - workArea.y ()) -
- BOTTOM_BORDER (w) - ps->optionGetPadBottom ();
- break;
- case PutEmptyBottomLeft:
- /* bottom left corner */
- workArea.setX (workArea.x () - LEFT_BORDER (w));
- workArea.setY (workArea.y () + BOTTOM_BORDER (w));
- dx = -(x - workArea.x ()) + LEFT_BORDER (w) + ps->optionGetPadLeft ();
- dy = workArea.height () - w->serverHeight () - (y - workArea.y ()) -
- BOTTOM_BORDER (w) - ps->optionGetPadBottom ();
- break;
- case PutRestore:
- /* back to last position */
- dx = pw->lastX - x;
- dy = pw->lastY - y;
- break;
- case PutViewport:
+ int x = w->x () + pw->tx;
+ int y = w->y () + pw->ty;
+
+ switch (type)
+ {
+ case PutEmptyCenter:
+ case PutCenter:
+ /* center of the screen */
+ dx = (workArea.width () / 2) - HALF_WIDTH (w) -
+ w->serverGeometry ().border () - (x - workArea.x ());
+ dy = (workArea.height () / 2) - HALF_HEIGHT (w) -
+ w->serverGeometry ().border () - (y - workArea.y ());
+ break;
+
+ case PutLeft:
+ /* center of the left edge */
+ dx = -(x - workArea.x ()) + LEFT_BORDER (w) + ps->optionGetPadLeft ();
+ dy = (workArea.height () / 2) - HALF_HEIGHT (w) -
+ (y - workArea.y ());
+ break;
+
+ case PutEmptyLeft:
+ /* center of the left edge */
+ workArea.setX (workArea.x () - LEFT_BORDER (w));
+ dx = -(x - workArea.x ()) + LEFT_BORDER (w) + ps->optionGetPadLeft ();
+ dy = (workArea.height () / 2) - HALF_HEIGHT (w) -
+ (y - workArea.y ());
+ break;
+
+ case PutTopLeft:
+ /* top left corner */
+ dx = -(x - workArea.x ()) + LEFT_BORDER (w) + ps->optionGetPadLeft ();
+ dy = -(y - workArea.y ()) + TOP_BORDER (w) + ps->optionGetPadTop ();
+ break;
+
+ case PutEmptyTopLeft:
+ /* top left corner */
+ workArea.setX (workArea.x () - LEFT_BORDER (w));
+ workArea.setY (workArea.y () - TOP_BORDER (w));
+ dx = -(x - workArea.x ()) + LEFT_BORDER (w) + ps->optionGetPadLeft ();
+ dy = -(y - workArea.y ()) + TOP_BORDER (w) + ps->optionGetPadTop ();
+ break;
+
+ case PutTop:
+ /* center of top edge */
+ dx = (workArea.width () / 2) - HALF_WIDTH (w) -
+ (x - workArea.x ());
+ dy = -(y - workArea.y ()) + TOP_BORDER (w) + ps->optionGetPadTop ();
+ break;
+
+ case PutEmptyTop:
+ /* center of top edge */
+ workArea.setY (workArea.x () - TOP_BORDER (w));
+ dx = (workArea.width () / 2) - HALF_WIDTH (w) -
+ (x - workArea.x ());
+ dy = -(y - workArea.y ()) + TOP_BORDER (w) + ps->optionGetPadTop ();
+ break;
+
+ case PutTopRight:
+ /* top right corner */
+ dx = workArea.width () - w->serverWidth () - (x - workArea.x ()) -
+ RIGHT_BORDER (w) - ps->optionGetPadRight ();
+ dy = -(y - workArea.y ()) + TOP_BORDER (w) + ps->optionGetPadTop ();
+ break;
+
+ case PutEmptyTopRight:
+ /* top right corner */
+ workArea.setX (workArea.x () + RIGHT_BORDER (w));
+ workArea.setY (workArea.y () - TOP_BORDER (w));
+ dx = workArea.width () - w->serverWidth () - (x - workArea.x ()) -
+ RIGHT_BORDER (w) - ps->optionGetPadRight ();
+ dy = -(y - workArea.y ()) + TOP_BORDER (w) + ps->optionGetPadTop ();
+ break;
+
+ case PutRight:
+ /* center of right edge */
+ dx = workArea.width () - w->serverWidth () - (x - workArea.x ()) -
+ RIGHT_BORDER (w) - ps->optionGetPadRight ();
+ dy = (workArea.height () / 2) - HALF_HEIGHT (w) -
+ (y - workArea.y ());
+ break;
+
+ case PutEmptyRight:
+ /* center of right edge */
+ workArea.setX (workArea.x () + RIGHT_BORDER (w));
+ dx = workArea.width () - w->serverWidth () - (x - workArea.x ()) -
+ RIGHT_BORDER (w) - ps->optionGetPadRight ();
+ dy = (workArea.height () / 2) - HALF_HEIGHT (w) -
+ (y - workArea.y ());
+ break;
+
+ case PutBottomRight:
+ /* bottom right corner */
+ dx = workArea.width () - w->serverWidth () - (x - workArea.x ()) -
+ RIGHT_BORDER (w) - ps->optionGetPadRight ();
+ dy = workArea.height () - w->serverHeight () - (y - workArea.y ()) -
+ BOTTOM_BORDER (w) - ps->optionGetPadBottom ();
+ break;
+
+ case PutEmptyBottomRight:
+ /* bottom right corner */
+ workArea.setX (workArea.x () + RIGHT_BORDER (w));
+ workArea.setY (workArea.y () + BOTTOM_BORDER (w));
+ dx = workArea.width () - w->serverWidth () - (x - workArea.x ()) -
+ RIGHT_BORDER (w) - ps->optionGetPadRight ();
+ dy = workArea.height () - w->serverHeight () - (y - workArea.y ()) -
+ BOTTOM_BORDER (w)- ps->optionGetPadBottom ();
+ break;
+
+ case PutBottom:
+ /* center of bottom edge */
+ dx = (workArea.width () / 2) - HALF_WIDTH (w) -
+ (x - workArea.x ());
+ dy = workArea.height () - w->serverHeight () - (y - workArea.y ()) -
+ BOTTOM_BORDER (w) - ps->optionGetPadBottom ();
+ break;
+
+ case PutEmptyBottom:
+ /* center of bottom edge */
+ workArea.setY (workArea.y () + BOTTOM_BORDER (w));
+ dx = (workArea.width () / 2) - HALF_WIDTH (w) -
+ (x - workArea.x ());
+ dy = workArea.height () - w->serverHeight () - (y - workArea.y ()) -
+ BOTTOM_BORDER (w) - ps->optionGetPadBottom ();
+ break;
+
+ case PutBottomLeft:
+ /* bottom left corner */
+ dx = -(x - workArea.x ()) + LEFT_BORDER (w) + ps->optionGetPadLeft ();
+ dy = workArea.height () - w->serverHeight () - (y - workArea.y ()) -
+ BOTTOM_BORDER (w) - ps->optionGetPadBottom ();
+ break;
+
+ case PutEmptyBottomLeft:
+ /* bottom left corner */
+ workArea.setX (workArea.x () - LEFT_BORDER (w));
+ workArea.setY (workArea.y () + BOTTOM_BORDER (w));
+ dx = -(x - workArea.x ()) + LEFT_BORDER (w) + ps->optionGetPadLeft ();
+ dy = workArea.height () - w->serverHeight () - (y - workArea.y ()) -
+ BOTTOM_BORDER (w) - ps->optionGetPadBottom ();
+ break;
+
+ case PutRestore:
+ /* back to last position */
+ dx = pw->lastX - x;
+ dy = pw->lastY - y;
+ break;
+
+ case PutViewport:
{
- int vpX, vpY, hDirection, vDirection;
-
/* get the viewport to move to from the options list */
- viewport = CompOption::getIntOptionNamed (option, "viewport", -1);
+ int viewport = CompOption::getIntOptionNamed (option, "viewport", -1);
/* if viewport wasn't supplied, bail out */
if (viewport < 0)
return result;
/* split 1D viewport value into 2D x and y viewport */
- vpX = viewport % s->vpSize ().width ();
- vpY = viewport / s->vpSize ().width ();
+ int vpX = viewport % s->vpSize ().width ();
+ int vpY = viewport / s->vpSize ().width ();
+
if (vpY > (int) s->vpSize ().height ())
vpY = s->vpSize ().height () - 1;
/* take the shortest horizontal path to the destination viewport */
- hDirection = (vpX - s->vp ().x ());
+ int hDirection = (vpX - s->vp ().x ());
+
if (hDirection > (int) s->vpSize ().width () / 2)
hDirection = (hDirection - s->vpSize ().width ());
else if (hDirection < - ((int) s->vpSize ().width ()) / 2)
hDirection = (hDirection + s->vpSize ().width ());
/* we need to do this for the vertical destination viewport too */
- vDirection = (vpY - s->vp ().y ());
+ int vDirection = (vpY - s->vp ().y ());
+
if (vDirection > (int) s->vpSize ().height () / 2)
vDirection = (vDirection - s->vpSize ().height ());
else if (vDirection < -((int) s->vpSize ().height ()) / 2)
@@ -617,6 +645,7 @@
dy = s->height () * vDirection;
break;
}
+<<<<<<< TREE
case PutViewportLeft:
/* move to the viewport on the left */
dx = (s->vp ().x () >= 1) ? -s->width () : 0;
@@ -639,20 +668,52 @@
break;
case PutPreviousOutput:
case PutNextOutput:
+=======
+
+ case PutViewportLeft:
+ /* move to the viewport on the left */
+ dx = (s->vp ().x () >= 1) ? -s->width () : 0;
+ dy = 0;
+ break;
+
+ case PutViewportRight:
+ /* move to the viewport on the right */
+ dx = (s->vp ().x () < s->vpSize ().width ()-1) ? s->width () : 0;
+ dy = 0;
+ break;
+
+ case PutViewportUp:
+ /* move to the viewport above */
+ dx = 0;
+ dy = (s->vp ().y () >= 1) ? -s->height () : 0;
+ break;
+
+ case PutViewportDown:
+ /* move to the viewport below */
+ dx = 0;
+ dy = (s->vp ().y () < s->vpSize ().height ()-1) ? s->height () : 0;
+ break;
+
+ case PutNextOutput:
+>>>>>>> MERGE-SOURCE
{
- int outputNum, currentNum;
int nOutputDev = s->outputDevs ().size ();
CompOutput *currentOutput, *newOutput;
if (nOutputDev < 2)
return result;
+<<<<<<< TREE
currentNum = getOutputForWindow (w);
outputNum = (currentNum + (type == PutNextOutput ? 1 : -1)) % nOutputDev;
if (outputNum < 0)
outputNum += nOutputDev;
+=======
+ int currentNum = getOutputForWindow (w);
+ int outputNum = (currentNum + 1) % nOutputDev;
+>>>>>>> MERGE-SOURCE
outputNum = CompOption::getIntOptionNamed (option,"output",
outputNum);
@@ -671,29 +732,32 @@
/* update work area for new output */
workArea = newOutput->workArea ();
}
- break;
- case PutAbsolute:
- /* move the window to an exact position */
- if (posX < 0)
- /* account for a specified negative position,
- like geometry without (-0) */
- dx = posX + s->width () - w->serverWidth () - x - RIGHT_BORDER (w);
- else
- dx = posX - x + LEFT_BORDER (w);
-
- if (posY < 0)
- /* account for a specified negative position,
- like geometry without (-0) */
- dy = posY + s->height () - w->height () - y - BOTTOM_BORDER (w);
- else
- dy = posY - y + TOP_BORDER (w);
- break;
- case PutRelative:
- /* move window by offset */
- dx = posX;
- dy = posY;
- break;
- case PutPointer:
+ break;
+
+ case PutAbsolute:
+ /* move the window to an exact position */
+ if (posX < 0)
+ /* account for a specified negative position,
+ like geometry without (-0) */
+ dx = posX + s->width () - w->serverWidth () - x - RIGHT_BORDER (w);
+ else
+ dx = posX - x + LEFT_BORDER (w);
+
+ if (posY < 0)
+ /* account for a specified negative position,
+ like geometry without (-0) */
+ dy = posY + s->height () - w->height () - y - BOTTOM_BORDER (w);
+ else
+ dy = posY - y + TOP_BORDER (w);
+ break;
+
+ case PutRelative:
+ /* move window by offset */
+ dx = posX;
+ dy = posY;
+ break;
+
+ case PutPointer:
{
/* move the window to the pointers position
* using the current quad of the screen to determine
@@ -743,15 +807,15 @@
}
}
else
- {
dx = dy = 0;
- }
+
}
- break;
- default:
- /* if an unknown type is specified, do nothing */
- dx = dy = 0;
- break;
+ break;
+
+ default:
+ /* if an unknown type is specified, do nothing */
+ dx = dy = 0;
+ break;
}
if ((dx || dy) && ps->optionGetAvoidOffscreen () &&
@@ -777,24 +841,16 @@
area.bottom = workArea.bottom () - ps->optionGetPadBottom ();
if (extents.left < area.left)
- {
inDx += area.left - extents.left;
- }
else if (w->serverWidth () <= workArea.width () &&
extents.right > area.right)
- {
inDx += area.right - extents.right;
- }
if (extents.top < area.top)
- {
inDy += area.top - extents.top;
- }
else if (w->serverHeight () <= workArea.height () &&
extents.bottom > area.bottom)
- {
inDy += area.bottom - extents.bottom;
- }
/* apply the change */
dx += inDx - dxBefore;
@@ -814,14 +870,13 @@
if (ps->moreAdjust && ps->grabIndex)
{
- int steps;
- float amount, chunk;
+ float amount = ms * 0.025f * ps->optionGetSpeed ();
+ int steps = amount / (0.5f * ps->optionGetTimestep ());
- amount = ms * 0.025f * ps->optionGetSpeed ();
- steps = amount / (0.5f * ps->optionGetTimestep ());
if (!steps)
steps = 1;
- chunk = amount / (float)steps;
+
+ float chunk = amount / (float)steps;
while (steps--)
{
@@ -859,6 +914,7 @@
screen->focusDefaultWindow ();
else if (endAnimationWindow)
screen->sendWindowActivationRequest (endAnimationWindow);
+
break;
}
}
@@ -880,14 +936,12 @@
CompOutput *output,
unsigned int mask)
{
- bool status;
-
PUT_SCREEN (screen);
if (ps->moreAdjust)
mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
- status = gScreen->glPaintOutput (attrib, transform, region, output, mask);
+ bool status = gScreen->glPaintOutput (attrib, transform, region, output, mask);
return status;
}
@@ -898,30 +952,25 @@
PUT_SCREEN (screen);
if (ps->moreAdjust && ps->grabIndex)
- {
cScreen->damageScreen (); // FIXME
- }
- else
+ else if (ps->grabIndex)
{
- if (ps->grabIndex)
- {
- /* release the screen grab */
- screen->removeGrab (ps->grabIndex, NULL);
- ps->grabIndex = 0;
- }
+ /* release the screen grab */
+ screen->removeGrab (ps->grabIndex, NULL);
+ ps->grabIndex = 0;
}
cScreen->donePaint ();
}
-/* This is our event handler. It directly hooks into the screen's X Event handler and allows us to handle
- * our raw X Events
+/* This is our event handler. It directly hooks into the screen's X Event handler and
+ * allows us to handle our raw X Events
*/
-
void
PutScreen::handleEvent (XEvent *event)
{
- switch (event->type) {
+ switch (event->type)
+ {
/* handle client events */
case ClientMessage:
/* accept the custom atom for putting windows */
@@ -971,6 +1020,7 @@
}
}
break;
+
default:
break;
}
@@ -1009,13 +1059,14 @@
PutType type)
{
CompWindow *w;
- Window xid;
-
- xid = CompOption::getIntOptionNamed (option, "window", 0);
+
+ Window xid = CompOption::getIntOptionNamed (option, "window", 0);
+
if (!xid)
xid = screen->activeWindow ();
w = screen->findWindow (xid);
+
if (w)
{
CompScreen *s = screen;
@@ -1037,9 +1088,7 @@
/* only allow movement of fullscreen windows to next output */
if ((type != PutNextOutput && type != PutPreviousOutput) &&
(w->type () & CompWindowTypeFullscreenMask))
- {
return false;
- }
/*
* handle the put types
@@ -1169,9 +1218,8 @@
CompOption::Vector &option)
{
PutType type = PutUnknown;
- CompString typeString;
- typeString = CompOption::getStringOptionNamed (option, "type");
+ CompString typeString = CompOption::getStringOptionNamed (option, "type");
if (!typeString.empty ())
type = typeFromString (typeString);
@@ -1188,6 +1236,7 @@
int vp)
{
unsigned int index;
+
if (CompOption::findOption (option, "viewport", &index) == NULL)
{
int last = option.size ();
@@ -1196,14 +1245,11 @@
option[last].value ().set (vp-1);
}
else
- {
option[index].value ().set (vp-1);
- }
return initiateCommon (action, state, option, (PutType) PutViewport);
}
-
PutScreen::PutScreen (CompScreen *screen) :
PluginClassHandler (screen),
PutOptions (),
=== modified file 'plugins/regex/src/regex.cpp'
--- plugins/regex/src/regex.cpp 2013-05-09 13:43:07 +0000
+++ plugins/regex/src/regex.cpp 2013-07-21 23:03:28 +0000
@@ -35,7 +35,9 @@
class RegexExp : public CompMatch::Expression
{
public:
- typedef enum {
+
+ typedef enum
+ {
TypeTitle,
TypeRole,
TypeClass,
@@ -49,7 +51,9 @@
static int matches (const CompString& str);
private:
- typedef struct {
+
+ typedef struct
+ {
const char *name;
size_t length;
Type type;
@@ -62,7 +66,8 @@
regex_t *mRegex;
};
-const RegexExp::Prefix RegexExp::prefix[] = {
+const RegexExp::Prefix RegexExp::prefix[] =
+{
{ "title=", 6, TypeTitle, 0 },
{ "role=", 5, TypeRole, 0 },
{ "class=", 6, TypeClass, 0 },
@@ -78,13 +83,10 @@
{
if ((unsigned int) item < sizeof (prefix) / sizeof (prefix[0]))
{
- int status;
- CompString value;
-
- value = str.substr (prefix[item].length);
+ CompString value = str.substr (prefix[item].length);
mRegex = new regex_t;
- status = regcomp (mRegex, value.c_str (),
- REG_NOSUB | prefix[item].flags);
+ int status = regcomp (mRegex, value.c_str (),
+ REG_NOSUB | prefix[item].flags);
if (status)
{
@@ -124,21 +126,23 @@
case TypeRole:
string = &rw->role;
break;
+
case TypeTitle:
string = &rw->title;
break;
+
case TypeClass:
string = &rw->resClass;
break;
+
case TypeName:
string = &rw->resName;
break;
}
- if (!mRegex || !string)
- return false;
-
- if (regexec (mRegex, string->c_str (), 0, NULL, 0))
+ if (!mRegex ||
+ !string ||
+ regexec (mRegex, string->c_str (), 0, NULL, 0))
return false;
return true;
@@ -147,7 +151,7 @@
int
RegexExp::matches (const CompString& str)
{
- for (unsigned int i = 0; i < sizeof (prefix) / sizeof (prefix[0]); i++)
+ for (unsigned int i = 0; i < sizeof (prefix) / sizeof (prefix[0]); ++i)
if (str.compare (0, prefix[i].length, prefix[i].name) == 0)
return (int) i;
@@ -170,15 +174,15 @@
Atom typeAtom,
CompString& string)
{
- Atom type;
+ Atom type;
unsigned long nItems;
unsigned long bytesAfter;
unsigned char *str = NULL;
- int format, result;
+ int format;
- result = XGetWindowProperty (screen->dpy (), window->id (), nameAtom, 0,
- LONG_MAX, false, typeAtom, &type, &format,
- &nItems, &bytesAfter, (unsigned char **) &str);
+ int result = XGetWindowProperty (screen->dpy (), window->id (), nameAtom, 0,
+ LONG_MAX, false, typeAtom, &type, &format,
+ &nItems, &bytesAfter, (unsigned char **) &str);
if (result != Success)
return false;
@@ -212,10 +216,8 @@
title = "";
- if (getStringProperty (rs->visibleNameAtom, Atoms::utf8String, title))
- return;
-
- if (getStringProperty (Atoms::wmName, Atoms::utf8String, title))
+ if (getStringProperty (rs->visibleNameAtom, Atoms::utf8String, title) ||
+ getStringProperty (Atoms::wmName, Atoms::utf8String, title))
return;
getStringProperty (XA_WM_NAME, XA_STRING, title);
@@ -247,14 +249,13 @@
void
RegexScreen::handleEvent (XEvent *event)
{
- CompWindow *w;
-
screen->handleEvent (event);
if (event->type != PropertyNotify)
return;
- w = screen->findWindow (event->xproperty.window);
+ CompWindow *w = screen->findWindow (event->xproperty.window);
+
if (!w)
return;
=== modified file 'plugins/regex/src/regexplugin.h'
--- plugins/regex/src/regexplugin.h 2012-02-06 17:44:17 +0000
+++ plugins/regex/src/regexplugin.h 2013-07-21 23:03:28 +0000
@@ -37,6 +37,7 @@
public ScreenInterface
{
public:
+
RegexScreen (CompScreen *s);
~RegexScreen ();
@@ -46,8 +47,8 @@
CompMatch::Expression * matchInitExp (const CompString& value);
- Atom roleAtom;
- Atom visibleNameAtom;
+ Atom roleAtom;
+ Atom visibleNameAtom;
CompTimer mApplyInitialActionsTimer;
};
@@ -56,6 +57,7 @@
public PluginClassHandler
{
public:
+
RegexWindow (CompWindow *w);
void updateRole ();
@@ -76,6 +78,7 @@
public CompPlugin::VTableForScreenAndWindow
{
public:
+
bool init ();
};
=== modified file 'plugins/resize/src/composite-screen-impl.h'
--- plugins/resize/src/composite-screen-impl.h 2012-08-15 21:36:40 +0000
+++ plugins/resize/src/composite-screen-impl.h 2013-07-21 23:03:28 +0000
@@ -41,7 +41,7 @@
{
}
- virtual ~CompositeScreenImpl() {}
+ virtual ~CompositeScreenImpl () {}
virtual bool compositingActive ()
{
=== modified file 'plugins/resize/src/composite-window-impl.h'
--- plugins/resize/src/composite-window-impl.h 2012-08-16 14:04:59 +0000
+++ plugins/resize/src/composite-window-impl.h 2013-07-21 23:03:28 +0000
@@ -34,6 +34,7 @@
class CompositeWindowImpl : public CompositeWindowInterface
{
public:
+
CompositeWindowImpl (CompositeWindow *impl)
: mImpl (impl)
{
@@ -54,6 +55,7 @@
ResizeWindow *resizeWindow;
private:
+
CompositeWindow *mImpl;
};
=== modified file 'plugins/resize/src/gl-screen-impl.h'
--- plugins/resize/src/gl-screen-impl.h 2012-08-16 14:04:59 +0000
+++ plugins/resize/src/gl-screen-impl.h 2013-07-21 23:03:28 +0000
@@ -36,6 +36,7 @@
class GLScreenImpl : public GLScreenInterface
{
public:
+
GLScreenImpl (GLScreen *impl)
: mImpl (impl)
{
@@ -45,7 +46,7 @@
virtual void glPaintOutputSetEnabled (bool enable)
{
- mImpl->glPaintOutputSetEnabled(ResizeScreen::get(screen), enable);
+ mImpl->glPaintOutputSetEnabled (ResizeScreen::get (screen), enable);
}
static GLScreenImpl *wrap (GLScreen *impl)
@@ -57,6 +58,7 @@
}
private:
+
GLScreen *mImpl;
};
=== modified file 'plugins/resize/src/gl-window-impl.h'
--- plugins/resize/src/gl-window-impl.h 2012-08-16 14:04:59 +0000
+++ plugins/resize/src/gl-window-impl.h 2013-07-21 23:03:28 +0000
@@ -34,6 +34,7 @@
class GLWindowImpl : public GLWindowInterface
{
public:
+
GLWindowImpl (GLWindow *impl)
: mImpl (impl)
{
@@ -54,6 +55,7 @@
ResizeWindow *resizeWindow;
private:
+
GLWindow *mImpl;
};
=== modified file 'plugins/resize/src/logic/include/resize-logic.h'
--- plugins/resize/src/logic/include/resize-logic.h 2012-08-15 21:36:40 +0000
+++ plugins/resize/src/logic/include/resize-logic.h 2013-07-21 23:03:28 +0000
@@ -52,8 +52,8 @@
class ResizeLogic
{
public:
- ResizeLogic();
- virtual ~ResizeLogic();
+ ResizeLogic ();
+ virtual ~ResizeLogic ();
void handleEvent (XEvent *event);
@@ -66,47 +66,48 @@
void damageRectangle (BoxPtr pBox);
- bool initiateResize (CompAction *action,
- CompAction::State state,
- CompOption::Vector &options,
- unsigned int mode);
-
- bool terminateResize (CompAction *action,
- CompAction::State state,
- CompOption::Vector &options);
-
- bool initiateResizeDefaultMode (CompAction *action,
- CompAction::State state,
- CompOption::Vector &options);
+ bool initiateResize (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options,
+ unsigned int mode);
+
+ bool terminateResize (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ bool initiateResizeDefaultMode (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
resize::CompScreenInterface *mScreen;
- struct _ResizeKeys {
- const char *name;
- int dx;
- int dy;
+ struct _ResizeKeys
+ {
+ const char *name;
+ int dx;
+ int dy;
unsigned int warpMask;
unsigned int resizeMask;
} rKeys[NUM_KEYS];
- Atom resizeNotifyAtom;
+ Atom resizeNotifyAtom;
resize::PropertyWriterInterface *resizeInformationAtom;
resize::CompWindowInterface *w;
- int mode;
- bool centered;
- XRectangle savedGeometry;
- XRectangle geometry;
-
- /* geometry without the vertical maximization.
- Its value is undefined when maximized_vertically == false */
- XRectangle geometryWithoutVertMax;
- bool maximized_vertically;
-
- int outlineMask;
- int rectangleMask;
- int stretchMask;
- int centeredMask;
+ int mode;
+ bool centered;
+ XRectangle savedGeometry;
+ XRectangle geometry;
+
+ /* geometry without the vertical maximization.
+ Its value is undefined when maximized_vertically == false */
+ XRectangle geometryWithoutVertMax;
+ bool maximized_vertically;
+
+ int outlineMask;
+ int rectangleMask;
+ int stretchMask;
+ int centeredMask;
int releaseButton;
unsigned int mask;
@@ -142,40 +143,56 @@
resize::GLScreenInterface *gScreen;
private:
+
void handleKeyEvent (KeyCode keycode);
- void handleMotionEvent (int xRoot, int yRoot);
+ void handleMotionEvent (int xRoot,
+ int yRoot);
void sendResizeNotify ();
void updateWindowSize ();
void updateWindowProperty ();
/* Helper functions for handleMotionEvent() */
- void snapWindowToWorkAreaBoundaries (int &wi, int &he,
- int &wX, int &wY,
- int &wWidth, int &wHeight);
- void setUpMask (int xRoot, int yRoot);
- void accumulatePointerMotion (int xRoot, int yRoot);
- void constrainToWorkArea (int &che, int &cwi);
- void limitMovementToConstraintRegion (int &wi, int &he,
- int xRoot, int yRoot,
- int wX, int wY,
- int wWidth, int wHeight);
- void computeWindowPlusBordersRect (int &wX, int &wY,
- int &wWidth, int &wHeight,
- int wi, int he);
+ void snapWindowToWorkAreaBoundaries (int &wi,
+ int &he,
+ int &wX,
+ int &wY,
+ int &wWidth,
+ int &wHeight);
+ void setUpMask (int xRoot,
+ int yRoot);
+ void accumulatePointerMotion (int xRoot,
+ int yRoot);
+ void constrainToWorkArea (int &che,
+ int &cwi);
+ void limitMovementToConstraintRegion (int &wi,
+ int &he,
+ int xRoot,
+ int yRoot,
+ int wX,
+ int wY,
+ int wWidth,
+ int wHeight);
+ void computeWindowPlusBordersRect (int &wX,
+ int &wY,
+ int &wWidth,
+ int &wHeight,
+ int wi,
+ int he);
void enableOrDisableVerticalMaximization (int yRoot);
- void computeGeometry (int wi, int he);
-
-
- int getOutputForEdge (int windowOutput,
+ void computeGeometry (int wi,
+ int he);
+
+
+ int getOutputForEdge (int windowOutput,
unsigned int touch,
- bool skipFirst);
- unsigned int findTouchingOutput (int touchPoint,
+ bool skipFirst);
+ unsigned int findTouchingOutput (int touchPoint,
unsigned int side);
void getPointForTp (unsigned int tp,
unsigned int output,
- int &op,
- int &wap);
+ int &op,
+ int &wap);
};
#endif /* RESIZELOGIC_H */
=== modified file 'plugins/resize/src/logic/include/resize-window-interface.h'
--- plugins/resize/src/logic/include/resize-window-interface.h 2012-08-15 21:36:40 +0000
+++ plugins/resize/src/logic/include/resize-window-interface.h 2013-07-21 23:03:28 +0000
@@ -33,7 +33,9 @@
{
public:
virtual ~ResizeWindowInterface () {}
- virtual void getStretchScale (BoxPtr pBox, float *xScale, float *yScale) = 0;
+ virtual void getStretchScale (BoxPtr pBox,
+ float *xScale,
+ float *yScale) = 0;
};
} /* namespace resize */
=== modified file 'plugins/resize/src/logic/src/resize-logic.cpp'
--- plugins/resize/src/logic/src/resize-logic.cpp 2013-05-12 09:39:45 +0000
+++ plugins/resize/src/logic/src/resize-logic.cpp 2013-07-21 23:03:28 +0000
@@ -43,9 +43,9 @@
#define XWINDOWCHANGES_INIT {0, 0, 0, 0, 0, None, 0}
-static const unsigned short TOUCH_LEFT = 1;
-static const unsigned short TOUCH_RIGHT = 2;
-static const unsigned short TOUCH_TOP = 3;
+static const unsigned short TOUCH_LEFT = 1;
+static const unsigned short TOUCH_RIGHT = 2;
+static const unsigned short TOUCH_TOP = 3;
static const unsigned short TOUCH_BOTTOM = 4;
using namespace resize;
@@ -104,34 +104,34 @@
case KeyPress:
if (event->xkey.root == mScreen->root ())
handleKeyEvent (event->xkey.keycode);
+
break;
case ButtonRelease:
- if (event->xbutton.root == mScreen->root ())
+ if (event->xbutton.root == mScreen->root () &&
+ grabIndex &&
+ (releaseButton == -1 ||
+ (int) event->xbutton.button == releaseButton))
{
- if (grabIndex)
- {
- if (releaseButton == -1 ||
- (int) event->xbutton.button == releaseButton)
- {
- CompAction *action = &options->optionGetInitiateButton ();
+ CompAction *action = &options->optionGetInitiateButton ();
- terminateResize (action, CompAction::StateTermButton,
- noOptions ());
- }
- }
+ terminateResize (action, CompAction::StateTermButton,
+ noOptions ());
}
+
break;
case MotionNotify:
if (event->xmotion.root == mScreen->root ())
handleMotionEvent (pointerX, pointerY);
+
break;
case EnterNotify:
case LeaveNotify:
if (event->xcrossing.root == mScreen->root ())
handleMotionEvent (pointerX, pointerY);
+
break;
case ClientMessage:
@@ -142,8 +142,8 @@
if (type <= WmMoveResizeSizeLeft ||
type == WmMoveResizeSizeKeyboard)
{
- CompWindowInterface *w;
- w = mScreen->findWindow (event->xclient.window);
+ CompWindowInterface *w = mScreen->findWindow (event->xclient.window);
+
if (w)
{
mScreen->freeWindowInterface (w);
@@ -160,11 +160,9 @@
o[1].value ().set (true);
if (event->xclient.data.l[2] == WmMoveResizeSizeKeyboard)
- {
initiateResizeDefaultMode (&options->optionGetInitiateKey (),
CompAction::StateInitKey,
o);
- }
else
{
/* TODO: not only button 1 */
@@ -212,17 +210,16 @@
}
}
}
- else if (this->w && type == WmMoveResizeCancel)
+ else if (this->w && type == WmMoveResizeCancel &&
+ this->w->id () == event->xclient.window)
{
- if (this->w->id () == event->xclient.window)
- {
- terminateResize (&options->optionGetInitiateButton (),
- CompAction::StateCancel, noOptions ());
- terminateResize (&options->optionGetInitiateKey (),
- CompAction::StateCancel, noOptions ());
- }
+ terminateResize (&options->optionGetInitiateButton (),
+ CompAction::StateCancel, noOptions ());
+ terminateResize (&options->optionGetInitiateKey (),
+ CompAction::StateCancel, noOptions ());
}
}
+
break;
case DestroyNotify:
@@ -231,6 +228,7 @@
terminateResize (&options->optionGetInitiateButton (), 0, noOptions ());
terminateResize (&options->optionGetInitiateKey (), 0, noOptions ());
}
+
break;
case UnmapNotify:
@@ -268,7 +266,7 @@
mode = ResizeOptions::ModeOutline;
}
- mods = 0xffffffff;
+// mods = 0xffffffff;
if (rectangleMask)
mods = rectangleMask;
@@ -278,7 +276,7 @@
mode = ResizeOptions::ModeRectangle;
}
- mods = 0xffffffff;
+// mods = 0xffffffff;
if (stretchMask)
mods = stretchMask;
@@ -288,7 +286,7 @@
mode = ResizeOptions::ModeStretch;
}
- mods = 0xffffffff;
+// mods = 0xffffffff;
if (centeredMask)
mods = centeredMask;
@@ -341,9 +339,7 @@
}
if ((stateEvent->mods & mods) == mods)
- {
centered = true;
- }
else if (w)
{
if (!w->evaluate (options->optionGetResizeFromCenterMatch ()))
@@ -362,9 +358,7 @@
{
if (w)
{
- XSyncAlarmNotifyEvent *sa;
-
- sa = (XSyncAlarmNotifyEvent *) event;
+ XSyncAlarmNotifyEvent *sa = (XSyncAlarmNotifyEvent *) event;
if (w->syncAlarm () == sa->alarm)
updateWindowSize ();
@@ -386,7 +380,9 @@
if (heightInc < MIN_KEY_HEIGHT_INC)
heightInc = MIN_KEY_HEIGHT_INC;
- for (unsigned int i = 0; i < NUM_KEYS; i++)
+ int x, y, left, top, width, height;
+
+ for (unsigned int i = 0; i < NUM_KEYS; ++i)
{
if (keycode != key[i])
continue;
@@ -413,31 +409,29 @@
mScreen->updateGrab (grabIndex, cursor[i]);
}
+
break;
}
}
}
void
-ResizeLogic::handleMotionEvent (int xRoot, int yRoot)
+ResizeLogic::handleMotionEvent (int xRoot,
+ int yRoot)
{
if (grabIndex)
{
BoxRec box;
- int wi, he, cwi, che; /* size of window contents (c prefix for constrained)*/
int wX, wY, wWidth, wHeight; /* rect. for window contents+borders */
- wi = savedGeometry.width;
- he = savedGeometry.height;
+ /* size of window contents */
+ int wi = savedGeometry.width;
+ int he = savedGeometry.height;
if (!mask)
- {
setUpMask (xRoot, yRoot);
- }
else
- {
accumulatePointerMotion (xRoot, yRoot);
- }
if (mask & ResizeLeftMask)
wi -= pointerDx;
@@ -455,8 +449,9 @@
if (w->state () & CompWindowStateMaximizedHorzMask)
wi = w->serverGeometry ().width ();
- cwi = wi;
- che = he;
+ /* size of window contents (c prefix for constrained) */
+ int cwi = wi;
+ int che = he;
if (w->constrainNewWindowSize (wi, he, &cwi, &che) &&
mode != ResizeOptions::ModeNormal)
@@ -514,9 +509,7 @@
damageRectangle (&box);
}
else
- {
updateWindowSize ();
- }
updateWindowProperty ();
sendResizeNotify ();
@@ -656,99 +649,97 @@
cursor = rightCursor;
}
else if (mask & ResizeUpMask)
- {
cursor = upCursor;
- }
else
- {
cursor = downCursor;
- }
return cursor;
}
void
-ResizeLogic::snapWindowToWorkAreaBoundaries (int &wi, int &he,
- int &wX, int &wY,
- int &wWidth, int &wHeight)
+ResizeLogic::snapWindowToWorkAreaBoundaries (int &wi,
+ int &he,
+ int &wX,
+ int &wY,
+ int &wWidth,
+ int &wHeight)
{
int workAreaSnapDistance = 15;
/* Check if resized edge(s) are near output work-area boundaries */
foreach (CompOutput &output, mScreen->outputDevs ())
{
- const CompRect &workArea = output.workArea ();
-
- /* if window and work-area intersect in x axis */
- if (wX + wWidth > workArea.x () &&
- wX < workArea.x2 ())
- {
- if (mask & ResizeLeftMask)
- {
- int dw = workArea.x () - wX;
-
- if (0 < dw && dw < workAreaSnapDistance)
- {
- wi -= dw;
- wWidth -= dw;
- wX += dw;
- }
- }
- else if (mask & ResizeRightMask)
- {
- int dw = wX + wWidth - workArea.x2 ();
-
- if (0 < dw && dw < workAreaSnapDistance)
- {
- wi -= dw;
- wWidth -= dw;
- }
- }
- }
-
- /* if window and work-area intersect in y axis */
- if (wY + wHeight > workArea.y () &&
- wY < workArea.y2 ())
- {
- if (mask & ResizeUpMask)
- {
- int dh = workArea.y () - wY;
-
- if (0 < dh && dh < workAreaSnapDistance)
- {
- he -= dh;
- wHeight -= dh;
- wY += dh;
- }
- }
- else if (mask & ResizeDownMask)
- {
- int dh = wY + wHeight - workArea.y2 ();
-
- if (0 < dh && dh < workAreaSnapDistance)
- {
- he -= dh;
- wHeight -= dh;
- }
- }
- }
+ const CompRect &workArea = output.workArea ();
+
+ /* if window and work-area intersect in x axis */
+ if (wX + wWidth > workArea.x () &&
+ wX < workArea.x2 ())
+ {
+ if (mask & ResizeLeftMask)
+ {
+ int dw = workArea.x () - wX;
+
+ if (0 < dw && dw < workAreaSnapDistance)
+ {
+ wi -= dw;
+ wWidth -= dw;
+ wX += dw;
+ }
+ }
+ else if (mask & ResizeRightMask)
+ {
+ int dw = wX + wWidth - workArea.x2 ();
+
+ if (0 < dw && dw < workAreaSnapDistance)
+ {
+ wi -= dw;
+ wWidth -= dw;
+ }
+ }
+ }
+
+ /* if window and work-area intersect in y axis */
+ if (wY + wHeight > workArea.y () &&
+ wY < workArea.y2 ())
+ {
+ if (mask & ResizeUpMask)
+ {
+ int dh = workArea.y () - wY;
+
+ if (0 < dh && dh < workAreaSnapDistance)
+ {
+ he -= dh;
+ wHeight -= dh;
+ wY += dh;
+ }
+ }
+ else if (mask & ResizeDownMask)
+ {
+ int dh = wY + wHeight - workArea.y2 ();
+
+ if (0 < dh && dh < workAreaSnapDistance)
+ {
+ he -= dh;
+ wHeight -= dh;
+ }
+ }
+ }
}
}
void
-ResizeLogic::setUpMask (int xRoot, int yRoot)
+ResizeLogic::setUpMask (int xRoot,
+ int yRoot)
{
- int xDist, yDist;
- int minPointerOffsetX, minPointerOffsetY;
-
CompWindow::Geometry server = w->serverGeometry ();
- xDist = xRoot - (server.x () + (server.width () / 2));
- yDist = yRoot - (server.y () + (server.height () / 2));
+ int xDist = xRoot - (server.x () + (server.width () / 2));
+ int yDist = yRoot - (server.y () + (server.height () / 2));
- /* decision threshold is 10% of window size */
- minPointerOffsetX = MIN (20, server.width () / 10);
- minPointerOffsetY = MIN (20, server.height () / 10);
+ /* decision threshold is 10% of window size
+ * TODO: Make this configurable */
+ int minPointerOffsetX = MIN (20, server.width () / 10);
+ int minPointerOffsetY = MIN (20, server.height () / 10);
/* if we reached the threshold in one direction,
make the threshold in the other direction smaller
@@ -780,12 +771,10 @@
and set the right cursor */
if (mask)
{
- Cursor cursor;
- CompAction *action;
- int pointerAdjustX = 0;
- int pointerAdjustY = 0;
+ int pointerAdjustX = 0;
+ int pointerAdjustY = 0;
- action = &options->optionGetInitiateKey ();
+ CompAction *action = &options->optionGetInitiateKey ();
action->setState (action->state () |
CompAction::StateTermButton);
@@ -804,13 +793,14 @@
mScreen->warpPointer (pointerAdjustX, pointerAdjustY);
- cursor = cursorFromResizeMask (mask);
+ Cursor cursor = cursorFromResizeMask (mask);
mScreen->updateGrab (grabIndex, cursor);
}
}
void
-ResizeLogic::accumulatePointerMotion (int xRoot, int yRoot)
+ResizeLogic::accumulatePointerMotion (int xRoot,
+ int yRoot)
{
/* only accumulate pointer movement if a mask is
already set as we don't have a use for the
@@ -864,7 +854,8 @@
}
void
-ResizeLogic::constrainToWorkArea (int &che, int &cwi)
+ResizeLogic::constrainToWorkArea (int &che,
+ int &cwi)
{
if (mask & ResizeUpMask)
{
@@ -874,6 +865,7 @@
if (grabWindowWorkArea->y () > decorTop)
che -= grabWindowWorkArea->y () - decorTop;
}
+
if (mask & ResizeDownMask)
{
int decorBottom = savedGeometry.y + che + w->border ().bottom;
@@ -883,6 +875,7 @@
che -= decorBottom - (grabWindowWorkArea->y () +
grabWindowWorkArea->height ());
}
+
if (mask & ResizeLeftMask)
{
int decorLeft = savedGeometry.x + savedGeometry.width -
@@ -891,6 +884,7 @@
if (grabWindowWorkArea->x () > decorLeft)
cwi -= grabWindowWorkArea->x () - decorLeft;
}
+
if (mask & ResizeRightMask)
{
int decorRight = savedGeometry.x + cwi + w->border ().right;
@@ -903,11 +897,16 @@
}
void
-ResizeLogic::limitMovementToConstraintRegion (int &wi, int &he,
- int xRoot, int yRoot,
- int wX, int wY,
- int wWidth, int wHeight)
+ResizeLogic::limitMovementToConstraintRegion (int &wi,
+ int &he,
+ int xRoot,
+ int yRoot,
+ int wX,
+ int wY,
+ int wWidth,
+ int wHeight)
{
+ // TODO: Magic number alert
int minHeight = 50;
/* rect. for a minimal height window + borders
@@ -977,10 +976,11 @@
width, height);
if (!xStatus)
{
- nw--;
- nx++;
+ --nw;
+ ++nx;
}
}
+
if (nw > minWidth)
{
x = nx;
@@ -995,8 +995,8 @@
width, height);
if (!xStatus)
{
- nw--;
- nx--;
+ --nw;
+ --nx;
}
}
if (nw > minWidth)
@@ -1014,10 +1014,11 @@
width, height);
if (!status)
{
- nh--;
- y++;
+ --nh;
+ ++y;
}
}
+
if (nh > minHeight)
he = nh;
}
@@ -1029,10 +1030,11 @@
width, height);
if (!status)
{
- nh--;
- y--;
+ --nh;
+ --y;
}
}
+
if (nh > minHeight)
he = nh;
}
@@ -1052,18 +1054,19 @@
}
}
else
- {
inRegionStatus = status;
- }
}
void
-ResizeLogic::computeWindowPlusBordersRect (int &wX, int &wY,
- int &wWidth, int &wHeight,
- int wi, int he)
+ResizeLogic::computeWindowPlusBordersRect (int &wX,
+ int &wY,
+ int &wWidth,
+ int &wHeight,
+ int wi,
+ int he)
{
wWidth = wi + w->border ().left + w->border ().right;
- wHeight = he + w->border ().top + w->border ().bottom;
+ wHeight = he + w->border ().top + w->border ().bottom;
if (centered || options->optionGetResizeFromCenter ())
{
@@ -1098,16 +1101,14 @@
void
ResizeLogic::enableOrDisableVerticalMaximization (int yRoot)
{
+ if (!options->optionGetMaximizeVertically () ||
+ !offWorkAreaConstrained)
+ return;
+
/* maximum distance between the pointer and a work area edge (top or bottom)
- for a vertical maximization */
+ for a vertical maximization, TODO: Magic number, should be configurable */
const int max_edge_distance = 5;
- if (!options->optionGetMaximizeVertically())
- return;
-
- if (!offWorkAreaConstrained)
- return;
-
if (centered || options->optionGetResizeFromCenter ())
{
if (maximized_vertically)
@@ -1149,9 +1150,11 @@
}
void
-ResizeLogic::computeGeometry(int wi, int he)
+ResizeLogic::computeGeometry (int wi,
+ int he)
{
XRectangle *regular_geometry;
+
if (maximized_vertically)
regular_geometry = &geometryWithoutVertMax;
else
@@ -1177,38 +1180,32 @@
if (maximized_vertically)
{
- geometry.x = geometryWithoutVertMax.x;
- geometry.width = geometryWithoutVertMax.width;
- geometry.y = grabWindowWorkArea->y() + w->border().top;
- geometry.height = grabWindowWorkArea->height() - w->border().top
- - w->border().bottom;
+ geometry.x = geometryWithoutVertMax.x;
+ geometry.width = geometryWithoutVertMax.width;
+ geometry.y = grabWindowWorkArea->y() + w->border().top;
+ geometry.height = grabWindowWorkArea->height() - w->border().top -
+ w->border().bottom;
}
}
-
bool
-ResizeLogic::initiateResize (CompAction *action,
- CompAction::State state,
- CompOption::Vector &options,
- unsigned int initMode)
+ResizeLogic::initiateResize (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options,
+ unsigned int initMode)
{
- CompWindowInterface *w;
- Window xid;
-
- xid = CompOption::getIntOptionNamed (options, "window");
-
- w = mScreen->findWindow (xid);
+ Window xid = CompOption::getIntOptionNamed (options, "window");
+
+ CompWindowInterface *w = mScreen->findWindow (xid);
+
if (w && (w->actions () & CompWindowActionResizeMask))
{
- int x, y;
- int button;
-
CompWindow::Geometry server = w->serverGeometry ();
- x = CompOption::getIntOptionNamed (options, "x", pointerX);
- y = CompOption::getIntOptionNamed (options, "y", pointerY);
+ int x = CompOption::getIntOptionNamed (options, "x", pointerX);
+ int y = CompOption::getIntOptionNamed (options, "y", pointerY);
- button = CompOption::getIntOptionNamed (options, "button", -1);
+ int button = CompOption::getIntOptionNamed (options, "button", -1);
mask = CompOption::getIntOptionNamed (options, "direction");
@@ -1218,9 +1215,7 @@
* with the cursor in the middle of the window and then starts
* resizing the edge corresponding to the next key press. */
if (state & CompAction::StateInitKey)
- {
mask = 0;
- }
else if (!mask)
{
int sectorSizeX = server.width () / 3;
@@ -1248,11 +1243,11 @@
}
}
- if (mScreen->otherGrabExist ("resize", NULL) ||
- this->w ||
+ if (mScreen->otherGrabExist ("resize", NULL) ||
+ this->w ||
(w->type () & (CompWindowTypeDesktopMask |
- CompWindowTypeDockMask |
- CompWindowTypeFullscreenMask)) ||
+ CompWindowTypeDockMask |
+ CompWindowTypeFullscreenMask)) ||
w->overrideRedirect ())
{
mScreen->freeWindowInterface (w);
@@ -1265,12 +1260,12 @@
if (w->shaded ())
mask &= ~(ResizeUpMask | ResizeDownMask);
- this->w = w;
+ this->w = w;
- savedGeometry.x = server.x ();
- savedGeometry.y = server.y ();
- savedGeometry.width = server.width ();
- savedGeometry.height = server.height ();
+ savedGeometry.x = server.x ();
+ savedGeometry.y = server.y ();
+ savedGeometry.width = server.width ();
+ savedGeometry.height = server.height ();
geometry = savedGeometry;
@@ -1280,28 +1275,24 @@
centered |= w->evaluate (this->options->optionGetResizeFromCenterMatch ());
if ((w->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE)
- {
/* if the window is fully maximized, showing the outline or
rectangle would be visually distracting as the window can't
be resized anyway; so we better don't use them in this case */
mode = ResizeOptions::ModeNormal;
- }
else if (!gScreen || !cScreen ||
!cScreen->compositingActive ())
- {
mode = ResizeOptions::ModeNormal;
- }
else
- {
mode = initMode;
- }
if (mode != ResizeOptions::ModeNormal)
{
if (w->getGLInterface () && mode == ResizeOptions::ModeStretch)
w->getGLInterface ()->glPaintSetEnabled (true);
+
if (w->getCompositeInterface () && mode == ResizeOptions::ModeStretch)
w->getCompositeInterface ()->damageRectSetEnabled (true);
+
gScreen->glPaintOutputSetEnabled (true);
}
@@ -1346,10 +1337,8 @@
if (state & CompAction::StateInitKey)
{
- int xRoot, yRoot;
-
- xRoot = server.x () + (server.width () / 2);
- yRoot = server.y () + (server.height () / 2);
+ int xRoot = server.x () + (server.width () / 2);
+ int yRoot = server.y () + (server.height () / 2);
mScreen->warpPointer (xRoot - pointerX, yRoot - pointerY);
}
@@ -1358,6 +1347,7 @@
/* Update offWorkAreaConstrained and workArea at grab time */
offWorkAreaConstrained = false;
+
if (sourceExternalApp)
{
int output = w->outputDevice ();
@@ -1384,9 +1374,9 @@
/* Now we need to form one big rect which describes
* the available workarea */
- int left = mScreen->outputDevs ().at (lco).workArea ().left ();
- int right = mScreen->outputDevs ().at (rco).workArea ().right ();
- int top = mScreen->outputDevs ().at (tco).workArea ().top ();
+ int left = mScreen->outputDevs ().at (lco).workArea ().left ();
+ int right = mScreen->outputDevs ().at (rco).workArea ().right ();
+ int top = mScreen->outputDevs ().at (tco).workArea ().top ();
int bottom = mScreen->outputDevs ().at (bco).workArea ().bottom ();
grabWindowWorkArea.reset (new CompRect (0, 0, 0, 0));
@@ -1409,7 +1399,7 @@
}
}
- maximized_vertically = false;
+ maximized_vertically = false;
}
else if (w)
mScreen->freeWindowInterface (w);
@@ -1418,7 +1408,7 @@
}
bool
-ResizeLogic::terminateResize (CompAction *action,
+ResizeLogic::terminateResize (CompAction *action,
CompAction::State state,
CompOption::Vector &options)
{
@@ -1487,15 +1477,16 @@
xwc.height = finalGeometry.height;
mask = CWX | CWY | CWWidth | CWHeight;
}
-
}
if (mode != ResizeOptions::ModeNormal)
{
if (w->getGLInterface () && mode == ResizeOptions::ModeStretch)
w->getGLInterface ()->glPaintSetEnabled (false);
+
if (w->getCompositeInterface () && mode == ResizeOptions::ModeStretch)
w->getCompositeInterface ()->damageRectSetEnabled (false);
+
gScreen->glPaintOutputSetEnabled (false);
}
}
@@ -1534,25 +1525,27 @@
}
bool
-ResizeLogic::initiateResizeDefaultMode (CompAction *action,
- CompAction::State state,
- CompOption::Vector &options)
+ResizeLogic::initiateResizeDefaultMode (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options)
{
- CompWindowInterface *w;
- unsigned int mode;
+ CompWindowInterface *w = mScreen->findWindow (CompOption::getIntOptionNamed (options,
+ "window"));
- w = mScreen->findWindow (CompOption::getIntOptionNamed (options, "window"));
if (!w)
return false;
- mode = this->options->optionGetMode ();
+ unsigned int mode = this->options->optionGetMode ();
if (w->evaluate (this->options->optionGetNormalMatch ()))
mode = ResizeOptions::ModeNormal;
+
if (w->evaluate (this->options->optionGetOutlineMatch ()))
mode = ResizeOptions::ModeOutline;
+
if (w->evaluate (this->options->optionGetRectangleMatch ()))
mode = ResizeOptions::ModeRectangle;
+
if (w->evaluate (this->options->optionGetStretchMatch ()))
mode = ResizeOptions::ModeStretch;
@@ -1564,12 +1557,10 @@
void
ResizeLogic::damageRectangle (BoxPtr pBox)
{
- int x1, x2, y1, y2;
-
- x1 = pBox->x1 - 1;
- y1 = pBox->y1 - 1;
- x2 = pBox->x2 + 1;
- y2 = pBox->y2 + 1;
+ int x1 = pBox->x1 - 1;
+ int y1 = pBox->y1 - 1;
+ int x2 = pBox->x2 + 1;
+ int y2 = pBox->y2 + 1;
if (cScreen)
cScreen->damageRegion (CompRect (x1, y1, x2 - x1, y2 - y1));
@@ -1585,7 +1576,9 @@
* */
int
-ResizeLogic::getOutputForEdge (int windowOutput, unsigned int touch, bool skipFirst)
+ResizeLogic::getOutputForEdge (int windowOutput,
+ unsigned int touch,
+ bool skipFirst)
{
int op, wap;
int ret = windowOutput;
@@ -1595,10 +1588,11 @@
if ((op == wap) || skipFirst)
{
int co = windowOutput;
+ int oco;
do
{
- int oco = co;
+ oco = co;
co = findTouchingOutput (op, touch);
@@ -1620,38 +1614,35 @@
co = -1;
}
}
- while (co != -1);
+ while (co != -1);
}
return ret;
}
unsigned int
-ResizeLogic::findTouchingOutput (int touchPoint, unsigned int side)
+ResizeLogic::findTouchingOutput (int touchPoint,
+ unsigned int side)
{
- for (unsigned int i = 0; i < mScreen->outputDevs ().size (); i++)
+ for (unsigned int i = 0; i < mScreen->outputDevs ().size (); ++i)
{
CompOutput &o = mScreen->outputDevs ().at (i);
- if (side == TOUCH_LEFT)
- {
- if (o.left () == touchPoint)
- return i;
- }
- if (side == TOUCH_RIGHT)
- {
- if (o.right () == touchPoint)
- return i;
- }
- if (side == TOUCH_TOP)
- {
- if (o.top () == touchPoint)
- return i;
- }
- if (side == TOUCH_BOTTOM)
- {
- if (o.bottom () == touchPoint)
- return i;
- }
+
+ if (side == TOUCH_LEFT &&
+ o.left () == touchPoint)
+ return i;
+
+ if (side == TOUCH_RIGHT &&
+ o.right () == touchPoint)
+ return i;
+
+ if (side == TOUCH_TOP &&
+ o.top () == touchPoint)
+ return i;
+
+ if (side == TOUCH_BOTTOM &&
+ o.bottom () == touchPoint)
+ return i;
}
return -1;
@@ -1660,8 +1651,8 @@
void
ResizeLogic::getPointForTp (unsigned int tp,
unsigned int output,
- int &op,
- int &wap)
+ int &op,
+ int &wap)
{
CompRect og = CompRect (mScreen->outputDevs ().at (output));
CompRect wag = mScreen->outputDevs ().at (output).workArea ();
@@ -1672,18 +1663,22 @@
op = og.right ();
wap = wag.right ();
break;
+
case TOUCH_RIGHT:
op = og.left ();
wap = wag.left ();
break;
+
case TOUCH_TOP:
op = og.bottom ();
wap = wag.bottom ();
break;
+
case TOUCH_BOTTOM:
op = og.top ();
wap = wag.top ();
break;
+
default:
return;
}
=== modified file 'plugins/resize/src/logic/tests/test-logic.cpp'
--- plugins/resize/src/logic/tests/test-logic.cpp 2013-01-09 05:30:46 +0000
+++ plugins/resize/src/logic/tests/test-logic.cpp 2013-07-21 23:03:28 +0000
@@ -166,7 +166,7 @@
void SetUpFakePropertyWriter ()
{
fakePropWriter.mPropertyValues.resize(4);
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
{
char buf[4];
snprintf (buf, 4, "%i", i);
=== modified file 'plugins/resize/src/property-writer-impl.h'
--- plugins/resize/src/property-writer-impl.h 2012-08-15 21:36:40 +0000
+++ plugins/resize/src/property-writer-impl.h 2013-07-21 23:03:28 +0000
@@ -38,7 +38,9 @@
PropertyWriterImpl (PropertyWriter *impl) : mImpl (impl) {}
virtual ~PropertyWriterImpl() {delete mImpl;}
- virtual bool updateProperty (Window w, CompOption::Vector &v, int i)
+ virtual bool updateProperty (Window w,
+ CompOption::Vector &v,
+ int i)
{
return mImpl->updateProperty (w, v, i);
}
=== modified file 'plugins/resize/src/resize-window-impl.h'
--- plugins/resize/src/resize-window-impl.h 2012-08-15 21:36:40 +0000
+++ plugins/resize/src/resize-window-impl.h 2013-07-21 23:03:28 +0000
@@ -34,6 +34,7 @@
class ResizeWindowImpl : public ResizeWindowInterface
{
public:
+
ResizeWindowImpl (ResizeWindow *impl)
: mImpl (impl)
{
@@ -52,12 +53,15 @@
return NULL;
}
- virtual void getStretchScale (BoxPtr pBox, float *xScale, float *yScale)
+ virtual void getStretchScale (BoxPtr pBox,
+ float *xScale,
+ float *yScale)
{
return mImpl->getStretchScale(pBox, xScale, yScale);
}
private:
+
ResizeWindow *mImpl;
};
=== modified file 'plugins/resize/src/resize.cpp'
--- plugins/resize/src/resize.cpp 2013-05-12 09:39:45 +0000
+++ plugins/resize/src/resize.cpp 2013-07-21 23:03:28 +0000
@@ -49,7 +49,9 @@
}
void
-ResizeWindow::getStretchScale (BoxPtr pBox, float *xScale, float *yScale)
+ResizeWindow::getStretchScale (BoxPtr pBox,
+ float *xScale,
+ float *yScale)
{
CompRect rect (window->borderRect ());
@@ -65,7 +67,7 @@
CompOption::Vector &options)
{
RESIZE_SCREEN (screen);
- return rs->logic.initiateResizeDefaultMode(action, state, options);
+ return rs->logic.initiateResizeDefaultMode (action, state, options);
}
static bool
@@ -74,7 +76,7 @@
CompOption::Vector &options)
{
RESIZE_SCREEN (screen);
- return rs->logic.terminateResize(action, state, options);
+ return rs->logic.terminateResize (action, state, options);
}
void
@@ -86,15 +88,15 @@
{
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
- BoxRec box;
- GLMatrix sTransform (transform);
- GLfloat vertexData [12];
- GLfloat vertexData2[24];
- GLint origSrc, origDst;
- GLushort fc[4], bc[4];
+ BoxRec box;
+ GLMatrix sTransform (transform);
+ GLfloat vertexData [12];
+ GLfloat vertexData2[24];
+ GLint origSrc, origDst;
+ GLushort fc[4], bc[4];
#ifdef USE_GLES
- GLint origSrcAlpha, origDstAlpha;
+ GLint origSrcAlpha, origDstAlpha;
glGetIntegerv (GL_BLEND_SRC_RGB, &origSrc);
glGetIntegerv (GL_BLEND_DST_RGB, &origDst);
glGetIntegerv (GL_BLEND_SRC_ALPHA, &origSrcAlpha);
@@ -105,7 +107,7 @@
#endif
/* Premultiply the alpha values */
- bc[3] = (float) borderColor[3] / (float) 65535.0f;
+ bc[3] = (float) borderColor[3] / 65535.0f;
bc[0] = ((float) borderColor[0] / 65535.0f) * bc[3];
bc[1] = ((float) borderColor[1] / 65535.0f) * bc[3];
bc[2] = ((float) borderColor[2] / 65535.0f) * bc[3];
@@ -159,7 +161,11 @@
sTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA);
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
/* fill rectangle */
@@ -186,7 +192,9 @@
streamingBuffer->end ();
streamingBuffer->render (sTransform);
- glDisable (GL_BLEND);
+ if (!glBlendEnabled)
+ glDisable (GL_BLEND);
+
#ifdef USE_GLES
glBlendFuncSeparate (origSrc, origDst,
origSrcAlpha, origDstAlpha);
@@ -196,9 +204,9 @@
CompositeScreen *cScreen = CompositeScreen::get (screen);
CompRect damage (box.x1 - borderWidth,
- box.y1 - borderWidth,
- box.x2 - box.x1 + 2 * borderWidth,
- box.y2 - box.y1 + 2 * borderWidth);
+ box.y1 - borderWidth,
+ box.x2 - box.x1 + 2 * borderWidth,
+ box.y2 - box.y1 + 2 * borderWidth);
cScreen->damageRegion (damage);
}
@@ -217,6 +225,7 @@
if (status && logic.w)
{
+<<<<<<< TREE
unsigned short *border, *fill;
border = optionGetBorderColor ();
@@ -224,6 +233,13 @@
switch (logic.mode)
{
+=======
+ unsigned short *border = optionGetBorderColor ();
+ unsigned short *fill = optionGetFillColor ();
+
+ switch (logic.mode)
+ {
+>>>>>>> MERGE-SOURCE
case ResizeOptions::ModeOutline:
glPaintRectangle (sAttrib, transform, output, border, NULL);
break;
@@ -246,18 +262,25 @@
const CompRegion ®ion,
unsigned int mask)
{
- bool status;
+ bool status;
if (window == static_cast(rScreen->logic.w)->impl ()
&& rScreen->logic.mode == ResizeOptions::ModeStretch)
{
+<<<<<<< TREE
GLMatrix wTransform (transform);
BoxRec box;
float xScale, yScale;
+=======
+>>>>>>> MERGE-SOURCE
if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)
return false;
+ GLMatrix wTransform (transform);
+ BoxRec box;
+ float xScale, yScale;
+
status = gWindow->glPaint (attrib, transform, region,
mask | PAINT_WINDOW_NO_CORE_INSTANCE_MASK);
@@ -291,7 +314,8 @@
}
bool
-ResizeWindow::damageRect (bool initial, const CompRect &rect)
+ResizeWindow::damageRect (bool initial,
+ const CompRect &rect)
{
bool status = false;
@@ -320,8 +344,8 @@
#define ResizeModeMetaMask (1 << 3)
void
-ResizeScreen::resizeMaskValueToKeyMask (int valueMask,
- int *mask)
+ResizeScreen::resizeMaskValueToKeyMask (int valueMask,
+ int *mask)
{
if (valueMask & ResizeModeShiftMask)
*mask |= ShiftMask;
@@ -334,7 +358,7 @@
}
void
-ResizeScreen::optionChanged (CompOption *option,
+ResizeScreen::optionChanged (CompOption *option,
ResizeOptions::Options num)
{
int *mask = NULL;
@@ -381,12 +405,12 @@
CompOption::Vector atomTemplate;
Display *dpy = s->dpy ();
- ResizeOptions::ChangeNotify notify =
- boost::bind (&ResizeScreen::optionChanged, this, _1, _2);
+ ResizeOptions::ChangeNotify notify = boost::bind (&ResizeScreen::optionChanged,
+ this, _1, _2);
atomTemplate.resize (4);
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 4; ++i)
{
char buf[4];
snprintf (buf, 4, "%i", i);
@@ -401,7 +425,7 @@
new PropertyWriter ("_COMPIZ_RESIZE_INFORMATION",
atomTemplate));
- for (unsigned int i = 0; i < NUM_KEYS; i++)
+ for (unsigned int i = 0; i < NUM_KEYS; ++i)
logic.key[i] = XKeysymToKeycode (s->dpy (), XStringToKeysym (logic.rKeys[i].name));
logic.leftCursor = XCreateFontCursor (dpy, XC_left_side);
=== modified file 'plugins/resize/src/resize.h'
--- plugins/resize/src/resize.h 2012-08-15 21:16:17 +0000
+++ plugins/resize/src/resize.h 2013-07-21 23:03:28 +0000
@@ -43,14 +43,17 @@
public ResizeOptions
{
public:
+
ResizeScreen (CompScreen *s);
~ResizeScreen ();
void handleEvent (XEvent *event);
bool glPaintOutput (const GLScreenPaintAttrib &,
- const GLMatrix &, const CompRegion &, CompOutput *,
- unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
void optionChanged (CompOption *o, Options);
void resizeMaskValueToKeyMask (int valueMask,
@@ -63,9 +66,9 @@
unsigned short *fillColor);
public:
+
ResizeLogic logic;
-
- GLScreen *gScreen;
+ GLScreen *gScreen;
};
class ResizeWindow :
@@ -75,17 +78,24 @@
public PluginClassHandler
{
public:
+
ResizeWindow (CompWindow *w);
~ResizeWindow ();
- bool damageRect (bool, const CompRect &);
-
- bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
- const CompRegion &, unsigned int);
-
- void getStretchScale (BoxPtr pBox, float *xScale, float *yScale);
+ bool damageRect (bool ,
+ const CompRect &);
+
+ bool glPaint (const GLWindowPaintAttrib &,
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
+
+ void getStretchScale (BoxPtr pBox,
+ float *xScale,
+ float *yScale);
public:
+
CompWindow *window;
GLWindow *gWindow;
CompositeWindow *cWindow;
@@ -96,6 +106,7 @@
public CompPlugin::VTableForScreenAndWindow
{
public:
+
bool init ();
};
=== modified file 'plugins/resize/src/window-impl.h'
--- plugins/resize/src/window-impl.h 2013-01-08 09:17:25 +0000
+++ plugins/resize/src/window-impl.h 2013-07-21 23:03:28 +0000
@@ -39,6 +39,7 @@
class CompWindowImpl : public CompWindowInterface
{
public:
+
CompWindowImpl (CompWindow *impl)
: mImpl (impl)
{
@@ -119,9 +120,9 @@
int *newHeight)
{
return mImpl->constrainNewWindowSize (width,
- height,
- newWidth,
- newHeight);
+ height,
+ newWidth,
+ newHeight);
}
virtual bool syncWait ()
@@ -134,14 +135,16 @@
mImpl->sendSyncRequest ();
}
- virtual void configureXWindow (unsigned int valueMask,
+ virtual void configureXWindow (unsigned int valueMask,
XWindowChanges *xwc)
{
mImpl->configureXWindow (valueMask, xwc);
}
- virtual void grabNotify (int x, int y,
- unsigned int state, unsigned int mask)
+ virtual void grabNotify (int x,
+ int y,
+ unsigned int state,
+ unsigned int mask)
{
mImpl->grabNotify (x, y, state, mask);
}
@@ -222,9 +225,10 @@
}
private:
- CompWindow *mImpl;
- ResizeWindowImpl *mResizeImpl;
- GLWindowImpl *mGLImpl;
+
+ CompWindow *mImpl;
+ ResizeWindowImpl *mResizeImpl;
+ GLWindowImpl *mGLImpl;
CompositeWindowImpl *mCompositeImpl;
};
=== modified file 'plugins/resizeinfo/src/resizeinfo.cpp'
--- plugins/resizeinfo/src/resizeinfo.cpp 2013-05-09 13:43:07 +0000
+++ plugins/resizeinfo/src/resizeinfo.cpp 2013-07-21 23:03:28 +0000
@@ -44,15 +44,15 @@
}
/* Here 's' is Screen * 'screen' is 'CompScreen *' */
-
InfoLayer::InfoLayer () :
- valid (false),
- s (ScreenOfDisplay (screen->dpy (), screen->screenNum ())),
- pixmap (None),
+ valid (false),
+ s (ScreenOfDisplay (screen->dpy (), screen->screenNum ())),
+ pixmap (None),
surface (NULL),
- cr (NULL)
+ cr (NULL)
{
format = XRenderFindStandardFormat (screen->dpy (), PictStandardARGB32);
+
if (!format)
return;
@@ -78,6 +78,7 @@
texture = GLTexture::bindPixmapToTexture (pixmap,
RESIZE_POPUP_WIDTH,
RESIZE_POPUP_HEIGHT, 32);
+
if (!texture.size ())
{
compLogMessage ("resizeinfo", CompLogLevelWarn,
@@ -86,6 +87,7 @@
}
cr = cairo_create (surface);
+
if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
{
compLogMessage ("resizeinfo", CompLogLevelWarn,
@@ -123,8 +125,13 @@
color = is->optionGetTextColor ();
+<<<<<<< TREE
unsigned int xv = (widthInc > 1) ? (width - baseWidth) / widthInc : width;
unsigned int yv = (heightInc > 1) ? (height - baseHeight) / heightInc : height;
+=======
+ unsigned int xv = (widthInc > 1) ? (width - baseWidth) / widthInc : width;
+ unsigned int yv = (heightInc > 1) ? (height - baseHeight) / heightInc : height;
+>>>>>>> MERGE-SOURCE
/* Clear the context. */
cairo_save (cr);
@@ -135,7 +142,7 @@
snprintf (info, 50, "%u x %u", xv, yv);
- font = pango_font_description_new ();
+ font = pango_font_description_new ();
layout = pango_cairo_create_layout (is->textLayer.cr);
pango_font_description_set_family (font,"Sans");
@@ -155,14 +162,19 @@
pango_layout_get_pixel_size (layout, &w, &h);
+<<<<<<< TREE
cairo_move_to (cr,
RESIZE_POPUP_WIDTH / 2.0f - w / 2.0f,
+=======
+ cairo_move_to (cr,
+ RESIZE_POPUP_WIDTH / 2.0f - w / 2.0f,
+>>>>>>> MERGE-SOURCE
RESIZE_POPUP_HEIGHT / 2.0f - h / 2.0f);
-
+
pango_layout_set_width (layout, RESIZE_POPUP_WIDTH * PANGO_SCALE);
pango_cairo_update_layout (cr, layout);
-
- cairo_set_source_rgba (cr,
+
+ cairo_set_source_rgba (cr,
*(color) / (float)0xffff,
*(color + 1) / (float)0xffff,
*(color + 2) / (float)0xffff,
@@ -180,10 +192,13 @@
void
InfoLayer::renderBackground ()
{
+<<<<<<< TREE
cairo_pattern_t *pattern;
float border = 7.5;
float r, g, b, a;
+=======
+>>>>>>> MERGE-SOURCE
INFO_SCREEN (screen);
if (!valid)
@@ -199,30 +214,38 @@
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
/* Setup Gradient */
+<<<<<<< TREE
pattern = cairo_pattern_create_linear (0, 0,
RESIZE_POPUP_WIDTH,
RESIZE_POPUP_HEIGHT);
+=======
+ cairo_pattern_t *pattern = cairo_pattern_create_linear (0, 0,
+ RESIZE_POPUP_WIDTH,
+ RESIZE_POPUP_HEIGHT);
+>>>>>>> MERGE-SOURCE
- r = is->optionGetGradient1Red () / (float)0xffff;
- g = is->optionGetGradient1Green () / (float)0xffff;
- b = is->optionGetGradient1Blue () / (float)0xffff;
- a = is->optionGetGradient1Alpha () / (float)0xffff;
+ float r = is->optionGetGradient1Red () / (float)0xffff;
+ float g = is->optionGetGradient1Green () / (float)0xffff;
+ float b = is->optionGetGradient1Blue () / (float)0xffff;
+ float a = is->optionGetGradient1Alpha () / (float)0xffff;
cairo_pattern_add_color_stop_rgba (pattern, 0.00f, r, g, b, a);
- r = is->optionGetGradient2Red () / (float)0xffff;
+ r = is->optionGetGradient2Red () / (float)0xffff;
g = is->optionGetGradient2Green () / (float)0xffff;
- b = is->optionGetGradient2Blue () / (float)0xffff;
+ b = is->optionGetGradient2Blue () / (float)0xffff;
a = is->optionGetGradient2Alpha () / (float)0xffff;
cairo_pattern_add_color_stop_rgba (pattern, 0.65f, r, g, b, a);
- r = is->optionGetGradient3Red () / (float)0xffff;
+ r = is->optionGetGradient3Red () / (float)0xffff;
g = is->optionGetGradient3Green () / (float)0xffff;
- b = is->optionGetGradient3Blue () / (float)0xffff;
+ b = is->optionGetGradient3Blue () / (float)0xffff;
a = is->optionGetGradient3Alpha () / (float)0xffff;
cairo_pattern_add_color_stop_rgba (pattern, 0.85f, r, g, b, a);
cairo_set_source (cr, pattern);
/* Rounded Rectangle! */
+ float border = 7.5;
+
cairo_arc (cr, border, border, border, PI, 1.5f * PI);
cairo_arc (cr, border + RESIZE_POPUP_WIDTH - 2 * border,
border, border,
@@ -234,7 +257,7 @@
border, PI / 2.0f, PI);
cairo_close_path (cr);
cairo_fill_preserve (cr);
-
+
/* Outline */
r = is->optionGetOutlineColorRed () / (float)0xffff;
g = is->optionGetOutlineColorGreen () / (float)0xffff;
@@ -280,6 +303,7 @@
if (fadeTime)
{
fadeTime -= ms;
+
if (fadeTime < 0)
fadeTime = 0;
}
@@ -299,9 +323,9 @@
{
pWindow = NULL;
- cScreen->preparePaintSetEnabled (this, false);
+ cScreen->preparePaintSetEnabled (this, false);
gScreen->glPaintOutputSetEnabled (this, false);
- cScreen->donePaintSetEnabled (this, false);
+ cScreen->donePaintSetEnabled (this, false);
}
}
@@ -356,7 +380,7 @@
screen->handleEventSetEnabled (is, false);
window->ungrabNotifySetEnabled (this, false);
}
-
+
window->ungrabNotify ();
}
@@ -364,25 +388,42 @@
RESIZE_POPUP_HEIGHT with the opacity in InfoScreen. */
void
InfoLayer::draw (const GLMatrix &transform,
+<<<<<<< TREE
int x,
int y)
+=======
+ int x,
+ int y)
+>>>>>>> MERGE-SOURCE
{
- BOX box;
- float opacity;
-
INFO_SCREEN (screen);
if (!valid)
return;
- for (unsigned int i = 0; i < texture.size (); i++)
+ BOX box;
+ float opacity;
+ GLushort colorData[4];
+ GLfloat textureData[8];
+ GLfloat vertexData[12];
+ GLTexture *tex;
+ GLTexture::Matrix matrix;
+ GLVertexBuffer *streamingBuffer;
+
+ for (unsigned int i = 0; i < texture.size (); ++i)
{
+<<<<<<< TREE
GLushort colorData[4];
GLfloat textureData[8];
GLfloat vertexData[12];
GLTexture *tex = texture[i];
GLTexture::Matrix matrix = tex->matrix ();
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
+=======
+ tex = texture[i];
+ matrix = tex->matrix ();
+ streamingBuffer = GLVertexBuffer::streamingBuffer ();
+>>>>>>> MERGE-SOURCE
tex->enable (GLTexture::Good);
@@ -395,6 +436,7 @@
box.y2 = y + RESIZE_POPUP_HEIGHT;
opacity = (float) is->fadeTime / is->optionGetFadeTime ();
+
if (is->drawing)
opacity = 1.0f - opacity;
@@ -457,8 +499,12 @@
RESIZE_POPUP_HEIGHT / 2.0f;
sTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA);
-
- glEnable (GL_BLEND);
+
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
#ifndef USE_GLES
gScreen->setTexEnvMode (GL_MODULATE);
#endif
@@ -466,7 +512,13 @@
textLayer.draw (sTransform, x, y);
gScreen->setTexEnvMode (GL_REPLACE);
+<<<<<<< TREE
glDisable (GL_BLEND);
+=======
+
+ if (!glBlendEnabled)
+ glDisable (GL_BLEND);
+>>>>>>> MERGE-SOURCE
}
return status;
@@ -475,6 +527,7 @@
void
InfoScreen::handleEvent (XEvent *event)
{
+<<<<<<< TREE
switch (event->type)
{
case ClientMessage:
@@ -485,27 +538,46 @@
w = screen->findWindow (event->xclient.window);
if (w && w == pWindow)
+=======
+ switch (event->type)
+ {
+ case ClientMessage:
+ if (event->xclient.message_type == resizeInfoAtom)
+>>>>>>> MERGE-SOURCE
{
- resizeGeometry.x = event->xclient.data.l[0];
- resizeGeometry.y = event->xclient.data.l[1];
- resizeGeometry.width = event->xclient.data.l[2];
- resizeGeometry.height = event->xclient.data.l[3];
-
- textLayer.renderText ();
-
- cScreen->preparePaintSetEnabled (this, true);
- gScreen->glPaintOutputSetEnabled (this, true);
- cScreen->donePaintSetEnabled (this, true);
-
- w->ungrabNotifySetEnabled (InfoWindow::get (w), true);
-
- damagePaintRegion ();
+ CompWindow *w = screen->findWindow (event->xclient.window);
+
+ if (w && w == pWindow)
+ {
+ resizeGeometry.x = event->xclient.data.l[0];
+ resizeGeometry.y = event->xclient.data.l[1];
+ resizeGeometry.width = event->xclient.data.l[2];
+ resizeGeometry.height = event->xclient.data.l[3];
+
+ textLayer.renderText ();
+
+ cScreen->preparePaintSetEnabled (this, true);
+ gScreen->glPaintOutputSetEnabled (this, true);
+ cScreen->donePaintSetEnabled (this, true);
+
+ w->ungrabNotifySetEnabled (InfoWindow::get (w), true);
+
+ damagePaintRegion ();
+ }
}
+<<<<<<< TREE
}
break;
default:
break;
+=======
+
+ break;
+
+ default:
+ break;
+>>>>>>> MERGE-SOURCE
}
screen->handleEvent (event);
@@ -514,12 +586,12 @@
InfoScreen::InfoScreen (CompScreen *screen) :
PluginClassHandler (screen),
ResizeinfoOptions (),
- gScreen (GLScreen::get (screen)),
- cScreen (CompositeScreen::get (screen)),
+ gScreen (GLScreen::get (screen)),
+ cScreen (CompositeScreen::get (screen)),
resizeInfoAtom (XInternAtom (screen->dpy (), "_COMPIZ_RESIZE_NOTIFY", 0)),
- pWindow (0),
- drawing (false),
- fadeTime (0)
+ pWindow (0),
+ drawing (false),
+ fadeTime (0)
{
ScreenInterface::setHandler (screen);
CompositeScreenInterface::setHandler (cScreen);
@@ -527,11 +599,11 @@
memset (&resizeGeometry, 0, sizeof (resizeGeometry));
- cScreen->preparePaintSetEnabled (this, false);
+ cScreen->preparePaintSetEnabled (this, false);
gScreen->glPaintOutputSetEnabled (this, false);
- cScreen->donePaintSetEnabled (this, false);
+ cScreen->donePaintSetEnabled (this, false);
- screen->handleEventSetEnabled (this, false);
+ screen->handleEventSetEnabled (this, false);
backgroundLayer.renderBackground ();
=== modified file 'plugins/ring/src/ring.cpp'
--- plugins/ring/src/ring.cpp 2013-05-13 15:18:36 +0000
+++ plugins/ring/src/ring.cpp 2013-07-21 23:03:28 +0000
@@ -225,11 +225,17 @@
bool scaled = false;
bool pixmap = true;
+<<<<<<< TREE
if (window->mapNum () &&
gWindow->textures ().empty ())
{
gWindow->bind ();
}
+=======
+ if (window->mapNum () &&
+ gWindow->textures ().empty ())
+ gWindow->bind ();
+>>>>>>> MERGE-SOURCE
if (mAdjust || mSlot)
{
@@ -567,7 +573,7 @@
}
void
-RingScreen::switchToWindow (bool toNext)
+RingScreen::switchToWindow (bool toNext)
{
CompWindow *w; // We need w to be in this scope
unsigned int cur = 0;
@@ -651,6 +657,7 @@
return 0;
}
+<<<<<<< TREE
int change = mRVelocity * chunk;
if (!change)
@@ -658,6 +665,13 @@
if (mRVelocity)
change = (mRotAdjust > 0) ? 1 : -1;
}
+=======
+ int change = mRVelocity * chunk;
+
+ if (!change &&
+ mRVelocity)
+ change = (mRotAdjust > 0) ? 1 : -1;
+>>>>>>> MERGE-SOURCE
mRotAdjust -= change;
mRotTarget += change;
@@ -788,7 +802,12 @@
if (!steps)
steps = 1;
- float chunk = amount / (float) steps;
+<<<<<<< TREE
+ float chunk = amount / (float) steps;
+=======
+
+ float chunk = amount / (float) steps;
+>>>>>>> MERGE-SOURCE
while (steps--)
{
@@ -812,9 +831,9 @@
else if (rw->mSlot)
{
rw->mScale = rw->mSlot->scale * rw->mSlot->depthScale;
- rw->mTx = rw->mSlot->x - w->x () -
+ rw->mTx = rw->mSlot->x - w->x () -
(w->width () * rw->mScale) / 2;
- rw->mTy = rw->mSlot->y - w->y () -
+ rw->mTy = rw->mSlot->y - w->y () -
(w->height () * rw->mScale) / 2;
}
}
@@ -1002,7 +1021,7 @@
return;
/* first find the top-most window the mouse
- pointer is over */
+ * pointer is over */
foreach (CompWindow *w, mWindows)
{
RING_WINDOW (w);
@@ -1061,10 +1080,16 @@
if (!rw->is (true))
return;
+<<<<<<< TREE
bool inList = false;
CompWindow *selected;
selected = mSelectedWindow;
CompWindowVector::iterator it = mWindows.begin ();
+=======
+ bool inList = false;
+ CompWindow *selected = mSelectedWindow;
+ CompWindowVector::iterator it = mWindows.begin ();
+>>>>>>> MERGE-SOURCE
while (it != mWindows.end ())
{
=== modified file 'plugins/rotate/src/rotate.cpp'
--- plugins/rotate/src/rotate.cpp 2013-05-21 14:13:15 +0000
+++ plugins/rotate/src/rotate.cpp 2013-07-21 23:03:28 +0000
@@ -33,7 +33,8 @@
COMPIZ_PLUGIN_20090315 (rotate, RotatePluginVTable)
bool
-RotateScreen::setOption (const CompString &name, CompOption::Value &value)
+RotateScreen::setOption (const CompString &name,
+ CompOption::Value &value)
{
unsigned int index;
@@ -57,7 +58,8 @@
}
bool
-RotateScreen::adjustVelocity (int size, int invert)
+RotateScreen::adjustVelocity (int size,
+ int invert)
{
float xrot;
@@ -122,9 +124,12 @@
RotateScreen::preparePaint (int msSinceLastPaint)
{
float oldXrot = mXrot + mBaseXrot;
+ float vpWidth = (float)screen->vpSize ().width ();
+ float tsWidth = 360.0f / vpWidth;
if (mGrabIndex || mMoving)
{
+<<<<<<< TREE
float amount = msSinceLastPaint * 0.05f * optionGetSpeed ();
int steps = amount / (0.5f * optionGetTimestep ());
@@ -132,21 +137,40 @@
steps = 1;
float chunk = amount / (float) steps;
+=======
+ float amount = msSinceLastPaint * 0.05f * optionGetSpeed ();
+ int steps = amount / (0.5f * optionGetTimestep ());
+
+ if (!steps)
+ steps = 1;
+
+ float chunk = amount / (float) steps;
+>>>>>>> MERGE-SOURCE
while (steps--)
{
mXrot += mXVelocity * chunk;
mYrot += mYVelocity * chunk;
- if (mXrot > 360.0f / screen->vpSize ().width ())
+ if (mXrot > tsWidth)
{
+<<<<<<< TREE
mBaseXrot += 360.0f / screen->vpSize ().width ();
mXrot -= 360.0f / screen->vpSize ().width ();
+=======
+ mBaseXrot += tsWidth;
+ mXrot -= tsWidth;
+>>>>>>> MERGE-SOURCE
}
else if (mXrot < 0.0f)
{
+<<<<<<< TREE
mBaseXrot -= 360.0f / screen->vpSize ().width ();
mXrot += 360.0f / screen->vpSize ().width ();
+=======
+ mBaseXrot -= tsWidth;
+ mXrot += tsWidth;
+>>>>>>> MERGE-SOURCE
}
if (cubeScreen->invert () == -1)
@@ -187,7 +211,7 @@
if (fabs (mYVelocity) < 0.01f)
mYVelocity = 0.0f;
}
- else if (adjustVelocity (screen->vpSize ().width (), cubeScreen->invert ()))
+ else if (adjustVelocity (vpWidth, cubeScreen->invert ()))
{
mXVelocity = 0.0f;
mYVelocity = 0.0f;
@@ -199,9 +223,9 @@
float xrot = mBaseXrot + mXrot;
if (xrot < 0.0f)
- tx = (screen->vpSize ().width () * xrot / 360.0f) - 0.5f;
+ tx = (tsWidth * xrot) - 0.5f;
else
- tx = (screen->vpSize ().width () * xrot / 360.0f) + 0.5f;
+ tx = (tsWidth * xrot) + 0.5f;
/* flag end of rotation */
cubeScreen->rotationState (CubeScreen::RotationNone);
@@ -232,6 +256,7 @@
screen->handleCompizEvent ("rotate", "end_viewport_switch", o);
}
+
break;
}
}
@@ -242,7 +267,7 @@
if (w)
{
- float xrot = (screen->vpSize ().width () * (mBaseXrot + mXrot)) / 360.0f;
+ float xrot = (vpWidth * (mBaseXrot + mXrot)) / 360.0f;
w->moveToViewportPosition (mMoveWindowX - xrot * screen->width (),
w->y (), false);
}
@@ -251,16 +276,33 @@
if (mMoving)
{
+<<<<<<< TREE
if (fabs (mXrot + mBaseXrot + mMoveTo) <= 180 / screen->vpSize ().width ())
+=======
+ if (fabs (mXrot + mBaseXrot + mMoveTo) <= 180.0f / vpWidth)
+>>>>>>> MERGE-SOURCE
mProgress = fabs (mXrot + mBaseXrot + mMoveTo) /
+<<<<<<< TREE
180 / screen->vpSize ().width ();
else if (fabs (mXrot + mBaseXrot) <= 180 / screen->vpSize ().width ())
+=======
+ 180.0f / vpWidth;
+ else if (fabs (mXrot + mBaseXrot) <= 180.0f / vpWidth)
+>>>>>>> MERGE-SOURCE
mProgress = fabs (mXrot + mBaseXrot) /
+<<<<<<< TREE
180 / screen->vpSize ().width ();
+=======
+ 180.0f / vpWidth;
+>>>>>>> MERGE-SOURCE
else
{
mProgress += fabs (mXrot + mBaseXrot - oldXrot) /
+<<<<<<< TREE
180 / (screen->vpSize ().width ());
+=======
+ 180.0f / vpWidth;
+>>>>>>> MERGE-SOURCE
mProgress = MIN (mProgress, 1.0);
}
}
@@ -279,7 +321,7 @@
float dt;
if (mGrabbed)
- dt = 1.0 - mProgress;
+ dt = 1.0f - mProgress;
else
dt = 0.0f - mProgress;
@@ -335,8 +377,8 @@
{
cubeScreen->cubeGetRotation (x, v, progress);
- x += mBaseXrot + mXrot;
- v += mYrot;
+ x += mBaseXrot + mXrot;
+ v += mYrot;
progress = MAX (progress, mProgress);
}
@@ -409,10 +451,16 @@
if (mGrabIndex)
{
+<<<<<<< TREE
mMoveTo = 0.0f;
mGrabbed = true;
mSnapTop = optionGetSnapTop ();
+=======
+ mMoveTo = 0.0f;
+ mGrabbed = true;
+ mSnapTop = optionGetSnapTop ();
+>>>>>>> MERGE-SOURCE
mSnapBottom = optionGetSnapBottom ();
if (state & CompAction::StateInitButton)
@@ -457,9 +505,17 @@
CompOption::Vector &options,
int direction)
{
+<<<<<<< TREE
if (screen->vpSize ().width () < 2 ||
!direction ||
screen->otherGrabExist ("rotate", "move", "switcher",
+=======
+ int vpWidth = screen->vpSize ().width ();
+
+ if (vpWidth < 2 ||
+ !direction ||
+ screen->otherGrabExist ("rotate", "move", "switcher",
+>>>>>>> MERGE-SOURCE
"group-drag", "cube", NULL))
return false;
@@ -473,8 +529,8 @@
CompOption::Vector o (0);
o.push_back (CompOption ("root", CompOption::TypeInt));
- o.push_back (CompOption ("x", CompOption::TypeInt));
- o.push_back (CompOption ("y", CompOption::TypeInt));
+ o.push_back (CompOption ("x", CompOption::TypeInt));
+ o.push_back (CompOption ("y", CompOption::TypeInt));
o[0].value ().set ((int) screen->root ());
o[1].value ().set (CompOption::getIntOptionNamed (options, "x", 0));
@@ -484,7 +540,11 @@
}
mMoving = true;
+<<<<<<< TREE
mMoveTo += 360.0f / screen->vpSize ().width () * direction;
+=======
+ mMoveTo += (360.0f / vpWidth) * direction;
+>>>>>>> MERGE-SOURCE
mGrabbed = false;
cScreen->damageScreen ();
@@ -511,10 +571,17 @@
if (!mGrabIndex && !mMoving)
{
CompWindow *w = screen->findWindow (xid);
+<<<<<<< TREE
if (w &&
!(w->type () & (CompWindowTypeDesktopMask | CompWindowTypeDockMask)) &&
!(w->state () & CompWindowStateStickyMask))
+=======
+
+ if (w &&
+ !(w->type () & (CompWindowTypeDesktopMask | CompWindowTypeDockMask)) &&
+ !(w->state () & CompWindowStateStickyMask))
+>>>>>>> MERGE-SOURCE
{
mMoveWindow = w->id ();
mMoveWindowX = w->x ();
@@ -530,8 +597,8 @@
CompOption::Vector o (0);
o.push_back (CompOption ("root", CompOption::TypeInt));
- o.push_back (CompOption ("x", CompOption::TypeInt));
- o.push_back (CompOption ("y", CompOption::TypeInt));
+ o.push_back (CompOption ("x", CompOption::TypeInt));
+ o.push_back (CompOption ("y", CompOption::TypeInt));
o[0].value ().set ((int) screen->root ());
o[1].value ().set (CompOption::getIntOptionNamed (options, "x", 0));
@@ -561,20 +628,33 @@
CompOption::Vector o (0);
mMoveTo = 0.0f;
+<<<<<<< TREE
mSlow = false;
int warpX = pointerX - (screen->width () * direction);
+=======
+ mSlow = false;
+
+ int sWidth = screen->width ();
+ int warpX = pointerX - sWidth * direction;
+
+>>>>>>> MERGE-SOURCE
if (direction == -1)
- screen->warpPointer (screen->width () - 10, 0);
+ screen->warpPointer (sWidth - 1, 0);
else
+<<<<<<< TREE
screen->warpPointer (10 - screen->width (), 0);
+=======
+ screen->warpPointer (1 - sWidth, 0);
+
+>>>>>>> MERGE-SOURCE
lastPointerX = warpX;
o.push_back (CompOption ("root", CompOption::TypeInt));
- o.push_back (CompOption ("x", CompOption::TypeInt));
- o.push_back (CompOption ("y", CompOption::TypeInt));
+ o.push_back (CompOption ("x", CompOption::TypeInt));
+ o.push_back (CompOption ("y", CompOption::TypeInt));
o[0].value ().set ((int) screen->root ());
o[1].value ().set (0);
@@ -583,7 +663,7 @@
rotate (NULL, 0, o, direction);
XWarpPointer (screen->dpy (), None, None, 0, 0, 0, 0, direction, 0);
- mSavedPointer.setX (lastPointerX + (9 * direction));
+ mSavedPointer.setX (lastPointerX + direction);
return false;
}
@@ -594,10 +674,15 @@
CompOption::Vector &options,
int direction)
{
+<<<<<<< TREE
CompOption::Vector o (0);
if (screen->vpSize ().width () < 2 ||
screen->otherGrabExist ("rotate", "move", "group-drag", NULL))
+=======
+ if (screen->vpSize ().width () < 2 ||
+ screen->otherGrabExist ("rotate", "move", "group-drag", NULL))
+>>>>>>> MERGE-SOURCE
return false;
if (state & CompAction::StateInitEdgeDnd)
@@ -622,12 +707,19 @@
if (!optionGetEdgeFlipWindow ())
return false;
}
- else if (!optionGetEdgeFlipPointer ())
- return false;
+<<<<<<< TREE
+ else if (!optionGetEdgeFlipPointer ())
+ return false;
+=======
+ else if (!optionGetEdgeFlipPointer ())
+ return false;
+
+ CompOption::Vector o (0);
+>>>>>>> MERGE-SOURCE
o.push_back (CompOption ("root", CompOption::TypeInt));
- o.push_back (CompOption ("x", CompOption::TypeInt));
- o.push_back (CompOption ("y", CompOption::TypeInt));
+ o.push_back (CompOption ("x", CompOption::TypeInt));
+ o.push_back (CompOption ("y", CompOption::TypeInt));
o[0].value ().set ((int) screen->root ());
o[1].value ().set (CompOption::getIntOptionNamed (options, "x", 0));
@@ -635,29 +727,40 @@
if (optionGetFlipTime () == 0 || (mMoving && !mSlow))
{
+ int sWidth = screen->width ();
int pointerDx = pointerX - lastPointerX;
int warpX;
/* TODO: Eliminate those magic numbers here */
if (direction == -1)
{
+<<<<<<< TREE
warpX = pointerX + screen->width ();
screen->warpPointer (screen->width () - 10, 0);
+=======
+ warpX = pointerX + sWidth;
+ screen->warpPointer (sWidth - 1, 0);
+>>>>>>> MERGE-SOURCE
lastPointerX = warpX - pointerDx;
rotate (NULL, 0, o, direction);
XWarpPointer (screen->dpy (), None, None, 0, 0, 0, 0, -1, 0);
- mSavedPointer.setX (lastPointerX - 9);
+ mSavedPointer.setX (lastPointerX - 1);
}
else
{
+<<<<<<< TREE
warpX = pointerX - screen->width ();
screen->warpPointer (10 - screen->width (), 0);
+=======
+ warpX = pointerX - sWidth;
+ screen->warpPointer (1 - sWidth, 0);
+>>>>>>> MERGE-SOURCE
lastPointerX = warpX - pointerDx;
rotate (NULL, 0, o, direction);
XWarpPointer (screen->dpy (), None, None, 0, 0, 0, 0, 1, 0);
- mSavedPointer.setX (lastPointerX + 9);
+ mSavedPointer.setX (lastPointerX + 1);
}
}
else
@@ -686,7 +789,6 @@
RotateScreen::flipTerminate (CompAction *action,
CompAction::State state,
CompOption::Vector &options)
-
{
Window xid = CompOption::getIntOptionNamed (options, "root", 0);
@@ -700,7 +802,7 @@
if (mSlow)
{
mMoveTo = 0.0f;
- mSlow = false;
+ mSlow = false;
}
cScreen->damageScreen ();
@@ -715,12 +817,24 @@
int
RotateScreen::rotateToDirection (int face)
{
+<<<<<<< TREE
int delta = face - screen->vp ().x () - (mMoveTo / (360.0f / screen->vpSize ().width ()));
+=======
+ int vpWidth = screen->vpSize ().width ();
+ int delta = face - screen->vp ().x () - (mMoveTo / (360.0f / vpWidth));
+>>>>>>> MERGE-SOURCE
+<<<<<<< TREE
if (delta > screen->vpSize ().width () / 2)
delta -= screen->vpSize ().width ();
else if (delta < -(screen->vpSize ().width () / 2))
delta += screen->vpSize ().width ();
+=======
+ if (delta > vpWidth / 2)
+ delta -= vpWidth;
+ else if (delta < -vpWidth / 2)
+ delta += vpWidth;
+>>>>>>> MERGE-SOURCE
return delta;
}
@@ -732,17 +846,17 @@
int face,
bool withWindow)
{
- CompOption::Vector o (0);
-
if (face < 0)
face = CompOption::getIntOptionNamed (options, "face", screen->vp ().x ());
if (face > screen->vpSize ().width ())
return false;
+ CompOption::Vector o (0);
+
o.push_back (CompOption ("root", CompOption::TypeInt));
- o.push_back (CompOption ("x", CompOption::TypeInt));
- o.push_back (CompOption ("y", CompOption::TypeInt));
+ o.push_back (CompOption ("x", CompOption::TypeInt));
+ o.push_back (CompOption ("y", CompOption::TypeInt));
o[0].value ().set ((int) screen->root ());
o[1].value ().set (CompOption::getIntOptionNamed (options, "x", pointerX));
@@ -819,18 +933,19 @@
int i, x, y;
unsigned int ui;
CompOption::Vector o (0);
+ int vpWidth = screen->vpSize ().width ();
XQueryPointer (screen->dpy (), screen->root (),
&win, &win, &x, &y, &i, &i, &ui);
- if (dx * 2 > screen->vpSize ().width ())
- dx -= screen->vpSize ().width ();
- else if (dx * 2 < -screen->vpSize ().width ())
- dx += screen->vpSize ().width ();
+ if (dx * 2 > vpWidth)
+ dx -= vpWidth;
+ else if (dx * 2 < -vpWidth)
+ dx += vpWidth;
o.push_back (CompOption ("root", CompOption::TypeInt));
- o.push_back (CompOption ("x", CompOption::TypeInt));
- o.push_back (CompOption ("y", CompOption::TypeInt));
+ o.push_back (CompOption ("x", CompOption::TypeInt));
+ o.push_back (CompOption ("y", CompOption::TypeInt));
o[0].value ().set ((int) screen->root ());
o[1].value ().set (x);
@@ -859,9 +974,16 @@
/* reset movement */
rScreen->mMoveTo = 0.0f;
+<<<<<<< TREE
int dx = window->defaultViewport ().x ();
dx -= screen->vp ().x ();
+=======
+ int vpWidth = screen->vpSize ().width ();
+ int dx = window->defaultViewport ().x ();
+ dx -= screen->vp ().x ();
+
+>>>>>>> MERGE-SOURCE
if (dx)
{
Window win;
@@ -872,14 +994,14 @@
XQueryPointer (screen->dpy (), screen->root (),
&win, &win, &x, &y, &i, &i, &ui);
- if (dx * 2 > screen->vpSize ().width ())
- dx -= screen->vpSize ().width ();
- else if (dx * 2 < -screen->vpSize ().width ())
- dx += screen->vpSize ().width ();
+ if (dx * 2 > vpWidth)
+ dx -= vpWidth;
+ else if (dx * 2 < -vpWidth)
+ dx += vpWidth;
o.push_back (CompOption ("root", CompOption::TypeInt));
- o.push_back (CompOption ("x", CompOption::TypeInt));
- o.push_back (CompOption ("y", CompOption::TypeInt));
+ o.push_back (CompOption ("x", CompOption::TypeInt));
+ o.push_back (CompOption ("y", CompOption::TypeInt));
o[0].value ().set ((int) screen->root ());
o[1].value ().set (x);
@@ -921,29 +1043,29 @@
RotateScreen::RotateScreen (CompScreen *s) :
PluginClassHandler (s),
- gScreen (GLScreen::get (s)),
- cScreen (CompositeScreen::get (s)),
- cubeScreen (CubeScreen::get (s)),
- mSnapTop (false),
- mSnapBottom (false),
- mGrabIndex (0),
- mXrot (0.0f),
- mXVelocity (0.0f),
- mYrot (0.0f),
- mYVelocity (0.0f),
- mBaseXrot (0.0f),
- mMoving (false),
- mMoveTo (0.0f),
- mMoveWindow (0),
- mMoveWindowX (0),
- mSavedPointer (0,0),
- mGrabbed (false),
- mSlow (false),
- mGrabMask (0),
- mGrabWindow (0),
- mProgress (0.0f),
+ gScreen (GLScreen::get (s)),
+ cScreen (CompositeScreen::get (s)),
+ cubeScreen (CubeScreen::get (s)),
+ mSnapTop (false),
+ mSnapBottom (false),
+ mGrabIndex (0),
+ mXrot (0.0f),
+ mXVelocity (0.0f),
+ mYrot (0.0f),
+ mYVelocity (0.0f),
+ mBaseXrot (0.0f),
+ mMoving (false),
+ mMoveTo (0.0f),
+ mMoveWindow (0),
+ mMoveWindowX (0),
+ mSavedPointer (0, 0),
+ mGrabbed (false),
+ mSlow (false),
+ mGrabMask (0),
+ mGrabWindow (NULL),
+ mProgress (0.0f),
mProgressVelocity (0.0f),
- mZoomTranslate (0.0f)
+ mZoomTranslate (0.0f)
{
mPointerSensitivity = optionGetSensitivity () * ROTATE_POINTER_SENSITIVITY_FACTOR;
@@ -1005,7 +1127,7 @@
RotateWindow::RotateWindow (CompWindow *w) :
PluginClassHandler (w),
- window (w),
+ window (w),
rScreen (RotateScreen::get (screen))
{
WindowInterface::setHandler (window);
=== modified file 'plugins/rotate/src/rotate.h'
--- plugins/rotate/src/rotate.h 2013-05-19 13:44:51 +0000
+++ plugins/rotate/src/rotate.h 2013-07-21 23:03:28 +0000
@@ -58,6 +58,7 @@
void handleEvent (XEvent *event);
void preparePaint (int);
+
void donePaint ();
bool glPaintOutput (const GLScreenPaintAttrib &,
@@ -125,8 +126,10 @@
CompScreen::GrabHandle mGrabIndex;
- GLfloat mXrot, mXVelocity;
- GLfloat mYrot, mYVelocity;
+ GLfloat mXrot;
+ GLfloat mXVelocity;
+ GLfloat mYrot;
+ GLfloat mYVelocity;
GLfloat mBaseXrot;
@@ -159,10 +162,18 @@
RotateWindow (CompWindow *w);
~RotateWindow () {};
- void grabNotify (int x,
- int y,
- unsigned int state,
- unsigned int mask);
+<<<<<<< TREE
+ void grabNotify (int x,
+ int y,
+ unsigned int state,
+ unsigned int mask);
+=======
+ void grabNotify (int x,
+ int y,
+ unsigned int state,
+ unsigned int mask);
+
+>>>>>>> MERGE-SOURCE
void ungrabNotify ();
void activate ();
=== modified file 'plugins/scale/scale.xml.in'
--- plugins/scale/scale.xml.in 2012-10-15 10:31:51 +0000
+++ plugins/scale/scale.xml.in 2013-07-21 23:03:28 +0000
@@ -35,7 +35,7 @@
<_short>Timestep
<_long>Scale timestep
1.2
- 0.1
+ 0
50
0.1
=== modified file 'plugins/scale/src/scale.cpp'
--- plugins/scale/src/scale.cpp 2013-05-26 06:15:47 +0000
+++ plugins/scale/src/scale.cpp 2013-07-21 23:03:28 +0000
@@ -52,10 +52,9 @@
bool
PrivateScaleWindow::isNeverScaleWin () const
{
- if (window->overrideRedirect ())
- return true;
-
- if (window->wmType () & (CompWindowTypeDockMask |
+ if (window->overrideRedirect () ||
+ window->inShowDesktopMode () ||
+ window->wmType () & (CompWindowTypeDockMask |
CompWindowTypeDesktopMask))
return true;
@@ -68,31 +67,33 @@
if (isNeverScaleWin ())
return false;
- if (!spScreen->type || spScreen->type == ScaleTypeOutput)
- {
- if (!window->focus ())
- return false;
- }
-
- if (window->state () & CompWindowStateSkipPagerMask)
+ if ((!spScreen->type || spScreen->type == ScaleTypeOutput) &&
+ !window->focus ())
return false;
- if (window->state () & CompWindowStateShadedMask)
+ if (window->state () & CompWindowStateSkipPagerMask ||
+ window->state () & CompWindowStateShadedMask)
return false;
if (!window->mapNum () || !window->isViewable ())
return false;
- switch (sScreen->priv->type) {
+ switch (sScreen->priv->type)
+ {
case ScaleTypeGroup:
if (spScreen->clientLeader != window->clientLeader () &&
spScreen->clientLeader != window->id ())
return false;
+
break;
+
case ScaleTypeOutput:
if ((unsigned int) window->outputDevice () !=
- (unsigned int) screen->currentOutputDev ().id ())
+ (unsigned int) screen->currentOutputDev ().id ())
return false;
+
+ break;
+
default:
break;
}
@@ -137,7 +138,12 @@
GLWindowPaintAttrib sAttrib (attrib);
GLTexture *icon;
- icon = priv->gWindow->getIcon (512, 512);
+<<<<<<< TREE
+ icon = priv->gWindow->getIcon (512, 512);
+=======
+ icon = priv->gWindow->getIcon (512, 512);
+
+>>>>>>> MERGE-SOURCE
if (!icon)
icon = priv->spScreen->gScreen->defaultIcon ();
@@ -145,17 +151,17 @@
{
float scale;
float x, y;
- int width, height;
- int scaledWinWidth, scaledWinHeight;
-
- scaledWinWidth = priv->window->width () * priv->scale;
- scaledWinHeight = priv->window->height () * priv->scale;
-
- switch (priv->spScreen->optionGetOverlayIcon ()) {
+
+ int scaledWinWidth = priv->window->width () * priv->scale;
+ int scaledWinHeight = priv->window->height () * priv->scale;
+
+ switch (priv->spScreen->optionGetOverlayIcon ())
+ {
case ScaleOptions::OverlayIconNone:
case ScaleOptions::OverlayIconEmblem:
scale = 1.0f;
break;
+
case ScaleOptions::OverlayIconBig:
default:
sAttrib.opacity /= 3;
@@ -164,15 +170,17 @@
break;
}
- width = icon->width () * scale;
- height = icon->height () * scale;
+ int width = icon->width () * scale;
+ int height = icon->height () * scale;
- switch (priv->spScreen->optionGetOverlayIcon ()) {
+ switch (priv->spScreen->optionGetOverlayIcon ())
+ {
case ScaleOptions::OverlayIconNone:
case ScaleOptions::OverlayIconEmblem:
x = priv->window->x () + scaledWinWidth - icon->width ();
y = priv->window->y () + scaledWinHeight - icon->height ();
break;
+
case ScaleOptions::OverlayIconBig:
default:
x = priv->window->x () + scaledWinWidth / 2 - width / 2;
@@ -184,36 +192,26 @@
y += priv->ty;
if (priv->slot)
- {
priv->delta = fabs (priv->slot->x1 () - priv->window->x ()) +
fabs (priv->slot->y1 () - priv->window->y ()) +
fabs (1.0f - priv->slot->scale) * 500.0f;
- }
if (priv->delta)
{
- float o;
- float ds;
-
- ds = fabs (priv->tx) +
- fabs (priv->ty) +
- fabs (1.0f - priv->scale) * 500.0f;
+ float ds = fabs (priv->tx) +
+ fabs (priv->ty) +
+ fabs (1.0f - priv->scale) * 500.0f;
if (ds > priv->delta)
ds = priv->delta;
- o = ds / priv->delta;
+ float o = ds / priv->delta;
- if (priv->slot)
- {
- if (o < priv->lastThumbOpacity)
- o = priv->lastThumbOpacity;
- }
- else
- {
- if (o > priv->lastThumbOpacity)
- o = 0.0f;
- }
+ if (priv->slot &&
+ o < priv->lastThumbOpacity)
+ o = priv->lastThumbOpacity;
+ else if (o > priv->lastThumbOpacity)
+ o = 0.0f;
priv->lastThumbOpacity = o;
@@ -335,25 +333,27 @@
else if (priv->spScreen->state != ScaleScreen::In)
{
if (priv->spScreen->optionGetDarkenBack ())
- {
/* modify brightness of the other windows */
attrib.brightness = attrib.brightness / 2;
- }
/* hide windows on the outputs used for scaling
that are not in scale mode */
if (!priv->isNeverScaleWin ())
{
- int moMode, output;
-
- moMode = priv->spScreen->getMultioutputMode ();
-
- switch (moMode) {
+ int output;
+
+ int moMode = priv->spScreen->getMultioutputMode ();
+
+ switch (moMode)
+ {
case ScaleOptions::MultioutputModeOnCurrentOutputDevice:
output = screen->currentOutputDev ().id ();
+
if (priv->window->outputDevice () == output)
attrib.opacity = 0;
+
break;
+
default:
attrib.opacity = 0;
break;
@@ -375,9 +375,8 @@
if (spScreen->state != ScaleScreen::Idle)
{
GLWindowPaintAttrib sAttrib (attrib);
- bool scaled;
- scaled = sWindow->setScaledPaintAttributes (sAttrib);
+ bool scaled = sWindow->setScaledPaintAttributes (sAttrib);
if (adjust || slot)
mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
@@ -407,9 +406,7 @@
}
}
else
- {
status = gWindow->glPaint (attrib, transform, region, mask);
- }
return status;
}
@@ -425,27 +422,29 @@
PrivateScaleScreen::layoutSlotsForArea (const CompRect& workArea,
int nWindows)
{
- if (!nWindows)
+ /* makes no sense without any or
+ * with just one open window */
+ if (!nWindows ||
+ nWindows == 1)
return;
- int x, y, width, height;
- int n;
+ int n, x, width;
int lines = sqrt (nWindows + 1);
int spacing = optionGetSpacing ();
int nSlots = 0;
- y = workArea.y () + spacing;
- height = (workArea.height () - (lines + 1) * spacing) / lines;
+ int y = workArea.y () + spacing;
+ int height = (workArea.height () - (lines + 1) * spacing) / lines;
- for (int i = 0; i < lines; i++)
+ for (int i = 0; i < lines; ++i)
{
n = MIN (nWindows - nSlots, ceilf ((float) nWindows / lines));
x = workArea.x () + spacing;
width = (workArea.width () - (n + 1) * spacing) / n;
- for (int j = 0; j < n; j++)
+ for (int j = 0; j < n; ++j)
{
slots[this->nSlots].setGeometry (x, y, width, height);
@@ -453,8 +452,8 @@
x += width + spacing;
- this->nSlots++;
- nSlots++;
+ ++this->nSlots;
+ ++nSlots;
}
y += height + spacing;
@@ -469,17 +468,19 @@
slotAreas.resize (screen->outputDevs ().size ());
unsigned int i = 0;
+
foreach (CompOutput &o, screen->outputDevs ())
{
slotAreas[i].nWindows = 0;
foreach (ScaleWindow *window, windows)
{
CompWindow *cw = window->priv->window;
+
if (cw->outputDevice () == (int) o.id ())
- slotAreas[i].nWindows++;
+ ++slotAreas[i].nWindows;
}
- slotAreas[i++].workArea = o.workArea ();
+ slotAreas[++i].workArea = o.workArea ();
}
return slotAreas;
@@ -488,9 +489,7 @@
void
PrivateScaleScreen::layoutSlots ()
{
- int moMode;
-
- moMode = getMultioutputMode ();
+ int moMode = getMultioutputMode ();
/* if we have only one head, we don't need the
additional effort of the all outputs mode */
@@ -511,6 +510,7 @@
}
}
break;
+
case ScaleOptions::MultioutputModeOnCurrentOutputDevice:
default:
{
@@ -525,7 +525,7 @@
PrivateScaleScreen::findBestSlots ()
{
CompWindow *w;
- int i, d, d0 = 0;
+ int d, d0 = 0;
float sx, sy, cx, cy;
foreach (ScaleWindow *sw, windows)
@@ -538,8 +538,7 @@
sw->priv->sid = 0;
sw->priv->distance = MAXSHORT;
- for (i = 0; i < nSlots; i++)
- {
+ for (int i = 0; i < nSlots; ++i)
if (!slots[i].filled)
{
sx = (slots[i].x2 () + slots[i].x1 ()) / 2;
@@ -558,7 +557,6 @@
sw->priv->distance = d0 + d;
}
}
- }
d0 += sw->priv->distance;
}
@@ -671,9 +669,11 @@
bool
PrivateScaleScreen::layoutThumbs ()
{
- switch (type) {
+ switch (type)
+ {
case ScaleTypeAll:
return layoutThumbsAll ();
+
case ScaleTypeNormal:
default:
return layoutThumbsSingle ();
@@ -696,7 +696,7 @@
sw->priv->slot = NULL;
if (!sw->priv->isScaleWin ())
- continue;
+ continue;
windows.push_back (sw);
}
@@ -716,9 +716,8 @@
std::map slotWindows;
CompWindowList allWindows;
- for (int i = 0; i < screen->vpSize ().height (); i++)
- {
- for (int j = 0; j < screen->vpSize ().width (); j++)
+ for (int i = 0; i < screen->vpSize ().height (); ++i)
+ for (int j = 0; j < screen->vpSize ().width (); ++j)
{
windows.clear ();
slots.clear ();
@@ -751,7 +750,6 @@
slotWindows[sw] = *sw->priv->slot;
}
}
- }
slots.clear ();
windows.clear ();
@@ -772,7 +770,6 @@
bool
PrivateScaleWindow::adjustScaleVelocity ()
{
- float dx, dy, ds, adjust, amount;
float x1, y1, scale;
if (slot)
@@ -788,10 +785,11 @@
scale = 1.0f;
}
- dx = x1 - (window->x () + tx);
-
- adjust = dx * 0.15f;
- amount = fabs (dx) * 1.5f;
+ float dx = x1 - (window->x () + tx);
+
+ float adjust = dx * 0.15f;
+ float amount = fabs (dx) * 1.5f;
+
if (amount < 0.5f)
amount = 0.5f;
else if (amount > 5.0f)
@@ -799,10 +797,11 @@
xVelocity = (amount * xVelocity + adjust) / (amount + 1.0f);
- dy = y1 - (window->y () + ty);
+ float dy = y1 - (window->y () + ty);
adjust = dy * 0.15f;
amount = fabs (dy) * 1.5f;
+
if (amount < 0.5f)
amount = 0.5f;
else if (amount > 5.0f)
@@ -810,10 +809,11 @@
yVelocity = (amount * yVelocity + adjust) / (amount + 1.0f);
- ds = scale - this->scale;
+ float ds = scale - this->scale;
adjust = ds * 0.1f;
amount = fabs (ds) * 7.0f;
+
if (amount < 0.01f)
amount = 0.01f;
else if (amount > 0.15f)
@@ -852,21 +852,21 @@
void
PrivateScaleScreen::preparePaint (int msSinceLastPaint)
{
+ /*
#ifndef LP1026986_FIXED_PROPERLY
if (state != ScaleScreen::Idle)
cScreen->damageScreen ();
#endif
+*/
if (state != ScaleScreen::Idle && state != ScaleScreen::Wait)
{
- int steps;
- float amount, chunk;
-
- amount = msSinceLastPaint * 0.05f * optionGetSpeed ();
- steps = amount / (0.5f * optionGetTimestep ());
+ float amount = msSinceLastPaint * 0.05f * optionGetSpeed ();
+ int steps = amount / (0.5f * optionGetTimestep ());
if (!steps)
steps = 1;
- chunk = amount / (float) steps;
+
+ float chunk = amount / (float) steps;
while (steps--)
{
@@ -902,37 +902,32 @@
if (state != ScaleScreen::Idle)
{
if (moreAdjust)
- {
cScreen->damageScreen ();
+ else if (state == ScaleScreen::In)
+ {
+ /* The false activate event is sent when scale state
+ goes back to normal, to avoid animation conflicts
+ with other plugins. */
+ activateEvent (false);
+ state = ScaleScreen::Idle;
+ cScreen->preparePaintSetEnabled (this, false);
+
+ cScreen->donePaintSetEnabled (this, false);
+ gScreen->glPaintOutputSetEnabled (this, false);
+
+ foreach (CompWindow *w, screen->windows ())
+ {
+ SCALE_WINDOW (w);
+ sw->priv->cWindow->damageRectSetEnabled (sw->priv, false);
+ sw->priv->gWindow->glPaintSetEnabled (sw->priv, false);
+ }
}
- else
+ else if (state == ScaleScreen::Out)
{
- if (state == ScaleScreen::In)
- {
- /* The false activate event is sent when scale state
- goes back to normal, to avoid animation conflicts
- with other plugins. */
- activateEvent (false);
- state = ScaleScreen::Idle;
-
- cScreen->preparePaintSetEnabled (this, false);
- cScreen->donePaintSetEnabled (this, false);
- gScreen->glPaintOutputSetEnabled (this, false);
-
- foreach (CompWindow *w, screen->windows ())
- {
- SCALE_WINDOW (w);
- sw->priv->cWindow->damageRectSetEnabled (sw->priv, false);
- sw->priv->gWindow->glPaintSetEnabled (sw->priv, false);
- }
- }
- else if (state == ScaleScreen::Out)
- {
- state = ScaleScreen::Wait;
-
- // When the animation is completed, select the window under mouse
- selectWindowAt (pointerX, pointerY);
- }
+ state = ScaleScreen::Wait;
+
+ // When the animation is completed, select the window under mouse
+ selectWindowAt (pointerX, pointerY);
}
}
@@ -1000,26 +995,22 @@
{
SCALE_SCREEN (screen);
- Window xid;
int selectX = CompOption::getIntOptionNamed (options, "select_x", -1);
int selectY = CompOption::getIntOptionNamed (options, "select_y", -1);
if (ss->priv->actionShouldToggle (action, state))
return false;
- xid = CompOption::getIntOptionNamed (options, "root");
- if (xid && ::screen->root () != xid)
- return false;
+ Window xid = CompOption::getIntOptionNamed (options, "root");
- if (!ss->priv->grab)
+ if ((xid && ::screen->root () != xid) ||
+ !ss->priv->grab)
return false;
if (selectX != -1 &&
- selectY != -1)
- {
- if (!ss->priv->selectWindowAt (selectX, selectY, true))
+ selectY != -1 &&
+ !ss->priv->selectWindowAt (selectX, selectY, true))
return false;
- }
if (ss->priv->grabIndex)
{
@@ -1054,16 +1045,14 @@
}
}
- if (state & CompAction::StateCancel)
+ if (state & CompAction::StateCancel &&
+ ::screen->activeWindow () != ss->priv->previousActiveWindow)
{
- if (::screen->activeWindow () != ss->priv->previousActiveWindow)
- {
- CompWindow *w;
+ CompWindow *w;
- w = ::screen->findWindow (ss->priv->previousActiveWindow);
- if (w)
- w->moveInputFocusTo ();
- }
+ w = ::screen->findWindow (ss->priv->previousActiveWindow);
+ if (w)
+ w->moveInputFocusTo ();
}
else if (ss->priv->state != ScaleScreen::In)
{
@@ -1121,21 +1110,21 @@
CompAction::State state)
{
if (state & EDGE_STATE)
- return TRUE;
+ return true;
if (state & (CompAction::StateInitKey | CompAction::StateTermKey))
{
if (optionGetKeyBindingsToggle ())
- return TRUE;
+ return true;
else if (!action->key ().modifiers ())
- return TRUE;
+ return true;
}
- if (state & (CompAction::StateInitButton | CompAction::StateTermButton))
- if (optionGetButtonBindingsToggle ())
- return TRUE;
+ if (state & (CompAction::StateInitButton | CompAction::StateTermButton) &&
+ optionGetButtonBindingsToggle ())
+ return true;
- return FALSE;
+ return false;
}
bool
@@ -1144,9 +1133,7 @@
CompOption::Vector &options,
ScaleType type)
{
- Window xid;
-
- xid = CompOption::getIntOptionNamed (options, "root");
+ Window xid = CompOption::getIntOptionNamed (options, "root");
if (::screen->root () == xid)
{
@@ -1154,13 +1141,11 @@
if (ss->priv->actionShouldToggle (action, state) &&
(ss->priv->state == ScaleScreen::Wait ||
- ss->priv->state == ScaleScreen::Out))
- {
- if (ss->priv->type == type)
- return scaleTerminate (action,
- CompAction::StateCancel,
- options);
- }
+ ss->priv->state == ScaleScreen::Out ) &&
+ ss->priv->type == type)
+ return scaleTerminate (action,
+ CompAction::StateCancel,
+ options);
else
{
ss->priv->type = type;
@@ -1196,14 +1181,13 @@
if (!grab)
{
- if (state & CompAction::StateInitEdgeDnd)
- {
- if (ensureDndRedirectWindow ())
- grab = true;
- }
+ if (state & CompAction::StateInitEdgeDnd &&
+ ensureDndRedirectWindow ())
+ grab = true;
else if (!grabIndex)
{
grabIndex = screen->pushGrab (cursor, "scale");
+
if (grabIndex)
grab = true;
}
@@ -1218,13 +1202,11 @@
bool found_active = false;
foreach (ScaleWindow *sw, windows)
- {
if (sw->window->id() == active_window)
{
found_active = true;
break;
}
- }
if (!found_active)
active_window = None;
@@ -1254,9 +1236,7 @@
if ((state & (CompAction::StateInitButton | EDGE_STATE)) ==
CompAction::StateInitButton)
- {
action->setState (action->state () | CompAction::StateTermButton);
- }
if (state & CompAction::StateInitKey)
action->setState (action->state () | CompAction::StateTermKey);
@@ -1381,6 +1361,7 @@
bool moveInputFocus)
{
ScaleWindow *w = checkForWindowAt (x, y);
+
if (w && w->priv->isScaleWin ())
{
w->scaleSelectWindow ();
@@ -1421,6 +1402,7 @@
CompWindow *focus = NULL;
active = screen->findWindow (screen->activeWindow ());
+
if (active)
{
SCALE_WINDOW (active);
@@ -1428,10 +1410,10 @@
if (sw->priv->slot)
{
ScaleSlot *slot;
- int x, y, cx, cy, d, min = MAXSHORT;
+ int x, y, d, min = MAXSHORT;
- cx = (sw->priv->slot->x1 () + sw->priv->slot->x2 ()) / 2;
- cy = (sw->priv->slot->y1 () + sw->priv->slot->y2 ()) / 2;
+ int cx = (sw->priv->slot->x1 () + sw->priv->slot->x2 ()) / 2;
+ int cy = (sw->priv->slot->y1 () + sw->priv->slot->y2 ()) / 2;
foreach (CompWindow *w, screen->windows ())
{
@@ -1510,7 +1492,6 @@
return;
foreach (ScaleWindow *lw, windows)
- {
if (lw->priv->window == w)
{
if (layoutThumbs ())
@@ -1538,7 +1519,6 @@
break;
}
}
- }
}
bool
@@ -1550,6 +1530,7 @@
CompOption::Vector o (0);
w = screen->findWindow (selectedWindow);
+
if (w)
{
lastActiveNum = w->activeNum ();
@@ -1573,7 +1554,8 @@
{
CompWindow *w = NULL;
- switch (event->type) {
+ switch (event->type)
+ {
case KeyPress:
if (screen->root () == event->xkey.root)
{
@@ -1589,7 +1571,9 @@
moveFocusWindow (0, 1);
}
}
+
break;
+
case ButtonPress:
if (screen->root () == event->xbutton.root &&
grabIndex &&
@@ -1617,35 +1601,43 @@
if (workArea.contains (pointer))
{
+// if (!screen->inShowDesktopMode ())
+// {
scaleTerminate (&optionGetInitiateEdge (), 0, o);
scaleTerminate (&optionGetInitiateKey (), 0, o);
screen->enterShowDesktopMode ();
+// }
+// else
+// {
+// screen->leaveShowDesktopMode ();
+// }
}
}
}
+
break;
+
case MotionNotify:
if (screen->root () == event->xmotion.root &&
grabIndex &&
state != ScaleScreen::In)
- {
selectWindowAt (event->xmotion.x_root, event->xmotion.y_root);
- }
+
break;
+
case DestroyNotify:
-
/* We need to get the CompWindow * for event->xdestroywindow.window
* here because in the ::handleEvent call below that CompWindow's
* id will become "1" so CompScreen::findWindow won't
- * be able to find teh window after that
+ * be able to find the window after that
*/
-
w = screen->findWindow (event->xdestroywindow.window);
break;
+
case UnmapNotify:
-
w = screen->findWindow (event->xunmap.window);
break;
+
case ClientMessage:
if (event->xclient.message_type == Atoms::xdndPosition)
{
@@ -1662,9 +1654,7 @@
ScaleWindow *sw = checkForWindowAt (pointerX, pointerY);
if (sw && sw->priv->isScaleWin ())
{
- int time;
-
- time = optionGetHoverTime ();
+ int time = optionGetHoverTime ();
if (hover.active ())
{
@@ -1675,17 +1665,12 @@
}
if (!hover.active ())
- {
hover.start (time, (float) time * 1.2);
- }
selectWindowAt (pointerX, pointerY);
}
- else
- {
- if (hover.active ())
- hover.stop ();
- }
+ else if (hover.active ())
+ hover.stop ();
}
}
}
@@ -1693,21 +1678,21 @@
event->xclient.message_type == Atoms::xdndLeave)
{
w = screen->findWindow (event->xclient.window);
- if (w)
+ if (w &&
+ grab &&
+ state != ScaleScreen::In &&
+ w->id () == dndTarget)
{
- if (grab &&
- state != ScaleScreen::In &&
- w->id () == dndTarget)
- {
- CompOption::Vector o (0);
- o.push_back (CompOption ("root", CompOption::TypeInt));
- o[0].value ().set ((int) screen->root ());
+ CompOption::Vector o (0);
+ o.push_back (CompOption ("root", CompOption::TypeInt));
+ o[0].value ().set ((int) screen->root ());
- scaleTerminate (&optionGetInitiateEdge (), 0, o);
- scaleTerminate (&optionGetInitiateKey (), 0, o);
- }
+ scaleTerminate (&optionGetInitiateEdge (), 0, o);
+ scaleTerminate (&optionGetInitiateKey (), 0, o);
}
}
+ break;
+
default:
break;
}
@@ -1718,11 +1703,13 @@
* handled, so that we don't get race conditions on calls
* to scale functions */
- switch (event->type) {
+ switch (event->type)
+ {
case UnmapNotify:
if (w)
windowRemove (w);
break;
+
case DestroyNotify:
if (w)
windowRemove (w);
@@ -1736,25 +1723,18 @@
{
bool status = false;
- if (initial)
+ if (initial &&
+ spScreen->grab && isScaleWin () &&
+ spScreen->layoutThumbs ())
{
- if (spScreen->grab && isScaleWin ())
- {
- if (spScreen->layoutThumbs ())
- {
- spScreen->state = ScaleScreen::Out;
- spScreen->cScreen->damageScreen ();
- }
- }
+ spScreen->state = ScaleScreen::Out;
+ spScreen->cScreen->damageScreen ();
}
- else if (spScreen->state == ScaleScreen::Wait)
+ else if (spScreen->state == ScaleScreen::Wait && slot)
{
- if (slot)
- {
- cWindow->damageTransformedRect (scale, scale, tx, ty, rect);
+ cWindow->damageTransformedRect (scale, scale, tx, ty, rect);
- status = true;
- }
+ status = true;
}
status |= cWindow->damageRect (initial, rect);
@@ -1883,7 +1863,6 @@
return optionGetMultioutputMode ();
}
-
PrivateScaleWindow::PrivateScaleWindow (CompWindow *w) :
window (w),
cWindow (CompositeWindow::get (w)),
@@ -1933,6 +1912,7 @@
bool
ScalePluginVTable::init ()
{
+<<<<<<< TREE
if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
@@ -1945,6 +1925,18 @@
}
return false;
+=======
+ CompPrivate p;
+ p.uval = COMPIZ_SCALE_ABI;
+ screen->storeValue ("scale_ABI", p);
+
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
+ CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
+ CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
+ return true;
+
+ return false;
+>>>>>>> MERGE-SOURCE
}
void
=== modified file 'plugins/scaleaddon/src/scaleaddon.cpp'
--- plugins/scaleaddon/src/scaleaddon.cpp 2013-05-14 13:13:46 +0000
+++ plugins/scaleaddon/src/scaleaddon.cpp 2013-07-21 23:03:28 +0000
@@ -130,13 +130,13 @@
glGetIntegerv (GL_BLEND_SRC_ALPHA, &oldBlendSrcAlpha);
glGetIntegerv (GL_BLEND_DST_ALPHA, &oldBlendDstAlpha);
#else
- GLboolean wasBlend = glIsEnabled (GL_BLEND);
glGetIntegerv (GL_BLEND_SRC, &oldBlendSrc);
glGetIntegerv (GL_BLEND_DST, &oldBlendDst);
- if (!wasBlend)
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
glEnable (GL_BLEND);
-
#endif
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -172,7 +172,7 @@
glBlendFuncSeparate (oldBlendSrc, oldBlendDst,
oldBlendSrcAlpha, oldBlendDstAlpha);
#else
- if (!wasBlend)
+ if (glBlendEnabled)
glDisable (GL_BLEND);
glBlendFunc (oldBlendSrc, oldBlendDst);
#endif
@@ -287,8 +287,43 @@
o.push_back (CompOption ("root", CompOption::TypeInt));
o[0].value ().set ((int) screen->root ());
- opt = CompOption::findOption (sScreen->getOptions (), "initiate_key", 0);
-
+<<<<<<< TREE
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_key", 0);
+
+=======
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_key", 0);
+
+ /* If the user has no initiate_key defined we gotta continue to search
+ * until we find a way to exit. We test them all to ensure that we always
+ * have a exit strategy as one of the following has to be defined.
+ */
+ if (!opt)
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_edge", 0);
+ if (!opt)
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_button", 0);
+ if (!opt)
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_all_key", 0);
+ if (!opt)
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_all_edge", 0);
+ if (!opt)
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_all_button", 0);
+ if (!opt)
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_group_key", 0);
+ if (!opt)
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_group_edge", 0);
+ if (!opt)
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_group_button", 0);
+ if (!opt)
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_output_key", 0);
+ if (!opt)
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_output_edge", 0);
+ if (!opt)
+ opt = CompOption::findOption (sScreen->getOptions (), "initiate_output_button", 0);
+
+ /* Now we can be sure that opt is not empty anymore, otherwise the user
+ * would not have been able to enter scale mode at all */
+
+>>>>>>> MERGE-SOURCE
action = &opt->value ().action ();
if (action->terminate ())
=== modified file 'plugins/scalefilter/src/scalefilter.cpp'
--- plugins/scalefilter/src/scalefilter.cpp 2013-05-09 13:43:07 +0000
+++ plugins/scalefilter/src/scalefilter.cpp 2013-07-21 23:03:28 +0000
@@ -265,7 +265,7 @@
foreach (ScaleWindow *sw, sScreen->getWindows ())
{
if (persistentMatch.evaluate (sw->window))
- count++;
+ ++count;
if (count > 1)
{
=== modified file 'plugins/screenshot/src/screenshot.cpp'
--- plugins/screenshot/src/screenshot.cpp 2013-05-09 13:43:07 +0000
+++ plugins/screenshot/src/screenshot.cpp 2013-07-21 23:03:28 +0000
@@ -153,229 +153,462 @@
{
if (!mGrabIndex)
{
- /* Taking screenshot, enable full paint on
- * this frame */
-
- outputs.clear ();
- outputs.push_back (&screen->fullscreenOutput ());
- }
- }
-
- cScreen->paint (outputs, mask);
-}
-
-namespace
-{
- bool paintSelectionRectangleFill (const CompRect &rect,
- unsigned short *fillColor,
- GLVertexBuffer *streamingBuffer,
- const GLMatrix &transform)
- {
- GLfloat vertexData[12];
- GLushort colorData[4];
-
- int x1 = rect.x1 ();
- int y1 = rect.y1 ();
- int x2 = rect.x2 ();
- int y2 = rect.y2 ();
-
- const float MaxUShortFloat = std::numeric_limits ::max ();
-
- /* draw filled rectangle */
- float alpha = fillColor[3] / MaxUShortFloat;
-
- colorData[0] = alpha * fillColor[0];
- colorData[1] = alpha * fillColor[1];
- colorData[2] = alpha * fillColor[2];
- colorData[3] = alpha * MaxUShortFloat;
-
- vertexData[0] = x1;
- vertexData[1] = y1;
- vertexData[2] = 0.0f;
- vertexData[3] = x1;
- vertexData[4] = y2;
- vertexData[5] = 0.0f;
- vertexData[6] = x2;
- vertexData[7] = y1;
- vertexData[8] = 0.0f;
- vertexData[9] = x2;
- vertexData[10] = y2;
- vertexData[11] = 0.0f;
-
- streamingBuffer->begin (GL_TRIANGLE_STRIP);
-
- streamingBuffer->addColors (1, colorData);
- streamingBuffer->addVertices (4, vertexData);
-
- if (streamingBuffer->end ())
- {
- glEnable (GL_BLEND);
-
- streamingBuffer->render (transform);
-
- glDisable (GL_BLEND);
-
- return true;
- }
-
- return false;
- }
-
- bool paintSelectionRectangleOutline (const CompRect &rect,
- unsigned short *outlineColor,
- GLVertexBuffer *streamingBuffer,
- const GLMatrix &transform)
- {
- GLfloat vertexData[12];
- GLushort colorData[4];
-
- int x1 = rect.x1 ();
- int y1 = rect.y1 ();
- int x2 = rect.x2 ();
- int y2 = rect.y2 ();
-
- const float MaxUShortFloat = std::numeric_limits ::max ();
-
- /* draw outline */
- float alpha = outlineColor[3] / MaxUShortFloat;
-
- colorData[0] = alpha * outlineColor[0];
- colorData[1] = alpha * outlineColor[1];
- colorData[2] = alpha * outlineColor[2];
- colorData[3] = alpha * MaxUShortFloat;
-
- vertexData[0] = x1;
- vertexData[1] = y1;
- vertexData[2] = 0.0f;
- vertexData[3] = x1;
- vertexData[4] = y2;
- vertexData[5] = 0.0f;
- vertexData[6] = x2;
- vertexData[7] = y2;
- vertexData[8] = 0.0f;
- vertexData[9] = x2;
- vertexData[10] = y1;
- vertexData[11] = 0.0f;
-
- streamingBuffer->begin (GL_LINE_LOOP);
-
- streamingBuffer->addColors (1, colorData);
- streamingBuffer->addVertices (4, vertexData);
-
- if (streamingBuffer->end ())
- {
- glEnable (GL_BLEND);
- glLineWidth (2.0);
-
- streamingBuffer->render (transform);
-
- glDisable (GL_BLEND);
-
- return true;
- }
-
- return false;
- }
-
- void
- ensureDirectoryForImage (CompString &directory)
- {
- /* If dir is empty, use user's desktop directory instead */
- if (directory.length () == 0)
- directory = getXDGUserDir (XDGUserDirDesktop);
- }
-
- int
- getImageNumberFromDirectory (const CompString &directory)
- {
- struct dirent **namelist;
-
- int n = scandir (directory.c_str (), &namelist, shotFilter, shotSort);
-
- if (n >= 0)
- {
- int number = 0;
-
- if (n > 0)
- sscanf (namelist[n - 1]->d_name,
- "screenshot%d.png",
- &number);
-
- ++number;
-
- if (n)
- free (namelist);
-
- return number;
- }
- else
- {
- perror ("scandir");
- return 0;
- }
- }
-
- CompString
- getImageAbsolutePath (const CompString &directory,
- int number)
- {
- std::stringstream ss;
- ss << directory << "/screenshot" << number << ".png";
- return ss.str ();
- }
-
- bool
- saveBuffer (const boost::scoped_array &buffer,
- int w,
- int h,
- const CompString &path)
- {
- CompSize imageSize (w, h);
-
- if (!::screen->writeImageToFile (const_cast (path),
- "png",
- imageSize,
- buffer.get ()))
- {
- compLogMessage ("screenshot", CompLogLevelError,
- "failed to write screenshot image");
- return false;
- }
-
- return true;
- }
-
- bool
- launchApplicationAndTakeScreenshot (const CompString &app,
- const CompString &directory)
- {
- if (app.length () > 0)
- {
- ::screen->runCommand (app + " " + directory);
- return true;
- }
-
- return false;
- }
-
- bool
- readFromGPUBufferToCPUBuffer (const CompRect &rect,
- boost::scoped_array &buffer)
- {
- int x1 = rect.x1 ();
- int y1 = rect.y1 ();
- int x2 = rect.x2 ();
- int y2 = rect.y2 ();
-
- int w = x2 - x1;
- int h = y2 - y1;
-
- if (w && h)
- {
- size_t size = w * h * 4;
- buffer.reset (new GLubyte[size]);
-
- if (buffer.get ())
+<<<<<<< TREE
+ /* Taking screenshot, enable full paint on
+ * this frame */
+
+ outputs.clear ();
+ outputs.push_back (&screen->fullscreenOutput ());
+ }
+ }
+
+ cScreen->paint (outputs, mask);
+}
+
+namespace
+{
+ bool paintSelectionRectangleFill (const CompRect &rect,
+ unsigned short *fillColor,
+ GLVertexBuffer *streamingBuffer,
+ const GLMatrix &transform)
+ {
+ GLfloat vertexData[12];
+ GLushort colorData[4];
+
+ int x1 = rect.x1 ();
+ int y1 = rect.y1 ();
+ int x2 = rect.x2 ();
+ int y2 = rect.y2 ();
+
+ const float MaxUShortFloat = std::numeric_limits ::max ();
+
+ /* draw filled rectangle */
+ float alpha = fillColor[3] / MaxUShortFloat;
+
+ colorData[0] = alpha * fillColor[0];
+ colorData[1] = alpha * fillColor[1];
+ colorData[2] = alpha * fillColor[2];
+ colorData[3] = alpha * MaxUShortFloat;
+
+ vertexData[0] = x1;
+ vertexData[1] = y1;
+ vertexData[2] = 0.0f;
+ vertexData[3] = x1;
+ vertexData[4] = y2;
+ vertexData[5] = 0.0f;
+ vertexData[6] = x2;
+ vertexData[7] = y1;
+ vertexData[8] = 0.0f;
+ vertexData[9] = x2;
+ vertexData[10] = y2;
+ vertexData[11] = 0.0f;
+
+ streamingBuffer->begin (GL_TRIANGLE_STRIP);
+
+ streamingBuffer->addColors (1, colorData);
+ streamingBuffer->addVertices (4, vertexData);
+
+ if (streamingBuffer->end ())
+ {
+ glEnable (GL_BLEND);
+
+ streamingBuffer->render (transform);
+
+ glDisable (GL_BLEND);
+
+ return true;
+ }
+
+ return false;
+ }
+
+ bool paintSelectionRectangleOutline (const CompRect &rect,
+ unsigned short *outlineColor,
+ GLVertexBuffer *streamingBuffer,
+ const GLMatrix &transform)
+ {
+ GLfloat vertexData[12];
+ GLushort colorData[4];
+
+ int x1 = rect.x1 ();
+ int y1 = rect.y1 ();
+ int x2 = rect.x2 ();
+ int y2 = rect.y2 ();
+
+ const float MaxUShortFloat = std::numeric_limits ::max ();
+
+ /* draw outline */
+ float alpha = outlineColor[3] / MaxUShortFloat;
+
+ colorData[0] = alpha * outlineColor[0];
+ colorData[1] = alpha * outlineColor[1];
+ colorData[2] = alpha * outlineColor[2];
+ colorData[3] = alpha * MaxUShortFloat;
+
+ vertexData[0] = x1;
+ vertexData[1] = y1;
+ vertexData[2] = 0.0f;
+ vertexData[3] = x1;
+ vertexData[4] = y2;
+ vertexData[5] = 0.0f;
+ vertexData[6] = x2;
+ vertexData[7] = y2;
+ vertexData[8] = 0.0f;
+ vertexData[9] = x2;
+ vertexData[10] = y1;
+ vertexData[11] = 0.0f;
+
+ streamingBuffer->begin (GL_LINE_LOOP);
+
+ streamingBuffer->addColors (1, colorData);
+ streamingBuffer->addVertices (4, vertexData);
+
+ if (streamingBuffer->end ())
+ {
+ glEnable (GL_BLEND);
+ glLineWidth (2.0);
+
+ streamingBuffer->render (transform);
+
+ glDisable (GL_BLEND);
+
+ return true;
+ }
+
+ return false;
+ }
+
+ void
+ ensureDirectoryForImage (CompString &directory)
+ {
+ /* If dir is empty, use user's desktop directory instead */
+ if (directory.length () == 0)
+ directory = getXDGUserDir (XDGUserDirDesktop);
+ }
+
+ int
+ getImageNumberFromDirectory (const CompString &directory)
+ {
+ struct dirent **namelist;
+
+ int n = scandir (directory.c_str (), &namelist, shotFilter, shotSort);
+
+ if (n >= 0)
+ {
+ int number = 0;
+
+ if (n > 0)
+ sscanf (namelist[n - 1]->d_name,
+ "screenshot%d.png",
+ &number);
+
+ ++number;
+
+ if (n)
+ free (namelist);
+
+ return number;
+ }
+ else
+ {
+ perror ("scandir");
+ return 0;
+ }
+ }
+
+ CompString
+ getImageAbsolutePath (const CompString &directory,
+ int number)
+ {
+ std::stringstream ss;
+ ss << directory << "/screenshot" << number << ".png";
+ return ss.str ();
+ }
+
+ bool
+ saveBuffer (const boost::scoped_array &buffer,
+ int w,
+ int h,
+ const CompString &path)
+ {
+ CompSize imageSize (w, h);
+
+ if (!::screen->writeImageToFile (const_cast (path),
+ "png",
+ imageSize,
+ buffer.get ()))
+ {
+ compLogMessage ("screenshot", CompLogLevelError,
+ "failed to write screenshot image");
+ return false;
+ }
+
+ return true;
+ }
+
+ bool
+ launchApplicationAndTakeScreenshot (const CompString &app,
+ const CompString &directory)
+ {
+ if (app.length () > 0)
+ {
+ ::screen->runCommand (app + " " + directory);
+ return true;
+ }
+
+ return false;
+ }
+
+ bool
+ readFromGPUBufferToCPUBuffer (const CompRect &rect,
+ boost::scoped_array &buffer)
+ {
+ int x1 = rect.x1 ();
+ int y1 = rect.y1 ();
+ int x2 = rect.x2 ();
+ int y2 = rect.y2 ();
+
+ int w = x2 - x1;
+ int h = y2 - y1;
+
+ if (w && h)
+ {
+ size_t size = w * h * 4;
+ buffer.reset (new GLubyte[size]);
+
+ if (buffer.get ())
+=======
+ /* Taking screenshot, enable full paint on
+ * this frame */
+
+ outputs.clear ();
+ outputs.push_back (&screen->fullscreenOutput ());
+ }
+ }
+
+ cScreen->paint (outputs, mask);
+}
+
+namespace
+{
+ bool paintSelectionRectangleFill (const CompRect &rect,
+ unsigned short *fillColor,
+ GLVertexBuffer *streamingBuffer,
+ const GLMatrix &transform)
+ {
+ GLfloat vertexData[12];
+ GLushort colorData[4];
+
+ int x1 = rect.x1 ();
+ int y1 = rect.y1 ();
+ int x2 = rect.x2 ();
+ int y2 = rect.y2 ();
+
+ const float MaxUShortFloat = std::numeric_limits ::max ();
+
+ /* draw filled rectangle */
+ float alpha = fillColor[3] / MaxUShortFloat;
+
+ colorData[0] = alpha * fillColor[0];
+ colorData[1] = alpha * fillColor[1];
+ colorData[2] = alpha * fillColor[2];
+ colorData[3] = alpha * MaxUShortFloat;
+
+ vertexData[0] = x1;
+ vertexData[1] = y1;
+ vertexData[2] = 0.0f;
+ vertexData[3] = x1;
+ vertexData[4] = y2;
+ vertexData[5] = 0.0f;
+ vertexData[6] = x2;
+ vertexData[7] = y1;
+ vertexData[8] = 0.0f;
+ vertexData[9] = x2;
+ vertexData[10] = y2;
+ vertexData[11] = 0.0f;
+
+ streamingBuffer->begin (GL_TRIANGLE_STRIP);
+
+ streamingBuffer->addColors (1, colorData);
+ streamingBuffer->addVertices (4, vertexData);
+
+ if (streamingBuffer->end ())
+ {
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
+ streamingBuffer->render (transform);
+
+ glDisable (GL_BLEND);
+
+ return true;
+ }
+
+ return false;
+ }
+
+ bool paintSelectionRectangleOutline (const CompRect &rect,
+ unsigned short *outlineColor,
+ GLVertexBuffer *streamingBuffer,
+ const GLMatrix &transform)
+ {
+ GLfloat vertexData[12];
+ GLushort colorData[4];
+
+ int x1 = rect.x1 ();
+ int y1 = rect.y1 ();
+ int x2 = rect.x2 ();
+ int y2 = rect.y2 ();
+
+ const float MaxUShortFloat = std::numeric_limits ::max ();
+
+ /* draw outline */
+ float alpha = outlineColor[3] / MaxUShortFloat;
+
+ colorData[0] = alpha * outlineColor[0];
+ colorData[1] = alpha * outlineColor[1];
+ colorData[2] = alpha * outlineColor[2];
+ colorData[3] = alpha * MaxUShortFloat;
+
+ vertexData[0] = x1;
+ vertexData[1] = y1;
+ vertexData[2] = 0.0f;
+ vertexData[3] = x1;
+ vertexData[4] = y2;
+ vertexData[5] = 0.0f;
+ vertexData[6] = x2;
+ vertexData[7] = y2;
+ vertexData[8] = 0.0f;
+ vertexData[9] = x2;
+ vertexData[10] = y1;
+ vertexData[11] = 0.0f;
+
+ streamingBuffer->begin (GL_LINE_LOOP);
+
+ streamingBuffer->addColors (1, colorData);
+ streamingBuffer->addVertices (4, vertexData);
+
+ if (streamingBuffer->end ())
+ {
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
+ glLineWidth (2.0);
+
+ streamingBuffer->render (transform);
+
+ glDisable (GL_BLEND);
+
+ return true;
+ }
+
+ return false;
+ }
+
+ void
+ ensureDirectoryForImage (CompString &directory)
+ {
+ /* If dir is empty, use user's desktop directory instead */
+ if (directory.length () == 0)
+ directory = getXDGUserDir (XDGUserDirDesktop);
+ }
+
+ int
+ getImageNumberFromDirectory (const CompString &directory)
+ {
+ struct dirent **namelist;
+
+ int n = scandir (directory.c_str (), &namelist, shotFilter, shotSort);
+
+ if (n >= 0)
+ {
+ int number = 0;
+
+ if (n > 0)
+ sscanf (namelist[n - 1]->d_name,
+ "screenshot%d.png",
+ &number);
+
+ ++number;
+
+ if (n)
+ free (namelist);
+
+ return number;
+ }
+ else
+ {
+ perror ("scandir");
+ return 0;
+ }
+ }
+
+ CompString
+ getImageAbsolutePath (const CompString &directory,
+ int number)
+ {
+ std::stringstream ss;
+ ss << directory << "/screenshot" << number << ".png";
+ return ss.str ();
+ }
+
+ bool
+ saveBuffer (const boost::scoped_array &buffer,
+ int w,
+ int h,
+ const CompString &path)
+ {
+ CompSize imageSize (w, h);
+
+ if (!::screen->writeImageToFile (const_cast (path),
+ "png",
+ imageSize,
+ buffer.get ()))
+ {
+ compLogMessage ("screenshot", CompLogLevelError,
+ "failed to write screenshot image");
+ return false;
+ }
+
+ return true;
+ }
+
+ bool
+ launchApplicationAndTakeScreenshot (const CompString &app,
+ const CompString &directory)
+ {
+ if (app.length () > 0)
+ {
+ ::screen->runCommand (app + " " + directory);
+ return true;
+ }
+
+ return false;
+ }
+
+ bool
+ readFromGPUBufferToCPUBuffer (const CompRect &rect,
+ boost::scoped_array &buffer)
+ {
+ int x1 = rect.x1 ();
+ int y1 = rect.y1 ();
+ int x2 = rect.x2 ();
+ int y2 = rect.y2 ();
+
+ int w = x2 - x1;
+ int h = y2 - y1;
+
+ if (w && h)
+ {
+ size_t size = w * h * 4;
+ buffer.reset (new GLubyte[size]);
+
+ if (buffer.get ())
+>>>>>>> MERGE-SOURCE
{
GLint drawBinding = 0;
GLint readBinding = 0;
@@ -402,6 +635,7 @@
return true;
}
+<<<<<<< TREE
}
return false;
@@ -441,6 +675,44 @@
return success;
+=======
+ }
+
+ return false;
+ }
+
+ /* We need to take directory by copy because
+ * it may be modified later */
+ bool saveScreenshot (CompRect rect,
+ CompString directory,
+ const CompString &alternativeApplication)
+ {
+ ensureDirectoryForImage (directory);
+
+ int number = getImageNumberFromDirectory (directory);
+ CompString path = getImageAbsolutePath (directory, number);
+
+ boost::scoped_array buffer;
+
+ bool success = readFromGPUBufferToCPUBuffer (rect,
+ buffer);
+
+ if (success)
+ {
+ success = saveBuffer (buffer,
+ rect.width (),
+ rect.height (), path);
+ }
+ else
+ compLogMessage ("screenshot", CompLogLevelWarn, "glReadPixels failed");
+
+ if (!success)
+ success = launchApplicationAndTakeScreenshot (alternativeApplication,
+ directory);
+
+ return success;
+
+>>>>>>> MERGE-SOURCE
}
}
@@ -455,6 +727,7 @@
if (status && mGrab)
{
+<<<<<<< TREE
/* We just want to draw the screenshot selection box if
* we are grabbed, the size has changed and the CCSM
* option to draw it is enabled. */
@@ -494,6 +767,41 @@
optionGetLaunchApp ());
cScreen->paintSetEnabled (this, false);
gScreen->glPaintOutputSetEnabled (this, false);
+=======
+ /* We just want to draw the screenshot selection box if
+ * we are grabbed and the CCSM option to draw it is enabled. */
+
+ CompRect selectionRect (std::min (mX1, mX2),
+ std::min (mY1, mY2),
+ std::abs (mX2 - mX1),
+ std::abs (mY2 - mY1));
+
+ if (mGrabIndex &&
+ optionGetDrawSelectionIndicator ())
+ {
+ GLMatrix transform (matrix);
+ GLVertexBuffer *streamingBuffer (GLVertexBuffer::streamingBuffer ());
+ transform.toScreenSpace (output, -DEFAULT_Z_CAMERA);
+
+ paintSelectionRectangleFill (selectionRect,
+ optionGetSelectionFillColor (),
+ streamingBuffer,
+ transform);
+
+ paintSelectionRectangleOutline (selectionRect,
+ optionGetSelectionOutlineColor (),
+ streamingBuffer,
+ transform);
+ }
+ else if (!mGrabIndex)
+ {
+ /* Taking a screenshot */
+ saveScreenshot (selectionRect,
+ optionGetDirectory (),
+ optionGetLaunchApp ());
+ cScreen->paintSetEnabled (this, false);
+ gScreen->glPaintOutputSetEnabled (this, false);
+>>>>>>> MERGE-SOURCE
}
}
@@ -508,6 +816,7 @@
if (mGrabIndex &&
(mX2 != xRoot || mY2 != yRoot))
{
+<<<<<<< TREE
/* the size has changed now */
selectionSizeChanged = true;
@@ -515,6 +824,12 @@
int y1 = MIN (mY1, mY2) - 1;
int x2 = MAX (mX1, mX2) + 1;
int y2 = MAX (mY1, mY2) + 1;
+=======
+ int x1 = MIN (mX1, mX2) - 1;
+ int y1 = MIN (mY1, mY2) - 1;
+ int x2 = MAX (mX1, mX2) + 1;
+ int y2 = MAX (mY1, mY2) + 1;
+>>>>>>> MERGE-SOURCE
cScreen->damageRegion (CompRegion (x1, y1, x2 - x1, y2 - y1));
=== modified file 'plugins/screenshot/src/screenshot.h'
--- plugins/screenshot/src/screenshot.h 2013-04-24 11:38:36 +0000
+++ plugins/screenshot/src/screenshot.h 2013-07-21 23:03:28 +0000
@@ -46,29 +46,40 @@
bool initiate (CompAction *action,
CompAction::State state,
CompOption::Vector &options);
+
bool terminate (CompAction *action,
CompAction::State state,
CompOption::Vector &options);
+
void handleMotionEvent (int xRoot,
int yRoot);
void handleEvent (XEvent *event);
+
bool glPaintOutput (const GLScreenPaintAttrib &attrib,
const GLMatrix &matrix,
const CompRegion ®ion,
CompOutput *output,
unsigned int mask);
+
void paint (CompOutput::ptrList &outputs,
unsigned int mask);
- CompositeScreen *cScreen;
- GLScreen *gScreen;
+ CompositeScreen *cScreen;
+ GLScreen *gScreen;
CompScreen::GrabHandle mGrabIndex;
+<<<<<<< TREE
bool mGrab;
bool selectionSizeChanged;
+=======
+ bool mGrab;
+>>>>>>> MERGE-SOURCE
- int mX1, mY1, mX2, mY2;
+ int mX1;
+ int mY1;
+ int mX2;
+ int mY2;
};
class ShotPluginVTable :
=== modified file 'plugins/session/src/session.cpp'
--- plugins/session/src/session.cpp 2013-05-09 13:43:07 +0000
+++ plugins/session/src/session.cpp 2013-07-21 23:03:28 +0000
@@ -39,14 +39,14 @@
CompString& string)
{
Atom type;
- int format, result;
+ int format;
unsigned long nItems, bytesAfter;
char *val;
bool retval = false;
- result = XGetWindowProperty (screen->dpy (), id, atom, 0L, 65536, False,
- Atoms::utf8String, &type, &format, &nItems,
- &bytesAfter, (unsigned char **) &val);
+ int result = XGetWindowProperty (screen->dpy (), id, atom, 0L, 65536, False,
+ Atoms::utf8String, &type, &format, &nItems,
+ &bytesAfter, (unsigned char **) &val);
if (result != Success)
return false;
@@ -78,7 +78,6 @@
text.nitems = 0;
if (XGetTextProperty (screen->dpy (), id, &text, atom))
- {
if (text.value)
{
char valueString[text.nitems + 1];
@@ -91,7 +90,6 @@
XFree (text.value);
}
- }
return retval;
}
@@ -144,13 +142,13 @@
SessionScreen::getIsEmbedded (Window id)
{
Atom type;
- int format, result;
+ int format;
unsigned long nitems, bytesAfter;
unsigned char *val;
- result = XGetWindowProperty (screen->dpy (), id, embedInfoAtom, 0L, 65536,
- false, XA_CARDINAL, &type, &format, &nitems,
- &bytesAfter, &val);
+ int result = XGetWindowProperty (screen->dpy (), id, embedInfoAtom, 0L, 65536,
+ false, XA_CARDINAL, &type, &format, &nitems,
+ &bytesAfter, &val);
if (result != Success)
return false;
@@ -166,9 +164,7 @@
Atom atom,
CompString& string)
{
- Window clientLeader;
-
- clientLeader = w->clientLeader ();
+ Window clientLeader = w->clientLeader ();
/* try to find clientLeader on transient parents */
if (!clientLeader)
@@ -266,19 +262,16 @@
{
CompString clientId, command, string;
CompString resName, resClass;
- xmlNodePtr node, childNode;
if (!getClientLeaderProperty (w, clientIdAtom, clientId) &&
!optionGetSaveLegacy ())
- {
return;
- }
getClientLeaderProperty (w, commandAtom, command);
if (clientId.empty () && command.empty ())
return;
- node = xmlNewChild (rootNode, NULL, BAD_CAST "window", NULL);
+ xmlNodePtr node = xmlNewChild (rootNode, NULL, BAD_CAST "window", NULL);
if (!node)
return;
@@ -303,7 +296,7 @@
xmlNewProp (node, BAD_CAST "command", BAD_CAST command.c_str ());
/* save geometry, relative to viewport 0, 0 */
- childNode = xmlNewChild (node, NULL, BAD_CAST "geometry", NULL);
+ xmlNodePtr childNode = xmlNewChild (node, NULL, BAD_CAST "geometry", NULL);
if (childNode)
{
int x = (w->saveMask () & CWX) ? w->saveWc ().x : w->serverX ();
@@ -318,9 +311,9 @@
y -= w->border ().top;
int width = (w->saveMask () & CWWidth) ? w->saveWc ().width :
- w->serverWidth ();
+ w->serverWidth ();
int height = (w->saveMask () & CWHeight) ? w->saveWc ().height :
- w->serverHeight ();
+ w->serverHeight ();
addIntegerPropToNode (childNode, "x", x);
addIntegerPropToNode (childNode, "y", y);
@@ -374,8 +367,6 @@
bool
SessionScreen::createDir (const CompString& path)
{
- size_t pos;
-
if (mkdir (path.c_str (), 0700) == 0)
return true;
@@ -387,7 +378,7 @@
if (errno != ENOENT)
return false;
- pos = path.rfind ('/', path.size () - 1);
+ size_t pos = path.rfind ('/', path.size () - 1);
if (pos == CompString::npos)
return false;
@@ -492,9 +483,7 @@
if (!getClientLeaderProperty (w, clientIdAtom, clientId) &&
!optionGetSaveLegacy ())
- {
return false;
- }
getClientLeaderProperty (w, commandAtom, command);
getWindowTitle (w->id (), title);
@@ -592,9 +581,7 @@
void
SessionScreen::readState (xmlNodePtr root)
{
- xmlNodePtr cur, attrib;
-
- for (cur = root->xmlChildrenNode; cur; cur = cur->next)
+ for (xmlNodePtr cur = root->xmlChildrenNode; cur; cur = cur->next)
{
SessionItem item;
@@ -612,20 +599,16 @@
if (item.clientId.empty () && item.title.empty () &&
item.resName.empty () && item.resClass.empty ())
- {
continue;
- }
- for (attrib = cur->xmlChildrenNode; attrib; attrib = attrib->next)
+ for (xmlNodePtr attrib = cur->xmlChildrenNode; attrib; attrib = attrib->next)
{
if (xmlStrcmp (attrib->name, BAD_CAST "geometry") == 0)
{
- int x, y, width, height;
-
- x = getIntForProp (attrib, "x");
- y = getIntForProp (attrib, "y");
- width = getIntForProp (attrib, "width");
- height = getIntForProp (attrib, "height");
+ int x = getIntForProp (attrib, "x");
+ int y = getIntForProp (attrib, "y");
+ int width = getIntForProp (attrib, "width");
+ int height = getIntForProp (attrib, "height");
item.geometrySet = true;
item.geometry.setGeometry (x, x + width, y, y + height);
@@ -669,15 +652,13 @@
void
SessionScreen::loadState (const CompString& previousId)
{
- xmlDocPtr doc;
- xmlNodePtr root;
CompString fileName = getFileName (previousId);
- doc = xmlParseFile (fileName.c_str ());
+ xmlDocPtr doc = xmlParseFile (fileName.c_str ());
if (!doc)
return;
- root = xmlDocGetRootElement (doc);
+ xmlNodePtr root = xmlDocGetRootElement (doc);
if (root && xmlStrcmp (root->name, BAD_CAST "compiz_session") == 0)
readState (root);
@@ -705,13 +686,12 @@
screen->handleEvent (event);
if (event->type == MapRequest)
- {
if (w && !(state & CompWindowStateDemandsAttentionMask))
{
state = w->state () & ~CompWindowStateDemandsAttentionMask;
w->changeState (state);
}
- }
+
}
void
@@ -720,24 +700,24 @@
{
if (event == CompSession::EventSaveYourself)
{
- bool shutdown, fast, saveSession;
- int saveType, interactStyle;
CompString clientId;
- shutdown = CompOption::getBoolOptionNamed (arguments,
- "shutdown", false);
- saveType = CompOption::getIntOptionNamed (arguments,
- "save_type", SmSaveLocal);
- interactStyle = CompOption::getIntOptionNamed (arguments,
- "interact_style",
- SmInteractStyleNone);
- fast = CompOption::getBoolOptionNamed (arguments, "fast", false);
+ bool shutdown = CompOption::getBoolOptionNamed
+ (arguments, "shutdown", false);
+
+ int saveType = CompOption::getIntOptionNamed
+ (arguments, "save_type", SmSaveLocal);
+
+ int interactStyle = CompOption::getIntOptionNamed
+ (arguments, "interact_style", SmInteractStyleNone);
+
+ bool fast = CompOption::getBoolOptionNamed (arguments, "fast", false);
/* ignore saveYourself after registering for the first time
(SM specification 7.2) */
- saveSession = shutdown || fast ||
- (saveType != SmSaveLocal) ||
- (interactStyle != SmInteractStyleNone);
+ bool saveSession = shutdown || fast ||
+ (saveType != SmSaveLocal) ||
+ (interactStyle != SmInteractStyleNone);
if (saveSession)
clientId = CompSession::getClientId (CompSession::ClientId);
=== modified file 'plugins/shelf/src/shelf.h'
--- plugins/shelf/src/shelf.h 2012-09-07 23:29:42 +0000
+++ plugins/shelf/src/shelf.h 2013-07-21 23:03:28 +0000
@@ -43,14 +43,16 @@
#include "shelf_options.h"
-class ShelfedWindowInfo {
+class ShelfedWindowInfo
+{
public:
ShelfedWindowInfo (CompWindow *);
~ShelfedWindowInfo ();
public:
- CompWindow *w;
+
+ CompWindow *w;
Window ipw;
@@ -73,27 +75,30 @@
ShelfWindow (CompWindow *);
~ShelfWindow ();
- CompWindow *window;
- CompositeWindow *cWindow;
- GLWindow *gWindow;
+ CompWindow *window;
+ CompositeWindow *cWindow;
+ GLWindow *gWindow;
- float mScale;
- float targetScale;
- float steps;
+ float mScale;
+ float targetScale;
+ float steps;
ShelfedWindowInfo *info;
void
- moveNotify (int, int, bool);
+ moveNotify (int ,
+ int ,
+ bool );
bool
- damageRect (bool, const CompRect &);
+ damageRect (bool ,
+ const CompRect &);
bool
glPaint (const GLWindowPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
void
saveInputShape (XRectangle **rectRects,
@@ -147,16 +152,16 @@
ShelfScreen (CompScreen *);
~ShelfScreen ();
- CompositeScreen *cScreen;
- GLScreen *gScreen;
-
- CompScreen::GrabHandle grabIndex;
- Window grabbedWindow;
-
- Cursor moveCursor;
-
- unsigned int lastPointerX;
- unsigned int lastPointerY;
+ CompositeScreen *cScreen;
+ GLScreen *gScreen;
+
+ CompScreen::GrabHandle grabIndex;
+ Window grabbedWindow;
+
+ Cursor moveCursor;
+
+ unsigned int lastPointerX;
+ unsigned int lastPointerY;
std::list shelfedWindows;
@@ -168,10 +173,10 @@
bool
glPaintOutput (const GLScreenPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- CompOutput *,
- unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
void
donePaint ();
@@ -228,5 +233,6 @@
public CompPlugin::VTableForScreenAndWindow
{
public:
+
bool init ();
};
=== modified file 'plugins/shift/src/shift.cpp'
--- plugins/shift/src/shift.cpp 2013-05-11 09:30:49 +0000
+++ plugins/shift/src/shift.cpp 2013-07-21 23:03:28 +0000
@@ -62,7 +62,11 @@
}
void
+<<<<<<< TREE
ShiftScreen::activateEvent (bool activating)
+=======
+ShiftScreen::activateEvent (bool activating)
+>>>>>>> MERGE-SOURCE
{
CompOption::Vector o;
@@ -80,17 +84,26 @@
bool
ShiftWindow::isShiftable ()
{
+ if (window->overrideRedirect () ||
+ (window->wmType () & (CompWindowTypeDockMask | CompWindowTypeDesktopMask)))
+ return false;
+
SHIFT_SCREEN (screen);
+<<<<<<< TREE
if (window->overrideRedirect () ||
(window->wmType () & (CompWindowTypeDockMask | CompWindowTypeDesktopMask)))
return false;
+=======
+>>>>>>> MERGE-SOURCE
if (!window->mapNum () || !window->isViewable ())
{
if (ss->optionGetMinimized ())
{
- if (!window->minimized () && !window->inShowDesktopMode () && !window->shaded ())
+ if (!window->minimized () &&
+ !window->inShowDesktopMode () &&
+ !window->shaded ())
return false;
}
else
@@ -101,9 +114,15 @@
{
if (!window->mapNum () || !window->isViewable ())
{
+<<<<<<< TREE
if (window->serverGeometry ().x () + window->serverGeometry ().width () <= 0 ||
window->serverGeometry ().y () + window->serverGeometry ().height () <= 0 ||
window->serverGeometry ().x () >= screen->width () ||
+=======
+ if (window->serverGeometry ().x () + window->serverGeometry ().width () <= 0 ||
+ window->serverGeometry ().y () + window->serverGeometry ().height () <= 0 ||
+ window->serverGeometry ().x () >= screen->width () ||
+>>>>>>> MERGE-SOURCE
window->serverGeometry ().y () >= screen->height ())
return false;
}
@@ -134,7 +153,7 @@
return;
CompText::Attrib tA;
- CompRect oe;
+ CompRect oe;
freeWindowTitle ();
@@ -144,6 +163,7 @@
oe = screen->getCurrentOutputExtents ();
/* 75% of the output device as maximum width */
+<<<<<<< TREE
tA.maxWidth = oe.width () * 3 / 4;
tA.maxHeight = 100;
@@ -156,11 +176,25 @@
tA.flags = CompText::WithBackground | CompText::Ellipsized;
+=======
+ tA.maxWidth = oe.width () * 0.75;
+ tA.maxHeight = 100;
+
+ tA.family = "Sans";
+ tA.size = optionGetTitleFontSize ();
+ tA.color[0] = optionGetTitleFontColorRed ();
+ tA.color[1] = optionGetTitleFontColorGreen ();
+ tA.color[2] = optionGetTitleFontColorBlue ();
+ tA.color[3] = optionGetTitleFontColorAlpha ();
+
+ tA.flags = CompText::WithBackground | CompText::Ellipsized;
+
+>>>>>>> MERGE-SOURCE
if (optionGetTitleFontBold ())
tA.flags |= CompText::StyleBold;
- tA.bgHMargin = 15;
- tA.bgVMargin = 15;
+ tA.bgHMargin = 15;
+ tA.bgVMargin = 15;
tA.bgColor[0] = optionGetTitleBackColorRed ();
tA.bgColor[1] = optionGetTitleBackColorGreen ();
tA.bgColor[2] = optionGetTitleBackColorBlue ();
@@ -178,8 +212,13 @@
CompRect oe;
+<<<<<<< TREE
float width = text.getWidth ();
float height = text.getHeight ();
+=======
+ float width = text.getWidth ();
+ float height = text.getHeight ();
+>>>>>>> MERGE-SOURCE
if (optionGetMultioutputMode () == MultioutputModeOneBigSwitcher)
oe.setGeometry (0, 0, screen->width (), screen->height ());
@@ -232,11 +271,19 @@
CompWindowTypeDockMask)))
{
GLWindowPaintAttrib sAttrib = attrib;
+<<<<<<< TREE
bool scaled = false;
if (window->mapNum () &&
gWindow->textures ().empty ())
gWindow->bind ();
+=======
+ bool scaled = false;
+
+ if (window->mapNum () &&
+ gWindow->textures ().empty ())
+ gWindow->bind ();
+>>>>>>> MERGE-SOURCE
if (mActive)
scaled = (ss->mActiveSlot != NULL);
@@ -244,7 +291,7 @@
if (mOpacity > 0.01 && (ss->mActiveSlot == NULL))
{
sAttrib.brightness = sAttrib.brightness * mBrightness;
- sAttrib.opacity = sAttrib.opacity * mOpacity;
+ sAttrib.opacity = sAttrib.opacity * mOpacity;
}
else
mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
@@ -259,6 +306,7 @@
if (scaled && !gWindow->textures ().empty ())
{
GLWindowPaintAttrib wAttrib (attrib);
+<<<<<<< TREE
GLMatrix wTransform = transform;
ShiftSlot *slot = ss->mActiveSlot->slot;
@@ -271,13 +319,26 @@
float sscale;
float sopacity;
+=======
+ GLMatrix wTransform = transform;
+ ShiftSlot *slot = ss->mActiveSlot->slot;
+
+ float sx = ss->mAnim * slot->tx;
+ float sy = ss->mAnim * slot->ty;
+ float sz = ss->mAnim * slot->z;
+ float srot = ss->mAnim * slot->rotation;
+ float anim = MIN (1.0, MAX (0.0, ss->mAnim));
+
+ float sscale, sopacity;
+
+>>>>>>> MERGE-SOURCE
if (slot->primary)
- sscale = (ss->mAnim * slot->scale) + (1 - ss->mAnim);
+ sscale = ss->mAnim * slot->scale + (1 - ss->mAnim);
else
sscale = ss->mAnim * slot->scale;
if (slot->primary && !ss->mReflectActive)
- sopacity = (ss->mAnim * slot->opacity) + (1 - ss->mAnim);
+ sopacity = ss->mAnim * slot->opacity + (1 - ss->mAnim);
else
sopacity = anim * anim * slot->opacity;
@@ -287,30 +348,52 @@
/*if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)
return false;*/
- wAttrib.opacity = (float)wAttrib.opacity * sopacity;
+ wAttrib.opacity = (float)wAttrib.opacity * sopacity;
wAttrib.brightness = (float)wAttrib.brightness *
- ss->mReflectBrightness;
+<<<<<<< TREE
+ ss->mReflectBrightness;
+=======
+ ss->mReflectBrightness;
+
+// float halfWinWidth = window->width () / 2;
+// float halfWinHeight = window->height () / 2;
+>>>>>>> MERGE-SOURCE
if (window->alpha () || wAttrib.opacity != OPAQUE)
mask |= PAINT_WINDOW_TRANSLUCENT_MASK;
wTransform.translate (sx, sy, sz);
+<<<<<<< TREE
wTransform.translate (window->x () + (window->width () * sscale / 2),
window->y () + (window->height () * sscale / 2),
0.0f);
+=======
+ wTransform.translate (window->x () + window->width () * sscale / 2,
+ window->y () + window->height () * sscale / 2,
+ 0.0f);
+>>>>>>> MERGE-SOURCE
+<<<<<<< TREE
wTransform.scale (ss->mOutput->width (), -ss->mOutput->height (),
1.0f);
+=======
+ wTransform.scale (ss->mOutput->width (), -ss->mOutput->height (), 1.0f);
+>>>>>>> MERGE-SOURCE
wTransform.rotate (srot, 0.0, 1.0, 0.0);
+<<<<<<< TREE
wTransform.scale (1.0f / ss->mOutput->width (),
-1.0f / ss->mOutput->height (), 1.0f);
+=======
+ wTransform.scale ( 1.0f / ss->mOutput->width (),
+ -1.0f / ss->mOutput->height (), 1.0f);
+>>>>>>> MERGE-SOURCE
wTransform.scale (sscale, sscale, 1.0f);
- wTransform.translate (-window->x () - (window->width () / 2),
- -window->y () - (window->height () / 2), 0.0f);
+ wTransform.translate (-window->x () - window->width () / 2,
+ -window->y () - window->height () / 2, 0.0f);
gWindow->glDraw (wTransform, wAttrib, region,
mask | PAINT_WINDOW_TRANSFORMED_MASK);
@@ -320,19 +403,28 @@
((ss->optionGetOverlayIcon () != ShiftOptions::OverlayIconNone) ||
gWindow->textures ().empty ()))
{
- GLTexture *icon;
+ GLTexture *icon = gWindow->getIcon (512, 512);
+<<<<<<< TREE
icon = gWindow->getIcon (512, 512);
+=======
+>>>>>>> MERGE-SOURCE
if (!icon)
icon = ss->gScreen->defaultIcon ();
if (icon && (icon->name ()))
{
+<<<<<<< TREE
float scale;
float x, y;
int iconOverlay = ss->optionGetOverlayIcon ();
ShiftSlot *slot = ss->mActiveSlot->slot;
+=======
+ float x, y, scale, sscale;
+ int iconOverlay = ss->optionGetOverlayIcon ();
+ ShiftSlot *slot = ss->mActiveSlot->slot;
+>>>>>>> MERGE-SOURCE
GLTexture::MatrixList matl;
float sx = ss->mAnim * slot->tx;
@@ -341,15 +433,18 @@
float srot = ss->mAnim * slot->rotation;
float sopacity = ss->mAnim * slot->opacity;
- float sscale;
-
if (slot->primary)
sscale = (ss->mAnim * slot->scale) + (1 - ss->mAnim);
else
sscale = ss->mAnim * ss->mAnim * slot->scale;
+<<<<<<< TREE
int scaledWinWidth = window->width () * sscale;
int scaledWinHeight = window->height () * sscale;
+=======
+ float scaledWinWidth = window->width () * sscale;
+ float scaledWinHeight = window->height () * sscale;
+>>>>>>> MERGE-SOURCE
if (gWindow->textures ().empty ())
iconOverlay = ShiftOptions::OverlayIconBig;
@@ -363,13 +458,20 @@
case ShiftOptions::OverlayIconBig:
default:
- /* only change opacity if not painting an
- icon for a minimized window */
+ /* Only change opacity if not painting an
+ * icon for a minimized window
+ * TODO: Make the opacity value configurable */
if (!gWindow->textures ().empty ())
sAttrib.opacity /= 3;
+<<<<<<< TREE
scale = MIN (((float) scaledWinWidth / icon->width ()),
((float) scaledWinHeight / icon->height ()));
+=======
+
+ scale = MIN (((float) scaledWinWidth / icon->width ()),
+ ((float) scaledWinHeight / icon->height ()));
+>>>>>>> MERGE-SOURCE
break;
}
@@ -380,13 +482,13 @@
{
case ShiftOptions::OverlayIconNone:
case ShiftOptions::OverlayIconEmblem:
- x = scaledWinWidth - width;
+ x = scaledWinWidth - width;
y = scaledWinHeight - height;
break;
case ShiftOptions::OverlayIconBig:
default:
- x = scaledWinWidth / 2 - width / 2;
+ x = scaledWinWidth / 2 - width / 2;
y = scaledWinHeight / 2 - height / 2;
break;
}
@@ -410,36 +512,56 @@
if (gWindow->vertexBuffer ()->end ())
{
GLWindowPaintAttrib wAttrib (sAttrib);
- GLMatrix wTransform (transform);
+ GLMatrix wTransform (transform);
if (gWindow->textures ().empty ())
sAttrib.opacity = gWindow->paintAttrib ().opacity;
wAttrib = GLWindowPaintAttrib (sAttrib);
- wAttrib.opacity = (float)wAttrib.opacity * sopacity;
+ wAttrib.opacity = (float)wAttrib.opacity * sopacity;
wAttrib.brightness = (float)wAttrib.brightness *
ss->mReflectBrightness;
wTransform.translate (sx, sy, sz);
+<<<<<<< TREE
wTransform.translate (window->x () +
(window->width () * sscale / 2),
window->y () +
(window->height () * sscale / 2),
0.0f);
+=======
+ wTransform.translate (window->x () + (window->width () * sscale / 2),
+ window->y () + (window->height () * sscale / 2),
+ 0.0f);
+>>>>>>> MERGE-SOURCE
+<<<<<<< TREE
wTransform.scale (ss->mOutput->width (),
-ss->mOutput->height (), 1.0f);
+=======
+ wTransform.scale ( ss->mOutput->width (),
+ -ss->mOutput->height (), 1.0f);
+>>>>>>> MERGE-SOURCE
wTransform.rotate (srot, 0.0, 1.0, 0.0);
+<<<<<<< TREE
wTransform.scale (1.0f / ss->mOutput->width (),
-1.0f / ss->mOutput->height (), 1.0f);
wTransform.translate (x - (window->width () * sscale / 2),
y - (window->height () * sscale / 2), 0.0f);
+=======
+ wTransform.scale ( 1.0f / ss->mOutput->width (),
+ -1.0f / ss->mOutput->height (), 1.0f);
+
+ wTransform.translate ((x - window->width () * sscale / 2),
+ (y - window->height () * sscale / 2), 0.0f);
+
+>>>>>>> MERGE-SOURCE
wTransform.scale (scale, scale, 1.0f);
gWindow->glDrawTexture (icon, wTransform, wAttrib, mask);
@@ -491,6 +613,7 @@
w = w->next;
}
+
return -1;
}
@@ -515,9 +638,16 @@
ShiftScreen::layoutThumbsCover ()
{
CompWindow *w;
- int ww, wh;
- float xScale, yScale;
- float distance;
+<<<<<<< TREE
+ int ww, wh;
+ float xScale, yScale;
+ float distance;
+=======
+ int ww, wh;
+ float xScale, yScale;
+ float distance;
+ float size = optionGetSize () / 100;
+>>>>>>> MERGE-SOURCE
CompRect oe;
@@ -532,8 +662,8 @@
int centerX = oe.centerX ();
int centerY = oe.centerY ();
- int maxThumbWidth = oe.width () * optionGetSize () / 100;
- int maxThumbHeight = oe.height () * optionGetSize () / 100;
+ int maxThumbWidth = oe.width () * size;
+ int maxThumbHeight = oe.height () * size;
for (int index = 0; index < mNWindows; ++index)
{
@@ -544,19 +674,19 @@
wh = w->height () + w->border ().top + w->border ().bottom;
if (ww > maxThumbWidth)
- xScale = (float)(maxThumbWidth) / (float)ww;
+ xScale = (float)maxThumbWidth / (float)ww;
else
xScale = 1.0f;
if (wh > maxThumbHeight)
- yScale = (float)(maxThumbHeight) / (float)wh;
+ yScale = (float)maxThumbHeight / (float)wh;
else
yScale = 1.0f;
float val1 = floor((float) MIN (mNWindows,
optionGetCoverMaxVisibleWindows ()) / 2.0);
float pos;
- float space = (maxThumbWidth / 2);
+ float space = maxThumbWidth / 2;
space *= cos (sin (PI / 4) * PI / 3);
space *= 2;
//space += (space / sin (PI / 4)) - space;
@@ -579,7 +709,7 @@
pos = MIN (1.0, MAX (-1.0, distance));
- sw->mSlots[i].opacity = 1.0 - MIN (1.0, MAX (0.0, fabs(distance) - val1));
+ sw->mSlots[i].opacity = 1.0 - MIN (1.0, MAX (0.0, fabs (distance) - val1));
sw->mSlots[i].scale = MIN (xScale, yScale);
sw->mSlots[i].y = centerY + (maxThumbHeight / 2.0) -
@@ -588,19 +718,29 @@
if (fabs(distance) < 1.0)
{
+<<<<<<< TREE
sw->mSlots[i].x = centerX + (sin(pos * PI * 0.5) * space *
optionGetCoverExtraSpace ());
+=======
+ sw->mSlots[i].x = centerX + (sin (pos * PI * 0.5) * space *
+ optionGetCoverExtraSpace ());
+>>>>>>> MERGE-SOURCE
sw->mSlots[i].z = fabs (distance);
sw->mSlots[i].z *= -(maxThumbWidth / (2.0 * oe.width ()));
+<<<<<<< TREE
sw->mSlots[i].rotation = sin(pos * PI * 0.5) *
-optionGetCoverAngle ();
+=======
+ sw->mSlots[i].rotation = sin (pos * PI * 0.5) *
+ -optionGetCoverAngle ();
+>>>>>>> MERGE-SOURCE
}
else
{
- float rad = (space / oe.width ()) / sin(PI / 6.0);
+ float rad = (space / oe.width ()) / sin (PI / 6.0);
- float ang = (PI / MAX(72.0, mNWindows * 2)) *
+ float ang = (PI / MAX (72.0, mNWindows * 2)) *
(distance - pos) + (pos * (PI / 6.0));
sw->mSlots[i].x = centerX;
@@ -608,16 +748,16 @@
optionGetCoverExtraSpace ();
sw->mSlots[i].rotation = optionGetCoverAngle () + 30;
- sw->mSlots[i].rotation -= fabs(ang) * 180.0 / PI;
+ sw->mSlots[i].rotation -= fabs (ang) * 180.0 / PI;
sw->mSlots[i].rotation *= -pos;
sw->mSlots[i].z = -(maxThumbWidth / (2.0 * oe.width ()));
- sw->mSlots[i].z += -(cos(PI / 6.0) * rad);
- sw->mSlots[i].z += (cos(ang) * rad);
+ sw->mSlots[i].z += -(cos (PI / 6.0) * rad);
+ sw->mSlots[i].z += (cos (ang) * rad);
}
- mDrawSlots[index * 2 + i].w = w;
- mDrawSlots[index * 2 + i].slot = &sw->mSlots[i];
+ mDrawSlots[index * 2 + i].w = w;
+ mDrawSlots[index * 2 + i].slot = &sw->mSlots[i];
mDrawSlots[index * 2 + i].distance = fabs(distance);
}
@@ -719,11 +859,19 @@
sw->mSlots[i].scale = MIN (xScale, yScale);
sw->mSlots[i].y = centerY + (maxThumbHeight / 2.0) -
+<<<<<<< TREE
(((w->height () / 2.0) + w->border ().bottom) *
sw->mSlots[i].scale);
sw->mSlots[i].x = sin(angle) * distance * (maxThumbWidth / 2);
+=======
+ (((w->height () / 2.0) + w->border ().bottom) *
+ sw->mSlots[i].scale);
+
+ sw->mSlots[i].x = sin (angle) * distance * (maxThumbWidth / 2);
+
+>>>>>>> MERGE-SOURCE
if (distance > 0 && false)
sw->mSlots[i].x *= 1.5;
@@ -740,8 +888,8 @@
if (sw->mSlots[i].opacity > 0.0)
{
- mDrawSlots[slotNum].w = w;
- mDrawSlots[slotNum].slot = &sw->mSlots[i];
+ mDrawSlots[slotNum].w = w;
+ mDrawSlots[slotNum].slot = &sw->mSlots[i];
mDrawSlots[slotNum].distance = -distance;
++slotNum;
}
@@ -814,12 +962,15 @@
bool
ShiftScreen::updateWindowList ()
{
+<<<<<<< TREE
CompWindow **wins;
+=======
+>>>>>>> MERGE-SOURCE
qsort (mWindows, mNWindows, sizeof (CompWindow *), compareWindows);
- mMvTarget = 0;
- mMvAdjust = 0;
+ mMvTarget = 0;
+ mMvAdjust = 0;
mMvVelocity = 0;
for (int i = 0; i < mNWindows; ++i)
@@ -837,9 +988,15 @@
* A,B,C,D,E --> A,B,D,E,C to get B,D,E,C,(A),B,D,E,C as initial state */
if (optionGetMode () == ShiftScreen::ModeCover)
{
+<<<<<<< TREE
int idx;
wins = (CompWindow **) malloc(mNWindows * sizeof (CompWindow *));
+=======
+ int idx;
+ CompWindow **wins = (CompWindow **) malloc(mNWindows * sizeof (CompWindow *));
+
+>>>>>>> MERGE-SOURCE
if (!wins)
return false;
@@ -882,19 +1039,22 @@
}
void
-ShiftScreen::switchToWindow (bool toNext)
+ShiftScreen::switchToWindow (bool toNext)
{
CompWindow *w;
- int cur;
+ int cur;
if (!mGrabIndex)
return;
+<<<<<<< TREE
for (cur = 0; cur < mNWindows; ++cur)
{
+=======
+ for (cur = 0; cur < mNWindows; ++cur)
+>>>>>>> MERGE-SOURCE
if (mWindows[cur]->id () == mSelectedWindow)
break;
- }
if (cur == mNWindows)
return;
@@ -929,10 +1089,13 @@
int count = 0;
foreach (CompWindow *w, screen->windows ())
- {
if (ShiftWindow::get (w)->isShiftable ())
+<<<<<<< TREE
++count;
}
+=======
+ ++count;
+>>>>>>> MERGE-SOURCE
return count;
}
@@ -955,8 +1118,8 @@
if (fabs (dx) < 0.002f && fabs (mMvVelocity) < 0.004f)
{
mMvVelocity = 0.0f;
- mMvTarget = mMvTarget + mMvAdjust;
- mMvAdjust = 0;
+ mMvTarget += mMvAdjust;
+ mMvAdjust = 0;
layoutThumbs ();
return false;
}
@@ -973,13 +1136,13 @@
while (mMvTarget >= mNWindows)
{
mMvTarget -= mNWindows;
- mInvert = !mInvert;
+ mInvert = !mInvert;
}
while (mMvTarget < 0)
{
mMvTarget += mNWindows;
- mInvert = !mInvert;
+ mInvert = !mInvert;
}
if (!layoutThumbs ())
@@ -1012,21 +1175,37 @@
else
brightness = ss->optionGetBackgroundIntensity ();
+<<<<<<< TREE
float dp = opacity - mOpacity;
float adjust = dp * 0.1f;
float amount = fabs (dp) * 7.0f;
+=======
+ float dp = opacity - mOpacity;
+ float adjust = dp * 0.1f;
+ float amount = fabs (dp) * 7.0f;
+
+>>>>>>> MERGE-SOURCE
if (amount < 0.01f)
amount = 0.01f;
else if (amount > 0.15f)
amount = 0.15f;
+<<<<<<< TREE
mOpacityVelocity = (amount * mOpacityVelocity + adjust) / (amount + 1.0f);
float db = brightness - mBrightness;
adjust = db * 0.1f;
amount = fabs (db) * 7.0f;
+=======
+ mOpacityVelocity = (amount * mOpacityVelocity + adjust) / (amount + 1.0f);
+
+ float db = brightness - mBrightness;
+ adjust = db * 0.1f;
+ amount = fabs (db) * 7.0f;
+
+>>>>>>> MERGE-SOURCE
if (amount < 0.01f)
amount = 0.01f;
else if (amount > 0.15f)
@@ -1044,12 +1223,14 @@
fabs (dp) != fabs (dp) || fabs (mBrightnessVelocity) != fabs (mBrightnessVelocity)))
{
mBrightness = brightness;
- mOpacity = opacity;
+ mOpacity = opacity;
+
return false;
}
mBrightness += mBrightnessVelocity * chunk;
- mOpacity += mOpacityVelocity * chunk;
+ mOpacity += mOpacityVelocity * chunk;
+
return true;
}
@@ -1063,10 +1244,17 @@
else
anim = 0.0;
+<<<<<<< TREE
float dr = anim - mAnim;
float adjust = dr * 0.1f;
float amount = fabs (dr) * 7.0f;
+=======
+ float dr = anim - mAnim;
+ float adjust = dr * 0.1f;
+ float amount = fabs (dr) * 7.0f;
+
+>>>>>>> MERGE-SOURCE
if (amount < 0.002f)
amount = 0.002f;
else if (amount > 0.15f)
@@ -1082,6 +1270,7 @@
}
mAnim += mAnimVelocity * chunk;
+
return true;
}
@@ -1096,10 +1285,16 @@
mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
mPaintingAbove = false;
+<<<<<<< TREE
mOutput = output;
bool status = gScreen->glPaintOutput (attrib, transform, region, output, mask);
+=======
+ mOutput = output;
+
+ bool status = gScreen->glPaintOutput (attrib, transform, region, output, mask);
+>>>>>>> MERGE-SOURCE
if (mState != ShiftStateNone &&
((unsigned int) output->id () == (unsigned int) mUsedOutput ||
@@ -1107,11 +1302,19 @@
{
CompWindow *w;
GLMatrix sTransform (transform);
+<<<<<<< TREE
int oy1 = screen->outputDevs ()[mUsedOutput].region ()->extents.y1;
int oy2 = screen->outputDevs ()[mUsedOutput].region ()->extents.y2;
int maxThumbHeight = (oy2 - oy1) * optionGetSize () / 100;
int oldFilter = gScreen->textureFilter ();
int i;
+=======
+ int oy1 = screen->outputDevs ()[mUsedOutput].region ()->extents.y1;
+ int oy2 = screen->outputDevs ()[mUsedOutput].region ()->extents.y2;
+ int maxThumbHeight = (oy2 - oy1) * optionGetSize () / 100;
+ int oldFilter = gScreen->textureFilter ();
+ int i;
+>>>>>>> MERGE-SOURCE
if (optionGetMultioutputMode () == ShiftOptions::MultioutputModeOneBigSwitcher)
{
@@ -1125,11 +1328,19 @@
if (optionGetReflection ())
{
+<<<<<<< TREE
GLMatrix rTransform = sTransform;
GLMatrix r2Transform;
GLushort colorData[4];
GLfloat vertexData[12];
int cull;
+=======
+ GLMatrix rTransform = sTransform;
+ GLMatrix r2Transform;
+ GLushort colorData[4];
+ GLfloat vertexData[12];
+ int cull;
+>>>>>>> MERGE-SOURCE
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
glGetIntegerv (GL_CULL_FACE_MODE, &cull);
@@ -1198,16 +1409,17 @@
if (optionGetGroundSize () > 0.0)
{
+ float groundSize = optionGetGroundSize ();
streamingBuffer->begin (GL_TRIANGLE_STRIP);
colorData[0] = optionGetGroundColor1 ()[0];
colorData[1] = optionGetGroundColor1 ()[1];
colorData[2] = optionGetGroundColor1 ()[2];
- colorData[3] = (float)optionGetGroundColor1 ()[3] * mAnim;
+ colorData[3] = optionGetGroundColor1 ()[3] * mAnim;
streamingBuffer->addColors (1, colorData);
streamingBuffer->addColors (1, colorData);
- colorData[3] = (float)optionGetGroundColor2 ()[3] * mAnim;
+ colorData[3] = optionGetGroundColor2 ()[3] * mAnim;
streamingBuffer->addColors (1, colorData);
streamingBuffer->addColors (1, colorData);
@@ -1218,10 +1430,10 @@
vertexData[4] = -0.5;
vertexData[5] = 0;
vertexData[6] = -0.5;
- vertexData[7] = -0.5 + optionGetGroundSize ();
+ vertexData[7] = -0.5 + groundSize;
vertexData[8] = 0;
vertexData[9] = 0.5;
- vertexData[10] = -0.5 + optionGetGroundSize ();
+ vertexData[10] = -0.5 + groundSize;
vertexData[11] = 0;
streamingBuffer->addVertices (4, vertexData);
@@ -1300,7 +1512,7 @@
void
ShiftScreen::paint (CompOutput::ptrList &outputs,
- unsigned int mask)
+ unsigned int mask)
{
if (mState != ShiftStateNone && outputs.size () > 0 &&
optionGetMultioutputMode () == ShiftOptions::MultioutputModeOneBigSwitcher)
@@ -1574,13 +1786,12 @@
{
CompWindow *w;
w = screen->findWindow (CompOption::getIntOptionNamed (options,
- "window",
- 0));
+ "window", 0));
+
if (w)
{
mType = ShiftTypeGroup;
- mClientLeader =
- (w->clientLeader ()) ? w->clientLeader () : w->id ();
+ mClientLeader = (w->clientLeader ()) ? w->clientLeader () : w->id ();
ret = initiateScreen (action, state, options);
}
}
@@ -2093,19 +2304,35 @@
bool
ShiftPluginVTable::init ()
{
+<<<<<<< TREE
if (CompPlugin::checkPluginABI ("text", COMPIZ_TEXT_ABI))
textAvailable = true;
else
+=======
+ if (!CompPlugin::checkPluginABI ("text", COMPIZ_TEXT_ABI))
+>>>>>>> MERGE-SOURCE
{
compLogMessage ("shift", CompLogLevelWarn, "No compatible text plugin"\
" loaded");
textAvailable = false;
}
-
- if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
- CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
- CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
- return true;
-
- return false;
+<<<<<<< TREE
+
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
+ CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
+ CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
+ return true;
+
+ return false;
+=======
+ else
+ textAvailable = true;
+
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
+ CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
+ CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
+ return true;
+
+ return false;
+>>>>>>> MERGE-SOURCE
}
=== modified file 'plugins/shift/src/shift.h'
--- plugins/shift/src/shift.h 2013-04-27 16:51:53 +0000
+++ plugins/shift/src/shift.h 2013-07-21 23:03:28 +0000
@@ -289,6 +289,7 @@
public:
+<<<<<<< TREE
ShiftSlot mSlots[2];
float mOpacity;
float mBrightness;
@@ -297,6 +298,16 @@
bool mActive;
+=======
+ ShiftSlot mSlots[2];
+ float mOpacity;
+ float mBrightness;
+ float mOpacityVelocity;
+ float mBrightnessVelocity;
+
+ bool mActive;
+
+>>>>>>> MERGE-SOURCE
public:
bool
=== modified file 'plugins/showdesktop/showdesktop.xml.in'
--- plugins/showdesktop/showdesktop.xml.in 2013-04-27 15:56:23 +0000
+++ plugins/showdesktop/showdesktop.xml.in 2013-07-21 23:03:28 +0000
@@ -105,11 +105,23 @@
<_short>Appearance
<_short>Window Opacity
+<<<<<<< TREE
<_long>Windows will fade to this opacity when showdesktop'd.
+=======
+ <_long>Windows will fade to this opacity when showdesktop'd (in percent).
+ 30.0
+ 0.0
+ 100.0
+ 5.0
+
+
+ <_short>Window Saturation
+ <_long>Windows will fade to this saturation when showdesktop'd (in percent).
+>>>>>>> MERGE-SOURCE
0.3
- 0.1
- 1.0
- 0.01
+ 0.0
+ 100.0
+ 5.0
<_short>Window Part Size
=== modified file 'plugins/showdesktop/src/showdesktop.cpp'
--- plugins/showdesktop/src/showdesktop.cpp 2013-05-09 13:43:07 +0000
+++ plugins/showdesktop/src/showdesktop.cpp 2013-07-21 23:03:28 +0000
@@ -37,7 +37,7 @@
COMPIZ_PLUGIN_20090315 (showdesktop, ShowdesktopPluginVTable);
-namespace cw = compiz::window;
+namespace cw = compiz::window;
namespace cwe = compiz::window::extents;
namespace
@@ -106,6 +106,7 @@
(screen.height () / 2);
}
}
+
const unsigned short SD_STATE_OFF = 0;
const unsigned short SD_STATE_ACTIVATING = 1;
const unsigned short SD_STATE_ON = 2;
@@ -117,20 +118,11 @@
{
SD_SCREEN (screen);
- if (window->grabbed ())
- return false;
-
- if (!window->focus ())
- return false;
-
- if (!ss->optionGetWindowMatch ().evaluate (window))
- return false;
-
- if (window->wmType () & (CompWindowTypeDesktopMask |
- CompWindowTypeDockMask))
- return false;
-
- if (window->state () & CompWindowStateSkipPagerMask)
+ if (window->grabbed () ||
+ !window->focus () ||
+ !ss->optionGetWindowMatch ().evaluate (window) ||
+ (window->wmType () & (CompWindowTypeDesktopMask | CompWindowTypeDockMask)) ||
+ window->state () & CompWindowStateSkipPagerMask)
return false;
return true;
@@ -175,8 +167,7 @@
const cwe::Extents &border,
int partSize)
{
- return workArea.y () - widthAndBottomBorder (geometry, border) +
- partSize;
+ return workArea.y () - widthAndBottomBorder (geometry, border) + partSize;
}
int bottomOffscreenPosition (const CompRect &workArea,
@@ -184,9 +175,7 @@
const cwe::Extents &border,
int partSize)
{
- return workArea.y () +
- workArea.height () + topBorder (border) -
- partSize;
+ return workArea.y () + workArea.height () + topBorder (border) - partSize;
}
int leftOffscreenPosition (const CompRect &workArea,
@@ -194,8 +183,7 @@
const cwe::Extents &border,
int partSize)
{
- return workArea.x () - widthAndRightBorder (geometry, border) +
- partSize;
+ return workArea.x () - widthAndRightBorder (geometry, border) + partSize;
}
int rightOffscreenPosition (const CompRect &workArea,
@@ -203,9 +191,7 @@
const cwe::Extents &border,
int partSize)
{
- return workArea.x () +
- workArea.width () + leftBorder (border) -
- partSize;
+ return workArea.x () + workArea.width () + leftBorder (border) - partSize;
}
}
@@ -370,9 +356,11 @@
case IntelligentRandomToCorners:
closestCorner (workArea, geometry, border, screen, partSize);
break;
+
case IntelligentRandomLeftRight:
leftOrRight (workArea, geometry, border, screen, partSize);
break;
+
case IntelligentRandomUpDown:
upOrDown (workArea, geometry, border, screen, partSize);
break;
@@ -393,27 +381,37 @@
case FullRandomUp:
up (workArea, geometry, border, partSize);
break;
+
case FullRandomDown:
down (workArea, geometry, border, partSize);
break;
+
case FullRandomLeft:
left (workArea, geometry, border, partSize);
break;
+
case FullRandomRight:
right (workArea, geometry, border, partSize);
break;
+
case FullRandomTopLeft:
topLeft (workArea, geometry, border, partSize);
break;
+
case FullRandomTopRight:
topRight (workArea, geometry, border, partSize);
break;
+
case FullRandomBottomLeft:
bottomLeft (workArea, geometry, border, partSize);
break;
+
case FullRandomBottomRight:
bottomRight (workArea, geometry, border, partSize);
break;
+
+ default:
+ break;
}
}
@@ -427,16 +425,16 @@
if (oldState == SD_STATE_OFF)
{
- placer->onScreenX = window->x ();
- placer->onScreenY = window->y ();
+ placer->onScreenX = window->x ();
+ placer->onScreenY = window->y ();
placer->origViewportX = screen->vp ().x ();
placer->origViewportY = screen->vp ().y ();
}
- const int partSize = ss->optionGetWindowPartSize ();
+ const int partSize = ss->optionGetWindowPartSize ();
const CompRect &workArea = screen->workArea ();
const cw::Geometry &geometry = window->geometry ();
- const cwe::Extents &border = window->border ();
+ const cwe::Extents &border = window->border ();
switch (ss->optionGetDirection ())
{
@@ -524,12 +522,13 @@
sw->placer->placed = true;
sw->adjust = true;
- w->setShowDesktopMode (true);
+ w->setShowDesktopMode (true);
sw->setHints (true);
if (sw->tx)
sw->tx -= (sw->placer->onScreenX - sw->placer->offScreenX);
+
if (sw->ty)
sw->ty -= (sw->placer->onScreenY - sw->placer->offScreenY);
@@ -537,7 +536,7 @@
sw->placer->offScreenY - w->y (),
true);
- count++;
+ ++count;
}
return count;
@@ -546,13 +545,10 @@
int
ShowdesktopWindow::adjustVelocity ()
{
- float adjust, amount;
- float x1, y1;
+ SD_SCREEN (screen);
+
float baseX, baseY;
-
- SD_SCREEN (screen);
-
- x1 = y1 = 0.0;
+ float x1 = 0.0f, y1 = 0.0f;
if (ss->state == SD_STATE_ACTIVATING)
{
@@ -569,10 +565,11 @@
baseY = placer->offScreenY;
}
- float dx = x1 - (baseX + tx);
-
- adjust = dx * 0.15f;
- amount = fabs (dx) * 1.5f;
+ float dx = x1 - (baseX + tx);
+
+ float adjust = dx * 0.15f;
+ float amount = fabs (dx) * 1.5f;
+
if (amount < 0.5f)
amount = 0.5f;
else if (amount > 5.0f)
@@ -582,8 +579,9 @@
float dy = y1 - (baseY + ty);
- adjust = dy * 0.15f;
- amount = fabs (dy) * 1.5f;
+ adjust = dy * 0.15f;
+ amount = fabs (dy) * 1.5f;
+
if (amount < 0.5f)
amount = 0.5f;
else if (amount > 5.0f)
@@ -600,6 +598,7 @@
return 0;
}
+
return 1;
}
@@ -613,14 +612,13 @@
if ((state == SD_STATE_ACTIVATING) ||
(state == SD_STATE_DEACTIVATING))
{
- int steps;
- float amount, chunk;
+ float amount = msSinceLastPaint * 0.05f * optionGetSpeed ();
+ int steps = amount / (0.5f * optionGetTimestep ());
- amount = msSinceLastPaint * 0.05f * optionGetSpeed ();
- steps = amount / (0.5f * optionGetTimestep ());
if (!steps)
- steps = 1;
- chunk = amount / (float)steps;
+ steps = 1;
+
+ float chunk = amount / (float)steps;
while (steps--)
{
@@ -629,27 +627,30 @@
foreach (CompWindow *w, screen->windows ())
{
SD_WINDOW (w);
+
if (sw->adjust)
{
sw->adjust = sw->adjustVelocity ();
moreAdjust |= sw->adjust;
- sw->tx += sw->xVelocity * chunk;
+ sw->tx += sw->xVelocity * chunk;
sw->ty += sw->yVelocity * chunk;
}
}
+
if (!moreAdjust)
break;
}
}
}
+
bool
ShowdesktopScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
- const GLMatrix &transform,
+ const GLMatrix &transform,
const CompRegion ®ion,
- CompOutput *output,
- unsigned int mask)
+ CompOutput *output,
+ unsigned int mask)
{
if ((state == SD_STATE_ACTIVATING) ||
(state == SD_STATE_DEACTIVATING))
@@ -676,6 +677,7 @@
else
{
SD_WINDOW (w);
+
if (sw->placer)
{
delete sw->placer;
@@ -691,14 +693,15 @@
else
state = SD_STATE_OFF;
}
+
cScreen->donePaint ();
}
bool
ShowdesktopWindow::glPaint (const GLWindowPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ unsigned int mask)
{
SD_SCREEN (screen);
@@ -706,7 +709,8 @@
(ss->state == SD_STATE_DEACTIVATING))
{
GLMatrix wTransform = transform;
- GLWindowPaintAttrib wAttrib = attrib;
+ GLWindowPaintAttrib wAttrib = attrib;
+// GLfloat scale = ss->optionGetWindowOpacity () / 100.0f;
if (adjust)
{
@@ -720,9 +724,9 @@
mask |= PAINT_WINDOW_TRANSFORMED_MASK;
wTransform.translate (window->x (), window->y (), 0.0f);
- wTransform.scale (1.0f, 1.0f, 1.0f);
- wTransform.translate(tx + offsetX - window->x (),
- ty + offsetY - window->y (), 0.0f);
+// wTransform.scale (0.5, 0.5, 0.5);
+ wTransform.translate (tx + offsetX - window->x (),
+ ty + offsetY - window->y (), 0.0f);
}
return gWindow->glPaint (wAttrib, wTransform, region, mask);
@@ -732,8 +736,13 @@
GLWindowPaintAttrib wAttrib = attrib;
if (window->inShowDesktopMode ())
- wAttrib.opacity = wAttrib.opacity *
- ss->optionGetWindowOpacity ();
+ {
+ wAttrib.opacity = wAttrib.opacity * ss->optionGetWindowOpacity () / 100.0f;
+ wAttrib.saturation = wAttrib.saturation * ss->optionGetWindowSaturation () / 100.0f;
+
+ if (window->grabbed ()) //otherGrabExist ("grid"))
+ wAttrib.opacity = 0.0f;
+ }
return gWindow->glPaint (wAttrib, transform, region, mask);
}
@@ -746,16 +755,19 @@
{
switch (event->type)
{
- case PropertyNotify:
- if (event->xproperty.atom == Atoms::desktopViewport)
- {
- SD_SCREEN (screen);
-
- if ((ss->state == SD_STATE_ON) ||
- (ss->state == SD_STATE_ACTIVATING))
- screen->leaveShowDesktopMode (NULL);
- }
- break;
+ case PropertyNotify:
+ if (event->xproperty.atom == Atoms::desktopViewport)
+ {
+ SD_SCREEN (screen);
+
+ if ((ss->state == SD_STATE_ON) ||
+ (ss->state == SD_STATE_ACTIVATING))
+ screen->leaveShowDesktopMode (NULL);
+ }
+ break;
+
+ default:
+ break;
}
screen->handleEvent (event);
@@ -776,6 +788,7 @@
if (state == SD_STATE_OFF || state == SD_STATE_DEACTIVATING)
{
int count = prepareWindows (state);
+
if (count > 0)
{
XSetInputFocus (screen->dpy (), screen->root (),
@@ -809,12 +822,10 @@
sw->tx += (sw->placer->onScreenX - sw->placer->offScreenX);
sw->ty += (sw->placer->onScreenY - sw->placer->offScreenY);
- sw->placer->onScreenX += (sw->placer->origViewportX -
- screen->vp (). x ())
- * screen->width ();
- sw->placer->onScreenY += (sw->placer->origViewportY -
- screen->vp ().y ())
- * screen->height ();
+ sw->placer->onScreenX += (sw->placer->origViewportX - screen->vp (). x ())
+ * screen->width ();
+ sw->placer->onScreenY += (sw->placer->origViewportY - screen->vp ().y ())
+ * screen->height ();
cw->move (sw->placer->onScreenX - cw->x (),
sw->placer->onScreenY - cw->y (),
@@ -824,6 +835,7 @@
cw->setShowDesktopMode (false);
}
}
+
state = SD_STATE_DEACTIVATING;
cScreen->damageScreen ();
}
@@ -846,11 +858,11 @@
}
ShowdesktopPlacer::ShowdesktopPlacer () :
- placed (0),
- onScreenX (0),
- onScreenY (0),
- offScreenX (0),
- offScreenY (0),
+ placed (0),
+ onScreenX (0),
+ onScreenY (0),
+ offScreenX (0),
+ offScreenY (0),
origViewportX (0),
origViewportY (0)
{
@@ -859,9 +871,9 @@
/* screen initialization */
ShowdesktopScreen::ShowdesktopScreen (CompScreen *screen) :
PluginClassHandler (screen),
- cScreen (CompositeScreen::get (screen)),
- gScreen (GLScreen::get (screen)),
- state (SD_STATE_OFF),
+ cScreen (CompositeScreen::get (screen)),
+ gScreen (GLScreen::get (screen)),
+ state (SD_STATE_OFF),
moreAdjust (0)
{
ScreenInterface::setHandler (screen);
@@ -872,23 +884,23 @@
/* window initialization */
ShowdesktopWindow::ShowdesktopWindow (CompWindow *window) :
PluginClassHandler (window),
- window (window),
- gWindow (GLWindow::get (window)),
- sid (0),
- distance (0),
- placer (NULL),
- xVelocity (0.0f),
- yVelocity (0.0f),
- tx (0.0f),
- ty (0.0f),
+ window (window),
+ gWindow (GLWindow::get (window)),
+ sid (0),
+ distance (0),
+ placer (NULL),
+ xVelocity (0.0f),
+ yVelocity (0.0f),
+ tx (0.0f),
+ ty (0.0f),
notAllowedMask (0),
- stateMask (0),
- showdesktoped (false),
- wasManaged (window->managed ()),
- delta (1.0f),
- adjust (false),
- state (0),
- moreAdjust (false)
+ stateMask (0),
+ showdesktoped (false),
+ wasManaged (window->managed ()),
+ delta (1.0f),
+ adjust (false),
+ state (0),
+ moreAdjust (false)
{
WindowInterface::setHandler (window);
GLWindowInterface::setHandler (gWindow);
=== modified file 'plugins/showdesktop/src/showdesktop.h'
--- plugins/showdesktop/src/showdesktop.h 2013-03-30 06:15:01 +0000
+++ plugins/showdesktop/src/showdesktop.h 2013-07-21 23:03:28 +0000
@@ -143,8 +143,10 @@
int partSize);
int placed;
- int onScreenX, onScreenY;
- int offScreenX, offScreenY;
+ int onScreenX;
+ int onScreenY;
+ int offScreenX;
+ int offScreenY;
int origViewportX;
int origViewportY;
};
@@ -161,10 +163,10 @@
ShowdesktopScreen (CompScreen *);
CompositeScreen *cScreen;
- GLScreen *gScreen;
+ GLScreen *gScreen;
- int state;
- int moreAdjust;
+ int state;
+ int moreAdjust;
void
handleEvent (XEvent *event);
@@ -174,10 +176,10 @@
bool
glPaintOutput (const GLScreenPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- CompOutput *,
- unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
void
donePaint ();
@@ -198,38 +200,41 @@
public GLWindowInterface
{
public:
+
ShowdesktopWindow (CompWindow *);
~ShowdesktopWindow ();
- CompWindow *window;
- GLWindow *gWindow;
+ CompWindow *window;
+ GLWindow *gWindow;
- int sid;
- int distance;
+ int sid;
+ int distance;
ShowdesktopPlacer *placer;
- GLfloat xVelocity, yVelocity;
- GLfloat tx, ty;
-
- unsigned int notAllowedMask;
- unsigned int stateMask;
-
- bool showdesktoped;
- bool wasManaged;
-
- float delta;
- bool adjust;
+ GLfloat xVelocity;
+ GLfloat yVelocity;
+ GLfloat tx;
+ GLfloat ty;
+
+ unsigned int notAllowedMask;
+ unsigned int stateMask;
+
+ bool showdesktoped;
+ bool wasManaged;
+
+ float delta;
+ bool adjust;
bool
glPaint (const GLWindowPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
void
getAllowedActions (unsigned int &,
- unsigned int &);
+ unsigned int &);
bool
focus ();
@@ -246,8 +251,8 @@
int
adjustVelocity ();
- int state;
- int moreAdjust;
+ int state;
+ int moreAdjust;
};
/* shortcut macros, usually named X_SCREEN and X_WINDOW
=== modified file 'plugins/showmouse/src/showmouse.cpp'
--- plugins/showmouse/src/showmouse.cpp 2013-05-09 13:43:07 +0000
+++ plugins/showmouse/src/showmouse.cpp 2013-07-21 23:03:28 +0000
@@ -28,14 +28,27 @@
COMPIZ_PLUGIN_20090315 (showmouse, ShowmousePluginVTable);
+<<<<<<< TREE
/* 3 vertices per triangle, 2 triangles per particle */
const unsigned short CACHESIZE_FACTOR = 3 * 2;
/* 2 coordinates, x and y */
const unsigned short COORD_COMPONENTS = CACHESIZE_FACTOR * 2;
/* each vertex is stored as 3 GLfloats */
+=======
+// GL_TRIANGLE_STRIP needs 4 vertices to create a quad
+const unsigned short CACHESIZE_FACTOR = 4;
+// 2 coordinates, x and y
+const unsigned short COORD_COMPONENTS = CACHESIZE_FACTOR * 2;
+// each vertex is stored as 3 GLfloats
+>>>>>>> MERGE-SOURCE
const unsigned short VERTEX_COMPONENTS = CACHESIZE_FACTOR * 3;
+<<<<<<< TREE
/* 4 colors, RGBA */
const unsigned short COLOR_COMPONENTS = CACHESIZE_FACTOR * 4;
+=======
+// 4 colors, RGBA
+const unsigned short COLOR_COMPONENTS = CACHESIZE_FACTOR * 4;
+>>>>>>> MERGE-SOURCE
Particle::Particle () :
life (0),
@@ -44,10 +57,12 @@
height (0),
w_mod (0),
h_mod (0),
+ // color
r (0),
g (0),
b (0),
a (0),
+ // coordinates
x (0),
y (0),
z (0),
@@ -83,14 +98,14 @@
}
void
-ParticleSystem::initParticles (int f_numParticles)
+ParticleSystem::initParticles (int f_numParticles)
{
particles.clear ();
- tex = 0;
+ tex = 0;
slowdown = 1;
- active = false;
- darken = 0;
+ active = false;
+ darken = 0;
// Initialize cache
vertices_cache.clear ();
@@ -98,7 +113,7 @@
colors_cache.clear ();
dcolors_cache.clear ();
- for (int i = 0; i < f_numParticles; i++)
+ for (int i = 0; i < f_numParticles; ++i)
{
Particle p;
p.life = 0.0f;
@@ -107,7 +122,7 @@
}
void
-ParticleSystem::drawParticles (const GLMatrix &transform)
+ParticleSystem::drawParticles (const GLMatrix &transform)
{
int i, j, k, l;
@@ -125,7 +140,10 @@
if (dcolors_cache.size () < particles.size () * COLOR_COMPONENTS)
dcolors_cache.resize (particles.size () * COLOR_COMPONENTS);
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
if (tex)
glBindTexture (GL_TEXTURE_2D, tex);
@@ -137,81 +155,79 @@
{
if (part.life > 0.0f)
{
- float w = part.width / 2;
+ float w = part.width / 2;
float h = part.height / 2;
- GLushort r, g, b, a, dark_a;
-
- r = part.r * 65535.0f;
- g = part.g * 65535.0f;
- b = part.b * 65535.0f;
- a = part.life * part.a * 65535.0f;
- dark_a = part.life * part.a * darken * 65535.0f;
+ GLushort r = part.r * 65535.0f;
+ GLushort g = part.g * 65535.0f;
+ GLushort b = part.b * 65535.0f;
+ GLushort a = part.life * part.a * 65535.0f;
+ GLushort dark_a = part.life * part.a * 65535.0f * darken;
w += (w * part.w_mod) * part.life;
h += (h * part.h_mod) * part.life;
- //first triangle
+ // first triangle
vertices_cache[i + 0] = part.x - w;
- vertices_cache[i + 1] = part.y - h;
+ vertices_cache[i + 1] = part.y + h;
vertices_cache[i + 2] = part.z;
vertices_cache[i + 3] = part.x - w;
- vertices_cache[i + 4] = part.y + h;
+ vertices_cache[i + 4] = part.y - h;
vertices_cache[i + 5] = part.z;
vertices_cache[i + 6] = part.x + w;
vertices_cache[i + 7] = part.y + h;
vertices_cache[i + 8] = part.z;
- //second triangle
- vertices_cache[i + 9] = part.x + w;
- vertices_cache[i + 10] = part.y + h;
+ // second triangle just needs one additional vertex
+ vertices_cache[i + 9] = part.x + w;
+ vertices_cache[i + 10] = part.y - h;
vertices_cache[i + 11] = part.z;
- vertices_cache[i + 12] = part.x + w;
- vertices_cache[i + 13] = part.y - h;
- vertices_cache[i + 14] = part.z;
-
- vertices_cache[i + 15] = part.x - w;
- vertices_cache[i + 16] = part.y - h;
- vertices_cache[i + 17] = part.z;
-
- i += 18;
+// vertices_cache[i + 9] = part.x + w;
+// vertices_cache[i + 10] = part.y + h;
+// vertices_cache[i + 11] = part.z;
+
+// vertices_cache[i + 9] = part.x - w;
+// vertices_cache[i + 10] = part.y - h;
+// vertices_cache[i + 11] = part.z;
+
+ i += 12;
coords_cache[j + 0] = 0.0;
- coords_cache[j + 1] = 0.0;
+ coords_cache[j + 1] = 1.0;
coords_cache[j + 2] = 0.0;
- coords_cache[j + 3] = 1.0;
+ coords_cache[j + 3] = 0.0;
coords_cache[j + 4] = 1.0;
coords_cache[j + 5] = 1.0;
//second
coords_cache[j + 6] = 1.0;
- coords_cache[j + 7] = 1.0;
+ coords_cache[j + 7] = 0.0;
- coords_cache[j + 8] = 1.0;
- coords_cache[j + 9] = 0.0;
+// coords_cache[j + 8] = 1.0;
+// coords_cache[j + 9] = 0.0;
- coords_cache[j + 10] = 0.0;
- coords_cache[j + 11] = 0.0;
-
- j += 12;
-
- colors_cache[k + 0] = r;
- colors_cache[k + 1] = g;
- colors_cache[k + 2] = b;
- colors_cache[k + 3] = a;
-
- colors_cache[k + 4] = r;
- colors_cache[k + 5] = g;
- colors_cache[k + 6] = b;
- colors_cache[k + 7] = a;
-
- colors_cache[k + 8] = r;
- colors_cache[k + 9] = g;
+// coords_cache[j + 10] = 0.0;
+// coords_cache[j + 11] = 0.0;
+
+ j += 8;
+
+ colors_cache[k + 0] = r;
+ colors_cache[k + 1] = g;
+ colors_cache[k + 2] = b;
+ colors_cache[k + 3] = a;
+
+ colors_cache[k + 4] = r;
+ colors_cache[k + 5] = g;
+ colors_cache[k + 6] = b;
+ colors_cache[k + 7] = a;
+
+ colors_cache[k + 8] = r;
+ colors_cache[k + 9] = g;
colors_cache[k + 10] = b;
colors_cache[k + 11] = a;
@@ -221,19 +237,19 @@
colors_cache[k + 14] = b;
colors_cache[k + 15] = a;
- colors_cache[k + 16] = r;
- colors_cache[k + 17] = g;
- colors_cache[k + 18] = b;
- colors_cache[k + 19] = a;
-
- colors_cache[k + 20] = r;
- colors_cache[k + 21] = g;
- colors_cache[k + 22] = b;
- colors_cache[k + 23] = a;
-
- k += 24;
-
- if(darken > 0)
+// colors_cache[k + 16] = r;
+// colors_cache[k + 17] = g;
+// colors_cache[k + 18] = b;
+// colors_cache[k + 19] = a;
+
+// colors_cache[k + 20] = r;
+// colors_cache[k + 21] = g;
+// colors_cache[k + 22] = b;
+// colors_cache[k + 23] = a;
+
+ k += 16;
+
+ if (darken)
{
dcolors_cache[l + 0] = r;
dcolors_cache[l + 1] = g;
@@ -256,17 +272,17 @@
dcolors_cache[l + 14] = b;
dcolors_cache[l + 15] = dark_a;
- dcolors_cache[l + 16] = r;
- dcolors_cache[l + 17] = g;
- dcolors_cache[l + 18] = b;
- dcolors_cache[l + 19] = dark_a;
-
- dcolors_cache[l + 20] = r;
- dcolors_cache[l + 21] = g;
- dcolors_cache[l + 22] = b;
- dcolors_cache[l + 23] = dark_a;
-
- l += 24;
+// dcolors_cache[l + 16] = r;
+// dcolors_cache[l + 17] = g;
+// dcolors_cache[l + 18] = b;
+// dcolors_cache[l + 19] = dark_a;
+
+// dcolors_cache[l + 20] = r;
+// dcolors_cache[l + 21] = g;
+// dcolors_cache[l + 22] = b;
+// dcolors_cache[l + 23] = dark_a;
+
+ l += 16;
}
}
}
@@ -276,8 +292,10 @@
if (darken > 0)
{
glBlendFunc (GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
- stream->begin (GL_TRIANGLES);
- stream->addVertices (i / 3, &vertices_cache[0]);
+// glNormal3d (0.0, 0.0, -1.0);
+ stream->begin (GL_TRIANGLE_STRIP);
+
+ stream->addVertices (i / 4, &vertices_cache[0]);
stream->addTexCoords (0, j / 2, &coords_cache[0]);
stream->addColors (l / 4, &dcolors_cache[0]);
@@ -287,9 +305,10 @@
// draw particles
glBlendFunc (GL_SRC_ALPHA, blendMode);
- stream->begin (GL_TRIANGLES);
+// glNormal3d (0.0, 0.0, -1.0);
+ stream->begin (GL_TRIANGLE_STRIP);
- stream->addVertices (i / 3, &vertices_cache[0]);
+ stream->addVertices (i / 4, &vertices_cache[0]);
stream->addTexCoords (0, j / 2, &coords_cache[0]);
stream->addColors (k / 4, &colors_cache[0]);
@@ -301,9 +320,9 @@
}
void
-ParticleSystem::updateParticles (float time)
+ParticleSystem::updateParticles (float time)
{
- float speed = (time / 50.0);
+ float speed = time / 50.0;
float f_slowdown = slowdown * (1 - MAX (0.99, time / 1000.0) ) * 1000;
active = false;
@@ -324,7 +343,7 @@
// modify life
part.life -= part.fade * speed;
- active = true;
+ active = true;
}
}
}
@@ -372,12 +391,21 @@
unsigned int i, j;
+<<<<<<< TREE
float pos[10][2];
unsigned int nE = optionGetEmitters ();
float rA = (2 * M_PI) / nE;
int radius = optionGetRadius ();
for (i = 0; i < nE; i++)
+=======
+ float pos[10][2];
+ unsigned int nE = optionGetEmitters ();
+ float rA = (2 * M_PI) / nE;
+ int radius = optionGetRadius ();
+
+ for (i = 0; i < nE; ++i)
+>>>>>>> MERGE-SOURCE
{
pos[i][0] = sin (rot + (i * rA)) * radius;
pos[i][0] += mousePos.x ();
@@ -385,23 +413,28 @@
pos[i][1] += mousePos.y ();
}
- for (i = 0; i < ps.particles.size () && max_new > 0; i++)
+ for (i = 0; i < ps.particles.size () && max_new > 0; ++i)
{
Particle &part = ps.particles.at (i);
+
if (part.life <= 0.0f)
{
// give gt new life
- rVal = (float)(random() & 0xff) / 255.0;
+ rVal = (float)(random () & 0xff) / 255.0;
part.life = 1.0f;
part.fade = rVal * lifeNeg + fadeExtra; // Random Fade Value
// set size
- part.width = partw;
+ part.width = partw;
part.height = parth;
- part.w_mod = part.h_mod = -1;
+ part.w_mod = part.h_mod = -1;
// choose random position
+<<<<<<< TREE
j = random() % nE;
+=======
+ j = random () % nE;
+>>>>>>> MERGE-SOURCE
part.x = pos[j][0];
part.y = pos[j][1];
part.z = 0.0;
@@ -410,25 +443,22 @@
part.zo = part.z;
// set speed and direction
- rVal = (float)(random() & 0xff) / 255.0;
+ rVal = (float)(random() & 0xff) / 255.0;
part.xi = ((rVal * 20.0) - 10.0f);
- rVal = (float)(random() & 0xff) / 255.0;
+ rVal = (float)(random() & 0xff) / 255.0;
part.yi = ((rVal * 20.0) - 10.0f);
part.zi = 0.0f;
if (rColor)
{
// Random colors! (aka Mystical Fire)
- rVal = (float)(random() & 0xff) / 255.0;
- part.r = rVal;
- rVal = (float)(random() & 0xff) / 255.0;
- part.g = rVal;
- rVal = (float)(random() & 0xff) / 255.0;
- part.b = rVal;
+ part.r = (float)(random() & 0xff) / 255.0;
+ part.g = (float)(random() & 0xff) / 255.0;
+ part.b = (float)(random() & 0xff) / 255.0;
}
else
{
- rVal = (float)(random() & 0xff) / 255.0;
+ rVal = (float)(random () & 0xff) / 255.0;
part.r = colr1 - rVal * colr2;
part.g = colg1 - rVal * colg2;
part.b = colb1 - rVal * colb2;
@@ -442,7 +472,7 @@
part.zg = 0.0f;
ps.active = true;
- max_new -= 1;
+ max_new -= 1;
}
}
}
@@ -459,7 +489,7 @@
foreach (Particle &p, ps.particles)
{
- w = p.width / 2;
+ w = p.width / 2;
h = p.height / 2;
w += (w * p.w_mod) * p.life;
@@ -494,25 +524,24 @@
if (active && !ps.active)
{
ps.initParticles (optionGetNumParticles ());
- ps.slowdown = optionGetSlowdown ();
- ps.darken = optionGetDarken ();
- ps.blendMode = (optionGetBlend()) ? GL_ONE :
- GL_ONE_MINUS_SRC_ALPHA;
- ps.active = true;
-
- glGenTextures(1, &ps.tex);
- glBindTexture(GL_TEXTURE_2D, ps.tex);
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, starTex);
- glBindTexture(GL_TEXTURE_2D, 0);
+ ps.slowdown = optionGetSlowdown ();
+ ps.darken = optionGetDarken ();
+ ps.blendMode = (optionGetBlend()) ? GL_ONE : GL_ONE_MINUS_SRC_ALPHA;
+ ps.active = true;
+
+ glGenTextures (1, &ps.tex);
+ glBindTexture (GL_TEXTURE_2D, ps.tex);
+
+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+
+ glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, starTex);
+ glBindTexture (GL_TEXTURE_2D, 0);
}
rot = fmod (rot + (((float)f_time / 1000.0) * 2 * M_PI *
- optionGetRotationSpeed ()), 2 * M_PI);
+ optionGetRotationSpeed ()), 2 * M_PI);
if (ps.active)
{
@@ -546,10 +575,10 @@
bool
ShowmouseScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- CompOutput *output,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ CompOutput *output,
+ unsigned int mask)
{
GLMatrix sTransform = transform;
=== modified file 'plugins/showrepaint/src/showrepaint.cpp'
--- plugins/showrepaint/src/showrepaint.cpp 2013-05-09 13:43:07 +0000
+++ plugins/showrepaint/src/showrepaint.cpp 2013-07-21 23:03:28 +0000
@@ -52,9 +52,13 @@
glColor4usv (color);
glPushMatrix ();
glLoadMatrixf (sTransform.getMatrix ());
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
glBegin (GL_QUADS);
+
foreach (const CompRect &box, tmpRegion.rects ())
{
glVertex2i (box.x1 (), box.y1 ());
=== modified file 'plugins/snap/src/snap.cpp'
--- plugins/snap/src/snap.cpp 2013-05-09 13:43:07 +0000
+++ plugins/snap/src/snap.cpp 2013-07-21 23:03:28 +0000
@@ -56,7 +56,10 @@
}
void
-SnapWindow::resize (int dx, int dy, int dwidth, int dheight)
+SnapWindow::resize (int dx,
+ int dy,
+ int dwidth,
+ int dheight)
{
const CompWindow::Geometry &geometry = window->serverGeometry ();
skipNotify = true;
@@ -68,7 +71,7 @@
void
SnapWindow::addEdge (Window id,
- int position,
+ int position,
int start,
int end,
EdgeType type,
@@ -92,7 +95,8 @@
* Add an edge for each rectangle of the region
*/
void
-SnapWindow::addRegionEdges (Edge *parent, CompRegion region)
+SnapWindow::addRegionEdges (Edge *parent,
+ CompRegion region)
{
int position, start, end;
@@ -100,20 +104,22 @@
{
switch (parent->type)
{
- case LeftEdge:
- case RightEdge:
- position = r.x1 ();
- start = r.y1 ();
- end = r.y2 ();
- break;
- case TopEdge:
- case BottomEdge:
- default:
- position = r.y1 ();
- start = r.x1 ();
- end = r.x2 ();
+ case LeftEdge:
+ case RightEdge:
+ position = r.x1 ();
+ start = r.y1 ();
+ end = r.y2 ();
+ break;
+
+ case TopEdge:
+ case BottomEdge:
+ default:
+ position = r.y1 ();
+ start = r.x1 ();
+ end = r.x2 ();
+ break;
}
-
+
addEdge (parent->id, position, start, end,
parent->type, parent->screenEdge);
edges.back ().passed = parent->passed;
@@ -124,7 +130,6 @@
* not visible, returns false. If it's a panel and we're
* snapping to screen edges, it's considered a snap-window.
*/
-
#define UNLIKELY(x) __builtin_expect(!!(x),0)
static inline bool
@@ -132,16 +137,18 @@
{
SNAP_SCREEN (screen);
- if (UNLIKELY(!w))
- return false;
- if (!w->isViewable ())
- return false;
+ if (UNLIKELY(!w) ||
+ !w->isViewable ())
+ return false;
+
if ((w->type () & SNAP_WINDOW_TYPE) &&
(ss->optionGetEdgesCategoriesMask () & EdgesCategoriesWindowEdgesMask))
return true;
+
if (w->struts () &&
(ss->optionGetEdgesCategoriesMask () & EdgesCategoriesScreenEdgesMask))
return true;
+
return false;
}
@@ -160,15 +167,13 @@
// First add all the windows
foreach (CompWindow *w, screen->windows ())
{
-
// Just check that we're not trying to snap to current window,
// that the window is not invisible and of a valid type
if (w == window || !isSnapWindow (w))
- {
continue;
- }
input = w->serverBorderRect ();
+
addEdge (w->id (), input.top (), input.left (),
input.right (), TopEdge, false);
addEdge (w->id (), input.bottom (), input.left (),
@@ -199,6 +204,7 @@
{
if (e->id == w->id ())
e->passed = true;
+
++it;
continue;
}
@@ -212,6 +218,7 @@
1,
e->end - e->start);
break;
+
case TopEdge:
case BottomEdge:
default:
@@ -219,6 +226,7 @@
e->position,
e->end - e->start,
1);
+ break;
}
// If the edge is in the window region, remove it,
@@ -226,9 +234,7 @@
edgeRegion = CompRegion (rect);
resultRegion = edgeRegion - w->region ();
if (resultRegion.isEmpty ())
- {
remove = true;
- }
else if (edgeRegion != resultRegion)
{
addRegionEdges (e, resultRegion);
@@ -241,9 +247,7 @@
remove = false;
}
else
- {
++it;
- }
}
}
}
@@ -263,6 +267,7 @@
foreach (CompOutput output, screen->outputDevs ())
{
const CompRect& area = output.workArea ();
+
addEdge (0, area.top (), area.left (), area.right () - 1,
BottomEdge, true);
addEdge (0, area.bottom (), area.left (), area.right () - 1,
@@ -300,6 +305,7 @@
1,
e->end - e->start);
break;
+
case TopEdge:
case BottomEdge:
default:
@@ -307,14 +313,14 @@
e->position,
e->end - e->start,
1);
+ break;
}
- edgeRegion = CompRegion (rect);
+ edgeRegion = CompRegion (rect);
resultRegion = edgeRegion - w->region ();
+
if (resultRegion.isEmpty ())
- {
remove = true;
- }
else if (edgeRegion != resultRegion)
{
addRegionEdges (e, resultRegion);
@@ -327,9 +333,7 @@
remove = false;
}
else
- {
++it;
- }
}
}
}
@@ -358,12 +362,12 @@
* snapDirection : just an helper, related to type
*/
void
-SnapWindow::moveCheckNearestEdge (int position,
- int start,
- int end,
- bool before,
+SnapWindow::moveCheckNearestEdge (int position,
+ int start,
+ int end,
+ bool before,
EdgeType type,
- int snapDirection)
+ int snapDirection)
{
SNAP_SCREEN (screen);
@@ -407,20 +411,24 @@
edge->snapped = true;
switch (type)
{
- case LeftEdge:
- move (min, 0, false);
- break;
- case RightEdge:
- move (-min, 0, false);
- break;
- case TopEdge:
- move (0, min, false);
- break;
- case BottomEdge:
- move (0, -min, false);
- break;
- default:
- break;
+ case LeftEdge:
+ move (min, 0, false);
+ break;
+
+ case RightEdge:
+ move (-min, 0, false);
+ break;
+
+ case TopEdge:
+ move (0, min, false);
+ break;
+
+ case BottomEdge:
+ move (0, -min, false);
+ break;
+
+ default:
+ break;
}
}
}
@@ -433,6 +441,7 @@
SnapWindow::moveCheckEdges (int snapDirection)
{
CompRect input (window->serverBorderRect ());
+
moveCheckNearestEdge (input.left (), input.top (), input.bottom (),
true, RightEdge, HorizontalSnap & snapDirection);
moveCheckNearestEdge (input.right (), input.top (), input.bottom (),
@@ -449,12 +458,12 @@
* Similar function for Snap on Resize
*/
void
-SnapWindow::resizeCheckNearestEdge (int position,
- int start,
- int end,
- bool before,
+SnapWindow::resizeCheckNearestEdge (int position,
+ int start,
+ int end,
+ bool before,
EdgeType type,
- int snapDirection)
+ int snapDirection)
{
SNAP_SCREEN (screen);
@@ -499,20 +508,24 @@
edge->snapped = true;
switch (type)
{
- case LeftEdge:
- resize (min, 0, 0, 0);
- break;
- case RightEdge:
- resize (-min, 0, 0, 0);
- break;
- case TopEdge:
- resize (0, min, 0, 0);
- break;
- case BottomEdge:
- resize (0, -min, 0, 0);
- break;
- default:
- break;
+ case LeftEdge:
+ resize (min, 0, 0, 0);
+ break;
+
+ case RightEdge:
+ resize (-min, 0, 0, 0);
+ break;
+
+ case TopEdge:
+ resize (0, min, 0, 0);
+ break;
+
+ case BottomEdge:
+ resize (0, -min, 0, 0);
+ break;
+
+ default:
+ break;
}
}
}
@@ -522,7 +535,10 @@
* Call the previous function for each of the 4 sides of the window
*/
void
-SnapWindow::resizeCheckEdges (int dx, int dy, int dwidth, int dheight)
+SnapWindow::resizeCheckEdges (int dx,
+ int dy,
+ int dwidth,
+ int dheight)
{
CompRect input (window->serverBorderRect ());
@@ -549,6 +565,7 @@
XkbStateNotifyEvent *stateEvent = (XkbStateNotifyEvent *) event;
unsigned int mods = 0xffffffff;
+
if (avoidSnapMask)
mods = avoidSnapMask;
@@ -596,6 +613,7 @@
if (!snapGeometry.isEmpty () && snapDirection & HorizontalSnap)
{
m_dx += dx;
+
if (m_dx < ss->optionGetResistanceDistance ()
&& m_dx > -ss->optionGetResistanceDistance ())
{
@@ -608,16 +626,17 @@
if (!m_dwidth)
snapDirection &= VerticalSnap;
}
+
m_dwidth += dwidth;
+
if (m_dwidth < ss->optionGetResistanceDistance ()
&& m_dwidth > -ss->optionGetResistanceDistance ())
- {
resize (0, 0, -dwidth, 0);
- }
else
{
resize (0, 0, m_dwidth - dwidth, 0);
m_dwidth = 0;
+
if (!m_dx)
snapDirection &= VerticalSnap;
}
@@ -627,24 +646,23 @@
if (snapGeometry.isEmpty () && snapDirection & VerticalSnap)
{
m_dy += dy;
+
if (m_dy < ss->optionGetResistanceDistance ()
&& m_dy > -ss->optionGetResistanceDistance ())
- {
resize (0, -dy, 0, 0);
- }
else
{
resize (0, m_dy - dy, 0, 0);
m_dy = 0;
+
if (!m_dheight)
snapDirection &= HorizontalSnap;
}
m_dheight += dheight;
+
if (m_dheight < ss->optionGetResistanceDistance ()
&& m_dheight > -ss->optionGetResistanceDistance ())
- {
resize (0, 0, 0, -dheight);
- }
else
{
resize (0, 0, 0, m_dheight - dheight);
@@ -685,7 +703,9 @@
}
void
-SnapWindow::moveNotify (int dx, int dy, bool immediate)
+SnapWindow::moveNotify (int dx,
+ int dy,
+ bool immediate)
{
unsigned int allowedSnapDirection = VerticalSnap | HorizontalSnap;
SNAP_SCREEN (screen);
@@ -733,11 +753,10 @@
if (!snapGeometry.isEmpty () && snapDirection & HorizontalSnap)
{
m_dx += dx;
+
if (m_dx < ss->optionGetResistanceDistance ()
&& m_dx > -ss->optionGetResistanceDistance ())
- {
move (-dx, 0, false);
- }
else
{
move (m_dx - dx, 0, true);
@@ -745,15 +764,15 @@
snapDirection &= VerticalSnap;
}
}
+
// Same for vertical snapping and dy
if (!snapGeometry.isEmpty () && snapDirection & VerticalSnap)
{
m_dy += dy;
+
if (m_dy < ss->optionGetResistanceDistance ()
&& m_dy > -ss->optionGetResistanceDistance ())
- {
move (0, -dy, false);
- }
else
{
move (0, m_dy - dy, true);
@@ -765,6 +784,7 @@
if (!snapGeometry.isEmpty () && !snapDirection)
snapGeometry = CompWindow::Geometry ();
}
+
// If we don't already snap vertically and horizontally,
// check edges status
if (snapDirection != (VerticalSnap | HorizontalSnap))
@@ -775,7 +795,10 @@
* Initiate snap, get edges
*/
void
-SnapWindow::grabNotify (int x, int y, unsigned int state, unsigned int mask)
+SnapWindow::grabNotify (int x,
+ int y,
+ unsigned int state,
+ unsigned int mask)
{
grabbed = (mask & CompWindowGrabResizeMask) ? ResizeGrab : MoveGrab;
updateEdges ();
@@ -803,26 +826,29 @@
// Internal stuff --------------------------------------------------------------
void
-SnapScreen::optionChanged (CompOption *opt, SnapOptions::Options num)
+SnapScreen::optionChanged (CompOption *opt,
+ SnapOptions::Options num)
{
switch (num)
{
- case SnapOptions::AvoidSnap:
- {
- unsigned int mask = optionGetAvoidSnapMask ();
- avoidSnapMask = 0;
- if (mask & AvoidSnapShiftMask)
- avoidSnapMask |= ShiftMask;
- if (mask & AvoidSnapAltMask)
- avoidSnapMask |= CompAltMask;
- if (mask & AvoidSnapControlMask)
- avoidSnapMask |= ControlMask;
- if (mask & AvoidSnapMetaMask)
- avoidSnapMask |= CompMetaMask;
- }
-
- default:
- break;
+ case SnapOptions::AvoidSnap:
+ {
+ unsigned int mask = optionGetAvoidSnapMask ();
+ avoidSnapMask = 0;
+
+ if (mask & AvoidSnapShiftMask)
+ avoidSnapMask |= ShiftMask;
+ if (mask & AvoidSnapAltMask)
+ avoidSnapMask |= CompAltMask;
+ if (mask & AvoidSnapControlMask)
+ avoidSnapMask |= ControlMask;
+ if (mask & AvoidSnapMetaMask)
+ avoidSnapMask |= CompMetaMask;
+ }
+ break;
+
+ default:
+ break;
}
}
=== modified file 'plugins/snap/src/snap.h'
--- plugins/snap/src/snap.h 2012-05-18 06:52:20 +0000
+++ plugins/snap/src/snap.h 2013-07-21 23:03:28 +0000
@@ -64,16 +64,16 @@
*/
typedef struct
{
- int position;
- int start;
- int end;
+ int position;
+ int start;
+ int end;
EdgeType type;
- bool screenEdge;
-
- Window id;
- bool passed;
-
- bool snapped;
+ bool screenEdge;
+
+ Window id;
+ bool passed;
+
+ bool snapped;
} Edge;
class SnapScreen :
@@ -82,16 +82,23 @@
public SnapOptions
{
public:
+
bool snapping;
SnapScreen (CompScreen *s);
void handleEvent (XEvent *event);
- bool enableSnapping (CompAction *action, CompAction::State state,
+
+ bool enableSnapping (CompAction *action,
+ CompAction::State state,
CompOption::Vector &options);
- bool disableSnapping (CompAction *action, CompAction::State state,
+
+ bool disableSnapping (CompAction *action,
+ CompAction::State state,
CompOption::Vector &options);
- void optionChanged (CompOption *opt, SnapOptions::Options num);
+
+ void optionChanged (CompOption *opt,
+ SnapOptions::Options num);
private:
// used to allow moving windows without snapping
@@ -103,54 +110,95 @@
public PluginClassHandler
{
public:
+
SnapWindow (CompWindow *window);
~SnapWindow ();
- void resizeNotify (int dx, int dy, int dwidth, int dheight);
- void moveNotify (int dx, int dy, bool immediate);
- void grabNotify (int x, int y, unsigned int state, unsigned int mask);
+ void resizeNotify (int dx,
+ int dy,
+ int dwidth,
+ int dheight);
+
+ void moveNotify (int dx,
+ int dy,
+ bool immediate);
+
+ void grabNotify (int x,
+ int y,
+ unsigned int state,
+ unsigned int mask);
+
void stateChangeNotify (unsigned int lastState);
+
void ungrabNotify ();
private:
- CompWindow *window;
+
+ CompWindow *window;
// linked lists
- std::list edges;
+ std::list edges;
// bitfield
- int snapDirection;
+ int snapDirection;
// dx/dy/dw/dh when a window is resisting to user
- int m_dx;
- int m_dy;
- int m_dwidth;
- int m_dheight;
+ int m_dx;
+ int m_dy;
+ int m_dwidth;
+ int m_dheight;
// internals
CompWindow::Geometry snapGeometry;
- int grabbed;
+ int grabbed;
// internal, avoids infinite notify loops
- bool skipNotify;
-
- void move (int dx, int dy, bool sync);
- void resize (int dx, int dy, int dwidth, int dheight);
-
- void addEdge (Window id, int position, int start, int end,
- EdgeType type, bool screenEdge);
+ bool skipNotify;
+
+ void move (int dx,
+ int dy,
+ bool sync);
+
+ void resize (int dx,
+ int dy,
+ int dwidth,
+ int dheight);
+
+ void addEdge (Window id,
+ int position,
+ int start,
+ int end,
+ EdgeType type,
+ bool screenEdge);
+
void addRegionEdges (Edge *parent, CompRegion region);
+
void updateWindowsEdges ();
+
void updateScreenEdges ();
+
void updateEdges ();
- void moveCheckNearestEdge (int position, int start, int end,
- bool before, EdgeType type,
- int snapDirection);
+
+ void moveCheckNearestEdge (int position,
+ int start,
+ int end,
+ bool before,
+ EdgeType type,
+ int snapDirection);
+
void moveCheckEdges (int snapDirection);
- void resizeCheckNearestEdge (int position, int start, int end,
- bool before, EdgeType type,
- int snapDirection);
- void resizeCheckEdges (int dx, int dy, int dwidth, int dheight);
+
+ void resizeCheckNearestEdge (int position,
+ int start,
+ int end,
+ bool before,
+ EdgeType type,
+ int snapDirection);
+
+ void resizeCheckEdges (int dx,
+ int dy,
+ int dwidth,
+ int dheight);
};
#define SNAP_SCREEN(s) \
@@ -165,4 +213,3 @@
public:
bool init ();
};
-
=== modified file 'plugins/splash/splash.xml.in'
--- plugins/splash/splash.xml.in 2012-10-15 10:31:51 +0000
+++ plugins/splash/splash.xml.in 2013-07-21 23:03:28 +0000
@@ -21,7 +21,7 @@
<_short>Main
- <_short>Initiate Splash
+ <_short>Initiate Splash Key
<_long>Start Splash.
<Control>F11
@@ -35,13 +35,13 @@
<_short>Images
<_short>Background File
- <_long>Background image File.
+ <_long>The background image file.
file;image;
splash_background.png
<_short>Logo File
- <_long>Logo image File.
+ <_long>The logo image file.
file;image;
splash_logo.png
@@ -64,6 +64,14 @@
100.0
0.1
+
+ <_short>Opacity
+ <_long>Background opacity.
+ 100.0
+ 0.0
+ 100.0
+ 0.1
+
<_short>Saturation
<_long>Background saturation.
=== modified file 'plugins/splash/src/splash.cpp'
--- plugins/splash/src/splash.cpp 2013-05-09 13:43:07 +0000
+++ plugins/splash/src/splash.cpp 2013-07-21 23:03:28 +0000
@@ -23,8 +23,8 @@
COMPIZ_PLUGIN_20090315 (splash, SplashPluginVTable);
-const std::string SPLASH_BACKGROUND_DEFAULT("");
-const std::string SPLASH_LOGO_DEFAULT("");
+const std::string SPLASH_BACKGROUND_DEFAULT ("");
+const std::string SPLASH_LOGO_DEFAULT ("");
void
SplashScreen::preparePaint (int ms)
@@ -35,7 +35,7 @@
if (fade_in < 0)
{
- time += fade_in;
+ time += fade_in;
fade_in = 0;
if (time < 0)
@@ -52,10 +52,10 @@
}
}
- if (initiate)
+ if (initiate && !active)
{
- fade_in = fade_out = optionGetFadeTime () * 1000.0;
- time = optionGetDisplayTime () * 1000.0;
+ fade_in = fade_out = optionGetFadeTime () * 1000.0;
+ time = optionGetDisplayTime () * 1000.0;
initiate = false;
}
@@ -67,17 +67,13 @@
if (!hasInit)
{
hasInit = true;
- mMove = 0.0;
+ mMove = 0.0;
CompString back_s (optionGetBackground ());
CompString logo_s (optionGetLogo ());
CompString pname ("splash");
- back_img =
- GLTexture::readImageToTexture (back_s, pname,
- backSize);
- logo_img =
- GLTexture::readImageToTexture (logo_s, pname,
- logoSize);
+ back_img = GLTexture::readImageToTexture (back_s, pname, backSize);
+ logo_img = GLTexture::readImageToTexture (logo_s, pname, logoSize);
if (!back_img.size ())
{
@@ -86,12 +82,10 @@
GLTexture::readImageToTexture (defaultBack, pname, backSize);
if (back_img.size ())
- {
compLogMessage ("splash", CompLogLevelWarn,
"Could not load splash background image "
"\"%s\" using default!",
back_s.c_str () );
- }
}
if (!logo_img.size ())
@@ -101,12 +95,10 @@
GLTexture::readImageToTexture (defaultLogo, pname, logoSize);
if (logo_img.size ())
- {
compLogMessage ("splash", CompLogLevelWarn,
"Could not load splash logo image "
"\"%s\" using default!",
logo_s.c_str () );
- }
}
if (!back_img.size ())
@@ -127,9 +119,9 @@
if (hasInit)
hasInit = false;
- cScreen->preparePaintSetEnabled (this, false);
+ cScreen->preparePaintSetEnabled (this, false);
gScreen->glPaintOutputSetEnabled (this, false);
- cScreen->donePaintSetEnabled (this, false);
+ cScreen->donePaintSetEnabled (this, false);
foreach (CompWindow *w, screen->windows ())
{
@@ -137,11 +129,9 @@
sw->gWindow->glPaintSetEnabled (sw, false);
}
-
}
cScreen->preparePaint (ms);
-
}
void
@@ -156,13 +146,14 @@
static CompRect
splashGetCurrentOutputRect ()
{
- int root_x = 0, root_y = 0;
- int ignore_i;
+ int root_x = 0, root_y = 0;
+ int ignore_i;
unsigned int ignore_ui;
- int output;
- Window ignore_w;
-
-
+ int output;
+ Window ignore_w;
+
+ /* TODO: Fix me, because I am always centered between multiple screens
+ * Ideally my position should be configurable via CCSM */
if (screen->outputDevs ().size () == 1)
output = 0;
else
@@ -175,20 +166,17 @@
CompRect rect (screen->outputDevs ()[output]);
return rect;
-
}
bool
SplashScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- CompOutput *output,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ CompOutput *output,
+ unsigned int mask)
{
- GLMatrix sTransform = transform;
- GLVertexBuffer *stream = GLVertexBuffer::streamingBuffer ();
-
- bool status = true;
+ GLMatrix sTransform = transform;
+ GLVertexBuffer *stream = GLVertexBuffer::streamingBuffer ();
float alpha = 0.0;
@@ -196,29 +184,32 @@
{
alpha = (1.0 - (fade_in / (optionGetFadeTime () * 1000.0) ) ) *
(fade_out / (optionGetFadeTime () * 1000.0) );
- saturation = 1.0 -
- ((1.0 - (optionGetSaturation () / 100.0) ) * alpha);
- brightness = 1.0 -
- ((1.0 - (optionGetBrightness () / 100.0) ) * alpha);
+ opacity = 1.0 - ((1.0 - (optionGetOpacity () / 100.0) ) * alpha);
+ saturation = 1.0 - ((1.0 - (optionGetSaturation () / 100.0) ) * alpha);
+ brightness = 1.0 - ((1.0 - (optionGetBrightness () / 100.0) ) * alpha);
}
- status = gScreen->glPaintOutput (attrib, transform, region, output, mask);
+ bool status = gScreen->glPaintOutput (attrib, transform, region, output, mask);
if (!active)
return status;
sTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA);
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
if (back_img.size ())
{
int x, y;
- for (x = 0; x < MESH_W; x++)
+ for (x = 0; x < MESH_W; ++x)
{
- for (y = 0; y < MESH_H; y++)
+ for (y = 0; y < MESH_H; ++y)
{
mesh[x][y][0] =
(x / (MESH_W - 1.0) ) +
@@ -233,21 +224,23 @@
{
tex->enable (GLTexture::Good);
+ int backWidth = backSize.width ();
+ int backHeight = backSize.height ();
+
if (!screen->outputDevs ().size () > 1)
{
- CompRect headOutputRect =
- splashGetCurrentOutputRect ();
+ CompRect headOutputRect = splashGetCurrentOutputRect ();
- x = (headOutputRect.width () - backSize.width ()) / 2;
- y = (headOutputRect.height () - backSize.height ()) / 2;
+ x = (headOutputRect.width () - backWidth) / 2;
+ y = (headOutputRect.height () - backHeight) / 2;
x += headOutputRect.x ();
y += headOutputRect.y ();
}
else
{
- x = (screen->width () - backSize.width ()) / 2;
- y = (screen->height () - backSize.height ()) / 2;
+ x = (screen->width () - backWidth) / 2;
+ y = (screen->height () - backHeight) / 2;
}
GLTexture::Matrix mat = tex->matrix ();
@@ -259,58 +252,58 @@
std::vector coords;
std::vector vertices;
- coords.reserve (12 * (MESH_W - 1) * (MESH_H - 1));
+ coords.reserve (12 * (MESH_W - 1) * (MESH_H - 1));
vertices.reserve (18 * (MESH_W - 1) * (MESH_H - 1));
- for (x = 0; x < MESH_W - 1; x++)
+ for (x = 0; x < MESH_W - 1; ++x)
{
- for (y = 0; y < MESH_H - 1; y++)
+ for (y = 0; y < MESH_H - 1; ++y)
{
- cx1 = (x / (MESH_W - 1.0) ) * backSize.width ();
- cx2 = ( (x + 1) / (MESH_W - 1.0) ) * backSize.width ();
- cy1 = (y / (MESH_H - 1.0) ) * backSize.height ();
- cy2 = ( (y + 1) / (MESH_H - 1.0) ) * backSize.height ();
-
- coords.push_back (COMP_TEX_COORD_X (mat, cx1));
- coords.push_back (COMP_TEX_COORD_Y (mat, cy1));
-
- coords.push_back (COMP_TEX_COORD_X (mat, cx1));
- coords.push_back (COMP_TEX_COORD_Y (mat, cy2));
-
- coords.push_back (COMP_TEX_COORD_X (mat, cx2));
- coords.push_back (COMP_TEX_COORD_Y (mat, cy2));
-
- coords.push_back (COMP_TEX_COORD_X (mat, cx2));
- coords.push_back (COMP_TEX_COORD_Y (mat, cy2));
-
- coords.push_back (COMP_TEX_COORD_X (mat, cx2));
- coords.push_back (COMP_TEX_COORD_Y (mat, cy1));
-
- coords.push_back (COMP_TEX_COORD_X (mat, cx1));
- coords.push_back (COMP_TEX_COORD_Y (mat, cy1));
-
- vertices.push_back (mesh[x][y][0] * backSize.width ());
- vertices.push_back (mesh[x][y][1] * backSize.height ());
- vertices.push_back (0.0f);
-
- vertices.push_back (mesh[x][y + 1][0] * backSize.width ());
- vertices.push_back (mesh[x][y + 1][1] * backSize.height ());
- vertices.push_back (0.0f);
-
- vertices.push_back (mesh[x + 1][y + 1][0] * backSize.width ());
- vertices.push_back (mesh[x + 1][y + 1][1] * backSize.height ());
- vertices.push_back (0.0f);
-
- vertices.push_back (mesh[x + 1][y + 1][0] * backSize.width ());
- vertices.push_back (mesh[x + 1][y + 1][1] * backSize.height ());
- vertices.push_back (0.0f);
-
- vertices.push_back (mesh[x + 1][y][0] * backSize.width ());
- vertices.push_back (mesh[x + 1][y][1] * backSize.height ());
- vertices.push_back (0.0f);
-
- vertices.push_back (mesh[x][y][0] * backSize.width ());
- vertices.push_back (mesh[x][y][1] * backSize.height ());
+ cx1 = (x / (MESH_W - 1.0) ) * backWidth;
+ cx2 = ( (x + 1) / (MESH_W - 1.0) ) * backWidth;
+ cy1 = (y / (MESH_H - 1.0) ) * backHeight;
+ cy2 = ( (y + 1) / (MESH_H - 1.0) ) * backHeight;
+
+ coords.push_back (COMP_TEX_COORD_X (mat, cx1));
+ coords.push_back (COMP_TEX_COORD_Y (mat, cy1));
+
+ coords.push_back (COMP_TEX_COORD_X (mat, cx1));
+ coords.push_back (COMP_TEX_COORD_Y (mat, cy2));
+
+ coords.push_back (COMP_TEX_COORD_X (mat, cx2));
+ coords.push_back (COMP_TEX_COORD_Y (mat, cy2));
+
+ coords.push_back (COMP_TEX_COORD_X (mat, cx2));
+ coords.push_back (COMP_TEX_COORD_Y (mat, cy2));
+
+ coords.push_back (COMP_TEX_COORD_X (mat, cx2));
+ coords.push_back (COMP_TEX_COORD_Y (mat, cy1));
+
+ coords.push_back (COMP_TEX_COORD_X (mat, cx1));
+ coords.push_back (COMP_TEX_COORD_Y (mat, cy1));
+
+ vertices.push_back (mesh[x][y][0] * backWidth);
+ vertices.push_back (mesh[x][y][1] * backHeight);
+ vertices.push_back (0.0f);
+
+ vertices.push_back (mesh[x][y + 1][0] * backWidth);
+ vertices.push_back (mesh[x][y + 1][1] * backHeight);
+ vertices.push_back (0.0f);
+
+ vertices.push_back (mesh[x + 1][y + 1][0] * backWidth);
+ vertices.push_back (mesh[x + 1][y + 1][1] * backHeight);
+ vertices.push_back (0.0f);
+
+ vertices.push_back (mesh[x + 1][y + 1][0] * backWidth);
+ vertices.push_back (mesh[x + 1][y + 1][1] * backHeight);
+ vertices.push_back (0.0f);
+
+ vertices.push_back (mesh[x + 1][y][0] * backWidth);
+ vertices.push_back (mesh[x + 1][y][1] * backHeight);
+ vertices.push_back (0.0f);
+
+ vertices.push_back (mesh[x][y][0] * backWidth);
+ vertices.push_back (mesh[x][y][1] * backHeight);
vertices.push_back (0.0f);
}
}
@@ -319,6 +312,7 @@
stream->color4f (1.0, 1.0, 1.0, alpha);
stream->addVertices (vertices.size () / 3, &vertices[0]);
stream->addTexCoords (0, coords.size () / 2, &coords[0]);
+
if (stream->end ())
stream->render (sTransform);
@@ -327,47 +321,47 @@
CompRect headOutputRect =
splashGetCurrentOutputRect ();
- x = (headOutputRect.width () - backSize.width ()) / 2;
- y = (headOutputRect.height () - backSize.height ()) / 2;
+ x = (headOutputRect.width () - backWidth) / 2;
+ y = (headOutputRect.height () - backHeight) / 2;
x += headOutputRect.x ();
y += headOutputRect.y ();
}
else
{
- x = (screen->width () - backSize.width ()) / 2;
- y = (screen->height () - backSize.height ()) / 2;
+ x = (screen->width () - backWidth) / 2;
+ y = (screen->height () - backHeight) / 2;
}
sTransform.translate (-x, -y, 0);
tex->disable ();
-
}
}
if (logo_img.size ())
{
- foreach (GLTexture* tex, logo_img)
+ foreach (GLTexture *tex, logo_img)
{
tex->enable (GLTexture::Good);
int x, y;
+ int logoWidth = logoSize.width ();
+ int logoHeight = logoSize.height ();
if (screen->outputDevs ().size () > 1)
{
- CompRect headOutputRect =
- splashGetCurrentOutputRect ();
+ CompRect headOutputRect = splashGetCurrentOutputRect ();
- x = (headOutputRect.width () - logoSize.width ()) / 2;
- y = (headOutputRect.height () - logoSize.height ()) / 2;
+ x = (headOutputRect.width () - logoWidth) / 2;
+ y = (headOutputRect.height () - logoHeight) / 2;
x += headOutputRect.x ();
y += headOutputRect.y ();
}
else
{
- x = (screen->width () - logoSize.width ()) / 2;
- y = (screen->height () - logoSize.height ()) / 2;
+ x = (screen->width () - logoWidth) / 2;
+ y = (screen->height () - logoHeight) / 2;
}
GLTexture::Matrix mat = tex->matrix ();
@@ -377,41 +371,41 @@
GLfloat coords[12];
GLfloat vertices[18];
- coords[0] = COMP_TEX_COORD_X (mat, 0);
- coords[1] = COMP_TEX_COORD_Y (mat, 0);
-
- coords[2] = COMP_TEX_COORD_X (mat, 0);
- coords[3] = COMP_TEX_COORD_Y (mat, logoSize.height ());
-
- coords[4] = COMP_TEX_COORD_X (mat, logoSize.width ());
- coords[5] = COMP_TEX_COORD_Y (mat, logoSize.height ());
-
- coords[6] = COMP_TEX_COORD_X (mat, logoSize.width ());
- coords[7] = COMP_TEX_COORD_Y (mat, logoSize.height ());
-
- coords[8] = COMP_TEX_COORD_X (mat, logoSize.width ());
- coords[9] = COMP_TEX_COORD_Y (mat, 0);
+ coords[0] = COMP_TEX_COORD_X (mat, 0);
+ coords[1] = COMP_TEX_COORD_Y (mat, 0);
+
+ coords[2] = COMP_TEX_COORD_X (mat, 0);
+ coords[3] = COMP_TEX_COORD_Y (mat, logoHeight);
+
+ coords[4] = COMP_TEX_COORD_X (mat, logoWidth);
+ coords[5] = COMP_TEX_COORD_Y (mat, logoHeight);
+
+ coords[6] = COMP_TEX_COORD_X (mat, logoWidth);
+ coords[7] = COMP_TEX_COORD_Y (mat, logoHeight);
+
+ coords[8] = COMP_TEX_COORD_X (mat, logoWidth);
+ coords[9] = COMP_TEX_COORD_Y (mat, 0);
coords[10] = COMP_TEX_COORD_X (mat, 0);
coords[11] = COMP_TEX_COORD_Y (mat, 0);
- vertices[0] = 0;
- vertices[1] = 0;
- vertices[2] = 0;
-
- vertices[3] = 0;
- vertices[4] = logoSize.height ();
- vertices[5] = 0;
-
- vertices[6] = logoSize.width ();
- vertices[7] = logoSize.height ();
- vertices[8] = 0;
-
- vertices[9] = logoSize.width ();
- vertices[10] = logoSize.height ();
+ vertices[0] = 0;
+ vertices[1] = 0;
+ vertices[2] = 0;
+
+ vertices[3] = 0;
+ vertices[4] = logoHeight;
+ vertices[5] = 0;
+
+ vertices[6] = logoWidth;
+ vertices[7] = logoHeight;
+ vertices[8] = 0;
+
+ vertices[9] = logoWidth;
+ vertices[10] = logoHeight;
vertices[11] = 0;
- vertices[12] = logoSize.width ();
+ vertices[12] = logoWidth;
vertices[13] = 0;
vertices[14] = 0;
@@ -423,6 +417,7 @@
stream->color4f (1.0, 1.0, 1.0, alpha);
stream->addVertices (6, vertices);
stream->addTexCoords (0, 6, coords);
+
if (stream->end ())
stream->render (sTransform);
@@ -434,14 +429,15 @@
glDisable (GL_BLEND);
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+
return status;
}
bool
SplashWindow::glPaint (const GLWindowPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ unsigned int mask)
{
bool status;
@@ -450,38 +446,38 @@
if (ss->active)
{
GLWindowPaintAttrib pA = attrib;
+ pA.opacity = (attrib.opacity * ss->opacity);
pA.brightness = (attrib.brightness * ss->brightness);
pA.saturation = (attrib.saturation * ss->saturation);
status = gWindow->glPaint (pA, transform, region, mask);
}
else
- {
status = gWindow->glPaint (attrib, transform, region, mask);
- }
return status;
}
-
bool
SplashScreen::initiateSplash (CompAction *action,
- CompAction::State state,
- CompOption::Vector options)
+ CompAction::State state,
+ CompOption::Vector options)
{
- initiate = true;
-
- cScreen->preparePaintSetEnabled (this, true);
- gScreen->glPaintOutputSetEnabled (this, true);
- cScreen->donePaintSetEnabled (this, true);
-
- foreach (CompWindow *w, screen->windows ())
+ if (initiate)
{
- SPLASH_WINDOW (w);
-
- sw->gWindow->glPaintSetEnabled (sw, true);
+ initiate = true;
+
+ cScreen->preparePaintSetEnabled (this, true);
+ gScreen->glPaintOutputSetEnabled (this, true);
+ cScreen->donePaintSetEnabled (this, true);
+
+ foreach (CompWindow *w, screen->windows ())
+ {
+ SPLASH_WINDOW (w);
+
+ sw->gWindow->glPaintSetEnabled (sw, true);
+ }
}
-
return false;
}
@@ -490,43 +486,45 @@
SplashScreen::SplashScreen (CompScreen *screen) :
PluginClassHandler (screen),
SplashOptions (),
- cScreen (CompositeScreen::get (screen)),
- gScreen (GLScreen::get (screen)),
+ cScreen (CompositeScreen::get (screen)),
+ gScreen (GLScreen::get (screen)),
splashAtom (XInternAtom (screen->dpy (), "_COMPIZ_WM_SPLASH", 0)),
- fade_in (0),
- fade_out (0),
- time (0),
- backSize (0, 0),
- logoSize (0, 0),
- hasInit (false),
- hasLogo (false),
- hasBack (false),
- mMove (0.0),
- brightness (0),
- saturation (0),
- initiate (false),
- active (false)
+ fade_in (0),
+ fade_out (0),
+ time (0),
+ backSize (0, 0),
+ logoSize (0, 0),
+ hasInit (false),
+ hasLogo (false),
+ hasBack (false),
+ mMove (0.0f),
+ opacity (0.0f),
+ brightness (0.0f),
+ saturation (0.0f),
+ initiate (optionGetFirststart ()),
+ active (false)
{
-
CompositeScreenInterface::setHandler (cScreen, false);
GLScreenInterface::setHandler (gScreen, false);
- if (optionGetFirststart () )
+ cScreen->preparePaintSetEnabled (this, initiate);
+ gScreen->glPaintOutputSetEnabled (this, initiate);
+ cScreen->donePaintSetEnabled (this, initiate);
+/*
+ if (initiate)
{
Atom actual;
- int result, format;
+ int format;
unsigned long n, left;
unsigned char *propData;
- result = XGetWindowProperty (screen->dpy (), screen->root (),
- splashAtom, 0L, 8192L, false,
- XA_INTEGER, &actual, &format,
- &n, &left, &propData);
+ int result = XGetWindowProperty (screen->dpy (), screen->root (),
+ splashAtom, 0L, 8192L, false,
+ XA_INTEGER, &actual, &format,
+ &n, &left, &propData);
if (result == Success && n && propData)
- {
XFree (propData);
- }
else
{
int value = 1;
@@ -535,19 +533,26 @@
(unsigned char *) &value, 1);
}
- initiate = true; // should fix later
-
- if (initiate)
+// initiateSplash ();
+
+// initiate = true; // should fix later
+
+ if (optionGetFirststart ())
{
cScreen->preparePaintSetEnabled (this, true);
gScreen->glPaintOutputSetEnabled (this, true);
cScreen->donePaintSetEnabled (this, true);
}
+ else
+ {
+ cScreen->preparePaintSetEnabled (this, false);
+ gScreen->glPaintOutputSetEnabled (this, false);
+ cScreen->donePaintSetEnabled (this, false);
+ }
}
-
+*/
optionSetInitiateKeyInitiate (boost::bind (&SplashScreen::initiateSplash,
- this, _1, _2, _3));
-
+ this, _1, _2, _3));
}
SplashWindow::SplashWindow (CompWindow *window) :
@@ -559,10 +564,9 @@
SPLASH_SCREEN (screen);
- if (ss->initiate)
- {
+ if (ss->initiate &&
+ !ss->active)
gWindow->glPaintSetEnabled (this, true);
- }
}
bool
=== modified file 'plugins/splash/src/splash.h'
--- plugins/splash/src/splash.h 2012-09-07 23:29:42 +0000
+++ plugins/splash/src/splash.h 2013-07-21 23:03:28 +0000
@@ -48,46 +48,52 @@
SplashScreen (CompScreen *);
CompositeScreen *cScreen;
- GLScreen *gScreen;
-
- Atom splashAtom;
-
- int fade_in;
- int fade_out;
- int time;
-
- GLTexture::List back_img, logo_img;
-
- CompSize backSize, logoSize;
- bool hasInit, hasLogo, hasBack;
-
- float mesh[MESH_W][MESH_H][2];
-
- float mMove;
-
- float brightness;
- float saturation;
-
- bool initiate;
- bool active;
+ GLScreen *gScreen;
+
+ Atom splashAtom;
+
+ int fade_in;
+ int fade_out;
+ int time;
+
+ GLTexture::List back_img;
+ GLTexture::List logo_img;
+
+ CompSize backSize;
+ CompSize logoSize;
+
+ bool hasInit;
+ bool hasLogo;
+ bool hasBack;
+
+ float mesh[MESH_W][MESH_H][2];
+
+ float mMove;
+
+ float opacity;
+ float brightness;
+ float saturation;
+
+ bool initiate;
+ bool active;
void
preparePaint (int);
bool
glPaintOutput (const GLScreenPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- CompOutput *output,
- unsigned int mask);
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ CompOutput *output,
+ unsigned int mask);
void
donePaint ();
bool
- initiateSplash (CompAction *,
- CompAction::State,
- CompOption::Vector);
+ initiateSplash (CompAction *,
+ CompAction::State ,
+ CompOption::Vector );
};
@@ -106,9 +112,9 @@
GLWindow *gWindow;
bool glPaint (const GLWindowPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
};
#define SPLASH_WINDOW(w) \
=== modified file 'plugins/stackswitch/src/stackswitch.cpp'
--- plugins/stackswitch/src/stackswitch.cpp 2013-05-11 09:30:49 +0000
+++ plugins/stackswitch/src/stackswitch.cpp 2013-07-21 23:03:28 +0000
@@ -62,13 +62,20 @@
else if (!window->focus ())
return false;
}
- else if (ss->mType == StackswitchTypeGroup &&
- ss->mClientLeader != window->clientLeader () &&
+ else if (ss->mType == StackswitchTypeGroup &&
+ ss->mClientLeader != window->clientLeader () &&
ss->mClientLeader != window->id ())
+<<<<<<< TREE
return false;
if (window->state () & CompWindowStateSkipTaskbarMask ||
!ss->mCurrentMatch.evaluate (window))
+=======
+ return false;
+
+ if (window->state () & CompWindowStateSkipTaskbarMask ||
+ !ss->mCurrentMatch.evaluate (window))
+>>>>>>> MERGE-SOURCE
return false;
return true;
@@ -113,13 +120,19 @@
}
void
-StackswitchScreen::drawWindowTitle (GLMatrix &transform,
+StackswitchScreen::drawWindowTitle (GLMatrix &transform,
CompWindow *w)
{
+<<<<<<< TREE
if (!textAvailable ||
!optionGetWindowTitle ())
return;
+=======
+ if (!textAvailable || !optionGetWindowTitle ())
+ return;
+
+>>>>>>> MERGE-SOURCE
GLint oldBlendSrc, oldBlendDst;
GLMatrix wTransform (transform);
float y;
@@ -129,11 +142,21 @@
CompRect oe = screen->getCurrentOutputExtents ();
- float width = mText.getWidth ();
- float height = mText.getHeight ();
-
- float x = oe.centerX ();
- float tx = x - width / 2;
+<<<<<<< TREE
+ float width = mText.getWidth ();
+ float height = mText.getHeight ();
+
+ float x = oe.centerX ();
+ float tx = x - width / 2;
+=======
+ float width = mText.getWidth ();
+ float height = mText.getHeight ();
+
+ float x = oe.centerX ();
+ float tx = x - width / 2;
+
+ unsigned short verticalOffset = optionGetVerticalOffset ();
+>>>>>>> MERGE-SOURCE
switch (optionGetTitleTextPlacement ())
{
@@ -150,8 +173,8 @@
wTransform.rotate (-mRotation, 1.0, 0.0, 0.0);
wTransform.scale (sw->mScale, sw->mScale, 1.0);
wTransform.translate (+w->border ().left, 0.0 - (w->height () +
- w->border ().bottom),
- 0.0f);
+ w->border ().bottom),
+ 0.0f);
wTransform.translate (-w->x (), -w->y (), 0.0f);
GLMatrix mvp = pm * wTransform;
@@ -174,17 +197,31 @@
case StackswitchOptions::TitleTextPlacementCenteredOnScreen:
y = oe.centerY () + height / 2;
break;
+<<<<<<< TREE
case StackswitchOptions::TitleTextPlacementAbove:
case StackswitchOptions::TitleTextPlacementBelow:
+=======
+
+ case StackswitchOptions::TitleTextPlacementTopOfScreenMinusOffset:
+ case StackswitchOptions::TitleTextPlacementBottomOfScreenPlusOffset:
+>>>>>>> MERGE-SOURCE
{
CompRect workArea = screen->currentOutputDev ().workArea ();
+<<<<<<< TREE
if (optionGetTitleTextPlacement () ==
StackswitchOptions::TitleTextPlacementAbove)
y = oe.y1 () + workArea.y () + height;
else
y = oe.y1 () + workArea.y2 () - 96;
+=======
+ if (optionGetTitleTextPlacement () ==
+ StackswitchOptions::TitleTextPlacementTopOfScreenMinusOffset)
+ y = oe.y1 () + workArea.y () + height + verticalOffset;
+ else /* TitleTextPlacementBottomOfScreenPlusOffset */
+ y = oe.y1 () + workArea.y2 () - verticalOffset;
+>>>>>>> MERGE-SOURCE
}
break;
@@ -199,9 +236,15 @@
glGetIntegerv (GL_BLEND_SRC, &oldBlendSrc);
glGetIntegerv (GL_BLEND_DST, &oldBlendDst);
+<<<<<<< TREE
GLboolean wasBlend = glIsEnabled (GL_BLEND);
if (!wasBlend)
+=======
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+>>>>>>> MERGE-SOURCE
glEnable (GL_BLEND);
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
@@ -689,6 +732,7 @@
Window old = mSelectedWindow;
mSelectedWindow = w->id ();
+
if (old != w->id ())
{
mRotateAdjust = true;
@@ -1029,7 +1073,7 @@
}
if (action)
- action->setState (action->state () & ~(CompAction::StateTermKey |
+ action->setState (action->state () & ~(CompAction::StateTermKey |
CompAction::StateTermButton |
CompAction::StateTermEdge));
=== modified file 'plugins/stackswitch/stackswitch.xml.in'
--- plugins/stackswitch/stackswitch.xml.in 2012-10-15 10:31:51 +0000
+++ plugins/stackswitch/stackswitch.xml.in 2013-07-21 23:03:28 +0000
@@ -180,13 +180,20 @@
2
- <_name>Above
+ <_name>Top of screen minus offset
3
- <_name>Below
+ <_name>Bottom of screen plus offset
+
+ <_short>Vertical Offset
+ <_long>Vertical offset from top or bottom of the screen (in pixels).
+ 50
+ 0
+ 500
+
=== modified file 'plugins/staticswitcher/src/staticswitcher.cpp'
--- plugins/staticswitcher/src/staticswitcher.cpp 2013-05-31 22:22:12 +0000
+++ plugins/staticswitcher/src/staticswitcher.cpp 2013-07-21 23:03:28 +0000
@@ -27,8 +27,13 @@
COMPIZ_PLUGIN_20090315 (staticswitcher, StaticSwitchPluginVTable)
+<<<<<<< TREE
const unsigned short ICON_SIZE = 48;
+=======
+const unsigned short ICON_SIZE = 512;
+
+>>>>>>> MERGE-SOURCE
const unsigned short PREVIEWSIZE = 150;
const unsigned short BORDER = 10;
@@ -45,7 +50,7 @@
XSizeHints xsh;
/* maximum window size is 2/3 of the current output */
- winWidth = ::screen->currentOutputDev ().width () * 2 / 3;
+ winWidth = ::screen->currentOutputDev ().width () * 2 / 3;
winHeight = ::screen->currentOutputDev ().height () * 2 / 3;
if (count <= 4)
@@ -66,19 +71,19 @@
(h + b) * newYCount > winHeight)
{
/* shrink by 10% until all windows fit */
- w = w * 9 / 10;
- h = h * 9 / 10;
- b = b * 9 / 10;
+ w = w * 0.9;
+ h = h * 0.9;
+ b = b * 0.9;
}
- winWidth = MIN (count, newXCount);
+ winWidth = MIN (count, newXCount);
winHeight = (count + newXCount - 1) / newXCount;
- winWidth = winWidth * w + (winWidth + 1) * b;
+ winWidth = winWidth * w + (winWidth + 1) * b;
winHeight = winHeight * h + (winHeight + 1) * b;
- xCount = MIN (newXCount, count);
+ xCount = MIN (newXCount, count);
- previewWidth = w;
+ previewWidth = w;
previewHeight = h;
previewBorder = b;
@@ -160,6 +165,7 @@
{
if (sScreen->optionGetIconOnly ())
return ShowIconOnly;
+
if (!sScreen->optionGetIcon ())
return HideIcon;
@@ -171,9 +177,7 @@
CompRect &rect,
int *opacity)
{
- int mode;
-
- mode = optionGetHighlightRectHidden ();
+ int mode = optionGetHighlightRectHidden ();
if (w->isViewable () || w->shaded ())
{
@@ -206,17 +210,16 @@
StaticSwitchScreen::doWindowDamage (CompWindow *w)
{
if (w->isViewable () || w->shaded ())
- {
- CompositeWindow::get (w)->addDamage ();
- }
+ CompositeWindow::get (w)->addDamage ();
else
{
CompRect box;
+
if (getPaintRectangle (w, box, NULL))
{
CompRect boxExtended (box.x () - 2,
box.y () - 2,
- box.width () + 4,
+ box.width () + 4,
box.height () + 4);
cScreen->damageRegion (CompRegion (boxExtended));
@@ -225,7 +228,8 @@
}
void
-StaticSwitchScreen::handleSelectionChange (bool toNext, int nextIdx)
+StaticSwitchScreen::handleSelectionChange (bool toNext,
+ int nextIdx)
{
move = nextIdx;
moreAdjust = true;
@@ -236,24 +240,23 @@
{
if (!popupWindow)
{
- Display *dpy = ::screen->dpy ();
- XWMHints xwmh;
- XClassHint xch;
- Atom state[4];
- int nState = 0;
- XSetWindowAttributes attr;
- Visual *visual;
+ Display *dpy = ::screen->dpy ();
+ Visual *visual = findArgbVisual (dpy, ::screen->screenNum ());
- visual = findArgbVisual (dpy, ::screen->screenNum ());
if (!visual)
return;
+ XWMHints xwmh;
+
xwmh.flags = InputHint;
xwmh.input = 0;
+ XClassHint xch;
+
xch.res_name = (char *)"compiz";
xch.res_class = (char *)"switcher-window";
+ XSetWindowAttributes attr;
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap (dpy, ::screen->root (), visual,
@@ -270,6 +273,9 @@
programArgv, programArgc,
NULL, &xwmh, &xch);
+ Atom state[4];
+ int nState = 0;
+
state[nState++] = Atoms::winStateAbove;
state[nState++] = Atoms::winStateSticky;
state[nState++] = Atoms::winStateSkipTaskbar;
@@ -321,16 +327,14 @@
StaticSwitchScreen::initiate (SwitchWindowSelection selection,
bool shouldShowPopup)
{
- bool noSwitchWindows;
- bool newMouseSelect;
-
if (::screen->otherGrabExist ("switcher", "scale", "cube", 0))
return;
this->selection = selection;
selectedWindow = NULL;
- noSwitchWindows = true;
+ bool noSwitchWindows = true;
+
foreach (CompWindow *w, ::screen->windows ())
{
if (StaticSwitchWindow::get (w)->isSwitchWin ())
@@ -339,11 +343,12 @@
break;
}
}
+
if (noSwitchWindows)
return;
- newMouseSelect = optionGetMouseSelect () &&
- selection != Panels && shouldShowPopup;
+ bool newMouseSelect = optionGetMouseSelect () &&
+ selection != Panels && shouldShowPopup;
if (!grabIndex)
grabIndex = ::screen->pushGrab (getCursor (newMouseSelect), "switcher");
@@ -362,9 +367,8 @@
if (shouldShowPopup)
{
- unsigned int delay;
+ unsigned int delay = optionGetPopupDelay () * 1000;
- delay = optionGetPopupDelay () * 1000;
if (delay)
{
if (popupDelayTimer.active ())
@@ -375,9 +379,7 @@
delay, delay * 1.2);
}
else
- {
showPopup ();
- }
setSelectedWindowHint (optionGetFocusOnSwitch ());
}
@@ -391,9 +393,9 @@
switching = true;
moreAdjust = true;
- ::screen->handleEventSetEnabled (this, true);
- cScreen->preparePaintSetEnabled (this, true);
- cScreen->donePaintSetEnabled (this, true);
+ ::screen->handleEventSetEnabled (this, true);
+ cScreen->preparePaintSetEnabled (this, true);
+ cScreen->donePaintSetEnabled (this, true);
gScreen->glPaintOutputSetEnabled (this, true);
foreach (CompWindow *w, ::screen->windows ())
@@ -410,9 +412,7 @@
CompAction::State state,
CompOption::Vector &options)
{
- Window xid;
-
- xid = (Window) CompOption::getIntOptionNamed (options, "root");
+ Window xid = (Window) CompOption::getIntOptionNamed (options, "root");
if (action)
action->setState (action->state () &
@@ -474,9 +474,7 @@
bool shouldShowPopup,
bool nextWindow)
{
- Window xid;
-
- xid = (Window) CompOption::getIntOptionNamed (options, "root");
+ Window xid = (Window) CompOption::getIntOptionNamed (options, "root");
if (xid != ::screen->root ())
return false;
@@ -487,14 +485,11 @@
{
if (selection == Group)
{
- CompWindow *w;
- Window xid;
+ Window xid = (Window) CompOption::getIntOptionNamed (options, "window");
+ CompWindow *w = ::screen->findWindow (xid);
- xid = (Window) CompOption::getIntOptionNamed (options, "window");
- w = ::screen->findWindow (xid);
if (w)
- ss->clientLeader = (w->clientLeader ()) ?
- w->clientLeader () : xid;
+ ss->clientLeader = (w->clientLeader ()) ? w->clientLeader () : xid;
else
ss->clientLeader = None;
}
@@ -516,11 +511,11 @@
}
void
-StaticSwitchScreen::getMinimizedAndMatch (bool &minimizedOption,
+StaticSwitchScreen::getMinimizedAndMatch (bool &minimizedOption,
CompMatch *&matchOption)
{
minimizedOption = optionGetMinimized ();
- matchOption = &optionGetWindowMatch ();
+ matchOption = &optionGetWindowMatch ();
}
bool
@@ -536,8 +531,7 @@
{
bool inList = false;
- CompWindow *selected;
- CompWindow *old;
+ CompWindow *old, *selected;
SWITCH_WINDOW (w);
@@ -550,6 +544,7 @@
old = selected = selectedWindow;
CompWindowList::iterator it = windows.begin ();
+
while (it != windows.end ())
{
if (*it == w)
@@ -559,15 +554,19 @@
if (w == selected)
{
++it;
+
if (it == windows.end ())
selected = windows.front ();
else
selected = *it;
+
--it;
}
CompWindowList::iterator del = it;
+
++it;
+
windows.erase (del);
}
else
@@ -593,6 +592,7 @@
updateWindowList ();
int i = 0;
+
foreach (CompWindow *w, windows)
{
selectedWindow = w;
@@ -600,14 +600,14 @@
if (selectedWindow == selected)
break;
- i++;
+
+ ++i;
}
if (popupWindow)
{
- CompWindow *popup;
+ CompWindow *popup = ::screen->findWindow (popupWindow);
- popup = ::screen->findWindow (popupWindow);
if (popup)
CompositeWindow::get (popup)->addDamage ();
@@ -631,22 +631,28 @@
StaticSwitchScreen::getRowXOffset (int y)
{
int retval = 0;
- int count = windows.size ();
+ int count = windows.size ();
if (count - (y * (int)xCount) >= (int)xCount)
return 0;
- switch (optionGetRowAlign ()) {
- case RowAlignLeft:
- break;
- case RowAlignCentered:
- retval = (xCount - count + (y * (int)xCount)) *
- (previewWidth + previewBorder) / 2;
- break;
- case RowAlignRight:
- retval = (xCount - count + (y * (int)xCount)) *
- (previewWidth + previewBorder);
- break;
+ switch (optionGetRowAlign ())
+ {
+ case RowAlignLeft:
+ break;
+
+ case RowAlignCentered:
+ retval = (xCount - count + (y * (int)xCount)) *
+ (previewWidth + previewBorder) / 2;
+ break;
+
+ case RowAlignRight:
+ retval = (xCount - count + (y * (int)xCount)) *
+ (previewWidth + previewBorder);
+ break;
+
+ default:
+ break;
}
return retval;
@@ -657,13 +663,11 @@
int *x,
int *y)
{
- int row, column;
-
if (index >= windows.size ())
return;
- column = (int)index % xCount;
- row = (int)index / xCount;
+ int column = (int)index % xCount;
+ int row = (int)index / xCount;
*x = column * previewWidth + (column + 1) * previewBorder;
*x += getRowXOffset (row);
@@ -675,16 +679,15 @@
StaticSwitchScreen::findWindowAt (int x,
int y)
{
- CompWindow *popup;
+ CompWindow *popup = ::screen->findWindow (popupWindow);
- popup = ::screen->findWindow (popupWindow);
if (popup)
{
unsigned int i = 0;
+ int x1, x2, y1, y2;
+
foreach (CompWindow *w, windows)
{
- int x1, x2, y1, y2;
-
getWindowPosition (i, &x1, &y1);
x1 += popup->geometry ().x ();
@@ -696,7 +699,7 @@
if (x >= x1 && x < x2 && y >= y1 && y < y2)
return w;
- i++;
+ ++i;
}
}
@@ -710,44 +713,46 @@
switch (event->type)
{
- case ButtonPress:
- if (grabIndex && mouseSelect)
- {
- CompWindow *selected;
-
- selected = findWindowAt (event->xbutton.x_root,
- event->xbutton.y_root);
- if (selected)
+ case ButtonPress:
+ if (grabIndex && mouseSelect)
{
- selectedWindow = selected;
-
- CompOption::Vector o (0);
- o.push_back (CompOption ("root", CompOption::TypeInt));
- o[0].value ().set ((int) ::screen->root ());
-
- switchTerminate (NULL, CompAction::StateTermButton, o);
+ CompWindow *selected = findWindowAt (event->xbutton.x_root,
+ event->xbutton.y_root);
+
+ if (selected)
+ {
+ selectedWindow = selected;
+
+ CompOption::Vector o (0);
+ o.push_back (CompOption ("root", CompOption::TypeInt));
+ o[0].value ().set ((int) ::screen->root ());
+
+ switchTerminate (NULL, CompAction::StateTermButton, o);
+ }
}
- }
- break;
- default:
- break;
+
+ break;
+
+ default:
+ break;
}
}
bool
StaticSwitchScreen::adjustVelocity ()
{
- float dx, adjust, amount;
int count = windows.size ();
+ float dx = move - pos;
- dx = move - pos;
if (abs (dx) > abs (dx + count))
dx += count;
+
if (abs (dx) > abs (dx - count))
dx -= count;
- adjust = dx * 0.15f;
- amount = fabs (dx) * 1.5f;
+ float adjust = dx * 0.15f;
+ float amount = fabs (dx) * 1.5f;
+
if (amount < 0.2f)
amount = 0.2f;
else if (amount > 2.0f)
@@ -769,18 +774,19 @@
{
if (moreAdjust)
{
- int steps;
- float amount, chunk;
- int count = windows.size ();
-
- amount = msSinceLastPaint * 0.05f * optionGetSpeed ();
- steps = amount / (0.5f * optionGetTimestep ());
- if (!steps) steps = 1;
- chunk = amount / (float) steps;
+ int count = windows.size ();
+ float amount = msSinceLastPaint * 0.05f * optionGetSpeed ();
+ int steps = amount / (0.5f * optionGetTimestep ());
+
+ if (!steps)
+ steps = 1;
+
+ float chunk = amount / (float) steps;
while (steps--)
{
moreAdjust = adjustVelocity ();
+
if (!moreAdjust)
{
pos = move;
@@ -788,7 +794,8 @@
}
pos += mVelocity * chunk;
- pos = fmod (pos, count);
+ pos = fmod (pos, count);
+
if (pos < 0.0)
pos += count;
}
@@ -799,19 +806,21 @@
void
StaticSwitchScreen::paintRect (const GLMatrix &transform,
- CompRect &box,
- int offset,
+ CompRect &box,
+ int offset,
unsigned short *color,
unsigned short opacity)
{
- GLushort colorData[4] = {
+ GLushort colorData[4] =
+ {
color[0],
color[1],
color[2],
static_cast (color[3] * opacity / 100)
};
- GLfloat vertexData[12] = {
+ GLfloat vertexData[12] =
+ {
static_cast (box.x1 () + offset), static_cast (box.y1 () + offset), 0,
static_cast (box.x2 () - offset), static_cast (box.y1 () + offset), 0,
static_cast (box.x2 () - offset), static_cast (box.y2 () - offset), 0,
@@ -853,31 +862,26 @@
CompWindow *frontWindow = ::screen->clientList ().back ();
zoomed = selectedWindow;
+
if (zoomed && zoomed != frontWindow)
{
CompWindow *w;
- for (w = zoomed->prev; w && w->id () <= 1; w = w->prev)
- ;
- zoomedAbove = (w) ? w->id () : None;
+ for (w = zoomed->prev; w && w->id () <= 1; w = w->prev);
+ zoomedAbove = (w) ? w->id () : None;
::screen->unhookWindow (zoomed);
::screen->insertWindow (zoomed, frontWindow->id ());
}
else
- {
zoomed = NULL;
- }
}
else
- {
zoomed = NULL;
- }
ignoreSwitcher = true;
- status = gScreen->glPaintOutput (sAttrib, transform, region, output,
- mask);
+ status = gScreen->glPaintOutput (sAttrib, transform, region, output, mask);
if (zoomed)
{
@@ -897,9 +901,7 @@
if (mode == HighlightModeShowRectangle)
{
- CompWindow *w;
-
- w = selectedWindow;
+ CompWindow *w = selectedWindow;
if (w)
{
@@ -909,11 +911,14 @@
if (getPaintRectangle (w, box, &opacity))
{
unsigned short *color;
- GLushort colorData[4];
- GLfloat vertexData[12];
+ GLushort colorData[4];
+ GLfloat vertexData[12];
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
/* fill rectangle */
colorData[0] = optionGetHighlightColorRed ();
@@ -950,7 +955,8 @@
color = optionGetHighlightBorderInlayColor ();
paintRect (sTransform, box, 1, color, opacity);
- glDisable (GL_BLEND);
+ if (!glBlendEnabled)
+ glDisable (GL_BLEND);
}
}
}
@@ -962,18 +968,13 @@
if (!switcher->destroyed () &&
switcher->isViewable () &&
sw->cWindow->damaged ())
- {
sw->gWindow->glPaint (sw->gWindow->paintAttrib (),
sTransform, infiniteRegion, 0);
- }
}
}
}
else
- {
- status = gScreen->glPaintOutput (sAttrib, transform, region, output,
- mask);
- }
+ status = gScreen->glPaintOutput (sAttrib, transform, region, output, mask);
return status;
}
@@ -983,9 +984,8 @@
{
if (grabIndex && moreAdjust)
{
- CompWindow *w;
+ CompWindow *w = ::screen->findWindow (popupWindow);
- w = ::screen->findWindow (popupWindow);
if (w)
CompositeWindow::get (w)->addDamage ();
}
@@ -993,15 +993,15 @@
{
activateEvent (false);
- cScreen->preparePaintSetEnabled (this, false);
- cScreen->donePaintSetEnabled (this, false);
+ cScreen->preparePaintSetEnabled (this, false);
+ cScreen->donePaintSetEnabled (this, false);
gScreen->glPaintOutputSetEnabled (this, false);
foreach (CompWindow *w, ::screen->windows ())
{
SWITCH_WINDOW (w);
sw->cWindow->damageRectSetEnabled (sw, false);
- sw->gWindow->glPaintSetEnabled (sw, false);
+ sw->gWindow->glPaintSetEnabled (sw, false);
}
}
@@ -1010,24 +1010,26 @@
void
StaticSwitchScreen::paintSelectionRect (const GLMatrix &transform,
- int x,
- int y,
- float dx,
- float dy,
- unsigned int opacity)
+ int x,
+ int y,
+ float dx,
+ float dy,
+ unsigned int opacity)
{
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
GLushort colorData[4];
GLfloat vertexData[18];
GLMatrix sTransform (transform);
float op;
- int w, h;
int count = windows.size ();
- w = previewWidth + previewBorder;
- h = previewHeight + previewBorder;
-
- glEnable (GL_BLEND);
+ int w = previewWidth + previewBorder;
+ int h = previewHeight + previewBorder;
+
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
if (dx > xCount - 1)
op = 1.0 - MIN (1.0, dx - (xCount - 1));
@@ -1038,7 +1040,7 @@
else
op = 1.0;
- for (unsigned int i = 0; i < 4; i++)
+ for (unsigned int i = 0; i < 4; ++i)
colorData[i] = (float)fgColor[i] * opacity * op / 0xffff;
sTransform.translate (x + previewBorder / 2 + (dx * w),
@@ -1131,7 +1133,8 @@
streamingBuffer->end ();
streamingBuffer->render (sTransform);
- glDisable (GL_BLEND);
+ if (!glBlendEnabled)
+ glDisable (GL_BLEND);
}
bool
@@ -1139,28 +1142,25 @@
{
bool baseIsSwitchWin = BaseSwitchWindow::isSwitchWin (removing);
- if (baseIsSwitchWin && sScreen->selection == Group)
- {
- if (sScreen->clientLeader != window->clientLeader () &&
- sScreen->clientLeader != window->id ())
- return false;
- }
+ if (baseIsSwitchWin &&
+ sScreen->selection == Group &&
+ sScreen->clientLeader != window->clientLeader () &&
+ sScreen->clientLeader != window->id ())
+ return false;
return baseIsSwitchWin;
}
void
-StaticSwitchWindow::updateIconTexturedWindow (GLWindowPaintAttrib &sAttrib,
- int &wx,
- int &wy,
- int x,
- int y,
- GLTexture *icon)
+StaticSwitchWindow::updateIconTexturedWindow (GLWindowPaintAttrib &sAttrib,
+ int &wx,
+ int &wy,
+ int x,
+ int y,
+ GLTexture *icon)
{
- float xScale, yScale;
-
- xScale = (float) ICON_SIZE / icon->width ();
- yScale = (float) ICON_SIZE / icon->height ();
+ float xScale = (float) ICON_SIZE / icon->width ();
+ float yScale = (float) ICON_SIZE / icon->height ();
if (xScale < yScale)
yScale = xScale;
@@ -1170,21 +1170,21 @@
sAttrib.xScale = (float) sScreen->previewWidth * xScale / PREVIEWSIZE;
sAttrib.yScale = (float) sScreen->previewWidth * yScale / PREVIEWSIZE;
- wx = x + sScreen->previewWidth - (sAttrib.xScale * icon->width ());
+ wx = x + sScreen->previewWidth - (sAttrib.xScale * icon->width ());
wy = y + sScreen->previewHeight - (sAttrib.yScale * icon->height ());
}
void
-StaticSwitchWindow::updateIconNontexturedWindow (GLWindowPaintAttrib &sAttrib,
- int &wx,
- int &wy,
- float &width,
- float &height,
- int x,
- int y,
- GLTexture *icon)
+StaticSwitchWindow::updateIconNontexturedWindow (GLWindowPaintAttrib &sAttrib,
+ int &wx,
+ int &wy,
+ float &width,
+ float &height,
+ int x,
+ int y,
+ GLTexture *icon)
{
- sAttrib.xScale = width / icon->width ();
+ sAttrib.xScale = width / icon->width ();
sAttrib.yScale = height / icon->height ();
if (sAttrib.xScale < sAttrib.yScale)
@@ -1195,7 +1195,7 @@
width = icon->width () * sAttrib.xScale;
height = icon->height () * sAttrib.yScale;
- wx = x + (sScreen->previewWidth / 2) - (width / 2);
+ wx = x + (sScreen->previewWidth / 2) - (width / 2);
wy = y + (sScreen->previewHeight / 2) - (height / 2);
}
@@ -1207,26 +1207,26 @@
float width,
float height)
{
- wx = x + (sScreen->previewWidth / 2) - (width / 2);
+ wx = x + (sScreen->previewWidth / 2) - (width / 2);
wy = y + (sScreen->previewHeight / 2) - (height / 2);
}
void
StaticSwitchWindow::paintThumb (const GLWindowPaintAttrib &attrib,
- const GLMatrix &transform,
- unsigned int mask,
- int x,
- int y)
+ const GLMatrix &transform,
+ unsigned int mask,
+ int x,
+ int y)
{
BaseSwitchWindow::paintThumb (attrib,
- transform,
- mask,
- x,
- y,
+ transform,
+ mask,
+ x,
+ y,
sScreen->previewWidth,
sScreen->previewHeight,
- sScreen->previewWidth * 3 / 4,
- sScreen->previewHeight * 3 / 4);
+ sScreen->previewWidth * 0.75,
+ sScreen->previewHeight * 0.75);
}
bool
@@ -1235,17 +1235,13 @@
const CompRegion ®ion,
unsigned int mask)
{
- bool status;
+ bool status;
/* We are painting the switcher popup window:
* Paint the popup window first and then paint
* the relevant thumbnails */
if (window->id () == sScreen->popupWindow)
{
- int x, y, offX;
- float px, py, pos;
- int count = sScreen->windows.size ();
-
const CompWindow::Geometry &g = window->geometry ();
if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK ||
@@ -1261,50 +1257,52 @@
glScissor (g.x (), 0, g.width (), ::screen->height ());
unsigned int i = 0;
+ int x, y;
+
foreach (CompWindow *w, sScreen->windows)
{
sScreen->getWindowPosition (i, &x, &y);
StaticSwitchWindow::get (w)->paintThumb (
gWindow->lastPaintAttrib (), transform,
mask, x + g.x (), y + g.y ());
- i++;
+ ++i;
}
- pos = fmod (sScreen->pos, count);
- px = fmod (pos, sScreen->xCount);
- py = floor (pos / sScreen->xCount);
-
- offX = sScreen->getRowXOffset (py);
+ int count = sScreen->windows.size ();
+ float pos = fmod (sScreen->pos, count);
+ float px = fmod (pos, sScreen->xCount);
+ float py = floor (pos / sScreen->xCount);
+ int offX = sScreen->getRowXOffset (py);
if (pos > count - 1)
{
px = fmod (pos - count, sScreen->xCount);
sScreen->paintSelectionRect (transform, g.x (), g.y (), px, 0.0,
- gWindow->lastPaintAttrib ().opacity);
+ gWindow->lastPaintAttrib ().opacity);
px = fmod (pos, sScreen->xCount);
sScreen->paintSelectionRect (transform, g.x () + offX, g.y (),
- px, py,
- gWindow->lastPaintAttrib ().opacity);
+ px, py,
+ gWindow->lastPaintAttrib ().opacity);
}
+
if (px > sScreen->xCount - 1)
{
sScreen->paintSelectionRect (transform, g.x (), g.y (), px, py,
- gWindow->lastPaintAttrib ().opacity);
+ gWindow->lastPaintAttrib ().opacity);
py = fmod (py + 1, ceil ((double) count / sScreen->xCount));
offX = sScreen->getRowXOffset (py);
sScreen->paintSelectionRect (transform, g.x () + offX, g.y (),
- px - sScreen->xCount, py,
- gWindow->lastPaintAttrib ().opacity);
+ px - sScreen->xCount, py,
+ gWindow->lastPaintAttrib ().opacity);
}
else
- {
sScreen->paintSelectionRect (transform, g.x () + offX, g.y (),
- px, py,
- gWindow->lastPaintAttrib ().opacity);
- }
+ px, py,
+ gWindow->lastPaintAttrib ().opacity);
+
glDisable (GL_SCISSOR_TEST);
}
/* Adjust opacity/brightness/saturation of windows that are
@@ -1314,13 +1312,14 @@
(window != sScreen->selectedWindow))
{
GLWindowPaintAttrib sAttrib (attrib);
- GLuint value;
-
- value = (GLuint) sScreen->optionGetSaturation ();
+
+ GLuint value = (GLuint) sScreen->optionGetSaturation ();
+
if (value != 100)
sAttrib.saturation = sAttrib.saturation * value / 100;
value = (GLuint) sScreen->optionGetBrightness ();
+
if (value != 100)
sAttrib.brightness = sAttrib.brightness * value / 100;
@@ -1328,6 +1327,7 @@
CompWindowTypeDesktopMask))
{
value = (GLuint) sScreen->optionGetOpacity ();
+
if (value != 100)
sAttrib.opacity = sAttrib.opacity * value / 100;
}
@@ -1336,9 +1336,7 @@
}
/* Fallback case for selected window */
else
- {
status = gWindow->glPaint (attrib, transform, region, mask);
- }
return status;
}
@@ -1346,16 +1344,16 @@
StaticSwitchScreen::StaticSwitchScreen (CompScreen *screen) :
BaseSwitchScreen (screen),
PluginClassHandler (screen),
- clientLeader (None),
- previewWidth (0),
+ clientLeader (None),
+ previewWidth (0),
previewHeight (0),
previewBorder (0),
- xCount (0),
- switching (false),
- mVelocity (0.0),
- pos (0),
- move (0),
- mouseSelect (false)
+ xCount (0),
+ switching (false),
+ mVelocity (0.0),
+ pos (0),
+ move (0),
+ mouseSelect (false)
{
#define SWITCHBIND(a,b,c) boost::bind (switchInitiateCommon, _1, _2, _3, a, b, c)
@@ -1437,11 +1435,19 @@
bool
StaticSwitchPluginVTable::init ()
{
+<<<<<<< TREE
if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
CompPlugin::checkPluginABI ("compiztoolbox", COMPIZ_COMPIZTOOLBOX_ABI) &&
CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
return true;
+=======
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
+ CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
+ CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI) &&
+ CompPlugin::checkPluginABI ("compiztoolbox", COMPIZ_COMPIZTOOLBOX_ABI))
+ return true;
+>>>>>>> MERGE-SOURCE
return false;
}
=== modified file 'plugins/staticswitcher/src/staticswitcher.h'
--- plugins/staticswitcher/src/staticswitcher.h 2013-05-12 08:24:06 +0000
+++ plugins/staticswitcher/src/staticswitcher.h 2013-07-21 23:03:28 +0000
@@ -46,50 +46,73 @@
public StaticswitcherOptions
{
public:
+
StaticSwitchScreen (CompScreen *screen);
~StaticSwitchScreen ();
void preparePaint (int);
+
void donePaint ();
bool glPaintOutput (const GLScreenPaintAttrib &,
- const GLMatrix &, const CompRegion &,
- CompOutput *, unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
void updatePopupWindow ();
+
void updateWindowList ();
+
void createWindowList ();
+
bool getPaintRectangle (CompWindow *w,
CompRect &rect,
int *opacity);
+
void doWindowDamage (CompWindow *w);
- void handleSelectionChange (bool toNext, int nextIdx);
+
+ void handleSelectionChange (bool toNext,
+ int nextIdx);
+
void createPopup ();
+
bool showPopup ();
+
Cursor getCursor (bool mouseSelectOn);
+
void initiate (SwitchWindowSelection selection,
bool shouldShowPopup);
+
void windowRemove (CompWindow *w);
+
int getRowXOffset (int y);
+
void getWindowPosition (unsigned int index,
int *x,
int *y);
+
CompWindow *findWindowAt (int x,
int y);
+
void handleEvent (XEvent *event);
+
bool adjustVelocity ();
+
void paintRect (const GLMatrix &transform,
- CompRect &box,
- int offset,
+ CompRect &box,
+ int offset,
unsigned short *color,
unsigned short opacity);
+
void paintSelectionRect (const GLMatrix &transform,
- int x,
- int y,
- float dx,
- float dy,
- unsigned int opacity);
- void getMinimizedAndMatch (bool &minimizedOption,
+ int x,
+ int y,
+ float dx,
+ float dy,
+ unsigned int opacity);
+
+ void getMinimizedAndMatch (bool &minimizedOption,
CompMatch *&match);
bool getMipmap ();
@@ -97,21 +120,21 @@
CompTimer popupDelayTimer;
- Window clientLeader;
-
- int previewWidth;
- int previewHeight;
- int previewBorder;
- int xCount;
-
- bool switching;
-
- GLfloat mVelocity;
-
- float pos;
- float move;
-
- bool mouseSelect;
+ Window clientLeader;
+
+ int previewWidth;
+ int previewHeight;
+ int previewBorder;
+ int xCount;
+
+ bool switching;
+
+ GLfloat mVelocity;
+
+ float pos;
+ float move;
+
+ bool mouseSelect;
};
class StaticSwitchWindow :
@@ -121,30 +144,41 @@
public PluginClassHandler
{
public:
+
StaticSwitchWindow (CompWindow *window);
bool isSwitchWin (bool removing = false);
- bool damageRect (bool initial, const CompRect &rect);
-
- bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
- const CompRegion &, unsigned int);
-
- void paintThumb (const GLWindowPaintAttrib &, const GLMatrix &,
- unsigned int, int, int);
- void updateIconTexturedWindow (GLWindowPaintAttrib &sAttrib,
- int &wx,
- int &wy,
- int x,
- int y,
- GLTexture *icon);
- void updateIconNontexturedWindow (GLWindowPaintAttrib &sAttrib,
- int &wx,
- int &wy,
- float &width,
- float &height,
- int x,
- int y,
- GLTexture *icon);
+
+ bool damageRect (bool initial,
+ const CompRect &rect);
+
+ bool glPaint (const GLWindowPaintAttrib &,
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
+
+ void paintThumb (const GLWindowPaintAttrib &,
+ const GLMatrix &,
+ unsigned int ,
+ int ,
+ int );
+
+ void updateIconTexturedWindow (GLWindowPaintAttrib &sAttrib,
+ int &wx,
+ int &wy,
+ int x,
+ int y,
+ GLTexture *icon);
+
+ void updateIconNontexturedWindow (GLWindowPaintAttrib &sAttrib,
+ int &wx,
+ int &wy,
+ float &width,
+ float &height,
+ int x,
+ int y,
+ GLTexture *icon);
+
void updateIconPos (int &wx,
int &wy,
int x,
@@ -175,4 +209,3 @@
bool init ();
};
-
=== modified file 'plugins/switcher/src/switcher.cpp'
--- plugins/switcher/src/switcher.cpp 2013-05-09 13:43:07 +0000
+++ plugins/switcher/src/switcher.cpp 2013-07-21 23:03:28 +0000
@@ -200,7 +200,7 @@
foreach (CompWindow *w, screen->windows ())
if (SwitchWindow::get (w)->isSwitchWin ())
{
- count++;
+ ++count;
if (count == 5)
break;
}
@@ -1012,8 +1012,12 @@
cx = g.x () + (g.width () >> 1);
wTransform.translate (cx, y, 0.0f);
- glEnable (GL_BLEND);
- for (int i = 0; i < 4; i++)
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
+ for (int i = 0; i < 4; ++i)
{
color[i] = (unsigned int)sScreen->fgColor[i] *
gWindow->lastPaintAttrib ().opacity /
@@ -1193,11 +1197,19 @@
bool
SwitchPluginVTable::init ()
{
+<<<<<<< TREE
if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
CompPlugin::checkPluginABI ("compiztoolbox", COMPIZ_COMPIZTOOLBOX_ABI) &&
CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
return true;
+=======
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
+ CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
+ CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI) &&
+ CompPlugin::checkPluginABI ("compiztoolbox", COMPIZ_COMPIZTOOLBOX_ABI))
+ return true;
+>>>>>>> MERGE-SOURCE
return false;
}
=== modified file 'plugins/td/src/3d.cpp'
--- plugins/td/src/3d.cpp 2013-05-09 13:43:07 +0000
+++ plugins/td/src/3d.cpp 2013-07-21 23:03:28 +0000
@@ -27,17 +27,12 @@
bool
TdWindow::is3D ()
{
- if (window->overrideRedirect ())
- return false;
-
- if (!window->isViewable () || window->shaded ())
- return false;
-
- if (window->state () & (CompWindowStateSkipPagerMask |
- CompWindowStateSkipTaskbarMask))
- return false;
-
- if (!TdScreen::get (screen)->optionGetWindowMatch ().evaluate (window))
+ if (window->overrideRedirect () ||
+ !window->isViewable () ||
+ window->shaded () ||
+ window->state () & (CompWindowStateSkipPagerMask |
+ CompWindowStateSkipTaskbarMask) ||
+ !TdScreen::get (screen)->optionGetWindowMatch ().evaluate (window))
return false;
return true;
@@ -46,45 +41,43 @@
void
TdScreen::preparePaint (int msSinceLastPaint)
{
- bool active;
-
CUBE_SCREEN (screen);
- active = (cs->rotationState () != CubeScreen::RotationNone) && screen->vpSize ().width () > 2 &&
- !(optionGetManualOnly () && (cs->rotationState () != CubeScreen::RotationManual));
+ bool active = cs->rotationState () != CubeScreen::RotationNone &&
+ screen->vpSize ().width () > 2 &&
+ !optionGetManualOnly () &&
+ cs->rotationState () != CubeScreen::RotationManual;
if (active || mBasicScale != 1.0)
{
- float maxDiv = (float) optionGetMaxWindowSpace () / 100;
- float minScale = (float) optionGetMinCubeSize () / 100;
+ float maxDiv = (float) optionGetMaxWindowSpace () / 100;
+ float minScale = (float) optionGetMinCubeSize () / 100;
float x, progress;
cs->cubeGetRotation (x, x, progress);
mMaxDepth = 0;
+
foreach (CompWindow *w, screen->windows ())
{
TD_WINDOW (w);
- tdw->mIs3D = false;
+ tdw->mIs3D = false;
tdw->mDepth = 0;
if (!tdw->is3D ())
continue;
tdw->mIs3D = true;
- mMaxDepth++;
+ ++mMaxDepth;
tdw->mDepth = mMaxDepth;
-
}
- minScale = MAX (minScale, 1.0 - (mMaxDepth * maxDiv));
+ minScale = MAX (minScale, 1.0 - (mMaxDepth * maxDiv));
mBasicScale = 1.0 - ((1.0 - minScale) * progress);
- mDamage = (progress != 0.0 && progress != 1.0);
+ mDamage = (progress != 0.0 && progress != 1.0);
}
else
- {
mBasicScale = 1.0;
- }
/* comparing float values with != is error prone, so better cache
the comparison and allow a small difference */
@@ -99,7 +92,7 @@
#define DOBEVEL(corner) (tds->optionGetBevel##corner () ? bevel : 0)
#define SET_V \
- for (int i = 0; i < 4; i++) \
+ for (int i = 0; i < 4; ++i) \
v[i] = tPoint[i];
#define ADDQUAD(x1,y1,x2,y2) \
@@ -137,38 +130,39 @@
bool
TdWindow::glPaintWithDepth (const GLWindowPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ unsigned int mask)
{
- bool status;
- int wx, wy, ww, wh;
- int bevel, cull, cullInv;
+ bool status;
+ int cull;
GLVector point, tPoint;
unsigned short *c;
- TD_SCREEN (screen);
- CUBE_SCREEN (screen);
-
glIsEnabled (GL_CULL_FACE);
-
- wx = window->x () - window->input ().left;
- wy = window->y () - window->input ().top;
-
- ww = window->width () + window->input ().left + window->input ().right;
- wh = window->height () + window->input ().top + window->input ().bottom;
-
- bevel = tds->optionGetBevel ();
+ glEnable (GL_DEPTH_TEST);
+ glDepthMask (GL_TRUE);
+ glDepthFunc (GL_ALWAYS);
+
+ TD_SCREEN (screen);
+ CUBE_SCREEN (screen);
+
+ int wx = window->x () - window->input ().left;
+ int wy = window->y () - window->input ().top;
+
+ int ww = window->width () + window->input ().left + window->input ().right;
+ int wh = window->height () + window->input ().top + window->input ().bottom;
+
+ int bevel = tds->optionGetBevel ();
glGetIntegerv (GL_CULL_FACE_MODE, &cull);
- cullInv = (cull == GL_BACK)? GL_FRONT : GL_BACK;
+ int cullInv = (cull == GL_BACK)? GL_FRONT : GL_BACK;
if (ww && wh && !(mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK) &&
((cs->paintOrder () == FTB && mFtb) ||
- (cs->paintOrder () == BTF && !mFtb)))
+ (cs->paintOrder () == BTF && !mFtb)))
{
- float v[4];
- int temp;
+ float v[4];
/* Paint window depth. */
glPushMatrix ();
@@ -177,7 +171,11 @@
if (cs->paintOrder () == BTF)
glCullFace (cullInv);
- glEnable (GL_BLEND);
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
if (window->id () == screen->activeWindow ())
@@ -185,8 +183,8 @@
else
c = tds->optionGetWidthColorInactive ();
- temp = c[3] * gWindow->paintAttrib ().opacity;
- temp /= 0xffff;
+ int temp = c[3] * gWindow->paintAttrib ().opacity;
+ temp /= 0xffff;
glColor4us (c[0], c[1], c[2], temp);
point[GLVector::z] = 0.0f;
@@ -222,7 +220,6 @@
wy + bevel - bevel / 1.2f,
wx + bevel, wy,
transform, tds->mBTransform);
-
}
/* Bottom left bevel */
@@ -251,8 +248,6 @@
wy + wh - bevel + bevel / 1.2f,
wx + ww, wy + wh - bevel,
tds->mBTransform, transform);
-
-
}
/* Top right bevel */
@@ -289,11 +284,11 @@
bool
TdWindow::glPaint (const GLWindowPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ unsigned int mask)
{
- bool status;
+ bool status;
TD_SCREEN (screen);
@@ -302,42 +297,34 @@
if (tds->mPainting3D && tds->optionGetWidth () && (mDepth != 0.0f) &&
tds->mWithDepth)
- {
status = glPaintWithDepth (attrib, transform, region, mask);
- }
else
- {
status = gWindow->glPaint (attrib, transform, region, mask);
- }
return status;
}
void
TdScreen::glApplyTransform (const GLScreenPaintAttrib &attrib,
- CompOutput *output,
- GLMatrix *transform)
+ CompOutput *output,
+ GLMatrix *transform)
{
-
gScreen->glApplyTransform (attrib, output, transform);
transform->scale (mCurrentScale, mCurrentScale, mCurrentScale);
}
-
void
TdScreen::cubePaintViewport (const GLScreenPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- CompOutput *output,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ CompOutput *output,
+ unsigned int mask)
{
CUBE_SCREEN (screen);
if (cs->paintOrder () == BTF)
- {
- cs->cubePaintViewport (attrib, transform,region, output, mask);
- }
+ cs->cubePaintViewport (attrib, transform,region, output, mask);
if (mActive)
{
@@ -345,7 +332,7 @@
GLMatrix screenSpace;
GLMatrix screenSpaceOffset;
TdWindow *tdw;
- CompWindowList pl;
+ CompWindowList pl;
CompWindowList::iterator it;
float wDepth = 0.0;
float pointZ = cs->invert () * cs->distance ();
@@ -353,12 +340,12 @@
std::vector vPoints;
vPoints.push_back (GLVector (-0.5, 0.0, pointZ, 1.0));
- vPoints.push_back (GLVector (0.0, 0.5, pointZ, 1.0));
- vPoints.push_back (GLVector (0.0, 0.0, pointZ, 1.0));
+ vPoints.push_back (GLVector ( 0.0, 0.5, pointZ, 1.0));
+ vPoints.push_back (GLVector ( 0.0, 0.0, pointZ, 1.0));
if (mWithDepth)
- wDepth = -MIN((optionGetWidth ()) / 30, (1.0 - mBasicScale) /
- mMaxDepth);
+ wDepth = -MIN ((optionGetWidth ()) / 30, (1.0 - mBasicScale) /
+ mMaxDepth);
if (wDepth != 0.0)
{
@@ -371,11 +358,10 @@
continue;
mCurrentScale = mBasicScale +
- (tdw->mDepth * ((1.0 - mBasicScale) /
- mMaxDepth));
+ (tdw->mDepth * ((1.0 - mBasicScale) / mMaxDepth));
tdw->mFtb = cs->cubeCheckOrientation (attrib, transform, output,
- vPoints);
+ vPoints);
}
}
@@ -391,34 +377,31 @@
pl = cScreen->getWindowPaintList ();
+ CompWindow *w;
+ CompPoint moveOffset;
+
/* paint all windows from bottom to top */
for (it = pl.begin (); it != pl.end (); ++it)
{
- CompWindow *w = (*it);
+ w = (*it);
tdw = TdWindow::get (w);
- if (w->destroyed ())
+ if (w->destroyed () ||
+ ((!w->shaded () || !w->isViewable ()) && !tdw->cWindow->damaged ()))
continue;
- if (!w->shaded () || !w->isViewable ())
- {
- if (!tdw->cWindow->damaged ())
- continue;
- }
-
mTransform = transform;
- newMask = PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK;
+ newMask = PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK;
if (tdw->mDepth != 0.0f)
{
mCurrentScale = mBasicScale +
- (tdw->mDepth * ((1.0 - mBasicScale) /
- mMaxDepth));
+ (tdw->mDepth * ((1.0 - mBasicScale) / mMaxDepth));
if (wDepth != 0.0)
{
mCurrentScale += wDepth;
- mBTransform = transform;
+ mBTransform = transform;
gScreen->glApplyTransform (attrib, output, &mBTransform);
mCurrentScale -= wDepth;
}
@@ -431,16 +414,15 @@
cScreen->windowPaintOffset ().y () != 0) &&
!w->onAllViewports ())
{
- CompPoint moveOffset;
- moveOffset = w->getMovementForOffset (
- cScreen->windowPaintOffset ());
+ moveOffset = w->getMovementForOffset (cScreen->windowPaintOffset ());
screenSpaceOffset = screenSpace;
screenSpaceOffset.translate (moveOffset.x (),
- moveOffset.y (), 0);
+ moveOffset.y (), 0);
if (wDepth != 0.0)
- mBTransform = mBTransform * screenSpaceOffset;
+ mBTransform = mBTransform * screenSpaceOffset;
+
mTransform = mTransform * screenSpaceOffset;
newMask |= PAINT_WINDOW_WITH_OFFSET_MASK;
@@ -449,16 +431,16 @@
{
if (wDepth != 0.0)
mBTransform = mBTransform * screenSpace;
+
mTransform = mTransform * screenSpace;
}
glLoadMatrixf (mTransform.getMatrix ());
tdw->gWindow->glPaint (tdw->gWindow->paintAttrib (), mTransform,
- infiniteRegion, newMask);
+ infiniteRegion, newMask);
gScreen->glDisableOutputClipping ();
-
}
}
@@ -466,14 +448,10 @@
mPainting3D = false;
mCurrentScale = mBasicScale;
-
}
-
if (cs->paintOrder () == FTB)
- {
- cs->cubePaintViewport (attrib, transform, region, output, mask);
- }
+ cs->cubePaintViewport (attrib, transform, region, output, mask);
}
bool
@@ -484,9 +462,9 @@
bool
TdScreen::cubeShouldPaintViewport (const GLScreenPaintAttrib &attrib,
- const GLMatrix &transform,
- CompOutput *outputPtr,
- PaintOrder order)
+ const GLMatrix &transform,
+ CompOutput *outputPtr,
+ PaintOrder order)
{
CUBE_SCREEN (screen);
@@ -495,24 +473,23 @@
if (mActive)
{
float pointZ = cs->invert () * cs->distance ();
- bool ftb1, ftb2;
std::vector vPoints;
vPoints.push_back (GLVector (-0.5, 0.0, pointZ, 1.0));
- vPoints.push_back (GLVector (0.0, 0.5, pointZ, 1.0));
- vPoints.push_back (GLVector (0.0, 0.0, pointZ, 1.0));
+ vPoints.push_back (GLVector ( 0.0, 0.5, pointZ, 1.0));
+ vPoints.push_back (GLVector ( 0.0, 0.0, pointZ, 1.0));
mCurrentScale = 1.0;
- ftb1 = cs->cubeCheckOrientation (attrib, transform, outputPtr, vPoints);
+ bool ftb1 = cs->cubeCheckOrientation (attrib, transform, outputPtr, vPoints);
mCurrentScale = mBasicScale;
- ftb2 = cs->cubeCheckOrientation (attrib, transform, outputPtr, vPoints);
+ bool ftb2 = cs->cubeCheckOrientation (attrib, transform, outputPtr, vPoints);
return (order == FTB && (ftb1 || ftb2)) ||
- (order == BTF && (!ftb1 || !ftb2)) || rv;
+ (order == BTF && (!ftb1 || !ftb2)) || rv;
}
return true;
@@ -520,36 +497,32 @@
bool
TdScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- CompOutput *output,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ CompOutput *output,
+ unsigned int mask)
{
- bool status;
-
if (mActive)
{
- CompPlugin *p;
-
- mask |= PAINT_SCREEN_TRANSFORMED_MASK |
- PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK |
+ mask |= PAINT_SCREEN_TRANSFORMED_MASK |
+ PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK |
PAINT_SCREEN_NO_OCCLUSION_DETECTION_MASK;
mWithDepth = true;
- p = CompPlugin::find ("cubeaddon");
+ CompPlugin *p = CompPlugin::find ("cubeaddon");
+
if (p)
{
CompOption::Vector &options = p->vTable->getOptions ();
- CompOption option;
+ CompOption option;
mWithDepth = (CompOption::getIntOptionNamed
- (options, "deformation", 0) == 0);
+ (options, "deformation", 0) == 0);
}
}
-
- status = gScreen->glPaintOutput (attrib, transform, region, output, mask);
+ bool status = gScreen->glPaintOutput (attrib, transform, region, output, mask);
return status;
}
@@ -574,7 +547,10 @@
mActive (false),
mPainting3D (false),
mCurrentScale (1.0f),
- mBasicScale (1.0f)
+ mBasicScale (1.0f),
+ mMaxDepth (0.0f),
+ mDamage (false),
+ mWithDepth (false)
{
CompositeScreenInterface::setHandler (cScreen, false);
GLScreenInterface::setHandler (gScreen, false);
=== modified file 'plugins/td/src/3d.h'
--- plugins/td/src/3d.h 2012-09-07 23:56:21 +0000
+++ plugins/td/src/3d.h 2013-07-21 23:03:28 +0000
@@ -53,57 +53,57 @@
public TdOptions
{
public:
-
+
TdScreen (CompScreen *);
~TdScreen ();
-
+
CompositeScreen *cScreen;
GLScreen *gScreen;
CubeScreen *cubeScreen;
-
+
void
preparePaint (int);
-
+
bool
glPaintOutput (const GLScreenPaintAttrib &,
const GLMatrix &,
const CompRegion &,
CompOutput *,
- unsigned int );
-
+ unsigned int );
+
void
donePaint ();
-
+
void
glApplyTransform (const GLScreenPaintAttrib &,
CompOutput *,
GLMatrix *);
-
+
void
cubePaintViewport (const GLScreenPaintAttrib &,
const GLMatrix &,
const CompRegion &,
CompOutput *,
- unsigned int );
-
+ unsigned int );
+
bool
cubeShouldPaintViewport (const GLScreenPaintAttrib &,
const GLMatrix &,
CompOutput *,
PaintOrder );
-
+
bool
cubeShouldPaintAllViewports ();
-
+
bool mActive;
bool mPainting3D;
float mCurrentScale;
float mBasicScale;
float mMaxDepth;
bool mDamage;
-
+
bool mWithDepth;
-
+
GLMatrix mBTransform;
};
@@ -115,32 +115,32 @@
public GLWindowInterface
{
public:
-
+
TdWindow (CompWindow *);
~TdWindow ();
-
+
CompWindow *window;
CompositeWindow *cWindow;
GLWindow *gWindow;
-
+
bool
glPaint (const GLWindowPaintAttrib &,
const GLMatrix &,
const CompRegion &,
- unsigned int );
+ unsigned int );
bool
glPaintWithDepth (const GLWindowPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- unsigned int );
-
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
+
bool
is3D ();
-
+
bool mIs3D;
bool mFtb;
-
+
float mDepth;
};
@@ -151,6 +151,6 @@
public CompPlugin::VTableForScreenAndWindow
{
public:
-
+
bool init ();
};
=== modified file 'plugins/text/include/text/text.h'
--- plugins/text/include/text/text.h 2013-05-17 12:40:48 +0000
+++ plugins/text/include/text/text.h 2013-07-21 23:03:28 +0000
@@ -34,12 +34,13 @@
{
StyleBold = (1 << 0), /**< render the text in bold */
StyleItalic = (1 << 1), /**< render the text italic */
- Ellipsized = (1 << 2), /**< ellipsize the text if the
+ StyleOblique = (1 << 2), /**< render the text oblique */
+ Ellipsized = (1 << 3), /**< ellipsize the text if the
specified maximum size is
too small */
- WithBackground = (1 << 3), /**< render a rounded rectangle as
+ WithBackground = (1 << 4), /**< render a rounded rectangle as
background behind the text */
- NoAutoBinding = (1 << 4) /**< do not automatically bind the
+ NoAutoBinding = (1 << 5) /**< do not automatically bind the
rendered text pixmap to a texture */
} Flags;
=== modified file 'plugins/text/src/private.h'
=== modified file 'plugins/text/src/text.cpp'
--- plugins/text/src/text.cpp 2013-07-05 14:43:37 +0000
+++ plugins/text/src/text.cpp 2013-07-21 23:03:28 +0000
@@ -215,6 +215,9 @@
if (attrib.flags & CompText::StyleItalic)
pango_font_description_set_style (font, PANGO_STYLE_ITALIC);
+ if (attrib.flags & CompText::StyleOblique)
+ pango_font_description_set_style (font, PANGO_STYLE_OBLIQUE);
+
pango_layout_set_font_description (layout, font);
if (attrib.flags & CompText::Ellipsized)
=== modified file 'plugins/thumbnail/thumbnail.xml.in'
--- plugins/thumbnail/thumbnail.xml.in 2013-02-02 23:55:01 +0000
+++ plugins/thumbnail/thumbnail.xml.in 2013-07-21 23:03:28 +0000
@@ -33,7 +33,7 @@
<_short>Show Delay
- <_long>Time before the thumbnail preview is faded in (in ms).
+ <_long>Time before the thumbnail preview is faded in (in milliseconds).
100
100
10000
=== modified file 'plugins/titleinfo/src/titleinfo.cpp'
=== modified file 'plugins/trailfocus/src/trailfocus.cpp'
--- plugins/trailfocus/src/trailfocus.cpp 2013-05-09 13:43:07 +0000
+++ plugins/trailfocus/src/trailfocus.cpp 2013-07-21 23:03:28 +0000
@@ -36,19 +36,11 @@
{
CompRect input (w->inputRect ());
- if (input.left () >= (int) screen->width () || input.right () <= 0 ||
- input.top () >= (int) screen->height () || input.bottom () <= 0)
- {
- return false;
- }
-
- if (w->overrideRedirect ())
- return false;
-
- if (w->destroyed () || !w->mapNum () || w->minimized () || w->shaded ())
- return false;
-
- if (!optionGetWindowMatch ().evaluate (w))
+ if (input.left () >= (int) screen->width () || input.right () <= 0 ||
+ input.top () >= (int) screen->height () || input.bottom () <= 0 ||
+ w->overrideRedirect () ||
+ w->destroyed () || !w->mapNum () || w->minimized () || w->shaded () ||
+ !optionGetWindowMatch ().evaluate (w))
return false;
return true;
@@ -67,7 +59,6 @@
foreach (CompWindow *w, screen->windows ())
{
TrailfocusWindow *tw = TrailfocusWindow::get (w);
- bool needDamage;
if (removedWindow == tw)
continue;
@@ -75,13 +66,13 @@
wasTfWindow = tw->isTfWindow;
tw->isTfWindow = isTrailfocusWindow (w);
- needDamage = wasTfWindow != tw->isTfWindow;
+ bool needDamage = wasTfWindow != tw->isTfWindow;
if (tw->isTfWindow)
{
unsigned int i;
- for (i = 0; i < windows.size (); i++)
+ for (i = 0; i < windows.size (); ++i)
if (windows[i] == tw)
break;
@@ -94,9 +85,7 @@
tw->attribs = attribs[i];
}
else if (wasTfWindow && tw->gWindow)
- {
tw->gWindow->glPaintSetEnabled (tw, false);
- }
if (needDamage && tw->cWindow)
tw->cWindow->addDamage ();
@@ -111,16 +100,14 @@
bool
TrailfocusScreen::pushWindow (Window id)
{
- CompWindow *w;
+ CompWindow *w = screen->findWindow (id);
+
+ if (!w ||
+ !isTrailfocusWindow (w))
+ return false;
+
TfWindowList::iterator iter;
- w = screen->findWindow (id);
- if (!w)
- return false;
-
- if (!isTrailfocusWindow (w))
- return false;
-
for (iter = windows.begin (); iter != windows.end (); ++iter)
if ((*iter)->window->id () == id)
break;
@@ -140,16 +127,14 @@
}
/* Pop a window-id from the trailfocus window-stack (not to be
- * confused with the real window stack). Only keep one copy of a
+ * confused with the real window stack). Only keep one copy of a
* window on the stack. Also fill the empty space with the next
* window on the real window stack.
*/
void
TrailfocusScreen::popWindow (TrailfocusWindow *tw)
{
- CompWindow *best = NULL;
TfWindowList::iterator iter;
- int distance, bestDist = 1000000;
for (iter = windows.begin (); iter != windows.end (); ++iter)
if (*iter == tw)
@@ -160,24 +145,23 @@
windows.erase (iter);
+ int distance, bestDist = 1000000;
+ CompWindow *best = NULL;
+
/* find window that was activated right before the destroyed one
to fill the empty space */
foreach (CompWindow *cur, screen->windows ())
{
bool present = false;
- if (!isTrailfocusWindow (cur))
- continue;
-
- if (cur == tw->window)
- continue;
-
- /* we only want windows that were activated before the popped one */
- if (cur->activeNum () > tw->window->activeNum ())
+ if (!isTrailfocusWindow (cur) ||
+ cur == tw->window ||
+ /* we only want windows that were activated before the popped one */
+ cur->activeNum () > tw->window->activeNum ())
continue;
/* we do not want any windows already present in the list */
- for (unsigned int i = 0; i < windows.size (); i++)
+ for (unsigned int i = 0; i < windows.size (); ++i)
{
if (windows[i]->window == cur)
{
@@ -190,12 +174,11 @@
continue;
if (!best)
- {
best = cur;
- }
else
{
distance = abs (cur->activeNum () - best->activeNum ());
+
if (distance < bestDist)
{
best = cur;
@@ -223,8 +206,8 @@
void
TrailfocusScreen::refillList ()
{
- CompWindowList activeList = screen->windows ();
- unsigned int winMax = optionGetWindowsCount ();
+ CompWindowList activeList = screen->windows ();
+ unsigned int winMax = optionGetWindowsCount ();
activeList.sort (compareActiveness);
windows.clear ();
@@ -245,18 +228,23 @@
void
TrailfocusScreen::handleEvent (XEvent *event)
{
- switch (event->type) {
+ switch (event->type)
+ {
case FocusIn:
if (pushWindow (event->xfocus.window))
setWindows (NULL);
+
break;
+
case PropertyNotify:
if (event->xproperty.atom == Atoms::desktopViewport)
{
refillList ();
setWindows (NULL);
}
+
break;
+
default:
break;
}
@@ -271,10 +259,10 @@
TrailfocusScreen::recalculateAttributes ()
{
TfAttribs tmp, min, max;
- int i, start, winMax;
+ int i;
- start = optionGetWindowsStart () - 1;
- winMax = optionGetWindowsCount ();
+ int start = optionGetWindowsStart () - 1;
+ int winMax = optionGetWindowsCount ();
if (start >= winMax)
{
@@ -283,24 +271,24 @@
start = winMax - 1;
}
- min.opacity = optionGetMinOpacity () * OPAQUE / 100;
+ min.opacity = optionGetMinOpacity () * OPAQUE / 100;
min.brightness = optionGetMinBrightness () * BRIGHT / 100;
- min.saturation = optionGetMinSaturation () * COLOR / 100;
+ min.saturation = optionGetMinSaturation () * COLOR / 100;
- max.opacity = optionGetMaxOpacity () * OPAQUE / 100;
+ max.opacity = optionGetMaxOpacity () * OPAQUE / 100;
max.brightness = optionGetMaxBrightness () * BRIGHT / 100;
- max.saturation = optionGetMaxSaturation () * COLOR / 100;
+ max.saturation = optionGetMaxSaturation () * COLOR / 100;
attribs.resize (winMax + 1);
- tmp.opacity = (max.opacity - min.opacity) / (winMax - start);
+ tmp.opacity = (max.opacity - min.opacity) / (winMax - start);
tmp.brightness = (max.brightness - min.brightness) / (winMax - start);
tmp.saturation = (max.saturation - min.saturation) / (winMax - start);
- for (i = 0; i < start; i++)
+ for (i = 0; i < start; ++i)
attribs[i] = max;
- for (i = 0; i + start <= winMax; i++)
+ for (i = 0; i + start <= winMax; ++i)
{
attribs[i + start].opacity = max.opacity - (tmp.opacity * i);
attribs[i + start].brightness = max.brightness - (tmp.brightness * i);
@@ -332,7 +320,8 @@
TrailfocusScreen::optionChanged (CompOption *opt,
Options num)
{
- switch (num) {
+ switch (num)
+ {
case MinOpacity:
case MaxOpacity:
case MinSaturation:
@@ -343,6 +332,7 @@
case WindowsCount:
recalculateAttributes ();
break;
+
default:
break;
}
=== modified file 'plugins/trailfocus/src/trailfocus.h'
--- plugins/trailfocus/src/trailfocus.h 2010-05-06 15:34:05 +0000
+++ plugins/trailfocus/src/trailfocus.h 2013-07-21 23:03:28 +0000
@@ -45,6 +45,7 @@
public PluginClassHandler
{
public:
+
TrailfocusWindow (CompWindow *);
~TrailfocusWindow ();
@@ -65,6 +66,7 @@
public TrailfocusOptions
{
public:
+
TrailfocusScreen (CompScreen *);
void handleEvent (XEvent *);
=== modified file 'plugins/trip/src/trip.cpp'
--- plugins/trip/src/trip.cpp 2013-05-09 13:43:07 +0000
+++ plugins/trip/src/trip.cpp 2013-07-21 23:03:28 +0000
@@ -138,7 +138,7 @@
if (intensity > 70)
intensity = 70;
- for (unsigned int i = 0; i < ripples.size (); i++)
+ for (unsigned int i = 0; i < ripples.size (); ++i)
{
int steps;
float amount, chunk;
@@ -203,7 +203,7 @@
glDisable (target);
- for (unsigned int i = 0; i < ripples.size (); i++)
+ for (unsigned int i = 0; i < ripples.size (); ++i)
{
ripples.at (i).width = 0;
ripples.at (i).height = 0;
@@ -355,7 +355,7 @@
/* Temporarily set the viewport to fullscreen */
glViewport (0, 0, screen->width (), screen->height ());
- for (unsigned int i = 0; i < ripples.size (); i++)
+ for (unsigned int i = 0; i < ripples.size (); ++i)
ripples.at (i).paint ();
gScreen->setDefaultViewport ();
@@ -406,7 +406,7 @@
ripples.clear ();
intensity = 30;
- for (int i = 0; i < optionGetMaxRipples (); i++)
+ for (int i = 0; i < optionGetMaxRipples (); ++i)
{
ripples.push_back (Ripple ());
ripples.at (i). spawnRandom ();
=== modified file 'plugins/vpswitch/src/vpswitch.cpp'
--- plugins/vpswitch/src/vpswitch.cpp 2013-05-09 13:43:07 +0000
+++ plugins/vpswitch/src/vpswitch.cpp 2013-07-21 23:03:28 +0000
@@ -45,13 +45,13 @@
foreach (CompOption &opt, plugin->vTable->getOptions ())
{
- if (opt.type () == CompOption::TypeAction ||
- opt.type () == CompOption::TypeKey ||
- opt.type () == CompOption::TypeButton ||
- opt.type () == CompOption::TypeEdge ||
- opt.type () == CompOption::TypeBell)
- if (opt.name () == optionGetInitAction () &&
- opt.value ().action ().initiate ())
+ if ((opt.type () == CompOption::TypeAction ||
+ opt.type () == CompOption::TypeKey ||
+ opt.type () == CompOption::TypeButton ||
+ opt.type () == CompOption::TypeEdge ||
+ opt.type () == CompOption::TypeBell) &&
+ opt.name () == optionGetInitAction () &&
+ opt.value ().action ().initiate ())
{
rv = opt.value ().action ().initiate ()
(action, state, options);
@@ -71,20 +71,20 @@
CompOption::Vector &options)
{
CompPlugin *plugin = CompPlugin::find (optionGetInitPlugin ().c_str ());
- bool rv = false;
+ bool rv = false;
if (!plugin)
return false;
foreach (CompOption &opt, plugin->vTable->getOptions ())
{
- if (opt.type () == CompOption::TypeAction ||
- opt.type () == CompOption::TypeKey ||
- opt.type () == CompOption::TypeButton ||
- opt.type () == CompOption::TypeEdge ||
- opt.type () == CompOption::TypeBell)
- if (opt.name () == optionGetInitAction () &&
- opt.value ().action ().terminate ())
+ if ((opt.type () == CompOption::TypeAction ||
+ opt.type () == CompOption::TypeKey ||
+ opt.type () == CompOption::TypeButton ||
+ opt.type () == CompOption::TypeEdge ||
+ opt.type () == CompOption::TypeBell) &&
+ opt.name () == optionGetInitAction () &&
+ opt.value ().action ().terminate ())
{
rv = opt.value ().action ().terminate ()
(action, state, options);
@@ -96,7 +96,8 @@
}
void
-VPSwitchScreen::gotovp (int x, int y)
+VPSwitchScreen::gotovp (int x,
+ int y)
{
XEvent xev;
@@ -124,19 +125,18 @@
CompAction::State state,
CompOption::Vector &options)
{
- int targetX, targetY;
CompPoint vp (screen->vp ());
CompSize vpsize (screen->vpSize ());
GET_DATA;
- targetX = vp.x () + 1;
- targetY = vp.y ();
+ int targetX = vp.x () + 1;
+ int targetY = vp.y ();
if (targetX >= vpsize.width ())
{
targetX = 0;
- targetY++;
+ ++targetY;
}
if (targetY >= vpsize.height ())
targetY = 0;
@@ -151,19 +151,18 @@
CompAction::State state,
CompOption::Vector &options)
{
- int targetX, targetY;
CompPoint vp (screen->vp ());
CompSize vpsize (screen->vpSize ());
GET_DATA;
- targetX = vp.x () - 1;
- targetY = vp.y ();
+ int targetX = vp.x () - 1;
+ int targetY = vp.y ();
if (targetX < 0)
{
targetX = vpsize.width () - 1;
- targetY--;
+ --targetY;
}
if (targetY < 0)
targetY = vpsize.height () - 1;
@@ -174,10 +173,11 @@
}
bool
-VPSwitchScreen::movevp (CompAction *action,
+VPSwitchScreen::movevp (CompAction *action,
CompAction::State state,
CompOption::Vector &options,
- unsigned int dx, unsigned int dy)
+ unsigned int dx,
+ unsigned int dy)
{
CompPoint vp (screen->vp ());
CompSize vpsize (screen->vpSize ());
@@ -204,21 +204,20 @@
switch (event->type)
{
case KeyPress:
- KeySym pressedKeySym;
- unsigned int mods;
- int i, row;
+ int row;
if (!numberedActive)
break;
- pressedKeySym = XLookupKeysym (&event->xkey, 0);
- mods = modHandler->keycodeToModifiers (event->xkey.keycode);
+ KeySym pressedKeySym = XLookupKeysym (&event->xkey, 0);
+ unsigned int mods = modHandler->keycodeToModifiers (event->xkey.keycode);
+
if (mods & CompNumLockMask)
row = 1; /* use first row of lookup table */
else
row = 2;
- for (i = 0; i < 10; i++)
+ for (int i = 0; i < 10; ++i)
{
/* first try to handle normal number keys */
if (numberKeySyms[0][i] == pressedKeySym)
@@ -227,14 +226,11 @@
destination += i;
break;
}
- else
+ else if (numberKeySyms[row][i] == pressedKeySym)
{
- if (numberKeySyms[row][i] == pressedKeySym)
- {
- destination *= 10;
- destination += i;
- break;
- }
+ destination *= 10;
+ destination += i;
+ break;
}
}
}
@@ -242,13 +238,11 @@
screen->handleEvent (event);
}
-
bool
VPSwitchScreen::initiateNumbered (CompAction *action,
CompAction::State state,
CompOption::Vector &options)
{
-
numberedActive = true;
if (state & CompAction::StateInitKey)
@@ -262,20 +256,19 @@
CompAction::State state,
CompOption::Vector &options)
{
- int nx, ny;
- CompSize vpsize (screen->vpSize ());
-
if (!numberedActive)
return false;
+ CompSize vpsize (screen->vpSize ());
+
numberedActive = false;
if (destination < 1 ||
destination > (int) (vpsize.width () * vpsize.height ()))
return false;
- nx = (destination - 1 ) % vpsize.width ();
- ny = (destination - 1 ) / vpsize.width ();
+ int nx = (destination - 1 ) % vpsize.width ();
+ int ny = (destination - 1 ) / vpsize.width ();
gotovp (nx, ny);
@@ -288,9 +281,8 @@
VPSwitchScreen::switchto (CompAction *action,
CompAction::State state,
CompOption::Vector &options,
- int num)
+ int num)
{
-
destination = num;
numberedActive = true;
=== modified file 'plugins/vpswitch/src/vpswitch.h'
--- plugins/vpswitch/src/vpswitch.h 2009-07-01 15:02:23 +0000
+++ plugins/vpswitch/src/vpswitch.h 2013-07-21 23:03:28 +0000
@@ -32,23 +32,22 @@
#include "vpswitch_options.h"
-/* Helper macro to obtain necesary action data */
+/* Helper macro to obtain necessary action data */
/* ??? xid = screen->grabWindow () else xid = screen->below () */
#define GET_DATA \
- CompWindow *w;\
- Window xid; \
if (screen->otherGrabExist ("rotate", "wall", "plane", 0)) \
return false; \
- xid = CompOption::getIntOptionNamed (options, "window"); \
- w = screen->findWindow (xid); \
+ Window xid = CompOption::getIntOptionNamed (options, "window"); \
+ CompWindow *w = screen->findWindow (xid); \
if ((!w || (w->type () & CompWindowTypeDesktopMask) == 0) && \
xid != screen->root ()) \
return false;
/* number-to-keysym mapping */
-static const KeySym numberKeySyms[3][10] = {
+static const KeySym numberKeySyms[3][10] =
+{
/* number key row */
{ XK_0, XK_1, XK_2, XK_3, XK_4, XK_5, XK_6, XK_7, XK_8, XK_9 },
/* number keypad with activated NumLock */
@@ -68,7 +67,7 @@
VPSwitchScreen (CompScreen *);
- int destination;
+ int destination;
bool numberedActive;
/* Wrappable functions */
@@ -77,16 +76,17 @@
/* Actions */
bool
- movevp (CompAction *action,
+ movevp (CompAction *action,
CompAction::State state,
CompOption::Vector &options,
- unsigned int dx, unsigned int dy);
+ unsigned int dx,
+ unsigned int dy);
bool
switchto (CompAction *action,
CompAction::State state,
CompOption::Vector &options,
- int num);
+ int num);
bool
initiateNumbered (CompAction *action,
@@ -94,7 +94,7 @@
CompOption::Vector &options);
bool
- terminateNumbered (CompAction *action,
+ terminateNumbered (CompAction *action,
CompAction::State state,
CompOption::Vector &options);
@@ -121,7 +121,8 @@
/* General Functions */
void
- gotovp (int x, int y);
+ gotovp (int x,
+ int y);
};
#define VPSWITCH_SCREEN(s) \
@@ -133,4 +134,4 @@
public:
bool init ();
-};
+};
=== modified file 'plugins/wall/src/offset_movement/include/offset-movement.h'
--- plugins/wall/src/offset_movement/include/offset-movement.h 2012-05-09 01:50:55 +0000
+++ plugins/wall/src/offset_movement/include/offset-movement.h 2013-07-21 23:03:28 +0000
@@ -33,7 +33,7 @@
{
namespace wall
{
- CompPoint movementWindowOnScreen (const CompRect &serverBorderRect,
+ CompPoint movementWindowOnScreen (const CompRect &serverBorderRect,
const CompRegion &screenRegion);
}
}
=== modified file 'plugins/wall/src/offset_movement/src/offset-movement.cpp'
--- plugins/wall/src/offset_movement/src/offset-movement.cpp 2013-02-27 11:33:10 +0000
+++ plugins/wall/src/offset_movement/src/offset-movement.cpp 2013-07-21 23:03:28 +0000
@@ -25,22 +25,22 @@
#include "offset-movement.h"
CompPoint
-compiz::wall::movementWindowOnScreen (const CompRect &serverBorderRect,
+compiz::wall::movementWindowOnScreen (const CompRect &serverBorderRect,
const CompRegion &screenRegion)
{
- CompRegion sbrRegion (serverBorderRect);
+// CompRegion sbrRegion (serverBorderRect);
/* If the window would be partially offscreen
* after it was moved then we should move it back
* so that it is completely onscreen, since we moved
* from mostly offscreen on B to mostly onscreen on A,
* the user should be able to see their selected window */
- CompRegion inter = sbrRegion.intersected (screenRegion);
- CompRegion rem = sbrRegion - screenRegion;
+// CompRegion inter = sbrRegion.intersected (screenRegion);
+// CompRegion rem = sbrRegion - screenRegion;
int dx = 0;
int dy = 0;
-
+/*
const CompRect::vector &rects (rem.rects ());
for (std::vector ::const_iterator it = rects.begin ();
@@ -59,6 +59,6 @@
else if (r.y2 () <= inter.boundingRect ().y1 ())
dy += r.height ();
}
-
+*/
return CompPoint (dx, dy);
}
=== modified file 'plugins/wall/src/wall.cpp'
--- plugins/wall/src/wall.cpp 2013-05-15 10:38:49 +0000
+++ plugins/wall/src/wall.cpp 2013-07-21 23:03:28 +0000
@@ -37,9 +37,9 @@
#include "wall.h"
-static const double PI = 3.14159265359f;
+static const double PI = 3.14159265359f;
static const unsigned short VIEWPORT_SWITCHER_SIZE = 100;
-static const unsigned short ARROW_SIZE = 33;
+static const unsigned short ARROW_SIZE = 33;
#define getColorRGBA(name) \
r = optionGet##name##Red() / 65535.0f;\
@@ -65,26 +65,22 @@
void
WallScreen::drawSwitcherBackground ()
{
- cairo_t *cr;
- cairo_pattern_t *pattern;
- float outline = 2.0f;
- int width, height, radius;
- float r, g, b, a;
-
destroyCairoContext (switcherContext);
setupCairoContext (switcherContext);
- cr = switcherContext.cr;
+ cairo_t *cr = switcherContext.cr;
clearCairoLayer (cr);
- width = switcherContext.width - outline;
- height = switcherContext.height - outline;
+ float r, g, b, a;
+ float outline = 2.0f;
+ int width = switcherContext.width - outline;
+ int height = switcherContext.height - outline;
cairo_save (cr);
cairo_translate (cr, outline / 2.0f, outline / 2.0f);
/* set the pattern for the switcher's background */
- pattern = cairo_pattern_create_linear (0, 0, width, height);
+ cairo_pattern_t *pattern = cairo_pattern_create_linear (0, 0, width, height);
getColorRGBA (BackgroundGradientBaseColor);
cairo_pattern_add_color_stop_rgba (pattern, 0.00f, r, g, b, a);
getColorRGBA (BackgroundGradientHighlightColor);
@@ -94,7 +90,8 @@
cairo_set_source (cr, pattern);
/* draw the border's shape */
- radius = optionGetEdgeRadius ();
+ int radius = optionGetEdgeRadius ();
+
if (radius)
{
cairo_arc (cr, radius, radius, radius, PI, 1.5f * PI);
@@ -104,9 +101,7 @@
cairo_arc (cr, radius, height - radius, radius, PI / 2.0f, PI);
}
else
- {
cairo_rectangle (cr, 0, 0, width, height);
- }
cairo_close_path (cr);
@@ -123,11 +118,13 @@
cairo_restore (cr);
cairo_save (cr);
- for (unsigned int i = 0; i < (unsigned int) screen->vpSize ().height (); i++)
+
+ for (unsigned int i = 0; i < (unsigned int) screen->vpSize ().height (); ++i)
{
cairo_translate (cr, 0.0, viewportBorder);
cairo_save (cr);
- for (unsigned int j = 0; j < (unsigned int) screen->vpSize ().width (); j++)
+
+ for (unsigned int j = 0; j < (unsigned int) screen->vpSize ().width (); ++j)
{
cairo_translate (cr, viewportBorder, 0.0);
@@ -142,34 +139,32 @@
cairo_translate (cr, viewportWidth, 0.0);
}
+
cairo_restore(cr);
cairo_translate (cr, 0.0, viewportHeight);
}
+
cairo_restore (cr);
}
void
WallScreen::drawThumb ()
{
- cairo_t *cr;
- cairo_pattern_t *pattern;
- float r, g, b, a;
- float outline = 2.0f;
- int width, height;
-
destroyCairoContext (thumbContext);
setupCairoContext (thumbContext);
- cr = thumbContext.cr;
+ cairo_t *cr = thumbContext.cr;
clearCairoLayer (cr);
- width = thumbContext.width - outline;
- height = thumbContext.height - outline;
+ float r, g, b, a;
+ float outline = 2.0f;
+ int width = thumbContext.width - outline;
+ int height = thumbContext.height - outline;
cairo_translate (cr, outline / 2.0f, outline / 2.0f);
- pattern = cairo_pattern_create_linear (0, 0, width, height);
+ cairo_pattern_t *pattern = cairo_pattern_create_linear (0, 0, width, height);
getColorRGBA (ThumbGradientBaseColor);
cairo_pattern_add_color_stop_rgba (pattern, 0.0f, r, g, b, a);
getColorRGBA (ThumbGradientHighlightColor);
@@ -193,24 +188,20 @@
void
WallScreen::drawHighlight ()
{
- cairo_t *cr;
- cairo_pattern_t *pattern;
- int width, height;
- float r, g, b, a;
- float outline = 2.0f;
-
destroyCairoContext (highlightContext);
setupCairoContext (highlightContext);
- cr = highlightContext.cr;
+ cairo_t *cr = highlightContext.cr;
clearCairoLayer (cr);
- width = highlightContext.width - outline;
- height = highlightContext.height - outline;
+ float r, g, b, a;
+ float outline = 2.0f;
+ int width = highlightContext.width - outline;
+ int height = highlightContext.height - outline;
cairo_translate (cr, outline / 2.0f, outline / 2.0f);
- pattern = cairo_pattern_create_linear (0, 0, width, height);
+ cairo_pattern_t *pattern = cairo_pattern_create_linear (0, 0, width, height);
getColorRGBA (ThumbHighlightGradientBaseColor);
cairo_pattern_add_color_stop_rgba (pattern, 0.0f, r, g, b, a);
getColorRGBA (ThumbHighlightGradientShadowColor);
@@ -234,14 +225,13 @@
void
WallScreen::drawArrow ()
{
- cairo_t *cr;
- float outline = 2.0f;
- float r, g, b, a;
+ float outline = 2.0f;
+ float r, g, b, a;
destroyCairoContext (arrowContext);
setupCairoContext (arrowContext);
- cr = arrowContext.cr;
+ cairo_t *cr = arrowContext.cr;
clearCairoLayer (cr);
cairo_translate (cr, outline / 2.0f, outline / 2.0f);
@@ -283,16 +273,13 @@
void
WallScreen::setupCairoContext (WallCairoContext &context)
{
- XRenderPictFormat *format;
- Screen *xScreen;
- int width, height;
-
- xScreen = ScreenOfDisplay (screen->dpy (), screen->screenNum ());
-
- width = context.width;
- height = context.height;
-
- format = XRenderFindStandardFormat (screen->dpy (), PictStandardARGB32);
+ Screen *xScreen = ScreenOfDisplay (screen->dpy (), screen->screenNum ());
+
+ int width = context.width;
+ int height = context.height;
+
+ XRenderPictFormat *format = XRenderFindStandardFormat (screen->dpy (),
+ PictStandardARGB32);
context.pixmap = XCreatePixmap (screen->dpy (), screen->root (),
width, height, 32);
@@ -300,10 +287,8 @@
context.texture = GLTexture::bindPixmapToTexture (context.pixmap,
width, height, 32);
if (context.texture.empty ())
- {
screen->logMessage ("wall", CompLogLevelError,
"Couldn't create cairo context for switcher");
- }
context.surface =
cairo_xlib_surface_create_with_xrender_format (screen->dpy (),
@@ -334,16 +319,11 @@
WallScreen::checkDestination (unsigned int destX,
unsigned int destY)
{
- CompPoint point;
- CompSize size;
-
- point = screen->vp ();
- size = screen->vpSize ();
-
- if (point.x () - destX >= (unsigned int) size.width ())
- return false;
-
- if (point.y () - destY >= (unsigned int) size.height ())
+ CompPoint point = screen->vp ();
+ CompSize size = screen->vpSize ();
+
+ if (point.x () - destX >= (unsigned int) size.width () ||
+ point.y () - destY >= (unsigned int) size.height ())
return false;
return true;
@@ -359,9 +339,9 @@
WallScreen::computeTranslation (float &x,
float &y)
{
- float elapsed, duration;
+ float elapsed;
+ float duration = optionGetSlideDuration () * 1000.0;
- duration = optionGetSlideDuration () * 1000.0;
if (duration != 0.0)
elapsed = 1.0 - (timer / duration);
else
@@ -369,6 +349,7 @@
if (elapsed < 0.0)
elapsed = 0.0;
+
if (elapsed > 1.0)
elapsed = 1.0;
@@ -384,10 +365,8 @@
WallScreen::determineMovementAngle ()
{
int angle;
- float dx, dy;
-
- dx = gotoX - curPosX;
- dy = gotoY - curPosY;
+ float dx = gotoX - curPosX;
+ float dy = gotoY - curPosY;
if (dy > IGNORE_REMAINDER)
angle = (dx > IGNORE_REMAINDER) ? 135 :
@@ -409,34 +388,24 @@
{
CompOption::Vector o(0);
- if (!x && !y)
- return false;
-
- if (screen->otherGrabExist ("move", "switcher", "group-drag", "wall", 0))
- return false;
-
- if (!checkDestination (x, y))
+ if ((!x && !y) ||
+ screen->otherGrabExist ("move", "switcher", "group-drag", "wall", 0) ||
+ !checkDestination (x, y))
return false;
if (moveWindow != moveWin)
{
- CompWindow *w;
-
releaseMoveWindow ();
- w = screen->findWindow (moveWin);
- if (w)
+ CompWindow *w = screen->findWindow (moveWin);
+
+ if (w &&
+ !(w->type () & (CompWindowTypeDesktopMask | CompWindowTypeDockMask)) &&
+ !(w->state () & CompWindowStateStickyMask))
{
- if (!(w->type () & (CompWindowTypeDesktopMask |
- CompWindowTypeDockMask)))
- {
- if (!(w->state () & CompWindowStateStickyMask))
- {
- moveWindow = w->id ();
- moveWindowX = w->x ();
- moveWindowY = w->y ();
- w->raise ();
- }
- }
+ moveWindow = w->id ();
+ moveWindowX = w->x ();
+ moveWindowY = w->y ();
+ w->raise ();
}
}
@@ -445,6 +414,7 @@
curPosX = screen->vp ().x ();
curPosY = screen->vp ().y ();
}
+
gotoX = screen->vp ().x () - x;
gotoY = screen->vp ().y () - y;
@@ -476,6 +446,7 @@
void
WallScreen::handleEvent (XEvent *event)
{
+<<<<<<< TREE
switch (event->type) {
case ClientMessage:
if (event->xclient.message_type == Atoms::desktopViewport)
@@ -497,9 +468,40 @@
}
break;
+=======
+ switch (event->type)
+ {
+ case ClientMessage:
+ if (event->xclient.message_type == Atoms::desktopViewport)
+ {
+ if (screen->otherGrabExist ("switcher", "wall", 0))
+ break;
+
+ int dx = event->xclient.data.l[0] / screen->width();
+ dx -= screen->vp ().x ();
+ int dy = event->xclient.data.l[1] / screen->height();
+ dy -= screen->vp ().y ();
+
+ if (!dx && !dy)
+ break;
+
+ moveViewport (-dx, -dy, None);
+ }
+
+ if (event->xclient.message_type == Atoms::xdndEnter)
+ {
+ toggleEdges (true);
+ edgeDrag = true;
+ }
+ else if (event->xclient.message_type == Atoms::xdndLeave)
+ edgeDrag = false;
+
+ break;
+>>>>>>> MERGE-SOURCE
case FocusIn:
case FocusOut:
+<<<<<<< TREE
/* Edges on when grabbed */
if (!optionGetEdgeflipPointer ())
{
@@ -508,17 +510,33 @@
else if (event->xfocus.mode == NotifyUngrab)
toggleEdges (false);
}
+=======
+ if (event->xfocus.mode == NotifyGrab)
+ poller.start ();
+ else if (event->xfocus.mode == NotifyUngrab)
+ poller.stop ();
+
+ break;
+>>>>>>> MERGE-SOURCE
case ConfigureNotify:
- break;
-
- default:
- break;
+<<<<<<< TREE
+ break;
+
+ default:
+ break;
+=======
+ break;
+
+ default:
+ break;
+>>>>>>> MERGE-SOURCE
}
screen->handleEvent (event);
}
+<<<<<<< TREE
/*
* When a dnd type window is mapped toggle edge flip dnd windows back on
* _NET_WM_WINDOW_TYPE_DND windows. This will not detect all dnd windows
@@ -546,6 +564,23 @@
}
window->windowNotify (n);
+=======
+void
+WallScreen::positionUpdate (const CompPoint &pos)
+{
+ if (edgeDrag)
+ return;
+
+ if (edgeRegion.contains (pos))
+ toggleEdges (false);
+ else if (noEdgeRegion.contains (pos))
+ {
+ if (!screen->grabbed ())
+ poller.stop ();
+
+ toggleEdges (true);
+ }
+>>>>>>> MERGE-SOURCE
}
void
@@ -555,12 +590,11 @@
if (window->placed () && !screen->otherGrabExist ("wall", "switcher", 0))
{
- int dx, dy;
CompPoint viewport;
screen->viewportForGeometry (window->geometry (), viewport);
- dx = viewport.x ();
- dy = viewport.y ();
+ int dx = viewport.x ();
+ int dy = viewport.y ();
/* Handle negative value */
dx = (unsigned int) dx % screen->vpSize ().width ();
@@ -626,16 +660,13 @@
}
void
-WallScreen::checkAmount (int dx,
- int dy,
- int &amountX,
- int &amountY)
+WallScreen::checkAmount (int dx,
+ int dy,
+ int &amountX,
+ int &amountY)
{
- CompPoint point;
- CompSize size;
-
- point = screen->vp ();
- size = screen->vpSize ();
+ CompPoint point = screen->vp ();
+ CompSize size = screen->vpSize ();
amountX = -dx;
amountY = -dy;
@@ -662,36 +693,39 @@
bool withWin)
{
int dx = 0, dy = 0, amountX, amountY;
- unsigned int vpX, vpY;
- CompSize size;
Window win = None;
- vpX = screen->vp ().x ();
- vpY = screen->vp ().y ();
- size = screen->vpSize ();
+ unsigned int vpX = screen->vp ().x ();
+ unsigned int vpY = screen->vp ().y ();
+ CompSize size = screen->vpSize ();
- switch (dir) {
+ switch (dir)
+ {
case Up:
dy = -1;
checkAmount (dx, dy, amountX, amountY);
break;
+
case Down:
dy = 1;
checkAmount (dx, dy, amountX, amountY);
break;
+
case Left:
dx = -1;
checkAmount (dx, dy, amountX, amountY);
break;
+
case Right:
dx = 1;
checkAmount (dx, dy, amountX, amountY);
break;
+
case Next:
- if ((vpX == (unsigned int) size.width () - 1) &&
+ if ((vpX == (unsigned int) size.width () - 1) &&
(vpY == (unsigned int) size.height () - 1))
{
- amountX = size.width () - 1;
+ amountX = size.width () - 1;
amountY = size.height () - 1;
}
else if (vpX == (unsigned int) size.width () - 1)
@@ -706,6 +740,7 @@
}
break;
+
case Prev:
if (vpX == 0 && vpY == 0)
{
@@ -722,6 +757,10 @@
amountX = 1;
amountY = 0;
}
+
+ break;
+
+ default:
break;
}
@@ -769,6 +808,7 @@
int dx, dy;
int amountX, amountY;
+<<<<<<< TREE
const bool allowFlipDnd = (state & CompAction::StateInitEdgeDnd) &&
optionGetEdgeflipDnd ();
const bool allowFlipMove = (windowIsDragMoved &&
@@ -806,6 +846,59 @@
dx = 0;
dy = 0;
break;
+=======
+ if (screen->otherGrabExist ("wall", "move", "group-drag", NULL))
+ return false;
+
+ if (state & CompAction::StateInitEdgeDnd)
+ {
+ if (!optionGetEdgeflipDnd ())
+ return false;
+ }
+ else if (screen->grabExist ("move"))
+ {
+ if (!optionGetEdgeflipMove ())
+ return false;
+ }
+ else if (screen->grabExist ("group-drag"))
+ {
+ if (!optionGetEdgeflipDnd ())
+ return false;
+ }
+ else if (!optionGetEdgeflipPointer ())
+ {
+ toggleEdges (false);
+ poller.start ();
+ return false;
+ }
+
+ switch (direction)
+ {
+ case Left:
+ dx = -1;
+ dy = 0;
+ break;
+
+ case Right:
+ dx = 1;
+ dy = 0;
+ break;
+
+ case Up:
+ dx = 0;
+ dy = -1;
+ break;
+
+ case Down:
+ dx = 0;
+ dy = 1;
+ break;
+
+ default:
+ dx = 0;
+ dy = 0;
+ break;
+>>>>>>> MERGE-SOURCE
}
checkAmount (dx, dy, amountX, amountY);
@@ -859,8 +952,8 @@
GLTexture::Matrix *matrix,
BOX *box)
{
- GLfloat textureData[8];
- GLfloat vertexData[12];
+ GLfloat textureData[8];
+ GLfloat vertexData[12];
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
streamingBuffer->begin (GL_TRIANGLE_STRIP);
@@ -897,39 +990,36 @@
void
WallScreen::drawCairoTextureOnScreen (const GLMatrix &transform)
{
- float centerX, centerY;
- float width, height;
- float topLeftX, topLeftY;
- float border;
GLTexture::Matrix matrix;
BOX box;
GLMatrix wTransform (transform);
- GLVertexBuffer *gl = GLVertexBuffer::streamingBuffer ();
+ GLVertexBuffer *gl = GLVertexBuffer::streamingBuffer ();
CompOutput::vector &outputDevs = screen->outputDevs ();
- CompOutput output = outputDevs[boxOutputDevice];
-
- glEnable (GL_BLEND);
-
- centerX = output.x1 () + (output.width () / 2.0f);
- centerY = output.y1 () + (output.height () / 2.0f);
-
- border = (float) viewportBorder;
- width = (float) switcherContext.width;
- height = (float) switcherContext.height;
-
- topLeftX = centerX - floor (width / 2.0f);
- topLeftY = centerY - floor (height / 2.0f);
+ CompOutput output = outputDevs[boxOutputDevice];
+
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
+ float centerX = output.x1 () + (output.width () / 2.0f);
+ float centerY = output.y1 () + (output.height () / 2.0f);
+
+ float border = (float) viewportBorder;
+ float width = (float) switcherContext.width;
+ float height = (float) switcherContext.height;
+
+ float topLeftX = centerX - floor (width / 2.0f);
+ float topLeftY = centerY - floor (height / 2.0f);
firstViewportX = topLeftX + border;
firstViewportY = topLeftY + border;
if (!moving)
{
- double left, timeout;
-
- timeout = optionGetPreviewTimeout () * 1000.0f;
- left = (timeout > 0) ? (float) boxTimeout / timeout : 1.0f;
+ double timeout = optionGetPreviewTimeout () * 1000.0f;
+ double left = (timeout > 0) ? (float) boxTimeout / timeout : 1.0f;
if (left < 0)
left = 0.0f;
@@ -947,9 +1037,7 @@
mSzCamera = -(1 - left);
}
else
- {
mSzCamera = 0.0f;
- }
/* draw background */
@@ -971,9 +1059,10 @@
height = (float) thumbContext.height;
thumbContext.texture[0]->enable (GLTexture::Fast);
- for (unsigned int i = 0; i < (unsigned int) screen->vpSize ().width (); i++)
+
+ for (unsigned int i = 0; i < (unsigned int) screen->vpSize ().width (); ++i)
{
- for (unsigned int j = 0; j < (unsigned int) screen->vpSize ().height (); j++)
+ for (unsigned int j = 0; j < (unsigned int) screen->vpSize ().height (); ++j)
{
if (i == gotoX && j == gotoY && moving)
continue;
@@ -992,13 +1081,13 @@
wallDrawQuad (wTransform, &matrix, &box);
}
}
+
thumbContext.texture[0]->disable ();
if (moving || showPreview)
{
/* draw highlight */
-
- box.x1 = screen->vp ().x () * (width + border) + topLeftX + border;
+ box.x1 = screen->vp ().x () * (width + border) + topLeftX + border;
box.x2 = box.x1 + width;
box.y1 = screen->vp ().y () * (height + border) + topLeftY + border;
box.y2 = box.y1 + height;
@@ -1067,6 +1156,7 @@
box.x1 = topLeftX - aW - border;
box.y1 = topLeftY + height / 2.0f - aH / 2.0f;
break;
+
default:
break;
}
@@ -1074,11 +1164,9 @@
else
{
/* arrow is visible (no preview is painted over it) */
- box.x1 = screen->vp().x() * (width + border) +
- topLeftX + border;
- box.x1 += width / 2 - aW / 2;
- box.y1 = screen->vp().y() * (height + border) +
- topLeftY + border;
+ box.x1 = screen->vp().x() * (width + border) + topLeftX + border;
+ box.x1 += width / 2 - aW / 2;
+ box.y1 = screen->vp().y() * (height + border) + topLeftY + border;
box.y1 += height / 2 - aH / 2;
}
@@ -1125,20 +1213,17 @@
CompOutput *output,
unsigned int mask)
{
- bool status;
-
transform = NoTransformation;
if (moving)
mask |= PAINT_SCREEN_TRANSFORMED_MASK |
PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
- status = glScreen->glPaintOutput (attrib, matrix, region, output, mask);
+ bool status = glScreen->glPaintOutput (attrib, matrix, region, output, mask);
- if (optionGetShowSwitcher () &&
- (moving || showPreview || boxTimeout) &&
- (output->id () == boxOutputDevice ||
- output == &screen->fullscreenOutput ()))
+ if (optionGetShowSwitcher () &&
+ (moving || showPreview || boxTimeout) &&
+ (output->id () == boxOutputDevice || output == &screen->fullscreenOutput ()))
{
GLMatrix sMatrix (matrix);
@@ -1147,54 +1232,48 @@
drawCairoTextureOnScreen (sMatrix);
if (optionGetMiniscreen ())
- {
- float mw, mh;
-
- mw = viewportWidth;
- mh = viewportHeight;
-
- transform = MiniScreen;
- mSAttribs.xScale = mw / screen->width ();
- mSAttribs.yScale = mh / screen->height ();
- mSAttribs.opacity = OPAQUE * (1.0 + mSzCamera);
+ {
+ float mw = viewportWidth;
+ float mh = viewportHeight;
+
+ transform = MiniScreen;
+ mSAttribs.xScale = mw / screen->width ();
+ mSAttribs.yScale = mh / screen->height ();
+ mSAttribs.opacity = OPAQUE * (1.0 + mSzCamera);
mSAttribs.saturation = COLOR;
- for (unsigned int j = 0; j < (unsigned int) screen->vpSize ().height (); j++)
+ for (unsigned int j = 0; j < (unsigned int) screen->vpSize ().height (); ++j)
{
- for (unsigned int i = 0; i < (unsigned int) screen->vpSize ().width (); i++)
+ for (unsigned int i = 0; i < (unsigned int) screen->vpSize ().width (); ++i)
{
- float mx, my;
- unsigned int msMask;
- CompPoint vp (i, j);
-
- mx = firstViewportX +
- (i * (viewportWidth + viewportBorder));
- my = firstViewportY +
- (j * (viewportHeight + viewportBorder));
-
- mSAttribs.xTranslate = mx / output->width ();
+ CompPoint vp (i, j);
+
+ float mx = firstViewportX +
+ (i * (viewportWidth + viewportBorder));
+ float my = firstViewportY +
+ (j * (viewportHeight + viewportBorder));
+
+ mSAttribs.xTranslate = mx / output->width ();
mSAttribs.yTranslate = -my / output->height ();
mSAttribs.brightness = 0.4f * BRIGHT;
if (vp == screen->vp () &&
(moving || boxTimeout || showPreview))
- {
mSAttribs.brightness = BRIGHT;
- }
cScreen->setWindowPaintOffset ((screen->vp ().x () - i) *
screen->width (),
(screen->vp ().y () - j) *
screen->height ());
- msMask = mask | PAINT_SCREEN_TRANSFORMED_MASK;
+ unsigned int msMask = mask | PAINT_SCREEN_TRANSFORMED_MASK;
glScreen->glPaintTransformedOutput (attrib, matrix,
region, output, msMask);
-
}
}
+
transform = NoTransformation;
cScreen->setWindowPaintOffset (0, 0);
}
@@ -1218,15 +1297,12 @@
if (moveWindow)
{
- CompWindow *window;
+ CompWindow *window = screen->findWindow (moveWindow);
- window = screen->findWindow (moveWindow);
if (window)
{
- float dx, dy;
-
- dx = (gotoX - curPosX) * screen->width ();
- dy = (gotoY - curPosY) * screen->height ();
+ float dx = (gotoX - curPosX) * screen->width ();
+ float dy = (gotoY - curPosY) * screen->height ();
window->moveToViewportPosition (moveWindowX - dx,
moveWindowY - dy,
@@ -1243,12 +1319,10 @@
if (moveWindow)
releaseMoveWindow ();
- else if (focusDefault)
- {
- /* only focus default window if switcher is not active */
- if (!screen->grabExist ("switcher"))
- screen->focusDefaultWindow ();
- }
+ else if (focusDefault &&
+ /* only focus default window if switcher is not active */
+ !screen->grabExist ("switcher"))
+ screen->focusDefaultWindow ();
screen->handleCompizEvent ("wall", "end_viewport_switch", o);
}
@@ -1271,7 +1345,7 @@
mask &= ~PAINT_SCREEN_CLEAR_MASK;
- /* move each screen to the correct output position */
+ /* move each screen to the correct output position */
sMatrix.translate (-(float) output->x1 () / (float) output->width (),
(float) output->y1 () / (float) output->height (),
0.0f);
@@ -1308,8 +1382,6 @@
ScreenTransformation oldTransform = transform;
GLMatrix sMatrix (matrix);
float xTranslate, yTranslate;
- float px, py;
- bool movingX, movingY;
CompPoint point (screen->vp ());
CompRegion outputRegion (*output);
@@ -1319,11 +1391,11 @@
transform = Sliding;
currOutput = output;
- px = curPosX;
- py = curPosY;
+ float px = curPosX;
+ float py = curPosY;
- movingX = ((int) floor (px)) != ((int) ceil (px));
- movingY = ((int) floor (py)) != ((int) ceil (py));
+ bool movingX = ((int) floor (px)) != ((int) ceil (px));
+ bool movingY = ((int) floor (py)) != ((int) ceil (py));
if (movingY)
{
@@ -1413,7 +1485,7 @@
GLWindowPaintAttrib pA (attrib);
pA.opacity = attrib.opacity *
- ((float) ws->mSAttribs.opacity / OPAQUE);
+ ((float) ws->mSAttribs.opacity / OPAQUE);
pA.brightness = attrib.brightness *
((float) ws->mSAttribs.brightness / BRIGHT);
pA.saturation = attrib.saturation *
@@ -1434,9 +1506,7 @@
status = glWindow->glPaint (attrib, wMatrix, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
}
else
- {
status = glWindow->glPaint (attrib, matrix, region, mask);
- }
return status;
}
@@ -1462,18 +1532,16 @@
void
WallScreen::createCairoContexts (bool initial)
{
- int width, height;
-
- viewportWidth = VIEWPORT_SWITCHER_SIZE *
- (float) optionGetPreviewScale () / 100.0f;
+ viewportWidth = VIEWPORT_SWITCHER_SIZE *
+ (float) optionGetPreviewScale () / 100.0f;
viewportHeight = viewportWidth * (float) screen->height () /
(float) screen->width ();
viewportBorder = optionGetBorderWidth ();
- width = screen->vpSize ().width () * (viewportWidth + viewportBorder) +
- viewportBorder;
- height = screen->vpSize ().height () * (viewportHeight + viewportBorder) +
- viewportBorder;
+ int width = screen->vpSize ().width () * (viewportWidth + viewportBorder) +
+ viewportBorder;
+ int height = screen->vpSize ().height () * (viewportHeight + viewportBorder) +
+ viewportBorder;
destroyCairoContext (switcherContext);
switcherContext.width = width;
@@ -1495,10 +1563,10 @@
if (initial)
{
- arrowContext.width = ARROW_SIZE;
- arrowContext.height = ARROW_SIZE;
- setupCairoContext (arrowContext);
- drawArrow ();
+ arrowContext.width = ARROW_SIZE;
+ arrowContext.height = ARROW_SIZE;
+ setupCairoContext (arrowContext);
+ drawArrow ();
}
}
@@ -1527,7 +1595,8 @@
WallScreen::optionChanged (CompOption *opt,
WallOptions::Options num)
{
- switch(num) {
+ switch(num)
+ {
case WallOptions::OutlineColor:
drawSwitcherBackground ();
drawHighlight ();
@@ -1584,13 +1653,9 @@
{
bool status = screen->setOptionForPlugin (plugin, name, value);
- if (strcmp (plugin, "core") == 0)
- {
- if (strcmp (name, "hsize") == 0 || strcmp (name, "vsize") == 0)
- {
- createCairoContexts (false);
- }
- }
+ if (strcmp (plugin, "core") == 0 &&
+ (strcmp (name, "hsize") == 0 || strcmp (name, "vsize") == 0))
+ createCairoContexts (false);
return status;
}
@@ -1698,6 +1763,12 @@
setNotify (ArrowShadowColor);
setNotify (NoSlideMatch);
setNotify (EdgeflipPointer);
+<<<<<<< TREE
+=======
+
+ poller.setCallback (boost::bind (&WallScreen::positionUpdate, this,
+ _1));
+>>>>>>> MERGE-SOURCE
}
WallScreen::~WallScreen ()
@@ -1724,10 +1795,18 @@
bool
WallPluginVTable::init ()
{
+<<<<<<< TREE
if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
return true;
+=======
+ if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
+ CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
+ CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI) &&
+ CompPlugin::checkPluginABI ("mousepoll", COMPIZ_MOUSEPOLL_ABI))
+ return true;
+>>>>>>> MERGE-SOURCE
return false;
}
=== modified file 'plugins/wall/src/wall.h'
--- plugins/wall/src/wall.h 2013-04-27 03:18:27 +0000
+++ plugins/wall/src/wall.h 2013-07-21 23:03:28 +0000
@@ -53,8 +53,8 @@
cairo_surface_t *surface;
cairo_t *cr;
- int width;
- int height;
+ int width;
+ int height;
} WallCairoContext;
/* classes */
@@ -66,6 +66,7 @@
public WallOptions
{
public:
+
enum Direction
{
Up = 0,
@@ -80,20 +81,28 @@
~WallScreen ();
void preparePaint (int);
- void paint (CompOutput::ptrList &, unsigned int);
+ void paint (CompOutput::ptrList &,
+ unsigned int );
void donePaint ();
+
void handleEvent (XEvent *event);
bool glPaintOutput (const GLScreenPaintAttrib &,
- const GLMatrix &, const CompRegion &,
- CompOutput *, unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
+
void glPaintTransformedOutput (const GLScreenPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- CompOutput *, unsigned int);
-
- bool setOptionForPlugin (const char *, const char *,
- CompOption::Value&);
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
+
+ bool setOptionForPlugin (const char *,
+ const char *,
+ CompOption::Value &);
+
void matchExpHandlerChanged ();
void matchPropertyChanged (CompWindow *);
@@ -101,6 +110,7 @@
void setupCairoContext (WallCairoContext &);
void destroyCairoContext (WallCairoContext &);
void clearCairoLayer (cairo_t *);
+
void drawSwitcherBackground ();
void drawThumb ();
void drawHighlight ();
@@ -108,22 +118,42 @@
void drawCairoTextureOnScreen (const GLMatrix &transform);
void releaseMoveWindow ();
- void computeTranslation (float &, float &);
+ void computeTranslation (float &,
+ float &);
+
void determineMovementAngle ();
- bool checkDestination (unsigned int, unsigned int);
- void checkAmount (int, int, int &, int &);
-
- bool initiate (CompAction *, CompAction::State, CompOption::Vector &,
- Direction, bool);
- bool terminate (CompAction *, CompAction::State, CompOption::Vector &);
- bool initiateFlip (Direction, CompAction::State);
-
- bool moveViewport (int, int, Window);
-
- void optionChanged (CompOption *opt, WallOptions::Options num);
+ bool checkDestination (unsigned int,
+ unsigned int);
+
+ void checkAmount (int ,
+ int ,
+ int &,
+ int &);
+
+ bool initiate (CompAction *,
+ CompAction::State ,
+ CompOption::Vector &,
+ Direction ,
+ bool );
+
+ bool terminate (CompAction *,
+ CompAction::State ,
+ CompOption::Vector &);
+
+ bool initiateFlip (Direction ,
+ CompAction::State);
+
+ bool moveViewport (int ,
+ int ,
+ Window);
+
+ void optionChanged (CompOption *opt,
+ WallOptions::Options num);
+
void toggleEdges (bool);
void positionUpdate (const CompPoint &pos);
+<<<<<<< TREE
CompositeScreen *cScreen;
GLScreen *glScreen;
@@ -140,7 +170,26 @@
int boxTimeout;
unsigned int boxOutputDevice;
+=======
+
+ CompositeScreen *cScreen;
+ GLScreen *glScreen;
+
+ bool moving; /* Used to track miniview movement */
+ bool showPreview;
+
+ float curPosX;
+ float curPosY;
+ unsigned int gotoX;
+ unsigned int gotoY;
+
+ int direction; /* >= 0 : direction arrow angle, < 0 : no direction */
+
+ int boxTimeout;
+ unsigned int boxOutputDevice;
+>>>>>>> MERGE-SOURCE
CompScreen::GrabHandle grabIndex;
+<<<<<<< TREE
int timer;
Window moveWindow;
@@ -168,6 +217,38 @@
WallCairoContext arrowContext;
bool windowIsDragMoved;
+=======
+ int timer;
+
+ Window moveWindow;
+
+ bool focusDefault;
+
+ ScreenTransformation transform;
+ CompOutput *currOutput;
+
+ GLWindowPaintAttrib mSAttribs;
+ float mSzCamera;
+
+ int firstViewportX;
+ int firstViewportY;
+ int viewportWidth;
+ int viewportHeight;
+ int viewportBorder;
+
+ int moveWindowX;
+ int moveWindowY;
+
+ WallCairoContext switcherContext;
+ WallCairoContext thumbContext;
+ WallCairoContext highlightContext;
+ WallCairoContext arrowContext;
+
+ MousePoller poller;
+ bool edgeDrag;
+ CompRegion edgeRegion;
+ CompRegion noEdgeRegion;
+>>>>>>> MERGE-SOURCE
};
class WallWindow :
@@ -176,19 +257,31 @@
public PluginClassHandler
{
public:
+
WallWindow (CompWindow *);
virtual void activate ();
- void grabNotify (int, int, unsigned int, unsigned int);
+
+ void grabNotify (int ,
+ int ,
+ unsigned int ,
+ unsigned int );
void ungrabNotify ();
+<<<<<<< TREE
void windowNotify (CompWindowNotify);
bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
const CompRegion &, unsigned int);
+=======
+ bool glPaint (const GLWindowPaintAttrib &,
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
+>>>>>>> MERGE-SOURCE
CompWindow *window;
GLWindow *glWindow;
- bool isSliding;
+ bool isSliding;
};
#define WALL_SCREEN(s) \
@@ -204,4 +297,3 @@
bool init ();
};
-
=== modified file 'plugins/wall/wall.xml.in'
--- plugins/wall/wall.xml.in 2013-04-27 03:18:27 +0000
+++ plugins/wall/wall.xml.in 2013-07-21 23:03:28 +0000
@@ -4,7 +4,6 @@
<_short>Desktop Wall
<_long>Desktop Wall Plugin
Desktop
- largedesktop
composite
@@ -73,7 +72,6 @@
<_short>Background Gradient
-
<_short>Base Color
<_long>First color for the background gradient of the switcher window.
@@ -131,7 +129,6 @@
<_short>Highlight Gradient
-
<_short>Base Color
<_long>First color for the thumb highlight gradient of the switcher window.
@@ -155,7 +152,6 @@
<_short>Arrow Colors
-
<_short>Base Color
<_long>First color of the arrow of the switcher window.
=== modified file 'plugins/wallpaper/src/wallpaper.cpp'
--- plugins/wallpaper/src/wallpaper.cpp 2013-05-15 22:15:41 +0000
+++ plugins/wallpaper/src/wallpaper.cpp 2013-07-21 23:03:28 +0000
@@ -265,7 +265,7 @@
blackenSecondary ();
fadeDuration = optionGetCycleTimeout ();
- fadeTimer = optionGetFadeDuration ();
+ fadeTimer = optionGetFadeDuration ();
}
void
@@ -286,10 +286,17 @@
void
WallpaperScreen::updateTimers ()
{
+<<<<<<< TREE
fadeTimeout = (optionGetCycleTimeout () * 1000 * 60);
fadeDuration = (optionGetFadeDuration () * 1000);
fadeTimer = fadeDuration;
+=======
+ fadeTimeout = optionGetCycleTimeout () * 1000 * 60;
+ fadeDuration = optionGetFadeDuration () * 1000;
+ fadeTimer = fadeDuration;
+
+>>>>>>> MERGE-SOURCE
if (optionGetCycleWallpapers ())
rotateTimer.start (fadeTimeout, fadeTimeout * 1.2);
else
=== modified file 'plugins/water/src/water.cpp'
--- plugins/water/src/water.cpp 2013-05-09 14:02:10 +0000
+++ plugins/water/src/water.cpp 2013-07-21 23:03:28 +0000
@@ -38,7 +38,8 @@
static int waterLastPointerX = 0;
static int waterLastPointerY = 0;
-GLfloat WaterScreen::vertexData [18] = {
+GLfloat WaterScreen::vertexData [18] =
+{
-1.0f, -1.0f, 0.0f,
1.0f, -1.0f, 0.0f,
-1.0f, 1.0f, 0.0f,
@@ -47,7 +48,8 @@
1.0f, 1.0f, 0.0f,
};
-GLfloat WaterScreen::textureData [12] = {
+GLfloat WaterScreen::textureData [12] =
+{
0.0f, 0.0f,
1.0f, 0.0f,
0.0f, 1.0f,
@@ -92,7 +94,7 @@
if (!fboPrologue (INDEX (this, 1)))
return;
- glEnable (GL_TEXTURE_2D);
+// glEnable (GL_TEXTURE_2D);
vertexBuffer[UPDATE]->begin ();
vertexBuffer[UPDATE]->addVertices (6, &vertexData[0]);
@@ -130,7 +132,7 @@
glActiveTexture (GL_TEXTURE1);
glBindTexture (GL_TEXTURE_2D, 0);
- glDisable (GL_TEXTURE_2D);
+// glDisable (GL_TEXTURE_2D);
fboEpilogue ();
@@ -140,9 +142,9 @@
void
WaterScreen::waterVertices (GLenum type,
- XPoint *p,
- int n,
- float v)
+ XPoint *p,
+ int n,
+ float v)
{
if (!fboPrologue (INDEX (this, 0)))
return;
@@ -154,15 +156,17 @@
{
vertexBuffer[SET]->begin (type);
float data[3];
+
for (int i = 0; i < n; i++)
{
data[0] = ((float) p->x / (float) screen->width ()) * 2.0f - 1.0f;
data[1] = (((float) screen->height () - (float) p->y) /
(float) screen->height ()) * 2.0f - 1.0f;
data[2] = 0.0f;
- p++;
+ ++p;
vertexBuffer[SET]->addVertices (1, &data[0]);
}
+
vertexBuffer[SET]->end();
vertexBuffer[SET]->addUniform ("color", v);
@@ -170,6 +174,7 @@
glGetBooleanv (GL_BLEND, &isBlendingEnabled);
glDisable (GL_BLEND);
vertexBuffer[SET]->render ();
+
if (isBlendingEnabled)
glEnable (GL_BLEND);
}
@@ -193,7 +198,7 @@
bool
WaterScreen::rainTimeout ()
{
- XPoint p;
+ XPoint p;
p.x = (int) (screen->width () * (rand () / (float) RAND_MAX));
p.y = (int) (screen->height () * (rand () / (float) RAND_MAX));
@@ -222,7 +227,6 @@
void
WaterScreen::waterSetup ()
{
- int size;
std::string buffer;
texHeight = TEXTURE_SIZE;
@@ -246,7 +250,7 @@
}
#endif
- size = (texWidth + 2) * (texHeight + 2);
+ int size = (texWidth + 2) * (texHeight + 2);
data = calloc (1, (sizeof (float) * size * 2) +
(sizeof (GLubyte) * texWidth * texHeight * 4));
@@ -299,6 +303,7 @@
if (GL::fboEnabled)
{
CompSize size(texWidth, texHeight);
+
for (int i = 0; i < TEXTURE_NUM; i++)
{
waterFbo[i] = new GLFramebufferObject ();
@@ -307,6 +312,7 @@
// check if FBOs are working. If not, fallback to software textures
oldFbo = waterFbo[i]->bind ();
waterFbo[i]->rebind (oldFbo);
+
if (!waterFbo[i]->checkStatus ())
{
useFbo = false;
@@ -319,8 +325,8 @@
void
WaterScreen::glPaintCompositedOutput (const CompRegion ®ion,
- GLFramebufferObject *fbo,
- unsigned int mask)
+ GLFramebufferObject *fbo,
+ unsigned int mask)
{
if (count)
{
@@ -335,7 +341,7 @@
vertexBuffer[PAINT]->addTexCoords (0, 6, &textureData[0]);
vertexBuffer[PAINT]->end ();
- glEnable (GL_TEXTURE_2D);
+// glEnable (GL_TEXTURE_2D);
glActiveTexture (GL_TEXTURE0);
fbo->tex ()->setFilter (GL_LINEAR);
@@ -345,7 +351,7 @@
glActiveTexture (GL_TEXTURE1);
waterFbo[INDEX (this, 0)]->tex ()->setFilter (GL_LINEAR);
glBindTexture (GL_TEXTURE_2D,
- waterFbo[INDEX (this, 0)]->tex ()->name ());
+ waterFbo[INDEX (this, 0)]->tex ()->name ());
vertexBuffer[PAINT]->addUniform ("waveTex", 1);
vertexBuffer[PAINT]->addUniform3f ("lightVec",
@@ -361,7 +367,7 @@
glEnable (GL_BLEND);
glBindTexture (GL_TEXTURE_2D, 0);
- glDisable (GL_TEXTURE_2D);
+// glDisable (GL_TEXTURE_2D);
}
}
}
@@ -373,19 +379,20 @@
if (count)
{
count -= 10;
+
if (count < 0)
count = 0;
if (wiperTimer.active ())
{
- float step, angle0, angle1;
+ float angle0, angle1;
bool wipe = false;
XPoint p[3];
p[1].x = screen->width () / 2;
p[1].y = screen->height ();
- step = wiperSpeed * msSinceLastPaint / 20.0f;
+ float step = wiperSpeed * msSinceLastPaint / 20.0f;
if (wiperSpeed > 0.0f)
{
@@ -490,7 +497,6 @@
cScreen->damageScreen ();
}
-
}
static bool
@@ -499,7 +505,7 @@
CompOption::Vector &options)
{
unsigned int ui;
- Window root, child;
+ Window root, child;
int xRoot, yRoot, i;
WATER_SCREEN (screen);
@@ -560,24 +566,20 @@
/* Remember StateCancel and StateCommit will be broadcast to all actions
so we need to verify that we are actually being toggled... */
if (!(state & CompAction::StateTermKey))
- return false;
+ return false;
/* And only respond to key taps */
if (!(state & CompAction::StateTermTapped))
- return false;
+ return false;
WATER_SCREEN (screen);
if (!ws->rainTimer.active ())
{
- int delay;
-
- delay = ws->optionGetRainDelay ();
- ws->rainTimer.start (delay, (float) delay * 1.2);
+ int delay = ws->optionGetRainDelay ();
+ ws->rainTimer.start (delay, (float)delay * 1.2);
}
else
- {
ws->rainTimer.stop ();
- }
return false;
}
@@ -590,13 +592,9 @@
WATER_SCREEN (screen);
if (!ws->wiperTimer.active ())
- {
ws->wiperTimer.start (2000, 2400);
- }
else
- {
ws->wiperTimer.stop ();
- }
return false;
}
@@ -606,15 +604,13 @@
CompAction::State state,
CompOption::Vector &options)
{
- CompWindow *w;
- int xid;
-
WATER_SCREEN (screen);
- xid = CompOption::getIntOptionNamed (options, "window",
- screen->activeWindow ());
-
- w = screen->findWindow (xid);
+ Window xid = CompOption::getIntOptionNamed (options, "window",
+ screen->activeWindow ());
+
+ CompWindow *w = screen->findWindow (xid);
+
if (w)
{
const CompWindow::Geometry &g = w->geometry ();
@@ -640,7 +636,6 @@
CompOption::Vector &options)
{
XPoint p;
- float amp;
WATER_SCREEN (screen);
@@ -649,7 +644,7 @@
p.y = CompOption::getIntOptionNamed (options, "y",
screen->height () / 2);
- amp = CompOption::getFloatOptionNamed (options, "amplitude", 0.5f);
+ float amp = CompOption::getFloatOptionNamed (options, "amplitude", 0.5f);
ws->waterVertices (GL_POINTS, &p, 1, amp);
@@ -664,7 +659,6 @@
CompOption::Vector &options)
{
XPoint p[2];
- float amp;
WATER_SCREEN (screen);
@@ -679,7 +673,7 @@
p[1].y = CompOption::getIntOptionNamed (options, "y1",
screen->height () / 2);
- amp = CompOption::getFloatOptionNamed (options, "amplitude", 0.25f);
+ float amp = CompOption::getFloatOptionNamed (options, "amplitude", 0.25f);
ws->waterVertices (GL_LINES, p, 2, amp);
@@ -691,7 +685,8 @@
void
WaterScreen::handleEvent (XEvent *event)
{
- switch (event->type) {
+ switch (event->type)
+ {
case ButtonPress:
if (event->xbutton.root == screen->root () && grabIndex)
{
@@ -703,15 +698,22 @@
waterVertices (GL_POINTS, &p, 1, 0.8f);
cScreen->damageScreen ();
}
+
break;
+
case EnterNotify:
case LeaveNotify:
if (event->xcrossing.root == screen->root () && grabIndex)
handleMotionEvent ();
+
break;
+
case MotionNotify:
if (event->xmotion.root == screen->root () && grabIndex)
handleMotionEvent ();
+
+ break;
+
default:
break;
}
@@ -722,26 +724,34 @@
void
WaterScreen::optionChange (WaterOptions::Options num)
{
- switch (num) {
+ switch (num)
+ {
case WaterOptions::OffsetScale:
offsetScale = optionGetOffsetScale () * 10.0f;
break;
+
case WaterOptions::RainDelay:
if (rainTimer.active ())
{
- rainTimer.setTimes (optionGetRainDelay (),
- (float)optionGetRainDelay () * 1.2);
+ int rainDelay = optionGetRainDelay ();
+ rainTimer.setTimes (rainDelay,
+ (float)rainDelay * 1.2);
}
+
break;
+
case WaterOptions::LightVecX:
lightVec[0] = optionGetLightVecX();
break;
+
case WaterOptions::LightVecY:
lightVec[1] = optionGetLightVecY();
break;
+
case WaterOptions::LightVecZ:
lightVec[2] = optionGetLightVecZ();
break;
+
default:
break;
}
@@ -814,7 +824,7 @@
if (program[PAINT])
delete program[PAINT];
- for (int i = 0; i < TEXTURE_NUM; i++)
+ for (int i = 0; i < TEXTURE_NUM; ++i)
{
if (waterFbo[i])
delete waterFbo[i];
=== modified file 'plugins/water/src/water.h'
--- plugins/water/src/water.h 2012-09-07 23:56:21 +0000
+++ plugins/water/src/water.h 2013-07-21 23:03:28 +0000
@@ -66,16 +66,22 @@
void glPaintCompositedOutput (const CompRegion ®ion,
GLFramebufferObject *fbo,
- unsigned int mask);
+ unsigned int mask);
+
void preparePaint (int);
void donePaint ();
bool fboPrologue (int fboIndex);
void fboEpilogue ();
- bool fboUpdate (float dt, float fade);
+ bool fboUpdate (float dt,
+ float fade);
void waterUpdate (float dt);
- void waterVertices (GLenum type, XPoint *p, int n, float v);
+
+ void waterVertices (GLenum type,
+ XPoint *p,
+ int n,
+ float v);
bool rainTimeout ();
bool wiperTimeout ();
@@ -84,45 +90,47 @@
void handleMotionEvent ();
- CompositeScreen *cScreen;
- GLScreen *gScreen;
+ CompositeScreen *cScreen;
+ GLScreen *gScreen;
- float offsetScale;
+ float offsetScale;
CompScreen::GrabHandle grabIndex;
- GLProgram *program[PROG_NUM];
- GLVertexBuffer *vertexBuffer[PROG_NUM];
-
- static GLfloat vertexData[18];
-
- static GLfloat textureData[12];
-
- GLFramebufferObject *waterFbo[TEXTURE_NUM];
-
- GLFramebufferObject *oldFbo;
- GLint oldViewport[4];
- int fboIndex;
- bool useFbo;
-
- int texWidth, texHeight;
- GLenum target;
- GLfloat tx, ty;
-
- int count;
-
- void *data;
- float *d0;
- float *d1;
- unsigned char *t0;
-
- CompTimer rainTimer;
- CompTimer wiperTimer;
-
- float wiperAngle;
- float wiperSpeed;
-
- GLVector lightVec;
+ GLProgram *program[PROG_NUM];
+ GLVertexBuffer *vertexBuffer[PROG_NUM];
+
+ static GLfloat vertexData[18];
+
+ static GLfloat textureData[12];
+
+ GLFramebufferObject *waterFbo[TEXTURE_NUM];
+
+ GLFramebufferObject *oldFbo;
+ GLint oldViewport[4];
+ int fboIndex;
+ bool useFbo;
+
+ int texWidth;
+ int texHeight;
+ GLenum target;
+ GLfloat tx;
+ GLfloat ty;
+
+ int count;
+
+ void *data;
+ float *d0;
+ float *d1;
+ unsigned char *t0;
+
+ CompTimer rainTimer;
+ CompTimer wiperTimer;
+
+ float wiperAngle;
+ float wiperSpeed;
+
+ GLVector lightVec;
};
class WaterPluginVTable :
@@ -132,4 +140,3 @@
bool init ();
};
-
=== modified file 'plugins/widget/src/widget.cpp'
--- plugins/widget/src/widget.cpp 2013-05-28 21:31:18 +0000
+++ plugins/widget/src/widget.cpp 2013-07-21 23:03:28 +0000
@@ -586,7 +586,9 @@
WIDGET_SCREEN (screen);
/* Don't focus non-widget windows while widget mode is enabled */
- if (ws->mState != WidgetScreen::StateOff && !mIsWidget && !mParentWidget)
+ if (ws->mState != WidgetScreen::StateOff &&
+ !mIsWidget &&
+ !mParentWidget)
return false;
return window->focus ();
=== modified file 'plugins/winrules/src/winrules.cpp'
--- plugins/winrules/src/winrules.cpp 2013-05-09 13:43:07 +0000
+++ plugins/winrules/src/winrules.cpp 2013-07-21 23:03:28 +0000
@@ -32,10 +32,13 @@
if (protocols & CompWindowProtocolDeleteMask)
protocol[count++] = Atoms::wmDeleteWindow;
+
if (protocols & CompWindowProtocolTakeFocusMask)
protocol[count++] = Atoms::wmTakeFocus;
+
if (protocols & CompWindowProtocolPingMask)
protocol[count++] = Atoms::wmPing;
+
if (protocols & CompWindowProtocolSyncRequestMask)
protocol[count++] = Atoms::wmSyncRequest;
@@ -45,10 +48,8 @@
bool
WinrulesWindow::is ()
{
- if (window->overrideRedirect ())
- return false;
-
- if (window->wmType () & CompWindowTypeDesktopMask)
+ if (window->overrideRedirect () ||
+ window->wmType () & CompWindowTypeDesktopMask)
return false;
return true;
@@ -79,7 +80,7 @@
}
void
-WinrulesWindow::setNoFocus (int optNum)
+WinrulesWindow::setNoFocus (int optNum)
{
unsigned int newProtocol = window->protocols ();
@@ -96,6 +97,7 @@
CompWindowProtocolTakeFocusMask);
newProtocol = window->protocols () & ~CompWindowProtocolTakeFocusMask;
}
+
window->isFocussableSetEnabled (this, true);// causes w->isFocussable ()
// to return false
window->focusSetEnabled (this, true); // causes w->focus () to return
@@ -104,20 +106,18 @@
else if ((protocolSetMask & CompWindowProtocolTakeFocusMask))
{
newProtocol = window->protocols () |
- (protocolSetMask & CompWindowProtocolTakeFocusMask);
+ (protocolSetMask & CompWindowProtocolTakeFocusMask);
protocolSetMask &= ~CompWindowProtocolTakeFocusMask;
window->isFocussableSetEnabled (this, false);
window->focusSetEnabled (this, false);
}
if (newProtocol != window->protocols ())
- {
ws->setProtocols (newProtocol, window->id ());
- }
}
void
-WinrulesWindow::setNoAlpha (int optNum)
+WinrulesWindow::setNoAlpha (int optNum)
{
WINRULES_SCREEN (screen);
@@ -125,19 +125,14 @@
return;
if (ws->getOptions ().at (optNum). value ().match ().evaluate (window))
- {
- window->alphaSetEnabled (this, true); // Causes w->alpha () to return
- // false
- }
+ window->alphaSetEnabled (this, true); // Causes w->alpha () to return false
else
- {
window->alphaSetEnabled (this, false);
- }
}
void
-WinrulesWindow::updateState (int optNum,
- int mask)
+WinrulesWindow::updateState (int optNum,
+ int mask)
{
unsigned int newState = window->state ();
@@ -172,8 +167,8 @@
}
void
-WinrulesWindow::setAllowedActions (int optNum,
- int action)
+WinrulesWindow::setAllowedActions (int optNum,
+ int action)
{
WINRULES_SCREEN (screen);
@@ -192,22 +187,18 @@
WinrulesWindow::matchSizeValue (CompOption::Value::Vector matches,
CompOption::Value::Vector widthValues,
CompOption::Value::Vector heightValues,
- int *width,
- int *height)
+ int *width,
+ int *height)
{
- int min;
-
- if (!is ())
- return false;
-
- if (window->type () & CompWindowTypeDesktopMask)
- return false;
-
- min = MIN (matches.size (), widthValues.size ());
- min = MIN ((unsigned int) min, heightValues.size ());
- min = MIN ((unsigned int) min, matches.size ());
-
- for (int i = 0; i < min; i++)
+ if (!is () ||
+ window->type () & CompWindowTypeDesktopMask)
+ return false;
+
+ int min = MIN (matches.size (), widthValues.size ());
+ min = MIN ((unsigned int) min, heightValues.size ());
+ min = MIN ((unsigned int) min, matches.size ());
+
+ for (int i = 0; i < min; ++i)
{
if ((matches.at (i).match ().evaluate (window)))
{
@@ -222,8 +213,8 @@
}
bool
-WinrulesWindow::matchSize (int *width,
- int *height)
+WinrulesWindow::matchSize (int *width,
+ int *height)
{
WINRULES_SCREEN (screen);
@@ -234,14 +225,15 @@
}
void
-WinrulesWindow::updateWindowSize (int width,
- int height)
+WinrulesWindow::updateWindowSize (int width,
+ int height)
{
XWindowChanges xwc;
unsigned int xwcm = 0;
if (width != window->serverWidth ())
xwcm |= CWWidth;
+
if (height != window->serverHeight ())
xwcm |= CWHeight;
@@ -255,7 +247,7 @@
}
void
-WinrulesScreen::optionChanged (CompOption *option,
+WinrulesScreen::optionChanged (CompOption *option,
WinrulesOptions::Options num)
{
@@ -266,41 +258,53 @@
case WinrulesOptions::SkiptaskbarMatch:
updateStateMask = CompWindowStateSkipTaskbarMask;
break;
+
case WinrulesOptions::SkippagerMatch:
updateStateMask = CompWindowStateSkipPagerMask;
break;
+
case WinrulesOptions::AboveMatch:
updateStateMask = CompWindowStateAboveMask;
break;
+
case WinrulesOptions::BelowMatch:
updateStateMask = CompWindowStateBelowMask;
break;
+
case WinrulesOptions::StickyMatch:
updateStateMask = CompWindowStateStickyMask;
break;
+
case WinrulesOptions::FullscreenMatch:
updateStateMask = CompWindowStateFullscreenMask;
break;
+
case WinrulesOptions::MaximizeMatch:
updateStateMask = CompWindowStateMaximizedHorzMask |
CompWindowStateMaximizedVertMask;
break;
+
case WinrulesOptions::NoMoveMatch:
updateActionsMask = CompWindowActionMoveMask;
break;
+
case WinrulesOptions::NoResizeMatch:
updateActionsMask = CompWindowActionResizeMask;
break;
+
case WinrulesOptions::NoMinimizeMatch:
updateActionsMask = CompWindowActionMinimizeMask;
break;
+
case WinrulesOptions::NoMaximizeMatch:
updateActionsMask = CompWindowActionMaximizeVertMask |
CompWindowActionMaximizeHorzMask;
break;
+
case WinrulesOptions::NoCloseMatch:
updateActionsMask = CompWindowActionCloseMask;
break;
+
case WinrulesOptions::NoArgbMatch:
foreach (CompWindow *w, screen->windows ())
{
@@ -310,6 +314,7 @@
return;
break;
+
case WinrulesOptions::SizeMatches:
foreach (CompOption::Value &v, option->value ().list ())
{
@@ -318,6 +323,7 @@
}
return;
break;
+
default:
return;
break;
@@ -328,7 +334,6 @@
/* We traverse a copy of the list here because windows can be unhooked
* on state change rather than the delayed unhook that happens in <0.8.x
*/
-
CompWindowList windows = screen->windows ();
foreach (CompWindow *w, windows)
@@ -354,7 +359,6 @@
return;
}
-
bool
WinrulesWindow::applyRules ()
{
@@ -406,13 +410,13 @@
return false;
}
-
void
WinrulesScreen::handleEvent (XEvent *event)
{
if (event->type == MapRequest)
{
CompWindow *w = screen->findWindow (event->xmap.window);
+
if (w)
{
WINRULES_WINDOW (w);
@@ -422,7 +426,6 @@
}
screen->handleEvent (event);
-
}
void
@@ -540,7 +543,6 @@
timer.setTimes (0, 0);
timer.start ();
-
}
bool
=== modified file 'plugins/winrules/src/winrules.h'
--- plugins/winrules/src/winrules.h 2012-12-10 03:28:47 +0000
+++ plugins/winrules/src/winrules.h 2013-07-21 23:03:28 +0000
@@ -52,7 +52,7 @@
Window id);
void
- optionChanged (CompOption *option,
+ optionChanged (CompOption *option,
WinrulesOptions::Options num);
};
@@ -84,23 +84,23 @@
int mask);
void
- setAllowedActions (int optNum,
- int action);
+ setAllowedActions (int optNum,
+ int action);
bool
matchSizeValue (CompOption::Value::Vector matches,
CompOption::Value::Vector widthValues,
CompOption::Value::Vector heightValues,
- int *width,
- int *height);
+ int *width,
+ int *height);
bool
- matchSize (int *width,
- int *height);
+ matchSize (int *width,
+ int *height);
void
- updateWindowSize (int width,
- int height);
+ updateWindowSize (int width,
+ int height);
bool applyRules ();
=== renamed file 'plugins/wizard/include/wizard.h' => 'plugins/wizard/include/wizard.h.THIS'
=== removed file 'plugins/wizard/include/wizard_tex.h'
--- plugins/wizard/include/wizard_tex.h 2010-09-14 01:57:47 +0000
+++ plugins/wizard/include/wizard_tex.h 1970-01-01 00:00:00 +0000
@@ -1,2827 +0,0 @@
-/*
- * Compiz wizard particle system plugin
- * Texture of a single particle. Generated using GIMP.
- *
- * wizard_tex.h
- *
- * Written by : Sebastian Kuhlen
- * E-mail : DiCon@tankwar.de
- *
- * Ported to Compiz 0.9.x
- * Copyright : (c) 2010 Scott Moreau
- *
- * This plugin and parts of its code have been inspired by the showmouse plugin
- * by Dennis Kasprzyk
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-static const unsigned char particleTex[65536] = {
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\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\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\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\1\377\377\377\1\377\377\377"
- "\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
- "\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\2"
- "\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\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"
- "\1\0\0\0\0\0\0\0\0\377\377\377\1\377\377\377\1\0\0\0\0\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2"
- "\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0"
- "\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377"
- "\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377"
- "\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\2\377\377\377\2\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\377\377\377"
- "\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\4"
- "\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\0"
- "\0\0\0\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377"
- "\4\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4"
- "\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377"
- "\377\377\3\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377"
- "\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377"
- "\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377"
- "\4\377\377\377\3\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\4\377"
- "\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377"
- "\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377"
- "\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377"
- "\377\4\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377"
- "\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2"
- "\377\377\377\3\377\377\377\4\377\377\377\5\377\377\377\7\377\377\377\6\377"
- "\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377"
- "\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377"
- "\5\377\377\377\6\377\377\377\5\377\377\377\4\377\377\377\3\377\377\377\2"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\3\377"
- "\377\377\5\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\7\377\377"
- "\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377"
- "\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4"
- "\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377"
- "\377\377\5\377\377\377\4\377\377\377\3\377\377\377\2\377\377\377\1\377\377"
- "\377\1\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\5\377\377\377"
- "\7\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\6"
- "\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377"
- "\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\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\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377"
- "\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377"
- "\7\377\377\377\6\377\377\377\4\377\377\377\3\377\377\377\2\377\377\377\1"
- "\377\377\377\1\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\6\377"
- "\377\377\10\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\7\377"
- "\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377"
- "\377\5\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\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\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377"
- "\377\377\3\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\4\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\2"
- "\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\4\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\6\377\377"
- "\377\7\377\377\377\7\377\377\377\7\377\377\377\5\377\377\377\4\377\377\377"
- "\3\377\377\377\2\377\377\377\1\377\377\377\2\377\377\377\4\377\377\377\5"
- "\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\11\377\377\377\10"
- "\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377"
- "\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\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\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377"
- "\377\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377"
- "\377\6\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\7\377\377\377"
- "\5\377\377\377\4\377\377\377\3\377\377\377\2\377\377\377\1\377\377\377\2"
- "\377\377\377\4\377\377\377\5\377\377\377\7\377\377\377\11\377\377\377\12"
- "\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377\7\377\377\377\7"
- "\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377"
- "\377\377\5\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377"
- "\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377"
- "\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4"
- "\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6\377"
- "\377\377\5\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\3\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4"
- "\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10\377"
- "\377\377\10\377\377\377\7\377\377\377\6\377\377\377\5\377\377\377\3\377\377"
- "\377\2\377\377\377\1\377\377\377\3\377\377\377\5\377\377\377\6\377\377\377"
- "\10\377\377\377\13\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377"
- "\11\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377"
- "\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5"
- "\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377"
- "\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\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"
- "\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377"
- "\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377"
- "\377\5\377\377\377\6\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377"
- "\5\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377"
- "\377\6\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\11\377\377"
- "\377\10\377\377\377\7\377\377\377\5\377\377\377\3\377\377\377\2\377\377\377"
- "\2\377\377\377\3\377\377\377\5\377\377\377\7\377\377\377\11\377\377\377\14"
- "\377\377\377\13\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377"
- "\10\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377"
- "\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5"
- "\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\2\377"
- "\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\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\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\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\1\377\377"
- "\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4\377"
- "\377\377\4\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10\377\377"
- "\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\5\377\377\377\5\377"
- "\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\11\377"
- "\377\377\12\377\377\377\11\377\377\377\7\377\377\377\5\377\377\377\3\377"
- "\377\377\2\377\377\377\2\377\377\377\4\377\377\377\6\377\377\377\10\377\377"
- "\377\13\377\377\377\15\377\377\377\14\377\377\377\13\377\377\377\13\377\377"
- "\377\12\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377\10\377\377"
- "\377\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377"
- "\5\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377"
- "\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377"
- "\377\377\7\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\7\377"
- "\377\377\6\377\377\377\6\377\377\377\5\377\377\377\4\377\377\377\4\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\7"
- "\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377\12\377\377\377"
- "\7\377\377\377\5\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\4"
- "\377\377\377\6\377\377\377\11\377\377\377\14\377\377\377\15\377\377\377\15"
- "\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377\12\377\377\377"
- "\11\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377"
- "\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5"
- "\377\377\377\5\377\377\377\4\377\377\377\3\377\377\377\2\377\377\377\1\377"
- "\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\1\0\0\0\0\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377"
- "\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\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\1"
- "\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\4\377"
- "\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377"
- "\4\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10"
- "\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\6"
- "\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\4\377"
- "\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5\377\377"
- "\377\5\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\11\377\377"
- "\377\12\377\377\377\13\377\377\377\13\377\377\377\10\377\377\377\6\377\377"
- "\377\4\377\377\377\2\377\377\377\3\377\377\377\5\377\377\377\7\377\377\377"
- "\12\377\377\377\15\377\377\377\16\377\377\377\15\377\377\377\14\377\377\377"
- "\14\377\377\377\13\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377"
- "\11\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377"
- "\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\4\377\377\377\3"
- "\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\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\1\377\377"
- "\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377"
- "\5\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5"
- "\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\4\377"
- "\377\377\4\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10\377\377"
- "\377\12\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377\7\377\377"
- "\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377"
- "\4\377\377\377\5\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5"
- "\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\12"
- "\377\377\377\14\377\377\377\13\377\377\377\10\377\377\377\6\377\377\377\4"
- "\377\377\377\2\377\377\377\3\377\377\377\5\377\377\377\10\377\377\377\13"
- "\377\377\377\17\377\377\377\17\377\377\377\16\377\377\377\15\377\377\377"
- "\14\377\377\377\13\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377"
- "\11\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377"
- "\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\4\377\377\377\3"
- "\377\377\377\2\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\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\1\377\377"
- "\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377"
- "\4\377\377\377\6\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\6"
- "\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\4\377"
- "\377\377\4\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10\377\377"
- "\377\11\377\377\377\13\377\377\377\13\377\377\377\12\377\377\377\11\377\377"
- "\377\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377"
- "\5\377\377\377\5\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\6"
- "\377\377\377\6\377\377\377\7\377\377\377\11\377\377\377\11\377\377\377\13"
- "\377\377\377\14\377\377\377\14\377\377\377\12\377\377\377\7\377\377\377\5"
- "\377\377\377\2\377\377\377\3\377\377\377\6\377\377\377\11\377\377\377\15"
- "\377\377\377\21\377\377\377\20\377\377\377\17\377\377\377\16\377\377\377"
- "\15\377\377\377\14\377\377\377\14\377\377\377\13\377\377\377\13\377\377\377"
- "\12\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377"
- "\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\4\377\377\377\3"
- "\377\377\377\2\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\1\377\377"
- "\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\2\377\377\377\3\377\377\377\3\377\377"
- "\377\4\377\377\377\5\377\377\377\6\377\377\377\10\377\377\377\10\377\377"
- "\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377"
- "\5\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10"
- "\377\377\377\11\377\377\377\13\377\377\377\14\377\377\377\13\377\377\377"
- "\12\377\377\377\11\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377"
- "\5\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6"
- "\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\11\377\377\377\12"
- "\377\377\377\13\377\377\377\15\377\377\377\16\377\377\377\12\377\377\377"
- "\7\377\377\377\5\377\377\377\2\377\377\377\4\377\377\377\7\377\377\377\13"
- "\377\377\377\16\377\377\377\22\377\377\377\21\377\377\377\17\377\377\377"
- "\16\377\377\377\15\377\377\377\15\377\377\377\14\377\377\377\13\377\377\377"
- "\13\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377"
- "\10\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377\4\377\377\377"
- "\3\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\0\0\0\0\377\377"
- "\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377"
- "\377\377\3\377\377\377\3\377\377\377\4\377\377\377\5\377\377\377\6\377\377"
- "\377\10\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\10\377\377"
- "\377\7\377\377\377\7\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377"
- "\6\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\13\377\377\377"
- "\15\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377"
- "\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5"
- "\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\10"
- "\377\377\377\11\377\377\377\13\377\377\377\14\377\377\377\16\377\377\377"
- "\17\377\377\377\13\377\377\377\10\377\377\377\5\377\377\377\3\377\377\377"
- "\4\377\377\377\10\377\377\377\14\377\377\377\20\377\377\377\22\377\377\377"
- "\22\377\377\377\20\377\377\377\17\377\377\377\16\377\377\377\15\377\377\377"
- "\14\377\377\377\14\377\377\377\13\377\377\377\13\377\377\377\12\377\377\377"
- "\12\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377\7\377\377\377"
- "\5\377\377\377\4\377\377\377\3\377\377\377\2\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377"
- "\3\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10"
- "\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377"
- "\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\5\377\377\377\7"
- "\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377\14\377\377\377"
- "\16\377\377\377\15\377\377\377\14\377\377\377\12\377\377\377\11\377\377\377"
- "\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5"
- "\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\12"
- "\377\377\377\13\377\377\377\15\377\377\377\17\377\377\377\20\377\377\377"
- "\13\377\377\377\10\377\377\377\5\377\377\377\3\377\377\377\5\377\377\377"
- "\11\377\377\377\15\377\377\377\22\377\377\377\24\377\377\377\22\377\377\377"
- "\21\377\377\377\20\377\377\377\17\377\377\377\16\377\377\377\16\377\377\377"
- "\15\377\377\377\15\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377"
- "\11\377\377\377\11\377\377\377\10\377\377\377\7\377\377\377\5\377\377\377"
- "\3\377\377\377\3\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377"
- "\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\3\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\3\377\377"
- "\377\3\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\10\377\377\377"
- "\12\377\377\377\13\377\377\377\13\377\377\377\12\377\377\377\12\377\377\377"
- "\11\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377"
- "\10\377\377\377\11\377\377\377\13\377\377\377\14\377\377\377\16\377\377\377"
- "\17\377\377\377\16\377\377\377\14\377\377\377\13\377\377\377\11\377\377\377"
- "\10\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377"
- "\6\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377"
- "\14\377\377\377\15\377\377\377\17\377\377\377\21\377\377\377\15\377\377\377"
- "\11\377\377\377\5\377\377\377\3\377\377\377\5\377\377\377\12\377\377\377"
- "\17\377\377\377\25\377\377\377\25\377\377\377\24\377\377\377\22\377\377\377"
- "\20\377\377\377\17\377\377\377\17\377\377\377\16\377\377\377\15\377\377\377"
- "\15\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377"
- "\11\377\377\377\10\377\377\377\6\377\377\377\4\377\377\377\3\377\377\377"
- "\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\3"
- "\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377"
- "\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377"
- "\3\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\11"
- "\377\377\377\13\377\377\377\14\377\377\377\14\377\377\377\13\377\377\377"
- "\13\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377\7\377\377\377"
- "\7\377\377\377\10\377\377\377\13\377\377\377\14\377\377\377\16\377\377\377"
- "\20\377\377\377\20\377\377\377\16\377\377\377\14\377\377\377\13\377\377\377"
- "\10\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377"
- "\7\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377"
- "\14\377\377\377\16\377\377\377\20\377\377\377\22\377\377\377\16\377\377\377"
- "\12\377\377\377\5\377\377\377\3\377\377\377\6\377\377\377\13\377\377\377"
- "\20\377\377\377\27\377\377\377\26\377\377\377\24\377\377\377\22\377\377\377"
- "\21\377\377\377\20\377\377\377\20\377\377\377\17\377\377\377\16\377\377\377"
- "\15\377\377\377\14\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377"
- "\11\377\377\377\7\377\377\377\5\377\377\377\4\377\377\377\2\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\3\377\377\377\3\377"
- "\377\377\4\377\377\377\5\377\377\377\6\377\377\377\5\377\377\377\5\377\377"
- "\377\5\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2"
- "\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\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\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\5\377\377\377\7\377"
- "\377\377\10\377\377\377\11\377\377\377\14\377\377\377\16\377\377\377\16\377"
- "\377\377\15\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377\10\377"
- "\377\377\7\377\377\377\10\377\377\377\12\377\377\377\14\377\377\377\15\377"
- "\377\377\20\377\377\377\22\377\377\377\20\377\377\377\17\377\377\377\14\377"
- "\377\377\12\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\10\377"
- "\377\377\7\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377\13\377"
- "\377\377\14\377\377\377\17\377\377\377\21\377\377\377\23\377\377\377\17\377"
- "\377\377\12\377\377\377\6\377\377\377\3\377\377\377\7\377\377\377\15\377"
- "\377\377\22\377\377\377\30\377\377\377\27\377\377\377\25\377\377\377\23\377"
- "\377\377\22\377\377\377\21\377\377\377\20\377\377\377\20\377\377\377\17\377"
- "\377\377\16\377\377\377\15\377\377\377\14\377\377\377\13\377\377\377\12\377"
- "\377\377\10\377\377\377\6\377\377\377\4\377\377\377\3\377\377\377\2\377\377"
- "\377\1\377\377\377\1\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377"
- "\5\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6"
- "\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377"
- "\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\5\377\377\377\6"
- "\377\377\377\7\377\377\377\11\377\377\377\13\377\377\377\15\377\377\377\17"
- "\377\377\377\17\377\377\377\16\377\377\377\15\377\377\377\14\377\377\377"
- "\12\377\377\377\11\377\377\377\10\377\377\377\11\377\377\377\13\377\377\377"
- "\15\377\377\377\20\377\377\377\22\377\377\377\23\377\377\377\20\377\377\377"
- "\16\377\377\377\14\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377"
- "\10\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377"
- "\14\377\377\377\16\377\377\377\17\377\377\377\22\377\377\377\24\377\377\377"
- "\20\377\377\377\12\377\377\377\7\377\377\377\4\377\377\377\10\377\377\377"
- "\16\377\377\377\26\377\377\377\32\377\377\377\30\377\377\377\26\377\377\377"
- "\24\377\377\377\22\377\377\377\22\377\377\377\21\377\377\377\20\377\377\377"
- "\17\377\377\377\16\377\377\377\15\377\377\377\14\377\377\377\13\377\377\377"
- "\12\377\377\377\7\377\377\377\5\377\377\377\3\377\377\377\2\377\377\377\1"
- "\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\5\377"
- "\377\377\6\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\6\377\377"
- "\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377"
- "\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\3\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4"
- "\377\377\377\5\377\377\377\6\377\377\377\10\377\377\377\12\377\377\377\14"
- "\377\377\377\16\377\377\377\21\377\377\377\20\377\377\377\20\377\377\377"
- "\16\377\377\377\15\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377"
- "\12\377\377\377\15\377\377\377\17\377\377\377\22\377\377\377\25\377\377\377"
- "\23\377\377\377\21\377\377\377\16\377\377\377\14\377\377\377\12\377\377\377"
- "\12\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377"
- "\12\377\377\377\14\377\377\377\16\377\377\377\20\377\377\377\23\377\377\377"
- "\26\377\377\377\21\377\377\377\13\377\377\377\7\377\377\377\4\377\377\377"
- "\12\377\377\377\20\377\377\377\30\377\377\377\33\377\377\377\31\377\377\377"
- "\27\377\377\377\25\377\377\377\24\377\377\377\23\377\377\377\22\377\377\377"
- "\21\377\377\377\20\377\377\377\17\377\377\377\16\377\377\377\15\377\377\377"
- "\14\377\377\377\11\377\377\377\7\377\377\377\4\377\377\377\3\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\4\377\377\377\5\377\377\377\5"
- "\377\377\377\7\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377\7\377"
- "\377\377\7\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377"
- "\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\6\377\377"
- "\377\7\377\377\377\10\377\377\377\12\377\377\377\15\377\377\377\20\377\377"
- "\377\23\377\377\377\22\377\377\377\21\377\377\377\17\377\377\377\15\377\377"
- "\377\14\377\377\377\12\377\377\377\12\377\377\377\14\377\377\377\16\377\377"
- "\377\21\377\377\377\24\377\377\377\26\377\377\377\23\377\377\377\20\377\377"
- "\377\16\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377\11\377\377"
- "\377\11\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377\16\377\377"
- "\377\21\377\377\377\23\377\377\377\27\377\377\377\22\377\377\377\14\377\377"
- "\377\7\377\377\377\5\377\377\377\13\377\377\377\22\377\377\377\34\377\377"
- "\377\35\377\377\377\33\377\377\377\30\377\377\377\26\377\377\377\25\377\377"
- "\377\24\377\377\377\23\377\377\377\22\377\377\377\21\377\377\377\17\377\377"
- "\377\16\377\377\377\15\377\377\377\12\377\377\377\10\377\377\377\5\377\377"
- "\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\4\377\377\377"
- "\5\377\377\377\6\377\377\377\10\377\377\377\11\377\377\377\10\377\377\377"
- "\10\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377"
- "\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\4"
- "\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\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\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\4\377\377\377\3\377\377\377\4\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\7\377\377\377"
- "\11\377\377\377\14\377\377\377\16\377\377\377\21\377\377\377\25\377\377\377"
- "\24\377\377\377\22\377\377\377\21\377\377\377\17\377\377\377\15\377\377\377"
- "\13\377\377\377\13\377\377\377\16\377\377\377\20\377\377\377\23\377\377\377"
- "\27\377\377\377\26\377\377\377\23\377\377\377\21\377\377\377\16\377\377\377"
- "\14\377\377\377\13\377\377\377\13\377\377\377\12\377\377\377\12\377\377\377"
- "\14\377\377\377\15\377\377\377\17\377\377\377\22\377\377\377\25\377\377\377"
- "\30\377\377\377\24\377\377\377\15\377\377\377\7\377\377\377\5\377\377\377"
- "\14\377\377\377\25\377\377\377\37\377\377\377\36\377\377\377\33\377\377\377"
- "\31\377\377\377\27\377\377\377\26\377\377\377\25\377\377\377\24\377\377\377"
- "\23\377\377\377\22\377\377\377\20\377\377\377\16\377\377\377\15\377\377\377"
- "\11\377\377\377\6\377\377\377\4\377\377\377\2\377\377\377\2\377\377\377\3"
- "\377\377\377\4\377\377\377\5\377\377\377\7\377\377\377\10\377\377\377\11"
- "\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377"
- "\11\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377"
- "\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4"
- "\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\1\377\377\377\2\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377"
- "\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4"
- "\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\10\377\377\377\12"
- "\377\377\377\14\377\377\377\17\377\377\377\22\377\377\377\26\377\377\377"
- "\26\377\377\377\24\377\377\377\22\377\377\377\20\377\377\377\16\377\377\377"
- "\14\377\377\377\15\377\377\377\17\377\377\377\23\377\377\377\27\377\377\377"
- "\32\377\377\377\27\377\377\377\23\377\377\377\20\377\377\377\15\377\377\377"
- "\15\377\377\377\13\377\377\377\12\377\377\377\12\377\377\377\14\377\377\377"
- "\15\377\377\377\17\377\377\377\22\377\377\377\25\377\377\377\31\377\377\377"
- "\25\377\377\377\15\377\377\377\10\377\377\377\7\377\377\377\16\377\377\377"
- "\30\377\377\377\"\377\377\377\37\377\377\377\35\377\377\377\32\377\377\377"
- "\31\377\377\377\30\377\377\377\26\377\377\377\25\377\377\377\23\377\377\377"
- "\22\377\377\377\20\377\377\377\17\377\377\377\13\377\377\377\7\377\377\377"
- "\5\377\377\377\3\377\377\377\1\377\377\377\3\377\377\377\4\377\377\377\6"
- "\377\377\377\7\377\377\377\11\377\377\377\13\377\377\377\12\377\377\377\12"
- "\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377"
- "\11\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377"
- "\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5\377"
- "\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377"
- "\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\10\377\377\377"
- "\13\377\377\377\15\377\377\377\20\377\377\377\24\377\377\377\30\377\377\377"
- "\30\377\377\377\26\377\377\377\24\377\377\377\21\377\377\377\16\377\377\377"
- "\14\377\377\377\17\377\377\377\22\377\377\377\26\377\377\377\31\377\377\377"
- "\33\377\377\377\27\377\377\377\23\377\377\377\20\377\377\377\16\377\377\377"
- "\14\377\377\377\13\377\377\377\12\377\377\377\14\377\377\377\16\377\377\377"
- "\20\377\377\377\23\377\377\377\27\377\377\377\33\377\377\377\30\377\377\377"
- "\17\377\377\377\10\377\377\377\10\377\377\377\20\377\377\377\33\377\377\377"
- "$\377\377\377!\377\377\377\36\377\377\377\33\377\377\377\31\377\377\377\30"
- "\377\377\377\27\377\377\377\26\377\377\377\24\377\377\377\22\377\377\377"
- "\20\377\377\377\15\377\377\377\11\377\377\377\7\377\377\377\4\377\377\377"
- "\2\377\377\377\3\377\377\377\5\377\377\377\6\377\377\377\10\377\377\377\12"
- "\377\377\377\14\377\377\377\13\377\377\377\13\377\377\377\13\377\377\377"
- "\13\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377"
- "\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\4"
- "\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5"
- "\377\377\377\5\377\377\377\6\377\377\377\5\377\377\377\6\377\377\377\6\377"
- "\377\377\5\377\377\377\6\377\377\377\5\377\377\377\7\377\377\377\11\377\377"
- "\377\13\377\377\377\16\377\377\377\22\377\377\377\26\377\377\377\32\377\377"
- "\377\32\377\377\377\30\377\377\377\25\377\377\377\22\377\377\377\17\377\377"
- "\377\15\377\377\377\20\377\377\377\24\377\377\377\30\377\377\377\35\377\377"
- "\377\33\377\377\377\27\377\377\377\23\377\377\377\17\377\377\377\15\377\377"
- "\377\15\377\377\377\14\377\377\377\15\377\377\377\17\377\377\377\21\377\377"
- "\377\24\377\377\377\27\377\377\377\34\377\377\377\31\377\377\377\20\377\377"
- "\377\10\377\377\377\11\377\377\377\22\377\377\377\37\377\377\377%\377\377"
- "\377!\377\377\377\36\377\377\377\34\377\377\377\33\377\377\377\32\377\377"
- "\377\31\377\377\377\26\377\377\377\24\377\377\377\23\377\377\377\21\377\377"
- "\377\14\377\377\377\10\377\377\377\5\377\377\377\2\377\377\377\3\377\377"
- "\377\5\377\377\377\6\377\377\377\11\377\377\377\13\377\377\377\14\377\377"
- "\377\14\377\377\377\14\377\377\377\13\377\377\377\14\377\377\377\14\377\377"
- "\377\13\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377\7\377\377"
- "\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377"
- "\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\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\1\377\377"
- "\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4"
- "\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377"
- "\377\377\6\377\377\377\6\377\377\377\7\377\377\377\6\377\377\377\6\377\377"
- "\377\6\377\377\377\6\377\377\377\7\377\377\377\6\377\377\377\7\377\377\377"
- "\11\377\377\377\14\377\377\377\17\377\377\377\23\377\377\377\27\377\377\377"
- "\35\377\377\377\35\377\377\377\32\377\377\377\27\377\377\377\24\377\377\377"
- "\20\377\377\377\20\377\377\377\23\377\377\377\30\377\377\377\34\377\377\377"
- "\40\377\377\377\33\377\377\377\26\377\377\377\22\377\377\377\20\377\377\377"
- "\16\377\377\377\15\377\377\377\15\377\377\377\17\377\377\377\21\377\377\377"
- "\24\377\377\377\30\377\377\377\34\377\377\377\33\377\377\377\20\377\377\377"
- "\10\377\377\377\12\377\377\377\25\377\377\377#\377\377\377&\377\377\377\""
- "\377\377\377\37\377\377\377\35\377\377\377\34\377\377\377\32\377\377\377"
- "\31\377\377\377\27\377\377\377\25\377\377\377\23\377\377\377\16\377\377\377"
- "\11\377\377\377\6\377\377\377\3\377\377\377\3\377\377\377\5\377\377\377\10"
- "\377\377\377\11\377\377\377\13\377\377\377\16\377\377\377\16\377\377\377"
- "\15\377\377\377\15\377\377\377\15\377\377\377\14\377\377\377\14\377\377\377"
- "\14\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377"
- "\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\4\377\377\377\4"
- "\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377"
- "\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\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\1\377\377\377"
- "\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
- "\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377"
- "\10\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7"
- "\377\377\377\11\377\377\377\15\377\377\377\20\377\377\377\24\377\377\377"
- "\31\377\377\377\37\377\377\377\40\377\377\377\34\377\377\377\31\377\377\377"
- "\24\377\377\377\20\377\377\377\21\377\377\377\26\377\377\377\33\377\377\377"
- "!\377\377\377!\377\377\377\33\377\377\377\26\377\377\377\21\377\377\377\20"
- "\377\377\377\16\377\377\377\15\377\377\377\17\377\377\377\21\377\377\377"
- "\24\377\377\377\30\377\377\377\35\377\377\377\34\377\377\377\21\377\377\377"
- "\11\377\377\377\13\377\377\377\27\377\377\377'\377\377\377&\377\377\377#"
- "\377\377\377\37\377\377\377\36\377\377\377\34\377\377\377\33\377\377\377"
- "\31\377\377\377\27\377\377\377\25\377\377\377\22\377\377\377\14\377\377\377"
- "\7\377\377\377\4\377\377\377\2\377\377\377\5\377\377\377\10\377\377\377\12"
- "\377\377\377\15\377\377\377\17\377\377\377\17\377\377\377\17\377\377\377"
- "\16\377\377\377\16\377\377\377\16\377\377\377\15\377\377\377\14\377\377\377"
- "\13\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377\7\377\377\377"
- "\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5"
- "\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377"
- "\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377"
- "\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377"
- "\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6"
- "\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\10"
- "\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377"
- "\10\377\377\377\10\377\377\377\10\377\377\377\12\377\377\377\15\377\377\377"
- "\21\377\377\377\25\377\377\377\33\377\377\377\"\377\377\377\"\377\377\377"
- "\36\377\377\377\32\377\377\377\26\377\377\377\21\377\377\377\24\377\377\377"
- "\31\377\377\377\37\377\377\377&\377\377\377\40\377\377\377\32\377\377\377"
- "\24\377\377\377\21\377\377\377\17\377\377\377\16\377\377\377\17\377\377\377"
- "\21\377\377\377\24\377\377\377\31\377\377\377\36\377\377\377\36\377\377\377"
- "\22\377\377\377\11\377\377\377\15\377\377\377\33\377\377\377,\377\377\377"
- "'\377\377\377#\377\377\377\40\377\377\377\37\377\377\377\35\377\377\377\33"
- "\377\377\377\31\377\377\377\27\377\377\377\25\377\377\377\17\377\377\377"
- "\12\377\377\377\6\377\377\377\2\377\377\377\5\377\377\377\10\377\377\377"
- "\13\377\377\377\16\377\377\377\21\377\377\377\20\377\377\377\20\377\377\377"
- "\20\377\377\377\17\377\377\377\17\377\377\377\17\377\377\377\15\377\377\377"
- "\14\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377"
- "\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5"
- "\377\377\377\5\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377"
- "\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377"
- "\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\7"
- "\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\11"
- "\377\377\377\11\377\377\377\11\377\377\377\12\377\377\377\11\377\377\377"
- "\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377"
- "\12\377\377\377\15\377\377\377\21\377\377\377\26\377\377\377\35\377\377\377"
- "%\377\377\377&\377\377\377\"\377\377\377\35\377\377\377\27\377\377\377\23"
- "\377\377\377\27\377\377\377\35\377\377\377#\377\377\377&\377\377\377\37\377"
- "\377\377\30\377\377\377\23\377\377\377\21\377\377\377\17\377\377\377\17\377"
- "\377\377\22\377\377\377\25\377\377\377\31\377\377\377\37\377\377\377!\377"
- "\377\377\23\377\377\377\11\377\377\377\17\377\377\377\37\377\377\377-\377"
- "\377\377(\377\377\377$\377\377\377!\377\377\377\37\377\377\377\36\377\377"
- "\377\34\377\377\377\31\377\377\377\27\377\377\377\22\377\377\377\14\377\377"
- "\377\7\377\377\377\4\377\377\377\6\377\377\377\11\377\377\377\14\377\377"
- "\377\20\377\377\377\22\377\377\377\22\377\377\377\22\377\377\377\21\377\377"
- "\377\21\377\377\377\21\377\377\377\17\377\377\377\16\377\377\377\14\377\377"
- "\377\13\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377\7\377\377"
- "\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377"
- "\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5"
- "\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4"
- "\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\7\377"
- "\377\377\7\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\11\377"
- "\377\377\11\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377\13\377"
- "\377\377\13\377\377\377\13\377\377\377\12\377\377\377\13\377\377\377\12\377"
- "\377\377\12\377\377\377\12\377\377\377\15\377\377\377\22\377\377\377\30\377"
- "\377\377\37\377\377\377(\377\377\377*\377\377\377$\377\377\377\37\377\377"
- "\377\30\377\377\377\25\377\377\377\32\377\377\377\40\377\377\377(\377\377"
- "\377%\377\377\377\35\377\377\377\26\377\377\377\23\377\377\377\21\377\377"
- "\377\17\377\377\377\22\377\377\377\25\377\377\377\32\377\377\377\40\377\377"
- "\377#\377\377\377\24\377\377\377\11\377\377\377\21\377\377\377#\377\377\377"
- ".\377\377\377)\377\377\377$\377\377\377\"\377\377\377\40\377\377\377\36\377"
- "\377\377\34\377\377\377\31\377\377\377\26\377\377\377\16\377\377\377\10\377"
- "\377\377\4\377\377\377\5\377\377\377\11\377\377\377\15\377\377\377\22\377"
- "\377\377\24\377\377\377\24\377\377\377\23\377\377\377\23\377\377\377\23\377"
- "\377\377\22\377\377\377\21\377\377\377\17\377\377\377\16\377\377\377\14\377"
- "\377\377\13\377\377\377\11\377\377\377\10\377\377\377\7\377\377\377\10\377"
- "\377\377\10\377\377\377\7\377\377\377\10\377\377\377\7\377\377\377\7\377"
- "\377\377\7\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377"
- "\377\6\377\377\377\6\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4"
- "\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377"
- "\377\377\7\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\11\377"
- "\377\377\11\377\377\377\12\377\377\377\13\377\377\377\13\377\377\377\13\377"
- "\377\377\14\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377\14\377"
- "\377\377\14\377\377\377\13\377\377\377\14\377\377\377\13\377\377\377\16\377"
- "\377\377\23\377\377\377\31\377\377\377!\377\377\377,\377\377\377.\377\377"
- "\377'\377\377\377\40\377\377\377\31\377\377\377\27\377\377\377\35\377\377"
- "\377%\377\377\377,\377\377\377#\377\377\377\33\377\377\377\25\377\377\377"
- "\22\377\377\377\20\377\377\377\22\377\377\377\25\377\377\377\32\377\377\377"
- "!\377\377\377&\377\377\377\25\377\377\377\11\377\377\377\24\377\377\377)"
- "\377\377\3770\377\377\377*\377\377\377&\377\377\377#\377\377\377!\377\377"
- "\377\37\377\377\377\34\377\377\377\31\377\377\377\21\377\377\377\12\377\377"
- "\377\5\377\377\377\5\377\377\377\11\377\377\377\16\377\377\377\23\377\377"
- "\377\26\377\377\377\26\377\377\377\25\377\377\377\25\377\377\377\24\377\377"
- "\377\24\377\377\377\22\377\377\377\20\377\377\377\16\377\377\377\15\377\377"
- "\377\13\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377\11\377\377"
- "\377\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\10\377\377"
- "\377\10\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\7\377\377"
- "\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377"
- "\377\377\6\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\11\377"
- "\377\377\12\377\377\377\12\377\377\377\12\377\377\377\13\377\377\377\14\377"
- "\377\377\14\377\377\377\15\377\377\377\15\377\377\377\15\377\377\377\16\377"
- "\377\377\16\377\377\377\16\377\377\377\15\377\377\377\16\377\377\377\15\377"
- "\377\377\14\377\377\377\16\377\377\377\24\377\377\377\33\377\377\377$\377"
- "\377\377/\377\377\3771\377\377\377)\377\377\377!\377\377\377\31\377\377\377"
- "\32\377\377\377!\377\377\377*\377\377\377*\377\377\377!\377\377\377\30\377"
- "\377\377\24\377\377\377\22\377\377\377\22\377\377\377\26\377\377\377\33\377"
- "\377\377\"\377\377\377*\377\377\377\26\377\377\377\11\377\377\377\30\377"
- "\377\3770\377\377\3771\377\377\377+\377\377\377'\377\377\377%\377\377\377"
- "\"\377\377\377\37\377\377\377\34\377\377\377\26\377\377\377\15\377\377\377"
- "\7\377\377\377\5\377\377\377\11\377\377\377\16\377\377\377\24\377\377\377"
- "\27\377\377\377\27\377\377\377\27\377\377\377\30\377\377\377\27\377\377\377"
- "\26\377\377\377\23\377\377\377\21\377\377\377\17\377\377\377\16\377\377\377"
- "\14\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377"
- "\12\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377"
- "\12\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377"
- "\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5"
- "\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377"
- "\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5"
- "\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\11"
- "\377\377\377\12\377\377\377\13\377\377\377\13\377\377\377\14\377\377\377"
- "\14\377\377\377\15\377\377\377\16\377\377\377\16\377\377\377\16\377\377\377"
- "\17\377\377\377\17\377\377\377\20\377\377\377\17\377\377\377\20\377\377\377"
- "\17\377\377\377\16\377\377\377\16\377\377\377\16\377\377\377\25\377\377\377"
- "\34\377\377\377%\377\377\3771\377\377\3774\377\377\377+\377\377\377\"\377"
- "\377\377\31\377\377\377\35\377\377\377&\377\377\3771\377\377\377)\377\377"
- "\377\36\377\377\377\27\377\377\377\24\377\377\377\22\377\377\377\26\377\377"
- "\377\33\377\377\377#\377\377\377-\377\377\377\30\377\377\377\11\377\377\377"
- "\34\377\377\3779\377\377\3772\377\377\377,\377\377\377)\377\377\377&\377"
- "\377\377#\377\377\377\37\377\377\377\33\377\377\377\20\377\377\377\11\377"
- "\377\377\4\377\377\377\11\377\377\377\17\377\377\377\25\377\377\377\31\377"
- "\377\377\31\377\377\377\31\377\377\377\31\377\377\377\31\377\377\377\27\377"
- "\377\377\24\377\377\377\22\377\377\377\20\377\377\377\16\377\377\377\15\377"
- "\377\377\14\377\377\377\13\377\377\377\14\377\377\377\14\377\377\377\13\377"
- "\377\377\14\377\377\377\13\377\377\377\13\377\377\377\13\377\377\377\13\377"
- "\377\377\13\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377\10\377"
- "\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
- "\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1"
- "\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4"
- "\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\7\377"
- "\377\377\10\377\377\377\11\377\377\377\12\377\377\377\13\377\377\377\14\377"
- "\377\377\15\377\377\377\15\377\377\377\17\377\377\377\17\377\377\377\20\377"
- "\377\377\20\377\377\377\20\377\377\377\22\377\377\377\22\377\377\377\22\377"
- "\377\377\21\377\377\377\22\377\377\377\21\377\377\377\20\377\377\377\17\377"
- "\377\377\24\377\377\377\34\377\377\377&\377\377\3773\377\377\3777\377\377"
- "\377-\377\377\377#\377\377\377\31\377\377\377\"\377\377\377,\377\377\377"
- "2\377\377\377&\377\377\377\33\377\377\377\27\377\377\377\24\377\377\377\26"
- "\377\377\377\34\377\377\377$\377\377\377/\377\377\377\31\377\377\377\12\377"
- "\377\377!\377\377\377<\377\377\3774\377\377\377-\377\377\377*\377\377\377"
- "'\377\377\377#\377\377\377\37\377\377\377\25\377\377\377\13\377\377\377\5"
- "\377\377\377\11\377\377\377\17\377\377\377\26\377\377\377\32\377\377\377"
- "\33\377\377\377\33\377\377\377\33\377\377\377\33\377\377\377\30\377\377\377"
- "\26\377\377\377\23\377\377\377\21\377\377\377\17\377\377\377\16\377\377\377"
- "\15\377\377\377\16\377\377\377\15\377\377\377\16\377\377\377\15\377\377\377"
- "\15\377\377\377\15\377\377\377\15\377\377\377\15\377\377\377\14\377\377\377"
- "\13\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377"
- "\10\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377"
- "\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4"
- "\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377"
- "\377\377\7\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377\13\377"
- "\377\377\14\377\377\377\15\377\377\377\16\377\377\377\17\377\377\377\20\377"
- "\377\377\20\377\377\377\21\377\377\377\21\377\377\377\23\377\377\377\23\377"
- "\377\377\24\377\377\377\24\377\377\377\24\377\377\377\23\377\377\377\23\377"
- "\377\377\22\377\377\377\21\377\377\377\24\377\377\377\34\377\377\377'\377"
- "\377\3776\377\377\377;\377\377\377/\377\377\377$\377\377\377\35\377\377\377"
- "'\377\377\3774\377\377\3770\377\377\377#\377\377\377\32\377\377\377\26\377"
- "\377\377\26\377\377\377\34\377\377\377&\377\377\3772\377\377\377\33\377\377"
- "\377\14\377\377\377(\377\377\377>\377\377\3775\377\377\377/\377\377\377,"
- "\377\377\377(\377\377\377#\377\377\377\33\377\377\377\17\377\377\377\6\377"
- "\377\377\11\377\377\377\20\377\377\377\30\377\377\377\34\377\377\377\35\377"
- "\377\377\35\377\377\377\35\377\377\377\33\377\377\377\31\377\377\377\26\377"
- "\377\377\24\377\377\377\22\377\377\377\17\377\377\377\17\377\377\377\20\377"
- "\377\377\17\377\377\377\20\377\377\377\17\377\377\377\20\377\377\377\17\377"
- "\377\377\17\377\377\377\16\377\377\377\16\377\377\377\15\377\377\377\14\377"
- "\377\377\13\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377\11\377"
- "\377\377\10\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377\6\377"
- "\377\377\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377"
- "\377\377\6\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\11\377"
- "\377\377\12\377\377\377\13\377\377\377\14\377\377\377\15\377\377\377\17\377"
- "\377\377\20\377\377\377\22\377\377\377\22\377\377\377\23\377\377\377\24\377"
- "\377\377\25\377\377\377\25\377\377\377\26\377\377\377\27\377\377\377\30\377"
- "\377\377\27\377\377\377\26\377\377\377\24\377\377\377\23\377\377\377\23\377"
- "\377\377\34\377\377\377(\377\377\3779\377\377\377@\377\377\3772\377\377\377"
- "$\377\377\377\"\377\377\377.\377\377\377=\377\377\377-\377\377\377\36\377"
- "\377\377\31\377\377\377\26\377\377\377\35\377\377\377'\377\377\3775\377\377"
- "\377\35\377\377\377\17\377\377\3772\377\377\377A\377\377\3776\377\377\377"
- "2\377\377\377.\377\377\377(\377\377\377#\377\377\377\23\377\377\377\11\377"
- "\377\377\11\377\377\377\21\377\377\377\32\377\377\377\37\377\377\377\37\377"
- "\377\377\37\377\377\377\37\377\377\377\34\377\377\377\31\377\377\377\26\377"
- "\377\377\24\377\377\377\22\377\377\377\21\377\377\377\22\377\377\377\22\377"
- "\377\377\22\377\377\377\22\377\377\377\22\377\377\377\21\377\377\377\22\377"
- "\377\377\21\377\377\377\20\377\377\377\17\377\377\377\16\377\377\377\15\377"
- "\377\377\15\377\377\377\13\377\377\377\13\377\377\377\13\377\377\377\12\377"
- "\377\377\11\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\7\377"
- "\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377"
- "\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\0\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5"
- "\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\7\377"
- "\377\377\10\377\377\377\11\377\377\377\12\377\377\377\13\377\377\377\14\377"
- "\377\377\16\377\377\377\17\377\377\377\21\377\377\377\22\377\377\377\24\377"
- "\377\377\25\377\377\377\26\377\377\377\27\377\377\377\30\377\377\377\30\377"
- "\377\377\32\377\377\377\32\377\377\377\31\377\377\377\30\377\377\377\27\377"
- "\377\377\25\377\377\377\23\377\377\377\34\377\377\377)\377\377\377<\377\377"
- "\377E\377\377\3775\377\377\377%\377\377\377'\377\377\3777\377\377\377;\377"
- "\377\377(\377\377\377\35\377\377\377\31\377\377\377\36\377\377\377(\377\377"
- "\3778\377\377\377\40\377\377\377\22\377\377\377>\377\377\377C\377\377\377"
- "9\377\377\3774\377\377\377.\377\377\377(\377\377\377\32\377\377\377\14\377"
- "\377\377\10\377\377\377\21\377\377\377\34\377\377\377!\377\377\377!\377\377"
- "\377\"\377\377\377!\377\377\377\35\377\377\377\32\377\377\377\27\377\377"
- "\377\24\377\377\377\23\377\377\377\23\377\377\377\24\377\377\377\25\377\377"
- "\377\24\377\377\377\25\377\377\377\24\377\377\377\25\377\377\377\23\377\377"
- "\377\23\377\377\377\21\377\377\377\20\377\377\377\20\377\377\377\16\377\377"
- "\377\16\377\377\377\15\377\377\377\14\377\377\377\13\377\377\377\13\377\377"
- "\377\12\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\7\377\377"
- "\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377"
- "\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0"
- "\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5"
- "\377\377\377\6\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6\377"
- "\377\377\7\377\377\377\10\377\377\377\11\377\377\377\11\377\377\377\12\377"
- "\377\377\13\377\377\377\14\377\377\377\15\377\377\377\17\377\377\377\21\377"
- "\377\377\23\377\377\377\25\377\377\377\30\377\377\377\30\377\377\377\32\377"
- "\377\377\33\377\377\377\33\377\377\377\34\377\377\377\34\377\377\377\35\377"
- "\377\377\33\377\377\377\32\377\377\377\30\377\377\377\26\377\377\377\33\377"
- "\377\377*\377\377\377?\377\377\377L\377\377\3778\377\377\377%\377\377\377"
- "/\377\377\377D\377\377\3777\377\377\377#\377\377\377\35\377\377\377\36\377"
- "\377\377(\377\377\377;\377\377\377#\377\377\377\27\377\377\377O\377\377\377"
- "F\377\377\377<\377\377\3776\377\377\377/\377\377\377%\377\377\377\20\377"
- "\377\377\7\377\377\377\22\377\377\377\37\377\377\377$\377\377\377%\377\377"
- "\377%\377\377\377#\377\377\377\36\377\377\377\32\377\377\377\27\377\377\377"
- "\24\377\377\377\25\377\377\377\26\377\377\377\27\377\377\377\27\377\377\377"
- "\30\377\377\377\30\377\377\377\30\377\377\377\26\377\377\377\25\377\377\377"
- "\24\377\377\377\23\377\377\377\22\377\377\377\20\377\377\377\20\377\377\377"
- "\17\377\377\377\16\377\377\377\15\377\377\377\14\377\377\377\13\377\377\377"
- "\13\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377\7\377\377\377"
- "\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\4"
- "\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377"
- "\377\1\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6"
- "\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\7\377"
- "\377\377\10\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\10\377"
- "\377\377\11\377\377\377\12\377\377\377\14\377\377\377\15\377\377\377\16\377"
- "\377\377\17\377\377\377\21\377\377\377\23\377\377\377\25\377\377\377\30\377"
- "\377\377\32\377\377\377\35\377\377\377\35\377\377\377\36\377\377\377\36\377"
- "\377\377\37\377\377\377\37\377\377\377\37\377\377\377\35\377\377\377\33\377"
- "\377\377\31\377\377\377\32\377\377\377*\377\377\377C\377\377\377S\377\377"
- "\377<\377\377\377&\377\377\377:\377\377\377L\377\377\3771\377\377\377\"\377"
- "\377\377\36\377\377\377*\377\377\377?\377\377\377&\377\377\377\36\377\377"
- "\377Z\377\377\377H\377\377\377?\377\377\3778\377\377\377/\377\377\377\30"
- "\377\377\377\10\377\377\377\22\377\377\377\"\377\377\377(\377\377\377(\377"
- "\377\377(\377\377\377$\377\377\377\37\377\377\377\33\377\377\377\27\377\377"
- "\377\27\377\377\377\30\377\377\377\31\377\377\377\32\377\377\377\33\377\377"
- "\377\33\377\377\377\33\377\377\377\32\377\377\377\30\377\377\377\27\377\377"
- "\377\25\377\377\377\24\377\377\377\23\377\377\377\22\377\377\377\21\377\377"
- "\377\20\377\377\377\17\377\377\377\16\377\377\377\15\377\377\377\14\377\377"
- "\377\13\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377\10\377\377"
- "\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4"
- "\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377"
- "\377\377\6\377\377\377\7\377\377\377\7\377\377\377\10\377\377\377\10\377"
- "\377\377\10\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\12\377"
- "\377\377\11\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377\13\377"
- "\377\377\13\377\377\377\14\377\377\377\16\377\377\377\17\377\377\377\21\377"
- "\377\377\23\377\377\377\25\377\377\377\30\377\377\377\32\377\377\377\35\377"
- "\377\377\40\377\377\377\40\377\377\377!\377\377\377\"\377\377\377\"\377\377"
- "\377#\377\377\377\"\377\377\377\40\377\377\377\35\377\377\377\32\377\377"
- "\377*\377\377\377G\377\377\377]\377\377\377@\377\377\377/\377\377\377J\377"
- "\377\377G\377\377\377*\377\377\377!\377\377\377+\377\377\377C\377\377\377"
- "+\377\377\377)\377\377\377`\377\377\377L\377\377\377C\377\377\3778\377\377"
- "\377#\377\377\377\13\377\377\377\23\377\377\377&\377\377\377,\377\377\377"
- "-\377\377\377,\377\377\377&\377\377\377\40\377\377\377\33\377\377\377\31"
- "\377\377\377\33\377\377\377\34\377\377\377\35\377\377\377\36\377\377\377"
- "\36\377\377\377\36\377\377\377\34\377\377\377\33\377\377\377\32\377\377\377"
- "\31\377\377\377\27\377\377\377\25\377\377\377\24\377\377\377\23\377\377\377"
- "\22\377\377\377\21\377\377\377\17\377\377\377\16\377\377\377\15\377\377\377"
- "\14\377\377\377\13\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377"
- "\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5"
- "\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\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\1\377\377\377\1\377\377\377\1\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377"
- "\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6"
- "\377\377\377\7\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\11"
- "\377\377\377\11\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377"
- "\13\377\377\377\13\377\377\377\14\377\377\377\14\377\377\377\15\377\377\377"
- "\14\377\377\377\15\377\377\377\15\377\377\377\15\377\377\377\15\377\377\377"
- "\15\377\377\377\16\377\377\377\21\377\377\377\22\377\377\377\25\377\377\377"
- "\27\377\377\377\31\377\377\377\34\377\377\377\37\377\377\377#\377\377\377"
- "$\377\377\377%\377\377\377&\377\377\377'\377\377\377'\377\377\377%\377\377"
- "\377\"\377\377\377\37\377\377\377*\377\377\377K\377\377\377h\377\377\377"
- "D\377\377\377;\377\377\377b\377\377\377=\377\377\377)\377\377\377-\377\377"
- "\377G\377\377\3770\377\377\3778\377\377\377e\377\377\377R\377\377\377F\377"
- "\377\3777\377\377\377\22\377\377\377\23\377\377\377+\377\377\3772\377\377"
- "\3773\377\377\377/\377\377\377'\377\377\377\40\377\377\377\34\377\377\377"
- "\36\377\377\377\37\377\377\377!\377\377\377\"\377\377\377\"\377\377\377!"
- "\377\377\377\37\377\377\377\36\377\377\377\34\377\377\377\33\377\377\377"
- "\32\377\377\377\31\377\377\377\27\377\377\377\26\377\377\377\24\377\377\377"
- "\23\377\377\377\21\377\377\377\20\377\377\377\17\377\377\377\15\377\377\377"
- "\14\377\377\377\13\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377"
- "\10\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377"
- "\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0"
- "\0\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\1\377\377"
- "\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377"
- "\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6"
- "\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\11"
- "\377\377\377\12\377\377\377\12\377\377\377\13\377\377\377\13\377\377\377"
- "\14\377\377\377\14\377\377\377\15\377\377\377\15\377\377\377\16\377\377\377"
- "\16\377\377\377\17\377\377\377\17\377\377\377\20\377\377\377\20\377\377\377"
- "\20\377\377\377\21\377\377\377\21\377\377\377\21\377\377\377\21\377\377\377"
- "\22\377\377\377\24\377\377\377\26\377\377\377\30\377\377\377\33\377\377\377"
- "\36\377\377\377\"\377\377\377&\377\377\377)\377\377\377*\377\377\377+\377"
- "\377\377,\377\377\377-\377\377\377)\377\377\377%\377\377\377(\377\377\377"
- "O\377\377\377w\377\377\377H\377\377\377O\377\377\377a\377\377\3774\377\377"
- "\377-\377\377\377L\377\377\3777\377\377\377Q\377\377\377k\377\377\377X\377"
- "\377\377F\377\377\377\36\377\377\377\22\377\377\3771\377\377\3779\377\377"
- "\377:\377\377\3772\377\377\377(\377\377\377!\377\377\377\"\377\377\377$\377"
- "\377\377&\377\377\377'\377\377\377&\377\377\377$\377\377\377\"\377\377\377"
- "!\377\377\377\37\377\377\377\36\377\377\377\34\377\377\377\33\377\377\377"
- "\32\377\377\377\30\377\377\377\26\377\377\377\25\377\377\377\22\377\377\377"
- "\21\377\377\377\20\377\377\377\16\377\377\377\15\377\377\377\15\377\377\377"
- "\13\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377"
- "\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5"
- "\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377"
- "\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\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\1\377\377\377"
- "\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3"
- "\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377"
- "\377\377\6\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\10\377"
- "\377\377\11\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377\15\377"
- "\377\377\16\377\377\377\17\377\377\377\17\377\377\377\20\377\377\377\21\377"
- "\377\377\21\377\377\377\22\377\377\377\23\377\377\377\24\377\377\377\24\377"
- "\377\377\25\377\377\377\24\377\377\377\25\377\377\377\26\377\377\377\26\377"
- "\377\377\25\377\377\377\25\377\377\377\24\377\377\377\27\377\377\377\31\377"
- "\377\377\34\377\377\377\40\377\377\377$\377\377\377*\377\377\3770\377\377"
- "\3771\377\377\3773\377\377\3774\377\377\3773\377\377\377.\377\377\377'\377"
- "\377\377S\377\377\377\213\377\377\377K\377\377\377o\377\377\377Q\377\377"
- "\3771\377\377\377P\377\377\377@\377\377\377}\377\377\377r\377\377\377]\377"
- "\377\3775\377\377\377\21\377\377\3779\377\377\377C\377\377\377C\377\377\377"
- "4\377\377\377)\377\377\377'\377\377\377*\377\377\377,\377\377\377.\377\377"
- "\377,\377\377\377)\377\377\377'\377\377\377$\377\377\377#\377\377\377!\377"
- "\377\377\37\377\377\377\35\377\377\377\33\377\377\377\31\377\377\377\30\377"
- "\377\377\26\377\377\377\25\377\377\377\23\377\377\377\22\377\377\377\20\377"
- "\377\377\17\377\377\377\15\377\377\377\14\377\377\377\13\377\377\377\13\377"
- "\377\377\12\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\7\377"
- "\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377"
- "\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\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\1\377\377\377"
- "\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377"
- "\377\377\5\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\7\377\377"
- "\377\10\377\377\377\11\377\377\377\12\377\377\377\13\377\377\377\14\377\377"
- "\377\14\377\377\377\16\377\377\377\17\377\377\377\20\377\377\377\21\377\377"
- "\377\24\377\377\377\25\377\377\377\26\377\377\377\27\377\377\377\30\377\377"
- "\377\31\377\377\377\31\377\377\377\32\377\377\377\33\377\377\377\33\377\377"
- "\377\33\377\377\377\33\377\377\377\33\377\377\377\32\377\377\377\32\377\377"
- "\377\31\377\377\377\32\377\377\377\36\377\377\377\"\377\377\377(\377\377"
- "\377.\377\377\3777\377\377\377;\377\377\377=\377\377\377?\377\377\377;\377"
- "\377\3773\377\377\377U\377\377\377\247\377\377\377M\377\377\377\230\377\377"
- "\377E\377\377\377T\377\377\377M\377\377\377\265\377\377\377\177\377\377\377"
- "^\377\377\377\20\377\377\377D\377\377\377Q\377\377\377I\377\377\3776\377"
- "\377\377.\377\377\3773\377\377\3776\377\377\3777\377\377\3773\377\377\377"
- "/\377\377\377,\377\377\377)\377\377\377'\377\377\377$\377\377\377!\377\377"
- "\377\36\377\377\377\34\377\377\377\32\377\377\377\30\377\377\377\27\377\377"
- "\377\25\377\377\377\24\377\377\377\23\377\377\377\21\377\377\377\20\377\377"
- "\377\16\377\377\377\15\377\377\377\14\377\377\377\14\377\377\377\12\377\377"
- "\377\12\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377\7\377\377"
- "\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0"
- "\0\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\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4"
- "\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377"
- "\377\377\7\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377\12\377"
- "\377\377\13\377\377\377\14\377\377\377\15\377\377\377\16\377\377\377\17\377"
- "\377\377\21\377\377\377\22\377\377\377\24\377\377\377\26\377\377\377\27\377"
- "\377\377\32\377\377\377\34\377\377\377\37\377\377\377!\377\377\377!\377\377"
- "\377\"\377\377\377\"\377\377\377\"\377\377\377\"\377\377\377\"\377\377\377"
- "\"\377\377\377\"\377\377\377!\377\377\377\40\377\377\377\37\377\377\377$"
- "\377\377\377+\377\377\3773\377\377\377?\377\377\377I\377\377\377L\377\377"
- "\377O\377\377\377E\377\377\377T\377\377\377\321\377\377\377w\377\377\377"
- "z\377\377\377Z\377\377\377`\377\377\377\313\377\377\377\214\377\377\377$"
- "\377\377\377U\377\377\377f\377\377\377N\377\377\3779\377\377\377?\377\377"
- "\377D\377\377\377B\377\377\377<\377\377\3777\377\377\3773\377\377\377/\377"
- "\377\377*\377\377\377&\377\377\377\"\377\377\377\37\377\377\377\35\377\377"
- "\377\33\377\377\377\31\377\377\377\27\377\377\377\25\377\377\377\24\377\377"
- "\377\23\377\377\377\22\377\377\377\21\377\377\377\17\377\377\377\16\377\377"
- "\377\16\377\377\377\14\377\377\377\14\377\377\377\13\377\377\377\12\377\377"
- "\377\11\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\7\377\377"
- "\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377"
- "\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0"
- "\0\0\0\0\0\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\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4\377\377"
- "\377\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377"
- "\6\377\377\377\7\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377"
- "\11\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377\15\377\377\377"
- "\16\377\377\377\17\377\377\377\21\377\377\377\22\377\377\377\24\377\377\377"
- "\25\377\377\377\30\377\377\377\31\377\377\377\34\377\377\377\36\377\377\377"
- "\40\377\377\377#\377\377\377&\377\377\377)\377\377\377,\377\377\377-\377"
- "\377\377-\377\377\377.\377\377\377.\377\377\377.\377\377\377-\377\377\377"
- ",\377\377\377*\377\377\377.\377\377\3779\377\377\377I\377\377\377`\377\377"
- "\377f\377\377\377g\377\377\377O\377\377\377\377\377\377\377\337\377\377\377"
- "c\377\377\377\200\377\377\377\343\377\377\377j\377\377\377r\377\377\377\206"
- "\377\377\377R\377\377\377U\377\377\377\\\377\377\377R\377\377\377I\377\377"
- "\377B\377\377\377;\377\377\3773\377\377\377-\377\377\377(\377\377\377$\377"
- "\377\377\40\377\377\377\35\377\377\377\33\377\377\377\31\377\377\377\27\377"
- "\377\377\26\377\377\377\24\377\377\377\23\377\377\377\22\377\377\377\21\377"
- "\377\377\21\377\377\377\20\377\377\377\16\377\377\377\15\377\377\377\15\377"
- "\377\377\13\377\377\377\13\377\377\377\12\377\377\377\12\377\377\377\10\377"
- "\377\377\10\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377\6\377"
- "\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\4\377\377"
- "\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0"
- "\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\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377"
- "\377\6\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\10\377\377\377"
- "\11\377\377\377\11\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377"
- "\15\377\377\377\15\377\377\377\17\377\377\377\20\377\377\377\21\377\377\377"
- "\23\377\377\377\24\377\377\377\26\377\377\377\30\377\377\377\31\377\377\377"
- "\33\377\377\377\35\377\377\377\40\377\377\377\"\377\377\377%\377\377\377"
- ")\377\377\377-\377\377\3772\377\377\3779\377\377\377@\377\377\377C\377\377"
- "\377D\377\377\377E\377\377\377D\377\377\377B\377\377\377>\377\377\377V\377"
- "\377\377\177\377\377\377\231\377\377\377\213\377\377\377\377\377\377\377"
- "\365\377\377\377\301\377\377\377\377\377\377\377\253\377\377\377\235\377"
- "\377\377\177\377\377\377\204\377\377\377n\377\377\377_\377\377\377M\377\377"
- "\377?\377\377\3776\377\377\377.\377\377\377)\377\377\377$\377\377\377!\377"
- "\377\377\36\377\377\377\34\377\377\377\32\377\377\377\30\377\377\377\26\377"
- "\377\377\25\377\377\377\24\377\377\377\23\377\377\377\22\377\377\377\21\377"
- "\377\377\20\377\377\377\17\377\377\377\17\377\377\377\15\377\377\377\14\377"
- "\377\377\14\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377\11\377"
- "\377\377\11\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\6\377\377"
- "\377\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0"
- "\0\0\0\0\0\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\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377"
- "\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\7"
- "\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\11\377\377\377\11"
- "\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377\14\377\377\377"
- "\16\377\377\377\17\377\377\377\17\377\377\377\21\377\377\377\22\377\377\377"
- "\23\377\377\377\24\377\377\377\26\377\377\377\27\377\377\377\31\377\377\377"
- "\33\377\377\377\35\377\377\377\40\377\377\377#\377\377\377&\377\377\377+"
- "\377\377\3770\377\377\3777\377\377\377@\377\377\377K\377\377\377[\377\377"
- "\377q\377\377\377\207\377\377\377\212\377\377\377\205\377\377\377\254\377"
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
- "\376\377\377\377\335\377\377\377\231\377\377\377l\377\377\377R\377\377\377"
- "B\377\377\3778\377\377\3770\377\377\377*\377\377\377&\377\377\377\"\377\377"
- "\377\37\377\377\377\34\377\377\377\32\377\377\377\30\377\377\377\27\377\377"
- "\377\25\377\377\377\24\377\377\377\23\377\377\377\22\377\377\377\21\377\377"
- "\377\20\377\377\377\17\377\377\377\17\377\377\377\16\377\377\377\15\377\377"
- "\377\14\377\377\377\13\377\377\377\13\377\377\377\12\377\377\377\11\377\377"
- "\377\11\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\6\377\377"
- "\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377"
- "\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\7"
- "\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377"
- "\11\377\377\377\12\377\377\377\13\377\377\377\13\377\377\377\15\377\377\377"
- "\15\377\377\377\16\377\377\377\17\377\377\377\20\377\377\377\22\377\377\377"
- "\22\377\377\377\23\377\377\377\24\377\377\377\25\377\377\377\26\377\377\377"
- "\27\377\377\377\30\377\377\377\32\377\377\377\33\377\377\377\35\377\377\377"
- "\37\377\377\377!\377\377\377$\377\377\377'\377\377\377+\377\377\377/\377"
- "\377\3774\377\377\377;\377\377\377C\377\377\377N\377\377\377^\377\377\377"
- "v\377\377\377\235\377\377\377\353\377\377\377\377\377\377\377\377\377\377"
- "\377\377\377\377\377\261\377\377\377v\377\377\377Y\377\377\377G\377\377\377"
- ";\377\377\3772\377\377\377,\377\377\377'\377\377\377#\377\377\377\40\377"
- "\377\377\35\377\377\377\33\377\377\377\31\377\377\377\27\377\377\377\26\377"
- "\377\377\25\377\377\377\23\377\377\377\22\377\377\377\21\377\377\377\21\377"
- "\377\377\20\377\377\377\17\377\377\377\16\377\377\377\16\377\377\377\15\377"
- "\377\377\15\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377\12\377"
- "\377\377\11\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\7\377"
- "\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377"
- "\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377"
- "\7\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\12\377\377\377"
- "\12\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377\15\377\377\377"
- "\16\377\377\377\17\377\377\377\20\377\377\377\22\377\377\377\22\377\377\377"
- "\24\377\377\377\25\377\377\377\26\377\377\377\27\377\377\377\31\377\377\377"
- "\32\377\377\377\33\377\377\377\35\377\377\377\37\377\377\377!\377\377\377"
- "$\377\377\377'\377\377\377*\377\377\377.\377\377\3773\377\377\3779\377\377"
- "\377>\377\377\377D\377\377\377K\377\377\377S\377\377\377]\377\377\377j\377"
- "\377\377\225\377\377\377\377\377\377\377\363\377\377\377\377\377\377\377"
- "\377\377\377\377\377\377\377\377\377\377\377\377\332\377\377\377\320\377"
- "\377\377\236\377\377\377h\377\377\377I\377\377\3776\377\377\377*\377\377"
- "\377\"\377\377\377\35\377\377\377\32\377\377\377\31\377\377\377\27\377\377"
- "\377\25\377\377\377\24\377\377\377\23\377\377\377\22\377\377\377\21\377\377"
- "\377\20\377\377\377\20\377\377\377\17\377\377\377\16\377\377\377\16\377\377"
- "\377\15\377\377\377\15\377\377\377\14\377\377\377\14\377\377\377\12\377\377"
- "\377\12\377\377\377\12\377\377\377\10\377\377\377\10\377\377\377\10\377\377"
- "\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377"
- "\5\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377"
- "\4\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6"
- "\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377\11"
- "\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377\14\377\377\377"
- "\16\377\377\377\17\377\377\377\17\377\377\377\21\377\377\377\22\377\377\377"
- "\23\377\377\377\25\377\377\377\27\377\377\377\30\377\377\377\31\377\377\377"
- "\33\377\377\377\34\377\377\377\35\377\377\377\37\377\377\377\40\377\377\377"
- "\"\377\377\377#\377\377\377%\377\377\377'\377\377\377)\377\377\377,\377\377"
- "\377/\377\377\3772\377\377\3775\377\377\377:\377\377\377J\377\377\377b\377"
- "\377\377\207\377\377\377\217\377\377\377z\377\377\377\322\377\377\377\354"
- "\377\377\377\352\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
- "\377\271\377\377\377\220\377\377\377y\377\377\377m\377\377\377k\377\377\377"
- "h\377\377\377c\377\377\377O\377\377\377?\377\377\3774\377\377\377+\377\377"
- "\377$\377\377\377\37\377\377\377\33\377\377\377\30\377\377\377\25\377\377"
- "\377\22\377\377\377\21\377\377\377\17\377\377\377\16\377\377\377\15\377\377"
- "\377\15\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377\13\377\377"
- "\377\12\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377\10\377\377"
- "\377\7\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\5\377\377\377"
- "\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0"
- "\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377"
- "\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6"
- "\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377\12"
- "\377\377\377\13\377\377\377\13\377\377\377\14\377\377\377\15\377\377\377"
- "\16\377\377\377\17\377\377\377\20\377\377\377\21\377\377\377\21\377\377\377"
- "\23\377\377\377\24\377\377\377\25\377\377\377\26\377\377\377\30\377\377\377"
- "\31\377\377\377\31\377\377\377\32\377\377\377\33\377\377\377\34\377\377\377"
- "\36\377\377\377\37\377\377\377\40\377\377\377\"\377\377\377#\377\377\377"
- "%\377\377\377*\377\377\3771\377\377\377;\377\377\377H\377\377\377Z\377\377"
- "\377b\377\377\377[\377\377\377Q\377\377\377r\377\377\377\332\377\377\377"
- "\236\377\377\377o\377\377\377\223\377\377\377\305\377\377\377\377\377\377"
- "\377\377\377\377\377\310\377\377\377\247\377\377\377p\377\377\377`\377\377"
- "\377U\377\377\377L\377\377\377H\377\377\377H\377\377\377G\377\377\377E\377"
- "\377\377C\377\377\377>\377\377\3774\377\377\377-\377\377\377'\377\377\377"
- "\"\377\377\377\36\377\377\377\33\377\377\377\30\377\377\377\26\377\377\377"
- "\24\377\377\377\22\377\377\377\20\377\377\377\17\377\377\377\16\377\377\377"
- "\15\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377"
- "\7\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5"
- "\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4"
- "\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6\377"
- "\377\377\7\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\11\377"
- "\377\377\11\377\377\377\13\377\377\377\13\377\377\377\14\377\377\377\15\377"
- "\377\377\15\377\377\377\16\377\377\377\17\377\377\377\20\377\377\377\20\377"
- "\377\377\22\377\377\377\22\377\377\377\24\377\377\377\25\377\377\377\26\377"
- "\377\377\27\377\377\377\30\377\377\377\31\377\377\377\31\377\377\377\32\377"
- "\377\377\33\377\377\377\35\377\377\377!\377\377\377%\377\377\377*\377\377"
- "\3771\377\377\3779\377\377\377C\377\377\377J\377\377\377G\377\377\377B\377"
- "\377\377=\377\377\377N\377\377\377i\377\377\377\314\377\377\377v\377\377"
- "\377K\377\377\377u\377\377\377\36\377\377\377\224\377\377\377\260\377\377"
- "\377\223\377\377\377\342\377\377\377\226\377\377\377\223\377\377\377]\377"
- "\377\377Q\377\377\377H\377\377\377A\377\377\377<\377\377\3777\377\377\377"
- "6\377\377\3776\377\377\3775\377\377\3775\377\377\3774\377\377\3773\377\377"
- "\3771\377\377\377,\377\377\377'\377\377\377#\377\377\377\37\377\377\377\34"
- "\377\377\377\32\377\377\377\27\377\377\377\25\377\377\377\23\377\377\377"
- "\21\377\377\377\20\377\377\377\16\377\377\377\14\377\377\377\13\377\377\377"
- "\12\377\377\377\12\377\377\377\11\377\377\377\7\377\377\377\7\377\377\377"
- "\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4"
- "\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\0\0\0\0\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\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377"
- "\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377"
- "\6\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377"
- "\11\377\377\377\11\377\377\377\12\377\377\377\13\377\377\377\13\377\377\377"
- "\14\377\377\377\15\377\377\377\15\377\377\377\16\377\377\377\17\377\377\377"
- "\20\377\377\377\21\377\377\377\21\377\377\377\23\377\377\377\23\377\377\377"
- "\25\377\377\377\25\377\377\377\26\377\377\377\30\377\377\377\33\377\377\377"
- "\35\377\377\377!\377\377\377%\377\377\377)\377\377\377/\377\377\3776\377"
- "\377\377;\377\377\377:\377\377\3777\377\377\3774\377\377\3770\377\377\377"
- ";\377\377\377I\377\377\377n\377\377\377\272\377\377\377^\377\377\3778\377"
- "\377\377H\377\377\377\223\377\377\377/\377\377\377v\377\377\377\216\377\377"
- "\377\246\377\377\377\216\377\377\377\232\377\377\377x\377\377\377\201\377"
- "\377\377Y\377\377\377F\377\377\377?\377\377\3779\377\377\3775\377\377\377"
- "2\377\377\377.\377\377\377,\377\377\377+\377\377\377+\377\377\377+\377\377"
- "\377*\377\377\377*\377\377\377)\377\377\377)\377\377\377(\377\377\377&\377"
- "\377\377\"\377\377\377\37\377\377\377\34\377\377\377\32\377\377\377\27\377"
- "\377\377\25\377\377\377\22\377\377\377\21\377\377\377\17\377\377\377\15\377"
- "\377\377\14\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377\10\377"
- "\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377"
- "\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0"
- "\0\0\0\0\0\0\0\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"
- "\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377"
- "\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377"
- "\377\6\377\377\377\7\377\377\377\7\377\377\377\10\377\377\377\10\377\377"
- "\377\11\377\377\377\12\377\377\377\12\377\377\377\13\377\377\377\14\377\377"
- "\377\14\377\377\377\14\377\377\377\16\377\377\377\16\377\377\377\17\377\377"
- "\377\20\377\377\377\20\377\377\377\22\377\377\377\24\377\377\377\26\377\377"
- "\377\30\377\377\377\33\377\377\377\35\377\377\377\40\377\377\377$\377\377"
- "\377(\377\377\377-\377\377\3772\377\377\3771\377\377\377/\377\377\377-\377"
- "\377\377+\377\377\377(\377\377\377/\377\377\3779\377\377\377F\377\377\377"
- "m\377\377\377\246\377\377\377O\377\377\377-\377\377\3777\377\377\377N\377"
- "\377\377J\377\377\3777\377\377\377b\377\377\377w\377\377\377\206\377\377"
- "\377b\377\377\377\231\377\377\377s\377\377\377d\377\377\377r\377\377\377"
- "S\377\377\377>\377\377\3778\377\377\3774\377\377\3770\377\377\377-\377\377"
- "\377*\377\377\377(\377\377\377&\377\377\377$\377\377\377$\377\377\377$\377"
- "\377\377$\377\377\377#\377\377\377#\377\377\377#\377\377\377\"\377\377\377"
- "\"\377\377\377!\377\377\377!\377\377\377\36\377\377\377\33\377\377\377\30"
- "\377\377\377\25\377\377\377\23\377\377\377\22\377\377\377\17\377\377\377"
- "\16\377\377\377\15\377\377\377\14\377\377\377\13\377\377\377\11\377\377\377"
- "\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5"
- "\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377"
- "\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\7"
- "\377\377\377\7\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\11"
- "\377\377\377\11\377\377\377\12\377\377\377\13\377\377\377\13\377\377\377"
- "\14\377\377\377\15\377\377\377\16\377\377\377\17\377\377\377\21\377\377\377"
- "\23\377\377\377\26\377\377\377\27\377\377\377\32\377\377\377\35\377\377\377"
- "\40\377\377\377#\377\377\377&\377\377\377*\377\377\377*\377\377\377)\377"
- "\377\377(\377\377\377&\377\377\377$\377\377\377\"\377\377\377(\377\377\377"
- ".\377\377\3776\377\377\377H\377\377\377j\377\377\377\203\377\377\377C\377"
- "\377\377%\377\377\377-\377\377\3775\377\377\377]\377\377\377\40\377\377\377"
- ";\377\377\377T\377\377\377f\377\377\377k\377\377\377l\377\377\377Y\377\377"
- "\377\221\377\377\377[\377\377\377U\377\377\377a\377\377\377N\377\377\377"
- "<\377\377\3772\377\377\377/\377\377\377,\377\377\377)\377\377\377'\377\377"
- "\377%\377\377\377#\377\377\377!\377\377\377\40\377\377\377\37\377\377\377"
- "\37\377\377\377\37\377\377\377\37\377\377\377\36\377\377\377\36\377\377\377"
- "\36\377\377\377\36\377\377\377\34\377\377\377\33\377\377\377\32\377\377\377"
- "\31\377\377\377\30\377\377\377\26\377\377\377\24\377\377\377\21\377\377\377"
- "\20\377\377\377\16\377\377\377\15\377\377\377\14\377\377\377\12\377\377\377"
- "\11\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377"
- "\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\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\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4"
- "\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377"
- "\377\377\6\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\10\377"
- "\377\377\11\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377\15\377"
- "\377\377\16\377\377\377\20\377\377\377\22\377\377\377\23\377\377\377\26\377"
- "\377\377\30\377\377\377\33\377\377\377\37\377\377\377!\377\377\377$\377\377"
- "\377%\377\377\377$\377\377\377#\377\377\377\"\377\377\377!\377\377\377\37"
- "\377\377\377\36\377\377\377\"\377\377\377'\377\377\377,\377\377\3774\377"
- "\377\377I\377\377\377f\377\377\377k\377\377\377;\377\377\377\40\377\377\377"
- "%\377\377\377+\377\377\377:\377\377\377U\377\377\377\17\377\377\377<\377"
- "\377\377J\377\377\377Y\377\377\377X\377\377\377k\377\377\377I\377\377\377"
- "b\377\377\377q\377\377\377K\377\377\377K\377\377\377T\377\377\377I\377\377"
- "\377:\377\377\377.\377\377\377+\377\377\377(\377\377\377&\377\377\377$\377"
- "\377\377\"\377\377\377\40\377\377\377\37\377\377\377\36\377\377\377\35\377"
- "\377\377\33\377\377\377\33\377\377\377\33\377\377\377\33\377\377\377\33\377"
- "\377\377\33\377\377\377\31\377\377\377\30\377\377\377\30\377\377\377\27\377"
- "\377\377\26\377\377\377\25\377\377\377\24\377\377\377\24\377\377\377\23\377"
- "\377\377\21\377\377\377\20\377\377\377\16\377\377\377\14\377\377\377\13\377"
- "\377\377\12\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\7\377"
- "\377\377\6\377\377\377\6\377\377\377\5\377\377\377\4\377\377\377\4\377\377"
- "\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\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\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377"
- "\377\6\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\11\377\377"
- "\377\12\377\377\377\13\377\377\377\14\377\377\377\15\377\377\377\17\377\377"
- "\377\21\377\377\377\22\377\377\377\24\377\377\377\26\377\377\377\30\377\377"
- "\377\34\377\377\377\36\377\377\377\40\377\377\377\40\377\377\377\40\377\377"
- "\377\37\377\377\377\36\377\377\377\35\377\377\377\34\377\377\377\33\377\377"
- "\377\36\377\377\377!\377\377\377&\377\377\377+\377\377\3776\377\377\377H"
- "\377\377\377a\377\377\377Z\377\377\3774\377\377\377\33\377\377\377\40\377"
- "\377\377%\377\377\377*\377\377\377C\377\377\3771\377\377\377\23\377\377\377"
- "7\377\377\377A\377\377\377N\377\377\377N\377\377\377Z\377\377\377O\377\377"
- "\377@\377\377\377f\377\377\377\\\377\377\377@\377\377\377B\377\377\377J\377"
- "\377\377D\377\377\3777\377\377\377-\377\377\377'\377\377\377%\377\377\377"
- "#\377\377\377!\377\377\377\40\377\377\377\36\377\377\377\35\377\377\377\34"
- "\377\377\377\33\377\377\377\32\377\377\377\31\377\377\377\30\377\377\377"
- "\30\377\377\377\27\377\377\377\27\377\377\377\26\377\377\377\26\377\377\377"
- "\25\377\377\377\24\377\377\377\23\377\377\377\22\377\377\377\22\377\377\377"
- "\21\377\377\377\20\377\377\377\17\377\377\377\17\377\377\377\16\377\377\377"
- "\15\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377"
- "\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\5\377\377\377\5"
- "\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\2\377"
- "\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0"
- "\0\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\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4"
- "\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377"
- "\377\377\7\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377\12\377"
- "\377\377\13\377\377\377\14\377\377\377\16\377\377\377\17\377\377\377\21\377"
- "\377\377\22\377\377\377\25\377\377\377\27\377\377\377\31\377\377\377\32\377"
- "\377\377\33\377\377\377\33\377\377\377\33\377\377\377\34\377\377\377\33\377"
- "\377\377\32\377\377\377\31\377\377\377\30\377\377\377\32\377\377\377\35\377"
- "\377\377!\377\377\377$\377\377\377*\377\377\3777\377\377\377G\377\377\377"
- "]\377\377\377N\377\377\377/\377\377\377\30\377\377\377\34\377\377\377\40"
- "\377\377\377$\377\377\377/\377\377\377I\377\377\377\34\377\377\377\27\377"
- "\377\3772\377\377\377;\377\377\377E\377\377\377G\377\377\377L\377\377\377"
- "S\377\377\377:\377\377\377G\377\377\377f\377\377\377M\377\377\3777\377\377"
- "\377<\377\377\377B\377\377\377@\377\377\3775\377\377\377,\377\377\377%\377"
- "\377\377#\377\377\377!\377\377\377\37\377\377\377\36\377\377\377\34\377\377"
- "\377\33\377\377\377\32\377\377\377\31\377\377\377\31\377\377\377\30\377\377"
- "\377\27\377\377\377\25\377\377\377\25\377\377\377\23\377\377\377\23\377\377"
- "\377\22\377\377\377\22\377\377\377\21\377\377\377\21\377\377\377\20\377\377"
- "\377\20\377\377\377\17\377\377\377\17\377\377\377\16\377\377\377\15\377\377"
- "\377\14\377\377\377\14\377\377\377\13\377\377\377\13\377\377\377\12\377\377"
- "\377\11\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377"
- "\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377"
- "\3\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\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"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377\377"
- "\377\7\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\12\377\377"
- "\377\13\377\377\377\15\377\377\377\16\377\377\377\17\377\377\377\21\377\377"
- "\377\22\377\377\377\25\377\377\377\26\377\377\377\27\377\377\377\26\377\377"
- "\377\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377"
- "\377\26\377\377\377\26\377\377\377\30\377\377\377\32\377\377\377\35\377\377"
- "\377\40\377\377\377#\377\377\377+\377\377\3777\377\377\377F\377\377\377X"
- "\377\377\377D\377\377\377+\377\377\377\26\377\377\377\31\377\377\377\34\377"
- "\377\377\37\377\377\377#\377\377\3774\377\377\3777\377\377\377\20\377\377"
- "\377\32\377\377\377.\377\377\3776\377\377\377>\377\377\377@\377\377\377B"
- "\377\377\377L\377\377\377>\377\377\3771\377\377\377J\377\377\377X\377\377"
- "\377B\377\377\3771\377\377\3776\377\377\377;\377\377\377<\377\377\3773\377"
- "\377\377+\377\377\377$\377\377\377\40\377\377\377\37\377\377\377\35\377\377"
- "\377\34\377\377\377\33\377\377\377\32\377\377\377\31\377\377\377\30\377\377"
- "\377\27\377\377\377\27\377\377\377\25\377\377\377\24\377\377\377\23\377\377"
- "\377\22\377\377\377\20\377\377\377\20\377\377\377\17\377\377\377\17\377\377"
- "\377\16\377\377\377\16\377\377\377\15\377\377\377\15\377\377\377\14\377\377"
- "\377\14\377\377\377\14\377\377\377\13\377\377\377\13\377\377\377\12\377\377"
- "\377\11\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\7\377\377"
- "\377\7\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377"
- "\4\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\1"
- "\377\377\377\1\377\377\377\1\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377"
- "\377\377\7\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\12\377"
- "\377\377\13\377\377\377\15\377\377\377\16\377\377\377\17\377\377\377\20\377"
- "\377\377\22\377\377\377\22\377\377\377\23\377\377\377\23\377\377\377\23\377"
- "\377\377\24\377\377\377\23\377\377\377\24\377\377\377\23\377\377\377\23\377"
- "\377\377\23\377\377\377\26\377\377\377\27\377\377\377\32\377\377\377\34\377"
- "\377\377\37\377\377\377#\377\377\377+\377\377\3776\377\377\377D\377\377\377"
- "S\377\377\377<\377\377\377'\377\377\377\24\377\377\377\26\377\377\377\31"
- "\377\377\377\33\377\377\377\36\377\377\377'\377\377\3779\377\377\377%\377"
- "\377\377\12\377\377\377\33\377\377\377+\377\377\3771\377\377\3778\377\377"
- "\377;\377\377\377:\377\377\377C\377\377\377A\377\377\3771\377\377\3777\377"
- "\377\377L\377\377\377K\377\377\3779\377\377\377-\377\377\3772\377\377\377"
- "6\377\377\3779\377\377\3771\377\377\377)\377\377\377$\377\377\377\37\377"
- "\377\377\35\377\377\377\34\377\377\377\33\377\377\377\32\377\377\377\31\377"
- "\377\377\30\377\377\377\27\377\377\377\25\377\377\377\24\377\377\377\23\377"
- "\377\377\22\377\377\377\21\377\377\377\20\377\377\377\20\377\377\377\16\377"
- "\377\377\16\377\377\377\15\377\377\377\15\377\377\377\15\377\377\377\14\377"
- "\377\377\14\377\377\377\13\377\377\377\13\377\377\377\12\377\377\377\11\377"
- "\377\377\11\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\7\377"
- "\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377"
- "\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377"
- "\2\377\377\377\1\377\377\377\1\377\377\377\1\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\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377"
- "\377\377\7\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\12\377"
- "\377\377\13\377\377\377\14\377\377\377\15\377\377\377\17\377\377\377\17\377"
- "\377\377\17\377\377\377\20\377\377\377\20\377\377\377\20\377\377\377\21\377"
- "\377\377\20\377\377\377\21\377\377\377\20\377\377\377\21\377\377\377\20\377"
- "\377\377\23\377\377\377\24\377\377\377\27\377\377\377\31\377\377\377\33\377"
- "\377\377\36\377\377\377#\377\377\377,\377\377\3776\377\377\377B\377\377\377"
- "I\377\377\3776\377\377\377$\377\377\377\24\377\377\377\24\377\377\377\26"
- "\377\377\377\31\377\377\377\33\377\377\377\35\377\377\377+\377\377\3779\377"
- "\377\377\30\377\377\377\14\377\377\377\35\377\377\377(\377\377\377-\377\377"
- "\3773\377\377\3777\377\377\3776\377\377\377;\377\377\377C\377\377\3773\377"
- "\377\377(\377\377\377:\377\377\377L\377\377\377A\377\377\3773\377\377\377"
- "*\377\377\377.\377\377\3771\377\377\3774\377\377\377.\377\377\377(\377\377"
- "\377#\377\377\377\36\377\377\377\33\377\377\377\32\377\377\377\31\377\377"
- "\377\30\377\377\377\27\377\377\377\27\377\377\377\25\377\377\377\24\377\377"
- "\377\23\377\377\377\22\377\377\377\20\377\377\377\20\377\377\377\17\377\377"
- "\377\16\377\377\377\15\377\377\377\15\377\377\377\14\377\377\377\13\377\377"
- "\377\13\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377\11\377\377"
- "\377\11\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\7\377\377"
- "\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\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\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3"
- "\377\377\377\3\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377"
- "\377\377\7\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\12\377"
- "\377\377\13\377\377\377\14\377\377\377\14\377\377\377\15\377\377\377\15\377"
- "\377\377\15\377\377\377\16\377\377\377\16\377\377\377\16\377\377\377\16\377"
- "\377\377\16\377\377\377\16\377\377\377\16\377\377\377\16\377\377\377\20\377"
- "\377\377\22\377\377\377\23\377\377\377\26\377\377\377\30\377\377\377\33\377"
- "\377\377\36\377\377\377$\377\377\377,\377\377\3775\377\377\377@\377\377\377"
- "A\377\377\3771\377\377\377!\377\377\377\23\377\377\377\22\377\377\377\24"
- "\377\377\377\26\377\377\377\30\377\377\377\32\377\377\377!\377\377\377.\377"
- "\377\377)\377\377\377\20\377\377\377\16\377\377\377\35\377\377\377&\377\377"
- "\377*\377\377\377/\377\377\3773\377\377\3772\377\377\3775\377\377\377;\377"
- "\377\3776\377\377\377*\377\377\377,\377\377\377<\377\377\377H\377\377\377"
- "9\377\377\377-\377\377\377'\377\377\377*\377\377\377.\377\377\3770\377\377"
- "\377-\377\377\377'\377\377\377\"\377\377\377\36\377\377\377\32\377\377\377"
- "\31\377\377\377\30\377\377\377\27\377\377\377\25\377\377\377\25\377\377\377"
- "\23\377\377\377\22\377\377\377\22\377\377\377\20\377\377\377\20\377\377\377"
- "\16\377\377\377\16\377\377\377\15\377\377\377\14\377\377\377\13\377\377\377"
- "\13\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377"
- "\10\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377"
- "\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5"
- "\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\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\1\377\377\377\1\377"
- "\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377"
- "\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377"
- "\6\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377"
- "\12\377\377\377\12\377\377\377\13\377\377\377\13\377\377\377\13\377\377\377"
- "\13\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377"
- "\15\377\377\377\14\377\377\377\15\377\377\377\16\377\377\377\17\377\377\377"
- "\20\377\377\377\23\377\377\377\24\377\377\377\26\377\377\377\31\377\377\377"
- "\36\377\377\377$\377\377\377+\377\377\3774\377\377\377>\377\377\377;\377"
- "\377\377-\377\377\377\37\377\377\377\23\377\377\377\21\377\377\377\22\377"
- "\377\377\24\377\377\377\26\377\377\377\30\377\377\377\32\377\377\377$\377"
- "\377\3771\377\377\377\35\377\377\377\12\377\377\377\17\377\377\377\36\377"
- "\377\377#\377\377\377'\377\377\377,\377\377\377/\377\377\377/\377\377\377"
- "0\377\377\3776\377\377\3777\377\377\377,\377\377\377\"\377\377\377/\377\377"
- "\377=\377\377\377?\377\377\3773\377\377\377)\377\377\377%\377\377\377(\377"
- "\377\377*\377\377\377-\377\377\377+\377\377\377&\377\377\377!\377\377\377"
- "\35\377\377\377\32\377\377\377\30\377\377\377\27\377\377\377\25\377\377\377"
- "\24\377\377\377\23\377\377\377\22\377\377\377\20\377\377\377\20\377\377\377"
- "\17\377\377\377\16\377\377\377\15\377\377\377\15\377\377\377\14\377\377\377"
- "\13\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377"
- "\10\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377"
- "\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5"
- "\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377"
- "\377\1\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377"
- "\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377"
- "\6\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377"
- "\10\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\12\377\377\377"
- "\12\377\377\377\13\377\377\377\12\377\377\377\13\377\377\377\12\377\377\377"
- "\13\377\377\377\13\377\377\377\14\377\377\377\15\377\377\377\16\377\377\377"
- "\20\377\377\377\21\377\377\377\23\377\377\377\26\377\377\377\30\377\377\377"
- "\36\377\377\377#\377\377\377+\377\377\3773\377\377\377<\377\377\3775\377"
- "\377\377)\377\377\377\35\377\377\377\22\377\377\377\20\377\377\377\21\377"
- "\377\377\22\377\377\377\24\377\377\377\26\377\377\377\27\377\377\377\35\377"
- "\377\377'\377\377\377*\377\377\377\25\377\377\377\7\377\377\377\20\377\377"
- "\377\36\377\377\377!\377\377\377%\377\377\377)\377\377\377,\377\377\377,"
- "\377\377\377,\377\377\3771\377\377\3775\377\377\377-\377\377\377$\377\377"
- "\377%\377\377\3771\377\377\377=\377\377\3778\377\377\377.\377\377\377%\377"
- "\377\377\"\377\377\377%\377\377\377'\377\377\377*\377\377\377)\377\377\377"
- "$\377\377\377\40\377\377\377\35\377\377\377\32\377\377\377\26\377\377\377"
- "\25\377\377\377\23\377\377\377\22\377\377\377\22\377\377\377\20\377\377\377"
- "\20\377\377\377\17\377\377\377\16\377\377\377\15\377\377\377\14\377\377\377"
- "\13\377\377\377\13\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377"
- "\11\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377"
- "\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\4"
- "\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377"
- "\377\1\377\377\377\1\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377"
- "\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377"
- "\5\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\7"
- "\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377\10"
- "\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377"
- "\11\377\377\377\12\377\377\377\14\377\377\377\15\377\377\377\16\377\377\377"
- "\17\377\377\377\20\377\377\377\22\377\377\377\24\377\377\377\27\377\377\377"
- "\34\377\377\377\"\377\377\377(\377\377\3771\377\377\377:\377\377\3771\377"
- "\377\377&\377\377\377\33\377\377\377\22\377\377\377\16\377\377\377\20\377"
- "\377\377\21\377\377\377\22\377\377\377\24\377\377\377\25\377\377\377\27\377"
- "\377\377\37\377\377\377)\377\377\377\40\377\377\377\17\377\377\377\10\377"
- "\377\377\21\377\377\377\35\377\377\377\37\377\377\377\"\377\377\377&\377"
- "\377\377)\377\377\377*\377\377\377)\377\377\377,\377\377\3771\377\377\377"
- "/\377\377\377&\377\377\377\37\377\377\377'\377\377\3772\377\377\377=\377"
- "\377\3773\377\377\377*\377\377\377\"\377\377\377!\377\377\377#\377\377\377"
- "%\377\377\377'\377\377\377'\377\377\377#\377\377\377\37\377\377\377\33\377"
- "\377\377\30\377\377\377\25\377\377\377\23\377\377\377\22\377\377\377\21\377"
- "\377\377\20\377\377\377\20\377\377\377\16\377\377\377\15\377\377\377\15\377"
- "\377\377\14\377\377\377\13\377\377\377\13\377\377\377\12\377\377\377\11\377"
- "\377\377\11\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\7\377"
- "\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1"
- "\377\377\377\1\377\377\377\1\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377"
- "\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377"
- "\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377"
- "\6\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7"
- "\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377"
- "\11\377\377\377\12\377\377\377\13\377\377\377\13\377\377\377\15\377\377\377"
- "\16\377\377\377\20\377\377\377\21\377\377\377\23\377\377\377\27\377\377\377"
- "\33\377\377\377!\377\377\377'\377\377\377.\377\377\3775\377\377\377-\377"
- "\377\377#\377\377\377\32\377\377\377\21\377\377\377\15\377\377\377\17\377"
- "\377\377\20\377\377\377\21\377\377\377\22\377\377\377\23\377\377\377\25\377"
- "\377\377\32\377\377\377!\377\377\377*\377\377\377\30\377\377\377\12\377\377"
- "\377\11\377\377\377\22\377\377\377\33\377\377\377\36\377\377\377!\377\377"
- "\377$\377\377\377'\377\377\377'\377\377\377'\377\377\377)\377\377\377-\377"
- "\377\3770\377\377\377'\377\377\377\40\377\377\377\40\377\377\377)\377\377"
- "\3773\377\377\3777\377\377\377.\377\377\377&\377\377\377\40\377\377\377\37"
- "\377\377\377!\377\377\377#\377\377\377%\377\377\377&\377\377\377!\377\377"
- "\377\36\377\377\377\31\377\377\377\27\377\377\377\24\377\377\377\21\377\377"
- "\377\20\377\377\377\20\377\377\377\16\377\377\377\16\377\377\377\15\377\377"
- "\377\14\377\377\377\13\377\377\377\13\377\377\377\13\377\377\377\12\377\377"
- "\377\11\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\7\377\377"
- "\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377"
- "\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5"
- "\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377"
- "\377\377\7\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\10\377"
- "\377\377\11\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377\15\377"
- "\377\377\16\377\377\377\20\377\377\377\22\377\377\377\26\377\377\377\32\377"
- "\377\377\37\377\377\377$\377\377\377+\377\377\3770\377\377\377(\377\377\377"
- "\40\377\377\377\31\377\377\377\21\377\377\377\15\377\377\377\16\377\377\377"
- "\17\377\377\377\20\377\377\377\21\377\377\377\22\377\377\377\23\377\377\377"
- "\25\377\377\377\34\377\377\377#\377\377\377!\377\377\377\22\377\377\377\7"
- "\377\377\377\12\377\377\377\23\377\377\377\32\377\377\377\34\377\377\377"
- "\37\377\377\377\"\377\377\377$\377\377\377%\377\377\377%\377\377\377&\377"
- "\377\377)\377\377\377,\377\377\377(\377\377\377\"\377\377\377\34\377\377"
- "\377\"\377\377\377*\377\377\3773\377\377\3771\377\377\377*\377\377\377#\377"
- "\377\377\35\377\377\377\35\377\377\377\37\377\377\377!\377\377\377\"\377"
- "\377\377#\377\377\377\37\377\377\377\34\377\377\377\30\377\377\377\25\377"
- "\377\377\23\377\377\377\21\377\377\377\17\377\377\377\16\377\377\377\16\377"
- "\377\377\15\377\377\377\14\377\377\377\13\377\377\377\13\377\377\377\12\377"
- "\377\377\11\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377\7\377"
- "\377\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377"
- "\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377"
- "\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377"
- "\377\6\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377"
- "\10\377\377\377\11\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377"
- "\16\377\377\377\17\377\377\377\22\377\377\377\25\377\377\377\31\377\377\377"
- "\35\377\377\377\"\377\377\377(\377\377\377*\377\377\377$\377\377\377\35\377"
- "\377\377\26\377\377\377\17\377\377\377\14\377\377\377\15\377\377\377\16\377"
- "\377\377\17\377\377\377\20\377\377\377\21\377\377\377\22\377\377\377\23\377"
- "\377\377\27\377\377\377\35\377\377\377$\377\377\377\32\377\377\377\16\377"
- "\377\377\6\377\377\377\13\377\377\377\23\377\377\377\31\377\377\377\33\377"
- "\377\377\35\377\377\377\40\377\377\377\"\377\377\377#\377\377\377#\377\377"
- "\377#\377\377\377&\377\377\377)\377\377\377)\377\377\377#\377\377\377\35"
- "\377\377\377\34\377\377\377#\377\377\377+\377\377\3773\377\377\377-\377\377"
- "\377&\377\377\377\40\377\377\377\33\377\377\377\34\377\377\377\36\377\377"
- "\377\36\377\377\377\37\377\377\377\40\377\377\377\35\377\377\377\32\377\377"
- "\377\27\377\377\377\24\377\377\377\22\377\377\377\20\377\377\377\16\377\377"
- "\377\16\377\377\377\14\377\377\377\14\377\377\377\13\377\377\377\13\377\377"
- "\377\12\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377\10\377\377"
- "\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377"
- "\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0"
- "\0\0\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\1\377\377"
- "\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4"
- "\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5\377"
- "\377\377\5\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\10\377\377"
- "\377\11\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377\15\377\377"
- "\377\17\377\377\377\21\377\377\377\24\377\377\377\30\377\377\377\34\377\377"
- "\377!\377\377\377&\377\377\377%\377\377\377\40\377\377\377\32\377\377\377"
- "\24\377\377\377\17\377\377\377\12\377\377\377\13\377\377\377\15\377\377\377"
- "\16\377\377\377\17\377\377\377\17\377\377\377\20\377\377\377\21\377\377\377"
- "\23\377\377\377\31\377\377\377\37\377\377\377\"\377\377\377\25\377\377\377"
- "\12\377\377\377\6\377\377\377\14\377\377\377\23\377\377\377\30\377\377\377"
- "\32\377\377\377\34\377\377\377\36\377\377\377\40\377\377\377\"\377\377\377"
- "!\377\377\377!\377\377\377#\377\377\377&\377\377\377)\377\377\377$\377\377"
- "\377\36\377\377\377\31\377\377\377\35\377\377\377$\377\377\377+\377\377\377"
- "0\377\377\377)\377\377\377#\377\377\377\36\377\377\377\32\377\377\377\32"
- "\377\377\377\33\377\377\377\34\377\377\377\34\377\377\377\35\377\377\377"
- "\33\377\377\377\30\377\377\377\26\377\377\377\23\377\377\377\20\377\377\377"
- "\17\377\377\377\15\377\377\377\14\377\377\377\13\377\377\377\13\377\377\377"
- "\12\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377"
- "\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5"
- "\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5"
- "\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\10\377"
- "\377\377\11\377\377\377\11\377\377\377\12\377\377\377\14\377\377\377\16\377"
- "\377\377\21\377\377\377\23\377\377\377\27\377\377\377\33\377\377\377\36\377"
- "\377\377#\377\377\377!\377\377\377\35\377\377\377\27\377\377\377\22\377\377"
- "\377\15\377\377\377\12\377\377\377\12\377\377\377\13\377\377\377\14\377\377"
- "\377\16\377\377\377\16\377\377\377\17\377\377\377\20\377\377\377\21\377\377"
- "\377\25\377\377\377\32\377\377\377\40\377\377\377\33\377\377\377\20\377\377"
- "\377\10\377\377\377\7\377\377\377\15\377\377\377\24\377\377\377\27\377\377"
- "\377\31\377\377\377\33\377\377\377\35\377\377\377\37\377\377\377\40\377\377"
- "\377\40\377\377\377\40\377\377\377!\377\377\377$\377\377\377&\377\377\377"
- "$\377\377\377\37\377\377\377\32\377\377\377\30\377\377\377\37\377\377\377"
- "%\377\377\377+\377\377\377,\377\377\377&\377\377\377\40\377\377\377\33\377"
- "\377\377\27\377\377\377\27\377\377\377\31\377\377\377\31\377\377\377\31\377"
- "\377\377\32\377\377\377\31\377\377\377\26\377\377\377\24\377\377\377\22\377"
- "\377\377\20\377\377\377\16\377\377\377\15\377\377\377\13\377\377\377\13\377"
- "\377\377\12\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377\10\377"
- "\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
- "\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377"
- "\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377"
- "\5\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\10"
- "\377\377\377\11\377\377\377\12\377\377\377\13\377\377\377\15\377\377\377"
- "\20\377\377\377\22\377\377\377\25\377\377\377\31\377\377\377\34\377\377\377"
- "!\377\377\377\36\377\377\377\32\377\377\377\25\377\377\377\21\377\377\377"
- "\15\377\377\377\10\377\377\377\12\377\377\377\12\377\377\377\13\377\377\377"
- "\14\377\377\377\15\377\377\377\15\377\377\377\17\377\377\377\20\377\377\377"
- "\22\377\377\377\26\377\377\377\33\377\377\377!\377\377\377\26\377\377\377"
- "\15\377\377\377\6\377\377\377\10\377\377\377\15\377\377\377\24\377\377\377"
- "\26\377\377\377\30\377\377\377\31\377\377\377\33\377\377\377\35\377\377\377"
- "\37\377\377\377\37\377\377\377\36\377\377\377\37\377\377\377!\377\377\377"
- "$\377\377\377%\377\377\377\40\377\377\377\33\377\377\377\27\377\377\377\32"
- "\377\377\377\40\377\377\377&\377\377\377+\377\377\377'\377\377\377\"\377"
- "\377\377\34\377\377\377\30\377\377\377\25\377\377\377\25\377\377\377\27\377"
- "\377\377\27\377\377\377\27\377\377\377\30\377\377\377\27\377\377\377\25\377"
- "\377\377\23\377\377\377\21\377\377\377\17\377\377\377\15\377\377\377\14\377"
- "\377\377\12\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\10\377"
- "\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
- "\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5"
- "\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\10\377"
- "\377\377\10\377\377\377\11\377\377\377\13\377\377\377\15\377\377\377\17\377"
- "\377\377\21\377\377\377\24\377\377\377\27\377\377\377\33\377\377\377\36\377"
- "\377\377\32\377\377\377\27\377\377\377\24\377\377\377\17\377\377\377\13\377"
- "\377\377\10\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377\13\377"
- "\377\377\14\377\377\377\14\377\377\377\15\377\377\377\16\377\377\377\20\377"
- "\377\377\23\377\377\377\27\377\377\377\34\377\377\377\34\377\377\377\22\377"
- "\377\377\12\377\377\377\5\377\377\377\10\377\377\377\15\377\377\377\24\377"
- "\377\377\25\377\377\377\27\377\377\377\30\377\377\377\32\377\377\377\34\377"
- "\377\377\35\377\377\377\35\377\377\377\35\377\377\377\35\377\377\377\37\377"
- "\377\377!\377\377\377#\377\377\377\40\377\377\377\34\377\377\377\30\377\377"
- "\377\26\377\377\377\33\377\377\377\40\377\377\377%\377\377\377)\377\377\377"
- "#\377\377\377\37\377\377\377\32\377\377\377\26\377\377\377\23\377\377\377"
- "\24\377\377\377\25\377\377\377\25\377\377\377\26\377\377\377\26\377\377\377"
- "\25\377\377\377\23\377\377\377\21\377\377\377\17\377\377\377\16\377\377\377"
- "\14\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377"
- "\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\6"
- "\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4"
- "\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\10\377"
- "\377\377\11\377\377\377\12\377\377\377\14\377\377\377\16\377\377\377\20\377"
- "\377\377\23\377\377\377\26\377\377\377\31\377\377\377\33\377\377\377\27\377"
- "\377\377\24\377\377\377\21\377\377\377\16\377\377\377\13\377\377\377\10\377"
- "\377\377\10\377\377\377\10\377\377\377\11\377\377\377\11\377\377\377\12\377"
- "\377\377\14\377\377\377\14\377\377\377\15\377\377\377\16\377\377\377\20\377"
- "\377\377\23\377\377\377\30\377\377\377\35\377\377\377\27\377\377\377\17\377"
- "\377\377\10\377\377\377\5\377\377\377\11\377\377\377\16\377\377\377\23\377"
- "\377\377\25\377\377\377\26\377\377\377\27\377\377\377\31\377\377\377\33\377"
- "\377\377\34\377\377\377\34\377\377\377\34\377\377\377\34\377\377\377\35\377"
- "\377\377\37\377\377\377!\377\377\377!\377\377\377\35\377\377\377\31\377\377"
- "\377\25\377\377\377\26\377\377\377\33\377\377\377\37\377\377\377$\377\377"
- "\377$\377\377\377\40\377\377\377\33\377\377\377\30\377\377\377\24\377\377"
- "\377\22\377\377\377\23\377\377\377\23\377\377\377\24\377\377\377\23\377\377"
- "\377\23\377\377\377\24\377\377\377\22\377\377\377\20\377\377\377\17\377\377"
- "\377\15\377\377\377\14\377\377\377\12\377\377\377\11\377\377\377\10\377\377"
- "\377\7\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377"
- "\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4"
- "\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377"
- "\377\377\5\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\10\377\377"
- "\377\11\377\377\377\13\377\377\377\15\377\377\377\17\377\377\377\21\377\377"
- "\377\24\377\377\377\27\377\377\377\30\377\377\377\26\377\377\377\23\377\377"
- "\377\20\377\377\377\15\377\377\377\12\377\377\377\7\377\377\377\7\377\377"
- "\377\10\377\377\377\10\377\377\377\11\377\377\377\11\377\377\377\12\377\377"
- "\377\13\377\377\377\13\377\377\377\15\377\377\377\15\377\377\377\21\377\377"
- "\377\24\377\377\377\30\377\377\377\33\377\377\377\23\377\377\377\14\377\377"
- "\377\6\377\377\377\6\377\377\377\11\377\377\377\16\377\377\377\23\377\377"
- "\377\24\377\377\377\25\377\377\377\26\377\377\377\30\377\377\377\31\377\377"
- "\377\33\377\377\377\33\377\377\377\33\377\377\377\33\377\377\377\34\377\377"
- "\377\35\377\377\377\37\377\377\377!\377\377\377\35\377\377\377\31\377\377"
- "\377\25\377\377\377\23\377\377\377\27\377\377\377\33\377\377\377\36\377\377"
- "\377\"\377\377\377!\377\377\377\34\377\377\377\31\377\377\377\25\377\377"
- "\377\22\377\377\377\21\377\377\377\21\377\377\377\22\377\377\377\22\377\377"
- "\377\21\377\377\377\22\377\377\377\22\377\377\377\21\377\377\377\17\377\377"
- "\377\15\377\377\377\14\377\377\377\12\377\377\377\12\377\377\377\11\377\377"
- "\377\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377"
- "\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377"
- "\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5"
- "\377\377\377\5\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\13"
- "\377\377\377\14\377\377\377\16\377\377\377\20\377\377\377\22\377\377\377"
- "\25\377\377\377\25\377\377\377\23\377\377\377\20\377\377\377\16\377\377\377"
- "\14\377\377\377\11\377\377\377\7\377\377\377\6\377\377\377\7\377\377\377"
- "\10\377\377\377\10\377\377\377\11\377\377\377\11\377\377\377\12\377\377\377"
- "\12\377\377\377\13\377\377\377\14\377\377\377\15\377\377\377\21\377\377\377"
- "\24\377\377\377\30\377\377\377\27\377\377\377\17\377\377\377\10\377\377\377"
- "\3\377\377\377\6\377\377\377\12\377\377\377\16\377\377\377\22\377\377\377"
- "\23\377\377\377\24\377\377\377\26\377\377\377\27\377\377\377\30\377\377\377"
- "\32\377\377\377\32\377\377\377\32\377\377\377\32\377\377\377\32\377\377\377"
- "\34\377\377\377\35\377\377\377\36\377\377\377\35\377\377\377\31\377\377\377"
- "\26\377\377\377\22\377\377\377\23\377\377\377\27\377\377\377\32\377\377\377"
- "\36\377\377\377!\377\377\377\35\377\377\377\31\377\377\377\26\377\377\377"
- "\23\377\377\377\20\377\377\377\17\377\377\377\20\377\377\377\20\377\377\377"
- "\20\377\377\377\20\377\377\377\20\377\377\377\20\377\377\377\17\377\377\377"
- "\15\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377\11\377\377\377"
- "\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5"
- "\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377"
- "\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3"
- "\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377"
- "\377\377\6\377\377\377\7\377\377\377\11\377\377\377\12\377\377\377\13\377"
- "\377\377\15\377\377\377\17\377\377\377\21\377\377\377\24\377\377\377\23\377"
- "\377\377\21\377\377\377\17\377\377\377\15\377\377\377\12\377\377\377\11\377"
- "\377\377\6\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\7\377\377"
- "\377\10\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377\12\377\377"
- "\377\13\377\377\377\14\377\377\377\16\377\377\377\21\377\377\377\25\377\377"
- "\377\31\377\377\377\22\377\377\377\14\377\377\377\7\377\377\377\3\377\377"
- "\377\6\377\377\377\11\377\377\377\15\377\377\377\20\377\377\377\22\377\377"
- "\377\24\377\377\377\25\377\377\377\26\377\377\377\27\377\377\377\30\377\377"
- "\377\30\377\377\377\30\377\377\377\30\377\377\377\30\377\377\377\31\377\377"
- "\377\33\377\377\377\33\377\377\377\34\377\377\377\31\377\377\377\25\377\377"
- "\377\23\377\377\377\20\377\377\377\23\377\377\377\27\377\377\377\32\377\377"
- "\377\35\377\377\377\36\377\377\377\32\377\377\377\26\377\377\377\23\377\377"
- "\377\21\377\377\377\17\377\377\377\16\377\377\377\16\377\377\377\16\377\377"
- "\377\17\377\377\377\17\377\377\377\17\377\377\377\17\377\377\377\16\377\377"
- "\377\15\377\377\377\14\377\377\377\12\377\377\377\11\377\377\377\10\377\377"
- "\377\7\377\377\377\7\377\377\377\6\377\377\377\5\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377"
- "\4\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10"
- "\377\377\377\11\377\377\377\13\377\377\377\14\377\377\377\16\377\377\377"
- "\20\377\377\377\22\377\377\377\21\377\377\377\17\377\377\377\15\377\377\377"
- "\13\377\377\377\12\377\377\377\10\377\377\377\6\377\377\377\5\377\377\377"
- "\5\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\10"
- "\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377\13\377\377\377"
- "\14\377\377\377\16\377\377\377\21\377\377\377\24\377\377\377\25\377\377\377"
- "\17\377\377\377\12\377\377\377\5\377\377\377\3\377\377\377\6\377\377\377"
- "\11\377\377\377\16\377\377\377\20\377\377\377\21\377\377\377\22\377\377\377"
- "\23\377\377\377\24\377\377\377\25\377\377\377\27\377\377\377\27\377\377\377"
- "\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377\30\377\377\377"
- "\32\377\377\377\32\377\377\377\30\377\377\377\25\377\377\377\22\377\377\377"
- "\20\377\377\377\20\377\377\377\23\377\377\377\26\377\377\377\31\377\377\377"
- "\34\377\377\377\33\377\377\377\27\377\377\377\25\377\377\377\22\377\377\377"
- "\17\377\377\377\15\377\377\377\15\377\377\377\15\377\377\377\15\377\377\377"
- "\15\377\377\377\16\377\377\377\15\377\377\377\15\377\377\377\15\377\377\377"
- "\14\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377"
- "\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4"
- "\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4"
- "\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\11"
- "\377\377\377\13\377\377\377\15\377\377\377\17\377\377\377\20\377\377\377"
- "\17\377\377\377\16\377\377\377\14\377\377\377\13\377\377\377\11\377\377\377"
- "\7\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6"
- "\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\10\377\377\377\10"
- "\377\377\377\11\377\377\377\11\377\377\377\12\377\377\377\14\377\377\377"
- "\17\377\377\377\22\377\377\377\24\377\377\377\22\377\377\377\14\377\377\377"
- "\10\377\377\377\4\377\377\377\4\377\377\377\6\377\377\377\12\377\377\377"
- "\16\377\377\377\17\377\377\377\20\377\377\377\21\377\377\377\21\377\377\377"
- "\22\377\377\377\24\377\377\377\25\377\377\377\25\377\377\377\25\377\377\377"
- "\25\377\377\377\25\377\377\377\26\377\377\377\27\377\377\377\30\377\377\377"
- "\31\377\377\377\30\377\377\377\25\377\377\377\23\377\377\377\20\377\377\377"
- "\16\377\377\377\20\377\377\377\23\377\377\377\26\377\377\377\30\377\377\377"
- "\32\377\377\377\30\377\377\377\25\377\377\377\22\377\377\377\20\377\377\377"
- "\16\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377"
- "\14\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377"
- "\13\377\377\377\12\377\377\377\11\377\377\377\7\377\377\377\7\377\377\377"
- "\6\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\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"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2"
- "\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377"
- "\377\377\6\377\377\377\7\377\377\377\10\377\377\377\12\377\377\377\14\377"
- "\377\377\15\377\377\377\16\377\377\377\15\377\377\377\14\377\377\377\13\377"
- "\377\377\11\377\377\377\10\377\377\377\7\377\377\377\5\377\377\377\4\377"
- "\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
- "\377\7\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\10\377\377"
- "\377\11\377\377\377\13\377\377\377\15\377\377\377\17\377\377\377\21\377\377"
- "\377\24\377\377\377\17\377\377\377\12\377\377\377\6\377\377\377\3\377\377"
- "\377\4\377\377\377\7\377\377\377\11\377\377\377\15\377\377\377\16\377\377"
- "\377\17\377\377\377\20\377\377\377\21\377\377\377\22\377\377\377\23\377\377"
- "\377\24\377\377\377\25\377\377\377\25\377\377\377\24\377\377\377\23\377\377"
- "\377\24\377\377\377\25\377\377\377\26\377\377\377\26\377\377\377\30\377\377"
- "\377\25\377\377\377\22\377\377\377\20\377\377\377\16\377\377\377\16\377\377"
- "\377\20\377\377\377\23\377\377\377\25\377\377\377\26\377\377\377\30\377\377"
- "\377\26\377\377\377\23\377\377\377\21\377\377\377\17\377\377\377\14\377\377"
- "\377\13\377\377\377\13\377\377\377\13\377\377\377\13\377\377\377\13\377\377"
- "\377\13\377\377\377\13\377\377\377\13\377\377\377\13\377\377\377\12\377\377"
- "\377\10\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377\5\377\377"
- "\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1"
- "\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377"
- "\377\377\4\377\377\377\5\377\377\377\5\377\377\377\7\377\377\377\10\377\377"
- "\377\11\377\377\377\12\377\377\377\14\377\377\377\14\377\377\377\13\377\377"
- "\377\12\377\377\377\11\377\377\377\10\377\377\377\7\377\377\377\6\377\377"
- "\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377"
- "\5\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\10"
- "\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377\13\377\377\377"
- "\15\377\377\377\17\377\377\377\22\377\377\377\21\377\377\377\14\377\377\377"
- "\10\377\377\377\5\377\377\377\2\377\377\377\4\377\377\377\6\377\377\377\11"
- "\377\377\377\15\377\377\377\16\377\377\377\16\377\377\377\17\377\377\377"
- "\20\377\377\377\21\377\377\377\21\377\377\377\22\377\377\377\23\377\377\377"
- "\23\377\377\377\23\377\377\377\23\377\377\377\23\377\377\377\24\377\377\377"
- "\24\377\377\377\25\377\377\377\26\377\377\377\24\377\377\377\22\377\377\377"
- "\20\377\377\377\16\377\377\377\14\377\377\377\16\377\377\377\20\377\377\377"
- "\22\377\377\377\24\377\377\377\25\377\377\377\26\377\377\377\23\377\377\377"
- "\21\377\377\377\17\377\377\377\15\377\377\377\13\377\377\377\12\377\377\377"
- "\12\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377"
- "\12\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377"
- "\7\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4"
- "\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377"
- "\2\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\5\377\377\377\6"
- "\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377\13"
- "\377\377\377\12\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377"
- "\6\377\377\377\5\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\4"
- "\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377"
- "\377\377\6\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\10\377\377"
- "\377\11\377\377\377\13\377\377\377\15\377\377\377\17\377\377\377\21\377\377"
- "\377\16\377\377\377\12\377\377\377\7\377\377\377\4\377\377\377\3\377\377"
- "\377\5\377\377\377\6\377\377\377\11\377\377\377\14\377\377\377\15\377\377"
- "\377\15\377\377\377\16\377\377\377\17\377\377\377\17\377\377\377\20\377\377"
- "\377\21\377\377\377\22\377\377\377\22\377\377\377\22\377\377\377\21\377\377"
- "\377\21\377\377\377\22\377\377\377\23\377\377\377\24\377\377\377\24\377\377"
- "\377\24\377\377\377\22\377\377\377\17\377\377\377\16\377\377\377\14\377\377"
- "\377\14\377\377\377\16\377\377\377\20\377\377\377\21\377\377\377\23\377\377"
- "\377\24\377\377\377\23\377\377\377\21\377\377\377\17\377\377\377\15\377\377"
- "\377\14\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377\11\377\377"
- "\377\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377"
- "\377\10\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377"
- "\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377"
- "\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4"
- "\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\11"
- "\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377\7\377\377\377\7"
- "\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5\377\377"
- "\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377"
- "\7\377\377\377\7\377\377\377\11\377\377\377\13\377\377\377\15\377\377\377"
- "\17\377\377\377\20\377\377\377\14\377\377\377\10\377\377\377\5\377\377\377"
- "\3\377\377\377\3\377\377\377\4\377\377\377\6\377\377\377\11\377\377\377\13"
- "\377\377\377\14\377\377\377\14\377\377\377\15\377\377\377\16\377\377\377"
- "\17\377\377\377\20\377\377\377\20\377\377\377\20\377\377\377\21\377\377\377"
- "\21\377\377\377\20\377\377\377\20\377\377\377\21\377\377\377\21\377\377\377"
- "\22\377\377\377\23\377\377\377\23\377\377\377\22\377\377\377\20\377\377\377"
- "\16\377\377\377\14\377\377\377\13\377\377\377\14\377\377\377\15\377\377\377"
- "\17\377\377\377\21\377\377\377\22\377\377\377\23\377\377\377\22\377\377\377"
- "\17\377\377\377\16\377\377\377\14\377\377\377\13\377\377\377\11\377\377\377"
- "\10\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377"
- "\10\377\377\377\10\377\377\377\7\377\377\377\10\377\377\377\7\377\377\377"
- "\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377"
- "\3\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10"
- "\377\377\377\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377"
- "\377\377\5\377\377\377\4\377\377\377\4\377\377\377\2\377\377\377\3\377\377"
- "\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6"
- "\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\13\377\377\377\15"
- "\377\377\377\17\377\377\377\15\377\377\377\12\377\377\377\7\377\377\377\4"
- "\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\7\377\377\377\10\377"
- "\377\377\13\377\377\377\13\377\377\377\14\377\377\377\15\377\377\377\15\377"
- "\377\377\15\377\377\377\16\377\377\377\17\377\377\377\20\377\377\377\20\377"
- "\377\377\20\377\377\377\20\377\377\377\20\377\377\377\17\377\377\377\20\377"
- "\377\377\21\377\377\377\21\377\377\377\22\377\377\377\21\377\377\377\17\377"
- "\377\377\16\377\377\377\14\377\377\377\12\377\377\377\12\377\377\377\13\377"
- "\377\377\15\377\377\377\16\377\377\377\20\377\377\377\21\377\377\377\22\377"
- "\377\377\17\377\377\377\16\377\377\377\14\377\377\377\13\377\377\377\11\377"
- "\377\377\10\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377"
- "\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377"
- "\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377"
- "\3\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\7"
- "\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\4\377"
- "\377\377\4\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\3\377\377"
- "\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6"
- "\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\13\377\377\377\15"
- "\377\377\377\17\377\377\377\13\377\377\377\10\377\377\377\5\377\377\377\3"
- "\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\6\377\377\377\11\377"
- "\377\377\12\377\377\377\13\377\377\377\13\377\377\377\13\377\377\377\14\377"
- "\377\377\15\377\377\377\16\377\377\377\16\377\377\377\16\377\377\377\16\377"
- "\377\377\16\377\377\377\16\377\377\377\16\377\377\377\16\377\377\377\17\377"
- "\377\377\17\377\377\377\20\377\377\377\21\377\377\377\21\377\377\377\17\377"
- "\377\377\15\377\377\377\14\377\377\377\13\377\377\377\11\377\377\377\12\377"
- "\377\377\13\377\377\377\14\377\377\377\16\377\377\377\17\377\377\377\20\377"
- "\377\377\17\377\377\377\16\377\377\377\14\377\377\377\13\377\377\377\11\377"
- "\377\377\10\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\7\377\377"
- "\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377"
- "\5\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\3\377\377\377\3"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377"
- "\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\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\1"
- "\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377"
- "\377\377\4\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\5\377\377"
- "\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377"
- "\3\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377"
- "\377\6\377\377\377\10\377\377\377\11\377\377\377\13\377\377\377\14\377\377"
- "\377\15\377\377\377\11\377\377\377\7\377\377\377\5\377\377\377\2\377\377"
- "\377\2\377\377\377\3\377\377\377\5\377\377\377\6\377\377\377\11\377\377\377"
- "\11\377\377\377\12\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377"
- "\14\377\377\377\15\377\377\377\15\377\377\377\16\377\377\377\16\377\377\377"
- "\16\377\377\377\16\377\377\377\16\377\377\377\16\377\377\377\16\377\377\377"
- "\16\377\377\377\17\377\377\377\17\377\377\377\20\377\377\377\17\377\377\377"
- "\15\377\377\377\14\377\377\377\12\377\377\377\11\377\377\377\11\377\377\377"
- "\12\377\377\377\13\377\377\377\14\377\377\377\15\377\377\377\16\377\377\377"
- "\17\377\377\377\16\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377"
- "\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6"
- "\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377"
- "\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377"
- "\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\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\1\377"
- "\377\377\1\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377"
- "\10\377\377\377\11\377\377\377\13\377\377\377\14\377\377\377\12\377\377\377"
- "\10\377\377\377\6\377\377\377\4\377\377\377\2\377\377\377\2\377\377\377\3"
- "\377\377\377\5\377\377\377\6\377\377\377\10\377\377\377\11\377\377\377\11"
- "\377\377\377\12\377\377\377\13\377\377\377\13\377\377\377\13\377\377\377"
- "\14\377\377\377\14\377\377\377\15\377\377\377\15\377\377\377\15\377\377\377"
- "\15\377\377\377\15\377\377\377\14\377\377\377\15\377\377\377\15\377\377\377"
- "\16\377\377\377\16\377\377\377\17\377\377\377\16\377\377\377\15\377\377\377"
- "\13\377\377\377\13\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377"
- "\12\377\377\377\13\377\377\377\14\377\377\377\14\377\377\377\15\377\377\377"
- "\16\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377\10\377\377\377"
- "\7\377\377\377\7\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5"
- "\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\4\377"
- "\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\2\377\377"
- "\377\2\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377"
- "\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377"
- "\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\2\377\377\377\2\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\5\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377"
- "\11\377\377\377\13\377\377\377\13\377\377\377\11\377\377\377\7\377\377\377"
- "\5\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\4"
- "\377\377\377\6\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377\11"
- "\377\377\377\11\377\377\377\12\377\377\377\12\377\377\377\13\377\377\377"
- "\14\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377"
- "\14\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377"
- "\15\377\377\377\15\377\377\377\16\377\377\377\14\377\377\377\13\377\377\377"
- "\12\377\377\377\11\377\377\377\10\377\377\377\7\377\377\377\10\377\377\377"
- "\11\377\377\377\12\377\377\377\13\377\377\377\14\377\377\377\14\377\377\377"
- "\14\377\377\377\13\377\377\377\11\377\377\377\11\377\377\377\7\377\377\377"
- "\7\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4"
- "\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377"
- "\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377"
- "\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377"
- "\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5"
- "\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\11\377\377\377\12"
- "\377\377\377\12\377\377\377\10\377\377\377\6\377\377\377\4\377\377\377\2"
- "\377\377\377\1\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\6\377"
- "\377\377\10\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\11\377"
- "\377\377\11\377\377\377\12\377\377\377\13\377\377\377\13\377\377\377\13\377"
- "\377\377\13\377\377\377\13\377\377\377\13\377\377\377\13\377\377\377\13\377"
- "\377\377\13\377\377\377\13\377\377\377\14\377\377\377\14\377\377\377\14\377"
- "\377\377\15\377\377\377\14\377\377\377\13\377\377\377\12\377\377\377\11\377"
- "\377\377\10\377\377\377\7\377\377\377\7\377\377\377\10\377\377\377\11\377"
- "\377\377\11\377\377\377\12\377\377\377\13\377\377\377\13\377\377\377\13\377"
- "\377\377\11\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377\6\377"
- "\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377"
- "\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\6\377\377\377"
- "\7\377\377\377\10\377\377\377\11\377\377\377\12\377\377\377\10\377\377\377"
- "\6\377\377\377\4\377\377\377\3\377\377\377\1\377\377\377\1\377\377\377\2"
- "\377\377\377\3\377\377\377\4\377\377\377\5\377\377\377\7\377\377\377\7\377"
- "\377\377\7\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377\12\377"
- "\377\377\12\377\377\377\12\377\377\377\12\377\377\377\13\377\377\377\13\377"
- "\377\377\13\377\377\377\13\377\377\377\12\377\377\377\12\377\377\377\12\377"
- "\377\377\13\377\377\377\13\377\377\377\14\377\377\377\14\377\377\377\14\377"
- "\377\377\13\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377\7\377"
- "\377\377\6\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\11\377"
- "\377\377\11\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377\10\377"
- "\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\4\377\377"
- "\377\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\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\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377"
- "\377\377\5\377\377\377\6\377\377\377\6\377\377\377\10\377\377\377\11\377"
- "\377\377\11\377\377\377\7\377\377\377\5\377\377\377\4\377\377\377\2\377\377"
- "\377\1\377\377\377\1\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377"
- "\5\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\10\377\377\377\10"
- "\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377"
- "\12\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377\11\377\377\377"
- "\11\377\377\377\11\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377"
- "\13\377\377\377\13\377\377\377\13\377\377\377\12\377\377\377\12\377\377\377"
- "\10\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377"
- "\6\377\377\377\7\377\377\377\10\377\377\377\10\377\377\377\11\377\377\377"
- "\11\377\377\377\11\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377"
- "\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\7"
- "\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377\4\377\377\377\3\377"
- "\377\377\2\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\3\377\377"
- "\377\4\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377"
- "\7\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377"
- "\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377"
- "\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377"
- "\11\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377\12\377\377\377"
- "\11\377\377\377\10\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377"
- "\5\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\10"
- "\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\6"
- "\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\3\377\377\377\3\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\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"
- "\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\5\377\377"
- "\377\6\377\377\377\6\377\377\377\7\377\377\377\10\377\377\377\6\377\377\377"
- "\5\377\377\377\4\377\377\377\3\377\377\377\2\377\377\377\1\377\377\377\1"
- "\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\5\377\377\377\6\377"
- "\377\377\6\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377"
- "\377\10\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\11\377\377"
- "\377\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377\377\11\377\377"
- "\377\10\377\377\377\10\377\377\377\11\377\377\377\11\377\377\377\11\377\377"
- "\377\11\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377\7\377\377"
- "\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377"
- "\6\377\377\377\6\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\10"
- "\377\377\377\7\377\377\377\6\377\377\377\5\377\377\377\4\377\377\377\4\377"
- "\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\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\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377"
- "\5\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\5"
- "\377\377\377\4\377\377\377\3\377\377\377\2\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\5\377\377"
- "\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377"
- "\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\10\377\377\377\10"
- "\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377"
- "\10\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377"
- "\11\377\377\377\11\377\377\377\11\377\377\377\10\377\377\377\10\377\377\377"
- "\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4"
- "\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6\377"
- "\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\4\377\377"
- "\377\4\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\4\377"
- "\377\377\4\377\377\377\5\377\377\377\6\377\377\377\7\377\377\377\6\377\377"
- "\377\5\377\377\377\3\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\5"
- "\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377"
- "\377\377\6\377\377\377\7\377\377\377\6\377\377\377\7\377\377\377\7\377\377"
- "\377\10\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377"
- "\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\10"
- "\377\377\377\10\377\377\377\10\377\377\377\10\377\377\377\7\377\377\377\7"
- "\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377"
- "\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377"
- "\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\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\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377"
- "\5\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\4\377\377\377\3"
- "\377\377\377\2\377\377\377\1\0\0\0\0\377\377\377\1\377\377\377\1\377\377"
- "\377\2\377\377\377\2\377\377\377\3\377\377\377\4\377\377\377\5\377\377\377"
- "\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6"
- "\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377"
- "\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377"
- "\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377\7\377\377\377"
- "\7\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377\6\377\377\377\5"
- "\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\4\377\377\377\4\377"
- "\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377"
- "\377\5\377\377\377\5\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377"
- "\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377"
- "\377\377\3\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5\377\377"
- "\377\4\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\1\0\0\0\0\377"
- "\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377"
- "\5\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6"
- "\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377"
- "\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
- "\377\6\377\377\377\6\377\377\377\7\377\377\377\7\377\377\377\6\377\377\377"
- "\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377"
- "\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377"
- "\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\5\377"
- "\377\377\4\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\1\377\377"
- "\377\1\0\0\0\0\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\3\377"
- "\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5\377\377"
- "\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377"
- "\6\377\377\377\5\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6"
- "\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\5\377\377\377\5\377"
- "\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
- "\377\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377"
- "\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\1\377\377"
- "\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\3\377\377\377\3\377\377\377\2\377\377\377\1\377\377\377\1\0\0\0"
- "\0\0\0\0\0\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377"
- "\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\5\377\377\377\5\377\377\377\5"
- "\377\377\377\5\377\377\377\5\377\377\377\6\377\377\377\5\377\377\377\5\377"
- "\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377"
- "\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377"
- "\6\377\377\377\5\377\377\377\5\377\377\377\4\377\377\377\4\377\377\377\3"
- "\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377"
- "\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377"
- "\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377\4\377\377\377\3\377"
- "\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\3\377\377"
- "\377\3\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5"
- "\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377"
- "\377\377\5\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\5\377\377"
- "\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377\5\377\377\377"
- "\5\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377"
- "\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\3\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4"
- "\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377"
- "\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0"
- "\0\0\0\0\0\0\0\0\0\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4"
- "\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377"
- "\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\4\377\377"
- "\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377\4\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\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\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3"
- "\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\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\1\377\377\377\1\377\377\377\1\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\3\377\377\377\3\377\377\377\3\377"
- "\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377\377\3\377\377"
- "\377\3\377\377\377\3\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377"
- "\3\377\377\377\3\377\377\377\2\377\377\377\3\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\3\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\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\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0"
- "\0\0\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\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377"
- "\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377"
- "\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\2"
- "\377\377\377\2\377\377\377\2\377\377\377\2\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1"
- "\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\377\377\377\1\377\377\377\1\377\377\377\1\377"
- "\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377"
- "\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377\1\377\377\377"
- "\1\377\377\377\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\1\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
- "\1\377\377\377\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-};
=== modified file 'plugins/wizard/src/wizard.cpp'
--- plugins/wizard/src/wizard.cpp 2013-07-07 13:31:29 +0000
+++ plugins/wizard/src/wizard.cpp 2013-07-21 23:03:28 +0000
@@ -42,16 +42,19 @@
const unsigned short COLOR_COMPONENTS = CACHESIZE_FACTOR * 4;
static void
-initParticles (int hardLimit, int softLimit, ParticleSystem * ps)
+initParticles (int hardLimit,
+ int softLimit,
+ ParticleSystem *ps)
{
if (ps->particles)
free (ps->particles);
- ps->particles = (Particle*) calloc (hardLimit, sizeof (Particle));
- ps->tex = 0;
- ps->hardLimit = hardLimit;
- ps->softLimit = softLimit;
- ps->active = false;
- ps->lastCount = 0;
+
+ ps->particles = (Particle*) calloc (hardLimit, sizeof (Particle));
+ ps->tex = 0;
+ ps->hardLimit = hardLimit;
+ ps->softLimit = softLimit;
+ ps->active = false;
+ ps->lastCount = 0;
// Initialize cache
ps->vertices_cache.clear ();
@@ -60,8 +63,8 @@
ps->dcolors_cache.clear ();
Particle *part = ps->particles;
- int i;
- for (i = 0; i < hardLimit; i++, part++)
+
+ for (int i = 0; i < hardLimit; ++i, ++part)
part->t = 0.0f;
}
@@ -72,38 +75,44 @@
free (ps->g);
int i;
- GPoint *gi;
CompOption::Value::Vector cvv = optionGetGStrength ();
+
ps->ng = cvv.size ();
- ps->g = (GPoint*) calloc (ps->ng, sizeof (GPoint));
-
- gi = ps->g;
- for (i = 0; i < ps->ng; i++, gi++)
- gi->strength = (float)cvv.at (i).i ()/ 1000.;
+ ps->g = (GPoint*) calloc (ps->ng, sizeof (GPoint));
+
+ GPoint *gi = ps->g;
+
+ for (i = 0; i < ps->ng; ++i, ++gi)
+ gi->strength = (float)cvv.at (i).i () / 1000.;
cvv = optionGetGPosx ();
- gi = ps->g;
- for (i = 0; i < ps->ng; i++, gi++)
+ gi = ps->g;
+
+ for (i = 0; i < ps->ng; ++i, ++gi)
gi->x = (float)cvv.at (i).i ();
cvv = optionGetGPosy ();
- gi = ps->g;
- for (i = 0; i < ps->ng; i++, gi++)
+ gi = ps->g;
+
+ for (i = 0; i < ps->ng; ++i, ++gi)
gi->y = (float)cvv.at (i).i ();
cvv = optionGetGSpeed ();
- gi = ps->g;
- for (i = 0; i < ps->ng; i++, gi++)
- gi->espeed = (float)cvv.at (i).i () / 100.;
+ gi = ps->g;
+
+ for (i = 0; i < ps->ng; ++i, ++gi)
+ gi->espeed = (float)cvv.at (i).i () / 100.0;
cvv = optionGetGAngle ();
- gi = ps->g;
- for (i = 0; i < ps->ng; i++, gi++)
- gi->eangle = (float)cvv.at (i).i () / 180.*M_PI;
+ gi = ps->g;
+
+ for (i = 0; i < ps->ng; ++i, ++gi)
+ gi->eangle = (float)cvv.at (i).i () / 180.0 * M_PI;
cvv = optionGetGMovement ();
- gi = ps->g;
- for (i = 0; i < ps->ng; i++, gi++)
+ gi = ps->g;
+
+ for (i = 0; i < ps->ng; ++i, ++gi)
gi->movement = cvv.at (i).i ();
}
@@ -114,173 +123,204 @@
free (ps->e);
int i;
- Emitter *ei;
CompOption::Value::Vector cvv = optionGetEActive ();
- ps->ne = cvv.size ();
- ps->e = (Emitter*) calloc (ps->ne, sizeof (Emitter));
+ ps->ne = cvv.size ();
+ ps->e = (Emitter*) calloc (ps->ne, sizeof (Emitter));
+ Emitter *ei = ps->e;
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->set_active = ei->active = cvv.at (i).b ();
cvv = optionGetETrigger ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->trigger = cvv.at (i).i ();
cvv = optionGetEPosx ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->x = (float)cvv.at (i).i ();
cvv = optionGetEPosy ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->y = (float)cvv.at (i).i ();
cvv = optionGetESpeed ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->espeed = (float)cvv.at (i).i () / 100.;
cvv = optionGetEAngle ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->eangle = (float)cvv.at (i).i () / 180.*M_PI;
cvv = optionGetEMovement ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->movement = cvv.at (i).i ();
cvv = optionGetECount ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->count = (float)cvv.at (i).i ();
cvv = optionGetEH ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->h = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEDh ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->dh = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEL ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->l = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEDl ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->dl = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEA ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->a = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEDa ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->da = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEDx ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->dx = (float)cvv.at (i).i ();
cvv = optionGetEDy ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->dy = (float)cvv.at (i).i ();
cvv = optionGetEDcirc ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->dcirc = (float)cvv.at (i).i ();
cvv = optionGetEVx ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->vx = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEVy ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->vy = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEVt ();
ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->vt = (float)cvv.at (i).i () / 10000.;
cvv = optionGetEVphi ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->vphi = (float)cvv.at (i).i () / 10000.;
cvv = optionGetEDvx ();
ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->dvx = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEDvy ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->dvy = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEDvcirc ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->dvcirc = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEDvt ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->dvt = (float)cvv.at (i).i () / 10000.;
cvv = optionGetEDvphi ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->dvphi = (float)cvv.at (i).i () / 10000.;
cvv = optionGetES ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->s = (float)cvv.at (i).i ();
cvv = optionGetEDs ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->ds = (float)cvv.at (i).i ();
cvv = optionGetESnew ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->snew = (float)cvv.at (i).i ();
cvv = optionGetEDsnew ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->dsnew = (float)cvv.at (i).i ();
cvv = optionGetEG ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->g = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEDg ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->dg = (float)cvv.at (i).i () / 1000.;
cvv = optionGetEGp ();
- ei = ps->e;
- for (i = 0; i < ps->ne; i++, ei++)
+ ei = ps->e;
+
+ for (i = 0; i < ps->ne; ++i, ++ei)
ei->gp = (float)cvv.at (i).i () / 10000.;
}
@@ -304,33 +344,110 @@
if (ps->dcolors_cache.size () < (unsigned int)ps->hardLimit * COLOR_COMPONENTS)
ps->dcolors_cache.resize (ps->hardLimit * COLOR_COMPONENTS);
+<<<<<<< TREE
glEnable (GL_BLEND);
+=======
+ GLboolean glBlendEnabled = glIsEnabled (GL_BLEND);
+
+ if (!glBlendEnabled)
+ glEnable (GL_BLEND);
+
+>>>>>>> MERGE-SOURCE
if (ps->tex)
{
glBindTexture (GL_TEXTURE_2D, ps->tex);
glEnable (GL_TEXTURE_2D);
}
+<<<<<<< TREE
i = j = k = l = 0;
Particle *part = ps->particles;
int m;
for (m = 0; m < ps->hardLimit; m++, part++)
+=======
+
+ glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+ /* Check that the cache is big enough */
+ if (ps->hardLimit > ps->vertex_cache_count)
+ {
+ ps->vertices_cache =
+ (GLfloat*) realloc (ps->vertices_cache,
+ ps->hardLimit * 4 * 3 * sizeof (GLfloat));
+ ps->vertex_cache_count = ps->hardLimit;
+ }
+
+ if (ps->hardLimit > ps->coords_cache_count)
+ {
+ ps->coords_cache =
+ (GLfloat*) realloc (ps->coords_cache,
+ ps->hardLimit * 4 * 2 * sizeof (GLfloat));
+ ps->coords_cache_count = ps->hardLimit;
+ }
+
+ if (ps->hardLimit > ps->color_cache_count)
+ {
+ ps->colors_cache =
+ (GLfloat*) realloc (ps->colors_cache,
+ ps->hardLimit * 4 * 4 * sizeof (GLfloat));
+ ps->color_cache_count = ps->hardLimit;
+ }
+
+ if (ps->darken > 0)
+ {
+ if (ps->dcolors_cache_count < ps->hardLimit)
+ {
+ ps->dcolors_cache =
+ (GLfloat*) realloc (ps->dcolors_cache,
+ ps->hardLimit * 4 * 4 * sizeof (GLfloat));
+ ps->dcolors_cache_count = ps->hardLimit;
+ }
+ }
+
+ GLfloat *dcolors = ps->dcolors_cache;
+ GLfloat *vertices = ps->vertices_cache;
+ GLfloat *coords = ps->coords_cache;
+ GLfloat *colors = ps->colors_cache;
+
+ int cornersSize = sizeof (GLfloat) * 8;
+ int colorSize = sizeof (GLfloat) * 4;
+
+ GLfloat cornerCoords[8] =
+ {
+ 0.0, 0.0,
+ 0.0, 1.0,
+ 1.0, 1.0,
+ 1.0, 0.0
+ };
+
+ int numActive = 0;
+ float offA, offB, cOff;
+ Particle *part = ps->particles;
+
+ for (int i = 0; i < ps->hardLimit; ++i, ++part)
+>>>>>>> MERGE-SOURCE
{
if (part->t > 0.0f)
{
+<<<<<<< TREE
float cOff = part->s / 2.; //Corner offset from center
+=======
+ numActive += 4;
+
+ cOff = part->s / 2.0; //Corner offset from center
+>>>>>>> MERGE-SOURCE
if (part->t > ps->tnew) //New particles start larger
cOff += (part->snew - part->s) * (part->t - ps->tnew)
- / (1. - ps->tnew) / 2.;
+ / (1.0 - ps->tnew) / 2.0;
else if (part->t < ps->told) //Old particles shrink
- cOff -= part->s * (ps->told - part->t) / ps->told / 2.;
+ cOff -= part->s * (ps->told - part->t) / ps->told / 2.0;
//Offsets after rotation of Texture
- float offA = cOff * (cos (part->phi) - sin (part->phi));
- float offB = cOff * (cos (part->phi) + sin (part->phi));
+ offA = cOff * (cos (part->phi) - sin (part->phi));
+ offB = cOff * (cos (part->phi) + sin (part->phi));
GLushort r, g, b, a, dark_a;
@@ -339,8 +456,13 @@
b = part->c[2] * 65535.0f;
if (part->t > ps->tnew) //New particles start at a == 1
+<<<<<<< TREE
a = part->a + (1. - part->a) * (part->t - ps->tnew)
/ (1. - ps->tnew) * 65535.0f;
+=======
+ colors[3] = part->a + (1.0 - part->a) * (part->t - ps->tnew)
+ / (1.0 - ps->tnew);
+>>>>>>> MERGE-SOURCE
else if (part->t < ps->told) //Old particles fade to a = 0
a = part->a * part->t / ps->told * 65535.0f;
else //The others have their own a
@@ -467,9 +589,21 @@
}
}
}
+<<<<<<< TREE
GLVertexBuffer *stream = GLVertexBuffer::streamingBuffer ();
+=======
+
+ glEnableClientState (GL_VERTEX_ARRAY);
+ glEnableClientState (GL_TEXTURE_COORD_ARRAY);
+ glEnableClientState (GL_COLOR_ARRAY);
+
+ glTexCoordPointer (2, GL_FLOAT, 2 * sizeof (GLfloat), ps->coords_cache);
+ glVertexPointer (3, GL_FLOAT, 3 * sizeof (GLfloat), ps->vertices_cache);
+
+ // darken the background
+>>>>>>> MERGE-SOURCE
if (ps->darken > 0)
{
glBlendFunc (GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
@@ -481,8 +615,13 @@
if (stream->end ())
stream->render (transform);
}
+<<<<<<< TREE
/* draw particles */
+=======
+
+ // draw particles
+>>>>>>> MERGE-SOURCE
glBlendFunc (GL_SRC_ALPHA, ps->blendMode);
stream->begin (GL_TRIANGLES);
@@ -496,20 +635,30 @@
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glDisable (GL_TEXTURE_2D);
glDisable (GL_BLEND);
+
+ glDisableClientState (GL_COLOR_ARRAY);
+ glDisableClientState (GL_TEXTURE_COORD_ARRAY);
+ glDisableClientState (GL_VERTEX_ARRAY);
+
+ glPopMatrix ();
+ glColor4usv (defaultColor);
+ gScreen->setTexEnvMode (GL_REPLACE);
+ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
}
static void
-updateParticles (ParticleSystem * ps, float time)
+updateParticles (ParticleSystem *ps,
+ float time)
{
- int i, j;
- int newCount = 0;
- Particle *part;
- GPoint *gi;
- float gdist, gangle;
+ int i, j;
+ int newCount = 0;
+ Particle *part = ps->particles;
+ GPoint *gi;
+ float gdist, gangle;
+
ps->active = false;
- part = ps->particles;
- for (i = 0; i < ps->hardLimit; i++, part++)
+ for (i = 0; i < ps->hardLimit; ++i, ++part)
{
if (part->t > 0.0f)
{
@@ -533,12 +682,14 @@
//GPoint gravity
gi = ps->g;
- for (j = 0; j < ps->ng; j++, gi++)
+
+ for (j = 0; j < ps->ng; ++j, ++gi)
{
if (gi->strength != 0)
{
- gdist = sqrt ((part->x-gi->x)*(part->x-gi->x)
- + (part->y-gi->y)*(part->y-gi->y));
+ gdist = sqrt ((part->x - gi->x) * (part->x - gi->x) +
+ (part->y - gi->y) * (part->y - gi->y));
+
if (gdist > 1)
{
gangle = atan2 (gi->y-part->y, gi->x-part->x);
@@ -549,7 +700,7 @@
}
ps->active = true;
- newCount++;
+ ++newCount;
}
}
ps->lastCount = newCount;
@@ -557,22 +708,25 @@
//Particle gravity
Particle *gpart;
part = ps->particles;
- for (i = 0; i < ps->hardLimit; i++, part++)
+
+ for (i = 0; i < ps->hardLimit; ++i, ++part)
{
if (part->t > 0.0f && part->g != 0)
{
gpart = ps->particles;
- for (j = 0; j < ps->hardLimit; j++, gpart++)
+
+ for (j = 0; j < ps->hardLimit; ++j, ++gpart)
{
if (gpart->t > 0.0f)
{
- gdist = sqrt ((part->x-gpart->x)*(part->x-gpart->x)
- + (part->y-gpart->y)*(part->y-gpart->y));
+ gdist = sqrt ((part->x - gpart->x) * (part->x - gpart->x) +
+ (part->y - gpart->y) * (part->y - gpart->y));
+
if (gdist > 1)
{
- gangle = atan2 (part->y-gpart->y, part->x-gpart->x);
- gpart->vx += part->g/gdist* cos (gangle) * part->t*time;
- gpart->vy += part->g/gdist* sin (gangle) * part->t*time;
+ gangle = atan2 (part->y - gpart->y, part->x - gpart->x);
+ gpart->vx += part->g / gdist * cos (gangle) * part->t * time;
+ gpart->vy += part->g / gdist * sin (gangle) * part->t * time;
}
}
}
@@ -581,34 +735,50 @@
}
static void
-finiParticles (ParticleSystem * ps)
+finiParticles (ParticleSystem *ps)
{
free (ps->e);
free (ps->particles);
+
if (ps->tex)
glDeleteTextures (1, &ps->tex);
+<<<<<<< TREE
+=======
+ if (ps->vertices_cache)
+ free (ps->vertices_cache);
+
+ if (ps->colors_cache)
+ free (ps->colors_cache);
+
+ if (ps->coords_cache)
+ free (ps->coords_cache);
+
+ if (ps->dcolors_cache)
+ free (ps->dcolors_cache);
+>>>>>>> MERGE-SOURCE
}
static void
-genNewParticles (ParticleSystem *ps, Emitter *e)
+genNewParticles (ParticleSystem *ps,
+ Emitter *e)
{
-
float q, p, t = 0, h, l;
int count = e->count;
Particle *part = ps->particles;
- int i, j;
+ int j;
- for (i = 0; i < ps->hardLimit && count > 0; i++, part++)
+ for (int i = 0; i < ps->hardLimit && count > 0; ++i, ++part)
{
if (part->t <= 0.0f)
{
//Position
part->x = rRange (e->x, e->dx); // X Position
part->y = rRange (e->y, e->dy); // Y Position
- if ((q = rRange (e->dcirc/2.,e->dcirc/2.)) > 0)
+
+ if ((q = rRange (e->dcirc / 2.0, e->dcirc / 2.0)) > 0)
{
p = rRange (0, M_PI);
part->x += q * cos (p);
@@ -618,70 +788,84 @@
//Speed
part->vx = rRange (e->vx, e->dvx); // X Speed
part->vy = rRange (e->vy, e->dvy); // Y Speed
- if ((q = rRange (e->dvcirc/2.,e->dvcirc/2.)) > 0)
+
+ if ((q = rRange (e->dvcirc / 2.0, e->dvcirc / 2.0)) > 0)
{
p = rRange (0, M_PI);
part->vx += q * cos (p);
part->vy += q * sin (p);
}
part->vt = rRange (e->vt, e->dvt); // Aging speed
+
if (part->vt > -0.0001)
part->vt = -0.0001;
//Size, Gravity and Rotation
- part->s = rRange (e->s, e->ds); // Particle size
+ part->s = rRange (e->s, e->ds); // Particle size
part->snew = rRange (e->snew, e->dsnew); // Particle start size
- if (e->gp > (float)(random () & 0xffff) / 65535.)
+
+ if (e->gp > (float)(random () & 0xffff) / 65535.0)
part->g = rRange (e->g, e->dg); // Particle gravity
else
- part->g = 0.;
- part->phi = rRange (0, M_PI); // Random orientation
+ part->g = 0.0;
+
+ part->phi = rRange (0, M_PI); // Random orientation
part->vphi = rRange (e->vphi, e->dvphi); // Rotation speed
//Alpha
part->a = rRange (e->a, e->da); // Alpha
+
if (part->a > 1)
- part->a = 1.;
+ part->a = 1.0;
else if (part->a < 0)
- part->a = 0.;
+ part->a = 0.0;
//HSL to RGB conversion from Wikipedia simplified by S = 1
h = rRange (e->h, e->dh); //Random hue within range
+
if (h < 0)
- h += 1.;
+ h += 1.0;
else if (t > 1)
- h -= 1.;
+ h -= 1.0;
+
l = rRange (e->l, e->dl); //Random lightness ...
+
if (l > 1)
- l = 1.;
+ l = 1.0;
else if (l < 0)
- l = 0.;
+ l = 0.0;
+
q = e->l * 2;
+
if (q > 1)
- q = 1.;
+ q = 1.0;
+
p = 2 * e->l - q;
+
for (j = 0; j < 3; j++)
{
- t = h + (1-j)/3.;
+ t = h + (1 - j) / 3.0;
+
if (t < 0)
- t += 1.;
+ t += 1.0;
else if (t > 1)
- t -= 1.;
- if (t < 1/6.)
- part->c[j] = p + ((q-p)*6*t);
- else if (t < .5)
+ t -= 1.0;
+
+ if (t < 1 / 6.0)
+ part->c[j] = p + ((q - p) * 6 * t);
+ else if (t < 0.5)
part->c[j] = q;
- else if (t < 2/3.)
- part->c[j] = p + ((q-p)*6*(2/3.-t));
+ else if (t < 2 / 3.0)
+ part->c[j] = p + ((q - p) * 6 * (2 / 3.0 - t));
else
part->c[j] = p;
}
// give new life
- part->t = 1.;
+ part->t = 1.0;
ps->active = true;
- count -= 1;
+ count -= 1;
}
}
}
@@ -697,7 +881,8 @@
Emitter *ei = ps->e;
GPoint *gi = ps->g;
int i;
- for (i = 0; i < ps->ng; i++, gi++)
+
+ for (i = 0; i < ps->ng; ++i, ++gi)
{
if (gi->movement == MOVEMENT_MOUSEPOSITION)
{
@@ -706,13 +891,14 @@
}
}
- for (i = 0; i < ps->ne; i++, ei++)
+ for (i = 0; i < ps->ne; ++i, ++ei)
{
if (ei->movement == MOVEMENT_MOUSEPOSITION)
{
ei->x = pos.x ();
ei->y = pos.y ();
}
+
if (ei->active && ei->trigger == TRIGGER_MOUSEMOVEMENT)
genNewParticles (ps, ei);
}
@@ -728,21 +914,23 @@
if (active && !ps)
{
ps = (ParticleSystem*) calloc(1, sizeof (ParticleSystem));
+
if (!ps)
{
cScreen->preparePaint (time);
return;
}
+
loadGPoints (ps);
loadEmitters (ps);
initParticles (optionGetHardLimit (), optionGetSoftLimit (), ps);
- ps->darken = optionGetDarken ();
+ ps->darken = optionGetDarken ();
ps->blendMode = (optionGetBlend ()) ? GL_ONE :
GL_ONE_MINUS_SRC_ALPHA;
- ps->tnew = optionGetTnew ();
- ps->told = optionGetTold ();
- ps->gx = optionGetGx ();
- ps->gy = optionGetGy ();
+ ps->tnew = optionGetTnew ();
+ ps->told = optionGetTold ();
+ ps->gx = optionGetGx ();
+ ps->gy = optionGetGy ();
glGenTextures (1, &ps->tex);
glBindTexture (GL_TEXTURE_2D, ps->tex);
@@ -758,127 +946,133 @@
if (ps && active && ps->e)
{
Emitter *ei = ps->e;
- GPoint *gi = ps->g;
+ GPoint *gi = ps->g;
int i;
- for (i = 0; i < ps->ng; i++, gi++)
+ for (i = 0; i < ps->ng; ++i, ++gi)
{
- if (gi->movement==MOVEMENT_BOUNCE || gi->movement==MOVEMENT_WRAP)
+ if (gi->movement == MOVEMENT_BOUNCE || gi->movement == MOVEMENT_WRAP)
{
gi->x += gi->espeed * cos (gi->eangle) * time;
gi->y += gi->espeed * sin (gi->eangle) * time;
+
if (gi->x >= screen->width ())
{
- if (gi->movement==MOVEMENT_BOUNCE)
+ if (gi->movement == MOVEMENT_BOUNCE)
{
- gi->x = 2*screen->width () - gi->x - 1;
+ gi->x = 2 * screen->width () - gi->x - 1;
gi->eangle = M_PI - gi->eangle;
}
- else if (gi->movement==MOVEMENT_WRAP)
+ else if (gi->movement == MOVEMENT_WRAP)
gi->x -= screen->width ();
}
else if (gi->x < 0)
{
- if (gi->movement==MOVEMENT_BOUNCE)
+ if (gi->movement == MOVEMENT_BOUNCE)
{
- gi->x *= -1;
+ gi->x *= -1;
gi->eangle = M_PI - gi->eangle;
}
- else if (gi->movement==MOVEMENT_WRAP)
+ else if (gi->movement == MOVEMENT_WRAP)
gi->x += screen->width ();
}
+
if (gi->y >= screen->height ())
{
- if (gi->movement==MOVEMENT_BOUNCE)
+ if (gi->movement == MOVEMENT_BOUNCE)
{
- gi->y = 2*screen->height () - gi->y - 1;
+ gi->y = 2 * screen->height () - gi->y - 1;
gi->eangle *= -1;
}
- else if (gi->movement==MOVEMENT_WRAP)
+ else if (gi->movement == MOVEMENT_WRAP)
gi->y -= screen->height ();
}
else if (gi->y < 0)
{
- if (gi->movement==MOVEMENT_BOUNCE)
+ if (gi->movement == MOVEMENT_BOUNCE)
{
- gi->y *= -1;
+ gi->y *= -1;
gi->eangle *= -1;
}
- else if (gi->movement==MOVEMENT_WRAP)
+ else if (gi->movement == MOVEMENT_WRAP)
gi->y += screen->height ();
}
}
- if (gi->movement==MOVEMENT_FOLLOWMOUSE
+
+ if (gi->movement == MOVEMENT_FOLLOWMOUSE
&& (my!=gi->y||mx!=gi->x))
{
- gi->eangle = atan2(my-gi->y, mx-gi->x);
+ gi->eangle = atan2 (my-gi->y, mx-gi->x);
gi->x += gi->espeed * cos(gi->eangle) * time;
gi->y += gi->espeed * sin(gi->eangle) * time;
}
}
- for (i = 0; i < ps->ne; i++, ei++)
+ for (i = 0; i < ps->ne; ++i, ++ei)
{
- if (ei->movement==MOVEMENT_BOUNCE || ei->movement==MOVEMENT_WRAP)
+ if (ei->movement == MOVEMENT_BOUNCE || ei->movement == MOVEMENT_WRAP)
{
ei->x += ei->espeed * cos (ei->eangle) * time;
ei->y += ei->espeed * sin (ei->eangle) * time;
+
if (ei->x >= screen->width ())
{
- if (ei->movement==MOVEMENT_BOUNCE)
+ if (ei->movement == MOVEMENT_BOUNCE)
{
- ei->x = 2*screen->width () - ei->x - 1;
+ ei->x = 2 * screen->width () - ei->x - 1;
ei->eangle = M_PI - ei->eangle;
}
- else if (ei->movement==MOVEMENT_WRAP)
+ else if (ei->movement == MOVEMENT_WRAP)
ei->x -= screen->width ();
}
else if (ei->x < 0)
{
- if (ei->movement==MOVEMENT_BOUNCE)
+ if (ei->movement == MOVEMENT_BOUNCE)
{
ei->x *= -1;
ei->eangle = M_PI - ei->eangle;
}
- else if (ei->movement==MOVEMENT_WRAP)
+ else if (ei->movement == MOVEMENT_WRAP)
ei->x += screen->width ();
}
if (ei->y >= screen->height ())
{
- if (ei->movement==MOVEMENT_BOUNCE)
+ if (ei->movement == MOVEMENT_BOUNCE)
{
- ei->y = 2*screen->height () - ei->y - 1;
+ ei->y = 2 * screen->height () - ei->y - 1;
ei->eangle *= -1;
}
- else if (ei->movement==MOVEMENT_WRAP)
+ else if (ei->movement == MOVEMENT_WRAP)
ei->y -= screen->height ();
}
else if (ei->y < 0)
{
- if (ei->movement==MOVEMENT_BOUNCE)
+ if (ei->movement == MOVEMENT_BOUNCE)
{
ei->y *= -1;
ei->eangle *= -1;
}
- else if (ei->movement==MOVEMENT_WRAP)
+ else if (ei->movement == MOVEMENT_WRAP)
ei->y += screen->height ();
}
}
- if (ei->movement==MOVEMENT_FOLLOWMOUSE
+
+ if (ei->movement == MOVEMENT_FOLLOWMOUSE
&& (my!=ei->y||mx!=ei->x))
{
ei->eangle = atan2 (my-ei->y, mx-ei->x);
ei->x += ei->espeed * cos (ei->eangle) * time;
ei->y += ei->espeed * sin (ei->eangle) * time;
}
- if (ei->trigger == TRIGGER_RANDOMPERIOD
- && ei->set_active && !((int)random ()&0xff))
+
+ if (ei->trigger == TRIGGER_RANDOMPERIOD &&
+ ei->set_active &&
+ !((int)random ()&0xff))
ei->active = !ei->active;
- if (ei->active && (
- (ei->trigger == TRIGGER_PERSISTENT) ||
- (ei->trigger == TRIGGER_RANDOMSHOT && !((int)random()&0xff)) ||
- (ei->trigger == TRIGGER_RANDOMPERIOD)
- ))
+
+ if (ei->active && ((ei->trigger == TRIGGER_PERSISTENT) ||
+ (ei->trigger == TRIGGER_RANDOMSHOT && !((int)random()&0xff)) ||
+ (ei->trigger == TRIGGER_RANDOMPERIOD)))
genNewParticles (ps, ei);
}
}
@@ -912,14 +1106,20 @@
}
bool
-WizardScreen::glPaintOutput (const GLScreenPaintAttrib &sa,
- const GLMatrix &transform,
- const CompRegion ®ion,
- CompOutput *output,
- unsigned int mask)
+WizardScreen::glPaintOutput (const GLScreenPaintAttrib &sa,
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ CompOutput *output,
+ unsigned int mask)
{
+<<<<<<< TREE
bool status = gScreen->glPaintOutput (sa, transform, region, output, mask);
GLMatrix sTransform = transform;
+=======
+ GLMatrix sTransform;
+
+ bool status = gScreen->glPaintOutput (sa, transform, region, output, mask);
+>>>>>>> MERGE-SOURCE
if (!ps || !ps->active)
return status;
@@ -935,16 +1135,17 @@
WizardScreen::toggle ()
{
active = !active;
+
cScreen->preparePaintSetEnabled (this, active);
cScreen->donePaintSetEnabled (this, active);
gScreen->glPaintOutputSetEnabled (this, active);
-
+
cScreen->damageScreen ();
return true;
}
void
-WizardScreen::optionChanged (CompOption *opt,
+WizardScreen::optionChanged (CompOption *opt,
WizardOptions::Options num)
{
loadGPoints (ps);
@@ -955,6 +1156,8 @@
PluginClassHandler (screen),
cScreen (CompositeScreen::get (screen)),
gScreen (GLScreen::get (screen)),
+ mx (0),
+ my (0),
active (false),
ps (NULL)
{
=== modified file 'plugins/wobbly/src/wobbly.cpp'
--- plugins/wobbly/src/wobbly.cpp 2013-05-11 07:15:17 +0000
+++ plugins/wobbly/src/wobbly.cpp 2013-07-21 23:03:28 +0000
@@ -30,8 +30,6 @@
COMPIZ_PLUGIN_20090315 (wobbly, WobblyPluginVTable)
-const float MASS = 15.0f;
-
const unsigned short EDGE_DISTANCE = 25;
const unsigned short EDGE_VELOCITY = 13;
@@ -40,6 +38,7 @@
{
int start = -65535;
int end = 65535;
+<<<<<<< TREE
int v1 = -65535;
int v2 = 65535;
@@ -50,6 +49,15 @@
const CompRect &workArea =
::screen->outputDevs ()[(unsigned) output].workArea ();
+=======
+ int v1 = -65535;
+ int v2 = 65535;
+ int x = object->position.x + window->output ().left - window->border ().left;
+
+ int output = ::screen->outputDeviceForPoint (x, object->position.y);
+ const CompRect &workArea = ::screen->outputDevs ()[(unsigned) output].workArea ();
+
+>>>>>>> MERGE-SOURCE
int workAreaEdge = workArea.x1 ();
if (x >= workAreaEdge)
@@ -121,11 +129,11 @@
if (v1 != (int) object->vertEdge.next)
object->vertEdge.snapped = false;
- object->vertEdge.start = start;
- object->vertEdge.end = end;
+ object->vertEdge.start = start;
+ object->vertEdge.end = end;
- object->vertEdge.next = v1;
- object->vertEdge.prev = v2;
+ object->vertEdge.next = v1;
+ object->vertEdge.prev = v2;
object->vertEdge.attract = v1 + EDGE_DISTANCE;
object->vertEdge.velocity = EDGE_VELOCITY;
@@ -136,6 +144,7 @@
{
int start = -65535;
int end = 65535;
+<<<<<<< TREE
int v1 = 65535;
int v2 = -65535;
@@ -146,6 +155,15 @@
const CompRect &workArea =
::screen->outputDevs ()[(unsigned) output].workArea ();
int workAreaEdge = workArea.x2 ();
+=======
+ int v1 = 65535;
+ int v2 = -65535;
+ int x = object->position.x - window->output ().right + window->border ().right;
+
+ int output = ::screen->outputDeviceForPoint (x, object->position.y);
+ const CompRect &workArea = ::screen->outputDevs ()[(unsigned) output].workArea ();
+ int workAreaEdge = workArea.x2 ();
+>>>>>>> MERGE-SOURCE
if (x <= workAreaEdge)
{
@@ -215,11 +233,11 @@
if (v1 != (int) object->vertEdge.next)
object->vertEdge.snapped = false;
- object->vertEdge.start = start;
- object->vertEdge.end = end;
+ object->vertEdge.start = start;
+ object->vertEdge.end = end;
- object->vertEdge.next = v1;
- object->vertEdge.prev = v2;
+ object->vertEdge.next = v1;
+ object->vertEdge.prev = v2;
object->vertEdge.attract = v1 - EDGE_DISTANCE;
object->vertEdge.velocity = EDGE_VELOCITY;
@@ -231,15 +249,14 @@
int start = -65535;
int end = 65535;
- int v1 = -65535;
- int v2 = 65535;
-
- int y = object->position.y + window->output ().top - window->border ().top;
-
- int output = ::screen->outputDeviceForPoint (object->position.x, y);
- const CompRect &workArea =
- ::screen->outputDevs ()[(unsigned) output].workArea ();
- int workAreaEdge = workArea.y1 ();
+ int v1 = -65535;
+ int v2 = 65535;
+
+ int y = object->position.y + window->output ().top - window->border ().top;
+
+ int output = ::screen->outputDeviceForPoint (object->position.x, y);
+ const CompRect &workArea = ::screen->outputDevs ()[(unsigned) output].workArea ();
+ int workAreaEdge = workArea.y1 ();
if (y >= workAreaEdge)
{
@@ -309,11 +326,11 @@
if (v1 != (int) object->horzEdge.next)
object->horzEdge.snapped = false;
- object->horzEdge.start = start;
- object->horzEdge.end = end;
+ object->horzEdge.start = start;
+ object->horzEdge.end = end;
- object->horzEdge.next = v1;
- object->horzEdge.prev = v2;
+ object->horzEdge.next = v1;
+ object->horzEdge.prev = v2;
object->horzEdge.attract = v1 + EDGE_DISTANCE;
object->horzEdge.velocity = EDGE_VELOCITY;
@@ -324,16 +341,13 @@
{
int start = -65535;
int end = 65535;
-
- int v1 = 65535;
- int v2 = -65535;
-
- int y = object->position.y - window->output ().bottom + window->border ().bottom;
-
- int output = ::screen->outputDeviceForPoint (object->position.x, y);
- const CompRect &workArea =
- ::screen->outputDevs ()[(unsigned) output].workArea ();
- int workAreaEdge = workArea.y2 ();
+ int v1 = 65535;
+ int v2 = -65535;
+ int y = object->position.y - window->output ().bottom + window->border ().bottom;
+
+ int output = ::screen->outputDeviceForPoint (object->position.x, y);
+ const CompRect &workArea = ::screen->outputDevs ()[(unsigned) output].workArea ();
+ int workAreaEdge = workArea.y2 ();
if (y <= workAreaEdge)
{
@@ -419,25 +433,25 @@
float velocityX,
float velocityY)
{
- force.x = 0;
- force.y = 0;
-
- position.x = positionX;
- position.y = positionY;
-
- velocity.x = velocityX;
- velocity.y = velocityY;
-
- theta = 0;
- immobile = false;
-
- edgeMask = 0;
+ force.x = 0;
+ force.y = 0;
+
+ position.x = positionX;
+ position.y = positionY;
+
+ velocity.x = velocityX;
+ velocity.y = velocityY;
+
+ theta = 0;
+ immobile = false;
+
+ edgeMask = 0;
vertEdge.snapped = false;
horzEdge.snapped = false;
- vertEdge.next = 0.0f;
- horzEdge.next = 0.0f;
+ vertEdge.next = 0.0f;
+ horzEdge.next = 0.0f;
}
void
@@ -482,19 +496,24 @@
float offsetX,
float offsetY)
{
+<<<<<<< TREE
Spring *spring;
spring = &springs[numSprings];
++numSprings;
+=======
+ Spring *spring = &springs[numSprings];
+ ++numSprings;
+>>>>>>> MERGE-SOURCE
spring->init (a, b, offsetX, offsetY);
}
void
-Model::setMiddleAnchor (int x,
- int y,
- int width,
- int height)
+Model::setMiddleAnchor (int x,
+ int y,
+ int width,
+ int height)
{
float gx = ((GRID_WIDTH - 1) / 2 * width) / (float) (GRID_WIDTH - 1);
float gy = ((GRID_HEIGHT - 1) / 2 * height) / (float) (GRID_HEIGHT - 1);
@@ -502,8 +521,7 @@
if (anchorObject)
anchorObject->immobile = false;
- anchorObject = &objects[GRID_WIDTH * ((GRID_HEIGHT - 1) / 2) +
- (GRID_WIDTH - 1) / 2];
+ anchorObject = &objects[GRID_WIDTH * ((GRID_HEIGHT - 1) / 2) + (GRID_WIDTH - 1) / 2];
anchorObject->position.x = x + gx;
anchorObject->position.y = y + gy;
@@ -533,27 +551,25 @@
int width,
int height)
{
- Object *o;
-
- o = &objects[0];
+ Object *o = &objects[0];
o->position.x = x;
o->position.y = y;
- o->immobile = true;
+ o->immobile = true;
o = &objects[GRID_WIDTH - 1];
o->position.x = x + width;
o->position.y = y;
- o->immobile = true;
+ o->immobile = true;
o = &objects[GRID_WIDTH * (GRID_HEIGHT - 1)];
o->position.x = x;
o->position.y = y + height;
- o->immobile = true;
+ o->immobile = true;
o = &objects[numObjects - 1];
o->position.x = x + width;
o->position.y = y + height;
- o->immobile = true;
+ o->immobile = true;
if (!anchorObject)
anchorObject = &objects[0];
@@ -565,9 +581,7 @@
int width,
int height)
{
- Object *o;
-
- o = &objects[0];
+ Object *o = &objects[0];
o->position.x = x;
o->position.y = y;
@@ -604,7 +618,11 @@
int height)
{
Object *o;
+<<<<<<< TREE
int i = 0;
+=======
+ int i = 0;
+>>>>>>> MERGE-SOURCE
for (int gridY = 0; gridY < GRID_HEIGHT; ++gridY)
{
@@ -614,7 +632,7 @@
if (o == object)
{
- o->position.x = x + (gridX * width) / (GRID_WIDTH - 1);
+ o->position.x = x + (gridX * width) / (GRID_WIDTH - 1);
o->position.y = y + (gridY * height) / (GRID_HEIGHT - 1);
return;
@@ -624,25 +642,30 @@
}
void
-Model::initObjects (int x,
+Model::initObjects (int x,
int y,
- int width,
- int height)
+ int width,
+ int height)
{
float gw = GRID_WIDTH - 1;
float gh = GRID_HEIGHT - 1;
Object *object = objects;
+<<<<<<< TREE
for (int gridY = 0; gridY < GRID_HEIGHT; ++gridY)
{
for (int gridX = 0; gridX < GRID_WIDTH; ++gridX, ++object)
{
object->init (x + (gridX * width) / gw,
+=======
+
+ for (int gridY = 0; gridY < GRID_HEIGHT; ++gridY)
+ for (int gridX = 0; gridX < GRID_WIDTH; ++gridX, ++object)
+ object->init (x + (gridX * width) / gw,
+>>>>>>> MERGE-SOURCE
y + (gridY * height) / gh,
0, 0);
- }
- }
setMiddleAnchor (x, y, width, height);
}
@@ -739,11 +762,16 @@
bool
Model::disableSnapping ()
{
- bool snapped = false;
-
- Object *object = objects;
-
- for (int gridY = 0; gridY < GRID_HEIGHT; ++gridY)
+ bool snapped = false;
+ Object *object = objects;
+
+<<<<<<< TREE
+ Object *object = objects;
+
+ for (int gridY = 0; gridY < GRID_HEIGHT; ++gridY)
+=======
+ for (int gridY = 0; gridY < GRID_HEIGHT; ++gridY)
+>>>>>>> MERGE-SOURCE
{
for (int gridX = 0; gridX < GRID_WIDTH; ++gridX, ++object)
{
@@ -804,12 +832,21 @@
int width,
int height)
{
+<<<<<<< TREE
int i = 0;
+=======
+ int i = 0;
+>>>>>>> MERGE-SOURCE
numSprings = 0;
+<<<<<<< TREE
float hpad = ((float) width) / (GRID_WIDTH - 1);
float vpad = ((float) height) / (GRID_HEIGHT - 1);
+=======
+ float hpad = ((float) width) / (GRID_WIDTH - 1);
+ float vpad = ((float) height) / (GRID_HEIGHT - 1);
+>>>>>>> MERGE-SOURCE
for (int gridY = 0; gridY < GRID_HEIGHT; ++gridY)
{
@@ -833,7 +870,12 @@
float ty)
{
Object *object = objects;
- for (int i = 0; i < numObjects; ++i, ++object)
+<<<<<<< TREE
+ for (int i = 0; i < numObjects; ++i, ++object)
+=======
+
+ for (int i = 0; i < numObjects; ++i, ++object)
+>>>>>>> MERGE-SOURCE
{
object->position.x += tx;
object->position.y += ty;
@@ -845,11 +887,11 @@
int width,
int height,
unsigned int edgeMask) :
- numObjects (GRID_WIDTH * GRID_HEIGHT),
- numSprings (0),
+ numObjects (GRID_WIDTH * GRID_HEIGHT),
+ numSprings (0),
anchorObject (0),
- steps (0),
- edgeMask (edgeMask)
+ steps (0),
+ edgeMask (edgeMask)
{
objects = new Object [numObjects];
@@ -862,8 +904,8 @@
}
void
-Object::applyForce (float fx,
- float fy)
+Object::applyForce (float fx,
+ float fy)
{
force.x += fx;
force.y += fy;
@@ -887,7 +929,7 @@
}
bool
-WobblyWindow::objectReleaseWestEastEdge (Object *object,
+WobblyWindow::objectReleaseWestEastEdge (Object *object,
Direction dir)
{
if (fabs (object->velocity.x) > object->vertEdge.velocity)
@@ -956,8 +998,10 @@
object->force.x -= friction * object->velocity.x;
object->force.y -= friction * object->velocity.y;
- object->velocity.x += object->force.x / MASS;
- object->velocity.y += object->force.y / MASS;
+ float mass = wScreen->optionGetWindowMass ();
+
+ object->velocity.x += object->force.x / mass;
+ object->velocity.y += object->force.y / mass;
if (object->edgeMask)
{
@@ -986,10 +1030,8 @@
updateModelSnapping ();
}
else
- {
object->velocity.x -=
object->vertEdge.attract - object->position.x;
- }
}
if (object->position.x > object->vertEdge.prev)
@@ -1021,10 +1063,8 @@
updateModelSnapping ();
}
else
- {
object->velocity.x =
object->position.x - object->vertEdge.attract;
- }
}
if (object->position.x < object->vertEdge.prev)
@@ -1059,10 +1099,8 @@
updateModelSnapping ();
}
else
- {
object->velocity.y -=
object->horzEdge.attract - object->position.y;
- }
}
if (object->position.y > object->horzEdge.prev)
@@ -1094,10 +1132,8 @@
updateModelSnapping ();
}
else
- {
object->velocity.y =
object->position.y - object->horzEdge.attract;
- }
}
if (object->position.y < object->horzEdge.prev)
@@ -1127,18 +1163,33 @@
float k,
float time)
{
+<<<<<<< TREE
unsigned int wobbly = 0;
float velocitySum = 0.0f;
float force, forceSum = 0.0f;
+=======
+>>>>>>> MERGE-SOURCE
model->steps += time / 15.0f;
+<<<<<<< TREE
int steps = floor (model->steps);
+=======
+ int steps = floor (model->steps);
+>>>>>>> MERGE-SOURCE
model->steps -= steps;
if (!steps)
return WobblyInitialMask;
- for (int j = 0; j < steps; ++j)
+<<<<<<< TREE
+ for (int j = 0; j < steps; ++j)
+=======
+ unsigned int wobbly = 0;
+ float velocitySum = 0.0f;
+ float force, forceSum = 0.0f;
+
+ for (int j = 0; j < steps; ++j)
+>>>>>>> MERGE-SOURCE
{
for (int i = 0; i < model->numSprings; ++i)
model->springs[i].exertForces (k);
@@ -1188,10 +1239,8 @@
{
for (int j = 0; j < 4; ++j)
{
- x += coeffsU[i] * coeffsV[j] *
- objects[j * GRID_WIDTH + i].position.x;
- y += coeffsU[i] * coeffsV[j] *
- objects[j * GRID_WIDTH + i].position.y;
+ x += coeffsU[i] * coeffsV[j] * objects[j * GRID_WIDTH + i].position.x;
+ y += coeffsU[i] * coeffsV[j] * objects[j * GRID_WIDTH + i].position.y;
}
}
@@ -1208,8 +1257,7 @@
CompRect outRect (window->outputRect ());
if (window->type () & CompWindowTypeNormalMask)
- edgeMask = WestEdgeMask | EastEdgeMask | NorthEdgeMask |
- SouthEdgeMask;
+ edgeMask = WestEdgeMask | EastEdgeMask | NorthEdgeMask | SouthEdgeMask;
try
{
model = new Model (outRect.x (), outRect.y (),
@@ -1221,6 +1269,7 @@
return false;
}
}
+
return true;
}
@@ -1238,16 +1287,17 @@
Model::findNearestObject (float x,
float y)
{
- Object *object = &objects[0];
+ Object *object = &objects[0];
float distance, minDistance = 0.0;
for (int i = 0; i < numObjects; ++i)
{
distance = objects[i].distanceToPoint (x, y);
+
if (i == 0 || distance < minDistance)
{
minDistance = distance;
- object = &objects[i];
+ object = &objects[i];
}
}
@@ -1269,7 +1319,7 @@
/* avoid fullscreen windows */
if (geom.x () <= 0 &&
geom.y () <= 0 &&
- geom.x () + window->width () >= ::screen->width () &&
+ geom.x () + window->width () >= ::screen->width () &&
geom.y () + window->height () >= ::screen->height ())
return false;
@@ -1281,17 +1331,18 @@
{
if (wobblingWindowsMask & (WobblyInitialMask | WobblyVelocityMask))
{
- Point topLeft, bottomRight;
- float friction, springK;
- Model *model;
+ Point topLeft, bottomRight;
+ Model *model;
- friction = optionGetFriction ();
- springK = optionGetSpringK ();
+ float friction = optionGetFriction ();
+ float springK = optionGetSpringK ();
wobblingWindowsMask = false;
+ WobblyWindow *ww;
+
foreach (CompWindow *w, ::screen->windows ())
{
- WobblyWindow *ww = WobblyWindow::get (w);
+ ww = WobblyWindow::get (w);
if (ww->wobblingMask)
{
@@ -1388,29 +1439,32 @@
// Find the bounding box of the two rectangles
if (topLeft.x > topLeft2.x)
topLeft.x = topLeft2.x;
+
if (topLeft.y > topLeft2.y)
topLeft.y = topLeft2.y;
+
if (bottomRight.x < bottomRight2.x)
bottomRight.x = bottomRight2.x;
+
if (bottomRight.y < bottomRight2.y)
bottomRight.y = bottomRight2.y;
}
else
cw->addDamage ();
- int wx = w->geometry ().x ();
- int wy = w->geometry ().y ();
+ int wx = w->geometry ().x ();
+ int wy = w->geometry ().y ();
int borderWidth = w->geometry ().border ();
// Damage a box that's 1-pixel larger on each side
// to prevent artifacts
- topLeft.x -= 1;
- topLeft.y -= 1;
+ topLeft.x -= 1;
+ topLeft.y -= 1;
bottomRight.x += 1;
bottomRight.y += 1;
- topLeft.x -= wx + borderWidth;
- topLeft.y -= wy + borderWidth;
+ topLeft.x -= wx + borderWidth;
+ topLeft.y -= wy + borderWidth;
bottomRight.x += 0.5f - (wx + borderWidth);
bottomRight.y += 0.5f - (wy + borderWidth);
@@ -1441,8 +1495,8 @@
if (!wobblingWindowsMask)
{
// Wobbling has finished for all windows
- cScreen->preparePaintSetEnabled (this, false);
- cScreen->donePaintSetEnabled (this, false);
+ cScreen->preparePaintSetEnabled (this, false);
+ cScreen->donePaintSetEnabled (this, false);
gScreen->glPaintOutputSetEnabled (this, false);
constraintBox = NULL;
@@ -1459,6 +1513,7 @@
unsigned int maxGridHeight)
{
CompRect outRect (window->outputRect ());
+<<<<<<< TREE
int wx = outRect.x ();
int wy = outRect.y ();
@@ -1474,6 +1529,25 @@
if (gridH < wScreen->optionGetMinGridSize ())
gridH = wScreen->optionGetMinGridSize ();
+=======
+
+ int wx = outRect.x ();
+ int wy = outRect.y ();
+ int width = outRect.width ();
+ int height = outRect.height ();
+ int gridRes = wScreen->optionGetGridResolution ();
+ int gridSize = wScreen->optionGetMinGridSize ();
+
+ int gridW = width / gridRes;
+
+ if (gridW < gridSize)
+ gridW = gridSize;
+
+ int gridH = height / gridRes;
+
+ if (gridH < gridSize)
+ gridH = gridSize;
+>>>>>>> MERGE-SOURCE
if (gridW > (int) maxGridWidth)
gridW = (int) maxGridWidth;
@@ -1481,15 +1555,14 @@
if (gridH > (int) maxGridHeight)
gridH = (int) maxGridHeight;
- GLVertexBuffer *vb = gWindow->vertexBuffer ();
-
- int oldCount = vb->countVertices ();
gWindow->glAddGeometry (matrix, region, clip, gridW, gridH);
- int newCount = vb->countVertices ();
- int stride = vb->getVertexStride ();
- GLfloat *v = vb->getVertices () + oldCount * stride;
- GLfloat *vMax = vb->getVertices () + newCount * stride;
+ GLVertexBuffer *vb = gWindow->vertexBuffer ();
+ int oldCount = vb->countVertices ();
+ int newCount = vb->countVertices ();
+ int stride = vb->getVertexStride ();
+ GLfloat *v = vb->getVertices () + oldCount * stride;
+ GLfloat *vMax = vb->getVertices () + newCount * stride;
for (; v < vMax; v += stride)
{
@@ -1537,9 +1610,11 @@
if (!snapping)
return false;
+ WobblyWindow *ww;
+
foreach (CompWindow *w, ::screen->windows ())
{
- WobblyWindow *ww = WobblyWindow::get (w);
+ ww = WobblyWindow::get (w);
if (ww->grabbed && ww->model &&
ww->model->disableSnapping ())
@@ -1554,9 +1629,8 @@
bool
WobblyScreen::shiver (CompOption::Vector &options)
{
- Window xid = (Window) CompOption::getIntOptionNamed (options, "window");
-
- CompWindow *w = ::screen->findWindow (xid);
+ Window xid = (Window) CompOption::getIntOptionNamed (options, "window");
+ CompWindow *w = ::screen->findWindow (xid);
if (w)
{
@@ -1574,6 +1648,7 @@
startWobbling (ww);
}
}
+
return false;
}
@@ -1585,6 +1660,7 @@
case CompWindowNotifyMap:
if (model && isWobblyWin ())
initiateMapEffect ();
+
break;
default:
@@ -1597,9 +1673,6 @@
void
WobblyScreen::handleEvent (XEvent *event)
{
- Window activeWindow = ::screen->activeWindow ();
- CompWindow *w;
-
if (event->type == ::screen->xkbEvent ())
{
XkbAnyEvent *xkbEvent = (XkbAnyEvent *) event;
@@ -1607,11 +1680,17 @@
if (xkbEvent->xkb_type == XkbStateNotify)
{
XkbStateNotifyEvent *stateEvent = (XkbStateNotifyEvent *) event;
+<<<<<<< TREE
CompAction *action;
unsigned int mods = 0xffffffff;
action = &optionGetSnapKey ();
bool inverted = optionGetSnapInverted ();
+=======
+ unsigned int mods = 0xffffffff;
+ CompAction *action = &optionGetSnapKey ();
+ bool inverted = optionGetSnapInverted ();
+>>>>>>> MERGE-SOURCE
if (action->type () & CompAction::BindingTypeKey)
mods = action->key ().modifiers ();
@@ -1637,46 +1716,58 @@
switch (event->type)
{
- case MotionNotify:
- if (event->xmotion.root == ::screen->root () &&
- grabWindow &&
- moveWindow &&
- optionGetMaximizeEffect ())
- {
- WobblyWindow *ww = WobblyWindow::get (grabWindow);
-
- if (ww && (ww->state & MAXIMIZE_STATE))
+ case MotionNotify:
+ if (event->xmotion.root == ::screen->root () &&
+ grabWindow &&
+ moveWindow &&
+ optionGetMaximizeEffect ())
{
- if (ww->model && ww->grabbed)
+ WobblyWindow *ww = WobblyWindow::get (grabWindow);
+
+ if (ww && (ww->state & MAXIMIZE_STATE))
{
- int dx, dy;
-
- if (ww->state & CompWindowStateMaximizedHorzMask)
- dx = pointerX - lastPointerX;
- else
- dx = 0;
-
- if (ww->state & CompWindowStateMaximizedVertMask)
- dy = pointerY - lastPointerY;
- else
- dy = 0;
-
- ww->model->anchorObject->position.x += dx;
- ww->model->anchorObject->position.y += dy;
-
- startWobbling (ww);
+ if (ww->model && ww->grabbed)
+ {
+ int dx, dy;
+
+ if (ww->state & CompWindowStateMaximizedHorzMask)
+ dx = pointerX - lastPointerX;
+ else
+ dx = 0;
+
+ if (ww->state & CompWindowStateMaximizedVertMask)
+ dy = pointerY - lastPointerY;
+ else
+ dy = 0;
+
+ ww->model->anchorObject->position.x += dx;
+ ww->model->anchorObject->position.y += dy;
+
+ startWobbling (ww);
+ }
}
}
+<<<<<<< TREE
}
break;
default:
break;
+=======
+
+ break;
+
+ default:
+ break;
+>>>>>>> MERGE-SOURCE
}
+ Window activeWindow = ::screen->activeWindow ();
+
if (::screen->activeWindow () != activeWindow)
{
- w = screen->findWindow (::screen->activeWindow ());
+ CompWindow *w = screen->findWindow (::screen->activeWindow ());
+
if (!w)
return;
@@ -1684,10 +1775,17 @@
if (ww->isWobblyWin ())
{
+<<<<<<< TREE
int focusEffect = optionGetFocusEffect ();
if ((focusEffect != WobblyOptions::FocusEffectNone) &&
optionGetFocusWindowMatch ().evaluate (w) &&
+=======
+ int focusEffect = optionGetFocusEffect ();
+
+ if (focusEffect != WobblyOptions::FocusEffectNone &&
+ optionGetFocusWindowMatch ().evaluate (w) &&
+>>>>>>> MERGE-SOURCE
ww->ensureModel ())
{
switch (focusEffect)
@@ -1716,9 +1814,9 @@
void
WobblyWindow::enableWobbling (bool enabling)
{
- gWindow->glPaintSetEnabled (this, enabling);
+ gWindow->glPaintSetEnabled (this, enabling);
gWindow->glAddGeometrySetEnabled (this, enabling);
- cWindow->damageRectSetEnabled (this, enabling);
+ cWindow->damageRectSetEnabled (this, enabling);
}
void
@@ -1729,19 +1827,24 @@
if (!wobblingWindowsMask)
{
- cScreen->preparePaintSetEnabled (this, true);
- cScreen->donePaintSetEnabled (this, true);
+ cScreen->preparePaintSetEnabled (this, true);
+ cScreen->donePaintSetEnabled (this, true);
gScreen->glPaintOutputSetEnabled (this, true);
}
+<<<<<<< TREE
ww->wobblingMask |= WobblyInitialMask;
+=======
+
+ ww->wobblingMask |= WobblyInitialMask;
+>>>>>>> MERGE-SOURCE
wobblingWindowsMask |= ww->wobblingMask;
cScreen->damagePending ();
}
bool
-WobblyWindow::damageRect (bool initial,
+WobblyWindow::damageRect (bool initial,
const CompRect &rect)
{
if (!initial)
@@ -1766,8 +1869,8 @@
{
int mapEffect = wScreen->optionGetMapEffect ();
- if ((mapEffect != WobblyOptions::MapEffectNone) &&
- wScreen->optionGetMapWindowMatch ().evaluate (window) &&
+ if (mapEffect != WobblyOptions::MapEffectNone &&
+ wScreen->optionGetMapWindowMatch ().evaluate (window) &&
ensureModel ())
{
CompRect outRect (window->outputRect ());
@@ -1803,11 +1906,11 @@
CompRect outRect (window->outputRect ());
if (wScreen->optionGetMaximizeEffect () &&
- isWobblyWin () &&
+ isWobblyWin () &&
/* prevent wobbling when shading maximized windows - assuming that
the height difference shaded - non-shaded will hardly be -1 and
a lack of wobbly animation in that corner case is tolerable */
- (dheight != -1) &&
+ dheight != -1 &&
((window->state () | state) & MAXIMIZE_STATE))
{
state &= (unsigned)~MAXIMIZE_STATE;
@@ -1820,7 +1923,7 @@
if (!grabbed && model->anchorObject)
{
model->anchorObject->immobile = false;
- model->anchorObject = NULL;
+ model->anchorObject = NULL;
}
model->addEdgeAnchors (outRect.x (), outRect.y (),
@@ -1860,8 +1963,7 @@
if (model->anchorObject)
model->anchorObject->immobile = false;
- model->anchorObject = model->findNearestObject (pointerX,
- pointerY);
+ model->anchorObject = model->findNearestObject (pointerX, pointerY);
model->anchorObject->immobile = true;
model->adjustObjectPosition (model->anchorObject,
@@ -1932,8 +2034,6 @@
if (ensureModel ())
{
- Spring *s;
-
if (wScreen->optionGetMaximizeEffect ())
{
CompRect outRect (window->outputRect ());
@@ -1953,7 +2053,7 @@
else if (model->anchorObject)
model->anchorObject->immobile = false;
- model->anchorObject = model->findNearestObject (x, y);
+ model->anchorObject = model->findNearestObject (x, y);
model->anchorObject->immobile = true;
grabbed = true;
@@ -1962,13 +2062,11 @@
wScreen->yConstrained = false;
if (mask & CompWindowGrabExternalAppMask)
{
- CompPlugin *pMove;
+ CompPlugin *pMove = CompPlugin::find ("move");
- pMove = CompPlugin::find ("move");
if (pMove)
{
- CompOption::Vector &moveOptions =
- pMove->vTable->getOptions ();
+ CompOption::Vector &moveOptions = pMove->vTable->getOptions ();
wScreen->yConstrained =
CompOption::getBoolOptionNamed (moveOptions,
@@ -1987,13 +2085,20 @@
if (mask & CompWindowGrabMoveMask)
{
model->disableSnapping ();
+
if (wScreen->snapping)
updateModelSnapping ();
}
if (wScreen->optionGetGrabWindowMatch ().evaluate (window))
{
- for (int i = 0; i < model->numSprings; ++i)
+<<<<<<< TREE
+ for (int i = 0; i < model->numSprings; ++i)
+=======
+ Spring *s;
+
+ for (int i = 0; i < model->numSprings; ++i)
+>>>>>>> MERGE-SOURCE
{
s = &model->springs[i];
@@ -2088,15 +2193,15 @@
WobblyScreen::WobblyScreen (CompScreen *s) :
PluginClassHandler (s),
- cScreen (CompositeScreen::get (s)),
- gScreen (GLScreen::get (s)),
+ cScreen (CompositeScreen::get (s)),
+ gScreen (GLScreen::get (s)),
wobblingWindowsMask (0),
- grabMask (0),
- grabWindow (NULL),
- moveWindow (false),
- snapping (false),
- yConstrained (false),
- constraintBox (NULL)
+ grabMask (0),
+ grabWindow (NULL),
+ moveWindow (false),
+ snapping (false),
+ yConstrained (false),
+ constraintBox (NULL)
{
optionSetSnapKeyInitiate (boost::bind
(&WobblyScreen::enableSnapping, this));
@@ -2116,14 +2221,14 @@
WobblyWindow::WobblyWindow (CompWindow *w) :
PluginClassHandler (w),
- wScreen (WobblyScreen::get (::screen)),
- window (w),
- cWindow (CompositeWindow::get (w)),
- gWindow (GLWindow::get (w)),
- model (0),
+ wScreen (WobblyScreen::get (::screen)),
+ window (w),
+ cWindow (CompositeWindow::get (w)),
+ gWindow (GLWindow::get (w)),
+ model (0),
wobblingMask (0),
- grabbed (false),
- state (w->state ())
+ grabbed (false),
+ state (w->state ())
{
if (((w->mapNum () && wScreen->optionGetMaximizeEffect ()) ||
wScreen->optionGetMapEffect () != WobblyOptions::MapEffectNone) &&
=== modified file 'plugins/wobbly/src/wobbly.h'
--- plugins/wobbly/src/wobbly.h 2012-12-10 03:28:47 +0000
+++ plugins/wobbly/src/wobbly.h 2013-07-21 23:03:28 +0000
@@ -41,13 +41,10 @@
CompWindowTypeMenuMask | \
CompWindowTypeUtilMask)
-const unsigned short GRID_WIDTH = 4;
-const unsigned short GRID_HEIGHT = 4;
-
+const unsigned short GRID_WIDTH = 4;
+const unsigned short GRID_HEIGHT = 4;
const unsigned short MODEL_MAX_SPRINGS = (GRID_WIDTH * GRID_HEIGHT * 2);
-extern const float MASS;
-
#define NorthEdgeMask (1L << 0)
#define SouthEdgeMask (1L << 1)
#define WestEdgeMask (1L << 2)
@@ -70,13 +67,16 @@
class WobblyWindow;
-typedef struct _xy_pair {
- float x, y;
+typedef struct _xy_pair
+{
+ float x;
+ float y;
} Point, Vector;
typedef struct _Edge
{
- float next, prev;
+ float next;
+ float prev;
float start;
float end;
@@ -90,21 +90,24 @@
class Object
{
public:
- Vector force;
- Point position;
- Vector velocity;
- float theta;
- bool immobile;
+
+ Vector force;
+ Point position;
+ Vector velocity;
+ float theta;
+ bool immobile;
unsigned int edgeMask;
- Edge vertEdge;
- Edge horzEdge;
-
- void init (float positionX,
- float positionY,
- float velocityX,
- float velocityY);
+ Edge vertEdge;
+ Edge horzEdge;
+
+ void init (float positionX,
+ float positionY,
+ float velocityX,
+ float velocityY);
+
void applyForce (float fx,
float fy);
+
float distanceToPoint (float x,
float y);
};
@@ -112,6 +115,7 @@
class Spring
{
public:
+
Object *a;
Object *b;
Vector offset;
@@ -119,13 +123,15 @@
void init (Object *newA,
Object *newB,
float newOffsetX,
- float newOffsetY);
+ float newOffsetY);
+
void exertForces (float k);
};
class Model
{
public:
+
Model (int x,
int y,
int width,
@@ -134,61 +140,75 @@
~Model ();
void calcBounds ();
+
void addSpring (Object *a,
Object *b,
float offsetX,
float offsetY);
+
void setMiddleAnchor (int x,
int y,
int width,
int height);
+
void setTopAnchor (int x,
int y,
int width);
+
void addEdgeAnchors (int x,
int y,
int width,
int height);
+
void removeEdgeAnchors (int x,
int y,
int width,
int height);
+
void adjustObjectPosition (Object *object,
int x,
int y,
int width,
int height);
+
void initObjects (int x,
int y,
int width,
int height);
+
void initSprings (int x,
int y,
int width,
int height);
+
void reduceEdgeEscapeVelocity ();
+
bool disableSnapping ();
- void adjustObjectsForShiver (int x,
- int y,
- int width,
- int height);
+
+ void adjustObjectsForShiver (int x,
+ int y,
+ int width,
+ int height);
+
void move (float tx,
float ty);
+
void bezierPatchEvaluate (float u,
float v,
float *patchX,
float *patchY);
+
Object * findNearestObject (float x,
float y);
- Object *objects;
- int numObjects;
- Spring springs[MODEL_MAX_SPRINGS];
- int numSprings;
- Object *anchorObject;
- float steps;
- Point topLeft;
- Point bottomRight;
+ Object *objects;
+ int numObjects;
+ Spring springs[MODEL_MAX_SPRINGS];
+ int numSprings;
+ Object *anchorObject;
+ float steps;
+ Point topLeft;
+ Point bottomRight;
unsigned int edgeMask;
unsigned int snapCnt[4];
};
@@ -201,6 +221,7 @@
public WobblyOptions
{
public:
+
WobblyScreen (CompScreen *s);
bool enableSnapping ();
@@ -219,27 +240,28 @@
// GLScreenInterface methods
bool glPaintOutput (const GLScreenPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- CompOutput *,
- unsigned int);
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
static void snapKeyChanged (CompOption *opt);
+
void snapInvertedChanged (CompOption *opt);
CompositeScreen *cScreen;
- GLScreen *gScreen;
-
- unsigned int wobblingWindowsMask;
-
- unsigned int grabMask;
- CompWindow *grabWindow;
- bool moveWindow;
-
- bool snapping;
-
- bool yConstrained;
- const CompRect *constraintBox;
+ GLScreen *gScreen;
+
+ unsigned int wobblingWindowsMask;
+
+ unsigned int grabMask;
+ CompWindow *grabWindow;
+ bool moveWindow;
+
+ bool snapping;
+
+ bool yConstrained;
+ const CompRect *constraintBox;
};
class WobblyWindow :
@@ -249,6 +271,7 @@
public GLWindowInterface
{
public:
+
WobblyWindow (CompWindow *);
~WobblyWindow ();
@@ -256,55 +279,80 @@
void findNextEastEdge (Object *object);
void findNextNorthEdge (Object *object);
void findNextSouthEdge (Object *object);
+
void updateModelSnapping ();
+
bool objectReleaseWestEastEdge (Object *object,
Direction dir);
+
bool objectReleaseNorthSouthEdge (Object *object,
Direction dir);
+
float modelStepObject (Object *object,
float friction,
float *force);
+
unsigned int modelStep (float friction,
float k,
float time);
+
bool ensureModel ();
bool isWobblyWin ();
+
void enableWobbling (bool enabling);
void initiateMapEffect ();
// WindowInterface methods
- void resizeNotify (int dx, int dy, int dwidth, int dheight);
- void moveNotify (int dx, int dy, bool immediate);
- void grabNotify (int x, int y, unsigned int state, unsigned int mask);
+ void resizeNotify (int dx,
+ int dy,
+ int dwidth,
+ int dheight);
+
+ void moveNotify (int dx,
+ int dy,
+ bool immediate);
+
+ void grabNotify (int x,
+ int y,
+ unsigned int state,
+ unsigned int mask);
+
void ungrabNotify ();
void windowNotify (CompWindowNotify n);
// CompositeWindowInterface methods
- bool damageRect (bool, const CompRect &);
+ bool damageRect (bool ,
+ const CompRect &);
// GLWindowInterface methods
- bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
- const CompRegion &, unsigned int);
+ bool glPaint (const GLWindowPaintAttrib &,
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
+
void glAddGeometry (const GLTexture::MatrixList &,
- const CompRegion &, const CompRegion &,
- unsigned int = MAXSHORT, unsigned int = MAXSHORT);
+ const CompRegion &,
+ const CompRegion &,
+ unsigned int = MAXSHORT,
+ unsigned int = MAXSHORT);
WobblyScreen *wScreen;
CompWindow *window;
CompositeWindow *cWindow;
GLWindow *gWindow;
- Model *model;
- unsigned int wobblingMask;
- bool grabbed;
- bool velocity;
- unsigned int state;
+ Model *model;
+ unsigned int wobblingMask;
+ bool grabbed;
+ bool velocity;
+ unsigned int state;
};
class WobblyPluginVTable :
public CompPlugin::VTableForScreenAndWindow
{
public:
+
bool init ();
};
@@ -314,7 +362,6 @@
#define WIN_W(w) ((w)->width + (w)->output.left + (w)->output.right)
#define WIN_H(w) ((w)->height + (w)->output.top + (w)->output.bottom)
-
#define WOBBLY_SCREEN_OPTION_FRICTION 0
#define WOBBLY_SCREEN_OPTION_SPRING_K 1
#define WOBBLY_SCREEN_OPTION_GRID_RESOLUTION 2
@@ -328,7 +375,6 @@
#define WOBBLY_SCREEN_OPTION_MAXIMIZE_EFFECT 10
#define WOBBLY_SCREEN_OPTION_NUM 11
-
static CompMetadata wobblyMetadata;
static int displayPrivateIndex;
@@ -338,12 +384,10 @@
#define WOBBLY_DISPLAY_OPTION_SHIVER 2
#define WOBBLY_DISPLAY_OPTION_NUM 3
-
#define WOBBLY_EFFECT_NONE 0
#define WOBBLY_EFFECT_SHIVER 1
#define WOBBLY_EFFECT_LAST WOBBLY_EFFECT_SHIVER
-
#define GET_WOBBLY_DISPLAY(d) \
((WobblyDisplay *) (d)->base.privates[displayPrivateIndex].ptr)
=== modified file 'plugins/wobbly/wobbly.xml.in'
--- plugins/wobbly/wobbly.xml.in 2012-10-15 10:31:51 +0000
+++ plugins/wobbly/wobbly.xml.in 2013-07-21 23:03:28 +0000
@@ -37,6 +37,14 @@
<_long>Make window shiver
false
+
+ <_short>Window Mass
+ <_long>The weight of your windows.
+ 15.0
+ 10.0
+ 100.0
+ 0.5
+
<_short>Friction
<_long>Spring Friction
=== modified file 'plugins/workarounds/src/workarounds.cpp'
--- plugins/workarounds/src/workarounds.cpp 2013-05-09 13:43:07 +0000
+++ plugins/workarounds/src/workarounds.cpp 2013-07-21 23:03:28 +0000
@@ -37,12 +37,11 @@
void
WorkaroundsWindow::clearInputShape (HideInfo *hideInfo)
{
- XRectangle *rects;
int count = 0, ordering;
Window xid = hideInfo->shapeWindow;
- rects = XShapeGetRectangles (screen->dpy (), xid, ShapeInput,
- &count, &ordering);
+ XRectangle *rects = XShapeGetRectangles (screen->dpy (), xid, ShapeInput,
+ &count, &ordering);
if (count == 0)
return;
@@ -56,9 +55,7 @@
window->serverGeometry ().border ())) &&
(rects[0].height == (window->serverGeometry ().height () +
window->serverGeometry ().border ())))
- {
count = 0;
- }
if (hideInfo->inputRects)
XFree (hideInfo->inputRects);
@@ -85,19 +82,15 @@
Window xid = info->shapeWindow;
if (info->nInputRects)
- {
- XShapeCombineRectangles (screen->dpy (), xid, ShapeInput, 0, 0,
- info->inputRects, info->nInputRects,
- ShapeSet, info->inputRectOrdering);
- }
+ XShapeCombineRectangles (screen->dpy (), xid, ShapeInput, 0, 0,
+ info->inputRects, info->nInputRects,
+ ShapeSet, info->inputRectOrdering);
else
- {
- XShapeCombineMask (screen->dpy (), xid, ShapeInput,
- 0, 0, None, ShapeSet);
- }
+ XShapeCombineMask (screen->dpy (), xid, ShapeInput,
+ 0, 0, None, ShapeSet);
if (info->inputRects)
- XFree (info->inputRects);
+ XFree (info->inputRects);
XShapeSelectInput (screen->dpy (), xid, info->shapeMask);
}
@@ -113,6 +106,7 @@
HideInfo *info;
windowHideInfo = info = new HideInfo ();
+
if (!windowHideInfo)
return;
@@ -121,7 +115,7 @@
info->shapeMask = XShapeInputSelected (screen->dpy (), window->id ());
/* We are a reparenting window manager now, which means that we either
- * shape the frame window, or if it does not exist, shape the window **/
+ * shape the frame window, or if it does not exist, shape the window */
if (window->frame ())
info->shapeWindow = window->frame ();
@@ -154,23 +148,18 @@
if (!clientLeader)
return false;
- if (window->transientFor () == None || window->transientFor () == screen->root ())
- {
- if (window->type () & (CompWindowTypeUtilMask |
- CompWindowTypeToolbarMask |
- CompWindowTypeMenuMask |
- CompWindowTypeDialogMask |
- CompWindowTypeModalDialogMask))
- {
- if (window->clientLeader () == clientLeader)
- return true;
- }
- }
+ if ((window->transientFor () == None || window->transientFor () == screen->root ()) &&
+ window->clientLeader () == clientLeader &&
+ window->type () & (CompWindowTypeUtilMask |
+ CompWindowTypeToolbarMask |
+ CompWindowTypeMenuMask |
+ CompWindowTypeDialogMask |
+ CompWindowTypeModalDialogMask))
+ return true;
return false;
}
-
void
WorkaroundsWindow::minimize ()
{
@@ -181,10 +170,10 @@
{
WORKAROUNDS_SCREEN (screen);
- unsigned long data[2];
- int state = IconicState;
+ unsigned long data[2];
+ int state = IconicState;
CompOption::Vector propTemplate = ws->inputDisabledAtom.getReadTemplate ();
- CompOption::Value enabled = CompOption::Value (true);
+ CompOption::Value enabled = CompOption::Value (true);
screen->handleCompizEventSetEnabled (ws, true);
@@ -192,11 +181,9 @@
window->changeState (window->state () | CompWindowStateHiddenMask);
foreach (CompWindow *w, screen->windows ())
- {
if (w->transientFor () == window->id () ||
WorkaroundsWindow::get (w)->isGroupTransient (window->clientLeader ()))
w->unminimize ();
- }
window->windowNotify (CompWindowNotifyHide);
@@ -216,7 +203,6 @@
propTemplate,
XA_CARDINAL);
-
isMinimized = true;
}
}
@@ -228,10 +214,10 @@
{
WORKAROUNDS_SCREEN (screen);
- unsigned long data[2];
- int state = NormalState;
+ unsigned long data[2];
+ int state = NormalState;
CompOption::Vector propTemplate = ws->inputDisabledAtom.getReadTemplate ();
- CompOption::Value enabled = CompOption::Value (false);
+ CompOption::Value enabled = CompOption::Value (false);
window->windowNotify (CompWindowNotifyUnminimize);
window->changeState (window->state () & ~CompWindowStateHiddenMask);
@@ -245,11 +231,9 @@
if (!ws->skipTransients)
{
foreach (CompWindow *w, screen->windows ())
- {
if (w->transientFor () == window->id () ||
WorkaroundsWindow::get (w)->isGroupTransient (window->clientLeader ()))
w->unminimize ();
- }
}
/* HACK ATTACK */
@@ -276,9 +260,9 @@
bool
WorkaroundsWindow::glPaint (const GLWindowPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ unsigned int mask)
{
if (isMinimized)
{
@@ -300,7 +284,8 @@
}
bool
-WorkaroundsWindow::damageRect (bool initial, const CompRect &rect)
+WorkaroundsWindow::damageRect (bool initial,
+ const CompRect &rect)
{
if (initial)
cWindow->addDamage (true);
@@ -311,40 +296,31 @@
}
void
-WorkaroundsScreen::checkFunctions (bool checkWindow, bool checkScreen)
+WorkaroundsScreen::checkFunctions (bool checkWindow,
+ bool checkScreen)
{
if (haveOpenGL && optionGetForceGlxSync () && checkScreen)
- {
gScreen->glPaintOutputSetEnabled (this, true);
- }
else if (haveOpenGL && checkScreen)
- {
gScreen->glPaintOutputSetEnabled (this, false);
- }
if (haveOpenGL && optionGetForceSwapBuffers () && checkScreen)
- {
cScreen->preparePaintSetEnabled (this, true);
- }
else if (haveOpenGL && checkScreen)
- {
cScreen->preparePaintSetEnabled (this, false);
- }
- if ((optionGetLegacyFullscreen () ||
- optionGetFirefoxMenuFix () ||
- optionGetOooMenuFix () ||
+ if ((optionGetLegacyFullscreen () ||
+ optionGetFirefoxMenuFix () ||
+ optionGetOooMenuFix () ||
optionGetNotificationDaemonFix () ||
- optionGetJavaFix () ||
- optionGetQtFix () ||
- optionGetConvertUrgency () ) && checkScreen)
- {
+ optionGetJavaFix () ||
+ optionGetQtFix () ||
+ optionGetConvertUrgency ()) &&
+ checkScreen)
screen->handleEventSetEnabled (this, true);
- }
+
else if (checkScreen)
- {
screen->handleEventSetEnabled (this, false);
- }
if (checkWindow)
{
@@ -362,16 +338,17 @@
if (m)
ww->window->unminimize ();
+
ww->window->minimizeSetEnabled (ww, keepMinimized);
ww->window->unminimizeSetEnabled (ww, keepMinimized);
ww->window->minimizedSetEnabled (ww, keepMinimized);
+
if (m)
ww->window->minimize ();
}
}
}
-
void
WorkaroundsScreen::addToFullscreenList (CompWindow *w)
{
@@ -427,6 +404,7 @@
if ((!GL::getVideoSync || origGetVideoSync) ||
(!GL::waitVideoSync || origWaitVideoSync))
return;
+
if (optionGetNoWaitForVideoSync ())
{
GL::getVideoSync = NULL;
@@ -451,10 +429,10 @@
bool
WorkaroundsScreen::glPaintOutput (const GLScreenPaintAttrib &attrib,
- const GLMatrix &transform,
- const CompRegion ®ion,
- CompOutput *output,
- unsigned int mask)
+ const GLMatrix &transform,
+ const CompRegion ®ion,
+ CompOutput *output,
+ unsigned int mask)
{
#ifndef USE_GLES
if (optionGetForceGlxSync ())
@@ -467,30 +445,29 @@
CompString
WorkaroundsWindow::getRoleAtom ()
{
- Atom type;
+ Atom type;
unsigned long nItems;
unsigned long bytesAfter;
unsigned char *str = NULL;
- int format, result;
- CompString retval;
+ int format;
WORKAROUNDS_SCREEN (screen);
- result = XGetWindowProperty (screen->dpy (), window->id (), ws->roleAtom,
- 0, LONG_MAX, FALSE, XA_STRING,
- &type, &format, &nItems, &bytesAfter,
- (unsigned char **) &str);
+ int result = XGetWindowProperty (screen->dpy (), window->id (), ws->roleAtom,
+ 0, LONG_MAX, FALSE, XA_STRING,
+ &type, &format, &nItems, &bytesAfter,
+ (unsigned char **) &str);
if (result != Success)
- return "";
+ return "";
if (type != XA_STRING)
{
- XFree (str);
- return "";
+ XFree (str);
+ return "";
}
- retval = CompString ((const char *) str);
+ CompString retval = CompString ((const char *) str);
return retval;
}
@@ -500,28 +477,26 @@
{
if (window->state () & CompWindowStateStickyMask && madeSticky)
window->changeState (window->state () & ~CompWindowStateStickyMask);
- madeSticky = FALSE;
+
+ madeSticky = false;
}
void
WorkaroundsWindow::updateSticky ()
{
- Bool makeSticky = FALSE;
+ bool makeSticky = false;
WORKAROUNDS_SCREEN (screen);
if (ws->optionGetStickyAlldesktops () && window->desktop () == 0xffffffff &&
ws->optionGetAlldesktopStickyMatch ().evaluate (window))
- makeSticky = TRUE;
+ makeSticky = true;
- if (makeSticky)
+ if (makeSticky &&
+ !(window->state () & CompWindowStateStickyMask))
{
- if (!(window->state () & CompWindowStateStickyMask))
- {
- madeSticky = TRUE;
- window->changeState (
- window->state () | CompWindowStateStickyMask);
- }
+ madeSticky = true;
+ window->changeState (window->state () | CompWindowStateStickyMask);
}
else
removeSticky ();
@@ -530,10 +505,7 @@
void
WorkaroundsWindow::updateUrgencyState ()
{
- Bool urgent;
- XWMHints *xwmh;
-
- xwmh = XGetWMHints (screen->dpy (), window->id ());
+ XWMHints *xwmh = XGetWMHints (screen->dpy (), window->id ());
if (!xwmh)
{
@@ -541,19 +513,19 @@
return;
}
- urgent = (xwmh->flags & XUrgencyHint);
+ bool urgent = (xwmh->flags & XUrgencyHint);
XFree (xwmh);
if (urgent)
{
- madeDemandAttention = TRUE;
+ madeDemandAttention = true;
window->changeState (window->state () |
CompWindowStateDemandsAttentionMask);
}
else if (madeDemandAttention)
{
- madeDemandAttention = FALSE;
+ madeDemandAttention = false;
window->changeState (window->state () &
~CompWindowStateDemandsAttentionMask);
}
@@ -567,20 +539,18 @@
void
WorkaroundsScreen::setWindowState (unsigned int state, Window id)
{
- int i = 0;
Atom data[32];
- i = compiz::window::fillStateData (state, data);
+ int i = compiz::window::fillStateData (state, data);
XChangeProperty (screen->dpy (), id, Atoms::winState,
- XA_ATOM, 32, PropModeReplace,
- (unsigned char *) data, i);
+ XA_ATOM, 32, PropModeReplace,
+ (unsigned char *) data, i);
}
void
WorkaroundsWindow::getAllowedActions (unsigned int &setActions,
unsigned int &clearActions)
{
-
window->getAllowedActions (setActions, clearActions);
if (isFullscreen)
@@ -590,8 +560,7 @@
void
WorkaroundsWindow::fixupFullscreen ()
{
- Bool isFullSize;
- BoxPtr box;
+ bool isFullSize;
WORKAROUNDS_SCREEN (screen);
@@ -599,15 +568,13 @@
return;
if (window->wmType () & CompWindowTypeDesktopMask)
- {
/* desktop windows are implicitly fullscreen */
- isFullSize = FALSE;
- }
+ isFullSize = false;
else
{
/* get output region for window */
int output = screen->outputDeviceForGeometry (window->geometry ());
- box = &screen->outputDevs ().at (output).region ()->extents;
+ BoxPtr box = &screen->outputDevs ().at (output).region ()->extents;
/* does the size match the output rectangle? */
isFullSize = (window->serverX () == box->x1) &&
@@ -616,15 +583,11 @@
(window->serverHeight () == (box->y2 - box->y1));
/* if not, check if it matches the whole screen */
- if (!isFullSize)
- {
- if ((window->serverX () == 0) && (window->serverY () == 0) &&
- (window->serverWidth () == screen->width ()) &&
- (window->serverHeight () == screen->height ()))
- {
- isFullSize = TRUE;
- }
- }
+ if (!isFullSize &&
+ (window->serverX () == 0) && (window->serverY () == 0) &&
+ (window->serverWidth () == screen->width ()) &&
+ (window->serverHeight () == screen->height ()))
+ isFullSize = true;
}
isFullscreen = isFullSize;
@@ -650,7 +613,6 @@
(window->state () & CompWindowStateFullscreenMask))
{
/* did we set the flag? */
-
foreach (Window mfw, ws->mfwList)
{
if (mfw == window->id ())
@@ -681,7 +643,7 @@
{
if (newWmType != window->wmType ())
{
- adjustedWinType = TRUE;
+ adjustedWinType = true;
oldWmType = window->wmType ();
window->recalcType ();
@@ -696,13 +658,12 @@
unsigned int
WorkaroundsWindow::getFixedWindowType ()
{
- unsigned int newWmType;
XClassHint classHint;
CompString resName;
WORKAROUNDS_SCREEN (screen);
- newWmType = window->wmType ();
+ unsigned int newWmType = window->wmType ();
if (!XGetClassHint (screen->dpy (), window->id (), &classHint))
return newWmType;
@@ -712,88 +673,74 @@
resName = CompString (classHint.res_name);
XFree (classHint.res_name);
}
-
+
if (classHint.res_class)
- {
XFree (classHint.res_class);
- }
/* FIXME: Is this the best way to detect a notification type window? */
if (ws->optionGetNotificationDaemonFix ())
- {
- if (newWmType == CompWindowTypeNormalMask &&
- window->overrideRedirect () && !resName.empty () &&
- resName.compare("notification-daemon") == 0)
- {
- newWmType = CompWindowTypeNotificationMask;
- return newWmType;
- }
- }
-
- if (ws->optionGetFirefoxMenuFix ())
- {
- if (newWmType == CompWindowTypeNormalMask &&
- window->overrideRedirect () && !resName.empty ())
- {
- if ((resName.compare ( "gecko") == 0) ||
- (resName.compare ( "popup") == 0))
- {
- newWmType = CompWindowTypeDropdownMenuMask;
- return newWmType;
- }
- }
- }
-
- if (ws->optionGetOooMenuFix ())
- {
- if (newWmType == CompWindowTypeNormalMask &&
- window->overrideRedirect () && !resName.empty ())
- {
- if (resName.compare ( "VCLSalFrame") == 0)
- {
- newWmType = CompWindowTypeDropdownMenuMask;
- return newWmType;
- }
- }
- }
+ if (newWmType == CompWindowTypeNormalMask &&
+ window->overrideRedirect () && !resName.empty () &&
+ resName.compare("notification-daemon") == 0)
+ {
+ newWmType = CompWindowTypeNotificationMask;
+ return newWmType;
+ }
+
+ if (ws->optionGetFirefoxMenuFix () &&
+ newWmType == CompWindowTypeNormalMask &&
+ window->overrideRedirect () && !resName.empty () &&
+ ((resName.compare ( "gecko") == 0) ||
+ (resName.compare ( "popup") == 0)))
+ {
+ newWmType = CompWindowTypeDropdownMenuMask;
+ return newWmType;
+ }
+
+ if (ws->optionGetOooMenuFix () &&
+ newWmType == CompWindowTypeNormalMask &&
+ window->overrideRedirect () && !resName.empty () &&
+ resName.compare ( "VCLSalFrame") == 0)
+ {
+ newWmType = CompWindowTypeDropdownMenuMask;
+ return newWmType;
+ }
+
/* FIXME: Basic hack to get Java windows working correctly. */
if (ws->optionGetJavaFix () && !resName.empty ())
{
- if ((resName.compare ( "sun-awt-X11-XMenuWindow") == 0) ||
- (resName.compare ( "sun-awt-X11-XWindowPeer") == 0))
- {
- newWmType = CompWindowTypeDropdownMenuMask;
- return newWmType;
- }
- else if (resName.compare ( "sun-awt-X11-XDialogPeer") == 0)
- {
- newWmType = CompWindowTypeDialogMask;
- return newWmType;
- }
- else if (resName.compare ( "sun-awt-X11-XFramePeer") == 0)
- {
- newWmType = CompWindowTypeNormalMask;
- return newWmType;
- }
+ if ((resName.compare ( "sun-awt-X11-XMenuWindow") == 0) ||
+ (resName.compare ( "sun-awt-X11-XWindowPeer") == 0))
+ {
+ newWmType = CompWindowTypeDropdownMenuMask;
+ return newWmType;
+ }
+ else if (resName.compare ( "sun-awt-X11-XDialogPeer") == 0)
+ {
+ newWmType = CompWindowTypeDialogMask;
+ return newWmType;
+ }
+ else if (resName.compare ( "sun-awt-X11-XFramePeer") == 0)
+ {
+ newWmType = CompWindowTypeNormalMask;
+ return newWmType;
+ }
}
if (ws->optionGetQtFix ())
{
- CompString windowRole;
-
- /* fix tooltips */
- windowRole = getRoleAtom ();
- if (!windowRole.empty ())
- {
- if ((windowRole.compare ("toolTipTip") == 0) ||
- (windowRole.compare ("qtooltip_label") == 0))
- {
- newWmType = CompWindowTypeTooltipMask;
- return newWmType;
- }
- }
-
- /* fix Qt transients - FIXME: is there a better way to detect them? */
+ /* fix tooltips */
+ CompString windowRole = getRoleAtom ();
+
+ if (!windowRole.empty () &&
+ ((windowRole.compare ("toolTipTip") == 0) ||
+ (windowRole.compare ("qtooltip_label") == 0)))
+ {
+ newWmType = CompWindowTypeTooltipMask;
+ return newWmType;
+ }
+
+ /* fix Qt transients - FIXME: is there a better way to detect them? */
if (resName.empty () && window->overrideRedirect () &&
(window->windowClass () == InputOutput) &&
(newWmType == CompWindowTypeUnknownMask))
@@ -807,7 +754,7 @@
}
void
-WorkaroundsScreen::optionChanged (CompOption *opt,
+WorkaroundsScreen::optionChanged (CompOption *opt,
WorkaroundsOptions::Options num)
{
checkFunctions (true, true);
@@ -829,48 +776,49 @@
#endif
if (optionGetKeepMinimizedWindows ())
- {
foreach (CompWindow *window, screen->windows ())
{
WORKAROUNDS_WINDOW (window);
bool m = window->minimized ();
+
if (m)
window->unminimize ();
+
window->minimizeSetEnabled (ww, true);
window->unminimizeSetEnabled (ww, true);
window->minimizedSetEnabled (ww, true);
+
if (m)
window->minimize ();
}
- }
else
- {
foreach (CompWindow *window, screen->windows ())
{
WORKAROUNDS_WINDOW (window);
bool m = window->minimized ();
+
if (m)
window->unminimize ();
+
window->minimizeSetEnabled (ww, false);
window->unminimizeSetEnabled (ww, false);
window->minimizedSetEnabled (ww, false);
+
if (m)
{
ww->isMinimized = false;
window->minimize ();
}
}
- }
}
void
-WorkaroundsScreen::handleCompizEvent (const char *pluginName,
- const char *eventName,
- CompOption::Vector &o)
+WorkaroundsScreen::handleCompizEvent (const char *pluginName,
+ const char *eventName,
+ CompOption::Vector &o)
{
if (strncmp (pluginName, "animation", 9) == 0 &&
strncmp (eventName, "window_animation", 16) == 0)
- {
if (CompOption::getStringOptionNamed (o, "type", "") == "minimize")
{
CompWindow *w = screen->findWindow (CompOption::getIntOptionNamed (
@@ -883,7 +831,6 @@
minimizingWindows.remove (w);
}
}
- }
if (!CompOption::getBoolOptionNamed (o, "active", false) &&
minimizingWindows.empty ())
@@ -897,9 +844,11 @@
{
CompWindow *w;
- switch (event->type) {
+ switch (event->type)
+ {
case ConfigureRequest:
w = screen->findWindow (event->xconfigurerequest.window);
+
if (w)
{
WORKAROUNDS_WINDOW (w);
@@ -907,9 +856,12 @@
if (ww->madeFullscreen)
w->changeState (w->state () &= ~CompWindowStateFullscreenMask);
}
+
break;
+
case MapRequest:
w = screen->findWindow (event->xmaprequest.window);
+
if (w)
{
WORKAROUNDS_WINDOW (w);
@@ -917,86 +869,104 @@
ww->updateFixedWindow (ww->getFixedWindowType ());
ww->fixupFullscreen ();
}
+
break;
+
case MapNotify:
w = screen->findWindow (event->xmap.window);
+
if (w && w->overrideRedirect ())
{
WORKAROUNDS_WINDOW (w);
ww->updateFixedWindow (ww->getFixedWindowType ());
}
+
break;
+
case DestroyNotify:
w = screen->findWindow (event->xdestroywindow.window);
+
if (w)
removeFromFullscreenList (w);
+
break;
}
screen->handleEvent (event);
- switch (event->type) {
- case ConfigureRequest:
- w = screen->findWindow (event->xconfigurerequest.window);
- if (w)
- {
- WORKAROUNDS_WINDOW (w);
-
- if (ww->madeFullscreen)
- w->state () |= CompWindowStateFullscreenMask;
- }
- break;
- case ClientMessage:
- if (event->xclient.message_type == Atoms::winDesktop)
- {
- w = screen->findWindow (event->xclient.window);
- if (w)
- {
- WORKAROUNDS_WINDOW (w);
- ww->updateSticky ();
- }
- }
- break;
- case PropertyNotify:
- if ((event->xproperty.atom == XA_WM_CLASS) ||
- (event->xproperty.atom == Atoms::winType))
- {
- w = screen->findWindow (event->xproperty.window);
- if (w)
- {
- WORKAROUNDS_WINDOW (w);
- ww->updateFixedWindow (ww->getFixedWindowType ());
- }
- }
- else if (event->xproperty.atom == XA_WM_HINTS)
- {
- if (optionGetConvertUrgency ())
+ switch (event->type)
+ {
+ case ConfigureRequest:
+ w = screen->findWindow (event->xconfigurerequest.window);
+
+ if (w)
+ {
+ WORKAROUNDS_WINDOW (w);
+
+ if (ww->madeFullscreen)
+ w->state () |= CompWindowStateFullscreenMask;
+ }
+
+ break;
+
+ case ClientMessage:
+ if (event->xclient.message_type == Atoms::winDesktop)
+ {
+ w = screen->findWindow (event->xclient.window);
+
+ if (w)
+ {
+ WORKAROUNDS_WINDOW (w);
+ ww->updateSticky ();
+ }
+ }
+
+ break;
+
+ case PropertyNotify:
+ if ((event->xproperty.atom == XA_WM_CLASS) ||
+ (event->xproperty.atom == Atoms::winType))
{
w = screen->findWindow (event->xproperty.window);
+
if (w)
{
WORKAROUNDS_WINDOW (w);
- ww->updateUrgencyState ();
- }
- }
- }
- else if (event->xproperty.atom == Atoms::clientList) {
- if (optionGetJavaTaskbarFix ()) {
- foreach (CompWindow *w, screen->windows ()) {
+ ww->updateFixedWindow (ww->getFixedWindowType ());
+ }
+ }
+ else if (event->xproperty.atom == XA_WM_HINTS)
+ {
+ if (optionGetConvertUrgency ())
+ {
+ w = screen->findWindow (event->xproperty.window);
+
+ if (w)
+ {
+ WORKAROUNDS_WINDOW (w);
+ ww->updateUrgencyState ();
+ }
+ }
+ }
+ else if (event->xproperty.atom == Atoms::clientList &&
+ optionGetJavaTaskbarFix ())
+ {
+ foreach (CompWindow *w, screen->windows ())
if (w->managed ())
setWindowState (w->state (), w->id ());
- }
}
- }
- break;
- default:
- break;
+ break;
+
+ default:
+ break;
}
}
void
-WorkaroundsWindow::resizeNotify (int dx, int dy,
- int dwidth, int dheight)
+WorkaroundsWindow::resizeNotify (int dx,
+ int dy,
+ int dwidth,
+ int dheight)
{
if (window->isViewable ())
fixupFullscreen ();
@@ -1033,7 +1003,6 @@
optionSetAiglxFragmentFixNotify (boost::bind (
&WorkaroundsScreen::optionChanged, this,
_1, _2));
-
optionSetFglrxXglFixNotify (boost::bind (
&WorkaroundsScreen::optionChanged, this,
_1, _2));
@@ -1052,7 +1021,7 @@
{
origProgramEnvParameter4f = GL::programEnvParameter4f;
programEnvParameter4dv = (GLProgramParameter4dvProc)
- gScreen->getProcAddress ("glProgramEnvParameter4dvARB");
+ gScreen->getProcAddress ("glProgramEnvParameter4dvARB");
origCopySubBuffer = GL::copySubBuffer;
origGetVideoSync = GL::getVideoSync;
@@ -1108,6 +1077,7 @@
window->getAllowedActionsSetEnabled (this, false);
window->resizeNotifySetEnabled (this, false);
}
+
if (ws->optionGetKeepMinimizedWindows ())
{
window->minimizeSetEnabled (this, true);
@@ -1116,7 +1086,6 @@
}
}
-
WorkaroundsWindow::~WorkaroundsWindow ()
{
WORKAROUNDS_SCREEN (screen);
@@ -1156,9 +1125,7 @@
}
if (window->state () & CompWindowStateStickyMask && madeSticky)
- {
window->state () &= ~CompWindowStateStickyMask;
- }
}
ws->skipTransients = false;
@@ -1167,8 +1134,13 @@
bool
WorkaroundsPluginVTable::init ()
{
+<<<<<<< TREE
if (CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
+=======
+ if ((CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI)) &&
+ (CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI)))
+>>>>>>> MERGE-SOURCE
haveOpenGL = true;
else
haveOpenGL = false;
=== modified file 'plugins/workarounds/src/workarounds.h'
--- plugins/workarounds/src/workarounds.h 2012-12-10 03:28:47 +0000
+++ plugins/workarounds/src/workarounds.h 2013-07-21 23:03:28 +0000
@@ -57,15 +57,15 @@
WorkaroundsScreen (CompScreen *);
~WorkaroundsScreen ();
- CompositeScreen *cScreen;
- GLScreen *gScreen;
-
- Atom roleAtom;
- std::list mfwList;
- CompWindowList minimizingWindows;
- bool skipTransients;
-
- PropertyWriter inputDisabledAtom;
+ CompositeScreen *cScreen;
+ GLScreen *gScreen;
+
+ Atom roleAtom;
+ std::list mfwList;
+ CompWindowList minimizingWindows;
+ bool skipTransients;
+
+ PropertyWriter inputDisabledAtom;
#ifndef USE_GLES
GL::GLProgramParameter4fProc origProgramEnvParameter4f;
@@ -85,14 +85,14 @@
bool
glPaintOutput (const GLScreenPaintAttrib &,
- const GLMatrix &,
- const CompRegion &,
- CompOutput *,
- unsigned int );
+ const GLMatrix &,
+ const CompRegion &,
+ CompOutput *,
+ unsigned int );
void
- handleCompizEvent (const char *pluginName,
- const char *eventName,
+ handleCompizEvent (const char *pluginName,
+ const char *eventName,
CompOption::Vector &o);
void
@@ -108,14 +108,16 @@
updateVideoSyncFix ();
void
- optionChanged (CompOption *opt,
- WorkaroundsOptions::Options num);
-
- void
- checkFunctions (bool window, bool screen);
-
- void
- setWindowState (unsigned int state, Window id);
+ optionChanged (CompOption *opt,
+ WorkaroundsOptions::Options num);
+
+ void
+ checkFunctions (bool window,
+ bool screen);
+
+ void
+ setWindowState (unsigned int state,
+ Window id);
};
@@ -131,15 +133,16 @@
{
public:
- typedef struct _HideInfo {
- Window shapeWindow;
+ typedef struct _HideInfo
+ {
+ Window shapeWindow;
unsigned long skipState;
unsigned long shapeMask;
- XRectangle *inputRects;
- int nInputRects;
- int inputRectOrdering;
+ XRectangle *inputRects;
+ int nInputRects;
+ int inputRectOrdering;
} HideInfo;
@@ -148,26 +151,29 @@
WorkaroundsWindow (CompWindow *);
~WorkaroundsWindow ();
- CompWindow *window;
+ CompWindow *window;
CompositeWindow *cWindow;
- GLWindow *gWindow;
-
- bool adjustedWinType;
- bool madeSticky;
- bool madeFullscreen;
- bool isFullscreen;
- bool madeDemandAttention;
- bool isMinimized;
-
- unsigned int oldWmType;
-
- HideInfo *windowHideInfo;
+ GLWindow *gWindow;
+
+ bool adjustedWinType;
+ bool madeSticky;
+ bool madeFullscreen;
+ bool isFullscreen;
+ bool madeDemandAttention;
+ bool isMinimized;
+
+ unsigned int oldWmType;
+
+ HideInfo *windowHideInfo;
bool
isGroupTransient (Window);
void
- resizeNotify (int, int, int, int);
+ resizeNotify (int,
+ int,
+ int,
+ int);
void
getAllowedActions (unsigned int &,
@@ -177,8 +183,10 @@
void unminimize ();
bool minimized () const;
- bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
- const CompRegion &, unsigned int);
+ bool glPaint (const GLWindowPaintAttrib &,
+ const GLMatrix &,
+ const CompRegion &,
+ unsigned int );
void setVisibility (bool);
void restoreInputShape (HideInfo *);
@@ -206,8 +214,8 @@
getFixedWindowType ();
bool
- damageRect (bool initial, const CompRect &rect);
-
+ damageRect (bool initial,
+ const CompRect &rect);
};
#define WORKAROUNDS_WINDOW(w) \
=== modified file 'plugins/workspacenames/src/workspacenames.cpp'
--- plugins/workspacenames/src/workspacenames.cpp 2013-05-10 09:23:25 +0000
+++ plugins/workspacenames/src/workspacenames.cpp 2013-07-21 23:03:28 +0000
@@ -37,8 +37,12 @@
int listSize = MIN (vpNumbers.size (), names.size ());
+<<<<<<< TREE
for (int i = 0; i < listSize; ++i)
{
+=======
+ for (int i = 0; i < listSize; ++i)
+>>>>>>> MERGE-SOURCE
if (vpNumbers[i].i () == currentVp)
return names[i].s ();
}
@@ -59,10 +63,28 @@
return;
/* 75% of the output device as maximum width */
- attrib.maxWidth = screen->getCurrentOutputExtents ().width () * 3 / 4;
+ attrib.maxWidth = screen->getCurrentOutputExtents ().width () * 0.75;
attrib.maxHeight = 100;
- attrib.family = "Sans";
+ int family = optionGetFontFamily ();
+ const char *familyString;
+
+ if (family == 0)
+ familyString = "cairo:serif";
+
+ if (family == 1)
+ familyString = "cairo:sans-serif";
+
+ if (family == 2)
+ familyString = "cairo:cursive";
+
+ if (family == 3)
+ familyString = "cairo:fantasy";
+
+ if (family == 4)
+ familyString = "cairo:monospace";
+
+ attrib.family = familyString;
attrib.size = optionGetTextFontSize ();
attrib.color[0] = optionGetFontColorRed ();
@@ -88,10 +110,17 @@
CompPoint
WSNamesScreen::getTextPlacementPosition ()
{
+<<<<<<< TREE
CompRect oe = screen->getCurrentOutputExtents ();
float x = oe.centerX () - textData.getWidth () / 2;
float y = 0;
unsigned short verticalOffset = optionGetVerticalOffset ();
+=======
+ CompRect oe = screen->getCurrentOutputExtents ();
+ float x = oe.centerX () - textData.getWidth () / 2;
+ float y = 0;
+ unsigned short verticalOffset = optionGetVerticalOffset ();
+>>>>>>> MERGE-SOURCE
switch (optionGetTextPlacement ())
{
@@ -141,7 +170,7 @@
void
WSNamesScreen::drawText (const GLMatrix &matrix)
{
- GLfloat alpha = 0.0f;
+ GLfloat alpha = 0.0f;
/* assign y (for the lower corner!) according to the setting */
const CompPoint p = getTextPlacementPosition ();
@@ -187,7 +216,7 @@
if (timer)
{
timer -= msSinceLastPaint;
- timer = MAX (timer, 0);
+ timer = std::max (timer, 0);
}
cScreen->preparePaint (msSinceLastPaint);
@@ -251,7 +280,7 @@
PluginClassHandler (screen),
cScreen (CompositeScreen::get (screen)),
gScreen (GLScreen::get (screen)),
- timer (0)
+ timer (0)
{
ScreenInterface::setHandler (screen, true);
CompositeScreenInterface::setHandler (cScreen, true);
=== modified file 'plugins/workspacenames/workspacenames.xml.in'
--- plugins/workspacenames/workspacenames.xml.in 2013-04-26 07:43:10 +0000
+++ plugins/workspacenames/workspacenames.xml.in 2013-07-21 23:03:28 +0000
@@ -66,9 +66,50 @@
<_short>Text Display
+
+ <_short>Font Family
+ <_long>Selects the font family.
+ 0
+ 0
+ 4
+
+ 0
+ <_name>Serif
+
+
+ 1
+ <_name>Sans-serif
+
+
+ 2
+ <_name>Cursive
+
+
+ 3
+ <_name>Fantasy
+
+
+ 4
+ <_name>Monospace
+
+
<_short>Bold Font
- <_long>Render the workspacename using a bold font.
+<<<<<<< TREE
+ <_long>Render the workspacename using a bold font.
+=======
+ <_long>Render the workspacename using a bold font.
+ true
+
+
+ <_short>Italic Font
+ <_long>Render the workspacename using an italic font.
+ true
+
+
+ <_short>Oblique Font
+ <_long>Render the workspacename using an oblique font.
+>>>>>>> MERGE-SOURCE
true
@@ -107,6 +148,16 @@
<_short>Colors
+
+ <_short>Font Color
+ <_long>Font color and opacity of the workspacename display.
+
+ 0xffff
+ 0xffff
+ 0xffff
+ 0xffff
+
+
<_short>Background Color
<_long>Background color and opacity of the workspacename display.
@@ -117,6 +168,7 @@
0x9999
+<<<<<<< TREE
<_short>Font Color
<_long>Font color and opacity of the workspacename display.
@@ -127,6 +179,8 @@
0xffff
+=======
+>>>>>>> MERGE-SOURCE
=== modified file 'src/asyncserverwindow.h'
--- src/asyncserverwindow.h 2012-12-13 11:12:32 +0000
+++ src/asyncserverwindow.h 2013-07-21 23:03:28 +0000
@@ -39,11 +39,15 @@
virtual int requestConfigureOnClient (const XWindowChanges &xwc,
unsigned int valueMask) = 0;
+
virtual int requestConfigureOnWrapper (const XWindowChanges &xwc,
unsigned int valueMask) = 0;
+
virtual int requestConfigureOnFrame (const XWindowChanges &xwc,
unsigned int valueMask) = 0;
+
virtual void sendSyntheticConfigureNotify () = 0;
+
virtual bool hasCustomShape () const = 0;
};
}
=== modified file 'src/atoms.cpp'
--- src/atoms.cpp 2012-01-19 17:44:32 +0000
+++ src/atoms.cpp 2013-07-21 23:03:28 +0000
@@ -27,7 +27,8 @@
#include
-namespace Atoms {
+namespace Atoms
+{
Atom supported;
Atom supportingWmCheck;
@@ -164,30 +165,21 @@
wmName = XInternAtom (dpy, "_NET_WM_NAME", 0);
winType = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE", 0);
- winTypeDesktop = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_DESKTOP",
- 0);
+ winTypeDesktop = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_DESKTOP", 0);
winTypeDock = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_DOCK", 0);
- winTypeToolbar = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_TOOLBAR",
- 0);
+ winTypeToolbar = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_TOOLBAR", 0);
winTypeMenu = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_MENU", 0);
- winTypeUtil = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_UTILITY",
- 0);
+ winTypeUtil = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_UTILITY", 0);
winTypeSplash = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_SPLASH", 0);
winTypeDialog = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_DIALOG", 0);
winTypeNormal = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_NORMAL", 0);
- winTypeDropdownMenu =
- XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", 0);
- winTypePopupMenu =
- XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_POPUP_MENU", 0);
- winTypeTooltip =
- XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_TOOLTIP", 0);
- winTypeNotification =
- XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_NOTIFICATION", 0);
- winTypeCombo =
- XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_COMBO", 0);
- winTypeDnd =
- XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_DND", 0);
+ winTypeDropdownMenu = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", 0);
+ winTypePopupMenu = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_POPUP_MENU", 0);
+ winTypeTooltip = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_TOOLTIP", 0);
+ winTypeNotification = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_NOTIFICATION", 0);
+ winTypeCombo = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_COMBO", 0);
+ winTypeDnd = XInternAtom (dpy, "_NET_WM_WINDOW_TYPE_DND", 0);
winOpacity = XInternAtom (dpy, "_NET_WM_WINDOW_OPACITY", 0);
winBrightness = XInternAtom (dpy, "_NET_WM_WINDOW_BRIGHTNESS", 0);
@@ -202,59 +194,34 @@
currentDesktop = XInternAtom (dpy, "_NET_CURRENT_DESKTOP", 0);
numberOfDesktops = XInternAtom (dpy, "_NET_NUMBER_OF_DESKTOPS", 0);
- winState = XInternAtom (dpy, "_NET_WM_STATE", 0);
- winStateModal =
- XInternAtom (dpy, "_NET_WM_STATE_MODAL", 0);
- winStateSticky =
- XInternAtom (dpy, "_NET_WM_STATE_STICKY", 0);
- winStateMaximizedVert =
- XInternAtom (dpy, "_NET_WM_STATE_MAXIMIZED_VERT", 0);
- winStateMaximizedHorz =
- XInternAtom (dpy, "_NET_WM_STATE_MAXIMIZED_HORZ", 0);
- winStateShaded =
- XInternAtom (dpy, "_NET_WM_STATE_SHADED", 0);
- winStateSkipTaskbar =
- XInternAtom (dpy, "_NET_WM_STATE_SKIP_TASKBAR", 0);
- winStateSkipPager =
- XInternAtom (dpy, "_NET_WM_STATE_SKIP_PAGER", 0);
- winStateHidden =
- XInternAtom (dpy, "_NET_WM_STATE_HIDDEN", 0);
- winStateFullscreen =
- XInternAtom (dpy, "_NET_WM_STATE_FULLSCREEN", 0);
- winStateAbove =
- XInternAtom (dpy, "_NET_WM_STATE_ABOVE", 0);
- winStateBelow =
- XInternAtom (dpy, "_NET_WM_STATE_BELOW", 0);
- winStateDemandsAttention =
- XInternAtom (dpy, "_NET_WM_STATE_DEMANDS_ATTENTION", 0);
- winStateDisplayModal =
- XInternAtom (dpy, "_NET_WM_STATE_DISPLAY_MODAL", 0);
- winStateFocused =
- XInternAtom (dpy, "_NET_WM_STATE_FOCUSED", 0);
+ winState = XInternAtom (dpy, "_NET_WM_STATE", 0);
+ winStateModal = XInternAtom (dpy, "_NET_WM_STATE_MODAL", 0);
+ winStateSticky = XInternAtom (dpy, "_NET_WM_STATE_STICKY", 0);
+ winStateMaximizedVert = XInternAtom (dpy, "_NET_WM_STATE_MAXIMIZED_VERT", 0);
+ winStateMaximizedHorz = XInternAtom (dpy, "_NET_WM_STATE_MAXIMIZED_HORZ", 0);
+ winStateShaded = XInternAtom (dpy, "_NET_WM_STATE_SHADED", 0);
+ winStateSkipTaskbar = XInternAtom (dpy, "_NET_WM_STATE_SKIP_TASKBAR", 0);
+ winStateSkipPager = XInternAtom (dpy, "_NET_WM_STATE_SKIP_PAGER", 0);
+ winStateHidden = XInternAtom (dpy, "_NET_WM_STATE_HIDDEN", 0);
+ winStateFullscreen = XInternAtom (dpy, "_NET_WM_STATE_FULLSCREEN", 0);
+ winStateAbove = XInternAtom (dpy, "_NET_WM_STATE_ABOVE", 0);
+ winStateBelow = XInternAtom (dpy, "_NET_WM_STATE_BELOW", 0);
+ winStateDemandsAttention = XInternAtom (dpy, "_NET_WM_STATE_DEMANDS_ATTENTION", 0);
+ winStateDisplayModal = XInternAtom (dpy, "_NET_WM_STATE_DISPLAY_MODAL", 0);
+ winStateFocused = XInternAtom (dpy, "_NET_WM_STATE_FOCUSED", 0);
winActionMove = XInternAtom (dpy, "_NET_WM_ACTION_MOVE", 0);
- winActionResize =
- XInternAtom (dpy, "_NET_WM_ACTION_RESIZE", 0);
- winActionStick =
- XInternAtom (dpy, "_NET_WM_ACTION_STICK", 0);
- winActionMinimize =
- XInternAtom (dpy, "_NET_WM_ACTION_MINIMIZE", 0);
- winActionMaximizeHorz =
- XInternAtom (dpy, "_NET_WM_ACTION_MAXIMIZE_HORZ", 0);
- winActionMaximizeVert =
- XInternAtom (dpy, "_NET_WM_ACTION_MAXIMIZE_VERT", 0);
- winActionFullscreen =
- XInternAtom (dpy, "_NET_WM_ACTION_FULLSCREEN", 0);
- winActionClose =
- XInternAtom (dpy, "_NET_WM_ACTION_CLOSE", 0);
- winActionShade =
- XInternAtom (dpy, "_NET_WM_ACTION_SHADE", 0);
- winActionChangeDesktop =
- XInternAtom (dpy, "_NET_WM_ACTION_CHANGE_DESKTOP", 0);
- winActionAbove =
- XInternAtom (dpy, "_NET_WM_ACTION_ABOVE", 0);
- winActionBelow =
- XInternAtom (dpy, "_NET_WM_ACTION_BELOW", 0);
+ winActionResize = XInternAtom (dpy, "_NET_WM_ACTION_RESIZE", 0);
+ winActionStick = XInternAtom (dpy, "_NET_WM_ACTION_STICK", 0);
+ winActionMinimize = XInternAtom (dpy, "_NET_WM_ACTION_MINIMIZE", 0);
+ winActionMaximizeHorz = XInternAtom (dpy, "_NET_WM_ACTION_MAXIMIZE_HORZ", 0);
+ winActionMaximizeVert = XInternAtom (dpy, "_NET_WM_ACTION_MAXIMIZE_VERT", 0);
+ winActionFullscreen = XInternAtom (dpy, "_NET_WM_ACTION_FULLSCREEN", 0);
+ winActionClose = XInternAtom (dpy, "_NET_WM_ACTION_CLOSE", 0);
+ winActionShade = XInternAtom (dpy, "_NET_WM_ACTION_SHADE", 0);
+ winActionChangeDesktop = XInternAtom (dpy, "_NET_WM_ACTION_CHANGE_DESKTOP", 0);
+ winActionAbove = XInternAtom (dpy, "_NET_WM_ACTION_ABOVE", 0);
+ winActionBelow = XInternAtom (dpy, "_NET_WM_ACTION_BELOW", 0);
wmAllowedActions = XInternAtom (dpy, "_NET_WM_ALLOWED_ACTIONS", 0);
@@ -267,8 +234,7 @@
wmIconGeometry = XInternAtom (dpy, "_NET_WM_ICON_GEOMETRY", 0);
clientList = XInternAtom (dpy, "_NET_CLIENT_LIST", 0);
- clientListStacking =
- XInternAtom (dpy, "_NET_CLIENT_LIST_STACKING", 0);
+ clientListStacking = XInternAtom (dpy, "_NET_CLIENT_LIST_STACKING", 0);
frameExtents = XInternAtom (dpy, "_NET_FRAME_EXTENTS", 0);
frameWindow = XInternAtom (dpy, "_NET_FRAME_WINDOW", 0);
@@ -283,11 +249,9 @@
wmPing = XInternAtom (dpy, "_NET_WM_PING", 0);
wmSyncRequest = XInternAtom (dpy, "_NET_WM_SYNC_REQUEST", 0);
- wmSyncRequestCounter =
- XInternAtom (dpy, "_NET_WM_SYNC_REQUEST_COUNTER", 0);
+ wmSyncRequestCounter = XInternAtom (dpy, "_NET_WM_SYNC_REQUEST_COUNTER", 0);
- wmFullscreenMonitors =
- XInternAtom (dpy, "_NET_WM_FULLSCREEN_MONITORS", 0);
+ wmFullscreenMonitors = XInternAtom (dpy, "_NET_WM_FULLSCREEN_MONITORS", 0);
closeWindow = XInternAtom (dpy, "_NET_CLOSE_WINDOW", 0);
wmMoveResize = XInternAtom (dpy, "_NET_WM_MOVERESIZE", 0);
@@ -299,12 +263,9 @@
xBackground[0] = XInternAtom (dpy, "_XSETROOT_ID", 0);
xBackground[1] = XInternAtom (dpy, "_XROOTPMAP_ID", 0);
- toolkitAction =
- XInternAtom (dpy, "_COMPIZ_TOOLKIT_ACTION", 0);
- toolkitActionWindowMenu =
- XInternAtom (dpy, "_COMPIZ_TOOLKIT_ACTION_WINDOW_MENU", 0);
- toolkitActionForceQuitDialog =
- XInternAtom (dpy, "_COMPIZ_TOOLKIT_ACTION_FORCE_QUIT_DIALOG", 0);
+ toolkitAction = XInternAtom (dpy, "_COMPIZ_TOOLKIT_ACTION", 0);
+ toolkitActionWindowMenu = XInternAtom (dpy, "_COMPIZ_TOOLKIT_ACTION_WINDOW_MENU", 0);
+ toolkitActionForceQuitDialog = XInternAtom (dpy, "_COMPIZ_TOOLKIT_ACTION_FORCE_QUIT_DIALOG", 0);
mwmHints = XInternAtom (dpy, "_MOTIF_WM_HINTS", 0);
=== modified file 'src/configurerequestbuffer-impl.h'
--- src/configurerequestbuffer-impl.h 2012-12-13 11:12:32 +0000
+++ src/configurerequestbuffer-impl.h 2013-07-21 23:03:28 +0000
@@ -59,6 +59,7 @@
public Releasable
{
public:
+
typedef boost::shared_ptr Ptr;
virtual ~BufferLock () {}
@@ -89,9 +90,12 @@
void untrackLock (compiz::window::configure_buffers::BufferLock *lock);
- void pushClientRequest (const XWindowChanges &xwc, unsigned int mask);
- void pushWrapperRequest (const XWindowChanges &xwc, unsigned int mask);
- void pushFrameRequest (const XWindowChanges &xwc, unsigned int mask);
+ void pushClientRequest (const XWindowChanges &xwc,
+ unsigned int mask);
+ void pushWrapperRequest (const XWindowChanges &xwc,
+ unsigned int mask);
+ void pushFrameRequest (const XWindowChanges &xwc,
+ unsigned int mask);
void pushSyntheticConfigureNotify ();
compiz::window::configure_buffers::Releasable::Ptr obtainLock ();
=== modified file 'src/configurerequestbuffer.cpp'
--- src/configurerequestbuffer.cpp 2013-02-14 12:12:53 +0000
+++ src/configurerequestbuffer.cpp 2013-07-21 23:03:28 +0000
@@ -35,7 +35,7 @@
#endif
namespace crb = compiz::window::configure_buffers;
-namespace cw = compiz::window;
+namespace cw = compiz::window;
class crb::ConfigureRequestBuffer::Private
{
@@ -46,34 +46,34 @@
Private (cw::AsyncServerWindow *asyncServerWindow,
cw::SyncServerWindow *syncServerWindow,
const crb::ConfigureRequestBuffer::LockFactory &lockFactory) :
- clientChangeMask (0),
- wrapperChangeMask (0),
- frameChangeMask (0),
+ clientChangeMask (0),
+ wrapperChangeMask (0),
+ frameChangeMask (0),
sendSyntheticConfigure (false),
- lockCount (0),
- asyncServerWindow (asyncServerWindow),
- syncServerWindow (syncServerWindow),
- lockFactory (lockFactory)
+ lockCount (0),
+ asyncServerWindow (asyncServerWindow),
+ syncServerWindow (syncServerWindow),
+ lockFactory (lockFactory)
{
}
void dispatchConfigure (bool force = false);
- XWindowChanges clientChanges;
- unsigned int clientChangeMask;
-
- XWindowChanges wrapperChanges;
- unsigned int wrapperChangeMask;
-
- XWindowChanges frameChanges;
- unsigned int frameChangeMask;
-
- bool sendSyntheticConfigure;
-
- unsigned int lockCount;
-
- cw::AsyncServerWindow *asyncServerWindow;
- cw::SyncServerWindow *syncServerWindow;
+ XWindowChanges clientChanges;
+ unsigned int clientChangeMask;
+
+ XWindowChanges wrapperChanges;
+ unsigned int wrapperChangeMask;
+
+ XWindowChanges frameChanges;
+ unsigned int frameChangeMask;
+
+ bool sendSyntheticConfigure;
+
+ unsigned int lockCount;
+
+ cw::AsyncServerWindow *asyncServerWindow;
+ cw::SyncServerWindow *syncServerWindow;
crb::ConfigureRequestBuffer::LockFactory lockFactory;
std::vector locks;
@@ -91,9 +91,9 @@
* happens. Its a separate unit of work for improving resize
* performance anyways.
*/
- immediate |= (frameChangeMask & (CWWidth | CWHeight | CWBorderWidth));
+ immediate |= (frameChangeMask & (CWWidth | CWHeight | CWBorderWidth));
immediate |= (wrapperChangeMask & (CWWidth | CWHeight | CWBorderWidth | CWX | CWY));
- immediate |= (clientChangeMask & (CWWidth | CWHeight | CWBorderWidth | CWX | CWY));
+ immediate |= (clientChangeMask & (CWWidth | CWHeight | CWBorderWidth | CWX | CWY));
immediate |= force;
bool clientDispatch = (clientChangeMask & allEventMasks);
@@ -151,7 +151,7 @@
void
crb::ConfigureRequestBuffer::freeze ()
{
- priv->lockCount++;
+ ++priv->lockCount;
assert (priv->lockCount <= priv->locks.size ());
}
@@ -161,7 +161,7 @@
{
assert (priv->lockCount);
- priv->lockCount--;
+ --priv->lockCount;
priv->dispatchConfigure ();
}
@@ -303,8 +303,8 @@
priv->dispatchConfigure (true);
}
-crb::ConfigureRequestBuffer::ConfigureRequestBuffer (AsyncServerWindow *asyncServerWindow,
- SyncServerWindow *syncServerWindow,
+crb::ConfigureRequestBuffer::ConfigureRequestBuffer (AsyncServerWindow *asyncServerWindow,
+ SyncServerWindow *syncServerWindow,
const crb::ConfigureRequestBuffer::LockFactory &factory) :
priv (new crb::ConfigureRequestBuffer::Private (asyncServerWindow, syncServerWindow, factory))
{
@@ -326,7 +326,7 @@
Private (crb::CountedFreeze *freezable) :
freezable (freezable),
- armed (false)
+ armed (false)
{
}
=== modified file 'src/event.cpp'
--- src/event.cpp 2013-06-28 01:10:57 +0000
+++ src/event.cpp 2013-07-21 23:03:28 +0000
@@ -44,7 +44,7 @@
#include "eventmanagement.h"
namespace cps = compiz::private_screen;
-namespace ce = compiz::events;
+namespace ce = compiz::events;
namespace
{
@@ -54,7 +54,6 @@
}
}
-
bool
PrivateWindow::handleSyncAlarm ()
{
@@ -63,30 +62,26 @@
priv->syncWait = false;
if (window->resize (priv->syncGeometry))
- {
window->windowNotify (CompWindowNotifySyncAlarm);
- }
else
- {
/* resizeWindow failing means that there is another pending
resize and we must send a new sync request to the client */
window->sendSyncRequest ();
- }
}
return false;
}
-
static bool
autoRaiseTimeout (CompScreen *screen)
{
- CompWindow *w = screen->findWindow (screen->activeWindow ());
+ CompWindow *w = screen->findWindow (screen->activeWindow ());
if (screen->autoRaiseWindow () == screen->activeWindow () ||
(w && (screen->autoRaiseWindow () == w->transientFor ())))
{
w = screen->findWindow (screen->autoRaiseWindow ());
+
if (w)
w->updateAttributes (CompStackingUpdateModeNormal);
}
@@ -98,35 +93,27 @@
Mod3Mask | Mod4Mask | Mod5Mask | CompNoMask)
static bool
-isCallBackBinding (CompOption &option,
+isCallBackBinding (CompOption &option,
CompAction::BindingType type,
CompAction::State state)
{
- if (!option.isAction ())
- return false;
-
- if (!(option.value ().action ().type () & type))
- return false;
-
- if (!(option.value ().action ().state () & state))
- return false;
-
- if (!option.value ().action ().active ())
+ if (!option.isAction () ||
+ !(option.value ().action ().type () & type) ||
+ !(option.value ().action ().state () & state) ||
+ !option.value ().action ().active ())
return false;
return true;
}
static bool
-isInitiateBinding (CompOption &option,
+isInitiateBinding (CompOption &option,
CompAction::BindingType type,
CompAction::State state,
- CompAction **action)
+ CompAction **action)
{
- if (!isCallBackBinding (option, type, state))
- return false;
-
- if (option.value ().action ().initiate ().empty ())
+ if (!isCallBackBinding (option, type, state) ||
+ option.value ().action ().initiate ().empty ())
return false;
*action = &option.value ().action ();
@@ -135,10 +122,10 @@
}
static bool
-isBound (CompOption &option,
- CompAction::BindingType type,
- CompAction::State state,
- CompAction **action)
+isBound (CompOption &option,
+ CompAction::BindingType type,
+ CompAction::State state,
+ CompAction **action)
{
if (!isCallBackBinding (option, type, state))
return false;
@@ -150,46 +137,42 @@
bool
cps::EventManager::triggerPress (CompAction *action,
- CompAction::State state,
- CompOption::Vector &arguments)
+ CompAction::State state,
+ CompOption::Vector &arguments)
{
bool actionEventHandled = false;
if (state == CompAction::StateInitKey && grabsEmpty ())
- {
- possibleTap = action;
- }
+ possibleTap = action;
if (!action->initiate ().empty ())
{
if (action->initiate () (action, state, arguments))
actionEventHandled = true;
}
- else if (!action->terminate ().empty ())
- {
+ else if (!action->terminate ().empty () &&
+ state & CompAction::StateInitKey)
/* Default Initiate implementation for plugins that only
provide a Terminate callback */
- if (state & CompAction::StateInitKey)
- action->setState (action->state () | CompAction::StateTermKey);
- }
+ action->setState (action->state () | CompAction::StateTermKey);
return actionEventHandled;
}
bool
cps::EventManager::triggerRelease (CompAction *action,
- CompAction::State state,
- CompOption::Vector &arguments)
+ CompAction::State state,
+ CompOption::Vector &arguments)
{
if (action == possibleTap)
{
- state |= CompAction::StateTermTapped;
- possibleTap = NULL;
+ state |= CompAction::StateTermTapped;
+ possibleTap = NULL;
}
if (!action->terminate ().empty () &&
- action->terminate () (action, state, arguments))
- return true;
+ action->terminate () (action, state, arguments))
+ return true;
return false;
}
@@ -207,14 +190,11 @@
if (eventRoot != root)
return edge;
- if (eventWindow != edgeWindow)
- {
- if (grabList.grabsEmpty () ||
- eventRoot != root)
- return edge;
- }
+ if (eventWindow != edgeWindow &&
+ (grabList.grabsEmpty () || eventRoot != root))
+ return edge;
- for (unsigned int i = 0; i < SCREEN_EDGE_NUM; i++)
+ for (unsigned int i = 0; i < SCREEN_EDGE_NUM; ++i)
{
if (edgeWindow == screenEdge[i].id)
{
@@ -238,8 +218,8 @@
bool buttonActionModifiersMatchEventState (unsigned int actionModifiers,
unsigned int eventState)
{
- const unsigned int ignored = modHandler->ignoredModMask ();
- const unsigned int modMask = REAL_MOD_MASK & ~ignored;
+ const unsigned int ignored = modHandler->ignoredModMask ();
+ const unsigned int modMask = REAL_MOD_MASK & ~ignored;
const unsigned int bindMods = modHandler->virtualToRealModMask (actionModifiers);
return (bindMods & modMask) == (eventState & modMask);
@@ -257,18 +237,11 @@
CompAction *action;
const CompAction::State state = CompAction::StateInitButton;
- if (isBound (option, CompAction::BindingTypeButton, state, &action))
- {
- if (action->button ().button () == (int) eventButton)
- {
- if (matchEventState (action->button ().modifiers (),
- eventState))
- {
- if (eventManager.triggerPress (action, state, arguments))
- return true;
- }
- }
- }
+ if (isBound (option, CompAction::BindingTypeButton, state, &action) &&
+ action->button ().button () == (int) eventButton &&
+ matchEventState (action->button ().modifiers (), eventState) &&
+ eventManager.triggerPress (action, state, arguments))
+ return true;
return false;
}
@@ -286,22 +259,13 @@
const CompAction::State state = CompAction::StateInitButton |
CompAction::StateInitEdge;
- if (edge != -1)
- {
- if (isInitiateBinding (option, CompAction::BindingTypeEdgeButton,
- state, &action))
- {
- if ((action->button ().button () == (int) eventButton) &&
- (action->edgeMask () & edge))
- {
- if (matchEventState (action->button ().modifiers (),
- eventState))
- if (action->initiate () (action, state,
- arguments))
- return true;
- }
- }
- }
+ if (edge != -1 &&
+ isInitiateBinding (option, CompAction::BindingTypeEdgeButton, state, &action) &&
+ action->button ().button () == (int) eventButton &&
+ action->edgeMask () & edge &&
+ matchEventState (action->button ().modifiers (), eventState) &&
+ action->initiate () (action, state, arguments))
+ return true;
return false;
}
@@ -311,7 +275,7 @@
XButtonEvent *event,
CompOption::Vector &arguments)
{
- int edge = -1;
+ int edge = -1;
static const ce::ActionModsMatchesEventStateFunc matchEventState (
boost::bind (buttonActionModifiersMatchEventState,
@@ -347,7 +311,6 @@
matchEventState,
arguments))
return true;
-
}
return false;
@@ -361,19 +324,13 @@
CompAction::State state = CompAction::StateTermButton;
CompAction::BindingType type = CompAction::BindingTypeButton |
CompAction::BindingTypeEdgeButton;
- CompAction *action;
+ CompAction *action;
foreach (CompOption &option, options)
- {
- if (isBound (option, type, state, &action))
- {
- if (action->button ().button () == (int) event->button)
- {
- if (eventManager.triggerRelease (action, state, arguments))
- return true;
- }
- }
- }
+ if (isBound (option, type, state, &action) &&
+ action->button ().button () == (int) event->button &&
+ eventManager.triggerRelease (action, state, arguments))
+ return true;
return false;
}
@@ -383,8 +340,8 @@
XKeyEvent *event,
CompOption::Vector &arguments)
{
- CompAction::State state = 0;
- CompAction *action;
+ CompAction::State state = 0;
+ CompAction *action;
unsigned int modMask = REAL_MOD_MASK & ~modHandler->ignoredModMask ();
unsigned int bindMods;
@@ -396,28 +353,24 @@
if (state)
{
foreach (CompOption &o, options)
- {
- if (o.isAction ())
- {
- if (!o.value ().action ().terminate ().empty ())
- o.value ().action ().terminate () (&o.value ().action (),
- state, noOptions ());
- }
- }
+ if (o.isAction () &&
+ !o.value ().action ().terminate ().empty ())
+ o.value ().action ().terminate () (&o.value ().action (), state, noOptions ());
if (state == CompAction::StateCancel)
return false;
}
state = CompAction::StateInitKey;
+
foreach (CompOption &option, options)
{
if (isBound (option, CompAction::BindingTypeKey, state, &action))
{
- bindMods = modHandler->virtualToRealModMask (
- action->key ().modifiers ());
+ bindMods = modHandler->virtualToRealModMask (action->key ().modifiers ());
bool match = false;
+
if (action->key ().keycode () == (int) event->keycode)
match = ((bindMods & modMask) == (event->state & modMask));
else if (!xkbEvent.get() && action->key ().keycode () == 0)
@@ -436,18 +389,18 @@
XKeyEvent *event,
CompOption::Vector &arguments)
{
- CompAction::State state = CompAction::StateTermKey;
- CompAction *action;
- unsigned int ignored = modHandler->ignoredModMask ();
- unsigned int modMask = REAL_MOD_MASK & ~ignored;
- unsigned int bindMods;
- unsigned int mods;
+ unsigned int mods = modHandler->keycodeToModifiers (event->keycode);
- mods = modHandler->keycodeToModifiers (event->keycode);
if (!xkbEvent.get() && !mods)
return false;
- bool handled = false;
+ CompAction::State state = CompAction::StateTermKey;
+ CompAction *action;
+ unsigned int ignored = modHandler->ignoredModMask ();
+ unsigned int modMask = REAL_MOD_MASK & ~ignored;
+ unsigned int bindMods;
+ bool handled = false;
+ bool match = false;
foreach (CompOption &option, options)
{
@@ -455,12 +408,11 @@
{
bindMods = modHandler->virtualToRealModMask (action->key ().modifiers ());
- bool match = false;
if ((bindMods & modMask) == 0)
match = ((unsigned int) action->key ().keycode () ==
(unsigned int) event->keycode);
else if (!xkbEvent.get() && ((mods & modMask & bindMods) != bindMods))
- match = true;
+ match = true;
handled |= match && eventManager.triggerRelease (action, state, arguments);
}
@@ -486,19 +438,14 @@
foreach (CompOption &option, options)
{
- if (isBound (option, CompAction::BindingTypeKey, state, &action))
+ if (isBound (option, CompAction::BindingTypeKey, state, &action) &&
+ action->key ().keycode () == 0)
{
- if (action->key ().keycode () == 0)
- {
- bindMods =
- modHandler->virtualToRealModMask (action->key ().modifiers ());
+ bindMods = modHandler->virtualToRealModMask (action->key ().modifiers ());
- if ((event->mods & modMask) == bindMods)
- {
- if (eventManager.triggerPress (action, state, arguments))
- return true;
- }
- }
+ if ((event->mods & modMask) == bindMods &&
+ eventManager.triggerPress (action, state, arguments))
+ return true;
}
}
}
@@ -511,16 +458,12 @@
{
if (isBound (option, CompAction::BindingTypeKey, state, &action))
{
- bindMods = modHandler->virtualToRealModMask (
- action->key ().modifiers ());
- unsigned int modKey =
- modHandler->keycodeToModifiers (event->keycode);
+ bindMods = modHandler->virtualToRealModMask (action->key ().modifiers ());
+ unsigned int modKey = modHandler->keycodeToModifiers (event->keycode);
if ((event->mods && ((event->mods & modMask) != bindMods)) ||
(!event->mods && (modKey == bindMods)))
- {
handled |= eventManager.triggerRelease (action, state, arguments);
- }
}
}
@@ -536,17 +479,11 @@
CompAction::State state,
CompAction **action)
{
- if (option.type () != CompOption::TypeAction &&
- option.type () != CompOption::TypeBell)
- return false;
-
- if (!option.value ().action ().bell ())
- return false;
-
- if (!(option.value ().action ().state () & state))
- return false;
-
- if (option.value ().action ().initiate ().empty ())
+ if ((option.type () != CompOption::TypeAction &&
+ option.type () != CompOption::TypeBell) ||
+ !option.value ().action ().bell () ||
+ !(option.value ().action ().state () & state) ||
+ option.value ().action ().initiate ().empty ())
return false;
*action = &option.value ().action ();
@@ -562,13 +499,9 @@
CompAction *action;
foreach (CompOption &option, options)
- {
- if (isBellAction (option, state, &action))
- {
- if (action->initiate () (action, state, arguments))
- return true;
- }
- }
+ if (isBellAction (option, state, &action) &&
+ action->initiate () (action, state, arguments))
+ return true;
return false;
}
@@ -578,15 +511,11 @@
CompAction::State state,
unsigned int edge)
{
- if (option.type () != CompOption::TypeAction &&
- option.type () != CompOption::TypeButton &&
- option.type () != CompOption::TypeEdge)
- return false;
-
- if (!(option.value ().action ().edgeMask () & edge))
- return false;
-
- if (!(option.value ().action ().state () & state))
+ if ((option.type () != CompOption::TypeAction &&
+ option.type () != CompOption::TypeButton &&
+ option.type () != CompOption::TypeEdge) ||
+ !(option.value ().action ().edgeMask () & edge) ||
+ !(option.value ().action ().state () & state))
return false;
return true;
@@ -599,27 +528,14 @@
unsigned int edge,
CompAction **action)
{
- if (!isEdgeAction (option, state, edge))
- return false;
-
- if (option.value ().action ().type () & CompAction::BindingTypeEdgeButton)
- return false;
-
- if (option.value ().action ().initiate ().empty ())
- return false;
-
- if (delayState)
- {
- if ((option.value ().action ().state () &
- CompAction::StateNoEdgeDelay) !=
- (delayState & CompAction::StateNoEdgeDelay))
- {
- /* ignore edge actions which shouldn't be delayed when invoking
- undelayed edges (or vice versa) */
- return false;
- }
- }
-
+ if (!isEdgeAction (option, state, edge) ||
+ option.value ().action ().type () & CompAction::BindingTypeEdgeButton ||
+ option.value ().action ().initiate ().empty () ||
+ /* ignore edge actions which shouldn't be delayed when invoking
+ undelayed edges (or vice versa) */
+ (delayState && (option.value ().action ().state () &
+ CompAction::StateNoEdgeDelay) != (delayState & CompAction::StateNoEdgeDelay)))
+ return false;
*action = &option.value ().action ();
@@ -632,10 +548,8 @@
unsigned int edge,
CompAction **action)
{
- if (!isEdgeAction (option, state, edge))
- return false;
-
- if (option.value ().action ().terminate ().empty ())
+ if (!isEdgeAction (option, state, edge) ||
+ option.value ().action ().terminate ().empty ())
return false;
*action = &option.value ().action ();
@@ -647,19 +561,15 @@
triggerEdgeEnterBindings (CompOption::Vector &options,
CompAction::State state,
CompAction::State delayState,
- unsigned int edge,
+ unsigned int edge,
CompOption::Vector &arguments)
{
CompAction *action;
foreach (CompOption &option, options)
- {
- if (isEdgeEnterAction (option, state, delayState, edge, &action))
- {
- if (action->initiate () (action, state, arguments))
- return true;
- }
- }
+ if (isEdgeEnterAction (option, state, delayState, edge, &action) &&
+ action->initiate () (action, state, arguments))
+ return true;
return false;
}
@@ -673,13 +583,9 @@
CompAction *action;
foreach (CompOption &option, options)
- {
- if (isEdgeLeaveAction (option, state, edge, &action))
- {
- if (action->terminate () (action, state, arguments))
- return true;
- }
- }
+ if (isEdgeLeaveAction (option, state, edge, &action) &&
+ action->terminate () (action, state, arguments))
+ return true;
return false;
}
@@ -693,12 +599,12 @@
foreach (CompPlugin *p, CompPlugin::getPlugins ())
{
CompOption::Vector &options = p->vTable->getOptions ();
+
if (triggerEdgeEnterBindings (options, state, delayState, edge,
arguments))
- {
return true;
- }
}
+
return false;
}
@@ -718,9 +624,7 @@
CompAction::State state,
CompOption::Vector &arguments)
{
- int delay;
-
- delay = optionGetEdgeDelay ();
+ int delay = optionGetEdgeDelay ();
if (delay > 0)
{
@@ -734,14 +638,12 @@
delay, (unsigned int) ((float) delay * 1.2));
delayState = CompAction::StateNoEdgeDelay;
+
if (triggerAllEdgeEnterBindings (state, delayState, edge, arguments))
return true;
}
- else
- {
- if (triggerAllEdgeEnterBindings (state, 0, edge, arguments))
- return true;
- }
+ else if (triggerAllEdgeEnterBindings (state, 0, edge, arguments))
+ return true;
return false;
}
@@ -750,17 +652,17 @@
PrivateScreen::handleActionEvent (XEvent *event)
{
static CompOption::Vector o;
- Window xid;
+ Window xid;
if (o.empty ())
{
o.resize (8);
o[0].setName ("event_window", CompOption::TypeInt);
- o[1].setName ("window", CompOption::TypeInt);
- o[2].setName ("modifiers", CompOption::TypeInt);
- o[3].setName ("x", CompOption::TypeInt);
- o[4].setName ("y", CompOption::TypeInt);
- o[5].setName ("root", CompOption::TypeInt);
+ o[1].setName ("window", CompOption::TypeInt);
+ o[2].setName ("modifiers", CompOption::TypeInt);
+ o[3].setName ("x", CompOption::TypeInt);
+ o[4].setName ("y", CompOption::TypeInt);
+ o[5].setName ("root", CompOption::TypeInt);
}
else
{
@@ -768,338 +670,352 @@
o[7].reset ();
}
- switch (event->type) {
- case ButtonPress:
- /* We need to determine if we clicked on a parent frame
+ switch (event->type)
+ {
+ case ButtonPress:
+ /* We need to determine if we clicked on a parent frame
* window, if so, pass the appropriate child window as
* "window" and the frame as "event_window"
*/
- xid = event->xbutton.window;
-
- foreach (CompWindow *w, screen->windows ())
- {
- if (w->priv->frame == xid)
- xid = w->id ();
- }
-
- o[0].value ().set ((int) event->xbutton.window);
- o[1].value ().set ((int) xid);
- o[2].value ().set ((int) event->xbutton.state);
- o[3].value ().set ((int) event->xbutton.x_root);
- o[4].value ().set ((int) event->xbutton.y_root);
- o[5].value ().set ((int) event->xbutton.root);
-
- o[6].setName ("button", CompOption::TypeInt);
- o[7].setName ("time", CompOption::TypeInt);
-
- o[6].value ().set ((int) event->xbutton.button);
- o[7].value ().set ((int) event->xbutton.time);
-
- eventManager.resetPossibleTap();
- foreach (CompPlugin *p, CompPlugin::getPlugins ())
- {
- CompOption::Vector &options = p->vTable->getOptions ();
- if (triggerButtonPressBindings (options, &event->xbutton, o))
- return true;
- }
- break;
- case ButtonRelease:
- o[0].value ().set ((int) event->xbutton.window);
- o[1].value ().set ((int) event->xbutton.window);
- o[2].value ().set ((int) event->xbutton.state);
- o[3].value ().set ((int) event->xbutton.x_root);
- o[4].value ().set ((int) event->xbutton.y_root);
- o[5].value ().set ((int) event->xbutton.root);
-
- o[6].setName ("button", CompOption::TypeInt);
- o[7].setName ("time", CompOption::TypeInt);
-
- o[6].value ().set ((int) event->xbutton.button);
- o[7].value ().set ((int) event->xbutton.time);
-
- foreach (CompPlugin *p, CompPlugin::getPlugins ())
- {
- CompOption::Vector &options = p->vTable->getOptions ();
- if (triggerButtonReleaseBindings (options, &event->xbutton, o))
- return true;
- }
- break;
- case KeyPress:
- o[0].value ().set ((int) event->xkey.window);
- o[1].value ().set ((int) orphanData.activeWindow);
- o[2].value ().set ((int) event->xkey.state);
- o[3].value ().set ((int) event->xkey.x_root);
- o[4].value ().set ((int) event->xkey.y_root);
- o[5].value ().set ((int) event->xkey.root);
-
- o[6].setName ("keycode", CompOption::TypeInt);
- o[7].setName ("time", CompOption::TypeInt);
-
- o[6].value ().set ((int) event->xkey.keycode);
- o[7].value ().set ((int) event->xkey.time);
-
- eventManager.resetPossibleTap();
- foreach (CompPlugin *p, CompPlugin::getPlugins ())
- {
- CompOption::Vector &options = p->vTable->getOptions ();
- if (triggerKeyPressBindings (options, &event->xkey, o))
- return true;
- }
- break;
- case KeyRelease:
- {
- o[0].value ().set ((int) event->xkey.window);
- o[1].value ().set ((int) orphanData.activeWindow);
- o[2].value ().set ((int) event->xkey.state);
- o[3].value ().set ((int) event->xkey.x_root);
- o[4].value ().set ((int) event->xkey.y_root);
- o[5].value ().set ((int) event->xkey.root);
-
- o[6].setName ("keycode", CompOption::TypeInt);
- o[7].setName ("time", CompOption::TypeInt);
-
- o[6].value ().set ((int) event->xkey.keycode);
- o[7].value ().set ((int) event->xkey.time);
-
- bool handled = false;
-
- foreach (CompPlugin *p, CompPlugin::getPlugins ())
- {
- CompOption::Vector &options = p->vTable->getOptions ();
- handled |= triggerKeyReleaseBindings (options, &event->xkey, o);
- }
-
- if (handled)
- return true;
-
- break;
- }
- case EnterNotify:
- if (event->xcrossing.mode != NotifyGrab &&
- event->xcrossing.mode != NotifyUngrab &&
- event->xcrossing.detail != NotifyInferior)
- {
- unsigned int edge, i;
- CompAction::State state;
-
- if (event->xcrossing.root != rootWindow())
- return false;
-
- if (edgeDelayTimer.active ())
- edgeDelayTimer.stop ();
-
- if (edgeWindow && edgeWindow != event->xcrossing.window)
- {
- state = CompAction::StateTermEdge;
- edge = 0;
-
- for (i = 0; i < SCREEN_EDGE_NUM; i++)
- {
- if (edgeWindow == screenEdge[i].id)
+ xid = event->xbutton.window;
+
+ foreach (CompWindow *w, screen->windows ())
+ if (w->priv->frame == xid)
+ xid = w->id ();
+
+ o[0].value ().set ((int) event->xbutton.window);
+ o[1].value ().set ((int) xid);
+ o[2].value ().set ((int) event->xbutton.state);
+ o[3].value ().set ((int) event->xbutton.x_root);
+ o[4].value ().set ((int) event->xbutton.y_root);
+ o[5].value ().set ((int) event->xbutton.root);
+
+ o[6].setName ("button", CompOption::TypeInt);
+ o[7].setName ("time", CompOption::TypeInt);
+
+ o[6].value ().set ((int) event->xbutton.button);
+ o[7].value ().set ((int) event->xbutton.time);
+
+ eventManager.resetPossibleTap();
+
+ foreach (CompPlugin *p, CompPlugin::getPlugins ())
+ {
+ CompOption::Vector &options = p->vTable->getOptions ();
+
+ if (triggerButtonPressBindings (options, &event->xbutton, o))
+ return true;
+ }
+
+ break;
+
+ case ButtonRelease:
+ o[0].value ().set ((int) event->xbutton.window);
+ o[1].value ().set ((int) event->xbutton.window);
+ o[2].value ().set ((int) event->xbutton.state);
+ o[3].value ().set ((int) event->xbutton.x_root);
+ o[4].value ().set ((int) event->xbutton.y_root);
+ o[5].value ().set ((int) event->xbutton.root);
+
+ o[6].setName ("button", CompOption::TypeInt);
+ o[7].setName ("time", CompOption::TypeInt);
+
+ o[6].value ().set ((int) event->xbutton.button);
+ o[7].value ().set ((int) event->xbutton.time);
+
+ foreach (CompPlugin *p, CompPlugin::getPlugins ())
+ {
+ CompOption::Vector &options = p->vTable->getOptions ();
+
+ if (triggerButtonReleaseBindings (options, &event->xbutton, o))
+ return true;
+ }
+
+ break;
+
+ case KeyPress:
+ o[0].value ().set ((int) event->xkey.window);
+ o[1].value ().set ((int) orphanData.activeWindow);
+ o[2].value ().set ((int) event->xkey.state);
+ o[3].value ().set ((int) event->xkey.x_root);
+ o[4].value ().set ((int) event->xkey.y_root);
+ o[5].value ().set ((int) event->xkey.root);
+
+ o[6].setName ("keycode", CompOption::TypeInt);
+ o[7].setName ("time", CompOption::TypeInt);
+
+ o[6].value ().set ((int) event->xkey.keycode);
+ o[7].value ().set ((int) event->xkey.time);
+
+ eventManager.resetPossibleTap();
+
+ foreach (CompPlugin *p, CompPlugin::getPlugins ())
+ {
+ CompOption::Vector &options = p->vTable->getOptions ();
+
+ if (triggerKeyPressBindings (options, &event->xkey, o))
+ return true;
+ }
+
+ break;
+
+ case KeyRelease:
+ {
+ o[0].value ().set ((int) event->xkey.window);
+ o[1].value ().set ((int) orphanData.activeWindow);
+ o[2].value ().set ((int) event->xkey.state);
+ o[3].value ().set ((int) event->xkey.x_root);
+ o[4].value ().set ((int) event->xkey.y_root);
+ o[5].value ().set ((int) event->xkey.root);
+
+ o[6].setName ("keycode", CompOption::TypeInt);
+ o[7].setName ("time", CompOption::TypeInt);
+
+ o[6].value ().set ((int) event->xkey.keycode);
+ o[7].value ().set ((int) event->xkey.time);
+
+ bool handled = false;
+
+ foreach (CompPlugin *p, CompPlugin::getPlugins ())
+ {
+ CompOption::Vector &options = p->vTable->getOptions ();
+ handled |= triggerKeyReleaseBindings (options, &event->xkey, o);
+ }
+
+ if (handled)
+ return true;
+
+ break;
+ }
+
+ case EnterNotify:
+ if (event->xcrossing.mode != NotifyGrab &&
+ event->xcrossing.mode != NotifyUngrab &&
+ event->xcrossing.detail != NotifyInferior)
+ {
+ if (event->xcrossing.root != rootWindow())
+ return false;
+
+ unsigned int edge, i;
+ CompAction::State state;
+
+ if (edgeDelayTimer.active ())
+ edgeDelayTimer.stop ();
+
+ if (edgeWindow && edgeWindow != event->xcrossing.window)
+ {
+ state = CompAction::StateTermEdge;
+ edge = 0;
+
+ for (i = 0; i < SCREEN_EDGE_NUM; ++i)
+ {
+ if (edgeWindow == screenEdge[i].id)
+ {
+ edge = 1 << i;
+ break;
+ }
+ }
+
+ edgeWindow = None;
+
+ o[0].value ().set ((int) event->xcrossing.window);
+ o[1].value ().set ((int) orphanData.activeWindow);
+ o[2].value ().set ((int) event->xcrossing.state);
+ o[3].value ().set ((int) event->xcrossing.x_root);
+ o[4].value ().set ((int) event->xcrossing.y_root);
+ o[5].value ().set ((int) event->xcrossing.root);
+
+ o[6].setName ("time", CompOption::TypeInt);
+ o[6].value ().set ((int) event->xcrossing.time);
+
+ foreach (CompPlugin *p, CompPlugin::getPlugins ())
+ {
+ CompOption::Vector &options = p->vTable->getOptions ();
+
+ if (triggerEdgeLeaveBindings (options, state, edge, o))
+ return true;
+ }
+ }
+
+ edge = 0;
+
+ for (i = 0; i < SCREEN_EDGE_NUM; ++i)
+ {
+ if (event->xcrossing.window == screenEdge[i].id)
{
edge = 1 << i;
break;
}
}
- edgeWindow = None;
-
- o[0].value ().set ((int) event->xcrossing.window);
- o[1].value ().set ((int) orphanData.activeWindow);
- o[2].value ().set ((int) event->xcrossing.state);
- o[3].value ().set ((int) event->xcrossing.x_root);
- o[4].value ().set ((int) event->xcrossing.y_root);
- o[5].value ().set ((int) event->xcrossing.root);
-
- o[6].setName ("time", CompOption::TypeInt);
- o[6].value ().set ((int) event->xcrossing.time);
-
- foreach (CompPlugin *p, CompPlugin::getPlugins ())
- {
- CompOption::Vector &options = p->vTable->getOptions ();
- if (triggerEdgeLeaveBindings (options, state, edge, o))
- return true;
- }
- }
-
- edge = 0;
-
- for (i = 0; i < SCREEN_EDGE_NUM; i++)
- {
- if (event->xcrossing.window == screenEdge[i].id)
- {
- edge = 1 << i;
- break;
- }
- }
-
- if (edge)
- {
- state = CompAction::StateInitEdge;
-
- edgeWindow = event->xcrossing.window;
-
- o[0].value ().set ((int) event->xcrossing.window);
- o[1].value ().set ((int) orphanData.activeWindow);
- o[2].value ().set ((int) event->xcrossing.state);
- o[3].value ().set ((int) event->xcrossing.x_root);
- o[4].value ().set ((int) event->xcrossing.y_root);
- o[5].value ().set ((int) event->xcrossing.root);
-
- o[6].setName ("time", CompOption::TypeInt);
- o[6].value ().set ((int) event->xcrossing.time);
-
- if (triggerEdgeEnter (edge, state, o))
- return true;
- }
- }
- break;
- case ClientMessage:
- if (event->xclient.message_type == Atoms::xdndEnter)
- {
- xdndWindow = event->xclient.window;
- }
- else if (event->xclient.message_type == Atoms::xdndLeave)
- {
- unsigned int edge = 0;
- CompAction::State state;
-
- if (!xdndWindow)
- {
- CompWindow *w;
-
- w = screen->findWindow (event->xclient.window);
- if (w)
- {
- for (unsigned int i = 0; i < SCREEN_EDGE_NUM; i++)
- {
- if (event->xclient.window == screenEdge[i].id)
- {
- edge = 1 << i;
- break;
- }
- }
- }
- }
-
- if (edge)
- {
- state = CompAction::StateTermEdgeDnd;
-
- o[0].value ().set ((int) event->xclient.window);
- o[1].value ().set ((int) orphanData.activeWindow);
- o[2].value ().set ((int) 0); /* fixme */
- o[3].value ().set ((int) 0); /* fixme */
- o[4].value ().set ((int) 0); /* fixme */
- o[5].value ().set ((int) rootWindow());
-
- foreach (CompPlugin *p, CompPlugin::getPlugins ())
- {
- CompOption::Vector &options = p->vTable->getOptions ();
- if (triggerEdgeLeaveBindings (options, state, edge, o))
- return true;
- }
- }
- }
- else if (event->xclient.message_type == Atoms::xdndPosition)
- {
- unsigned int edge = 0;
- CompAction::State state;
-
- if (xdndWindow == event->xclient.window)
- {
- CompWindow *w;
-
- w = screen->findWindow (event->xclient.window);
- if (w)
- {
- for (unsigned int i = 0; i < SCREEN_EDGE_NUM; i++)
- {
- if (xdndWindow == screenEdge[i].id)
- {
- edge = 1 << i;
- break;
- }
- }
- }
- }
-
- if (edge)
- {
- state = CompAction::StateInitEdgeDnd;
-
- o[0].value ().set ((int) event->xclient.window);
- o[1].value ().set ((int) orphanData.activeWindow);
- o[2].value ().set ((int) 0); /* fixme */
- o[3].value ().set ((int) event->xclient.data.l[2] >> 16);
- o[4].value ().set ((int) event->xclient.data.l[2] & 0xffff);
- o[5].value ().set ((int) rootWindow());
-
- if (triggerEdgeEnter (edge, state, o))
- return true;
- }
-
- xdndWindow = None;
- }
- break;
- default:
- if (event->type == xkbEvent.get())
- {
- XkbAnyEvent *xkbEvent = (XkbAnyEvent *) event;
- static CompOption::Vector arg;
-
- if (arg.empty ())
- {
- arg.resize (8);
- arg[0].setName ("event_window", CompOption::TypeInt);
- arg[1].setName ("window", CompOption::TypeInt);
- }
-
- if (xkbEvent->xkb_type == XkbStateNotify)
- {
- XkbStateNotifyEvent *stateEvent = (XkbStateNotifyEvent *) event;
-
- arg[0].value ().set ((int) orphanData.activeWindow);
- arg[1].value ().set ((int) orphanData.activeWindow);
- arg[2].setName ("modifiers", CompOption::TypeInt);
- arg[2].value ().set ((int) stateEvent->mods);
- arg[3].setName ("time", CompOption::TypeInt);
- arg[3].value ().set ((int) xkbEvent->time);
- arg[7].value ().set ((int) xkbEvent->time);
-
- if (stateEvent->event_type == KeyPress)
- eventManager.resetPossibleTap();
-
- bool handled = false;
-
- foreach (CompPlugin *p, CompPlugin::getPlugins ())
- {
- CompOption::Vector &options = p->vTable->getOptions ();
- handled |= triggerStateNotifyBindings (options, stateEvent, arg);
- }
-
- if (handled)
- return true;
- }
- else if (xkbEvent->xkb_type == XkbBellNotify)
- {
- arg[0].value ().set ((int) orphanData.activeWindow);
- arg[1].value ().set ((int) orphanData.activeWindow);
- arg[2].setName ("time", CompOption::TypeInt);
- arg[2].value ().set ((int) xkbEvent->time);
- arg[3].reset ();
- arg[7].reset ();
-
- foreach (CompPlugin *p, CompPlugin::getPlugins ())
- {
- CompOption::Vector &options = p->vTable->getOptions ();
- if (triggerBellNotifyBindings (options, arg))
- return true;
- }
- }
- }
- break;
+ if (edge)
+ {
+ state = CompAction::StateInitEdge;
+
+ edgeWindow = event->xcrossing.window;
+
+ o[0].value ().set ((int) event->xcrossing.window);
+ o[1].value ().set ((int) orphanData.activeWindow);
+ o[2].value ().set ((int) event->xcrossing.state);
+ o[3].value ().set ((int) event->xcrossing.x_root);
+ o[4].value ().set ((int) event->xcrossing.y_root);
+ o[5].value ().set ((int) event->xcrossing.root);
+
+ o[6].setName ("time", CompOption::TypeInt);
+ o[6].value ().set ((int) event->xcrossing.time);
+
+ if (triggerEdgeEnter (edge, state, o))
+ return true;
+ }
+ }
+
+ break;
+
+ case ClientMessage:
+ if (event->xclient.message_type == Atoms::xdndEnter)
+ xdndWindow = event->xclient.window;
+ else if (event->xclient.message_type == Atoms::xdndLeave)
+ {
+ unsigned int edge = 0;
+ CompAction::State state;
+
+ if (!xdndWindow)
+ {
+ CompWindow *w = screen->findWindow (event->xclient.window);
+
+ if (w)
+ {
+ for (unsigned int i = 0; i < SCREEN_EDGE_NUM; ++i)
+ {
+ if (event->xclient.window == screenEdge[i].id)
+ {
+ edge = 1 << i;
+ break;
+ }
+ }
+ }
+ }
+
+ if (edge)
+ {
+ state = CompAction::StateTermEdgeDnd;
+
+ o[0].value ().set ((int) event->xclient.window);
+ o[1].value ().set ((int) orphanData.activeWindow);
+ o[2].value ().set ((int) 0); /* fixme */
+ o[3].value ().set ((int) 0); /* fixme */
+ o[4].value ().set ((int) 0); /* fixme */
+ o[5].value ().set ((int) rootWindow());
+
+ foreach (CompPlugin *p, CompPlugin::getPlugins ())
+ {
+ CompOption::Vector &options = p->vTable->getOptions ();
+
+ if (triggerEdgeLeaveBindings (options, state, edge, o))
+ return true;
+ }
+ }
+ }
+ else if (event->xclient.message_type == Atoms::xdndPosition)
+ {
+ unsigned int edge = 0;
+ CompAction::State state;
+
+ if (xdndWindow == event->xclient.window)
+ {
+ CompWindow *w = screen->findWindow (event->xclient.window);
+
+ if (w)
+ {
+ for (unsigned int i = 0; i < SCREEN_EDGE_NUM; ++i)
+ {
+ if (xdndWindow == screenEdge[i].id)
+ {
+ edge = 1 << i;
+ break;
+ }
+ }
+ }
+ }
+
+ if (edge)
+ {
+ state = CompAction::StateInitEdgeDnd;
+
+ o[0].value ().set ((int) event->xclient.window);
+ o[1].value ().set ((int) orphanData.activeWindow);
+ o[2].value ().set ((int) 0); /* fixme */
+ o[3].value ().set ((int) event->xclient.data.l[2] >> 16);
+ o[4].value ().set ((int) event->xclient.data.l[2] & 0xffff);
+ o[5].value ().set ((int) rootWindow());
+
+ if (triggerEdgeEnter (edge, state, o))
+ return true;
+ }
+
+ xdndWindow = None;
+ }
+
+ break;
+
+ default:
+ if (event->type == xkbEvent.get())
+ {
+ XkbAnyEvent *xkbEvent = (XkbAnyEvent *) event;
+ static CompOption::Vector arg;
+
+ if (arg.empty ())
+ {
+ arg.resize (8);
+ arg[0].setName ("event_window", CompOption::TypeInt);
+ arg[1].setName ("window", CompOption::TypeInt);
+ }
+
+ if (xkbEvent->xkb_type == XkbStateNotify)
+ {
+ XkbStateNotifyEvent *stateEvent = (XkbStateNotifyEvent *) event;
+
+ arg[0].value ().set ((int) orphanData.activeWindow);
+ arg[1].value ().set ((int) orphanData.activeWindow);
+ arg[2].setName ("modifiers", CompOption::TypeInt);
+ arg[2].value ().set ((int) stateEvent->mods);
+ arg[3].setName ("time", CompOption::TypeInt);
+ arg[3].value ().set ((int) xkbEvent->time);
+ arg[7].value ().set ((int) xkbEvent->time);
+
+ if (stateEvent->event_type == KeyPress)
+ eventManager.resetPossibleTap();
+
+ bool handled = false;
+
+ foreach (CompPlugin *p, CompPlugin::getPlugins ())
+ {
+ CompOption::Vector &options = p->vTable->getOptions ();
+ handled |= triggerStateNotifyBindings (options, stateEvent, arg);
+ }
+
+ if (handled)
+ return true;
+ }
+ else if (xkbEvent->xkb_type == XkbBellNotify)
+ {
+ arg[0].value ().set ((int) orphanData.activeWindow);
+ arg[1].value ().set ((int) orphanData.activeWindow);
+ arg[2].setName ("time", CompOption::TypeInt);
+ arg[2].value ().set ((int) xkbEvent->time);
+ arg[3].reset ();
+ arg[7].reset ();
+
+ foreach (CompPlugin *p, CompPlugin::getPlugins ())
+ {
+ CompOption::Vector &options = p->vTable->getOptions ();
+
+ if (triggerBellNotifyBindings (options, arg))
+ return true;
+ }
+ }
+ }
+ break;
}
return false;
@@ -1108,29 +1024,29 @@
void
PrivateScreen::setDefaultWindowAttributes (XWindowAttributes *wa)
{
- wa->x = 0;
- wa->y = 0;
- wa->width = 1;
- wa->height = 1;
- wa->border_width = 0;
- wa->depth = 0;
- wa->visual = NULL;
- wa->root = rootWindow();
- wa->c_class = InputOnly;
- wa->bit_gravity = NorthWestGravity;
- wa->win_gravity = NorthWestGravity;
- wa->backing_store = NotUseful;
- wa->backing_planes = 0;
- wa->backing_pixel = 0;
- wa->save_under = false;
- wa->colormap = None;
- wa->map_installed = false;
- wa->map_state = IsUnviewable;
- wa->all_event_masks = 0;
- wa->your_event_mask = 0;
+ wa->x = 0;
+ wa->y = 0;
+ wa->width = 1;
+ wa->height = 1;
+ wa->border_width = 0;
+ wa->depth = 0;
+ wa->visual = NULL;
+ wa->root = rootWindow();
+ wa->c_class = InputOnly;
+ wa->bit_gravity = NorthWestGravity;
+ wa->win_gravity = NorthWestGravity;
+ wa->backing_store = NotUseful;
+ wa->backing_planes = 0;
+ wa->backing_pixel = 0;
+ wa->save_under = false;
+ wa->colormap = None;
+ wa->map_installed = false;
+ wa->map_state = IsUnviewable;
+ wa->all_event_masks = 0;
+ wa->your_event_mask = 0;
wa->do_not_propagate_mask = 0;
wa->override_redirect = true;
- wa->screen = ScreenOfDisplay (dpy, screenNum);
+ wa->screen = ScreenOfDisplay (dpy, screenNum);
}
void
@@ -1144,8 +1060,8 @@
void
CompScreenImpl::_handleCompizEvent (const char *plugin,
- const char *event,
- CompOption::Vector &options)
+ const char *event,
+ CompOption::Vector &options)
{
}
@@ -1162,7 +1078,6 @@
/*
* Critical event handling that cannot be overridden by plugins
*/
-
if (event->type == ButtonPress || event->type == KeyPress)
privateScreen.eventManager.resetPossibleTap();
@@ -1181,9 +1096,7 @@
}
if (privateScreen.eventManager.grabsEmpty () && event->type == KeyPress)
- {
XUngrabKeyboard (privateScreen.dpy, event->xkey.time);
- }
}
ServerGrabInterface *
@@ -1217,74 +1130,85 @@
* Non-critical event handling that might be overridden by plugins
*/
- CompWindow *w = NULL;
+ CompWindow *w = NULL;
XWindowAttributes wa;
- switch (event->type) {
- case ButtonPress:
- if (event->xbutton.root == privateScreen.rootWindow())
- privateScreen.outputDevices.setCurrentOutput (
- outputDeviceForPoint (event->xbutton.x_root,
- event->xbutton.y_root));
- break;
- case MotionNotify:
- if (event->xmotion.root == privateScreen.rootWindow())
- privateScreen.outputDevices.setCurrentOutput (
- outputDeviceForPoint (event->xmotion.x_root,
- event->xmotion.y_root));
- break;
- case KeyPress:
- w = findWindow (privateScreen.orphanData.activeWindow);
- if (w)
- privateScreen.outputDevices.setCurrentOutput (w->outputDevice ());
- break;
- default:
- break;
+ switch (event->type)
+ {
+ case ButtonPress:
+ if (event->xbutton.root == privateScreen.rootWindow())
+ privateScreen.outputDevices.setCurrentOutput (
+ outputDeviceForPoint (event->xbutton.x_root,
+ event->xbutton.y_root));
+
+ break;
+
+ case MotionNotify:
+ if (event->xmotion.root == privateScreen.rootWindow())
+ privateScreen.outputDevices.setCurrentOutput (
+ outputDeviceForPoint (event->xmotion.x_root,
+ event->xmotion.y_root));
+
+ break;
+
+ case KeyPress:
+ w = findWindow (privateScreen.orphanData.activeWindow);
+
+ if (w)
+ privateScreen.outputDevices.setCurrentOutput (w->outputDevice ());
+
+ break;
+
+ default:
+ break;
}
eventHandled = privateScreen.handleActionEvent (event);
+
if (eventHandled)
{
if (privateScreen.eventManager.grabsEmpty ())
XAllowEvents (privateScreen.dpy, AsyncPointer, event->xbutton.time);
+
return;
}
- switch (event->type) {
- case SelectionRequest:
- privateScreen.handleSelectionRequest (event);
- break;
- case SelectionClear:
- privateScreen.handleSelectionClear (event);
- break;
- case ConfigureNotify:
- w = findWindow (event->xconfigure.window);
-
- if (w && !w->priv->frame)
- {
- w->priv->configure (&event->xconfigure);
- }
- else
- {
- w = findTopLevelWindow (event->xconfigure.window);
-
- if (w && w->priv->frame == event->xconfigure.window)
- w->priv->configureFrame (&event->xconfigure);
+ switch (event->type)
+ {
+ case SelectionRequest:
+ privateScreen.handleSelectionRequest (event);
+ break;
+
+ case SelectionClear:
+ privateScreen.handleSelectionClear (event);
+ break;
+
+ case ConfigureNotify:
+ w = findWindow (event->xconfigure.window);
+
+ if (w && !w->priv->frame)
+ w->priv->configure (&event->xconfigure);
else
{
- if (event->xconfigure.window == privateScreen.rootWindow())
+ w = findTopLevelWindow (event->xconfigure.window);
+
+ if (w && w->priv->frame == event->xconfigure.window)
+ w->priv->configureFrame (&event->xconfigure);
+ else if (event->xconfigure.window == privateScreen.rootWindow())
privateScreen.configure (&event->xconfigure);
}
- }
- break;
- case CreateNotify:
- {
- bool create = true;
-
- /* Failure means that window has been destroyed. We still have to add
+
+ break;
+
+ case CreateNotify:
+ {
+ bool create = true;
+
+ /* Failure means that window has been destroyed. We still have to add
* the window to the window list as we might get configure requests
* which require us to stack other windows relative to it. Setting
* some default values if this is the case. */
+<<<<<<< TREE
if (!XGetWindowAttributes (privateScreen.dpy, event->xcreatewindow.window, &wa)) {
privateScreen.setDefaultWindowAttributes (&wa);
@@ -1314,33 +1238,66 @@
{
if (w->priv->serverId == event->xcreatewindow.window)
{
+=======
+ if (!XGetWindowAttributes (privateScreen.dpy, event->xcreatewindow.window, &wa))
+ {
+ privateScreen.setDefaultWindowAttributes (&wa);
+
+ /* That being said, we should store as much information as possible
+ * about it. There may be requests relative to this window that could
+ * use the data in the XCreateWindowEvent structure, especially the
+ * override redirect state */
+ wa.x = event->xcreatewindow.x;
+ wa.y = event->xcreatewindow.y;
+ wa.width = event->xcreatewindow.width;
+ wa.height = event->xcreatewindow.height;
+ wa.border_width = event->xcreatewindow.border_width;
+ wa.override_redirect = event->xcreatewindow.override_redirect;
+ }
+
+ foreach (CompWindow *w, screen->windows ())
+ {
+ if (w->priv->serverFrame == event->xcreatewindow.window)
+ {
+ w->priv->frame = event->xcreatewindow.window;
+ w->priv->updatePassiveButtonGrabs ();
+ create = false;
+ }
+ }
+
+ foreach (CompWindow *w, destroyedWindows())
+ {
+ if (w->priv->serverId == event->xcreatewindow.window)
+ {
+>>>>>>> MERGE-SOURCE
/* Previously destroyed window
* plugins were keeping around
* in order to avoid an xid conflict,
* destroy it right away and manage
* the new window */
- StackDebugger *dbg = StackDebugger::Default ();
-
- while (w->priv->destroyRefCnt)
- w->destroy ();
-
- if (dbg)
- dbg->removeDestroyedFrame (event->xcreatewindow.window);
+ StackDebugger *dbg = StackDebugger::Default ();
+
+ while (w->priv->destroyRefCnt)
+ w->destroy ();
+
+ if (dbg)
+ dbg->removeDestroyedFrame (event->xcreatewindow.window);
+ }
+
}
- }
-
- if (wa.root != event->xcreatewindow.parent)
- create = false;
-
- if (create)
- {
+ if (wa.root != event->xcreatewindow.parent)
+ create = false;
+
+ if (create)
+ {
/* Track the window if it was created on this
* screen, otherwise we still need to register
* for FocusChangeMask. Also, we don't want to
* manage it straight away - in reality we want
* that to wait until the map request */
+<<<<<<< TREE
if (wa.root == privateScreen.rootWindow())
{
Window top = CompWindowToWindow (getTopWindow ());
@@ -1350,99 +1307,107 @@
wa,
event->xcreatewindow.window);
}
+=======
+ if (wa.root == privateScreen.rootWindow())
+ PrivateWindow::createCompWindow (CompWindowToWindow (getTopWindow ()),
+ CompWindowToWindow (getTopServerWindow ()),
+ wa, event->xcreatewindow.window);
+ else
+ XSelectInput (privateScreen.dpy, event->xcreatewindow.window,
+ FocusChangeMask);
+ }
+>>>>>>> MERGE-SOURCE
else
- XSelectInput (privateScreen.dpy, event->xcreatewindow.window,
- FocusChangeMask);
+ compLogMessage ("core", CompLogLevelDebug, "refusing to manage window 0x%x", (unsigned int) event->xcreatewindow.window);
+
+ break;
}
- else
- compLogMessage ("core", CompLogLevelDebug, "refusing to manage window 0x%x", (unsigned int) event->xcreatewindow.window);
- break;
- }
- case DestroyNotify:
- w = findWindow (event->xdestroywindow.window);
+ case DestroyNotify:
+ w = findWindow (event->xdestroywindow.window);
/* It is possible that some plugin might call
* w->destroy () before the window actually receives
* its first DestroyNotify event which would mean
* that it is already in the list of destroyed
* windows, so check that list too */
-
- if (!w)
- {
- foreach (CompWindow *dw, destroyedWindows())
+ if (!w)
{
- if (dw->priv->serverId == event->xdestroywindow.window)
+ foreach (CompWindow *dw, destroyedWindows())
{
- w = dw;
- break;
+ if (dw->priv->serverId == event->xdestroywindow.window)
+ {
+ w = dw;
+ break;
+ }
}
}
- }
-
- if (w)
- {
- w->moveInputFocusToOtherWindow ();
- w->destroy ();
- }
- break;
- case MapNotify:
-
- /* Search in already-created windows for this window */
- if (!w)
- w = findWindow (event->xmap.window);
-
- if (w)
- {
- if (w->priv->pendingMaps)
- {
+
+ if (w)
+ {
+ w->moveInputFocusToOtherWindow ();
+ w->destroy ();
+ }
+
+ break;
+
+ case MapNotify:
+
+ /* Search in already-created windows for this window */
+ if (!w)
+ w = findWindow (event->xmap.window);
+
+ if (w)
+ {
+ if (w->priv->pendingMaps)
+ {
/* The only case where this happens
* is where the window unmaps itself
* but doesn't get destroyed so when
* it re-maps we need to reparent it */
- if (!w->priv->serverFrame)
- w->priv->reparent ();
-
- w->priv->managed = true;
- }
-
- /* been shaded */
- if (w->shaded ())
- {
- if (w->id () == privateScreen.orphanData.activeWindow)
+ if (!w->priv->serverFrame)
+ w->priv->reparent ();
+
+ w->priv->managed = true;
+ }
+
+ /* been shaded */
+ if (w->shaded () &&
+ w->id () == privateScreen.orphanData.activeWindow)
w->moveInputFocusTo ();
- }
-
- w->map ();
- }
-
- break;
- case UnmapNotify:
- w = findWindow (event->xunmap.window);
- if (w)
- {
- /* Normal -> Iconic */
- if (w->pendingUnmaps ())
- {
- setWmState (IconicState, w->id ());
- w->priv->pendingUnmaps--;
- }
- else /* X -> Withdrawn */
- {
- /* Iconic -> Withdrawn:
+
+ w->map ();
+ }
+
+ break;
+
+ case UnmapNotify:
+ w = findWindow (event->xunmap.window);
+
+ if (w)
+ {
+ /* Normal -> Iconic */
+ if (w->pendingUnmaps ())
+ {
+ setWmState (IconicState, w->id ());
+ --w->priv->pendingUnmaps;
+ }
+ else /* X -> Withdrawn */
+ {
+ /* Iconic -> Withdrawn:
*
* The window is already unmapped so we need to check the
* synthetic UnmapNotify that comes and withdraw the window here */
- if (w->state () & CompWindowStateHiddenMask)
- {
- w->priv->minimized = false;
- w->changeState (w->state () & ~CompWindowStateHiddenMask);
+ if (w->state () & CompWindowStateHiddenMask)
+ {
+ w->priv->minimized = false;
+ w->changeState (w->state () & ~CompWindowStateHiddenMask);
- privateScreen.updateClientList ();
- w->priv->withdraw ();
- }
- /* Closing:
+ privateScreen.updateClientList ();
+ w->priv->withdraw ();
+ }
+ /* Closing:
*
* ICCCM Section 4.1.4 says that clients need to send
* a synthetic UnmapNotify for every real unmap
@@ -1450,37 +1415,39 @@
* since we already withdraw the window on the real
* UnmapNotify, no need to do it again on the synthetic
* one. */
- else if (!event->xunmap.send_event)
+ else if (!event->xunmap.send_event)
+ {
+ w->windowNotify (CompWindowNotifyClose);
+ w->priv->withdraw ();
+ }
+ }
+
+ if (!event->xunmap.send_event)
{
- w->windowNotify (CompWindowNotifyClose);
- w->priv->withdraw ();
+ w->unmap ();
+
+ if (!w->shaded () && !w->priv->pendingMaps)
+ w->moveInputFocusToOtherWindow ();
}
}
- if (!event->xunmap.send_event)
- {
- w->unmap ();
-
- if (!w->shaded () && !w->priv->pendingMaps)
- w->moveInputFocusToOtherWindow ();
- }
- }
- break;
- case ReparentNotify:
-
- w = findWindow (event->xreparent.window);
-
- /* If this window isn't part of our tracked window
+ break;
+
+ case ReparentNotify:
+ w = findWindow (event->xreparent.window);
+
+ /* If this window isn't part of our tracked window
* list and was reparented into the root window then
* we need to track it */
- if (!w)
- {
- if (event->xreparent.parent == privateScreen.rootWindow())
+ if (!w)
{
- /* Failure means that window has been destroyed. We still have to add
+ if (event->xreparent.parent == privateScreen.rootWindow())
+ {
+ /* Failure means that window has been destroyed. We still have to add
* the window to the window list as we might get configure requests
* which require us to stack other windows relative to it. Setting
* some default values if this is the case. */
+<<<<<<< TREE
if (!XGetWindowAttributes (privateScreen.dpy, event->xcreatewindow.window, &wa)) {
privateScreen.setDefaultWindowAttributes (&wa);
@@ -1499,30 +1466,49 @@
else
{
/* It is possible that some plugin might call
+=======
+ if (!XGetWindowAttributes (privateScreen.dpy, event->xcreatewindow.window, &wa))
+ {
+ privateScreen.setDefaultWindowAttributes (&wa);
+
+ /* That being said, we should store as much information as possible
+ * about it. There may be requests relative to this window that could
+ * use the data in the XCreateWindowEvent structure, especially the
+ * override redirect state */
+ wa.x = event->xreparent.x;
+ wa.y = event->xreparent.y;
+ wa.override_redirect = event->xreparent.override_redirect;
+ }
+
+ PrivateWindow::createCompWindow (getTopWindow ()->id (), getTopServerWindow ()->id (), wa, event->xreparent.window);
+ break;
+ }
+ else
+ {
+ /* It is possible that some plugin might call
+>>>>>>> MERGE-SOURCE
* w->destroy () before the window actually receives
* its first ReparentNotify event which would mean
* that it is already in the list of destroyed
* windows, so check that list too */
- foreach (CompWindow *dw, destroyedWindows())
- {
- if (dw->priv->serverId == event->xreparent.window)
+ foreach (CompWindow *dw, destroyedWindows())
{
- w = dw;
- break;
+ if (dw->priv->serverId == event->xreparent.window)
+ {
+ w = dw;
+ break;
+ }
}
}
}
- }
- /* This is the only case where a window is removed but not
+ /* This is the only case where a window is removed but not
destroyed. We must remove our event mask and all passive
grabs. */
-
- if (w)
- {
- if ((w->priv->wrapper && event->xreparent.parent != w->priv->wrapper) ||
- (!w->priv->wrapper && event->xreparent.parent != privateScreen.rootWindow ()))
+ if (w &&
+ ((w->priv->wrapper && event->xreparent.parent != w->priv->wrapper) ||
+ (!w->priv->wrapper && event->xreparent.parent != privateScreen.rootWindow ())))
{
w->moveInputFocusToOtherWindow ();
w->destroy ();
@@ -1530,649 +1516,675 @@
XSelectInput (privateScreen.dpy, w->id (), NoEventMask);
XShapeSelectInput (privateScreen.dpy, w->id (), NoEventMask);
XUngrabButton (privateScreen.dpy, AnyButton, AnyModifier, w->id ());
+
}
- }
-
- break;
- case CirculateNotify:
- w = findWindow (event->xcirculate.window);
- if (w)
- w->priv->circulate (&event->xcirculate);
- break;
- case ButtonPress:
- if (event->xbutton.button == Button1 ||
- event->xbutton.button == Button2 ||
- event->xbutton.button == Button3)
- {
- w = findTopLevelWindow (event->xbutton.window);
+
+ break;
+
+ case CirculateNotify:
+ w = findWindow (event->xcirculate.window);
+
if (w)
+ w->priv->circulate (&event->xcirculate);
+
+ break;
+
+ case ButtonPress:
+ if (event->xbutton.button == Button1 ||
+ event->xbutton.button == Button2 ||
+ event->xbutton.button == Button3)
{
- if (privateScreen.optionGetRaiseOnClick ())
+ w = findTopLevelWindow (event->xbutton.window);
+
+ if (w)
{
- w->updateAttributes (CompStackingUpdateModeAboveFullscreen);
+ if (privateScreen.optionGetRaiseOnClick ())
+ w->updateAttributes (CompStackingUpdateModeAboveFullscreen);
+
+ if (w->id () != privateScreen.orphanData.activeWindow &&
+ !(w->type () & CompWindowTypeDockMask) &&
+ w->focus ())
+ w->moveInputFocusTo ();
}
-
- if (w->id () != privateScreen.orphanData.activeWindow)
- if (!(w->type () & CompWindowTypeDockMask))
- if (w->focus ())
- w->moveInputFocusTo ();
}
- }
-
- if (privateScreen.eventManager.grabsEmpty ())
- XAllowEvents (privateScreen.dpy, ReplayPointer, event->xbutton.time);
-
- break;
- case PropertyNotify:
- if (event->xproperty.atom == Atoms::winType)
- {
- w = findWindow (event->xproperty.window);
- if (w)
+
+ if (privateScreen.eventManager.grabsEmpty ())
+ XAllowEvents (privateScreen.dpy, ReplayPointer, event->xbutton.time);
+
+ break;
+
+ case PropertyNotify:
+ if (event->xproperty.atom == Atoms::winType)
{
- unsigned int type;
-
- type = getWindowType (w->id ());
-
- if (type != w->wmType ())
+ w = findWindow (event->xproperty.window);
+
+ if (w)
{
- if (w->isViewable ())
+ unsigned int type = getWindowType (w->id ());
+
+ if (type != w->wmType ())
{
- if (w->type () == CompWindowTypeDesktopMask)
- decrementDesktopWindowCount();
- else if (type == CompWindowTypeDesktopMask)
- incrementDesktopWindowCount();
+ if (w->isViewable ())
+ {
+ if (w->type () == CompWindowTypeDesktopMask)
+ decrementDesktopWindowCount();
+ else if (type == CompWindowTypeDesktopMask)
+ incrementDesktopWindowCount();
+ }
+
+ w->wmType () = type;
+
+ w->recalcType ();
+ w->recalcActions ();
+
+ if (type & (CompWindowTypeDockMask |
+ CompWindowTypeDesktopMask))
+ w->setDesktop (0xffffffff);
+
+ privateScreen.updateClientList ();
+
+ matchPropertyChanged (w);
}
-
- w->wmType () = type;
-
- w->recalcType ();
- w->recalcActions ();
-
- if (type & (CompWindowTypeDockMask |
- CompWindowTypeDesktopMask))
- w->setDesktop (0xffffffff);
-
- privateScreen.updateClientList ();
-
- matchPropertyChanged (w);
}
}
- }
- else if (event->xproperty.atom == Atoms::winState)
- {
- w = findWindow (event->xproperty.window);
- if (w && !w->managed ())
+ else if (event->xproperty.atom == Atoms::winState)
{
- unsigned int state;
-
- state = getWindowState (w->id ());
- state = CompWindow::constrainWindowState (state, w->actions ());
-
- /* EWMH suggests that we ignore changes
+ w = findWindow (event->xproperty.window);
+
+ if (w && !w->managed ())
+ {
+ // TODO: check if this below here is correct
+ unsigned int state = getWindowState (w->id ());
+ state = CompWindow::constrainWindowState (state, w->actions ());
+
+ /* EWMH suggests that we ignore changes
to _NET_WM_STATE_HIDDEN */
- if (w->state () & CompWindowStateHiddenMask)
- state |= CompWindowStateHiddenMask;
- else
- state &= ~CompWindowStateHiddenMask;
-
- w->changeState (state);
- }
- }
- else if (event->xproperty.atom == XA_WM_NORMAL_HINTS)
- {
- w = findWindow (event->xproperty.window);
- if (w)
- {
- w->priv->updateNormalHints ();
- w->recalcActions ();
- }
- }
- else if (event->xproperty.atom == XA_WM_HINTS)
- {
- w = findWindow (event->xproperty.window);
- if (w)
- w->priv->updateWmHints ();
- }
- else if (event->xproperty.atom == XA_WM_TRANSIENT_FOR)
- {
- w = findWindow (event->xproperty.window);
- if (w)
- {
- w->priv->updateTransientHint ();
- w->recalcActions ();
- }
- }
- else if (event->xproperty.atom == Atoms::wmClientLeader)
- {
- w = findWindow (event->xproperty.window);
- if (w)
- w->priv->clientLeader = w->priv->getClientLeader ();
- }
- else if (event->xproperty.atom == Atoms::wmIconGeometry)
- {
- w = findWindow (event->xproperty.window);
- if (w)
- w->priv->updateIconGeometry ();
- }
- else if (event->xproperty.atom == Atoms::wmStrut ||
- event->xproperty.atom == Atoms::wmStrutPartial)
- {
- w = findWindow (event->xproperty.window);
- if (w)
- {
- if (w->updateStruts ())
+ if (w->state () & CompWindowStateHiddenMask)
+ state |= CompWindowStateHiddenMask;
+ else
+ state &= ~CompWindowStateHiddenMask;
+
+ w->changeState (state);
+ }
+ }
+ else if (event->xproperty.atom == XA_WM_NORMAL_HINTS)
+ {
+ w = findWindow (event->xproperty.window);
+
+ if (w)
+ {
+ w->priv->updateNormalHints ();
+ w->recalcActions ();
+ }
+ }
+ else if (event->xproperty.atom == XA_WM_HINTS)
+ {
+ w = findWindow (event->xproperty.window);
+
+ if (w)
+ w->priv->updateWmHints ();
+ }
+ else if (event->xproperty.atom == XA_WM_TRANSIENT_FOR)
+ {
+ w = findWindow (event->xproperty.window);
+
+ if (w)
+ {
+ w->priv->updateTransientHint ();
+ w->recalcActions ();
+ }
+ }
+ else if (event->xproperty.atom == Atoms::wmClientLeader)
+ {
+ w = findWindow (event->xproperty.window);
+
+ if (w)
+ w->priv->clientLeader = w->priv->getClientLeader ();
+ }
+ else if (event->xproperty.atom == Atoms::wmIconGeometry)
+ {
+ w = findWindow (event->xproperty.window);
+
+ if (w)
+ w->priv->updateIconGeometry ();
+ }
+ else if (event->xproperty.atom == Atoms::wmStrut ||
+ event->xproperty.atom == Atoms::wmStrutPartial)
+ {
+ w = findWindow (event->xproperty.window);
+
+ if (w &&
+ w->updateStruts ())
updateWorkarea ();
}
- }
- else if (event->xproperty.atom == Atoms::mwmHints)
- {
- w = findWindow (event->xproperty.window);
- if (w)
- w->priv->updateMwmHints ();
- }
- else if (event->xproperty.atom == Atoms::wmProtocols)
- {
- w = findWindow (event->xproperty.window);
- if (w)
- w->priv->protocols = getProtocols (w->id ());
- }
- else if (event->xproperty.atom == Atoms::wmIcon)
- {
- w = findWindow (event->xproperty.window);
- if (w)
- w->priv->freeIcons ();
- }
- else if (event->xproperty.atom == Atoms::startupId)
- {
- w = findWindow (event->xproperty.window);
- if (w)
- w->priv->updateStartupId ();
- }
- else if (event->xproperty.atom == XA_WM_CLASS)
- {
- w = findWindow (event->xproperty.window);
- if (w)
- w->priv->updateClassHints ();
- }
- break;
- case MotionNotify:
- break;
- case ClientMessage:
- if (event->xclient.message_type == Atoms::winActive)
- {
- w = findTopLevelWindow (event->xclient.window);
- if (w)
- {
- /* use focus stealing prevention if request came
+ else if (event->xproperty.atom == Atoms::mwmHints)
+ {
+ w = findWindow (event->xproperty.window);
+
+ if (w)
+ w->priv->updateMwmHints ();
+ }
+ else if (event->xproperty.atom == Atoms::wmProtocols)
+ {
+ w = findWindow (event->xproperty.window);
+
+ if (w)
+ w->priv->protocols = getProtocols (w->id ());
+ }
+ else if (event->xproperty.atom == Atoms::wmIcon)
+ {
+ w = findWindow (event->xproperty.window);
+
+ if (w)
+ w->priv->freeIcons ();
+ }
+ else if (event->xproperty.atom == Atoms::startupId)
+ {
+ w = findWindow (event->xproperty.window);
+
+ if (w)
+ w->priv->updateStartupId ();
+ }
+ else if (event->xproperty.atom == XA_WM_CLASS)
+ {
+ w = findWindow (event->xproperty.window);
+
+ if (w)
+ w->priv->updateClassHints ();
+ }
+
+ break;
+
+ case MotionNotify:
+ break;
+
+ case ClientMessage:
+ if (event->xclient.message_type == Atoms::winActive)
+ {
+ w = findTopLevelWindow (event->xclient.window);
+
+ if (w)
+ {
+ /* use focus stealing prevention if request came
from an application */
- if (event->xclient.data.l[0] != ClientTypeApplication ||
- w->priv->allowWindowFocus (0, event->xclient.data.l[1]))
- {
- w->activate ();
- }
- }
- }
- else if (event->xclient.message_type == Atoms::winState)
- {
- w = findWindow (event->xclient.window);
- if (w)
- {
- unsigned long wState, state;
-
- wState = w->state ();
-
- for (int i = 1; i < 3; i++)
- {
- state = cps::windowStateMask (event->xclient.data.l[i]);
- if (state & ~CompWindowStateHiddenMask)
- {
-
-static const unsigned short _NET_WM_STATE_REMOVE = 0;
-static const unsigned short _NET_WM_STATE_ADD = 1;
-static const unsigned short _NET_WM_STATE_TOGGLE = 2;
-
- switch (event->xclient.data.l[0]) {
- case _NET_WM_STATE_REMOVE:
- wState &= ~state;
- break;
- case _NET_WM_STATE_ADD:
- wState |= state;
- break;
- case _NET_WM_STATE_TOGGLE:
- wState ^= state;
- break;
- }
- }
- }
-
- wState = CompWindow::constrainWindowState (wState,
- w->actions ());
- if (w->id () == privateScreen.orphanData.activeWindow)
- wState &= ~CompWindowStateDemandsAttentionMask;
-
- if (wState != w->state ())
- {
- CompStackingUpdateMode stackingUpdateMode;
- unsigned long dState = wState ^ w->state ();
-
- stackingUpdateMode = CompStackingUpdateModeNone;
-
- /* raise the window whenever its fullscreen state,
- above/below state or maximization state changed */
- if (dState & (CompWindowStateFullscreenMask |
- CompWindowStateAboveMask |
- CompWindowStateBelowMask |
- CompWindowStateMaximizedHorzMask |
- CompWindowStateMaximizedVertMask))
- stackingUpdateMode = CompStackingUpdateModeNormal;
-
- w->changeState (wState);
-
- w->updateAttributes (stackingUpdateMode);
- }
- }
- }
- else if (event->xclient.message_type == Atoms::wmProtocols)
- {
- if ((unsigned long) event->xclient.data.l[0] == Atoms::wmPing)
- {
- w = findWindow (event->xclient.data.l[2]);
- if (w)
- w->priv->handlePing (lastPing ());
- }
- }
- else if (event->xclient.message_type == Atoms::closeWindow)
- {
- w = findWindow (event->xclient.window);
- if (w)
- w->close (event->xclient.data.l[0]);
- }
- else if (event->xclient.message_type == Atoms::desktopGeometry)
- {
- if (event->xclient.window == privateScreen.rootWindow())
- {
- CompOption::Value value;
-
- value.set ((int) (event->xclient.data.l[0] /
- width ()));
-
- setOptionForPlugin ("core", "hsize", value);
-
- value.set ((int) (event->xclient.data.l[1] /
- height ()));
-
- setOptionForPlugin ("core", "vsize", value);
- }
- }
- else if (event->xclient.message_type == Atoms::moveResizeWindow)
- {
- w = findWindow (event->xclient.window);
- if (w)
- {
- unsigned int xwcm = 0;
- XWindowChanges xwc;
- int gravity;
- int value_mask;
- unsigned int source;
-
- gravity = (event->xclient.data.l[0] & 0xFF);
- value_mask = (event->xclient.data.l[0] & 0xF00) >> 8;
- source = (event->xclient.data.l[0] & 0xF000) >> 12;
-
- memset (&xwc, 0, sizeof (xwc));
-
- if (value_mask & CWX)
- {
- xwcm |= CWX;
- xwc.x = event->xclient.data.l[1];
- }
-
- if (value_mask & CWY)
- {
- xwcm |= CWY;
- xwc.y = event->xclient.data.l[2];
- }
-
- if (value_mask & CWWidth)
- {
- xwcm |= CWWidth;
- xwc.width = event->xclient.data.l[3];
- }
-
- if (value_mask & CWHeight)
- {
- xwcm |= CWHeight;
- xwc.height = event->xclient.data.l[4];
- }
-
- w->moveResize (&xwc, xwcm, gravity, source);
- }
- }
- else if (event->xclient.message_type == Atoms::restackWindow)
- {
- w = findWindow (event->xclient.window);
- if (w)
- {
- /* TODO: other stack modes than Above and Below */
- if (event->xclient.data.l[1])
- {
- CompWindow *sibling;
-
- sibling = findWindow (event->xclient.data.l[1]);
- if (sibling)
+ if (event->xclient.data.l[0] != ClientTypeApplication ||
+ w->priv->allowWindowFocus (0, event->xclient.data.l[1]))
+ w->activate ();
+ }
+ }
+ else if (event->xclient.message_type == Atoms::winState)
+ {
+ w = findWindow (event->xclient.window);
+
+ if (w)
+ {
+ unsigned long state;
+ unsigned long wState = w->state ();
+ static const unsigned short _NET_WM_STATE_REMOVE = 0;
+ static const unsigned short _NET_WM_STATE_ADD = 1;
+ static const unsigned short _NET_WM_STATE_TOGGLE = 2;
+
+ for (int i = 1; i < 3; ++i)
+ {
+ state = cps::windowStateMask (event->xclient.data.l[i]);
+
+ if (state & ~CompWindowStateHiddenMask)
+ {
+ switch (event->xclient.data.l[0])
+ {
+ case _NET_WM_STATE_REMOVE:
+ wState &= ~state;
+ break;
+
+ case _NET_WM_STATE_ADD:
+ wState |= state;
+ break;
+
+ case _NET_WM_STATE_TOGGLE:
+ wState ^= state;
+ break;
+ }
+ }
+ }
+
+ wState = CompWindow::constrainWindowState (wState,
+ w->actions ());
+ if (w->id () == privateScreen.orphanData.activeWindow)
+ wState &= ~CompWindowStateDemandsAttentionMask;
+
+ if (wState != w->state ())
+ {
+ CompStackingUpdateMode stackingUpdateMode;
+ unsigned long dState = wState ^ w->state ();
+
+ stackingUpdateMode = CompStackingUpdateModeNone;
+
+ /* raise the window whenever its fullscreen state,
+ * above/below state or maximization state changed */
+ if (dState & (CompWindowStateFullscreenMask |
+ CompWindowStateAboveMask |
+ CompWindowStateBelowMask |
+ CompWindowStateMaximizedHorzMask |
+ CompWindowStateMaximizedVertMask))
+ stackingUpdateMode = CompStackingUpdateModeNormal;
+
+ w->changeState (wState);
+
+ w->updateAttributes (stackingUpdateMode);
+ }
+ }
+ }
+ else if (event->xclient.message_type == Atoms::wmProtocols)
+ {
+ if ((unsigned long) event->xclient.data.l[0] == Atoms::wmPing)
+ {
+ w = findWindow (event->xclient.data.l[2]);
+
+ if (w)
+ w->priv->handlePing (lastPing ());
+ }
+ }
+ else if (event->xclient.message_type == Atoms::closeWindow)
+ {
+ w = findWindow (event->xclient.window);
+
+ if (w)
+ w->close (event->xclient.data.l[0]);
+ }
+ else if (event->xclient.message_type == Atoms::desktopGeometry)
+ {
+ if (event->xclient.window == privateScreen.rootWindow())
+ {
+ CompOption::Value value;
+
+ value.set ((int) (event->xclient.data.l[0] /
+ width ()));
+
+ setOptionForPlugin ("core", "hsize", value);
+
+ value.set ((int) (event->xclient.data.l[1] /
+ height ()));
+
+ setOptionForPlugin ("core", "vsize", value);
+ }
+ }
+ else if (event->xclient.message_type == Atoms::moveResizeWindow)
+ {
+ w = findWindow (event->xclient.window);
+
+ if (w)
+ {
+ unsigned int xwcm = 0;
+ XWindowChanges xwc;
+ int gravity = (event->xclient.data.l[0] & 0xFF);
+ int value_mask = (event->xclient.data.l[0] & 0xF00) >> 8;
+ unsigned int source = (event->xclient.data.l[0] & 0xF000) >> 12;
+
+ memset (&xwc, 0, sizeof (xwc));
+
+ if (value_mask & CWX)
+ {
+ xwcm |= CWX;
+ xwc.x = event->xclient.data.l[1];
+ }
+
+ if (value_mask & CWY)
+ {
+ xwcm |= CWY;
+ xwc.y = event->xclient.data.l[2];
+ }
+
+ if (value_mask & CWWidth)
+ {
+ xwcm |= CWWidth;
+ xwc.width = event->xclient.data.l[3];
+ }
+
+ if (value_mask & CWHeight)
+ {
+ xwcm |= CWHeight;
+ xwc.height = event->xclient.data.l[4];
+ }
+
+ w->moveResize (&xwc, xwcm, gravity, source);
+ }
+ }
+ else if (event->xclient.message_type == Atoms::restackWindow)
+ {
+ w = findWindow (event->xclient.window);
+
+ if (w)
+ {
+ /* TODO: other stack modes than Above and Below */
+ if (event->xclient.data.l[1])
+ {
+ CompWindow *sibling = findWindow (event->xclient.data.l[1]);
+
+ if (sibling)
+ {
+ if (event->xclient.data.l[2] == Above)
+ w->restackAbove (sibling);
+ else if (event->xclient.data.l[2] == Below)
+ w->restackBelow (sibling);
+ }
+ }
+ else
{
if (event->xclient.data.l[2] == Above)
- w->restackAbove (sibling);
+ w->raise ();
else if (event->xclient.data.l[2] == Below)
- w->restackBelow (sibling);
- }
- }
- else
- {
- if (event->xclient.data.l[2] == Above)
- w->raise ();
- else if (event->xclient.data.l[2] == Below)
- w->lower ();
- }
- }
- }
- else if (event->xclient.message_type == Atoms::wmChangeState)
- {
- w = findWindow (event->xclient.window);
- if (w)
- {
- if (event->xclient.data.l[0] == IconicState)
- {
- if (w->actions () & CompWindowActionMinimizeMask)
- w->minimize ();
- }
- else if (event->xclient.data.l[0] == NormalState)
- {
- w->unminimize ();
- }
- }
- }
- else if (event->xclient.message_type == Atoms::showingDesktop)
- {
- if (event->xclient.window == privateScreen.rootWindow() ||
- event->xclient.window == None)
- {
- if (event->xclient.data.l[0])
- enterShowDesktopMode ();
- else
- leaveShowDesktopMode (NULL);
- }
- }
- else if (event->xclient.message_type == Atoms::numberOfDesktops)
- {
- if (event->xclient.window == privateScreen.rootWindow())
- {
- CompOption::Value value;
-
- value.set ((int) event->xclient.data.l[0]);
-
- setOptionForPlugin ("core", "number_of_desktops", value);
- }
- }
- else if (event->xclient.message_type == Atoms::currentDesktop)
- {
- if (event->xclient.window == privateScreen.rootWindow())
- privateScreen.setCurrentDesktop (event->xclient.data.l[0]);
- }
- else if (event->xclient.message_type == Atoms::winDesktop)
- {
- w = findWindow (event->xclient.window);
- if (w)
- w->setDesktop (event->xclient.data.l[0]);
- }
- else if (event->xclient.message_type == Atoms::wmFullscreenMonitors)
- {
- w = findWindow (event->xclient.window);
- if (w)
- {
- CompFullscreenMonitorSet monitors;
-
- monitors.top = event->xclient.data.l[0];
- monitors.bottom = event->xclient.data.l[1];
- monitors.left = event->xclient.data.l[2];
- monitors.right = event->xclient.data.l[3];
-
- w->priv->setFullscreenMonitors (&monitors);
- }
- }
- break;
- case MappingNotify:
- modHandler->updateModifierMappings ();
- break;
- case MapRequest:
- w = screen->findWindow (event->xmaprequest.window);
-
- if (w)
- {
- XWindowAttributes attr;
- bool doMapProcessing = true;
-
- /* We should check the override_redirect flag here, because the
- client might have changed it while being unmapped. */
- if (w->queryAttributes (attr))
- w->priv->setOverrideRedirect (attr.override_redirect != 0);
-
- if (w->state () & CompWindowStateHiddenMask)
- if (!w->minimized () && !w->inShowDesktopMode ())
+ w->lower ();
+ }
+ }
+ }
+ else if (event->xclient.message_type == Atoms::wmChangeState)
+ {
+ w = findWindow (event->xclient.window);
+
+ if (w)
+ {
+ if (event->xclient.data.l[0] == IconicState)
+ {
+ if (w->actions () & CompWindowActionMinimizeMask)
+ w->minimize ();
+ }
+ else if (event->xclient.data.l[0] == NormalState)
+ {
+ w->unminimize ();
+ }
+ }
+ }
+ else if (event->xclient.message_type == Atoms::showingDesktop)
+ {
+ if (event->xclient.window == privateScreen.rootWindow() ||
+ event->xclient.window == None)
+ {
+ if (event->xclient.data.l[0])
+ enterShowDesktopMode ();
+ else
+ leaveShowDesktopMode (NULL);
+ }
+ }
+ else if (event->xclient.message_type == Atoms::numberOfDesktops)
+ {
+ if (event->xclient.window == privateScreen.rootWindow())
+ {
+ CompOption::Value value;
+
+ value.set ((int) event->xclient.data.l[0]);
+
+ setOptionForPlugin ("core", "number_of_desktops", value);
+ }
+ }
+ else if (event->xclient.message_type == Atoms::currentDesktop)
+ {
+ if (event->xclient.window == privateScreen.rootWindow())
+ privateScreen.setCurrentDesktop (event->xclient.data.l[0]);
+ }
+ else if (event->xclient.message_type == Atoms::winDesktop)
+ {
+ w = findWindow (event->xclient.window);
+
+ if (w)
+ w->setDesktop (event->xclient.data.l[0]);
+ }
+ else if (event->xclient.message_type == Atoms::wmFullscreenMonitors)
+ {
+ w = findWindow (event->xclient.window);
+
+ if (w)
+ {
+ CompFullscreenMonitorSet monitors;
+
+ monitors.top = event->xclient.data.l[0];
+ monitors.bottom = event->xclient.data.l[1];
+ monitors.left = event->xclient.data.l[2];
+ monitors.right = event->xclient.data.l[3];
+
+ w->priv->setFullscreenMonitors (&monitors);
+ }
+ }
+
+ break;
+
+ case MappingNotify:
+ modHandler->updateModifierMappings ();
+ break;
+
+ case MapRequest:
+ w = screen->findWindow (event->xmaprequest.window);
+
+ if (w)
+ {
+ XWindowAttributes attr;
+ bool doMapProcessing = true;
+
+ /* We should check the override_redirect flag here, because the
+ * client might have changed it while being unmapped. */
+ if (w->queryAttributes (attr))
+ w->priv->setOverrideRedirect (attr.override_redirect != 0);
+
+ if (w->state () & CompWindowStateHiddenMask &&
+ !w->minimized () && !w->inShowDesktopMode ())
doMapProcessing = false;
- if (doMapProcessing)
- w->priv->processMap ();
-
- w->priv->managed = true;
-
- setWindowProp (w->id (), Atoms::winDesktop, w->desktop ());
- }
- else
- {
- XMapWindow (privateScreen.dpy, event->xmaprequest.window);
- }
- break;
- case ConfigureRequest:
- w = findWindow (event->xconfigurerequest.window);
- if (w && w->managed ())
- {
- XWindowChanges xwc;
-
- memset (&xwc, 0, sizeof (xwc));
-
- xwc.x = event->xconfigurerequest.x;
- xwc.y = event->xconfigurerequest.y;
- xwc.width = event->xconfigurerequest.width;
- xwc.height = event->xconfigurerequest.height;
- xwc.border_width = event->xconfigurerequest.border_width;
-
- w->moveResize (&xwc, event->xconfigurerequest.value_mask,
- 0, ClientTypeUnknown);
-
- if (event->xconfigurerequest.value_mask & CWStackMode)
- {
- Window above = None;
- CompWindow *sibling = NULL;
-
- if (event->xconfigurerequest.value_mask & CWSibling)
- {
- above = event->xconfigurerequest.above;
- sibling = findTopLevelWindow (above);
- }
-
- switch (event->xconfigurerequest.detail) {
- case Above:
- if (w->priv->allowWindowFocus (NO_FOCUS_MASK, 0))
- {
- if (above)
- {
- if (sibling)
- w->restackAbove (sibling);
- }
- else
- w->raise ();
- }
- break;
- case Below:
- if (above)
- {
- if (sibling)
- w->restackBelow (sibling);
- }
- else
- w->lower ();
- break;
- default:
- /* no handling of the TopIf, BottomIf, Opposite cases -
- there will hardly be any client using that */
- break;
- }
- }
- }
- else
- {
- XWindowChanges xwc;
- unsigned int xwcm;
-
- xwcm = event->xconfigurerequest.value_mask &
- (CWX | CWY | CWWidth | CWHeight | CWBorderWidth);
-
- xwc.x = event->xconfigurerequest.x;
- xwc.y = event->xconfigurerequest.y;
- xwc.width = event->xconfigurerequest.width;
- xwc.height = event->xconfigurerequest.height;
- xwc.border_width = event->xconfigurerequest.border_width;
-
- if (w)
- {
+ if (doMapProcessing)
+ w->priv->processMap ();
+
+ w->priv->managed = true;
+
+ setWindowProp (w->id (), Atoms::winDesktop, w->desktop ());
+ }
+ else
+ XMapWindow (privateScreen.dpy, event->xmaprequest.window);
+
+ break;
+
+ case ConfigureRequest:
+ w = findWindow (event->xconfigurerequest.window);
+
+ if (w && w->managed ())
+ {
+ XWindowChanges xwc;
+
+ memset (&xwc, 0, sizeof (xwc));
+
+ xwc.x = event->xconfigurerequest.x;
+ xwc.y = event->xconfigurerequest.y;
+ xwc.width = event->xconfigurerequest.width;
+ xwc.height = event->xconfigurerequest.height;
+ xwc.border_width = event->xconfigurerequest.border_width;
+
+ w->moveResize (&xwc, event->xconfigurerequest.value_mask,
+ 0, ClientTypeUnknown);
+
+ if (event->xconfigurerequest.value_mask & CWStackMode)
+ {
+ Window above = None;
+ CompWindow *sibling = NULL;
+
+ if (event->xconfigurerequest.value_mask & CWSibling)
+ {
+ above = event->xconfigurerequest.above;
+ sibling = findTopLevelWindow (above);
+ }
+
+ switch (event->xconfigurerequest.detail)
+ {
+ case Above:
+ if (w->priv->allowWindowFocus (NO_FOCUS_MASK, 0))
+ {
+ if (above)
+ {
+ if (sibling)
+ w->restackAbove (sibling);
+ }
+ else
+ w->raise ();
+ }
+
+ break;
+
+ case Below:
+ if (above)
+ {
+ if (sibling)
+ w->restackBelow (sibling);
+ }
+ else
+ w->lower ();
+
+ break;
+
+ default:
+ /* no handling of the TopIf, BottomIf, Opposite cases -
+ * there will hardly be any client using that */
+ break;
+ }
+ }
+ }
+ else
+ {
+ XWindowChanges xwc;
+
+ unsigned int xwcm = event->xconfigurerequest.value_mask &
+ (CWX | CWY | CWWidth | CWHeight | CWBorderWidth);
+
+ xwc.x = event->xconfigurerequest.x;
+ xwc.y = event->xconfigurerequest.y;
+ xwc.width = event->xconfigurerequest.width;
+ xwc.height = event->xconfigurerequest.height;
+ xwc.border_width = event->xconfigurerequest.border_width;
+
+ if (w)
+ {
/* Any window that receives a ConfigureRequest
* is not override redirect, and may have changed
* to being not override redirect */
- w->priv->setOverrideRedirect (false);
- w->configureXWindow (xwcm, &xwc);
+ w->priv->setOverrideRedirect (false);
+ w->configureXWindow (xwcm, &xwc);
+ }
+ else
+ XConfigureWindow (privateScreen.dpy, event->xconfigurerequest.window,
+ xwcm, &xwc);
}
- else
- XConfigureWindow (privateScreen.dpy, event->xconfigurerequest.window,
- xwcm, &xwc);
- }
- break;
- case CirculateRequest:
- break;
- case FocusIn:
- {
- if (!XGetWindowAttributes (privateScreen.dpy, event->xfocus.window, &wa))
- privateScreen.setDefaultWindowAttributes (&wa);
-
- /* If the call to XGetWindowAttributes failed it means
- * the window was destroyed, so track the focus change
- * anyways since we need to increment activeNum
- * and the passive button grabs and then we will
- * get the DestroyNotify later and change the focus
- * there
+
+ break;
+
+ case CirculateRequest:
+ break;
+
+ case FocusIn:
+ {
+ if (!XGetWindowAttributes (privateScreen.dpy, event->xfocus.window, &wa))
+ privateScreen.setDefaultWindowAttributes (&wa);
+
+ /* If the call to XGetWindowAttributes failed it means
+ * the window was destroyed, so track the focus change
+ * anyways since we need to increment activeNum
+ * and the passive button grabs and then we will
+ * get the DestroyNotify later and change the focus
+ * there
*/
-
- if (wa.root == privateScreen.rootWindow())
- {
- if (event->xfocus.mode == NotifyGrab)
- privateScreen.eventManager.grabNotified ();
- else if (event->xfocus.mode == NotifyUngrab)
- privateScreen.eventManager.ungrabNotified ();
- else
+ if (wa.root == privateScreen.rootWindow())
{
- CompWindowList dockWindows;
- XWindowChanges xwc;
- unsigned int mask;
-
- w = findTopLevelWindow (event->xfocus.window);
- if (w && w->managed ())
+ if (event->xfocus.mode == NotifyGrab)
+ privateScreen.eventManager.grabNotified ();
+ else if (event->xfocus.mode == NotifyUngrab)
+ privateScreen.eventManager.ungrabNotified ();
+ else
{
- unsigned int state = w->state ();
-
- if (getNextActiveWindow() == event->xfocus.window)
- setNextActiveWindow(None);
-
- if (w->id () != privateScreen.orphanData.activeWindow)
+ CompWindowList dockWindows;
+ XWindowChanges xwc;
+ unsigned int mask;
+
+ w = findTopLevelWindow (event->xfocus.window);
+
+ if (w && w->managed ())
{
- CompWindow *active = screen->findWindow (privateScreen.orphanData.activeWindow);
-
- privateScreen.orphanData.activeWindow = w->id ();
- w->priv->activeNum = nextActiveNum();
-
- if (active)
+ unsigned int state = w->state ();
+
+ if (getNextActiveWindow() == event->xfocus.window)
+ setNextActiveWindow(None);
+
+ if (w->id () != privateScreen.orphanData.activeWindow)
{
- CompWindowList windowsLostFocus;
+ CompWindow *active = screen->findWindow (privateScreen.orphanData.activeWindow);
+
+ privateScreen.orphanData.activeWindow = w->id ();
+ w->priv->activeNum = nextActiveNum();
+
+ if (active)
+ {
+ CompWindowList windowsLostFocus;
/* If this window lost focus and was above a fullscreen window
* and is no longer capable of being focused (eg, it is
* not visible on this viewport) then we need to check if
* any other windows below it are also now no longer capable
* of being focused and restack them in the highest position
* below docks that they are allowed to take */
- if (!active->focus ())
- {
- windowsLostFocus.push_back (active);
- for (CompWindow *fsw = active->prev; fsw; fsw = fsw->prev)
+ if (!active->focus ())
{
- if (!fsw->focus () &&
- fsw->managed () &&
- !(fsw->type () & (CompWindowTypeDockMask |
- CompWindowTypeFullscreenMask)) &&
- !fsw->overrideRedirect ())
- windowsLostFocus.push_back (fsw);
+ windowsLostFocus.push_back (active);
- if (fsw->type () & CompWindowTypeFullscreenMask)
+ for (CompWindow *fsw = active->prev; fsw; fsw = fsw->prev)
{
- ServerLock lock (screen->serverGrabInterface ());
-
- /* This will be the window that we must lower relative to */
- CompWindow *sibling =
- PrivateWindow::findValidStackSiblingBelow (active,
- fsw,
- lock);
-
- if (sibling)
+ if (!fsw->focus () &&
+ fsw->managed () &&
+ !(fsw->type () & (CompWindowTypeDockMask |
+ CompWindowTypeFullscreenMask)) &&
+ !fsw->overrideRedirect ())
+ windowsLostFocus.push_back (fsw);
+
+ if (fsw->type () & CompWindowTypeFullscreenMask)
{
- for (CompWindowList::reverse_iterator rit = windowsLostFocus.rbegin ();
- rit != windowsLostFocus.rend (); ++rit)
- {
- (*rit)->restackAbove (sibling);
- }
+ ServerLock lock (screen->serverGrabInterface ());
+
+ /* This will be the window that we must lower relative to */
+ CompWindow *sibling =
+ PrivateWindow::findValidStackSiblingBelow (active,
+ fsw,
+ lock);
+
+ if (sibling)
+ for (CompWindowList::reverse_iterator rit = windowsLostFocus.rbegin ();
+ rit != windowsLostFocus.rend (); ++rit)
+ (*rit)->restackAbove (sibling);
+
+ break;
}
-
- break;
}
}
+
+ active->changeState (active->focused () ?
+ active->state () | CompWindowStateFocusedMask :
+ active->state () & ~CompWindowStateFocusedMask);
+
+ active->priv->updatePassiveButtonGrabs ();
}
- active->changeState (active->focused () ?
- active->state () | CompWindowStateFocusedMask :
- active->state () & ~CompWindowStateFocusedMask);
-
- active->priv->updatePassiveButtonGrabs ();
+ if (w->focused ())
+ state |= w->state () | CompWindowStateFocusedMask;
+ else
+ state &= w->state () & ~CompWindowStateFocusedMask;
+
+ w->priv->updatePassiveButtonGrabs ();
+
+ addToCurrentActiveWindowHistory (w->id ());
+
+ XChangeProperty (privateScreen.dpy , privateScreen.rootWindow(),
+ Atoms::winActive,
+ XA_WINDOW, 32, PropModeReplace,
+ (unsigned char *) &privateScreen.orphanData.activeWindow, 1);
+
+ w->windowNotify (CompWindowNotifyFocusChange);
}
- if (w->focused ())
- state |= w->state () | CompWindowStateFocusedMask;
- else
- state &= w->state () & ~CompWindowStateFocusedMask;
-
- w->priv->updatePassiveButtonGrabs ();
-
- addToCurrentActiveWindowHistory (w->id ());
-
- XChangeProperty (privateScreen.dpy , privateScreen.rootWindow(),
- Atoms::winActive,
- XA_WINDOW, 32, PropModeReplace,
- (unsigned char *) &privateScreen.orphanData.activeWindow, 1);
-
- w->windowNotify (CompWindowNotifyFocusChange);
+ state &= ~CompWindowStateDemandsAttentionMask;
+ w->changeState (state);
}
-
- state &= ~CompWindowStateDemandsAttentionMask;
- w->changeState (state);
- }
- else if (event->xfocus.window == privateScreen.rootWindow())
- {
+ else if (event->xfocus.window == privateScreen.rootWindow())
+ {
/* Don't ever let the focus go to the root
* window except in grab cases
*
@@ -2180,158 +2192,151 @@
* handle root windows of other screens here, but
* the other window managers should handle that
*/
-
- if (event->xfocus.detail == NotifyDetailNone ||
- (event->xfocus.mode == NotifyNormal &&
- event->xfocus.detail == NotifyInferior))
- {
- privateScreen.orphanData.activeWindow = None;
-
if (event->xfocus.detail == NotifyDetailNone ||
(event->xfocus.mode == NotifyNormal &&
event->xfocus.detail == NotifyInferior))
{
- screen->focusDefaultWindow ();
+ privateScreen.orphanData.activeWindow = None;
+
+ if (event->xfocus.detail == NotifyDetailNone ||
+ (event->xfocus.mode == NotifyNormal &&
+ event->xfocus.detail == NotifyInferior))
+ screen->focusDefaultWindow ();
}
}
- }
- /* Ensure that docks are stacked in the right place
+ /* Ensure that docks are stacked in the right place
*
* When a normal window gets the focus and is above a
* fullscreen window, restack the docks to be above
* the highest level mapped and visible normal window,
* otherwise put them above the highest fullscreen window
*/
+ if (w)
+ {
+ ServerLock lock (screen->serverGrabInterface ());
+
+ if (PrivateWindow::stackDocks (w,
+ dockWindows,
+ &xwc,
+ &mask,
+ lock))
+ {
+ Window sibling = xwc.sibling;
+ xwc.stack_mode = Above;
+
+ /* Then update the dock windows */
+ foreach (CompWindow *dw, dockWindows)
+ {
+ xwc.sibling = sibling;
+ dw->restackAndConfigureXWindow (mask, &xwc, lock);
+ }
+ }
+ }
+
+ }
+ }
+ else
+ {
+ CompWindow *w = screen->findWindow (privateScreen.orphanData.activeWindow);
+
+ setNextActiveWindow(None);
+ privateScreen.orphanData.activeWindow = None;
+
if (w)
- {
- ServerLock lock (screen->serverGrabInterface ());
- if (PrivateWindow::stackDocks (w,
- dockWindows,
- &xwc,
- &mask,
- lock))
- {
- Window sibling = xwc.sibling;
- xwc.stack_mode = Above;
-
- /* Then update the dock windows */
- foreach (CompWindow *dw, dockWindows)
- {
- xwc.sibling = sibling;
- dw->restackAndConfigureXWindow (mask, &xwc, lock);
- }
- }
- }
-
+ w->priv->updatePassiveButtonGrabs ();
}
}
- else
- {
- CompWindow *w;
-
- w = screen->findWindow (privateScreen.orphanData.activeWindow);
-
- setNextActiveWindow(None);
- privateScreen.orphanData.activeWindow = None;
-
- if (w)
- w->priv->updatePassiveButtonGrabs ();
- }
- }
- break;
- case FocusOut:
- if (event->xfocus.mode == NotifyUngrab)
- privateScreen.eventManager.ungrabNotified ();
- break;
- case EnterNotify:
- if (event->xcrossing.root == privateScreen.rootWindow())
- w = findTopLevelWindow (event->xcrossing.window);
- else
- w = NULL;
-
- if (w && w->id () != below)
- {
- below = w->id ();
-
- if (!privateScreen.optionGetClickToFocus () &&
- privateScreen.eventManager.grabsEmpty () &&
- event->xcrossing.mode != NotifyGrab &&
- event->xcrossing.detail != NotifyInferior)
+ break;
+
+ case FocusOut:
+ if (event->xfocus.mode == NotifyUngrab)
+ privateScreen.eventManager.ungrabNotified ();
+
+ break;
+
+ case EnterNotify:
+ if (event->xcrossing.root == privateScreen.rootWindow())
+ w = findTopLevelWindow (event->xcrossing.window);
+ else
+ w = NULL;
+
+ if (w && w->id () != below)
{
- bool raise;
- int delay;
-
- raise = privateScreen.optionGetAutoraise ();
- delay = privateScreen.optionGetAutoraiseDelay ();
-
- if (autoRaiseTimer_.active () &&
- autoRaiseWindow_ != w->id ())
- {
- autoRaiseTimer_.stop ();
- }
-
- if (w->type () & ~(CompWindowTypeDockMask |
- CompWindowTypeDesktopMask))
- {
- w->moveInputFocusTo ();
-
- if (raise)
+ below = w->id ();
+
+ if (!privateScreen.optionGetClickToFocus () &&
+ privateScreen.eventManager.grabsEmpty () &&
+ event->xcrossing.mode != NotifyGrab &&
+ event->xcrossing.detail != NotifyInferior)
+ {
+ bool raise = privateScreen.optionGetAutoraise ();
+ int delay = privateScreen.optionGetAutoraiseDelay ();
+
+ if (autoRaiseTimer_.active () &&
+ autoRaiseWindow_ != w->id ())
+ autoRaiseTimer_.stop ();
+
+ if (w->type () & ~(CompWindowTypeDockMask |
+ CompWindowTypeDesktopMask))
{
- if (delay > 0)
- {
- autoRaiseWindow_ = w->id ();
- autoRaiseTimer_.start (
- boost::bind (autoRaiseTimeout, this),
- delay, (unsigned int) ((float) delay * 1.2));
- }
- else
- {
- CompStackingUpdateMode mode =
- CompStackingUpdateModeNormal;
-
- w->updateAttributes (mode);
+ w->moveInputFocusTo ();
+
+ if (raise)
+ {
+ if (delay > 0)
+ {
+ autoRaiseWindow_ = w->id ();
+ autoRaiseTimer_.start (
+ boost::bind (autoRaiseTimeout, this),
+ delay, (unsigned int) ((float) delay * 1.2));
+ }
+ else
+ {
+ CompStackingUpdateMode mode =
+ CompStackingUpdateModeNormal;
+
+ w->updateAttributes (mode);
+ }
}
}
}
}
- }
- break;
- case LeaveNotify:
- if (event->xcrossing.detail != NotifyInferior)
- {
- if (event->xcrossing.window == below)
+ break;
+
+ case LeaveNotify:
+ if (event->xcrossing.detail != NotifyInferior &&
+ event->xcrossing.window == below)
below = None;
- }
- break;
- default:
- if (privateScreen.xShape.isEnabled () &&
- event->type == privateScreen.xShape.get () + ShapeNotify)
- {
- w = findWindow (((XShapeEvent *) event)->window);
- if (w)
+
+ break;
+
+ default:
+ if (privateScreen.xShape.isEnabled () &&
+ event->type == privateScreen.xShape.get () + ShapeNotify)
{
- if (w->mapNum ())
+ w = findWindow (((XShapeEvent *) event)->window);
+
+ if (w &&
+ w->mapNum ())
w->priv->updateRegion ();
}
- }
- else if (event->type == privateScreen.xSync.get () + XSyncAlarmNotify)
- {
- XSyncAlarmNotifyEvent *sa;
-
- sa = (XSyncAlarmNotifyEvent *) event;
-
-
- for (cps::WindowManager::iterator i = windowManager.begin(); i != windowManager.end(); ++i)
+ else if (event->type == privateScreen.xSync.get () + XSyncAlarmNotify)
{
- CompWindow* const w(*i);
- if (w->priv->syncAlarm == sa->alarm)
+ XSyncAlarmNotifyEvent *sa = (XSyncAlarmNotifyEvent *) event;
+
+ for (cps::WindowManager::iterator i = windowManager.begin(); i != windowManager.end(); ++i)
{
- w->priv->handleSyncAlarm ();
- break;
+ CompWindow* const w(*i);
+
+ if (w->priv->syncAlarm == sa->alarm)
+ {
+ w->priv->handleSyncAlarm ();
+ break;
+ }
}
}
- }
- break;
+
+ break;
}
}
=== modified file 'src/eventmanagement.h'
--- src/eventmanagement.h 2012-10-11 10:06:30 +0000
+++ src/eventmanagement.h 2013-07-21 23:03:28 +0000
@@ -75,6 +75,4 @@
}
}
-
-
#endif
=== modified file 'src/global.cpp'
--- src/global.cpp 2012-12-03 09:40:19 +0000
+++ src/global.cpp 2013-07-21 23:03:28 +0000
@@ -33,13 +33,13 @@
char **programArgv;
int programArgc;
-bool restartSignal = false;
+bool restartSignal = false;
-bool replaceCurrentWm = false;
+bool replaceCurrentWm = false;
bool sendStartupMessage = false;
-bool useDesktopHints = false;
-bool debugOutput = false;
-bool synchronousX = false;
+bool useDesktopHints = false;
+bool debugOutput = false;
+bool synchronousX = false;
std::list initialPlugins;
=== modified file 'src/main.cpp'
--- src/main.cpp 2013-02-21 17:05:46 +0000
+++ src/main.cpp 2013-07-21 23:03:28 +0000
@@ -60,17 +60,18 @@
{
int status;
- switch (sig) {
- case SIGCHLD:
- waitpid (-1, &status, WNOHANG | WUNTRACED);
- break;
+ switch (sig)
+ {
+ case SIGCHLD:
+ waitpid (-1, &status, WNOHANG | WUNTRACED);
+ break;
}
}
bool
CompManager::parseArguments (int argc, char **argv)
{
- for (int i = 1; i < argc; i++)
+ for (int i = 1; i < argc; ++i)
{
if (!strcmp (argv[i], "--help"))
{
@@ -83,48 +84,28 @@
return false;
}
else if (!strcmp (argv[i], "--debug"))
- {
debugOutput = true;
- }
else if (!strcmp (argv[i], "--sync"))
- {
synchronousX = true;
- }
- else if (!strcmp (argv[i], "--display"))
- {
- if (i + 1 < argc)
- displayName = argv[++i];
- }
+ else if (!strcmp (argv[i], "--display") &&
+ i + 1 < argc)
+ displayName = argv[++i];
else if (!strcmp (argv[i], "--keep-desktop-hints"))
- {
useDesktopHints = true;
- }
else if (!strcmp (argv[i], "--replace"))
- {
replaceCurrentWm = true;
- }
else if (!strcmp (argv[i], "--send-startup-message"))
- {
sendStartupMessage = true;
- }
else if (!strcmp (argv[i], "--sm-disable"))
- {
disableSm = true;
- }
- else if (!strcmp (argv[i], "--sm-client-id"))
- {
- if (i + 1 < argc)
- clientId = argv[++i];
- }
+ else if (!strcmp (argv[i], "--sm-client-id") &&
+ i + 1 < argc)
+ clientId = argv[++i];
else if (*argv[i] == '-')
- {
compLogMessage ("core", CompLogLevelWarn,
"Unknown option '%s'\n", argv[i]);
- }
else
- {
initialPlugins.push_back (argv[i]);
- }
}
return true;
@@ -143,9 +124,7 @@
std::auto_ptr screen(new CompScreenImpl ());
if (screen->createFailed ())
- {
return false;
- }
::screen = screen.get();
@@ -159,11 +138,13 @@
if (clientId == NULL)
{
char *desktop_autostart_id = getenv ("DESKTOP_AUTOSTART_ID");
+
if (desktop_autostart_id != NULL)
clientId = strdup (desktop_autostart_id);
+
unsetenv ("DESKTOP_AUTOSTART_ID");
- }
- CompSession::init (clientId);
+ }
+ CompSession::init (clientId);
}
screen.release ();
@@ -200,6 +181,7 @@
#ifdef __linux__
char exe[PATH_MAX];
ssize_t len = readlink ("/proc/self/exe", exe, sizeof(exe)-1);
+
if (len > 0)
{
exe[len] = '\0';
@@ -210,24 +192,28 @@
{
// We need a private copy for dirname() to modify
char *tmpBin = strdup (bin);
+
if (tmpBin)
{
const char *binDir = dirname (tmpBin);
+
if (binDir)
{
char env[PATH_MAX];
snprintf (env, sizeof(env)-1, "COMPIZ_BIN_PATH=%s/", binDir);
putenv (strdup (env)); // parameter needs to be leaked!
}
+
free (tmpBin);
}
}
}
int
-main (int argc, char **argv)
+main (int argc,
+ char **argv)
{
- CompManager manager;
+ CompManager manager;
programName = argv[0];
programArgc = argc;
=== modified file 'src/match.cpp'
--- src/match.cpp 2012-12-10 05:35:03 +0000
+++ src/match.cpp 2013-07-21 23:03:28 +0000
@@ -39,11 +39,14 @@
const CompMatch CompMatch::emptyMatch;
-class CoreExp : public CompMatch::Expression {
+class CoreExp : public CompMatch::Expression
+{
public:
+
virtual ~CoreExp () {};
- typedef enum {
+ typedef enum
+ {
TypeXid,
TypeState,
TypeOverride,
@@ -51,7 +54,7 @@
TypeType
} Type;
- CoreExp (const CompString& str)
+ CoreExp (const CompString &str)
{
if (str.compare (0, 4, "xid=") == 0)
{
@@ -91,19 +94,31 @@
{
case TypeXid:
return ((unsigned int) priv.val == w->id ());
+ break;
+
case TypeState:
return (priv.uval & w->state ());
+ break;
+
case TypeOverride:
{
bool overrideRedirect = w->overrideRedirect ();
return ((priv.val == 1 && overrideRedirect) ||
(priv.val == 0 && !overrideRedirect));
+ break;
}
+
case TypeRGBA:
return ((priv.val && w->alpha ()) ||
(!priv.val && !w->alpha ()));
+ break;
+
case TypeType:
return (priv.uval & w->wmType ());
+ break;
+
+ default:
+ break;
}
return true;
}
@@ -113,7 +128,7 @@
};
CompMatch::Expression *
-CompScreen::matchInitExp (const CompString& str)
+CompScreen::matchInitExp (const CompString &str)
{
WRAPABLE_HND_FUNCTN_RETURN (CompMatch::Expression *, matchInitExp, str);
return _matchInitExp (str);
@@ -130,16 +145,21 @@
{
foreach (CompOption &option, options)
{
- switch (option.type ()) {
+ switch (option.type ())
+ {
case CompOption::TypeMatch:
option.value ().match ().update ();
break;
+
case CompOption::TypeList:
if (option.value ().listType () == CompOption::TypeMatch)
{
foreach (CompOption::Value &value, option.value ().list ())
value.match ().update ();
}
+
+ break;
+
default:
break;
}
@@ -181,15 +201,20 @@
MatchExpOp *exp;
foreach (MatchOp *op, list)
{
- switch (op->type ()) {
+ switch (op->type ())
+ {
case MatchOp::TypeGroup:
matchResetOps (dynamic_cast (op)->op);
break;
+
case MatchOp::TypeExp:
exp = dynamic_cast (op);
+
if (exp && exp->e)
exp->e.reset ();
+
break;
+
default:
break;
}
@@ -209,13 +234,12 @@
while (it1 != list1.end ())
{
- if ((*it1)->type () != (*it2)->type ())
- return false;
-
- if ((*it1)->flags != (*it2)->flags)
- return false;
-
- switch ((*it1)->type ()) {
+ if ((*it1)->type () != (*it2)->type () ||
+ (*it1)->flags != (*it2)->flags)
+ return false;
+
+ switch ((*it1)->type ())
+ {
case MatchOp::TypeGroup:
g1 = dynamic_cast (*it1);
g2 = dynamic_cast (*it2);
@@ -224,6 +248,7 @@
return false;
break;
+
case MatchOp::TypeExp:
e1 = dynamic_cast (*it1);
e2 = dynamic_cast (*it2);
@@ -232,6 +257,7 @@
return false;
break;
+
default:
break;
}
@@ -249,7 +275,7 @@
{
while (str[i] == '\\')
if (str[++i] != '\0')
- i++;
+ ++i;
return i;
}
@@ -263,37 +289,36 @@
/* count trialing white spaces */
i = j = 0;
+
while (i < n)
{
if (str[i] != ' ')
{
j = 0;
+
if (str[i] == '\\')
- i++;
+ ++i;
}
else
- {
- j++;
- }
+ ++j;
- i++;
+ ++i;
}
/* remove trialing white spaces */
n -= j;
i = j = 0;
+
for (;;)
{
if (str[i] == '\\')
- i++;
+ ++i;
value += str[i++];
if (i >= n)
- {
return value;
- }
}
}
@@ -312,23 +337,24 @@
CompString str)
{
CompString value;
- int j, i = 0;
- int flags = 0;
+ int j, i = 0;
+ int flags = 0;
str += "\0";
while (str[i] != '\0')
{
while (str[i] == ' ')
- i++;
+ ++i;
if (str[i] == '!')
{
flags |= MATCH_OP_NOT_MASK;
- i++;
+ ++i;
+
while (str[i] == ' ')
- i++;
+ ++i;
}
if (str[i] == '(')
@@ -341,12 +367,11 @@
while (str[j] != '\0')
{
if (str[j] == '(')
- {
- level++;
- }
+ ++level;
else if (str[j] == ')')
{
- level--;
+ --level;
+
if (level == 0)
break;
}
@@ -362,7 +387,7 @@
list.push_back (group);
while (str[j] != '\0' && str[j] != '|' && str[j] != '&')
- j++;
+ ++j;
}
else
{
@@ -387,7 +412,7 @@
if (str[i] == '&')
flags = MATCH_OP_AND_MASK;
- i++;
+ ++i;
}
}
@@ -403,23 +428,25 @@
foreach (MatchOp *op, list)
{
- switch (op->type ()) {
+ switch (op->type ())
+ {
case MatchOp::TypeGroup:
- group =
- matchOpsToString (dynamic_cast (op)->op);
+ group = matchOpsToString (dynamic_cast (op)->op);
if (group.length ())
{
if (value.length ())
- {
value += ((op->flags & MATCH_OP_AND_MASK) ?
"& " : "| ");
- }
+
if (op->flags & MATCH_OP_NOT_MASK)
value += "!";
+
value += "(" + group + ") ";
}
+
break;
+
case MatchOp::TypeExp:
if (value.length ())
value += ((op->flags & MATCH_OP_AND_MASK) ? "& " : "| ");
@@ -430,6 +457,7 @@
value += dynamic_cast (op)->value;
value += " ";
break;
+
default:
break;
}
@@ -445,17 +473,23 @@
matchUpdateOps (MatchOp::List &list)
{
MatchExpOp *exp;
+
foreach (MatchOp *op, list)
{
- switch (op->type ()) {
+ switch (op->type ())
+ {
case MatchOp::TypeGroup:
matchUpdateOps (dynamic_cast (op)->op);
break;
+
case MatchOp::TypeExp:
exp = dynamic_cast (op);
+
if (exp && screen)
exp->e.reset (screen->matchInitExp (exp->value));
+
break;
+
default:
break;
}
@@ -463,7 +497,7 @@
}
static bool
-matchEvalOps (MatchOp::List &list,
+matchEvalOps (MatchOp::List &list,
const CompWindow *w)
{
bool value, result = false;
@@ -478,25 +512,26 @@
if (!result)
return false;
}
- else
- {
+ else if (result)
/* result will always be true */
- if (result)
- return true;
- }
+ return true;
- switch (op->type ()) {
+ switch (op->type ())
+ {
case MatchOp::TypeGroup:
- value =
- matchEvalOps (dynamic_cast (op)->op, w);
+ value = matchEvalOps (dynamic_cast (op)->op, w);
break;
+
case MatchOp::TypeExp:
exp = dynamic_cast (op);
+
if (exp->e.get ())
value = exp->e->evaluate (w);
else
value = true;
+
break;
+
default:
value = true;
break;
@@ -525,13 +560,13 @@
MatchExpOp::MatchExpOp () :
value (""),
- e ()
+ e ()
{
}
MatchExpOp::MatchExpOp (const MatchExpOp &ex) :
value (ex.value),
- e (ex.e)
+ e (ex.e)
{
flags = ex.flags;
}
@@ -558,7 +593,7 @@
MatchGroupOp::operator= (const MatchGroupOp &gr)
{
MatchGroupOp *gop;
- MatchExpOp *eop;
+ MatchExpOp *eop;
foreach (MatchOp *o, op)
delete o;
@@ -572,11 +607,13 @@
case MatchOp::TypeGroup:
gop = new MatchGroupOp (dynamic_cast (*o));
op.push_back (gop);
+
break;
case MatchOp::TypeExp:
eop = new MatchExpOp (dynamic_cast (*o));
- op.push_back (eop);
+ op.push_back (eop);
break;
+
default:
break;
}
@@ -590,7 +627,6 @@
{
}
-
CompMatch::CompMatch () :
priv (new PrivateMatch ())
{
=== modified file 'src/modifierhandler.cpp'
--- src/modifierhandler.cpp 2012-12-01 17:07:09 +0000
+++ src/modifierhandler.cpp 2013-07-21 23:03:28 +0000
@@ -29,14 +29,16 @@
#include
#include "privatewindow.h"
-const unsigned int ModifierHandler::virtualModMask[7] = {
- CompAltMask, CompMetaMask, CompSuperMask, CompHyperMask,
- CompModeSwitchMask, CompNumLockMask, CompScrollLockMask
+const unsigned int ModifierHandler::virtualModMask[7] =
+{
+ CompAltMask, CompMetaMask, CompSuperMask, CompHyperMask,
+ CompModeSwitchMask, CompNumLockMask, CompScrollLockMask
};
-const int ModifierHandler::maskTable[8] = {
- ShiftMask, LockMask, ControlMask, Mod1Mask,
- Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask
+const int ModifierHandler::maskTable[8] =
+{
+ ShiftMask, LockMask, ControlMask, Mod1Mask,
+ Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask
};
unsigned int
@@ -55,34 +57,34 @@
ModifierHandler::updateModifierMappings ()
{
unsigned int modMask[CompModNum];
- int i, minKeycode, maxKeycode, keysymsPerKeycode = 0;
- KeySym* key;
+ int i, minKeycode, maxKeycode, keysymsPerKeycode = 0;
- for (i = 0; i < CompModNum; i++)
+ for (i = 0; i < CompModNum; ++i)
modMask[i] = 0;
XDisplayKeycodes (screen->dpy (), &minKeycode, &maxKeycode);
- key = XGetKeyboardMapping (screen->dpy (),
- minKeycode, (maxKeycode - minKeycode + 1),
- &keysymsPerKeycode);
+ KeySym *key = XGetKeyboardMapping (screen->dpy (),
+ minKeycode, (maxKeycode - minKeycode + 1),
+ &keysymsPerKeycode);
if (mModMap)
XFreeModifiermap (mModMap);
mModMap = XGetModifierMapping (screen->dpy ());
+
if (mModMap && mModMap->max_keypermod > 0)
{
KeySym keysym;
- int index, size, mask;
-
- size = maskTableSize * mModMap->max_keypermod;
-
- for (i = 0; i < size; i++)
+ int index, mask;
+ int size = maskTableSize * mModMap->max_keypermod;
+
+ for (i = 0; i < size; ++i)
{
if (!mModMap->modifiermap[i])
continue;
index = 0;
+
do
{
keysym = XKeycodeToKeysym (screen->dpy (),
@@ -96,44 +98,28 @@
if (keysym == XK_Alt_L ||
keysym == XK_Alt_R)
- {
modMask[CompModAlt] |= mask;
- }
else if (keysym == XK_Meta_L ||
keysym == XK_Meta_R)
- {
modMask[CompModMeta] |= mask;
- }
else if (keysym == XK_Super_L ||
keysym == XK_Super_R)
- {
modMask[CompModSuper] |= mask;
- }
else if (keysym == XK_Hyper_L ||
keysym == XK_Hyper_R)
- {
modMask[CompModHyper] |= mask;
- }
else if (keysym == XK_Mode_switch)
- {
modMask[CompModModeSwitch] |= mask;
- }
else if (keysym == XK_Scroll_Lock)
- {
modMask[CompModScrollLock] |= mask;
- }
else if (keysym == XK_Num_Lock)
- {
modMask[CompModNumLock] |= mask;
- }
}
}
- for (i = 0; i < CompModNum; i++)
- {
+ for (i = 0; i < CompModNum; ++i)
if (!modMask[i])
modMask[i] = CompNoMask;
- }
if (memcmp (modMask, mModMask, sizeof (modMask)))
{
@@ -144,6 +130,7 @@
(modMask[CompModScrollLock] & ~CompNoMask);
screen->updatePassiveKeyGrabs ();
+
foreach (CompWindow *w, screen->windows ())
w->priv->updatePassiveButtonGrabs ();
}
@@ -156,7 +143,7 @@
unsigned int
ModifierHandler::virtualToRealModMask (unsigned int modMask)
{
- for (int i = 0; i < CompModNum; i++)
+ for (int i = 0; i < CompModNum; ++i)
{
if (modMask & virtualModMask[i])
{
@@ -172,17 +159,12 @@
ModifierHandler::keycodeToModifiers (int keycode)
{
unsigned int mods = 0;
- int mod, k;
- for (mod = 0; mod < maskTableSize; mod++)
- {
- for (k = 0; k < mModMap->max_keypermod; k++)
- {
+ for (int mod = 0; mod < maskTableSize; ++mod)
+ for (int k = 0; k < mModMap->max_keypermod; ++k)
if (mModMap->modifiermap[mod *
mModMap->max_keypermod + k] == keycode)
mods |= maskTable[mod];
- }
- }
return mods;
}
@@ -191,7 +173,7 @@
mIgnoredModMask (LockMask),
mModMap (0)
{
- for (int i = 0; i < ModNum; i++)
+ for (int i = 0; i < ModNum; ++i)
mModMask[i] = NoMask;
}
=== modified file 'src/option.cpp'
--- src/option.cpp 2012-12-01 17:07:09 +0000
+++ src/option.cpp 2013-07-21 23:03:28 +0000
@@ -127,18 +127,19 @@
return v;
}
-
-
static bool
checkIsAction (CompOption::Type type)
{
- switch (type) {
+ switch (type)
+ {
case CompOption::TypeAction:
case CompOption::TypeKey:
case CompOption::TypeButton:
case CompOption::TypeEdge:
case CompOption::TypeBell:
return true;
+ break;
+
default:
break;
}
@@ -151,10 +152,11 @@
}
void
-CompOption::Value::set (Type t, const CompOption::Value::Vector & v)
+CompOption::Value::set (Type t,
+ const CompOption::Value::Vector &v)
{
mListType = t;
- mValue = v;
+ mValue = v;
}
bool
@@ -281,6 +283,7 @@
{
if (priv->type == CompOption::TypeInt)
return priv->rest.i.min;
+
return MINSHORT;
}
@@ -289,6 +292,7 @@
{
if (priv->type == CompOption::TypeInt)
return priv->rest.i.max;
+
return MAXSHORT;
}
@@ -297,6 +301,7 @@
{
if (priv->type == CompOption::TypeFloat)
return priv->rest.f.min;
+
return MINSHORT;
}
@@ -305,6 +310,7 @@
{
if (priv->type == CompOption::TypeFloat)
return priv->rest.f.min;
+
return MINSHORT;
}
@@ -313,22 +319,26 @@
{
if (priv->type == CompOption::TypeFloat)
return priv->rest.f.precision;
+
return 0.1f;
}
void
-CompOption::Restriction::set (int min, int max)
+CompOption::Restriction::set (int min,
+ int max)
{
- priv->type = CompOption::TypeInt;
+ priv->type = CompOption::TypeInt;
priv->rest.i.min = min;
priv->rest.i.max = max;
}
void
-CompOption::Restriction::set (float min, float max, float precision)
+CompOption::Restriction::set (float min,
+ float max,
+ float precision)
{
- priv->type = CompOption::TypeFloat;
+ priv->type = CompOption::TypeFloat;
priv->rest.f.min = min;
priv->rest.f.max = max;
priv->rest.f.precision = precision;
@@ -339,10 +349,11 @@
{
if (priv->type != CompOption::TypeInt)
return true;
- if (i < priv->rest.i.min)
- return false;
- if (i > priv->rest.i.max)
- return false;
+
+ if (i < priv->rest.i.min ||
+ i > priv->rest.i.max)
+ return false;
+
return true;
}
@@ -351,10 +362,11 @@
{
if (priv->type != CompOption::TypeFloat)
return true;
- if (f < priv->rest.f.min)
- return false;
- if (f > priv->rest.f.max)
- return false;
+
+ if (f < priv->rest.f.min ||
+ f > priv->rest.f.max)
+ return false;
+
return true;
}
@@ -381,7 +393,7 @@
CompString name,
unsigned int *index)
{
- for (unsigned int i = 0; i < options.size (); i++)
+ for (unsigned int i = 0; i < options.size (); ++i)
{
if (options[i].priv->name == name)
{
@@ -443,12 +455,14 @@
}
void
-CompOption::setName (const char *name, CompOption::Type type)
+CompOption::setName (const char *name,
+ CompOption::Type type)
{
if (!name && !priv->name.empty ())
priv->name.clear ();
else if (name && priv->name != name)
priv->name = name;
+
priv->type = type;
}
@@ -545,6 +559,7 @@
if (val.action ().type () == value().action ().type () &&
!(val.action ().type () & CompAction::BindingTypeKey))
return false;
+
break;
case CompOption::TypeButton:
@@ -552,6 +567,7 @@
!(val.action ().type () & (CompAction::BindingTypeButton |
CompAction::BindingTypeEdgeButton)))
return false;
+
break;
default:
@@ -581,9 +597,9 @@
}
bool
-CompOption::getBoolOptionNamed (const Vector& options,
- const CompString& name,
- bool defaultValue)
+CompOption::getBoolOptionNamed (const Vector &options,
+ const CompString &name,
+ bool defaultValue)
{
foreach (const CompOption &o, options)
if (o.priv->type == CompOption::TypeBool && o.priv->name == name)
@@ -593,9 +609,9 @@
}
int
-CompOption::getIntOptionNamed (const Vector& options,
- const CompString& name,
- int defaultValue)
+CompOption::getIntOptionNamed (const Vector &options,
+ const CompString &name,
+ int defaultValue)
{
foreach (const CompOption &o, options)
if (o.priv->type == CompOption::TypeInt && o.priv->name == name)
@@ -617,9 +633,9 @@
}
CompString
-CompOption::getStringOptionNamed (const Vector& options,
- const CompString& name,
- const CompString& defaultValue)
+CompOption::getStringOptionNamed (const Vector &options,
+ const CompString &name,
+ const CompString &defaultValue)
{
foreach (const CompOption &o, options)
if (o.priv->type == CompOption::TypeString && o.priv->name == name)
@@ -629,9 +645,9 @@
}
unsigned short *
-CompOption::getColorOptionNamed (const Vector& options,
- const CompString& name,
- unsigned short *defaultValue)
+CompOption::getColorOptionNamed (const Vector &options,
+ const CompString &name,
+ unsigned short *defaultValue)
{
foreach (const CompOption &o, options)
if (o.priv->type == CompOption::TypeColor && o.priv->name == name)
@@ -682,31 +698,44 @@
CompString
CompOption::typeToString (CompOption::Type type)
{
- switch (type) {
+ switch (type)
+ {
case CompOption::TypeBool:
return "bool";
+
case CompOption::TypeInt:
return "int";
+
case CompOption::TypeFloat:
return "float";
+
case CompOption::TypeString:
return "string";
+
case CompOption::TypeColor:
return "color";
+
case CompOption::TypeAction:
return "action";
+
case CompOption::TypeKey:
return "key";
+
case CompOption::TypeButton:
return "button";
+
case CompOption::TypeEdge:
return "edge";
+
case CompOption::TypeBell:
return "bell";
+
case CompOption::TypeMatch:
return "match";
+
case CompOption::TypeList:
return "list";
+
default:
break;
}
@@ -722,18 +751,17 @@
}
PrivateOption::PrivateOption () :
- name (""),
- type (CompOption::TypeUnset),
+ name (""),
+ type (CompOption::TypeUnset),
value (),
- rest ()
+ rest ()
{
}
PrivateOption::PrivateOption (const PrivateOption &p) :
- name (p.name),
- type (p.type),
+ name (p.name),
+ type (p.type),
value (p.value),
- rest (p.rest)
+ rest (p.rest)
{
}
-
=== modified file 'src/option/tests/option.cpp'
--- src/option/tests/option.cpp 2012-12-10 13:01:00 +0000
+++ src/option/tests/option.cpp 2013-07-21 23:03:28 +0000
@@ -48,7 +48,7 @@
for (CompOption::Value::Vector::const_iterator it = vl.get ().begin ();
it != vl.get ().end ();
- it++)
+ ++it)
{
T inst;
CompOption::Value value (inst);
=== modified file 'src/plugin.cpp'
--- src/plugin.cpp 2013-06-28 01:10:57 +0000
+++ src/plugin.cpp 2013-07-21 23:03:28 +0000
@@ -47,7 +47,7 @@
static const char here[] = "core";
-CompPlugin::Map pluginsMap;
+CompPlugin::Map pluginsMap;
CompPlugin::List plugins;
class CorePluginVTable : public CompPlugin::VTable
@@ -70,9 +70,7 @@
CompPlugin::VTable * getCoreVTable ()
{
if (!coreVTable)
- {
return getCompPluginVTable20090315_core ();
- }
return coreVTable;
}
@@ -111,15 +109,13 @@
const char *path,
const char *name)
{
- if (path)
- return false;
-
- if (strcmp (name, getCoreVTable ()->name ().c_str ()))
- return false;
-
- p->vTable = getCoreVTable ();
+ if (path ||
+ strcmp (name, getCoreVTable ()->name ().c_str ()))
+ return false;
+
+ p->vTable = getCoreVTable ();
p->devPrivate.ptr = NULL;
- p->devType = "cloader";
+ p->devType = "cloader";
return true;
}
@@ -135,13 +131,13 @@
const char *path,
const char *name)
{
- CompString file;
- void *dlhand;
- bool loaded = false;
-
if (cloaderLoadPlugin (p, path, name))
return true;
+ CompString file;
+ void *dlhand;
+ bool loaded = false;
+
if (path)
{
file = path;
@@ -153,8 +149,8 @@
file += ".so";
compLogMessage (here, CompLogLevelDebug,
- "Trying to load %s from: %s", name, file.c_str ());
-
+ "Trying to load %s from: %s", name, file.c_str ());
+
int open_flags = RTLD_NOW;
#ifdef DEBUG
// Do not unload the library during dlclose.
@@ -163,20 +159,20 @@
open_flags |= RTLD_GLOBAL;
#endif
dlhand = dlopen (file.c_str (), open_flags);
+
if (dlhand)
{
- PluginGetInfoProc getInfo;
- char *error;
- char sym[1024];
-
compLogMessage (here, CompLogLevelDebug,
- "Opened library: %s", file.c_str ());
+ "Opened library: %s", file.c_str ());
dlerror ();
+ char sym[1024];
+
snprintf (sym, 1024, "getCompPluginVTable20090315_%s", name);
- getInfo = (PluginGetInfoProc) dlsym (dlhand, sym);
-
- error = dlerror ();
+ PluginGetInfoProc getInfo = (PluginGetInfoProc) dlsym (dlhand, sym);
+
+ char *error = dlerror ();
+
if (error)
{
compLogMessage (here, CompLogLevelError, "dlsym: %s", error);
@@ -186,28 +182,26 @@
if (getInfo)
{
p->vTable = (*getInfo) ();
+
if (!p->vTable)
- {
compLogMessage (here, CompLogLevelError,
"Couldn't get vtable from '%s' plugin",
file.c_str ());
- }
else
{
p->devPrivate.ptr = dlhand;
p->devType = "dlloader";
loaded = true;
+
compLogMessage (here, CompLogLevelDebug,
- "Loaded plugin %s from: %s",
- name, file.c_str ());
+ "Loaded plugin %s from: %s",
+ name, file.c_str ());
}
}
}
else
- {
compLogMessage (here, CompLogLevelDebug,
"dlopen failed: %s", dlerror ());
- }
if (!loaded && dlhand)
dlclose (dlhand);
@@ -236,10 +230,11 @@
CompManager::initPlugin (CompPlugin *p)
{
const char *name = p->vTable->name ().c_str ();
+
if (!p->vTable->init ())
{
compLogMessage (here, CompLogLevelError,
- "Plugin init failed: %s", name);
+ "Plugin init failed: %s", name);
return false;
}
@@ -250,14 +245,15 @@
if (!p->vTable->initScreen (screen))
{
compLogMessage (here, CompLogLevelError,
- "Plugin initScreen failed: %s", name);
+ "Plugin initScreen failed: %s", name);
p->vTable->fini ();
return false;
}
+
if (!screen->initPluginForScreen (p))
{
compLogMessage (here, CompLogLevelError,
- "initPluginForScreen failed: %s", name);
+ "initPluginForScreen failed: %s", name);
p->vTable->fini ();
return false;
}
@@ -291,26 +287,29 @@
{
using compiz::private_screen::WindowManager;
- bool status = true;
+ bool status = true;
WindowManager::iterator it, fail;
- CompWindow *w;
+ CompWindow *w;
it = fail = windowManager.begin ();
+
for (;it != windowManager.end (); ++it)
{
w = *it;
+
if (!p->vTable->initWindow (w))
{
const char *name = p->vTable->name ().c_str ();
compLogMessage (here, CompLogLevelError,
- "initWindow failed for %s", name);
- fail = it;
- status = false;
- break;
+ "initWindow failed for %s", name);
+ fail = it;
+ status = false;
+ break;
}
}
it = windowManager.begin ();
+
for (;it != fail; ++it)
{
w = *it;
@@ -362,7 +361,6 @@
s->finiPluginForScreen (p);
p->vTable->finiScreen (s);
}
-
}
bool
@@ -371,10 +369,8 @@
bool status = true;
for (List::reverse_iterator rit = plugins.rbegin ();
- rit != plugins.rend (); ++rit)
- {
+ rit != plugins.rend (); ++rit)
status &= (*rit)->vTable->initWindow (w);
- }
return status;
}
@@ -383,19 +379,16 @@
CompPlugin::windowFiniPlugins (CompWindow *w)
{
foreach (CompPlugin *p, plugins)
- {
p->vTable->finiWindow (w);
- }
}
-
CompPlugin *
CompPlugin::find (const char *name)
{
CompPlugin::Map::iterator it = pluginsMap.find (name);
if (it != pluginsMap.end ())
- return it->second;
+ return it->second;
return NULL;
}
@@ -408,6 +401,7 @@
const char *name = p->vTable->name ().c_str ();
compLogMessage (here, CompLogLevelInfo, "Unloading plugin: %s", name);
}
+
loaderUnloadPlugin (p);
delete p;
}
@@ -424,6 +418,7 @@
compLogMessage (here, CompLogLevelInfo, "Loading plugin: %s", name);
+<<<<<<< TREE
if (compiz_plugin_dir_override)
{
std::vector paths;
@@ -455,6 +450,24 @@
if (loaderLoadPlugin (p.get(), NULL, name))
return p.release();
+=======
+ if (compiz_plugin_dir_override &&
+ loaderLoadPlugin (p.get (), compiz_plugin_dir_override, name))
+ return p.release ();
+
+ if (char *home = getenv ("HOME"))
+ {
+ boost::scoped_array plugindir(new char [strlen (home) + strlen (HOME_PLUGINDIR) + 3]);
+ sprintf (plugindir.get(), "%s/%s", home, HOME_PLUGINDIR);
+
+ if (loaderLoadPlugin (p.get(), plugindir.get(), name))
+ return p.release();
+ }
+
+ if (loaderLoadPlugin (p.get(), PLUGINDIR, name) ||
+ loaderLoadPlugin (p.get(), NULL, name))
+ return p.release();
+>>>>>>> MERGE-SOURCE
compLogMessage (here, CompLogLevelError, "Failed to load plugin: %s", name);
@@ -466,7 +479,7 @@
{
const CompString &name = p->vTable->name ();
std::pair insertRet =
- pluginsMap.insert (std::make_pair (name, p));
+ pluginsMap.insert (std::make_pair (name, p));
if (!insertRet.second)
{
@@ -480,16 +493,15 @@
plugins.push_front (p);
compLogMessage (here, CompLogLevelInfo, "Starting plugin: %s", name.c_str ());
+
if (CompManager::initPlugin (p))
- {
compLogMessage (here, CompLogLevelDebug, "Started plugin: %s", name.c_str ());
- }
else
{
compLogMessage (here, CompLogLevelError,
"Failed to start plugin: %s", name.c_str ());
- pluginsMap.erase (name);
+ pluginsMap.erase (name);
plugins.pop_front ();
return false;
@@ -531,11 +543,11 @@
CompPlugin::getPluginABI (const char *name)
{
CompPlugin *p = find (name);
+
+ if (!p)
+ return 0;
+
CompString s = name;
-
- if (!p)
- return 0;
-
s += "_ABI";
if (!screen->hasValue (s))
@@ -548,9 +560,8 @@
CompPlugin::checkPluginABI (const char *name,
int abi)
{
- int pluginABI;
+ int pluginABI = getPluginABI (name);
- pluginABI = getPluginABI (name);
if (!pluginABI)
{
compLogMessage (here, CompLogLevelError,
@@ -586,9 +597,10 @@
CompPlugin::VTable **self)
{
mName = name;
+
if (self)
{
- mSelf = self;
+ mSelf = self;
*mSelf = this;
}
}
=== modified file 'src/pluginclasshandler/include/core/pluginclasshandler.h'
--- src/pluginclasshandler/include/core/pluginclasshandler.h 2013-04-22 13:35:23 +0000
+++ src/pluginclasshandler/include/core/pluginclasshandler.h 2013-07-21 23:03:28 +0000
@@ -202,7 +202,7 @@
* plugin class and set the index pointer */
if (!mIndex.failed)
{
- mIndex.refCount++;
+ ++mIndex.refCount;
mBase->pluginClasses[mIndex.index] = static_cast (this);
}
}
@@ -232,7 +232,7 @@
if (!ValueHolder::Default ()->hasValue (keyName ()))
{
ValueHolder::Default ()->storeValue (keyName (), p);
- pluginClassHandlerIndex++;
+ ++pluginClassHandlerIndex;
}
else
{
@@ -260,7 +260,7 @@
* class allocation was actually successful */
if (!mIndex.pcFailed)
{
- mIndex.refCount--;
+ --mIndex.refCount;
/* Once this index's reference count hits zero it
* means that there are no more plugin classes attached
@@ -276,7 +276,7 @@
mIndex.failed = false;
mIndex.pcIndex = pluginClassHandlerIndex;
ValueHolder::Default ()->eraseValue (keyName ());
- pluginClassHandlerIndex++;
+ ++pluginClassHandlerIndex;
}
}
}
=== modified file 'src/pluginclasshandler/src/pluginclasses.cpp'
--- src/pluginclasshandler/src/pluginclasses.cpp 2012-01-12 06:48:58 +0000
+++ src/pluginclasshandler/src/pluginclasses.cpp 2013-07-21 23:03:28 +0000
@@ -39,7 +39,7 @@
{
unsigned int i;
- for (i = 0; i < iList.size (); i++)
+ for (i = 0; i < iList.size (); ++i)
{
if (!iList.at (i))
{
=== modified file 'src/pluginclasshandler/src/valueholder.cpp'
--- src/pluginclasshandler/src/valueholder.cpp 2012-02-06 17:44:17 +0000
+++ src/pluginclasshandler/src/valueholder.cpp 2013-07-21 23:03:28 +0000
@@ -63,30 +63,21 @@
void
ValueHolder::storeValue (CompString key, CompPrivate value)
{
- std::map::iterator it;
-
- it = priv->valueMap.find (key);
+ std::map::iterator it = priv->valueMap.find (key);
if (it != priv->valueMap.end ())
- {
it->second = value;
- }
else
- {
priv->valueMap.insert (std::pair (key, value));
- }
}
void
ValueHolder::eraseValue (CompString key)
{
- std::map::iterator it;
- it = priv->valueMap.find (key);
+ std::map::iterator it = priv->valueMap.find (key);
if (it != priv->valueMap.end ())
- {
priv->valueMap.erase (key);
- }
}
bool
@@ -100,13 +91,10 @@
{
CompPrivate p;
- std::map::iterator it;
- it = priv->valueMap.find (key);
+ std::map::iterator it = priv->valueMap.find (key);
if (it != priv->valueMap.end ())
- {
return it->second;
- }
else
{
p.uval = 0;
=== modified file 'src/point/src/point.cpp'
--- src/point/src/point.cpp 2012-01-19 19:16:27 +0000
+++ src/point/src/point.cpp 2013-07-21 23:03:28 +0000
@@ -31,14 +31,16 @@
{
}
-CompPoint::CompPoint (int x, int y) :
+CompPoint::CompPoint (int x,
+ int y) :
mX (x),
mY (y)
{
}
void
-CompPoint::set (int x, int y)
+CompPoint::set (int x,
+ int y)
{
mX = x;
mY = y;
@@ -97,4 +99,3 @@
{
return CompPoint (mX - rhs.mX, mY - rhs.mY);
}
-
=== modified file 'src/privateaction.h'
--- src/privateaction.h 2012-10-02 10:28:01 +0000
+++ src/privateaction.h 2013-07-21 23:03:28 +0000
@@ -41,8 +41,8 @@
virtual void setActive (bool) = 0;
};
-void setActionActiveState (const CompAction &action,
- bool active);
+void setActionActiveState (const CompAction &action,
+ bool active);
}
}
@@ -50,15 +50,16 @@
public compiz::actions::BoundAction
{
public:
+
PrivateAction ();
- PrivateAction (const PrivateAction&);
+ PrivateAction (const PrivateAction &);
void setActive (bool);
- CompAction::CallBack initiate;
- CompAction::CallBack terminate;
+ CompAction::CallBack initiate;
+ CompAction::CallBack terminate;
- CompAction::State state;
+ CompAction::State state;
CompAction::BindingType type;
=== modified file 'src/privateeventsource.h'
--- src/privateeventsource.h 2012-12-02 12:06:02 +0000
+++ src/privateeventsource.h 2013-07-21 23:03:28 +0000
@@ -54,9 +54,9 @@
private:
- Display *mDpy;
- Glib::PollFD mPollFD;
- int mConnectionFD;
+ Display *mDpy;
+ Glib::PollFD mPollFD;
+ int mConnectionFD;
};
#endif
=== modified file 'src/privateiosource.h'
--- src/privateiosource.h 2012-12-02 12:06:02 +0000
+++ src/privateiosource.h 2013-07-21 23:03:28 +0000
@@ -47,22 +47,25 @@
virtual ~CompWatchFd ();
static
- CompWatchFd * create (int,
- Glib::IOCondition,
- FdWatchCallBack);
+ CompWatchFd * create (int ,
+ Glib::IOCondition ,
+ FdWatchCallBack );
protected:
- explicit CompWatchFd (int, Glib::IOCondition, FdWatchCallBack);
- bool internalCallback (Glib::IOCondition);
+ explicit
+ CompWatchFd (int ,
+ Glib::IOCondition ,
+ FdWatchCallBack );
+ bool internalCallback (Glib::IOCondition);
private:
- int mFd;
+ int mFd;
FdWatchCallBack mCallBack;
CompWatchFdHandle mHandle;
- bool mForceFail;
- bool mExecuting;
+ bool mForceFail;
+ bool mExecuting;
friend class ::compiz::private_screen::EventManager;
};
=== modified file 'src/privatematch.h'
--- src/privatematch.h 2009-03-16 09:18:16 +0000
+++ src/privatematch.h 2013-07-21 23:03:28 +0000
@@ -34,9 +34,12 @@
#define MATCH_OP_AND_MASK (1 << 0)
#define MATCH_OP_NOT_MASK (1 << 1)
-class MatchOp {
+class MatchOp
+{
public:
- typedef enum {
+
+ typedef enum
+ {
TypeNone,
TypeGroup,
TypeExp
@@ -52,22 +55,27 @@
unsigned int flags;
};
-class MatchExpOp : public MatchOp {
+class MatchExpOp : public MatchOp
+{
public:
+
MatchExpOp ();
MatchExpOp (const MatchExpOp &);
MatchOp::Type type () { return MatchOp::TypeExp; };
- CompString value;
+ CompString value;
boost::shared_ptr e;
};
-class MatchGroupOp : public MatchOp {
+class MatchGroupOp : public MatchOp
+{
public:
+
MatchGroupOp ();
~MatchGroupOp ();
+
MatchGroupOp (const MatchGroupOp &);
MatchGroupOp & operator= (const MatchGroupOp &);
@@ -77,11 +85,14 @@
MatchOp::List op;
};
-class PrivateMatch {
+class PrivateMatch
+{
public:
+
PrivateMatch ();
public:
+
MatchGroupOp op;
};
=== modified file 'src/privateoption.h'
--- src/privateoption.h 2012-01-24 08:24:18 +0000
+++ src/privateoption.h 2013-07-21 23:03:28 +0000
@@ -34,23 +34,27 @@
#include
#include
-typedef struct _CompOptionIntRestriction {
+typedef struct _CompOptionIntRestriction
+{
int min;
int max;
} IntRestriction;
-typedef struct _CompOptionFloatRestriction {
+typedef struct _CompOptionFloatRestriction
+{
float min;
float max;
float precision;
} FloatRestriction;
-typedef union {
- IntRestriction i;
- FloatRestriction f;
+typedef union
+{
+ IntRestriction i;
+ FloatRestriction f;
} RestrictionUnion;
-class PrivateRestriction {
+class PrivateRestriction
+{
public:
CompOption::Type type;
RestrictionUnion rest;
=== modified file 'src/privatescreen.h'
--- src/privatescreen.h 2013-05-12 08:20:10 +0000
+++ src/privatescreen.h 2013-07-21 23:03:28 +0000
@@ -53,10 +53,10 @@
class CoreWindow;
-extern bool shutDown;
-extern bool restartSignal;
+extern bool shutDown;
+extern bool restartSignal;
-extern bool useDesktopHints;
+extern bool useDesktopHints;
extern std::list initialPlugins;
@@ -66,27 +66,30 @@
CompAction::CallBack initiate;
CompAction::CallBack terminate;
- unsigned int edge;
- unsigned int state;
+ unsigned int edge;
+ unsigned int state;
- CompOption::Vector options;
+ CompOption::Vector options;
} CompDelayedEdgeSettings;
-struct CompScreenEdge {
- Window id;
+struct CompScreenEdge
+{
+ Window id;
unsigned int count;
};
-struct CompGroup {
- unsigned int refCnt;
- Window id;
+struct CompGroup
+{
+ unsigned int refCnt;
+ Window id;
};
-struct CompStartupSequence {
- SnStartupSequence *sequence;
- unsigned int viewportX;
- unsigned int viewportY;
+struct CompStartupSequence
+{
+ SnStartupSequence *sequence;
+ unsigned int viewportX;
+ unsigned int viewportY;
};
namespace compiz
@@ -118,7 +121,7 @@
typedef CompWindow::ForEach Functor;
- WindowManager();
+ WindowManager ();
CompGroup * addGroup (Window id);
void removeGroup (CompGroup *group);
@@ -127,90 +130,102 @@
void eraseWindowFromMap (Window id);
void removeDestroyed ();
- void updateClientList (PrivateScreen& ps);
+ void updateClientList (PrivateScreen &ps);
- void addToDestroyedWindows(CompWindow * cw)
+ void addToDestroyedWindows (CompWindow *cw)
{ destroyedWindows.push_back (cw); }
- void incrementPendingDestroys() { pendingDestroys++; }
- const CompWindowVector& getClientList () const
- { return clientList; }
- const CompWindowVector& getClientListStacking () const
- { return clientListStacking; }
+ void incrementPendingDestroys ()
+ {
+ ++pendingDestroys;
+ }
+
+ const CompWindowVector &getClientList () const
+ {
+ return clientList;
+ }
+
+ const CompWindowVector &getClientListStacking () const
+ {
+ return clientListStacking;
+ }
CompWindow * findWindow (Window id) const;
- CompWindow * getTopWindow() const;
- CompWindow * getTopServerWindow() const;
-
-
- void removeFromFindWindowCache(CompWindow* w)
+ CompWindow * getTopWindow () const;
+ CompWindow * getTopServerWindow () const;
+
+
+ void removeFromFindWindowCache (CompWindow *w)
{
if (w == lastFoundWindow)
lastFoundWindow = 0;
}
- void addWindowToMap(CompWindow* w)
+ void addWindowToMap(CompWindow *w)
{
if (w->id () != 1)
windowsMap[w->id ()] = w;
}
- void validateServerWindows();
-
- void invalidateServerWindows();
-
- void insertWindow (CompWindow* w, Window aboveId);
+ void validateServerWindows ();
+
+ void invalidateServerWindows ();
+
+ void insertWindow (CompWindow *w,
+ Window aboveId);
void unhookWindow (CompWindow *w);
- CompWindowList& getWindows() { return windows; }
-
- CompWindowList& getDestroyedWindows() { return destroyedWindows; }
-
- void insertServerWindow(CompWindow* w, Window aboveId);
- void unhookServerWindow(CompWindow *w);
- CompWindowList& getServerWindows() { return serverWindows; }
+ CompWindowList &getWindows () { return windows; }
+
+ CompWindowList &getDestroyedWindows () { return destroyedWindows; }
+
+ void insertServerWindow (CompWindow *w,
+ Window aboveId);
+ void unhookServerWindow (CompWindow *w);
+ CompWindowList &getServerWindows () { return serverWindows; }
typedef CompWindowList::const_iterator iterator;
typedef CompWindowList::const_reverse_iterator reverse_iterator;
- iterator begin() const { return windows.begin(); }
- iterator end() const { return windows.end(); }
- reverse_iterator rbegin() const { return windows.rbegin(); }
- reverse_iterator rend() const { return windows.rend(); }
-
- iterator serverBegin() const { return serverWindows.begin(); }
- iterator serverEnd() const { return serverWindows.end(); }
- reverse_iterator rserverBegin() const { return serverWindows.rbegin(); }
- reverse_iterator rserverEnd() const { return serverWindows.rend(); }
-
- void clearFullscreenHints() const;
- void showOrHideForDesktop(unsigned int desktop) const;
- void setWindowActiveness(::compiz::private_screen::History& history) const;
+ iterator begin () const { return windows.begin (); }
+ iterator end () const { return windows.end (); }
+ reverse_iterator rbegin () const { return windows.rbegin (); }
+ reverse_iterator rend () const { return windows.rend (); }
+
+ iterator serverBegin () const { return serverWindows.begin (); }
+ iterator serverEnd () const { return serverWindows.end (); }
+ reverse_iterator rserverBegin () const { return serverWindows.rbegin (); }
+ reverse_iterator rserverEnd () const { return serverWindows.rend (); }
+
+ void clearFullscreenHints () const;
+ void showOrHideForDesktop (unsigned int desktop) const;
+ void setWindowActiveness (::compiz::private_screen::History& history) const;
void setNumberOfDesktops (unsigned int nDesktop) const;
- void updateWindowSizes() const;
+ void updateWindowSizes () const;
- void forEachWindow(Functor const& f) const
+ void forEachWindow (Functor const& f) const
{
- std::for_each(windows.begin(), windows.end(), f);
+ std::for_each (windows.begin (), windows.end (), f);
}
private:
- CompWindowList windows;
- CompWindowList serverWindows;
- CompWindowList destroyedWindows;
- bool stackIsFresh;
-
- CompWindow::Map windowsMap;
+
+ CompWindowList windows;
+ CompWindowList serverWindows;
+ CompWindowList destroyedWindows;
+ bool stackIsFresh;
+
+ CompWindow::Map windowsMap;
std::list groups;
- CompWindowVector clientList; /* clients in mapping order */
- CompWindowVector clientListStacking; /* clients in stacking order */
-
- std::vector clientIdList; /* client ids in mapping order */
- std::vector clientIdListStacking;/* client ids in stacking order */
-
- unsigned int pendingDestroys;
-
- mutable CompWindow* lastFoundWindow;
+ CompWindowVector clientList; /* clients in mapping order */
+ CompWindowVector clientListStacking; /* clients in stacking order */
+
+ std::vector clientIdList; /* client ids in mapping order */
+ std::vector clientIdListStacking;/* client ids in stacking order */
+
+ unsigned int pendingDestroys;
+
+ mutable CompWindow *lastFoundWindow;
};
unsigned int windowStateFromString (const char *str);
@@ -218,11 +233,13 @@
class PluginManager
{
public:
+
PluginManager();
- void updatePlugins (CompScreen* screen, CompOption::Value::Vector const& extraPluginsRequested);
+ void updatePlugins (CompScreen *screen,
+ CompOption::Value::Vector const &extraPluginsRequested);
- void setPlugins(CompOption::Value::Vector const& vList)
+ void setPlugins(CompOption::Value::Vector const &vList)
{
plugin.set (CompOption::TypeString, vList);
}
@@ -230,9 +247,10 @@
bool isDirtyPluginList () const { return dirtyPluginList; }
void setDirtyPluginList () { dirtyPluginList = true; }
- CompOption::Value::Vector mergedPluginList(CompOption::Value::Vector const& extraPluginsRequested) const;
+ CompOption::Value::Vector mergedPluginList(CompOption::Value::Vector const &extraPluginsRequested) const;
private:
+
CompOption::Value plugin;
bool dirtyPluginList;
typedef std::set CompStringSet;
@@ -265,6 +283,7 @@
public GrabList
{
public:
+
EventManager ();
~EventManager ();
@@ -278,24 +297,22 @@
CompAction::State state,
CompOption::Vector &arguments);
- void startEventLoop(Display* dpy);
- void quit() { mainloop->quit(); }
+ void startEventLoop (Display *dpy);
+ void quit () { mainloop->quit(); }
- CompWatchFdHandle addWatchFd (
- int fd,
- short int events,
- FdWatchCallBack callBack);
+ CompWatchFdHandle addWatchFd (int fd,
+ short int events,
+ FdWatchCallBack callBack);
void removeWatchFd (CompWatchFdHandle handle);
- CompFileWatch* addFileWatch (
- const char *path,
- int mask,
- FileWatchCallBack callBack);
+ CompFileWatch* addFileWatch (const char *path,
+ int mask,
+ FileWatchCallBack callBack);
CompFileWatch* removeFileWatch (CompFileWatchHandle handle);
- const CompFileWatchList& getFileWatches () const;
+ const CompFileWatchList &getFileWatches () const;
void grabNotified() { grabbed = true; }
void ungrabNotified() { grabbed = false; }
@@ -310,7 +327,8 @@
void resetPossibleTap() { possibleTap = 0; }
private:
- void *possibleTap;
+
+ void *possibleTap;
Glib::RefPtr mainloop;
@@ -332,28 +350,33 @@
std::list< CompWatchFd * > watchFds;
CompWatchFdHandle lastWatchFdHandle;
- bool grabbed; /* true once we receive a GrabNotify
+ bool grabbed; /* true once we receive a GrabNotify
on FocusOut and false on
UngrabNotify from FocusIn */
- Window grabWindow;
+ Window grabWindow;
};
-class KeyGrab {
+class KeyGrab
+{
public:
+
int keycode;
unsigned int modifiers;
int count;
};
-class ButtonGrab {
+class ButtonGrab
+{
public:
+
int button;
unsigned int modifiers;
int count;
};
-struct Grab {
- Grab(Cursor cursor, const char *name) : cursor(cursor), name(name) {}
+struct Grab
+{
+ Grab (Cursor cursor, const char *name) : cursor (cursor), name (name) {}
Cursor cursor;
const char *name;
};
@@ -371,40 +394,44 @@
class GrabManager : boost::noncopyable
{
-public:
- GrabManager(CompScreen *screen);
-
- bool addPassiveKeyGrab (CompAction::KeyBinding &key);
- void removePassiveKeyGrab (CompAction::KeyBinding &key);
- bool addPassiveButtonGrab (CompAction::ButtonBinding &button);
- void removePassiveButtonGrab (CompAction::ButtonBinding &button);
-
- void grabUngrabOneKey (unsigned int modifiers,
- int keycode,
- bool grab);
- bool grabUngrabKeys (unsigned int modifiers,
- int keycode,
- bool grab);
- void updatePassiveKeyGrabs ();
- void updatePassiveButtonGrabs(Window serverFrame);
-
- void setCurrentState(CompAction::State state);
-
-private:
- CompScreen * const screen;
- CompAction::State currentState;
-
- std::list buttonGrabs;
- std::list keyGrabs;
+ public:
+
+ GrabManager(CompScreen *screen);
+
+ bool addPassiveKeyGrab (CompAction::KeyBinding &key);
+ void removePassiveKeyGrab (CompAction::KeyBinding &key);
+ bool addPassiveButtonGrab (CompAction::ButtonBinding &button);
+ void removePassiveButtonGrab (CompAction::ButtonBinding &button);
+
+ void grabUngrabOneKey (unsigned int modifiers,
+ int keycode,
+ bool grab);
+ bool grabUngrabKeys (unsigned int modifiers,
+ int keycode,
+ bool grab);
+ void updatePassiveKeyGrabs ();
+ void updatePassiveButtonGrabs(Window serverFrame);
+
+ void setCurrentState(CompAction::State state);
+
+ private:
+
+ CompScreen *const screen;
+ CompAction::State currentState;
+
+ std::list buttonGrabs;
+ std::list keyGrabs;
};
class History : public virtual ::compiz::History,
boost::noncopyable
{
public:
+
History();
- void setCurrentActiveWindowHistory (int x, int y);
+ void setCurrentActiveWindowHistory (int x,
+ int y);
void addToCurrentActiveWindowHistory (Window id);
@@ -414,9 +441,10 @@
unsigned int activeNum () const;
private:
+
CompActiveWindowHistory history[ACTIVE_WINDOW_HISTORY_NUM];
int currentHistory_;
- unsigned int activeNum_;
+ unsigned int activeNum_;
};
class ViewportRetrievalInterface
@@ -449,14 +477,15 @@
namespace viewports
{
void viewportForGeometry (const CompWindow::Geometry &gm,
- CompPoint &viewport,
+ CompPoint &viewport,
ViewportRetrievalInterface *viewports,
- const CompSize &screenSize);
+ const CompSize &screenSize);
}
class StartupSequence : boost::noncopyable
{
public:
+
StartupSequence();
void addSequence (SnStartupSequence *sequence, CompPoint const& vp);
void removeSequence (SnStartupSequence *sequence);
@@ -466,6 +495,7 @@
virtual void updateStartupFeedback () = 0;
bool emptySequence() const { return startupSequences.empty(); }
private:
+
std::list startupSequences;
CompTimer startupSequenceTimer;
};
@@ -474,44 +504,49 @@
class StartupSequenceImpl : public StartupSequence
{
public:
- StartupSequenceImpl(PrivateScreen* priv) : priv(priv) {}
+
+ StartupSequenceImpl(PrivateScreen *priv) : priv (priv) {}
virtual void updateStartupFeedback ();
private:
- PrivateScreen* const priv;
+
+ PrivateScreen *const priv;
};
class Extension
{
-public:
- Extension() : is_enabled(), extension() {}
-
- template
- bool init(Display * dpy)
- {
- int error;
- is_enabled = ExtensionQuery(dpy, &extension, &error);
- return is_enabled;
- }
-
- template
- bool init(Display * dpy)
- {
- int opcode;
- int error;
- is_enabled = ExtensionQuery(dpy, &opcode, &extension, &error, NULL, NULL);
-
- if (!is_enabled) extension = -1;
-
- return is_enabled;
- }
-
- int isEnabled () const { return is_enabled; }
- int get () const { return extension; }
-
-private:
- bool is_enabled;
- int extension;
+ public:
+
+ Extension() : is_enabled(), extension() {}
+
+ template
+ bool init(Display * dpy)
+ {
+ int error;
+ is_enabled = ExtensionQuery(dpy, &extension, &error);
+ return is_enabled;
+ }
+
+ template
+ bool init(Display * dpy)
+ {
+ int opcode;
+ int error;
+ is_enabled = ExtensionQuery(dpy, &opcode, &extension, &error, NULL, NULL);
+
+ if (!is_enabled)
+ extension = -1;
+
+ return is_enabled;
+ }
+
+ int isEnabled () const { return is_enabled; }
+ int get () const { return extension; }
+
+ private:
+
+ bool is_enabled;
+ int extension;
};
class Ping :
@@ -724,18 +759,19 @@
{ pingTimer.setCallback(callback); }
public:
- Display* dpy;
- compiz::private_screen::Extension xSync;
- compiz::private_screen::Extension xRandr;
- compiz::private_screen::Extension xShape;
- compiz::private_screen::ViewPort viewPort;
+
+ Display *dpy;
+ compiz::private_screen::Extension xSync;
+ compiz::private_screen::Extension xRandr;
+ compiz::private_screen::Extension xShape;
+ compiz::private_screen::ViewPort viewPort;
compiz::private_screen::StartupSequenceImpl startupSequence;
- compiz::private_screen::EventManager eventManager;
- compiz::private_screen::OrphanData orphanData;
- compiz::core::OutputDevices outputDevices;
+ compiz::private_screen::EventManager eventManager;
+ compiz::private_screen::OrphanData orphanData;
+ compiz::core::OutputDevices outputDevices;
- Colormap colormap;
- int screenNum;
+ Colormap colormap;
+ int screenNum;
unsigned int nDesktop;
unsigned int currentDesktop;
@@ -753,6 +789,7 @@
bool initialized;
private:
+
CompScreen* screen;
compiz::private_screen::Extension xkbEvent;
@@ -783,7 +820,7 @@
CompDelayedEdgeSettings edgeDelaySettings;
Window xdndWindow;
compiz::private_screen::PluginManager pluginManager;
- compiz::private_screen::WindowManager& windowManager;
+ compiz::private_screen::WindowManager &windowManager;
};
class CompManager
@@ -822,6 +859,7 @@
::compiz::private_screen::History
{
public:
+
CompScreenImpl ();
~CompScreenImpl ();
@@ -919,7 +957,8 @@
CompWindowList & serverWindows ();
CompWindowList & destroyedWindows ();
- void warpPointer (int dx, int dy);
+ void warpPointer (int dx,
+ int dy);
Time getCurrentTime ();
@@ -929,7 +968,8 @@
void focusDefaultWindow ();
- void insertWindow (CompWindow *w, Window aboveId);
+ void insertWindow (CompWindow *w,
+ Window aboveId);
void unhookWindow (CompWindow *w);
void insertServerWindow (CompWindow *w, Window aboveId);
@@ -981,7 +1021,9 @@
void runCommand (CompString command);
- void moveViewport (int tx, int ty, bool sync);
+ void moveViewport (int tx,
+ int ty,
+ bool sync);
void sendWindowActivationRequest (Window id);
@@ -1026,32 +1068,32 @@
void updateSupportedWmHints ();
- unsigned int showingDesktopMask() const;
- virtual bool grabsEmpty() const;
- virtual void sizePluginClasses(unsigned int size);
+ unsigned int showingDesktopMask () const;
+ virtual bool grabsEmpty () const;
+ virtual void sizePluginClasses (unsigned int size);
virtual void setWindowState (unsigned int state, Window id);
- virtual void addToDestroyedWindows(CompWindow * cw);
+ virtual void addToDestroyedWindows (CompWindow * cw);
virtual void processEvents ();
virtual void alwaysHandleEvent (XEvent *event);
virtual ServerGrabInterface * serverGrabInterface ();
virtual void updatePassiveKeyGrabs () const;
- virtual void updatePassiveButtonGrabs(Window serverFrame);
+ virtual void updatePassiveButtonGrabs (Window serverFrame);
- virtual bool displayInitialised() const;
+ virtual bool displayInitialised () const;
virtual void applyStartupProperties (CompWindow *window);
- virtual void updateClientList();
- virtual CompWindow * getTopWindow() const;
- virtual CompWindow * getTopServerWindow() const;
- virtual CoreOptions& getCoreOptions();
- virtual Colormap colormap() const;
+ virtual void updateClientList ();
+ virtual CompWindow * getTopWindow () const;
+ virtual CompWindow * getTopServerWindow () const;
+ virtual CoreOptions& getCoreOptions ();
+ virtual Colormap colormap () const;
virtual void setCurrentDesktop (unsigned int desktop);
- virtual Window activeWindow() const;
- virtual bool grabWindowIsNot(Window w) const;
- virtual void incrementPendingDestroys();
- virtual void setNextActiveWindow(Window id);
- virtual Window getNextActiveWindow() const;
+ virtual Window activeWindow () const;
+ virtual bool grabWindowIsNot (Window w) const;
+ virtual void incrementPendingDestroys ();
+ virtual void setNextActiveWindow (Window id);
+ virtual Window getNextActiveWindow () const;
virtual CompWindow * focusTopMostWindow ();
public :
@@ -1120,43 +1162,54 @@
private:
- virtual bool _setOptionForPlugin(const char *, const char *, CompOption::Value &);
- virtual bool _initPluginForScreen(CompPlugin *);
- virtual void _finiPluginForScreen(CompPlugin *);
- virtual void _handleEvent(XEvent *event);
- virtual void _logMessage(const char *, CompLogLevel, const char*);
- virtual void _enterShowDesktopMode();
- virtual void _leaveShowDesktopMode(CompWindow *);
- virtual void _addSupportedAtoms(std::vector& atoms);
+ virtual bool _setOptionForPlugin (const char *, const char *, CompOption::Value &);
+ virtual bool _initPluginForScreen (CompPlugin *);
+ virtual void _finiPluginForScreen (CompPlugin *);
+ virtual void _handleEvent (XEvent *event);
+ virtual void _logMessage (const char *,
+ CompLogLevel, const char *);
+ virtual void _enterShowDesktopMode ();
+ virtual void _leaveShowDesktopMode (CompWindow *);
+ virtual void _addSupportedAtoms (std::vector& atoms);
- // These are stubs - but allow mocking of AbstractCompWindow
- virtual void _fileWatchAdded(CompFileWatch *);
- virtual void _fileWatchRemoved(CompFileWatch *);
- virtual void _sessionEvent(CompSession::Event, CompOption::Vector &);
- virtual void _handleCompizEvent(const char *, const char *, CompOption::Vector &);
- virtual bool _fileToImage(CompString &, CompSize &, int &, void *&);
- virtual bool _imageToFile(CompString &, CompString &, CompSize &, int, void *);
- virtual CompMatch::Expression * _matchInitExp(const CompString&);
- virtual void _matchExpHandlerChanged();
- virtual void _matchPropertyChanged(CompWindow *);
- virtual void _outputChangeNotify();
+ // These are stubs - but allow mocking of AbstractCompWindow
+ virtual void _fileWatchAdded (CompFileWatch *);
+ virtual void _fileWatchRemoved (CompFileWatch *);
+ virtual void _sessionEvent (CompSession::Event ,
+ CompOption::Vector &);
+ virtual void _handleCompizEvent (const char *,
+ const char *,
+ CompOption::Vector &);
+ virtual bool _fileToImage (CompString &,
+ CompSize &,
+ int &,
+ void *&);
+ virtual bool _imageToFile (CompString &,
+ CompString &,
+ CompSize &,
+ int ,
+ void *);
+ virtual CompMatch::Expression * _matchInitExp (const CompString &);
+ virtual void _matchExpHandlerChanged ();
+ virtual void _matchPropertyChanged (CompWindow *);
+ virtual void _outputChangeNotify ();
void grabServer ();
void ungrabServer ();
void syncServer ();
- bool handlePingTimeout();
+ bool handlePingTimeout();
- Window below;
- CompTimer autoRaiseTimer_;
- Window autoRaiseWindow_;
- CompIcon *defaultIcon_;
+ Window below;
+ CompTimer autoRaiseTimer_;
+ Window autoRaiseWindow_;
+ CompIcon *defaultIcon_;
compiz::private_screen::GrabManager mutable grabManager;
- ValueHolder valueHolder;
- bool eventHandled;
- PrivateScreen privateScreen;
- compiz::private_screen::WindowManager windowManager;
- unsigned int showingDesktopMask_;
+ ValueHolder valueHolder;
+ bool eventHandled;
+ PrivateScreen privateScreen;
+ compiz::private_screen::WindowManager windowManager;
+ unsigned int showingDesktopMask_;
};
#endif
=== modified file 'src/propertywriter.cpp'
--- src/propertywriter.cpp 2012-01-18 16:26:45 +0000
+++ src/propertywriter.cpp 2013-07-21 23:03:28 +0000
@@ -30,7 +30,7 @@
{
}
-PropertyWriter::PropertyWriter (CompString propName,
+PropertyWriter::PropertyWriter (CompString propName,
CompOption::Vector &readTemplate)
{
mPropertyValues = readTemplate;
@@ -50,77 +50,73 @@
}
bool
-PropertyWriter::updateProperty (Window id,
+PropertyWriter::updateProperty (Window id,
CompOption::Vector &propertyData,
- int type)
+ int type)
{
int count = 0;
-
if (type != XA_STRING)
{
- long int data[propertyData.size ()];
+ long int data[propertyData.size ()];
- foreach (CompOption &o, propertyData)
- {
+ foreach (CompOption &o, propertyData)
+ {
switch (o.type ())
{
- case CompOption::TypeBool:
+ case CompOption::TypeBool:
data[count] = o.value ().b ();
break;
- case CompOption::TypeInt:
+
+ case CompOption::TypeInt:
data[count] = o.value ().i ();
break;
- default:
+
+ default:
data[count] = 0;
break;
}
- count++;
+ ++count;
}
XChangeProperty (screen->dpy (), id,
mAtom, type, 32,
- PropModeReplace, (unsigned char *)data,
+ PropModeReplace, (unsigned char *)data,
propertyData.size ());
}
else
{
- char * data[propertyData.size ()];
- XTextProperty prop;
- bool ok = true;
+ char *data[propertyData.size ()];
+ XTextProperty prop;
+ bool ok = true;
- foreach (CompOption &o, propertyData)
- {
+ foreach (CompOption &o, propertyData)
+ {
switch (o.type ())
{
- case CompOption::TypeString:
+ case CompOption::TypeString:
data[count] = (char *) o.value ().s ().c_str ();
break;
- default:
+
+ default:
data[count] = NULL;
break;
}
- count++;
- }
+ ++count;
+ }
- for (int i = 0; i < count; i++)
- {
+ for (int i = 0; i < count; ++i)
if (data[i] == NULL)
- {
- ok = false;
- }
- }
+ ok = false;
- if (ok)
- {
- if (XStringListToTextProperty (data, count, &prop))
- {
- XSetTextProperty (screen->dpy (), id, &prop, mAtom);
- XFree (prop.value);
- }
- }
+ if (ok &&
+ XStringListToTextProperty (data, count, &prop))
+ {
+ XSetTextProperty (screen->dpy (), id, &prop, mAtom);
+ XFree (prop.value);
+ }
}
return true;
@@ -135,18 +131,18 @@
const CompOption::Vector &
PropertyWriter::readProperty (Window id)
{
- Atom type;
- int retval, fmt;
+ if (mPropertyValues.empty ())
+ return mPropertyValues;
+
+ Atom type;
+ int fmt;
unsigned long nitems, exbyte;
- long int *data;
-
- if (mPropertyValues.empty ())
- return mPropertyValues;
-
- retval = XGetWindowProperty (screen->dpy (), id, mAtom, 0,
- mPropertyValues.size (), False, XA_CARDINAL,
- &type, &fmt, &nitems, &exbyte,
- (unsigned char **)&data);
+ long int *data;
+
+ int retval = XGetWindowProperty (screen->dpy (), id, mAtom, 0,
+ mPropertyValues.size (), False, XA_CARDINAL,
+ &type, &fmt, &nitems, &exbyte,
+ (unsigned char **)&data);
if (retval == Success && !mPropertyValues.empty ())
{
@@ -155,26 +151,29 @@
if (type == XA_CARDINAL && fmt == 32 &&
nitems == mPropertyValues.size ())
{
+ CompOption::Value tmpVal;
+
foreach (CompOption &o, mPropertyValues)
{
- CompOption::Value tmpVal;
switch (mPropertyValues.at (count).type ())
{
case CompOption::TypeBool:
tmpVal = CompOption::Value ((bool) data[count]);
o.set (tmpVal);
break;
+
case CompOption::TypeInt:
tmpVal = CompOption::Value ((int) data[count]);
o.set (tmpVal);
break;
+
default:
tmpVal = CompOption::Value (CompOption::Value (0));
o.set (tmpVal);
break;
}
- count++;
+ ++count;
}
XFree (data);
@@ -188,55 +187,52 @@
if (tProp.value)
{
- int retCount = 0;
- char **tData = NULL;
-
- XTextPropertyToStringList (&tProp, &tData, &retCount);
-
- if (retCount == (int) mPropertyValues.size ())
- {
+ int retCount = 0;
+ char **tData = NULL;
+
+ XTextPropertyToStringList (&tProp, &tData, &retCount);
+
+ if (retCount == (int) mPropertyValues.size ())
+ {
+ CompOption::Value tmpVal;
+
foreach (CompOption &o, mPropertyValues)
{
- CompOption::Value tmpVal;
- tmpVal = CompOption::Value (CompString ((char *) tData[count]));
-
- o.set (tmpVal);
-
- count++;
+ tmpVal = CompOption::Value (CompString ((char *) tData[count]));
+
+ o.set (tmpVal);
+
+ ++count;
}
XFreeStringList (tData);
- XFree (data);
- XFree (tProp.value);
+ XFree (data);
+ XFree (tProp.value);
return mPropertyValues;
- }
- else
- {
+ }
+ else
+ {
XFreeStringList (tData);
- XFree (data);
- XFree (tProp.value);
+ XFree (data);
+ XFree (tProp.value);
return nilValues;
- }
+ }
}
else
{
XFree (data);
XFree (tProp.value);
- return nilValues;
+ return nilValues;
}
}
else if (fmt != 0)
- {
XFree (data);
- }
}
else
- {
return mPropertyValues;
- }
return mPropertyValues;
}
=== modified file 'src/rect/src/rect.cpp'
--- src/rect/src/rect.cpp 2012-10-16 06:51:36 +0000
+++ src/rect/src/rect.cpp 2013-07-21 23:03:28 +0000
@@ -41,7 +41,10 @@
mRegion.extents.y2 = 0;
}
-CompRect::CompRect (int x, int y, int width, int height)
+CompRect::CompRect (int x,
+ int y,
+ int width,
+ int height)
{
mRegion.rects = &mRegion.extents;
mRegion.numRects = 1;
@@ -122,7 +125,7 @@
}
void
-CompRect::setPos (const CompPoint& pos)
+CompRect::setPos (const CompPoint &pos)
{
setX (pos.x ());
setY (pos.y ());
@@ -141,7 +144,7 @@
}
void
-CompRect::setSize (const CompSize& size)
+CompRect::setSize (const CompSize &size)
{
mRegion.extents.x2 = mRegion.extents.x1 + size.width ();
mRegion.extents.y2 = mRegion.extents.y1 + size.height ();
@@ -180,45 +183,37 @@
}
bool
-CompRect::contains (const CompPoint& point) const
-{
- if (point.x () < x1 ())
- return false;
- if (point.x () > x2 ())
- return false;
- if (point.y () < y1 ())
- return false;
- if (point.y () > y2 ())
- return false;
-
- return true;
-}
-
-bool
-CompRect::contains (const CompRect& rect) const
-{
- if (rect.x1 () < x1 ())
- return false;
- if (rect.x2 () > x2 ())
- return false;
- if (rect.y1 () < y1 ())
- return false;
- if (rect.y2 () > y2 ())
- return false;
-
- return true;
-}
-
-bool
-CompRect::intersects (const CompRect& rect) const
-{
- int l, r, t, b;
-
+CompRect::contains (const CompPoint &point) const
+{
+ if (point.x () < x1 () ||
+ point.x () > x2 () ||
+ point.y () < y1 () ||
+ point.y () > y2 ())
+ return false;
+
+ return true;
+}
+
+bool
+CompRect::contains (const CompRect &rect) const
+{
+ if (rect.x1 () < x1 () ||
+ rect.x2 () > x2 () ||
+ rect.y1 () < y1 () ||
+ rect.y2 () > y2 ())
+ return false;
+
+ return true;
+}
+
+bool
+CompRect::intersects (const CompRect &rect) const
+{
/* extents of overlapping rectangle */
- l = MAX (left (), rect.left ());
- r = MIN (right (), rect.right ());
- t = MAX (top (), rect.top ());
- b = MIN (bottom (), rect.bottom ());
+ int l = MAX (left (), rect.left ());
+ int r = MIN (right (), rect.right ());
+ int t = MAX (top (), rect.top ());
+ int b = MIN (bottom (), rect.bottom ());
return (l < r) && (t < b);
}
@@ -233,9 +228,8 @@
int
CompRect::area () const
{
- if (mRegion.extents.x2 < mRegion.extents.x1)
- return 0;
- if (mRegion.extents.y2 < mRegion.extents.y1)
+ if (mRegion.extents.x2 < mRegion.extents.x1 ||
+ mRegion.extents.y2 < mRegion.extents.y1)
return 0;
return (mRegion.extents.x2 - mRegion.extents.x1) *
@@ -245,13 +239,10 @@
bool
CompRect::operator== (const CompRect &rect) const
{
- if (mRegion.extents.x1 != rect.mRegion.extents.x1)
- return false;
- if (mRegion.extents.y1 != rect.mRegion.extents.y1)
- return false;
- if (mRegion.extents.x2 != rect.mRegion.extents.x2)
- return false;
- if (mRegion.extents.y2 != rect.mRegion.extents.y2)
+ if (mRegion.extents.x1 != rect.mRegion.extents.x1 ||
+ mRegion.extents.y1 != rect.mRegion.extents.y1 ||
+ mRegion.extents.x2 != rect.mRegion.extents.x2 ||
+ mRegion.extents.y2 != rect.mRegion.extents.y2)
return false;
return true;
@@ -275,13 +266,11 @@
CompRect&
CompRect::operator&= (const CompRect &rect)
{
- int l, r, t, b;
-
/* extents of overlapping rectangle */
- l = MAX (left (), rect.left ());
- r = MIN (right (), rect.right ());
- t = MAX (top (), rect.top ());
- b = MIN (bottom (), rect.bottom ());
+ int l = MAX (left (), rect.left ());
+ int r = MIN (right (), rect.right ());
+ int t = MAX (top (), rect.top ());
+ int b = MIN (bottom (), rect.bottom ());
mRegion.extents.x1 = l;
mRegion.extents.x2 = r;
@@ -304,4 +293,3 @@
return *this;
}
-
=== modified file 'src/region/src/region.cpp'
--- src/region/src/region.cpp 2012-10-16 07:00:03 +0000
+++ src/region/src/region.cpp 2013-07-21 23:03:28 +0000
@@ -62,31 +62,34 @@
XUnionRegion (_emptyRegion ().handle (), c.handle (), handle ());
}
-CompRegion::CompRegion ( int x, int y, int w, int h)
+CompRegion::CompRegion (int x,
+ int y,
+ int w,
+ int h)
{
init ();
-
+
XRectangle rect;
-
+
rect.x = x;
rect.y = y;
- rect.width = w;
+ rect.width = w;
rect.height = h;
-
+
XUnionRectWithRegion (&rect, _emptyRegion ().handle (), handle ());
}
CompRegion::CompRegion (const CompRect &r)
{
init ();
-
+
XRectangle rect;
-
+
rect.x = r.x ();
rect.y = r.y ();
- rect.width = r.width ();
+ rect.width = r.width ();
rect.height = r.height ();
-
+
XUnionRectWithRegion (&rect, _emptyRegion ().handle (), handle ());
}
@@ -110,7 +113,7 @@
CompRegion::~CompRegion ()
{
if (priv)
- XDestroyRegion (static_cast (priv));
+ XDestroyRegion (static_cast (priv));
}
void
@@ -169,11 +172,12 @@
}
bool
-CompRegion::contains (int x, int y, int width, int height) const
+CompRegion::contains (int x,
+ int y,
+ int width,
+ int height) const
{
- int result;
-
- result = XRectInRegion (handle (), x, y, width, height);
+ int result = XRectInRegion (handle (), x, y, width, height);
return result == RectangleIn;
}
@@ -203,8 +207,7 @@
bool
CompRegion::intersects (const CompRect &r) const
{
- int result;
- result = XRectInRegion (handle (), r.x (), r.y (), r.width (), r.height ());
+ int result = XRectInRegion (handle (), r.x (), r.y (), r.width (), r.height ());
return result != RectangleOut;
}
@@ -225,15 +228,18 @@
CompRegion::rects () const
{
CompRect::vector rv;
+
if (!numRects ())
return rv;
BOX b;
- for (int i = 0; i < handle ()->numRects; i++)
+
+ for (int i = 0; i < handle ()->numRects; ++i)
{
b = handle ()->rects[i];
rv.push_back (CompRect (b.x1, b.y1, b.x2 - b.x1, b.y2 - b.y1));
}
+
return rv;
}
@@ -254,7 +260,8 @@
}
void
-CompRegion::translate (int dx, int dy)
+CompRegion::translate (int dx,
+ int dy)
{
XOffsetRegion (handle (), dx, dy);
}
@@ -266,7 +273,8 @@
}
CompRegion
-CompRegion::translated (int dx, int dy) const
+CompRegion::translated (int dx,
+ int dy) const
{
CompRegion rv (*this);
rv.translate (dx, dy);
@@ -282,7 +290,8 @@
}
void
-CompRegion::shrink (int dx, int dy)
+CompRegion::shrink (int dx,
+ int dy)
{
XShrinkRegion (handle (), dx, dy);
}
@@ -294,7 +303,8 @@
}
CompRegion
-CompRegion::shrinked (int dx, int dy) const
+CompRegion::shrinked (int dx,
+ int dy) const
{
CompRegion rv (*this);
rv.shrink (dx, dy);
@@ -439,4 +449,3 @@
XUnionRegion (handle (), r.handle (), handle ());
return *this;
}
-
=== modified file 'src/screen.cpp'
--- src/screen.cpp 2013-05-13 13:27:30 +0000
+++ src/screen.cpp 2013-07-21 23:03:28 +0000
@@ -67,12 +67,12 @@
CompOutput *targetOutput;
-int lastPointerX = 0;
-int lastPointerY = 0;
+int lastPointerX = 0;
+int lastPointerY = 0;
unsigned int lastPointerMods = 0;
-int pointerX = 0;
-int pointerY = 0;
-unsigned int pointerMods = 0;
+int pointerX = 0;
+int pointerY = 0;
+unsigned int pointerMods = 0;
namespace
{
@@ -85,18 +85,17 @@
#define MwmHintsDecorations (1L << 1)
static const unsigned short PropMotifWmHintElements = 3;
-typedef struct {
+typedef struct
+{
unsigned long flags;
unsigned long functions;
unsigned long decorations;
} MwmHints;
namespace cps = compiz::private_screen;
-namespace ca = compiz::actions;
-
-
-
-CompScreen *screen;
+namespace ca = compiz::actions;
+
+CompScreen *screen;
ModifierHandler *modHandler;
PluginClassStorage::Indices screenPluginClassIndices (0);
@@ -112,9 +111,9 @@
privateScreen.setWindowState (state, id);
}
-void CompScreenImpl::addToDestroyedWindows(CompWindow * cw)
+void CompScreenImpl::addToDestroyedWindows (CompWindow * cw)
{
- windowManager.addToDestroyedWindows(cw);
+ windowManager.addToDestroyedWindows (cw);
}
void CompScreenImpl::processEvents () { privateScreen.processEvents (); }
@@ -146,10 +145,12 @@
case SIGTERM:
mainloop->quit ();
break;
+
case SIGHUP:
restartSignal = true;
mainloop->quit ();
break;
+
default:
break;
}
@@ -160,11 +161,11 @@
void
CompScreenImpl::eventLoop ()
{
- privateScreen.eventManager.startEventLoop (dpy());
+ privateScreen.eventManager.startEventLoop (dpy ());
}
void
-cps::EventManager::startEventLoop(Display* dpy)
+cps::EventManager::startEventLoop (Display *dpy)
{
source = CompEventSource::create ();
timeout = CompTimeoutSource::create (ctx);
@@ -173,13 +174,13 @@
XFlush (dpy);
- mainloop->run();
+ mainloop->run ();
}
CompFileWatchHandle
CompScreenImpl::addFileWatch (const char *path,
- int mask,
- FileWatchCallBack callBack)
+ int mask,
+ FileWatchCallBack callBack)
{
CompFileWatch *fileWatch = privateScreen.eventManager.addFileWatch (path, mask, callBack);
@@ -192,17 +193,17 @@
}
CompFileWatch*
-cps::EventManager::addFileWatch (
- const char *path,
- int mask,
- FileWatchCallBack callBack)
+cps::EventManager::addFileWatch (const char *path,
+ int mask,
+ FileWatchCallBack callBack)
{
CompFileWatch *fw = new CompFileWatch ();
+
if (!fw)
return 0;
- fw->path = path;
- fw->mask = mask;
+ fw->path = path;
+ fw->mask = mask;
fw->callBack = callBack;
fw->handle = lastFileWatchHandle++;
@@ -237,7 +238,7 @@
if (it == fileWatch.end ())
return 0;
- CompFileWatch* w = (*it);
+ CompFileWatch *w = (*it);
fileWatch.erase (it);
return w;
@@ -255,7 +256,7 @@
return fileWatch;
}
-CompWatchFd::CompWatchFd (int fd,
+CompWatchFd::CompWatchFd (int fd,
Glib::IOCondition events,
FdWatchCallBack callback) :
Glib::IOSource (fd, events),
@@ -282,29 +283,33 @@
CompWatchFdHandle
CompScreenImpl::addWatchFd (int fd,
- short int events,
- FdWatchCallBack callBack)
+ short int events,
+ FdWatchCallBack callBack)
{
return privateScreen.eventManager.addWatchFd (fd, events, callBack);
}
CompWatchFdHandle
cps::EventManager::addWatchFd (int fd,
- short int events,
- FdWatchCallBack callBack)
+ short int events,
+ FdWatchCallBack callBack)
{
Glib::IOCondition gEvents;
-
+
memset (&gEvents, 0, sizeof (Glib::IOCondition));
if (events & POLLIN)
gEvents |= Glib::IO_IN;
+
if (events & POLLOUT)
gEvents |= Glib::IO_OUT;
+
if (events & POLLPRI)
gEvents |= Glib::IO_PRI;
+
if (events & POLLERR)
gEvents |= Glib::IO_ERR;
+
if (events & POLLHUP)
gEvents |= Glib::IO_HUP;
@@ -314,7 +319,8 @@
if (!watchFd)
return 0;
- watchFd->mHandle = lastWatchFdHandle++;
+
+ watchFd->mHandle = ++lastWatchFdHandle;
if (lastWatchFdHandle == MAXSHORT)
lastWatchFdHandle = 1;
@@ -334,19 +340,16 @@
cps::EventManager::removeWatchFd (CompWatchFdHandle handle)
{
std::list::iterator it;
- CompWatchFd * w;
- for (it = watchFds.begin();
+ for (it = watchFds.begin ();
it != watchFds.end (); ++it)
- {
if ((*it)->mHandle == handle)
break;
- }
if (it == watchFds.end ())
return;
- w = (*it);
+ CompWatchFd *w = (*it);
if (w->mExecuting)
{
@@ -383,14 +386,19 @@
if (events & Glib::IO_IN)
revents |= POLLIN;
+
if (events & Glib::IO_OUT)
revents |= POLLOUT;
+
if (events & Glib::IO_PRI)
revents |= POLLPRI;
+
if (events & Glib::IO_ERR)
revents |= POLLERR;
+
if (events & Glib::IO_HUP)
revents |= POLLHUP;
+
if (events & Glib::IO_NVAL)
return false;
@@ -405,9 +413,9 @@
//screen->priv->watchFds.remove (this);
return false;
}
-
+
return true;
-}
+}
void
CompScreenImpl::eraseValue (CompString key)
@@ -444,18 +452,18 @@
const char *name,
CompOption::Value &value)
{
- WRAPABLE_HND_FUNCTN_RETURN (bool, setOptionForPlugin,
- plugin, name, value)
+ WRAPABLE_HND_FUNCTN_RETURN (bool, setOptionForPlugin, plugin, name, value)
return _setOptionForPlugin(plugin, name, value);
}
bool
CompScreenImpl::_setOptionForPlugin (const char *plugin,
- const char *name,
- CompOption::Value &value)
+ const char *name,
+ CompOption::Value &value)
{
CompPlugin *p = CompPlugin::find (plugin);
+
if (p)
return p->vTable->setOption (name, value);
@@ -472,7 +480,7 @@
void
CompScreenImpl::_sessionEvent (CompSession::Event event,
- CompOption::Vector &arguments)
+ CompOption::Vector &arguments)
{
}
@@ -515,7 +523,7 @@
char str[128];
#endif
- errors++;
+ ++errors;
#ifdef DEBUG
XGetErrorDatabaseText (dpy, "XlibMessage", "XError", "", str, 128);
@@ -529,8 +537,10 @@
snprintf (str, 128, "%d", e->request_code);
XGetErrorDatabaseText (dpy, "XRequest", str, "", str, 128);
+
if (strcmp (str, ""))
fprintf (stderr, " (%s)", str);
+
fprintf (stderr, "\n ");
XGetErrorDatabaseText (dpy, "XlibMessage", "MinorCode", "%d", str, 128);
@@ -550,11 +560,9 @@
int
CompScreen::checkForError (Display *dpy)
{
- int e;
-
XSync (dpy, false);
- e = errors;
+ int e = errors;
errors = 0;
return e;
@@ -639,7 +647,7 @@
void
PrivateScreen::setAudibleBell (bool audible)
{
- if (xkbEvent.isEnabled())
+ if (xkbEvent.isEnabled ())
XkbChangeEnabledControls (dpy,
XkbUseCoreKbd,
XkbAudibleBellMask,
@@ -649,22 +657,23 @@
bool
CompScreenImpl::handlePingTimeout ()
{
- return Ping::handlePingTimeout(
- windowManager.begin(),
- windowManager.end(),
- privateScreen.dpy);
+ return Ping::handlePingTimeout (windowManager.begin (),
+ windowManager.end (),
+ privateScreen.dpy);
}
bool
-cps::Ping::handlePingTimeout (WindowManager::iterator begin, WindowManager::iterator end, Display* dpy)
+cps::Ping::handlePingTimeout (WindowManager::iterator begin,
+ WindowManager::iterator end,
+ Display *dpy)
{
- XEvent ev;
- int ping = lastPing_ + 1;
+ XEvent ev;
+ int ping = lastPing_ + 1;
- ev.type = ClientMessage;
- ev.xclient.window = 0;
+ ev.type = ClientMessage;
+ ev.xclient.window = 0;
ev.xclient.message_type = Atoms::wmProtocols;
- ev.xclient.format = 32;
+ ev.xclient.format = 32;
ev.xclient.data.l[0] = Atoms::wmPing;
ev.xclient.data.l[1] = ping;
ev.xclient.data.l[2] = 0;
@@ -674,6 +683,7 @@
for (WindowManager::iterator i = begin; i != end; ++i)
{
CompWindow* const w(*i);
+
if (w->priv->handlePingTimeout (lastPing_))
{
ev.xclient.window = w->id ();
@@ -696,7 +706,7 @@
bool
CompScreenImpl::setOption (const CompString &name,
- CompOption::Value &value)
+ CompOption::Value &value)
{
return privateScreen.setOption (name, value);
}
@@ -709,48 +719,54 @@
bool rv = CoreOptions::setOption (name, value);
- if (!rv)
+ if (!rv ||
+ !CompOption::findOption (getOptions (), name, &index))
return false;
- if (!CompOption::findOption (getOptions (), name, &index))
- return false;
-
- switch (index) {
+ switch (index)
+ {
case CoreOptions::ActivePlugins:
pluginManager.setDirtyPluginList ();
break;
+
case CoreOptions::PingDelay:
pingTimer.setTimes (optionGetPingDelay (),
optionGetPingDelay () + 500);
break;
+
case CoreOptions::AudibleBell:
setAudibleBell (optionGetAudibleBell ());
break;
+
case CoreOptions::DetectOutputs:
if (optionGetDetectOutputs ())
detectOutputDevices (*this);
break;
+
case CoreOptions::Hsize:
case CoreOptions::Vsize:
-
- if (optionGetHsize () * screen->width () > MAXSHORT)
- return false;
- if (optionGetVsize () * screen->height () > MAXSHORT)
+ if (optionGetHsize () * screen->width () > MAXSHORT ||
+ optionGetVsize () * screen->height () > MAXSHORT)
return false;
setVirtualScreenSize (optionGetHsize (), optionGetVsize ());
break;
+
case CoreOptions::NumberOfDesktops:
setNumberOfDesktops (optionGetNumberOfDesktops ());
break;
+
case CoreOptions::DefaultIcon:
return screen->updateDefaultIcon ();
break;
+
case CoreOptions::Outputs:
if (optionGetDetectOutputs ())
return false;
+
updateOutputDevices (*this);
break;
+
default:
break;
}
@@ -763,6 +779,7 @@
{
if (!XEventsQueued (dpy, QueuedAlready))
return false;
+
XNextEvent (dpy, &ev);
/* Skip to the last MotionNotify
@@ -770,6 +787,7 @@
if (ev.type == MotionNotify)
{
XEvent peekEvent;
+
while (XPending (dpy))
{
XPeekEvent (dpy, &peekEvent);
@@ -790,9 +808,7 @@
StackDebugger *dbg = StackDebugger::Default ();
if (StackDebugger::Default ())
- {
return dbg->getNextEvent (ev);
- }
else
return getNextXEvent (ev);
}
@@ -804,77 +820,83 @@
if (pluginManager.isDirtyPluginList ())
{
- eventManager.resetPossibleTap();
- pluginManager.updatePlugins (screen, optionGetActivePlugins());
+ eventManager.resetPossibleTap ();
+ pluginManager.updatePlugins (screen, optionGetActivePlugins ());
}
- windowManager.validateServerWindows();
+ windowManager.validateServerWindows ();
if (dbg)
{
dbg->windowsChanged (false);
dbg->serverWindowsChanged (false);
- dbg->loadStack (windowManager.getServerWindows());
+ dbg->loadStack (windowManager.getServerWindows ());
}
- windowManager.invalidateServerWindows();
+ windowManager.invalidateServerWindows ();
XEvent event;
while (getNextEvent (event))
{
- switch (event.type) {
- case ButtonPress:
- case ButtonRelease:
- pointerX = event.xbutton.x_root;
- pointerY = event.xbutton.y_root;
- pointerMods = event.xbutton.state;
- break;
- case KeyPress:
- case KeyRelease:
- pointerX = event.xkey.x_root;
- pointerY = event.xkey.y_root;
- pointerMods = event.xkey.state;
- break;
- case MotionNotify:
-
- pointerX = event.xmotion.x_root;
- pointerY = event.xmotion.y_root;
- pointerMods = event.xmotion.state;
- break;
- case EnterNotify:
- case LeaveNotify:
- pointerX = event.xcrossing.x_root;
- pointerY = event.xcrossing.y_root;
- pointerMods = event.xcrossing.state;
- break;
- case ClientMessage:
- if (event.xclient.message_type == Atoms::xdndPosition)
- {
- pointerX = event.xclient.data.l[2] >> 16;
- pointerY = event.xclient.data.l[2] & 0xffff;
- /* FIXME: Xdnd provides us no way of getting the pointer mods
- * without doing XQueryPointer, which is a round-trip */
- pointerMods = 0;
- }
- else if (event.xclient.message_type == Atoms::wmMoveResize)
- {
- int i;
- Window child, root;
- /* _NET_WM_MOVERESIZE is most often sent by clients who provide
- * a special "grab space" on a window for the user to initiate
- * adjustment by the window manager. Since we don't have a
- * passive grab on Button1 for active and raised windows, we
- * need to update the pointer buffer here */
-
- XQueryPointer (screen->dpy (), screen->root (),
- &root, &child, &pointerX, &pointerY,
- &i, &i, &pointerMods);
- }
- break;
- default:
- break;
- }
+ switch (event.type)
+ {
+ case ButtonPress:
+ case ButtonRelease:
+ pointerX = event.xbutton.x_root;
+ pointerY = event.xbutton.y_root;
+ pointerMods = event.xbutton.state;
+ break;
+
+ case KeyPress:
+ case KeyRelease:
+ pointerX = event.xkey.x_root;
+ pointerY = event.xkey.y_root;
+ pointerMods = event.xkey.state;
+ break;
+
+ case MotionNotify:
+ pointerX = event.xmotion.x_root;
+ pointerY = event.xmotion.y_root;
+ pointerMods = event.xmotion.state;
+ break;
+
+ case EnterNotify:
+ case LeaveNotify:
+ pointerX = event.xcrossing.x_root;
+ pointerY = event.xcrossing.y_root;
+ pointerMods = event.xcrossing.state;
+ break;
+
+ case ClientMessage:
+ if (event.xclient.message_type == Atoms::xdndPosition)
+ {
+ pointerX = event.xclient.data.l[2] >> 16;
+ pointerY = event.xclient.data.l[2] & 0xffff;
+ /* FIXME: Xdnd provides us no way of getting the pointer mods
+ * without doing XQueryPointer, which is a round-trip */
+ pointerMods = 0;
+ }
+ else if (event.xclient.message_type == Atoms::wmMoveResize)
+ {
+ int i;
+ Window child, root;
+ /* _NET_WM_MOVERESIZE is most often sent by clients who provide
+ * a special "grab space" on a window for the user to initiate
+ * adjustment by the window manager. Since we don't have a
+ * passive grab on Button1 for active and raised windows, we
+ * need to update the pointer buffer here */
+
+ XQueryPointer (screen->dpy (), screen->root (),
+ &root, &child, &pointerX, &pointerY,
+ &i, &i, &pointerMods);
+ }
+
+ break;
+
+ default:
+ break;
+ }
sn_display_process_event (snDisplay, &event);
@@ -895,20 +917,23 @@
if (dbg)
{
if (dbg->windowsChanged () &&
- dbg->cmpStack (windowManager.getWindows(), windowManager.getServerWindows()))
+ dbg->cmpStack (windowManager.getWindows (),
+ windowManager.getServerWindows ()))
{
compLogMessage ("core", CompLogLevelDebug, "stacks are out of sync");
+
if (dbg->timedOut ())
compLogMessage ("core", CompLogLevelDebug, "however, this may be a false positive");
}
- if (dbg->serverWindowsChanged () && dbg->checkSanity (windowManager.getWindows()))
+ if (dbg->serverWindowsChanged () &&
+ dbg->checkSanity (windowManager.getWindows ()))
compLogMessage ("core", CompLogLevelDebug, "windows are stacked incorrectly");
}
}
void
-cps::WindowManager::validateServerWindows()
+cps::WindowManager::validateServerWindows ()
{
/* Restacks recently processed, ensure that
* plugins use the stack last received from
@@ -927,30 +952,32 @@
}
void
-cps::WindowManager::invalidateServerWindows()
+cps::WindowManager::invalidateServerWindows ()
{
stackIsFresh = false;
}
void
-cps::WindowManager::clearFullscreenHints() const
+cps::WindowManager::clearFullscreenHints () const
{
/* clear out fullscreen monitor hints of all windows as
suggested on monitor layout changes in EWMH */
- for (iterator i = windows.begin(); i != windows.end(); ++i)
+ for (iterator i = windows.begin (); i != windows.end (); ++i)
{
- CompWindow* const w(*i);
+ CompWindow* const w (*i);
+
if (w->priv->fullscreenMonitorsSet)
w->priv->setFullscreenMonitors (NULL);
}
}
void
-cps::WindowManager::showOrHideForDesktop(unsigned int desktop) const
+cps::WindowManager::showOrHideForDesktop (unsigned int desktop) const
{
for (iterator i = windows.begin(); i != windows.end(); ++i)
{
- CompWindow* const w(*i);
+ CompWindow* const w (*i);
+
if (w->desktop () == 0xffffffff)
continue;
@@ -962,22 +989,24 @@
}
void
-cps::WindowManager::setWindowActiveness(cps::History& history) const
+cps::WindowManager::setWindowActiveness (cps::History &history) const
{
- for (iterator i = windows.begin(); i != windows.end(); ++i)
+ for (iterator i = windows.begin (); i != windows.end (); ++i)
{
CompWindow* const w(*i);
+
if (w->isViewable ())
w->priv->activeNum = history.nextActiveNum ();
}
}
void
-cps::WindowManager::setNumberOfDesktops(unsigned int desktops) const
+cps::WindowManager::setNumberOfDesktops (unsigned int desktops) const
{
- for (iterator i = windows.begin(); i != windows.end(); ++i)
+ for (iterator i = windows.begin (); i != windows.end (); ++i)
{
CompWindow* const w(*i);
+
if (w->desktop () == 0xffffffff)
continue;
@@ -987,9 +1016,9 @@
}
void
-cps::WindowManager::updateWindowSizes() const
+cps::WindowManager::updateWindowSizes () const
{
- for (iterator i = windows.begin(); i != windows.end(); ++i)
+ for (iterator i = windows.begin (); i != windows.end (); ++i)
{
CompWindow* const w(*i);
w->priv->updateSize ();
@@ -1003,7 +1032,7 @@
CompOption::Value::Vector result;
/* Must have core as first plugin */
- result.push_back("core");
+ result.push_back ("core");
/* Add initial plugins */
foreach(CompString & p, initialPlugins)
@@ -1018,21 +1047,21 @@
}
/* Add plugins not in the initial list */
- foreach(CompOption::Value const& opt, extraPluginsRequested)
+ foreach(CompOption::Value const &opt, extraPluginsRequested)
{
- if (opt.s() == "core")
+ if (opt.s () == "core")
continue;
- if (blacklist.find (opt.s()) != blacklist.end ())
+ if (blacklist.find (opt.s ()) != blacklist.end ())
continue;
typedef std::list::iterator iterator;
bool skip = false;
- for (iterator it = initialPlugins.begin(); it != initialPlugins.end();
- ++it)
+ for (iterator it = initialPlugins.begin ();
+ it != initialPlugins.end (); ++it)
{
- if ((*it) == opt.s())
+ if ((*it) == opt.s ())
{
skip = true;
break;
@@ -1040,70 +1069,70 @@
}
if (!skip)
- {
- result.push_back(opt.s());
- }
+ result.push_back(opt.s ());
}
+
return result;
}
-
void
-cps::PluginManager::updatePlugins (CompScreen* screen, CompOption::Value::Vector const& extraPluginsRequested)
+cps::PluginManager::updatePlugins (CompScreen *screen,
+ CompOption::Value::Vector const &extraPluginsRequested)
{
dirtyPluginList = false;
- CompOption::Value::Vector const desiredPlugins(mergedPluginList(extraPluginsRequested));
+ CompOption::Value::Vector const desiredPlugins (mergedPluginList (extraPluginsRequested));
unsigned int pluginIndex;
+
for (pluginIndex = 1;
pluginIndex < plugin.list ().size () && pluginIndex < desiredPlugins.size ();
- pluginIndex++)
- {
+ ++pluginIndex)
if (plugin.list ().at (pluginIndex).s () != desiredPlugins.at (pluginIndex).s ())
break;
- }
unsigned int desireIndex = pluginIndex;
// We have pluginIndex pointing at first difference (or end).
// Now pop plugins off stack to this point, but keep track that they are loaded
CompPlugin::List alreadyLoaded;
- if (const unsigned int nPop = plugin.list().size() - pluginIndex)
+
+ if (const unsigned int nPop = plugin.list ().size () - pluginIndex)
{
- for (pluginIndex = 0; pluginIndex < nPop; pluginIndex++)
+ for (pluginIndex = 0; pluginIndex < nPop; ++pluginIndex)
{
- alreadyLoaded.push_back(CompPlugin::pop());
- plugin.list().pop_back();
+ alreadyLoaded.push_back(CompPlugin::pop ());
+ plugin.list ().pop_back ();
}
}
+ CompPlugin *p;
+ bool failedPush;
+
// Now work forward through requested plugins
- for (; desireIndex < desiredPlugins.size(); desireIndex++)
+ for (; desireIndex < desiredPlugins.size (); ++desireIndex)
{
- CompPlugin *p = NULL;
- bool failedPush = false;
+ p = NULL;
+ failedPush = false;
// If already loaded, just try to push it...
- foreach(CompPlugin * pp, alreadyLoaded)
+ foreach (CompPlugin *pp, alreadyLoaded)
{
- if (desiredPlugins[desireIndex].s() == pp->vTable->name())
+ if (desiredPlugins[desireIndex].s () == pp->vTable->name ())
{
if (CompPlugin::push (pp))
{
p = pp;
- alreadyLoaded.erase(
- std::find(alreadyLoaded.begin(),
- alreadyLoaded.end(), pp));
+ alreadyLoaded.erase (std::find (alreadyLoaded.begin (),
+ alreadyLoaded.end (), pp));
break;
}
else
{
- alreadyLoaded.erase(
- std::find(alreadyLoaded.begin(),
- alreadyLoaded.end(), pp));
+ alreadyLoaded.erase (std::find (alreadyLoaded.begin (),
+ alreadyLoaded.end (), pp));
blacklist.insert (desiredPlugins[desireIndex].s ());
- CompPlugin::unload(pp);
+ CompPlugin::unload (pp);
p = NULL;
failedPush = true;
break;
@@ -1114,25 +1143,23 @@
// ...otherwise, try to load and push
if (p == 0 && !failedPush)
{
- p = CompPlugin::load(desiredPlugins[desireIndex].s ().c_str ());
+ p = CompPlugin::load (desiredPlugins[desireIndex].s ().c_str ());
if (p)
{
- if (!CompPlugin::push(p))
+ if (!CompPlugin::push (p))
{
blacklist.insert (desiredPlugins[desireIndex].s ());
- CompPlugin::unload(p);
+ CompPlugin::unload (p);
p = 0;
}
}
else
- {
blacklist.insert (desiredPlugins[desireIndex].s ());
- }
}
if (p)
- plugin.list().push_back(p->vTable->name());
+ plugin.list ().push_back(p->vTable->name ());
}
// Any plugins that are loaded, but were not re-initialized can be unloaded.
@@ -1151,8 +1178,7 @@
Atom target,
Atom property)
{
-
-static const unsigned short N_TARGETS = 4;
+ static const unsigned short N_TARGETS = 4;
Atom conversionTargets[N_TARGETS];
@@ -1192,7 +1218,7 @@
PrivateScreen::handleSelectionRequest (XEvent *event)
{
if (wmSnSelectionWindow != event->xselectionrequest.owner ||
- wmSnAtom != event->xselectionrequest.selection)
+ wmSnAtom != event->xselectionrequest.selection)
return;
XSelectionEvent reply;
@@ -1209,8 +1235,8 @@
{
if (event->xselectionrequest.property != None)
{
- Atom type, *adata;
- int i, format;
+ Atom type;
+ int format;
unsigned long num, rest;
unsigned char *data;
@@ -1227,8 +1253,9 @@
* but since we have 4 possible targets, we will hardly ever
* meet multiple requests with a length > 8
*/
- adata = (Atom *) data;
- i = 0;
+ Atom *adata = (Atom *) data;
+ int i = 0;
+
while (i < (int) num)
{
if (!convertProperty (dpy, wmSnTimestamp,
@@ -1276,23 +1303,23 @@
eventManager.quit ();
}
-static const std::string IMAGEDIR("images");
-static const std::string HOMECOMPIZDIR(".compiz-1");
+static const std::string IMAGEDIR = "images";
+static const std::string HOMECOMPIZDIR = ".compiz-1";
bool
CompScreenImpl::readImageFromFile (CompString &name,
- CompString &pname,
- CompSize &size,
- void *&data)
+ CompString &pname,
+ CompSize &size,
+ void *&data)
{
- bool status;
int stride;
+ bool status = fileToImage (name, size, stride, data);
- status = fileToImage (name, size, stride, data);
if (!status)
{
char *home = getenv ("HOME");
CompString path;
+
if (home)
{
path = home;
@@ -1326,9 +1353,9 @@
bool
CompScreenImpl::writeImageToFile (CompString &path,
- const char *format,
- CompSize &size,
- void *data)
+ const char *format,
+ CompSize &size,
+ void *data)
{
CompString formatString (format);
return imageToFile (path, formatString, size, size.width () * 4, data);
@@ -1337,21 +1364,22 @@
Window
PrivateScreen::getActiveWindow (Window root)
{
- Atom actual;
- int result, format;
+ Atom actual;
+ int format;
unsigned long n, left;
unsigned char *data;
Window w = None;
- result = XGetWindowProperty (dpy, root,
- Atoms::winActive, 0L, 1L, false,
- XA_WINDOW, &actual, &format,
- &n, &left, &data);
+ int result = XGetWindowProperty (dpy, root,
+ Atoms::winActive, 0L, 1L, false,
+ XA_WINDOW, &actual, &format,
+ &n, &left, &data);
if (result == Success && data)
{
if (n)
memcpy (&w, data, sizeof (Window));
+
XFree (data);
}
@@ -1370,9 +1398,9 @@
bool
CompScreenImpl::_fileToImage (CompString &name,
- CompSize &size,
- int &stride,
- void *&data)
+ CompSize &size,
+ int &stride,
+ void *&data)
{
return false;
}
@@ -1384,17 +1412,17 @@
int stride,
void *data)
{
- WRAPABLE_HND_FUNCTN_RETURN (bool, imageToFile, path, format, size,
- stride, data);
+ WRAPABLE_HND_FUNCTN_RETURN (bool, imageToFile, path, format,
+ size, stride, data);
return _imageToFile (path, format, size, stride, data);
}
bool
CompScreenImpl::_imageToFile (CompString &path,
- CompString &format,
- CompSize &size,
- int stride,
- void *data)
+ CompString &format,
+ CompSize &size,
+ int stride,
+ void *data)
{
return false;
}
@@ -1410,8 +1438,8 @@
void
CompScreenImpl::_logMessage (const char *componentName,
- CompLogLevel level,
- const char *message)
+ CompLogLevel level,
+ const char *message)
{
::logMessage (componentName, level, message);
}
@@ -1419,21 +1447,22 @@
int
cps::XWindowInfo::getWmState (Window id)
{
- Atom actual;
- int result, format;
+ Atom actual;
+ int format;
unsigned long n, left;
unsigned char *data;
unsigned long state = NormalState;
- result = XGetWindowProperty (dpy, id,
- Atoms::wmState, 0L, 2L, false,
- Atoms::wmState, &actual, &format,
- &n, &left, &data);
+ int result = XGetWindowProperty (dpy, id,
+ Atoms::wmState, 0L, 2L, false,
+ Atoms::wmState, &actual, &format,
+ &n, &left, &data);
if (result == Success && data)
{
if (n)
memcpy (&state, data, sizeof (unsigned long));
+
XFree ((void *) data);
}
@@ -1441,7 +1470,8 @@
}
void
-cps::XWindowInfo::setWmState (int state, Window id) const
+cps::XWindowInfo::setWmState (int state,
+ Window id) const
{
unsigned long data[2];
@@ -1520,16 +1550,16 @@
unsigned int
cps::XWindowInfo::getWindowState (Window id)
{
- Atom actual;
- int result, format;
+ Atom actual;
+ int format;
unsigned long n, left;
unsigned char *data;
unsigned int state = 0;
- result = XGetWindowProperty (dpy, id,
- Atoms::winState,
- 0L, 1024L, false, XA_ATOM, &actual, &format,
- &n, &left, &data);
+ int result = XGetWindowProperty (dpy, id,
+ Atoms::winState,
+ 0L, 1024L, false, XA_ATOM, &actual,
+ &format, &n, &left, &data);
if (result == Success && data)
{
@@ -1545,9 +1575,10 @@
}
unsigned int
-compiz::window::fillStateData (unsigned int state, Atom *data)
+compiz::window::fillStateData (unsigned int state,
+ Atom *data)
{
- int i = 0;
+ int i = 0;
if (state & CompWindowStateModalMask)
data[i++] = Atoms::winStateModal;
@@ -1582,34 +1613,35 @@
}
void
-PrivateScreen::setWindowState (unsigned int state, Window id)
+PrivateScreen::setWindowState (unsigned int state,
+ Window id)
{
- int i = 0;
Atom data[32];
- i = compiz::window::fillStateData (state, data);
+ int i = compiz::window::fillStateData (state, data);
XChangeProperty (dpy, id, Atoms::winState,
- XA_ATOM, 32, PropModeReplace,
- (unsigned char *) data, i);
+ XA_ATOM, 32, PropModeReplace,
+ (unsigned char *) data, i);
}
unsigned int
cps::XWindowInfo::getWindowType (Window id)
{
- Atom actual, a = None;
- int result, format;
+ Atom actual, a = None;
+ int format;
unsigned long n, left;
unsigned char *data;
- result = XGetWindowProperty (dpy , id,
- Atoms::winType,
- 0L, 1L, false, XA_ATOM, &actual, &format,
- &n, &left, &data);
+ int result = XGetWindowProperty (dpy , id,
+ Atoms::winType,
+ 0L, 1L, false, XA_ATOM, &actual,
+ &format, &n, &left, &data);
if (result == Success && data)
{
if (n)
memcpy (&a, data, sizeof (Atom));
+
XFree ((void *) data);
}
@@ -1650,21 +1682,21 @@
void
cps::XWindowInfo::getMwmHints (Window id,
- unsigned int *func,
- unsigned int *decor) const
+ unsigned int *func,
+ unsigned int *decor) const
{
- Atom actual;
- int result, format;
+ Atom actual;
+ int format;
unsigned long n, left;
unsigned char *data;
*func = MwmFuncAll;
*decor = MwmDecorAll;
- result = XGetWindowProperty (dpy, id,
- Atoms::mwmHints,
- 0L, 20L, false, Atoms::mwmHints,
- &actual, &format, &n, &left, &data);
+ int result = XGetWindowProperty (dpy, id,
+ Atoms::mwmHints,
+ 0L, 20L, false, Atoms::mwmHints,
+ &actual, &format, &n, &left, &data);
if (result == Success && data)
{
@@ -1692,7 +1724,7 @@
if (XGetWMProtocols (dpy, id, &protocol, &count))
{
- for (int i = 0; i < count; i++)
+ for (int i = 0; i < count; ++i)
{
if (protocol[i] == Atoms::wmDeleteWindow)
protocols |= CompWindowProtocolDeleteMask;
@@ -1712,18 +1744,18 @@
unsigned int
CompScreenImpl::getWindowProp (Window id,
- Atom property,
- unsigned int defaultValue)
+ Atom property,
+ unsigned int defaultValue)
{
- Atom actual;
- int result, format;
+ Atom actual;
+ int format;
unsigned long n, left;
unsigned char *data;
unsigned int retval = defaultValue;
- result = XGetWindowProperty (privateScreen.dpy, id, property,
- 0L, 1L, false, XA_CARDINAL, &actual, &format,
- &n, &left, &data);
+ int result = XGetWindowProperty (privateScreen.dpy, id, property,
+ 0L, 1L, false, XA_CARDINAL, &actual, &format,
+ &n, &left, &data);
if (result == Success && data)
{
@@ -1742,8 +1774,8 @@
void
CompScreenImpl::setWindowProp (Window id,
- Atom property,
- unsigned int value)
+ Atom property,
+ unsigned int value)
{
unsigned long data = value;
@@ -1757,15 +1789,15 @@
Atom property,
unsigned short *returnValue)
{
- Atom actual;
- int result, format;
+ Atom actual;
+ int format;
unsigned long n, left;
unsigned char *data;
bool retval = false;
- result = XGetWindowProperty (dpy, id, property,
- 0L, 1L, false, XA_CARDINAL, &actual, &format,
- &n, &left, &data);
+ int result = XGetWindowProperty (dpy, id, property,
+ 0L, 1L, false, XA_CARDINAL, &actual,
+ &format, &n, &left, &data);
if (result == Success && data)
{
@@ -1786,8 +1818,8 @@
unsigned short
CompScreenImpl::getWindowProp32 (Window id,
- Atom property,
- unsigned short defaultValue)
+ Atom property,
+ unsigned short defaultValue)
{
unsigned short result;
@@ -1799,12 +1831,10 @@
void
CompScreenImpl::setWindowProp32 (Window id,
- Atom property,
- unsigned short value)
+ Atom property,
+ unsigned short value)
{
- CARD32 value32;
-
- value32 = value << 16 | value;
+ CARD32 value32 = value << 16 | value;
XChangeProperty (privateScreen.dpy, id, property,
XA_CARDINAL, 32, PropModeReplace,
@@ -1875,40 +1905,39 @@
void
PrivateScreen::setDesktopHints ()
{
- unsigned long *data;
-
- int dSize = nDesktop * 2 + nDesktop * 2 + nDesktop * 4 + 1;
-
- data = (unsigned long *) malloc (sizeof (unsigned long) * dSize);
+ int dSize = nDesktop * 8 + 1;
+
+ unsigned long *data = (unsigned long *) malloc (sizeof (unsigned long) * dSize);
+
if (!data)
return;
- unsigned int i;
+ unsigned int i;
int offset = 0;
int hintSize = nDesktop * 2;
- for (i = 0; i < nDesktop; i++)
+ for (i = 0; i < nDesktop; ++i)
{
data[offset + i * 2 + 0] = viewPort.vp.x () * screen->width ();
data[offset + i * 2 + 1] = viewPort.vp.y () * screen->height ();
}
if (!desktopHintEqual (data, dSize, offset, hintSize))
- XChangeProperty (dpy, rootWindow(),
+ XChangeProperty (dpy, rootWindow (),
Atoms::desktopViewport,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) &data[offset], hintSize);
offset += hintSize;
- for (i = 0; i < nDesktop; i++)
+ for (i = 0; i < nDesktop; ++i)
{
- data[offset + i * 2 + 0] = screen->width () * viewPort.vpSize.width ();
+ data[offset + i * 2 + 0] = screen->width () * viewPort.vpSize.width ();
data[offset + i * 2 + 1] = screen->height () * viewPort.vpSize.height ();
}
if (!desktopHintEqual (data, dSize, offset, hintSize))
- XChangeProperty (dpy, rootWindow(),
+ XChangeProperty (dpy, rootWindow (),
Atoms::desktopGeometry,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) &data[offset], hintSize);
@@ -1916,7 +1945,7 @@
offset += hintSize;
hintSize = nDesktop * 4;
- for (i = 0; i < nDesktop; i++)
+ for (i = 0; i < nDesktop; ++i)
{
data[offset + i * 4 + 0] = workArea.x ();
data[offset + i * 4 + 1] = workArea.y ();
@@ -1925,7 +1954,7 @@
}
if (!desktopHintEqual (data, dSize, offset, hintSize))
- XChangeProperty (dpy, rootWindow(),
+ XChangeProperty (dpy, rootWindow (),
Atoms::workarea,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) &data[offset], hintSize);
@@ -1936,7 +1965,7 @@
hintSize = 1;
if (!desktopHintEqual (data, dSize, offset, hintSize))
- XChangeProperty (dpy, rootWindow(),
+ XChangeProperty (dpy, rootWindow (),
Atoms::numberOfDesktops,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) &data[offset], hintSize);
@@ -1949,14 +1978,15 @@
}
void
-PrivateScreen::setVirtualScreenSize (int newh, int newv)
+PrivateScreen::setVirtualScreenSize (int newh,
+ int newv)
{
/* if newh or newv is being reduced */
if (newh < screen->vpSize ().width () ||
newv < screen->vpSize ().height ())
{
- int tx = 0;
- int ty = 0;
+ int tx = 0;
+ int ty = 0;
if (screen->vp ().x () >= newh)
tx = screen->vp ().x () - (newh - 1);
@@ -1966,12 +1996,16 @@
if (tx != 0 || ty != 0)
screen->moveViewport (tx, ty, TRUE);
+ int moveX, moveY;
+ int vpX; /* x index of a window's vp */
+ int vpY; /* y index of a window's vp */
+
/* Move windows that were in one of the deleted viewports into the
closest viewport */
foreach (CompWindow *w, screen->windows ())
{
- int moveX = 0;
- int moveY = 0;
+ moveX = 0;
+ moveY = 0;
if (w->onAllViewports ())
continue;
@@ -1981,9 +2015,8 @@
vertical index range */
if (newh < screen->vpSize ().width ())
{
- int vpX; /* x index of a window's vp */
-
vpX = w->serverX () / screen->width ();
+
if (w->serverX () < 0)
vpX -= 1;
@@ -1993,11 +2026,11 @@
if (vpX >= newh)
moveX = ((newh - 1) - vpX) * screen->width ();
}
+
if (newv < screen->vpSize ().height ())
{
- int vpY; /* y index of a window's vp */
-
vpY = w->serverY () / screen->height ();
+
if (w->serverY () < 0)
vpY -= 1;
@@ -2032,7 +2065,7 @@
{
outputDevices.updateOutputDevices(coreOptions, screen);
- windowManager.clearFullscreenHints();
+ windowManager.clearFullscreenHints ();
screen->updateWorkarea ();
@@ -2040,7 +2073,7 @@
}
void
-PrivateScreen::detectOutputDevices (CoreOptions& coreOptions)
+PrivateScreen::detectOutputDevices (CoreOptions &coreOptions)
{
if (coreOptions.optionGetDetectOutputs ())
{
@@ -2050,11 +2083,10 @@
if (!screenInfo.empty ())
{
CompOption::Value::Vector l;
+
foreach (XineramaScreenInfo xi, screenInfo)
- {
l.push_back (compPrintf ("%dx%d+%d+%d", xi.width, xi.height,
xi.x_org, xi.y_org));
- }
value.set (CompOption::TypeString, l);
}
@@ -2071,12 +2103,9 @@
coreOptions.getOptions()[CoreOptions::DetectOutputs].value ().set (true);
}
else
- {
updateOutputDevices (coreOptions);
- }
}
-
void
cps::StartupSequenceImpl::updateStartupFeedback ()
{
@@ -2089,13 +2118,14 @@
}
}
+/* TODO: Investigate this magic number timeout, can it be reduced ? */
static const unsigned int STARTUP_TIMEOUT_DELAY = 15000;
bool
cps::StartupSequence::handleStartupSequenceTimeout ()
{
- struct timeval now, active;
- double elapsed;
+ struct timeval now, active;
+ double elapsed;
gettimeofday (&now, NULL);
@@ -2116,11 +2146,11 @@
}
void
-cps::StartupSequence::addSequence (SnStartupSequence *sequence, CompPoint const& vp)
+cps::StartupSequence::addSequence (SnStartupSequence *sequence,
+ CompPoint const &vp)
{
- CompStartupSequence *s;
+ CompStartupSequence *s = new CompStartupSequence ();
- s = new CompStartupSequence ();
if (!s)
return;
@@ -2188,35 +2218,41 @@
void
PrivateScreen::compScreenSnEvent (SnMonitorEvent *event,
- void *userData)
+ void *userData)
{
- PrivateScreen *self = (PrivateScreen *) userData;
- SnStartupSequence *sequence;
-
- sequence = sn_monitor_event_get_startup_sequence (event);
-
- switch (sn_monitor_event_get_type (event)) {
- case SN_MONITOR_EVENT_INITIATED:
- self->startupSequence.addSequence (sequence, self->viewPort.vp);
- break;
- case SN_MONITOR_EVENT_COMPLETED:
- self->startupSequence.removeSequence (sequence);
- break;
- case SN_MONITOR_EVENT_CHANGED:
- case SN_MONITOR_EVENT_CANCELED:
- break;
+ PrivateScreen *self = (PrivateScreen *) userData;
+ SnStartupSequence *sequence = sn_monitor_event_get_startup_sequence (event);
+
+ switch (sn_monitor_event_get_type (event))
+ {
+ case SN_MONITOR_EVENT_INITIATED:
+ self->startupSequence.addSequence (sequence, self->viewPort.vp);
+ break;
+
+ case SN_MONITOR_EVENT_COMPLETED:
+ self->startupSequence.removeSequence (sequence);
+ break;
+
+ case SN_MONITOR_EVENT_CHANGED:
+ case SN_MONITOR_EVENT_CANCELED:
+ break;
+
+ default:
+ break;
}
}
void
PrivateScreen::updateScreenEdges ()
{
- struct screenEdgeGeometry {
+ struct screenEdgeGeometry
+ {
int xw, x0;
int yh, y0;
int ww, w0;
int hh, h0;
- } geometry[SCREEN_EDGE_NUM] = {
+ } geometry[SCREEN_EDGE_NUM] =
+ {
{ 0, -1, 0, 2, 0, 2, 1, -4 }, /* left */
{ 1, -1, 0, 2, 0, 2, 1, -4 }, /* right */
{ 0, 2, 0, -1, 1, -4, 0, 2 }, /* top */
@@ -2227,8 +2263,7 @@
{ 1, -1, 1, -1, 0, 2, 0, 2 } /* bottom-right */
};
- for (int i = 0; i < SCREEN_EDGE_NUM; i++)
- {
+ for (int i = 0; i < SCREEN_EDGE_NUM; ++i)
if (screenEdge[i].id)
XMoveResizeWindow (dpy, screenEdge[i].id,
geometry[i].xw * screen->width () +
@@ -2239,11 +2274,11 @@
geometry[i].w0,
geometry[i].hh * screen->height () +
geometry[i].h0);
- }
}
void
-PrivateScreen::reshape (int w, int h)
+PrivateScreen::reshape (int w,
+ int h)
{
updateScreenInfo ();
@@ -2271,12 +2306,12 @@
reshape (ce->width, ce->height);
detectOutputDevices (*this);
-
updateOutputDevices (*this);
}
void
-cps::EventManager::setSupportingWmCheck (Display* dpy, Window root)
+cps::EventManager::setSupportingWmCheck (Display* dpy,
+ Window root)
{
XChangeProperty (dpy, grabWindow,
Atoms::supportingWmCheck,
@@ -2286,13 +2321,15 @@
XChangeProperty (dpy, grabWindow, Atoms::wmName,
Atoms::utf8String, 8, PropModeReplace,
(unsigned char *) PACKAGE, strlen (PACKAGE));
+
XChangeProperty (dpy, grabWindow, Atoms::winState,
XA_ATOM, 32, PropModeReplace,
- (unsigned char *) &Atoms::winStateSkipTaskbar,
- 1);
+ (unsigned char *) &Atoms::winStateSkipTaskbar, 1);
+
XChangeProperty (dpy, grabWindow, Atoms::winState,
XA_ATOM, 32, PropModeAppend,
(unsigned char *) &Atoms::winStateSkipPager, 1);
+
XChangeProperty (dpy, grabWindow, Atoms::winState,
XA_ATOM, 32, PropModeAppend,
(unsigned char *) &Atoms::winStateHidden, 1);
@@ -2354,6 +2391,7 @@
atoms.push_back (Atoms::workarea);
atoms.push_back (Atoms::wmName);
+ // TODO: Why is this below commented out ?
/*
atoms.push_back (Atoms::wmVisibleName);
*/
@@ -2361,6 +2399,7 @@
atoms.push_back (Atoms::wmStrut);
atoms.push_back (Atoms::wmStrutPartial);
+ // TODO: Why is this below commented out ?
/*
atoms.push_back (Atoms::wmPid);
*/
@@ -2387,7 +2426,7 @@
atoms.push_back (Atoms::winOpacity);
atoms.push_back (Atoms::winBrightness);
-/* FIXME */
+/* TODO: FIXME */
#if 0
if (canDoSaturated)
{
@@ -2435,14 +2474,14 @@
PrivateScreen::getDesktopHints (unsigned int showingDesktopMask)
{
unsigned long data[2];
- Atom actual;
- int result, format;
+ Atom actual;
+ int result, format;
unsigned long n, left;
unsigned char *propData;
if (useDesktopHints)
{
- result = XGetWindowProperty (dpy, rootWindow(),
+ result = XGetWindowProperty (dpy, rootWindow (),
Atoms::numberOfDesktops,
0L, 1L, false, XA_CARDINAL, &actual,
&format, &n, &left, &propData);
@@ -2452,6 +2491,7 @@
if (n)
{
memcpy (data, propData, sizeof (unsigned long));
+
if (data[0] > 0 && data[0] < 0xffffffff)
nDesktop = data[0];
}
@@ -2459,7 +2499,7 @@
XFree (propData);
}
- result = XGetWindowProperty (dpy, rootWindow(),
+ result = XGetWindowProperty (dpy, rootWindow (),
Atoms::desktopViewport, 0L, 2L,
false, XA_CARDINAL, &actual, &format,
&n, &left, &propData);
@@ -2482,7 +2522,7 @@
XFree (propData);
}
- result = XGetWindowProperty (dpy, rootWindow(),
+ result = XGetWindowProperty (dpy, rootWindow (),
Atoms::currentDesktop,
0L, 1L, false, XA_CARDINAL, &actual,
&format, &n, &left, &propData);
@@ -2492,6 +2532,7 @@
if (n)
{
memcpy (data, propData, sizeof (unsigned long));
+
if (data[0] < nDesktop)
currentDesktop = data[0];
}
@@ -2500,7 +2541,7 @@
}
}
- result = XGetWindowProperty (dpy, rootWindow(),
+ result = XGetWindowProperty (dpy, rootWindow (),
Atoms::showingDesktop,
0L, 1L, false, XA_CARDINAL, &actual, &format,
&n, &left, &propData);
@@ -2510,6 +2551,7 @@
if (n)
{
memcpy (data, propData, sizeof (unsigned long));
+
if (data[0])
screen->enterShowDesktopMode ();
}
@@ -2519,13 +2561,13 @@
data[0] = currentDesktop;
- XChangeProperty (dpy, rootWindow(), Atoms::currentDesktop,
+ XChangeProperty (dpy, rootWindow (), Atoms::currentDesktop,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) data, 1);
data[0] = showingDesktopMask ? true : false;
- XChangeProperty (dpy, rootWindow(), Atoms::showingDesktop,
+ XChangeProperty (dpy, rootWindow (), Atoms::showingDesktop,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) data, 1);
}
@@ -2537,29 +2579,31 @@
_enterShowDesktopMode ();
}
-unsigned int CompScreenImpl::showingDesktopMask() const
+unsigned int CompScreenImpl::showingDesktopMask () const
{
return showingDesktopMask_;
}
-bool CompScreenImpl::grabsEmpty() const
+bool CompScreenImpl::grabsEmpty () const
{
- return privateScreen.eventManager.grabsEmpty();
+ return privateScreen.eventManager.grabsEmpty ();
}
void
CompScreenImpl::_enterShowDesktopMode ()
{
- unsigned long data = 1;
- int count = 0;
- bool st = privateScreen.optionGetHideSkipTaskbarWindows ();
+ unsigned long data = 1;
+ int count = 0;
+ bool st = privateScreen.optionGetHideSkipTaskbarWindows ();
showingDesktopMask_ = ~(CompWindowTypeDesktopMask |
CompWindowTypeDockMask);
- for (cps::WindowManager::iterator i = windowManager.begin(); i != windowManager.end(); ++i)
+ for (cps::WindowManager::iterator i = windowManager.begin ();
+ i != windowManager.end (); ++i)
{
CompWindow* const w(*i);
+
if ((showingDesktopMask_ & w->wmType ()) &&
(!(w->state () & CompWindowStateSkipTaskbarMask) || st))
{
@@ -2573,7 +2617,7 @@
}
if (w->inShowDesktopMode ())
- count++;
+ ++count;
}
if (!count)
@@ -2610,9 +2654,10 @@
window->priv->show ();
/* return if some other window is still in show desktop mode */
- for (cps::WindowManager::iterator i = windowManager.begin(); i != windowManager.end(); ++i)
+ for (cps::WindowManager::iterator i = windowManager.begin (); i != windowManager.end (); ++i)
{
CompWindow* const w(*i);
+
if (w->inShowDesktopMode ())
return;
}
@@ -2622,9 +2667,10 @@
{
showingDesktopMask_ = 0;
- for (cps::WindowManager::iterator i = windowManager.begin(); i != windowManager.end(); ++i)
+ for (cps::WindowManager::iterator i = windowManager.begin (); i != windowManager.end (); ++i)
{
CompWindow* const w(*i);
+
if (!w->inShowDesktopMode ())
continue;
@@ -2638,7 +2684,7 @@
focusDefaultWindow ();
}
- XChangeProperty (privateScreen.dpy, privateScreen.rootWindow(),
+ XChangeProperty (privateScreen.dpy, privateScreen.rootWindow (),
Atoms::showingDesktop,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) &data, 1);
@@ -2676,11 +2722,11 @@
/* huh, we didn't find d->below ... perhaps it's out of date;
try grabbing it through the server */
- status = XQueryPointer (dpy (), privateScreen.rootWindow(), &rootReturn,
+ status = XQueryPointer (dpy (), privateScreen.rootWindow (), &rootReturn,
&childReturn, &dummyInt, &dummyInt,
&dummyInt, &dummyInt, &dummyUInt);
- if (status && rootReturn == privateScreen.rootWindow())
+ if (status && rootReturn == privateScreen.rootWindow ())
{
w = findTopLevelWindow (childReturn);
@@ -2697,8 +2743,8 @@
if (!focus)
{
/* Traverse down the stack */
- for (cps::WindowManager::reverse_iterator rit = windowManager.rbegin();
- rit != windowManager.rend(); ++rit)
+ for (cps::WindowManager::reverse_iterator rit = windowManager.rbegin ();
+ rit != windowManager.rend (); ++rit)
{
w = (*rit);
@@ -2745,8 +2791,8 @@
}
else
{
- XSetInputFocus (privateScreen.dpy, privateScreen.rootWindow(), RevertToPointerRoot,
- CurrentTime);
+ XSetInputFocus (privateScreen.dpy, privateScreen.rootWindow (),
+ RevertToPointerRoot, CurrentTime);
}
}
@@ -2760,26 +2806,23 @@
cps::WindowManager::findWindow (Window id) const
{
if (lastFoundWindow && lastFoundWindow->id () == id)
- {
return lastFoundWindow;
- }
else
{
- CompWindow::Map::const_iterator it = windowsMap.find (id);
+ CompWindow::Map::const_iterator it = windowsMap.find (id);
- if (it != windowsMap.end ())
- return (lastFoundWindow = it->second);
+ if (it != windowsMap.end ())
+ return (lastFoundWindow = it->second);
}
return 0;
}
CompWindow *
-CompScreenImpl::findTopLevelWindow (Window id, bool override_redirect)
+CompScreenImpl::findTopLevelWindow (Window id,
+ bool override_redirect)
{
- CompWindow *w;
-
- w = findWindow (id);
+ CompWindow *w = findWindow (id);
if (w)
{
@@ -2792,6 +2835,7 @@
for (cps::WindowManager::iterator i = windowManager.begin(); i != windowManager.end(); ++i)
{
CompWindow* const w(*i);
+
if (w->priv->serverFrame == id)
{
if (w->overrideRedirect () && !override_redirect)
@@ -2805,7 +2849,8 @@
}
void
-CompScreenImpl::insertWindow (CompWindow *w, Window aboveId)
+CompScreenImpl::insertWindow (CompWindow *w,
+ Window aboveId)
{
windowManager.insertWindow (w, aboveId);
}
@@ -2817,7 +2862,7 @@
if (dbg)
dbg->windowsChanged (true);
- invalidateServerWindows();
+ invalidateServerWindows ();
w->prev = NULL;
w->next = NULL;
@@ -2829,9 +2874,9 @@
windows.front ()->prev = w;
w->next = windows.front ();
}
+
windows.push_front (w);
-
- addWindowToMap(w);
+ addWindowToMap (w);
return;
}
@@ -2842,9 +2887,8 @@
{
if ((*it)->id () == aboveId ||
((*it)->priv->frame && (*it)->priv->frame == aboveId))
- {
break;
- }
+
++it;
}
@@ -2863,16 +2907,15 @@
(*it)->next = w;
if (w->next)
- {
w->next->prev = w;
- }
windows.insert (++it, w);
- addWindowToMap(w);
+ addWindowToMap (w);
}
void
-CompScreenImpl::insertServerWindow (CompWindow *w, Window aboveId)
+CompScreenImpl::insertServerWindow (CompWindow *w,
+ Window aboveId)
{
windowManager.insertServerWindow(w, aboveId);
}
@@ -2895,6 +2938,7 @@
serverWindows.front ()->serverPrev = w;
w->serverNext = serverWindows.front ();
}
+
serverWindows.push_front (w);
return;
@@ -2906,9 +2950,8 @@
{
if ((*it)->priv->serverId == aboveId ||
((*it)->priv->serverFrame && (*it)->priv->serverFrame == aboveId))
- {
break;
- }
+
++it;
}
@@ -2927,9 +2970,7 @@
(*it)->serverNext = w;
if (w->serverNext)
- {
w->serverNext->serverPrev = w;
- }
serverWindows.insert (++it, w);
}
@@ -2938,7 +2979,7 @@
cps::WindowManager::eraseWindowFromMap (Window id)
{
if (id != 1)
- windowsMap.erase (id);
+ windowsMap.erase (id);
}
void
@@ -2948,17 +2989,16 @@
}
void
-cps::WindowManager::unhookWindow(CompWindow* w)
+cps::WindowManager::unhookWindow (CompWindow* w)
{
StackDebugger *dbg = StackDebugger::Default ();
if (dbg)
dbg->windowsChanged (true);
- CompWindowList::iterator it =
- std::find (windows.begin(), windows.end(), w);
+ CompWindowList::iterator it = std::find (windows.begin (), windows.end (), w);
- if (it == windows.end())
+ if (it == windows.end ())
{
compLogMessage ("core", CompLogLevelWarn, "a broken plugin tried to remove a window twice, we won't allow that!");
return;
@@ -2976,7 +3016,7 @@
w->next = NULL;
w->prev = NULL;
- removeFromFindWindowCache(w);
+ removeFromFindWindowCache (w);
}
void
@@ -3029,25 +3069,26 @@
#define POINTER_GRAB_MASK (ButtonReleaseMask | \
ButtonPressMask | \
PointerMotionMask)
+
CompScreenImpl::GrabHandle
-CompScreenImpl::pushGrab (Cursor cursor, const char *name)
+CompScreenImpl::pushGrab (Cursor cursor,
+ const char *name)
{
if (privateScreen.eventManager.grabsEmpty ())
{
- int status;
-
- status = XGrabPointer (privateScreen.dpy, privateScreen.eventManager.getGrabWindow(), true,
- POINTER_GRAB_MASK,
- GrabModeAsync, GrabModeAsync,
- privateScreen.rootWindow(), cursor,
- CurrentTime);
+ int status = XGrabPointer (privateScreen.dpy, privateScreen.eventManager.getGrabWindow (),
+ true, POINTER_GRAB_MASK,
+ GrabModeAsync, GrabModeAsync,
+ privateScreen.rootWindow (), cursor,
+ CurrentTime);
if (status == GrabSuccess)
{
status = XGrabKeyboard (privateScreen.dpy,
- privateScreen.eventManager.getGrabWindow(), true,
+ privateScreen.eventManager.getGrabWindow (), true,
GrabModeAsync, GrabModeAsync,
CurrentTime);
+
if (status != GrabSuccess)
{
XUngrabPointer (privateScreen.dpy, CurrentTime);
@@ -3058,10 +3099,8 @@
return NULL;
}
else
- {
XChangeActivePointerGrab (privateScreen.dpy, POINTER_GRAB_MASK,
cursor, CurrentTime);
- }
cps::Grab *grab = new cps::Grab (cursor, name);
privateScreen.eventManager.grabsPush (grab);
@@ -3070,7 +3109,8 @@
}
void
-CompScreenImpl::updateGrab (CompScreen::GrabHandle handle, Cursor cursor)
+CompScreenImpl::updateGrab (CompScreen::GrabHandle handle,
+ Cursor cursor)
{
if (!handle)
return;
@@ -3083,12 +3123,12 @@
void
CompScreenImpl::removeGrab (CompScreen::GrabHandle handle,
- CompPoint *restorePointer)
+ CompPoint *restorePointer)
{
if (!handle)
return;
- privateScreen.eventManager.grabsRemove(handle);
+ privateScreen.eventManager.grabsRemove (handle);
if (!privateScreen.eventManager.grabsEmpty ())
{
@@ -3109,7 +3149,7 @@
}
void
-cps::GrabList::grabsRemove(Grab* handle)
+cps::GrabList::grabsRemove (Grab* handle)
{
GrabIterator it = std::find (grabsBegin (), grabsEnd (), handle);
@@ -3125,18 +3165,21 @@
plugins listed, returns false otherwise. */
bool
-CompScreenImpl::otherGrabExist (const char *first, ...)
+CompScreenImpl::otherGrabExist (const char *first,
+ ...)
{
va_list ap;
const char *name;
std::list::iterator it;
- for (it = privateScreen.eventManager.grabsBegin (); it != privateScreen.eventManager.grabsEnd (); ++it)
+ for (it = privateScreen.eventManager.grabsBegin ();
+ it != privateScreen.eventManager.grabsEnd (); ++it)
{
va_start (ap, first);
name = first;
+
while (name)
{
if (strcmp (name, (*it)->name) == 0)
@@ -3164,23 +3207,22 @@
cps::GrabList::grabExist (const char *grab)
{
foreach (cps::Grab* g, grabs)
- {
if (strcmp (g->name, grab) == 0)
return true;
- }
+
return false;
}
bool
CompScreenImpl::grabbed ()
{
- return privateScreen.eventManager.isGrabbed();
+ return privateScreen.eventManager.isGrabbed ();
}
void
cps::GrabManager::grabUngrabOneKey (unsigned int modifiers,
- int keycode,
- bool grab)
+ int keycode,
+ bool grab)
{
if (grab)
{
@@ -3188,62 +3230,51 @@
* Always grab the keyboard Sync-ronously. This is so that we can
* choose to ReplayKeyboard in alwaysHandleEvent if need be.
*/
- XGrabKey (screen->dpy(),
+ XGrabKey (screen->dpy (),
keycode,
modifiers,
- screen->root(),
+ screen->root (),
true,
GrabModeAsync,
GrabModeSync);
}
else
{
- XUngrabKey (screen->dpy(),
+ XUngrabKey (screen->dpy (),
keycode,
modifiers,
- screen->root());
+ screen->root ());
}
}
bool
cps::GrabManager::grabUngrabKeys (unsigned int modifiers,
- int keycode,
- bool grab)
+ int keycode,
+ bool grab)
{
- int mod, k;
- unsigned int ignore;
-
- CompScreen::checkForError (screen->dpy());
-
- for (ignore = 0; ignore <= modHandler->ignoredModMask (); ignore++)
+ int mod, k;
+ int minCode, maxCode;
+ unsigned int ignore;
+
+ CompScreen::checkForError (screen->dpy ());
+
+ for (ignore = 0; ignore <= modHandler->ignoredModMask (); ++ignore)
{
if (ignore & ~modHandler->ignoredModMask ())
continue;
if (keycode != 0)
- {
grabUngrabOneKey (modifiers | ignore, keycode, grab);
- }
else
{
- for (mod = 0; mod < 8; mod++)
- {
+ for (mod = 0; mod < 8; ++mod)
if (modifiers & (1 << mod))
- {
for (k = mod * modHandler->modMap ()->max_keypermod;
- k < (mod + 1) * modHandler->modMap ()->max_keypermod;
- k++)
- {
+ k < (mod + 1) * modHandler->modMap ()->max_keypermod; ++k)
if (modHandler->modMap ()->modifiermap[k])
- {
- grabUngrabOneKey ((modifiers & ~(1 << mod)) |
- ignore,
+ grabUngrabOneKey ((modifiers & ~(1 << mod)) | ignore,
modHandler->modMap ()->modifiermap[k],
grab);
- }
- }
- }
- }
/*
* keycode == 0, so this is a modifier-only keybinding.
@@ -3255,15 +3286,15 @@
* keys, and know to cancel the tap if +k is pressed.
*/
if (!(currentState & CompAction::StateIgnoreTap))
- {
- int minCode, maxCode;
- XDisplayKeycodes (screen->dpy(), &minCode, &maxCode);
- for (k = minCode; k <= maxCode; k++)
- grabUngrabOneKey (modifiers | ignore, k, grab);
- }
+ {
+ XDisplayKeycodes (screen->dpy (), &minCode, &maxCode);
+
+ for (k = minCode; k <= maxCode; ++k)
+ grabUngrabOneKey (modifiers | ignore, k, grab);
+ }
}
- if (CompScreen::checkForError (screen->dpy()))
+ if (CompScreen::checkForError (screen->dpy ()))
return false;
}
@@ -3273,29 +3304,22 @@
bool
cps::GrabManager::addPassiveKeyGrab (CompAction::KeyBinding &key)
{
- KeyGrab newKeyGrab;
- unsigned int mask;
- std::list::iterator it;
-
- mask = modHandler->virtualToRealModMask (key.modifiers ());
-
- for (it = keyGrabs.begin (); it != keyGrabs.end (); ++it)
+ KeyGrab newKeyGrab;
+ unsigned int mask = modHandler->virtualToRealModMask (key.modifiers ());
+
+ for (std::list::iterator it = keyGrabs.begin (); it != keyGrabs.end (); ++it)
{
if (key.keycode () == (*it).keycode &&
mask == (*it).modifiers)
{
- (*it).count++;
+ ++(*it).count;
return true;
}
}
-
-
- if (!(mask & CompNoMask))
- {
- if (!grabUngrabKeys (mask, key.keycode (), true))
- return false;
- }
+ if (!(mask & CompNoMask) &&
+ !grabUngrabKeys (mask, key.keycode (), true))
+ return false;
newKeyGrab.keycode = key.keycode ();
newKeyGrab.modifiers = mask;
@@ -3309,17 +3333,16 @@
void
cps::GrabManager::removePassiveKeyGrab (CompAction::KeyBinding &key)
{
- unsigned int mask;
- std::list::iterator it;
-
- mask = modHandler->virtualToRealModMask (key.modifiers ());
-
- for (it = keyGrabs.begin (); it != keyGrabs.end (); ++it)
+ unsigned int mask = modHandler->virtualToRealModMask (key.modifiers ());
+
+ for (std::list::iterator it = keyGrabs.begin ();
+ it != keyGrabs.end (); ++it)
{
if (key.keycode () == (*it).keycode &&
mask == (*it).modifiers)
{
- (*it).count--;
+ --(*it).count;
+
if ((*it).count)
return;
@@ -3342,32 +3365,27 @@
void
cps::GrabManager::updatePassiveKeyGrabs ()
{
- std::list::iterator it;
-
- XUngrabKey (screen->dpy(), AnyKey, AnyModifier, screen->root());
-
- for (it = keyGrabs.begin (); it != keyGrabs.end (); ++it)
- {
+ XUngrabKey (screen->dpy (), AnyKey, AnyModifier, screen->root ());
+
+ for (std::list::iterator it = keyGrabs.begin ();
+ it != keyGrabs.end (); ++it)
if (!((*it).modifiers & CompNoMask))
- {
grabUngrabKeys ((*it).modifiers,
(*it).keycode, true);
- }
- }
}
bool
cps::GrabManager::addPassiveButtonGrab (CompAction::ButtonBinding &button)
{
- ButtonGrab newButtonGrab;
- std::list::iterator it;
+ ButtonGrab newButtonGrab;
- for (it = buttonGrabs.begin (); it != buttonGrabs.end (); ++it)
+ for (std::list::iterator it = buttonGrabs.begin ();
+ it != buttonGrabs.end (); ++it)
{
if (button.button () == (*it).button &&
button.modifiers () == (*it).modifiers)
{
- (*it).count++;
+ ++(*it).count;
return true;
}
}
@@ -3395,18 +3413,17 @@
continue;
for (unsigned int ignore = 0;
- ignore <= modHandler->ignoredModMask (); ignore++)
+ ignore <= modHandler->ignoredModMask (); ++ignore)
{
if (ignore & ~modHandler->ignoredModMask ())
continue;
- XGrabButton (screen->dpy(),
+ XGrabButton (screen->dpy (),
bind.button,
mods | ignore,
serverFrame,
false,
- ButtonPressMask | ButtonReleaseMask |
- ButtonMotionMask,
+ ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
GrabModeSync,
GrabModeAsync,
None,
@@ -3418,14 +3435,14 @@
void
cps::GrabManager::removePassiveButtonGrab (CompAction::ButtonBinding &button)
{
- std::list::iterator it;
-
- for (it = buttonGrabs.begin (); it != buttonGrabs.end (); ++it)
+ for (std::list::iterator it = buttonGrabs.begin ();
+ it != buttonGrabs.end (); ++it)
{
if (button.button () == (*it).button &&
button.modifiers () == (*it).modifiers)
{
- (*it).count--;
+ --(*it).count;
+
if ((*it).count)
return;
@@ -3447,37 +3464,30 @@
CompScreenImpl::addAction (CompAction *action)
{
assert (privateScreen.initialized);
- if (!privateScreen.initialized)
- return false;
-
- if (action->active ())
- return false;
-
- grabManager.setCurrentState(action->state());
-
- if (action->type () & CompAction::BindingTypeKey)
- {
- if (!grabManager.addPassiveKeyGrab (action->key ()))
- return false;
- }
-
- if (action->type () & CompAction::BindingTypeButton)
- {
- if (!grabManager.addPassiveButtonGrab (action->button ()))
- {
- if (action->type () & CompAction::BindingTypeKey)
- grabManager.removePassiveKeyGrab (action->key ());
-
- return false;
- }
+
+ if (!privateScreen.initialized ||
+ action->active ())
+ return false;
+
+ grabManager.setCurrentState(action->state ());
+
+ if (action->type () & CompAction::BindingTypeKey &&
+ !grabManager.addPassiveKeyGrab (action->key ()))
+ return false;
+
+ if (action->type () & CompAction::BindingTypeButton &&
+ !grabManager.addPassiveButtonGrab (action->button ()))
+ {
+ if (action->type () & CompAction::BindingTypeKey)
+ grabManager.removePassiveKeyGrab (action->key ());
+
+ return false;
}
if (action->edgeMask ())
- {
- for (int i = 0; i < SCREEN_EDGE_NUM; i++)
+ for (int i = 0; i < SCREEN_EDGE_NUM; ++i)
if (action->edgeMask () & (1 << i))
privateScreen.enableEdge (i);
- }
ca::setActionActiveState (*action, true);
@@ -3491,7 +3501,7 @@
!action->active ())
return;
- grabManager.setCurrentState(action->state());
+ grabManager.setCurrentState(action->state ());
if (action->type () & CompAction::BindingTypeKey)
grabManager.removePassiveKeyGrab (action->key ());
@@ -3500,11 +3510,9 @@
grabManager.removePassiveButtonGrab (action->button ());
if (action->edgeMask ())
- {
- for (int i = 0; i < SCREEN_EDGE_NUM; i++)
+ for (int i = 0; i < SCREEN_EDGE_NUM; ++i)
if (action->edgeMask () & (1 << i))
privateScreen.disableEdge (i);
- }
ca::setActionActiveState (*action, false);
}
@@ -3512,14 +3520,14 @@
void
CompScreenImpl::updateWorkarea ()
{
- CompRect workArea;
- CompRegion allWorkArea = CompRegion ();
- bool workAreaChanged = false;
- privateScreen.outputDevices.computeWorkAreas(
- workArea,
- workAreaChanged,
- allWorkArea,
- windowManager.getWindows());
+ CompRect workArea;
+ CompRegion allWorkArea = CompRegion ();
+ bool workAreaChanged = false;
+
+ privateScreen.outputDevices.computeWorkAreas (workArea,
+ workAreaChanged,
+ allWorkArea,
+ windowManager.getWindows ());
workArea = allWorkArea.boundingRect ();
@@ -3535,7 +3543,7 @@
{
/* as work area changed, update all maximized windows on this
screen to snap to the new work area */
- windowManager.updateWindowSizes();
+ windowManager.updateWindowSizes ();
}
}
@@ -3545,17 +3553,10 @@
/* windows with client id less than 2 have been destroyed and only exists
because some plugin keeps a reference to them. they should not be in
client lists */
- if (w->id () < 2)
- return false;
-
- if (w->overrideRedirect ())
- return false;
-
- if (!w->isViewable ())
- {
- if (!(w->state () & CompWindowStateHiddenMask))
- return false;
- }
+ if (w->id () < 2 ||
+ w->overrideRedirect () ||
+ (!w->isViewable () && !(w->state () & CompWindowStateHiddenMask)))
+ return false;
return true;
}
@@ -3565,9 +3566,7 @@
int *n)
{
if (isClientListWindow (w))
- {
*n = *n + 1;
- }
}
static bool
@@ -3578,15 +3577,15 @@
}
void
-cps::WindowManager::updateClientList (PrivateScreen& ps)
+cps::WindowManager::updateClientList (PrivateScreen &ps)
{
- bool updateClientList = false;
- bool updateClientListStacking = false;
- int n = 0;
+ bool updateClientList = false;
+ bool updateClientListStacking = false;
+ int n = 0;
screen->forEachWindow (boost::bind (countClientListWindow, _1, &n));
- if (n == 0)
+ if (!n)
{
if ((unsigned int) n != clientList.size ())
{
@@ -3595,14 +3594,14 @@
clientIdList.clear ();
clientIdListStacking.clear ();
- XChangeProperty (ps.dpy, ps.rootWindow(),
+ XChangeProperty (ps.dpy, ps.rootWindow (),
Atoms::clientList,
XA_WINDOW, 32, PropModeReplace,
- (unsigned char *) &ps.eventManager.getGrabWindow(), 1);
- XChangeProperty (ps.dpy, ps.rootWindow(),
+ (unsigned char *) &ps.eventManager.getGrabWindow (), 1);
+ XChangeProperty (ps.dpy, ps.rootWindow (),
Atoms::clientListStacking,
XA_WINDOW, 32, PropModeReplace,
- (unsigned char *) &ps.eventManager.getGrabWindow(), 1);
+ (unsigned char *) &ps.eventManager.getGrabWindow (), 1);
}
return;
@@ -3618,9 +3617,10 @@
clientListStacking.clear ();
- for (iterator i = begin(); i != end(); ++i)
+ for (iterator i = begin (); i != end (); ++i)
{
CompWindow* const w(*i);
+
if (isClientListWindow (w))
clientListStacking.push_back (w);
}
@@ -3633,61 +3633,57 @@
compareMappingOrder);
/* make sure client id lists are up-to-date */
- for (int i = 0; i < n; i++)
+ for (int i = 0; i < n; ++i)
{
if (!updateClientList &&
clientIdList[i] != clientList[i]->id ())
- {
updateClientList = true;
- }
clientIdList[i] = clientList[i]->id ();
}
- for (int i = 0; i < n; i++)
+ for (int i = 0; i < n; ++i)
{
if (!updateClientListStacking &&
clientIdListStacking[i] != clientListStacking[i]->id ())
- {
updateClientListStacking = true;
- }
clientIdListStacking[i] = clientListStacking[i]->id ();
}
if (updateClientList)
- XChangeProperty (ps.dpy, ps.rootWindow(),
+ XChangeProperty (ps.dpy, ps.rootWindow (),
Atoms::clientList,
XA_WINDOW, 32, PropModeReplace,
(unsigned char *) &clientIdList.at (0), n);
if (updateClientListStacking)
- XChangeProperty (ps.dpy, ps.rootWindow(),
+ XChangeProperty (ps.dpy, ps.rootWindow (),
Atoms::clientListStacking,
XA_WINDOW, 32, PropModeReplace,
- (unsigned char *) &clientIdListStacking.at (0),
- n);
+ (unsigned char *) &clientIdListStacking.at (0), n);
}
const CompWindowVector &
CompScreenImpl::clientList (bool stackingOrder)
{
- return stackingOrder ? windowManager.getClientListStacking() : windowManager.getClientList();
+ return stackingOrder ? windowManager.getClientListStacking () :
+ windowManager.getClientList ();
}
void
CompScreenImpl::toolkitAction (Atom toolkitAction,
- Time eventTime,
- Window window,
- long data0,
- long data1,
- long data2)
+ Time eventTime,
+ Window window,
+ long data0,
+ long data1,
+ long data2)
{
XEvent ev;
- ev.type = ClientMessage;
- ev.xclient.window = window;
+ ev.type = ClientMessage;
+ ev.xclient.window = window;
ev.xclient.message_type = Atoms::toolkitAction;
- ev.xclient.format = 32;
+ ev.xclient.format = 32;
ev.xclient.data.l[0] = toolkitAction;
ev.xclient.data.l[1] = eventTime;
ev.xclient.data.l[2] = data0;
@@ -3697,7 +3693,7 @@
XUngrabPointer (privateScreen.dpy, CurrentTime);
XUngrabKeyboard (privateScreen.dpy, CurrentTime);
- XSendEvent (privateScreen.dpy, privateScreen.rootWindow(), false,
+ XSendEvent (privateScreen.dpy, privateScreen.rootWindow (), false,
StructureNotifyMask, &ev);
}
@@ -3709,23 +3705,21 @@
if (fork () == 0)
{
- size_t pos;
- CompString env (privateScreen.displayString ());
+ CompString env (privateScreen.displayString ());
setsid ();
- pos = env.find (':');
+ size_t pos = env.find (':');
+
if (pos != std::string::npos)
{
- size_t pointPos = env.find ('.', pos);
+ size_t pointPos = env.find ('.', pos);
if (pointPos != std::string::npos)
- {
env.erase (pointPos);
- }
else
{
- unsigned int displayNum = atoi (env.substr (pos + 1).c_str ());
+ unsigned int displayNum = atoi (env.substr (pos + 1).c_str ());
env.erase (pos);
env.append (compPrintf (":%i", displayNum));
}
@@ -3740,7 +3734,9 @@
}
void
-CompScreenImpl::moveViewport (int tx, int ty, bool sync)
+CompScreenImpl::moveViewport (int tx,
+ int ty,
+ bool sync)
{
CompPoint pnt;
@@ -3761,11 +3757,14 @@
tx *= -width ();
ty *= -height ();
- for (cps::WindowManager::iterator i = windowManager.begin(); i != windowManager.end(); ++i)
+ unsigned int valueMask;
+
+ for (cps::WindowManager::iterator i = windowManager.begin ();
+ i != windowManager.end (); ++i)
{
- CompWindow* const w(*i);
- unsigned int valueMask = CWX | CWY;
- XWindowChanges xwc= XWINDOWCHANGES_INIT;
+ CompWindow* const w (*i);
+ valueMask = CWX | CWY;
+ XWindowChanges xwc = XWINDOWCHANGES_INIT;
if (w->onAllViewports ())
continue;
@@ -3786,18 +3785,15 @@
if (sync)
{
- CompWindow *w;
-
privateScreen.setDesktopHints ();
setCurrentActiveWindowHistory (privateScreen.viewPort.vp.x (), privateScreen.viewPort.vp.y ());
- w = findWindow (privateScreen.orphanData.activeWindow);
+ CompWindow *w = findWindow (privateScreen.orphanData.activeWindow);
+
if (w)
{
- CompPoint dvp;
-
- dvp = w->defaultViewport ();
+ CompPoint dvp = w->defaultViewport ();
/* add window to current history if it's default viewport is
still the current one. */
@@ -3823,7 +3819,8 @@
void
cps::WindowManager::removeGroup (CompGroup *group)
{
- group->refCnt--;
+ --group->refCnt;
+
if (group->refCnt)
return;
@@ -3831,9 +3828,7 @@
std::find (groups.begin (), groups.end (), group);
if (it != groups.end ())
- {
groups.erase (it);
- }
delete group;
}
@@ -3849,16 +3844,16 @@
}
void
-cps::StartupSequence::applyStartupProperties (CompScreen* screen, CompWindow *window)
+cps::StartupSequence::applyStartupProperties (CompScreen *screen,
+ CompWindow *window)
{
CompStartupSequence *s = NULL;
const char *startupId = window->startupId ();
if (!startupId)
{
- CompWindow *leader;
+ CompWindow *leader = screen->findWindow (window->clientLeader ());
- leader = screen->findWindow (window->clientLeader ());
if (leader)
startupId = leader->startupId ();
@@ -3868,9 +3863,8 @@
foreach (CompStartupSequence *ss, startupSequences)
{
- const char *id;
+ const char *id = sn_startup_sequence_get_id (ss->sequence);
- id = sn_startup_sequence_get_id (ss->sequence);
if (strcmp (id, startupId) == 0)
{
s = ss;
@@ -3892,7 +3886,7 @@
xev.xclient.format = 32;
xev.xclient.message_type = Atoms::winActive;
- xev.xclient.window = id;
+ xev.xclient.window = id;
xev.xclient.data.l[0] = ClientTypePager;
xev.xclient.data.l[1] = 0;
@@ -3900,7 +3894,7 @@
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
- XSendEvent (privateScreen.dpy, privateScreen.rootWindow(), false,
+ XSendEvent (privateScreen.dpy, privateScreen.rootWindow (), false,
SubstructureRedirectMask | SubstructureNotifyMask, &xev);
}
@@ -3912,7 +3906,8 @@
void
PrivateScreen::enableEdge (int edge)
{
- screenEdge[edge].count++;
+ ++screenEdge[edge].count;
+
if (screenEdge[edge].count == 1)
XMapRaised (dpy, screenEdge[edge].id);
}
@@ -3920,13 +3915,14 @@
void
PrivateScreen::disableEdge (int edge)
{
- screenEdge[edge].count--;
+ --screenEdge[edge].count;
+
if (screenEdge[edge].count == 0)
XUnmapWindow (dpy, screenEdge[edge].id);
}
CompWindow *
-cps::WindowManager::getTopWindow() const
+cps::WindowManager::getTopWindow () const
{
/* return first window that has not been destroyed */
if (!windows.empty ())
@@ -3951,7 +3947,8 @@
}
int
-CompScreenImpl::outputDeviceForPoint (int x, int y)
+CompScreenImpl::outputDeviceForPoint (int x,
+ int y)
{
CompWindow::Geometry geom (x, y, 1, 1, 0);
@@ -3992,7 +3989,7 @@
unsigned long data = desktop;
- XChangeProperty (dpy, rootWindow(), Atoms::currentDesktop,
+ XChangeProperty (dpy, rootWindow (), Atoms::currentDesktop,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) &data, 1);
}
@@ -4024,6 +4021,11 @@
* XXX: It is possible for this function to return a negative viewport, which
* definitely feels wrong, however it seems that some plugins depend on this behaviour
* so they need to be fixed first
+ *
+ * TODO: This function is responsible for several problems as the viewport containing
+ * the center of the window is not always the correct one.
+ * A example for this buggy behaviour is that a window maximizes offscreen, if
+ * it's center is offscreen !
*/
void
compiz::private_screen::viewports::viewportForGeometry (const CompWindow::Geometry &gm,
@@ -4032,30 +4034,31 @@
const CompSize & screenSize)
{
CompRect rect (gm);
- int offset;
- const CompPoint &vp = viewports->getCurrentViewport ();
- const CompSize &vpSize = viewports->viewportDimensions ();
+ const CompPoint &vp = viewports->getCurrentViewport ();
+ const CompSize &vpSize = viewports->viewportDimensions ();
rect.setWidth (gm.widthIncBorders ());
rect.setHeight (gm.heightIncBorders ());
- offset = rect.centerX () < 0 ? -1 : 0;
- viewport.setX (vp.x () + ((rect.centerX () / screenSize.width ()) + offset) % vpSize.width ());
+ int offset = rect.centerX () < 0 ? -1 : 0;
+ viewport.setX (vp.x () + ((rect.centerX () / screenSize.width ()) + offset) %
+ vpSize.width ());
offset = rect.centerY () < 0 ? -1 : 0;
- viewport.setY (vp.y () + ((rect.centerY () / screenSize.height ()) + offset ) % vpSize.height ());
+ viewport.setY (vp.y () + ((rect.centerY () / screenSize.height ()) + offset ) %
+ vpSize.height ());
}
void
-CompScreenImpl::viewportForGeometry (const CompWindow::Geometry& gm,
- CompPoint& viewport)
+CompScreenImpl::viewportForGeometry (const CompWindow::Geometry &gm,
+ CompPoint &viewport)
{
compiz::private_screen::viewports::viewportForGeometry (gm, viewport, &privateScreen.viewPort, *this);
}
int
-CompScreenImpl::outputDeviceForGeometry (const CompWindow::Geometry& gm)
+CompScreenImpl::outputDeviceForGeometry (const CompWindow::Geometry &gm)
{
return privateScreen.outputDevices.outputDeviceForGeometry (gm, privateScreen.optionGetOverlappingOutputs (), this);
}
@@ -4094,11 +4097,12 @@
}
void
-cps::History::setCurrentActiveWindowHistory (int x, int y)
+cps::History::setCurrentActiveWindowHistory (int x,
+ int y)
{
int i, min = 0;
- for (i = 0; i < ACTIVE_WINDOW_HISTORY_NUM; i++)
+ for (i = 0; i < ACTIVE_WINDOW_HISTORY_NUM; ++i)
{
if (history[i].x == x && history[i].y == y)
{
@@ -4107,7 +4111,7 @@
}
}
- for (i = 1; i < ACTIVE_WINDOW_HISTORY_NUM; i++)
+ for (i = 1; i < ACTIVE_WINDOW_HISTORY_NUM; ++i)
if (history[i].activeNum < history[min].activeNum)
min = i;
@@ -4124,10 +4128,10 @@
cps::History::addToCurrentActiveWindowHistory (Window id)
{
CompActiveWindowHistory *history = &this->history[currentHistory_];
- Window tmp, next = id;
+ Window tmp, next = id;
/* walk and move history */
- for (int i = 0; i < ACTIVE_WINDOW_HISTORY_SIZE; i++)
+ for (int i = 0; i < ACTIVE_WINDOW_HISTORY_SIZE; ++i)
{
tmp = history->id[i];
history->id[i] = next;
@@ -4161,7 +4165,7 @@
Window
CompScreenImpl::root ()
{
- return privateScreen.rootWindow();
+ return privateScreen.rootWindow ();
}
int
@@ -4171,10 +4175,11 @@
}
void
-PrivateScreen::identifyEdgeWindow(Window id)
+PrivateScreen::identifyEdgeWindow (Window id)
{
edgeWindow = 0;
- for (unsigned int i = 0; i < SCREEN_EDGE_NUM; i++)
+
+ for (unsigned int i = 0; i < SCREEN_EDGE_NUM; ++i)
{
if (id == screenEdge[i].id)
{
@@ -4186,9 +4191,9 @@
void
CompScreenImpl::warpPointer (int dx,
- int dy)
+ int dy)
{
- XEvent event;
+ XEvent event;
pointerX += dx;
pointerY += dy;
@@ -4204,7 +4209,7 @@
pointerY = 0;
XWarpPointer (privateScreen.dpy,
- None, privateScreen.rootWindow(),
+ None, privateScreen.rootWindow (),
0, 0, 0, 0,
pointerX, pointerY);
@@ -4228,17 +4233,11 @@
EnterWindowMask |
PointerMotionMask,
&event))
- {
- if (event.type == EnterNotify)
- {
- if (event.xcrossing.mode != NotifyGrab ||
- event.xcrossing.mode != NotifyUngrab ||
- event.xcrossing.mode != NotifyInferior)
- {
- privateScreen.identifyEdgeWindow(event.xcrossing.window);
- }
- }
- }
+ if (event.type == EnterNotify &&
+ (event.xcrossing.mode != NotifyGrab ||
+ event.xcrossing.mode != NotifyUngrab ||
+ event.xcrossing.mode != NotifyInferior))
+ privateScreen.identifyEdgeWindow(event.xcrossing.window);
if (!inHandleEvent)
{
@@ -4250,22 +4249,21 @@
CompWindowList &
CompScreenImpl::windows ()
{
- return windowManager.getWindows();
+ return windowManager.getWindows ();
}
CompWindowList &
CompScreenImpl::serverWindows ()
{
- return windowManager.getServerWindows();
+ return windowManager.getServerWindows ();
}
CompWindowList &
CompScreenImpl::destroyedWindows ()
{
- return windowManager.getDestroyedWindows();
+ return windowManager.getDestroyedWindows ();
}
-
Time
CompScreenImpl::getCurrentTime ()
{
@@ -4379,7 +4377,7 @@
}
}
- pendingDestroys--;
+ --pendingDestroys;
}
}
@@ -4401,7 +4399,6 @@
return privateScreen.fullscreenOutput;
}
-
XWindowAttributes
CompScreenImpl::attrib ()
{
@@ -4426,27 +4423,28 @@
}
CompScreenImpl::CompScreenImpl () :
- cps::XWindowInfo(privateScreen.dpy),
- below(),
- autoRaiseTimer_(),
- autoRaiseWindow_(0),
- defaultIcon_(0),
+ cps::XWindowInfo (privateScreen.dpy),
+ below (),
+ autoRaiseTimer_ (),
+ autoRaiseWindow_ (0),
+ defaultIcon_ (0),
grabManager (this),
eventHandled (false),
- privateScreen(this, windowManager),
- showingDesktopMask_(0)
+ privateScreen (this, windowManager),
+ showingDesktopMask_ (0)
{
ValueHolder::SetDefault (&valueHolder);
CompPrivate p;
CompOption::Value::Vector vList;
- privateScreen.setPingTimerCallback(
+ privateScreen.setPingTimerCallback (
boost::bind (&CompScreenImpl::handlePingTimeout, this));
screenInitalized = true;
- CompPlugin* corePlugin = CompPlugin::load ("core");
+ CompPlugin *corePlugin = CompPlugin::load ("core");
+
if (!corePlugin)
{
compLogMessage ("core", CompLogLevelFatal,
@@ -4470,22 +4468,22 @@
}
void
-PrivateScreen::setPlugins(CompOption::Value::Vector const& vList)
+PrivateScreen::setPlugins (CompOption::Value::Vector const &vList)
{
pluginManager.setPlugins(vList);
}
void
-PrivateScreen::initPlugins()
+PrivateScreen::initPlugins ()
{
pluginManager.setDirtyPluginList ();
- pluginManager.updatePlugins (screen, optionGetActivePlugins());
+ pluginManager.updatePlugins (screen, optionGetActivePlugins ());
}
bool
CompScreenImpl::init (const char *name)
{
- privateScreen.eventManager.init();
+ privateScreen.eventManager.init ();
if (privateScreen.initDisplay(name, *this, showingDesktopMask_))
{
@@ -4502,10 +4500,8 @@
privateScreen.optionSetMinimizeWindowKeyInitiate (CompScreenImpl::minimizeWin);
privateScreen.optionSetMinimizeWindowButtonInitiate (CompScreenImpl::minimizeWin);
privateScreen.optionSetMaximizeWindowKeyInitiate (CompScreenImpl::maximizeWin);
- privateScreen.optionSetMaximizeWindowHorizontallyKeyInitiate (
- CompScreenImpl::maximizeWinHorizontally);
- privateScreen.optionSetMaximizeWindowVerticallyKeyInitiate (
- CompScreenImpl::maximizeWinVertically);
+ privateScreen.optionSetMaximizeWindowHorizontallyKeyInitiate (CompScreenImpl::maximizeWinHorizontally);
+ privateScreen.optionSetMaximizeWindowVerticallyKeyInitiate (CompScreenImpl::maximizeWinVertically);
privateScreen.optionSetWindowMenuKeyInitiate (CompScreenImpl::windowMenu);
privateScreen.optionSetWindowMenuButtonInitiate (CompScreenImpl::windowMenu);
@@ -4523,34 +4519,33 @@
privateScreen.optionSetToggleWindowShadedKeyInitiate (CompScreenImpl::shadeWin);
- privateScreen.initPlugins();
+ privateScreen.initPlugins ();
if (debugOutput)
{
- StackDebugger::SetDefault (
- new StackDebugger (
- dpy (),
- root (),
- &privateScreen));
+ StackDebugger::SetDefault (new StackDebugger (dpy (),
+ root (),
+ &privateScreen));
}
return true;
}
+
return false;
}
void
cps::EventManager::init ()
{
- ctx = Glib::MainContext::get_default ();
- mainloop = Glib::MainLoop::create (ctx, false);
- sighupSource = CompSignalSource::create (SIGHUP, boost::bind (&EventManager::handleSignal, this, _1));
- sigintSource = CompSignalSource::create (SIGINT, boost::bind (&EventManager::handleSignal, this, _1));
+ ctx = Glib::MainContext::get_default ();
+ mainloop = Glib::MainLoop::create (ctx, false);
+ sighupSource = CompSignalSource::create (SIGHUP, boost::bind (&EventManager::handleSignal, this, _1));
+ sigintSource = CompSignalSource::create (SIGINT, boost::bind (&EventManager::handleSignal, this, _1));
sigtermSource = CompSignalSource::create (SIGTERM, boost::bind (&EventManager::handleSignal, this, _1));
}
bool
-CompScreenImpl::displayInitialised() const
+CompScreenImpl::displayInitialised () const
{
return privateScreen.initialized;
}
@@ -4568,31 +4563,31 @@
}
void
-CompScreenImpl::updateClientList()
+CompScreenImpl::updateClientList ()
{
privateScreen.updateClientList ();
}
CompWindow *
-CompScreenImpl::getTopWindow() const
+CompScreenImpl::getTopWindow () const
{
- return windowManager.getTopWindow();
+ return windowManager.getTopWindow ();
}
CompWindow *
CompScreenImpl::getTopServerWindow () const
{
- return windowManager.getTopServerWindow();
+ return windowManager.getTopServerWindow ();
}
-CoreOptions&
-CompScreenImpl::getCoreOptions()
+CoreOptions &
+CompScreenImpl::getCoreOptions ()
{
return privateScreen;
}
Colormap
-CompScreenImpl::colormap() const
+CompScreenImpl::colormap () const
{
return privateScreen.colormap;
}
@@ -4600,11 +4595,11 @@
void
CompScreenImpl::setCurrentDesktop (unsigned int desktop)
{
- privateScreen.setCurrentDesktop(desktop);
+ privateScreen.setCurrentDesktop (desktop);
}
Window
-CompScreenImpl::activeWindow() const
+CompScreenImpl::activeWindow () const
{
return privateScreen.orphanData.activeWindow;
}
@@ -4612,70 +4607,73 @@
void
CompScreenImpl::updatePassiveButtonGrabs(Window serverFrame)
{
- grabManager.updatePassiveButtonGrabs(serverFrame);
+ grabManager.updatePassiveButtonGrabs (serverFrame);
}
bool
-CompScreenImpl::grabWindowIsNot(Window w) const
+CompScreenImpl::grabWindowIsNot (Window w) const
{
- return privateScreen.eventManager.notGrabWindow(w);
+ return privateScreen.eventManager.notGrabWindow (w);
}
void
-CompScreenImpl::incrementPendingDestroys()
+CompScreenImpl::incrementPendingDestroys ()
{
- windowManager.incrementPendingDestroys();
+ windowManager.incrementPendingDestroys ();
}
-cps::DesktopWindowCount::DesktopWindowCount() :
+cps::DesktopWindowCount::DesktopWindowCount () :
count(0)
{
}
void
-cps::DesktopWindowCount::incrementDesktopWindowCount()
+cps::DesktopWindowCount::incrementDesktopWindowCount ()
{
- count++;
+ ++count;
}
void
-cps::DesktopWindowCount::decrementDesktopWindowCount()
+cps::DesktopWindowCount::decrementDesktopWindowCount ()
{
- count--;
+ --count;
}
-cps::MapNum::MapNum() :
+cps::MapNum::MapNum () :
mapNum (1)
{
}
unsigned int
-cps::MapNum::nextMapNum()
+cps::MapNum::nextMapNum ()
{
return mapNum++;
}
void
-CompScreenImpl::setNextActiveWindow(Window id)
+CompScreenImpl::setNextActiveWindow (Window id)
{
privateScreen.orphanData.nextActiveWindow = id;
}
+
Window
-CompScreenImpl::getNextActiveWindow() const
+CompScreenImpl::getNextActiveWindow () const
{
return privateScreen.orphanData.nextActiveWindow;
}
namespace
{
-void sendStartupMessageToClients (Display *dpy, bool success)
+void
+sendStartupMessageToClients (Display *dpy,
+ bool success)
{
/* Send a client message indicating that our startup is complete if
* we were asked to do so */
if (sendStartupMessage)
{
- Atom startupMessageAtom = XInternAtom (dpy,
- "_COMPIZ_TESTING_STARTUP",
- FALSE);
+ Atom startupMessageAtom = XInternAtom (dpy,
+ "_COMPIZ_TESTING_STARTUP",
+ FALSE);
XEvent startupMessageEvent;
Window root = DefaultRootWindow (dpy);
@@ -4699,11 +4697,13 @@
}
}
-
bool
-PrivateScreen::initDisplay (const char *name, cps::History& history, unsigned int showingDesktopMask)
+PrivateScreen::initDisplay (const char *name,
+ cps::History &history,
+ unsigned int showingDesktopMask)
{
dpy = XOpenDisplay (name);
+
if (!dpy)
{
compLogMessage ("core", CompLogLevelFatal,
@@ -4723,13 +4723,14 @@
XSetErrorHandler (errorHandler);
snDisplay = sn_display_new (dpy, NULL, NULL);
+
if (!snDisplay)
return true;
if (!xSync.init (dpy))
{
compLogMessage ("core", CompLogLevelFatal,
- "No sync extension");
+ "No sync extension");
sendStartupMessageToClients (dpy, false);
return false;
}
@@ -4738,23 +4739,20 @@
xShape.init (dpy);
xkbEvent.init (dpy);
+
if (xkbEvent.isEnabled ())
- {
XkbSelectEvents (dpy, XkbUseCoreKbd,
XkbBellNotifyMask | XkbStateNotifyMask,
XkbAllEventsMask);
- }
else
- {
compLogMessage ("core", CompLogLevelFatal,
"No XKB extension");
- }
-
- int xineramaError;
- int xineramaEvent;
+
+ int xineramaError, xineramaEvent;
+
xineramaExtension = XineramaQueryExtension (dpy,
- &xineramaEvent,
- &xineramaError);
+ &xineramaEvent,
+ &xineramaError);
updateScreenInfo ();
@@ -4765,9 +4763,8 @@
Window root_tmp = XRootWindow (dpy, DefaultScreen (dpy));
-
/* Don't select for SubstructureRedirectMask or
- * SubstructureNotifyMask yet since we need to
+ * SubstructureNotifyMask yet, since we need to
* act in complete synchronization here when
* doing the initial window init in order to ensure
* that windows don't receive invalid stack positions
@@ -4787,11 +4784,11 @@
/* We need to register for EnterWindowMask |
* ButtonPressMask | FocusChangeMask on other
- * root windows as well because focus happens
+ * root windows as well, because focus happens
* on a display level and we need to check
- * if the screen we are running on lost focus */
+ * if the screen, we are running on, lost focus */
- for (int i = 0; i <= ScreenCount (dpy) - 1; i++)
+ for (int i = 0; i <= ScreenCount (dpy) - 1; ++i)
{
Window rt = XRootWindow (dpy, i);
@@ -4803,7 +4800,7 @@
SubstructureNotifyMask);
}
- for (int i = 0; i < SCREEN_EDGE_NUM; i++)
+ for (int i = 0; i < SCREEN_EDGE_NUM; ++i)
{
screenEdge[i].id = None;
screenEdge[i].count = 0;
@@ -4816,17 +4813,18 @@
snContext = sn_monitor_context_new (snDisplay, screenNum,
compScreenSnEvent, this, NULL);
- if (!XGetWindowAttributes (dpy, rootWindow(), &attrib))
+ if (!XGetWindowAttributes (dpy, rootWindow (), &attrib))
return false;
workArea.setWidth (attrib.width);
workArea.setHeight (attrib.height);
- XVisualInfo templ;
+ XVisualInfo templ;
templ.visualid = XVisualIDFromVisual (attrib.visual);
- int nvisinfo;
- XVisualInfo* visinfo = XGetVisualInfo (dpy, VisualIDMask, &templ, &nvisinfo);
+ int nvisinfo;
+ XVisualInfo *visinfo = XGetVisualInfo (dpy, VisualIDMask, &templ, &nvisinfo);
+
if (!nvisinfo)
{
compLogMessage ("core", CompLogLevelFatal,
@@ -4835,7 +4833,7 @@
return false;
}
- XColor black;
+ XColor black;
black.red = black.green = black.blue = 0;
if (!XAllocColor (dpy, colormap, &black))
@@ -4847,8 +4845,9 @@
return false;
}
- static char data = 0;
- Pixmap bitmap = XCreateBitmapFromData (dpy, rootWindow(), &data, 1, 1);
+ static char data = 0;
+ Pixmap bitmap = XCreateBitmapFromData (dpy, rootWindow (), &data, 1, 1);
+
if (!bitmap)
{
compLogMessage ("core", CompLogLevelFatal,
@@ -4859,7 +4858,7 @@
}
invisibleCursor = XCreatePixmapCursor (dpy, bitmap, bitmap,
- &black, &black, 0, 0);
+ &black, &black, 0, 0);
if (!invisibleCursor)
{
compLogMessage ("core", CompLogLevelFatal,
@@ -4960,12 +4959,12 @@
/* Wait for old window manager to go away */
if (currentWmSnOwner != None)
{
- do {
+ do
+ {
XWindowEvent (dpy, currentWmSnOwner, StructureNotifyMask, &event);
} while (event.type != DestroyNotify);
}
-
/* Server grab from here, we are creating windows */
XGrabServer (dpy);
@@ -4975,13 +4974,13 @@
attrib.override_redirect = 1;
attrib.event_mask = PropertyChangeMask;
- eventManager.createGrabWindow(dpy, rootWindow(), &attrib);
+ eventManager.createGrabWindow(dpy, rootWindow (), &attrib);
- for (int i = 0; i < SCREEN_EDGE_NUM; i++)
+ for (int i = 0; i < SCREEN_EDGE_NUM; ++i)
{
long xdndVersion = 3;
- screenEdge[i].id = XCreateWindow (dpy, rootWindow(),
+ screenEdge[i].id = XCreateWindow (dpy, rootWindow (),
-100, -100, 1, 1, 0,
CopyFromParent, InputOnly,
CopyFromParent,
@@ -5006,7 +5005,7 @@
updateScreenEdges ();
- eventManager.setSupportingWmCheck (dpy, rootWindow());
+ eventManager.setSupportingWmCheck (dpy, rootWindow ());
screen->updateSupportedWmHints ();
XIGetClientPointer (dpy, None, &clientPointerDeviceId);
@@ -5014,14 +5013,18 @@
normalCursor = XCreateFontCursor (dpy, XC_left_ptr);
busyCursor = XCreateFontCursor (dpy, XC_watch);
+<<<<<<< TREE
XIDefineCursor (dpy, clientPointerDeviceId, rootWindow(), normalCursor);
+=======
+ XDefineCursor (dpy, rootWindow (), normalCursor);
+>>>>>>> MERGE-SOURCE
/* Attempt to gain SubstructureRedirectMask */
CompScreenImpl::checkForError (dpy);
/* We should get DestroyNotify events for any windows that were
* destroyed while initializing windows here now */
- XSelectInput (dpy, rootWindow(), attrib.your_event_mask |
+ XSelectInput (dpy, rootWindow (), attrib.your_event_mask |
SubstructureRedirectMask | SubstructureNotifyMask);
if (CompScreenImpl::checkForError (dpy))
@@ -5038,12 +5041,12 @@
}
wmSnSelectionWindow = newWmSnOwner;
- this->wmSnTimestamp = wmSnTimestamp;
+ this->wmSnTimestamp = wmSnTimestamp;
Window rootReturn, parentReturn;
Window *children;
unsigned int nchildren;
- XQueryTree (dpy, rootWindow(),
+ XQueryTree (dpy, rootWindow (),
&rootReturn, &parentReturn,
&children, &nchildren);
@@ -5052,7 +5055,7 @@
/* Start initializing windows here */
- for (unsigned int i = 0; i < nchildren; i++)
+ for (unsigned int i = 0; i < nchildren; ++i)
{
XWindowAttributes attrib;
@@ -5073,7 +5076,7 @@
* using list last sent to server
i = 0;
for (CompWindowList::reverse_iterator rit = serverWindows.rbegin ();
- rit != serverWindows.rend (); rit++)
+ rit != serverWindows.rend (); ++rit)
children[i++] = ROOTPARENT ((*rit));
XRestackWindows (dpy, children, i);
@@ -5082,23 +5085,20 @@
windowManager.setWindowActiveness(history);
- Window focus;
- int revertTo;
+ Window focus;
+ int revertTo;
XGetInputFocus (dpy, &focus, &revertTo);
/* move input focus to root window so that we get a FocusIn event when
moving it to the default window */
- XSetInputFocus (dpy, rootWindow(), RevertToPointerRoot, CurrentTime);
+ XSetInputFocus (dpy, rootWindow (), RevertToPointerRoot, CurrentTime);
if (focus == None || focus == PointerRoot)
- {
screen->focusDefaultWindow ();
- }
else
{
- CompWindow *w;
+ CompWindow *w = screen->findWindow (focus);
- w = screen->findWindow (focus);
if (w)
w->moveInputFocusTo ();
else
@@ -5120,6 +5120,7 @@
* screens from option changes */
bool init_succeeded = CompPlugin::screenInitPlugins (screen);
assert (init_succeeded);
+
if (!init_succeeded)
return false;
@@ -5131,9 +5132,9 @@
setAudibleBell (optionGetAudibleBell ());
-
+ /* TODO: just query optionGetPingDelay () once */
pingTimer.setTimes (optionGetPingDelay (),
- optionGetPingDelay () + 500);
+ optionGetPingDelay () + 500);
pingTimer.start ();
@@ -5146,8 +5147,8 @@
{
privateScreen.startupSequence.removeAllSequences ();
- while (!windowManager.getWindows().empty ())
- delete windowManager.getWindows().front ();
+ while (!windowManager.getWindows ().empty ())
+ delete windowManager.getWindows ().front ();
while (CompPlugin* p = CompPlugin::pop ())
CompPlugin::unload (p);
@@ -5159,32 +5160,34 @@
}
cps::GrabManager::GrabManager (CompScreen *screen) :
- screen(screen),
- currentState(0),
+ screen (screen),
+ currentState (0),
buttonGrabs (),
keyGrabs ()
{
}
-cps::ViewPort::ViewPort() :
+cps::ViewPort::ViewPort () :
vp (0, 0),
vpSize (1, 1)
{
}
-cps::StartupSequence::StartupSequence() :
+cps::StartupSequence::StartupSequence () :
startupSequences (),
startupSequenceTimer ()
{
startupSequenceTimer.setCallback (
boost::bind (&cps::StartupSequence::handleStartupSequenceTimeout, this));
+
+ /* TODO: Magic number alert */
startupSequenceTimer.setTimes (1000, 1500);
}
PrivateScreen::PrivateScreen (CompScreen *screen, cps::WindowManager& windowManager) :
- CoreOptions(false),
+ CoreOptions (false),
dpy (NULL),
- startupSequence(this),
+ startupSequence (this),
eventManager (),
nDesktop (1),
currentDesktop (0),
@@ -5194,10 +5197,10 @@
busyCursor (None),
invisibleCursor (None),
initialized (false),
- screen(screen),
+ screen (screen),
screenInfo (),
- snDisplay(0),
- root(None),
+ snDisplay (0),
+ root (None),
snContext (0),
wmSnAtom (None),
desktopHintData (0),
@@ -5205,64 +5208,64 @@
edgeWindow (None),
edgeDelayTimer (),
xdndWindow (None),
- windowManager(windowManager)
+ windowManager (windowManager)
{
- for (int i = 0; i < SCREEN_EDGE_NUM; i++)
+ for (int i = 0; i < SCREEN_EDGE_NUM; ++i)
{
screenEdge[i].id = None;
screenEdge[i].count = 0;
}
-
}
-cps::History::History() :
+cps::History::History () :
currentHistory_(0),
activeNum_ (1)
{
memset (history, 0, sizeof history);
}
-cps::WindowManager::WindowManager() :
+cps::WindowManager::WindowManager () :
windows (),
serverWindows (),
destroyedWindows (),
stackIsFresh (false),
groups (0),
pendingDestroys (0),
- lastFoundWindow(0)
+ lastFoundWindow (0)
{
}
-cps::PluginManager::PluginManager() :
+cps::PluginManager::PluginManager () :
plugin (),
dirtyPluginList (true)
{
}
cps::EventManager::EventManager () :
- possibleTap(NULL),
- source(0),
- timeout(0),
- sighupSource(0),
- sigtermSource(0),
- sigintSource(0),
+ possibleTap (NULL),
+ source (0),
+ timeout (0),
+ sighupSource (0),
+ sigtermSource (0),
+ sigintSource (0),
fileWatch (0),
lastFileWatchHandle (1),
watchFds (0),
lastWatchFdHandle (1),
+ grabbed (false),
grabWindow (None)
{
TimeoutHandler *dTimeoutHandler = new TimeoutHandler ();
TimeoutHandler::SetDefault (dTimeoutHandler);
}
-cps::OrphanData::OrphanData() :
+cps::OrphanData::OrphanData () :
activeWindow (0),
nextActiveWindow(0)
{
}
-cps::OrphanData::~OrphanData()
+cps::OrphanData::~OrphanData ()
{
}
@@ -5275,16 +5278,15 @@
* See LP: #1085590 */
g_source_destroy (timeout->gobj ());
}
+
delete sigintSource;
delete sigtermSource;
delete sighupSource;
/* Not guaranteed to be created by EventManager's constructor */
if (source)
- {
/* This will implicitly call ~CompEventSource */
g_source_destroy (source->gobj ());
- }
/* This will implicitly call ~CompWatchFd */
foreach (CompWatchFd *fd, watchFds)
@@ -5302,11 +5304,12 @@
if (dpy != NULL)
{
- XUngrabKey (dpy, AnyKey, AnyModifier, rootWindow());
+ XUngrabKey (dpy, AnyKey, AnyModifier, rootWindow ());
- for (int i = 0; i < SCREEN_EDGE_NUM; i++)
+ for (int i = 0; i < SCREEN_EDGE_NUM; ++i)
{
Window id = screenEdge[i].id;
+
if (id != None)
XDestroyWindow (dpy, id);
}
@@ -5340,7 +5343,7 @@
* windows
*/
- XSync (dpy, False); // Redundant?
+ XSync (dpy, False); // TODO: Redundant?
XCloseDisplay (dpy);
}
=== modified file 'src/stackdebugger.cpp'
--- src/stackdebugger.cpp 2012-11-05 02:06:09 +0000
+++ src/stackdebugger.cpp 2013-07-21 23:03:28 +0000
@@ -159,7 +159,8 @@
XSync (mDpy, FALSE);
- /* It is possible that X might not be keeping up with us, so
+ /* TODO: Check if this timeout here is really needed:
+ * It is possible that X might not be keeping up with us, so
* we should give it about 300 ms in case the stacks are out of sync
* in order to deliver any more events that might be pending */
@@ -210,16 +211,14 @@
std::vector serverSideWindows;
CompWindowList::reverse_iterator lrrit = windows.rbegin ();
CompWindowList::reverse_iterator lsrit = mLastServerWindows.rbegin ();
- unsigned int i = 0;
- bool err = false;
+ unsigned int i = 0;
+ bool err = false;
- for (unsigned int n = 0; n < mServerNChildren; n++)
- {
+ for (unsigned int n = 0; n < mServerNChildren; ++n)
if (std::find (mDestroyedFrames.begin (),
mDestroyedFrames.end (), mServerChildren[n])
== mDestroyedFrames.end ())
serverSideWindows.push_back (mServerChildren[n]);
- }
if (verbose)
compLogMessage ("core", CompLogLevelDebug, "sent | recv | server |");
@@ -256,7 +255,7 @@
++lsrit;
if (i != serverSideWindows.size ())
- i++;
+ ++i;
}
return err;
@@ -327,9 +326,9 @@
bool
StackDebugger::checkSanity (CompWindowList &serverWindows, bool verbose)
{
- int current = 0xffffffff;
+ int current = 0xffffffff;
int oldCurrent = current;
- bool err = false;
+ bool err = false;
if (verbose)
compLogMessage ("stackdebugger", CompLogLevelDebug, "processing new stack --------");
@@ -365,13 +364,11 @@
/* search down the stack to check if there is a fullscreen
* window, otherwise we are not on the fullscreen layer */
for (CompWindow *rw = w->prev; rw; rw = rw->prev)
- {
if (rw->type () & CompWindowTypeFullscreenMask)
{
fullscreenWindow = true;
break;
}
- }
/* if there is no fullscreen window, change the layer */
if (!fullscreenWindow)
@@ -385,13 +382,9 @@
err |= setCurrentLayer (w->id (), DOCKS, current);
}
else if (w->type () == CompWindowTypeFullscreenMask)
- {
err |= setCurrentLayer (w->id (), FULLSCREEN, current);
- }
else if (w->type () == CompWindowTypeDesktopMask)
- {
err |= setCurrentLayer (w->id (), DESKTOP, current);
- }
/* everything else that is not a fullscreen window or a desktop */
else
{
=== modified file 'src/string/src/string.cpp'
--- src/string/src/string.cpp 2012-03-23 03:37:26 +0000
+++ src/string/src/string.cpp 2013-07-21 23:03:28 +0000
@@ -31,11 +31,10 @@
CompString compPrintf (const char *format, ...)
{
- va_list ap;
- CompString rv;
+ va_list ap;
va_start (ap, format);
- rv = compPrintf (format, ap);
+ CompString rv = compPrintf (format, ap);
va_end (ap);
return rv;
@@ -43,19 +42,18 @@
CompString compPrintf (const char *format, va_list ap)
{
- va_list aq;
- int n;
- char *str;
-
if (!format)
return CompString ("");
unsigned int size = strlen (format) + 1;
- str = new char[size];
+ char *str = new char[size];
if (!str)
return CompString ("");
+ va_list aq;
+ int n;
+
while (1)
{
/* Try to print in the allocated space. */
@@ -71,15 +69,13 @@
if (n > -1) /* glibc 2.1 */
size = n + 1; /* precisely what is needed */
else /* glibc 2.0 */
- size++; /* one more than the old size */
+ ++size; /* one more than the old size */
delete [] str;
str = new char[size];
if (!str)
- {
return CompString ("");
- }
}
CompString rv (str);
=== modified file 'src/string/tests/printf/src/test-string-printf.cpp'
--- src/string/tests/printf/src/test-string-printf.cpp 2013-03-25 03:35:47 +0000
+++ src/string/tests/printf/src/test-string-printf.cpp 2013-07-21 23:03:28 +0000
@@ -152,7 +152,7 @@
formatStrings["%d"] = CompString ("2");
for (std::map ::iterator it = formatStrings.begin ();
- it != formatStrings.end (); it++)
+ it != formatStrings.end (); ++it)
{
CompString str = compiz::string::printf_test::get_format (it->first, formatValues[it->first]);
ASSERT_EQ(str, it->second);
=== modified file 'src/timer/src/timeouthandler.cpp'
--- src/timer/src/timeouthandler.cpp 2012-07-29 23:40:47 +0000
+++ src/timer/src/timeouthandler.cpp 2013-07-21 23:03:28 +0000
@@ -48,18 +48,15 @@
void
TimeoutHandler::addTimer (CompTimer *timer)
{
- std::list::iterator it;
-
- it = std::find (priv->mTimers.begin (), priv->mTimers.end (), timer);
+ std::list::iterator it =
+ std::find (priv->mTimers.begin (), priv->mTimers.end (), timer);
if (it != priv->mTimers.end ())
return;
for (it = priv->mTimers.begin (); it != priv->mTimers.end (); ++it)
- {
if (timer->minTime () < (*it)->minLeft ())
break;
- }
timer->setExpiryTimes (timer->minTime (), timer->maxTime ());
@@ -69,9 +66,8 @@
void
TimeoutHandler::removeTimer (CompTimer *timer)
{
- std::list::iterator it;
-
- it = std::find (priv->mTimers.begin (), priv->mTimers.end (), timer);
+ std::list::iterator it =
+ std::find (priv->mTimers.begin (), priv->mTimers.end (), timer);
if (it == priv->mTimers.end ())
return;
=== modified file 'src/timer/src/timer.cpp'
--- src/timer/src/timer.cpp 2012-09-05 13:04:40 +0000
+++ src/timer/src/timer.cpp 2013-07-21 23:03:28 +0000
@@ -79,6 +79,7 @@
return new CompTimeoutSource (ctx);
}
+/* TODO: Investigate this arbitrary, magic number */
static const unsigned short COMPIZ_TIMEOUT_WAIT = 15;
bool
@@ -94,7 +95,6 @@
* we create the source after we start pingTimer
* and that doesn't stop until compiz does
*/
-
timeout = COMPIZ_TIMEOUT_WAIT;
return true;
@@ -106,20 +106,22 @@
CompTimer *t = (*it);
timeout = t->maxLeft ();
+
while (it != TimeoutHandler::Default ()->timers ().end ())
{
t = (*it);
+
if (t->minLeft () >= (unsigned int) timeout)
break;
+
if (t->maxLeft () < (unsigned int) timeout)
timeout = (int) t->maxLeft ();
+
++it;
}
}
else
- {
timeout = 0;
- }
return timeout <= 0;
}
@@ -143,22 +145,27 @@
{
TimeoutHandler *handler = TimeoutHandler::Default ();
std::list requeue, &timers = handler->timers ();
+ CompTimer *t;
while (!timers.empty ())
{
- CompTimer *t = timers.front ();
+ t = timers.front ();
+
if (t->minLeft () > 0)
break;
+
timers.pop_front ();
t->setActive (false);
+
if (t->triggerCallback ())
requeue.push_back (t);
}
std::list::const_iterator i = requeue.begin ();
+
for (; i != requeue.end (); ++i)
{
- CompTimer *t = *i;
+ t = *i;
handler->addTimer (t);
t->setActive (true);
}
@@ -193,11 +200,14 @@
}
void
-CompTimer::setTimes (unsigned int min, unsigned int max)
+CompTimer::setTimes (unsigned int min,
+ unsigned int max)
{
bool wasActive = priv->mActive;
+
if (priv->mActive)
stop ();
+
priv->mMinTime = min;
priv->mMaxTime = (min <= max)? max : min;
@@ -206,7 +216,8 @@
}
void
-CompTimer::setExpiryTimes (unsigned int min, unsigned int max)
+CompTimer::setExpiryTimes (unsigned int min,
+ unsigned int max)
{
gint64 now = g_get_monotonic_time ();
priv->mMinDeadline = now + (static_cast (min) * 1000);
@@ -216,7 +227,7 @@
void
CompTimer::decrement (unsigned int diff)
{
- /* deprecated */
+ /* deprecated, TODO: Investigate why we have this empty, deprecated function */
}
void
@@ -235,6 +246,7 @@
CompTimer::setCallback (CompTimer::CallBack callback)
{
bool wasActive = priv->mActive;
+
if (priv->mActive)
stop ();
@@ -265,7 +277,8 @@
}
void
-CompTimer::start (unsigned int min, unsigned int max)
+CompTimer::start (unsigned int min,
+ unsigned int max)
{
setTimes (min, max);
start ();
@@ -273,7 +286,8 @@
void
CompTimer::start (CompTimer::CallBack callback,
- unsigned int min, unsigned int max)
+ unsigned int min,
+ unsigned int max)
{
setTimes (min, max);
setCallback (callback);
=== modified file 'src/timer/tests/callbacks/src/test-timer-callbacks.cpp'
--- src/timer/tests/callbacks/src/test-timer-callbacks.cpp 2012-07-30 13:05:05 +0000
+++ src/timer/tests/callbacks/src/test-timer-callbacks.cpp 2013-07-21 23:03:28 +0000
@@ -87,7 +87,7 @@
bool QuitIfLast (unsigned int num)
{
- mCallsCounter[num].calls++;
+ ++mCallsCounter[num].calls;
if (mCallsCounter[num].maxCalls < 0 ||
static_cast (mCallsCounter[num].maxCalls) == mCallsCounter[num].calls)
@@ -140,7 +140,7 @@
mDispatchTable->setMax (mLastAdded, maxAllowedCalls);
- mLastAdded++;
+ ++mLastAdded;
}
void Run ()
=== modified file 'src/window.cpp'
--- src/window.cpp 2013-07-19 18:39:38 +0000
+++ src/window.cpp 2013-07-21 23:03:28 +0000
@@ -1184,12 +1184,47 @@
if (priv->wrapper)
XUnmapWindow (screen->dpy (), priv->wrapper);
+<<<<<<< TREE
CompWindow *oldServerNext = serverNext;
CompWindow *oldServerPrev = serverPrev;
CompWindow *oldNext = next;
CompWindow *oldPrev = prev;
priv->manageFrameWindowSeparately ();
+=======
+ CompWindow *oldServerNext = serverNext;
+ CompWindow *oldServerPrev = serverPrev;
+ CompWindow *oldNext = next;
+ CompWindow *oldPrev = prev;
+
+ /* This is where things get tricky ... it is possible
+ * to receive a ConfigureNotify relative to a frame window
+ * for a destroyed window in case we process a ConfigureRequest
+ * for the destroyed window and then a DestroyNotify for it directly
+ * afterwards. In that case, we will receive the ConfigureNotify
+ * for the XConfigureWindow request we made relative to that frame
+ * window. Because of this, we must keep the frame window in the stack
+ * as a new toplevel window so that the ConfigureNotify will be processed
+ * properly until it too receives a DestroyNotify */
+
+ if (priv->serverFrame)
+ {
+ XWindowAttributes attrib;
+
+ /* It's possible that the frame window was already destroyed because
+ * the client was unreparented before it was destroyed (eg
+ * UnmapNotify before DestroyNotify). In that case the frame window
+ * is going to be an invalid window but since we haven't received
+ * a DestroyNotify for it yet, it is possible that restacking
+ * operations could occurr relative to it so we need to hold it
+ * in the stack for now. Ensure that it is marked override redirect */
+ XGetWindowAttributes (screen->dpy (), priv->serverFrame, &attrib);
+
+ /* Put the frame window "above" the client window
+ * in the stack */
+ PrivateWindow::createCompWindow (priv->id, priv->id, attrib, priv->serverFrame);
+ }
+>>>>>>> MERGE-SOURCE
/* Immediately unhook the window once destroyed
* as the stacking order will be invalid if we don't
@@ -2893,12 +2928,48 @@
xwc->y = saveWc.y + window->border ().top;
if (m & CWWidth)
+<<<<<<< TREE
xwc->width = saveWc.width - (window->border ().left +
window->border ().right);
+=======
+ {
+ xwc->width = saveWc.width;
+
+ /* This is not perfect but it works OK for now. If the saved width is
+ the same as the current width then make it a little be smaller so
+ the user can see that it changed and it also makes sure that
+ windowResizeNotify is called and plugins are notified.
+ TODO: Eliminate these arbitrary magic numbers here */
+ if (xwc->width == (int) serverGeometry.width ())
+ {
+ xwc->width -= 10;
+
+ if (m & CWX)
+ xwc->x += 5;
+ }
+ }
+>>>>>>> MERGE-SOURCE
if (m & CWHeight)
+<<<<<<< TREE
xwc->height = saveWc.height - (window->border ().top +
window->border ().bottom);
+=======
+ {
+ xwc->height = saveWc.height;
+
+ /* As above, if the saved height is the same as the current height
+ then make it a little be smaller.
+ TODO: As above, find a better solution without magic numbers here */
+ if (xwc->height == (int) serverGeometry.height ())
+ {
+ xwc->height -= 10;
+
+ if (m & CWY)
+ xwc->y += 5;
+ }
+ }
+>>>>>>> MERGE-SOURCE
if (m & CWBorderWidth)
xwc->border_width = saveWc.border_width;
@@ -3553,6 +3624,7 @@
int mask = 0;
CompPoint viewport;
+<<<<<<< TREE
if (old.intersects (CompRect (0, 0, screen->width (), screen->height ())))
viewport = screen->vp ();
else
@@ -3562,6 +3634,14 @@
int y = (viewport.y () - screen->vp ().y ()) * screen->height ();
CompOutput *output = &screen->outputDevs ().at (screen->outputDeviceForGeometry (old));
+=======
+ screen->viewportForGeometry (old, viewport);
+
+ int x = (viewport.x () - screen->vp ().x ()) * screen->width ();
+ int y = (viewport.y () - screen->vp ().y ()) * screen->height ();
+
+ CompOutput *output = &screen->outputDevs ().at (screen->outputDeviceForGeometry (old));
+>>>>>>> MERGE-SOURCE
/*
* output is now the correct output for the given geometry.
@@ -6601,6 +6681,7 @@
priv->alreadyDecorated = true;
priv->serverInput = *i;
+<<<<<<< TREE
priv->border = *b;
/* Offset client for any new decoration size */
@@ -6614,6 +6695,10 @@
configureXWindow (CWX | CWY | CWWidth | CWHeight, &xwc);
windowNotify (CompWindowNotifyFrameUpdate);
+=======
+ priv->border = *b;
+
+>>>>>>> MERGE-SOURCE
recalcActions ();
/* Always send a moveNotify
@@ -6755,6 +6840,7 @@
0);
/* Awaiting a new frame to be given to us */
+<<<<<<< TREE
frame = None;
serverFrame = XCreateWindow (dpy,
screen->root (),
@@ -6768,6 +6854,12 @@
visual,
mask,
&attr);
+=======
+ frame = None;
+ serverFrame = XCreateWindow (dpy, screen->root (), 0, 0,
+ wa.width, wa.height, 0, wa.depth,
+ InputOutput, visual, mask, &attr);
+>>>>>>> MERGE-SOURCE
/* Do not get any events from here on */
XSelectInput (dpy, screen->root (), NoEventMask);
@@ -6855,8 +6947,18 @@
if (wa.map_state == IsViewable || shaded)
XMapWindow (dpy, serverFrame);
- attr.event_mask = SubstructureRedirectMask | SubstructureNotifyMask |
- EnterWindowMask | LeaveWindowMask;
+<<<<<<< TREE
+ attr.event_mask = SubstructureRedirectMask | SubstructureNotifyMask |
+ EnterWindowMask | LeaveWindowMask;
+=======
+ attr.event_mask = SubstructureRedirectMask | SubstructureNotifyMask |
+ EnterWindowMask | LeaveWindowMask;
+
+ serverFrameGeometry = serverGeometry;
+
+ XMoveResizeWindow (dpy, serverFrame, serverFrameGeometry.x (), serverFrameGeometry.y (),
+ serverFrameGeometry.width (), serverFrameGeometry.height ());
+>>>>>>> MERGE-SOURCE
XChangeWindowAttributes (dpy, serverFrame, CWEventMask, &attr);
XChangeWindowAttributes (dpy, wrapper, CWEventMask, &attr);
=== modified file 'src/window/constrainment/include/core/windowconstrainment.h'
--- src/window/constrainment/include/core/windowconstrainment.h 2012-01-21 18:31:07 +0000
+++ src/window/constrainment/include/core/windowconstrainment.h 2013-07-21 23:03:28 +0000
@@ -47,8 +47,8 @@
CompSize constrainToHints (const XSizeHints &hints,
const CompSize &size,
- long ignoreHints,
- long resizeIgnoreHints);
+ long ignoreHints,
+ long resizeIgnoreHints);
}
}
=== modified file 'src/window/constrainment/src/windowconstrainment.cpp'
--- src/window/constrainment/src/windowconstrainment.cpp 2012-01-21 18:31:07 +0000
+++ src/window/constrainment/src/windowconstrainment.cpp 2013-07-21 23:03:28 +0000
@@ -44,20 +44,20 @@
CompSize
compiz::window::constrainment::constrainToHints (const XSizeHints &hints,
const CompSize &size,
- long ignoreHints,
- long resizeIgnoreHints)
+ long ignoreHints,
+ long resizeIgnoreHints)
{
- int width = size.width ();
- int height = size.height ();
- int min_width = 1;
- int min_height = 1;
- int base_width = 1;
- int base_height = 1;
- int xinc = 1;
- int yinc = 1;
- int max_width = std::numeric_limits ::max ();
- int max_height = std::numeric_limits ::max ();
- long flags = hints.flags & ~ignoreHints;
+ int width = size.width ();
+ int height = size.height ();
+ int min_width = 1;
+ int min_height = 1;
+ int base_width = 1;
+ int base_height = 1;
+ int xinc = 1;
+ int yinc = 1;
+ int max_width = std::numeric_limits ::max ();
+ int max_height = std::numeric_limits ::max ();
+ long flags = hints.flags & ~ignoreHints;
long resizeIncFlags = (flags & PResizeInc) ? ((PHorzResizeInc | PVertResizeInc) & ~resizeIgnoreHints) : 0;
/* Ater gdk_window_constrain_size(), which is partially borrowed from fvwm.
@@ -130,13 +130,14 @@
if (min_aspect_x * height > width * min_aspect_y)
{
delta = constrainment64Floor (height - width * min_aspect_y / min_aspect_x,
- yinc);
+ yinc);
if (height - (int) delta >= min_height)
height -= delta;
else
{
delta = constrainment64Floor (height * min_aspect_x / min_aspect_y - width,
xinc);
+
if (width + (int) delta <= max_width)
width += delta;
}
@@ -145,13 +146,15 @@
if (width * max_aspect_y > max_aspect_x * height)
{
delta = constrainment64Floor (width - height * max_aspect_x / max_aspect_y,
- xinc);
+ xinc);
+
if (width - (int) delta >= min_width)
width -= delta;
else
{
delta = constrainment64Floor (width * min_aspect_y / min_aspect_x - height,
- yinc);
+ yinc);
+
if (height + (int) delta <= max_height)
height += delta;
}
=== modified file 'src/window/extents/src/windowextents.cpp'
--- src/window/extents/src/windowextents.cpp 2013-06-26 21:59:35 +0000
+++ src/window/extents/src/windowextents.cpp 2013-07-21 23:03:28 +0000
@@ -34,42 +34,58 @@
{
CompPoint rv = CompPoint ();
+<<<<<<< TREE
switch (gravity) {
/* We treat StaticGravity like NorthWestGravity here
* as when decorating / undecorating the window we
* really do need to move it in order to handle
* any cases where it goes offscreen */
case StaticGravity:
+=======
+ switch (gravity)
+ {
+>>>>>>> MERGE-SOURCE
case NorthGravity:
case NorthWestGravity:
case NorthEastGravity:
rv.setY (extents.top);
break;
+
case SouthGravity:
case SouthWestGravity:
case SouthEastGravity:
rv.setY (-extents.bottom);
break;
+
default:
break;
}
+<<<<<<< TREE
switch (gravity) {
/* We treat StaticGravity like NorthWestGravity here
* as when decorating / undecorating the window we
* really do need to move it in order to handle
* any cases where it goes offscreen */
case StaticGravity:
+=======
+ switch (gravity)
+ {
+>>>>>>> MERGE-SOURCE
case WestGravity:
case NorthWestGravity:
case SouthWestGravity:
rv.setX (extents.left);
break;
+
case EastGravity:
case NorthEastGravity:
case SouthEastGravity:
rv.setX (-extents.right);
break;
+
+ default:
+ break;
}
return rv;
@@ -89,6 +105,7 @@
bool
compiz::window::extents::Extents::operator== (const Extents &other)
{
+<<<<<<< TREE
const Extents &self = const_cast (*this);
return self == other;
}
@@ -99,6 +116,11 @@
return this->left == other.left &&
this->right == other.right &&
this->top == other.top &&
+=======
+ return this->left == other.left &&
+ this->right == other.right &&
+ this->top == other.top &&
+>>>>>>> MERGE-SOURCE
this->bottom == other.bottom;
}
=== modified file 'src/window/geometry-saver/src/geometrysaver.cpp'
--- src/window/geometry-saver/src/geometrysaver.cpp 2012-01-19 20:00:04 +0000
+++ src/window/geometry-saver/src/geometrysaver.cpp 2013-07-21 23:03:28 +0000
@@ -32,7 +32,8 @@
}
unsigned int
-compiz::window::GeometrySaver::push (const Geometry &g, unsigned int mask)
+compiz::window::GeometrySaver::push (const Geometry &g,
+ unsigned int mask)
{
/* Don't allow overwriting of any already set geometry */
unsigned int useMask = mask & ~mMask;
@@ -44,7 +45,8 @@
}
unsigned int
-compiz::window::GeometrySaver::pop (Geometry &g, unsigned int mask)
+compiz::window::GeometrySaver::pop (Geometry &g,
+ unsigned int mask)
{
unsigned int restoreMask = mask & mMask;
=== modified file 'src/window/geometry/src/windowgeometry.cpp'
--- src/window/geometry/src/windowgeometry.cpp 2012-01-19 20:08:32 +0000
+++ src/window/geometry/src/windowgeometry.cpp 2013-07-21 23:03:28 +0000
@@ -32,10 +32,10 @@
}
compiz::window::Geometry::Geometry (int x,
- int y,
- int width,
- int height,
- int border) :
+ int y,
+ int width,
+ int height,
+ int border) :
CompRect (x, y, width, height),
mBorder (border)
{
@@ -55,10 +55,10 @@
void
compiz::window::Geometry::set (int x,
- int y,
- int width,
- int height,
- int border)
+ int y,
+ int width,
+ int height,
+ int border)
{
setX (x);
setY (y);
@@ -91,7 +91,8 @@
}
compiz::window::Geometry
-compiz::window::Geometry::change (const compiz::window::Geometry &g, unsigned int mask) const
+compiz::window::Geometry::change (const compiz::window::Geometry &g,
+ unsigned int mask) const
{
compiz::window::Geometry rg = *this;
@@ -101,7 +102,8 @@
}
void
-compiz::window::Geometry::applyChange (const compiz::window::Geometry &g, unsigned int mask)
+compiz::window::Geometry::applyChange (const compiz::window::Geometry &g,
+ unsigned int mask)
{
if (mask & CHANGE_X)
setX (g.x ());
=== modified file 'src/windowgeometry.cpp'
--- src/windowgeometry.cpp 2012-12-10 03:28:47 +0000
+++ src/windowgeometry.cpp 2013-07-21 23:03:28 +0000
@@ -120,10 +120,8 @@
{
return CompRect (geometry ().xMinusBorder () - priv->border.left,
geometry ().yMinusBorder () - priv->border.top,
- geometry ().widthIncBorders () +
- priv->border.left + priv->border.right,
- geometry ().heightIncBorders () +
- priv->border.top + priv->border.bottom);
+ geometry ().widthIncBorders () + priv->border.left + priv->border.right,
+ geometry ().heightIncBorders () + priv->border.top + priv->border.bottom);
}
CompRect
@@ -131,10 +129,8 @@
{
return CompRect (serverGeometry ().xMinusBorder () - priv->border.left,
serverGeometry ().yMinusBorder () - priv->border.top,
- serverGeometry ().widthIncBorders () +
- priv->border.left + priv->border.right,
- serverGeometry ().heightIncBorders() +
- priv->border.top + priv->border.bottom);
+ serverGeometry ().widthIncBorders () + priv->border.left + priv->border.right,
+ serverGeometry ().heightIncBorders () + priv->border.top + priv->border.bottom);
}
CompRect
@@ -142,10 +138,8 @@
{
return CompRect (geometry ().xMinusBorder () - priv->serverInput.left,
geometry ().yMinusBorder () - priv->serverInput.top,
- geometry ().widthIncBorders () +
- priv->serverInput.left + priv->serverInput.right,
- geometry ().heightIncBorders () +
- priv->serverInput.top + priv->serverInput.bottom);
+ geometry ().widthIncBorders () + priv->serverInput.left + priv->serverInput.right,
+ geometry ().heightIncBorders () + priv->serverInput.top + priv->serverInput.bottom);
}
CompRect
@@ -153,30 +147,24 @@
{
return CompRect (serverGeometry ().xMinusBorder () - priv->serverInput.left,
serverGeometry ().yMinusBorder () - priv->serverInput.top,
- serverGeometry ().widthIncBorders () +
- priv->serverInput.left + priv->serverInput.right,
- serverGeometry ().heightIncBorders () +
- priv->serverInput.top + priv->serverInput.bottom);
+ serverGeometry ().widthIncBorders () + priv->serverInput.left + priv->serverInput.right,
+ serverGeometry ().heightIncBorders () + priv->serverInput.top + priv->serverInput.bottom);
}
CompRect
CompWindow::outputRect () const
{
- return CompRect (geometry ().xMinusBorder ()- priv->output.left,
+ return CompRect (geometry ().xMinusBorder () - priv->output.left,
geometry ().yMinusBorder () - priv->output.top,
- geometry ().widthIncBorders () +
- priv->output.left + priv->output.right,
- geometry ().heightIncBorders () +
- priv->output.top + priv->output.bottom);
+ geometry ().widthIncBorders () + priv->output.left + priv->output.right,
+ geometry ().heightIncBorders () + priv->output.top + priv->output.bottom);
}
CompRect
CompWindow::serverOutputRect () const
{
- return CompRect (serverGeometry ().xMinusBorder () - priv->output.left,
+ return CompRect (serverGeometry ().xMinusBorder () - priv->output.left,
serverGeometry ().yMinusBorder () - priv->output.top,
- serverGeometry ().widthIncBorders () +
- priv->output.left + priv->output.right,
- serverGeometry ().heightIncBorders () +
- priv->output.top + priv->output.bottom);
+ serverGeometry ().widthIncBorders () + priv->output.left + priv->output.right,
+ serverGeometry ().heightIncBorders () + priv->output.top + priv->output.bottom);
}
=== modified file 'src/wrapsystem/tests/test-wrapsystem.cpp'
--- src/wrapsystem/tests/test-wrapsystem.cpp 2012-01-12 17:23:36 +0000
+++ src/wrapsystem/tests/test-wrapsystem.cpp 2013-07-21 23:03:28 +0000
@@ -77,12 +77,12 @@
void TestInterface::testMethodReturningVoid() /* const */ {
WRAPABLE_DEF (testMethodReturningVoid);
- testMethodReturningVoidCalls++;
+ ++testMethodReturningVoidCalls;
}
int TestInterface::testMethodReturningInt(int i) {
WRAPABLE_DEF (testMethodReturningInt, i);
- testMethodReturningIntCalls++;
+ ++testMethodReturningIntCalls;
return i;
}
@@ -92,7 +92,7 @@
#else
WRAPABLE_HND_FUNCTN(testMethodReturningVoid)
#endif
- testMethodReturningVoidCalls++;
+ ++testMethodReturningVoidCalls;
}
int TestImplementation::testMethodReturningInt(int i) {
@@ -101,17 +101,17 @@
#else
WRAPABLE_HND_FUNCTN_RETURN(int, testMethodReturningInt, i)
#endif
- testMethodReturningIntCalls++;
+ ++testMethodReturningIntCalls;
return i;
}
void TestWrapper::testMethodReturningVoid() {
impl.testMethodReturningVoid();
- testMethodReturningVoidCalls++;
+ ++testMethodReturningVoidCalls;
}
int TestWrapper::testMethodReturningInt(int i) {
- testMethodReturningIntCalls++;
+ ++testMethodReturningIntCalls;
return impl.testMethodReturningInt(i);
}
=== modified file 'tests/integration/xig/src/test-runner.c'
--- tests/integration/xig/src/test-runner.c 2012-12-01 17:57:53 +0000
+++ tests/integration/xig/src/test-runner.c 2013-07-21 23:03:28 +0000
@@ -199,7 +199,7 @@
c = command + 1;
while (*c && !isspace (*c))
- c++;
+ ++c;
name = g_strdup_printf ("%.*s", (int) (c - command - 1), command + 1);
params = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
@@ -208,10 +208,10 @@
gchar *start, *param_name, *param_value;
while (isspace (*c))
- c++;
+ ++c;
start = c;
while (*c && !isspace (*c) && *c != '=')
- c++;
+ ++c;
if (*c == '\0')
break;
@@ -219,15 +219,15 @@
if (*c == '=')
{
- c++;
+ ++c;
while (isspace (*c))
- c++;
+ ++c;
if (*c == '\"')
{
gboolean escaped = FALSE;
GString *value;
- c++;
+ ++c;
value = g_string_new ("");
while (*c)
{
@@ -245,18 +245,18 @@
break;
if (!escaped)
g_string_append_c (value, *c);
- c++;
+ ++c;
}
param_value = value->str;
g_string_free (value, FALSE);
if (*c == '\"')
- c++;
+ ++c;
}
else
{
start = c;
while (*c && !isspace (*c))
- c++;
+ ++c;
param_value = g_strdup_printf ("%.*s", (int) (c - start), start);
}
}
@@ -420,7 +420,7 @@
g_free (data);
/* Load lines with #? prefix as expected behaviour */
- for (i = 0; lines[i]; i++)
+ for (i = 0; lines[i]; ++i)
{
gchar *line = g_strstrip (lines[i]);
if (g_str_has_prefix (line, "#?"))
=== modified file 'tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp'
--- tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp 2013-07-18 13:06:24 +0000
+++ tests/system/xorg-gtest/tests/compiz_xorg_gtest_configure_window.cpp 2013-07-21 23:03:28 +0000
@@ -191,6 +191,14 @@
bool overrideAssert);
+ /* Helper functions for the Create*WindowOverrideRedirect* tests */
+ Window GrabAndCreateWindowWithAttrs (::Display *dpy,
+ XSetWindowAttributes &attr);
+ void UngrabSyncAndTestOverride (::Display *dpy,
+ Window w,
+ bool overrideAssert);
+
+
protected:
ReparentedWindow CreateWindow (::Display *);
@@ -834,3 +842,93 @@
XDestroyWindow (dpy, w);
}
+
+
+Window
+CompizXorgSystemConfigureWindowTest::GrabAndCreateWindowWithAttrs (::Display *dpy,
+ XSetWindowAttributes &attr)
+{
+ /* NOTE: We need to ungrab the server after this function */
+ XGrabServer (dpy);
+
+ /* Create a window with our custom attributes */
+ return XCreateWindow (dpy, DefaultRootWindow (dpy),
+ 0, 0, 100, 100, 0, CopyFromParent,
+ InputOutput, CopyFromParent, CWOverrideRedirect,
+ &attr);
+}
+
+void
+CompizXorgSystemConfigureWindowTest::UngrabSyncAndTestOverride (::Display *dpy,
+ Window w,
+ bool overrideAssert)
+{
+ XSync (dpy, false);
+
+ XUngrabServer (dpy);
+
+ XSync (dpy, false);
+
+ /* Check if the created window had the attributes passed correctly */
+ std::vector data = WaitForWindowCreation (w);
+ EXPECT_EQ (overrideAssert, IsOverrideRedirect (data));
+}
+
+
+TEST_F (CompizXorgSystemConfigureWindowTest, CreateDestroyWindowOverrideRedirectTrue)
+{
+ ::Display *dpy = Display ();
+ XSetWindowAttributes attr;
+ attr.override_redirect = 1;
+
+ Window w = GrabAndCreateWindowWithAttrs (dpy, attr);
+
+ XDestroyWindow (dpy, w);
+
+ UngrabSyncAndTestOverride (dpy, w, true);
+}
+
+TEST_F (CompizXorgSystemConfigureWindowTest, CreateDestroyWindowOverrideRedirectFalse)
+{
+ ::Display *dpy = Display ();
+ XSetWindowAttributes attr;
+ attr.override_redirect = 0;
+
+ Window w = GrabAndCreateWindowWithAttrs (dpy, attr);
+
+ XDestroyWindow (dpy, w);
+
+ UngrabSyncAndTestOverride (dpy, w, false);
+}
+
+TEST_F (CompizXorgSystemConfigureWindowTest, CreateChangeWindowOverrideRedirectTrue)
+{
+ ::Display *dpy = Display ();
+ XSetWindowAttributes attr;
+ attr.override_redirect = 0;
+
+ Window w = GrabAndCreateWindowWithAttrs (dpy, attr);
+
+ attr.override_redirect = 1;
+ XChangeWindowAttributes (dpy, w, CWOverrideRedirect, &attr);
+
+ UngrabSyncAndTestOverride (dpy, w, true);
+
+ XDestroyWindow (dpy, w);
+}
+
+TEST_F (CompizXorgSystemConfigureWindowTest, CreateChangeWindowOverrideRedirectFalse)
+{
+ ::Display *dpy = Display ();
+ XSetWindowAttributes attr;
+ attr.override_redirect = 1;
+
+ Window w = GrabAndCreateWindowWithAttrs (dpy, attr);
+
+ attr.override_redirect = 0;
+ XChangeWindowAttributes (dpy, w, CWOverrideRedirect, &attr);
+
+ UngrabSyncAndTestOverride (dpy, w, false);
+
+ XDestroyWindow (dpy, w);
+}
=== modified file 'tests/xorg-gtest/include/compiz-xorg-gtest.h'
=== modified file 'tests/xorg-gtest/plugins/testhelper/src/testhelper.cpp'
=== modified file 'tests/xorg-gtest/src/compiz-xorg-gtest.cpp'