home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / clib / progs / timslib / TimsLib / h / Interface < prev    next >
Encoding:
Text File  |  1993-01-22  |  3.6 KB  |  105 lines

  1. /* Interface.h - simple macros for Interface SWIs when using DeskLib. */
  2.  
  3. /*                           
  4.  
  5.   #####                 #         #
  6.     #    #              #      #  #
  7.     #                   #         #
  8.     #   ##  ####   #### #     ##  ####
  9.     #    #  # # # #     #      #  #   #
  10.     #    #  # # #  ###  #      #  #   #
  11.     #    #  # # #     # #      #  #   #
  12.     #   ### # # # ####  ##### ### ####
  13.  
  14. -----------------------------------------------------------------------------
  15.  
  16. This is source for use with the 'DeskLib' Wimp C programming library for
  17. Risc OS. I currently use v1.04 of DeskLib.  This source is FreeWare, which
  18. means you can use it to write commercial applications, but you may not charge
  19. *in any way* for the distribution of this source.  I (Tim Browse) retain
  20. all copyright on this source.
  21.  
  22. This source is provided 'as is' and I offer no guarantees that is useful,
  23. bug-free, commented, that it will compile, or even that it exists.
  24.  
  25. If it breaks in half, you own both pieces.
  26.  
  27. All source © Tim Browse 1993
  28.  
  29. -----------------------------------------------------------------------------
  30.  
  31. */
  32.  
  33. #ifndef __interface_h
  34. #define __interface_h
  35.  
  36. #include "DeskLib.SWI.h"
  37. #include "DeskLib.Event.h"
  38.  
  39. typedef struct
  40. {
  41.   int  window_handle,
  42.        x0, y0, x1, y1;                  
  43.  
  44.   char ptr_validation [24];
  45. } wimp_pointer;
  46.  
  47. /*
  48.   These functions are implemented as #defines...the equivalent C declarations
  49.   would be:
  50.  
  51. extern os_error *Interface_SlabButton(mouse_block *mouse);
  52. extern os_error *Interface_Render3dWindow(window_redrawblock *redraw);
  53. extern os_error *Interface_Initialise(void);
  54. extern os_error *Interface_Closedown(void);
  55. extern os_error *Interface_SetWorkareaPointer(wimp_pointer *pointer);
  56. extern os_error *Interface_RemoveWorkareaPointer(wimp_pointer *pointer);
  57. extern os_error *Interface_Poll(int poll);
  58. extern os_error *Interface_SendHelp(message_header *message_block);
  59. extern os_error *Interface_Plot3dIcon(window_state *wstate, icon_block *icon);
  60. extern os_error *Interface_BoundingBox(icon_block *icon);
  61.  
  62.   Note that any structures are passed as pointers to structures; with the header
  63.   provided by the author of Interface this was not always the case - the ones which
  64.   passed structures (naughty!) were:
  65.  
  66.     Render3dWindow, SetWorkareaPointer, and RemoveWorkareaPointer.
  67.  
  68.   Also note that some are untested : I use - and therefore know to work - the 
  69.   following (barring Interface bugs):
  70.  
  71.     BoundingBox, Initialise, CloseDown, SlabButton, Poll, & Render3dWindow.
  72. */
  73.  
  74.  
  75. #define Interface_SlabButton(mouse)              (SWI(2, 0, 0x81680, 0, mouse))
  76.  
  77. #define Interface_Render3dWindow(redraw)         (SWI(2, 0, 0x81681, 0, redraw))
  78.  
  79. #define Interface_Initialise()                   (SWI(1, 0, 0x81682, event_taskhandle))
  80.  
  81. #define Interface_Closedown()                    (SWI(1, 0, 0x81683, event_taskhandle))
  82.  
  83. #define Interface_SetWorkareaPointer(pointer)    (SWI(2, 0, 0x81684, 0, pointer))
  84.  
  85. #define Interface_RemoveWorkareaPointer(pointer) (SWI(2, 0, 0x81685, 0, pointer))
  86.  
  87. #define Interface_Poll(poll)                     (SWI(3, 0, 0x81686, poll, 0, event_taskhandle))
  88. #define Interface_SendHelp(msg_block)            (SWI(2, 0, 0x81687, 0, msg_block))
  89.  
  90. #define Interface_Plot3dIcon(wstate, icon)       (SWI(2, 0, 0x81689, wstate, icon))
  91.  
  92. #define Interface_BoundingBox(icon)              (SWI(2, 0, 0x8168A, 0, icon))
  93.  
  94.  
  95. /* This one not yet implemented: (I don't use it and so can't be bothered)
  96.  
  97.    It's a bit special anyway as you'd probably need to plonk it in the Event
  98.    module, or if not, you couldn't use Event_Process().
  99.  
  100. #define Interface_PreProcessKey                  (SWI(0, 0, 0x81688)
  101.  
  102. */
  103.  
  104. #endif
  105.