1: #include <X/mit-copyright.h>
   2: 
   3: /* $Header: XGeom.c,v 10.5 86/02/01 15:34:27 tony Rel $/
   4: /* Copyright Massachusetts Institute of Technology 1985 */
   5: 
   6: #include "XlibInternal.h"
   7: 
   8: /*
   9:  * This routine given a user supplied positional argument and a default
  10:  * argument (fully qualified) will return the position the window should take
  11:  * returns 0 if there was some problem, else the position bitmask.
  12:  */
  13: 
  14: int XGeometry (pos, def, bwidth, fwidth, fheight, xadd, yadd, x, y, width, height)
  15: char *pos;              /* user provided geometry spec */
  16: char *def;              /* default geometry spec for window */
  17: int bwidth;             /* border width */
  18: int fwidth, fheight;            /* size of position units */
  19: int xadd, yadd;             /* any additional interior space */
  20: register *x, *y, *width, *height;   /* always set on successful RETURN */
  21: {
  22:     int px, py, pwidth, pheight;    /* returned values from parse */
  23:     int dx, dy, dwidth, dheight;    /* default values from parse */
  24:     int pmask, dmask;       /* values back from parse */
  25: 
  26:     pmask = XParseGeometry(pos, &px, &py, &pwidth, &pheight);
  27:     dmask = XParseGeometry(def, &dx, &dy, &dwidth, &dheight);
  28: 
  29:     /* set default values */
  30:     *x = (dmask & XNegative) ?
  31:         DisplayWidth()  + dx - dwidth * fwidth - 2 * bwidth - xadd : dx;
  32:     *y = (dmask & YNegative) ?
  33:         DisplayHeight() + dy - dheight * fheight - 2 * bwidth - yadd : dy;
  34:     *width  = dwidth;
  35:     *height = dheight;
  36: 
  37:     if (pmask & WidthValue)  *width  = pwidth;
  38:     if (pmask & HeightValue) *height = pheight;
  39: 
  40:     if (pmask & XValue)
  41:         *x = (pmask & XNegative) ?
  42:           DisplayWidth()  + px - *width * fwidth - 2 * bwidth - xadd : px;
  43:     if (pmask & YValue)
  44:         *y = (pmask & YNegative) ?
  45:           DisplayHeight() + py - *height * fheight - 2 * bwidth - xadd: py;
  46: 
  47:     return (pmask);
  48: }

Defined functions

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