cab CUPS Treiber  ---
raster_int.c
Go to the documentation of this file.
1 /******************************************************************************
2  * cab Produkttechnik GmbH & Co KG
3  * Entwicklung Etikettendrucker
4  *
5  * cab CUPS Linux Driver, raster_int.c
6  * - Implementation of debugging 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 "rastertocab.h"
20 
21 
22 /*****************************************************************************/
23 /*---------------------------------------------------------------------------*/
35 /*---------------------------------------------------------------------------*/
36 /* Note: */
37 /* */
38 /*---------------------------------------------------------------------------*/
39 void dump_pg_header (cups_page_header2_t *header)
40 {
41  fprintf(stderr, "DEBUG: cab Printer - Start - Dumping page header ...\n");
42 
43  fprintf(stderr, "DEBUG: AdvanceDistance = %u\n", header->AdvanceDistance);
44  fprintf(stderr, "DEBUG: AdvanceMedia = %d\n", header->AdvanceMedia);
45  fprintf(stderr, "DEBUG: Collate = %d\n", header->Collate);
46  fprintf(stderr, "DEBUG: CutMedia = %d\n", header->CutMedia);
47  fprintf(stderr, "DEBUG: Duplex = %d\n", header->Duplex);
48  fprintf(stderr, "DEBUG: HWResolution = [ %u %u ]\n", header->HWResolution[0], header->HWResolution[1]);
49  fprintf(stderr, "DEBUG: ImagingBoundingBox = [ %u %u %u %u ]\n", header->ImagingBoundingBox[0], header->ImagingBoundingBox[1], header->ImagingBoundingBox[2], header->ImagingBoundingBox[3]);
50  fprintf(stderr, "DEBUG: InsertSheet = %d\n", header->InsertSheet);
51  fprintf(stderr, "DEBUG: Jog = %d\n", header->Jog);
52  fprintf(stderr, "DEBUG: LeadingEdge = %d\n", header->LeadingEdge);
53  fprintf(stderr, "DEBUG: ManualFeed = %u\n", header->ManualFeed);
54  fprintf(stderr, "DEBUG: Margins = [ %u %u ]\n", header->Margins[0], header->Margins[1]);
55 
56  fprintf(stderr, "DEBUG: MediaClass = \"%s\"\n", header->MediaClass);
57  fprintf(stderr, "DEBUG: MediaColor = \"%s\"\n", header->MediaColor);
58  fprintf(stderr, "DEBUG: MediaPosition = %u\n", header->MediaPosition);
59  fprintf(stderr, "DEBUG: MediaType = \"%s\"\n", header->MediaType);
60  fprintf(stderr, "DEBUG: MediaWeight = %u\n", header->MediaWeight);
61 
62  fprintf(stderr, "DEBUG: MirrorPrint = %d\n", header->MirrorPrint);
63  fprintf(stderr, "DEBUG: NegativePrint = %d\n", header->NegativePrint);
64  fprintf(stderr, "DEBUG: NumCopies = %u\n", header->NumCopies);
65  fprintf(stderr, "DEBUG: Orientation = %d\n", header->Orientation);
66  fprintf(stderr, "DEBUG: OutputFaceUp = %d\n", header->OutputFaceUp);
67  fprintf(stderr, "DEBUG: OutputType = \"%s\"\n", header->OutputType);
68  fprintf(stderr, "DEBUG: PageSize = [ %u %u ]\n", header->PageSize[0], header->PageSize[1]);
69  fprintf(stderr, "DEBUG: Separations = %d\n", header->Separations);
70  fprintf(stderr, "DEBUG: TraySwitch = %d\n", header->TraySwitch);
71  fprintf(stderr, "DEBUG: Tumble = %d\n", header->Tumble);
72 
73  fprintf(stderr, "DEBUG: cupsBitsPerColor = %u\n", header->cupsBitsPerColor);
74  fprintf(stderr, "DEBUG: cupsBitsPerPixel = %u\n", header->cupsBitsPerPixel);
75  fprintf(stderr, "DEBUG: cupsBytesPerLine = %u\n", header->cupsBytesPerLine);
76  fprintf(stderr, "DEBUG: cupsColorOrder = %d\n", header->cupsColorOrder);
77  fprintf(stderr, "DEBUG: cupsColorSpace = %d\n", header->cupsColorSpace);
78  fprintf(stderr, "DEBUG: cupsCompression = %u\n", header->cupsCompression);
79  fprintf(stderr, "DEBUG: cupsHeight = %u\n", header->cupsHeight);
80  fprintf(stderr, "DEBUG: cupsMediaType = %u\n", header->cupsMediaType);
81  fprintf(stderr, "DEBUG: cupsNumColors = %u\n", header->cupsNumColors);
82  fprintf(stderr, "DEBUG: cupsPageSizeName = %s\n", header->cupsPageSizeName);
83  fprintf(stderr, "DEBUG: cupsPageSize [ %f %f ]\n", header->cupsPageSize[0], header->cupsPageSize[1]);
84  fprintf(stderr, "DEBUG: cupsRowCount = %u\n", header->cupsRowCount);
85  fprintf(stderr, "DEBUG: cupsRowFeed = %u\n", header->cupsRowFeed);
86  fprintf(stderr, "DEBUG: cupsRowStep = %u\n", header->cupsRowStep);
87  fprintf(stderr, "DEBUG: cupsWidth = %u\n", header->cupsWidth);
88 
89  fprintf(stderr, "DEBUG: cab - End - Dumping page header ...\n");
90 }
91 
92 
93 /*****************************************************************************/
94 /*---------------------------------------------------------------------------*/
105 /*---------------------------------------------------------------------------*/
106 /* Note: */
107 /* */
108 /*---------------------------------------------------------------------------*/
109 void dump_ppd_option (ppd_file_t *ppd, char *option)
110 {
111  ppd_option_t *ppd_option;
112  ppd_choice_t *choice;
113  int j;
114 
115  fprintf(stderr, "DEBUG: Dump - Starting ...\n");
116 
117  ppd_option = ppdFindOption(ppd, option);
118 
119  if (ppd_option != NULL)
120  {
121  fprintf(stderr, "DEBUG: cab - Option: ");
122  fprintf(stderr, "%s", ppd_option->text);
123  fprintf(stderr, "\n");
124 
125  for (j = 0; j < ppd_option->num_choices; j++)
126  {
127  choice = &(ppd_option->choices[j]);
128  fprintf(stderr, "DEBUG: cab - Choice-Text: ");
129  fprintf(stderr, "%s", choice->text);
130  fprintf(stderr, " -> %d", choice->marked);
131 
132  if (choice->marked == 0)
133  {
134  fprintf(stderr, " - is not marked ...");
135  }
136  else
137  {
138  fprintf(stderr, " - marked!!!");
139  }
140  fprintf(stderr, "\n");
141  }
142  }
143  else
144  {
145  fprintf(stderr, "ERROR: cab -Dump - Option is not available ...\n");
146  }
147 
148  fprintf(stderr, "ERROR: cab - Dump - Done ...\n");
149 }
150 
151 
152 #ifdef DEBUG_INFO
153 /*****************************************************************************/
154 /*---------------------------------------------------------------------------*/
165 /*---------------------------------------------------------------------------*/
166 /* Note: */
167 /* */
168 /*---------------------------------------------------------------------------*/
169 void dump_cups_options (int num_options, cups_option_t *options)
170 {
171  int j;
172 
173  fprintf(stderr, "DEBUG: cab - Number of options: %d\n", num_options);
174  fputs("DEBUG: .........................................\n", stderr);
175 
176  for (j = 0; j < num_options; j++)
177  {
178  fprintf(stderr, "DEBUG: cab - Number of option: %d - ", j);
179  fputs(options[j].name, stderr);
180  fputs(" - ", stderr);
181  fputs(options[j].value, stderr);
182  fputs("\n", stderr);
183  }
184  fputs("DEBUG: ......... +++ Cups option done +++ ..........\n", stderr);
185 }
186 
187 
188 /*****************************************************************************/
189 /*---------------------------------------------------------------------------*/
199 /*---------------------------------------------------------------------------*/
200 /* Note: */
201 /* */
202 /*---------------------------------------------------------------------------*/
203 void dump_cab_page_info (cups_page_header2_t *header)
204 {
205  fprintf(stderr, "DEBUG: cab - --------------\n");
206  fprintf(stderr, "DEBUG: Bilddaten ...\n");
207  fprintf(stderr, "DEBUG: Height: %u\n", header->cupsHeight);
208  fprintf(stderr, "DEBUG: Width: %u\n", header->cupsWidth);
209  fprintf(stderr, "DEBUG: BitsPerColor: %u\n", header->cupsBitsPerColor);
210  fprintf(stderr, "DEBUG: BitsPerPixel: %u\n", header->cupsBitsPerPixel);
211  fprintf(stderr, "DEBUG: BytePerLine: %u\n", header->cupsBytesPerLine);
212  fprintf(stderr, "DEBUG: Compression: %u\n", header->cupsCompression);
213  fprintf(stderr, "DEBUG: cab - -------------- \n");
214  fprintf(stderr, "DEBUG: PageSize = [ %u %u ]\n", header->PageSize[0], header->PageSize[1]);
215  fprintf(stderr, "DEBUG: HWResolution[0]: %u\n", header->HWResolution[0]);
216  fprintf(stderr, "DEBUG: HWResolution[1]: %u\n", header->HWResolution[1]);
217  fprintf(stderr, "DEBUG: cab - -------------- \n");
218 }
219 
220 #endif /* DEBUG_INFO */
void dump_ppd_option(ppd_file_t *ppd, char *option)
Dumps a printer option described in the related PPD.
Definition: raster_int.c:109
void dump_pg_header(cups_page_header2_t *header)
Dumps the CUPS page header structure.
Definition: raster_int.c:39