Exemplo n.º 1
0
static void
thumbPaintTransformedOutput (CompScreen              *s,
                             const ScreenPaintAttrib *sAttrib,
                             const CompTransform     *transform,
                             Region region,
                             CompOutput              *output,
                             unsigned int mask)
{

	THUMB_SCREEN (s);

	UNWRAP (ts, s, paintTransformedOutput);
	(*s->paintTransformedOutput)(s, sAttrib, transform, region, output, mask);
	WRAP (ts, s, paintTransformedOutput, thumbPaintTransformedOutput);

	const BananaValue *
	option_always_on_top = bananaGetOption (bananaIndex,
	                                        "always_on_top",
	                                        s->screenNum);

	if (option_always_on_top->b && ts->x == s->x && ts->y == s->y)
	{
		ts->painted = TRUE;

		if (ts->oldThumb.opacity > 0.0 && ts->oldThumb.win)
		{
			CompTransform sTransform = *transform;

			(*s->applyScreenTransform)(s, sAttrib, output, &sTransform);
			transformToScreenSpace (s, output, -sAttrib->zTranslate,
			                        &sTransform);
			glPushMatrix ();
			glLoadMatrixf (sTransform.m);
			thumbPaintThumb (s, &ts->oldThumb, &sTransform);
			glPopMatrix ();
		}

		if (ts->thumb.opacity > 0.0 && ts->thumb.win)
		{
			CompTransform sTransform = *transform;

			(*s->applyScreenTransform)(s, sAttrib, output, &sTransform);
			transformToScreenSpace (s, output, -sAttrib->zTranslate,
			                        &sTransform);
			glPushMatrix ();
			glLoadMatrixf (sTransform.m);
			thumbPaintThumb (s, &ts->thumb, &sTransform);
			glPopMatrix ();
		}
	}
}
static Bool
wizardPaintOutput (CompScreen           *s,
		const ScreenPaintAttrib *sa,
		const CompTransform     *transform,
		Region                  region,
		CompOutput              *output,
		unsigned int            mask)
{
    Bool           status;
    CompTransform  sTransform;

    WIZARD_SCREEN (s);

    UNWRAP (ws, s, paintOutput);
    status = (*s->paintOutput) (s, sa, transform, region, output, mask);
    WRAP (ws, s, paintOutput, wizardPaintOutput);

    if (!ws->ps || !ws->ps->active)
	return status;

    matrixGetIdentity (&sTransform);

    transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);

    glPushMatrix ();
    glLoadMatrixf (sTransform.m);

    drawParticles (s, ws->ps);

    glPopMatrix ();

    glColor4usv (defaultColor);

    return status;
}
Exemplo n.º 3
0
static Bool
snowPaintOutput (CompScreen              *s,
		 const ScreenPaintAttrib *sa,
		 const CompTransform	 *transform,
		 Region                  region,
		 CompOutput              *output,
		 unsigned int            mask)
{
    Bool status;

    SNOW_SCREEN (s);

    if (ss->active && !starGetSnowOverWindows (s->display))
	mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;

    UNWRAP (ss, s, paintOutput);
    status = (*s->paintOutput) (s, sa, transform, region, output, mask);
    WRAP (ss, s, paintOutput, snowPaintOutput);

    if (ss->active && starGetSnowOverWindows (s->display))
    {
	CompTransform sTransform = *transform;

	transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);

	glPushMatrix ();
	glLoadMatrixf (sTransform.m);
	beginRendering (ss, s);
	glPopMatrix ();
    }

    return status;
}
static Bool
elementsPaintOutput (CompScreen              *s,
		 const ScreenPaintAttrib *sa,
		 const CompTransform	 *transform,
		 Region                  region,
		 CompOutput              *output,
		 unsigned int            mask)
{
	CompDisplay *d = s->display;
	Bool status;
	Bool active = elementActive(s);

	E_SCREEN (s);

	UNWRAP (eScreen, s, paintOutput);
	status = (*s->paintOutput) (s, sa, transform, region, output, mask);
	WRAP (eScreen, s, paintOutput, elementsPaintOutput);

	if(elementsGetApplyTransform (d))
		return status;

	if (active && elementsGetOverWindows (d))
	{
		CompTransform sTransform = *transform;
		transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);
		glPushMatrix ();
		glLoadMatrixf (sTransform.m);
		beginRendering (s);
		glPopMatrix ();
	}

    return status;
}
Exemplo n.º 5
0
static Bool
wsnamesPaintOutput (CompScreen              *s,
                    const ScreenPaintAttrib *sAttrib,
                    const CompTransform     *transform,
                    Region                  region,
                    CompOutput              *output,
                    unsigned int            mask)
{
	Bool status;

	WSNAMES_SCREEN (s);

	UNWRAP (ws, s, paintOutput);
	status = (*s->paintOutput) (s, sAttrib, transform, region, output, mask);
	WRAP (ws, s, paintOutput, wsnamesPaintOutput);

	if (ws->textData)
	{
		CompTransform sTransform = *transform;

		transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);
		glPushMatrix ();
		glLoadMatrixf (sTransform.m);

		wsnamesDrawText (s);

		glPopMatrix ();
	}

	return status;
}
Exemplo n.º 6
0
static Bool
scalefilterPaintOutput (CompScreen              *s,
			const ScreenPaintAttrib *sAttrib,
			const CompTransform     *transform,
			Region                  region,
			CompOutput              *output,
			unsigned int            mask)
{
    Bool status;

    FILTER_SCREEN (s);

    UNWRAP (fs, s, paintOutput);
    status = (*s->paintOutput) (s, sAttrib, transform, region, output, mask);
    WRAP (fs, s, paintOutput, scalefilterPaintOutput);

    if (status && fs->filterInfo)
    {
	if ((output->id == ~0 || output->id == fs->filterInfo->outputDevice) &&
	    fs->filterInfo->textPixmap)
	{
	    CompTransform sTransform = *transform;
	    transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);

	    glPushMatrix ();
	    glLoadMatrixf (sTransform.m);

	    scalefilterDrawFilterText (s, output);

	    glPopMatrix ();
	}
    }

    return status;
}
Exemplo n.º 7
0
void
paintTransformedOutput (CompScreen		*screen,
			const ScreenPaintAttrib *sAttrib,
			const CompTransform	*transform,
			Region			region,
			CompOutput		*output,
			unsigned int		mask)
{
    CompTransform sTransform = *transform;

    if (mask & PAINT_SCREEN_CLEAR_MASK)
	clearTargetOutput (screen->display, GL_COLOR_BUFFER_BIT);

    screenLighting (screen, TRUE);

    (*screen->applyScreenTransform) (screen, sAttrib, output, &sTransform);

    if ((mask & CLIP_PLANE_MASK) == CLIP_PLANE_MASK)
    {
	screen->enableOutputClipping (screen, &sTransform, region, output);

	transformToScreenSpace (screen, output, -sAttrib->zTranslate,
				&sTransform);

	glPushMatrix ();
	glLoadMatrixf (sTransform.m);

	paintOutputRegion (screen, &sTransform, region, output, mask);

	glPopMatrix ();

	screen->disableOutputClipping (screen);
    }
    else
    {
	transformToScreenSpace (screen, output, -sAttrib->zTranslate,
				&sTransform);

	glPushMatrix ();
	glLoadMatrixf (sTransform.m);

	paintOutputRegion (screen, &sTransform, region, output, mask);

	glPopMatrix ();
    }
}
Exemplo n.º 8
0
Bool
paintOutput (CompScreen		     *screen,
	     const ScreenPaintAttrib *sAttrib,
	     const CompTransform     *transform,
	     Region		     region,
	     CompOutput		     *output,
	     unsigned int	     mask)
{
    CompTransform sTransform = *transform;

    if (mask & PAINT_SCREEN_REGION_MASK)
    {
	if (mask & PAINT_SCREEN_TRANSFORMED_MASK)
	{
	    if (mask & PAINT_SCREEN_FULL_MASK)
	    {
		region = &output->region;

		(*screen->paintTransformedOutput) (screen, sAttrib,
						   &sTransform, region,
						   output, mask);

		return TRUE;
	    }

	    return FALSE;
	}

	/* fall through and redraw region */
    }
    else if (mask & PAINT_SCREEN_FULL_MASK)
    {
	(*screen->paintTransformedOutput) (screen, sAttrib, &sTransform,
					   &output->region,
					   output, mask);

	return TRUE;
    }
    else
	return FALSE;

    screenLighting (screen, FALSE);

    transformToScreenSpace (screen, output, -DEFAULT_Z_CAMERA, &sTransform);

    glPushMatrix ();
    glLoadMatrixf (sTransform.m);

    paintOutputRegion (screen, &sTransform, region, output, mask);

    glPopMatrix ();

    return TRUE;
}
static Bool
ringPaintOutput (CompScreen		  *s,
		 const ScreenPaintAttrib *sAttrib,
		 const CompTransform	  *transform,
		 Region		          region,
		 CompOutput		  *output,
		 unsigned int		  mask)
{
    Bool status;

    RING_SCREEN (s);

    if (rs->state != RingStateNone)
	mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;

    UNWRAP (rs, s, paintOutput);
    status = (*s->paintOutput) (s, sAttrib, transform, region, output, mask);
    WRAP (rs, s, paintOutput, ringPaintOutput);

    if (rs->state != RingStateNone)
    {
	int           i;
	CompTransform sTransform = *transform;

	transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);
	glPushMatrix ();
	glLoadMatrixf (sTransform.m);

	rs->paintingSwitcher = TRUE;

	for (i = 0; i < rs->nWindows; i++)
	{
	    if (rs->drawSlots[i].slot && *(rs->drawSlots[i].slot))
	    {
		CompWindow *w = rs->drawSlots[i].w;

		(*s->paintWindow) (w, &w->paint, &sTransform,
				   &infiniteRegion, 0);
	    }
	}

	rs->paintingSwitcher = FALSE;

	if (rs->textData && rs->state != RingStateIn)
	    ringDrawWindowTitle (s);
	
	glPopMatrix ();
    }

    return status;
}
Exemplo n.º 10
0

static Bool
elementsPaintOutput (CompScreen              *s,
		 const ScreenPaintAttrib *sa,
		 const CompTransform	 *transform,
		 Region                  region,
		 CompOutput              *output, 
		 unsigned int            mask)
{
	Bool status;

	E_SCREEN (s);
	int ii;
	Bool active = FALSE;
	for (ii = 0; ii <= 4; ii++)
	{
		if (eScreen->isActive[ii])
			active = TRUE;
	}

	if (active && elementsGetOverWindows (s->display))
		mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;

	UNWRAP (eScreen, s, paintOutput);
	status = (*s->paintOutput) (s, sa, transform, region, output, mask);
	WRAP (eScreen, s, paintOutput, elementsPaintOutput);

	if (active && elementsGetOverWindows (s->display))
	{
		CompTransform sTransform = *transform;
		transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);
		glPushMatrix ();
		glLoadMatrixf (sTransform.m);
		beginRendering (eScreen, s);
		glPopMatrix ();
	}
Exemplo n.º 11
0
static Bool
snowPaintOutput (CompScreen              *s,
                 const ScreenPaintAttrib *sa,
                 const CompTransform     *transform,
                 Region                  region,
                 CompOutput              *output,
                 unsigned int            mask)
{
	Bool status;

	SNOW_SCREEN (s);

	const BananaValue *
	option_snow_over_windows = bananaGetOption (bananaIndex,
	                                            "snow_over_windows",
	                                            -1);

	if (ss->active && !option_snow_over_windows->b)
		mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;

	UNWRAP (ss, s, paintOutput);
	status = (*s->paintOutput) (s, sa, transform, region, output, mask);
	WRAP (ss, s, paintOutput, snowPaintOutput);

	if (ss->active && option_snow_over_windows->b)
	{
		CompTransform sTransform = *transform;

		transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);

		glPushMatrix ();
		glLoadMatrixf (sTransform.m);
		beginRendering (ss, s);
		glPopMatrix ();
	}

	return status;
}
Exemplo n.º 12
0
/*
 * groupaintTransformedOutput
 *
 */
void
groupPaintTransformedOutput (CompScreen              *s,
                             const ScreenPaintAttrib *sa,
                             const CompTransform     *transform,
                             Region                  region,
                             CompOutput              *output,
                             unsigned int            mask)
{
	GROUP_SCREEN (s);

	UNWRAP (gs, s, paintTransformedOutput);
	(*s->paintTransformedOutput)(s, sa, transform, region, output, mask);
	WRAP (gs, s, paintTransformedOutput, groupPaintTransformedOutput);

	if ((gs->vpX == s->x) && (gs->vpY == s->y))
	{
		gs->painted = TRUE;

		if ((gs->grabState == ScreenGrabTabDrag) &&
		    gs->draggedSlot && gs->dragged)
		{
			CompTransform wTransform = *transform;

			(*s->applyScreenTransform)(s, sa, output, &wTransform);
			transformToScreenSpace (s, output, -sa->zTranslate, &wTransform);
			glPushMatrix ();
			glLoadMatrixf (wTransform.m);

			groupPaintThumb (NULL, gs->draggedSlot, &wTransform, OPAQUE);

			glPopMatrix ();
		}
		else if (gs->grabState == ScreenGrabSelect)
		{
			groupPaintSelectionOutline (s, sa, transform, output, TRUE);
		}
	}
}
Exemplo n.º 13
0
static void
glPaintRectangle (CompScreen		  *s,
                  const ScreenPaintAttrib *sAttrib,
                  const CompTransform	  *transform,
                  CompOutput		  *output)
{
    float alpha = 0;

    GRID_SCREEN (s);

    BoxRec      rect;

    setCurrentRect (s);

    rect.x1=gs->anim.currentRect.x;
    rect.y1=gs->anim.currentRect.y;
    rect.x2=gs->anim.currentRect.x + gs->anim.currentRect.width;
    rect.y2=gs->anim.currentRect.y + gs->anim.currentRect.height;
    CompTransform sTransform = *transform;

    /* rect = desiredSlot;*/

    glPushMatrix ();

    transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);

    glLoadMatrixf (sTransform.m);

    glDisableClientState (GL_TEXTURE_COORD_ARRAY);
    glEnable (GL_BLEND);

    /* fill rectangle */
    /* TODO: have multiple animations
       for (iter = animations.begin (); iter != animations.end () && animating; iter++)
       { */

    alpha = ((float) gridGetFillColorAlpha (s->display) / 65535.0f) *
            gs->anim.opacity;

    glColor4f (((float) gridGetFillColorRed (s->display) / 65535.0f) * alpha,
               ((float) gridGetFillColorGreen (s->display) / 65535.0f) * alpha,
               ((float) gridGetFillColorBlue (s->display) / 65535.0f) * alpha,
               alpha);

    glRecti (rect.x1, rect.y2, rect.x2, rect.y1);

    /* draw outline */

    alpha = ((float) gridGetOutlineColorAlpha (s->display) / 65535.0f) *
            gs->anim.opacity;

    glColor4f (((float) gridGetOutlineColorRed (s->display) / 65535.0f) * alpha,
               ((float) gridGetOutlineColorGreen (s->display) / 65535.0f) * alpha,
               ((float) gridGetOutlineColorBlue (s->display) / 65535.0f) * alpha,
               alpha);

    int thickness = gridGetOutlineThickness (s->display);
    glLineWidth (thickness);
    glBegin (GL_LINE_LOOP);

    /* set outline rect smaller to avoid damage issues */
    /* TODO: maybe get a better way of doing this */
    float half_thickness = thickness * 0.5;
    glVertex2f (rect.x1 + half_thickness, rect.y1 + half_thickness);
    glVertex2f (rect.x2 - half_thickness, rect.y1 + half_thickness);
    glVertex2f (rect.x2 - half_thickness, rect.y2 - half_thickness);
    glVertex2f (rect.x1 + half_thickness, rect.y2 - half_thickness);
    glEnd ();

    /* clean up */
    glColor4usv (defaultColor);
    glDisable (GL_BLEND);
    glEnableClientState (GL_TEXTURE_COORD_ARRAY);
    glPopMatrix ();
}
static Bool
tilePaintOutput (CompScreen              *s,
		 const ScreenPaintAttrib *sa,
		 const CompTransform	 *transform,
		 Region                  region,
		 CompOutput              *output,
		 unsigned int            mask)
{
    Bool status;

    TILE_SCREEN (s);

    if (ts->grabIndex)
	mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;

    UNWRAP (ts, s, paintOutput);
    status = (*s->paintOutput) (s, sa, transform, region, output, mask);
    WRAP (ts, s, paintOutput, tilePaintOutput);

    /* Check if animation is enabled, there is resizing
       on screen and only outline should be drawn */

    if (ts->grabIndex && (output->id == ~0) &&
	(tileGetAnimateType (s->display) == AnimateTypeFilledOutline))
    {
	CompWindow    *w;
	CompTransform sTransform = *transform;
	float         animationDuration = tileGetAnimationDuration (s->display);
	int           x, y, width, height;

	transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);
	glPushMatrix ();
	glLoadMatrixf (sTransform.m);

	glLineWidth (4.0f);

	for (w = s->windows; w; w = w->next)
	{
	    TILE_WINDOW (w);

	    if (tw->animationType == Animating)
	    {
		/* Coordinate = start +            speed          * elapsedTime
		   Coordinate = start + (target - start)/interval * elapsedTime
		   Draw outline */

		x      = tw->prevCoords.x - w->input.left +
		         (((float)(w->attrib.x - tw->prevCoords.x)) *
			  ts->msResizing / animationDuration);
		y      = tw->prevCoords.y - w->input.top +
		         (((float)(w->attrib.y - tw->prevCoords.y)) *
			  ts->msResizing / animationDuration);
		width  = tw->prevCoords.width + w->input.left + w->input.right +
		         (((float)(w->attrib.width - tw->prevCoords.width)) *
			  ts->msResizing / animationDuration);
		height = tw->prevCoords.height +
		         w->input.top + w->input.bottom +
			 (((float)(w->attrib.height - tw->prevCoords.height)) *
			  ts->msResizing / animationDuration);

		glColor3us (tw->outlineColor[0] * 0.66,
			    tw->outlineColor[1] * 0.66,
			    tw->outlineColor[2] * 0.66);
		glRecti (x, y + height, x + width, y);

		glColor3usv (tw->outlineColor);

		glBegin (GL_LINE_LOOP);
		glVertex3f (x, y, 0.0f);
		glVertex3f (x + width, y, 0.0f);
		glVertex3f (x + width, y + height, 0.0f);
		glVertex3f (x, y + height, 0.0f);
		glEnd ();

		glColor4usv (defaultColor);
	    }
	}

	glPopMatrix ();
	glColor4usv (defaultColor);
	glLineWidth (1.0f);
    }

    return status;
}
Exemplo n.º 15
0
static Bool
thumbPaintOutput (CompScreen              *s,
                  const ScreenPaintAttrib *sAttrib,
                  const CompTransform     *transform,
                  Region region,
                  CompOutput              *output,
                  unsigned int mask)
{
	Bool status;
	unsigned int newMask = mask;

	THUMB_SCREEN (s);

	ts->painted = FALSE;

	ts->x = s->x;
	ts->y = s->y;

	if ((ts->oldThumb.opacity > 0.0 && ts->oldThumb.win) ||
	    (ts->thumb.opacity > 0.0 && ts->thumb.win))
	{
		newMask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
	}

	UNWRAP (ts, s, paintOutput);
	status = (*s->paintOutput)(s, sAttrib, transform, region,
	                           output, newMask);
	WRAP (ts, s, paintOutput, thumbPaintOutput);

	const BananaValue *
	option_always_on_top = bananaGetOption (bananaIndex,
	                                        "always_on_top",
	                                        s->screenNum);

	if (option_always_on_top->b && !ts->painted)
	{
		if (ts->oldThumb.opacity > 0.0 && ts->oldThumb.win)
		{
			CompTransform sTransform = *transform;

			transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA,
			                        &sTransform);
			glPushMatrix ();
			glLoadMatrixf (sTransform.m);
			thumbPaintThumb (s, &ts->oldThumb, &sTransform);
			glPopMatrix ();
		}

		if (ts->thumb.opacity > 0.0 && ts->thumb.win)
		{
			CompTransform sTransform = *transform;

			transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA,
			                        &sTransform);
			glPushMatrix ();
			glLoadMatrixf (sTransform.m);
			thumbPaintThumb (s, &ts->thumb, &sTransform);
			glPopMatrix ();
		}
	}

	return status;
}
Exemplo n.º 16
0
/*
 * groupPaintSelectionOutline
 *
 */
static void
groupPaintSelectionOutline (CompScreen              *s,
                            const ScreenPaintAttrib *sa,
                            const CompTransform     *transform,
                            CompOutput              *output,
                            Bool                    transformed)
{
	int x1, x2, y1, y2;

	GROUP_SCREEN (s);

	x1 = MIN (gs->x1, gs->x2);
	y1 = MIN (gs->y1, gs->y2);
	x2 = MAX (gs->x1, gs->x2);
	y2 = MAX (gs->y1, gs->y2);

	const BananaValue *
	option_fill_color = bananaGetOption (bananaIndex,
	                                     "fill_color",
	                                     s->screenNum);

	const BananaValue *
	option_line_color = bananaGetOption (bananaIndex,
	                                     "line_color",
	                                     s->screenNum);

	unsigned short fill_color[] = { 0, 0, 0, 0 };

	unsigned short line_color[] = { 0, 0, 0, 0 };

	stringToColor (option_fill_color->s, fill_color);
	stringToColor (option_line_color->s, line_color);

	if (gs->grabState == ScreenGrabSelect)
	{
		CompTransform sTransform = *transform;

		if (transformed)
		{
			(*s->applyScreenTransform)(s, sa, output, &sTransform);
			transformToScreenSpace (s, output, -sa->zTranslate, &sTransform);
		} else
			transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);

		glPushMatrix ();
		glLoadMatrixf (sTransform.m);

		glDisableClientState (GL_TEXTURE_COORD_ARRAY);
		glEnable (GL_BLEND);

		glColor4usv (fill_color);
		glRecti (x1, y2, x2, y1);

		glColor4usv (line_color);
		glBegin (GL_LINE_LOOP);
		glVertex2i (x1, y1);
		glVertex2i (x2, y1);
		glVertex2i (x2, y2);
		glVertex2i (x1, y2);
		glEnd ();

		glColor4usv (defaultColor);
		glDisable (GL_BLEND);
		glEnableClientState (GL_TEXTURE_COORD_ARRAY);
		glPopMatrix ();
	}
}
Exemplo n.º 17
0
Arquivo: zoom.c Projeto: zmike/compiz
static Bool
zoomPaintOutput(CompScreen *s,
                const ScreenPaintAttrib *sAttrib,
                const CompTransform *transform,
                Region region,
                CompOutput *output,
                unsigned int mask)
{
   CompTransform zTransform = *transform;
   Bool status;

   ZOOM_SCREEN(s);

   if (output->id != ~0 && (zs->zoomed & (1 << output->id)))
     {
        int saveFilter;
        ZoomBox box;
        float scale, x, y, x1, y1;
        float oWidth = output->width;
        float oHeight = output->height;

        mask &= ~PAINT_SCREEN_REGION_MASK;

        zoomGetCurrentZoom(s, output->id, &box);

        x1 = box.x1 - output->region.extents.x1;
        y1 = box.y1 - output->region.extents.y1;

        scale = oWidth / (box.x2 - box.x1);

        x = ((oWidth / 2.0f) - x1) / oWidth;
        y = ((oHeight / 2.0f) - y1) / oHeight;

        x = 0.5f - x * scale;
        y = 0.5f - y * scale;

        matrixTranslate(&zTransform, -x, y, 0.0f);
        matrixScale(&zTransform, scale, scale, 1.0f);

        mask |= PAINT_SCREEN_TRANSFORMED_MASK;

        saveFilter = s->filter[SCREEN_TRANS_FILTER];

        if ((zs->zoomOutput != output->id || !zs->adjust) && scale > 3.9f &&
            !zs->opt[ZOOM_SCREEN_OPTION_FILTER_LINEAR].value.b)
          s->filter[SCREEN_TRANS_FILTER] = COMP_TEXTURE_FILTER_FAST;

        UNWRAP(zs, s, paintOutput);
        status = (*s->paintOutput)(s, sAttrib, &zTransform, region, output,
                                   mask);
        WRAP(zs, s, paintOutput, zoomPaintOutput);

        s->filter[SCREEN_TRANS_FILTER] = saveFilter;
     }
   else
     {
        UNWRAP(zs, s, paintOutput);
        status = (*s->paintOutput)(s, sAttrib, transform, region, output,
                                   mask);
        WRAP(zs, s, paintOutput, zoomPaintOutput);
     }

   if (status && zs->grab)
     {
        int x1, x2, y1, y2;

        x1 = MIN(zs->x1, zs->x2);
        y1 = MIN(zs->y1, zs->y2);
        x2 = MAX(zs->x1, zs->x2);
        y2 = MAX(zs->y1, zs->y2);

        if (zs->grabIndex)
          {
             transformToScreenSpace(s, output, -DEFAULT_Z_CAMERA, &zTransform);

             glPushMatrix();
             glLoadMatrixf(zTransform.m);
             glDisableClientState(GL_TEXTURE_COORD_ARRAY);
             glEnable(GL_BLEND);
             glColor4us(0x2fff, 0x2fff, 0x4fff, 0x4fff);
             glRecti(x1, y2, x2, y1);
             glColor4us(0x2fff, 0x2fff, 0x4fff, 0x9fff);
             glBegin(GL_LINE_LOOP);
             glVertex2i(x1, y1);
             glVertex2i(x2, y1);
             glVertex2i(x2, y2);
             glVertex2i(x1, y2);
             glEnd();
             glColor4usv(defaultColor);
             glDisable(GL_BLEND);
             glEnableClientState(GL_TEXTURE_COORD_ARRAY);
             glPopMatrix();
          }
     }

   return status;
}
Exemplo n.º 18
0
/*
 * groupPaintOutput
 *
 */
Bool
groupPaintOutput (CompScreen              *s,
                  const ScreenPaintAttrib *sAttrib,
                  const CompTransform     *transform,
                  Region                  region,
                  CompOutput              *output,
                  unsigned int            mask)
{
	GroupSelection *group;
	Bool status;

	GROUP_SCREEN (s);
	GROUP_DISPLAY (&display);

	gs->painted = FALSE;
	gs->vpX = s->x;
	gs->vpY = s->y;

	if (gd->resizeInfo)
	{
		mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
	}
	else
	{
		for (group = gs->groups; group; group = group->next)
		{
			if (group->changeState != NoTabChange ||
			    group->tabbingState != NoTabbing)
			{
				mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
			}
			else if (group->tabBar && (group->tabBar->state != PaintOff))
			{
				mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
			}
		}
	}

	UNWRAP (gs, s, paintOutput);
	status = (*s->paintOutput)(s, sAttrib, transform, region, output, mask);
	WRAP (gs, s, paintOutput, groupPaintOutput);

	if (status && !gs->painted)
	{
		if ((gs->grabState == ScreenGrabTabDrag) && gs->draggedSlot)
		{
			CompTransform wTransform = *transform;
			PaintState state;

			GROUP_WINDOW (gs->draggedSlot->window);

			transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &wTransform);

			glPushMatrix ();
			glLoadMatrixf (wTransform.m);

			/* prevent tab bar drawing.. */
			state = gw->group->tabBar->state;
			gw->group->tabBar->state = PaintOff;
			groupPaintThumb (NULL, gs->draggedSlot, &wTransform, OPAQUE);
			gw->group->tabBar->state = state;

			glPopMatrix ();
		}
		else if (gs->grabState == ScreenGrabSelect)
		{
			groupPaintSelectionOutline (s, sAttrib, transform, output, FALSE);
		}
	}

	return status;
}