#pragma lib "/$M/lib/alef/libg.a" /* * Types */ aggr Point { int x; int y; }; aggr Rectangle { Point min; Point max; }; aggr Bitmap { Rectangle r; /* rectangle in data area, local coords */ Rectangle clipr; /* clipping region */ int ldepth; int id; Bitmap *cache; /* zero; distinguishes bitmap from layer */ }; aggr Mouse { int mb; Point m; uint tick; }; aggr Cursor { Point offset; char clr[2*16]; char set[2*16]; }; aggr Linedesc { int x0; int y0; char xmajor; char slopeneg; int dminor; int dmajor; }; /* * Subfonts * * given char c, Subfont *f, Fontchar *i, and Point p, one says * i = f->info+c; * bitblt(b, Pt(p.x+i->left,p.y+i->top), * bitmap, Rect(i->x,i->top,(i+1)->x,i->bottom), * fc); * p.x += i->width; * where bitmap b is the repository of the images. * */ aggr Fontchar { usint x; /* left edge of bits */ char top; /* first non-zero scan-line */ char bottom; /* last non-zero scan-line + 1 */ char left; /* offset of baseline */ char width; /* width of baseline */ }; aggr Subfont { sint n; /* number of chars in font */ char height; /* height of bitmap */ char ascent; /* top of bitmap to baseline */ Fontchar *info; /* n+1 character descriptors */ int id; /* of font */ }; enum { /* starting values */ LOG2NFCACHE = 6, NFCACHE = (1<>8; } #define BPLONG(p, v) {(p)[0]=(v); (p)[1]=(v)>>8; (p)[2]=(v)>>16; (p)[3]=(v)>>24; }