예제 #1
0
static Bool
waterPoint(CompDisplay * d,
	   CompAction * action,
	   CompActionState state, CompOption * option, int nOption)
{
	CompScreen *s;
	int xid;

	xid = getIntOptionNamed(option, nOption, "root", 0);

	s = findScreenAtDisplay(d, xid);
	if (s) {
		XPoint p;
		float amp;

		p.x = getIntOptionNamed(option, nOption, "x", s->width / 2);
		p.y = getIntOptionNamed(option, nOption, "y", s->height / 2);

		amp = getFloatOptionNamed(option, nOption, "amplitude", 0.5f);

		waterVertices(s, GL_POINTS, &p, 1, amp);

		damageScreen(s);
	}

	return FALSE;
}
예제 #2
0
static Bool
waterLine(CompDisplay * d,
	  CompAction * action,
	  CompActionState state, CompOption * option, int nOption)
{
	CompScreen *s;
	int xid;

	xid = getIntOptionNamed(option, nOption, "root", 0);

	s = findScreenAtDisplay(d, xid);
	if (s) {
		XPoint p[2];
		float amp;

		p[0].x = getIntOptionNamed(option, nOption, "x0", s->width / 4);
		p[0].y =
		    getIntOptionNamed(option, nOption, "y0", s->height / 2);

		p[1].x = getIntOptionNamed(option, nOption, "x1",
					   s->width - s->width / 4);
		p[1].y =
		    getIntOptionNamed(option, nOption, "y1", s->height / 2);

		amp = getFloatOptionNamed(option, nOption, "amplitude", 0.25f);

		waterVertices(s, GL_LINES, p, 2, amp);

		damageScreen(s);
	}

	return FALSE;
}
static Bool
magInitiate (CompDisplay     *d,
	     CompAction      *action,
	     CompActionState state,
	     CompOption      *option,
	     int             nOption)
{
    CompScreen *s;
    Window     xid;
    float      factor;

    xid    = getIntOptionNamed (option, nOption, "root", 0);
    factor = getFloatOptionNamed (option, nOption, "factor", 0.0);

    s = findScreenAtDisplay (d, xid);
    if (s)
    {
	MAG_SCREEN (s);

	if (factor == 0.0 && ms->zTarget != 1.0)
	    return magTerminate (d, action, state, option, nOption);

	if (ms->mode == ModeFisheye)
	{
	    if (factor != 1.0)
		factor = magGetZoomFactor (s) * 3;

	    ms->zTarget = MAX (1.0, MIN (10.0, factor));
	}
	else
	{
	    if (factor != 1.0)
		factor = magGetZoomFactor (s);

	    ms->zTarget = MAX (1.0, MIN (64.0, factor));
	}
	ms->adjust  = TRUE;
	damageScreen (s);

	return TRUE;
    }
    return FALSE;
}