home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / gcc / !GCC / patches / DeskLib / h / WimpSWIs < prev    next >
Encoding:
Text File  |  1994-10-03  |  7.3 KB  |  196 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    WimpSWIs.h
  12.     Author:  Copyright © 1992, 1993 John Winters and Jason Williams
  13.     Version: 1.06 (22 Jul 1993)
  14.     Purpose: Prototypes for Wimp SWI calls defined in the Wimp library
  15.              (Basic SWI-level interface to the Wimp)
  16. */
  17.  
  18.  
  19. #ifndef __dl_wimpswis_h
  20. #define __dl_wimpswis_h
  21.  
  22. #ifndef __dl_core_h
  23. #include "Core.h"
  24. #endif
  25.  
  26. #ifndef __kernel_h
  27. #include "kernel.h"
  28. #endif
  29.  
  30. #ifndef __dl_wimp_h
  31. #include "Wimp.h"
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. /* Task handling: init, closedown, messages, transfers, etc. */
  39. extern os_error *Wimp_Initialise(unsigned int *version,
  40.                                  char         *name,
  41.                                  task_handle  *task,
  42.                                  int          *messages);
  43. extern os_error *Wimp_CloseDown(task_handle task);
  44.  
  45. extern os_error *Wimp_StartTask(char *command);
  46. extern os_error *Wimp_SlotSize(int *currentslot, int *nextslot, int *freepool);
  47. extern os_error *Wimp_TransferBlock(task_handle  sourcetask,
  48.                                     void         *sourcebuffer,
  49.                                     task_handle  desttask,
  50.                                     void         *destbuffer,
  51.                                     unsigned int length);
  52.  
  53.  /*  Wimp_ReportError
  54.   *  Reports an error in the standard WIMP non-multitasking error box.
  55.   *  Avoid (by using your own multitasking error box) where possible!
  56.   *  See also Wimp_ReportErrorR
  57.   */
  58. extern os_error *Wimp_ReportError(os_error *error, int flags, char *name);
  59.  
  60.  
  61.  /*  Wimp_ReportErrorR
  62.   *  Identical to Wimp_ReportError, except this version returns the flags
  63.   *  that are returned by the SWI. That is, the return code from this
  64.   *  function is 1 if OK was pressed or 2 if Cancel was pressed.
  65.   */
  66. extern int Wimp_ReportErrorR(os_error *error, int flags, char *name);
  67.  
  68.  
  69. extern os_error *Wimp_SendMessage (event_type       eventtype,
  70.                                    message_block    *message,
  71.                                    message_destinee destinee,
  72.                                    icon_handle      icon);
  73.  
  74.  
  75. /* window handling */
  76. extern os_error *Wimp_OpenTemplate(char *name);
  77. extern os_error *Wimp_CloseTemplate(void);
  78. extern os_error *Wimp_LoadTemplate(template_block *template_block);
  79.  
  80. extern os_error *Wimp_CreateWindow(window_block *block, window_handle *window);
  81. extern os_error *Wimp_OpenWindow(window_openblock *block);
  82. extern os_error *Wimp_CloseWindow(window_handle window);
  83. extern os_error *Wimp_DeleteWindow(window_handle window);
  84.  
  85. extern os_error *Wimp_RedrawWindow(window_redrawblock *block, BOOL *more);
  86. extern os_error *Wimp_UpdateWindow(window_redrawblock *block, BOOL *more);
  87. extern os_error *Wimp_GetRectangle(window_redrawblock *block, BOOL *more);
  88.  
  89. extern os_error *Wimp_GetWindowState(window_handle window,window_state *state);
  90.  
  91. /*  Wimp_GetWindowInfo
  92.  *  NOTE that this call returns a window_info PLUS icon data following it.
  93.  *  It will therefore overwrite past the end of a normal window_info block.
  94.  *  Use Window_GetInfo in preference.
  95.  */
  96. extern os_error *Wimp_GetWindowInfo(window_info *info);
  97.  
  98. extern os_error *Wimp_GetWindowOutline(window_outline *outline);
  99. extern os_error *Wimp_SetExtent(window_handle window, wimp_box *newextent);
  100. extern os_error *Wimp_ForceRedraw(window_redrawblock *block);
  101.  
  102.  
  103. /* Icon handling */
  104. extern os_error *Wimp_CreateIcon(icon_createblock *block, icon_handle *icon);
  105. extern os_error *Wimp_DeleteIcon(window_handle window, icon_handle icon);
  106. extern os_error *Wimp_SetIconState(window_handle window,
  107.                                    icon_handle   icon,
  108.                                    int           value,
  109.                                    int           mask);
  110. extern os_error *Wimp_GetIconState(window_handle window,
  111.                                    icon_handle   icon,
  112.                                    icon_block    *iconinfo);
  113. extern os_error *Wimp_WhichIcon(window_handle    window,
  114.                                    icon_handle   *icons,
  115.                                    int           mask,
  116.                                    int           settings);
  117. extern os_error *Wimp_PlotIcon(icon_block *fakeicon);
  118.  
  119.  
  120.  
  121. /*  Poll handling */
  122. /*  DeskLib 2.04:
  123.  *  WimpSWIs.s.Poll has been updated to handle passing a WIMP pollword
  124.  *  under RISC OS 3. The new Poll functions have been named Poll3 and
  125.  *  PollIdle3 so that you can't accidentally link with the new forms
  126.  *  of the functions.
  127.  *  Poll and PollIdle are now macros that map Poll calls onto the new
  128.  *  Poll3 functions (passing a zero for the pollword). So long as you
  129.  *  only try to use pollwords under RISC OS 3 onwards, you should be fine!
  130.  *
  131.  *  If you wish to specifically use the pollword, then call the Poll3 functions
  132.  *  directly, using the new parameter.
  133.  */
  134.  
  135. #define Wimp_Poll(mask, evt) Wimp_Poll3(mask, evt, 0)
  136. #define Wimp_PollIdle(mask, evt, time) Wimp_PollIdle3(mask, evt, time, 0)
  137.  
  138. extern os_error *Wimp_Poll3(event_pollmask mask, event_pollblock *event,
  139.                             void *pollword);
  140. extern os_error *Wimp_PollIdle3(event_pollmask mask, event_pollblock *block,
  141.                                 int earliest, void *pollword);
  142.  
  143. extern os_error *Wimp_SaveFPStateOnPoll(void);
  144. extern os_error *Wimp_CorruptFPStateOnPoll(void);
  145.  
  146.  
  147. /* Pointer/Mouse handling */
  148. extern os_error *Wimp_GetPointerInfo(mouse_block *ptrinfo);
  149. extern os_error *Wimp_SetPointerShape(pointer_shapeblock *shape);
  150.  
  151. extern os_error *Wimp_DragBox(drag_block *draginfo);
  152.  
  153.  
  154. /* Caret handling */
  155. extern os_error *Wimp_SetCaretPosition(caret_block *caret);
  156. extern os_error *Wimp_GetCaretPosition(caret_block *caret);
  157.  
  158.  
  159. /* Menu handling */
  160. extern os_error *Wimp_CreateMenu(menu_ptr menu, int xpos, int ypos);
  161. extern os_error *Wimp_CreateSubMenu(menu_ptr menu, int xpos, int ypos);
  162. extern os_error *Wimp_DecodeMenu(menu_ptr menu,
  163.                                  int      *selections,
  164.                                  char     *result);
  165.  
  166.  
  167. /* Keyboard handling */
  168. extern os_error *Wimp_ProcessKey(int character);
  169.  
  170.  
  171. /* Graphics/Screen handling */
  172. extern os_error *Wimp_SetMode(int mode);
  173. extern os_error *Wimp_SetColour(int colour);
  174. extern os_error *Wimp_ReadPalette(palette_block *palette);
  175. extern os_error *Wimp_SetPalette(palette_block *palette);
  176. extern os_error *Wimp_ReadPixTrans(int         areaindex,
  177.                                    void        *area,
  178.                                    void        *sprite,
  179.                                    scale_block *scaleblock,
  180.                                    char        *transblock);
  181. extern os_error *Wimp_SetFontColours(int foreground, int background);
  182.  
  183. extern os_error *Wimp_SpriteOp(_kernel_swi_regs *registers);
  184. extern os_error *Wimp_BaseOfSprites(void **rom_base, void **ram_base);
  185.  
  186. extern os_error *Wimp_BlockCopy(window_handle window, wimp_box *source,
  187.                                                       int x, int y);
  188.  
  189. extern os_error *Wimp_CommandWindow(int);
  190.  
  191. #ifdef __cplusplus
  192.            }
  193. #endif
  194.  
  195. #endif
  196.