This file contains type and structure definitions for the Wimp SWI interface, which are used in many different places in DeskLib - Event, Menu, Coord, and so on.
#define wimp_MAXPATH 1024
The maximum length of a file path used in various parts of the library.
#define wimp_MAXNAME 12
The maximum size of non-indirected wimp names (icon text fields, sprite names, etc).
#define colour_WHITE 0
#define colour_GREY0 0
#define colour_GREY1 1
#define colour_GREY2 2
#define colour_GREY3 3
#define colour_GREY4 4
#define colour_GREY5 5
#define colour_GREY6 6
#define colour_GREY7 7
#define colour_BLACK 7
#define colour_DARK_BLUE 8
#define colour_YELLOW 9
#define colour_GREEN 10
#define colour_RED 11
#define colour_CREAM 12
#define colour_ARMY_GREEN 13
#define colour_ORANGE 14
#define colour_LIGHT_BLUE 15
#define colour_TRANSPARENT 255
#define colour_NOBORDER 255
This colour represents the absence of a border in the nested wimp.
#define iconbtype_NEVER 0
The icon returns no click events except menu clicks
#define iconbtype_ALWAYS 1
The icon reports an event all the time the pointer is over the icon
#define iconbtype_AUTOREPEAT 2
The icon reports events when the mouse is clicked and regularly for as long as the mouse button is held down.
#define iconbtype_CLICK 3
The icon reports an event when any mouse button is pressed over the icon.
#define iconbtype_RELEASE 4
A click on the icon selects it, moving away deselects it and releasing the button generates an event.
#define iconbtype_DOUBLECLICK 5
A click selects the icon, a double-click generates an event.
#define iconbtype_CLICKDRAG 6
A click generates an event. If a drag starts, it generates an event with the button code the normal click code * 16.
#define iconbtype_RELEASEDRAG 7
A click selects the icon, and releasing the button generates an event. If a drag starts, it generates an event with the button code the normal click code * 16.
#define iconbtype_DOUBLEDRAG 8
A click selects the icon, and a double-click generates an event. If a drag starts, it generates an event with the button code the normal click code * 16.
#define iconbtype_MENU 9
The icon is selected when the pointer is over the icon (like a menu item), and clicking generates an event.
#define iconbtype_DOUBLECLICKDRAG 10
A click generates an event, with the button code the normal click code * 256. A drag starting generates the click code * 16, and a double-click generates the normal click code.
#define iconbtype_RADIO 11
A click selects and generates an event, a drag generates an event with the click code * 16.
#define iconbtype_RESERVED1 12
A reserved button type. Do not use.
#define iconbtype_RESERVED2 13
A reserved button type. Do not use.
#define iconbtype_WRITECLICKDRAG 14
A click causes the icon to gain the caret to edit the text in it. A drag starting generates an event with click code * 16.
#define iconbtype_WRITABLE 15
A click causes the icon to gain the caret.
#define iconbar_RIGHT -1
Specifies that a created icon should be on the right hand side of the iconbar.
#define iconbar_LEFT -2
Specififes that a created icon should be on the left hand side of the iconbar.
#define window_ICONBAR -2
The window handle of the iconbar, for click events and suchlike.
#define icon_TEXT 0x00000001
icon contains text
#define icon_SPRITE 0x00000002
icon is a sprite
#define icon_BORDER 0x00000004
icon has a border
#define icon_HCENTRE 0x00000008
text is horizontally centred
#define icon_VCENTRE 0x00000010
text is vertically centred
#define icon_FILLED 0x00000020
icon has a filled background
#define icon_FONT 0x00000040
text is an anti-aliased font
#define icon_NEEDSHELP 0x00000080
redraw needs application's help
#define icon_INDIRECTED 0x00000100
icon data is 'indirected'
#define icon_RJUSTIFY 0x00000200
text right justified in box
#define icon_ALLOWADJUST 0x00000400
Allow multiple select with adjust
#define icon_HALVESPRITE 0x00000800
plot sprites half-size
#define icon_BUTTONTYPE 0x00001000
4-bit field: button type
#define icon_NUMERIC 0x00100000
icon contains only 'numeric' data
#define icon_SELECTED 0x00200000
icon selected by user (inverted)
#define icon_SHADED 0x00400000
icon cannot be selected (shaded)
#define icon_DELETED 0x00800000
icon has been deleted
#define icon_FORECOLOUR 0x01000000
4-bit field: foreground colour
#define icon_BACKCOLOUR 0x10000000
4-bit field: background colour
#define iconvalid_ALLOW 'A'
Specifies the characters that are allowed in the icon
#define iconvalid_BORDERTYPE 'R'
Specifies the 3D border style
#define iconvalid_DISPLAY 'D'
Specifies that all typed characters in the icon whould be displayed as the character given immediately after this. eg. for a password field.
#define iconvalid_FONTCOLOURS 'F'
Specifies the colours for an icon containing anti-aliased text.
#define iconvalid_LINESPACE 'L'
Specifies the linespacing for a multi-line text field. This can only be used with icons which are horizontally and vertically centred, not antil-aliased text and not writeable.
#define iconvalid_SPRITENAME 'S'
Specifies a sprite (or pair of sprites) to use with a text-and-sprite indirected icon.
#define iconborder_PLINTH 0
#define iconborder_SURROUND 1
#define iconborder_OKBUTTON 2
#define iconborder_INDENT 3
#define button_ADJUST 0x00000001
The button code for an adjust-click
#define button_MENU 0x00000002
The button code for a menu-click
#define button_SELECT 0x00000004
The button code for a select-click
#define button_DRAGADJUST 0x00000010
The button code for a drag with the adjust mouse button
#define button_DRAGSELECT 0x00000040
The button code for a drag with the select mouse button
#define button_CLICKADJUST 0x00000100
The button code for a click with the adjust button when received on a double/click/drag button.
#define button_CLICKSELECT 0x00000400
The button code for a click with the select button when received on a double/click/drag button.
#define wimp_NUMBEROFEVENTS 20
There aren't actually twenty events, but the way the are numbered, you need an array of twenty to hold them all.
A C struct which corresponds with how the RISC OS Window Manager usually represents (x,y) points.
A type to represent a single screen coordinate (x,y).
A C struct which corresponds with how the RISC OS Window Manager usually represents rectangles.
A type to correspond with how RISC OS normaly represents boxes.
A window handle (the unique number used to identify a Wimp window).
An icon handle (the unique number used to identify each icon in a given window).
A task handle (the unique number used to identify a multitasking application by RISC OS).
This holds information about a wimp colour, including the gcol action (ie. whether it sets the colour, EORs with the current colour, etc), and whether it is a background colour (foreback = 1), or a foreground colour (foreback = 0).
This holds an RGB colour in the correct form for the ColourTrans SWIs.
This is a Wimp desktop palette block. 'border' is the colour of the border around the edge of the screen, 'mouse1'..'mouse3' define the pointer colours.
This holds the flags for a Wimp icon, allowing access to the various flags with bitfields in the union, if you so desire.
Defines the icon data for an indirected text icon, giving a pointer to the indirected text buffer, the length of that buffer and a pointer to the validation string for the icon.
Defines the icon data for an indirected sprite icon, giving a pointer to the sprite name, a pointer to the sprite area containing the sprite (or 1 for the Wimp sprite area) and 'nameisname', which should be the length of the buffer holding the sprite name or zero if the 'name' field is actually a sprite pointer.
This represents the different information that can be held in the data part of an icon definition, depending on the flags set for the icon.
This is an Wimp icon block, used when creating an icon and when you read information about an icon. It defines the position of the icon on the window, the properties of the icon, and the text or sprite it contains.
This specifies everything needed to create an icon - the icon data and the window it is to be created in.
This holds the flags for a Wimp window, allowing access to the various flags with bitfields, if desired.
You should always use new-style flags (they aren't really new any more) which means setting 'newflags' to 1, 'hastitle', 'hasvscroll', 'hashscroll' and 'nobackclose' should all be set to zero. You will usually set up your windows using a template editor, and so do not have to worry about setting the values in this form.
This specifies a minimum size for a Wimp window - this is the size beyond which the Wimp will refuse to make the window any smaller when it is being resized.
This is used to specify the window colours in the window block, as well as some misc extra window flags.
This represents the definition of a Wimp window. It contains details about the position on the screen, the locations of the scroll bars, the position in the window stack, colours, flags, and so on.
It is followed immediately in memory by the icon blocks defining the icons for this window. This is represented by the array of icon blocks at the end of the definition. This will only be defined if you have defined DESKLIB_zeroarray and are using GCC, or Norcroft with the option -Ez, as zero-length arrays (representing an array of unknown length) are not part of ANSI/ISO C.
This specifies the position of the window on the screen and is used with Wimp_OpenWindow to show a window on the screen.
This holds all the information about the current state of a window.
When used with Wimp_OpenWindowNest, the supplied flags will update the window if 'updateflags' is set in the supplied nested flags
This holds information about a window, as returned by Wimp_GetWindowInfo.
This defines an area of a window to be redrawn. It is used with Wimp_ForceRedraw and Wimp_UpdateWindow, for example.
This defines the area of the screen which is the bounding box of the window in OS coordinates (including any scrollbars, titlebar, etc).
This holds the nesting flags for a window opened within another window under the nested Wimp. The possible values for the flags are given by the enumerated type windownest_align. These determine what part(s) of the parent window the child window is linked to.
These enumerated constants are used to give meaningful names to the ways parts of a child window can be linked to its parent.
This gives meaningful names to the types of information we can read about the window stack, as available under the nested Wimp. Used with Wimp_Enumerate.
This holds the button state, ie. what button was used to create a click event. It allows bitfield access to the flags saying which button caused the event. The clickxxx fields represent a single click on a double/click/drag button, and the dragxxx fields represent the start of a drag on any draggable icon.
This is used to hold the current mouse state, as read with Wimp_GetPointerInfo or returned with a Poll event. It gives the screen position of the pointer, the state of the mouse buttons and what window and icon were clicked on.
This defines a shape and active point for the mouse pointer.
This gives meaningful names to the various types of drags that can be initiated with the Wimp_DragBox SWI. The "NC" drag types are not cancelled when the buttons are released. None of the "USER" drag types are directly supported by DeskLib.
This holds information needed to start a Wimp_DragBox operation. You only need the 'window' filled in for the first four drag types, as they directly affect the window's position or size. 'screenrect' defines the initial size and position of the dragbox, and 'parent' defines the limits imposed on the drag where appropriate.
These are the flags to set up the behaviour of a standard Wimp non-multitasking error box. 'noprompt' means that you won't get the "Press space or click mouse to continue" prompt. 'noprefix' means that the title will not be prefixed by "Error from".
This holds the flags for a menu item, which decide the colours, whether the icon is selectable or greyed-out, whether the item is ticked, and so on.
This is a union defining the type of things which can be placed in the 'submenu' field of a menu item, namely a submenu, subwindow or -1 to show that there is no submenu attached.
These follow a menu_block in memory, and define the items in the menu.
This is a menu block, defining a Wimp menu. The menu item blocks follow immediately after this in memory. It can be displayed using Wimp_CreateMenu, or using the functions in the Menu library,
This holds information about the caret position. If the caret is not in a window or icon, they are set to -1. 'offset' contains the caret offset relative to the window's work area origin. 'index' contains the index into the string in the icon, or -1 if not in an icon.
'height' contains the height of the caret in OS units (in bits 0..15), and the flags for the caret: bit 24 means to use a VDU 5 caret instead of the anti-aliased one, bit 25 means the caret is invisible, bit 26 means that bits 16..23 are the colour of the caret, and bit 27 means that the given colour is a logical rather than a wimp colour.
You normally do not need to access the flags (or the height).
This holds information about a keypress event in the event_data union.
This holds information about a non-zero-pollword event in the event_data union.
This gives meaningful names to some of the many Wimp user message codes, which are used to pass between between different applications and the OS.
A window or task handle identifying the task to which a message will be sent.
This is the standard header for a Wimp message block.
'size' should be the total size of the message block (including this header), rounded up to the nearest four bytes. 'sender' is the person who sent the message - this is filled in for you when you send the message. 'myref' and 'yourref' help you to keep track of replies to messages. 'myref' is filled in for you when you send a message, 'yourref' should be 0 for an original message, or the reference of the message being replied to.
The message action code determines the contents of the rest of the message.
This contains the message data needed for a datasave request..
'window', 'icon' and 'pos' are found using Wimp_GetPointerInfo when the drag to save the data ended. 'estsize' if the estimated size (in bytes) of the file to be saved. 'filetype' is the filetype you are intending to save, with -1 meaning untyped, 0x1000 meaning an application and 0x2000 meaning a directory. Finally, the suggested leafname (zero-terminated) should be in 'leafname'.
This holds the message data for the reply to a datasave message. Everything but the filename should be copied from the datasave message it is a reply to, except that the 'estsize' may be -1 if it is "unsafe". In this context, unsafe means it has not been written to a storage device, but merely been displayed by another task, for instance.
This holds the message data for a dataload request.
This holds the message data for a dataload reply. It is identical to the dataload request.
This holds the message data for a dataopen request. It has the same structure as a dataload.
This holds the data for a ramfetch request. It contains a pointer to a buffer where the receiver of the message should put the data, and the size of that buffer.
This holds the data for the response to a ramfetch message - a ramtransmit message - which should be sent after the data has been copied with Wimp_TransferBlock. The 'buffer' should be copied from the ramfetch message, and 'byteswritten' should be the amount of data written to the buffer.
This message is sent by a task which wants to to be given the help text for the given location of the pointer.
This is sent in response to to a helprequest message to supply the help for the location requested. A "|M" within the text indicates a line break.
This holds the data for a PrintTypeOdd message. This is sent when !Printers doesn't know how to print the given filetype. If you know how to print it, you should respond with a PrintTypeKnown message and print it.
This holds the data for a menuwarn message, which is sent to you if you have set the appropriate flag for a menu item. 'id' is the number set in the submenu field of the item, 'openpos' is the (top left) location to open any submenu or window, and 'selection' is the list of selections for the currently open menus, terminated by a -1.
This is the data for an windowiconise message. It is broadcast by the Wimp when a window is iconised. 'task' is the task handle of the owner of the window, and 'title' is 20 bytes of the title string.
This is the data for a windowinfo message. This is used to give information to the "iconiser" (usually the pinboard) about what sprite and title to give to the iconised window.
Broadcast to all tasks when the caret/seletion or clipboard are claimed
Broadcast by an application when it wishes to paste data that it doesn't own.
This is the structure of a wimp message block. It consists of a header which is the same for all messages, and the message data which varies between messages types.
The bytes and words fields allow you to access the data section for any message, while many of the more common messages have their own defined structures to make them easier to use.
Messages are sent with Wimp_SendMessage and received as Wimp Poll events.
This gives meaningful names for the types of events you can receive on a Wimp_Poll. event_ANY is used by the Event library to denote any event code, any window handle or any icon handle, depending.
This holds a pollmask for Wimp_Poll, and allows bitfield access to mask out events as required.
This holds the data from a Scroll Request Wimp Poll event. You are passed a window_openblock and the "direction" of the scroll. The scroll direction are -2 (Page Left/Down), -1 (Left/Down), 0, 1 (Right/Up) and 2 (Page Right/Up).
This holds the data for a Wimp_Poll event. It provides 'bytes' and 'words' for generic access to the data, and structures for accessing the data for a specific event with a more informative and useful interface.
This is the type of block returned by a Wimp_Poll. The information in the 'data' block is determined by the event type.
This type contains a count for each font handle from 0-255 of how many times it has been found with Font_FindFont. It is used in template_block for creating windows.
This holds data for use by Wimp_LoadTemplate. The buffer needs to be large enough to hold the window block you are trying to load, 'workfree' should point to workspace for indirected data with 'workend' pointing to the end of that workspace.
This holds x and y multipliers and divisors, and is used by Wimp_ReadPixTrans to hold scaling information.