summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-20 13:04:51 +0000
committerracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-20 13:04:51 +0000
commitaea1260fe1f24db794bec30f8ad34be6bc54bb2e (patch)
treeae1a2cb9e6156a8a0b164c72ad0763d53e5a3e9d
parent752acefaf60969e1c8603fb119bb4eacbd01027c (diff)
downloadmarex-dev-aea1260fe1f24db794bec30f8ad34be6bc54bb2e.tar.gz
marex-dev-aea1260fe1f24db794bec30f8ad34be6bc54bb2e.tar.bz2
Run indent.sh on beryl-plugins
git-svn-id: file:///beryl/trunk@1945 d7aaf104-2d23-0410-ae22-9d23157bf5a3
-rw-r--r--beryl-plugins/src/blurfx.c2
-rw-r--r--beryl-plugins/src/clone.c2
-rw-r--r--beryl-plugins/src/group.c4
-rw-r--r--beryl-plugins/src/place.c57
-rw-r--r--beryl-plugins/src/plane.c120
-rw-r--r--beryl-plugins/src/put.c7
-rw-r--r--beryl-plugins/src/rotate.c6
-rw-r--r--beryl-plugins/src/scale.c2
-rw-r--r--beryl-plugins/src/snow.c76
9 files changed, 149 insertions, 127 deletions
diff --git a/beryl-plugins/src/blurfx.c b/beryl-plugins/src/blurfx.c
index 59abeef..e53183f 100644
--- a/beryl-plugins/src/blurfx.c
+++ b/beryl-plugins/src/blurfx.c
@@ -4707,7 +4707,7 @@ loadPngToTexture2D (CompScreen * s, BlurTexture * tex, char *filename)
float Y, R, G, B;
int pix;
- BLURFX_SCREEN(s);
+ BLURFX_SCREEN (s);
if (strlen (filename) == 0)
return;
diff --git a/beryl-plugins/src/clone.c b/beryl-plugins/src/clone.c
index e9e07be..6a550dd 100644
--- a/beryl-plugins/src/clone.c
+++ b/beryl-plugins/src/clone.c
@@ -819,7 +819,7 @@ static void
cloneFiniScreen (CompPlugin * p, CompScreen * s)
{
CLONE_SCREEN (s);
-
+
UNWRAP (cs, s, preparePaintScreen);
UNWRAP (cs, s, donePaintScreen);
diff --git a/beryl-plugins/src/group.c b/beryl-plugins/src/group.c
index 18ca570..e5b1706 100644
--- a/beryl-plugins/src/group.c
+++ b/beryl-plugins/src/group.c
@@ -1335,7 +1335,7 @@ groupHandleEvent (CompDisplay * d, XEvent * event)
GROUP_SCREEN (w->screen);
if (gw->inGroup &&
- !screenGrabExist(w->screen, "scale", 0) &&
+ !screenGrabExist (w->screen, "scale", 0) &&
gs->opt[GROUP_SCREEN_OPTION_RAISE].value.b)
{
groupRaiseWindows (d, w, gw->groupID);
@@ -1364,7 +1364,7 @@ groupWindowMoveNotify (CompWindow * w, int dx, int dy, Bool immediate)
(*w->screen->windowMoveNotify) (w, dx, dy, immediate);
WRAP (gs, w->screen, windowMoveNotify, groupWindowMoveNotify);
- if (gw->inGroup && screenGrabExist(w->screen, "move", 0) &&
+ if (gw->inGroup && screenGrabExist (w->screen, "move", 0) &&
gs->opt[GROUP_SCREEN_OPTION_MOVE].value.b && !gd->ignoreMode)
{
int index = groupFindGroupAtDisplay (gd, gw->groupID);
diff --git a/beryl-plugins/src/place.c b/beryl-plugins/src/place.c
index e23c240..666f948 100644
--- a/beryl-plugins/src/place.c
+++ b/beryl-plugins/src/place.c
@@ -573,20 +573,21 @@ placeIntelligent (CompWindow * w, int *x, int *y, GList * windows)
XRectangle wRect = RECTANGLE_FROM_WINDOW (w);
XRectangle sRect = { 0, 0, 0, 0 };
wRect.height += w->serverBorderWidth;
- int wIter = wRect.width/10;
- int hIter = wRect.height/10;
+ int wIter = wRect.width / 10;
+ int hIter = wRect.height / 10;
CompScreen *screen = w->screen;
get_workarea_of_current_output_device (screen, &sRect);
- placeCentered(w,x,y);
- XRectangle cRect = {*x,*y,wRect.width,wRect.height};
- if (!rectangle_overlaps_some_window(&cRect,windows)) return; /*If it fits place it in the center */
-
+ placeCentered (w, x, y);
+ XRectangle cRect = { *x, *y, wRect.width, wRect.height };
+ if (!rectangle_overlaps_some_window (&cRect, windows))
+ return; /*If it fits place it in the center */
+
int xi;
int yi;
- thisisdisgusting:
+ thisisdisgusting:
for (xi = 0; xi < (sRect.width - sRect.x); xi += 10)
{
@@ -597,29 +598,33 @@ placeIntelligent (CompWindow * w, int *x, int *y, GList * windows)
if (!rectangle_overlaps_some_window (&wRect, windows))
{
-
- if ( !((wRect.width > sRect.width/2) && ((wRect.width+w->serverX > sRect.width) || (wRect.height+w->serverY > sRect.height)) ) )
+
+ if (!
+ ((wRect.width > sRect.width / 2)
+ && ((wRect.width + w->serverX > sRect.width)
+ || (wRect.height + w->serverY > sRect.height))))
*x = xi;
- *y = yi;
- return;
-
+ *y = yi;
+ return;
+
}
}
}
- /* No fit and big window? Center it, that tends to be what people expect */
- if (tries == 0 && wRect.width > ( sRect.width/2 ) )
- {
- placeCentered(w,x,y);
- return;
- }
- /* Would the window fit if it was smaller ? */
- if(tries < 10 && wRect.width>0 && wRect.height>0) {
- tries++;
- wRect.width-=wIter;
- wRect.height-=hIter;
- goto thisisdisgusting;
- }
- placeCentered(w,x,y);
+ /* No fit and big window? Center it, that tends to be what people expect */
+ if (tries == 0 && wRect.width > (sRect.width / 2))
+ {
+ placeCentered (w, x, y);
+ return;
+ }
+ /* Would the window fit if it was smaller ? */
+ if (tries < 10 && wRect.width > 0 && wRect.height > 0)
+ {
+ tries++;
+ wRect.width -= wIter;
+ wRect.height -= hIter;
+ goto thisisdisgusting;
+ }
+ placeCentered (w, x, y);
}
static gint
diff --git a/beryl-plugins/src/plane.c b/beryl-plugins/src/plane.c
index e6fb605..411c70d 100644
--- a/beryl-plugins/src/plane.c
+++ b/beryl-plugins/src/plane.c
@@ -110,7 +110,7 @@ typedef struct _PlaneScreen
SetScreenOptionForPluginProc setScreenOptionForPlugin;
WindowGrabNotifyProc windowGrabNotify;
WindowUngrabNotifyProc windowUngrabNotify;
-
+
CompTimeoutHandle timeout_handle;
int timer;
int preview;
@@ -321,31 +321,34 @@ planePaintTransformedScreen (CompScreen * screen,
{
PLANE_SCREEN (screen);
static Bool notfirst;
- if (!notfirst){
- ps->initZoom=sAttrib->zCamera;
- notfirst = TRUE;
- }
+ if (!notfirst)
+ {
+ ps->initZoom = sAttrib->zCamera;
+
+ }
UNWRAP (ps, screen, paintTransformedScreen);
- static float zsane;
mask &= ~PAINT_SCREEN_CLEAR_MASK;
- if (ps->preview && !ps->timeout_handle){
-
- ScreenPaintAttrib sa = *sAttrib;
- (*screen->paintTransformedScreen) (screen,
- &sa,
- region, output, mask);
- sa.zCamera = -1.5;
-
- (*screen->paintTransformedScreen) (screen,
- &sa,
- region, output, mask);
- WRAP (ps, screen, paintTransformedScreen, planePaintTransformedScreen);
- return;
-
- } else {zsane=sAttrib->zCamera;}
- glPushMatrix();
-
- if (mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK)
+ if (ps->preview && !ps->timeout_handle)
+ {
+
+ ScreenPaintAttrib sa = *sAttrib;
+ (*screen->paintTransformedScreen) (screen, &sa, region, output, mask);
+ if (sa.zCamera != ps->initZoom)
+ {
+ sa.zCamera = -1.5;
+
+ (*screen->paintTransformedScreen) (screen,
+ &sa, region, output, mask);
+ WRAP (ps, screen, paintTransformedScreen,
+ planePaintTransformedScreen);
+ return;
+
+ }
+
+ }
+ glPushMatrix ();
+
+ if (mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK)
glClear (GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
else
glClear (GL_COLOR_BUFFER_BIT);
@@ -431,19 +434,27 @@ planePaintTransformedScreen (CompScreen * screen,
#endif
glPushMatrix ();
- ScreenPaintAttrib *sa = sAttrib;
- if (ps->preview) {sa->zCamera = -2;}
- else {sa->zCamera = ps->initZoom;}
- sAttrib=sa;
+ ScreenPaintAttrib *sa = sAttrib;
+ if (ps->preview)
+ {
+ sa->zCamera = -2;
+ }
+ else
+ {
+ sa->zCamera = ps->initZoom;
+ }
+ sAttrib = sa;
glTranslatef (dx, -dy, 0.0);
(*screen->paintTransformedScreen) (screen, sAttrib, region,
output, mask);
- float s1=1.05;float s2=-1.05;
- if (!ps->preview){
- s1=1;
- s2=-1;
- }
-
+ float s1 = 1.05;
+ float s2 = -1.05;
+ if (!ps->preview)
+ {
+ s1 = 1;
+ s2 = -1;
+ }
+
if (dx > 0)
{
glTranslatef (s2, 0.0, 0.0);
@@ -512,7 +523,7 @@ planePaintTransformedScreen (CompScreen * screen,
}
}
}
-
+ notfirst = TRUE;
WRAP (ps, screen, paintTransformedScreen, planePaintTransformedScreen);
glPopMatrix ();
@@ -753,24 +764,26 @@ planeDown (CompDisplay * d,
}
static Bool
-planePreview (CompDisplay *d, CompAction *action, CompActionState state, CompOption *option, int n_options)
+planePreview (CompDisplay * d, CompAction * action, CompActionState state,
+ CompOption * option, int n_options)
{
- static int xView;
- static int yView;
-
- CompScreen *screen = get_screen(d,option,n_options);
- PLANE_SCREEN(screen);
- if (!ps->preview){
- xView = screen->x/screen->width;
- yView = screen->y/screen->height;
- }
- ps->preview = !ps->preview;
- /*if (!ps->preview){
- moveScreenViewport(screen,xView,yView,TRUE);
- } */
- damageScreen(screen);
-
- return FALSE;
+ static int xView;
+ static int yView;
+
+ CompScreen *screen = get_screen (d, option, n_options);
+ PLANE_SCREEN (screen);
+ if (!ps->preview)
+ {
+ xView = screen->x / screen->width;
+ yView = screen->y / screen->height;
+ }
+ ps->preview = !ps->preview;
+ /*if (!ps->preview){
+ moveScreenViewport(screen,xView,yView,TRUE);
+ } */
+ damageScreen (screen);
+
+ return FALSE;
}
static Bool
@@ -1073,7 +1086,8 @@ planeFiniScreen (CompPlugin * p, CompScreen * s)
removeScreenAction (s, &pd->opt[PLANE_DISPLAY_OPTION_RIGHT].value.action);
removeScreenAction (s, &pd->opt[PLANE_DISPLAY_OPTION_DOWN].value.action);
removeScreenAction (s, &pd->opt[PLANE_DISPLAY_OPTION_UP].value.action);
- removeScreenAction(s, &pd->opt[PLANE_DISPLAY_OPTION_PREVIEW].value.action);
+ removeScreenAction (s,
+ &pd->opt[PLANE_DISPLAY_OPTION_PREVIEW].value.action);
removeScreenAction (s, &pd->opt[PLANE_DISPLAY_OPTION_TO_1].value.action);
removeScreenAction (s, &pd->opt[PLANE_DISPLAY_OPTION_TO_2].value.action);
removeScreenAction (s, &pd->opt[PLANE_DISPLAY_OPTION_TO_3].value.action);
diff --git a/beryl-plugins/src/put.c b/beryl-plugins/src/put.c
index 9988e60..8c59fc7 100644
--- a/beryl-plugins/src/put.c
+++ b/beryl-plugins/src/put.c
@@ -375,9 +375,10 @@ putScreenInitOptions (PutScreen * ps)
o->group = N_("");
o->subGroup = N_("");
o->displayHints = "";
- o->shortDesc =
- N_("Right side padding");
- o->longDesc = N_("Number of pixels from the right edge where the active window will come to rest");
+ o->shortDesc = N_("Right side padding");
+ o->longDesc =
+ N_
+ ("Number of pixels from the right edge where the active window will come to rest");
o->type = CompOptionTypeInt;
o->value.i = PUT_RIGHT_PAD_DEFAULT;
o->rest.i.min = PUT_RIGHT_PAD_MIN;
diff --git a/beryl-plugins/src/rotate.c b/beryl-plugins/src/rotate.c
index a2f30d4..4fcb7fa 100644
--- a/beryl-plugins/src/rotate.c
+++ b/beryl-plugins/src/rotate.c
@@ -1080,9 +1080,9 @@ rotateInitiateDesktop (CompDisplay * d,
CompActionState state, CompOption * option,
int nOption)
{
- CompScreen *s =
- findScreenAtDisplay (d,
- getIntOptionNamed (option, nOption, "root", 0));
+ CompScreen *s = findScreenAtDisplay (d,
+ getIntOptionNamed (option, nOption,
+ "root", 0));
if (s)
{
int x, y;
diff --git a/beryl-plugins/src/scale.c b/beryl-plugins/src/scale.c
index 3b59c7b..3ec855c 100644
--- a/beryl-plugins/src/scale.c
+++ b/beryl-plugins/src/scale.c
@@ -1947,7 +1947,7 @@ zoomWindow (CompScreen * s, CompWindow * w)
}
else
{
- restackWindowAbove(w,s->windows); // TODO make sure this is right
+ restackWindowAbove (w, s->windows); // TODO make sure this is right
sw->rescaled = FALSE;
sw->scale = sw->oldScale;
sw->slot->x1 = sw->origX;
diff --git a/beryl-plugins/src/snow.c b/beryl-plugins/src/snow.c
index 6976649..954179b 100644
--- a/beryl-plugins/src/snow.c
+++ b/beryl-plugins/src/snow.c
@@ -198,11 +198,11 @@ snowThink (SnowScreen * ss, SnowFlake * sf)
static void
snowMove (SnowFlake * sf)
{
- float tmp = 1.0f / (100.0f - snowSpeed);
- sf->x += (sf->xs * (float)snowUpdateDelay) * tmp;
- sf->y += (sf->ys * (float)snowUpdateDelay) * tmp;
- sf->z += (sf->zs * (float)snowUpdateDelay) * tmp;
- sf->ra += ((float)snowUpdateDelay) / (10.0f - sf->rs);
+ float tmp = 1.0f / (100.0f - snowSpeed);
+ sf->x += (sf->xs * (float)snowUpdateDelay) * tmp;
+ sf->y += (sf->ys * (float)snowUpdateDelay) * tmp;
+ sf->z += (sf->zs * (float)snowUpdateDelay) * tmp;
+ sf->ra += ((float)snowUpdateDelay) / (10.0f - sf->rs);
}
static Bool
@@ -214,9 +214,9 @@ stepSnowPositions (void *sc)
return True;
int i = 0;
- SnowFlake *snowFlake = ss->allSnowFlakes;
- for (i = 0; i < numFlakes; i++)
- snowThink(ss, snowFlake++);
+ SnowFlake *snowFlake = ss->allSnowFlakes;
+ for (i = 0; i < numFlakes; i++)
+ snowThink (ss, snowFlake++);
if (ss->active && !onTop)
{
@@ -329,34 +329,35 @@ beginRendering (SnowScreen * ss, CompScreen * s, int output)
COMP_TEXTURE_FILTER_GOOD);
int i = 0;
- SnowFlake *snowFlake = ss->allSnowFlakes;
- for (i = 0; i < numFlakes; i++)
- {
- if (snowFlake->tex == &ss->snowTex[j])
- {
- glTranslatef(snowFlake->x, snowFlake->y, snowFlake->z);
- glRotatef(snowFlake->ra, 0, 0, 1);
- glCallList(ss->snowTex[j].dList);
- glRotatef(-snowFlake->ra, 0, 0, 1);
- glTranslatef(-snowFlake->x, -snowFlake->y, -snowFlake->z);
- }
- snowFlake++;
+ SnowFlake *snowFlake = ss->allSnowFlakes;
+ for (i = 0; i < numFlakes; i++)
+ {
+ if (snowFlake->tex == &ss->snowTex[j])
+ {
+ glTranslatef (snowFlake->x, snowFlake->y, snowFlake->z);
+ glRotatef (snowFlake->ra, 0, 0, 1);
+ glCallList (ss->snowTex[j].dList);
+ glRotatef (-snowFlake->ra, 0, 0, 1);
+ glTranslatef (-snowFlake->x, -snowFlake->y,
+ -snowFlake->z);
+ }
+ snowFlake++;
}
- disableTexture (ss->s, &ss->snowTex[j].tex);
+ disableTexture (ss->s, &ss->snowTex[j].tex);
}
}
else if (!ss->snowTexturesLoaded || !useTextures)
{
int i = 0;
- SnowFlake *snowFlake = ss->allSnowFlakes;
- for (i = 0; i < numFlakes; i++)
- {
- glTranslatef(snowFlake->x, snowFlake->y, snowFlake->z);
- glRotatef(snowFlake->ra, 0, 0, 1);
- glCallList(ss->displayList);
- glRotatef(-snowFlake->ra, 0, 0, 1);
- glTranslatef(-snowFlake->x, -snowFlake->y, -snowFlake->z);
- snowFlake++;
+ SnowFlake *snowFlake = ss->allSnowFlakes;
+ for (i = 0; i < numFlakes; i++)
+ {
+ glTranslatef (snowFlake->x, snowFlake->y, snowFlake->z);
+ glRotatef (snowFlake->ra, 0, 0, 1);
+ glCallList (ss->displayList);
+ glRotatef (-snowFlake->ra, 0, 0, 1);
+ glTranslatef (-snowFlake->x, -snowFlake->y, -snowFlake->z);
+ snowFlake++;
}
}
@@ -517,10 +518,10 @@ updateSnowTextures (CompScreen * s)
if (count < sd->snowTexNFiles)
ss->snowTex = realloc (ss->snowTex, sizeof (SnowTexture) * count);
- SnowFlake *snowFlake = ss->allSnowFlakes;
+ SnowFlake *snowFlake = ss->allSnowFlakes;
for (i = 0; i < MAX_SNOWFLAKES; i++)
{
- setSnowflakeTexture(ss, snowFlake++);
+ setSnowflakeTexture (ss, snowFlake++);
}
}
@@ -534,12 +535,12 @@ snowInitScreen (CompPlugin * p, CompScreen * s)
s->privates[sd->screenPrivateIndex].ptr = ss;
int i = 0;
- SnowFlake *snowFlake = ss->allSnowFlakes;
+ SnowFlake *snowFlake = ss->allSnowFlakes;
for (i = 0; i < MAX_SNOWFLAKES; i++)
{
- InitiateSnowFlake(ss, snowFlake);
- setSnowflakeTexture(ss, snowFlake);
- snowFlake++;
+ InitiateSnowFlake (ss, snowFlake);
+ setSnowflakeTexture (ss, snowFlake);
+ snowFlake++;
}
updateSnowTextures (s);
@@ -854,7 +855,8 @@ snowDisplayInitOptions (SnowDisplay * sd)
o->displayHints = "";
o->shortDesc = N_("Enable Textures");
o->longDesc =
- N_( "Enables textured snowflakes. Otherwise color gradients are used.");
+ N_
+ ("Enables textured snowflakes. Otherwise color gradients are used.");
o->type = CompOptionTypeBool;
o->value.b = SNOW_DISPLAY_OPTION_USE_TEXTURES_DEFAULT;
}