|
|
1.1 root 1: #ifndef lint
2: static char *rcsid_StoreGridBox_c = "$Header: StoreGridBox.c,v 10.4 86/11/19 16:24:52 jg Rel $";
3: #endif lint
4:
5: /*
6: * COPYRIGHT 1985, 1986
7: * DIGITAL EQUIPMENT CORPORATION
8: * MAYNARD, MASSACHUSETTS
9: * ALL RIGHTS RESERVED.
10: *
11: * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
12: * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
13: * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITIBILITY OF THIS SOFTWARE FOR
14: * ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
15: *
16: * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT RIGHTS,
17: * APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN ADDITION TO THAT
18: * SET FORTH ABOVE.
19: *
20: *
21: * Permission to use, copy, modify, and distribute this software and its
22: * documentation for any purpose and without fee is hereby granted, provided
23: * that the above copyright notice appear in all copies and that both that
24: * copyright notice and this permission notice appear in supporting documentation,
25: * and that the name of Digital Equipment Corporation not be used in advertising
26: * or publicity pertaining to distribution of the software without specific,
27: * written prior permission.
28: *
29: */
30:
31:
32: /*
33: * MODIFICATION HISTORY
34: *
35: * 000 -- M. Gancarz, DEC Ultrix Engineering Group
36: */
37:
38: #ifndef lint
39: static char *sccsid = "@(#)StoreGridBox.c 3.8 1/24/86";
40: #endif
41: /*
42: * StoreGridBox - This subroutine is used by the X Window Manager (xwm)
43: * to store the vertices for the movement resize grid and box in a
44: * vertex list.
45: */
46:
47: #include "uwm.h"
48:
49: /*
50: * Store the vertices for the movement resize grid and box in a vertex list.
51: */
52: int StoreGridBox(box, ulx, uly, lrx, lry)
53: register Vertex box[];
54: int ulx; /* Upper left X coordinate. */
55: int uly; /* Upper left Y coordinate. */
56: int lrx; /* Lower right X coordinate. */
57: int lry; /* Lower right Y coordinate. */
58: {
59: register int xthird, ythird;
60: int x1third, y1third;
61: int x2third, y2third;
62:
63: /*
64: * Xor in.
65: */
66: box[0].x = box[3].x = box[4].x = box[5].x = box[7].x = ulx;
67: box[1].x = box[2].x = box[6].x = box[8].x = lrx;
68:
69: box[0].y = box[1].y = box[4].y = box[9].y = box[11].y = uly;
70: box[2].y = box[3].y = box[10].y = box[12].y = lry;
71:
72: box[0].flags = box[5].flags = box[7].flags = box[9].flags =
73: box[11].flags = VertexDontDraw;
74:
75: /*
76: * These are the X and Y calculations for the parts of the grid that
77: * are dependent on the division by 3 calculations.
78: */
79:
80: /*
81: * Y dimension third.
82: */
83: ythird = (lry - uly) / 3;
84: y1third = uly + ythird;
85: y2third = y1third + ythird;
86:
87: /*
88: * X dimension third.
89: */
90: xthird = (lrx - ulx) / 3;
91: x1third = ulx + xthird;
92: x2third = x1third + xthird;
93:
94: /*
95: * Stash first set of vertices.
96: */
97: box[5].y = box[6].y = y1third;
98: box[7].y = box[8].y = y2third;
99:
100: box[9].x = box[10].x = x1third;
101: box[11].x = box[12].x = x2third;
102:
103: /*
104: * Do not erase if we're freezing the screen.
105: */
106: if (Freeze)
107: return(13);
108:
109: /*
110: * From here on we're retracing the vertices to clear the
111: * grid using GXxor.
112: */
113: box[18].y = box[19].y = y1third;
114: box[20].y = box[21].y = y2third;
115:
116: box[22].x = box[23].x = x1third;
117: box[24].x = box[25].x = x2third;
118:
119: box[13].x = box[16].x = box[17].x = box[18].x = box[20].x = ulx;
120: box[13].y = box[14].y = box[17].y = box[22].y = box[24].y = uly;
121:
122: box[14].x = box[15].x = box[19].x = box[21].x = lrx;
123: box[15].y = box[16].y = box[23].y = box[25].y = lry;
124:
125: box[13].flags = box[18].flags = box[20].flags = box[22].flags =
126: box[24].flags = VertexDontDraw;
127:
128:
129: /*
130: * Total number of vertices is 26.
131: */
132: return(26);
133: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.