home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / Update204 / DeskLib / !DeskLib / h / WimpSWIs
Encoding:
Text File  |  1993-07-22  |  7.1 KB  |  182 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. extern os_error *Wimp_GetWindowInfo(window_info *info);
  88. extern os_error *Wimp_GetWindowOutline(window_outline *outline);
  89. extern os_error *Wimp_SetExtent(window_handle window, wimp_box *newextent);
  90. extern os_error *Wimp_ForceRedraw(window_redrawblock *block);
  91.  
  92.  
  93. /* Icon handling */
  94. extern os_error *Wimp_CreateIcon(icon_createblock *block, icon_handle *icon);
  95. extern os_error *Wimp_DeleteIcon(window_handle window, icon_handle icon);
  96. extern os_error *Wimp_SetIconState(window_handle window,
  97.                                    icon_handle   icon,
  98.                                    int           value,
  99.                                    int           mask);
  100. extern os_error *Wimp_GetIconState(window_handle window,
  101.                                    icon_handle   icon,
  102.                                    icon_block    *iconinfo);
  103. extern os_error *Wimp_WhichIcon(window_handle    window,
  104.                                    icon_handle   *icons,
  105.                                    int           mask,
  106.                                    int           settings);
  107. extern os_error *Wimp_PlotIcon(icon_block *fakeicon);
  108.  
  109.  
  110.  
  111. /*  Poll handling */
  112. /*  DeskLib 2.04:
  113.  *  WimpSWIs.s.Poll has been updated to handle passing a WIMP pollword
  114.  *  under RISC OS 3. The new Poll functions have been named Poll3 and
  115.  *  PollIdle3 so that you can't accidentally link with the new forms
  116.  *  of the functions.
  117.  *  Poll and PollIdle are now macros that map Poll calls onto the new
  118.  *  Poll3 functions (passing a zero for the pollword). So long as you
  119.  *  only try to use pollwords under RISC OS 3 onwards, you should be fine!
  120.  *
  121.  *  If you wish to specifically use the pollword, then call the Poll3 functions
  122.  *  directly, using the new parameter.
  123.  */
  124.  
  125. #define Wimp_Poll(mask, evt) Wimp_Poll3(mask, evt, 0)
  126. #define Wimp_PollIdle(mask, evt, time) Wimp_PollIdle3(mask, evt, time, 0)
  127.  
  128. extern os_error *Wimp_Poll3(event_pollmask mask, event_pollblock *event,
  129.                             void *pollword);
  130. extern os_error *Wimp_PollIdle3(event_pollmask mask, event_pollblock *block,
  131.                                 int earliest, void *pollword);
  132.  
  133. extern os_error *Wimp_SaveFPStateOnPoll(void);
  134. extern os_error *Wimp_CorruptFPStateOnPoll(void);
  135.  
  136.  
  137. /* Pointer/Mouse handling */
  138. extern os_error *Wimp_GetPointerInfo(mouse_block *ptrinfo);
  139. extern os_error *Wimp_SetPointerShape(pointer_shapeblock *shape);
  140.  
  141. extern os_error *Wimp_DragBox(drag_block *draginfo);
  142.  
  143.  
  144. /* Caret handling */
  145. extern os_error *Wimp_SetCaretPosition(caret_block *caret);
  146. extern os_error *Wimp_GetCaretPosition(caret_block *caret);
  147.  
  148.  
  149. /* Menu handling */
  150. extern os_error *Wimp_CreateMenu(menu_block *menu, int xpos, int ypos);
  151. extern os_error *Wimp_CreateSubMenu(menu_block *menu, int xpos, int ypos);
  152. extern os_error *Wimp_DecodeMenu(menu_block *menu,
  153.                                  int        *selections,
  154.                                  char       *result);
  155.  
  156.  
  157. /* Keyboard handling */
  158. extern os_error *Wimp_ProcessKey(int character);
  159.  
  160.  
  161. /* Graphics/Screen handling */
  162. extern os_error *Wimp_SetMode(int mode);
  163. extern os_error *Wimp_SetColour(int colour);
  164. extern os_error *Wimp_ReadPalette(palette_block *palette);
  165. extern os_error *Wimp_SetPalette(palette_block *palette);
  166. extern os_error *Wimp_ReadPixTrans(int         areaindex,
  167.                                    void        *area,
  168.                                    void        *sprite,
  169.                                    scale_block *scaleblock,
  170.                                    char        *transblock);
  171. extern os_error *Wimp_SetFontColours(int foreground, int background);
  172.  
  173. extern os_error *Wimp_SpriteOp(_kernel_swi_regs *registers);
  174. extern os_error *Wimp_BaseOfSprites(void **rom_base, void **ram_base);
  175.  
  176. extern os_error *Wimp_BlockCopy(window_handle window, wimp_box *source,
  177.                                                       int x, int y);
  178.  
  179. extern os_error *Wimp_CommandWindow(int);
  180.  
  181. #endif
  182.