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

  1. #ifndef printdbox_H
  2. #define printdbox_H
  3.  
  4. /* C header file for PrintDbox
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 15:14:11 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  PrintDbox_ClassSWI
  25. #define PrintDbox_ClassSWI                      0x82B00
  26. #undef  XPrintDbox_ClassSWI
  27. #define XPrintDbox_ClassSWI                     0xA2B00
  28. #undef  PrintDbox_PostFilter
  29. #define PrintDbox_PostFilter                    0x82B01
  30. #undef  XPrintDbox_PostFilter
  31. #define XPrintDbox_PostFilter                   0xA2B01
  32. #undef  PrintDbox_PreFilter
  33. #define PrintDbox_PreFilter                     0x82B02
  34. #undef  XPrintDbox_PreFilter
  35. #define XPrintDbox_PreFilter                    0xA2B02
  36. #undef  PrintDbox_GetWindowId
  37. #define PrintDbox_GetWindowId                   0x0
  38. #undef  PrintDbox_SetPageRange
  39. #define PrintDbox_SetPageRange                  0x1
  40. #undef  PrintDbox_GetPageRange
  41. #define PrintDbox_GetPageRange                  0x2
  42. #undef  PrintDbox_SetCopies
  43. #define PrintDbox_SetCopies                     0x3
  44. #undef  PrintDbox_GetCopies
  45. #define PrintDbox_GetCopies                     0x4
  46. #undef  PrintDbox_SetScale
  47. #define PrintDbox_SetScale                      0x5
  48. #undef  PrintDbox_GetScale
  49. #define PrintDbox_GetScale                      0x6
  50. #undef  PrintDbox_SetOrientation
  51. #define PrintDbox_SetOrientation                0x7
  52. #undef  PrintDbox_GetOrientation
  53. #define PrintDbox_GetOrientation                0x8
  54. #undef  PrintDbox_GetTitle
  55. #define PrintDbox_GetTitle                      0x9
  56. #undef  PrintDbox_SetDraft
  57. #define PrintDbox_SetDraft                      0xA
  58. #undef  PrintDbox_GetDraft
  59. #define PrintDbox_GetDraft                      0xB
  60.  
  61. /************************************
  62.  * Structure and union declarations *
  63.  ************************************/
  64. typedef struct printdbox_object                 printdbox_object;
  65. typedef struct printdbox_action_about_to_be_shown printdbox_action_about_to_be_shown;
  66. typedef struct printdbox_action_setup_about_to_be_shown printdbox_action_setup_about_to_be_shown;
  67. typedef struct printdbox_action_save            printdbox_action_save;
  68. typedef struct printdbox_action_print           printdbox_action_print;
  69.  
  70. /********************
  71.  * Type definitions *
  72.  ********************/
  73. typedef bits printdbox_flags;
  74.  
  75. struct printdbox_object
  76.    {  printdbox_flags flags;
  77.       int from;
  78.       int to;
  79.       int copies;
  80.       int scale;
  81.       toolbox_string_reference further_options;
  82.       toolbox_string_reference alternative_window_name;
  83.    };
  84.  
  85. typedef toolbox_full printdbox_full;
  86.  
  87. struct printdbox_action_about_to_be_shown
  88.    {  toolbox_position_tag tag;
  89.       union
  90.       {  os_coord top_left;
  91.          printdbox_full full;
  92.       }
  93.       position;
  94.    };
  95.  
  96. struct printdbox_action_setup_about_to_be_shown
  97.    {  toolbox_o setup;
  98.       toolbox_position_tag tag;
  99.       union
  100.       {  os_coord top_left;
  101.          printdbox_full full;
  102.       }
  103.       position;
  104.    };
  105.  
  106. struct printdbox_action_save
  107.    {  int start;
  108.       int finish;
  109.       int copies;
  110.       int scale_factor;
  111.    };
  112.  
  113. struct printdbox_action_print
  114.    {  int start;
  115.       int finish;
  116.       int copies;
  117.       int scale_factor;
  118.    };
  119.  
  120. /************************
  121.  * Constant definitions *
  122.  ************************/
  123. #define class_PRINT_DBOX                        ((toolbox_class) 0x82B00u)
  124. #define printdbox_GENERATE_ABOUT_TO_BE_SHOWN    ((printdbox_flags) 0x1u)
  125. #define printdbox_GENERATE_DIALOGUE_COMPLETED   ((printdbox_flags) 0x2u)
  126. #define printdbox_GENERATE_SHOW_SETUP_ACTION    ((printdbox_flags) 0x4u)
  127. #define printdbox_INCLUDE_ALL_FROM_TO           ((printdbox_flags) 0x8u)
  128. #define printdbox_INCLUDE_COPIES                ((printdbox_flags) 0x10u)
  129. #define printdbox_INCLUDE_SCALE                 ((printdbox_flags) 0x20u)
  130. #define printdbox_INCLUDE_ORIENTATION           ((printdbox_flags) 0x40u)
  131. #define printdbox_INCLUDE_SAVE                  ((printdbox_flags) 0x80u)
  132. #define printdbox_INCLUDE_SET_UP                ((printdbox_flags) 0x100u)
  133. #define printdbox_INCLUDE_DRAFT                 ((printdbox_flags) 0x200u)
  134. #define printdbox_SELECT_FROM_TO                ((printdbox_flags) 0x400u)
  135. #define printdbox_SELECT_SIDEWAYS               ((printdbox_flags) 0x800u)
  136. #define printdbox_SELECT_DRAFT                  ((printdbox_flags) 0x1000u)
  137. #define printdbox_PRINT                         ((toolbox_c) 0x82B0000u)
  138. #define printdbox_SAVE                          ((toolbox_c) 0x82B0001u)
  139. #define printdbox_CANCEL                        ((toolbox_c) 0x82B0002u)
  140. #define printdbox_FROM_TO                       ((toolbox_c) 0x82B0003u)
  141. #define printdbox_ALL                           ((toolbox_c) 0x82B0004u)
  142. #define printdbox_FROM                          ((toolbox_c) 0x82B0005u)
  143. #define printdbox_TO                            ((toolbox_c) 0x82B000Du)
  144. #define printdbox_COPIES                        ((toolbox_c) 0x82B000Eu)
  145. #define printdbox_SCALE                         ((toolbox_c) 0x82B000Fu)
  146. #define printdbox_UPRIGHT                       ((toolbox_c) 0x82B0009u)
  147. #define printdbox_SIDEWAYS                      ((toolbox_c) 0x82B000Au)
  148. #define printdbox_DRAFT                         ((toolbox_c) 0x82B000Bu)
  149. #define printdbox_SET_UP                        ((toolbox_c) 0x82B000Cu)
  150. #define printdbox_PERCENT                       ((toolbox_c) 0x82B0010u)
  151. #define action_PRINT_DBOX_ABOUT_TO_BE_SHOWN     0x82B00u
  152. #define action_PRINT_DBOX_DIALOGUE_COMPLETED    0x82B01u
  153. #define action_PRINT_DBOX_SET_UP_ABOUT_TO_BE_SHOWN 0x82B02u
  154. #define action_PRINT_DBOX_SAVE                  0x82B03u
  155. #define action_PRINT_DBOX_SET_UP                0x82B04u
  156. #define action_PRINT_DBOX_PRINT                 0x82B05u
  157. #define printdbox_PRINT_SIDEWAYS                0x1u
  158. #define printdbox_PRINT_DRAFT                   0x2u
  159. #define error_PRINT_DBOX_TASKS_ACTIVE           0x80B300u
  160. #define error_PRINT_DBOX_ALLOC_FAILED           0x80B301u
  161. #define error_PRINT_DBOX_SHORT_BUFFER           0x80B302u
  162. #define error_PRINT_DBOX_NO_SUCH_TASK           0x80B311u
  163. #define error_PRINT_DBOX_NO_SUCH_METHOD         0x80B312u
  164. #define error_PRINT_DBOX_NO_SUCH_MISC_OP_METHOD 0x80B313u
  165. #define printdbox_PAGE_RANGE_ALL                (-1)
  166.  
  167. /*************************
  168.  * Function declarations *
  169.  *************************/
  170.  
  171. #ifdef __cplusplus
  172.    extern "C" {
  173. #endif
  174.  
  175. /* ------------------------------------------------------------------------
  176.  * Function:      printdbox_get_window_id()
  177.  *
  178.  * Description:   Calls reason code 0 of SWI 0x44EC6
  179.  *
  180.  * Input:         flags - value of R0 on entry
  181.  *                print_dbox - value of R1 on entry
  182.  *
  183.  * Output:        window - value of R0 on exit (X version only)
  184.  *
  185.  * Returns:       R0 (non-X version only)
  186.  *
  187.  * Other notes:   Before entry, R2 = 0x0.
  188.  */
  189.  
  190. extern os_error *xprintdbox_get_window_id (bits flags,
  191.       toolbox_o print_dbox,
  192.       toolbox_o *window);
  193. extern toolbox_o printdbox_get_window_id (bits flags,
  194.       toolbox_o print_dbox);
  195.  
  196. /* ------------------------------------------------------------------------
  197.  * Function:      printdbox_set_page_range()
  198.  *
  199.  * Description:   Calls reason code 1 of SWI 0x44EC6
  200.  *
  201.  * Input:         flags - value of R0 on entry
  202.  *                print_dbox - value of R1 on entry
  203.  *                start - value of R3 on entry
  204.  *                end - value of R4 on entry
  205.  *
  206.  * Other notes:   Before entry, R2 = 0x1.
  207.  */
  208.  
  209. extern os_error *xprintdbox_set_page_range (bits flags,
  210.       toolbox_o print_dbox,
  211.       int start,
  212.       int end);
  213. extern void printdbox_set_page_range (bits flags,
  214.       toolbox_o print_dbox,
  215.       int start,
  216.       int end);
  217.  
  218. /* ------------------------------------------------------------------------
  219.  * Function:      printdbox_get_page_range()
  220.  *
  221.  * Description:   Calls reason code 2 of SWI 0x44EC6
  222.  *
  223.  * Input:         flags - value of R0 on entry
  224.  *                print_dbox - value of R1 on entry
  225.  *
  226.  * Output:        start - value of R0 on exit
  227.  *                end - value of R1 on exit
  228.  *
  229.  * Other notes:   Before entry, R2 = 0x2.
  230.  */
  231.  
  232. extern os_error *xprintdbox_get_page_range (bits flags,
  233.       toolbox_o print_dbox,
  234.       int *start,
  235.       int *end);
  236. extern void printdbox_get_page_range (bits flags,
  237.       toolbox_o print_dbox,
  238.       int *start,
  239.       int *end);
  240.  
  241. /* ------------------------------------------------------------------------
  242.  * Function:      printdbox_set_copies()
  243.  *
  244.  * Description:   Calls reason code 3 of SWI 0x44EC6
  245.  *
  246.  * Input:         flags - value of R0 on entry
  247.  *                print_dbox - value of R1 on entry
  248.  *                copy_count - value of R3 on entry
  249.  *
  250.  * Other notes:   Before entry, R2 = 0x3.
  251.  */
  252.  
  253. extern os_error *xprintdbox_set_copies (bits flags,
  254.       toolbox_o print_dbox,
  255.       int copy_count);
  256. extern void printdbox_set_copies (bits flags,
  257.       toolbox_o print_dbox,
  258.       int copy_count);
  259.  
  260. /* ------------------------------------------------------------------------
  261.  * Function:      printdbox_get_copies()
  262.  *
  263.  * Description:   Calls reason code 4 of SWI 0x44EC6
  264.  *
  265.  * Input:         flags - value of R0 on entry
  266.  *                print_dbox - value of R1 on entry
  267.  *
  268.  * Output:        copy_count - value of R0 on exit (X version only)
  269.  *
  270.  * Returns:       R0 (non-X version only)
  271.  *
  272.  * Other notes:   Before entry, R2 = 0x4.
  273.  */
  274.  
  275. extern os_error *xprintdbox_get_copies (bits flags,
  276.       toolbox_o print_dbox,
  277.       int *copy_count);
  278. extern int printdbox_get_copies (bits flags,
  279.       toolbox_o print_dbox);
  280.  
  281. /* ------------------------------------------------------------------------
  282.  * Function:      printdbox_set_scale()
  283.  *
  284.  * Description:   Calls reason code 5 of SWI 0x44EC6
  285.  *
  286.  * Input:         flags - value of R0 on entry
  287.  *                print_dbox - value of R1 on entry
  288.  *                scale - value of R3 on entry
  289.  *
  290.  * Other notes:   Before entry, R2 = 0x5.
  291.  */
  292.  
  293. extern os_error *xprintdbox_set_scale (bits flags,
  294.       toolbox_o print_dbox,
  295.       int scale);
  296. extern void printdbox_set_scale (bits flags,
  297.       toolbox_o print_dbox,
  298.       int scale);
  299.  
  300. /* ------------------------------------------------------------------------
  301.  * Function:      printdbox_get_scale()
  302.  *
  303.  * Description:   Calls reason code 6 of SWI 0x44EC6
  304.  *
  305.  * Input:         flags - value of R0 on entry
  306.  *                print_dbox - value of R1 on entry
  307.  *
  308.  * Output:        scale - value of R0 on exit (X version only)
  309.  *
  310.  * Returns:       R0 (non-X version only)
  311.  *
  312.  * Other notes:   Before entry, R2 = 0x6.
  313.  */
  314.  
  315. extern os_error *xprintdbox_get_scale (bits flags,
  316.       toolbox_o print_dbox,
  317.       int *scale);
  318. extern int printdbox_get_scale (bits flags,
  319.       toolbox_o print_dbox);
  320.  
  321. /* ------------------------------------------------------------------------
  322.  * Function:      printdbox_set_orientation()
  323.  *
  324.  * Description:   Calls reason code 7 of SWI 0x44EC6
  325.  *
  326.  * Input:         flags - value of R0 on entry
  327.  *                print_dbox - value of R1 on entry
  328.  *                landscape - value of R3 on entry
  329.  *
  330.  * Other notes:   Before entry, R2 = 0x7.
  331.  */
  332.  
  333. extern os_error *xprintdbox_set_orientation (bits flags,
  334.       toolbox_o print_dbox,
  335.       bool landscape);
  336. extern void printdbox_set_orientation (bits flags,
  337.       toolbox_o print_dbox,
  338.       bool landscape);
  339.  
  340. /* ------------------------------------------------------------------------
  341.  * Function:      printdbox_get_orientation()
  342.  *
  343.  * Description:   Calls reason code 8 of SWI 0x44EC6
  344.  *
  345.  * Input:         flags - value of R0 on entry
  346.  *                print_dbox - value of R1 on entry
  347.  *
  348.  * Output:        landscape - value of R0 on exit (X version only)
  349.  *
  350.  * Returns:       R0 (non-X version only)
  351.  *
  352.  * Other notes:   Before entry, R2 = 0x8.
  353.  */
  354.  
  355. extern os_error *xprintdbox_get_orientation (bits flags,
  356.       toolbox_o print_dbox,
  357.       bool *landscape);
  358. extern bool printdbox_get_orientation (bits flags,
  359.       toolbox_o print_dbox);
  360.  
  361. /* ------------------------------------------------------------------------
  362.  * Function:      printdbox_get_title()
  363.  *
  364.  * Description:   Calls reason code 9 of SWI 0x44EC6
  365.  *
  366.  * Input:         flags - value of R0 on entry
  367.  *                print_dbox - value of R1 on entry
  368.  *                buffer - value of R3 on entry
  369.  *                size - value of R4 on entry
  370.  *
  371.  * Output:        used - value of R4 on exit (X version only)
  372.  *
  373.  * Returns:       R4 (non-X version only)
  374.  *
  375.  * Other notes:   Before entry, R2 = 0x9.
  376.  */
  377.  
  378. extern os_error *xprintdbox_get_title (bits flags,
  379.       toolbox_o print_dbox,
  380.       char *buffer,
  381.       int size,
  382.       int *used);
  383. extern int printdbox_get_title (bits flags,
  384.       toolbox_o print_dbox,
  385.       char *buffer,
  386.       int size);
  387.  
  388. /* ------------------------------------------------------------------------
  389.  * Function:      printdbox_set_draft()
  390.  *
  391.  * Description:   Calls reason code 10 of SWI 0x44EC6
  392.  *
  393.  * Input:         flags - value of R0 on entry
  394.  *                print_dbox - value of R1 on entry
  395.  *                draft - value of R3 on entry
  396.  *
  397.  * Other notes:   Before entry, R2 = 0xA.
  398.  */
  399.  
  400. extern os_error *xprintdbox_set_draft (bits flags,
  401.       toolbox_o print_dbox,
  402.       bool draft);
  403. extern void printdbox_set_draft (bits flags,
  404.       toolbox_o print_dbox,
  405.       bool draft);
  406.  
  407. /* ------------------------------------------------------------------------
  408.  * Function:      printdbox_get_draft()
  409.  *
  410.  * Description:   Calls reason code 11 of SWI 0x44EC6
  411.  *
  412.  * Input:         flags - value of R0 on entry
  413.  *                print_dbox - value of R1 on entry
  414.  *
  415.  * Output:        draft - value of R0 on exit (X version only)
  416.  *
  417.  * Returns:       R0 (non-X version only)
  418.  *
  419.  * Other notes:   Before entry, R2 = 0xB.
  420.  */
  421.  
  422. extern os_error *xprintdbox_get_draft (bits flags,
  423.       toolbox_o print_dbox,
  424.       bool *draft);
  425. extern bool printdbox_get_draft (bits flags,
  426.       toolbox_o print_dbox);
  427.  
  428. #ifdef __cplusplus
  429.    }
  430. #endif
  431.  
  432. #endif
  433.