/*
 * -- $Header: /cec/src/nestor/servers/R3/shXlib/XCrCursor.c,v 1.1.1.1 90/04/23 09:54:37 spanachi Exp $
 */

#include "copyright.h"

/* $XConsortium: XCrCursor.c,v 11.7 88/09/06 16:05:43 jim Exp $ */
/* Copyright    Massachusetts Institute of Technology    1986	*/

/* -- MULTIPLEX Extension -- */

#include "Xlibint.h"

/* additional includes -- */

#include "resources.h"

Cursor XCreatePixmapCursor(dpy, source, mask, foreground, background, x, y)
     register Display *dpy;
     Pixmap source, mask;
     XColor *foreground, *background;
     unsigned int  x, y;

{       
    register xCreateCursorReq *req;
    Cursor cid;

    LockDisplay(dpy);
    GetReq(CreateCursor, req);
    req->cid = cid = XAllocID(dpy);
    req->source = source;
    req->mask = mask;
    req->foreRed = foreground->red;
    req->foreGreen = foreground->green;
    req->foreBlue = foreground->blue;
    req->backRed = background->red;
    req->backGreen = background->green;
    req->backBlue = background->blue;
    req->x = x;
    req->y = y;

    /* -- store the new resource if it is necessary -- */
    if( XmuXStoreResources( dpy ) )
	XmuXInsertPixmapCursorInfo( dpy , cid , foreground , background ,
				    source , mask , x , y ) ;

    UnlockDisplay(dpy);
    SyncHandle();
    return (cid);
}

