home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / Toolbox / h / draggable < prev    next >
Encoding:
Text File  |  1995-09-05  |  7.3 KB  |  255 lines

  1. #ifndef draggable_H
  2. #define draggable_H
  3.  
  4. /* C header file for Draggable
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 16:29:21 1995
  6.  * Jonathan Coxhead, Acorn Computers Ltd
  7.  */
  8.  
  9. #ifndef types_H
  10. #include "types.h"
  11. #endif
  12.  
  13. #ifndef toolbox_H
  14. #include "toolbox.h"
  15. #endif
  16.  
  17. #ifndef window_H
  18. #include "window.h"
  19. #endif
  20.  
  21. /**********************************
  22.  * SWI names and SWI reason codes *
  23.  **********************************/
  24. #undef  Draggable_SetSprite
  25. #define Draggable_SetSprite                     0x280
  26. #undef  Draggable_GetSprite
  27. #define Draggable_GetSprite                     0x281
  28. #undef  Draggable_SetText
  29. #define Draggable_SetText                       0x282
  30. #undef  Draggable_GetText
  31. #define Draggable_GetText                       0x283
  32. #undef  Draggable_SetState
  33. #define Draggable_SetState                      0x284
  34. #undef  Draggable_GetState
  35. #define Draggable_GetState                      0x285
  36.  
  37. /************************************
  38.  * Structure and union declarations *
  39.  ************************************/
  40. typedef struct draggable_gadget                 draggable_gadget;
  41. typedef struct draggable_action_drag_ended      draggable_action_drag_ended;
  42.  
  43. /********************
  44.  * Type definitions *
  45.  ********************/
  46. struct draggable_gadget
  47.    {  toolbox_msg_reference text;
  48.       int text_limit;
  49.       toolbox_string_reference sprite_name;
  50.       int sprite_limit;
  51.    };
  52.  
  53. struct draggable_action_drag_ended
  54.    {  union
  55.       {  struct
  56.          {  wimp_w w;
  57.             wimp_i i;
  58.          }
  59.          wimp;
  60.          struct
  61.          {  toolbox_o o;
  62.             toolbox_c c;
  63.          }
  64.          toolbox;
  65.       }
  66.       ids;
  67.       os_coord pos;
  68.    };
  69.  
  70. /************************
  71.  * Constant definitions *
  72.  ************************/
  73. #define class_DRAGGABLE                         ((toolbox_class) 0x280u)
  74. #define draggable_GENERATE_DRAG_STARTED         ((gadget_flags) 0x1u)
  75. #define draggable_SPRITE                        ((gadget_flags) 0x2u)
  76. #define draggable_TEXT                          ((gadget_flags) 0x4u)
  77. #define draggable_TYPE                          ((gadget_flags) 0x38u)
  78. #define draggable_TYPE_SHIFT                    3
  79. #define draggable_TYPE_DRAG                     0x0u
  80. #define draggable_TYPE_CLICK_DRAG               0x1u
  81. #define draggable_TYPE_CLICK_DOUBLE_DRAG        0x2u
  82. #define draggable_USE_TOOLBOX_IDS               ((gadget_flags) 0x40u)
  83. #define draggable_DROP_SHADOW                   ((gadget_flags) 0x80u)
  84. #define draggable_NO_DITHER                     ((gadget_flags) 0x100u)
  85. #define action_DRAGGABLE_DRAG_STARTED           0x82887u
  86. #define action_DRAGGABLE_DRAG_ENDED             0x82888u
  87. #define draggable_DRAG_STARTED_ADJUST           0x1u
  88. #define draggable_DRAG_STARTED_SELECT           0x4u
  89. #define draggable_DRAG_STARTED_SHIFT            0x8u
  90. #define draggable_DRAG_STARTED_CTRL             0x10u
  91.  
  92. /*************************
  93.  * Function declarations *
  94.  *************************/
  95.  
  96. #ifdef __cplusplus
  97.    extern "C" {
  98. #endif
  99.  
  100. /* ------------------------------------------------------------------------
  101.  * Function:      draggable_set_sprite()
  102.  *
  103.  * Description:   Calls reason code 640 of SWI 0x44EC6
  104.  *
  105.  * Input:         flags - value of R0 on entry
  106.  *                window - value of R1 on entry
  107.  *                draggable - value of R3 on entry
  108.  *                sprite_name - value of R4 on entry
  109.  *
  110.  * Other notes:   Before entry, R2 = 0x280.
  111.  */
  112.  
  113. extern os_error *xdraggable_set_sprite (bits flags,
  114.       toolbox_o window,
  115.       toolbox_c draggable,
  116.       char const *sprite_name);
  117. extern void draggable_set_sprite (bits flags,
  118.       toolbox_o window,
  119.       toolbox_c draggable,
  120.       char const *sprite_name);
  121.  
  122. /* ------------------------------------------------------------------------
  123.  * Function:      draggable_get_sprite()
  124.  *
  125.  * Description:   Calls reason code 641 of SWI 0x44EC6
  126.  *
  127.  * Input:         flags - value of R0 on entry
  128.  *                window - value of R1 on entry
  129.  *                draggable - value of R3 on entry
  130.  *                buffer - value of R4 on entry
  131.  *                size - value of R5 on entry
  132.  *
  133.  * Output:        used - value of R5 on exit (X version only)
  134.  *
  135.  * Returns:       R5 (non-X version only)
  136.  *
  137.  * Other notes:   Before entry, R2 = 0x281.
  138.  */
  139.  
  140. extern os_error *xdraggable_get_sprite (bits flags,
  141.       toolbox_o window,
  142.       toolbox_c draggable,
  143.       char *buffer,
  144.       int size,
  145.       int *used);
  146. extern int draggable_get_sprite (bits flags,
  147.       toolbox_o window,
  148.       toolbox_c draggable,
  149.       char *buffer,
  150.       int size);
  151.  
  152. /* ------------------------------------------------------------------------
  153.  * Function:      draggable_set_text()
  154.  *
  155.  * Description:   Calls reason code 642 of SWI 0x44EC6
  156.  *
  157.  * Input:         flags - value of R0 on entry
  158.  *                window - value of R1 on entry
  159.  *                draggable - value of R3 on entry
  160.  *                text - value of R4 on entry
  161.  *
  162.  * Other notes:   Before entry, R2 = 0x282.
  163.  */
  164.  
  165. extern os_error *xdraggable_set_text (bits flags,
  166.       toolbox_o window,
  167.       toolbox_c draggable,
  168.       char const *text);
  169. extern void draggable_set_text (bits flags,
  170.       toolbox_o window,
  171.       toolbox_c draggable,
  172.       char const *text);
  173.  
  174. /* ------------------------------------------------------------------------
  175.  * Function:      draggable_get_text()
  176.  *
  177.  * Description:   Calls reason code 643 of SWI 0x44EC6
  178.  *
  179.  * Input:         flags - value of R0 on entry
  180.  *                window - value of R1 on entry
  181.  *                draggable - value of R3 on entry
  182.  *                buffer - value of R4 on entry
  183.  *                size - value of R5 on entry
  184.  *
  185.  * Output:        used - value of R5 on exit (X version only)
  186.  *
  187.  * Returns:       R5 (non-X version only)
  188.  *
  189.  * Other notes:   Before entry, R2 = 0x283.
  190.  */
  191.  
  192. extern os_error *xdraggable_get_text (bits flags,
  193.       toolbox_o window,
  194.       toolbox_c draggable,
  195.       char *buffer,
  196.       int size,
  197.       int *used);
  198. extern int draggable_get_text (bits flags,
  199.       toolbox_o window,
  200.       toolbox_c draggable,
  201.       char *buffer,
  202.       int size);
  203.  
  204. /* ------------------------------------------------------------------------
  205.  * Function:      draggable_set_state()
  206.  *
  207.  * Description:   Calls reason code 644 of SWI 0x44EC6
  208.  *
  209.  * Input:         flags - value of R0 on entry
  210.  *                window - value of R1 on entry
  211.  *                draggable - value of R3 on entry
  212.  *                state - value of R4 on entry
  213.  *
  214.  * Other notes:   Before entry, R2 = 0x284.
  215.  */
  216.  
  217. extern os_error *xdraggable_set_state (bits flags,
  218.       toolbox_o window,
  219.       toolbox_c draggable,
  220.       int state);
  221. extern void draggable_set_state (bits flags,
  222.       toolbox_o window,
  223.       toolbox_c draggable,
  224.       int state);
  225.  
  226. /* ------------------------------------------------------------------------
  227.  * Function:      draggable_get_state()
  228.  *
  229.  * Description:   Calls reason code 645 of SWI 0x44EC6
  230.  *
  231.  * Input:         flags - value of R0 on entry
  232.  *                window - value of R1 on entry
  233.  *                draggable - value of R3 on entry
  234.  *
  235.  * Output:        state - value of R0 on exit (X version only)
  236.  *
  237.  * Returns:       R0 (non-X version only)
  238.  *
  239.  * Other notes:   Before entry, R2 = 0x285.
  240.  */
  241.  
  242. extern os_error *xdraggable_get_state (bits flags,
  243.       toolbox_o window,
  244.       toolbox_c draggable,
  245.       int *state);
  246. extern int draggable_get_state (bits flags,
  247.       toolbox_o window,
  248.       toolbox_c draggable);
  249.  
  250. #ifdef __cplusplus
  251.    }
  252. #endif
  253.  
  254. #endif
  255.