#include "view.h"
#include "device.h"

extern Display *display;

Surface *newPixmapSurface(posx,posy,width,height)
int posx,posy,width,height;
{
	Surface *surface;

	surface = Malloc(Surface,1);
	surface->posx = posx;
	surface->posy = posy;
	surface->width = width;
	surface->height = height;

	/*default viewport*/
	surface->x1 = 0.0;
	surface->x2 = (REAL)(width-1);
	surface->y1 = 0.0;
	surface->y2 = (REAL)(height-1);
	surface->dvx = (surface->x2-surface->x1)/2.0;
	surface->dvy = (surface->y2-surface->y1)/2.0;

	surface->drawable = newPixmapDrawable(posx,posy,width,height);


	return(surface);
}

Pixmap newPixmapDrawable(posx,posy,width,height)
int posx,posy,width,height;
{
	Pixmap pmap;

	pmap = XCreatePixmap(display,
