Annotation of researchv9/X11/src/X.V11R1/lib/X/XCursor.c, revision 1.1.1.1

1.1       root        1: #include "copyright.h"
                      2: 
                      3: /* $Header: XCursor.c,v 11.11 87/09/08 14:31:05 newman Exp $ */
                      4: /* Copyright    Massachusetts Institute of Technology    1987  */
                      5: 
                      6: #include "Xlibint.h"
                      7: static XColor foreground = { 0,    0,     0,     0  };  /* black */
                      8: static XColor background = { 0, 65535, 65535, 65535 };  /* white */
                      9: 
                     10: Cursor XCreateFontCursor(dpy, which)
                     11:        Display *dpy;
                     12:        unsigned int which;
                     13: {
                     14:        static Font cfont = 0;
                     15:        Cursor result;
                     16:        static Display *olddpy = NULL;
                     17:        /* 
                     18:         * the cursor font contains the shape glyph followed by the mask
                     19:         * glyph; so character position 0 contains a shape, 1 the mask for 0,
                     20:         * 2 a shape, etc.  <X11/cursorfont.h> contains hash define names
                     21:         * for all of these.
                     22:         */
                     23: 
                     24:        if (cfont == 0 || dpy != olddpy)        {
                     25:                if (cfont && dpy) XUnloadFont (olddpy, cfont);
                     26:                cfont = XLoadFont(dpy, CURSORFONT);
                     27:                olddpy = dpy;
                     28:                if (!cfont) return (Cursor) 0;
                     29:        }
                     30:        result = XCreateGlyphCursor 
                     31:               (dpy, cfont, cfont, which, which + 1, &foreground, &background);
                     32:        return(result);
                     33: }
                     34: 

unix.superglobalmegacorp.com

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