summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/miniview.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 00:43:33 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 00:43:33 +0000
commit0ab00e046951ad9b6263c8fb0ede3effa86d222d (patch)
treeaf3675da1e41d63d136e72824326d2a0c358bb7b /beryl-plugins/src/miniview.c
parent104ed8ebe6ebeed3e48c8b1269a23e36928aacc8 (diff)
downloadmarex-dev-0ab00e046951ad9b6263c8fb0ede3effa86d222d.tar.gz
marex-dev-0ab00e046951ad9b6263c8fb0ede3effa86d222d.tar.bz2
beryl-(core|plugins): moved matrix transformations out of gl (David Reveman)
- group not ported yet - blurfx has bugs but this will be fixed in a rewrite all other plugins should work git-svn-id: file:///beryl/trunk@4005 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/miniview.c')
-rw-r--r--beryl-plugins/src/miniview.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/beryl-plugins/src/miniview.c b/beryl-plugins/src/miniview.c
index 6342b95..5027a32 100644
--- a/beryl-plugins/src/miniview.c
+++ b/beryl-plugins/src/miniview.c
@@ -71,12 +71,12 @@ typedef struct _MiniviewScreen
int miniViewportY;
int moveStep;
float zCam;
-
-
+
+
float size;
- Bool moving;
-
+ Bool moving;
+
int grabIndex;
@@ -98,8 +98,8 @@ typedef struct _MiniviewScreen
static void miniviewHandleEvent(CompDisplay * d, XEvent * event)
{
MINIVIEW_DISPLAY(d);
-
- CompScreen *s;
+
+ CompScreen *s;
switch (event->type)
{
default:
@@ -107,7 +107,7 @@ static void miniviewHandleEvent(CompDisplay * d, XEvent * event)
}
UNWRAP(md,d,handleEvent);
(*d->handleEvent)(d,event);
- WRAP(md,d,handleEvent,miniviewHandleEvent);
+ WRAP(md,d,handleEvent,miniviewHandleEvent);
}
static Bool miniviewCreate(CompDisplay * d, CompAction * action,
@@ -168,6 +168,7 @@ static Bool miniviewHide(CompDisplay * d, CompAction * action,
static Bool miniviewPaintScreen(CompScreen * s,
const ScreenPaintAttrib * sAttrib,
+ const CompTransform *transform,
Region region, int output, unsigned int mask)
{
Bool status;
@@ -178,7 +179,7 @@ static Bool miniviewPaintScreen(CompScreen * s,
mask |= PAINT_SCREEN_TRANSFORMED_MASK;
}
UNWRAP(ms, s, paintScreen);
- status = (*s->paintScreen) (s, sAttrib, region, output, mask);
+ status = (*s->paintScreen) (s, sAttrib, transform, region, output, mask);
WRAP(ms, s, paintScreen, miniviewPaintScreen);
return status;
@@ -198,10 +199,10 @@ static void miniviewPreparePaintScreen(CompScreen *s, int ICouldCareLess)
XQueryPointer(s->display->display, s->root,
&root_return, &child_return,
&rootX, &rootY, &winX, &winY, &mask_return);
-
+
ms->miniX = rootX;
ms->miniY = rootY;
-
+
}
UNWRAP(ms,s,preparePaintScreen);
(*s->preparePaintScreen) (s,ICouldCareLess);
@@ -210,40 +211,40 @@ static void miniviewPreparePaintScreen(CompScreen *s, int ICouldCareLess)
static void miniviewPaintTransformedScreen(CompScreen * s,
const ScreenPaintAttrib * sAttrib,
+ const CompTransform *transform,
Region region, int output,
unsigned int mask)
{
MINIVIEW_SCREEN(s);
-
+
UNWRAP(ms, s, paintTransformedScreen);
- (*s->paintTransformedScreen) (s, sAttrib, region, output, mask);
+ (*s->paintTransformedScreen) (s, sAttrib, transform, region, output, mask);
if (ms->showing )
{
//mask &= PAINT_SCREEN_TRANSFORMED_MASK;
int oldFilter = s->display->textureFilter;
s->display->textureFilter = GL_LINEAR_MIPMAP_LINEAR;
- glPushMatrix();
if (ms->zCam > -ms->size)
ms->zCam -= .075;
-
+ CompTransform sTransform = *transform;
ScreenPaintAttrib * sa = sAttrib;
-
- glScalef(1.0f,1.0f,1.0f*-ms->zCam);
- glTranslatef(-1.0,1.0,0);
+
+ matrixScale(&sTransform, 1.0f,1.0f,1.0f*-ms->zCam);
+ matrixTranslate(&sTransform, -1.0,1.0,0);
float compensation;
compensation = ms->size - 2.0f;
compensation /= 2;
- glTranslatef(-compensation,compensation,0);
-
+ matrixTranslate(&sTransform, -compensation,compensation,0);
+
if (ms->moveStep <= 0.95)
ms->moveStep += 0.05;
- glTranslatef((1/((float)s->width/(float)ms->miniX)*-ms->zCam),
+ matrixTranslate(&sTransform, (1/((float)s->width/(float)ms->miniX)*-ms->zCam),
(-1/((float)s->height/(float)ms->miniY)*-ms->zCam),
- 0);
+ 0);
int move = 0;
int ymove = 0;
@@ -257,12 +258,11 @@ static void miniviewPaintTransformedScreen(CompScreen * s,
moveScreenViewport(s,0,1,FALSE);
ymove++;
}
- (*s->paintTransformedScreen) (s, sa, &s->region, output, mask);
+ (*s->paintTransformedScreen) (s, sa, &sTransform, &s->region, output, mask);
s->display->textureFilter = oldFilter;
moveScreenViewport(s,-move,-ymove,FALSE);
- glPopMatrix();
}
@@ -276,8 +276,8 @@ static void miniviewDonePaintScreen(CompScreen * s)
if (ms->showing)
damageScreen(s);
-
-
+
+
UNWRAP(ms, s, donePaintScreen);
(*s->donePaintScreen) (s);
@@ -344,7 +344,7 @@ static void miniviewDisplayInitOptions(MiniviewDisplay * md)
//o->value.action.key.keysym = XStringToKeysym(MINIVIEW_MOVE_KEY_DEFAULT);
o->value.action.button.modifiers = MINIVIEW_MOVE_MODIFIERS_DEFAULT;
o->value.action.button.button = MINIVIEW_MOVE_KEY_DEFAULT;
-
+
}
static CompOption *miniviewGetDisplayOptions(CompDisplay * d, int *count)