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

  1. #ifndef stringset_H
  2. #define stringset_H
  3.  
  4. /* C header file for StringSet
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 16:29:04 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 gadget_H
  18. #include "gadget.h"
  19. #endif
  20.  
  21. /**********************************
  22.  * SWI names and SWI reason codes *
  23.  **********************************/
  24. #undef  StringSet_SetAvailable
  25. #define StringSet_SetAvailable                  0x380
  26. #undef  StringSet_SetSelected
  27. #define StringSet_SetSelected                   0x382
  28. #undef  StringSetSetSelected_String
  29. #define StringSetSetSelected_String             0x0
  30. #undef  StringSetSetSelected_Index
  31. #define StringSetSetSelected_Index              0x1
  32. #undef  StringSet_GetSelected
  33. #define StringSet_GetSelected                   0x383
  34. #undef  StringSetGetSelected_String
  35. #define StringSetGetSelected_String             0x0
  36. #undef  StringSetGetSelected_Index
  37. #define StringSetGetSelected_Index              0x1
  38. #undef  StringSet_SetAllowable
  39. #define StringSet_SetAllowable                  0x384
  40. #undef  StringSet_GetComponents
  41. #define StringSet_GetComponents                 0x386
  42.  
  43. /************************************
  44.  * Structure and union declarations *
  45.  ************************************/
  46. typedef struct stringset_gadget                 stringset_gadget;
  47. typedef struct stringset_action_value_changed   stringset_action_value_changed;
  48.  
  49. /********************
  50.  * Type definitions *
  51.  ********************/
  52. struct stringset_gadget
  53.    {  toolbox_msg_reference string_set;
  54.       toolbox_msg_reference title;
  55.       toolbox_msg_reference initial_selected_string;
  56.       int selected_string_limit;
  57.       toolbox_msg_reference allowable;
  58.       int allowable_limit;
  59.       toolbox_c prev;
  60.       toolbox_c next;
  61.    };
  62.  
  63. struct stringset_action_value_changed
  64.    {  char value [216];
  65.    };
  66.  
  67. /************************
  68.  * Constant definitions *
  69.  ************************/
  70. #define class_STRING_SET                        ((toolbox_class) 0x380u)
  71. #define stringset_GENERATE_USER_VALUE_CHANGED   ((gadget_flags) 0x1u)
  72. #define stringset_GENERATE_SET_VALUE_CHANGED    ((gadget_flags) 0x2u)
  73. #define stringset_WRITABLE                      ((gadget_flags) 0x4u)
  74. #define stringset_GENERATE_ABOUT_TO_BE_SHOWN    ((gadget_flags) 0x8u)
  75. #define stringset_NO_DISPLAY                    ((gadget_flags) 0x10u)
  76. #define stringset_JUSTIFICATION                 ((gadget_flags) 0x60u)
  77. #define stringset_JUSTIFICATION_SHIFT           5
  78. #define stringset_JUSTIFICATION_LEFT            0x0u
  79. #define stringset_JUSTIFICATION_RIGHT           0x1u
  80. #define stringset_JUSTIFICATION_CENTRED         0x2u
  81. #define stringset_GET_ALPHANUMERIC_FIELD        0x1u
  82. #define stringset_GET_POP_UP_MENU               0x2u
  83. #define action_STRING_SET_VALUE_CHANGED         0x8288Eu
  84. #define action_STRING_SET_ABOUT_TO_BE_SHOWN     0x8288Fu
  85. #define stringset_VALUE_TOO_LONG                0x1u
  86.  
  87. /*************************
  88.  * Function declarations *
  89.  *************************/
  90.  
  91. #ifdef __cplusplus
  92.    extern "C" {
  93. #endif
  94.  
  95. /* ------------------------------------------------------------------------
  96.  * Function:      stringset_set_available()
  97.  *
  98.  * Description:   Calls reason code 896 of SWI 0x44EC6
  99.  *
  100.  * Input:         flags - value of R0 on entry
  101.  *                window - value of R1 on entry
  102.  *                string_set - value of R3 on entry
  103.  *                set - value of R4 on entry
  104.  *
  105.  * Other notes:   Before entry, R2 = 0x380.
  106.  */
  107.  
  108. extern os_error *xstringset_set_available (bits flags,
  109.       toolbox_o window,
  110.       toolbox_c string_set,
  111.       char const *set);
  112. extern void stringset_set_available (bits flags,
  113.       toolbox_o window,
  114.       toolbox_c string_set,
  115.       char const *set);
  116.  
  117. /* ------------------------------------------------------------------------
  118.  * Function:      stringsetsetselected_string()
  119.  *
  120.  * Description:   Calls reason code 0 of SWI 0x44EC6
  121.  *
  122.  * Input:         flags - value of R0 on entry
  123.  *                window - value of R1 on entry
  124.  *                string_set - value of R3 on entry
  125.  *                selection - value of R4 on entry
  126.  *
  127.  * Other notes:   Before entry, R0 |= 0x0, R2 = 0x382.
  128.  */
  129.  
  130. extern os_error *xstringsetsetselected_string (bits flags,
  131.       toolbox_o window,
  132.       toolbox_c string_set,
  133.       char const *selection);
  134. extern void stringsetsetselected_string (bits flags,
  135.       toolbox_o window,
  136.       toolbox_c string_set,
  137.       char const *selection);
  138.  
  139. /* ------------------------------------------------------------------------
  140.  * Function:      stringsetsetselected_index()
  141.  *
  142.  * Description:   Calls reason code 1 of SWI 0x44EC6
  143.  *
  144.  * Input:         flags - value of R0 on entry
  145.  *                window - value of R1 on entry
  146.  *                string_set - value of R3 on entry
  147.  *                index - value of R4 on entry
  148.  *
  149.  * Other notes:   Before entry, R0 |= 0x1, R2 = 0x382.
  150.  */
  151.  
  152. extern os_error *xstringsetsetselected_index (bits flags,
  153.       toolbox_o window,
  154.       toolbox_c string_set,
  155.       int index);
  156. extern void stringsetsetselected_index (bits flags,
  157.       toolbox_o window,
  158.       toolbox_c string_set,
  159.       int index);
  160.  
  161. /* ------------------------------------------------------------------------
  162.  * Function:      stringsetgetselected_string()
  163.  *
  164.  * Description:   Calls reason code 0 of SWI 0x44EC6
  165.  *
  166.  * Input:         flags - value of R0 on entry
  167.  *                window - value of R1 on entry
  168.  *                string_set - value of R3 on entry
  169.  *                buffer - value of R4 on entry
  170.  *                size - value of R5 on entry
  171.  *
  172.  * Output:        used - value of R5 on exit (X version only)
  173.  *
  174.  * Returns:       R5 (non-X version only)
  175.  *
  176.  * Other notes:   Before entry, R0 |= 0x0, R2 = 0x383.
  177.  */
  178.  
  179. extern os_error *xstringsetgetselected_string (bits flags,
  180.       toolbox_o window,
  181.       toolbox_c string_set,
  182.       char *buffer,
  183.       int size,
  184.       int *used);
  185. extern int stringsetgetselected_string (bits flags,
  186.       toolbox_o window,
  187.       toolbox_c string_set,
  188.       char *buffer,
  189.       int size);
  190.  
  191. /* ------------------------------------------------------------------------
  192.  * Function:      stringsetgetselected_index()
  193.  *
  194.  * Description:   Calls reason code 1 of SWI 0x44EC6
  195.  *
  196.  * Input:         flags - value of R0 on entry
  197.  *                window - value of R1 on entry
  198.  *                string_set - value of R3 on entry
  199.  *
  200.  * Output:        index - value of R0 on exit (X version only)
  201.  *
  202.  * Returns:       R0 (non-X version only)
  203.  *
  204.  * Other notes:   Before entry, R0 |= 0x1, R2 = 0x383.
  205.  */
  206.  
  207. extern os_error *xstringsetgetselected_index (bits flags,
  208.       toolbox_o window,
  209.       toolbox_c string_set,
  210.       int *index);
  211. extern int stringsetgetselected_index (bits flags,
  212.       toolbox_o window,
  213.       toolbox_c string_set);
  214.  
  215. /* ------------------------------------------------------------------------
  216.  * Function:      stringset_set_allowable()
  217.  *
  218.  * Description:   Calls reason code 900 of SWI 0x44EC6
  219.  *
  220.  * Input:         flags - value of R0 on entry
  221.  *                window - value of R1 on entry
  222.  *                string_set - value of R3 on entry
  223.  *                allowable - value of R4 on entry
  224.  *
  225.  * Other notes:   Before entry, R2 = 0x384.
  226.  */
  227.  
  228. extern os_error *xstringset_set_allowable (bits flags,
  229.       toolbox_o window,
  230.       toolbox_c string_set,
  231.       char const *allowable);
  232. extern void stringset_set_allowable (bits flags,
  233.       toolbox_o window,
  234.       toolbox_c string_set,
  235.       char const *allowable);
  236.  
  237. /* ------------------------------------------------------------------------
  238.  * Function:      stringset_get_components()
  239.  *
  240.  * Description:   Calls reason code 902 of SWI 0x44EC6
  241.  *
  242.  * Input:         flags - value of R0 on entry
  243.  *                window - value of R1 on entry
  244.  *                string_set - value of R3 on entry
  245.  *
  246.  * Output:        alphanumeric_field - value of R0 on exit
  247.  *                popup_menu - value of R1 on exit
  248.  *
  249.  * Other notes:   Before entry, R2 = 0x386.
  250.  */
  251.  
  252. extern os_error *xstringset_get_components (bits flags,
  253.       toolbox_o window,
  254.       toolbox_c string_set,
  255.       toolbox_c *alphanumeric_field,
  256.       toolbox_c *popup_menu);
  257. extern void stringset_get_components (bits flags,
  258.       toolbox_o window,
  259.       toolbox_c string_set,
  260.       toolbox_c *alphanumeric_field,
  261.       toolbox_c *popup_menu);
  262.  
  263. #ifdef __cplusplus
  264.    }
  265. #endif
  266.  
  267. #endif
  268.