home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 053.lha / PlaceWindow.doc < prev    next >
Text File  |  1986-11-20  |  4KB  |  72 lines

  1. /*
  2.  * placewindow - starts a program, and make the window look like you want it
  3.  * to, not like the person who wrote the program wants it to.
  4.  *
  5.  * Copyright (c) 1987, Mike Meyer
  6.  * This program can be redistributed freely, under two conditions:
  7.  *    1) The source must be part of the distribution.
  8.  *    2) This copyright notice must stay attached to the source.
  9.  *
  10.  * usage: placewindow windowname geometry [ command ]
  11.  *
  12.  *    windowname is a proper prefix of the title for the window
  13.  *        that we're going to change.
  14.  *
  15.  *    geometry describes where the window should be, and how it should
  16.  *        look. This is an enhanced version of the con: syntax for
  17.  *        specifying where a window should go. The full spec is
  18.  *        X/Y/W/H/e. Postive X (Y) specifies the offset from the
  19.  *        left (top) edge of the screen to the left (top) edge of
  20.  *        the window. Negative X (Y) specifes the offset from the
  21.  *        right (bottom) edge of the screen to the right (bottom)
  22.  *        edge of the window. W and H are the width and height of
  23.  *        the window, respectively. Zero values for those means to
  24.  *        make the window as long as possible in that direction.
  25.  *        Obviously, you can't specify -X and 0 W, or -Y and 0 H.
  26.  *        The "e", if present, means that the maximum sizes for the
  27.  *        window should be set to -1 (any value you can mouse to).
  28.  *        Nearly any piece of this can be left off. If the value is
  29.  *        not specified (i.e., you didn't put in enough geometry to
  30.  *        reach it) then it is left unmodified. If you actually put
  31.  *        in the gemoetry specification, but don't put in a number
  32.  *        (i.e. "////") then the missing values are treated as zero.
  33.  *
  34.  *        Simple examples: "////", "////e" and "-////" all specify
  35.  *        max-sized windows. The "e" makes the max-sized window the
  36.  *        screen size, and makes the window that big. "-" positions the
  37.  *        window against the right edge of the screen if it's smaller
  38.  *        than the screen. '10////', '10////', '10////e' and '10////e'
  39.  *        all specify windows that are max-height, and stretch as far
  40.  *        as they can from 10 pixels to the right of the left edge of
  41.  *        the screen. The two with the "e" make the max-size window
  42.  *        the screen size. The first two are synonyms, as are the
  43.  *        last two. '10//100e' will be a window that start 10 pixels
  44.  *        to the right of the left edge of the screen, is 100 pixels
  45.  *        wide, and stretches from the top to the bottom of the
  46.  *        screen. '10/10//100e' will be a window with it's upper left
  47.  *        corner at 10, 10, is 100 pixels high, and stretches from
  48.  *        the left to the right edge of the screen. '10/10/100/100e'
  49.  *        and '10/10/100/100/e' both describe a 100 by 100 window with
  50.  *        it's upper left corner at 10, 10 that has had it's maximum
  51.  *        window sizes changed to the screen sizes. For leaving things
  52.  *        off, '3/10' and '3/10e' would be a window the same size as
  53.  *        the default, at location 3, 10. Note that '///' and '///e' are
  54.  *        windows at 0, 0 with max-size X, and Y left alone, but '////'
  55.  *        and '////e' are full-screen windows. Finally, a lone "e" will
  56.  *        leave the window alone, but change it's maximum size but
  57.  *        otherwise leave it alone.
  58.  *
  59.  *    command consists of all following arguments, and is a command to be
  60.  *        executed before we try resizing the window. If command is
  61.  *        given, we'll try to find the window at 1-second intervals
  62.  *        one minute (roughly), so that command can create the window.
  63.  *        If command isn't specified, we just look for the window
  64.  *        once.
  65.  *
  66.  *    Warning: Negative W and H values in the geometry aren't supported,
  67.  *        and I ain't going to say what happens if you use them.
  68.  *        Sanity checks are done on the size/position. Rather than
  69.  *        abort and have you try again, it trys to do something
  70.  *        sane. Improvements on this code are welcome.
  71.  */
  72.