Annotation of 43BSDTahoe/new/X/libapollo/Xapollo.h, revision 1.1.1.1

1.1       root        1: /* $Header: Xapollo.h,v 10.1 86/11/29 13:53:26 jg Rel $ */
                      2:     /*
                      3: 
                      4:     Copyright 1986 by the University of Utah
                      5: 
                      6:     Permission to use, copy, modify, and distribute this
                      7:     software and its documentation for any purpose and without
                      8:     fee is hereby granted, provided that the above copyright
                      9:     notice appear in all copies and that both that copyright
                     10:     notice and this permission notice appear in supporting
                     11:     documentation, and that the name of the University of Utah
                     12:     not be used in advertising or publicity pertaining to 
                     13:     distribution of the software without specific, written 
                     14:     prior permission. The University of Utah makes no
                     15:     representations about the suitability of this software for
                     16:     any purpose.  It is provided "as is" without express or
                     17:     implied warranty.
                     18: 
                     19:     */
                     20: 
                     21: #include <stdio.h>
                     22: #include "/sys/ins/base.ins.c"
                     23: #include "/sys/ins/error.ins.c"
                     24: #include "/sys/ins/gpr.ins.c"
                     25: #include "/sys/ins/pad.ins.c"
                     26: #include "/sys/ins/streams.ins.c"
                     27: #include "/sys/ins/ms.ins.c"
                     28: #include <sys/types.h>
                     29: 
                     30: #include <X/X.h>
                     31: #include "../X/vsinput.h"
                     32: #include "../X/Xdev.h"
                     33: 
                     34: #define dprintf if(Xdbg) fprintf
                     35: 
                     36: #define ConstantPixmap 0x0     /* kinds of pixmaps on apollo, constant */
                     37: #define BitmapPixmap 0x1       /* and ones with associated bitmaps   */
                     38: #define        ZColorPixmap 0x2        /* and (up to) 8-bit color ones */
                     39: #define XYColorPixmap 0x3      /* in both styles (but they're not done yet) */
                     40: #define CanBeTiled 1           /* this pixmap can be tiled           */
                     41: #define CannotBeTiled 0                /* this pixmap cannont be tiled       */
                     42: 
                     43: #define InvertFlag 0x10                /* pixmap source should be inverted   */
                     44: #define PTYPE(x) (((int) (x)->kind) & 0xf)
                     45: #define PINVERT(x) (((int) (x)->kind) >> 4)
                     46: 
                     47: typedef enum { apollo_bitmap, memory_bitmap } BitmapType;
                     48: #define BM_TYPE(bm)     ( (BitmapType)((bm)->kind) )
                     49: #define A_BITMAP(bm)    ( (int)((bm)->data ) )
                     50: #define M_BITMAP(bm)    ( (short *)((bm)->data) )
                     51: 
                     52: 
                     53: typedef struct _fontpriv {
                     54:        int maxwidth;           /* maximum width found in the font */
                     55:        short *widths;          /* width table (in pixels)         */
                     56:        short *leftarray;       /* leftarray                       */
                     57:        boolean ap_font;        /* true->Apollo format font        */
                     58:        int ap_font_id;         /* the font id returned by gpr_$load_font */
                     59:        int ap_font_id_inv;     /* ditto for the inverse font      */
                     60:        BITMAP *strike;         /* the font bitmap (not for Apollo format) */
                     61:        long *chrs;             /* chars in independent bitmaps    */
                     62: } FontPriv;
                     63: 
                     64: typedef struct _curspriv {
                     65:         BITMAP *bits;          /* the cursor image     */
                     66:        BITMAP *mask;           /* the mask bitmap      */
                     67:        BITMAP *save;           /* a place to save what the cursor covers */
                     68:        int fore, back;
                     69: } CursPriv;
                     70: 
                     71: #define CDATA(x) ((CursPriv *) x->data)
                     72: 
                     73: #define PDATA(x) ((BITMAP *) x->data)
                     74: 
                     75: #define CURSOR_WIDTH   16
                     76: #define CURSOR_HEIGHT  16
                     77: 
                     78: #define GetNextClip(clips, win) \
                     79:        win.x_coord = clips->left; \
                     80:        win.y_coord = clips->top; \
                     81:        win.x_size = clips->width; \
                     82:        win.y_size = clips->height; \
                     83:        clips++;
                     84: 
                     85: #define        OverLap(win, x2, y2, w2, h2)    \
                     86:        ((win.x_coord < x2+w2) && (win.y_coord < y2+h2) && \
                     87:         (x2 < win.x_coord+win.x_size) && (y2 < win.y_coord+win.y_size))
                     88: 
                     89: #define imin(i,j)      ((i)<(j)?(i):(j))
                     90: 
                     91: #define imax(i,j)      ((i)>(j)?(i):(j))
                     92: 
                     93: #define set_zmask( zmask ) \
                     94:         { extern long old_zmask; \
                     95:         if (old_zmask != zmask) { \
                     96:          gpr_$set_plane_mask((gpr_$mask_t)(zmask & Screen.plane_mask), status); \
                     97:          old_zmask = zmask; \
                     98:          } \
                     99:        }
                    100: 
                    101: #define set_op( op ) \
                    102:     { extern int old_op; \
                    103:     if (old_op != op) { \
                    104:        for (i=0; i<Screen.depth; i++) \
                    105:          gpr_$set_raster_op( (gpr_$plane_t)i, (gpr_$raster_op_t)op, status ); \
                    106:        old_op = op; \
                    107:        } \
                    108:      }
                    109: 
                    110: #define CheckCursor(basex, basey, w, h) \
                    111:     { extern int CursorDisplayed; \
                    112:       extern DEVICE *CurrentDevice; \
                    113:       extern CURSOR *CurrentCursor; \
                    114:       int mousex = CurrentDevice->mouse->x; \
                    115:       int mousey = CurrentDevice->mouse->y; \
                    116:       if (CursorDisplayed && \
                    117:          (basex < mousex+CurrentCursor->width) && \
                    118:          (basey < mousey+CurrentCursor->height) && \
                    119:          (mousex < basex+w) && (mousey < basey+h)) \
                    120:            DisplayCursor(NULL); \
                    121:     }
                    122: 
                    123: #define RestoreCursor() \
                    124:     { extern int CursorDisplayed; \
                    125:       extern CURSOR *CurrentCursor; \
                    126:       extern DisplayCursor(); \
                    127:       if (!CursorDisplayed) \
                    128:        DisplayCursor(CurrentCursor); \
                    129:     }
                    130: 
                    131: extern struct Scr {
                    132:     gpr_$plane_t depth;
                    133:     gpr_$mask_t plane_mask;
                    134:     short width;                /*  screen width */
                    135:     short height;               /*  screen height */
                    136:     short line_width;           /*  halfwords between scan lines */
                    137:     caddr_t ptr;               /*  memory ptr to bitmap */
                    138:     stream_$id_t fd;            /*  file descriptor for screen pad */
                    139:     gpr_$bitmap_desc_t bm;      /*  bitmap descriptor */
                    140:     gpr_$attribute_desc_t ab;   /*  attribute descriptor */
                    141: } Screen;
                    142: 
                    143: BITMAP * make_bitmap();         
                    144: 
                    145: extern int Xdbg;
                    146: 
                    147: 

unix.superglobalmegacorp.com

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