|
|
1.1 root 1: /* $Header: private.h,v 10.1 86/11/19 10:46:15 jg Exp $ */
2: /* Copyright 1985 Massachusetts Institute of Technology */
3:
4: /* private.h - Defines and macros to access private data structures
5: *
6: * Changes and modifications by:
7: *
8: * Scott Bates
9: * Brown University
10: * IRIS, Box 1946
11: * Providence, RI 02912
12: *
13: *
14: * Copyright (c) 1986 Brown University
15: *
16: * Permission to use, copy, modify and distribute this software and its
17: * documentation for any purpose and without fee is hereby granted, provided
18: * that the above copyright notice appear in all copies, and that both
19: * that copyright notice and this permission notice appear in supporting
20: * documentation, and that the name of Brown University not be used in
21: * advertising or publicity pertaining to distribution of the software
22: * without specific, written prior permission. Brown University makes no
23: * representations about the suitability of this software for any purpose.
24: * It is provided "as-is" without express or implied warranty.
25: */
26:
27: #include <sys/types.h>
28: #include <stdio.h>
29: #include <errno.h>
30: #include "vsinput.h"
31: #include "Xdev.h"
32: #include "X.h"
33: #include <sys/ioctl.h>
34: #include <sgtty.h>
35: #include <fcntl.h>
36: #include <sys/tbioctl.h>
37: #include <machineio/mouseio.h>
38: #include <machinecons/xio.h>
39:
40: #define ConstantPixmap 0 /* kinds of pixmaps, constant */
41: #define BitmapPixmap 1 /* and ones with associated bitmaps */
42:
43: #define CanBeTiled 1 /* this pixmap can be tiled */
44: #define CannotBeTiled 0 /* this pixmap cannont be tiled */
45:
46: #define InvertFlag 0x10 /* pixmap source should be inverted */
47: #define PTYPE(x) (((int) (x)->kind) & 0xF) /* get type */
48: #define PINVERT(x) (((int) (x)->kind) >> 4) /* get invert flag */
49:
50: #define TILE_SIZE 16 /* tile size in shorts */
51: #define TILE_WIDTH 16 /* tile width in bits */
52: #define TILE_HEIGHT 16 /* tile height in bits */
53:
54: #define CURSOR_SIZE 16 /* cursor size in shorts */
55: #define CURSOR_WIDTH 16 /* cursor width in bits */
56: #define CURSOR_HEIGHT 16 /* cursor height in bits */
57:
58: #define CDATA(x) ((CursPriv *) x->data) /* get pntr to private cursor data */
59:
60: typedef struct _curspriv { /* private data struct for cursor */
61: u_short data[CURSOR_SIZE]; /* cursor image */
62: u_short mask[CURSOR_SIZE]; /* cursor mask */
63: struct { /* cursor hot spot */
64: short y;
65: short x;
66: } hotspot;
67: } CursPriv;
68:
69: #define FDATA(x) ((FontPriv *) x->data) /* get pntr to private font data */
70:
71: typedef struct _fontpriv { /* private font data */
72: int maxwidth; /* maximum width found in the font */
73: short *widths; /* width table (in pixels) */
74: short *leftarray; /* leftarray */
75: BITMAP *chrs; /* individual character bitmaps */
76: BITMAP *offscr; /* the font offscreen bitmap */
77: } FontPriv;
78:
79: #define BDATA(x) ((u_short *) x->data) /* get pntr to private bitmap data */
80:
81: #define PDATA(x) ((BITMAP *) x->data) /* get pntr to private pixmap data */
82:
83: /*
84: * Define for the global text offscreen array of unsigned shorts.
85: * Each offscr BITMAP.data structure will point to this array.
86: * When each font is opened, it uses this buffer which is designed to
87: * be as wide as the widest display and 128 bits high.
88: * This is roughly 20K. (For all fonts.)
89: * (We are assuming some day one will have a 1280x1024 screen.)
90: */
91: #define MAX_OFFSCR_WD 1280
92: #define MAX_OFFSCR_HT 128
93: #define TEXT_BUFFER_SIZE ((MAX_OFFSCR_WD * MAX_OFFSCR_HT) >> 4)
94: #define CH_THRESHOLD 3
95:
96: /*
97: * Path list type flags
98: */
99:
100: #define DRAW_PATH_LIST 0
101: #define FILL_PATH_LIST 1
102:
103: /*
104: * These macors are used in place of floating point
105: * code to get precision to the second decimal place
106: * using interger math.
107: */
108:
109: #define SHIFT_LEFT_16(x) \
110: (((x) < 0) ? -(-(x) << 16) : (x) << 16)
111:
112: #define ROUND_16(x) \
113: (((x) < 0) ? -((-(x) + 32768) >> 16) : (((x) + 32768) >> 16))
114:
115: #define PERCENT_16(x, n, d) \
116: (((x) < 0) ? -((-(x) / d) * n) : (((x) / d) * n))
117:
118: /*
119: * Macro to obtain address of the screens
120: * BITMAP structure
121: */
122:
123: #define SCREEN_BITMAP &pbm
124:
125: /*
126: * Externs and declarations
127: */
128:
129: extern BITMAP pbm;
130: extern BITMAP txtbm;
131: extern u_short *ConstantTiles[];
132: extern PIXMAP constpix0;
133: extern PIXMAP constpix1;
134: extern char FBMap[];
135: extern char SSMap[];
136: extern int errno;
137:
138: BITMAP *CharBitmap();
139: BITMAP *MakeMask();
140: PIXMAP *MakePixmap();
141: char *Xalloc(), *calloc();
142: char *strcpy(), *strcat();
143: char *getenv();
144: long lseek();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.