home *** CD-ROM | disk | FTP | other *** search
- /*
- #### # # # #
- # # # # # The FreeWare C library for
- # # ## ### # # # # ### RISC OS machines
- # # # # # # # # # # # ___________________________________
- # # #### ### ## # # # #
- # # # # # # # # # # Please refer to the accompanying
- #### ### #### # # ##### # ### documentation for conditions of use
- ________________________________________________________________________
-
- File: WimpSWIs.h
- Author: Copyright © 1992, 1993, 1994 John Winters, Jason Williams
- Sergio Monesi, Julian Smith.
- Version: 1.08 (09 Sep 1995)
- Purpose: Prototypes for Wimp SWI calls defined in the Wimp library
- (Basic SWI-level interface to the Wimp)
-
- Mods: 19 Mar 1995 - JS - Added macros to make calls to
- Desk_Wimp_Poll(Idle) actually call Straylight
- equivalents, when compilataion is for
- dynamic linking.
- 08 Jul 1995 - JS - Removed #include of kernel.h, and changed
- Desk_Wimp_SpriteOp prototype, to make
- DeskLib usable without Acorn headers
-
- 13 Jul 1995 - SM - Added Desk_Wimp_StartTask3 and
- Desk_Wimp_GetWindowInfoNoIcons (for RISC OS 3.10
- or later).
-
- 09 Sep 1995 - JS - Added Desk_Wimp_e* macros for each Wimp SWI.
- These call Desk_Error2_XHandle if the SWI returns
- an (Desk_os_error *).
- 10 Nov 1995 - JS - Added Desk_Wimp_E* macros for each Wimp SWI.
- These call Desk_Error2_Handle if the SWI returns
- an (Desk_os_error *).
-
- */
-
-
- #ifndef __Desk_WimpSWIs_h
- #define __Desk_WimpSWIs_h
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- #ifndef __Desk_Core_h
- #include "Desk.Core.h"
- #endif
-
- #ifndef __Desk_Wimp_h
- #include "Desk.Wimp.h"
- #endif
-
- #ifndef __Desk_Error2_h
- #include "Desk.Error2.h"
- #endif
-
-
- /* Task handling: init, closedown, messages, transfers, etc. */
-
- extern void Desk_Wimp_Initialise(const unsigned int *version,
- const char *name,
- Desk_task_handle *task,
- const int *messages);
- extern void Desk_Wimp_CloseDown(Desk_task_handle task);
-
- extern void Desk_Wimp_StartTask(const char *command);
-
- extern void Desk_Wimp_StartTask3(const char *command, Desk_task_handle *newtask);
- /* Desk_Wimp_StartTask3
- * RISC OS 3 version of Desk_Wimp_StartTask that returns the task handle of
- * the started task if it is still alive or 0 if it isn't
- */
-
- extern void Desk_Wimp_SlotSize(int *currentslot, int *nextslot, int *freepool);
- extern void Desk_Wimp_TransferBlock(Desk_task_handle sourcetask,
- void *sourcebuffer,
- Desk_task_handle desttask,
- void *destbuffer,
- unsigned int length);
-
- extern void Desk_Wimp_ReportError(const Desk_os_error *error, int flags, const char *name);
- /* Desk_Wimp_ReportError
- * Reports an error in the standard WIMP non-multitasking error box.
- * Avoid (by using your own multitasking error box) where possible!
- * See also Desk_Wimp_ReportErrorR
- * 'flags' should be as in the Desk_error_flags union.
- */
-
- enum {
- Desk_wimp_reporterror_button_NONE = 0,
- Desk_wimp_reporterror_button_OK = 1,
- Desk_wimp_reporterror_button_CANCEL = 2
- };
-
-
- extern int Desk_Wimp_ReportErrorR(const Desk_os_error *error, int flags, const char *name);
- /* Desk_Wimp_ReportErrorR
- * Identical to Desk_Wimp_ReportError, except this version returns the flags
- * that are returned by the SWI. That is, the return code from this
- * function is 1 if OK was pressed or 2 if Cancel was pressed (see
- * Desk_wimp_reporterror_button_NONE, Desk_wimp_reporterror_button_OK,
- * Desk_wimp_reporterror_button_CANCEL).
- * 'flags' should be as in the Desk_error_flags union.
- */
-
- /*
- extern int Desk_Wimp_ReportErrorR350(
- const Desk_os_error *error,
- int flags,
- const char *name,
- const char* spritename,
- Desk_sprite_area area,
- const char* text
- );
- */ /* Identical to Desk_Wimp_ReportErrorR, except it supports
- * the new parameters in RO3.5
- */
-
-
-
-
-
- extern void Desk_Wimp_SendMessage (Desk_event_type eventtype,
- Desk_message_block *message,
- Desk_message_destinee destinee,
- Desk_icon_handle icon);
-
-
- /* window handling */
-
- extern void Desk_Wimp_OpenTemplate(const char *name);
- extern void Desk_Wimp_CloseTemplate(void);
- extern void Desk_Wimp_LoadTemplate(Desk_template_block *wtemplate);
-
- extern void Desk_Wimp_CreateWindow(const Desk_window_block *block, Desk_window_handle *window);
- extern void Desk_Wimp_OpenWindow(const Desk_window_openblock *block);
- extern void Desk_Wimp_CloseWindow(Desk_window_handle window);
- extern void Desk_Wimp_DeleteWindow(Desk_window_handle window);
-
- extern void Desk_Wimp_RedrawWindow(Desk_window_redrawblock *block, Desk_bool *more);
- extern void Desk_Wimp_UpdateWindow(Desk_window_redrawblock *block, Desk_bool *more);
- extern void Desk_Wimp_GetRectangle(Desk_window_redrawblock *block, Desk_bool *more);
-
- extern void Desk_Wimp_GetWindowState(Desk_window_handle window, Desk_window_state *state);
-
- extern void Desk_Wimp_GetWindowInfo(Desk_window_info *info);
- /*
- * NOTE that this call returns a Desk_window_info PLUS icon data following it.
- * It will therefore overwrite past the end of a normal Desk_window_info block.
- * Use Desk_Window_GetInfo in preference.
- */
-
- extern void Desk_Wimp_GetWindowInfoNoIcons(Desk_window_info *info);
- /*
- * This call returns only the Desk_window_info, NOT the icons data. It only
- * works with RISC OS 3.10 or later
- */
-
- extern void Desk_Wimp_GetWindowOutline(Desk_window_outline *outline);
- extern void Desk_Wimp_SetExtent(Desk_window_handle window, Desk_wimp_box *newextent);
- extern void Desk_Wimp_ForceRedraw(const Desk_window_redrawblock *block);
-
-
-
- /* Icon handling */
-
- extern void Desk_Wimp_CreateIcon(const Desk_icon_createblock *block, Desk_icon_handle *icon);
- extern void Desk_Wimp_DeleteIcon(Desk_window_handle window, Desk_icon_handle icon);
- extern void Desk_Wimp_SetIconState(Desk_window_handle window,
- Desk_icon_handle icon,
- int value,
- int mask);
- extern void Desk_Wimp_GetIconState(Desk_window_handle window,
- Desk_icon_handle icon,
- Desk_icon_block *iconinfo);
- extern void Desk_Wimp_WhichIcon(Desk_window_handle window,
- Desk_icon_handle *icons,
- int mask,
- int settings);
-
- extern void Desk_Wimp_PlotIcon(Desk_icon_block *fakeicon);
- /*
- Don't call this except in a redraw loop. If not in a redraw loop, use
- Desk_Wimp_PlotIcon2.
- */
-
- extern void Desk_Wimp_PlotIcon2( Desk_icon_block *fakeicon, int xorigin, int yorigin);
- /*
- When not invoked in a redraw loop, Wimp_PlotIcon assumes origin at
- (r4,r5). This is undocumented AFAIK, even in PRMs 5a, but see PRMs
- 5a-516.
-
- I think Wimp_Plot ignores the current graphics origin in favour of
- (r4,r5) when invoked outside a redraw loop, so you should include the
- graphics origin explicitly using this call when redrawing to a sprite
- for example.
-
- If in a redraw loop, xorigin and yorigin are ignored by the underlying
- SWI Wimp_PlotIcon, so you'll save a few ns by using Desk_Wimp_PlotIcon.
- */
-
-
-
- /* Poll handling */
- /* DeskLib 2.04:
- * WimpSWIs.s.Poll has been updated to handle passing a WIMP pollword
- * under RISC OS 3. The new Poll functions have been named Poll3 and
- * PollIdle3 so that you can't accidentally link with the new forms
- * of the functions.
- * Poll and PollIdle are now macros that map Poll calls onto the new
- * Poll3 functions (passing a zero for the pollword). So long as you
- * only try to use pollwords under RISC OS 3 onwards, you should be fine!
- *
- * If you wish to specifically use the pollword, then call the Poll3 functions
- * directly, using the new parameter.
- */
-
- #define Desk_Wimp_Poll(mask, evt) Desk_Wimp_Poll3(mask, evt, 0)
- #define Desk_Wimp_PollIdle(mask, evt, time) Desk_Wimp_PollIdle3(mask, evt, time, 0)
-
- extern void Desk_Wimp_Poll3(Desk_event_pollmask mask, Desk_event_pollblock *event,
- void *pollword);
- extern void Desk_Wimp_PollIdle3(Desk_event_pollmask mask, Desk_event_pollblock *block,
- int earliest, void *pollword);
-
-
-
- /*
- Some macro stuff to make sure the SDLS Desk_Wimp_Poll veneers are
- called if compilation is for a DLL.
- */
-
-
- #ifdef Desk__using_SDLS
-
- extern Desk_event_type _dll_wimpPoll(
- Desk_event_pollmask mask,
- Desk_event_data *data,
- int dummy,
- void *pollword
- );
- /*
- This SDLS function preserves the Straylight DLL handle in case a new
- application starts before Desk_Wimp_Poll returns.
- Only used if compilation is for a SDLS client application.
- */
-
- extern Desk_event_type _dll_wimpPollIdle(
- Desk_event_pollmask mask,
- Desk_event_data *data,
- int earliest,
- void *pollword
- );
- /*
- This SDLS function preserves the Straylight DLL handle in case a new
- application starts before Desk_Wimp_Poll returns.
- Only used if compilation is for a SDLS client application.
- */
-
- extern void Desk_Wimp_Poll3_DLL( Desk_event_pollmask mask, Desk_event_pollblock *event,
- void *pollword);
- /*
- A DeskLib-style veneer onto the Straylight DLL handle-preserving function.
- Only used if compilation is for a SDLS client application.
- */
-
- extern void Desk_Wimp_PollIdle3_DLL( Desk_event_pollmask mask, Desk_event_pollblock *block,
- int earliest, void *pollword);
- /*
- A DeskLib-style veneer onto the Straylight DLL handle-preserving function.
- Only used if compilation is for a SDLS client application.
- */
-
- #define Desk_Wimp_Poll3 Desk_Wimp_Poll3_DLL
- #define Desk_Wimp_PollIdle3 Desk_Wimp_PollIdle3_DLL
-
-
- #endif
-
-
-
-
-
- extern void Desk_Wimp_SaveFPStateOnPoll(void);
- extern void Desk_Wimp_CorruptFPStateOnPoll(void);
-
-
- /* Pointer/Mouse handling */
-
- extern void Desk_Wimp_GetPointerInfo(Desk_mouse_block *ptrinfo);
- extern void Desk_Wimp_SetPointerShape(const Desk_pointer_shapeblock *shape);
-
- extern void Desk_Wimp_DragBox(Desk_drag_block *draginfo);
-
-
- /* Caret handling */
-
- extern void Desk_Wimp_SetCaretPosition(const Desk_caret_block *caret);
- extern void Desk_Wimp_GetCaretPosition(const Desk_caret_block *caret);
-
-
- /* Menu handling */
-
- extern void Desk_Wimp_CreateMenu(Desk_menu_ptr menu, int xpos, int ypos);
- extern void Desk_Wimp_CreateSubMenu(Desk_menu_ptr menu, int xpos, int ypos);
- extern void Desk_Wimp_DecodeMenu(Desk_menu_ptr menu,
- const int *selections,
- char *result);
- /*
- Note that this makes a CR-terminated string.
- */
-
-
- /* Keyboard handling */
-
- extern void Desk_Wimp_ProcessKey(int character);
-
-
- /* Graphics/Screen handling */
-
- extern void Desk_Wimp_SetMode(int mode);
- extern void Desk_Wimp_SetColour(int colour);
- extern void Desk_Wimp_ReadPalette(Desk_palette_block *palette);
- extern void Desk_Wimp_SetPalette(const Desk_palette_block *palette);
- extern void Desk_Wimp_ReadPixTrans(int areaindex,
- void *area,
- void *sprite,
- Desk_scale_block *scaleblock,
- char *transblock);
- extern void Desk_Wimp_SetFontColours(int foreground, int background);
-
-
- extern void Desk_Wimp_SpriteOp( int r[10]);
- /*
- r = should be a pointer to an array of 10 ints
- This used to be:
- extern void Desk_Wimp_SpriteOp(_kernel_swi_regs *registers);
- */
-
- extern void Desk_Wimp_BaseOfSprites(void **Desk_rom_base, void **Desk_ram_base);
-
- extern void Desk_Wimp_BlockCopy(Desk_window_handle window, const Desk_wimp_box *source,
- int x, int y);
-
- extern void Desk_Wimp_CommandWindow(int);
-
-
-
- #ifdef __cplusplus
- }
- #endif
-
-
- #endif
-