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

  1. #ifndef fontmenu_H
  2. #define fontmenu_H
  3.  
  4. /* C header file for FontMenu
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 15:14:23 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 menu_H
  18. #include "menu.h"
  19. #endif
  20.  
  21. /**********************************
  22.  * SWI names and SWI reason codes *
  23.  **********************************/
  24. #undef  FontMenu_ClassSWI
  25. #define FontMenu_ClassSWI                       0x82A40
  26. #undef  XFontMenu_ClassSWI
  27. #define XFontMenu_ClassSWI                      0xA2A40
  28. #undef  FontMenu_PostFilter
  29. #define FontMenu_PostFilter                     0x82A41
  30. #undef  XFontMenu_PostFilter
  31. #define XFontMenu_PostFilter                    0xA2A41
  32. #undef  FontMenu_PreFilter
  33. #define FontMenu_PreFilter                      0x82A42
  34. #undef  XFontMenu_PreFilter
  35. #define XFontMenu_PreFilter                     0xA2A42
  36. #undef  FontMenu_SetFont
  37. #define FontMenu_SetFont                        0x0
  38. #undef  FontMenu_GetFont
  39. #define FontMenu_GetFont                        0x1
  40.  
  41. /************************************
  42.  * Structure and union declarations *
  43.  ************************************/
  44. typedef struct fontmenu_object                  fontmenu_object;
  45. typedef struct fontmenu_action_about_to_be_shown fontmenu_action_about_to_be_shown;
  46. typedef struct fontmenu_action_selection        fontmenu_action_selection;
  47.  
  48. /********************
  49.  * Type definitions *
  50.  ********************/
  51. typedef bits fontmenu_flags;
  52.  
  53. struct fontmenu_object
  54.    {  fontmenu_flags flags;
  55.       toolbox_string_reference ticked_font;
  56.    };
  57.  
  58. typedef os_coord fontmenu_full;
  59.  
  60. struct fontmenu_action_about_to_be_shown
  61.    {  toolbox_position_tag tag;
  62.       union
  63.       {  os_coord top_left;
  64.          fontmenu_full full;
  65.       }
  66.       position;
  67.    };
  68.  
  69. struct fontmenu_action_selection
  70.    {  char font_identifier [216];
  71.    };
  72.  
  73. /************************
  74.  * Constant definitions *
  75.  ************************/
  76. #define class_FONT_MENU                         ((toolbox_class) 0x82A40u)
  77. #define fontmenu_GENERATE_ABOUT_TO_BE_SHOWN     ((fontmenu_flags) 0x1u)
  78. #define fontmenu_GENERATE_DIALOGUE_COMPLETED    ((fontmenu_flags) 0x2u)
  79. #define fontmenu_INCLUDE_SYSTEM_FONT            ((fontmenu_flags) 0x4u)
  80. #define action_FONT_MENU_ABOUT_TO_BE_SHOWN      0x82A40u
  81. #define action_FONT_MENU_DIALOGUE_COMPLETED     0x82A41u
  82. #define action_FONT_MENU_SELECTION              0x82A42u
  83. #define error_FONT_MENU_TASKS_ACTIVE            0x80B000u
  84. #define error_FONT_MENU_ALLOC_FAILED            0x80B001u
  85. #define error_FONT_MENU_SHORT_BUFFER            0x80B002u
  86. #define error_FONT_MENU_NO_SUCH_TASK            0x80B011u
  87. #define error_FONT_MENU_NO_SUCH_METHOD          0x80B012u
  88. #define error_FONT_MENU_NO_SUCH_MISC_OP_METHOD  0x80B013u
  89.  
  90. /*************************
  91.  * Function declarations *
  92.  *************************/
  93.  
  94. #ifdef __cplusplus
  95.    extern "C" {
  96. #endif
  97.  
  98. /* ------------------------------------------------------------------------
  99.  * Function:      fontmenu_set_font()
  100.  *
  101.  * Description:   Calls reason code 0 of SWI 0x44EC6
  102.  *
  103.  * Input:         flags - value of R0 on entry
  104.  *                font_menu - value of R1 on entry
  105.  *                font_identifier - value of R3 on entry
  106.  *
  107.  * Other notes:   Before entry, R2 = 0x0.
  108.  */
  109.  
  110. extern os_error *xfontmenu_set_font (bits flags,
  111.       toolbox_o font_menu,
  112.       char const *font_identifier);
  113. extern void fontmenu_set_font (bits flags,
  114.       toolbox_o font_menu,
  115.       char const *font_identifier);
  116.  
  117. /* ------------------------------------------------------------------------
  118.  * Function:      fontmenu_get_font()
  119.  *
  120.  * Description:   Calls reason code 1 of SWI 0x44EC6
  121.  *
  122.  * Input:         flags - value of R0 on entry
  123.  *                font_menu - value of R1 on entry
  124.  *                buffer - value of R3 on entry
  125.  *                size - value of R4 on entry
  126.  *
  127.  * Output:        used - value of R4 on exit (X version only)
  128.  *
  129.  * Returns:       R4 (non-X version only)
  130.  *
  131.  * Other notes:   Before entry, R2 = 0x1.
  132.  */
  133.  
  134. extern os_error *xfontmenu_get_font (bits flags,
  135.       toolbox_o font_menu,
  136.       char *buffer,
  137.       int size,
  138.       int *used);
  139. extern int fontmenu_get_font (bits flags,
  140.       toolbox_o font_menu,
  141.       char *buffer,
  142.       int size);
  143.  
  144. #ifdef __cplusplus
  145.    }
  146. #endif
  147.  
  148. #endif
  149.