struct Bitmap
{
Rectangle r; /* rectangle in data area, local coords */
Rectangle clipr; /* clipping region */
int ldepth;
int id;
Bitmap *cache; /* zero; distinguishes bitmap from layer */
};
struct Mouse
{
int buttons; /* bit array: LMR=124 */
Point xy;
ulong msec;
};
struct Cursor
{
Point offset;
uchar clr[2*16];
uchar set[2*16];
};
struct Menu
{
char **item;
char *(*gen)(int);
int lasthit;
};
struct Linedesc
{
int x0;
int y0;
char xmajor;
char slopeneg;
long dminor;
long 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.
*
*/
struct Fontchar
{
ushort x; /* left edge of bits */
uchar top; /* first non-zero scan-line */
uchar bottom; /* last non-zero scan-line + 1 */
char left; /* offset of baseline */
uchar width; /* width of baseline */
};
struct Subfont
{
short n; /* number of chars in font */
uchar height; /* height of bitmap */
char ascent; /* top of bitmap to baseline */
Fontchar *info; /* n+1 character descriptors */
int id; /* of font */
};
struct Cachefont
{
Rune min; /* rune value of 0th char in subfont */
Rune max; /* rune value+1 of last char in subfont */
int abs; /* name has been made absolute */
char *name;
};
struct Cacheinfo
{
Rune value; /* value of character at this slot in cache */
ushort age;
ulong xright; /* right edge of bits */
Fontchar;
};
struct Cachesubf
{
ulong age; /* for replacement */
Cachefont *cf; /* font info that owns us */
Subfont *f; /* attached subfont */
};
struct Font
{
char *name;
uchar height; /* max height of bitmap, interline spacing */
char ascent; /* top of bitmap to baseline */
char width; /* widest so far; used in caching only */
char ldepth; /* of images */
short id; /* of font */
short nsub; /* number of subfonts */
ulong age; /* increasing counter; used for LRU */
int ncache; /* size of cache */
int nsubf; /* size of subfont list */
Cacheinfo *cache;
Cachesubf *subf;
Cachefont **sub; /* as read from file */
};
struct Event
{
int kbdc;
Mouse mouse;
int n; /* number of characters in mesage */
uchar data[EMAXMSG]; /* message from an arbitrary file descriptor */
};