1: #include <X/mit-copyright.h>
   2: 
   3: /* Copyright    Massachusetts Institute of Technology    1985	*/
   4: 
   5: /*
   6:  *	StoreGridBox - This subroutine is used by the X Window Manager (xwm)
   7:  *	to store the vertices for the movement resize grid and box in a
   8:  *	vertex list.
   9:  *
  10:  *	File:		StoreGridBox.c
  11:  */
  12: 
  13: #ifndef lint
  14: static char *rcsid_StoreGridBox_c = "$Header: StoreGridBox.c,v 10.3 86/02/01 16:10:17 tony Rel $";
  15: #endif
  16: 
  17: #include "xwm.h"
  18: 
  19: /*
  20:  * Store the vertices for the movement resize grid and box in a vertex list.
  21:  */
  22: int StoreGridBox(box, ulx, uly, lrx, lry)
  23:     register Vertex box[];
  24:     register int ulx;       /* Upper left X coordinate. */
  25:     register int uly;       /* Upper left Y coordinate. */
  26:     register int lrx;       /* Lower right X coordinate. */
  27:     register int lry;       /* Lower right Y coordinate. */
  28: {
  29:     register int value;
  30:     int third;
  31: 
  32:     /*
  33:      * Xor box in.
  34:      */
  35:     box[0].x = ulx;  box[0].y = uly;  box[0].flags = VertexDontDraw;
  36:     box[1].x = lrx;  box[1].y = uly;
  37:     box[2].x = lrx;  box[2].y = lry;
  38:     box[3].x = ulx;  box[3].y = lry;
  39:     box[4].x = ulx;  box[4].y = uly;
  40: 
  41:     /*
  42:      * Xor grid in.
  43:      */
  44:     box[5].x = ulx;     box[5].flags = VertexDontDraw;
  45:     box[6].x = lrx;
  46:     box[7].x = ulx;     box[7].flags = VertexDontDraw;
  47:     box[8].x = lrx;
  48:     box[9].y = uly;     box[9].flags = VertexDontDraw;
  49:     box[10].y = lry;
  50:     box[11].y = uly;    box[11].flags = VertexDontDraw;
  51:     box[12].y = lry;
  52: 
  53:     /*
  54:      * Xor out.
  55:      */
  56:     box[13].x = ulx;  box[13].y = uly;  box[13].flags = VertexDontDraw;
  57:     box[14].x = lrx;  box[14].y = uly;
  58:     box[15].x = lrx;  box[15].y = lry;
  59:     box[16].x = ulx;  box[16].y = lry;
  60:     box[17].x = ulx;  box[17].y = uly;
  61: 
  62:     /*
  63:      * Xor grid out.
  64:      */
  65:     box[18].x = ulx;    box[18].flags = VertexDontDraw;
  66:     box[19].x = lrx;
  67:     box[20].x = ulx;    box[20].flags = VertexDontDraw;
  68:     box[21].x = lrx;
  69:     box[22].y = uly;    box[22].flags = VertexDontDraw;
  70:     box[23].y = lry;
  71:     box[24].y = uly;    box[24].flags = VertexDontDraw;
  72:     box[25].y = lry;
  73: 
  74:     /*
  75:      * These are the X and Y calculations for the parts of the grid that
  76:      * are dependent the division by 3 calculations.
  77:      */
  78: 
  79:     /*
  80:      * Y dimension third.
  81:      */
  82:     third = (lry - uly) / 3;
  83: 
  84:     value = uly + third;
  85: 
  86:     box[5].y = value;
  87:     box[6].y = value;
  88:     box[18].y = value;
  89:     box[19].y = value;
  90: 
  91:     value += third;
  92: 
  93:     box[7].y = value;
  94:     box[8].y = value;
  95:     box[20].y = value;
  96:     box[21].y = value;
  97: 
  98:     /*
  99:      * X dimension third.
 100:      */
 101:     third = (lrx - ulx) / 3;
 102: 
 103:     value = ulx + third;
 104: 
 105:     box[9].x = value;
 106:     box[10].x = value;
 107:     box[22].x = value;
 108:     box[23].x = value;
 109: 
 110:     value += third;
 111: 
 112:     box[11].x = value;
 113:     box[12].x = value;
 114:     box[24].x = value;
 115:     box[25].x = value;
 116: 
 117:     /*
 118:      * Total number of vertices is 26.
 119:      */
 120:     return(26);
 121: }

Defined functions

Defined variables

rcsid_StoreGridBox_c defined in line 14; never used
Last modified: 1986-02-01
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 887
Valid CSS Valid XHTML 1.0 Strict