Esempio n. 1
0
static void X_gotoxy(aa_context * c, int x, int y)
{
    struct xdriverdata *d=c->driverdata;
    if (d->Xpos != x || d->Ypos != y) {
	if (d->previoust != NULL)
	    d->previoust[d->Ypos * d->width + d->Xpos] = 255;
	d->Xpos = x;
	d->Ypos = y;
	X_flush(c);
    }
}
Esempio n. 2
0
void __aa_X_redraw(aa_context *c)
{
    struct xdriverdata *d=c->driverdata;
    if (d->pixmapmode && d->previoust != NULL) {
	    XFlush(d->dp);
	    return;
    }
    if (d->previoust != NULL)
	free(d->previoust), free(d->previousa);
    d->previoust=NULL;
    d->previousa=NULL;
    X_flush(c);
    XFlush(d->dp);
}
Esempio n. 3
0
int __aa_X_getsize(struct aa_context *c,struct xdriverdata *d)
{
    unsigned int px, py;
    int tmp;
    Window wtmp;
    XSync(d->dp, 0);
    XGetGeometry(d->dp, d->wi, &wtmp, &tmp, &tmp, &px, &py, (unsigned int *) &tmp, (unsigned int *) &tmp);
    tmp = 0;
    if (px != d->pixelwidth || py != d->pixelheight)
	tmp = 1;
    d->pixelwidth = px;
    d->pixelheight = py;
    if (tmp) {
	if (d->pixmapmode)
	    XFreePixmap(d->dp, d->pi);
	if (!getenv("AABlink"))
	  d->pi = XCreatePixmap(d->dp, d->wi, d->pixelwidth, d->pixelheight, DefaultDepth(d->dp, d->screen));
	else
	  d->pi = BadAlloc;
	if (d->pi == BadAlloc) {
	    d->pixmapmode = 0;
	    XSetWindowBackground(d->dp, d->wi, d->inverted ? d->invertedblack : d->black);
	} else {
	    d->pixmapmode = 1;
	    XFillRectangle(d->dp, d->pi, d->blackGC, 0, 0, d->pixelwidth, d->pixelheight);
	    XSetWindowBackgroundPixmap(d->dp, d->wi, d->pi);
	}
	c->driverparams.mmwidth = DisplayWidthMM(d->dp, d->screen) * d->pixelwidth / DisplayWidth(d->dp, d->screen);
	c->driverparams.mmheight = DisplayHeightMM(d->dp, d->screen) * d->pixelheight / DisplayHeight(d->dp, d->screen);
	if (d->previoust != NULL)
	    free(d->previoust), free(d->previousa);
	d->previoust=NULL;
	d->previousa=NULL;
	X_flush(c);
	XFlush(d->dp);
    }
    XSync(d->dp, 0);
    return (tmp);
}