   _______       __    __    __ ___ ___ ___ ___ ___ ___
  |   _   \---.-.  |--.__|--|  |   Y   |   Y   |   Y   |
  |.  l   /  _  |  _  |  |  _  |.  |   |.  |   |.      |
  |.  _   1___._|_____|__|_____|.  |   |. / \  |. \_/  |
  |:  |   |                    |:  1   |:      |:  |   |
  |::.|:. |  v1.0 alpha 4       \:.. ./|::.|:. |::.|:. |
  `--- ---'                      `---' `--- ---'--- ---'

Comments & Complaints to rabidcow@juno.com

This is a completely new VWM, written from scratch as I was annoyed at working 
around all the sysvwm bugs.  Of course I wouldn't've known how to write this 
without it, so thanks to everyone who worked on sysvwm (and ckVWM)!

The two main things I'm going for are a vwm that looks as good as possible and 
every little insane feature I can think of.

v1.0 alpha 4 (this release) supports these step.rc commands:


---- The Basics

VWMPos <x> <y>
VWMx <x>
VWMy <y>

  These set the position of the main vwm window, you can specify them in one line 
with VWMPos or in two with VWMx and VWMy.  Some possible coordinates are:
	VWMPos 0 0	; left edge of screen
	VWMPos -0 0	; right edge of screen
	VWMPos %50-20 0	; 20 pixels left of center of screen
	VWMPos %25 0	; 25% across the screen
Percent based values are only allowed when you use the combined command, VWMPos

VWMSize <width> <height>
VWMWidth <width>
VWMHeight <height>

  These set the size of the main vwm window, again you can set them in one line or 
two.  All forms accepted for position can be used.

VWMDesks <x> <y>
VWMDesksX <x>
VWMDesksY <y>

  Specifies the number of virtual desktops across and down.  Only positive integers 
are allowed.


----- Colors and Bevels

VWMForeColor <color>		- miniwindow color
VWMWinColor <color>		- miniwindow color if bevel
VWMBorderColor <color>		- border color for everything and titlebar color
VWMBackColor <color>		- main window color
VWMSelBackColor <color>		- selected desk and flash color

  These should behave the same as for sysvwm, except color values can also be 
specified as:
	VWMWinColor :2		; system active titlebar color (see table below)
	VWMWinColor :2*64	; system active titlebar color, scaled by 64
	VWMWinColor 00a000*-32	; standard ls color, scaled by -32
(the scale values are the same as for ...Bevel)

VWMTitleColor <color>

  Specifies the color of the titlebar, defaults to the border color.

VWMFlashColor <color>

  The color that windows flash with.

VWMBevel

  Turns on bevelling so that there's a raised edge around all of the miniwindows.

VWMWinBevel <amount>
VWMTitleBevel <amount>
VWMBackBevel <amount>

  Specify the amount of bevel for each item, default is 64.  This will have no 
effect if VWMBevel is not specified, and currently bevels are not drawn for the 
main window.  An amount of 0 will effectively remove the bevel, but the border 
color will not show up.  A negative amount will make the bevelled areas look 
depressed rather than raised.

System colors (:###) are the same as for GetSysColor(), or:
	:0		Scrollbar color
	:1		Background color
	:2		Active titlebar color
	:3		Inactive titlebar color
	:4		Menu color
	:5		Window color
	:6		Window "frame" color?
	:7		Menu text color
	:8		Window text color
	:9		Active titlebar text color
	:10		Active window border color
	:11		Inactive window border color
	:12		Background color of MDI window
	:13		Selected item color
	:14		Selected item text color
	:15		Button/3D item color
	:16		Button/3d item shadow color
	:17		Disabled item text color
	:18		Button/3d item text color
	:19		Inactive titlebar text color
	:20		Button/3d item highlight color
   -- Windows 95 and newer --
	:21		Button/3d item dark shadow color
	:22		Button/3d item bright highlight color
	:23		Tooltip text color
	:24		Tooltip background color
	:25		undefined
   -- Windows 2000 and newer (not 98/ME?) --
	:26		"hotlight"?
	:27		Active titlebar gradient color
	:28		Inactive titlebar gradient color
   -- Windows XP and newer --
	:29		"menuhilight"?
	:30		"menubar"?


----- Bitmaps

VWMBackBmp <bitmap>
VWMBackBorder
VWMBackTile

  Instructs the vwm to use a bitmap for the background of the main window, and 
specifies which bitmap should be used.  VWMBackTile makes the back bitmap tiled 
rather than stretched.  Use this if you just want to specify one bitmap and tile it 
for every desktop, for example.

VWMDeskBorder

  Defines a border area inside the VWM window where desktops are not drawn.  The 
select bitmap can overlap this area.

VWMSelBmp
VWMSelBorder
VWMSelTile

  Bitmap for selected desktop.

VWMSelExpand <border crud>

  The desktop selection area is expanded by this amount on each side.

VWMWinBmp <bitmap>
VWMWinBorder <size>
VWMWinBorder <left> <top> <right> <bottom>
VWMWinTile

  Set the bitmap for the miniwindows.  VWMWinBorder specifies a border around the 
bitmap that does not get stretched.  This basically works the same as skins for 
systray except in separate commands.  VWMWinTile will tile anything that would have 
been stretched.

  SNAPSHOT MODE:  You can set VWMWinBMP to ".snapshot" and mini-windows will be 
given a shrunken snapshot of how the window looked last time it was on the screen.  
This takes a lot of processor time, so you can select a quality setting as a number 
from 0-3, 0 being the default:
	0	9 samples/pixel		21%
	1	5 samples in an X	13%
	2	5 samples in a +	13%
	3	1 sample/pixel		 6%
If you want a snapshot of the entire desktop, use a VWMBackBmp that's a shrunken 
version of your background.  The percents are percent CPU usage for all of LiteStep 
on my 600MHz P3 with a few windows up.  In contrast:
	VWMUseTransBlt			 6%
	normal bitmaps			 2%
	colors				 1%

  VWMWinBmp is also used to switch to bitmapped miniwindow mode.  If no bitmap is 
specified, or it doesn't load, none of the other miniwindow bitmaps will work.  
(Miniwindows are then drawn using solid colors.)

VWMTitlebarBmp <bitmap>
VWMTitlebarBorder <size>
VWMTitlebarBorder <left> <top> <right> <bottom>
VWMTitlebarTile

  Same as VWMWin... except for the titlebar of the miniwindows, if it gets drawn.  
No effect without VWMTitlebars and VWMWinBmp.

VWMFlashBmp
VWMFlashBorder
VWMFlashTile

  Same as VWMWin... except for flashing miniwindows.  No effect without VWMWinBmp.

VWMFlashTitleBmp
VWMFlashTitleBorder
VWMFlashTitleTile

  Same as VWMTitlebar... except for flashing miniwindows.

VWMUseTransBlt

  This enables magic pink transparency in bitmaps.  Be aware that it will take 
about 3 times the cpu usage of solid bitmaps.


----- Icons

VWMShowIcons

  Enables drawing icons in the miniwindows.

VWMScaleIconToFit

  Try to shrink the icons in miniwindows to fit inside them rather than letting 
them run over the edge.  This has no effect if VWMShowIcons has not been specified.

VWMIconSize <size>

  Icons are drawn this large, in pixels, square.  This has no effect unless 
VWMShowIcons is specified.  Defaults to 16.

VWMMinIconSize <size>

  If an icon should scale to smaller than this, it is not drawn.  This has no 
effect unless both VWMShowIcons and VWMScaleIconToFit are specified.  Defaults to 
4.

VWMIconBorder <size>
VWMIconBorder <left> <top> <right> <bottom>

  Specifies the border around the window that the icon should not be draw on.  All 
values are distances in pixels from the appropriate edge.

VWMForceIconBorderTop

  If a titlebar is drawn on a miniwindow, the top border is usually replaced by the 
height of the titlebar.  This will prevent this and ensure that the top border 
space set with VWMIconBorder will be used.  This has no effect if VWMShowIcons and 
VWMTitlebars are not both enabled.


----- Titlebars

VWMTitlebars

  Enables drawing titlebars on the miniwindows.

VWMTitleForTitle

  Only draw titlebars on miniwindows corresponding to windows that have titlebars.  
Splash screens, for example, tend to not have titlebars.  This has no effect if 
VWMTitlebars is not specified.

VWMTitlebarHeight <height>

  Specifies the height of the titlebars drawn in the miniwindows in pixels.  This 
has no effect if VWMTitlebars is not specified.  Default is 3 pixels.

VWMTitlebarMod <mod>

  Specifies the height of the titlebars as a fraction of the vwm desk size.  Actual 
size is (minidesk height)/mod.  This has no effect if VWMTitlebarHeight is 
specifically given.


----- VWM Behavior

VWMMouseLeft <action>
VWMMouseRight <action>
VWMMouseMiddle <action>

  These select an action for each mouse button when you click on the vwm window.  
Valid actions are:
	0	Do nothing
	1	Switch desktops
	2	Drag miniwindow (hold now CTRL for snap)
These all default to 0, so I strongly suggest you set them.  (I mean you don't 
*have* to, say if you just want a pretty box that shows all your windows.)

VWMAlwaysOnTop

  Makes the vwm window float above mere mortal windows.

VWMDetectTitleChange

  Tells it to monitor the titles of windows, so miniwindows corresponding to new 
windows or windows whose titles have changed will flash until they're given 
attention.  (ie, input focus)

VWMFocusCenter

  Set the input focus to whichever window is in the center of the desktop when 
switching desks.

VWMFocusLast

  Set the input focus to whichever window last had input focus on the desktop 
you're switching to.

VWMNoBorder

  Doesn't draw borders around desks or miniwindows.  If VWMBevel is specified 
miniwindows still get a bevelled border.

VWMNoWindows

  Doesn't draw any miniwindows.

VWMNoGathering

  Doesn't gather all windows on exit.

VWMReturnToFirstScreen

  Causes the VWM to switch to the top-left desk on exit.

VWMNoShow
VWMHidden

  If either of these is present, the VWM windows starts hidden.  Use !VWMShow to 
make it visible.

VWMNoSwitchOnFocus

  Prevents the VWM from switching desktops when a window in a different desktop 
gains input focus.

VWMNoWrap

  Normally going right from the right-most desktop will take you to the left-most, 
etc.  This setting will disable that.

VWMDeskSpacing <width> <height>

  Amount of spacing between desks, in screen pixels.  Default is 16 12, if you're 
gonna switch between this and other VWMs, use 10 10.  This will also affect spacing 
between windows in the VWM window.


----- Special Windows

Any of these can have the window spec preceded by flags, starting with #, that will 
tell the vwm what to match against:
	t	match window title
	c	match window class
If you don't specify any flags, it will check both, but you can specify the flags 
to save a little processor time and accidentally misidentified windows.

Wildcards are allowed in all window specs.

*VWMIgnoreTitleChange <windowspec>

  List windows that change their window titles often and it doesn't matter.  No 
effect without VWMDetectTitleChange.  One recommendation:
	*VWMIgnoreTitleChange #c WinAmp*
And for POV-Ray users:
	*VWMIgnoreTitleChange #c PovRenderWinClass
	*VWMIgnoreTitleChange #t *.pov:line*

*VWMFix <windowspec>

  Windows that should be hidden rather than moved to different desktops.  Not 
needed for Photoshop.  I have to decide what to do on exit for these guys, probably 
show them and gather their parents to the current desktop.  Note that the window 
spec identifies the PARENT of the window to be fixed.

*VWMSticky <windowspec>

  Windows that should appear on all desktops and should not be drawn in the vwm.

*VWMStartWindowsOnDesktop <windowspec> <desk>
*VWMStartWindowsOnDesktop <windowspec> <deskx> <desky>

  Windows that should start on a specific desktop.  Idea stolen from ckVWM, of 
course.  All desk numbers start at 1.  My favorite is:
	*VWMStartWindowsOnDesktop #c AIM_IMessage 3 3


----- !Bang Commands

Anywhere you see <deskno>, you can use a desk number, a desk x and y coordinate (as 
<deskx> <desky>), or left, right, up, or down.  All desk numbers start at 1, 0 is 
the current desk (usually the same as just leaving it out).  <deskno> can also be a 
windowspec enclosed in (parentheses) to refer to the desk containing that window.  
For example, to open Notepad on the desk containing WinAmp:
	!VWMOpen (#c WinAmp*) notepad.exe

!VWMLeft
!VWMRight
!VWMUp
!VWMDown

  Switch to a desktop next to this one.  By default this will wrap, IE going left 
from the leftmost desk takes you to the rightmost one.

!VWMDesk <deskno>

  Switch to a specific desktop.

!VWMGather
!VWMGather <deskno>

  Gathers all windows to the current or a specific desktop.

!VWMGatherLost
!VWMGatherLost <deskno>

  Gathers all "lost" windows to the current or a specific desktop.  Lost windows 
are windows that are currently outside of any desktop, normally they are left there 
until you try to switch to them (at which point that window is brought to the 
current desk).

!VWMToggleOnTop

  This toggles between on top and on bottom.  You can specify true, yes, on, or 
toggle (or anything else).  true, yes, or on will set it to on top, toggle or 
nothing will toggle the state, and anything else will set it to on bottom.

!VWMOpen <deskno> <command> <parameters>

  Switches to a specific desktop and opens or executes a command.

!VWMShow [toggle|off|no|false|hide]

  Shows or hides the VWM window.  If toggle is specified, the state is toggled, if 
off, no, false, or hide is specified, the window is hidden, if anything else or 
nothing is specified, the window is shown.

!VWMHide

  Hides the VWM window.

!VWMMoveApp <deskno>
!VWMMoveApp <deskno> <windowspec>

  Move the foreground window to the specified window, or in the specified 
direction.  If windowspec is given, moves the first matching window instead.  See 
"special windows" for a description of windowspec, two more flags are accepted:
	d	find window on current desk only
	p	find top window in paint order rather than lowest hwnd
	h	find by window handle, in hex
	a	find all matching windows
	d1.1	only windows on desk 1,1; only numbers are valid
	d4	only windows on desk 4
To gather all notepad windows to the current desk:
	!VWMMoveApp 0 #ac Notepad
To move all notepad windows on desk 3,2 to a desk containing a mozilla window:
	!VWMMoveApp (#c MozillaWindowClass) #ad3.2c Notepad

!VWMReset

  Resets the VWM to the initial state specified in step.rc, also reload all 
bitmaps.

!VWMMove
!VWMMove <x> <y>

  Sets the screen position of the VWM window.  Same as VWMPos, if you don't give it 
any values, it resets the position to that given in step.rc.

!VWMFlash <Windowspec>

  Flashes the miniwindow for windows that match the given windowspec.  Same flags 
as for !VWMMoveApp.

!VWMExec <command>

  Executes a command after replacing variables:
	^@wh^ handle of active window
	^@wt^ title of active window
	^@wc^ class of active window

	^@wd(<windowspec>)^ desk of window matching windowspec
	^@wt(<windowspec>)^ title of window matching windowspec
	^@wc(<windowspec>)^ class of window matching windowspec
	^@wh(<windowspec>)^ handle in hex of window matching windowspec

	^@dx^ total number of desks across
	^@dy^ total number of desks down
	^@dc^ current desktop number
This allows you to read information out of the module.  To find the class name for 
a window with a specific title, try:
	!VWMExec !alert "^@wc(#t * - Notepad)^"


----- Not yet implemented

vwmhidetaskonswitch (being more of a freak than i had expected)

action triggerred bang commands

lsbox compatibility

VWMInitialDesk


################################################################################

----- Known bugs and notes

*Fix is somewhat broken.  It'll be fixed.

There is no way to escape a ^@^ sequence in !VWMExec.

Sometimes programs get the wrong icon, or no icon when they first come up.  Resize 
the window to correct this.  (Some I just can't seem to get the icon for: Windows 
2000 Task Manager, for example.)

If a window somehow gets "lost":  First try switching to that window, it should 
come back, then try !VWMGatherLost.  If that doesn't work, use Alt-Tab to switch to 
that window, then press Alt-Space.  If the window was maximized, select "Restore" 
and it will reappear, otherwise select "Move", press any arrow key on the keyboard, 
then move the mouse.  Click to drop the window.  (This trick should work with ANY 
vwm.)

If a *Fix window or toolbar gets lost...  well you're screwed for now, deal.  
There's no easy way for me to distinguish between that and a window that shouldn't 
be shown at all.  (depending on conditions...)


----- Changes


- alpha 4 -

110201:

 - Fixed diagonal samples in .snapshots

110101:

 - Added .snapshot mode.
 - Made non-transparent default and added VWMUseTransBlt
 - negative percents for position and size work (as 100-%)
 - added !VWMMove
 - fixed !VWMGatherLost for windows in negative space
 - fixed !cmd desk references
 - fixed lcd "theme"
 - added !VWMFlash
 - added #h flag to use hwnd in hex for window spec (! only)
 - allow 0 as a valid desk number (current desk),
   didn't work with !VWMMoveApp before
 - added #a flag to repeat for all windows with window spec (! only)
 - added (windowspec) syntax for desknos
 - added #dx.y syntax for desk only flag in window spec
 - tried to add lsbox compatibility, not tested (load as regular module)
 - added !vwmexec and ^@commands^
 - added VWMDeskSpacing

- alpha 3 -

 - Good stuff.


-----

Have fun!

-josh





  .--------.-----.-----.
  |        |  _  |  _  |__
  |__|__|__|_____|_____|__|


