Annotation of 43BSDTahoe/new/X/Xlib/XCreateCursor.c, revision 1.1

1.1     ! root        1: #include <X/mit-copyright.h>
        !             2: 
        !             3: /* $Header: XCreateCursor.c,v 10.6 86/04/22 15:27:51 jg Rel $ */
        !             4: /* Copyright    Massachusetts Institute of Technology    1985  */
        !             5: 
        !             6: #include "XlibInternal.h"
        !             7: Cursor XCreateCursor (width, height, cursor, mask, xOffset, yOffset,
        !             8:     foreground, background, func)
        !             9:        short *cursor, *mask;
        !            10:        int width, height;
        !            11:        int xOffset, yOffset;
        !            12:        int func;
        !            13:        int foreground, background;
        !            14: {
        !            15:        register Display *dpy;
        !            16:        register XReq *req;
        !            17:        XRep rep;
        !            18:        Bitmap cbitmap, mbitmap = 0;
        !            19:        int nbytes = BitmapSize (width, height)/UBPS;
        !            20:        Status status;
        !            21: 
        !            22:        GetReq(X_StoreBitmap, 0);
        !            23:        req->params0 = height;
        !            24:        req->params1 = width;
        !            25:        PackData (dpy, cursor, nbytes);
        !            26: 
        !            27:        if (mask) {
        !            28:            GetReq(X_StoreBitmap, 0);
        !            29:            req->params0 = height;
        !            30:            req->params1 = width;
        !            31:            PackData (dpy, mask, nbytes);
        !            32:            dpy->request--; /* to synchronize properly with XError packets */
        !            33:            }
        !            34: 
        !            35:        cbitmap = _XReply (dpy, &rep) ? rep.param.l[0] : 0;
        !            36: 
        !            37:        if (mask) {
        !            38:            dpy->request++;
        !            39:            mbitmap = _XReply (dpy, &rep) ? rep.param.l[0] : 0;
        !            40:            }
        !            41: 
        !            42:        if (!cbitmap || (mask && !mbitmap)) {
        !            43:            /* an error occurred. Clean up and return. */
        !            44:            if (cbitmap)
        !            45:                XFreeBitmap (cbitmap);
        !            46:            if (mbitmap)
        !            47:                XFreeBitmap (mbitmap);
        !            48:            return (0);
        !            49:            }
        !            50: 
        !            51:        GetReq(X_StoreCursor, 0);
        !            52:        req->func = func;
        !            53:        req->param.l[0] = cbitmap;
        !            54:        req->params2 = foreground;
        !            55:        req->params3 = background;
        !            56:        req->param.l[2] = mbitmap;
        !            57:        req->params6 = xOffset;
        !            58:        req->params7 = yOffset;
        !            59:        status = _XReply (dpy, &rep);
        !            60:        XFreeBitmap (cbitmap);
        !            61:        if (mbitmap) 
        !            62:            XFreeBitmap (mbitmap);
        !            63:        return (status ? rep.param.l[0] : 0);
        !            64: }
        !            65: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.