1 {
2 This file is part of the Free Pascal run time library.
3 Copyright (c) 2002 by Yuri Prokushev (prokushev@freemail.ru).
4
5 OS/2 Presentation Manager Device Context constants, types and
6 function declarations
7
8 See the file COPYING.FPC, included in this distribution,
9 for details about the copyright.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
15 **********************************************************************}
16
17 {Warning: This code is alfa. Future versions
18 of this unit might not be compatible.}
19
20 unit pmdev;
21
22 interface
23
24 uses
25 os2def;
26
27 //General DEV return values
28 const
29 DEV_ERROR =0;
30 DEV_OK =1;
31
32 //DC type for DevOpenDC
33
34 OD_QUEUED =2;
35 OD_DIRECT =5;
36 OD_INFO =6;
37 OD_METAFILE =7;
38 OD_MEMORY =8;
39 OD_METAFILE_NOQUERY =9;
40
41 //codes for DevQueryCaps
42 CAPS_FAMILY =0;
43 CAPS_IO_CAPS =1;
44 CAPS_TECHNOLOGY =2;
45 CAPS_DRIVER_VERSION =3;
46 CAPS_WIDTH =4; //pels
47 CAPS_HEIGHT =5; //pels
48 CAPS_WIDTH_IN_CHARS =6;
49 CAPS_HEIGHT_IN_CHARS =7;
50 CAPS_HORIZONTAL_RESOLUTION =8; //pels per meter
51 CAPS_VERTICAL_RESOLUTION =9; //pels per meter
52 CAPS_CHAR_WIDTH =10; //pels
53 CAPS_CHAR_HEIGHT =11; //pels
54 CAPS_SMALL_CHAR_WIDTH =12; //pels
55 CAPS_SMALL_CHAR_HEIGHT =13; //pels
56 CAPS_COLORS =14;
57 CAPS_COLOR_PLANES =15;
58 CAPS_COLOR_BITCOUNT =16;
59 CAPS_COLOR_TABLE_SUPPORT =17;
60 CAPS_MOUSE_BUTTONS =18;
61 CAPS_FOREGROUND_MIX_SUPPORT =19;
62 CAPS_BACKGROUND_MIX_SUPPORT =20;
63 CAPS_DEVICE_WINDOWING =31;
64 CAPS_ADDITIONAL_GRAPHICS =32;
65 CAPS_VIO_LOADABLE_FONTS =21;
66 CAPS_WINDOW_BYTE_ALIGNMENT =22;
67 CAPS_BITMAP_FORMATS =23;
68 CAPS_RASTER_CAPS =24;
69 CAPS_MARKER_HEIGHT =25; //pels
70 CAPS_MARKER_WIDTH =26; //pels
71 CAPS_DEVICE_FONTS =27;
72 CAPS_GRAPHICS_SUBSET =28;
73 CAPS_GRAPHICS_VERSION =29;
74 CAPS_GRAPHICS_VECTOR_SUBSET =30;
75 CAPS_PHYS_COLORS =33;
76 CAPS_COLOR_INDEX =34;
77 CAPS_GRAPHICS_CHAR_WIDTH =35;
78 CAPS_GRAPHICS_CHAR_HEIGHT =36;
79 CAPS_HORIZONTAL_FONT_RES =37;
80 CAPS_VERTICAL_FONT_RES =38;
81 CAPS_DEVICE_FONT_SIM =39;
82 CAPS_LINEWIDTH_THICK =40;
83 CAPS_DEVICE_POLYSET_POINTS =41;
84
85 //Constants for CAPS_IO_CAPS
86 CAPS_IO_DUMMY =1;
87 CAPS_IO_SUPPORTS_OP =2;
88 CAPS_IO_SUPPORTS_IP =3;
89 CAPS_IO_SUPPORTS_IO =4;
90
91 //Constants for CAPS_TECHNOLOGY
92 CAPS_TECH_UNKNOWN =0;
93 CAPS_TECH_VECTOR_PLOTTER =1;
94 CAPS_TECH_RASTER_DISPLAY =2;
95 CAPS_TECH_RASTER_PRINTER =3;
96 CAPS_TECH_RASTER_CAMERA =4;
97 CAPS_TECH_POSTSCRIPT =5;
98
99 //Constants for CAPS_COLOR_TABLE_SUPPORT
100 CAPS_COLTABL_RGB_8 =1;
101 CAPS_COLTABL_RGB_8_PLUS =2;
102 CAPS_COLTABL_TRUE_MIX =4;
103 CAPS_COLTABL_REALIZE =8;
104
105 //Constants for CAPS_FOREGROUND_MIX_SUPPORT
106 CAPS_FM_OR =1;
107 CAPS_FM_OVERPAINT =2;
108 CAPS_FM_XOR =8;
109 CAPS_FM_LEAVEALONE =16;
110 CAPS_FM_AND =32;
111 CAPS_FM_GENERAL_BOOLEAN =64;
112
113 //Constants for CAPS_BACKGROUND_MIX_SUPPORT
114 CAPS_BM_OR =1;
115 CAPS_BM_OVERPAINT =2;
116 CAPS_BM_XOR =8;
117 CAPS_BM_LEAVEALONE =16;
118 CAPS_BM_AND =32;
119 CAPS_BM_GENERAL_BOOLEAN =64;
120 CAPS_BM_SRCTRANSPARENT =128;
121 CAPS_BM_DESTTRANSPARENT =256;
122
123 //Constants for CAPS_DEVICE_WINDOWING
124 CAPS_DEV_WINDOWING_SUPPORT =1;
125
126 //Constants for CAPS_ADDITIONAL_GRAPHICS
127 CAPS_VDD_DDB_TRANSFER =1;
128 CAPS_GRAPHICS_KERNING_SUPPORT =2;
129 CAPS_FONT_OUTLINE_DEFAULT =4;
130 CAPS_FONT_IMAGE_DEFAULT =8;
131 //bits represented by values 16L and 32L are reserved
132 CAPS_SCALED_DEFAULT_MARKERS =64;
133 CAPS_COLOR_CURSOR_SUPPORT =128;
134 CAPS_PALETTE_MANAGER =256;
135 CAPS_COSMETIC_WIDELINE_SUPPORT =512;
136 CAPS_DIRECT_FILL =1024;
137 CAPS_REBUILD_FILLS =2048;
138 CAPS_CLIP_FILLS =$00001000; //4096L
139 CAPS_ENHANCED_FONTMETRICS =$00002000; //8192L
140 CAPS_TRANSFORM_SUPPORT =$00004000; //16384L
141
142 //Constants for CAPS_WINDOW_BYTE_ALIGNMENT
143 CAPS_BYTE_ALIGN_REQUIRED =0;
144 CAPS_BYTE_ALIGN_RECOMMENDED =1;
145 CAPS_BYTE_ALIGN_NOT_REQUIRED =2;
146
147 //Constants for CAPS_RASTER_CAPS
148 CAPS_RASTER_BITBLT =1;
149 CAPS_RASTER_BANDING =2;
150 CAPS_RASTER_BITBLT_SCALING =4;
151 CAPS_RASTER_SET_PEL =16;
152 CAPS_RASTER_FONTS =32;
153 CAPS_RASTER_FLOOD_FILL =64;
154
155 //structures for DEVESC_QUERYVIOCELLSIZES
156
157 type
158 PVioSizeCount=^VioSizeCount;
159 VioSizeCount=record
160 maxcount: Longint;
161 count: Longint;
162 end;
163
164 PVioFontCellSize=^VioFontCellSize;
165 VioFontCellSize=record
166 cx: Longint;
167 cy: Longint;
168 end;
169
170 //structure for DEVESC_GETSCALINGFACTOR
171 PSFactors=^SFactors;
172 SFactors=record
173 x: Longint;
174 y: Longint;
175 end;
176
177 //structure for DEVESC_NEXTBAND
178 PBandRect=^BandRect;
179 BandRect=record
180 xleft: Longint;
181 ybottom: Longint;
182 xright: Longint;
183 ytop: Longint;
184 end;
185
186 //return codes for DevEscape
187 const
188 DEVESC_ERROR =-1;
189 DEVESC_NOTIMPLEMENTED =0;
190
191 //codes for DevEscape
192 DEVESC_QUERYESCSUPPORT = 0;
193 DEVESC_GETSCALINGFACTOR = 1;
194 DEVESC_QUERYVIOCELLSIZES = 2;
195 DEVESC_GETCP =8000;
196
197 DEVESC_STARTDOC =8150;
198 DEVESC_ENDDOC =8151;
199 DEVESC_NEXTBAND =8152;
200 DEVESC_ABORTDOC =8153;
201
202 DEVESC_NEWFRAME =16300;
203 DEVESC_DRAFTMODE =16301;
204 DEVESC_FLUSHOUTPUT =16302;
205 DEVESC_RAWDATA =16303;
206 DEVESC_SETMODE =16304;
207
208 DEVESC_DBE_FIRST =24450;
209 DEVESC_DBE_LAST =24455;
210
211 //DevEscape codes for adding extra space to character strings
212 DEVESC_CHAR_EXTRA =16998;
213 DEVESC_BREAK_EXTRA =16999;
214
215 //codes for DevEscape PM_Q_ESC spool files
216 DEVESC_STD_JOURNAL =32600;
217
218 //structure for DEVESC_SETMODE
219 type
220 PEscMode=^EscMode;
221 EscMode=record
222 mode: cardinal;
223 modedata: byte;
224 end;
225
226 //return codes for DevPostDeviceModes
227 const
228 DPDM_ERROR =-1;
229 DPDM_NONE =0;
230
231 //codes for DevPostDeviceModes
232 DPDM_POSTJOBPROP =0;
233 DPDM_CHANGEPROP =1;
234 DPDM_QUERYJOBPROP =2;
235
236 //string types for DevQueryDeviceNames
237 type
238 Str16= string [15];
239 Str32= string [31];
240 Str64= string [63];
241
242 //return code for DevQueryHardcopyCaps
243 const
244 DQHC_ERROR =-1;
245
246 //codes for DevQueryHardcopyCaps
247 const
248 HCAPS_CURRENT =1;
249 HCAPS_SELECTABLE =2;
250
251 //structure for DevQueryHardcopyCaps
252 type
253 PHCInfo=^HCInfo;
254 HCInfo=record
255 szFormname: Str32;
256 cx: Longint;
257 cy: Longint;
258 xLeftClip: Longint;
259 yBottomClip: Longint;
260 xRightClip: Longint;
261 yTopClip: Longint;
262 xPels: Longint;
263 yPels: Longint;
264 flAttributes: Longint;
265 end;
266
267 { -----------------------------------------------------------------
268 Tuple Item used for QUERYSIZE
269 }
270 { djpQRT }
271 { I - Property }
272 { I - type (DJP_ALL or DJP_CURRENT) }
273 { }
274
275 type
276
277 TdjpQueryTuple = record
278 ulProperty : Cardinal;
279 lType : Longint;
280 end;
281 TQUERYTUPLE = TdjpQueryTuple;
282 TPQUERYTUPLE = ^TdjpQueryTuple;
283 { -----------------------------------------------------------------
284 Query Size Structure for DEVESC_QUERYSIZE
285 }
286 { djpQRS }
287 { I - Size of entire structure }
288 { O - Size returned; }
289 { I - Start of tuple list }
290 { use DJP_NONE for end of list }
291
292 TdjpQuerySize = record
293 cb : Cardinal;
294 ulSizeNeeded : Cardinal;
295 aTuples : array[0..0] of TQUERYTUPLE;
296 end;
297 TQUERYSIZE = TdjpQuerySize;
298 TPQUERYSIZE = ^TdjpQuerySize;
299 { was #define dname def_expr }
QUERYSIZE_HEADER_SIZEnull300 // function QUERYSIZE_HEADER_SIZE : longint;
301 { return type might be wrong }
302
303 { -----------------------------------------------------------------
304 Dynamic Job Property Item
305 }
306 { djpITM }
307 { I/O - sizeof DJP_ITEM structure }
308 { I - Which property }
309 { I/O - DJP_ALL or DJP_CURRENT. }
310 { DJP_ERROR_XXX if error. }
311 { O - How many elements have been }
312 { returned }
313 { O - Variably sized based on }
314 { ulProperty. The smallest }
315 { is a ULONG in size }
316
317 type
318
319 TdjpItem = record
320 cb : Cardinal;
321 ulProperty : Cardinal;
322 lType : Longint;
323 ulNumReturned : Cardinal;
324 ulValue : Cardinal;
325 end;
326 TDJP_ITEM = TdjpItem;
327 TPDJP_ITEM = ^TdjpItem;
328 { was #define dname def_expr }
DJP_HEADER_SIZEnull329 // function DJP_HEADER_SIZE : longint;
330 { return type might be wrong }
331
332 { was #define dname(params) para_def_expr }
333 { argument types are unknown }
334 // function DJP_NEXT_STRUCTP(p : longint) : TPDJP_ITEM;
335
336 { was #define dname(params) para_def_expr }
337 { argument types are unknown }
338 // function DJP_ELEMENTP(s,t : longint) : ^Tt;
339
340 (* error
341 #define DJP_SET_ELEMENT(s,t,e) ( *DJP_ELEMENTP (s,t) = (e))
342 in define line 83 *)
343 { -----------------------------------------------------------------
344 Types of Dynamic Job Properties
345
346 To see if the driver is enabled use,
347 DevEscape (DEVESC_QUERYESCSUPPORT,
348 DEVESC_STARTDOC_WPROP, ...)
349 and DevQueryDevice (DEVQRY_QUERYSUPPORT,
350 DEVESC_QUERYJOBPROPERTIES, ...)
351
352 NOTE: The C/S in the defines indicate the complexity or size of
353 the information. If it is s, then the size is ULONG sized
354 and no special processing for the next element needs to be
355 done.
356 The J/P in the defines indicate the class. J stands for job
357 properties and P stands for printer properties.
358 }
359 { also End Of List marker }
360
361 const
362 DJP_NONE = 0;
363 DJP_SJ_ORIENTATION = 1;
364 DJP_CJ_RESOLUTION = 2;
365 DJP_SJ_BITSPERPEL = 3;
366 DJP_SJ_COLOR = 4;
367 DJP_SJ_PRINTQUALITY = 5;
368 DJP_SJ_PAPERSIZE = 6;
369 DJP_SJ_TRAYTYPE = 7;
370 DJP_SJ_MEDIA = 8;
371 DJP_SJ_MEDIA_COLOR = 9;
372 DJP_CJ_FORM = 10;
373 DJP_CJ_MIXEDFORMS = 11;
374 DJP_SJ_FONTDOWNLOADING = 12;
375 DJP_SJ_DUPLEX = 13;
376 DJP_SJ_COLLATE = 14;
377 DJP_SJ_FEED = 15;
378 DJP_SJ_COPIES = 16;
379 DJP_SJ_SCALING = 17;
380 DJP_SJ_FORMFEEDCONTROL = 18;
381 DJP_SJ_N_UP = 19;
382 DJP_CJ_OUTPUTBIN = 20;
383 DJP_CJ_TRAYNAME = 21;
384 { Types for DEVESC_QUERYJOBPROPERTIES / DEVESC_SETJOBPROPERTIES
385 }
386 { enumerate the property }
387 DJP_ALL = 1;
388 { from job properties }
389 DJP_CURRENT = 2;
390 { Errors for DEVESC_QUERYJOBPROPERTIES / DEVESC_SETJOBPROPERTIES
391 }
392 { driver doesnt support that property }
393 DJP_ERROR_NOT_SUPPORTED = -(1);
394 { not in the valid range }
395 DJP_ERROR_OUT_OF_RANGE = -(2);
396 { not enumerateable }
397 DJP_ERROR_NOT_ENUM = -(3);
398 { field not proper value }
399 DJP_ERROR_INV_PARMS = -(4);
400 { -----------------------------------------------------------------
401 DJP_SJ_ORIENTATION
402 }
403 DJP_ORI_PORTRAIT = 1;
404 DJP_ORI_LANDSCAPE = 2;
405 DJP_ORI_REV_PORTRAIT = 3;
406 DJP_ORI_REV_LANDSCAPE = 4;
407
408 type
409
410 TDJPT_ORIENTATION = Cardinal;
411
412 TPDJPT_ORIENTATION = Cardinal;
413 { -----------------------------------------------------------------
414 DJP_CJ_RESOLUTION
415 }
416 { djpRES }
417 { X resolution (in dots per inch) }
418 { Y resolution (in dots per inch) }
419
420 TdjpResolution = record
421 usXResolution : Word;
422 usYResolution : Word;
423 end;
424 TDJPT_RESOLUTION = TdjpResolution;
425 TPDJPT_RESOLUTION = ^TdjpResolution;
426 { -----------------------------------------------------------------
427 DJP_SJ_BITSPERPEL
428 }
429
430 TDJPT_BITSPERPEL = Cardinal;
431
432 TPDJPT_BITSPERPEL = Cardinal;
433 { -----------------------------------------------------------------
434 DJP_SJ_COLOR
435 }
436
437 const
438 DJP_CLR_MONOCHROME = 1;
439 DJP_CLR_COLOR = 2;
440
441 type
442
443 TDJPT_COLOR = Cardinal;
444
445 TPDJPT_COLOR = Cardinal;
446 { -----------------------------------------------------------------
447 DJP_SJ_PRINTQUALITY
448
449 Note: DJP_PQL_DRAFT is the worst quality. In the future, there
450 may be better qualities (such as DJP_PQL_ULTRA_HIGH) which
451 will be numerically greater than DJP_PQL_HIGH.
452 }
453
454 const
455 DJP_PQL_DRAFT = 1;
456 DJP_PQL_LOW = 2;
457 DJP_PQL_MEDIUM = 3;
458 DJP_PQL_HIGH = 4;
459 DJP_PQL_LAST = DJP_PQL_HIGH;
460
461 type
462
463 TDJPT_PRINTQUALITY = Cardinal;
464
465 TPDJPT_PRINTQUALITY = Cardinal;
466 { -----------------------------------------------------------------
467 DJP_SJ_PAPERSIZE
468
469 Note: it is recommended to use DJP_CJ_FORM to chage the papersize.
470 approximate size
471 }
472 { inches millimeters }
473
474 const
475 DJP_PSI_NONE = 0;
476 { 8.5 x 11 216 x 279 }
477 DJP_PSI_LETTER = 1;
478 { 8.5 x 14 216 x 356 }
479 DJP_PSI_LEGAL = 2;
480 { 13.58 x 11 345 x 279 }
481 DJP_PSI_WIDE = 3;
482 { 17 x 22 431 x 558 }
483 DJP_PSI_CSHEET = 4;
484 { 22 x 34 558 x 863 }
485 DJP_PSI_DSHEET = 5;
486 { 34 x 44 863 x 1117 }
487 DJP_PSI_ESHEET = 6;
488 { }
489 DJP_PSI_LETTERSMALL = 7;
490 { 11 x 17 279 x 431 }
491 DJP_PSI_TABLOID = 8;
492 { 17 x 11 431 x 279 }
493 DJP_PSI_LEDGER = 9;
494 { 5.5 x 8.5 139 x 216 }
495 DJP_PSI_STATEMENT = 10;
496 { 7.25 x 10.5 184 x 266 }
497 DJP_PSI_EXECUTIVE = 11;
498 { 33.11 x 46.81 841 x 1189 }
499 DJP_PSI_A0 = 12;
500 { 23.39 x 33.11 594 x 841 }
501 DJP_PSI_A1 = 13;
502 { 16.54 x 23.39 420 x 594 }
503 DJP_PSI_A2 = 14;
504 { 11.7 x 16.54 297 x 420 }
505 DJP_PSI_A3 = 15;
506 { 8.3 x 11.7 210 x 297 }
507 DJP_PSI_A4 = 16;
508 { }
509 DJP_PSI_A4_SMALL = 17;
510 { 5.83 x 8.27 148 x 210 }
511 DJP_PSI_A5 = 18;
512 { 9.84 x 13.94 250 x 354 }
513 DJP_PSI_B4 = 19;
514 { 7.17 x 10.12 182 x 257 }
515 DJP_PSI_B5 = 20;
516 { 8.5 x 13 216 x 330 }
517 DJP_PSI_FOLIO = 21;
518 { 8.46 x 10.83 215 x 275 }
519 DJP_PSI_QUATRO = 22;
520 { 10 x 14 254 x 355 }
521 DJP_PSI_10X14 = 23;
522 { 11 x 17 279 x 431 }
523 DJP_PSI_11X17 = 24;
524 { }
525 DJP_PSI_NOTE = 25;
526 { }
527 DJP_PSI_ENV_9 = 26;
528 { }
529 DJP_PSI_ENV_10 = 27;
530 { }
531 DJP_PSI_ENV_11 = 28;
532 { }
533 DJP_PSI_ENV_12 = 29;
534 { }
535 DJP_PSI_ENV_14 = 30;
536 { }
537 DJP_PSI_ENV_DL = 31;
538 { }
539 DJP_PSI_ENV_A2 = 32;
540 { }
541 DJP_PSI_ENV_C3 = 33;
542 { }
543 DJP_PSI_ENV_C4 = 34;
544 { }
545 DJP_PSI_ENV_C5 = 35;
546 { }
547 DJP_PSI_ENV_C6 = 36;
548 { }
549 DJP_PSI_ENV_C65 = 37;
550 { }
551 DJP_PSI_ENV_C9 = 38;
552 { }
553 DJP_PSI_ENV_C10 = 39;
554 { }
555 DJP_PSI_ENV_B4 = 40;
556 { }
557 DJP_PSI_ENV_B5 = 41;
558 { }
559 DJP_PSI_ENV_B6 = 42;
560 { }
561 DJP_PSI_ENV_ITALY = 43;
562 { }
563 DJP_PSI_ENV_MONARCH = 44;
564 { }
565 DJP_PSI_ENV_PERSONAL = 45;
566 { }
567 DJP_PSI_FANFOLD_US = 46;
568 { }
569 DJP_PSI_FANFOLD_STD_GERMAN = 47;
570 { }
571 DJP_PSI_FANFOLD_LGL_GERMAN = 48;
572 { }
573 DJP_PSI_ARCHITECT_BSHEET = 49;
574 { }
575 DJP_PSI_ARCHITECT_CSHEET = 50;
576 { }
577 DJP_PSI_ARCHITECT_DSHEET = 51;
578 { }
579 DJP_PSI_ARCHITECT_ESHEET = 52;
580 { }
581 DJP_PSI_CARD_A6 = 53;
582 { }
583 DJP_PSI_CARD_4X6 = 54;
584 { }
585 DJP_PSI_CARD_5X8 = 55;
586 { }
587 DJP_PSI_CARD_HAGAKI = 56;
588 { 1.10 x 3.50 28 x 89 }
589 DJP_PSI_LABEL_STANDARD = 57;
590 { 3.98 x 2.13 101 x 54 }
591 DJP_PSI_LABEL_SHIPPING = 58;
592 { 2.76 x 2.13 70 x 54 }
593 DJP_PSI_LABEL_DISK = 59;
594 { 3.50 x 1.42 89 x 36 }
595 DJP_PSI_LABEL_EURO = 60;
596 { }
597 DJP_PSI_CARD_OUFUKU_HAGAKI = 61;
598 { }
599 DJP_PSI_B0 = 62;
600 { }
601 DJP_PSI_B1 = 63;
602 { }
603 DJP_PSI_B2 = 64;
604 { }
605 DJP_PSI_B3 = 65;
606 { }
607 DJP_PSI_B6 = 66;
608 { }
609 DJP_PSI_B7 = 67;
610 { }
611 DJP_PSI_B8 = 68;
612 { }
613 DJP_PSI_B9 = 69;
614 { }
615 DJP_PSI_B10 = 70;
616 { }
617 DJP_PSI_B0_JIS = 71;
618 { }
619 DJP_PSI_B1_JIS = 72;
620 { }
621 DJP_PSI_B2_JIS = 73;
622 { }
623 DJP_PSI_B3_JIS = 74;
624 { }
625 DJP_PSI_B4_JIS = 75;
626 { }
627 DJP_PSI_B5_JIS = 76;
628 { }
629 DJP_PSI_B6_JIS = 77;
630 { }
631 DJP_PSI_B7_JIS = 78;
632 { }
633 DJP_PSI_B8_JIS = 79;
634 { }
635 DJP_PSI_B9_JIS = 80;
636 { }
637 DJP_PSI_B10_JIS = 81;
638 DJP_PSI_LAST = DJP_PSI_B10_JIS;
639
640 type
641
642 TDJPT_PAPERSIZE = Longint;
643
644 TPDJPT_PAPERSIZE = Longint;
645 { -----------------------------------------------------------------
646 DJP_SJ_TRAYTYPE
647
648 Note: it is recommended to use DJP_CJ_FORM to chage the tray type.
649 }
650
651 const
652 DJP_TRY_NONE = 0;
653 DJP_TRY_UPPER = 1;
654 DJP_TRY_ONLYONE = DJP_TRY_UPPER;
655 DJP_TRY_LOWER = 2;
656 DJP_TRY_MIDDLE = 3;
657 DJP_TRY_MANUAL = 4;
658 DJP_TRY_ENVELOPE = 5;
659 DJP_TRY_ENVMANUAL = 6;
660 DJP_TRY_AUTO = 7;
661 DJP_TRY_TRACTOR = 8;
662 DJP_TRY_SMALLFMT = 9;
663 DJP_TRY_LARGEFMT = 10;
664 DJP_TRY_LARGECAPACITY = 11;
665 DJP_TRY_CASSETTE = 12;
666 DJP_TRY_LAST = DJP_TRY_CASSETTE;
667
668 type
669
670 TDJPT_TRAYTYPE = Cardinal;
671
672 TPDJPT_TRAYTYPE = Cardinal;
673 { -----------------------------------------------------------------
674 DJP_SJ_MEDIA
675
676 Note: it is recommended to use DJP_CJ_FORM to chage the media type.
677 }
678
679 const
680 DJP_MED_NONE = 0;
681 DJP_MED_PLAIN = 1;
682 DJP_MED_TRANSPARENCY = 2;
683 DJP_MED_GLOSSY = 3;
684 DJP_MED_SPECIAL = 4;
685 DJP_MED_COATED = 5;
686 DJP_MED_BACKPRINT = 6;
687 DJP_MED_CLOTH = 7;
688 DJP_MED_THICK = 8;
689 DJP_MED_STATIONARY = 9;
690 DJP_MED_ENVELOPE = 10;
691 DJP_MED_CONTINUOUS_LONG = 11;
692 DJP_MED_CONTINUOUS_SHORT = 12;
693 DJP_MED_TAB_STOCK = 13;
694 DJP_MED_MULTI_PART_FORM = 14;
695 DJP_MED_LABELS = 15;
696 DJP_MED_LAST = DJP_MED_LABELS;
697
698 type
699
700 TDJPT_MEDIA = Cardinal;
701
702 TPDJPT_MEDIA = Cardinal;
703 { -----------------------------------------------------------------
704 DJP_SJ_MEDIA_COLOR
705
706 Select the media color (for the same media types).
707 }
708
709 const
710 DJP_MDC_BLUE = 1;
711 DJP_MDC_BLUFF = 2;
712 DJP_MDC_GOLDENROD = 3;
713 DJP_MDC_GREEN = 4;
714 DJP_MDC_PINK = 5;
715 DJP_MDC_TRANSPARENT = 6;
716 DJP_MDC_WHITE = 7;
717 DJP_MDC_YELLOW = 8;
718 DJP_MDC_LAST = DJP_MDC_YELLOW;
719
720 type
721
722 TDJPT_MEDIA_COLOR = Cardinal;
723
724 TPDJPT_MEDIA_COLOR = Cardinal;
725 { -----------------------------------------------------------------
726 DJP_CJ_FORM
727
728 Setting will match all three fields. If szTrayname or szMedianame
729 is null then it will be defaulted to the first one found.
730
731 Querying will return all fields filled in.
732 }
733 { djpFRM }
734 { System Form name }
735 { System Tray name }
736 { System Media name }
737 { v-= Informational only =-v }
738 { Corresponding hard copy info }
739 { Display Form name (translated) }
740 { Display Tray name (translated) }
741 { Display Media name (translated) }
742 { Simple form id (if not DJP_NONE) }
743 { Simple tray id (if not DJP_NONE) }
744 { Simple media id (if not DJP_NONE) }
745
746 TdjpForm = record
747 szFormname : Str32;
748 szTrayname : Str32;
749 szMedianame : Str32;
750 ahcInfo : HCINFO;
751 szDisplayFormname : Str64;
752 szDisplayTrayname : Str64;
753 szDisplayMedianame : Str64;
754 djppsFormID : TDJPT_PAPERSIZE;
755 djpttTrayID : TDJPT_TRAYTYPE;
756 djpmdMediaID : TDJPT_MEDIA;
757 end;
758 TDJPT_FORM = TdjpForm;
759 TPDJPT_FORM = ^TdjpForm;
760 { -----------------------------------------------------------------
761 DJP_CJ_MIXEDFORMS
762
763 This is unique in that both setting and querying can have multiple
764 elements. Both the first page and the last page are DJP_MXF_INFINITY
765 (which is the separator for individual elements).
766 Some examples are:
767
768 - Only one form (form1) for the entire job.
769 (DJP_MXF_INFINITY, DJP_MXF_INFINITY, form1)
770
771 - Page 1 has form1, then pages 2 ... n have form2.
772 (DJP_MXF_INFINITY, 1, form1) (2, DJP_MXF_INFINITY, form2)
773
774 - Even pages have form1 and odd pages have form2
775 (DJP_MXF_INFINITY, DJP_MXF_ODD, form1) (DJP_MXF_EVEN, DJP_MXF_INFINITY, form2)
776 or (DJP_MXF_INFINITY, DJP_MXF_EVEN, form2) (DJP_MXF_ODD, DJP_MXF_INFINITY, form1)
777
778 - First page has form1, even pages have form2 and odd pages have form3
779 (DJP_MXF_INFINITY, 1, form1) (DJP_MXF_ODD, DJP_MXF_ODD, form1) (DJP_MXF_EVEN, DJP_MXF_INFINITY, form2)
780 or (DJP_MXF_INFINITY, 1, form1) (DJP_MXF_EVEN, DJP_MXF_EVEN, form2) (DJP_MXF_ODD, DJP_MXF_INFINITY, form1)
781
782 }
783
784 const
785 DJP_MXF_INFINITY = -(1);
786 DJP_MXF_ODD = -(2);
787 DJP_MXF_EVEN = -(3);
788 { djpMXF }
789 { Starting page number }
790 { Ending page number }
791 { Form associated with the range }
792
793 type
794
795 TdjpMixedForms = record
796 lStartRange : Longint;
797 lEndRange : Longint;
798 djpfmForm : TDJPT_FORM;
799 end;
800 TDJPT_MIXEDFORMS = TdjpMixedForms;
801 TPDJPT_MIXEDFORMS = ^TdjpMixedForms;
802 { -----------------------------------------------------------------
803 DJP_SJ_FONTDOWNLOADING
804 }
805 { Device does not support downloading }
806
807 const
808 DJP_FDL_NONE = 0;
809 { Download fonts to printer }
810 DJP_FDL_DOWNLOAD = 1;
811 { Rasterize fonts }
812 DJP_FDL_BITMAP = 2;
813 { Substitute device fonts for system }
814 DJP_FDL_SUBSTITUTE = 3;
815
816 type
817
818 TDJPT_FONTDOWNLOADING = Cardinal;
819
820 TPDJPT_FONTDOWNLOADING = Cardinal;
821 { -----------------------------------------------------------------
822 DJP_SJ_DUPLEX
823 }
824 { Device does not support duplex }
825
826 const
827 DJP_DUP_NONE = 0;
828 { Duplex is turned off }
829 DJP_DUP_OFF = 1;
830 DJP_DUP_BOOK = 2;
831 DJP_DUP_FLIP = 3;
832
833 type
834
835 TDJPT_DUPLEX = Cardinal;
836
837 TPDJPT_DUPLEX = Cardinal;
838 { -----------------------------------------------------------------
839 DJP_SJ_COLLATE
840 }
841 { Device does not support collation }
842
843 const
844 DJP_COL_NONE = 0;
845 DJP_COL_OFF = 1;
846 DJP_COL_ON = 2;
847 { more for printer dialogs than }
848 DJP_COL_PRINTER_SETTING = 3;
849 { programmatic control. Use }
850 { the setting on the printer panel. }
851
852 type
853
854 TDJPT_COLLATE = Cardinal;
855
856 TPDJPT_COLLATE = Cardinal;
857 { -----------------------------------------------------------------
858 DJP_SJ_FEED
859 }
860
861 const
862 DJP_FED_MANUAL = 1;
863 DJP_FED_AUTOMATIC = 2;
864
865 type
866
867 TDJPT_FEED = Cardinal;
868
869 TPDJPT_FEED = Cardinal;
870 { -----------------------------------------------------------------
871 DJP_SJ_COPIES
872
873 This is the number of copies on a per page basis. This is not
874 enumerateable.
875 }
876
877 TDJPT_COPIES = Cardinal;
878
879 TPDJPT_COPIES = Cardinal;
880 { -----------------------------------------------------------------
881 DJP_SJ_SCALING
882
883 This is a percentage value. This is not enumerateable.
884 }
885
886 TDJPT_SCALING = Longint;
887
888 TPDJPT_SCALING = Longint;
889 { -----------------------------------------------------------------
890 DJP_SJ_FORMFEEDCONTROL
891
892 This is a property that effects raw data jobs (print from the
893 command line, DOS print jobs, Windows print jobs). This checks
894 the very last byte of the data stream to see if it is a form
895 feed control character.
896 }
897 { Never add }
898
899 const
900 DJP_FFC_NONE = 1;
901 { Add if not seen }
902 DJP_FFC_CONDITIONAL = 2;
903 { Always add }
904 DJP_FFC_COMPULSORY = 3;
905
906 type
907
908 TDJPT_FORMFEEDCONTROL = Cardinal;
909
910 TPDJPT_FORMFEEDCONTROL = Cardinal;
911 { -----------------------------------------------------------------
912 DJP_SJ_N_UP
913
914 Number of logical pages per physical page (ex: 2-up, 4-up)
915 }
916
917 TDJPT_NUP = Longint;
918
919 TPDJPT_NUP = Longint;
920 { -----------------------------------------------------------------
921 DJP_CJ_OUTPUTBIN
922
923 Setting will only use szBinname.
924
925 Querying will return all fields filled in.
926 }
927 { djpOBN }
928 { System Bin name }
929 { v-= Informational only =-v }
930 { Display Bin name (translated) }
931 { Bin id # (-1 for no id) }
932
933 TdjpOutputBin = record
934 szBinname : Str32;
935 szDisplayBinname : Str64;
936 lBinId : Longint;
937 end;
938 TDJPT_OUTPUTBIN = TdjpOutputBin;
939 TPDJPT_OUTPUTBIN = ^TdjpOutputBin;
940 { -----------------------------------------------------------------
941 DJP_CJ_TRAYNAME
942
943 Setting will match only szTrayname. The perfered way to set which
944 tray to use is DJP_CJ_FORM. Otherwise, you are not guaranteed a
945 unique match for all three form, tray, and media possibilities.
946
947 Querying will return all fields filled in.
948 }
949 { djpTry }
950 { System Tray name }
951 { v-= Informational only =-v }
952 { Display Tray name (translated) }
953 { Simple tray id (if not DJP_NONE) }
954
955 TdjpInputTray = record
956 szTrayname : Str32;
957 szDisplayTrayname : Str64;
958 djpttTrayID : TDJPT_TRAYTYPE;
959 end;
960 TDJPT_TRAYNAME = TdjpInputTray;
961 TPDJPT_TRAYNAME = ^TdjpInputTray;
962
963
DevOpenDCnull964 function DevOpenDC(ahab: HAB; lType: Longint; pszToken: PChar; lCount: Longint; var pdopData: DevOpenStruc; hdcComp: cardinal): cardinal; cdecl;
DevCloseDCnull965 function DevCloseDC(ahdc: cardinal): cardinal; cdecl;
DevEscapenull966 function DevEscape(ahdc: cardinal; lCode, lInCount: Longint; var pbInData; var plOutCount: Longint; var pbOutData): Longint; cdecl;
DevQueryCapsnull967 function DevQueryCaps(ahdc: cardinal; lStart, lCount: Longint; var alArray: Longint): Longbool; cdecl;
DevQueryDeviceNamesnull968 function DevQueryDeviceNames(ahab: HAB; pszDriverName: PChar; var pldn: Longint; aDeviceName: Str32; aDeviceDesc: Str64; var pldt: Longint; aDataType: Str16): Longbool; cdecl;
DevQueryHardcopyCapsnull969 function DevQueryHardcopyCaps(ahdc: cardinal; lStartForm, lForms: Longint; var phciHcInfo: HCInfo): Longint; cdecl;
DevPostDeviceModesnull970 function DevPostDeviceModes(ahab: HAB; var pdrivDriverData: DrivData; pszDriverName, pszDeviceName, pszName: PChar; flOptions: cardinal): Longint; cdecl;
971
972 implementation
973
DevOpenDCnull974 function DevOpenDC(ahab: HAB; lType: Longint; pszToken: PChar; lCount: Longint; var pdopData: DevOpenStruc; hdcComp: cardinal): cardinal; cdecl;
975 external 'PMGPI' index 610;
DevCloseDCnull976 function DevCloseDC(ahdc: cardinal): cardinal; cdecl;
977 external 'PMGPI' index 604;
DevEscapenull978 function DevEscape(ahdc: cardinal; lCode, lInCount: Longint; var pbInData; var plOutCount: Longint; var pbOutData): Longint; cdecl;
979 external 'PMGPI' index 605;
DevQueryCapsnull980 function DevQueryCaps(ahdc: cardinal; lStart, lCount: Longint;var alArray: Longint): Longbool; cdecl;
981 external 'PMGPI' index 606;
DevQueryDeviceNamesnull982 function DevQueryDeviceNames(ahab: HAB; pszDriverName: PChar; var pldn: Longint; aDeviceName: Str32; aDeviceDesc: Str64; var pldt: Longint; aDataType: Str16): Longbool; cdecl;
983 external 'PMGPI' index 607;
DevQueryHardcopyCapsnull984 function DevQueryHardcopyCaps(ahdc: cardinal; lStartForm, lForms: Longint; var phciHcInfo: HCInfo): Longint; cdecl;
985 external 'PMGPI' index 608;
DevPostDeviceModesnull986 function DevPostDeviceModes(ahab: HAB; var pdrivDriverData: DrivData; pszDriverName, pszDeviceName, pszName: PChar; flOptions: cardinal): Longint; cdecl;
987 external 'PMGPI' index 609;
988
989 { was
990 #define QUERYSIZE_HEADER_SIZE (sizeof (QUERYSIZE) - sizeof (((PQUERYSIZE)NULL)->aTuples))
991 }
QUERYSIZE_HEADER_SIZEnull992 // function QUERYSIZE_HEADER_SIZE : longint;
993 // { return type might be wrong }
994 // begin
995 // QUERYSIZE_HEADER_SIZE:=(sizeof(QUERYSIZE)) - (sizeof((TPQUERYSIZE(NULL))^.aTuples));
996 // end;
997
998 // #define DJP_HEADER_SIZE (sizeof (DJP_ITEM) - sizeof (((PDJP_ITEM)NULL)->ulValue))
999 // #define DJP_NEXT_STRUCTP(p) ((PDJP_ITEM)((PBYTE)(p) + (p)->cb))
1000 // #define DJP_ELEMENTP(s,t) ((t*)&((s).ulValue))
1001 // #define DJP_SET_ELEMENT(s,t,e) (*DJP_ELEMENTP (s,t) = (e))
1002
1003 { was #define dname def_expr }
1004 // function DJP_HEADER_SIZE : longint;
1005 // { return type might be wrong }
1006 // begin
1007 // DJP_HEADER_SIZE:=(sizeof(DJP_ITEM)) - (sizeof((TPDJP_ITEM(NULL))^.ulValue));
1008 // end;
1009
1010 { was #define dname(params) para_def_expr }
1011 { argument types are unknown }
1012 // function DJP_NEXT_STRUCTP(p : longint) : TPDJP_ITEM;
1013 // begin
1014 // DJP_NEXT_STRUCTP:=TPDJP_ITEM((TPBYTE(p)) + (p^.cb));
1015 // end;
1016
1017 { was #define dname(params) para_def_expr }
1018 { argument types are unknown }
1019 // function DJP_ELEMENTP(s,t : longint) : ^Tt;
1020 // begin
1021 // DJP_ELEMENTP:=^Tt(@(s.ulValue));
1022 // end;
1023
1024 end.
1025