home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
053.lha
/
PlaceWindow.doc
< prev
next >
Wrap
Text File
|
1986-11-20
|
4KB
|
72 lines
/*
* placewindow - starts a program, and make the window look like you want it
* to, not like the person who wrote the program wants it to.
*
* Copyright (c) 1987, Mike Meyer
* This program can be redistributed freely, under two conditions:
* 1) The source must be part of the distribution.
* 2) This copyright notice must stay attached to the source.
*
* usage: placewindow windowname geometry [ command ]
*
* windowname is a proper prefix of the title for the window
* that we're going to change.
*
* geometry describes where the window should be, and how it should
* look. This is an enhanced version of the con: syntax for
* specifying where a window should go. The full spec is
* X/Y/W/H/e. Postive X (Y) specifies the offset from the
* left (top) edge of the screen to the left (top) edge of
* the window. Negative X (Y) specifes the offset from the
* right (bottom) edge of the screen to the right (bottom)
* edge of the window. W and H are the width and height of
* the window, respectively. Zero values for those means to
* make the window as long as possible in that direction.
* Obviously, you can't specify -X and 0 W, or -Y and 0 H.
* The "e", if present, means that the maximum sizes for the
* window should be set to -1 (any value you can mouse to).
* Nearly any piece of this can be left off. If the value is
* not specified (i.e., you didn't put in enough geometry to
* reach it) then it is left unmodified. If you actually put
* in the gemoetry specification, but don't put in a number
* (i.e. "////") then the missing values are treated as zero.
*
* Simple examples: "////", "////e" and "-////" all specify
* max-sized windows. The "e" makes the max-sized window the
* screen size, and makes the window that big. "-" positions the
* window against the right edge of the screen if it's smaller
* than the screen. '10////', '10////', '10////e' and '10////e'
* all specify windows that are max-height, and stretch as far
* as they can from 10 pixels to the right of the left edge of
* the screen. The two with the "e" make the max-size window
* the screen size. The first two are synonyms, as are the
* last two. '10//100e' will be a window that start 10 pixels
* to the right of the left edge of the screen, is 100 pixels
* wide, and stretches from the top to the bottom of the
* screen. '10/10//100e' will be a window with it's upper left
* corner at 10, 10, is 100 pixels high, and stretches from
* the left to the right edge of the screen. '10/10/100/100e'
* and '10/10/100/100/e' both describe a 100 by 100 window with
* it's upper left corner at 10, 10 that has had it's maximum
* window sizes changed to the screen sizes. For leaving things
* off, '3/10' and '3/10e' would be a window the same size as
* the default, at location 3, 10. Note that '///' and '///e' are
* windows at 0, 0 with max-size X, and Y left alone, but '////'
* and '////e' are full-screen windows. Finally, a lone "e" will
* leave the window alone, but change it's maximum size but
* otherwise leave it alone.
*
* command consists of all following arguments, and is a command to be
* executed before we try resizing the window. If command is
* given, we'll try to find the window at 1-second intervals
* one minute (roughly), so that command can create the window.
* If command isn't specified, we just look for the window
* once.
*
* Warning: Negative W and H values in the geometry aren't supported,
* and I ain't going to say what happens if you use them.
* Sanity checks are done on the size/position. Rather than
* abort and have you try again, it trys to do something
* sane. Improvements on this code are welcome.
*/