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 John Winters and Jason Williams
- Version: 1.06 (22 Jul 1993)
- Purpose: Prototypes for Wimp SWI calls defined in the Wimp library
- (Basic SWI-level interface to the Wimp)
- */
-
-
- #ifndef __dl_wimpswis_h
- #define __dl_wimpswis_h
-
- #ifndef __dl_core_h
- #include "Core.h"
- #endif
-
- #ifndef __kernel_h
- #include "kernel.h"
- #endif
-
- #ifndef __dl_wimp_h
- #include "Wimp.h"
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /* Task handling: init, closedown, messages, transfers, etc. */
- extern os_error *Wimp_Initialise(unsigned int *version,
- char *name,
- task_handle *task,
- int *messages);
- extern os_error *Wimp_CloseDown(task_handle task);
-
- extern os_error *Wimp_StartTask(char *command);
- extern os_error *Wimp_SlotSize(int *currentslot, int *nextslot, int *freepool);
- extern os_error *Wimp_TransferBlock(task_handle sourcetask,
- void *sourcebuffer,
- task_handle desttask,
- void *destbuffer,
- unsigned int length);
-
- /* 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 Wimp_ReportErrorR
- */
- extern os_error *Wimp_ReportError(os_error *error, int flags, char *name);
-
-
- /* Wimp_ReportErrorR
- * Identical to 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.
- */
- extern int Wimp_ReportErrorR(os_error *error, int flags, char *name);
-
-
- extern os_error *Wimp_SendMessage (event_type eventtype,
- message_block *message,
- message_destinee destinee,
- icon_handle icon);
-
-
- /* window handling */
- extern os_error *Wimp_OpenTemplate(char *name);
- extern os_error *Wimp_CloseTemplate(void);
- extern os_error *Wimp_LoadTemplate(template_block *template_block);
-
- extern os_error *Wimp_CreateWindow(window_block *block, window_handle *window);
- extern os_error *Wimp_OpenWindow(window_openblock *block);
- extern os_error *Wimp_CloseWindow(window_handle window);
- extern os_error *Wimp_DeleteWindow(window_handle window);
-
- extern os_error *Wimp_RedrawWindow(window_redrawblock *block, BOOL *more);
- extern os_error *Wimp_UpdateWindow(window_redrawblock *block, BOOL *more);
- extern os_error *Wimp_GetRectangle(window_redrawblock *block, BOOL *more);
-
- extern os_error *Wimp_GetWindowState(window_handle window,window_state *state);
-
- /* Wimp_GetWindowInfo
- * NOTE that this call returns a window_info PLUS icon data following it.
- * It will therefore overwrite past the end of a normal window_info block.
- * Use Window_GetInfo in preference.
- */
- extern os_error *Wimp_GetWindowInfo(window_info *info);
-
- extern os_error *Wimp_GetWindowOutline(window_outline *outline);
- extern os_error *Wimp_SetExtent(window_handle window, wimp_box *newextent);
- extern os_error *Wimp_ForceRedraw(window_redrawblock *block);
-
-
- /* Icon handling */
- extern os_error *Wimp_CreateIcon(icon_createblock *block, icon_handle *icon);
- extern os_error *Wimp_DeleteIcon(window_handle window, icon_handle icon);
- extern os_error *Wimp_SetIconState(window_handle window,
- icon_handle icon,
- int value,
- int mask);
- extern os_error *Wimp_GetIconState(window_handle window,
- icon_handle icon,
- icon_block *iconinfo);
- extern os_error *Wimp_WhichIcon(window_handle window,
- icon_handle *icons,
- int mask,
- int settings);
- extern os_error *Wimp_PlotIcon(icon_block *fakeicon);
-
-
-
- /* 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 Wimp_Poll(mask, evt) Wimp_Poll3(mask, evt, 0)
- #define Wimp_PollIdle(mask, evt, time) Wimp_PollIdle3(mask, evt, time, 0)
-
- extern os_error *Wimp_Poll3(event_pollmask mask, event_pollblock *event,
- void *pollword);
- extern os_error *Wimp_PollIdle3(event_pollmask mask, event_pollblock *block,
- int earliest, void *pollword);
-
- extern os_error *Wimp_SaveFPStateOnPoll(void);
- extern os_error *Wimp_CorruptFPStateOnPoll(void);
-
-
- /* Pointer/Mouse handling */
- extern os_error *Wimp_GetPointerInfo(mouse_block *ptrinfo);
- extern os_error *Wimp_SetPointerShape(pointer_shapeblock *shape);
-
- extern os_error *Wimp_DragBox(drag_block *draginfo);
-
-
- /* Caret handling */
- extern os_error *Wimp_SetCaretPosition(caret_block *caret);
- extern os_error *Wimp_GetCaretPosition(caret_block *caret);
-
-
- /* Menu handling */
- extern os_error *Wimp_CreateMenu(menu_ptr menu, int xpos, int ypos);
- extern os_error *Wimp_CreateSubMenu(menu_ptr menu, int xpos, int ypos);
- extern os_error *Wimp_DecodeMenu(menu_ptr menu,
- int *selections,
- char *result);
-
-
- /* Keyboard handling */
- extern os_error *Wimp_ProcessKey(int character);
-
-
- /* Graphics/Screen handling */
- extern os_error *Wimp_SetMode(int mode);
- extern os_error *Wimp_SetColour(int colour);
- extern os_error *Wimp_ReadPalette(palette_block *palette);
- extern os_error *Wimp_SetPalette(palette_block *palette);
- extern os_error *Wimp_ReadPixTrans(int areaindex,
- void *area,
- void *sprite,
- scale_block *scaleblock,
- char *transblock);
- extern os_error *Wimp_SetFontColours(int foreground, int background);
-
- extern os_error *Wimp_SpriteOp(_kernel_swi_regs *registers);
- extern os_error *Wimp_BaseOfSprites(void **rom_base, void **ram_base);
-
- extern os_error *Wimp_BlockCopy(window_handle window, wimp_box *source,
- int x, int y);
-
- extern os_error *Wimp_CommandWindow(int);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-