forked from michaelrsweet/lprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lprint-fgl.c
169 lines (129 loc) · 3.37 KB
/
lprint-fgl.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
//
// UNIMPLEMENTED FGL driver for LPrint, a Label Printer Application
//
// Copyright © 2019 by Michael R Sweet.
//
// Licensed under Apache License v2.0. See the file "LICENSE" for more
// information.
//
//
// Include necessary headers...
//
#include "lprint.h"
//
// Local globals...
//
static const char * const lprint_fgl_media[] =
{ // Supported media sizes
"oe_1.25x0.25-label_1.25x0.25in",
"oe_1.25x2.25-label_1.25x2.25in",
"oe_1.5x0.25-label_1.5x0.25in",
"oe_1.5x0.5-label_1.5x0.5in",
"oe_1.5x1-label_1.5x1in",
"oe_1.5x2-label_1.5x2in",
"oe_2x0.37-label_2x0.37in",
"oe_2x0.5-label_2x0.5in",
"oe_2x1-label_2x1in",
"oe_2x1.25-label_2x1.25in",
"oe_2x2-label_2x2in",
"oe_2x3-label_2x3in",
"oe_2x4-label_2x4in",
"oe_2x5.5-label_2x5.5in",
"oe_2.25x0.5-label_2.25xin",
"oe_2.25x1.25-label_2.25xin",
"oe_30859-paint-can-label_2.25x3.125in",
"oe_2.25x4-label_2.25x4in",
"oe_2.25x5.5-label_2.25x5.5in",
"oe_2.38x5.5-label_2.38x5.5in",
"oe_2.5x1-label_2.5x1in",
"oe_2.5x2-label_2.5x2in",
"oe_2.75x1.25-label_2.75x1.25in",
"oe_2.9x1-label_2.9x1in",
"oe_3x1-label_3x1in",
"oe_3x1.25-label_3x1.25in",
"oe_3x2-label_3x2in",
"oe_3x3-label_3x3in",
"oe_3x5-label_3x5in",
"oe_3.25x2-label_3.25x2in",
"oe_3.25x5-label_3.25x5in",
"oe_3.25x5.5-label_3.25x5.5in",
"oe_3.25x5.83-label_3.25x5.83in",
"oe_3.25x7.83-label_3.25x7.83in",
"oe_3.5x1-label_3.5x1in",
"oe_4x1-label_4x1in",
"oe_4x2-label_4x2in",
"oe_4x3-label_4x3in",
"oe_4x4-label_4x4in",
"oe_4x5-label_4x5in",
"oe_4x6-label_4x6in",
"oe_4x6.5-label_4x6.5in",
"oe_4x13-label_4x13in",
"oe_6x1-label_6x1in",
"oe_6x2-label_6x2in",
"oe_6x3-label_6x3in",
"oe_6x4-label_6x4in",
"oe_6x5-label_6x5in",
"oe_6x6-label_6x6in",
"oe_6x6.5-label_6x6.5in",
"oe_6x13-label_6x13in",
"oe_8x1-label_8x1in",
"oe_8x2-label_8x2in",
"oe_8x3-label_8x3in",
"oe_8x4-label_8x4in",
"oe_8x5-label_8x5in",
"oe_8x6-label_8x6in",
"oe_8x6.5-label_8x6.5in",
"oe_8x13-label_8x13in",
"roll_max_8x100in",
"roll_min_1.25x0.25in"
};
//
// Local functions...
//
static int lprint_fgl_print(lprint_printer_t *printer, lprint_job_t *job);
static int lprint_fgl_status(lprint_printer_t *printer);
//
// 'lprintInitFGL()' - Initialize the driver.
//
void
lprintInitFGL(
lprint_driver_t *driver) // I - Driver
{
pthread_rwlock_wrlock(&driver->rwlock);
driver->printfunc = lprint_fgl_print;
driver->statusfunc = lprint_fgl_status;
driver->format = "application/vnd.-";
driver->num_resolution = 1;
driver->x_resolution[0] = 203;
driver->y_resolution[0] = 203;
driver->num_media = (int)(sizeof(lprint_fgl_media) / sizeof(lprint_fgl_media[0]));
memcpy(driver->media, lprint_fgl_media, sizeof(lprint_fgl_media));
driver->num_source = 1;
driver->source[0] = "main-roll";
driver->num_type = 1;
driver->type[0] = "labels";
driver->num_supply = 0;
pthread_rwlock_unlock(&driver->rwlock);
}
//
// 'lprint_fgl_print()' - Print a file.
//
static int // O - 1 on success, 0 on failure
lprint_fgl_print(
lprint_printer_t *printer, // I - Printer
lprint_job_t *job) // I - Job
{
(void)printer;
(void)job;
return (1);
}
//
// 'lprint_fgl_status()' - Get current printer status.
//
static int // O - 1 on success, 0 on failure
lprint_fgl_status(
lprint_printer_t *printer) // I - Printer
{
(void)printer;
return (1);
}