cab CUPS Treiber  ---
cab_options.c
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.c
6  * - Implementation of cab specific and supporting functions
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 #include <cups/cups.h>
18 
19 #include <stdlib.h>
20 #include <stdio.h>
21 #include <string.h>
22 
23 #include "rastertocab.h"
24 #include "cab_options.h"
25 
36 
37 
38 /*****************************************************************************/
39 /*---------------------------------------------------------------------------*/
50 /*---------------------------------------------------------------------------*/
52 /* */
53 /*---------------------------------------------------------------------------*/
54 static void calcNumberOpt(char *res, char *vk, char *nk) {
55  strcpy(res, vk);
56  strcat(res, ".");
57  strcat(res, nk);
58 }
59 
60 
61 
62 /*****************************************************************************/
63 /*---------------------------------------------------------------------------*/
72 /*---------------------------------------------------------------------------*/
73 /* Note: */
74 /* */
75 /*---------------------------------------------------------------------------*/
76 static double convPPItomm (unsigned int ppi) {
77  double res;
78  res = (ppi / 72.0) * 25.4;
79  return res;
80 }
81 
82 
83 static int replace_string_section(char *buffer, const char *search, const char *replace)
84 {
85  int bufferlen, searchlen, is_located, i;
86  char temp[CUSTOM_JSCRIPT_PARAM_MAX];
87 
88  bufferlen = strlen(buffer);
89  searchlen = strlen(search);
90  is_located = FALSE;
91 
92  for(i = 0; i < (bufferlen - searchlen); i++)
93  {
94  if(!strncmp(&buffer[i], search, searchlen))
95  {
96  strncpy(temp, &buffer[i+searchlen], CUSTOM_JSCRIPT_PARAM_MAX);
97  sprintf(&buffer[i], "%s%s", replace, temp);
98  bufferlen = strlen(buffer);
99  is_located = TRUE;
100  }
101  }
102  return is_located;
103 }
104 
105 
106 int get_custom_jscript1_cmd(char *command, int 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 }
120 
121 
122 int get_custom_jscript3_cmd(char *command)
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 }
136 
137 
138 /*****************************************************************************/
139 /*---------------------------------------------------------------------------*/
150 /*---------------------------------------------------------------------------*/
151 /* Note: */
152 /* */
153 /*---------------------------------------------------------------------------*/
154 void get_s_option_cmd (char *command, cups_page_header2_t *header, double printwidth) {
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 }
194 
195 
196 
197 /*****************************************************************************/
198 /*---------------------------------------------------------------------------*/
207 /*---------------------------------------------------------------------------*/
211 /* Note: */
212 /* */
213 /*---------------------------------------------------------------------------*/
214 int get_c_option_cmd (char *command) {
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 }
240 
241 
242 
243 /*****************************************************************************/
244 /*---------------------------------------------------------------------------*/
253 /*---------------------------------------------------------------------------*/
257 /* */
258 /*---------------------------------------------------------------------------*/
259 int get_p_option_cmd (char *command) {
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 }
268 
269 
270 
271 /*****************************************************************************/
272 /*---------------------------------------------------------------------------*/
282 /*---------------------------------------------------------------------------*/
283 /* Note: */
284 /* */
285 /*---------------------------------------------------------------------------*/
286 void get_h_option_cmd (char *command) {
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 }
299 
300 
301 /*****************************************************************************/
302 /*---------------------------------------------------------------------------*/
311 /*---------------------------------------------------------------------------*/
312 /* Note: */
313 /* */
314 /*---------------------------------------------------------------------------*/
315 int get_d_option_cmd (char *command) {
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 }
332 
333 
334 /*****************************************************************************/
335 /*---------------------------------------------------------------------------*/
343 /*---------------------------------------------------------------------------*/
344 /* Note: */
345 /* */
346 /*---------------------------------------------------------------------------*/
348  return perfo_opt.installed;
349 }
350 
351 /*****************************************************************************/
352 /*---------------------------------------------------------------------------*/
360 /*---------------------------------------------------------------------------*/
361 /* Note: */
362 /* */
363 /*---------------------------------------------------------------------------*/
365  return pp_opt.mode==CAB_PREPRINT_MODE_PERFORATE;
366 }
367 
368 /*****************************************************************************/
369 /*---------------------------------------------------------------------------*/
377 /*---------------------------------------------------------------------------*/
378 /* Note: */
379 /* */
380 /*---------------------------------------------------------------------------*/
382  return h_opt.ribbon_saver;
383 }
384 
385 /*****************************************************************************/
386 /*---------------------------------------------------------------------------*/
397 /*---------------------------------------------------------------------------*/
398 /* Note: */
399 /* */
400 /*---------------------------------------------------------------------------*/
401 int get_o_option_cmd (char *command)
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 }
430 
431 
432 
433 /*****************************************************************************/
434 /*---------------------------------------------------------------------------*/
443 /*---------------------------------------------------------------------------*/
444 /* Note: */
445 /* */
446 /*---------------------------------------------------------------------------*/
447 void get_perfo_offset(char *command) {
448  strcpy(command, "C p,");
449  strcat(command, perfo_opt.disp);
450  strcat(command, "\r\n");
451 }
452 
453 
454 /*****************************************************************************/
455 /*---------------------------------------------------------------------------*/
464 /*---------------------------------------------------------------------------*/
465 /* Note: */
466 /* */
467 /*---------------------------------------------------------------------------*/
468 void get_perfo_depth(char *command) {
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 }
475 
476 
477 /*****************************************************************************/
478 /*---------------------------------------------------------------------------*/
487 /*---------------------------------------------------------------------------*/
488 /* Note: */
489 /* */
490 /*---------------------------------------------------------------------------*/
491 int get_preprint_opt(char *command) {
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 }
516 
517 int get_immediate_cmd(char *command, const char* type, const char value) {
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 }
539 
540 
541 /*****************************************************************************/
542 /*---------------------------------------------------------------------------*/
551 /*---------------------------------------------------------------------------*/
552 /* Note: */
553 /* */
554 /*---------------------------------------------------------------------------*/
555 static void set_Heat (ppd_choice_t *choice) {
556  strcpy(h_opt.heat, choice->text);
557 }
558 
559 
560 
561 /*****************************************************************************/
562 /*---------------------------------------------------------------------------*/
571 /*---------------------------------------------------------------------------*/
572 /* Note: */
573 /* */
574 /*---------------------------------------------------------------------------*/
575 static void set_PrintMethod (ppd_choice_t *choice) {
576  if (choice != NULL && (strcmp(choice->choice, "True") == 0 || strcmp(choice->choice, "true") == 0)) {
577  strcpy(h_opt.type, "T"); /* Thermotransfer ... */
578  } else {
579  strcpy(h_opt.type, "D"); /* Thermodirekt ... */
580  }
581 }
582 
583 
584 
585 /*****************************************************************************/
586 /*---------------------------------------------------------------------------*/
595 /*---------------------------------------------------------------------------*/
596 /* Note: */
597 /* */
598 /*---------------------------------------------------------------------------*/
599 static void set_Speed (ppd_choice_t *choice) {
600  strcpy(h_opt.speed, choice->text);
601 }
602 
603 
604 
605 /*****************************************************************************/
606 /*---------------------------------------------------------------------------*/
615 /*---------------------------------------------------------------------------*/
616 /* Note: */
617 /* */
618 /*---------------------------------------------------------------------------*/
619 static void set_LabelMirrored (ppd_choice_t *choice) {
620  if (choice != NULL && (strcmp(choice->choice, "True") == 0 || strcmp(choice->choice, "true") == 0)) {
621  o_opt.mirrored = TRUE;
622  }
623  else {
624  o_opt.mirrored = FALSE;
625  }
626 }
627 
628 
629 
630 /*****************************************************************************/
631 /*---------------------------------------------------------------------------*/
640 /*---------------------------------------------------------------------------*/
641 /* Note: */
642 /* */
643 /*---------------------------------------------------------------------------*/
644 static void set_LabelRotate (ppd_choice_t *choice) {
645  if (choice != NULL && (strcmp(choice->choice, "True") == 0 || strcmp(choice->choice, "true") == 0)) {
646  o_opt.rotate = TRUE;
647  }
648  else {
649  o_opt.rotate = FALSE;
650  }
651 }
652 
653 
654 
655 /*****************************************************************************/
656 /*---------------------------------------------------------------------------*/
665 /*---------------------------------------------------------------------------*/
666 /* Note: */
667 /* */
668 /*---------------------------------------------------------------------------*/
669 static void set_TearOffMode (ppd_choice_t *choice) {
670  if (choice != NULL && (strcmp(choice->choice, "True") == 0 || strcmp(choice->choice, "true") == 0)) {
671  o_opt.tear_off = TRUE;
672  }
673  else {
674  o_opt.tear_off = FALSE;
675  }
676 }
677 
678 
679 
680 /*****************************************************************************/
681 /*---------------------------------------------------------------------------*/
690 /*---------------------------------------------------------------------------*/
691 /* Note: */
692 /* */
693 /*---------------------------------------------------------------------------*/
694 static void set_BackfeedMode (ppd_choice_t *choice) {
695  if (choice != NULL && strcmp(choice->choice, "BFA") == 0) {
696  strcpy(o_opt.backfeed, "D");
697  }
698  else if (choice != NULL && strcmp(choice->choice, "BFS") == 0) {
699  strcpy(o_opt.backfeed, "P");
700  }
701  else {
702  fprintf(stderr, "ERROR: Backfeed Mode - Unknown choice '%s'. Setting to 'D'\n", choice->choice);
703  strcpy(o_opt.backfeed, "D");
704  }
705 }
706 
707 /*****************************************************************************/
708 /*---------------------------------------------------------------------------*/
717 /*---------------------------------------------------------------------------*/
718 /* Note: */
719 /* */
720 /*---------------------------------------------------------------------------*/
721 static void set_ImmediateCommand (ppd_choice_t *choice) {
722 
723  /* Formfeed*/
724  if (choice != NULL && strcmp(choice->choice, "FFS") == 0) {
725  strcpy(imm_cmd.formfeed, "S");
726  }
727  else if (choice != NULL && strcmp(choice->choice, "FFE") == 0) {
728  strcpy(imm_cmd.formfeed, "E");
729  }
730  else if (choice != NULL && strcmp(choice->choice, "FFD") == 0) {
731  strcpy(imm_cmd.formfeed, "D");
732  }
733  /* Pause */
734  else if (choice != NULL && strcmp(choice->choice, "PSS") == 0) {
735  strcpy(imm_cmd.pause, "S");
736  }
737  else if (choice != NULL && strcmp(choice->choice, "PSD") == 0) {
738  strcpy(imm_cmd.pause, "D");
739  }
740 
741  else {
742  fprintf(stderr, "ERROR: Immediate command - Unknown choice '%s'\n", choice->choice);
743  }
744 }
745 
746 
747 
748 /*****************************************************************************/
749 /*---------------------------------------------------------------------------*/
758 /*---------------------------------------------------------------------------*/
759 /* Note: */
760 /* */
761 /*---------------------------------------------------------------------------*/
762 static void set_IgnorePaperend (ppd_choice_t *choice) {
763  if (choice != NULL && (strcmp(choice->choice, "True") == 0 || strcmp(choice->choice, "true") == 0)) {
764  o_opt.ignore_paperend = TRUE;
765  }
766  else {
767  o_opt.ignore_paperend = FALSE;
768  }
769 }
770 
771 
772 static void set_image_optimization(ppd_choice_t *choice)
773 {
774  o_opt.image_optimization = (choice && !strcmp(choice->choice, "True"))? TRUE : FALSE;
775 }
776 
778 {
779  return o_opt.image_optimization;
780 }
781 
782 
783 static void set_replace(ppd_choice_t *choice)
784 {
785  o_opt.replace = (choice && !strcmp(choice->choice, "True"))? TRUE : FALSE;
786 }
787 
789 {
790  return o_opt.replace;
791 }
792 
793 
794 static void set_ribbon_saver(ppd_choice_t *choice)
795 {
796  h_opt.ribbon_saver = FALSE;
797 
798  if(!choice)
799  return;
800 
801  if(!strcmp(choice->choice, "True"))
802  h_opt.ribbon_saver = TRUE;
803 }
804 
805 
806 /*****************************************************************************/
807 /*---------------------------------------------------------------------------*/
818 /*---------------------------------------------------------------------------*/
819 /* Note: */
820 /* */
821 /*---------------------------------------------------------------------------*/
822 static void set_PeelOffDisp (ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) {
823  char num[10];
824 
825  calcNumberOpt (num, choice_vk->text, choice_nk->text);
826  if (choice_dir != NULL && strcmp(choice_dir->choice, "PODIRM") == 0) {
827  strcpy(p_opt.disp, "-");
828  strcat(p_opt.disp, num);
829  }
830  else {
831  strcpy(p_opt.disp, num);
832  }
833 }
834 
835 
836 
837 /*****************************************************************************/
838 /*---------------------------------------------------------------------------*/
847 /*---------------------------------------------------------------------------*/
848 /* Note: */
849 /* */
850 /*---------------------------------------------------------------------------*/
851 static void set_PeelOffMode (ppd_choice_t *choice) {
852  if (choice != NULL && (strcmp(choice->choice, "True") == 0 || strcmp(choice->choice, "true") == 0)) {
853  p_opt.installed = TRUE;
854  }
855  else {
856  p_opt.installed = FALSE;
857  }
858 }
859 
860 
861 
862 /*****************************************************************************/
863 /*---------------------------------------------------------------------------*/
872 /*---------------------------------------------------------------------------*/
873 /* Note: */
874 /* */
875 /*---------------------------------------------------------------------------*/
876 static void set_LabelSensor (ppd_choice_t *choice) {
877  if (strncmp(choice->choice, "LSD", 3) == 0) {
878  strcpy(s_opt.ptype, CAB_LABEL_SENSOR_GAP);
879  }
880  else if (strncmp(choice->choice, "LSR", 3) == 0) {
881  strcpy(s_opt.ptype, CAB_LABEL_SENSOR_REFLEX);
882  }
883  else if (strncmp(choice->choice, "LSE", 3) == 0) {
884  strcpy(s_opt.ptype, CAB_LABEL_SENSOR_ENDLESS);
885  } else {
886  fprintf(stderr, "ERROR: Label Sensor - Option is not available ...\n");
887  strcpy(s_opt.ptype, CAB_LABEL_SENSOR_ERROR);
888  }
889 }
890 
891 
892 
893 /*****************************************************************************/
894 /*---------------------------------------------------------------------------*/
904 /*---------------------------------------------------------------------------*/
905 /* Note: */
906 /* */
907 /*---------------------------------------------------------------------------*/
908 static void set_DisplacementX(ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) {
909  char num[6];
910  strcpy(num, choice_vk->text);
911  strcat(num, ".");
912  strcat(num, choice_nk->text);
913  s_opt.x0 = atof(num);
914 }
915 
916 
917 
918 /*****************************************************************************/
919 /*---------------------------------------------------------------------------*/
930 /*---------------------------------------------------------------------------*/
931 /* Note: */
932 /* */
933 /*---------------------------------------------------------------------------*/
934 static void set_DisplacementY(ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) {
935  char num[6];
936  strcpy(num, choice_dir->text);
937  strcat(num, choice_vk->text);
938  strcat(num, ".");
939  strcat(num, choice_nk->text);
940  s_opt.y0 = atof(num);
941 }
942 
943 
944 
945 /*****************************************************************************/
946 /*---------------------------------------------------------------------------*/
956 /*---------------------------------------------------------------------------*/
957 /* Note: */
958 /* */
959 /*---------------------------------------------------------------------------*/
960 static void set_LabelGap(ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) {
961  char num[6];
962  calcNumberOpt (num, choice_vk->text, choice_nk->text);
963  s_opt.gap = atof(num);
964 }
965 
966 
967 
968 /*****************************************************************************/
969 /*---------------------------------------------------------------------------*/
978 /*---------------------------------------------------------------------------*/
979 /* Note: */
980 /* */
981 /*---------------------------------------------------------------------------*/
982 /* Funktionen zum Setzen der einzelnen Cutter Optionen */
983 static void set_Cutter (ppd_choice_t *choice) {
984  if (choice != NULL && (strcmp(choice->choice, "True") == 0 || strcmp(choice->choice, "true") == 0)) {
985  c_opt.installed = TRUE;
986  }
987  else {
988  c_opt.installed = FALSE;
989  }
990 }
991 
992 
993 
994 /*****************************************************************************/
995 /*---------------------------------------------------------------------------*/
1004 /*---------------------------------------------------------------------------*/
1005 /* Note: */
1006 /* */
1007 /*---------------------------------------------------------------------------*/
1008 static void setCutterMode (ppd_choice_t *choice) {
1009  if (choice != NULL && strcmp(choice->choice, CAB_CUTTER_MODE_EOJ_CHOICE) == 0) {
1010  c_opt.mode = CAB_CUTTER_END_JOB;
1011  }
1012  else if (choice != NULL && strcmp(choice->choice, CAB_CUTTER_MODE_EXL_CHOICE) == 0) {
1013  c_opt.mode = CAB_CUTTER_INTERVAL;
1014  }
1015  else {
1016  fprintf(stderr, "ERROR: Cutter Mode - Option is not available ...\n");
1017  c_opt.mode = CAB_CUTTER_MODE_ERR;
1018  }
1019 }
1020 
1021 
1022 
1023 /*****************************************************************************/
1024 /*---------------------------------------------------------------------------*/
1034 /*---------------------------------------------------------------------------*/
1035 /* Note: */
1036 /* */
1037 /*---------------------------------------------------------------------------*/
1038 static void set_CutterInterval(ppd_choice_t *choice) {
1039  strcpy(c_opt.amount, choice->text);
1040 }
1041 
1042 
1043 
1044 /*****************************************************************************/
1045 /*---------------------------------------------------------------------------*/
1056 /*---------------------------------------------------------------------------*/
1057 /* Note: */
1058 /* */
1059 /*---------------------------------------------------------------------------*/
1060 static void set_CutterOffset1(ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) {
1061  char num[6];
1062  calcNumberOpt (num, choice_vk->text, choice_nk->text);
1063  strcpy(c_opt.disp1, choice_dir->text);
1064  strcat(c_opt.disp1, num);
1065 }
1066 
1067 
1068 /* ------------------- */
1069 /* Perforation Options */
1070 /* ------------------- */
1071 
1072 /*****************************************************************************/
1073 /*---------------------------------------------------------------------------*/
1082 /*---------------------------------------------------------------------------*/
1083 /* Note: */
1084 /* */
1085 /*---------------------------------------------------------------------------*/
1086 /* Funktionen zum Setzen der einzelnen Cutter Optionen */
1087 static int set_Perforation (ppd_choice_t *choice) {
1088  if (choice != NULL && (strcmp(choice->choice, "True") == 0 || strcmp(choice->choice, "true") == 0)) {
1089  perfo_opt.installed = TRUE;
1090  }
1091  else {
1092  perfo_opt.installed = FALSE;
1093  }
1094  return perfo_opt.installed;
1095 }
1096 
1097 
1098 
1099 /*****************************************************************************/
1100 /*---------------------------------------------------------------------------*/
1110 /*---------------------------------------------------------------------------*/
1111 /* Note: */
1112 /* */
1113 /*---------------------------------------------------------------------------*/
1114 static void set_PerfoDepth(ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) {
1115  char num[6];
1116  calcNumberOpt (num, choice_vk->text, choice_nk->text);
1117  strcpy(perfo_opt.depth, num);
1118 }
1119 
1120 
1121 
1122 /*****************************************************************************/
1123 /*---------------------------------------------------------------------------*/
1134 /*---------------------------------------------------------------------------*/
1135 /* Note: */
1136 /* */
1137 /*---------------------------------------------------------------------------*/
1138 static void set_PerfoOffset(ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) {
1139  char num[6];
1140  calcNumberOpt (num, choice_vk->text, choice_nk->text);
1141  strcpy(perfo_opt.disp, choice_dir->text);
1142  strcat(perfo_opt.disp, num);
1143 }
1144 
1145 
1146 /* -------------------- */
1147 /* Pre-Printing options */
1148 /* -------------------- */
1149 
1150 /*****************************************************************************/
1151 /*---------------------------------------------------------------------------*/
1160 /*---------------------------------------------------------------------------*/
1161 /* Note: */
1162 /* */
1163 /*---------------------------------------------------------------------------*/
1164 static int setPrePrintingMode (ppd_choice_t *choice) {
1165  if (choice == NULL || strcmp(choice->choice, CAB_PREPRINT_MODE_OFF_CHOICE) == 0) {
1166  pp_opt.mode = CAB_PREPRINT_MODE_OFF;
1167  }
1168  else if (choice != NULL && strcmp(choice->choice, CAB_PREPRINT_MODE_CUT_CHOICE) == 0) {
1169  pp_opt.mode = CAB_PREPRINT_MODE_CUT;
1170  }
1171  else if (choice != NULL && strcmp(choice->choice, CAB_PREPRINT_MODE_PERFO_CHOICE) == 0) {
1173  }
1174  return pp_opt.mode;
1175 }
1176 
1177 
1178 
1179 /*****************************************************************************/
1180 /*---------------------------------------------------------------------------*/
1191 /*---------------------------------------------------------------------------*/
1192 /* Note: */
1193 /* */
1194 /*---------------------------------------------------------------------------*/
1195 static void set_PrePrintingOffset(ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) {
1196  char num[6];
1197  calcNumberOpt (num, choice_vk->text, choice_nk->text);
1198  strcpy(pp_opt.disp, choice_dir->text);
1199  strcat(pp_opt.disp, num);
1200 }
1201 
1202 
1203 /*****************************************************************************/
1204 /*---------------------------------------------------------------------------*/
1215 /*---------------------------------------------------------------------------*/
1216 /* Note: */
1217 /* */
1218 /*---------------------------------------------------------------------------*/
1219 static void set_GlobalObjectOff (ppd_choice_t *choice_dir, ppd_choice_t *choice_vk, ppd_choice_t *choice_nk) {
1220  char num[10];
1221 
1222  calcNumberOpt (num, choice_vk->text, choice_nk->text);
1223  if (choice_dir != NULL && strcmp(choice_dir->choice, "GOOXDIRN") == 0) {
1224  strcpy(d_opt.dispx, "-");
1225  strcat(d_opt.dispx, num);
1226  }
1227  else if (choice_dir != NULL && strcmp(choice_dir->choice, "GOOXDIRP") == 0) {
1228  strcpy(d_opt.dispx, num);
1229  }
1230  else if (choice_dir != NULL && strcmp(choice_dir->choice, "GOOYDIRN") == 0) {
1231  strcpy(d_opt.dispy, "-");
1232  strcat(d_opt.dispy, num);
1233  }
1234  else if (choice_dir != NULL && strcmp(choice_dir->choice, "GOOYDIRP") == 0) {
1235  strcpy(d_opt.dispy, num);
1236  }
1237 }
1238 
1239 
1240 /*****************************************************************************/
1241 /*---------------------------------------------------------------------------*/
1250 /*---------------------------------------------------------------------------*/
1251 /* Note: */
1252 /* */
1253 /*---------------------------------------------------------------------------*/
1254 void handleMarkedPPDOptions (ppd_file_t *ppd) {
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 
1375  if (pp_opt.mode != CAB_PREPRINT_MODE_OFF) {
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  }
1382  if (pp_opt.mode == CAB_PREPRINT_MODE_PERFORATE) {
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
#define CAB_PREPRINT_MODE_CUT_CHOICE
Definition: cab_options.h:278
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
char depth[5]
Additional cutting time factor to influence the perforation.
Definition: cab_options.h:270
#define CAB_PREPRINT_MODE_PERFO_CHOICE
Definition: cab_options.h:280
#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 CAB_PREPRINT_MODE_OFF_CHOICE
Definition: cab_options.h:276
#define OPT_CAB_PRN_HEAD_OFF_X_NK
Definition: cab_options.h:50
char disp[5]
Displacement for the first cut.
Definition: cab_options.h:271
static int set_Perforation(ppd_choice_t *choice)
Handles the perforation cutter installation option.
Definition: cab_options.c:1087
int ribbon_saver
Definition: cab_options.h:178
#define TRUE
Debug level.
Definition: rastertocab.h:30
char dispy[5]
Displacement y in mm.
Definition: cab_options.h:204
Struktur für Einstellungen des Schneidemessers.
Definition: cab_options.h:234
#define OPT_CAB_GLBL_OBJ_OFF_Y_DIR
Definition: cab_options.h:68
char param1[CUSTOM_JSCRIPT_PARAM_MAX]
Definition: cab_options.h:216
int get_p_option_cmd(char *command)
Definition: cab_options.c:259
#define OPT_CAB_PRE_PRINT_DIR_OFFSET
Definition: cab_options.h:99
int rotate
Rotate the label contents 180 degrees.
Definition: cab_options.h:185
int mirrored
Mirrowed label printing.
Definition: cab_options.h:184
int get_preprint_opt(char *command)
Assembles the command for the per-print option (C-Command)
Definition: cab_options.c:491
char disp1[5]
Displacement for the first cut.
Definition: cab_options.h:238
#define CAB_CUTTER_MODE_EXL_CHOICE
Definition: cab_options.h:231
int get_o_option_cmd(char *command)
Definition: cab_options.c:401
Structure heat level, speed and kind of printing method.
Definition: cab_options.h:174
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 backfeed[2]
Backfeed Modus: &#39;D&#39; or &#39;P&#39;.
Definition: cab_options.h:187
int isPrePrintPerforate()
Return, wether the pre-print option is set to &#39;Perforate&#39;.
Definition: cab_options.c:364
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
void get_s_option_cmd(char *command, cups_page_header2_t *header, double printwidth)
Definition: cab_options.c:154
#define OPT_CAB_IMAGE_OPTIMIZATION
Definition: cab_options.h:146
#define OPT_CAB_PERFO_VK_OFFSET
Definition: cab_options.h:113
char speed[4]
Print speed in mm.
Definition: cab_options.h:176
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
static o_options_t o_opt
Print options.
Definition: cab_options.c:30
#define OPT_CAB_IGNORE_PAPEREND
Definition: cab_options.h:44
#define OPT_CAB_FORMFEED_MODE
Definition: cab_options.h:141
#define CAB_CUTTER_MODE_EOJ_CHOICE
Definition: cab_options.h:229
#define FALSE
Boolean define used for FALSE.
Definition: rastertocab.h:33
char heat[4]
Heating (-10 up to 10)
Definition: cab_options.h:175
int get_option_replace()
Definition: cab_options.c:788
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
static void calcNumberOpt(char *res, char *vk, char *nk)
Puts two strings to a number together.
Definition: cab_options.c:54
#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
int image_optimization
Definition: cab_options.h:189
#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
#define CAB_LABEL_SENSOR_REFLEX
Definition: cab_options.h:246
char amount[5]
Amount of label after which a cut is processed.
Definition: cab_options.h:237
static void set_Heat(ppd_choice_t *choice)
Extracts the heat options.
Definition: cab_options.c:555
Cut, when job is done.
Definition: cab_options.h:166
void get_perfo_depth(char *command)
Assembles the command for the perforation depth (C-Command)
Definition: cab_options.c:468
static void set_Speed(ppd_choice_t *choice)
Extracts the printing speed setting.
Definition: cab_options.c:599
double gap
Gap between two labels.
Definition: cab_options.h:262
char formfeed[2]
Formfeed Modus: &#39;S&#39; (start), &#39;E&#39; (end), &#39;D&#39; (disabled)
Definition: cab_options.h:210
int installed
Flag, set to TRUE (1) if a perforation cutter is installed.
Definition: cab_options.h:269
static h_options_t h_opt
Printing parameters.
Definition: cab_options.c:29
#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
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
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
int get_d_option_cmd(char *command)
Definition: cab_options.c:315
int isRibbonSaveSelected()
Return, wether the RibbonSave is active.
Definition: cab_options.c:381
#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
Struktur für das Definieren der Etikettengröße.
Definition: cab_options.h:258
static d_options_t d_opt
Global object offset.
Definition: cab_options.c:31
char ptype[4]
Labelsensing mode.
Definition: cab_options.h:259
#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 CAB_LABEL_SENSOR_ENDLESS
Definition: cab_options.h:245
char disp[5]
Displacement in mm.
Definition: cab_options.h:198
#define OPT_CAB_PEEL_OFF_DIR
Definition: cab_options.h:130
char param3[CUSTOM_JSCRIPT_PARAM_MAX]
Definition: cab_options.h:218
#define CAB_LABEL_SENSOR_GAP
Definition: cab_options.h:247
#define OPT_CAB_PERFO_DIR_OFFSET
Definition: cab_options.h:111
#define CUSTOM_JSCRIPT_PARAM_MAX
Definition: cab_options.h:160
int ignore_paperend
Ignore paper end.
Definition: cab_options.h:188
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
Struktur für Einstellungen des Perforationsschneidemessers.
Definition: cab_options.h:268
#define CAB_LABEL_SENSOR_ERROR
Definition: cab_options.h:248
char dispx[5]
Displacement x in mm.
Definition: cab_options.h:203
int get_option_image_optimization()
Definition: cab_options.c:777
static immediate_commands_t imm_cmd
Immediate commands.
Definition: cab_options.c:34
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
int get_custom_jscript1_cmd(char *command, int page)
Definition: cab_options.c:106
char disp[5]
Displacement for the first action.
Definition: cab_options.h:295
void handleMarkedPPDOptions(ppd_file_t *ppd)
Definition: cab_options.c:1254
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
Structure for printing parameters.
Definition: cab_options.h:183
#define OPT_CAB_PEEL_OFF_NKV
Definition: cab_options.h:134
Structure for extra immediate commands.
Definition: cab_options.h:209
int get_custom_jscript3_cmd(char *command)
Definition: cab_options.c:122
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
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
#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
double y0
Vertical displacement.
Definition: cab_options.h:261
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 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
double x0
Horizontal displacement.
Definition: cab_options.h:260
#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
static perfo_options_t perfo_opt
Perforation options.
Definition: cab_options.c:32
#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 double convPPItomm(unsigned int ppi)
Converts the pixels per inch in millimeters.
Definition: cab_options.c:76
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
char pause[2]
Pause Modus: &#39;S&#39; (start), &#39;D&#39; (disabled)
Definition: cab_options.h:211
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
Unknown mode.
Definition: cab_options.h:164
void get_perfo_offset(char *command)
Assembles the command for the perforation offset (C-Command)
Definition: cab_options.c:447
Structure for the peel-off modi.
Definition: cab_options.h:196
static void set_LabelMirrored(ppd_choice_t *choice)
Handles whether the label should be mirrored.
Definition: cab_options.c:619
static s_options_t s_opt
Label size.
Definition: cab_options.c:26
#define OPT_CAB_LABEL_MIRRORED
Definition: cab_options.h:40
Perforate before printing.
Definition: cab_options.h:287
int get_c_option_cmd(char *command)
Definition: cab_options.c:214
#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
char type[2]
Method of printing.
Definition: cab_options.h:177
static int replace_string_section(char *buffer, const char *search, const char *replace)
Definition: cab_options.c:83
void get_h_option_cmd(char *command)
Definition: cab_options.c:286
static double printwidth
Definition: rastertocab.c:34