]> git.ipfire.org Git - thirdparty/cups.git/blob - filter/textcommon.h
Merge changes from CUPS 1.5.1-r9875.
[thirdparty/cups.git] / filter / textcommon.h
1 /*
2 * "$Id: textcommon.h 6649 2007-07-11 21:46:42Z mike $"
3 *
4 * Common text filter definitions for CUPS.
5 *
6 * Copyright 2007-2010 by Apple Inc.
7 * Copyright 1997-2005 by Easy Software Products.
8 *
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
14 *
15 * This file is subject to the Apple OS-Developed Software exception.
16 */
17
18 /*
19 * Include necessary headers...
20 */
21
22 #include "common.h"
23
24
25 /*
26 * C++ magic...
27 */
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
32
33
34 /*
35 * Constants...
36 */
37
38 #define ATTR_NORMAL 0x00
39 #define ATTR_BOLD 0x01
40 #define ATTR_ITALIC 0x02
41 #define ATTR_BOLDITALIC 0x03
42 #define ATTR_FONT 0x03
43
44 #define ATTR_UNDERLINE 0x04
45 #define ATTR_RAISED 0x08
46 #define ATTR_LOWERED 0x10
47 #define ATTR_RED 0x20
48 #define ATTR_GREEN 0x40
49 #define ATTR_BLUE 0x80
50
51 #define PRETTY_OFF 0
52 #define PRETTY_PLAIN 1
53 #define PRETTY_CODE 2
54 #define PRETTY_SHELL 3
55 #define PRETTY_PERL 4
56 #define PRETTY_HTML 5
57
58
59 /*
60 * Structures...
61 */
62
63 typedef struct /**** Character/attribute structure... ****/
64 {
65 unsigned short ch, /* Character */
66 attr; /* Any attributes */
67 } lchar_t;
68
69
70 /*
71 * Globals...
72 */
73
74 extern int WrapLines, /* Wrap text in lines */
75 SizeLines, /* Number of lines on a page */
76 SizeColumns, /* Number of columns on a line */
77 PageColumns, /* Number of columns on a page */
78 ColumnGutter, /* Number of characters between text columns */
79 ColumnWidth, /* Width of each column */
80 PrettyPrint, /* Do pretty code formatting? */
81 Copies; /* Number of copies to produce */
82 extern lchar_t **Page; /* Page characters */
83 extern int NumPages; /* Number of pages in document */
84 extern float CharsPerInch, /* Number of character columns per inch */
85 LinesPerInch; /* Number of lines per inch */
86 extern int UTF8, /* Use UTF-8 encoding? */
87 NumKeywords; /* Number of known keywords */
88 extern char **Keywords; /* List of known keywords... */
89
90
91 /*
92 * Required functions...
93 */
94
95 extern int TextMain(const char *name, int argc, char *argv[]);
96 extern void WriteEpilogue(void);
97 extern void WritePage(void);
98 extern void WriteProlog(const char *title, const char *user,
99 const char *classification, const char *label,
100 ppd_file_t *ppd);
101
102
103 /*
104 * C++ magic...
105 */
106
107 #ifdef __cplusplus
108 }
109 #endif /* __cplusplus */
110
111
112 /*
113 * End of "$Id: textcommon.h 6649 2007-07-11 21:46:42Z mike $".
114 */