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

  1. #ifndef writablefield_H
  2. #define writablefield_H
  3.  
  4. /* C header file for WritableField
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 16:28:46 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. #ifndef font_H
  22. #include "font.h"
  23. #endif
  24.  
  25. /**********************************
  26.  * SWI names and SWI reason codes *
  27.  **********************************/
  28. #undef  WritableField_SetValue
  29. #define WritableField_SetValue                  0x200
  30. #undef  WritableField_GetValue
  31. #define WritableField_GetValue                  0x201
  32. #undef  WritableField_SetAllowable
  33. #define WritableField_SetAllowable              0x202
  34. #undef  WritableField_SetFont
  35. #define WritableField_SetFont                   0x204
  36.  
  37. /************************************
  38.  * Structure and union declarations *
  39.  ************************************/
  40. typedef struct writablefield_gadget             writablefield_gadget;
  41. typedef struct writablefield_action_value_changed writablefield_action_value_changed;
  42.  
  43. /********************
  44.  * Type definitions *
  45.  ********************/
  46. struct writablefield_gadget
  47.    {  toolbox_msg_reference text;
  48.       int text_limit;
  49.       toolbox_msg_reference allowable;
  50.       int allowable_limit;
  51.       toolbox_c prev;
  52.       toolbox_c next;
  53.    };
  54.  
  55. struct writablefield_action_value_changed
  56.    {  char string [212];
  57.    };
  58.  
  59. /************************
  60.  * Constant definitions *
  61.  ************************/
  62. #define class_WRITABLE_FIELD                    ((toolbox_class) 0x200u)
  63. #define writablefield_GENERATE_USER_VALUE_CHANGED 0x1u
  64. #define writablefield_GENERATE_SET_VALUE_CHANGED 0x2u
  65. #define writablefield_RJUSTIFIED                0x4u
  66. #define writablefield_HCENTRED                  0x8u
  67. #define writablefield_CONCEAL_TEXT              0x10u
  68. #define action_WRITABLE_FIELD_VALUE_CHANGED     0x82885u
  69. #define writablefield_VALUE_TOO_LONG            0x1u
  70.  
  71. /*************************
  72.  * Function declarations *
  73.  *************************/
  74.  
  75. #ifdef __cplusplus
  76.    extern "C" {
  77. #endif
  78.  
  79. /* ------------------------------------------------------------------------
  80.  * Function:      writablefield_set_value()
  81.  *
  82.  * Description:   Calls reason code 512 of SWI 0x44EC6
  83.  *
  84.  * Input:         flags - value of R0 on entry
  85.  *                window - value of R1 on entry
  86.  *                writable_field - value of R3 on entry
  87.  *                value - value of R4 on entry
  88.  *
  89.  * Other notes:   Before entry, R2 = 0x200.
  90.  */
  91.  
  92. extern os_error *xwritablefield_set_value (bits flags,
  93.       toolbox_o window,
  94.       toolbox_c writable_field,
  95.       char const *value);
  96. extern void writablefield_set_value (bits flags,
  97.       toolbox_o window,
  98.       toolbox_c writable_field,
  99.       char const *value);
  100.  
  101. /* ------------------------------------------------------------------------
  102.  * Function:      writablefield_get_value()
  103.  *
  104.  * Description:   Calls reason code 513 of SWI 0x44EC6
  105.  *
  106.  * Input:         flags - value of R0 on entry
  107.  *                window - value of R1 on entry
  108.  *                writable_field - value of R3 on entry
  109.  *                buffer - value of R4 on entry
  110.  *                size - value of R5 on entry
  111.  *
  112.  * Output:        used - value of R5 on exit (X version only)
  113.  *
  114.  * Returns:       R5 (non-X version only)
  115.  *
  116.  * Other notes:   Before entry, R2 = 0x201.
  117.  */
  118.  
  119. extern os_error *xwritablefield_get_value (bits flags,
  120.       toolbox_o window,
  121.       toolbox_c writable_field,
  122.       char *buffer,
  123.       int size,
  124.       int *used);
  125. extern int writablefield_get_value (bits flags,
  126.       toolbox_o window,
  127.       toolbox_c writable_field,
  128.       char *buffer,
  129.       int size);
  130.  
  131. /* ------------------------------------------------------------------------
  132.  * Function:      writablefield_set_allowable()
  133.  *
  134.  * Description:   Calls reason code 514 of SWI 0x44EC6
  135.  *
  136.  * Input:         flags - value of R0 on entry
  137.  *                window - value of R1 on entry
  138.  *                writable_field - value of R3 on entry
  139.  *                allowed - value of R4 on entry
  140.  *
  141.  * Other notes:   Before entry, R2 = 0x202.
  142.  */
  143.  
  144. extern os_error *xwritablefield_set_allowable (bits flags,
  145.       toolbox_o window,
  146.       toolbox_c writable_field,
  147.       char const *allowed);
  148. extern void writablefield_set_allowable (bits flags,
  149.       toolbox_o window,
  150.       toolbox_c writable_field,
  151.       char const *allowed);
  152.  
  153. /* ------------------------------------------------------------------------
  154.  * Function:      writablefield_set_font()
  155.  *
  156.  * Description:   Calls reason code 516 of SWI 0x44EC6
  157.  *
  158.  * Input:         flags - value of R0 on entry
  159.  *                window - value of R1 on entry
  160.  *                writable_field - value of R3 on entry
  161.  *                font_name - value of R4 on entry
  162.  *                xsize - value of R5 on entry
  163.  *                ysize - value of R6 on entry
  164.  *
  165.  * Other notes:   Before entry, R2 = 0x204.
  166.  */
  167.  
  168. extern os_error *xwritablefield_set_font (bits flags,
  169.       toolbox_o window,
  170.       toolbox_c writable_field,
  171.       char const *font_name,
  172.       int xsize,
  173.       int ysize);
  174. extern void writablefield_set_font (bits flags,
  175.       toolbox_o window,
  176.       toolbox_c writable_field,
  177.       char const *font_name,
  178.       int xsize,
  179.       int ysize);
  180.  
  181. #ifdef __cplusplus
  182.    }
  183. #endif
  184.  
  185. #endif
  186.