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