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

  1. #ifndef displayfield_H
  2. #define displayfield_H
  3.  
  4. /* C header file for DisplayField
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 16:29:22 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  DisplayField_SetValue
  29. #define DisplayField_SetValue                   0x1C0
  30. #undef  DisplayField_GetValue
  31. #define DisplayField_GetValue                   0x1C1
  32. #undef  DisplayField_SetFont
  33. #define DisplayField_SetFont                    0x1C2
  34.  
  35. /************************************
  36.  * Structure and union declarations *
  37.  ************************************/
  38. typedef struct displayfield_gadget              displayfield_gadget;
  39.  
  40. /********************
  41.  * Type definitions *
  42.  ********************/
  43. struct displayfield_gadget
  44.    {  toolbox_msg_reference text;
  45.       int text_limit;
  46.    };
  47.  
  48. /************************
  49.  * Constant definitions *
  50.  ************************/
  51. #define class_DISPLAY_FIELD                     ((toolbox_class) 0x1C0u)
  52. #define displayfield_RJUSTIFIED                 ((gadget_flags) 0x2u)
  53. #define displayfield_HCENTRED                   ((gadget_flags) 0x4u)
  54.  
  55. /*************************
  56.  * Function declarations *
  57.  *************************/
  58.  
  59. #ifdef __cplusplus
  60.    extern "C" {
  61. #endif
  62.  
  63. /* ------------------------------------------------------------------------
  64.  * Function:      displayfield_set_value()
  65.  *
  66.  * Description:   Calls reason code 448 of SWI 0x44EC6
  67.  *
  68.  * Input:         flags - value of R0 on entry
  69.  *                window - value of R1 on entry
  70.  *                display_field - value of R3 on entry
  71.  *                text - value of R4 on entry
  72.  *
  73.  * Other notes:   Before entry, R2 = 0x1C0.
  74.  */
  75.  
  76. extern os_error *xdisplayfield_set_value (bits flags,
  77.       toolbox_o window,
  78.       toolbox_c display_field,
  79.       char const *text);
  80. extern void displayfield_set_value (bits flags,
  81.       toolbox_o window,
  82.       toolbox_c display_field,
  83.       char const *text);
  84.  
  85. /* ------------------------------------------------------------------------
  86.  * Function:      displayfield_get_value()
  87.  *
  88.  * Description:   Calls reason code 449 of SWI 0x44EC6
  89.  *
  90.  * Input:         flags - value of R0 on entry
  91.  *                window - value of R1 on entry
  92.  *                display_field - value of R3 on entry
  93.  *                buffer - value of R4 on entry
  94.  *                size - value of R5 on entry
  95.  *
  96.  * Output:        used - value of R5 on exit (X version only)
  97.  *
  98.  * Returns:       R5 (non-X version only)
  99.  *
  100.  * Other notes:   Before entry, R2 = 0x1C1.
  101.  */
  102.  
  103. extern os_error *xdisplayfield_get_value (bits flags,
  104.       toolbox_o window,
  105.       toolbox_c display_field,
  106.       char *buffer,
  107.       int size,
  108.       int *used);
  109. extern int displayfield_get_value (bits flags,
  110.       toolbox_o window,
  111.       toolbox_c display_field,
  112.       char *buffer,
  113.       int size);
  114.  
  115. /* ------------------------------------------------------------------------
  116.  * Function:      displayfield_set_font()
  117.  *
  118.  * Description:   Calls reason code 450 of SWI 0x44EC6
  119.  *
  120.  * Input:         flags - value of R0 on entry
  121.  *                window - value of R1 on entry
  122.  *                display_field - value of R3 on entry
  123.  *                font - value of R4 on entry
  124.  *                width - value of R5 on entry
  125.  *                height - value of R6 on entry
  126.  *
  127.  * Other notes:   Before entry, R2 = 0x1C2.
  128.  */
  129.  
  130. extern os_error *xdisplayfield_set_font (bits flags,
  131.       toolbox_o window,
  132.       toolbox_c display_field,
  133.       char const *font,
  134.       int width,
  135.       int height);
  136. extern void displayfield_set_font (bits flags,
  137.       toolbox_o window,
  138.       toolbox_c display_field,
  139.       char const *font,
  140.       int width,
  141.       int height);
  142.  
  143. #ifdef __cplusplus
  144.    }
  145. #endif
  146.  
  147. #endif
  148.