cab CUPS Treiber  ---
cab_options.h File Reference
#include <cups/cups.h>
#include <cups/raster.h>
#include <cups/ppd.h>

Go to the source code of this file.

Data Structures

struct  h_options_t
 Structure heat level, speed and kind of printing method. More...
 
struct  o_options_t
 Structure for printing parameters. More...
 
struct  p_options_t
 Structure for the peel-off modi. More...
 
struct  d_options_t
 Structure for the global object offset. More...
 
struct  immediate_commands_t
 Structure for extra immediate commands. More...
 
struct  custom_jscript_t
 
struct  c_options_t
 Struktur für Einstellungen des Schneidemessers. More...
 
struct  s_options_t
 Struktur für das Definieren der Etikettengröße. More...
 
struct  perfo_options_t
 Struktur für Einstellungen des Perforationsschneidemessers. More...
 
struct  preprint_options_t
 Struktur für Einstellungen der Pre-Printing Option. More...
 

Macros

#define OPT_CAB_HEAD   "Heat"
 
#define OPT_CAB_PRN_METHOD   "PrintMethod"
 
#define OPT_CAB_SPEED   "Speed"
 
#define OPT_CAB_LABEL_SENSOR   "LabelSensor"
 
#define OPT_CAB_LABEL_GAP_VK   "LabelGapVK"
 
#define OPT_CAB_LABEL_GAP_NK   "LabelGapNK"
 
#define OPT_CAB_LABEL_MIRRORED   "LabelMirrored"
 
#define OPT_CAB_LABEL_ROTATE   "LabelRotate"
 
#define OPT_CAB_IGNORE_PAPEREND   "IgnorePaperend"
 
#define OPT_CAB_PRN_HEAD_OFF_X_VK   "PrnHeadOffsetXVK"
 
#define OPT_CAB_PRN_HEAD_OFF_X_NK   "PrnHeadOffsetXNK"
 
#define OPT_CAB_PRN_HEAD_OFF_Y_DIR   "PrnHeadOffsetYDir"
 
#define OPT_CAB_PRN_HEAD_OFF_Y_VK   "PrnHeadOffsetYVK"
 
#define OPT_CAB_PRN_HEAD_OFF_Y_NK   "PrnHeadOffsetYNK"
 
#define OPT_CAB_GLBL_OBJ_OFF_X_DIR   "GlobalObjOffsetXDir"
 
#define OPT_CAB_GLBL_OBJ_OFF_X_VK   "GlobalObjOffsetXVK"
 
#define OPT_CAB_GLBL_OBJ_OFF_X_NK   "GlobalObjOffsetXNK"
 
#define OPT_CAB_GLBL_OBJ_OFF_Y_DIR   "GlobalObjOffsetYDir"
 
#define OPT_CAB_GLBL_OBJ_OFF_Y_VK   "GlobalObjOffsetYVK"
 
#define OPT_CAB_GLBL_OBJ_OFF_Y_NK   "GlobalObjOffsetYNK"
 
#define OPT_CAB_TEAR_OFF_MODE   "TearOffMode"
 
#define OPT_CAB_CUTTER   "Cutter"
 
#define OPT_CAB_CUTTER_MODE   "cCutterMode"
 
#define OPT_CAB_CUTTER_INTERVAL   "cCutterInterval"
 
#define OPT_CAB_CUTTER_OFFS_1DIR   "cCutterOffset1Dir"
 
#define OPT_CAB_CUTTER_OFFS_1VK   "cCutterOffset1VK"
 
#define OPT_CAB_CUTTER_OFFS_1NK   "cCutterOffset1NK"
 
#define OPT_CAB_PRE_PRINT_MODE   "cPrePrintOption"
 
#define OPT_CAB_PRE_PRINT_DIR_OFFSET   "cPrePrintOffsetDir"
 
#define OPT_CAB_PRE_PRINT_VK_OFFSET   "cPrePrintOffsetVK"
 
#define OPT_CAB_PRE_PRINT_NK_OFFSET   "cPrePrintOffsetNK"
 
#define OPT_CAB_PERFORATION_ENABLE   "cPerforate"
 
#define OPT_CAB_PERFO_DIR_OFFSET   "cPerfoPrintOffsetDir"
 
#define OPT_CAB_PERFO_VK_OFFSET   "cPerfoPrintOffsetVK"
 
#define OPT_CAB_PERFO_NK_OFFSET   "cPerfoPrintOffsetNK"
 
#define OPT_CAB_PERFO_VK_DEPTH   "cPerfoDepthOffsetVK"
 
#define OPT_CAB_PERFO_NK_DEPTH   "cPerfoDepthOffsetNK"
 
#define OPT_CAB_RIBBON_SAVER   "RibbonSaver"
 
#define OPT_CAB_PEEL_OFF   "PeelOff"
 
#define OPT_CAB_PEEL_OFF_DIR   "cPeelOffDir"
 
#define OPT_CAB_PEEL_OFF_VKV   "cPeelOffVKVersatz"
 
#define OPT_CAB_PEEL_OFF_NKV   "cPeelOffNKVersatz"
 
#define OPT_CAB_BACKFEED_MODE   "BackFeed"
 
#define OPT_CAB_FORMFEED_MODE   "FormFeed"
 
#define OPT_CAB_PAUSE_MODE   "Pause"
 
#define OPT_CAB_IMAGE_OPTIMIZATION   "ImageOpt"
 
#define OPT_CAB_REPLACE   "Replace"
 
#define OPT_CAB_JSCRIPT_PARAM1   "JScriptParam1"
 
#define OPT_CAB_JSCRIPT_PARAM2   "JScriptParam2"
 
#define OPT_CAB_JSCRIPT_PARAM3   "JScriptParam3"
 
#define OPT_CAB_JSCRIPT_PARAM4   "JScriptParam4"
 
#define CUSTOM_JSCRIPT_PARAM_MAX   80
 
#define CAB_CUTTER_MODE_EOJ_CHOICE   "CMOD2E"
 
#define CAB_CUTTER_MODE_EXL_CHOICE   "CMOD1I"
 
#define CAB_LABEL_SENSOR_ENDLESS   "e"
 
#define CAB_LABEL_SENSOR_REFLEX   "l2"
 
#define CAB_LABEL_SENSOR_GAP   "l1"
 
#define CAB_LABEL_SENSOR_ERROR   "ERR"
 
#define CAB_PREPRINT_MODE_OFF_CHOICE   "PREPOPT0"
 
#define CAB_PREPRINT_MODE_CUT_CHOICE   "PREPOPT1"
 
#define CAB_PREPRINT_MODE_PERFO_CHOICE   "PREPOPT2"
 

Enumerations

enum  cutter_mode {
  CAB_CUTTER_MODE_ERR = 0, CAB_CUTTER_INTERVAL = 1, CAB_CUTTER_END_JOB = 2, CAB_CUTTER_START_JOB = 3,
  CAB_CUTTER_MODE_MAX = 4
}
 Enumeration for cutting mode. More...
 
enum  preprinting_mode { CAB_PREPRINT_MODE_OFF = 0, CAB_PREPRINT_MODE_CUT = 1, CAB_PREPRINT_MODE_PERFORATE = 2, CAB_PREPRINT_MODE_MAX = 3 }
 Enumeration for pre-printing mode. More...
 

Functions

void handleMarkedPPDOptions (ppd_file_t *ppd)
 
int get_option_image_optimization ()
 
int get_option_replace ()
 
int get_custom_jscript1_cmd (char *command, int page)
 
int get_custom_jscript3_cmd (char *command)
 
void get_s_option_cmd (char *command, cups_page_header2_t *header, double printwidth)
 
int get_c_option_cmd (char *command)
 
int get_p_option_cmd (char *command)
 
void get_h_option_cmd (char *command)
 
int get_o_option_cmd (char *command)
 
int get_d_option_cmd (char *command)
 
int isPerfoCutterInstalled ()
 Return, wether a perforation cutter is installed. More...
 
int isPrePrintPerforate ()
 Return, wether the pre-print option is set to 'Perforate'. More...
 
int isRibbonSaveSelected ()
 Return, wether the RibbonSave is active. More...
 
void get_perfo_depth (char *command)
 Assembles the command for the perforation depth (C-Command) More...
 
void get_perfo_offset (char *command)
 Assembles the command for the perforation offset (C-Command) More...
 
int get_preprint_opt (char *command)
 Assembles the command for the per-print option (C-Command) More...
 
int get_immediate_cmd (char *command, const char *type, const char value)
 

Macro Definition Documentation

◆ CAB_CUTTER_MODE_EOJ_CHOICE

#define CAB_CUTTER_MODE_EOJ_CHOICE   "CMOD2E"

Definition at line 229 of file cab_options.h.

Referenced by setCutterMode().

◆ CAB_CUTTER_MODE_EXL_CHOICE

#define CAB_CUTTER_MODE_EXL_CHOICE   "CMOD1I"

Definition at line 231 of file cab_options.h.

Referenced by setCutterMode().

◆ CAB_LABEL_SENSOR_ENDLESS

#define CAB_LABEL_SENSOR_ENDLESS   "e"

Definition at line 245 of file cab_options.h.

Referenced by set_LabelSensor().

◆ CAB_LABEL_SENSOR_ERROR

#define CAB_LABEL_SENSOR_ERROR   "ERR"

Definition at line 248 of file cab_options.h.

Referenced by set_LabelSensor().

◆ CAB_LABEL_SENSOR_GAP

#define CAB_LABEL_SENSOR_GAP   "l1"

Definition at line 247 of file cab_options.h.

Referenced by get_o_option_cmd(), and set_LabelSensor().

◆ CAB_LABEL_SENSOR_REFLEX

#define CAB_LABEL_SENSOR_REFLEX   "l2"

Definition at line 246 of file cab_options.h.

Referenced by get_o_option_cmd(), and set_LabelSensor().

◆ CAB_PREPRINT_MODE_CUT_CHOICE

#define CAB_PREPRINT_MODE_CUT_CHOICE   "PREPOPT1"

Definition at line 278 of file cab_options.h.

Referenced by setPrePrintingMode().

◆ CAB_PREPRINT_MODE_OFF_CHOICE

#define CAB_PREPRINT_MODE_OFF_CHOICE   "PREPOPT0"

Definition at line 276 of file cab_options.h.

Referenced by setPrePrintingMode().

◆ CAB_PREPRINT_MODE_PERFO_CHOICE

#define CAB_PREPRINT_MODE_PERFO_CHOICE   "PREPOPT2"

Definition at line 280 of file cab_options.h.

Referenced by setPrePrintingMode().

◆ CUSTOM_JSCRIPT_PARAM_MAX

#define CUSTOM_JSCRIPT_PARAM_MAX   80

Definition at line 160 of file cab_options.h.

Referenced by print_page(), and replace_string_section().

◆ OPT_CAB_BACKFEED_MODE

#define OPT_CAB_BACKFEED_MODE   "BackFeed"

Definition at line 139 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_CUTTER

#define OPT_CAB_CUTTER   "Cutter"

Definition at line 81 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_CUTTER_INTERVAL

#define OPT_CAB_CUTTER_INTERVAL   "cCutterInterval"

Definition at line 85 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_CUTTER_MODE

#define OPT_CAB_CUTTER_MODE   "cCutterMode"

Definition at line 83 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_CUTTER_OFFS_1DIR

#define OPT_CAB_CUTTER_OFFS_1DIR   "cCutterOffset1Dir"

Definition at line 87 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_CUTTER_OFFS_1NK

#define OPT_CAB_CUTTER_OFFS_1NK   "cCutterOffset1NK"

Definition at line 91 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_CUTTER_OFFS_1VK

#define OPT_CAB_CUTTER_OFFS_1VK   "cCutterOffset1VK"

Definition at line 89 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_FORMFEED_MODE

#define OPT_CAB_FORMFEED_MODE   "FormFeed"

Definition at line 141 of file cab_options.h.

Referenced by get_immediate_cmd(), handleMarkedPPDOptions(), and print_page().

◆ OPT_CAB_GLBL_OBJ_OFF_X_DIR

#define OPT_CAB_GLBL_OBJ_OFF_X_DIR   "GlobalObjOffsetXDir"

Definition at line 61 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_GLBL_OBJ_OFF_X_NK

#define OPT_CAB_GLBL_OBJ_OFF_X_NK   "GlobalObjOffsetXNK"

Definition at line 65 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_GLBL_OBJ_OFF_X_VK

#define OPT_CAB_GLBL_OBJ_OFF_X_VK   "GlobalObjOffsetXVK"

Definition at line 63 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_GLBL_OBJ_OFF_Y_DIR

#define OPT_CAB_GLBL_OBJ_OFF_Y_DIR   "GlobalObjOffsetYDir"

Definition at line 68 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_GLBL_OBJ_OFF_Y_NK

#define OPT_CAB_GLBL_OBJ_OFF_Y_NK   "GlobalObjOffsetYNK"

Definition at line 72 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_GLBL_OBJ_OFF_Y_VK

#define OPT_CAB_GLBL_OBJ_OFF_Y_VK   "GlobalObjOffsetYVK"

Definition at line 70 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_HEAD

#define OPT_CAB_HEAD   "Heat"

Definition at line 26 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_IGNORE_PAPEREND

#define OPT_CAB_IGNORE_PAPEREND   "IgnorePaperend"

Definition at line 44 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_IMAGE_OPTIMIZATION

#define OPT_CAB_IMAGE_OPTIMIZATION   "ImageOpt"

Definition at line 146 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_JSCRIPT_PARAM1

#define OPT_CAB_JSCRIPT_PARAM1   "JScriptParam1"

Definition at line 152 of file cab_options.h.

◆ OPT_CAB_JSCRIPT_PARAM2

#define OPT_CAB_JSCRIPT_PARAM2   "JScriptParam2"

Definition at line 154 of file cab_options.h.

◆ OPT_CAB_JSCRIPT_PARAM3

#define OPT_CAB_JSCRIPT_PARAM3   "JScriptParam3"

Definition at line 156 of file cab_options.h.

◆ OPT_CAB_JSCRIPT_PARAM4

#define OPT_CAB_JSCRIPT_PARAM4   "JScriptParam4"

Definition at line 158 of file cab_options.h.

◆ OPT_CAB_LABEL_GAP_NK

#define OPT_CAB_LABEL_GAP_NK   "LabelGapNK"

Definition at line 38 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_LABEL_GAP_VK

#define OPT_CAB_LABEL_GAP_VK   "LabelGapVK"

Definition at line 36 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_LABEL_MIRRORED

#define OPT_CAB_LABEL_MIRRORED   "LabelMirrored"

Definition at line 40 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_LABEL_ROTATE

#define OPT_CAB_LABEL_ROTATE   "LabelRotate"

Definition at line 42 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_LABEL_SENSOR

#define OPT_CAB_LABEL_SENSOR   "LabelSensor"

Definition at line 34 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PAUSE_MODE

#define OPT_CAB_PAUSE_MODE   "Pause"

Definition at line 143 of file cab_options.h.

Referenced by get_immediate_cmd(), handleMarkedPPDOptions(), and print_page().

◆ OPT_CAB_PEEL_OFF

#define OPT_CAB_PEEL_OFF   "PeelOff"

Definition at line 127 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PEEL_OFF_DIR

#define OPT_CAB_PEEL_OFF_DIR   "cPeelOffDir"

Definition at line 130 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PEEL_OFF_NKV

#define OPT_CAB_PEEL_OFF_NKV   "cPeelOffNKVersatz"

Definition at line 134 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PEEL_OFF_VKV

#define OPT_CAB_PEEL_OFF_VKV   "cPeelOffVKVersatz"

Definition at line 132 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PERFO_DIR_OFFSET

#define OPT_CAB_PERFO_DIR_OFFSET   "cPerfoPrintOffsetDir"

Definition at line 111 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PERFO_NK_DEPTH

#define OPT_CAB_PERFO_NK_DEPTH   "cPerfoDepthOffsetNK"

Definition at line 120 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PERFO_NK_OFFSET

#define OPT_CAB_PERFO_NK_OFFSET   "cPerfoPrintOffsetNK"

Definition at line 115 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PERFO_VK_DEPTH

#define OPT_CAB_PERFO_VK_DEPTH   "cPerfoDepthOffsetVK"

Definition at line 118 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PERFO_VK_OFFSET

#define OPT_CAB_PERFO_VK_OFFSET   "cPerfoPrintOffsetVK"

Definition at line 113 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PERFORATION_ENABLE

#define OPT_CAB_PERFORATION_ENABLE   "cPerforate"

Definition at line 108 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PRE_PRINT_DIR_OFFSET

#define OPT_CAB_PRE_PRINT_DIR_OFFSET   "cPrePrintOffsetDir"

Definition at line 99 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PRE_PRINT_MODE

#define OPT_CAB_PRE_PRINT_MODE   "cPrePrintOption"

Definition at line 96 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PRE_PRINT_NK_OFFSET

#define OPT_CAB_PRE_PRINT_NK_OFFSET   "cPrePrintOffsetNK"

Definition at line 103 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PRE_PRINT_VK_OFFSET

#define OPT_CAB_PRE_PRINT_VK_OFFSET   "cPrePrintOffsetVK"

Definition at line 101 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PRN_HEAD_OFF_X_NK

#define OPT_CAB_PRN_HEAD_OFF_X_NK   "PrnHeadOffsetXNK"

Definition at line 50 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PRN_HEAD_OFF_X_VK

#define OPT_CAB_PRN_HEAD_OFF_X_VK   "PrnHeadOffsetXVK"

Definition at line 48 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PRN_HEAD_OFF_Y_DIR

#define OPT_CAB_PRN_HEAD_OFF_Y_DIR   "PrnHeadOffsetYDir"

Definition at line 54 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PRN_HEAD_OFF_Y_NK

#define OPT_CAB_PRN_HEAD_OFF_Y_NK   "PrnHeadOffsetYNK"

Definition at line 58 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PRN_HEAD_OFF_Y_VK

#define OPT_CAB_PRN_HEAD_OFF_Y_VK   "PrnHeadOffsetYVK"

Definition at line 56 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_PRN_METHOD

#define OPT_CAB_PRN_METHOD   "PrintMethod"

Definition at line 28 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_REPLACE

#define OPT_CAB_REPLACE   "Replace"

Definition at line 149 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_RIBBON_SAVER

#define OPT_CAB_RIBBON_SAVER   "RibbonSaver"

Definition at line 122 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_SPEED

#define OPT_CAB_SPEED   "Speed"

Definition at line 30 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

◆ OPT_CAB_TEAR_OFF_MODE

#define OPT_CAB_TEAR_OFF_MODE   "TearOffMode"

Definition at line 77 of file cab_options.h.

Referenced by handleMarkedPPDOptions().

Enumeration Type Documentation

◆ cutter_mode

Enumeration for cutting mode.

Enumerator
CAB_CUTTER_MODE_ERR 

Unknown mode.

CAB_CUTTER_INTERVAL 

Cut after a certain amount of x labels.

CAB_CUTTER_END_JOB 

Cut, when job is done.

CAB_CUTTER_START_JOB 

Cut, when job is done.

CAB_CUTTER_MODE_MAX 

Max.

number of cutting modi

Definition at line 163 of file cab_options.h.

163  {
164  CAB_CUTTER_MODE_ERR = 0,
165  CAB_CUTTER_INTERVAL = 1,
166  CAB_CUTTER_END_JOB = 2,
169 };
Cut, when job is done.
Definition: cab_options.h:166
Cut, when job is done.
Definition: cab_options.h:167
Unknown mode.
Definition: cab_options.h:164
Cut after a certain amount of x labels.
Definition: cab_options.h:165

◆ preprinting_mode

Enumeration for pre-printing mode.

Enumerator
CAB_PREPRINT_MODE_OFF 

No Pre-Printing action.

CAB_PREPRINT_MODE_CUT 

Cut before printing.

CAB_PREPRINT_MODE_PERFORATE 

Perforate before printing.

CAB_PREPRINT_MODE_MAX 

Max.

number of pre-printing modi

Definition at line 284 of file cab_options.h.

284  {
289 };
Cut before printing.
Definition: cab_options.h:286
No Pre-Printing action.
Definition: cab_options.h:285
Perforate before printing.
Definition: cab_options.h:287

Function Documentation

◆ get_c_option_cmd()

int get_c_option_cmd ( char *  command)
Note
The cutter is an optional feature of cab printer. It has to checked, whether the sensor is installed.

Definition at line 214 of file cab_options.c.

References c_options_t::amount, CAB_CUTTER_END_JOB, CAB_CUTTER_INTERVAL, c_options_t::disp1, FALSE, c_options_t::installed, c_options_t::mode, and TRUE.

Referenced by print_page().

214  {
215  int res = TRUE;
216 
217  if (c_opt.installed == TRUE) {
218  if (c_opt.mode == CAB_CUTTER_INTERVAL) {
219  strcpy(command, "C ");
220  strcat(command, c_opt.amount);
221  strcat(command, ",");
222  strcat(command, c_opt.disp1);
223  }
224  else if (c_opt.mode == CAB_CUTTER_END_JOB) {
225  strcpy(command, "C e");
226  strcat(command, ",");
227  strcat(command, c_opt.disp1);
228  }
229  else {
230  strcpy(command, "C ERROR!!!");
231  }
232  strcat(command, "\r\n");
233  }
234  else {
235  res = FALSE;
236  }
237 
238  return res;
239 }
#define TRUE
Debug level.
Definition: rastertocab.h:30
char disp1[5]
Displacement for the first cut.
Definition: cab_options.h:238
int mode
Cutting mode: Job start/end or amount of labels.
Definition: cab_options.h:236
#define FALSE
Boolean define used for FALSE.
Definition: rastertocab.h:33
static c_options_t c_opt
Cutter parameters.
Definition: cab_options.c:27
char amount[5]
Amount of label after which a cut is processed.
Definition: cab_options.h:237
Cut, when job is done.
Definition: cab_options.h:166
int installed
Flag, set to TRUE (1) if a cutter is installed.
Definition: cab_options.h:235
Cut after a certain amount of x labels.
Definition: cab_options.h:165

◆ get_custom_jscript1_cmd()

int get_custom_jscript1_cmd ( char *  command,
int  page 
)

Definition at line 106 of file cab_options.c.

References custom_jscript_t::param1, and replace_string_section().

Referenced by print_page().

107 {
108  char buf[8];
109 
110  if(!custom_jscript.param1[0])
111  return 0;
112 
113  sprintf(command, "%s\r\n", custom_jscript.param1);
114  sprintf(buf, "%d", page);
115 
116  replace_string_section(command, "{PageNum+1}", buf);
117 
118  return 1;
119 }
char param1[CUSTOM_JSCRIPT_PARAM_MAX]
Definition: cab_options.h:216
static custom_jscript_t custom_jscript
Definition: cab_options.c:35
static int replace_string_section(char *buffer, const char *search, const char *replace)
Definition: cab_options.c:83

◆ get_custom_jscript3_cmd()

int get_custom_jscript3_cmd ( char *  command)

Definition at line 122 of file cab_options.c.

References custom_jscript_t::param3, and replace_string_section().

Referenced by print_page().

123 {
124  char buf[3];
125 
126  if(!custom_jscript.param3[0])
127  return 0;
128 
129  sprintf(command, "%s\r\n", custom_jscript.param3);
130  sprintf(buf, "\r\n");
131 
132  replace_string_section(command, "<CR>", buf);
133 
134  return 1;
135 }
char param3[CUSTOM_JSCRIPT_PARAM_MAX]
Definition: cab_options.h:218
static custom_jscript_t custom_jscript
Definition: cab_options.c:35
static int replace_string_section(char *buffer, const char *search, const char *replace)
Definition: cab_options.c:83

◆ get_d_option_cmd()

int get_d_option_cmd ( char *  command)

Definition at line 315 of file cab_options.c.

References d_options_t::dispx, d_options_t::dispy, FALSE, and TRUE.

Referenced by print_page().

315  {
316  int ret = FALSE;
317  if ((strncmp(d_opt.dispx, "0.0", 3) == 0 ||
318  strncmp(d_opt.dispx, "-0.0", 4) == 0) &&
319  (strncmp(d_opt.dispy, "0.0", 3) == 0 ||
320  strncmp(d_opt.dispy, "-0.0", 4) == 0) ) {
321  ret = FALSE;
322  } else {
323  strcpy(command, "D ");
324  strcat(command, d_opt.dispx);
325  strcat(command, ",");
326  strcat(command, d_opt.dispy);
327  strcat(command, "\r\n");
328  ret = TRUE;
329  }
330  return ret;
331 }
#define TRUE
Debug level.
Definition: rastertocab.h:30
char dispy[5]
Displacement y in mm.
Definition: cab_options.h:204
#define FALSE
Boolean define used for FALSE.
Definition: rastertocab.h:33
static d_options_t d_opt
Global object offset.
Definition: cab_options.c:31
char dispx[5]
Displacement x in mm.
Definition: cab_options.h:203

◆ get_h_option_cmd()

void get_h_option_cmd ( char *  command)

Definition at line 286 of file cab_options.c.

References h_options_t::heat, h_options_t::ribbon_saver, h_options_t::speed, and h_options_t::type.

Referenced by print_page().

286  {
287  strcpy(command, "H ");
288  strcat(command, h_opt.speed);
289  strcat(command, ",");
290  strcat(command, h_opt.heat);
291  strcat(command, ",");
292  strcat(command, h_opt.type);
293 
294  if(h_opt.ribbon_saver)
295  strcat(command, ",R1");
296 
297  strcat(command, "\r\n");
298 }
int ribbon_saver
Definition: cab_options.h:178
char speed[4]
Print speed in mm.
Definition: cab_options.h:176
char heat[4]
Heating (-10 up to 10)
Definition: cab_options.h:175
static h_options_t h_opt
Printing parameters.
Definition: cab_options.c:29
char type[2]
Method of printing.
Definition: cab_options.h:177

◆ get_immediate_cmd()

int get_immediate_cmd ( char *  command,
const char *  type,
const char  value 
)

Definition at line 517 of file cab_options.c.

References FALSE, immediate_commands_t::formfeed, OPT_CAB_FORMFEED_MODE, OPT_CAB_PAUSE_MODE, immediate_commands_t::pause, and TRUE.

Referenced by print_page().

517  {
518  int ret = FALSE;
519 
520  /* Formfeed */
521  if (strncmp(type, OPT_CAB_FORMFEED_MODE, sizeof(OPT_CAB_FORMFEED_MODE)) == 0 &&
522  imm_cmd.formfeed[0] == value)
523  {
524  strcpy (command, "f");
525  strcat(command, "\r\n");
526  ret = TRUE;
527  }
528  /* Pause */
529  else if (strncmp(type, OPT_CAB_PAUSE_MODE, sizeof(OPT_CAB_PAUSE_MODE)) == 0 &&
530  imm_cmd.pause[0] == value)
531  {
532  strcpy (command, "p1");
533  strcat(command, "\r\n");
534  ret = TRUE;
535  }
536 
537  return ret;
538 }
#define TRUE
Debug level.
Definition: rastertocab.h:30
#define OPT_CAB_FORMFEED_MODE
Definition: cab_options.h:141
#define FALSE
Boolean define used for FALSE.
Definition: rastertocab.h:33
char formfeed[2]
Formfeed Modus: &#39;S&#39; (start), &#39;E&#39; (end), &#39;D&#39; (disabled)
Definition: cab_options.h:210
static immediate_commands_t imm_cmd
Immediate commands.
Definition: cab_options.c:34
#define OPT_CAB_PAUSE_MODE
Definition: cab_options.h:143
char pause[2]
Pause Modus: &#39;S&#39; (start), &#39;D&#39; (disabled)
Definition: cab_options.h:211

◆ get_o_option_cmd()

int get_o_option_cmd ( char *  command)

Definition at line 401 of file cab_options.c.

References o_options_t::backfeed, CAB_LABEL_SENSOR_GAP, CAB_LABEL_SENSOR_REFLEX, o_options_t::ignore_paperend, o_options_t::mirrored, custom_jscript_t::param2, s_options_t::ptype, o_options_t::rotate, o_options_t::tear_off, and TRUE.

Referenced by print_page().

402 {
403  strcpy (command, "O ");
404 
405  strcat(command, o_opt.backfeed);
406 
407  if (o_opt.mirrored == TRUE)
408  strcat(command, ",M");
409 
410  if (o_opt.rotate == TRUE)
411  strcat(command, ",R");
412 
413  if (o_opt.ignore_paperend == TRUE &&
414  ((strncmp(s_opt.ptype, CAB_LABEL_SENSOR_GAP, 2) == 0) ||
415  (strncmp(s_opt.ptype, CAB_LABEL_SENSOR_REFLEX, 2) == 0)))
416  {
417  strcat(command, ",E");
418  }
419 
420  if (o_opt.tear_off == TRUE)
421  strcat(command, ",T");
422 
423  if(custom_jscript.param2[0])
424  strcat(command, custom_jscript.param2);
425 
426  strcat(command, "\r\n");
427 
428  return TRUE;
429 }
#define TRUE
Debug level.
Definition: rastertocab.h:30
int rotate
Rotate the label contents 180 degrees.
Definition: cab_options.h:185
int mirrored
Mirrowed label printing.
Definition: cab_options.h:184
char backfeed[2]
Backfeed Modus: &#39;D&#39; or &#39;P&#39;.
Definition: cab_options.h:187
char param2[CUSTOM_JSCRIPT_PARAM_MAX]
Definition: cab_options.h:217
static o_options_t o_opt
Print options.
Definition: cab_options.c:30
#define CAB_LABEL_SENSOR_REFLEX
Definition: cab_options.h:246
char ptype[4]
Labelsensing mode.
Definition: cab_options.h:259
#define CAB_LABEL_SENSOR_GAP
Definition: cab_options.h:247
int ignore_paperend
Ignore paper end.
Definition: cab_options.h:188
int tear_off
Enables the "tear off mode" ...
Definition: cab_options.h:186
static custom_jscript_t custom_jscript
Definition: cab_options.c:35
static s_options_t s_opt
Label size.
Definition: cab_options.c:26

◆ get_option_image_optimization()

int get_option_image_optimization ( )

Definition at line 777 of file cab_options.c.

References o_options_t::image_optimization.

Referenced by print_raster_image().

778 {
779  return o_opt.image_optimization;
780 }
static o_options_t o_opt
Print options.
Definition: cab_options.c:30
int image_optimization
Definition: cab_options.h:189

◆ get_option_replace()

int get_option_replace ( )

Definition at line 788 of file cab_options.c.

References o_options_t::replace.

Referenced by print_page().

789 {
790  return o_opt.replace;
791 }
static o_options_t o_opt
Print options.
Definition: cab_options.c:30

◆ get_p_option_cmd()

int get_p_option_cmd ( char *  command)
Note
The Peel-off sensor is an optional feature of cab printer. It has to checked, whether the sensor is installed.

Definition at line 259 of file cab_options.c.

References p_options_t::disp, p_options_t::installed, and TRUE.

Referenced by print_page().

259  {
260  if (p_opt.installed == TRUE) {
261  strcpy(command, "P ");
262  strcat(command, p_opt.disp);
263  strcat(command, "\r\n");
264  }
265 
266  return p_opt.installed;
267 }
#define TRUE
Debug level.
Definition: rastertocab.h:30
int installed
Peel-Off is switch on ...
Definition: cab_options.h:197
char disp[5]
Displacement in mm.
Definition: cab_options.h:198
static p_options_t p_opt
Peel-Off mode.
Definition: cab_options.c:28

◆ get_perfo_depth()

void get_perfo_depth ( char *  command)

Assembles the command for the perforation depth (C-Command)

Parameters
*commandString for the result
Returns

Definition at line 468 of file cab_options.c.

References perfo_options_t::depth.

Referenced by print_page().

468  {
469 /* Optional Perforation Option - O Cx -> x:0.0 - 9.9 (10.0) is posible, but not supported. */
470  strcpy(command, "O C");
471  strcat(command, perfo_opt.depth);
472  strcat(command, "\r\n");
473 
474 }
char depth[5]
Additional cutting time factor to influence the perforation.
Definition: cab_options.h:270
static perfo_options_t perfo_opt
Perforation options.
Definition: cab_options.c:32

◆ get_perfo_offset()

void get_perfo_offset ( char *  command)

Assembles the command for the perforation offset (C-Command)

Parameters
*commandString for the result
Returns

Definition at line 447 of file cab_options.c.

References perfo_options_t::disp.

Referenced by print_page().

447  {
448  strcpy(command, "C p,");
449  strcat(command, perfo_opt.disp);
450  strcat(command, "\r\n");
451 }
char disp[5]
Displacement for the first cut.
Definition: cab_options.h:271
static perfo_options_t perfo_opt
Perforation options.
Definition: cab_options.c:32

◆ get_preprint_opt()

int get_preprint_opt ( char *  command)

Assembles the command for the per-print option (C-Command)

Parameters
*commandString for the result
Returns
int TRUE, if for using pre-print options

Definition at line 491 of file cab_options.c.

References CAB_PREPRINT_MODE_CUT, CAB_PREPRINT_MODE_OFF, CAB_PREPRINT_MODE_PERFORATE, preprint_options_t::disp, FALSE, preprint_options_t::mode, and TRUE.

Referenced by print_page().

491  {
492  int ret = FALSE;
493 
494  switch (pp_opt.mode) {
496  strcpy (command, "C s,");
497  strcat(command, pp_opt.disp);
498  strcat(command, "\r\n");
499  ret = TRUE;
500  break;
501 
503  strcpy (command, "C sp,");
504  strcat(command, pp_opt.disp);
505  strcat(command, "\r\n");
506  ret = TRUE;
507  break;
508 
510  break;
511  default:
512  break;
513  }
514  return ret;
515 }
#define TRUE
Debug level.
Definition: rastertocab.h:30
static preprint_options_t pp_opt
Pre-Printing options.
Definition: cab_options.c:33
#define FALSE
Boolean define used for FALSE.
Definition: rastertocab.h:33
int mode
Pre-Print Mode.
Definition: cab_options.h:294
char disp[5]
Displacement for the first action.
Definition: cab_options.h:295
Cut before printing.
Definition: cab_options.h:286
No Pre-Printing action.
Definition: cab_options.h:285
Perforate before printing.
Definition: cab_options.h:287

◆ get_s_option_cmd()

void get_s_option_cmd ( char *  command,
cups_page_header2_t *  header,
double  printwidth 
)

Definition at line 154 of file cab_options.c.

References convPPItomm(), s_options_t::gap, custom_jscript_t::param4, printwidth, s_options_t::ptype, s_options_t::x0, and s_options_t::y0.

Referenced by print_page().

154  {
155  double ho;
156  double dx;
157  double dy;
158  char part1[40];
159  char part2[40];
160 
161  strcpy(command, "S ");
162  strcat(command, s_opt.ptype);
163  sprintf(part1, ";%.2f,%.2f,", s_opt.x0, s_opt.y0);
164  strcat(command, part1);
165 
166  /* Laenge und Breite auslesen und von PPI in mm konvertieren ... */
167  dx = convPPItomm(header->PageSize[0]); /* Breite der Seite auslesen ... */
168  ho = convPPItomm(header->PageSize[1]); /* Laaenge der Seite auslesen ... */
169 
170  /* Breitenkorrektur und Plausibilittsprfung fr die Druckbreite. Dies wurde
171  * notwendig, da der neue Mach4 zentriert arbeitet und somit die automatische
172  * Breitenkorrektur des Drucker ein -falsches- Ergebnis liefert */
173  /* double tdx = (printwidth - s_opt.x0); */
174  if (dx > printwidth) {
175  dx = printwidth;
176  }
177 
178  if (strncmp(s_opt.ptype, "e", 1) == 0) {
179  dy = ho;
180  }
181  else {
182  dy = ho + s_opt.gap;
183  }
184 
185  sprintf(part2, "%.2f,%.2f,%.1f", ho, dy, (dx - s_opt.x0));
186 
187  strcat(command, part2);
188 
189  if(custom_jscript.param4[0])
190  strcat(command, custom_jscript.param4);
191 
192  strcat(command,"\r\n");
193 }
double gap
Gap between two labels.
Definition: cab_options.h:262
char ptype[4]
Labelsensing mode.
Definition: cab_options.h:259
char param4[CUSTOM_JSCRIPT_PARAM_MAX]
Definition: cab_options.h:219
double y0
Vertical displacement.
Definition: cab_options.h:261
static custom_jscript_t custom_jscript
Definition: cab_options.c:35
double x0
Horizontal displacement.
Definition: cab_options.h:260
static double convPPItomm(unsigned int ppi)
Converts the pixels per inch in millimeters.
Definition: cab_options.c:76
static s_options_t s_opt
Label size.
Definition: cab_options.c:26
static double printwidth
Definition: rastertocab.c:34

◆ handleMarkedPPDOptions()

void handleMarkedPPDOptions ( ppd_file_t *  ppd)
Parameters
*ppd
Returns

Definition at line 1254 of file cab_options.c.

References CAB_CUTTER_INTERVAL, CAB_PREPRINT_MODE_OFF, CAB_PREPRINT_MODE_PERFORATE, p_options_t::installed, c_options_t::installed, c_options_t::mode, preprint_options_t::mode, OPT_CAB_BACKFEED_MODE, OPT_CAB_CUTTER, OPT_CAB_CUTTER_INTERVAL, OPT_CAB_CUTTER_MODE, OPT_CAB_CUTTER_OFFS_1DIR, OPT_CAB_CUTTER_OFFS_1NK, OPT_CAB_CUTTER_OFFS_1VK, OPT_CAB_FORMFEED_MODE, OPT_CAB_GLBL_OBJ_OFF_X_DIR, OPT_CAB_GLBL_OBJ_OFF_X_NK, OPT_CAB_GLBL_OBJ_OFF_X_VK, OPT_CAB_GLBL_OBJ_OFF_Y_DIR, OPT_CAB_GLBL_OBJ_OFF_Y_NK, OPT_CAB_GLBL_OBJ_OFF_Y_VK, OPT_CAB_HEAD, OPT_CAB_IGNORE_PAPEREND, OPT_CAB_IMAGE_OPTIMIZATION, OPT_CAB_LABEL_GAP_NK, OPT_CAB_LABEL_GAP_VK, OPT_CAB_LABEL_MIRRORED, OPT_CAB_LABEL_ROTATE, OPT_CAB_LABEL_SENSOR, OPT_CAB_PAUSE_MODE, OPT_CAB_PEEL_OFF, OPT_CAB_PEEL_OFF_DIR, OPT_CAB_PEEL_OFF_NKV, OPT_CAB_PEEL_OFF_VKV, OPT_CAB_PERFO_DIR_OFFSET, OPT_CAB_PERFO_NK_DEPTH, OPT_CAB_PERFO_NK_OFFSET, OPT_CAB_PERFO_VK_DEPTH, OPT_CAB_PERFO_VK_OFFSET, OPT_CAB_PERFORATION_ENABLE, OPT_CAB_PRE_PRINT_DIR_OFFSET, OPT_CAB_PRE_PRINT_MODE, OPT_CAB_PRE_PRINT_NK_OFFSET, OPT_CAB_PRE_PRINT_VK_OFFSET, OPT_CAB_PRN_HEAD_OFF_X_NK, OPT_CAB_PRN_HEAD_OFF_X_VK, OPT_CAB_PRN_HEAD_OFF_Y_DIR, OPT_CAB_PRN_HEAD_OFF_Y_NK, OPT_CAB_PRN_HEAD_OFF_Y_VK, OPT_CAB_PRN_METHOD, OPT_CAB_REPLACE, OPT_CAB_RIBBON_SAVER, OPT_CAB_SPEED, OPT_CAB_TEAR_OFF_MODE, custom_jscript_t::param1, custom_jscript_t::param2, custom_jscript_t::param3, custom_jscript_t::param4, set_BackfeedMode(), set_Cutter(), set_CutterInterval(), set_CutterOffset1(), set_DisplacementX(), set_DisplacementY(), set_GlobalObjectOff(), set_Heat(), set_IgnorePaperend(), set_image_optimization(), set_ImmediateCommand(), set_LabelGap(), set_LabelMirrored(), set_LabelRotate(), set_LabelSensor(), set_PeelOffDisp(), set_PeelOffMode(), set_PerfoDepth(), set_PerfoOffset(), set_Perforation(), set_PrePrintingOffset(), set_PrintMethod(), set_replace(), set_ribbon_saver(), set_Speed(), set_TearOffMode(), setCutterMode(), setPrePrintingMode(), and TRUE.

Referenced by setup_printer().

1254  {
1255  ppd_choice_t *choice;
1256  ppd_choice_t *choice_dir;
1257  ppd_choice_t *choice_vk;
1258  ppd_choice_t *choice_nk;
1259 
1260  /* Setting of the H-option - Heat, speed, printing method */
1261  choice = ppdFindMarkedChoice(ppd, OPT_CAB_HEAD);
1262  set_Heat(choice);
1263 
1264  choice = ppdFindMarkedChoice(ppd, OPT_CAB_PRN_METHOD);
1265  set_PrintMethod(choice);
1266 
1267  choice_dir = ppdFindMarkedChoice(ppd, OPT_CAB_GLBL_OBJ_OFF_X_DIR);
1268  choice_vk = ppdFindMarkedChoice(ppd, OPT_CAB_GLBL_OBJ_OFF_X_VK);
1269  choice_nk = ppdFindMarkedChoice(ppd, OPT_CAB_GLBL_OBJ_OFF_X_NK);
1270  set_GlobalObjectOff(choice_dir, choice_vk, choice_nk);
1271 
1272  choice_dir = ppdFindMarkedChoice(ppd, OPT_CAB_GLBL_OBJ_OFF_Y_DIR);
1273  choice_vk = ppdFindMarkedChoice(ppd, OPT_CAB_GLBL_OBJ_OFF_Y_VK);
1274  choice_nk = ppdFindMarkedChoice(ppd, OPT_CAB_GLBL_OBJ_OFF_Y_NK);
1275  set_GlobalObjectOff(choice_dir, choice_vk, choice_nk);
1276 
1277  choice = ppdFindMarkedChoice(ppd, OPT_CAB_SPEED);
1278  set_Speed(choice);
1279  /* ****** */
1280 
1281 
1282  /* Setting of the O-option - Label mirrored & rotation, Tear Off Mode */
1283  choice = ppdFindMarkedChoice (ppd, OPT_CAB_LABEL_MIRRORED);
1284  set_LabelMirrored(choice);
1285 
1286  choice = ppdFindMarkedChoice (ppd, OPT_CAB_LABEL_ROTATE);
1287  set_LabelRotate(choice);
1288 
1289  choice = ppdFindMarkedChoice (ppd, OPT_CAB_TEAR_OFF_MODE);
1290  set_TearOffMode(choice);
1291 
1292  choice = ppdFindMarkedChoice (ppd, OPT_CAB_BACKFEED_MODE);
1293  set_BackfeedMode(choice);
1294 
1295  choice = ppdFindMarkedChoice (ppd, OPT_CAB_IGNORE_PAPEREND);
1296  set_IgnorePaperend(choice);
1297 
1298  choice = ppdFindMarkedChoice (ppd, OPT_CAB_IMAGE_OPTIMIZATION);
1299  set_image_optimization(choice);
1300 
1301  choice = ppdFindMarkedChoice (ppd, OPT_CAB_REPLACE);
1302  set_replace(choice);
1303 
1304  choice = ppdFindMarkedChoice (ppd, OPT_CAB_RIBBON_SAVER);
1305  set_ribbon_saver(choice);
1306 
1307  /* Setting of the P-option - Peel-Off */
1308  choice = ppdFindMarkedChoice (ppd, OPT_CAB_PEEL_OFF);
1309  set_PeelOffMode(choice);
1310 
1311  if (p_opt.installed == TRUE) {
1312  choice_dir = ppdFindMarkedChoice (ppd, OPT_CAB_PEEL_OFF_DIR);
1313  choice_vk = ppdFindMarkedChoice (ppd, OPT_CAB_PEEL_OFF_VKV);
1314  choice_nk = ppdFindMarkedChoice (ppd, OPT_CAB_PEEL_OFF_NKV);
1315  set_PeelOffDisp (choice_dir, choice_vk, choice_nk);
1316  }
1317  /* ****** */
1318 
1319 
1320  /* Setting of the S-option */
1321  choice = ppdFindMarkedChoice (ppd, OPT_CAB_LABEL_SENSOR);
1322  set_LabelSensor (choice);
1323 
1324  choice_vk = ppdFindMarkedChoice (ppd, OPT_CAB_LABEL_GAP_VK);
1325  choice_nk = ppdFindMarkedChoice (ppd, OPT_CAB_LABEL_GAP_NK);
1326  set_LabelGap(choice_vk, choice_nk);
1327 
1328  choice_vk = ppdFindMarkedChoice (ppd, OPT_CAB_PRN_HEAD_OFF_X_VK);
1329  choice_nk = ppdFindMarkedChoice (ppd, OPT_CAB_PRN_HEAD_OFF_X_NK);
1330  set_DisplacementX(choice_vk, choice_nk);
1331 
1332  choice_dir = ppdFindMarkedChoice (ppd, OPT_CAB_PRN_HEAD_OFF_Y_DIR);
1333  choice_vk = ppdFindMarkedChoice (ppd, OPT_CAB_PRN_HEAD_OFF_Y_VK);
1334  choice_nk = ppdFindMarkedChoice (ppd, OPT_CAB_PRN_HEAD_OFF_Y_NK);
1335  set_DisplacementY(choice_dir, choice_vk, choice_nk);
1336 
1337  /* ****** */
1338 
1339 
1340  /* Setting of the cutter and perforation options */
1341  choice = ppdFindMarkedChoice (ppd, OPT_CAB_CUTTER);
1342  set_Cutter(choice);
1343 
1344  if (c_opt.installed == TRUE) {
1345  choice = ppdFindMarkedChoice (ppd, OPT_CAB_CUTTER_MODE);
1346  setCutterMode (choice);
1347  if (c_opt.mode == CAB_CUTTER_INTERVAL) {
1348  choice = ppdFindMarkedChoice (ppd, OPT_CAB_CUTTER_INTERVAL);
1349  set_CutterInterval(choice);
1350  }
1351 
1352  choice_dir = ppdFindMarkedChoice (ppd, OPT_CAB_CUTTER_OFFS_1DIR);
1353  choice_vk = ppdFindMarkedChoice (ppd, OPT_CAB_CUTTER_OFFS_1VK);
1354  choice_nk = ppdFindMarkedChoice (ppd, OPT_CAB_CUTTER_OFFS_1NK);
1355  set_CutterOffset1(choice_dir, choice_vk, choice_nk);
1356  }
1357 
1358  /* Set perforation and perforation depth */
1359  choice = ppdFindMarkedChoice(ppd, OPT_CAB_PERFORATION_ENABLE);
1360  if (set_Perforation(choice) == TRUE) {
1361  choice_vk = ppdFindMarkedChoice (ppd, OPT_CAB_PERFO_VK_DEPTH);
1362  choice_nk = ppdFindMarkedChoice (ppd, OPT_CAB_PERFO_NK_DEPTH);
1363  set_PerfoDepth(choice_vk, choice_nk);
1364 
1365  choice_dir = ppdFindMarkedChoice (ppd, OPT_CAB_PERFO_DIR_OFFSET);
1366  choice_vk = ppdFindMarkedChoice (ppd, OPT_CAB_PERFO_VK_OFFSET);
1367  choice_nk = ppdFindMarkedChoice (ppd, OPT_CAB_PERFO_NK_OFFSET);
1368  set_PerfoOffset(choice_dir, choice_vk, choice_nk);
1369  }
1370 
1371  /* Pre-Print Mode */
1372  choice = ppdFindMarkedChoice (ppd, OPT_CAB_PRE_PRINT_MODE);
1373  setPrePrintingMode(choice);
1374 
1376  /* Pre-Print Offset */
1377  choice_dir = ppdFindMarkedChoice (ppd, OPT_CAB_PRE_PRINT_DIR_OFFSET);
1378  choice_vk = ppdFindMarkedChoice (ppd, OPT_CAB_PRE_PRINT_VK_OFFSET);
1379  choice_nk = ppdFindMarkedChoice (ppd, OPT_CAB_PRE_PRINT_NK_OFFSET);
1380  set_PrePrintingOffset(choice_dir, choice_vk, choice_nk);
1381  }
1383  choice_vk = ppdFindMarkedChoice (ppd, OPT_CAB_PERFO_VK_DEPTH);
1384  choice_nk = ppdFindMarkedChoice (ppd, OPT_CAB_PERFO_NK_DEPTH);
1385  set_PerfoDepth(choice_vk, choice_nk);
1386  }
1387 
1388  /* Immediate commands */
1389  /* Formfeed */
1390  choice = ppdFindMarkedChoice (ppd, OPT_CAB_FORMFEED_MODE);
1391  set_ImmediateCommand(choice);
1392  /* Pause */
1393  choice = ppdFindMarkedChoice (ppd, OPT_CAB_PAUSE_MODE);
1394  set_ImmediateCommand(choice);
1395 
1396  custom_jscript.param1[0] = 0;
1397  custom_jscript.param2[0] = 0;
1398  custom_jscript.param3[0] = 0;
1399  custom_jscript.param4[0] = 0;
1400 
1401 }
#define OPT_CAB_HEAD
Definition: cab_options.h:26
static void set_CutterInterval(ppd_choice_t *choice)
Extracts the cutter interval.
Definition: cab_options.c:1038
static void set_image_optimization(ppd_choice_t *choice)
Definition: cab_options.c:772
#define OPT_CAB_LABEL_ROTATE
Definition: cab_options.h:42
#define OPT_CAB_PRN_HEAD_OFF_X_VK
Definition: cab_options.h:48
#define OPT_CAB_LABEL_SENSOR
Definition: cab_options.h:34
static void setCutterMode(ppd_choice_t *choice)
Extracts the cutter mode.
Definition: cab_options.c:1008
#define OPT_CAB_PRN_HEAD_OFF_X_NK
Definition: cab_options.h:50
static int set_Perforation(ppd_choice_t *choice)
Handles the perforation cutter installation option.
Definition: cab_options.c:1087
#define TRUE
Debug level.
Definition: rastertocab.h:30
#define OPT_CAB_GLBL_OBJ_OFF_Y_DIR
Definition: cab_options.h:68
char param1[CUSTOM_JSCRIPT_PARAM_MAX]
Definition: cab_options.h:216
#define OPT_CAB_PRE_PRINT_DIR_OFFSET
Definition: cab_options.h:99
static preprint_options_t pp_opt
Pre-Printing options.
Definition: cab_options.c:33
int mode
Cutting mode: Job start/end or amount of labels.
Definition: cab_options.h:236
char param2[CUSTOM_JSCRIPT_PARAM_MAX]
Definition: cab_options.h:217
#define OPT_CAB_PERFO_VK_DEPTH
Definition: cab_options.h:118
static void set_LabelRotate(ppd_choice_t *choice)
Extracts, whether the label should be rotated.
Definition: cab_options.c:644
#define OPT_CAB_PRN_HEAD_OFF_Y_NK
Definition: cab_options.h:58
#define OPT_CAB_IMAGE_OPTIMIZATION
Definition: cab_options.h:146
#define OPT_CAB_PERFO_VK_OFFSET
Definition: cab_options.h:113
static void set_DisplacementX(ppd_choice_t *choice_vk, ppd_choice_t *choice_nk)
Extracts the label offset for x-direction.
Definition: cab_options.c:908
#define OPT_CAB_IGNORE_PAPEREND
Definition: cab_options.h:44
#define OPT_CAB_FORMFEED_MODE
Definition: cab_options.h:141
static c_options_t c_opt
Cutter parameters.
Definition: cab_options.c:27
#define OPT_CAB_PRE_PRINT_NK_OFFSET
Definition: cab_options.h:103
#define OPT_CAB_PRE_PRINT_VK_OFFSET
Definition: cab_options.h:101
#define OPT_CAB_CUTTER_MODE
Definition: cab_options.h:83
#define OPT_CAB_LABEL_GAP_VK
Definition: cab_options.h:36
#define OPT_CAB_RIBBON_SAVER
Definition: cab_options.h:122
#define OPT_CAB_BACKFEED_MODE
Definition: cab_options.h:139
#define OPT_CAB_GLBL_OBJ_OFF_X_VK
Definition: cab_options.h:63
#define OPT_CAB_CUTTER_OFFS_1DIR
Definition: cab_options.h:87
static int setPrePrintingMode(ppd_choice_t *choice)
Extracts the pre-printing mode.
Definition: cab_options.c:1164
#define OPT_CAB_TEAR_OFF_MODE
Definition: cab_options.h:77
#define OPT_CAB_LABEL_GAP_NK
Definition: cab_options.h:38
#define OPT_CAB_PRN_METHOD
Definition: cab_options.h:28
int mode
Pre-Print Mode.
Definition: cab_options.h:294
static void set_Heat(ppd_choice_t *choice)
Extracts the heat options.
Definition: cab_options.c:555
static void set_Speed(ppd_choice_t *choice)
Extracts the printing speed setting.
Definition: cab_options.c:599
#define OPT_CAB_CUTTER
Definition: cab_options.h:81
int installed
Peel-Off is switch on ...
Definition: cab_options.h:197
#define OPT_CAB_GLBL_OBJ_OFF_X_DIR
Definition: cab_options.h:61
static void set_LabelGap(ppd_choice_t *choice_vk, ppd_choice_t *choice_nk)
Assembles the gap between labels.
Definition: cab_options.c:960
#define OPT_CAB_PEEL_OFF_VKV
Definition: cab_options.h:132
#define OPT_CAB_PERFO_NK_OFFSET
Definition: cab_options.h:115
#define OPT_CAB_CUTTER_OFFS_1NK
Definition: cab_options.h:91
#define OPT_CAB_PEEL_OFF
Definition: cab_options.h:127
#define OPT_CAB_SPEED
Definition: cab_options.h:30
#define OPT_CAB_PRN_HEAD_OFF_Y_DIR
Definition: cab_options.h:54
static void set_PeelOffDisp(ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk)
Assembles and extract the peel-off displacement.
Definition: cab_options.c:822
#define OPT_CAB_PEEL_OFF_DIR
Definition: cab_options.h:130
char param3[CUSTOM_JSCRIPT_PARAM_MAX]
Definition: cab_options.h:218
#define OPT_CAB_PERFO_DIR_OFFSET
Definition: cab_options.h:111
static void set_PrePrintingOffset(ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk)
Assembles the pre-printing displacement.
Definition: cab_options.c:1195
static void set_GlobalObjectOff(ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk)
Assembles and extract the global offset displacement.
Definition: cab_options.c:1219
char param4[CUSTOM_JSCRIPT_PARAM_MAX]
Definition: cab_options.h:219
static void set_ImmediateCommand(ppd_choice_t *choice)
Handles the immediate commands.
Definition: cab_options.c:721
#define OPT_CAB_PERFO_NK_DEPTH
Definition: cab_options.h:120
static void set_DisplacementY(ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk)
Extracts the label offset for y-direction Format: "dir|vk.nk".
Definition: cab_options.c:934
static void set_PerfoDepth(ppd_choice_t *choice_vk, ppd_choice_t *choice_nk)
Assembles the perforation depth factor.
Definition: cab_options.c:1114
static void set_TearOffMode(ppd_choice_t *choice)
Handles the rotation of a label.
Definition: cab_options.c:669
#define OPT_CAB_CUTTER_OFFS_1VK
Definition: cab_options.h:89
static void set_PerfoOffset(ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk)
Assembles the perforation displacement.
Definition: cab_options.c:1138
#define OPT_CAB_PEEL_OFF_NKV
Definition: cab_options.h:134
static void set_BackfeedMode(ppd_choice_t *choice)
Handles the backfeed mode setting.
Definition: cab_options.c:694
static void set_PrintMethod(ppd_choice_t *choice)
Handles the setting for the printing method.
Definition: cab_options.c:575
#define OPT_CAB_GLBL_OBJ_OFF_Y_VK
Definition: cab_options.h:70
No Pre-Printing action.
Definition: cab_options.h:285
#define OPT_CAB_PRE_PRINT_MODE
Definition: cab_options.h:96
#define OPT_CAB_GLBL_OBJ_OFF_Y_NK
Definition: cab_options.h:72
#define OPT_CAB_REPLACE
Definition: cab_options.h:149
#define OPT_CAB_PAUSE_MODE
Definition: cab_options.h:143
static custom_jscript_t custom_jscript
Definition: cab_options.c:35
static p_options_t p_opt
Peel-Off mode.
Definition: cab_options.c:28
#define OPT_CAB_PRN_HEAD_OFF_Y_VK
Definition: cab_options.h:56
#define OPT_CAB_CUTTER_INTERVAL
Definition: cab_options.h:85
static void set_Cutter(ppd_choice_t *choice)
Handles the cutter installation option.
Definition: cab_options.c:983
#define OPT_CAB_GLBL_OBJ_OFF_X_NK
Definition: cab_options.h:65
int installed
Flag, set to TRUE (1) if a cutter is installed.
Definition: cab_options.h:235
static void set_PeelOffMode(ppd_choice_t *choice)
Checks whether the peel-off sensor is marked as installed.
Definition: cab_options.c:851
static void set_CutterOffset1(ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk)
Assembles the cutting displacement.
Definition: cab_options.c:1060
static void set_ribbon_saver(ppd_choice_t *choice)
Definition: cab_options.c:794
static void set_replace(ppd_choice_t *choice)
Definition: cab_options.c:783
static void set_LabelMirrored(ppd_choice_t *choice)
Handles whether the label should be mirrored.
Definition: cab_options.c:619
#define OPT_CAB_LABEL_MIRRORED
Definition: cab_options.h:40
Perforate before printing.
Definition: cab_options.h:287
#define OPT_CAB_PERFORATION_ENABLE
Definition: cab_options.h:108
static void set_LabelSensor(ppd_choice_t *choice)
Extract the kind of label sensor mode to be used.
Definition: cab_options.c:876
static void set_IgnorePaperend(ppd_choice_t *choice)
Handles the &#39;ignore paperend&#39; setting.
Definition: cab_options.c:762
Cut after a certain amount of x labels.
Definition: cab_options.h:165

◆ isPerfoCutterInstalled()

int isPerfoCutterInstalled ( )

Return, wether a perforation cutter is installed.

Parameters
&mdash;
Returns
TRUE, if a perforation cutter is installed and activated

Definition at line 347 of file cab_options.c.

References perfo_options_t::installed.

Referenced by print_page().

347  {
348  return perfo_opt.installed;
349 }
int installed
Flag, set to TRUE (1) if a perforation cutter is installed.
Definition: cab_options.h:269
static perfo_options_t perfo_opt
Perforation options.
Definition: cab_options.c:32

◆ isPrePrintPerforate()

int isPrePrintPerforate ( )

Return, wether the pre-print option is set to 'Perforate'.

Parameters
&mdash;
Returns
TRUE, if the pre-print option is 'Perforate'

Definition at line 364 of file cab_options.c.

References CAB_PREPRINT_MODE_PERFORATE, and preprint_options_t::mode.

Referenced by print_page().

364  {
366 }
static preprint_options_t pp_opt
Pre-Printing options.
Definition: cab_options.c:33
int mode
Pre-Print Mode.
Definition: cab_options.h:294
Perforate before printing.
Definition: cab_options.h:287

◆ isRibbonSaveSelected()

int isRibbonSaveSelected ( )

Return, wether the RibbonSave is active.

Parameters
&mdash;
Returns
TRUE, if RibbonSave is active

Definition at line 381 of file cab_options.c.

References h_options_t::ribbon_saver.

Referenced by print_raster_image().

381  {
382  return h_opt.ribbon_saver;
383 }
int ribbon_saver
Definition: cab_options.h:178
static h_options_t h_opt
Printing parameters.
Definition: cab_options.c:29