Annotation of researchv10no/cmd/movie/xjerq.h, revision 1.1.1.1

1.1       root        1: #ifndef        JERQ_H
                      2: #define        JERQ_H
                      3: #include <X11/Xlib.h>
                      4: #include <X11/Xatom.h>
                      5: #include <X11/Xutil.h>
                      6: 
                      7: #ifndef NULL
                      8: #define NULL 0
                      9: #endif
                     10: 
                     11: typedef int    Word;           /* 32 bits */
                     12: 
                     13: typedef unsigned int   UWord;  /* 32 bits */
                     14: 
                     15: typedef struct Point {
                     16:        short   x;
                     17:        short   y;
                     18: } Point;
                     19: 
                     20: typedef struct Rectangle {
                     21:        Point origin;
                     22:        Point corner;
                     23: } Rectangle;
                     24: 
                     25: typedef struct Bitmap { /* a Bitmap, but offset */
                     26:        Drawable dr;
                     27:        Rectangle rect;
                     28:        int flag;
                     29: } Bitmap;
                     30: 
                     31: /*
                     32:  * Flag bits
                     33:  */
                     34: #define BI_PIXMAP      1
                     35: 
                     36: typedef struct Menu{
                     37:        char    **item;                 /* string array, ending with 0 */
                     38:        char    *(*generator)();        /* used if item == 0 */
                     39:        short   prevhit;                /* private to menuhit() */
                     40:        short   prevtop;                /* private to menuhit() */
                     41: } Menu;
                     42: 
                     43: struct Mouse {
                     44:        Point xy;
                     45:        int buttons;
                     46:        unsigned long time;
                     47: };
                     48: 
                     49: struct JProc {
                     50:        int     state;  /* only one we need */
                     51: };
                     52: #define RESHAPED       1               /* window has been changed */
                     53: #define KBD            2               /* we have keyboard input */
                     54: #define RCV            4               /* recevied from "host" proc */
                     55: #define SEND           8               /* sent to "host" proc */       
                     56: #define MOUSE          16              /* we always have the mouse */
                     57: #define CPU            32              /* we always have the cpu */
                     58: 
                     59: typedef int Code;
                     60: 
                     61: #define Texture                Pixmap
                     62: #define Font           XFontStruct
                     63: #define        wait(x)         jwait(x)
                     64: 
                     65: /* The faster implementation of Rect, Pt, and Rpt is machine dependent
                     66:    (depends on structure packing and argument passing).  To avoid
                     67:    machine dependencies, and make lint happy, use -Dsafe */
                     68: #ifdef safe
                     69: #define Rect(a,b,c,d)  SRect(a,b,c,d)
                     70: extern Point           Pt();
                     71: extern Rectangle       SRect();
                     72: extern Rectangle       Rpt();
                     73: #else
                     74: #define        Pt(x, y)         ((((short)(x))<<16)|((unsigned short)(y)))
                     75: #define        Rect(x1, y1, x2, y2)    Pt(x1, y1), Pt(x2, y2)
                     76: #define        Rpt(p1, p2)             (p1), (p2)
                     77: #endif
                     78: 
                     79: #define        muldiv(a,b,c)   ((long)((a)*((long)b)/(c)))
                     80: 
                     81: /*
                     82:  * Function Codes
                     83:  */
                     84: #define        F_STORE 0               /* target = source */
                     85: #define        F_OR    1               /* target |= source */
                     86: #define        F_CLR   2               /* target &= ~source */
                     87: #define        F_XOR   3               /* target ^= source */
                     88: 
                     89: #define button(i)              (mouse.buttons&(8>>i))
                     90: #define button1()              (mouse.buttons&4)
                     91: #define button2()              (mouse.buttons&2)
                     92: #define button3()              (mouse.buttons&1)
                     93: #define button12()             (mouse.buttons&6)
                     94: #define button13()             (mouse.buttons&5)
                     95: #define button23()             (mouse.buttons&3)
                     96: #define button123()            (mouse.buttons&7)
                     97: 
                     98: Rectangle getrectb(), getrect();
                     99: #define getrect1()             getrectb(4)
                    100: #define getrect2()             getrectb(2)
                    101: #define getrect3()             getrectb(1)
                    102: #define getrect12()            getrectb(6)
                    103: #define getrect13()            getrectb(5)
                    104: #define getrect23()            getrectb(3)
                    105: #define getrect123()           getrectb(7)
                    106: 
                    107: extern Point add(), sub(), mul(), div(), string();
                    108: extern Rectangle rsubp(), raddp(), inset();
                    109: extern Bitmap *balloc();
                    110: extern char *gcalloc(), *calloc();
                    111: extern void bfree(), gcfree();
                    112: extern void rectf(), rectfD(), bitblt(), bitbltD(),
                    113:        texture(), evtomouse();
                    114: 
                    115: #define alloc(n) calloc(n,1)
                    116: #define realtime(x) (mouse.time)
                    117: #define jstrwidth(b) strwidth(&defont,b)
                    118: 
                    119: extern Cursor ToCursor(), *cursswitch();
                    120: extern Pixmap ToPixmap();
                    121: extern Cursor normalcursor;
                    122: extern Rectangle Drect;
                    123: extern Bitmap  display;
                    124: extern GC      gcs[];
                    125: extern Display *dpy;
                    126: extern unsigned long   fgpix;
                    127: extern unsigned long   bgpix;
                    128: extern Colormap colormap;
                    129: extern XColor  fgcolor, bgcolor;
                    130: extern struct  Mouse mouse;
                    131: extern struct  JProc *P;
                    132: extern Font    defont;
                    133: 
                    134: #endif JERQ_H

unix.superglobalmegacorp.com

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