printer: Move some files around, in preparation for more types of printer drivers
[AROS.git] / compiler / include / aros / printertag.h
blobccbfe172fa2f023eb8ed52fb229e240205557d46
1 /*
2 * Copyright (C) 2012, The AROS Development Team. All rights reserved.
3 * Author: Jason S. McMullan <jason.mcmullan@gmail.com>
5 * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1
6 */
8 #ifndef AROS_PRINTERTAG_H
9 #define AROS_PRINTERTAG_H
11 #include <devices/prtbase.h>
13 /* .text tag that helps identify this as a printer driver.
14 * by convention, this is a 'return' instruction
16 #ifdef __mc68000
17 #define AROS_PRINTER_MAGIC 0x70004e75 /* m68k's moveq #0,%d0, rts */
18 #elif defined(__i386__)
19 #define AROS_PRINTER_MAGIC 0x90c3c031 /* xor %eax,%eax, ret, nop */
20 #elif defined(__x86_64__)
21 #define AROS_PRINTER_MAGIC 0xccc3c031 /* xor %eax,%eax, retq, int3 */
22 #elif defined(__arm__)
23 #define AROS_PRINTER_MAGIC 0xe12fff1e /* bx lr */
24 #elif defined(__ppc__)
25 #define AROS_PRINTER_MAGIC 0x4e800020 /* blr */
26 #else
27 #error AROS_PRINTER_MAGIC is not defined for your architecture
28 #endif
30 #define AROS_PRINTER_TAG(PED, version, revision, ped...) \
31 __section(".tag.printer") __used static struct { \
32 ULONG pmh_Magic; \
33 UWORD pmh_Version; \
34 UWORD pmh_Revision; \
35 struct PrinterExtendedData pmh_PED; \
36 } __pmh = { \
37 .pmh_Magic = AROS_PRINTER_MAGIC, \
38 .pmh_Version = (version), \
39 .pmh_Revision = (revision), \
40 .pmh_PED = { ped } }; \
41 struct PrinterExtendedData *PED = &__pmh.pmh_PED;
43 /* 'status' codes sent to the ped_Render() routine
46 /* PRS_INIT - Initialize page for printing
48 * ct - pointer to IODRPReq
49 * x - width in pixels
50 * y - height in pixels
52 #define PRS_INIT 0
54 /* PRS_TRANSFER - Render page row
56 * ct - pointer to PrtInfo
57 * x - 0
58 * y - row # (0 to height-1)
60 #define PRS_TRANSFER 1
62 /* PRS_FLUSH - Send data to the printer
63 * ct - 0
64 * x - 0
65 * y - # of rows to send (1 to NumRows)
67 #define PRS_FLUSH 2
69 /* PRS_CLEAR - Clear and Init buffer
70 * ct - 0
71 * x - 0
72 * y - 0
74 #define PRS_CLEAR 3
76 /* PRS_CLOSE - Close down graphics operation,
77 * and go back to text mode
78 * ct - Error code
79 * x - io_Special flag from IODRPReq
80 * y - 0
82 #define PRS_CLOSE 4
84 /* PRS_PREINIT - Pre-Master initialization
85 * ct - NULL or pointer to IODRPReq
86 * x - io_Special flag from IODRPReq
87 * y - 0
89 #define PRS_PREINIT 5
91 /* PRS_UNKNOWN - Something that AOS 3.9 sends, unknown?
92 * ct - 0
93 * x - 0
94 * y - 0
96 #define PRS_UNKNOWN 7
98 /* PRS_CONVERT - Transfer colormap/BGR line to printer
99 * ct - UBYTE * to an array of entries
100 * x - # of entries in the array
101 * y - 0 if ct is a union colorEntry *, 1 if ct is a BGR pixel line
103 #define PRS_CONVERT 8
105 /* PRS_CORRECT - Color correct a colormap/BGR line
106 * ct - UBYTE * to an array of entries
107 * x - # of entries in the array
108 * y - 0 if ct is a union colorEntry *, 1 if ct is a BGR pixel line
110 #define PRS_CORRECT 9
113 #endif /* AROS_PRINTERTAG_H */