home *** CD-ROM | disk | FTP | other *** search
- /*
- *
- * Title : interface.c
- * System : Risc-OS library
- * Version : 2.00
- * Copyright : © Software Interrupt
- * Date : 25nd September, 1990
- * Author : Simon Huntington
- * Updated : Tim Browse, 12th July, 1992
- *
- * Function : Headers for Interface functions
- *
- */
-
- /* DeskLib includes */
- #include "DeskLib.Error.h"
- #include "DeskLib.Wimp.h"
- #include "DeskLib.Event.h"
-
- /* Risc OS Lib includes */
- #include "os.h"
-
- #include "Interface.h"
-
- /*
- *============================================================================
- *
- * Function to border an icon
- *
- * Parameters : mouse - mouse string containg icon, window, buttons
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *Interface_SlabButton (mouse_block *mouse)
- {
- os_regset regs;
- os_error *error;
-
- regs.r[1] = (int) mouse;
- error = os_swix (SWI_Interface_SlabButton, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to border a window
- *
- * Parameters : redraw_box - a redraw box as returned from wimp_EREDRAW
- * poll code
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *Interface_Render3dWindow (window_redrawblock redraw_box)
- {
- os_regset regs;
- os_error *error;
-
- regs.r[1] = (int) &redraw_box;
- error = os_swix (SWI_Interface_Render3dWindow, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to allow application to use Interface pointers
- *
- * Parameters : None
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *Interface_Initialise (void)
- {
- os_regset regs;
- os_error *error;
-
- regs.r[0] = event_taskhandle;
- error = os_swix (SWI_Interface_Initialise, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to stop the application using pointers and remove any workspace
- * used by the application
- *
- * Parameters : None
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *Interface_Closedown(void)
- {
- os_regset regs;
- os_error *error;
-
- regs.r[0] = event_taskhandle;
- error = os_swix (SWI_Interface_Closedown, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to set a workarea pointer
- *
- * Parameters : pointer - a pointer block as described at the start
- * of this header
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *Interface_SetWorkareaPointer(wimp_pointer pointer)
- {
- os_regset regs;
- os_error *error;
-
- regs.r[1] = (int) &pointer;
- error = os_swix (SWI_Interface_SetWorkareaPointer, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to release a workarea pointer
- *
- * Parameters : pointer - a pointer block as described at the start
- * of this header
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *Interface_RemoveWorkAreaPointer (wimp_pointer pointer)
- {
- os_regset regs;
- os_error *error;
-
- regs.r[0] = event_taskhandle;
- regs.r[1] = (int) &pointer;
- error = os_swix (SWI_Interface_RemoveWorkareaPointer, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to swap pointers when over an icon or the appropriate workarea
- *
- * Parameters : poll - the wimp poll reason code
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *Interface_Poll(int poll)
- {
- os_regset regs;
- os_error *error;
-
- regs.r[0] = (int) poll;
- regs.r[2] = event_taskhandle;
- error = os_swix (SWI_Interface_Poll, ®s);
-
- return error;
- }
-
-
-
-
-
- /*
- *============================================================================
- *
- * Function to send help to the help application
- *
- * Parameters : message_block - the message block from the help
- * application
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *Interface_SendHelp(message_header *message_block)
- {
- os_regset regs;
- os_error *error;
-
- regs.r[1] = (int) message_block;
- error = os_swix (SWI_Interface_SendHelp, ®s);
-
- return error;
- }
-
-
-
- /*
- *============================================================================
- *
- * Function to get the bounding box of an icon
- *
- * Parameters : icon - the icon data of the icon
- *
- * Returns : An error is not successful
- *
- *============================================================================
- */
-
- os_error *Interface_BoundingBox(icon_block *icon)
- {
- os_regset regs;
- os_error *error;
-
- regs.r[1] = (int) icon;
- error = os_swix (SWI_Interface_BoundingBox, ®s);
-
- return error;
- }
-
-