|
|
1.1 root 1: .ds ZZ DEVELOPMENT PACKAGE
2: .TH STRUCTURES 3R "630 MTG"
3: .XE "Word"
4: .XE "Code"
5: .XE "Point"
6: .XE "Rectangle"
7: .XE "Bitmap"
8: .XE "Texture16"
9: .XE "Font"
10: .XE "Fontchar"
11: .XE "msgbuf"
12: .XE "message_list"
13: .XE "msqid_ds"
14: .SH NAME
15: structures: Word, Code, Point, Rectangle, Bitmap, Texture16, Font, Fontchar, msgbuf, message_list, msqid_ds \- 630 MTG Structures
16: .SH SYNOPSIS
17: .ft B
18: #include <dmd.h>
19: .sp
20: #include <font.h>
21: .sp
22: #include <message.h>
23: .SH DESCRIPTION
24: In the following summaries,
25: all coordinates are screen or Bitmap coordinates
26: (which are scaled the same)
27: unless specified as window coordinates.
28: .I Word ,
29: .I Code ,
30: .I Point ,
31: .I Rectangle ,
32: .I Bitmap
33: and
34: .I Texture16
35: are included in a program
36: by including
37: .BR dmd.h .
38: .I Font
39: and
40: .I Fontchar
41: are defined in
42: .BR font.h .
43: .IR Msgbuf ,
44: .IR message_list ,
45: and
46: .I msqid_ds
47: are defined in
48: .BR message.h .
49: .SH \fIWord\fR
50: .RS 3
51: .ft CM
52: typedef short Word;
53: .br
54: typedef unsigned short UWord;
55: .RE
56: .PP
57: A
58: .I Word
59: is a 16-bit integer and is the unit of storage used in the graphics software.
60: .SH \fICode\fR
61: .RS 3
62: .ft CM
63: typedef int Code;
64: .RE
65: .PP
66: .I Code
67: is the functional constant used in all graphical drawing or copying
68: operations. Available Codes are:
69: .PP
70: .RS 3
71: .nf
72: .ft CM
73: F_STORE target = source
74: F_OR target |= source
75: F_XOR target ^= source
76: F_CLR target &= ~source
77: .fi
78: .ft 1
79: .RE
80: .SH \fIPoint\fR
81: .RS 3
82: .nf
83: .ft CM
84: typedef struct Point {
85: short x; /* x-coordinate */
86: short y; /* y-coordinate */
87: } Point;
88: .fi
89: .ft 1
90: .RE
91: .PP
92: A
93: .I Point
94: is a location in a
95: .IR Bitmap ,
96: such as the display.
97: The coordinate system has
98: .I x
99: increasing to the right and
100: .I y
101: increasing down.
102: .SH \fIRectangle\fR
103: .RS 3
104: .nf
105: .ft CM
106: typedef struct Rectangle {
107: Point origin; /* Upper left corner */
108: Point corner; /* Lower right corner*/
109: } Rectangle;
110: .fi
111: .ft 1
112: .RE
113: .PP
114: A
115: .I Rectangle
116: is a rectangular area in a
117: .IR Bitmap .
118: By definition
119: .BR "origin.x<=corner.x" " and " "origin.y<=corner.y"
120: define the rectangle.
121: By convention, the right (maximum \f2x\f1) and bottom (maximum \f2y\f1) edges are
122: excluded from the represented rectangle, so abutting rectangles have no
123: points in common. Thus
124: .I corner
125: is the coordinates of the first point beyond the rectangle.
126: The data on the screen of the 630 MTG is contained in the
127: .B Rectangle
128: \f3{0, 0, \s-1XMAX, YMAX\s+1}\f1
129: where
130: \f3\s-1XMAX\s+1=1024\f1
131: and
132: \f3\s-1YMAX\s+1=1024\f1.
133: .SH \fIBitmap\fR
134: .RS 3
135: .nf
136: .ft CM
137: typedef struct Bitmap {
138: Word *base;/* pointer to start of data */
139: unsigned short width;/* width in Words of total data area */
140: Rectangle rect; /* rectangle describing data area */
141: char *_null; /* unused, must always be zero */
142: } Bitmap;
143: .fi
144: .ft 1
145: .RE
146: .PP
147: A
148: .I Bitmap
149: holds a rectangular image stored in contiguous memory starting at
150: .I base.
151: Each
152: .I width
153: words of memory form a scan-line of the image.
154: The
155: .I rect
156: argument
157: defines the coordinate system inside the
158: .IR Bitmap .
159: Argument
160: .I rect.origin
161: is the location in the
162: .I Bitmap
163: of the upper-leftmost point in the image
164: and is not necessarily (0,0).
165: Graphical operations performed on a \f2Bitmap\f1 are clipped to
166: .I rect.
167: .SH \fITexture16\fR
168: .RS 3
169: .nf
170: .ft CM
171: typedef struct Texture16 {
172: Word bits[16];
173: } Texture16;
174: .fi
175: .ft 1
176: .RE
177: .PP
178: A
179: .I Texture16
180: is a 16\(mu16 bit dot pattern.
181: \f2Texture16\f1's
182: are aligned to absolute display positions,
183: so adjacent areas colored with the same
184: .I Texture16
185: align smoothly.
186: .SH \fIFont\fR \fRand \fIFontchar\fR
187: .RS 3
188: \s-3
189: .nf
190: .ft CM
191: typedef struct Fontchar
192: {
193: short x; /* left edge of character cell in Font.bits */
194: unsigned char top; /* first non-zero scan-line of character image */
195: unsigned char bottom; /* last non-zero scan-line of character image */
196: char left; /* offset of baseline from x; used for kerning */
197: unsigned char width; /* width of baseline for character image */
198: } Fontchar;
199:
200: typedef struct Font
201: {
202: short n; /* number of characters in font */
203: char height; /* height of the Bitmap bits */
204: char ascent; /* top of Bitmap to baseline of character image */
205: long unused;
206: Bitmap *bits; /* Bitmap where the characters are stored */
207: Fontchar info[1]; /* n+1 character descriptors */
208: } Font;
209: .fi
210: .ft 1
211: .RE
212: .PP
213: A
214: .I Font
215: is a character set. For each character in a
216: .I Font
217: there is information stored in a
218: .I Fontchar
219: structure.
220: .B Font.info[n]
221: is a dummy fontchar descriptor used to determine
222: the right edge of the last character in
223: .BR Font.bits .
224: The actual character images in the
225: .I Font
226: are stored in a single
227: .I Bitmap
228: pointed to by
229: \f2bits\f1.
230: The
231: .I Bitmap
232: contains the bit pattern for each character, arrayed adjacently into a
233: long horizontal strip. The characters in the
234: .I Bitmap
235: must appear in ASCII order and are aligned on the same baseline.
236: Characters in the
237: .I Bitmap
238: abut exactly, so the width of a character
239: .I c
240: is
241: .BR "Font.info[c+1].x-Font.info[c].x" .
242: When a character is displayed on the screen at a point
243: .I p ,
244: the upper left-hand corner of the rectangle enclosing the
245: character image coincides with the point
246: .IR p .
247: .SH \fImsqid_ds\fR, \fImessage_list\fR and \fImsgbuf\fR
248: .RS 3
249: .nf
250: .ft CM
251: typedef struct msgbuf
252: {
253: long mtype; /* message type */
254: char mtext[1]; /* text of message */
255: } msgbuf;
256:
257: typedef struct message_list
258: {
259: msgbuf *msg; /* the message in the queue */
260: int size; /* size of the message */
261: struct message_list *next; /* link to next message */
262: } message_list;
263:
264: typedef struct msqid_ds
265: {
266: Struct Proc *cid; /* creator process id */
267: short msg_qnum; /* number of messages */
268: short msg_qbytes; /* max number of bytes */
269: Struct Proc *msg_lspid; /* last process to send */
270: Struct Proc *msg_lrpid; /* last process to rcv */
271: unsigned long msg_stime; /* time of last send */
272: unsigned long msg_rtime; /* time of last rcv */
273: unsigned long msg_ctime; /* time of last change */
274: message_list *msg_list; /* linked list of messages */
275: short msg_curbytes /* current # of bytes */
276: short state; /* remove queue if cid exits? */
277: long name; /* name of queue (key) */
278: struct msqid_ds *next; /* link to next queue */
279: } msqid_ds;
280: .ft 1
281: .fi
282: .RE
283: .PP
284: A
285: .I msqid_ds
286: is a message queue. The messages in the queue are kept in a linked list
287: referenced by the pointer
288: .IR msg_list .
289: The actual messages are stored in
290: .IR msgbuf s
291: which are pointed to by
292: .IR message_list .
293: .I Msg_qbytes
294: is initialized to
295: .B MAX_QBYTES
296: where
297: .B MAX_QBYTES=020000
298: (decimal 8192).
299: The
300: .I msqid_ds
301: is stored in a linked list in the 630 so that the number
302: of message queues is limited only by memory.
303: .SH FILES
304: $DMD/include/dmd.h
305: .br
306: $DMD/include/font.h
307: .br
308: $DMD/include/message.h
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.