diff options
author | Danny Baumann <dannybaumann@web.de> | 2009-03-16 10:18:16 +0100 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2009-03-16 10:18:16 +0100 |
commit | 59666304be35773fcb4c9c7eeef40695e6203c8c (patch) | |
tree | 658e5ab592b9e7ab4870b42973be34d66dafdf4c /plugins | |
parent | d8971221a3d271d18879d625aaaf89cc0df9eb63 (diff) | |
download | compiz-with-glib-mainloop-59666304be35773fcb4c9c7eeef40695e6203c8c.tar.gz compiz-with-glib-mainloop-59666304be35773fcb4c9c7eeef40695e6203c8c.tar.bz2 |
Whitespace fixes.
Diffstat (limited to 'plugins')
37 files changed, 203 insertions, 221 deletions
diff --git a/plugins/blur/src/blur.cpp b/plugins/blur/src/blur.cpp index c13230e..ecb86c5 100644 --- a/plugins/blur/src/blur.cpp +++ b/plugins/blur/src/blur.cpp @@ -220,7 +220,7 @@ BlurWindow::updateRegion () if (!q.isEmpty ()) { q &= r; - + if (q != r) state[BLUR_STATE_CLIENT].clipped = true; @@ -428,7 +428,7 @@ BlurScreen::preparePaint (int msSinceLastPaint) foreach (CompWindow *w, screen->windows ()) { BLUR_WINDOW (w); - + if (!w->isViewable () || !CompositeWindow::get (w)->damaged ()) continue; @@ -579,7 +579,7 @@ BlurScreen::getSrcBlurFragmentFunction (GLTexture *texture, { static const char *temp[] = { "offset0", "offset1", "sum" }; int i; - + for (i = 0; i < sizeof (temp) / sizeof (temp[0]); i++) data.addTempHeaderOp (temp[i]); @@ -723,7 +723,7 @@ BlurScreen::getDstBlurFragmentFunction (GLTexture *texture, } else { - i = MAX(((maxTemp / 2) - 4) / 4, 1); + i = MAX (((maxTemp / 2) - 4) / 4, 1); numIndirect = ceil ((float)numTexop / (float)i); numIndirectOp = ceil ((float)numTexop / (float)numIndirect); } @@ -744,7 +744,6 @@ BlurScreen::getDstBlurFragmentFunction (GLTexture *texture, data.addTempHeaderOp (str); } - data.addFetchOp ("output", NULL, target); data.addColorOp ("output", "output"); @@ -765,7 +764,7 @@ BlurScreen::getDstBlurFragmentFunction (GLTexture *texture, { base = j * numIndirectOp; end = MIN ((j + 1) * numIndirectOp, numTexop) - base; - + ITCbase = MAX (numITC - base, 0); for (i = ITCbase; i < end; i++) @@ -988,7 +987,7 @@ BlurScreen::loadFilterProgram (int numITC) { base = j * numIndirectOp; end = MIN ((j + 1) * numIndirectOp, numTexop) - base; - + ITCbase = MAX (numITC - base, 0); for (i = ITCbase; i < end; i++) @@ -1369,10 +1368,11 @@ BlurWindow::updateDstTexture (const GLMatrix &transform, if (state[BLUR_STATE_DECOR].threshold) { int xx, yy, ww, hh; - // top + // top xx = window->x () - window->output ().left; yy = window->y () - window->output ().top; - ww = window->width () + window->output ().left + window->output ().right; + ww = window->width () + window->output ().left + + window->output ().right; hh = window->output ().top; bScreen->tmpRegion2 = bScreen->tmpRegion.intersected ( @@ -1384,7 +1384,8 @@ BlurWindow::updateDstTexture (const GLMatrix &transform, // bottom xx = window->x () - window->output ().left; yy = window->y () + window->height (); - ww = window->width () + window->output ().left + window->output ().right; + ww = window->width () + window->output ().left + + window->output ().right; hh = window->output ().bottom; bScreen->tmpRegion2 = bScreen->tmpRegion.intersected ( @@ -1555,7 +1556,7 @@ BlurWindow::updateDstTexture (const GLMatrix &transform, switch (filter) { case BlurOptions::FilterGaussian: - return bScreen->fboUpdate (bScreen->tmpRegion.handle()->rects, + return bScreen->fboUpdate (bScreen->tmpRegion.handle ()->rects, bScreen->tmpRegion.numRects ()); case BlurOptions::FilterMipmap: (*GL::generateMipmap) (bScreen->target); @@ -1605,7 +1606,7 @@ BlurWindow::glDraw (const GLMatrix &transform, bScreen->tmpRegion = this->region.intersected (reg); if (!bScreen->blurOcclusion && !(mask & PAINT_WINDOW_TRANSFORMED_MASK)) - bScreen->tmpRegion -= clip; + bScreen->tmpRegion -= clip; if (updateDstTexture (transform, &box, clientThreshold)) { @@ -1663,7 +1664,7 @@ BlurWindow::glDraw (const GLMatrix &transform, GLTexture::MatrixList ml; gWindow->geometry ().reset (); - + gWindow->glAddGeometry (ml, bScreen->tmpRegion, reg); if (gWindow->geometry ().vCount) { @@ -1800,7 +1801,9 @@ BlurWindow::glDrawTexture (GLTexture *texture, unit = dstFa.allocTextureUnits (2); function = bScreen->getDstBlurFragmentFunction ( - texture, param, unit, iTC, gWindow->geometry().texUnits); + texture, param, unit, iTC, + gWindow->geometry ().texUnits); + if (function) { int i; @@ -1867,30 +1870,30 @@ BlurWindow::glDrawTexture (GLTexture *texture, q_gen[2] = rm[11]; q_gen[3] = rm[15]; - glTexGenfv(GL_T, GL_OBJECT_PLANE, t_gen); - glTexGenfv(GL_S, GL_OBJECT_PLANE, s_gen); - glTexGenfv(GL_Q, GL_OBJECT_PLANE, q_gen); + glTexGenfv (GL_T, GL_OBJECT_PLANE, t_gen); + glTexGenfv (GL_S, GL_OBJECT_PLANE, s_gen); + glTexGenfv (GL_Q, GL_OBJECT_PLANE, q_gen); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, - GL_OBJECT_LINEAR); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, - GL_OBJECT_LINEAR); - glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, - GL_OBJECT_LINEAR); + glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, + GL_OBJECT_LINEAR); + glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, + GL_OBJECT_LINEAR); + glTexGeni (GL_Q, GL_TEXTURE_GEN_MODE, + GL_OBJECT_LINEAR); - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glEnable(GL_TEXTURE_GEN_Q); + glEnable (GL_TEXTURE_GEN_S); + glEnable (GL_TEXTURE_GEN_T); + glEnable (GL_TEXTURE_GEN_Q); (*GL::activeTexture) (GL_TEXTURE0_ARB + gWindow->geometry ().texUnits + 1 + (i * 2)); rm.reset (); - + rm[13] = -bScreen->ty * bScreen->pos[i]; rm *= tm; - + s_gen[0] = rm[0]; s_gen[1] = rm[4]; s_gen[2] = rm[8]; @@ -1904,20 +1907,20 @@ BlurWindow::glDrawTexture (GLTexture *texture, q_gen[2] = rm[11]; q_gen[3] = rm[15]; - glTexGenfv(GL_T, GL_OBJECT_PLANE, t_gen); - glTexGenfv(GL_S, GL_OBJECT_PLANE, s_gen); - glTexGenfv(GL_Q, GL_OBJECT_PLANE, q_gen); + glTexGenfv (GL_T, GL_OBJECT_PLANE, t_gen); + glTexGenfv (GL_S, GL_OBJECT_PLANE, s_gen); + glTexGenfv (GL_Q, GL_OBJECT_PLANE, q_gen); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, - GL_OBJECT_LINEAR); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, - GL_OBJECT_LINEAR); - glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, - GL_OBJECT_LINEAR); + glTexGeni (GL_S, GL_TEXTURE_GEN_MODE, + GL_OBJECT_LINEAR); + glTexGeni (GL_T, GL_TEXTURE_GEN_MODE, + GL_OBJECT_LINEAR); + glTexGeni (GL_Q, GL_TEXTURE_GEN_MODE, + GL_OBJECT_LINEAR); - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glEnable(GL_TEXTURE_GEN_Q); + glEnable (GL_TEXTURE_GEN_S); + glEnable (GL_TEXTURE_GEN_T); + glEnable (GL_TEXTURE_GEN_Q); } (*GL::activeTexture) (GL_TEXTURE0_ARB); @@ -1993,17 +1996,17 @@ BlurWindow::glDrawTexture (GLTexture *texture, glBindTexture (bScreen->target, 0); (*GL::activeTexture) (GL_TEXTURE0_ARB); } - + if (iTC) { int i; - for (i = gWindow->geometry().texUnits; - i < gWindow->geometry().texUnits + (2 * iTC); i++) + for (i = gWindow->geometry ().texUnits; + i < gWindow->geometry ().texUnits + (2 * iTC); i++) { (*GL::activeTexture) (GL_TEXTURE0_ARB + i); - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - glDisable(GL_TEXTURE_GEN_Q); + glDisable (GL_TEXTURE_GEN_S); + glDisable (GL_TEXTURE_GEN_T); + glDisable (GL_TEXTURE_GEN_Q); } (*GL::activeTexture) (GL_TEXTURE0_ARB); } diff --git a/plugins/blur/src/blur.h b/plugins/blur/src/blur.h index 4f31ff6..980fb25 100644 --- a/plugins/blur/src/blur.h +++ b/plugins/blur/src/blur.h @@ -74,7 +74,6 @@ class BlurScreen : public BlurOptions { public: - BlurScreen (CompScreen *screen); ~BlurScreen (); @@ -84,7 +83,7 @@ class BlurScreen : virtual void matchExpHandlerChanged (); virtual void matchPropertyChanged (CompWindow *window); - + void preparePaint (int); void donePaint (); diff --git a/plugins/commands/src/commands.cpp b/plugins/commands/src/commands.cpp index dd9ecd6..11df0d0 100644 --- a/plugins/commands/src/commands.cpp +++ b/plugins/commands/src/commands.cpp @@ -42,7 +42,7 @@ CommandsScreen::runCommand (CompAction *action, cs = CommandsScreen::get (screen); - screen->runCommand (cs->mOptions[commandOption].value (). s()); + screen->runCommand (cs->mOptions[commandOption].value (). s ()); return true; } diff --git a/plugins/composite/include/composite/composite.h b/plugins/composite/include/composite/composite.h index 4378f53..97fd46c 100644 --- a/plugins/composite/include/composite/composite.h +++ b/plugins/composite/include/composite/composite.h @@ -108,7 +108,7 @@ class CompositeScreen : bool compositingActive (); int damageEvent (); - + void damageScreen (); void damageRegion (const CompRegion &); void damagePending (); @@ -130,7 +130,7 @@ class CompositeScreen : int getTimeToNextRedraw (struct timeval *tv); int redrawTime (); - + bool handlePaintTimeout (); WRAPABLE_HND (0, CompositeScreenInterface, void, preparePaint, int); @@ -226,7 +226,7 @@ class CompositeWindow : void unredirect (); bool redirected (); bool overlayWindow (); - + void damageTransformedRect (float xScale, float yScale, float xTranslate, @@ -254,7 +254,7 @@ class CompositeWindow : friend class PrivateCompositeWindow; friend class CompositeScreen; - + private: PrivateCompositeWindow *priv; }; diff --git a/plugins/composite/src/privates.h b/plugins/composite/src/privates.h index 5247f1e..3f3468d 100644 --- a/plugins/composite/src/privates.h +++ b/plugins/composite/src/privates.h @@ -82,7 +82,7 @@ class PrivateCompositeScreen : unsigned long damageMask; CompRegion tmpRegion; - + Window overlay; Window output; @@ -126,7 +126,6 @@ class PrivateCompositeWindow : WindowInterface int height); public: - CompWindow *window; CompositeWindow *cWindow; CompositeScreen *cScreen; @@ -143,7 +142,7 @@ class PrivateCompositeWindow : WindowInterface unsigned short opacity; unsigned short brightness; unsigned short saturation; - + XRectangle *damageRects; int sizeDamage; int nDamage; diff --git a/plugins/composite/src/screen.cpp b/plugins/composite/src/screen.cpp index 8947847..b2d97bd 100644 --- a/plugins/composite/src/screen.cpp +++ b/plugins/composite/src/screen.cpp @@ -99,7 +99,7 @@ PrivateCompositeScreen::handleEvent (XEvent *event) } break; } - + screen->handleEvent (event); switch (event->type) { @@ -222,7 +222,7 @@ CompositeScreen::CompositeScreen (CompScreen *s) : } if (!XDamageQueryExtension (s->dpy (), &priv->damageEvent, - &priv->damageError)) + &priv->damageError)) { compLogMessage ("core", CompLogLevelFatal, "No damage extension"); @@ -403,8 +403,9 @@ CompositeScreen::registerPaintHandler (PaintHandler *pHnd) showOutputWindow (); priv->paintTimer.start - (boost::bind(&CompositeScreen::handlePaintTimeout, this), + (boost::bind (&CompositeScreen::handlePaintTimeout, this), priv->optimalRedrawTime, MAXSHORT); + return true; } @@ -545,7 +546,7 @@ CompositeScreen::updateOutputWindow () Display *dpy = screen->dpy (); XserverRegion region; CompRegion tmpRegion (screen->region ()); - + for (CompWindowList::reverse_iterator rit = screen->windows ().rbegin (); rit != screen->windows ().rend (); rit++) @@ -553,7 +554,7 @@ CompositeScreen::updateOutputWindow () { tmpRegion -= (*rit)->region (); } - + XShapeCombineRegion (dpy, priv->output, ShapeBounding, 0, 0, tmpRegion.handle (), ShapeSet); @@ -630,7 +631,7 @@ PrivateCompositeScreen::detectRefreshRate () value.set ((int) 0); - if (screen->XRandr()) + if (screen->XRandr ()) { XRRScreenConfiguration *config; @@ -777,7 +778,7 @@ CompositeScreen::handlePaintTimeout () } priv->tmpRegion = priv->damage & screen->region (); - + if (priv->damageMask & COMPOSITE_SCREEN_DAMAGE_REGION_MASK) { if (priv->tmpRegion == screen->region ()) @@ -790,7 +791,7 @@ CompositeScreen::handlePaintTimeout () priv->damageMask = 0; CompOutput::ptrList outputs (0); - + if (priv->optionGetForceIndependentOutputPainting () || !screen->hasOverlappingOutputs ()) { @@ -801,7 +802,7 @@ CompositeScreen::handlePaintTimeout () outputs.push_back (&screen->fullscreenOutput ()); paint (outputs, mask); - + priv->lastRedraw = tv; donePaint (); @@ -833,17 +834,17 @@ CompositeScreen::handlePaintTimeout () void CompositeScreen::preparePaint (int msSinceLastPaint) - WRAPABLE_HND_FUNC(0, preparePaint, msSinceLastPaint) + WRAPABLE_HND_FUNC (0, preparePaint, msSinceLastPaint) void CompositeScreen::donePaint () - WRAPABLE_HND_FUNC(1, donePaint) + WRAPABLE_HND_FUNC (1, donePaint) void CompositeScreen::paint (CompOutput::ptrList &outputs, unsigned int mask) { - WRAPABLE_HND_FUNC(2, paint, outputs, mask) + WRAPABLE_HND_FUNC (2, paint, outputs, mask) if (priv->pHnd) priv->pHnd->paintOutputs (outputs, mask, priv->tmpRegion); diff --git a/plugins/composite/src/window.cpp b/plugins/composite/src/window.cpp index 94dd36b..aa9331f 100644 --- a/plugins/composite/src/window.cpp +++ b/plugins/composite/src/window.cpp @@ -45,7 +45,7 @@ CompositeWindow::CompositeWindow (CompWindow *w) : priv->opacity = OPAQUE; if (!(w->type () & CompWindowTypeDesktopMask)) - priv->opacity = s->getWindowProp32 (w->id (), + priv->opacity = s->getWindowProp32 (w->id (), Atoms::winOpacity, OPAQUE); priv->brightness = s->getWindowProp32 (w->id (), @@ -53,7 +53,7 @@ CompositeWindow::CompositeWindow (CompWindow *w) : priv->saturation = s->getWindowProp32 (w->id (), Atoms::winSaturation, COLOR); - + if (w->isViewable ()) priv->damaged = true; } @@ -478,9 +478,9 @@ CompositeWindow::saturation () bool CompositeWindow::damageRect (bool initial, - const CompRect &rect) + const CompRect &rect) { - WRAPABLE_HND_FUNC_RETURN(0, bool, damageRect, initial, rect) + WRAPABLE_HND_FUNC_RETURN (0, bool, damageRect, initial, rect) return false; } @@ -535,7 +535,6 @@ PrivateCompositeWindow::windowNotify (CompWindowNotify n) } default: break; - } window->windowNotify (n); diff --git a/plugins/copytex/src/copytex.cpp b/plugins/copytex/src/copytex.cpp index f3d4ea1..95188c3 100644 --- a/plugins/copytex/src/copytex.cpp +++ b/plugins/copytex/src/copytex.cpp @@ -92,7 +92,7 @@ CopyPixmap::~CopyPixmap () CopyTexture::CopyTexture (CopyPixmap *cp, CompRect dim) : cp (cp), dim (dim), - damage (0, 0, dim.width(), dim.height ()) + damage (0, 0, dim.width (), dim.height ()) { GLenum target; GLTexture::Matrix matrix = _identity_matrix; @@ -172,35 +172,36 @@ CopyTexture::update () tmpPix = XCreatePixmap (screen->dpy (), cp->pixmap, damage.width (), damage.height (), cp->depth); - XCopyArea(screen->dpy (), cp->pixmap, tmpPix, gc, dim.x () + damage.x (), - dim.y () + damage.y (), damage.width (), damage.height (), 0, 0); - XSync(screen->dpy (), FALSE); + XCopyArea (screen->dpy (), cp->pixmap, tmpPix, gc, + dim.x () + damage.x (), dim.y () + damage.y (), + damage.width (), damage.height (), 0, 0); + XSync (screen->dpy (), FALSE); if (cs->useShm) addr = cs->shmInfo.shmaddr; else { - image = XGetImage(screen->dpy (), tmpPix, 0, 0, damage.width(), - damage.height (), AllPlanes, ZPixmap); + image = XGetImage (screen->dpy (), tmpPix, 0, 0, damage.width (), + damage.height (), AllPlanes, ZPixmap); if (image) addr = image->data; } glBindTexture (target (), name ()); - glTexSubImage2D(target (), 0, damage.x (), damage.y (), damage.width (), - damage.height (), GL_BGRA, + glTexSubImage2D (target (), 0, damage.x (), damage.y (), + damage.width (), damage.height (), GL_BGRA, #if IMAGE_BYTE_ORDER == MSBFirst - GL_UNSIGNED_INT_8_8_8_8_REV, + GL_UNSIGNED_INT_8_8_8_8_REV, #else - GL_UNSIGNED_BYTE, + GL_UNSIGNED_BYTE, #endif - addr); + addr); glBindTexture (target (), 0); - XFreePixmap(screen->dpy (), tmpPix); - XFreeGC(screen->dpy (), gc); + XFreePixmap (screen->dpy (), tmpPix); + XFreeGC (screen->dpy (), gc); if (image) - XDestroyImage(image); + XDestroyImage (image); damage.setGeometry (0, 0, 0, 0); } @@ -249,7 +250,7 @@ CopytexScreen::handleEvent (XEvent *event) y1 = MIN (y1, t->damage.y1 ()); y2 = MAX (y2, t->damage.y2 ()); } - + if (x1 < x2 && y1 < y2) t->damage.setGeometry (x1, y1, x2 - x1, y2 - y1); @@ -271,7 +272,7 @@ CopytexScreen::CopytexScreen (CompScreen *screen) : if (b) useShm = true; } - + if (useShm) { shmInfo.shmid = shmget (IPC_PRIVATE, SHM_SIZE, IPC_CREAT | 0600); @@ -298,7 +299,7 @@ CopytexScreen::CopytexScreen (CompScreen *screen) : if (useShm) { shmInfo.readOnly = FALSE; - if (!XShmAttach(screen->dpy (), &shmInfo)) + if (!XShmAttach (screen->dpy (), &shmInfo)) { shmdt (shmInfo.shmaddr); shmctl (shmInfo.shmid, IPC_RMID, 0); @@ -321,9 +322,9 @@ CopytexScreen::~CopytexScreen () { if (useShm) { - XShmDetach(screen->dpy (), &shmInfo); + XShmDetach (screen->dpy (), &shmInfo); shmdt (shmInfo.shmaddr); - shmctl (shmInfo.shmid, IPC_RMID, 0); + shmctl (shmInfo.shmid, IPC_RMID, 0); } GLScreen::get (screen)->unregisterBindPixmap (hnd); } diff --git a/plugins/copytex/src/copytex.h b/plugins/copytex/src/copytex.h index 4bb83a2..6d35685 100644 --- a/plugins/copytex/src/copytex.h +++ b/plugins/copytex/src/copytex.h @@ -49,7 +49,7 @@ class CopyPixmap { ~CopyPixmap (); - static GLTexture::List bindPixmapToTexture (Pixmap pixmap, + static GLTexture::List bindPixmapToTexture (Pixmap pixmap, int width, int height, int depth); @@ -87,7 +87,6 @@ class CopytexScreen : public PluginClassHandler<CopytexScreen,CompScreen> { public: - CopytexScreen (CompScreen *screen); ~CopytexScreen (); @@ -110,7 +109,6 @@ class CopytexPluginVTable : public CompPlugin::VTableForScreen<CopytexScreen> { public: - bool init (); -};
\ No newline at end of file +}; diff --git a/plugins/decor/src/decor.cpp b/plugins/decor/src/decor.cpp index 34d762b..892631a 100644 --- a/plugins/decor/src/decor.cpp +++ b/plugins/decor/src/decor.cpp @@ -244,7 +244,7 @@ computeQuadBox (decor_quad_t *q, if (q->stretch & STRETCH_X) { - sx = (float)q->max_width / ((float)(x2 - x1)); + sx = (float) q->max_width / ((float) (x2 - x1)); } else if (q->max_width < x2 - x1) { @@ -256,7 +256,7 @@ computeQuadBox (decor_quad_t *q, if (q->stretch & STRETCH_Y) { - sy = (float)q->max_height / ((float)(y2 - y1)); + sy = (float) q->max_height / ((float) (y2 - y1)); } else if (q->max_height < y2 - y1) { @@ -691,7 +691,7 @@ DecorWindow::update (bool allowDecoration) } else { - + if (dScreen->dmSupports & WINDOW_DECORATION_TYPE_PIXMAP && dScreen->cmActive && !(dScreen->dmSupports & WINDOW_DECORATION_TYPE_WINDOW && @@ -766,7 +766,7 @@ DecorWindow::update (bool allowDecoration) wd = NULL; updateFrame (); - + memset (&emptyExtents, 0, sizeof (CompWindowExtents)); window->setWindowFrameExtents (&emptyExtents); @@ -1017,7 +1017,7 @@ DecorWindow::updateOutputFrame () XChangeProperty (screen->dpy (), window->id (), dScreen->outputFrameAtom, XA_WINDOW, 32, PropModeReplace, (unsigned char *) &outputFrame, 1); - + if (screen->XShape ()) XShapeSelectInput (screen->dpy (), outputFrame, ShapeNotifyMask); @@ -1133,7 +1133,7 @@ DecorScreen::checkForDm (bool updateWindows) if (!dmSupports) dmWin = None; - + XFree (data); } else @@ -1253,7 +1253,7 @@ DecorScreen::handleEvent (XEvent *event) if (frames.find (de->drawable) != frames.end ()) frames[de->drawable]->cWindow->damageOutputExtents (); - + foreach (DecorTexture *t, textures) { if (t->pixmap == de->drawable) @@ -1468,7 +1468,7 @@ DecorWindow::getOutputExtents (CompWindowExtents& output) output.bottom = e->bottom; } } - + bool DecorScreen::setOption (const CompString &name, CompOption::Value &value) @@ -1505,7 +1505,7 @@ DecorScreen::setOption (const CompString &name, matchString = optionGetShadowMatch ().toString (); if (matchString.find ("rgba=") == CompString::npos) { - CompMatch rgbaMatch("rgba=0"); + CompMatch rgbaMatch ("rgba=0"); optionGetShadowMatch () &= rgbaMatch; } } diff --git a/plugins/decor/src/decor.h b/plugins/decor/src/decor.h index 28379f4..bef0be1 100644 --- a/plugins/decor/src/decor.h +++ b/plugins/decor/src/decor.h @@ -120,7 +120,6 @@ class DecorScreen : DecorTexture * getTexture (Pixmap); void releaseTexture (DecorTexture *); - void checkForDm (bool); bool decoratorStartTimeout (); @@ -199,7 +198,7 @@ class DecorWindow : GLWindow *gWindow; CompositeWindow *cWindow; DecorScreen *dScreen; - + WindowDecoration *wd; Decoration *decor; diff --git a/plugins/imgpng/src/imgpng.cpp b/plugins/imgpng/src/imgpng.cpp index b7826e5..ae2abd4 100644 --- a/plugins/imgpng/src/imgpng.cpp +++ b/plugins/imgpng/src/imgpng.cpp @@ -95,7 +95,7 @@ PngScreen::readPngData (png_struct *png, png_set_gray_1_2_4_to_8 (png); /* transform transparency to alpha */ - if (png_get_valid(png, info, PNG_INFO_tRNS)) + if (png_get_valid (png, info, PNG_INFO_tRNS)) png_set_tRNS_to_alpha (png); if (depth == 16) diff --git a/plugins/imgsvg/src/imgsvg.cpp b/plugins/imgsvg/src/imgsvg.cpp index a252d46..a97aafd 100644 --- a/plugins/imgsvg/src/imgsvg.cpp +++ b/plugins/imgsvg/src/imgsvg.cpp @@ -213,7 +213,7 @@ SvgWindow::~SvgWindow () if (context) { finiTexture (context->texture[0]); - delete context; + delete context; } } diff --git a/plugins/ini/src/ini.cpp b/plugins/ini/src/ini.cpp index 0c8c3e0..7c3948a 100644 --- a/plugins/ini/src/ini.cpp +++ b/plugins/ini/src/ini.cpp @@ -465,7 +465,7 @@ IniScreen::fileChanged (const char *name) CompString IniScreen::getHomeDir () { - char *home = getenv("HOME"); + char *home = getenv ("HOME"); CompString retval; if (home) diff --git a/plugins/move/src/move.cpp b/plugins/move/src/move.cpp index 87cd059..6556416 100644 --- a/plugins/move/src/move.cpp +++ b/plugins/move/src/move.cpp @@ -185,7 +185,7 @@ moveTerminate (CompAction *action, } action->setState (action->state () & ~(CompAction::StateTermKey | - CompAction::StateTermButton)); + CompAction::StateTermButton)); return false; } @@ -221,7 +221,7 @@ moveGetYConstrainRegion (CompScreen *s) XUnionRegion (&r, region, region); - for (i = 0; i < s->outputDevs ().size(); i++) + for (i = 0; i < s->outputDevs ().size (); i++) { XUnionRegion (s->outputDevs ()[i].region (), region, region); @@ -296,7 +296,7 @@ moveHandleMotionEvent (CompScreen *s, CompWindow *w; w = ms->w; - + wX = w->serverGeometry ().x (); wY = w->serverGeometry ().y (); wWidth = w->serverGeometry ().width () + @@ -665,12 +665,12 @@ MoveScreen::MoveScreen (CompScreen *screen) : region (NULL), status (RectangleOut), releaseButton (0), - grab(NULL), + grab (NULL), hasCompositing (false) { updateOpacity (); - + for (unsigned int i = 0; i < NUM_KEYS; i++) key[i] = XKeysymToKeycode (screen->dpy (), XStringToKeysym (mKeys[i].name)); diff --git a/plugins/move/src/move.h b/plugins/move/src/move.h index 8e49e5f..bfc228d 100644 --- a/plugins/move/src/move.h +++ b/plugins/move/src/move.h @@ -55,14 +55,13 @@ class MoveScreen : public MoveOptions { public: - MoveScreen (CompScreen *screen); ~MoveScreen (); - + void updateOpacity (); void handleEvent (XEvent *); - + CompWindow *w; int savedX; int savedY; @@ -75,7 +74,7 @@ class MoveScreen : int releaseButton; GLushort moveOpacity; - + CompScreen::GrabHandle grab; Cursor moveCursor; diff --git a/plugins/opengl/include/opengl/opengl.h b/plugins/opengl/include/opengl/opengl.h index 8d73f47..3fe84cc 100644 --- a/plugins/opengl/include/opengl/opengl.h +++ b/plugins/opengl/include/opengl/opengl.h @@ -287,7 +287,7 @@ class GLScreen : GLTexture::BindPixmapHandle registerBindPixmap (GLTexture::BindPixmapProc); void unregisterBindPixmap (GLTexture::BindPixmapHandle); - + GLFBConfig * glxPixmapFBConfig (unsigned int depth); GLTexture *defaultIcon (); @@ -355,7 +355,7 @@ class GLWindow : ~Geometry (); void reset (); - + bool moreVertices (int newSize); bool moreIndices (int newSize); @@ -370,7 +370,7 @@ class GLWindow : int texCoordSize; int indexCount; }; - + static GLWindowPaintAttrib defaultPaintAttrib; public: @@ -410,7 +410,7 @@ class GLWindow : friend class GLScreen; friend class PrivateGLScreen; - + private: PrivateGLWindow *priv; }; diff --git a/plugins/opengl/include/opengl/texture.h b/plugins/opengl/include/opengl/texture.h index 1a32757..eb64dba 100644 --- a/plugins/opengl/include/opengl/texture.h +++ b/plugins/opengl/include/opengl/texture.h @@ -81,7 +81,6 @@ class GLTexture : public CompRect { typedef unsigned int BindPixmapHandle; public: - GLuint name () const; GLenum target () const; GLenum filter () const; diff --git a/plugins/opengl/src/fragment.cpp b/plugins/opengl/src/fragment.cpp index 3546be3..d964478 100644 --- a/plugins/opengl/src/fragment.cpp +++ b/plugins/opengl/src/fragment.cpp @@ -84,7 +84,7 @@ namespace GLFragment { class HeaderOp { public: - HeaderOp () : type(OpTypeHeaderTemp), name ("") {}; + HeaderOp () : type (OpTypeHeaderTemp), name ("") {}; public: OpType type; CompString name; @@ -93,7 +93,7 @@ namespace GLFragment { class BodyOp { public: BodyOp () : - type(OpTypeData), + type (OpTypeData), data (""), dst (""), src (""), @@ -296,7 +296,7 @@ namespace GLFragment { offset, &colorDone, &blendDone, callBack); - if (bodyOp.dst.compare("output")) + if (bodyOp.dst.compare ("output")) { dataOp.type = OpTypeDataStore; dataOp.data = @@ -486,7 +486,7 @@ namespace GLFragment { addFetchOffsetVariables (BodyOp *op, int index, bool *indices, - CompString *data) + CompString *data) { if (op->type == OpTypeDataOffset) { @@ -780,7 +780,7 @@ namespace GLFragment { FunctionData::addColorOp (const char *dst, const char *src) { BodyOp b; - + b.type = OpTypeColor; b.dst = CompString (dst); b.src = CompString (src); @@ -793,12 +793,12 @@ namespace GLFragment { { BodyOp b; va_list ap; - + b.type = OpTypeData; va_start (ap, str); - b.data = compPrintf(str, ap); + b.data = compPrintf (str, ap); va_end (ap); - + priv->body.push_back (b); } @@ -807,12 +807,12 @@ namespace GLFragment { { BodyOp b; va_list ap; - + b.type = OpTypeDataBlend; va_start (ap, str); - b.data = compPrintf(str, ap); + b.data = compPrintf (str, ap); va_end (ap); - + priv->body.push_back (b); } @@ -824,7 +824,6 @@ namespace GLFragment { CompString validName = name; unsigned int i = 0; - while (findFragmentFunctionWithName (s, validName)) { validName = compPrintf ("%s%d", name, i++); diff --git a/plugins/opengl/src/matrix.cpp b/plugins/opengl/src/matrix.cpp index 2dc7d6f..656afef 100644 --- a/plugins/opengl/src/matrix.cpp +++ b/plugins/opengl/src/matrix.cpp @@ -113,7 +113,7 @@ GLMatrix::reset () memcpy (m, identity, sizeof (m)); } -const float * +const float * GLMatrix::getMatrix () const { return m; diff --git a/plugins/opengl/src/paint.cpp b/plugins/opengl/src/paint.cpp index 376cf4e..458fd4c 100644 --- a/plugins/opengl/src/paint.cpp +++ b/plugins/opengl/src/paint.cpp @@ -49,7 +49,7 @@ GLScreen::glApplyTransform (const GLScreenPaintAttrib &sAttrib, CompOutput *output, GLMatrix *transform) { - WRAPABLE_HND_FUNC(2, glApplyTransform, sAttrib, output, transform) + WRAPABLE_HND_FUNC (2, glApplyTransform, sAttrib, output, transform) transform->translate (sAttrib.xTranslate, sAttrib.yTranslate, @@ -119,7 +119,7 @@ PrivateGLScreen::paintBackground (const CompRegion ®ion, } glVertexPointer (2, GL_FLOAT, sizeof (GLfloat) * 2, data + 2); - + glColor4us (0, 0, 0, 0); glDrawArrays (GL_QUADS, 0, nBox * 4); glColor4usv (defaultColor); @@ -213,9 +213,7 @@ PrivateGLScreen::paintOutputRegion (const GLMatrix &transform, CompWindowList::reverse_iterator rit; unredirectFS = CompositeScreen::get (screen)-> - getOption("unredirect_fullscreen_windows")->value ().b (); - - + getOption ("unredirect_fullscreen_windows")->value ().b (); if (mask & PAINT_SCREEN_TRANSFORMED_MASK) { @@ -233,7 +231,7 @@ PrivateGLScreen::paintOutputRegion (const GLMatrix &transform, if (!(mask & PAINT_SCREEN_NO_OCCLUSION_DETECTION_MASK)) { /* detect occlusions */ - for (rit = pl.rbegin (); rit != pl.rend(); rit++) + for (rit = pl.rbegin (); rit != pl.rend (); rit++) { w = (*rit); gw = GLWindow::get (w); @@ -252,7 +250,7 @@ PrivateGLScreen::paintOutputRegion (const GLMatrix &transform, gw->priv->clip = tmpRegion; odMask = PAINT_WINDOW_OCCLUSION_DETECTION_MASK; - + if ((cScreen->windowPaintOffset ().x () != 0 || cScreen->windowPaintOffset ().x () != 0) && !w->onAllViewports ()) @@ -264,7 +262,7 @@ PrivateGLScreen::paintOutputRegion (const GLMatrix &transform, vTransform = transform; vTransform.translate (offXY.x (), offXY.y (), 0); - gw->priv->clip.translate (-offXY.x (), -offXY. y()); + gw->priv->clip.translate (-offXY.x (), -offXY. y ()); odMask |= PAINT_WINDOW_WITH_OFFSET_MASK; status = gw->glPaint (gw->paintAttrib (), vTransform, @@ -358,7 +356,7 @@ GLScreen::glEnableOutputClipping (const GLMatrix &transform, const CompRegion ®ion, CompOutput *output) { - WRAPABLE_HND_FUNC(3, glEnableOutputClipping, transform, region, output) + WRAPABLE_HND_FUNC (3, glEnableOutputClipping, transform, region, output) GLdouble h = screen->height (); @@ -397,7 +395,7 @@ GLScreen::glEnableOutputClipping (const GLMatrix &transform, void GLScreen::glDisableOutputClipping () { - WRAPABLE_HND_FUNC(4, glDisableOutputClipping) + WRAPABLE_HND_FUNC (4, glDisableOutputClipping) glDisable (GL_CLIP_PLANE0); glDisable (GL_CLIP_PLANE1); @@ -415,8 +413,8 @@ GLScreen::glPaintTransformedOutput (const GLScreenPaintAttrib &sAttrib, CompOutput *output, unsigned int mask) { - WRAPABLE_HND_FUNC(1, glPaintTransformedOutput, sAttrib, transform, - region, output, mask) + WRAPABLE_HND_FUNC (1, glPaintTransformedOutput, sAttrib, transform, + region, output, mask) GLMatrix sTransform = transform; @@ -462,8 +460,8 @@ GLScreen::glPaintOutput (const GLScreenPaintAttrib &sAttrib, CompOutput *output, unsigned int mask) { - WRAPABLE_HND_FUNC_RETURN(0, bool, glPaintOutput, sAttrib, transform, - region, output, mask) + WRAPABLE_HND_FUNC_RETURN (0, bool, glPaintOutput, sAttrib, transform, + region, output, mask) GLMatrix sTransform = transform; @@ -579,7 +577,7 @@ GLScreen::glPaintOutput (const GLScreenPaintAttrib &sAttrib, void GLWindow::glDrawGeometry () { - WRAPABLE_HND_FUNC(4, glDrawGeometry) + WRAPABLE_HND_FUNC (4, glDrawGeometry) int texUnit = priv->geometry.texUnits; int currentTexUnit = 0; @@ -624,7 +622,7 @@ GLWindow::glAddGeometry (const GLTexture::MatrixList &matrix, const CompRegion ®ion, const CompRegion &clip) { - WRAPABLE_HND_FUNC(2, glAddGeometry, matrix, region, clip) + WRAPABLE_HND_FUNC (2, glAddGeometry, matrix, region, clip) BoxRec full; int nMatrix = matrix.size (); @@ -1064,7 +1062,7 @@ GLWindow::glDrawTexture (GLTexture *texture, GLFragment::Attrib &attrib, unsigned int mask) { - WRAPABLE_HND_FUNC(3, glDrawTexture, texture, attrib, mask) + WRAPABLE_HND_FUNC (3, glDrawTexture, texture, attrib, mask) GLTexture::Filter filter; @@ -1090,7 +1088,8 @@ GLWindow::glDraw (const GLMatrix &transform, const CompRegion ®ion, unsigned int mask) { - WRAPABLE_HND_FUNC_RETURN(1, bool, glDraw, transform, fragment, region, mask) + WRAPABLE_HND_FUNC_RETURN (1, bool, glDraw, transform, + fragment, region, mask) const CompRegion reg = (mask & PAINT_WINDOW_TRANSFORMED_MASK) ? infiniteRegion : region; @@ -1108,7 +1107,7 @@ GLWindow::glDraw (const GLMatrix &transform, mask |= PAINT_WINDOW_BLEND_MASK; GLTexture::MatrixList ml (1); - + if (priv->textures.size () == 1) { ml[0] = priv->matrices[0]; @@ -1140,7 +1139,7 @@ GLWindow::glPaint (const GLWindowPaintAttrib &attrib, const CompRegion ®ion, unsigned int mask) { - WRAPABLE_HND_FUNC_RETURN(0, bool, glPaint, attrib, transform, region, mask) + WRAPABLE_HND_FUNC_RETURN (0, bool, glPaint, attrib, transform, region, mask) GLFragment::Attrib fragment (attrib); bool status; diff --git a/plugins/opengl/src/privates.h b/plugins/opengl/src/privates.h index 0d39907..3aebaf0 100644 --- a/plugins/opengl/src/privates.h +++ b/plugins/opengl/src/privates.h @@ -42,7 +42,7 @@ class GLIcon { public: GLIcon () : icon (NULL) {}; - + CompIcon *icon; GLTexture::List textures; }; @@ -135,7 +135,7 @@ class PrivateGLWindow : 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 (); @@ -148,9 +148,9 @@ class PrivateGLWindow : GLTexture::MatrixList matrices; CompRegion::Vector regions; bool updateReg; - + CompRegion clip; - + bool bindFailed; bool overlayWindow; diff --git a/plugins/opengl/src/screen.cpp b/plugins/opengl/src/screen.cpp index e15dc84..37d1833 100644 --- a/plugins/opengl/src/screen.cpp +++ b/plugins/opengl/src/screen.cpp @@ -624,7 +624,7 @@ frustum (GLfloat *m, c = -(farval + nearval) / ( farval - nearval); d = -(2.0 * farval * nearval) / (farval - nearval); -#define M(row,col) m[col*4+row] +#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; M(1,0) = 0.0f; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0f; M(2,0) = 0.0f; M(2,1) = 0.0f; M(2,2) = c; M(2,3) = d; @@ -998,7 +998,7 @@ PrivateGLScreen::paintOutputs (CompOutput::ptrList &outputs, r.height = output->height (); if (lastViewport.x != r.x || - lastViewport.y != r.y || + lastViewport.y != r.y || lastViewport.width != r.width || lastViewport.height != r.height) { @@ -1154,7 +1154,7 @@ GLScreen::defaultIcon () if (!i) return NULL; - + if (!i->width () || !i->height ()) return NULL; diff --git a/plugins/opengl/src/texture.cpp b/plugins/opengl/src/texture.cpp index 3e7b015..5728caa 100644 --- a/plugins/opengl/src/texture.cpp +++ b/plugins/opengl/src/texture.cpp @@ -296,6 +296,7 @@ PrivateTexture::loadImageData (const char *image, rv[0] = t; GLTexture::Matrix matrix = _identity_matrix; + CompOption *opt; GLint internalFormat; GLenum target; bool mipmap; @@ -324,9 +325,11 @@ PrivateTexture::loadImageData (const char *image, glBindTexture (target, t->name ()); - internalFormat = - (GLScreen::get(screen)->getOption ("texture_compression")->value ().b () - && GL::textureCompression ? GL_COMPRESSED_RGBA_ARB : GL_RGBA); + opt = GLScreen::get (screen)->getOption ("texture_compression"); + if (opt->value ().b () && GL::textureCompression) + internalFormat = GL_COMPRESSED_RGBA_ARB; + else + internalFormat = GL_RGBA; glTexImage2D (target, 0, internalFormat, width, height, 0, format, type, image); @@ -482,7 +485,7 @@ TfpTexture::bindPixmapToTexture (Pixmap pixmap, else if (config->textureTargets & GLX_TEXTURE_RECTANGLE_BIT_EXT) target = GLX_TEXTURE_RECTANGLE_EXT; - /* Workaround for broken texture from pixmap implementations, + /* Workaround for broken texture from pixmap implementations, that don't advertise any texture target in the fbconfig. */ if (!target) { diff --git a/plugins/opengl/src/window.cpp b/plugins/opengl/src/window.cpp index 52a4488..c822b51 100644 --- a/plugins/opengl/src/window.cpp +++ b/plugins/opengl/src/window.cpp @@ -32,7 +32,7 @@ GLWindow::GLWindow (CompWindow *w) : priv (new PrivateGLWindow (w, this)) { CompositeWindow *cw = CompositeWindow::get (w); - + priv->paint.opacity = cw->opacity (); priv->paint.brightness = cw->brightness (); priv->paint.saturation = cw->saturation (); @@ -78,7 +78,7 @@ PrivateGLWindow::setWindowMatrix () { if (textures.size () != matrices.size ()) matrices.resize (textures.size ()); - + for (unsigned int i = 0; i < textures.size (); i++) { matrices[i] = textures[i]->matrix (); @@ -206,7 +206,6 @@ PrivateGLWindow::windowNotify (CompWindowNotify n) break; default: break; - } window->windowNotify (n); @@ -321,7 +320,7 @@ GLWindow::getIcon (int width, int height) foreach (GLIcon &icon, priv->icons) if (icon.icon == i) return icon.textures[0]; - + icon.icon = i; icon.textures = GLTexture::imageBufferToTexture ((char *) i->data (), *i); diff --git a/plugins/place/src/place.cpp b/plugins/place/src/place.cpp index 6640950..33297a4 100644 --- a/plugins/place/src/place.cpp +++ b/plugins/place/src/place.cpp @@ -56,7 +56,7 @@ PlaceScreen::handleScreenSizeChange (int width, { if (!w->managed ()) continue; - + if (w->wmType () & (CompWindowTypeDockMask | CompWindowTypeDesktopMask)) continue; @@ -85,7 +85,7 @@ PlaceScreen::handleScreenSizeChange (int width, shiftX += width - x - extents.width (); if (y + extents.height () > height) shiftY += height - y - extents.height (); - + if (shiftX) { mask |= CWX; diff --git a/plugins/regex/src/regex.cpp b/plugins/regex/src/regex.cpp index f906ce3..ae7fd56 100644 --- a/plugins/regex/src/regex.cpp +++ b/plugins/regex/src/regex.cpp @@ -51,7 +51,7 @@ class RegexExp : public CompMatch::Expression Type type; unsigned int flags; } Prefix; - + static const Prefix prefix[]; Type mType; diff --git a/plugins/resize/src/resize.cpp b/plugins/resize/src/resize.cpp index 25a9837..8ac3f1b 100644 --- a/plugins/resize/src/resize.cpp +++ b/plugins/resize/src/resize.cpp @@ -81,10 +81,10 @@ ResizeScreen::getStretchRectangle (BoxPtr pBox) getPaintRectangle (&box); ResizeWindow::get (w)->getStretchScale (&box, &xScale, &yScale); - pBox->x1 = (int)(box.x1 - (w->output ().left - w->input ().left) * xScale); - pBox->y1 = (int)(box.y1 - (w->output ().top - w->input ().top) * yScale); - pBox->x2 = (int)(box.x2 + w->output ().right * xScale); - pBox->y2 = (int)(box.y2 + w->output ().bottom * yScale); + pBox->x1 = (int) (box.x1 - (w->output ().left - w->input ().left) * xScale); + pBox->y1 = (int) (box.y1 - (w->output ().top - w->input ().top) * yScale); + pBox->x2 = (int) (box.x2 + w->output ().right * xScale); + pBox->y2 = (int) (box.y2 + w->output ().bottom * yScale); } void @@ -170,7 +170,7 @@ ResizeScreen::updateWindowProperty () XChangeProperty (screen->dpy (), w->id (), resizeInformationAtom, XA_CARDINAL, 32, PropModeReplace, - (unsigned char*) data, 4); + (unsigned char*) data, 4); } void @@ -204,7 +204,7 @@ resizeInitiate (CompAction *action, RESIZE_SCREEN (screen); CompWindow::Geometry server = w->serverGeometry (); - + x = CompOption::getIntOptionNamed (options, "x", pointerX); y = CompOption::getIntOptionNamed (options, "y", pointerY); @@ -467,7 +467,7 @@ resizeTerminate (CompAction *action, } action->setState (action->state () & ~(CompAction::StateTermKey | - CompAction::StateTermButton)); + CompAction::StateTermButton)); return false; } @@ -787,7 +787,7 @@ ResizeScreen::handleEvent (XEvent *event) CompOption::TypeInt)); o.push_back (CompOption ("button", CompOption::TypeInt)); - + o[1].value ().set ((int) mods); o[2].value ().set ((int) event->xclient.data.l[0]); @@ -798,7 +798,7 @@ ResizeScreen::handleEvent (XEvent *event) o[5].value ().set ((int) (event->xclient.data.l[3] ? event->xclient.data.l[3] : -1)); - + resizeInitiate (&optionGetInitiateButton (), CompAction::StateInitButton, o); diff --git a/plugins/resize/src/resize.h b/plugins/resize/src/resize.h index e2eee68..f04ac63 100644 --- a/plugins/resize/src/resize.h +++ b/plugins/resize/src/resize.h @@ -116,7 +116,7 @@ class ResizeScreen : int pointerDx; int pointerDy; KeyCode key[NUM_KEYS]; - + CompScreen::GrabHandle grabIndex; Cursor leftCursor; @@ -140,7 +140,7 @@ class ResizeWindow : public: ResizeWindow (CompWindow *w); ~ResizeWindow (); - + void resizeNotify (int, int, int, int); bool damageRect (bool, const CompRect &); @@ -150,9 +150,7 @@ class ResizeWindow : void getStretchScale (BoxPtr pBox, float *xScale, float *yScale); - public: - CompWindow *window; GLWindow *gWindow; CompositeWindow *cWindow; diff --git a/plugins/scale/include/scale/scale.h b/plugins/scale/include/scale/scale.h index f31fe71..85d11c5 100644 --- a/plugins/scale/include/scale/scale.h +++ b/plugins/scale/include/scale/scale.h @@ -76,7 +76,7 @@ class ScaleScreen : WRAPABLE_HND (0, ScaleScreenInterface, bool, layoutSlotsAndAssignWindows) - + friend class ScaleWindow; friend class PrivateScaleScreen; friend class PrivateScaleWindow; @@ -112,11 +112,11 @@ class ScaleWindow : WRAPABLE_HND (1, ScaleWindowInterface, bool, setScaledPaintAttributes, GLWindowPaintAttrib &) WRAPABLE_HND (2, ScaleWindowInterface, void, scaleSelectWindow) - + friend class ScaleScreen; friend class PrivateScaleScreen; friend class PrivateScaleWindow; - + private: PrivateScaleWindow *priv; }; diff --git a/plugins/scale/src/privates.h b/plugins/scale/src/privates.h index a0e65c3..8ef94b0 100644 --- a/plugins/scale/src/privates.h +++ b/plugins/scale/src/privates.h @@ -169,16 +169,15 @@ class PrivateScaleWindow : bool adjustScaleVelocity (); static bool compareWindowsDistance (ScaleWindow *, ScaleWindow *); - - public: + public: CompWindow *window; CompositeWindow *cWindow; GLWindow *gWindow; ScaleWindow *sWindow; ScaleScreen *sScreen; PrivateScaleScreen *spScreen; - + ScaleSlot *slot; int sid; diff --git a/plugins/scale/src/scale.cpp b/plugins/scale/src/scale.cpp index 0615fd1..e3accee 100644 --- a/plugins/scale/src/scale.cpp +++ b/plugins/scale/src/scale.cpp @@ -38,11 +38,6 @@ #define EDGE_STATE (CompAction::StateInitEdge) -#define WIN_X(w) ((w)->attrib.x - (w)->input.left) -#define WIN_Y(w) ((w)->attrib.y - (w)->input.top) -#define WIN_W(w) ((w)->width + (w)->input.left + (w)->input.right) -#define WIN_H(w) ((w)->height + (w)->input.top + (w)->input.bottom) - class ScalePluginVTable : public CompPlugin::VTableForScreenAndWindow<ScaleScreen, ScaleWindow> { @@ -134,7 +129,7 @@ ScaleWindow::scalePaintDecoration (const GLWindowPaintAttrib& attrib, const CompRegion& region, unsigned int mask) { - WRAPABLE_HND_FUNC(0, scalePaintDecoration, attrib, transform, region, mask) + WRAPABLE_HND_FUNC (0, scalePaintDecoration, attrib, transform, region, mask) if (priv->spScreen->optionGetOverlayIcon () != ScaleOptions::OverlayIconNone) { @@ -230,12 +225,12 @@ ScaleWindow::scalePaintDecoration (const GLWindowPaintAttrib& attrib, GLTexture::MatrixList ml (1); ml[0] = icon->matrix (); - priv->gWindow->geometry().reset (); + priv->gWindow->geometry ().reset (); if (width && height) priv->gWindow->glAddGeometry (ml, iconReg, iconReg); - if (priv->gWindow->geometry().vCount) + if (priv->gWindow->geometry ().vCount) { GLFragment::Attrib fragment (sAttrib); GLMatrix wTransform (transform); @@ -285,7 +280,7 @@ ScaleWindow::setScaledPaintAttributes (GLWindowPaintAttrib& attrib) attrib.brightness = attrib.brightness / 2; } - /* hide windows on the outputs used for scaling + /* hide windows on the outputs used for scaling that are not in scale mode */ if (!priv->isNeverScaleWin ()) { @@ -490,7 +485,7 @@ PrivateScaleScreen::layoutSlots () moMode = optionGetMultioutputMode (); - /* if we have only one head, we don't need the + /* if we have only one head, we don't need the additional effort of the all outputs mode */ if (screen->outputDevs ().size () == 1) moMode = ScaleOptions::MultioutputModeOnCurrentOutputDevice; @@ -950,7 +945,7 @@ PrivateScaleScreen::scaleTerminate (CompAction *action, if (::screen->activeWindow () != ss->priv->previousActiveWindow) { CompWindow *w; - + w = ::screen->findWindow (ss->priv->previousActiveWindow); if (w) w->moveInputFocusTo (); @@ -1045,7 +1040,6 @@ PrivateScaleScreen::scaleInitiateCommon (CompAction *action, if (match.isEmpty ()) match = optionGetWindowMatch (); - /* TODO: match.update() ? */ currentMatch = match; if (!layoutThumbs ()) @@ -1110,7 +1104,7 @@ ScaleWindowInterface::scaleSelectWindow () void ScaleWindow::scaleSelectWindow () { - WRAPABLE_HND_FUNC(2, scaleSelectWindow) + WRAPABLE_HND_FUNC (2, scaleSelectWindow) if (priv->spScreen->selectedWindow != priv->window->id ()) { @@ -1249,7 +1243,7 @@ ScaleScreen::relayoutSlots (const CompMatch& match) priv->state = ScaleScreen::Out; priv->moveFocusWindow (0, 0); } - + priv->cScreen->damageScreen (); } @@ -1314,7 +1308,7 @@ PrivateScaleScreen::hoverTimeout () o.push_back (CompOption ("root", CompOption::TypeInt)); o[0].value ().set ((int) screen->root ()); - + scaleTerminate (&optionGetInitiateEdge (), 0, o); scaleTerminate (&optionGetInitiateKey (), 0, o); } diff --git a/plugins/switcher/src/switcher.cpp b/plugins/switcher/src/switcher.cpp index e645d40..647c879 100644 --- a/plugins/switcher/src/switcher.cpp +++ b/plugins/switcher/src/switcher.cpp @@ -481,16 +481,12 @@ SwitchScreen::initiate (SwitchWindowSelection selection, { CompWindow *w; - w = screen->findWindow (popupWindow); if (w && (w->state () & CompWindowStateHiddenMask)) - { w->unminimize (); - } else - { XMapWindow (screen->dpy (), popupWindow); - } + setSelectedWindowHint (); } @@ -669,7 +665,7 @@ SwitchScreen::windowRemove (Window id) it++; if (it == windows.end ()) selected = windows.front ()->id (); - else + else selected = (*it)->id (); it--; } diff --git a/plugins/switcher/src/switcher.h b/plugins/switcher/src/switcher.h index cb895a4..f9a53e6 100644 --- a/plugins/switcher/src/switcher.h +++ b/plugins/switcher/src/switcher.h @@ -60,7 +60,6 @@ class SwitchScreen : public SwitcherOptions { public: - SwitchScreen (CompScreen *screen); ~SwitchScreen (); diff --git a/plugins/water/src/water.cpp b/plugins/water/src/water.cpp index 19b8330..08fffeb 100644 --- a/plugins/water/src/water.cpp +++ b/plugins/water/src/water.cpp @@ -310,7 +310,7 @@ WaterScreen::fboEpilogue () glLoadIdentity (); glDepthRange (0, 1); glViewport (-1, -1, 2, 2); - + gScreen->resetRasterPos (); gScreen->setDefaultViewport (); @@ -868,7 +868,7 @@ WaterWindow::glDrawTexture (GLTexture *texture, GL::programEnvParameter4f (GL_FRAGMENT_PROGRAM_ARB, param, texture->matrix ().yy * - wScreen->offsetScale, + wScreen->offsetScale, -texture->matrix ().xx * wScreen->offsetScale, 0.0f, 0.0f); diff --git a/plugins/water/src/water.h b/plugins/water/src/water.h index 4172034..567a0d3 100644 --- a/plugins/water/src/water.h +++ b/plugins/water/src/water.h @@ -73,7 +73,6 @@ class WaterScreen : public WaterOptions { public: - WaterScreen (CompScreen *screen); ~WaterScreen (); @@ -109,7 +108,7 @@ class WaterScreen : bool wiperTimeout (); void waterReset (); - + void handleMotionEvent (); CompositeScreen *cScreen; diff --git a/plugins/zoom/src/zoom.h b/plugins/zoom/src/zoom.h index 90e4449..e040da3 100644 --- a/plugins/zoom/src/zoom.h +++ b/plugins/zoom/src/zoom.h @@ -57,7 +57,7 @@ class ZoomScreen : public ZoomOptions { public: - + ZoomScreen (CompScreen *screen); ~ZoomScreen (); |