home *** CD-ROM | disk | FTP | other *** search
- /* Interface.h - simple macros for Interface SWIs when using DeskLib. */
-
- /*
-
- ##### # #
- # # # # #
- # # #
- # ## #### #### # ## ####
- # # # # # # # # # #
- # # # # # ### # # # #
- # # # # # # # # # #
- # ### # # # #### ##### ### ####
-
- -----------------------------------------------------------------------------
-
- This is source for use with the 'DeskLib' Wimp C programming library for
- Risc OS. I currently use v1.04 of DeskLib. This source is FreeWare, which
- means you can use it to write commercial applications, but you may not charge
- *in any way* for the distribution of this source. I (Tim Browse) retain
- all copyright on this source.
-
- This source is provided 'as is' and I offer no guarantees that is useful,
- bug-free, commented, that it will compile, or even that it exists.
-
- If it breaks in half, you own both pieces.
-
- All source © Tim Browse 1993
-
- -----------------------------------------------------------------------------
-
- */
-
- #ifndef __interface_h
- #define __interface_h
-
- #include "DeskLib.SWI.h"
- #include "DeskLib.Event.h"
-
- typedef struct
- {
- int window_handle,
- x0, y0, x1, y1;
-
- char ptr_validation [24];
- } wimp_pointer;
-
- /*
- These functions are implemented as #defines...the equivalent C declarations
- would be:
-
- extern os_error *Interface_SlabButton(mouse_block *mouse);
- extern os_error *Interface_Render3dWindow(window_redrawblock *redraw);
- extern os_error *Interface_Initialise(void);
- extern os_error *Interface_Closedown(void);
- extern os_error *Interface_SetWorkareaPointer(wimp_pointer *pointer);
- extern os_error *Interface_RemoveWorkareaPointer(wimp_pointer *pointer);
- extern os_error *Interface_Poll(int poll);
- extern os_error *Interface_SendHelp(message_header *message_block);
- extern os_error *Interface_Plot3dIcon(window_state *wstate, icon_block *icon);
- extern os_error *Interface_BoundingBox(icon_block *icon);
-
- Note that any structures are passed as pointers to structures; with the header
- provided by the author of Interface this was not always the case - the ones which
- passed structures (naughty!) were:
-
- Render3dWindow, SetWorkareaPointer, and RemoveWorkareaPointer.
-
- Also note that some are untested : I use - and therefore know to work - the
- following (barring Interface bugs):
-
- BoundingBox, Initialise, CloseDown, SlabButton, Poll, & Render3dWindow.
- */
-
-
- #define Interface_SlabButton(mouse) (SWI(2, 0, 0x81680, 0, mouse))
-
- #define Interface_Render3dWindow(redraw) (SWI(2, 0, 0x81681, 0, redraw))
-
- #define Interface_Initialise() (SWI(1, 0, 0x81682, event_taskhandle))
-
- #define Interface_Closedown() (SWI(1, 0, 0x81683, event_taskhandle))
-
- #define Interface_SetWorkareaPointer(pointer) (SWI(2, 0, 0x81684, 0, pointer))
-
- #define Interface_RemoveWorkareaPointer(pointer) (SWI(2, 0, 0x81685, 0, pointer))
-
- #define Interface_Poll(poll) (SWI(3, 0, 0x81686, poll, 0, event_taskhandle))
- #define Interface_SendHelp(msg_block) (SWI(2, 0, 0x81687, 0, msg_block))
-
- #define Interface_Plot3dIcon(wstate, icon) (SWI(2, 0, 0x81689, wstate, icon))
-
- #define Interface_BoundingBox(icon) (SWI(2, 0, 0x8168A, 0, icon))
-
-
- /* This one not yet implemented: (I don't use it and so can't be bothered)
-
- It's a bit special anyway as you'd probably need to plonk it in the Event
- module, or if not, you couldn't use Event_Process().
-
- #define Interface_PreProcessKey (SWI(0, 0, 0x81688)
-
- */
-
- #endif
-