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

  1. #ifndef fontdbox_H
  2. #define fontdbox_H
  3.  
  4. /* C header file for FontDbox
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 15:14:26 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  ProgInfo_ClassSWI
  25. #define ProgInfo_ClassSWI                       0x82A00
  26. #undef  XProgInfo_ClassSWI
  27. #define XProgInfo_ClassSWI                      0xA2A00
  28. #undef  ProgInfo_PostFilter
  29. #define ProgInfo_PostFilter                     0x82A01
  30. #undef  XProgInfo_PostFilter
  31. #define XProgInfo_PostFilter                    0xA2A01
  32. #undef  ProgInfo_PreFilter
  33. #define ProgInfo_PreFilter                      0x82A02
  34. #undef  XProgInfo_PreFilter
  35. #define XProgInfo_PreFilter                     0xA2A02
  36. #undef  FontDbox_GetWindowId
  37. #define FontDbox_GetWindowId                    0x0
  38. #undef  FontDbox_SetFont
  39. #define FontDbox_SetFont                        0x1
  40. #undef  FontDbox_GetFont
  41. #define FontDbox_GetFont                        0x2
  42. #undef  FontDbox_SetSize
  43. #define FontDbox_SetSize                        0x3
  44. #undef  FontDbox_GetSize
  45. #define FontDbox_GetSize                        0x4
  46. #undef  FontDbox_SetTryString
  47. #define FontDbox_SetTryString                   0x5
  48. #undef  FontDbox_GetTryString
  49. #define FontDbox_GetTryString                   0x6
  50. #undef  FontDbox_SetTitle
  51. #define FontDbox_SetTitle                       0x7
  52. #undef  FontDbox_GetTitle
  53. #define FontDbox_GetTitle                       0x8
  54.  
  55. /************************************
  56.  * Structure and union declarations *
  57.  ************************************/
  58. typedef struct fontdbox_font                    fontdbox_font;
  59. typedef struct fontdbox_object                  fontdbox_object;
  60. typedef struct fontdbox_action_about_to_be_shown fontdbox_action_about_to_be_shown;
  61. typedef struct fontdbox_action_apply_font       fontdbox_action_apply_font;
  62.  
  63. /********************
  64.  * Type definitions *
  65.  ********************/
  66. typedef bits fontdbox_flags;
  67.  
  68. struct fontdbox_font
  69.    {  toolbox_string_reference font;
  70.       int height;
  71.       int aspect;
  72.    };
  73.  
  74. struct fontdbox_object
  75.    {  fontdbox_flags flags;
  76.       toolbox_msg_reference title;
  77.       int title_limit;
  78.       fontdbox_font initial;
  79.       toolbox_msg_reference try;
  80.       toolbox_string_reference alternative_window_name;
  81.    };
  82.  
  83. typedef toolbox_full fontdbox_full;
  84.  
  85. struct fontdbox_action_about_to_be_shown
  86.    {  toolbox_position_tag tag;
  87.       union
  88.       {  os_coord top_left;
  89.          fontdbox_full full;
  90.       }
  91.       position;
  92.    };
  93.  
  94. struct fontdbox_action_apply_font
  95.    {  int height;
  96.       int aspect;
  97.       char font [208];
  98.    };
  99.  
  100. /************************
  101.  * Constant definitions *
  102.  ************************/
  103. #define class_FONT_DBOX                         ((toolbox_class) 0x82A00u)
  104. #define fontdbox_SET_HEIGHT                     0x1u
  105. #define fontdbox_SET_ASPECT                     0x2u
  106. #define fontdbox_GENERATE_ABOUT_TO_BE_SHOWN     ((fontdbox_flags) 0x1u)
  107. #define fontdbox_GENERATE_DIALOGUE_COMPLETED    ((fontdbox_flags) 0x2u)
  108. #define fontdbox_INCLUDE_SYSTEM_FONT            ((fontdbox_flags) 0x4u)
  109. #define fontdbox_APPLY                          ((toolbox_c) 0x82A0000u)
  110. #define fontdbox_CANCEL                         ((toolbox_c) 0x82A0001u)
  111. #define fontdbox_TRY                            ((toolbox_c) 0x82A0002u)
  112. #define fontdbox_TRY_STRING                     ((toolbox_c) 0x82A0003u)
  113. #define fontdbox_ASPECT_RATIO                   ((toolbox_c) 0x82A0004u)
  114. #define fontdbox_HEIGHT                         ((toolbox_c) 0x82A0005u)
  115. #define fontdbox_STANDARD_SIZE0                 ((toolbox_c) 0x82A0006u)
  116. #define fontdbox_STANDARD_SIZE1                 ((toolbox_c) 0x82A0007u)
  117. #define fontdbox_STANDARD_SIZE2                 ((toolbox_c) 0x82A0008u)
  118. #define fontdbox_STANDARD_SIZE3                 ((toolbox_c) 0x82A0009u)
  119. #define fontdbox_STANDARD_SIZE4                 ((toolbox_c) 0x82A000Au)
  120. #define fontdbox_STANDARD_SIZE5                 ((toolbox_c) 0x82A000Bu)
  121. #define fontdbox_STANDARD_SIZE6                 ((toolbox_c) 0x82A000Cu)
  122. #define fontdbox_STANDARD_SIZE7                 ((toolbox_c) 0x82A000Du)
  123. #define fontdbox_STANDARD_SIZE8                 ((toolbox_c) 0x82A000Eu)
  124. #define fontdbox_STANDARD_SIZE9                 ((toolbox_c) 0x82A000Fu)
  125. #define fontdbox_STYLE                          ((toolbox_c) 0x82A0010u)
  126. #define fontdbox_WEIGHT                         ((toolbox_c) 0x82A0011u)
  127. #define fontdbox_FONT                           ((toolbox_c) 0x82A0012u)
  128. #define action_FONT_DBOX_ABOUT_TO_BE_SHOWN      0x82A00u
  129. #define action_FONT_DBOX_DIALOGUE_COMPLETED     0x82A01u
  130. #define action_FONT_DBOX_APPLY_FONT             0x82A02u
  131. #define error_FONT_DBOX_TASKS_ACTIVE            0x80AF00u
  132. #define error_FONT_DBOX_ALLOC_FAILED            0x80AF01u
  133. #define error_FONT_DBOX_SHORT_BUFFER            0x80AF02u
  134. #define error_FONT_DBOX_NO_SUCH_TASK            0x80AF11u
  135. #define error_FONT_DBOX_NO_SUCH_METHOD          0x80AF12u
  136. #define error_FONT_DBOX_NO_SUCH_MISC_OP_METHOD  0x80AF13u
  137. #define error_FONT_DBOX_NO_SUCH_FONT            0x80AF14u
  138. #define error_FONT_DBOX_NO_FONTS                0x80AF21u
  139. #define error_FONT_DBOX_OUT_OF_MESSAGE_SPACE    0x80AF31u
  140.  
  141. /*************************
  142.  * Function declarations *
  143.  *************************/
  144.  
  145. #ifdef __cplusplus
  146.    extern "C" {
  147. #endif
  148.  
  149. /* ------------------------------------------------------------------------
  150.  * Function:      fontdbox_get_window_id()
  151.  *
  152.  * Description:   Calls reason code 0 of SWI 0x44EC6
  153.  *
  154.  * Input:         flags - value of R0 on entry
  155.  *                font_dbox - value of R1 on entry
  156.  *
  157.  * Output:        window - value of R0 on exit (X version only)
  158.  *
  159.  * Returns:       R0 (non-X version only)
  160.  *
  161.  * Other notes:   Before entry, R2 = 0x0.
  162.  */
  163.  
  164. extern os_error *xfontdbox_get_window_id (bits flags,
  165.       toolbox_o font_dbox,
  166.       toolbox_o *window);
  167. extern toolbox_o fontdbox_get_window_id (bits flags,
  168.       toolbox_o font_dbox);
  169.  
  170. /* ------------------------------------------------------------------------
  171.  * Function:      fontdbox_set_font()
  172.  *
  173.  * Description:   Calls reason code 1 of SWI 0x44EC6
  174.  *
  175.  * Input:         flags - value of R0 on entry
  176.  *                font_dbox - value of R1 on entry
  177.  *                font_identifier - value of R3 on entry
  178.  *
  179.  * Other notes:   Before entry, R2 = 0x1.
  180.  */
  181.  
  182. extern os_error *xfontdbox_set_font (bits flags,
  183.       toolbox_o font_dbox,
  184.       char const *font_identifier);
  185. extern void fontdbox_set_font (bits flags,
  186.       toolbox_o font_dbox,
  187.       char const *font_identifier);
  188.  
  189. /* ------------------------------------------------------------------------
  190.  * Function:      fontdbox_get_font()
  191.  *
  192.  * Description:   Calls reason code 2 of SWI 0x44EC6
  193.  *
  194.  * Input:         flags - value of R0 on entry
  195.  *                font_dbox - value of R1 on entry
  196.  *                buffer - value of R3 on entry
  197.  *                size - value of R4 on entry
  198.  *
  199.  * Output:        used - value of R4 on exit (X version only)
  200.  *
  201.  * Returns:       R4 (non-X version only)
  202.  *
  203.  * Other notes:   Before entry, R2 = 0x2.
  204.  */
  205.  
  206. extern os_error *xfontdbox_get_font (bits flags,
  207.       toolbox_o font_dbox,
  208.       char *buffer,
  209.       int size,
  210.       int *used);
  211. extern int fontdbox_get_font (bits flags,
  212.       toolbox_o font_dbox,
  213.       char *buffer,
  214.       int size);
  215.  
  216. /* ------------------------------------------------------------------------
  217.  * Function:      fontdbox_set_size()
  218.  *
  219.  * Description:   Calls reason code 3 of SWI 0x44EC6
  220.  *
  221.  * Input:         flags - value of R0 on entry
  222.  *                font_dbox - value of R1 on entry
  223.  *                height - value of R3 on entry
  224.  *                aspect - value of R4 on entry
  225.  *
  226.  * Other notes:   Before entry, R2 = 0x3.
  227.  */
  228.  
  229. extern os_error *xfontdbox_set_size (bits flags,
  230.       toolbox_o font_dbox,
  231.       int height,
  232.       int aspect);
  233. extern void fontdbox_set_size (bits flags,
  234.       toolbox_o font_dbox,
  235.       int height,
  236.       int aspect);
  237.  
  238. /* ------------------------------------------------------------------------
  239.  * Function:      fontdbox_get_size()
  240.  *
  241.  * Description:   Calls reason code 4 of SWI 0x44EC6
  242.  *
  243.  * Input:         flags - value of R0 on entry
  244.  *                font_dbox - value of R1 on entry
  245.  *
  246.  * Output:        height - value of R0 on exit
  247.  *                aspect - value of R1 on exit
  248.  *
  249.  * Other notes:   Before entry, R2 = 0x4.
  250.  */
  251.  
  252. extern os_error *xfontdbox_get_size (bits flags,
  253.       toolbox_o font_dbox,
  254.       int *height,
  255.       int *aspect);
  256. extern void fontdbox_get_size (bits flags,
  257.       toolbox_o font_dbox,
  258.       int *height,
  259.       int *aspect);
  260.  
  261. /* ------------------------------------------------------------------------
  262.  * Function:      fontdbox_set_try_string()
  263.  *
  264.  * Description:   Calls reason code 5 of SWI 0x44EC6
  265.  *
  266.  * Input:         flags - value of R0 on entry
  267.  *                font_dbox - value of R1 on entry
  268.  *                try_string - value of R3 on entry
  269.  *
  270.  * Other notes:   Before entry, R2 = 0x5.
  271.  */
  272.  
  273. extern os_error *xfontdbox_set_try_string (bits flags,
  274.       toolbox_o font_dbox,
  275.       char const *try_string);
  276. extern void fontdbox_set_try_string (bits flags,
  277.       toolbox_o font_dbox,
  278.       char const *try_string);
  279.  
  280. /* ------------------------------------------------------------------------
  281.  * Function:      fontdbox_get_try_string()
  282.  *
  283.  * Description:   Calls reason code 6 of SWI 0x44EC6
  284.  *
  285.  * Input:         flags - value of R0 on entry
  286.  *                font_dbox - value of R1 on entry
  287.  *                buffer - value of R3 on entry
  288.  *                size - value of R4 on entry
  289.  *
  290.  * Output:        used - value of R4 on exit (X version only)
  291.  *
  292.  * Returns:       R4 (non-X version only)
  293.  *
  294.  * Other notes:   Before entry, R2 = 0x6.
  295.  */
  296.  
  297. extern os_error *xfontdbox_get_try_string (bits flags,
  298.       toolbox_o font_dbox,
  299.       char *buffer,
  300.       int size,
  301.       int *used);
  302. extern int fontdbox_get_try_string (bits flags,
  303.       toolbox_o font_dbox,
  304.       char *buffer,
  305.       int size);
  306.  
  307. /* ------------------------------------------------------------------------
  308.  * Function:      fontdbox_set_title()
  309.  *
  310.  * Description:   Calls reason code 7 of SWI 0x44EC6
  311.  *
  312.  * Input:         flags - value of R0 on entry
  313.  *                font_dbox - value of R1 on entry
  314.  *                title - value of R3 on entry
  315.  *
  316.  * Other notes:   Before entry, R2 = 0x7.
  317.  */
  318.  
  319. extern os_error *xfontdbox_set_title (bits flags,
  320.       toolbox_o font_dbox,
  321.       char const *title);
  322. extern void fontdbox_set_title (bits flags,
  323.       toolbox_o font_dbox,
  324.       char const *title);
  325.  
  326. /* ------------------------------------------------------------------------
  327.  * Function:      fontdbox_get_title()
  328.  *
  329.  * Description:   Calls reason code 8 of SWI 0x44EC6
  330.  *
  331.  * Input:         flags - value of R0 on entry
  332.  *                font_dbox - value of R1 on entry
  333.  *                buffer - value of R3 on entry
  334.  *                size - value of R4 on entry
  335.  *
  336.  * Output:        used - value of R4 on exit (X version only)
  337.  *
  338.  * Returns:       R4 (non-X version only)
  339.  *
  340.  * Other notes:   Before entry, R2 = 0x8.
  341.  */
  342.  
  343. extern os_error *xfontdbox_get_title (bits flags,
  344.       toolbox_o font_dbox,
  345.       char *buffer,
  346.       int size,
  347.       int *used);
  348. extern int fontdbox_get_title (bits flags,
  349.       toolbox_o font_dbox,
  350.       char *buffer,
  351.       int size);
  352.  
  353. #ifdef __cplusplus
  354.    }
  355. #endif
  356.  
  357. #endif
  358.