cab CUPS Treiber  ---
cab_options.h
Go to the documentation of this file.
1 /******************************************************************************
2  * cab Produkttechnik GmbH & Co KG
3  * Entwicklung Etikettendrucker
4  *
5  * cab CUPS Linux Driver, cab_options.h
6  * - Defines and cab specific structure
7  *
8  * Copyright (c) 2004-2020 cab Produkttechnik GmbH, Germany
9  *
10  * Licensed under Apache License v2.0. See the file "LICENSE" for more
11  * information.
12  *
13  */
14 
15 /*****************************************************************************/
16 
17 #ifndef CAB_OPTIONS_H_
18 #define CAB_OPTIONS_H_
19 
20 #include <cups/cups.h>
21 #include <cups/raster.h>
22 #include <cups/ppd.h>
23 
24 /* Printing parameters */
26 #define OPT_CAB_HEAD "Heat"
27 
28 #define OPT_CAB_PRN_METHOD "PrintMethod"
29 
30 #define OPT_CAB_SPEED "Speed"
31 
32 /* Media setup */
34 #define OPT_CAB_LABEL_SENSOR "LabelSensor"
35 
36 #define OPT_CAB_LABEL_GAP_VK "LabelGapVK"
37 
38 #define OPT_CAB_LABEL_GAP_NK "LabelGapNK"
39 
40 #define OPT_CAB_LABEL_MIRRORED "LabelMirrored"
41 
42 #define OPT_CAB_LABEL_ROTATE "LabelRotate"
43 
44 #define OPT_CAB_IGNORE_PAPEREND "IgnorePaperend"
45 
46 
48 #define OPT_CAB_PRN_HEAD_OFF_X_VK "PrnHeadOffsetXVK"
49 
50 #define OPT_CAB_PRN_HEAD_OFF_X_NK "PrnHeadOffsetXNK"
51 
52 
54 #define OPT_CAB_PRN_HEAD_OFF_Y_DIR "PrnHeadOffsetYDir"
55 
56 #define OPT_CAB_PRN_HEAD_OFF_Y_VK "PrnHeadOffsetYVK"
57 
58 #define OPT_CAB_PRN_HEAD_OFF_Y_NK "PrnHeadOffsetYNK"
59 
61 #define OPT_CAB_GLBL_OBJ_OFF_X_DIR "GlobalObjOffsetXDir"
62 
63 #define OPT_CAB_GLBL_OBJ_OFF_X_VK "GlobalObjOffsetXVK"
64 
65 #define OPT_CAB_GLBL_OBJ_OFF_X_NK "GlobalObjOffsetXNK"
66 
68 #define OPT_CAB_GLBL_OBJ_OFF_Y_DIR "GlobalObjOffsetYDir"
69 
70 #define OPT_CAB_GLBL_OBJ_OFF_Y_VK "GlobalObjOffsetYVK"
71 
72 #define OPT_CAB_GLBL_OBJ_OFF_Y_NK "GlobalObjOffsetYNK"
73 
74 
75 /* Peripherie Einstellungen */
77 #define OPT_CAB_TEAR_OFF_MODE "TearOffMode"
78 
79 
81 #define OPT_CAB_CUTTER "Cutter"
82 
83 #define OPT_CAB_CUTTER_MODE "cCutterMode"
84 
85 #define OPT_CAB_CUTTER_INTERVAL "cCutterInterval"
86 
87 #define OPT_CAB_CUTTER_OFFS_1DIR "cCutterOffset1Dir"
88 
89 #define OPT_CAB_CUTTER_OFFS_1VK "cCutterOffset1VK"
90 
91 #define OPT_CAB_CUTTER_OFFS_1NK "cCutterOffset1NK"
92 
93 
94 /* Pre-Printing options */
96 #define OPT_CAB_PRE_PRINT_MODE "cPrePrintOption"
97 
99 #define OPT_CAB_PRE_PRINT_DIR_OFFSET "cPrePrintOffsetDir"
100 
101 #define OPT_CAB_PRE_PRINT_VK_OFFSET "cPrePrintOffsetVK"
102 
103 #define OPT_CAB_PRE_PRINT_NK_OFFSET "cPrePrintOffsetNK"
104 
105 
106 /* Perforation settings */
108 #define OPT_CAB_PERFORATION_ENABLE "cPerforate"
109 
111 #define OPT_CAB_PERFO_DIR_OFFSET "cPerfoPrintOffsetDir"
112 
113 #define OPT_CAB_PERFO_VK_OFFSET "cPerfoPrintOffsetVK"
114 
115 #define OPT_CAB_PERFO_NK_OFFSET "cPerfoPrintOffsetNK"
116 
118 #define OPT_CAB_PERFO_VK_DEPTH "cPerfoDepthOffsetVK"
119 
120 #define OPT_CAB_PERFO_NK_DEPTH "cPerfoDepthOffsetNK"
121 
122 #define OPT_CAB_RIBBON_SAVER "RibbonSaver"
123 
124 
125 /* Peel Off Settings */
127 #define OPT_CAB_PEEL_OFF "PeelOff"
128 
130 #define OPT_CAB_PEEL_OFF_DIR "cPeelOffDir"
131 
132 #define OPT_CAB_PEEL_OFF_VKV "cPeelOffVKVersatz"
133 
134 #define OPT_CAB_PEEL_OFF_NKV "cPeelOffNKVersatz"
135 
136 
137 /* Advance setup parameters */
139 #define OPT_CAB_BACKFEED_MODE "BackFeed"
140 
141 #define OPT_CAB_FORMFEED_MODE "FormFeed"
142 
143 #define OPT_CAB_PAUSE_MODE "Pause"
144 
146 #define OPT_CAB_IMAGE_OPTIMIZATION "ImageOpt"
147 
149 #define OPT_CAB_REPLACE "Replace"
150 
152 #define OPT_CAB_JSCRIPT_PARAM1 "JScriptParam1"
153 
154 #define OPT_CAB_JSCRIPT_PARAM2 "JScriptParam2"
155 
156 #define OPT_CAB_JSCRIPT_PARAM3 "JScriptParam3"
157 
158 #define OPT_CAB_JSCRIPT_PARAM4 "JScriptParam4"
159 
160 #define CUSTOM_JSCRIPT_PARAM_MAX 80
161 
169 };
170 
171 
172 
174 typedef struct {
175  char heat[4];
176  char speed[4];
177  char type[2];
179 } h_options_t;
180 
181 
183 typedef struct {
184  int mirrored;
185  int rotate;
186  int tear_off;
187  char backfeed[2];
190  int replace;
191 } o_options_t;
192 
193 
194 
196 typedef struct {
197  int installed;
198  char disp[5];
199 } p_options_t;
200 
202 typedef struct {
203  char dispx[5];
204  char dispy[5];
205 } d_options_t;
206 
207 
209 typedef struct {
210  char formfeed[2];
211  char pause[2];
213 
214 
215 typedef struct {
221 
222 
223 /* ******************************************************************* */
224 /* Import: This command must be placed after the label size is defined */
225 /* (S-Command) */
226 /* ******************************************************************* */
227 
229 #define CAB_CUTTER_MODE_EOJ_CHOICE "CMOD2E"
230 
231 #define CAB_CUTTER_MODE_EXL_CHOICE "CMOD1I"
232 
234 typedef struct {
235  int installed;
236  int mode;
237  char amount[5];
238  char disp1[5];
239  char disp2[5];
240 } c_options_t;
241 
242 
243 
244 /* J-Script Optionen für den Etikettensensor */
245 #define CAB_LABEL_SENSOR_ENDLESS "e"
246 #define CAB_LABEL_SENSOR_REFLEX "l2"
247 #define CAB_LABEL_SENSOR_GAP "l1"
248 #define CAB_LABEL_SENSOR_ERROR "ERR"
249 
258 typedef struct {
259  char ptype[4];
260  double x0;
261  double y0;
262  double gap;
263 } s_options_t;
264 
265 
266 
268 typedef struct {
269  int installed;
270  char depth[5];
271  char disp[5];
273 
274 
275 /* \def CAB_PREPRINT_MODE_OFF_CHOICE Pre-Printing action is disabled */
276 #define CAB_PREPRINT_MODE_OFF_CHOICE "PREPOPT0"
277 /* \def CAB_PREPRINT_MODE_CUT_CHOICE Pre-Printing Mode - Cut label */
278 #define CAB_PREPRINT_MODE_CUT_CHOICE "PREPOPT1"
279 /* \def CAB_PREPRINT_MODE_PERFO_CHOICE Pre-Printing Mode - Perforate label */
280 #define CAB_PREPRINT_MODE_PERFO_CHOICE "PREPOPT2"
281 
282 
289 };
290 
291 
293 typedef struct {
294  int mode;
295  char disp[5];
297 
298 void handleMarkedPPDOptions(ppd_file_t *ppd);
299 
301 int get_option_replace();
302 
303 int get_custom_jscript1_cmd(char *command, int page);
304 int get_custom_jscript3_cmd(char *command);
305 
306 void get_s_option_cmd(char *command, cups_page_header2_t *header, double printwidth);
307 int get_c_option_cmd(char *command);
308 int get_p_option_cmd(char *command);
309 void get_h_option_cmd(char *command);
310 int get_o_option_cmd(char *command);
311 int get_d_option_cmd(char *command);
312 
314 int isPrePrintPerforate();
316 void get_perfo_depth(char *command);
317 void get_perfo_offset(char *command);
318 int get_preprint_opt(char *command);
319 
320 int get_immediate_cmd(char *command, const char* type, const char value);
321 
322 #endif /* _CAB_OPTIONS_H_ */
void get_h_option_cmd(char *command)
Definition: cab_options.c:286
int ribbon_saver
Definition: cab_options.h:178
Struktur für Einstellungen des Schneidemessers.
Definition: cab_options.h:234
int get_custom_jscript3_cmd(char *command)
Definition: cab_options.c:122
int rotate
Rotate the label contents 180 degrees.
Definition: cab_options.h:185
int mirrored
Mirrowed label printing.
Definition: cab_options.h:184
Structure heat level, speed and kind of printing method.
Definition: cab_options.h:174
int mode
Cutting mode: Job start/end or amount of labels.
Definition: cab_options.h:236
int isPrePrintPerforate()
Return, wether the pre-print option is set to &#39;Perforate&#39;.
Definition: cab_options.c:364
preprinting_mode
Enumeration for pre-printing mode.
Definition: cab_options.h:284
int get_option_image_optimization()
Definition: cab_options.c:777
void handleMarkedPPDOptions(ppd_file_t *ppd)
Definition: cab_options.c:1254
void get_perfo_depth(char *command)
Assembles the command for the perforation depth (C-Command)
Definition: cab_options.c:468
int image_optimization
Definition: cab_options.h:189
void get_s_option_cmd(char *command, cups_page_header2_t *header, double printwidth)
Definition: cab_options.c:154
int mode
Pre-Print Mode.
Definition: cab_options.h:294
int isPerfoCutterInstalled()
Return, wether a perforation cutter is installed.
Definition: cab_options.c:347
int get_immediate_cmd(char *command, const char *type, const char value)
Definition: cab_options.c:517
int get_option_replace()
Definition: cab_options.c:788
Cut, when job is done.
Definition: cab_options.h:166
int get_preprint_opt(char *command)
Assembles the command for the per-print option (C-Command)
Definition: cab_options.c:491
double gap
Gap between two labels.
Definition: cab_options.h:262
int installed
Flag, set to TRUE (1) if a perforation cutter is installed.
Definition: cab_options.h:269
int installed
Peel-Off is switch on ...
Definition: cab_options.h:197
int get_d_option_cmd(char *command)
Definition: cab_options.c:315
Struktur für das Definieren der Etikettengröße.
Definition: cab_options.h:258
Cut, when job is done.
Definition: cab_options.h:167
#define CUSTOM_JSCRIPT_PARAM_MAX
Definition: cab_options.h:160
int ignore_paperend
Ignore paper end.
Definition: cab_options.h:188
int get_custom_jscript1_cmd(char *command, int page)
Definition: cab_options.c:106
Struktur für Einstellungen des Perforationsschneidemessers.
Definition: cab_options.h:268
Structure for printing parameters.
Definition: cab_options.h:183
Structure for extra immediate commands.
Definition: cab_options.h:209
Cut before printing.
Definition: cab_options.h:286
Struktur für Einstellungen der Pre-Printing Option.
Definition: cab_options.h:293
No Pre-Printing action.
Definition: cab_options.h:285
Structure for the global object offset.
Definition: cab_options.h:202
int isRibbonSaveSelected()
Return, wether the RibbonSave is active.
Definition: cab_options.c:381
double y0
Vertical displacement.
Definition: cab_options.h:261
int tear_off
Enables the "tear off mode" ...
Definition: cab_options.h:186
double x0
Horizontal displacement.
Definition: cab_options.h:260
int installed
Flag, set to TRUE (1) if a cutter is installed.
Definition: cab_options.h:235
cutter_mode
Enumeration for cutting mode.
Definition: cab_options.h:163
Unknown mode.
Definition: cab_options.h:164
Structure for the peel-off modi.
Definition: cab_options.h:196
Perforate before printing.
Definition: cab_options.h:287
int get_o_option_cmd(char *command)
Definition: cab_options.c:401
Cut after a certain amount of x labels.
Definition: cab_options.h:165
void get_perfo_offset(char *command)
Assembles the command for the perforation offset (C-Command)
Definition: cab_options.c:447
int get_c_option_cmd(char *command)
Definition: cab_options.c:214
static double printwidth
Definition: rastertocab.c:34
int get_p_option_cmd(char *command)
Definition: cab_options.c:259