예제 #1
0
static Pixmap makePixmap(WMScreen * scr, int width, int height, int side, Pixmap * mask)
{
	Display *dpy = WMScreenDisplay(scr);
	Pixmap bitmap;
	Pixmap pixmap;
	int x, y;
	WMColor *black = WMBlackColor(scr);

	bitmap = XCreatePixmap(dpy, scr->rootWin, width + SPACE, height + SPACE, 1);

	XSetForeground(dpy, scr->monoGC, 0);
	XFillRectangle(dpy, bitmap, scr->monoGC, 0, 0, width + SPACE, height + SPACE);

	pixmap = XCreatePixmap(dpy, scr->rootWin, width + SPACE, height + SPACE, scr->depth);

	XFillRectangle(dpy, pixmap, WMColorGC(black), 0, 0, width + SPACE, height + SPACE);

	if (side & BOTTOM) {
		y = 0;
	} else {
		y = SPACE;
	}
	x = 0;

	drawBalloon(scr, bitmap, pixmap, x, y, width, height, side);

	*mask = bitmap;

	WMReleaseColor(black);

	return pixmap;
}
예제 #2
0
파일: balloon.c 프로젝트: cneira/wmaker-crm
static Pixmap makePixmap(WScreen *scr, int width, int height, int side, Pixmap *mask)
{
	WBalloon *bal = scr->balloon;
	Pixmap bitmap;
	Pixmap pixmap;
	int x, y;

	bitmap = XCreatePixmap(dpy, scr->root_win, width + SPACE, height + SPACE, 1);

	if (!bal->monoGC)
		bal->monoGC = XCreateGC(dpy, bitmap, 0, NULL);

	XSetForeground(dpy, bal->monoGC, 0);
	XFillRectangle(dpy, bitmap, bal->monoGC, 0, 0, width + SPACE, height + SPACE);

	pixmap = XCreatePixmap(dpy, scr->root_win, width + SPACE, height + SPACE, scr->w_depth);
	XSetForeground(dpy, scr->draw_gc, scr->black_pixel);
	XFillRectangle(dpy, pixmap, scr->draw_gc, 0, 0, width + SPACE, height + SPACE);

	if (side & BOTTOM)
		y = 0;
	else
		y = SPACE;
	x = 0;

	drawBalloon(scr, bitmap, pixmap, x, y, width, height, side);

	*mask = bitmap;

	return pixmap;
}
예제 #3
0
/*
 * Show a balloon with "mesg".
 */
    void
gui_mch_post_balloon(BalloonEval *beval, char_u *mesg)
{
    beval->msg = mesg;
    if (mesg != NULL)
	drawBalloon(beval);
    else
	undrawBalloon(beval);
}
예제 #4
0
void Sensing::draw()
{
    if(_recordMode)
    {
        vector <Balloon *> balloons = getBalloons();

        for(int i = 0; i < balloons.size(); i++)
        {
            // draw circle around
            ofSetColor(255, 255, 255);
            //ofFill();
            //ofEllipse(balloons[i]->getCenterX(), balloons[i]->getCenterY(), balloons[i]->getWidth(),balloons[i]->getHeight());
            ofNoFill();
            ofEllipse(balloons[i]->getCenterX(), balloons[i]->getCenterY(), balloons[i]->getWidth(), balloons[i]->getHeight());

            ofRectangle bounds = balloons[i]->getBoundsFromSize(_head.getWidth(), _head.getHeight());

            ofSetColor(255, 255, 255, 255);

            ofEnableAlphaBlending();
            _head.draw(bounds.x, bounds.y + _offSet, bounds.width, bounds.height);
            ofDisableAlphaBlending();

            ofSetColor(0, 255, 0);

            if(i == _selectedBalloon)
            {
                drawBalloon(balloons[i]->getCenterX(), balloons[i]->getCenterY(), 0x000FF00);
            }
            else
            {
                drawBalloon(balloons[i]->getCenterX(), balloons[i]->getCenterY(), 0xFF0000);
            }
        }
    }
}