3.56
Misc
FNwimp_OStolength(coord,scale,inch%)
Converts OS units to mm or inches.
coord = value to convert, can be integer or floating point.
scale = scaling factor 0-100 (%) can be integer or floating point.
If inch%=0 the value returned is in mm. If inch%=1 the
value returned is in inches.

Misc
FNwimp_changecase(string$,upper%)
Converts a string all to upper or lower case characters.
string$ = string to convert
If upper% = 0 then conversion is to lower case
If upper% = 1 then conversion is to upper case
(The conversion only affects the alphabetical characters A-Z and a-z.
All others are left unchanged.)

Misc
FNwimp_countdirectoryobjects(dir$)
Returns number of objects (i.e. files/applications/directories) in
specified directory.
dir$ - full pathname of directory or application
(NOTE: Will give error if dir$ is not a directory or application)

Misc
FNwimp_createblock(items%,length%)
Creates a block for storing strings in. Returns a handle
to the block.
items% = maximum number of strings to store.
length% = maximum possible length of each string.

Misc
FNwimp_decplacesnum(number,decplaces%)
Returns, as a real number, the number formatted to the designated
number of decimal places.
number - is the number to format, can be integer or floating point.
decplaces% - is the number of decimal places required.
(N.B. this function can suffer from rounding errors. Use the string
version FNwimp_decplacesstr if possible.)

Misc
FNwimp_decplacesstr(number,decplaces%)
Returns, as a string, the number formatted to the designated number of
decimal places.
number - is the number to format, can be integer or floating point.
decplaces% - is the number of decimal places required.

Misc
FNwimp_errorchoice(title$,error$,prefix%)
Reports an error using a standard error box.
It has both OK and CANCEL buttons.
title$ = title of error window.
error$ = error message.
If prefix% = 0 then the title is title$.
If prefix% = 1 then the title is prefixed by Error from .
If prefix% = 2 then the title is prefixed by Message from .
Returns TRUE if OK pressed. FALSE if CANCEL pressed.

Misc
FNwimp_getdirectoryobjectname(dir$,objectnumber%)
Returns name of specified object (i.e. file/application/directory) in
specified directory.
dir$ - full pathname of directory or application
(NOTE: Will give error if dir$ is not a directory or application)
objectnumber% is 1 for first object, 2 for second object, etc.
Objects are read in alphabetical order of name - so names starting
with ! (Ascii 33) will come first.
(Use FNwimp_countdirectoryobjects first to find total number of 
objects present in directory.)

Misc
FNwimp_getdirectoryobjecttype(dir$,objectnumber%)
Returns, as a string, the filetype number of specified object (i.e.
file/application/directory) in specified directory. A file will
return &xxx where xxx is the filetype hex number e.g. &fff for 
textfiles.
A directory will return &1000 and an application &2000.
dir$ - full pathname of directory or application
(NOTE: Will give error if dir$ is not a directory or application)
objectnumber% is 1 for first object, 2 for second object, etc.
Objects are read in alphabetical order of name - so names starting
with ! (Ascii 33) will come first.
(Use FNwimp_countdirectoryobjects first to find total number of 
objects present in directory.)

Misc
FNwimp_getdirectorypath(pathname$)
Returns the pathname with the leafname removed i.e. returns the 
directory specification string. The trailing fullstop (or trailing colon, if 
pathname$ is something like Boot:!Help) will be included.
pathname$ = full file pathname string
(If pathname$ does not include at least one . character a null-string 
will be returned, after a warning.)

Misc
FNwimp_getfromblock(block%,pos%)
Returns a string stored in a block.
block% = handle of block.
pos% = position of string in block (ranging from 1 to
maximum as passed to FNwimp_createblock).

Misc
FNwimp_getleafname(path$)
Returns a string containing the leafname from the pathname.
path$ = pathname.

Misc
FNwimp_getscreenres(direction%)
Returns the resolution (number of pixels) of the current screen mode
in the specified direction.
If direction%=0 then return is horizontal resolution.
If direction%=1 then return is vertical resolution.

Misc
FNwimp_getscreensize(side%)
Returns the required dimension, in OS units, of the full screen in
current mode.
If side% = 0 returns width.
If side% = 1 returns height.

Misc
FNwimp_getsysvariable(sysvar$)
Returns, as a string, the contents of the system variable sysvar$.
Note < and > are not required in sysvar$.
If designated system variable is not present a null string is returned.

Misc
FNwimp_initialise(name$,wimpmem%,ver%,desktopsave%)
This function registers your application with the Task Manager, reserves
some important memory and determines if the application will
give a response to the Wimps desktop save protocol and whether it will 
pass on unused messages from the Wimps messaging system.
name$ = the name of your application eg. MyApp.
wimpmem% = number of bytes to reserve for window, icon and menu 
definitions. (Space for indirected data is allocated automatically.)
ver% = minimum version of RISC OS that the application is allowed to 
run on, multiplied by 100.
If desktopsave% <> 0 then application will respond to Wimps desktop 
save message.

Misc
FNwimp_lengthtoOS(coord,scale,inch%)
Converts mm or inches to OS units.
coord = value to convert, can be integer or floating point.
scale = scaling factor 0-100 (%) can be integer or floating point.
If inch%=0 the value coord supplied is in mm. If inch%=1
the value coord supplied is in inches.

Misc
FNwimp_libversion
Returns the version number of the DrWimp library x 100.
Eg. if the version of the library is 3.54 then 354 will be returned.

Misc
FNwimp_roundfloat(float)
Rounds the specified floating point number up or down and returns the
integer.

Misc
FNwimp_screentowork(window%,coord%,side%)
Converts the x or y screen coordinate coord% to a work area x or y 
coordinate - all in OS units.
window% = handle of window whose work area coordinate is being 
sought.
coord% = coordinate (x or y).
If side% = 0 then coord% is a x coordinate, and an x coordinate is 
returned.
If side% = 1 then coord% is a y coordinate, and a y coordinate is 
returned.

Misc
FNwimp_sigfigsnum(number,sigfigs%)
Returns, as a real number, the number formatted to the designated
number of significant figures.
number - is the number to format
sigfigs% - is the number of significant figures required.
(N.B. this function can suffer from rounding errors. Use the string
version FNwimp_sigfigsstr if possible.)

Misc
FNwimp_sigfigsstr(number,sigfigs%)
Returns, as a string, the number formatted to the designated number of
significant figures.
number - is the number to format
sigfigs% - is the number of significant figures required.

Misc
FNwimp_testsysvariable(sysvar$)
Returns TRUE if designated system variable is present, or FALSE if not.
Note < and > are not required in sysvar$.

Misc
FNwimp_worktoscreen(window%,coord%,side%)
Converts the x or y work area coordinate coord% to an x or y screen
coordinate - in OS units
window% = handle of window whose work area coordinate is being 
converted.
coord% = coordinate (x or y).
If side% = 0 then coord% is a x coordinate, and an x coordinate is 
returned.
If side% = 1 then coord% is a y coordinate, and a y coordinate is 
returned.

Misc
PROCwimp_bar(window%,icon%,length%,dir%)
Sets/adjusts the length of a bar - in OS units.
window% = handle of window containing the bar.
icon% = icon number of the bar.
length% = length of the bar.
If dir% = 0 then the bar moves horizontally keeping the height constant.
If dir% = 1 then the bar moves vertically keeping the width constant.

Misc
PROCwimp_error(title$,error$,button%,prefix%)
Reports an error using a standard error box.
title$ = title of error window.
error$ = error message.
If button%=1 then will have an OK button.
If button%=2 then will have a CANCEL button.
prefix% = 0 then the title is title$.
If prefix% = 1 then the title is prefixed by Error from .
If prefix% = 2 then the title is prefixed by Message from .

Misc
PROCwimp_hourglassoff
Turns off the hourglass.

Misc
PROCwimp_hourglasson
Turns on the hourglass.

Misc
PROCwimp_hourglasspercentage(percentage%)
Sets the percentage display on the hourglass.
percentage% is in the range 0 to 99.

Misc
PROCwimp_increaseslot(bytes%)
Increases size of wimpslot by bytes% bytes. If not
enough available RAM then creates an error.

Misc
PROCwimp_putinblock(block%,string$,pos%)
Stores a string in a block. (The block must have been created using 
FNwimp_createblock).
block% = handle of block.
string$ = string to store.
pos% = position to store string in (ranging from 1 to maximum number 
of strings as passed to FNwimp_createblock).

Misc
PROCwimp_quit(type%)
Causes the application to quit or the desktop to be
shutdown. FNuser_quit will be called with type% passed to it.
If type%=0 the application will quit.
If type%=1 the desktop will be shutdown.

Misc
PROCwimp_setbackgroundcolour(red%,green%,blue%)
Sets the current GCOL background colour to the nearest possible for
the current mode.
red% = amount of red in range 0-255.
green% = amount of green in range 0-255.
blue% = amount of blue in range 0-255.

Misc
PROCwimp_setforegroundcolour(red%,green%,blue%)
Sets the current GCOL foreground colour to the nearest possible for
the current mode.
red% = amount of red in range 0-255.
green% = amount of green in range 0-255.
blue% = amount of blue in range 0-255.

Misc
PROCwimp_starttask(command$)
Sends command$ to the CLI. Omit *.

Polling
PROCwimp_poll
This function provides the main loop of your application.
When it has exited, your application has quitted.
During the loop operation, whenever something happens to your
application eg. an icon has been clicked on, then the relevant
action will be initiated from the loop.

Polling
PROCwimp_pollidle(seconds%)
If NULL%=TRUE then PROCuser_null will be called every
seconds% seconds instead of every time control is passed
to the application and no event has occurred.

Polling
PROCwimp_singlepoll
The same as PROCwimp_poll, except that it is called once
and not in a loop. If something happens then the relevant action will
still be taken before returning.
Useful for making loops multitask, eg: raytracing,
printing, calculating, loading in data, etc.
Note: if calling in PROCuser_null, make sure NULL%=FALSE
before this call is made (can be set to TRUE afterwards) otherwise
recursion will occur.

Polling
PROCwimp_singlepollidle(seconds%)
The same as PROCwimp_pollidle, except that it is called
once and not in a loop.
If something happens then the relevant action will be taken before 
returning.
If NULL%=TRUE then PROCuser_null will be called after
seconds% seconds.
Useful for incorporating delays into multitasking loops.
Note: if calling in PROCuser_null, make sure NULL%=FALSE
before this call is made (can be set to TRUE afterwards) otherwise
recursion will occur.

User
FNuser_help(window%,icon%)
Return a string to be used for interactive help for the
window (and icon).
window% = handle of window (containing icon).
icon% = number of icon.

User
FNuser_keypress(window%,icon%,key%)
If a key is pressed while one of your windows has the input focus, or a 
hotkey is pressed, then this function is called (provided icon validation 
string is suitably defined).
If you dont use the key press then return a 0. If you do then return a 1.
window% = handle of window with input focus.
icon% = number of icon with caret.
key% = key code. For most keys it is the ASCII number.
(See Section 2.4 of the Manual for codes of special keys - and Section 
2.21 for validation strings.)

User
FNuser_loaddata(path$,window%,icon%,filetype$,workx%,worky%)
Used to load data. Important to return a 1 if data is loaded.
(Can also be used for other operations without loading data. In these
cases, return 0.)
path$ = full pathname of source file offered for loading.
window% = handle of window file has been dragged to. (Will be 0 if file 
double-clicked rather than dragged.)
icon% = number of icon file was dragged on to. (Will be -1 if file 
double-clicked rather than dragged.)
filetype$ = filetype of file offered for loading. Eg. FFF. (or 1000 if a 
directory, or 2000 if an application)
workx%, worky% = work area coordinates the icon was dropped at 
(these values are both -1 if file was loaded with a double-click rather 
than dragged).

User
FNuser_menu(window%,icon%)
If you want a menu to be displayed when you press <menu> over the
specified window/icon, then this function needs to return the handle
of the menu required - instead of the default value of 0.
window% = handle of window.
icon% = number of icon.

User
FNuser_menuhelp(menu%,item%)
Return a string to be used for interactive help for the
menu item.
menu% = handle of menu.
item% = number of item (starting from 1 at the top).

User
FNuser_pane(window%)
If the window has a pane attached to it, then this function should
return the window handle of the pane. If the window doesnt have a
pane attached, then it should return a -1.
window% = handle of window.

User
FNuser_printing(copy%,page%,totpages%,pagepos%)
Called repeatedly during printing so application can keep user informed 
of current printing status and give the option to cancel printing.
copy% = number of current copy being printed.
page% = number of current page being printed.
totpages% = total number of pages being printed.
pagepos% = current page being printed (starts at 1 each time and goes up 
to totpages%).
Return a 1 to cancel printing or a 0 to continue.

User
FNuser_quit(type%)
Called when the application is quit either from the user choosing quit or 
from a desktop shutdown.
Return a 1 to continue with the quit/shutdown or return a 0 to stop it, 
perhaps allowing the user to save any data.
If type%=0 then it is a quit.
If type%=1 then it is a shutdown.

User
FNuser_savedata(path$,window%)
When the user is required to save data, this function is called.
(Can also be used for file operations which do not save data, in which 
case return 0.)
Return a 1 if some data was saved, 2 if an error occurred or return a
0 for no data saved and no error.
path$ = full pathname of file to save data to i.e. destination file.
(Note that this must be a complete file path, not a directory.
Leafname is usually in save window writable icon.)
window% = handle of save window that file icon was dragged from.

User
FNuser_savefiletype(window%)
You return the filetype for the save windows. eg. =FFF.
For windows that arent save windows, return a null string.
window% = handle of window%

User
FNuser_slider(window%,icon%)
In order to let DrWimp know that an icon is part of a
slider/sliderback pair, return the slider icon number.
window% = handle of window with slider pair in.
icon% = icon number of slider back icon.
(Always used with FNuser_sliderback as a complementary pair.)

User
FNuser_sliderback(window%,icon%)
In order to let DrWimp know that an icon is part of a
slider/sliderback pair, return the slider back icon number.
window% = handle of window with slider pair in.
icon% = icon number of slider.
(Always used with FNuser_slider as a complementary pair.)

User
PROCuser_closewindow(window%)
If this function is called, then the window whose handle is window%
has just been closed.

User
PROCuser_colourpickermodel(model%,value1%,value2%,value3%,value4%,none%)
When the colour picker window is used to select a colour (by pressing 
OK or None) the colour model values of the currently displayed 
colour are passed to this function.
model%=colour model number. 0 is RGB model, 1 is CMYK 
model, 2 is HSV model.
value1%, value2% etc. are colour component values appropriate to the 
model, in range 0-100% (except value1% is in range 0-359 degrees for 
HSV model i.e. when model%=2)
Note that value4% is only relevant for CMYK model i.e. when 
model%=1. In other cases value4% will be -1.
If none%=0, OK was pressed in colour picker window i.e. displayed 
colour was selected.
If none%=1, None was pressed in colour picker window i.e. no colour 
selection was made.
(Note: Colour values are still passed when None is pressed.)

User
PROCuser_colourpickerrgb(red%,green%,blue%,none%)
When the colour picker window is used to select a colour (by pressing 
OK or None) the rgb values of the currently displayed colour are 
passed to this function.
red% = red component of colour, in range 0-255.
green% = green component of colour, in range 0-255.
blue% = blue component of colour, in range 0-255.
If none%=0, OK was pressed in colour picker window i.e. displayed 
colour was selected.
If none%=1, None was pressed in colour picker window i.e. no colour 
selection was made.
(Note: Colour values are still passed when None is pressed.)

User
PROCuser_declarefonts
Any fonts being used in printing must be declared in this function using 
PROCwimp_declarefont or PROCwimp_declarefonth.
(This is in case the application is used with a PostScript type
printer, which requires font declarations.)

User
PROCuser_enteringwindow(window%)
This function is called when the pointer enters a window.
window% = handle of window.

User
PROCuser_iconise(window%,RETURN text$,RETURN sprite$)
This function is called when iconising action takes place. It allows the 
text and/or sprite used to be customised.
window% = handle of the window where the iconising action has 
occurred.
text$ = text to appear beneath the iconised sprite.
sprite$ = name of the sprite to be used, without the ic_ prefix. A sprite 
with the full name needs to be supplied in the !Sprites/!Sprites22 files - 
otherwise the Wimps default sprite will be displayed.
(By default, both text$ and sprite$ will be set to the application name as 
declared in FNwimp_initialise.)
N.B. If sprite$ exceeds 7 characters it will produce an invalid iconiser 
sprite name - and hence the Wimps default iconiser sprite will be 
displayed instead.

User
PROCuser_initialise
This procedure should typically contain the following:
Window and menu loading/definition; declaration of global variables;
DIMming of arrays & data blocks; anything that needs to be done before 
polling starts.

User
PROCuser_leavingwindow(window%)
This function is called when the pointer leaves a window.
window% = handle of window.

User
PROCuser_menuopen(menu%,icon%)
Called just before menu (not a sub-menu) is opened.
menu% = handle of menu just about to open.
icon% = icon which pointer is over ( or -1 if not over an icon).

User
PROCuser_menuselection(menu%,item%)
This function is called when the user has chosen a menu item from one 
of your menus.
menu% = handle of menu.
item% = item number (top item is 1).

User
PROCuser_modechange
Called when the mode is changed.

User
PROCuser_mouseclick(window%,icon%,button%,workx%,worky%)
If an icon has been clicked on in one of your windows then this function 
is called.
window% = handle of window containing icon.
icon% = number of the icon clicked on.
button% = which mouse button was pressed.
Eg. 4 for <select>, 1 for <adjust>.
workx%,worky% = work area coordinates of pointer (in window%)
when the mouse button was clicked.

User
PROCuser_null
This is called continuously if you set NULL%=TRUE.
So if you are writing something like a clock, you would monitor the time 
here and change any windows as required.

User
PROCuser_openwindow(window%,x%,y%,stack%)
If this function is called, then the window whose handle
is window% has been opened with the top left of the
window at x%,y% on the screen.
stack% = window handle which window% was opened behind,
or -1 for top of window stack, or -2 for bottom.

User
PROCuser_overmenuarrow(RETURN nextsubmenu%,parentmenuitem%,x%,y%)
Called when pointer moves over arrow-head against menu item,
on way to activating sub-menu.
nextsubmenu% = handle of submenu (or could be window) about
to be opened.
(Note: RETURN means that submenu handle can be changed here, if 
required.)
parentmenuitem% = menu item number which pointer is moving over.
x%/y% are work area OS-unit positions of pointer when over
arrow-head.

User
PROCuser_print(minx%,miny%,maxx%,maxy%,page%)
Called to draw a page for printing, if PROCwimp_print was
called with user%=1.
minx%,miny% = coordinates of bottom left corner of clipping rectangle
on page in paper coordinates.
maxx%,maxy% = coordinates of top right corner of clipping rectangle on
page in paper coordinates.
page% = number of page to print.

User
PROCuser_printerchange
Called when the printer settings or the current printer has changed so you 
can update your page measurements, current printer name, etc.

User
PROCuser_redraw(window%,minx%,miny%,maxx%,maxy%,printing%,page%)
When this function is called, the Wimp wants you to update (redraw) the 
specified box.
The box is in the window whose handle is window% or, if printing, then 
it is in paper coordinates with the origin is at the bottom left of the paper.
printing% = TRUE if currently printing, FALSE otherwise.
page% = number of page currently being printed if printing%=TRUE.
minx%,miny% = bottom left co-ordinates of box in screen/paper 
coordinates.
maxx%,maxy% = top right co-ordinates of box in screen/paper 
coordinates.

User
PROCuser_saveicon(window%,RETURN drag%,RETURN write%,RETURN ok%)
This function allows the three save window icons (the one to drag, the 
writable icon for the filename/pathname and the OK button) to have
their icon numbers set, if you want to override the defaults.
Defaults:
  drag% - 0   write% - 1   ok% - 2
window% = handle of save window.

User
PROCuser_slidervalue(window%,slider%,pcent%,dir%)
When a slider is being dragged or has just finished being dragged, the 
percentage of the slider is passed to this function.
window% = handle of window with slider in.
icon% = icon number of slider.
pcent% = percentage of slider.
dir% = direction of slider (0 is horizontal, 1 is vertical)

User
PROCuser_wimpmessage(messagenumber%)
This user-function allows details of any unused wimp-messages to be 
passed to the !RunImage, if required.
If the global variable UNUSED% is set to TRUE then this PROC will be 
called whenever a wimp-message is received by the application but is 
not used within the DrWimp library. (UNUSED% is set to FALSE by 
default on application start-up.)
messagenumber% = number of the unused wimp-message received.
(See Section 2.29 of Manual for the list of wimp-messages that are 
currently used within the DrWimp library - and hence would never be 
passed on via this user-function.)

Windows
FNwimp_createwindow(vminx%,vminy%,vmaxx%,vmaxy%,wminx%,wminy%,wmaxx%,wmaxy%,flags%,workcol%,button%,title$,maxind%,sarea%)
Creates a window, returning the handle to it.
vminx%,vminy%,vmaxx%,vmaxy% = limits of opening visible window 
in OS screen units.
wminx%,wminy%,wmaxx%,wmaxy% = limits of work area of window
in work area OS coordinates.
flags% = number representing window flags.
workcol% = work area colour in desktop colours, in range 0-15.
button% = work area button type. 0 for ignoring clicks, 1 for responding 
to them.
title$ = title of window.
maxind% = maximum size of title if indirected.
sarea% = handle of sprite area, or 0 to use Wimp sprite area.
(See Section 2.25 of Manual for details of flags%, button%, etc.)

Windows
FNwimp_getwindowsize(window%,side%)
Returns the dimension required, in OS units, of the currently displayed 
size of the specified window. (If window is not open then size that would 
be displayed is returned.)
If side% = 0 returns width. If side% = 1 returns height.

Windows
FNwimp_getwindowtitle(window%)
Returns a string containing the window title.
window% = handle of window.

Windows
FNwimp_getwindowvisibleOS(window%,side%,end%)
Return the work area OS coordinates of the edges of the current visible 
area of the window.
window% = handle of window.
If side%=0 then a x coordinate will be returned.
If side%=1 then a y coordinate will be returned.
If end%=0, then the minimum coordinate will be returned, ie the left
or bottom of the visible area depending on the value of side%.
If end%=1, then the maximum coordinate will be returned, ie the right
or top of the visible area depending on the value of side%.

Windows
FNwimp_getwindowvisiblescreen(window%,side%,end%)
Return the screen OS coordinates of the edges of the current visible area 
of the window.
window% = handle of window.
If side%=0 then a x coordinate will be returned.
If side%=1 then a y coordinate will be returned.
If end%=0, then the minimum coordinate will be returned, ie the left
or bottom of the visible area depending on the value of side%.
If end%=1, then the maximum coordinate will be returned, ie the right
or top of the visible area depending on the value of side%.

Windows
FNwimp_getwindowworksize(window%,side%)
Returns the size, in OS units, of a window work area
window% = handle of window.
If side%=0 the width of the work area is returned.
If side%=1 the height of the work area is returned.

Windows
FNwimp_iswindowopen(window%)
Returns a 1 if the window is open otherwise returns a 0.
window% = handle of window.

Windows
FNwimp_loadwindow(path$,window$,sprite%)
Loads in a window from a templates file and returns a
handle for the window.
path$ = full pathname to templates file.
window$ = name of window in templates file.
sprite% = 0 if sprites used are from wimp pool (RMA). Otherwise 
sprite% is a handle to a user sprite area.

Windows
PROCwimp_banner(window%,delay%)
Opens window in the centre of the screen for specified
time before closing it.
window% = handle of window to open.
delay% = number of seconds to keep window on screen.

Windows
PROCwimp_closewindow(window%)
Closes a window (removes it from the screen).
window% = handle of window to close.

Windows
PROCwimp_deletewindow(window%)
Deletes a window definition, closing it if it is open. All the memory
apart from the indirected memory is reclaimed and the window handle
becomes invalid.
window% = handle of window to delete.

Windows
PROCwimp_openwindow(window%,centre%,stack%)
Opens a window on the screen.
window% = handle of window to open.
If centre% = 0 opens window where it was last left on the screen, or if it 
hasnt been opened before, then where it is positioned in the template 
file.
If centre% = 1 opens the window centred on the screen
(mode independent).
If centre% = 2 opens the window centred on the pointer.
stack% = window handle to open behind, or -1 for top of window stack, 
-2 for bottom, or -3 for current stack position.

Windows
PROCwimp_openwindowat(window%,x%,y%,stack%)
Opens a window on the screen so the top left of the
window is at co-ordinates x%,y% - in OS units.
window% = handle of window to open.
stack% = window handle to open behind, or -1 for top of window stack,
-2 for bottom or -3 for current stack position.

Windows
PROCwimp_putwindowtitle(window%,title$)
Changes the window title to title$
window% = handle of window.

Windows
PROCwimp_redrawwindow(window%)
Causes the complete window whose handle is window% to be redrawn/
updated.

Windows
PROCwimp_resizewindow(window%,width%,height%)
Resizes the work area of the specified window to the specified width and 
height, which are in OS co-ordinates.
(The displayed size of the window will not change unless the new work 
area size is less than the displayed size.)

Windows
PROCwimp_resizewindowvisible(window%,width%,height%)
Resizes the visible area of the window to the specified width and height 
which are in OS co-ordinates.

Windows
PROCwimp_scroll(window%,side%,direction%,distance%)
Causes the window to automatically scroll vertically or horizontally a 
given distance in a given direction.
window% = handle of window to be scrolled.
If side%=0 then a horizontal scroll will be done.
If side%=1 then a vertical scroll will be done.
If direction%=0 then the scroll will be left or down depending on the
value of side%.
If direction%=1 then the scroll will be right or up depending on the
value of side%.
distance% = the distance to scroll the window given in OS units.

Windows
PROCwimp_updatewindow(window%,minx%,miny%,maxx%,maxy%)
This procedure tells the Wimp to redraw only the part of a window 
which is defined by the given coordinates.
This greatly speeds up redraws where lots of graphics are used and/or the 
window needs regular updating as it avoids redrawing the whole 
window.
The necessary code needs to be in PROCuser_redraw to enable the 
redraw to be done.
window% = handle of window to be updated.
minx%, miny% = bottom left of box to be redrawn in work area
coordinates.
maxx%, maxy% = top right of box to be redrawn in work area
coordinates.

Messages
FNwimp_createmessagemenu(tag$,title$,size%)
Creates a menu automatically from a Messages file, with the same result 
as FNwimp_createmenu.
tag$ = tag for menu. Eg: if tag$=MMenu then the tag MMenuT will 
specify the title, MMenu1 the first item, MMenu2 the second etc.
If title$= then the title defined in the message file will be used, 
otherwise title$ will override whatever is defined in the messages file.
If size%>number of items then the menu is dynamic, ie.
the items can be increased up to size%.

Messages
FNwimp_messlook0(token$)
Returns the string in the messages file for the token token$.

Messages
FNwimp_messlook1(token$,a$)
Returns the string in the messages file for the token token$.
Any %0s in the string are replaced with a$ before returning.

Messages
FNwimp_messlook2(token$,a$,b$)
Returns the string in the messages file for the token token$.
Any %0s and %1s are replaced with a$ and b$ respectively before 
returning.

Messages
FNwimp_reinitmessages(path$)
Forgets about the current messages file and changes to a new one. The 
new file must be the same size or smaller than the old one.
Returns a 1 for success, 0 for failure.
path$ = full pathname of messages file to use.

Messages
PROCwimp_initmessages(path$)
Reserves blocks of memory and sets up Messages file for use.
path$ = full pathname of messages file to use.

Icons
FNwimp_createicon(window%,wminx%,wminy%,wmaxx%,wmaxy%,flags%,esg%,button%,fcol%,bcol%,font%,text$,sprite$,sarea%,maxind%,valid$)
Creates an icon and returns its handle (icon number).
window% = handle of window to create icon in.
wminx%,wminy%,wmaxx%,wmaxy% are bottom left and top
right corners of icon in work area OS coordinates.
flags% = number representing flags for icon.
esg% = esg number of icon. 0 for icons which arent radio buttons.
button% = button type of icon.
fcol%,bcol% = foreground and background colours of icons (if not using
outline font) in desktop colours, so both in the range 0-15.
font% = handle of outline font. 0 if not using a font.
text$ = text for icon.            sprite$ = sprite name for icon.
sarea% = handle of sprite area, or 0 to use Wimp sprite area.
maxind% = if icon is indirected then maximum size.
valid$ = icon validation string.
(See Section 2.25 of Manual for details of flags%, button%, etc.)

Icons
FNwimp_getcaretposition(choice%)
Returns information about current caret location/position.
If choice% = 0 handle of window with caret is returned.
If choice% = 1 handle of icon with caret is returned.
If choice% = 2 work area OS-unit x position (in window carrying caret) 
is returned.
If choice% = 3 work area OS-unit y position (in window carrying caret) 
is returned.
If choice% = 4 the position of the caret (the index) within the text of a 
writable icon is returned.
Return is -1 in cases where the caret is not present.

Icons
FNwimp_geticonenable(window%,icon%)
Returns a 0 if the icon icon% in the window whose handle
is window%, is disabled/greyed. Returns a 1 if it isnt.

Icons
FNwimp_geticonposition(window%,icon%,coord%)
Returns x/y work area OS-unit coordinates of icon corners.
window%= window handle
icon%- icon handle
If coord% = 0 minimum x coord of icon is returned.
If coord% = 1 minimum y coord of icon is returned.
If coord% = 2 maximum x coord of icon is returned.
If coord% = 3 maximum y coord of icon is returned.

Icons
FNwimp_geticonsize(window%,icon%,side%)
Returns the dimension required, in OS units.
window%= window handle
icon%- icon handle
If side% = 0 width of icon is returned.
If side% = 1 height of icon is returned.

Icons
FNwimp_geticonstate(window%,icon%)
Returns a 1 if the icon is selected and a 0 if it is deselected.
Useful for reading the state of radio and option icons.
window% = handle of window containing icon.
icon% = number of icon.

Icons
FNwimp_geticontext(window%,icon%)
Returns a string containing the text from the icon.
window% = handle of window containing icon.
icon% = icon number.

Icons
FNwimp_getsliderpcent(window%,icon%)
Returns the percentage of the slider. If the icon is not
a slider then 0 is returned.
The number returned is a floating point number in the
range 0-100.
window% = handle of window with slider in.
icon% = icon number of slider.

Icons
FNwimp_iconbar(sprite$,text$,maxlen%,pos%)
Creates and places an icon on the iconbar.
sprite$ = name of sprite to put on iconbar.
text$ = text to put underneath the icon.
If text$ =  then sprite-only icon will be created and maxlen% will be 
ignored.
If text$ is any other string then an indirected text-plus-sprite icon will 
be created, with space available for a maximum of maxlen% characters 
(+1). (If maxlen% is less than length of text$ then maxlen% will be 
made equal to length of text$.)
If pos% = 1 then the icon will appear on the right of iconbar.
If pos% = 0 then it will appear on the left.
Returns the iconbar window handle (-2).

Icons
PROCwimp_colouricontext(window%,icon%,colour%)
Sets colour of text in an icon to colour%.
window% = handle of window containing icon.
icon% = number of icon.
colour% = colour in range 0-15.

Icons
PROCwimp_deleteicon(window%,icon%,redraw%)
Deletes an icon definition from a window.
The icon will not disappear unless the window is redrawn.
window% = handle of window containing the icon.
icon% = icon number of icon to delete.
If redraw% is 1 then the window is redrawn.
If redraw% is 0 then it isnt and the icon wont disappear immediately.

Icons
PROCwimp_iconbarsprite(sprite$)
Changes the sprite used for the iconbar icon to sprite$.

Icons
PROCwimp_iconbit(window%,icon%,bit%,state%)
Ensures a specific bit of an icons icon flags is set to the
specified state.
window% = handle of window containing icon.
icon% = number of icon.
bit% = number of icon flags bit to change.
state% = state to set bit to. 1 to set bit, 0 to unset bit.

Icons
PROCwimp_icondisable(window%,icon%)
Greys out icon so it cannot be selected.
window% = handle of window containing icon.
icon% = number of icon.

Icons
PROCwimp_iconenable(window%,icon%)
Un-greys out icon so it can be selected.
window% = handle of window containing icon.
icon% = number of icon.

Icons
PROCwimp_iconselect(window%,icon%,state%)
Selects (inverts) and un-selects icon.
window% = handle of window containing icon.
icon% = number of icon.
If state% = 0 icon is un-selected. If state% = 1 icon
is selected.

Icons
PROCwimp_losecaret
Removes the caret from the icon it is in - and removes input focus
from the window.

Icons
PROCwimp_putcaret(window%,icon%)
Puts the caret in the icon and gives window input focus.
window% =handle of window containing icon.
icon% = number of icon (or set to -1 if caret not wanted in icon)

Icons
PROCwimp_puticonbartext(text$)
If the iconbar icon has indirected text underneath it then it is
replaced by text$.
(The length of text$ must not exceed the iconbars defined max. 
indirected text length.)

Icons
PROCwimp_puticontext(window%,icon%,text$)
If the icon is indirected then the text in the icon is replaced with text$.
If the icon is not indirected then an error is caused.
window% = handle of window containing icon.
icon% = number of icon.

Icons
PROCwimp_putsliderpcent(window%,icon%,pcent)
Sets the percentage of the slider. If the icon is not a
slider then this is ignored.
window% = handle of window with slider in.
icon% = icon number of slider.
pcent = percentage to set. Can be integer or floating point number,
but must be in the range 0-100.

Menus
FNwimp_createmenu(menu$,size%)
Creates a menu structure from the string menu$. The menu
handle is returned.
For more information on menu$ see the manual.
If size%>number of items then the menu is dynamic, ie.
the number of menu items can be increased up to size%.

Menus
FNwimp_createmenuarray(array$(),size%)
Creates a menu from the array supplied.
Each item of the menu is in a separate element of the array.
e.g. array$(1)=Info.
The first element, array$(0), is the menu title, and the last
must be the string END.
array$() = array holding item strings.
size% = maximum number of elements to allocate room for
(doesnt have to be the current number).
Returns a handle to the menu.

Menus
FNwimp_createmessagemenu(tag$,title$,size%)
Creates a menu automatically from a Messages file, with the same result 
as FNwimp_createmenu.
tag$ = tag for menu.
Eg: if tag$=MMenu then the tag MMenuT will specify the title, 
MMenu1 the first item, MMenu2 the second etc.
If title$= then the title defined in the message file will be used, 
otherwise title$ will override whatever is defined in the messages file.
If size%>number of items then the menu is dynamic, ie. the items can be 
later increased up to size%.

Menus
FNwimp_getmenuitem(menu%,menuitemtext$)
Returns the menu item number (top=1) of the menu item whose text 
matches menuitemtext$.
menu% = handle of menu to search
menuitemtext$ = text string to match
Returns 0 if no match found.

Menus
FNwimp_getmenutext(menu%,item%)
Returns a string containing the text of the menu item in position item%.
menu% = handle of menu.
item% = number of item (top item is 1).

Menus
FNwimp_getmenutitle(menu%)
Returns a string containing the title of the menu.
menu% = handle of menu.

Menus
FNwimp_menusize(menu%)
Returns the number of entries (items) in the menu.
menu% = handle of menu.

Menus
PROCwimp_attachsubmenu(menu%,item%,submenu%)
Attaches a submenu to a menu item.
menu% = handle of menu.
item% = item number (top item is 1).
submenu% = handle of submenu or window handle.

Menus
PROCwimp_menuclose
Closes the currently active menu.
Used if menu closure is required other than by normal (automatic) wimp
process.

Menus
PROCwimp_menudisable(menu%,item%)
Greys out the menu item so it is un-selectable.
menu% = handle of menu.
item% = item number (top item is 1).

Menus
PROCwimp_menudottedline(menu%,item%)
Adds a dotted line to the menu below the item.
menu% = handle of menu.
item% = number of item (top item is 1).

Menus
PROCwimp_menuenable(menu%,item%)
Un-greys out the menu item so it is selectable.
menu% = handle of menu.
item% = item number (top item is 1).

Menus
PROCwimp_menuitemcolour(menu%,item%,colour%)
Changes the text colour of the menu item specified.
menu% = handle of menu.
item% = item number (top item is 1).
colour% = colour required (standard Wimp colours in range 0-15)
(Colours 8, 10, 11, 13, 14 and 15 are best for visibility)

Menus
PROCwimp_menupopup(menu%,pos%,x%,y%)
Displays the menu (or window) whose handle is menu%.
If pos%=0 then menu is displayed at coordinates x%,y% (slightly to
right and above)
If pos%=1 then menu will be positioned as for an iconbar menu (as if
iconbar icon is at x%)
If pos%=2 then menu will be centred (x%/y% values ignored but must 
be present)
If pos%=3 then menu will be opened at the pointer position (position
optimised for ptr_menu shape)
Can also be used to open windows that close when the mouse is clicked
elsewhere.

Menus
PROCwimp_menutick(menu%,item%)
If the item doesnt have a tick next to it then this function places one.
If the item does have a tick then it is removed. i.e. toggles menu tick.
menu% = handle of menu.
item% = item number (top item is 1).

Menus
PROCwimp_menuwrite(menu%,item%,length%)
Makes the menu item writable.
menu% = handle of menu.
item% = number of item (top item is 1)
length% = maximum length of text allowed to be entered.
(Any text already in the item will be re-inserted into the new writable 
item.)

Menus
PROCwimp_putmenuitem(menu%,item%,item$)
If the menu is dynamic then item$ will be put into menu item item%.
Any items below will be shuffled down.
If item% is bigger than the current number of items+1, then it will be 
added to the bottom.
menu% = handle of menu.

Menus
PROCwimp_putmenutext(menu%,item%,text$)
Replaces menu items text with text$.
menu% = handle of menu.
item% = number of item (Top item is 1).

Menus
PROCwimp_putmenutitle(menu%,title$)
Changes the title of the menu.
More than 11 characters can be used.
menu% = handle of menu.
title$ = new title.

Menus
PROCwimp_recreatemenu(menu%,menu$)
Rebuilds the menu using the string menu$.
More items can be included than the first time as long as you dont go
over the pre-defined limit.
menu% = handle of menu to rebuild.

Menus
PROCwimp_recreatemenuarray(menu%,array$())
Rebuilds the menu using the items in the array.
The first array item (array$(0)) is the menu title, and the
last has to be the string END.
Things like ticks and dotted lines are removed.
menu% = handle of menu to rebuild
array$() = array to get items from.

Menus
PROCwimp_removemenuitem(menu%,item%)
Removes the item from the menu. Any items below are
shuffled up. If there is only one item on the menu, then
it cannot be removed.
menu% = handle of menu.
item% = number of item to remove.

Sprites
FNwimp_countsprites(sprite%)
Returns the number of sprites in a sprite area.
sprite% = handle of sprite area.

Sprites
FNwimp_getspritename(sprite%,number%)
Returns the name of a sprite in a sprite area.
sprite% = handle of sprite area.
number% = number of sprite. First sprite is numbered 1.

Sprites
FNwimp_getspritesize(sprite$,sprite%,side%)
Returns the width or height in OS units of a sprite.
sprite$ = name of sprite.
sprite% = handle of sprite area containing sprite.
If side%=0 then returns width of sprite.
If side%=1 then returns height of sprite.

Sprites
FNwimp_loadsprites(path$,ptr%)
Loads a spritefile into a block of memory at ptr%.
Returns a new value of ptr% to load the next in.
path$ = full pathname to sprite file.

Sprites
FNwimp_measurefile(path$)
Returns the size in bytes needed to store the spritefile.
Always use this as opposed to any other form of measurement.
path$ = full pathname of spritefile.
(N.B. Same wimp-function used for drawfiles.)

Sprites
PROCwimp_renderpoolsprite(sprite$,bx%,by%,minx%,miny%,maxx%,maxy%,xscale,yscale)
Renders (plots) a wimp pool sprite on the screen at the specified 
coordinates, using the clipping rectangle.
sprite$ = name of sprite to render (must be in the Wimp sprite pool).
bx%,by% = screen coordinates (OS units) at which to put bottom left
corner of sprite.
minx%,miny% = coordinates of bottom left corner of clipping rectangle
in screen coordinates (OS units).
maxx%,maxy% = coordinates of top right corner of clipping rectangle in
screen coordinates (OS units).
xscale,yscale = respectively, required scaling factors in x and y 
directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).

Sprites
PROCwimp_rendersprite(sprite$,sprite%,bx%,by%,minx%,miny%,maxx%,maxy%,xscale,yscale)
Renders (plots) a sprite on the screen at the specified coordinates, using 
the clipping rectangle.
sprite$ = name of sprite to plot.
sprite% = handle of sprite area containing sprite.
bx%,by% = screen coordinates (OS units) at which to put bottom left
corner of sprite.
minx%,miny% = coordinates of bottom left corner of clipping rectangle
in screen coordinates (OS units).
maxx%,maxy% = coordinates of top right corner of clipping rectangle in
screen coordinates (OS units).
xscale,yscale = respectively, required scaling factors in x and y 
directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).

Sprites
PROCwimp_renderwindowpoolsprite(window%,sprite$,bx%,by%,minx%,miny%,maxx%,maxy%,xscale,yscale)
Renders (plots) a wimp pool sprite in a window. The window must have 
its auto-redraw flag unset.
window% = handle of window to render sprite in.
sprite$ = name of sprite to render (must be in the Wimp sprite pool).
bx%,by% = work area coordinates (OS units) of where to put bottom left
of sprite.
minx%,miny% = coordinates of bottom left corner of clipping
rectangle in screen coordinates (OS units).
maxx%,maxy% = coordinates of top right corner of clipping rectangle in
screen coordinates (OS units).
(Clipping rectangle is the same as that passed to PROCuser_redraw.)
xscale,yscale = respectively, required scaling factors in x and y 
directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).

Sprites
PROCwimp_renderwindowsprite(window%,sprite$,sprite%,bx%,by%,minx%,miny%,maxx%,maxy%,xscale,yscale)
Renders (plots) a sprite in a window. The window must have its auto-
redraw flag unset.
window% = handle of window to render sprite in.
sprite$ = name of sprite to render.
sprite% = handle of sprite area containing sprite.
bx%,by% = work area coordinates (OS units) of where to put bottom left
of sprite.
minx%,miny% = coordinates of bottom left corner of clipping
rectangle in screen coordinates (OS units).
maxx%,maxy% = coordinates of top right corner of clipping rectangle in
screen coordinates (OS units).
(Clipping rectangle is the same as that passed to PROCuser_redraw.)
xscale,yscale = respectively, required scaling factors in x and y 
directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).

Pointer
FNwimp_getpointerposition(side%)
Returns the screen coordinates of the pointer, in OS units.
If side%=0 then the x coordinate is returned.
If side%=1 then the y coordinate is returned.

Pointer
PROCwimp_bindpointer(window%)
Binds the mouse pointer within the given window in the same manner as 
a standard error message. It should be used when the window the mouse 
is to be bound in is opened.
The pointer is also placed inside the bound area if it was outside it.
Useful if your application uses its own error or message windows which 
you want to force the user to respond to.
As the pointer cannot reach any of the window control icons, your 
window should have a title bar at most.

Pointer
PROCwimp_pointer(pointer%,area%,pointer$)
Changes mouse pointer between the default (number 1) and
the user defined pointer (number 2).
If pointer% = 0 default pointer is used.
If pointer% = 1 user defined pointer is used.
If area% = 0 Wimp sprite pool is used, otherwise area% is a handle to a 
sprite area.
pointer$ = sprite name of pointer.

Pointer
PROCwimp_releasepointer
Releases the mouse pointer to roam over the whole screen after using 
PROCwimp_bindpointer. It should be used when the window the mouse 
is bound in is closed.

Pointer
PROCwimp_setpointerposition(x%,y%)
Moves the pointer to a given position on the screen - in OS units.
x%,y% = screen coordinates to move the pointer to.

Drawfiles
FNwimp_getdfilesize(dfile%,side%)
Returns the dimension required - in OS units.
If side% = 0 returns width.
If side% = 1 returns height.
N.B. the returned dimensions are those of the overall bounding box 
surrounding all the drawfile objects i.e. as if all objects were grouped.

Drawfiles
FNwimp_loaddfile(path$,ptr%)
Loads a drawfile into a block of memory at ptr%.
Returns a new value of ptr% to load the next in.
path$ = full pathname of drawfile.

Drawfiles
FNwimp_measurefile(path$)
Returns the size in bytes needed to store the drawfile.
Always use this as opposed to any other form of measurement.
path$ = full pathname of drawfile.
(N.B. Same wimp-function used for sprites.)

Drawfiles
PROCwimp_initdfiles
Initialises various blocks of memory ready to use with drawfiles.

Drawfiles
PROCwimp_render(dfile%,bx%,by%,xl%,yl%,xh%,yh%,scalex,scaley,origin%)
Renders (draws) a drawfile directly to the screen using the clipping 
rectangle xl%,yl%,xh%,yh%. All coordinates are in OS units.
dfile% = handle of drawfile to render.
bx%,by% = screen coordinates of where to put bottom left corner of
drawfile.
xl%,yl% = coordinates of bottom left corner of clipping rectangle in
screen coordinates.
xh%,yh% = coordinates of top right corner of clipping rectangle in
screen coordinates.
scalex,scaley = respectively, required scaling factors in x and y 
directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).
If origin% = 0 drawfile will be rendered with bottom left corner of 
drawfile page at bx%/by%.
If origin% = 1 drawfile will be rendered with bottom left corner of 
drawfile objects overall bounding box at bx%/by%. (See Section 2.20)

Drawfiles
PROCwimp_renderwindow(w%,dfile%,bx%,by%,xl%,yl%,xh%,yh%,scalex,scaley,origin%)
Renders (draws) a drawfile in a window. The window must have its
auto-redraw flag unset. All coordinates are in OS units.
w% = handle of window.
dfile% = handle of drawfile to render.
bx%,by% = work area coordinates of where to put bottom left corner of 
drawfile.
xl%,yl% = coordinates of bottom left corner of clipping rectangle in 
screen coordinates.
xh%,yh% = coordinates of top right corner of clipping rectangle in 
screen coordinates.
scalex,scaley = respectively, required scaling factors in x and y 
directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).
If origin% = 0 drawfile will be rendered with bottom left corner of 
drawfile page at bx%/by%.
If origin% = 1 drawfile will be rendered with bottom left corner of 
drawfile objects overall bounding box at bx%/by%. (See Section 2.20)

Drawfiles
PROCwimp_savedfile(path$,dfile%)
Saves a drawfile into a file.
dfile% = handle of drawfile to save.
path$ = full pathname to save to.

Text
FNwimp_fontchangeh(font%)
Returns control codes in a string to change the current font.
Useful for using in the middle of a string of outline font text being 
plotted.
font% = handle of font to change to.

Text
FNwimp_fontcolour(fr%,fg%,fb%)
Returns control codes in a string to change the current font colour.
Useful for using in the middle of a string of outline font text being 
plotted.
fr%,fg%,fb% = red, green and blue components respectively of the 
foreground colour, in the range 0-255.

Text
FNwimp_fontunderline(on%)
Returns control codes in a string to turn underlining on or off.
Useful for using in the middle of a string of outline font text being 
plotted.
If on%=0 turns underlining off.
If on%=1 turns underlining on.

Text
FNwimp_getfont(font$,size%)
Obtains a font handle for a particular font at a particular point size.
font$ = name of font, period separated. eg: Trinity.Medium.
size% = point size of font.
Returns 0 if the font cannot be found.

Text
FNwimp_gettextsize(text$,font$,size%,side%)
Returns the size (in OS units) of a text string as if it had been plotted in a 
particular font, using a string-specified font.
text$ = string to measure.
font$ = name of font, period separated, eg: Trinity.Medium.
size% = point size of font.
If side%=0 then the plotted width (length) of the text is returned.
If side%=1 then the plotted height of the text is returned.

Text
FNwimp_gettextsizeh(text$,font%,side%)
Returns the size (in OS units) of a text string as if it had been plotted in a 
particular font, using a font handle.
text$ = string to measure.
font% = handle of font.
If side%=0 then the plotted width (length) of the text is returned.
If side%=1 then the plotted height of the text is returned.

Text
PROCwimp_deskplottext(t$,c%,x%,y%,fr%,fg%,fb%,br%,bg%,bb%)
Plots text directly to screen, using the current desktop font
(always the System Font on pre-RISC OS 3.50).
t$ = string to plot.
If c%=1 then text is horizontally centred around x%.
If c%=0 then left side of text is placed at x%.
x%,y% = screen coordinates (OS units) to plot the text at.
(y% value is bottom of text)
fr%,fg%,fb% = foreground colour red, green and blue
amounts in range 0-255.
br%,bg%,bb% = background colour red, green and blue
amounts in range 0-255.

Text
PROCwimp_deskplotwindowtext(window%,t$,c%,x%,y%,fr%,fg%,fb%,br%,bg%,bb%,minx%,miny%,maxx%,maxy%)
Plots text in a window, using the current desktop font
(always the System Font on pre-RISC OS 3.50). 
window% = handle of window to plot in.
t$ = string to plot.
If c%=1 then text is horizontally centred around x%.
If c%=0 then left side of text is placed at x%.
x%,y% = work coordinates (OS units) to plot the text at.
(y% value is bottom of text)
fr%,fg%,fb% = foreground colour red, green and blue
amounts in range 0-255.
br%,bg%,bb% = background colour red, green and blue
amounts in range 0-255.
minx%,miny% = coordinates (OS units) of bottom left corner of clipping
rectangle in screen coordinates.
maxx%,maxy% = coordinates (OS units) of top right corner of clipping
rectangle in screen coordinates.

Text
PROCwimp_losefont(font%)
Forgets about a font i.e. closes its handle, like closing a file.
Should be called when you have finished with the font, eg. when the
application is quitting.
font% = handle of font to lose.

Text
PROCwimp_plottext(t$,f$,s%,x%,y%,fr%,fg%,fb%,br%,bg%,bb%)
Plots text directly to screen, using string-specified font.
t$ = string to plot.
f$ = name of font period spaced eg: Trinity.Medium
s% = point size of font.
x%,y% = screen coordinates (OS units) to plot the text at.
(y% value is bottom of text)
fr%,fg%,fb% = foreground colour red, green and blue
amounts in range 0-255.
br%,bg%,bb% = background colour red, green and blue
amounts in range 0-255.

Text
PROCwimp_plottexth(t$,font%,x%,y%,fr%,fg%,fb%,br%,bg%,bb%)
Plots text directly to screen, using font specified by font handle.
t$ = string to plot.
font% = handle of font.
x%,y% = screen coordinates (OS units) to plot the text at.
(y% value is bottom of text)
fr%,fg%,fb% = foreground colour red, green and blue
amounts in range 0-255.
br%,bg%,bb% = background colour red, green and blue
amounts in range 0-255.

Text
PROCwimp_plotwindowtext(window%,t$,f$,s%,x%,y%,fr%,fg%,fb%,br%,bg%,bb%,minx%,miny%,maxx%,maxy%)
Plots text in a window, using string-specified font.
window% = handle of window to plot in.
t$ = string to plot.
f$ = name of font to use, period separated, eg: Trinity.Medium.
s% = point size of font.
x%,y% = work area coordinates (OS units) to plot text at.
(y% value is bottom of text)
fr%,fg%,fb% = foreground colour red, green and blue
amounts in the range 0-255.
br%,bg%,bb% = background colour red, green and blue
amounts in the range 0-255.
minx%,miny% = coordinates (OS units) of bottom left corner of clipping
rectangle.
maxx%,maxy% = coordinates (OS units) of top right corner of clipping
rectangle.

Text
PROCwimp_plotwindowtexth(window%,t$,font%,x%,y%,fr%,fg%,fb%,br%,bg%,bb%,minx%,miny%,maxx%,maxy%)
Plots text in a window, using font specified by font handle.
window% = handle of window to plot in.
t$ = string to plot.
font% = handle of font to use.
x%,y% = work area coordinates (OS units) to plot text at.
(y% value is bottom of text)
fr%,fg%,fb% = foreground colour red, green and blue
amounts in the range 0-255.
br%,bg%,bb% = background colour red, green and blue
amounts in the range 0-255.
minx%,miny% = coordinates (OS units) of bottom left corner of clipping
rectangle.
maxx%,maxy% = coordinates (OS units) of top right corner of clipping
rectangle.

Printing
FNwimp_getpapersize(side%,type%)
Returns various information about the current paper size set up in loaded 
printer driver - in OS units.
If side%=0 then a horizontal measurement is returned.
If side%=1 then a vertical measurement is returned.
Which measurement is determined by type%.
If type%=0 then the width or height is returned.
If type%=1 then the left or bottom margin is returned.
If type%=2 then the printable width or printable height is returned.
If type%=3 then the right or top margin is returned.

Printing
FNwimp_getpdrivername
If a printer driver is loaded, then this function returns a string containing 
the name of the printer driver.
Check to make sure one is loaded first with FNwimp_pdriverpresent.

Printing
FNwimp_papertoscreen(window%,coord%,side%,orient%)
Converts a paper x or y coordinate to a screen x or y coordinate - all in 
OS units.
window% = handle of window whose work area to use.
(A window reference is needed because paper values are assumed to map 
to positions in a window - from which screen coords are calculated.)
coord% = coordinate (x or y).
If side%=0 then coord% is a x coordinate, and an x coordinate is 
returned.
If side%=1 then coord% is a y coordinate, and a y coordinate is returned.
If orient%=0 then page is portrait.
If orient%=1 then page is landscape.

Printing
FNwimp_papertowork(coord%,side%,orient%)
Converts a paper x or y coordinate to a work area x or y coordinate - all 
in OS units.
(Paper values are assumed to map to positions in a window. Hence x 
values are the same and y values only referenced to different corner.)
coord% = coordinate (x or y).
If side%=0 then coord% is a x coordinate, and an x coordinate is 
returned.
If side%=1 then coord% is a y coordinate, and a y coordinate is returned.
If orient%=0 then page is portrait. If orient%=1 then page is landscape.

Printing
FNwimp_pdriverpresent
Checks to see if a printer driver is loaded.
Returns a 0 if one isnt, returns a 1 if one is.

Printing
FNwimp_screentopaper(window%,coord%,side%,orient%)
Converts a screen x or y coordinate to a paper x or y coordinate - all
in OS units.
(A window reference is needed because paper values are assumed to map 
to positions in a window.)
window% = handle of window whose work area to use.
coord% = coordinate (x or y).
If side%=0 then coord% is a x coordinate, and an x coordinate is 
returned.
If side%=1 then coord% is a y coordinate, and a y coordinate is returned.
If orient%=0 then page is portrait. If orient%=1 then page is landscape.

Printing
FNwimp_worktopaper(coord%,side%,orient%)
Converts a work area x or y coordinate to a paper x or y coordinate -
all in OS units.
(Paper values are assumed to map to positions in a window. Hence x 
values are the same and y values only referenced to different corner.)
coord% = coordinate (x or y).
If side%=0 then coord% is a x coordinate, and an x coordinate is 
returned.
If side%=1 then coord% is a y coordinate, and a y coordinate is returned.
If orient%=0 then page is portrait. If orient%=1 then page is landscape.

Printing
PROCwimp_declaredfilefonts(drawfile%)
Declares the fonts used in a drawfile (especially) for postscript printing.
drawfile% = handle of drawfile to be printed.

Printing
PROCwimp_declarefont(font$)
Declares a font for printing.
font$ = name of font to declare, period separated e.g. Trinity.Medium.

Printing
PROCwimp_declarefonth(font%)
Declares a font for printing using font handle.
font% = handle of font to declare.

Printing
PROCwimp_print(user%,window%,fpage%,lpage%,perpage%,copies%,orient%)
Initiates printing of a document.
If user%=0 PROCuser_redraw is called to draw the pages, with 
printing% set to TRUE and the clipping rectangle set to the page 
coordinates.
If user%=1 PROCuser_print is called to draw the pages.
window% = handle of window to redraw if user%=0.
fpage% = page number of first page to print.
lpage% = page number of last page to print.
perpage% = number of A4 pages to fit onto a physical A4 page. Can be
1, 2 or 4.
copies% = number of copies of the document to print.
If orient%=0 then page is portrait.
If orient%=1 then page is landscape.

Dynamic areas
FNwimp_changedynamic(darea%,absolute%,size%)
Changes the size of a dynamic area.
darea% = handle of dynamic area to change the size of.
If absolute%=1 then the size in bytes given in size% is the new absolute 
size of the dynamic area.
If absolute%=0 then the size in bytes given in size% is the amount to 
change the dynamic area size by. (In this case, if size% is positive then 
the area will become larger, if size% is negative then the area will 
shrink.)

Dynamic areas
FNwimp_createdynamic(size%,type%,drag%,name$)
Creates a dynamic area.
size% = size of area initially in bytes.
If type%=1 then the area is in the module area.
If type%=0 and RISC OS 3.5+ is being used then a specific dynamic 
area is created.
If type%=0 and drag%=1 then the user can change the size of the area by 
dragging in the Task Manager. (If type%=1 then drag% is ignored.)
If type%=0 then name$ is the name of the dynamic area, which appears 
in the Task Manager. (If type%=1 then name$ is ignored.)
Returns a handle for the dynamic area.

Dynamic areas
FNwimp_measuredynamic(darea%)
Returns the current size of a dynamic area in bytes.
darea% = handle of dynamic area to measure.

Dynamic areas
PROCwimp_deletedynamic(darea%)
Deletes a dynamic area, returning the memory so it can be used for other 
applications, modules, etc.
darea% = handle of dynamic area to delete

Colour picker
PROCwimp_opencolourpickermodel(model%,dialoguetype%,value1%,value2%,value3%,value4%,x%,y%)
Opens the colour picker window with the colour model set by model% 
and the initial colour set by the values of value1%, value2%, etc.
model%=0 for RGB model, 1 for CMYK model, 2 for HSV model.
value1%, value2% etc. are in range 0-100%, except that value1% is
in the range 0-359 degrees (the colour angle in HSV) when model%=2.
value4%, which must always be present, is ignored unless model%=1 
(CMYK model).
x%/y% are screen OS-unit coordinates of top left corner of window.
If dialoguetype%=0 the window will be closed by specific action e.g. 
selecting its Close icon.
If dialoguetype%=1 the window will close if the mouse is clicked 
outside the window.
(Note: the window also closes when OK or None button is selected.)

Colour picker
PROCwimp_opencolourpickerrgb(dialoguetype%,red%,green%,blue%,x%,y%)
Opens the colour picker window with the initial colour set by the values 
of red%, green% and blue%, which are in the range 0-255.
The window will open in the RGB model (which means the set colour
values will actually be shown as percentages in the range 0-100%).
x%/y% give the screen OS-unit coordinates of the top left corner of
the opening window.
dialoguetype% determines how the window will close:
If dialoguetype%=0 the window will be closed by specific action e.g. 
selecting its Close icon.
If dialoguetype%=1 the window will close if the mouse is clicked 
outside the window.
(Note: the window also closes when the OK or None button is 
selected.)

Colour picker
PROCwimp_opensubmenucolourpickermodel(model%,value1%,value2%,value3%,value4%,x%,y%)
Opens the colour picker window as a sub-menu, with the colour 
model set by model% and the initial colour set by the values of 
value1%, value2%, etc.
model%=0 for RGB model, 1 for CMYK model, 2 for HSV model.
value1%, value2% etc. are in range 0-100%, except that value1% is
in the range 0-359 degrees (the colour angle in HSV) when model%=2.
value4%, which must always be present, is ignored unless model%=1 
(CMYK model).
x%/y% are screen OS-unit coordinates of top left corner of window.
As with any sub-menu, the window will close if the mouse is clicked 
outside the window or when the mouse pointer retraces the opening 
route. (Note: the window also closes when the OK or None button is 
selected.)

Colour picker
PROCwimp_opensubmenucolourpickerrgb(red%,green%,blue%, x%,y%)
Opens the colour picker window as a sub-menu, with the initial colour 
set by the values of red%, green% and blue%,
which are in the range 0-255.
The window will open in the RGB model (which means the set colour
values will actually be shown as percentages in the range 0-100%).
x%/y% give the screen OS-unit coordinates of the top left corner of
the opening window.
As with any sub-menu, the window will close if the mouse is clicked 
outside the window or when the mouse pointer retraces the opening 
route. (Note: the window also closes when the OK or None button is 
selected.)

