|
|
1.1 root 1: #ifndef lint
2: static char *rcsid_StoreBox_c = "$Header: StoreBox.c,v 1.3 87/09/11 08:21:43 toddb Exp $";
3: #endif lint
4:
5: #include <X11/copyright.h>
6:
7: /*
8: * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
9: *
10: * All Rights Reserved
11: *
12: * Permission to use, copy, modify, and distribute this software and its
13: * documentation for any purpose and without fee is hereby granted,
14: * provided that the above copyright notice appear in all copies and that
15: * both that copyright notice and this permission notice appear in
16: * supporting documentation, and that the name of Digital Equipment
17: * Corporation not be used in advertising or publicity pertaining to
18: * distribution of the software without specific, written prior permission.
19: *
20: *
21: * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
22: * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
23: * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
24: * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
25: * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
26: * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
27: * SOFTWARE.
28: */
29:
30:
31:
32: /*
33: * MODIFICATION HISTORY
34: *
35: * 000 -- M. Gancarz, DEC Ultrix Engineering Group
36: * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
37: Western Software Lab. Convert to X11.
38: */
39:
40: #ifndef lint
41: static char *sccsid = "@(#)StoreBox.c 3.8 1/24/86";
42: #endif
43: /*
44: * StoreBox - This subroutine is used by the X Window Manager (xwm)
45: * to store the vertices for the resize / movement box in a vertex list.
46: */
47:
48: #include "uwm.h"
49:
50: /*
51: * Store the vertices for the resize movement box in a vertex list.
52: */
53: int StoreBox(box, ulx, uly, lrx, lry)
54: register XSegment box[];
55: int ulx; /* Upper left X coordinate. */
56: int uly; /* Upper left Y coordinate. */
57: int lrx; /* Lower right X coordinate. */
58: int lry; /* Lower right Y coordinate. */
59: {
60: /*
61: * Xor in.
62: */
63:
64: box[0].x1 = ulx; box[0].y1 = uly;
65: box[0].x2 = lrx; box[0].y2 = uly;
66:
67: box[1].x1 = lrx; box[1].y1 = uly;
68: box[1].x2 = lrx; box[1].y2 = lry;
69:
70: box[2].x1 = lrx; box[2].y1 = lry;
71: box[2].x2 = ulx; box[2].y2 = lry;
72:
73: box[3].x1 = ulx; box[3].y1 = lry;
74: box[3].x2 = ulx; box[3].y2 = uly;
75:
76:
77: /*
78: * If we freeze the screen, don't bother to xor out.
79: */
80: if (Freeze)
81: return(4);
82:
83: /*
84: * Xor out.
85: */
86: box[4].x1 = ulx; box[4].y1 = uly;
87: box[4].x2 = lrx; box[4].y2 = uly;
88:
89: box[5].x1 = lrx; box[5].y1 = uly;
90: box[5].x2 = lrx; box[5].y2 = lry;
91:
92: box[6].x1 = lrx; box[6].y1 = lry;
93: box[6].x2 = ulx; box[6].y2 = lry;
94:
95: box[7].x1 = ulx; box[7].y1 = lry;
96: box[7].x2 = ulx; box[7].y2 = uly;
97:
98:
99: /*
100: * Total number of vertices is 8.
101: */
102: return(8);
103: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.