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

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 5 (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	1 sample/pixel
	1	5 samples in a +
	2	5 samples in a X
	3	9 samples in an octagon
	4	same as 3, but without center
	5	17 samples in two octagons, for the truely insane
If you want a snapshot of the entire desktop, use a VWMBackBmp that's a shrunken version of your background.
CPU usage will be higher with snapshot (and more samples), but the snapshots aren't updated very often.

  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.  If your window spec starts with a # and you don't want to use flags, put it in quotes.

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 decimal
	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:
	^@wd^ desk no of the active window (usually the current desk)
	^@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 decimal of window matching windowspec

	^@dx^ total number of desks across
	^@dy^ total number of desks down
	^@dc^ current desktop number
	^@de^ number of first empty desk
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)^"

----- Triggerred Actions

These can all use the variables as in !VWMExec, some actions can also use:
	^@md^ desk no that the mouse is over
	^@mx^ cursor x coordinate relative to VWM window
	^@my^ cursor y coordinate relative to VWM window
	^@mxs^ cursor x coordinate relative to screen
	^@mys^ cursor y coordinate relative to screen
	^@mxv^ virtual screen x coordinate corresponding to the mouse position
	^@myv^ virtual screen y coordinate corresponding to the mouse position
	^@cc^ class of window relevant to command
	^@ct^ title of window relevant to command
	^@ch^ handle of window relevant to command
	^@cd^ desk of window relevant to command

VWMOnInit <command>
VWMOnQuit <command>

  Command is run after the VWM has initialized or before it quits.  If the VWM is in lsbox mode, each of these will be called only once, and the VWM window may not be set up.

VWMOnMouseOver <command>
VWMOnMouseOut <command>

  Runs command when mouse enters/leaves VWM window.  Use VWMOnMouseOut !VWMHide for autohide.  VWMOnMouseOut will be delayed by the hover time.

VWMOnHover <command>
VWMOnUnhover <command>

  Runs commands when the mouse stops moving for a while over the VWM or starts moving again.  VWMOnHover !VWMDesk ^@md^ will switch desks on hover.

VWMOnSwitchFrom <command>
VWMOnSwitchTo <command>

  Runs commands before or after switching desktops.  Combined with a background switcher, you can use something like VWMOnSwitchTo !SwitchBackground bitmap^@dc^.bmp to have a different background for each desk.

VWMOnNewWindow <command>
VWMOnRemoveWindow <command>

  Runs when windows are added/removed.  This may include windows that are not drawn in the VWM.  I recommend against openning a new window in response to these, LiteStep windows should be ok.

VWMOnTitleChange <command>

  Runs a command when a window title changes.  VWMDetectTitleChange must be set for this to work.

VWMOnClickLeft <command>
VWMOnClickRight <command>
VWMOnClickMiddle <command>

  Runs a command when the VWM is clicked.  These actions happens before the VWMMouse... ones.

----- lsBox

RabidVWM can be loaded with lsbox, version 2.72 or newer, using *ModuleHook !VWMLoadBoxHook.  User data strings are currently ignored.

RabidVWM will load rc commands from the box file, but they may not have any effect if they're also specified in step.rc.  If the box comes up empty try !VWMMove 0 0 or something, to see if it's been given a position outside of the box.

VWMLoadInBox

  Tells the vwm to wait for lsbox to load rather than creating its main window.

!VWMLoadBoxHook

  Hook bang for lsbox.  Do not call manually.


----- Tricks

 - To allow dragging the VWM, use lsbox.

 - Switch on hover with VWMOnHover !VWMDesk ^@md^

 - With some bizzare combination of label and some scripting module, it should be possible to do tooltips.  Try VWMOnHover !yourtooltipbanghere ^@mxs^ ^@mys^ ^@mt^

 - Miniwindow bitmaps can be very small when used with a border, I usually use 9x9 pixels.

 - You can get the window class of the active window with !VWMExec !alert "^@wc^"

 - Use VWMOnMouseOut !VWMHide for autohide.  Make sure you have a way to show it again!

 - To test a flash bitmap, try VWMOnHover !vwmflash #h ^@ch^

 - Use ^@mh^ to tell whether the mouse is over a window.  It will be 0 if it's not.

----- Not yet implemented

vwmhidetaskonswitch

VWMInitialDesk

snap windows while dragging mode

improved icon caching and smooth scaling

-- further away:

grdtrans/magick compatibility (should work now, but it doesn't...)

!popupdesktops (requires me to link to a newer lsapi.lib)

dynamic resize / change # of desks


----- Known bugs and notes

As this is only an alpha release, not all features are implemented (everything listed here works) and this is a DEBUG BUILD, which means it's larger than normal (the release build is currently ~30k) and you may get an "Assert failed" message before it crashes.  If you get such a message, please email me with at least the line # and file given in the message, as well as your version number (look for "RabidVWM" in your !about screen) and a short description of what you did just before.

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...)

*VWMIgnoreTitleChange windows still trigger VWMOnTitleChange.

^@de^ loses track of things with !vwmreset or !lsboxdestroy/create

----- Changes

** alpha 5 **

110801:

 - added OnClicks
 - added hung app detection, so ls won't freeze when something else does
   Doesn't seem to always work :(
   (thanks blkhawk for bringing this to my attention, and help with testing)

110701:

 - added VWMOnNewWindow, VWMOnRemoveWindow, VWMOnTitleChange
 - added ^@de^
 - added ^@c^ vars

110601:

 - fixed OnHover & OnMouseOut
 - added a bunch of ^@m...^ vars
 - fixed state change detection.  This means that cpu usage is greatly reduced
   (not that it was all that high unless you're using snapshots), but snapshots
   don't get updated as often. (only when window order or something changes)
 - added flash to .snapshot mode
 - fixed some bad memory accesses in drag window code
 - fixed a resource leak with snapshot mode

110501:

 - added lsbox support (for real!  needs v 2.72) thanx blkhawk!
 - added alternate config file option
 - added triggered actions

110401:

 - Fixed *Fix.  Still can't drag *Fixed windows :6
 - Fixed restore of minimized windows in LM_BRINGTOFRONT.
   (thanks "u_u zZzZz" for finding this)

** alpha 4 **

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 **

Stuff.

-----

Have fun!

-josh





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


