cab CUPS Treiber
---
|
#include <cups/cups.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "rastertocab.h"
#include "cab_options.h"
Go to the source code of this file.
Functions | |
static void | calcNumberOpt (char *res, char *vk, char *nk) |
Puts two strings to a number together. More... | |
static double | convPPItomm (unsigned int ppi) |
Converts the pixels per inch in millimeters. More... | |
static int | replace_string_section (char *buffer, const char *search, const char *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_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... | |
int | get_o_option_cmd (char *command) |
void | get_perfo_offset (char *command) |
Assembles the command for the perforation offset (C-Command) More... | |
void | get_perfo_depth (char *command) |
Assembles the command for the perforation depth (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) |
static void | set_Heat (ppd_choice_t *choice) |
Extracts the heat options. More... | |
static void | set_PrintMethod (ppd_choice_t *choice) |
Handles the setting for the printing method. More... | |
static void | set_Speed (ppd_choice_t *choice) |
Extracts the printing speed setting. More... | |
static void | set_LabelMirrored (ppd_choice_t *choice) |
Handles whether the label should be mirrored. More... | |
static void | set_LabelRotate (ppd_choice_t *choice) |
Extracts, whether the label should be rotated. More... | |
static void | set_TearOffMode (ppd_choice_t *choice) |
Handles the rotation of a label. More... | |
static void | set_BackfeedMode (ppd_choice_t *choice) |
Handles the backfeed mode setting. More... | |
static void | set_ImmediateCommand (ppd_choice_t *choice) |
Handles the immediate commands. More... | |
static void | set_IgnorePaperend (ppd_choice_t *choice) |
Handles the 'ignore paperend' setting. More... | |
static void | set_image_optimization (ppd_choice_t *choice) |
int | get_option_image_optimization () |
static void | set_replace (ppd_choice_t *choice) |
int | get_option_replace () |
static void | set_ribbon_saver (ppd_choice_t *choice) |
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. More... | |
static void | set_PeelOffMode (ppd_choice_t *choice) |
Checks whether the peel-off sensor is marked as installed. More... | |
static void | set_LabelSensor (ppd_choice_t *choice) |
Extract the kind of label sensor mode to be used. More... | |
static void | set_DisplacementX (ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) |
Extracts the label offset for x-direction. More... | |
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". More... | |
static void | set_LabelGap (ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) |
Assembles the gap between labels. More... | |
static void | set_Cutter (ppd_choice_t *choice) |
Handles the cutter installation option. More... | |
static void | setCutterMode (ppd_choice_t *choice) |
Extracts the cutter mode. More... | |
static void | set_CutterInterval (ppd_choice_t *choice) |
Extracts the cutter interval. More... | |
static void | set_CutterOffset1 (ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) |
Assembles the cutting displacement. More... | |
static int | set_Perforation (ppd_choice_t *choice) |
Handles the perforation cutter installation option. More... | |
static void | set_PerfoDepth (ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) |
Assembles the perforation depth factor. More... | |
static void | set_PerfoOffset (ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) |
Assembles the perforation displacement. More... | |
static int | setPrePrintingMode (ppd_choice_t *choice) |
Extracts the pre-printing mode. More... | |
static void | set_PrePrintingOffset (ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) |
Assembles the pre-printing displacement. More... | |
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. More... | |
void | handleMarkedPPDOptions (ppd_file_t *ppd) |
Variables | |
static s_options_t | s_opt |
Label size. More... | |
static c_options_t | c_opt |
Cutter parameters. More... | |
static p_options_t | p_opt |
Peel-Off mode. More... | |
static h_options_t | h_opt |
Printing parameters. More... | |
static o_options_t | o_opt |
Print options. More... | |
static d_options_t | d_opt |
Global object offset. More... | |
static perfo_options_t | perfo_opt |
Perforation options. More... | |
static preprint_options_t | pp_opt |
Pre-Printing options. More... | |
static immediate_commands_t | imm_cmd |
Immediate commands. More... | |
static custom_jscript_t | custom_jscript |
|
static |
Puts two strings to a number together.
*res | String with the result Format: "vk.nk" ... |
*vk | String (vk: 1) |
*nk | String (nk: 1/10) |
Definition at line 54 of file cab_options.c.
Referenced by set_CutterOffset1(), set_GlobalObjectOff(), set_LabelGap(), set_PeelOffDisp(), set_PerfoDepth(), set_PerfoOffset(), and set_PrePrintingOffset().
|
static |
Converts the pixels per inch in millimeters.
ppi | Resolution in ppi |
Definition at line 76 of file cab_options.c.
Referenced by get_s_option_cmd().
int get_c_option_cmd | ( | char * | command | ) |
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().
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().
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().
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().
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().
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().
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().
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().
int get_option_replace | ( | ) |
Definition at line 788 of file cab_options.c.
References o_options_t::replace.
Referenced by print_page().
int get_p_option_cmd | ( | char * | command | ) |
Definition at line 259 of file cab_options.c.
References p_options_t::disp, p_options_t::installed, and TRUE.
Referenced by print_page().
static void get_perfo_depth | ( | char * | command | ) |
Assembles the command for the perforation depth (C-Command)
*command | String for the result |
Definition at line 468 of file cab_options.c.
References perfo_options_t::depth.
Referenced by print_page().
static void get_perfo_offset | ( | char * | command | ) |
Assembles the command for the perforation offset (C-Command)
*command | String for the result |
Definition at line 447 of file cab_options.c.
References perfo_options_t::disp.
Referenced by print_page().
static void get_preprint_opt | ( | char * | command | ) |
Assembles the command for the per-print option (C-Command)
*command | String for the result |
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().
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().
void handleMarkedPPDOptions | ( | ppd_file_t * | ppd | ) |
*ppd |
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().
int isPerfoCutterInstalled | ( | ) |
Return, wether a perforation cutter is installed.
— |
Definition at line 347 of file cab_options.c.
References perfo_options_t::installed.
Referenced by print_page().
int isPrePrintPerforate | ( | ) |
Return, wether the pre-print option is set to 'Perforate'.
— |
Definition at line 364 of file cab_options.c.
References CAB_PREPRINT_MODE_PERFORATE, and preprint_options_t::mode.
Referenced by print_page().
int isRibbonSaveSelected | ( | ) |
Return, wether the RibbonSave is active.
— |
Definition at line 381 of file cab_options.c.
References h_options_t::ribbon_saver.
Referenced by print_raster_image().
|
static |
Definition at line 83 of file cab_options.c.
References CUSTOM_JSCRIPT_PARAM_MAX, FALSE, and TRUE.
Referenced by get_custom_jscript1_cmd(), and get_custom_jscript3_cmd().
|
static |
Handles the backfeed mode setting.
*choice | Choice for the backfeed mode |
Definition at line 694 of file cab_options.c.
References o_options_t::backfeed.
Referenced by handleMarkedPPDOptions().
|
static |
Handles the cutter installation option.
*choice |
Definition at line 983 of file cab_options.c.
References FALSE, c_options_t::installed, and TRUE.
Referenced by handleMarkedPPDOptions().
|
static |
Extracts the cutter interval.
*choice | Choice for the cutter interval |
Sets the amount of printed labels after a cut will be performed
Definition at line 1038 of file cab_options.c.
References c_options_t::amount.
Referenced by handleMarkedPPDOptions().
|
static |
Assembles the cutting displacement.
Format: "dir|vk.nk"
*choice_dir | Choice for the direction of the cutting displacement |
*choice_vk | Choice for the cutting displacement (vk:1) |
*choice_nk | Choice for the cutting displacement (nk:1/10) |
Definition at line 1060 of file cab_options.c.
References calcNumberOpt(), and c_options_t::disp1.
Referenced by handleMarkedPPDOptions().
|
static |
Extracts the label offset for x-direction.
Format: "vk.nk"
*choice_vk | Choice for the x-offset (vk: 1) |
*choice_nk | Choice the the x-offset (nk: 1/10) |
Definition at line 908 of file cab_options.c.
References s_options_t::x0.
Referenced by handleMarkedPPDOptions().
|
static |
Extracts the label offset for y-direction Format: "dir|vk.nk".
*choice_dir | Choice for the y-offset direction |
*choice_vk | Choice for the y-offset (vk: 1) |
*choice_nk | Choice the the y-offset (nk: 1/10) |
Definition at line 934 of file cab_options.c.
References s_options_t::y0.
Referenced by handleMarkedPPDOptions().
|
static |
Assembles and extract the global offset displacement.
Format: "dir|vk.nk"
*choice_dir | Choice for the global offset direction |
*choice_vk | Choice for the global offset displacement (vk: 1) |
*choice_nk | Choice for the global offset displacement (nk: 1/10) |
Definition at line 1219 of file cab_options.c.
References calcNumberOpt(), d_options_t::dispx, and d_options_t::dispy.
Referenced by handleMarkedPPDOptions().
|
static |
Extracts the heat options.
*choice | Choice for the heat option |
Definition at line 555 of file cab_options.c.
References h_options_t::heat.
Referenced by handleMarkedPPDOptions().
|
static |
Handles the 'ignore paperend' setting.
*choice | Choice for the 'ignore paperend' setting |
Definition at line 762 of file cab_options.c.
References FALSE, o_options_t::ignore_paperend, and TRUE.
Referenced by handleMarkedPPDOptions().
|
static |
Definition at line 772 of file cab_options.c.
References FALSE, o_options_t::image_optimization, and TRUE.
Referenced by handleMarkedPPDOptions().
|
static |
Handles the immediate commands.
*choice | Choice for the immediate command |
Definition at line 721 of file cab_options.c.
References immediate_commands_t::formfeed, and immediate_commands_t::pause.
Referenced by handleMarkedPPDOptions().
|
static |
Assembles the gap between labels.
Format: "vk.nk"
*choice_vk | Choice for the label gap (vk: 1) |
*choice_nk | Choice for the label gap (nk: 1/10) |
Definition at line 960 of file cab_options.c.
References calcNumberOpt(), and s_options_t::gap.
Referenced by handleMarkedPPDOptions().
|
static |
Handles whether the label should be mirrored.
*choice | Choice for mirroring the label |
Definition at line 619 of file cab_options.c.
References FALSE, o_options_t::mirrored, and TRUE.
Referenced by handleMarkedPPDOptions().
|
static |
Extracts, whether the label should be rotated.
*choice | Choice for the rotation of the label |
Definition at line 644 of file cab_options.c.
References FALSE, o_options_t::rotate, and TRUE.
Referenced by handleMarkedPPDOptions().
|
static |
Extract the kind of label sensor mode to be used.
*choice | Choice for the label sensor |
Definition at line 876 of file cab_options.c.
References CAB_LABEL_SENSOR_ENDLESS, CAB_LABEL_SENSOR_ERROR, CAB_LABEL_SENSOR_GAP, CAB_LABEL_SENSOR_REFLEX, and s_options_t::ptype.
Referenced by handleMarkedPPDOptions().
|
static |
Assembles and extract the peel-off displacement.
Format: "dir|vk.nk"
*choice_dir | Choice for the peel-off direction |
*choice_vk | Choice for the peel-off displacement (vk: 1) |
*choice_nk | Choice for the peel-off displacement (nk: 1/10) |
Definition at line 822 of file cab_options.c.
References calcNumberOpt(), and p_options_t::disp.
Referenced by handleMarkedPPDOptions().
|
static |
Checks whether the peel-off sensor is marked as installed.
*choice | Choice for the peel-off sensor installation |
Definition at line 851 of file cab_options.c.
References FALSE, p_options_t::installed, and TRUE.
Referenced by handleMarkedPPDOptions().
|
static |
Assembles the perforation depth factor.
Format: "vk.nk".
*choice_vk | Choice for the perforation depth (vk:1) |
*choice_nk | Choice for the perforation depth (nk:1/10) |
Definition at line 1114 of file cab_options.c.
References calcNumberOpt(), and perfo_options_t::depth.
Referenced by handleMarkedPPDOptions().
|
static |
Assembles the perforation displacement.
Format: "dir|vk.nk".
*choice_dir | Choice for the direction of the perforation displacement |
*choice_vk | Choice for the perforation displacement (vk:1) |
*choice_nk | Choice for the perforation displacement (nk:1/10) |
Definition at line 1138 of file cab_options.c.
References calcNumberOpt(), and perfo_options_t::disp.
Referenced by handleMarkedPPDOptions().
|
static |
Handles the perforation cutter installation option.
*choice |
Definition at line 1087 of file cab_options.c.
References FALSE, perfo_options_t::installed, and TRUE.
Referenced by handleMarkedPPDOptions().
|
static |
Assembles the pre-printing displacement.
Format: "dir|vk.nk - Used for all modes."
*choice_dir | Choice for the direction of the pre-printing displacement |
*choice_vk | Choice for the pre-printing displacement (vk:1) |
*choice_nk | Choice for the pre-printing displacement (nk:1/10) |
Definition at line 1195 of file cab_options.c.
References calcNumberOpt(), and preprint_options_t::disp.
Referenced by handleMarkedPPDOptions().
|
static |
Handles the setting for the printing method.
*choice | Choice for the printing method |
Definition at line 575 of file cab_options.c.
References h_options_t::type.
Referenced by handleMarkedPPDOptions().
|
static |
Definition at line 783 of file cab_options.c.
References FALSE, o_options_t::replace, and TRUE.
Referenced by handleMarkedPPDOptions().
|
static |
Definition at line 794 of file cab_options.c.
References FALSE, h_options_t::ribbon_saver, and TRUE.
Referenced by handleMarkedPPDOptions().
|
static |
Extracts the printing speed setting.
*choice | Choice for the printing speed setting |
Definition at line 599 of file cab_options.c.
References h_options_t::speed.
Referenced by handleMarkedPPDOptions().
|
static |
Handles the rotation of a label.
*choice | Choice for rotating the label |
Definition at line 669 of file cab_options.c.
References FALSE, o_options_t::tear_off, and TRUE.
Referenced by handleMarkedPPDOptions().
|
static |
Extracts the cutter mode.
*choice | Choice for the cutter mode |
Definition at line 1008 of file cab_options.c.
References CAB_CUTTER_END_JOB, CAB_CUTTER_INTERVAL, CAB_CUTTER_MODE_EOJ_CHOICE, CAB_CUTTER_MODE_ERR, CAB_CUTTER_MODE_EXL_CHOICE, and c_options_t::mode.
Referenced by handleMarkedPPDOptions().
|
static |
Extracts the pre-printing mode.
*choice | Choice for the pre-printing mode |
Definition at line 1164 of file cab_options.c.
References CAB_PREPRINT_MODE_CUT, CAB_PREPRINT_MODE_CUT_CHOICE, CAB_PREPRINT_MODE_OFF, CAB_PREPRINT_MODE_OFF_CHOICE, CAB_PREPRINT_MODE_PERFO_CHOICE, CAB_PREPRINT_MODE_PERFORATE, and preprint_options_t::mode.
Referenced by handleMarkedPPDOptions().
|
static |
Cutter parameters.
Definition at line 27 of file cab_options.c.
|
static |
Definition at line 35 of file cab_options.c.
|
static |
Global object offset.
Definition at line 31 of file cab_options.c.
|
static |
Printing parameters.
Definition at line 29 of file cab_options.c.
|
static |
Immediate commands.
Definition at line 34 of file cab_options.c.
|
static |
Print options.
Definition at line 30 of file cab_options.c.
|
static |
Peel-Off mode.
Definition at line 28 of file cab_options.c.
|
static |
Perforation options.
Definition at line 32 of file cab_options.c.
|
static |
Pre-Printing options.
Definition at line 33 of file cab_options.c.
|
static |
Label size.
Definition at line 26 of file cab_options.c.