Twain_DSM  1.0
twain.h
1 /* ======================================================================== *\
2 
3  Copyright (C) 2007 TWAIN Working Group: Adobe Systems Incorporated,
4  AnyDoc Software Inc., Eastman Kodak Company, Fujitsu Computer Products
5  of America, JFL Peripheral Solutions Inc., Ricoh Corporation, and
6  Xerox Corporation. All rights reserved.
7 
8  Copyright (C) 1991, 1992 TWAIN Working Group: Aldus, Caere, Eastman-Kodak,
9  Hewlett-Packard and Logitech Corporations. All rights reserved.
10 
11  Copyright (C) 1997 TWAIN Working Group: Bell+Howell, Canon, DocuMagix,
12  Fujitsu, Genoa Technology, Hewlett-Packard, Kofax Imaging Products, and
13  Ricoh Corporation. All rights reserved.
14 
15  Copyright (C) 1998 TWAIN Working Group: Adobe Systems Incorporated,
16  Canon Information Systems, Eastman Kodak Company,
17  Fujitsu Computer Products of America, Genoa Technology,
18  Hewlett-Packard Company, Intel Corporation, Kofax Image Products,
19  JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation.
20  All rights reserved.
21 
22  Copyright (C) 2000 TWAIN Working Group: Adobe Systems Incorporated,
23  Canon Information Systems, Digimarc Corporation, Eastman Kodak Company,
24  Fujitsu Computer Products of America, Hewlett-Packard Company,
25  JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation.
26  All rights reserved.
27 
28 
29  TWAIN.h - This is the definitive include file for applications and
30  data sources written to the TWAIN specification.
31  It defines constants, data structures, messages etc.
32  for the public interface to TWAIN.
33 
34  Revision History:
35  version 1.0, March 6, 1992. TWAIN 1.0.
36  version 1.1, January 1993. Tech Notes 1.1
37  version 1.5, June 1993. Specification Update 1.5
38  Change DC to TW
39  Change filename from DC.H to TWAIN.H
40  version 1.5, July 1993. Remove spaces from country identifiers
41 
42  version 1.7, July 1997 Added Capabilities and data structure for
43  document imaging and digital cameras.
44  KHL.
45  version 1.7, July 1997 Inserted Borland compatibile structure packing
46  directives provided by Mentor. JMH
47  version 1.7, Aug 1997 Expanded file tabs to spaces.
48  NOTE: future authors should be sure to have
49  their editors set to automatically expand tabs
50  to spaces (original tab setting was 4 spaces).
51  version 1.7, Sept 1997 Added job control values
52  Added return codes
53  version 1.7, Sept 1997 changed definition of pRGBRESPONSE to
54  pTW_RGBRESPONSE
55  version 1.7 Aug 1998 Added missing TWEI_BARCODEROTATION values
56  TWBCOR_ types JMH
57  version 1.8 August 1998 Added new types and definitions required
58  for 1.8 Specification JMH
59  version 1.8 January 1999 Changed search mode from SRCH_ to TWBD_ as
60  in 1.8 Specification, added TWBT_MAXICODE JMH
61  version 1.8 January 1999 Removed undocumented duplicate AUTO<cap> JMH
62  version 1.8 March 1999 Removed undocumented 1.8 caps:
63  CAP_FILESYSTEM
64  CAP_PAPERBINDING
65  CAP_PASSTHRU
66  CAP_POWERDOWNTIME
67  ICAP_AUTODISCARDBLANKPAGES
68  * CAP_PAGEMULTIPLEACQUIRE - is CAP_REACQUIREALLOWED,
69  requires spec change. JMH
70  Added Mac structure packing modifications JMH
71  version 1.9 March 2000 Added new types and definations required
72  for 1.9 Specification MLM
73  version 1.9 March 2000 Added ICAP_JPEGQUALITY, TWJQ_ values,
74  updated TWON_PROTOCOLMINOR for Release v1.9 MN
75  version 1.91 August 2007 Added new types and definitions required
76  for 1.91 Specification MLM
77  version 2.0 Sept 2007 Added new types and definitions required
78  for 2.0 Specification FHH
79  version 2.0 Mar 2008 Depreciated ICAP_PIXELTYPEs TWPT_SRGB64, TWPT_BGR,
80  TWPT_CIELAB, TWPT_CIELUV, and TWPT_YCBCR JMW
81  version 2.0 Mar 2008 Added missing new 2.0 CAP_ definitions JMW
82  version 2.0 Dec 2008 Updated TW_INFO structure for 64bit JMW
83  version 2.1 Mar 2009 Added new types and definitions required
84  for 2.1 Specification JMW
85  version 2.2 Nov 2010 Added new types and definitions required
86  for 2.2 Specification MSM
87  version 2.3 Feb 2013 Added new types and definitions required
88  for 2.3 Specification MLM
89  version 2.3a Apr 2015 Errata fixes to TWCY_ANDORRA and TWCY_CUBA
90  version 2.4 Aug 2015 Added new types and definitions required
91  for 2.4 Specification MLM
92  version 2.4a June 2016 Added TW_INT32 and TW_UINT32 fixes for Linux,
93  (I just added this comment today)
94  version 2.4b March 2017 Missing changeset from 2.3 verion (2013/06/20)
95 
96 
97 \* ======================================================================== */
98 
99 #ifndef TWAIN
100 #define TWAIN
101 
102 /****************************************************************************
103  * TWAIN Version *
104  ****************************************************************************/
105 #define TWON_PROTOCOLMINOR 4 /* Changed for Version 2.4 */
106 #define TWON_PROTOCOLMAJOR 2
107 
108 /****************************************************************************
109  * Platform Dependent Definitions and Typedefs *
110  ****************************************************************************/
111 
112 /* Microsoft C/C++ Compiler */
113 #if defined(WIN32) || defined(WIN64) || defined (_WINDOWS)
114  #define TWH_CMP_MSC
115  #if defined(_WIN64) || defined(WIN64)
116  #define TWH_64BIT
117  #elif defined(WIN32) || defined(_WIN32)
118  #define TWH_32BIT
119  #endif
120 
121 /* GNU C/C++ Compiler */
122 #elif defined(__GNUC__)
123  #define TWH_CMP_GNU
124  #if defined(__alpha__)\
125  ||defined(__ia64__)\
126  ||defined(__ppc64__)\
127  ||defined(__s390x__)\
128  ||defined(__x86_64__)
129  #define TWH_64BIT
130  #else
131  #define TWH_32BIT
132  #endif
133 
134 
135 /* Borland C/C++ Compiler */
136 #elif defined(__BORLAND__)
137  #define TWH_CMP_BORLAND
138  #define TWH_32BIT
139 /* Unrecognized */
140 #else
141  #error Unrecognized compiler
142 #endif
143 
144 /* Apple Compiler (which is GNU now) */
145 #if defined(__APPLE__)
146  #define TWH_CMP_XCODE
147  #ifdef __MWERKS__
148  #include <Carbon.h>
149  #else
150  #include <Carbon/Carbon.h>
151  #endif
152 #endif
153 
154 /* Win32 and Win64 systems */
155 #if defined(TWH_CMP_MSC) | defined(TWH_CMP_BORLAND)
156  typedef HANDLE TW_HANDLE;
157  typedef LPVOID TW_MEMREF;
158  typedef UINT_PTR TW_UINTPTR;
159 
160 /* MacOS/X... */
161 #elif defined(TWH_CMP_XCODE)
162  #define PASCAL pascal
163  #define FAR
164  typedef Handle TW_HANDLE;
165  typedef char *TW_MEMREF;
166  typedef unsigned char BYTE;
167 
168  #ifdef TWH_32BIT
169  //32 bit GNU
170  typedef unsigned long TW_UINTPTR;
171  #else
172  //64 bit GNU
173  typedef unsigned long long TW_UINTPTR;
174  #endif
175 
176 /* Everything else... */
177 #else
178  #define PASCAL
179  #define FAR
180  typedef void* TW_HANDLE;
181  typedef void* TW_MEMREF;
182  typedef unsigned char BYTE;
183 
184  #ifdef TWH_32BIT
185  //32 bit GNU
186  typedef unsigned long TW_UINTPTR;
187  #else
188  //64 bit GNU
189  typedef unsigned long long TW_UINTPTR;
190  #endif
191 #endif
192 
193 
194 /* Set the packing: this occurs before any structures are defined */
195 #ifdef TWH_CMP_MSC
196  #pragma pack (push, before_twain)
197  #pragma pack (2)
198 #elif defined(TWH_CMP_GNU)
199  #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */
200  #pragma options align = power
201  #else
202  #pragma pack (push, before_twain)
203  #pragma pack (2)
204  #endif
205 #elif defined(TWH_CMP_BORLAND)
206  #pragma option -a2
207 #endif
208 
209 
210 /****************************************************************************
211  * Type Definitions *
212  ****************************************************************************/
213 
214 /* String types. These include room for the strings and a NULL char, *
215  * or, on the Mac, a length byte followed by the string. *
216  * TW_STR255 must hold less than 256 chars so length fits in first byte. */
217 #if defined(__APPLE__)/* cf: Mac version of TWAIN.h */
218  typedef unsigned char TW_STR32[34], FAR *pTW_STR32;
219  typedef unsigned char TW_STR64[66], FAR *pTW_STR64;
220  typedef unsigned char TW_STR128[130], FAR *pTW_STR128;
221  typedef unsigned char TW_STR255[256], FAR *pTW_STR255;
222 #else
223  typedef char TW_STR32[34], FAR *pTW_STR32;
224  typedef char TW_STR64[66], FAR *pTW_STR64;
225  typedef char TW_STR128[130], FAR *pTW_STR128;
226  typedef char TW_STR255[256], FAR *pTW_STR255;
227 #endif
228 
229 /* Numeric types. */
230 typedef char TW_INT8, FAR *pTW_INT8;
231 typedef short TW_INT16, FAR *pTW_INT16;
232 #if defined(_WIN32)
233  typedef long TW_INT32, FAR *pTW_INT32;
234 #else
235  typedef int TW_INT32, FAR *pTW_INT32;
236 #endif
237 typedef unsigned char TW_UINT8, FAR *pTW_UINT8;
238 typedef unsigned short TW_UINT16, FAR *pTW_UINT16;
239 #if defined(_WIN32)
240  typedef unsigned long TW_UINT32, FAR *pTW_UINT32;
241 #else
242  typedef unsigned int TW_UINT32, FAR *pTW_UINT32;
243 #endif
244 typedef unsigned short TW_BOOL, FAR *pTW_BOOL;
245 
246 
247 /****************************************************************************
248  * Structure Definitions *
249  ****************************************************************************/
250 
251 /* Fixed point structure type. */
252 typedef struct {
253  TW_INT16 Whole;
254  TW_UINT16 Frac;
255 } TW_FIX32, FAR *pTW_FIX32;
256 
257 /* Defines a frame rectangle in ICAP_UNITS coordinates. */
258 typedef struct {
259  TW_FIX32 Left;
260  TW_FIX32 Top;
261  TW_FIX32 Right;
262  TW_FIX32 Bottom;
263 } TW_FRAME, FAR * pTW_FRAME;
264 
265 /* Defines the parameters used for channel-specific transformation. */
266 typedef struct {
267  TW_FIX32 StartIn;
268  TW_FIX32 BreakIn;
269  TW_FIX32 EndIn;
270  TW_FIX32 StartOut;
271  TW_FIX32 BreakOut;
272  TW_FIX32 EndOut;
273  TW_FIX32 Gamma;
274  TW_FIX32 SampleCount;
276 
277 /* Stores a Fixed point number in two parts, a whole and a fractional part. */
278 typedef struct {
279  TW_DECODEFUNCTION Decode[3];
280  TW_FIX32 Mix[3][3];
282 
283 /* Container for array of values */
284 typedef struct {
285  TW_UINT16 ItemType;
286  TW_UINT32 NumItems;
287  TW_UINT8 ItemList[1];
288 } TW_ARRAY, FAR * pTW_ARRAY;
289 
290 /* Information about audio data */
291 typedef struct {
292  TW_STR255 Name;
293  TW_UINT32 Reserved;
294 } TW_AUDIOINFO, FAR * pTW_AUDIOINFO;
295 
296 /* Used to register callbacks. */
297 typedef struct {
298  TW_MEMREF CallBackProc;
299  #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */
300  TW_MEMREF RefCon;
301  #else
302  TW_UINT32 RefCon;
303  #endif
304  TW_INT16 Message;
305 } TW_CALLBACK, FAR * pTW_CALLBACK;
306 
307 /* Used to register callbacks. */
308 typedef struct {
309  TW_MEMREF CallBackProc;
310  TW_UINTPTR RefCon;
311  TW_INT16 Message;
312 } TW_CALLBACK2, FAR * pTW_CALLBACK2;
313 
314 /* Used by application to get/set capability from/in a data source. */
315 typedef struct {
316  TW_UINT16 Cap;
317  TW_UINT16 ConType;
318  TW_HANDLE hContainer;
320 
321 /* Defines a CIE XYZ space tri-stimulus value. */
322 typedef struct {
323  TW_FIX32 X;
324  TW_FIX32 Y;
325  TW_FIX32 Z;
326 } TW_CIEPOINT, FAR * pTW_CIEPOINT;
327 
328 /* Defines the mapping from an RGB color space device into CIE 1931 (XYZ) color space. */
329 typedef struct {
330  TW_UINT16 ColorSpace;
331  TW_INT16 LowEndian;
332  TW_INT16 DeviceDependent;
333  TW_INT32 VersionNumber;
334  TW_TRANSFORMSTAGE StageABC;
335  TW_TRANSFORMSTAGE StageLMN;
336  TW_CIEPOINT WhitePoint;
337  TW_CIEPOINT BlackPoint;
338  TW_CIEPOINT WhitePaper;
339  TW_CIEPOINT BlackInk;
340  TW_FIX32 Samples[1];
341 } TW_CIECOLOR, FAR * pTW_CIECOLOR;
342 
343 /* Allows for a data source and application to pass custom data to each other. */
344 typedef struct {
345  TW_UINT32 InfoLength;
346  TW_HANDLE hData;
348 
349 /* Provides information about the Event that was raised by the Source */
350 typedef struct {
351  TW_UINT32 Event;
352  TW_STR255 DeviceName;
353  TW_UINT32 BatteryMinutes;
354  TW_INT16 BatteryPercentage;
355  TW_INT32 PowerSupply;
356  TW_FIX32 XResolution;
357  TW_FIX32 YResolution;
358  TW_UINT32 FlashUsed2;
359  TW_UINT32 AutomaticCapture;
360  TW_UINT32 TimeBeforeFirstCapture;
361  TW_UINT32 TimeBetweenCaptures;
363 
364 /* This structure holds the tri-stimulus color palette information for TW_PALETTE8 structures.*/
365 typedef struct {
366  TW_UINT8 Index;
367  TW_UINT8 Channel1;
368  TW_UINT8 Channel2;
369  TW_UINT8 Channel3;
370 } TW_ELEMENT8, FAR * pTW_ELEMENT8;
371 
372 /* Stores a group of individual values describing a capability. */
373 typedef struct {
374  TW_UINT16 ItemType;
375  TW_UINT32 NumItems;
376  TW_UINT32 CurrentIndex;
377  TW_UINT32 DefaultIndex;
378  TW_UINT8 ItemList[1];
380 
381 /* Used to pass application events/messages from the application to the Source. */
382 typedef struct {
383  TW_MEMREF pEvent;
384  TW_UINT16 TWMessage;
385 } TW_EVENT, FAR * pTW_EVENT;
386 
387 /* This structure is used to pass specific information between the data source and the application. */
388 typedef struct {
389  TW_UINT16 InfoID;
390  TW_UINT16 ItemType;
391  TW_UINT16 NumItems;
392  union {
393  TW_UINT16 ReturnCode;
394  TW_UINT16 CondCode; // Deprecated, do not use
395  };
396  TW_UINTPTR Item;
397 }TW_INFO, FAR* pTW_INFO;
398 
399 typedef struct {
400  TW_UINT32 NumInfos;
401  TW_INFO Info[1];
403 
404 /* Provides information about the currently selected device */
405 typedef struct {
406  TW_STR255 InputName;
407  TW_STR255 OutputName;
408  TW_MEMREF Context;
409  union {
410  int Recursive;
411  TW_BOOL Subdirectories;
412  };
413  union {
414  TW_INT32 FileType;
415  TW_UINT32 FileSystemType;
416  };
417  TW_UINT32 Size;
418  TW_STR32 CreateTimeDate;
419  TW_STR32 ModifiedTimeDate;
420  TW_UINT32 FreeSpace;
421  TW_INT32 NewImageSize;
422  TW_UINT32 NumberOfFiles;
423  TW_UINT32 NumberOfSnippets;
424  TW_UINT32 DeviceGroupMask;
425  TW_INT8 Reserved[508];
427 
428 /* This structure is used by the application to specify a set of mapping values to be applied to grayscale data. */
429 typedef struct {
430  TW_ELEMENT8 Response[1];
432 
433 /* A general way to describe the version of software that is running. */
434 typedef struct {
435  TW_UINT16 MajorNum;
436  TW_UINT16 MinorNum;
437  TW_UINT16 Language;
438  TW_UINT16 Country;
439  TW_STR32 Info;
440 } TW_VERSION, FAR * pTW_VERSION;
441 
442 /* Provides identification information about a TWAIN entity.*/
443 typedef struct {
444  #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */
445  TW_MEMREF Id;
446  #else
447  TW_UINT32 Id;
448  #endif
449  TW_VERSION Version;
450  TW_UINT16 ProtocolMajor;
451  TW_UINT16 ProtocolMinor;
452  TW_UINT32 SupportedGroups;
453  TW_STR32 Manufacturer;
454  TW_STR32 ProductFamily;
455  TW_STR32 ProductName;
456 } TW_IDENTITY, FAR * pTW_IDENTITY;
457 
458 /* Describes the "real" image data, that is, the complete image being transferred between the Source and application. */
459 typedef struct {
460  TW_FIX32 XResolution;
461  TW_FIX32 YResolution;
462  TW_INT32 ImageWidth;
463  TW_INT32 ImageLength;
464  TW_INT16 SamplesPerPixel;
465  TW_INT16 BitsPerSample[8];
466  TW_INT16 BitsPerPixel;
467  TW_BOOL Planar;
468  TW_INT16 PixelType;
469  TW_UINT16 Compression;
470 } TW_IMAGEINFO, FAR * pTW_IMAGEINFO;
471 
472 /* Involves information about the original size of the acquired image. */
473 typedef struct {
474  TW_FRAME Frame;
475  TW_UINT32 DocumentNumber;
476  TW_UINT32 PageNumber;
477  TW_UINT32 FrameNumber;
479 
480 /* Provides information for managing memory buffers. */
481 typedef struct {
482  TW_UINT32 Flags;
483  TW_UINT32 Length;
484  TW_MEMREF TheMem;
485 } TW_MEMORY, FAR * pTW_MEMORY;
486 
487 /* Describes the form of the acquired data being passed from the Source to the application.*/
488 typedef struct {
489  TW_UINT16 Compression;
490  TW_UINT32 BytesPerRow;
491  TW_UINT32 Columns;
492  TW_UINT32 Rows;
493  TW_UINT32 XOffset;
494  TW_UINT32 YOffset;
495  TW_UINT32 BytesWritten;
496  TW_MEMORY Memory;
498 
499 /* Describes the information necessary to transfer a JPEG-compressed image. */
500 typedef struct {
501  TW_UINT16 ColorSpace;
502  TW_UINT32 SubSampling;
503  TW_UINT16 NumComponents;
504  TW_UINT16 RestartFrequency;
505  TW_UINT16 QuantMap[4];
506  TW_MEMORY QuantTable[4];
507  TW_UINT16 HuffmanMap[4];
508  TW_MEMORY HuffmanDC[2];
509  TW_MEMORY HuffmanAC[2];
511 
512 /* Collects scanning metrics after returning to state 4 */
513 typedef struct {
514  TW_UINT32 SizeOf;
515  TW_UINT32 ImageCount;
516  TW_UINT32 SheetCount;
517 } TW_METRICS, FAR * pTW_METRICS;
518 
519 /* Stores a single value (item) which describes a capability. */
520 typedef struct {
521  TW_UINT16 ItemType;
522  TW_UINT32 Item;
523 } TW_ONEVALUE, FAR * pTW_ONEVALUE;
524 
525 /* This structure holds the color palette information. */
526 typedef struct {
527  TW_UINT16 NumColors;
528  TW_UINT16 PaletteType;
529  TW_ELEMENT8 Colors[256];
530 } TW_PALETTE8, FAR * pTW_PALETTE8;
531 
532 /* Used to bypass the TWAIN protocol when communicating with a device */
533 typedef struct {
534  TW_MEMREF pCommand;
535  TW_UINT32 CommandBytes;
536  TW_INT32 Direction;
537  TW_MEMREF pData;
538  TW_UINT32 DataBytes;
539  TW_UINT32 DataBytesXfered;
540 } TW_PASSTHRU, FAR * pTW_PASSTHRU;
541 
542 /* This structure tells the application how many more complete transfers the Source currently has available. */
543 typedef struct {
544  TW_UINT16 Count;
545  union {
546  TW_UINT32 EOJ;
547  TW_UINT32 Reserved;
548  #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */
549  union {
550  TW_UINT32 EOJ;
551  TW_UINT32 Reserved;
552  } TW_JOBCONTROL;
553  #endif
554  };
556 
557 /* Stores a range of individual values describing a capability. */
558 typedef struct {
559  TW_UINT16 ItemType;
560  TW_UINT32 MinValue;
561  TW_UINT32 MaxValue;
562  TW_UINT32 StepSize;
563  TW_UINT32 DefaultValue;
564  TW_UINT32 CurrentValue;
565 } TW_RANGE, FAR * pTW_RANGE;
566 
567 /* This structure is used by the application to specify a set of mapping values to be applied to RGB color data. */
568 typedef struct {
569  TW_ELEMENT8 Response[1];
571 
572 /* Describes the file format and file specification information for a transfer through a disk file. */
573 typedef struct {
574  TW_STR255 FileName;
575  TW_UINT16 Format;
576  TW_INT16 VRefNum;
578 
579 /* Provides the application information about the Source's requirements and preferences regarding allocation of transfer buffer(s). */
580 typedef struct {
581  TW_UINT32 MinBufSize;
582  TW_UINT32 MaxBufSize;
583  TW_UINT32 Preferred;
585 
586 /* Describes the status of a source. */
587 typedef struct {
588  TW_UINT16 ConditionCode;
589  union {
590  TW_UINT16 Data;
591  TW_UINT16 Reserved;
592  };
593 } TW_STATUS, FAR * pTW_STATUS;
594 
595 /* Translates the contents of Status into a localized UTF8string. */
596 typedef struct {
597  TW_STATUS Status;
598  TW_UINT32 Size;
599  TW_HANDLE UTF8string;
601 
602 typedef struct {
603  TW_UINT32 SizeOf;
604  TW_UINT16 CommunicationManager;
605  TW_HANDLE Send;
606  TW_UINT32 SendSize;
607  TW_HANDLE Receive;
608  TW_UINT32 ReceiveSize;
610 
611 /* This structure is used to handle the user interface coordination between an application and a Source. */
612 typedef struct {
613  TW_BOOL ShowUI;
614  TW_BOOL ModalUI;
615  TW_HANDLE hParent;
617 
618 
619 /****************************************************************************
620  * Generic Constants *
621  ****************************************************************************/
622 
623 #define TWON_ARRAY 3
624 #define TWON_ENUMERATION 4
625 #define TWON_ONEVALUE 5
626 #define TWON_RANGE 6
627 
628 #define TWON_ICONID 962
629 #define TWON_DSMID 461
630 #define TWON_DSMCODEID 63
631 
632 #define TWON_DONTCARE8 0xff
633 #define TWON_DONTCARE16 0xffff
634 #define TWON_DONTCARE32 0xffffffff
635 
636 /* Flags used in TW_MEMORY structure. */
637 #define TWMF_APPOWNS 0x0001
638 #define TWMF_DSMOWNS 0x0002
639 #define TWMF_DSOWNS 0x0004
640 #define TWMF_POINTER 0x0008
641 #define TWMF_HANDLE 0x0010
642 
643 #define TWTY_INT8 0x0000
644 #define TWTY_INT16 0x0001
645 #define TWTY_INT32 0x0002
646 
647 #define TWTY_UINT8 0x0003
648 #define TWTY_UINT16 0x0004
649 #define TWTY_UINT32 0x0005
650 
651 #define TWTY_BOOL 0x0006
652 
653 #define TWTY_FIX32 0x0007
654 
655 #define TWTY_FRAME 0x0008
656 
657 #define TWTY_STR32 0x0009
658 #define TWTY_STR64 0x000a
659 #define TWTY_STR128 0x000b
660 #define TWTY_STR255 0x000c
661 #define TWTY_HANDLE 0x000f
662 
663 
664 /****************************************************************************
665  * Capability Constants *
666  ****************************************************************************/
667 
668 /* CAP_ALARMS values */
669 #define TWAL_ALARM 0
670 #define TWAL_FEEDERERROR 1
671 #define TWAL_FEEDERWARNING 2
672 #define TWAL_BARCODE 3
673 #define TWAL_DOUBLEFEED 4
674 #define TWAL_JAM 5
675 #define TWAL_PATCHCODE 6
676 #define TWAL_POWER 7
677 #define TWAL_SKEW 8
678 
679 /* ICAP_AUTOSIZE values */
680 #define TWAS_NONE 0
681 #define TWAS_AUTO 1
682 #define TWAS_CURRENT 2
683 
684 /* TWEI_BARCODEROTATION values */
685 #define TWBCOR_ROT0 0
686 #define TWBCOR_ROT90 1
687 #define TWBCOR_ROT180 2
688 #define TWBCOR_ROT270 3
689 #define TWBCOR_ROTX 4
690 
691 /* ICAP_BARCODESEARCHMODE values */
692 #define TWBD_HORZ 0
693 #define TWBD_VERT 1
694 #define TWBD_HORZVERT 2
695 #define TWBD_VERTHORZ 3
696 
697 /* ICAP_BITORDER values */
698 #define TWBO_LSBFIRST 0
699 #define TWBO_MSBFIRST 1
700 
701 /* ICAP_AUTODISCARDBLANKPAGES values */
702 #define TWBP_DISABLE -2
703 #define TWBP_AUTO -1
704 
705 /* ICAP_BITDEPTHREDUCTION values */
706 #define TWBR_THRESHOLD 0
707 #define TWBR_HALFTONE 1
708 #define TWBR_CUSTHALFTONE 2
709 #define TWBR_DIFFUSION 3
710 #define TWBR_DYNAMICTHRESHOLD 4
711 
712 /* ICAP_SUPPORTEDBARCODETYPES and TWEI_BARCODETYPE values*/
713 #define TWBT_3OF9 0
714 #define TWBT_2OF5INTERLEAVED 1
715 #define TWBT_2OF5NONINTERLEAVED 2
716 #define TWBT_CODE93 3
717 #define TWBT_CODE128 4
718 #define TWBT_UCC128 5
719 #define TWBT_CODABAR 6
720 #define TWBT_UPCA 7
721 #define TWBT_UPCE 8
722 #define TWBT_EAN8 9
723 #define TWBT_EAN13 10
724 #define TWBT_POSTNET 11
725 #define TWBT_PDF417 12
726 #define TWBT_2OF5INDUSTRIAL 13
727 #define TWBT_2OF5MATRIX 14
728 #define TWBT_2OF5DATALOGIC 15
729 #define TWBT_2OF5IATA 16
730 #define TWBT_3OF9FULLASCII 17
731 #define TWBT_CODABARWITHSTARTSTOP 18
732 #define TWBT_MAXICODE 19
733 #define TWBT_QRCODE 20
734 
735 /* ICAP_COMPRESSION values*/
736 #define TWCP_NONE 0
737 #define TWCP_PACKBITS 1
738 #define TWCP_GROUP31D 2
739 #define TWCP_GROUP31DEOL 3
740 #define TWCP_GROUP32D 4
741 #define TWCP_GROUP4 5
742 #define TWCP_JPEG 6
743 #define TWCP_LZW 7
744 #define TWCP_JBIG 8
745 #define TWCP_PNG 9
746 #define TWCP_RLE4 10
747 #define TWCP_RLE8 11
748 #define TWCP_BITFIELDS 12
749 #define TWCP_ZIP 13
750 #define TWCP_JPEG2000 14
751 
752 /* CAP_CAMERASIDE and TWEI_PAGESIDE values */
753 #define TWCS_BOTH 0
754 #define TWCS_TOP 1
755 #define TWCS_BOTTOM 2
756 
757 /* CAP_DEVICEEVENT values */
758 #define TWDE_CUSTOMEVENTS 0x8000
759 #define TWDE_CHECKAUTOMATICCAPTURE 0
760 #define TWDE_CHECKBATTERY 1
761 #define TWDE_CHECKDEVICEONLINE 2
762 #define TWDE_CHECKFLASH 3
763 #define TWDE_CHECKPOWERSUPPLY 4
764 #define TWDE_CHECKRESOLUTION 5
765 #define TWDE_DEVICEADDED 6
766 #define TWDE_DEVICEOFFLINE 7
767 #define TWDE_DEVICEREADY 8
768 #define TWDE_DEVICEREMOVED 9
769 #define TWDE_IMAGECAPTURED 10
770 #define TWDE_IMAGEDELETED 11
771 #define TWDE_PAPERDOUBLEFEED 12
772 #define TWDE_PAPERJAM 13
773 #define TWDE_LAMPFAILURE 14
774 #define TWDE_POWERSAVE 15
775 #define TWDE_POWERSAVENOTIFY 16
776 
777 /* TW_PASSTHRU.Direction values. */
778 #define TWDR_GET 1
779 #define TWDR_SET 2
780 
781 /* TWEI_DESKEWSTATUS values. */
782 #define TWDSK_SUCCESS 0
783 #define TWDSK_REPORTONLY 1
784 #define TWDSK_FAIL 2
785 #define TWDSK_DISABLED 3
786 
787 /* CAP_DUPLEX values */
788 #define TWDX_NONE 0
789 #define TWDX_1PASSDUPLEX 1
790 #define TWDX_2PASSDUPLEX 2
791 
792 /* CAP_FEEDERALIGNMENT values */
793 #define TWFA_NONE 0
794 #define TWFA_LEFT 1
795 #define TWFA_CENTER 2
796 #define TWFA_RIGHT 3
797 
798 /* ICAP_FEEDERTYPE values*/
799 #define TWFE_GENERAL 0
800 #define TWFE_PHOTO 1
801 
802 /* ICAP_IMAGEFILEFORMAT values */
803 #define TWFF_TIFF 0
804 #define TWFF_PICT 1
805 #define TWFF_BMP 2
806 #define TWFF_XBM 3
807 #define TWFF_JFIF 4
808 #define TWFF_FPX 5
809 #define TWFF_TIFFMULTI 6
810 #define TWFF_PNG 7
811 #define TWFF_SPIFF 8
812 #define TWFF_EXIF 9
813 #define TWFF_PDF 10
814 #define TWFF_JP2 11
815 #define TWFF_JPX 13
816 #define TWFF_DEJAVU 14
817 #define TWFF_PDFA 15
818 #define TWFF_PDFA2 16
819 #define TWFF_PDFRASTER 17
820 
821 /* ICAP_FLASHUSED2 values */
822 #define TWFL_NONE 0
823 #define TWFL_OFF 1
824 #define TWFL_ON 2
825 #define TWFL_AUTO 3
826 #define TWFL_REDEYE 4
827 
828 /* CAP_FEEDERORDER values */
829 #define TWFO_FIRSTPAGEFIRST 0
830 #define TWFO_LASTPAGEFIRST 1
831 
832 /* CAP_FEEDERPOCKET values*/
833 #define TWFP_POCKETERROR 0
834 #define TWFP_POCKET1 1
835 #define TWFP_POCKET2 2
836 #define TWFP_POCKET3 3
837 #define TWFP_POCKET4 4
838 #define TWFP_POCKET5 5
839 #define TWFP_POCKET6 6
840 #define TWFP_POCKET7 7
841 #define TWFP_POCKET8 8
842 #define TWFP_POCKET9 9
843 #define TWFP_POCKET10 10
844 #define TWFP_POCKET11 11
845 #define TWFP_POCKET12 12
846 #define TWFP_POCKET13 13
847 #define TWFP_POCKET14 14
848 #define TWFP_POCKET15 15
849 #define TWFP_POCKET16 16
850 
851 /* ICAP_FLIPROTATION values */
852 #define TWFR_BOOK 0
853 #define TWFR_FANFOLD 1
854 
855 /* ICAP_FILTER values */
856 #define TWFT_RED 0
857 #define TWFT_GREEN 1
858 #define TWFT_BLUE 2
859 #define TWFT_NONE 3
860 #define TWFT_WHITE 4
861 #define TWFT_CYAN 5
862 #define TWFT_MAGENTA 6
863 #define TWFT_YELLOW 7
864 #define TWFT_BLACK 8
865 
866 /* TW_FILESYSTEM.FileType values */
867 #define TWFY_CAMERA 0
868 #define TWFY_CAMERATOP 1
869 #define TWFY_CAMERABOTTOM 2
870 #define TWFY_CAMERAPREVIEW 3
871 #define TWFY_DOMAIN 4
872 #define TWFY_HOST 5
873 #define TWFY_DIRECTORY 6
874 #define TWFY_IMAGE 7
875 #define TWFY_UNKNOWN 8
876 
877 /* ICAP_ICCPROFILE values */
878 #define TWIC_NONE 0
879 #define TWIC_LINK 1
880 #define TWIC_EMBED 2
881 
882 /* ICAP_IMAGEFILTER values */
883 #define TWIF_NONE 0
884 #define TWIF_AUTO 1
885 #define TWIF_LOWPASS 2
886 #define TWIF_BANDPASS 3
887 #define TWIF_HIGHPASS 4
888 #define TWIF_TEXT TWIF_BANDPASS
889 #define TWIF_FINELINE TWIF_HIGHPASS
890 
891 /* ICAP_IMAGEMERGE values */
892 #define TWIM_NONE 0
893 #define TWIM_FRONTONTOP 1
894 #define TWIM_FRONTONBOTTOM 2
895 #define TWIM_FRONTONLEFT 3
896 #define TWIM_FRONTONRIGHT 4
897 
898 /* CAP_JOBCONTROL values */
899 #define TWJC_NONE 0
900 #define TWJC_JSIC 1
901 #define TWJC_JSIS 2
902 #define TWJC_JSXC 3
903 #define TWJC_JSXS 4
904 
905 /* ICAP_JPEGQUALITY values */
906 #define TWJQ_UNKNOWN -4
907 #define TWJQ_LOW -3
908 #define TWJQ_MEDIUM -2
909 #define TWJQ_HIGH -1
910 
911 /* ICAP_LIGHTPATH values */
912 #define TWLP_REFLECTIVE 0
913 #define TWLP_TRANSMISSIVE 1
914 
915 /* ICAP_LIGHTSOURCE values */
916 #define TWLS_RED 0
917 #define TWLS_GREEN 1
918 #define TWLS_BLUE 2
919 #define TWLS_NONE 3
920 #define TWLS_WHITE 4
921 #define TWLS_UV 5
922 #define TWLS_IR 6
923 
924 /* TWEI_MAGTYPE values */
925 #define TWMD_MICR 0
926 #define TWMD_RAW 1
927 #define TWMD_INVALID 2
928 
929 /* ICAP_NOISEFILTER values */
930 #define TWNF_NONE 0
931 #define TWNF_AUTO 1
932 #define TWNF_LONEPIXEL 2
933 #define TWNF_MAJORITYRULE 3
934 
935 /* ICAP_ORIENTATION values */
936 #define TWOR_ROT0 0
937 #define TWOR_ROT90 1
938 #define TWOR_ROT180 2
939 #define TWOR_ROT270 3
940 #define TWOR_PORTRAIT TWOR_ROT0
941 #define TWOR_LANDSCAPE TWOR_ROT270
942 #define TWOR_AUTO 4
943 #define TWOR_AUTOTEXT 5
944 #define TWOR_AUTOPICTURE 6
945 
946 /* ICAP_OVERSCAN values */
947 #define TWOV_NONE 0
948 #define TWOV_AUTO 1
949 #define TWOV_TOPBOTTOM 2
950 #define TWOV_LEFTRIGHT 3
951 #define TWOV_ALL 4
952 
953 /* Palette types for TW_PALETTE8 */
954 #define TWPA_RGB 0
955 #define TWPA_GRAY 1
956 #define TWPA_CMY 2
957 
958 /* ICAP_PLANARCHUNKY values */
959 #define TWPC_CHUNKY 0
960 #define TWPC_PLANAR 1
961 
962 /* TWEI_PATCHCODE values*/
963 #define TWPCH_PATCH1 0
964 #define TWPCH_PATCH2 1
965 #define TWPCH_PATCH3 2
966 #define TWPCH_PATCH4 3
967 #define TWPCH_PATCH6 4
968 #define TWPCH_PATCHT 5
969 
970 /* ICAP_PIXELFLAVOR values */
971 #define TWPF_CHOCOLATE 0
972 #define TWPF_VANILLA 1
973 
974 /* CAP_PRINTERMODE values */
975 #define TWPM_SINGLESTRING 0
976 #define TWPM_MULTISTRING 1
977 #define TWPM_COMPOUNDSTRING 2
978 
979 /* CAP_PRINTER values */
980 #define TWPR_IMPRINTERTOPBEFORE 0
981 #define TWPR_IMPRINTERTOPAFTER 1
982 #define TWPR_IMPRINTERBOTTOMBEFORE 2
983 #define TWPR_IMPRINTERBOTTOMAFTER 3
984 #define TWPR_ENDORSERTOPBEFORE 4
985 #define TWPR_ENDORSERTOPAFTER 5
986 #define TWPR_ENDORSERBOTTOMBEFORE 6
987 #define TWPR_ENDORSERBOTTOMAFTER 7
988 
989 /* CAP_PRINTERFONTSTYLE Added 2.3 */
990 #define TWPF_NORMAL 0
991 #define TWPF_BOLD 1
992 #define TWPF_ITALIC 2
993 #define TWPF_LARGESIZE 3
994 #define TWPF_SMALLSIZE 4
995 
996 /* CAP_PRINTERINDEXTRIGGER Added 2.3 */
997 #define TWCT_PAGE 0
998 #define TWCT_PATCH1 1
999 #define TWCT_PATCH2 2
1000 #define TWCT_PATCH3 3
1001 #define TWCT_PATCH4 4
1002 #define TWCT_PATCHT 5
1003 #define TWCT_PATCH6 6
1004 
1005 /* CAP_POWERSUPPLY values */
1006 #define TWPS_EXTERNAL 0
1007 #define TWPS_BATTERY 1
1008 
1009 /* ICAP_PIXELTYPE values (PT_ means Pixel Type) */
1010 #define TWPT_BW 0
1011 #define TWPT_GRAY 1
1012 #define TWPT_RGB 2
1013 #define TWPT_PALETTE 3
1014 #define TWPT_CMY 4
1015 #define TWPT_CMYK 5
1016 #define TWPT_YUV 6
1017 #define TWPT_YUVK 7
1018 #define TWPT_CIEXYZ 8
1019 #define TWPT_LAB 9
1020 #define TWPT_SRGB 10
1021 #define TWPT_SCRGB 11
1022 #define TWPT_INFRARED 16
1023 
1024 /* CAP_SEGMENTED values */
1025 #define TWSG_NONE 0
1026 #define TWSG_AUTO 1
1027 #define TWSG_MANUAL 2
1028 
1029 /* ICAP_FILMTYPE values */
1030 #define TWFM_POSITIVE 0
1031 #define TWFM_NEGATIVE 1
1032 
1033 /* CAP_DOUBLEFEEDDETECTION */
1034 #define TWDF_ULTRASONIC 0
1035 #define TWDF_BYLENGTH 1
1036 #define TWDF_INFRARED 2
1037 
1038 /* CAP_DOUBLEFEEDDETECTIONSENSITIVITY */
1039 #define TWUS_LOW 0
1040 #define TWUS_MEDIUM 1
1041 #define TWUS_HIGH 2
1042 
1043 /* CAP_DOUBLEFEEDDETECTIONRESPONSE */
1044 #define TWDP_STOP 0
1045 #define TWDP_STOPANDWAIT 1
1046 #define TWDP_SOUND 2
1047 #define TWDP_DONOTIMPRINT 3
1048 
1049 /* ICAP_MIRROR values */
1050 #define TWMR_NONE 0
1051 #define TWMR_VERTICAL 1
1052 #define TWMR_HORIZONTAL 2
1053 
1054 /* ICAP_JPEGSUBSAMPLING values */
1055 #define TWJS_444YCBCR 0
1056 #define TWJS_444RGB 1
1057 #define TWJS_422 2
1058 #define TWJS_421 3
1059 #define TWJS_411 4
1060 #define TWJS_420 5
1061 #define TWJS_410 6
1062 #define TWJS_311 7
1063 
1064 /* CAP_PAPERHANDLING values */
1065 #define TWPH_NORMAL 0
1066 #define TWPH_FRAGILE 1
1067 #define TWPH_THICK 2
1068 #define TWPH_TRIFOLD 3
1069 #define TWPH_PHOTOGRAPH 4
1070 
1071 /* CAP_INDICATORSMODE values */
1072 #define TWCI_INFO 0
1073 #define TWCI_WARNING 1
1074 #define TWCI_ERROR 2
1075 #define TWCI_WARMUP 3
1076 
1077 /* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */
1078 #define TWSS_NONE 0
1079 #define TWSS_A4 1
1080 #define TWSS_JISB5 2
1081 #define TWSS_USLETTER 3
1082 #define TWSS_USLEGAL 4
1083 #define TWSS_A5 5
1084 #define TWSS_ISOB4 6
1085 #define TWSS_ISOB6 7
1086 #define TWSS_USLEDGER 9
1087 #define TWSS_USEXECUTIVE 10
1088 #define TWSS_A3 11
1089 #define TWSS_ISOB3 12
1090 #define TWSS_A6 13
1091 #define TWSS_C4 14
1092 #define TWSS_C5 15
1093 #define TWSS_C6 16
1094 #define TWSS_4A0 17
1095 #define TWSS_2A0 18
1096 #define TWSS_A0 19
1097 #define TWSS_A1 20
1098 #define TWSS_A2 21
1099 #define TWSS_A7 22
1100 #define TWSS_A8 23
1101 #define TWSS_A9 24
1102 #define TWSS_A10 25
1103 #define TWSS_ISOB0 26
1104 #define TWSS_ISOB1 27
1105 #define TWSS_ISOB2 28
1106 #define TWSS_ISOB5 29
1107 #define TWSS_ISOB7 30
1108 #define TWSS_ISOB8 31
1109 #define TWSS_ISOB9 32
1110 #define TWSS_ISOB10 33
1111 #define TWSS_JISB0 34
1112 #define TWSS_JISB1 35
1113 #define TWSS_JISB2 36
1114 #define TWSS_JISB3 37
1115 #define TWSS_JISB4 38
1116 #define TWSS_JISB6 39
1117 #define TWSS_JISB7 40
1118 #define TWSS_JISB8 41
1119 #define TWSS_JISB9 42
1120 #define TWSS_JISB10 43
1121 #define TWSS_C0 44
1122 #define TWSS_C1 45
1123 #define TWSS_C2 46
1124 #define TWSS_C3 47
1125 #define TWSS_C7 48
1126 #define TWSS_C8 49
1127 #define TWSS_C9 50
1128 #define TWSS_C10 51
1129 #define TWSS_USSTATEMENT 52
1130 #define TWSS_BUSINESSCARD 53
1131 #define TWSS_MAXSIZE 54
1132 
1133 /* ICAP_XFERMECH values (SX_ means Setup XFer) */
1134 #define TWSX_NATIVE 0
1135 #define TWSX_FILE 1
1136 #define TWSX_MEMORY 2
1137 #define TWSX_MEMFILE 4
1138 
1139 /* ICAP_UNITS values (UN_ means UNits) */
1140 #define TWUN_INCHES 0
1141 #define TWUN_CENTIMETERS 1
1142 #define TWUN_PICAS 2
1143 #define TWUN_POINTS 3
1144 #define TWUN_TWIPS 4
1145 #define TWUN_PIXELS 5
1146 #define TWUN_MILLIMETERS 6
1147 
1148 
1149 /****************************************************************************
1150  * Country Constants *
1151  ****************************************************************************/
1152 
1153 #define TWCY_AFGHANISTAN 1001
1154 #define TWCY_ALGERIA 213
1155 #define TWCY_AMERICANSAMOA 684
1156 #define TWCY_ANDORRA 33
1157 #define TWCY_ANGOLA 1002
1158 #define TWCY_ANGUILLA 8090
1159 #define TWCY_ANTIGUA 8091
1160 #define TWCY_ARGENTINA 54
1161 #define TWCY_ARUBA 297
1162 #define TWCY_ASCENSIONI 247
1163 #define TWCY_AUSTRALIA 61
1164 #define TWCY_AUSTRIA 43
1165 #define TWCY_BAHAMAS 8092
1166 #define TWCY_BAHRAIN 973
1167 #define TWCY_BANGLADESH 880
1168 #define TWCY_BARBADOS 8093
1169 #define TWCY_BELGIUM 32
1170 #define TWCY_BELIZE 501
1171 #define TWCY_BENIN 229
1172 #define TWCY_BERMUDA 8094
1173 #define TWCY_BHUTAN 1003
1174 #define TWCY_BOLIVIA 591
1175 #define TWCY_BOTSWANA 267
1176 #define TWCY_BRITAIN 6
1177 #define TWCY_BRITVIRGINIS 8095
1178 #define TWCY_BRAZIL 55
1179 #define TWCY_BRUNEI 673
1180 #define TWCY_BULGARIA 359
1181 #define TWCY_BURKINAFASO 1004
1182 #define TWCY_BURMA 1005
1183 #define TWCY_BURUNDI 1006
1184 #define TWCY_CAMAROON 237
1185 #define TWCY_CANADA 2
1186 #define TWCY_CAPEVERDEIS 238
1187 #define TWCY_CAYMANIS 8096
1188 #define TWCY_CENTRALAFREP 1007
1189 #define TWCY_CHAD 1008
1190 #define TWCY_CHILE 56
1191 #define TWCY_CHINA 86
1192 #define TWCY_CHRISTMASIS 1009
1193 #define TWCY_COCOSIS 1009
1194 #define TWCY_COLOMBIA 57
1195 #define TWCY_COMOROS 1010
1196 #define TWCY_CONGO 1011
1197 #define TWCY_COOKIS 1012
1198 #define TWCY_COSTARICA 506
1199 #define TWCY_CUBA 5
1200 #define TWCY_CYPRUS 357
1201 #define TWCY_CZECHOSLOVAKIA 42
1202 #define TWCY_DENMARK 45
1203 #define TWCY_DJIBOUTI 1013
1204 #define TWCY_DOMINICA 8097
1205 #define TWCY_DOMINCANREP 8098
1206 #define TWCY_EASTERIS 1014
1207 #define TWCY_ECUADOR 593
1208 #define TWCY_EGYPT 20
1209 #define TWCY_ELSALVADOR 503
1210 #define TWCY_EQGUINEA 1015
1211 #define TWCY_ETHIOPIA 251
1212 #define TWCY_FALKLANDIS 1016
1213 #define TWCY_FAEROEIS 298
1214 #define TWCY_FIJIISLANDS 679
1215 #define TWCY_FINLAND 358
1216 #define TWCY_FRANCE 33
1217 #define TWCY_FRANTILLES 596
1218 #define TWCY_FRGUIANA 594
1219 #define TWCY_FRPOLYNEISA 689
1220 #define TWCY_FUTANAIS 1043
1221 #define TWCY_GABON 241
1222 #define TWCY_GAMBIA 220
1223 #define TWCY_GERMANY 49
1224 #define TWCY_GHANA 233
1225 #define TWCY_GIBRALTER 350
1226 #define TWCY_GREECE 30
1227 #define TWCY_GREENLAND 299
1228 #define TWCY_GRENADA 8099
1229 #define TWCY_GRENEDINES 8015
1230 #define TWCY_GUADELOUPE 590
1231 #define TWCY_GUAM 671
1232 #define TWCY_GUANTANAMOBAY 5399
1233 #define TWCY_GUATEMALA 502
1234 #define TWCY_GUINEA 224
1235 #define TWCY_GUINEABISSAU 1017
1236 #define TWCY_GUYANA 592
1237 #define TWCY_HAITI 509
1238 #define TWCY_HONDURAS 504
1239 #define TWCY_HONGKONG 852
1240 #define TWCY_HUNGARY 36
1241 #define TWCY_ICELAND 354
1242 #define TWCY_INDIA 91
1243 #define TWCY_INDONESIA 62
1244 #define TWCY_IRAN 98
1245 #define TWCY_IRAQ 964
1246 #define TWCY_IRELAND 353
1247 #define TWCY_ISRAEL 972
1248 #define TWCY_ITALY 39
1249 #define TWCY_IVORYCOAST 225
1250 #define TWCY_JAMAICA 8010
1251 #define TWCY_JAPAN 81
1252 #define TWCY_JORDAN 962
1253 #define TWCY_KENYA 254
1254 #define TWCY_KIRIBATI 1018
1255 #define TWCY_KOREA 82
1256 #define TWCY_KUWAIT 965
1257 #define TWCY_LAOS 1019
1258 #define TWCY_LEBANON 1020
1259 #define TWCY_LIBERIA 231
1260 #define TWCY_LIBYA 218
1261 #define TWCY_LIECHTENSTEIN 41
1262 #define TWCY_LUXENBOURG 352
1263 #define TWCY_MACAO 853
1264 #define TWCY_MADAGASCAR 1021
1265 #define TWCY_MALAWI 265
1266 #define TWCY_MALAYSIA 60
1267 #define TWCY_MALDIVES 960
1268 #define TWCY_MALI 1022
1269 #define TWCY_MALTA 356
1270 #define TWCY_MARSHALLIS 692
1271 #define TWCY_MAURITANIA 1023
1272 #define TWCY_MAURITIUS 230
1273 #define TWCY_MEXICO 3
1274 #define TWCY_MICRONESIA 691
1275 #define TWCY_MIQUELON 508
1276 #define TWCY_MONACO 33
1277 #define TWCY_MONGOLIA 1024
1278 #define TWCY_MONTSERRAT 8011
1279 #define TWCY_MOROCCO 212
1280 #define TWCY_MOZAMBIQUE 1025
1281 #define TWCY_NAMIBIA 264
1282 #define TWCY_NAURU 1026
1283 #define TWCY_NEPAL 977
1284 #define TWCY_NETHERLANDS 31
1285 #define TWCY_NETHANTILLES 599
1286 #define TWCY_NEVIS 8012
1287 #define TWCY_NEWCALEDONIA 687
1288 #define TWCY_NEWZEALAND 64
1289 #define TWCY_NICARAGUA 505
1290 #define TWCY_NIGER 227
1291 #define TWCY_NIGERIA 234
1292 #define TWCY_NIUE 1027
1293 #define TWCY_NORFOLKI 1028
1294 #define TWCY_NORWAY 47
1295 #define TWCY_OMAN 968
1296 #define TWCY_PAKISTAN 92
1297 #define TWCY_PALAU 1029
1298 #define TWCY_PANAMA 507
1299 #define TWCY_PARAGUAY 595
1300 #define TWCY_PERU 51
1301 #define TWCY_PHILLIPPINES 63
1302 #define TWCY_PITCAIRNIS 1030
1303 #define TWCY_PNEWGUINEA 675
1304 #define TWCY_POLAND 48
1305 #define TWCY_PORTUGAL 351
1306 #define TWCY_QATAR 974
1307 #define TWCY_REUNIONI 1031
1308 #define TWCY_ROMANIA 40
1309 #define TWCY_RWANDA 250
1310 #define TWCY_SAIPAN 670
1311 #define TWCY_SANMARINO 39
1312 #define TWCY_SAOTOME 1033
1313 #define TWCY_SAUDIARABIA 966
1314 #define TWCY_SENEGAL 221
1315 #define TWCY_SEYCHELLESIS 1034
1316 #define TWCY_SIERRALEONE 1035
1317 #define TWCY_SINGAPORE 65
1318 #define TWCY_SOLOMONIS 1036
1319 #define TWCY_SOMALI 1037
1320 #define TWCY_SOUTHAFRICA 27
1321 #define TWCY_SPAIN 34
1322 #define TWCY_SRILANKA 94
1323 #define TWCY_STHELENA 1032
1324 #define TWCY_STKITTS 8013
1325 #define TWCY_STLUCIA 8014
1326 #define TWCY_STPIERRE 508
1327 #define TWCY_STVINCENT 8015
1328 #define TWCY_SUDAN 1038
1329 #define TWCY_SURINAME 597
1330 #define TWCY_SWAZILAND 268
1331 #define TWCY_SWEDEN 46
1332 #define TWCY_SWITZERLAND 41
1333 #define TWCY_SYRIA 1039
1334 #define TWCY_TAIWAN 886
1335 #define TWCY_TANZANIA 255
1336 #define TWCY_THAILAND 66
1337 #define TWCY_TOBAGO 8016
1338 #define TWCY_TOGO 228
1339 #define TWCY_TONGAIS 676
1340 #define TWCY_TRINIDAD 8016
1341 #define TWCY_TUNISIA 216
1342 #define TWCY_TURKEY 90
1343 #define TWCY_TURKSCAICOS 8017
1344 #define TWCY_TUVALU 1040
1345 #define TWCY_UGANDA 256
1346 #define TWCY_USSR 7
1347 #define TWCY_UAEMIRATES 971
1348 #define TWCY_UNITEDKINGDOM 44
1349 #define TWCY_USA 1
1350 #define TWCY_URUGUAY 598
1351 #define TWCY_VANUATU 1041
1352 #define TWCY_VATICANCITY 39
1353 #define TWCY_VENEZUELA 58
1354 #define TWCY_WAKE 1042
1355 #define TWCY_WALLISIS 1043
1356 #define TWCY_WESTERNSAHARA 1044
1357 #define TWCY_WESTERNSAMOA 1045
1358 #define TWCY_YEMEN 1046
1359 #define TWCY_YUGOSLAVIA 38
1360 #define TWCY_ZAIRE 243
1361 #define TWCY_ZAMBIA 260
1362 #define TWCY_ZIMBABWE 263
1363 #define TWCY_ALBANIA 355
1364 #define TWCY_ARMENIA 374
1365 #define TWCY_AZERBAIJAN 994
1366 #define TWCY_BELARUS 375
1367 #define TWCY_BOSNIAHERZGO 387
1368 #define TWCY_CAMBODIA 855
1369 #define TWCY_CROATIA 385
1370 #define TWCY_CZECHREPUBLIC 420
1371 #define TWCY_DIEGOGARCIA 246
1372 #define TWCY_ERITREA 291
1373 #define TWCY_ESTONIA 372
1374 #define TWCY_GEORGIA 995
1375 #define TWCY_LATVIA 371
1376 #define TWCY_LESOTHO 266
1377 #define TWCY_LITHUANIA 370
1378 #define TWCY_MACEDONIA 389
1379 #define TWCY_MAYOTTEIS 269
1380 #define TWCY_MOLDOVA 373
1381 #define TWCY_MYANMAR 95
1382 #define TWCY_NORTHKOREA 850
1383 #define TWCY_PUERTORICO 787
1384 #define TWCY_RUSSIA 7
1385 #define TWCY_SERBIA 381
1386 #define TWCY_SLOVAKIA 421
1387 #define TWCY_SLOVENIA 386
1388 #define TWCY_SOUTHKOREA 82
1389 #define TWCY_UKRAINE 380
1390 #define TWCY_USVIRGINIS 340
1391 #define TWCY_VIETNAM 84
1392 
1393 /****************************************************************************
1394  * Language Constants *
1395  ****************************************************************************/
1396 #define TWLG_USERLOCALE -1
1397 #define TWLG_DAN 0
1398 #define TWLG_DUT 1
1399 #define TWLG_ENG 2
1400 #define TWLG_FCF 3
1401 #define TWLG_FIN 4
1402 #define TWLG_FRN 5
1403 #define TWLG_GER 6
1404 #define TWLG_ICE 7
1405 #define TWLG_ITN 8
1406 #define TWLG_NOR 9
1407 #define TWLG_POR 10
1408 #define TWLG_SPA 11
1409 #define TWLG_SWE 12
1410 #define TWLG_USA 13
1411 #define TWLG_AFRIKAANS 14
1412 #define TWLG_ALBANIA 15
1413 #define TWLG_ARABIC 16
1414 #define TWLG_ARABIC_ALGERIA 17
1415 #define TWLG_ARABIC_BAHRAIN 18
1416 #define TWLG_ARABIC_EGYPT 19
1417 #define TWLG_ARABIC_IRAQ 20
1418 #define TWLG_ARABIC_JORDAN 21
1419 #define TWLG_ARABIC_KUWAIT 22
1420 #define TWLG_ARABIC_LEBANON 23
1421 #define TWLG_ARABIC_LIBYA 24
1422 #define TWLG_ARABIC_MOROCCO 25
1423 #define TWLG_ARABIC_OMAN 26
1424 #define TWLG_ARABIC_QATAR 27
1425 #define TWLG_ARABIC_SAUDIARABIA 28
1426 #define TWLG_ARABIC_SYRIA 29
1427 #define TWLG_ARABIC_TUNISIA 30
1428 #define TWLG_ARABIC_UAE 31
1429 #define TWLG_ARABIC_YEMEN 32
1430 #define TWLG_BASQUE 33
1431 #define TWLG_BYELORUSSIAN 34
1432 #define TWLG_BULGARIAN 35
1433 #define TWLG_CATALAN 36
1434 #define TWLG_CHINESE 37
1435 #define TWLG_CHINESE_HONGKONG 38
1436 #define TWLG_CHINESE_PRC 39
1437 #define TWLG_CHINESE_SINGAPORE 40
1438 #define TWLG_CHINESE_SIMPLIFIED 41
1439 #define TWLG_CHINESE_TAIWAN 42
1440 #define TWLG_CHINESE_TRADITIONAL 43
1441 #define TWLG_CROATIA 44
1442 #define TWLG_CZECH 45
1443 #define TWLG_DANISH TWLG_DAN
1444 #define TWLG_DUTCH TWLG_DUT
1445 #define TWLG_DUTCH_BELGIAN 46
1446 #define TWLG_ENGLISH TWLG_ENG
1447 #define TWLG_ENGLISH_AUSTRALIAN 47
1448 #define TWLG_ENGLISH_CANADIAN 48
1449 #define TWLG_ENGLISH_IRELAND 49
1450 #define TWLG_ENGLISH_NEWZEALAND 50
1451 #define TWLG_ENGLISH_SOUTHAFRICA 51
1452 #define TWLG_ENGLISH_UK 52
1453 #define TWLG_ENGLISH_USA TWLG_USA
1454 #define TWLG_ESTONIAN 53
1455 #define TWLG_FAEROESE 54
1456 #define TWLG_FARSI 55
1457 #define TWLG_FINNISH TWLG_FIN
1458 #define TWLG_FRENCH TWLG_FRN
1459 #define TWLG_FRENCH_BELGIAN 56
1460 #define TWLG_FRENCH_CANADIAN TWLG_FCF
1461 #define TWLG_FRENCH_LUXEMBOURG 57
1462 #define TWLG_FRENCH_SWISS 58
1463 #define TWLG_GERMAN TWLG_GER
1464 #define TWLG_GERMAN_AUSTRIAN 59
1465 #define TWLG_GERMAN_LUXEMBOURG 60
1466 #define TWLG_GERMAN_LIECHTENSTEIN 61
1467 #define TWLG_GERMAN_SWISS 62
1468 #define TWLG_GREEK 63
1469 #define TWLG_HEBREW 64
1470 #define TWLG_HUNGARIAN 65
1471 #define TWLG_ICELANDIC TWLG_ICE
1472 #define TWLG_INDONESIAN 66
1473 #define TWLG_ITALIAN TWLG_ITN
1474 #define TWLG_ITALIAN_SWISS 67
1475 #define TWLG_JAPANESE 68
1476 #define TWLG_KOREAN 69
1477 #define TWLG_KOREAN_JOHAB 70
1478 #define TWLG_LATVIAN 71
1479 #define TWLG_LITHUANIAN 72
1480 #define TWLG_NORWEGIAN TWLG_NOR
1481 #define TWLG_NORWEGIAN_BOKMAL 73
1482 #define TWLG_NORWEGIAN_NYNORSK 74
1483 #define TWLG_POLISH 75
1484 #define TWLG_PORTUGUESE TWLG_POR
1485 #define TWLG_PORTUGUESE_BRAZIL 76
1486 #define TWLG_ROMANIAN 77
1487 #define TWLG_RUSSIAN 78
1488 #define TWLG_SERBIAN_LATIN 79
1489 #define TWLG_SLOVAK 80
1490 #define TWLG_SLOVENIAN 81
1491 #define TWLG_SPANISH TWLG_SPA
1492 #define TWLG_SPANISH_MEXICAN 82
1493 #define TWLG_SPANISH_MODERN 83
1494 #define TWLG_SWEDISH TWLG_SWE
1495 #define TWLG_THAI 84
1496 #define TWLG_TURKISH 85
1497 #define TWLG_UKRANIAN 86
1498 #define TWLG_ASSAMESE 87
1499 #define TWLG_BENGALI 88
1500 #define TWLG_BIHARI 89
1501 #define TWLG_BODO 90
1502 #define TWLG_DOGRI 91
1503 #define TWLG_GUJARATI 92
1504 #define TWLG_HARYANVI 93
1505 #define TWLG_HINDI 94
1506 #define TWLG_KANNADA 95
1507 #define TWLG_KASHMIRI 96
1508 #define TWLG_MALAYALAM 97
1509 #define TWLG_MARATHI 98
1510 #define TWLG_MARWARI 99
1511 #define TWLG_MEGHALAYAN 100
1512 #define TWLG_MIZO 101
1513 #define TWLG_NAGA 102
1514 #define TWLG_ORISSI 103
1515 #define TWLG_PUNJABI 104
1516 #define TWLG_PUSHTU 105
1517 #define TWLG_SERBIAN_CYRILLIC 106
1518 #define TWLG_SIKKIMI 107
1519 #define TWLG_SWEDISH_FINLAND 108
1520 #define TWLG_TAMIL 109
1521 #define TWLG_TELUGU 110
1522 #define TWLG_TRIPURI 111
1523 #define TWLG_URDU 112
1524 #define TWLG_VIETNAMESE 113
1525 
1526 
1527 /****************************************************************************
1528  * Data Groups *
1529  ****************************************************************************/
1530 #define DG_CONTROL 0x0001L
1531 #define DG_IMAGE 0x0002L
1532 #define DG_AUDIO 0x0004L
1533 
1534 /* More Data Functionality may be added in the future.
1535  * These are for items that need to be determined before DS is opened.
1536  * NOTE: Supported Functionality constants must be powers of 2 as they are
1537  * used as bitflags when Application asks DSM to present a list of DSs.
1538  * to support backward capability the App and DS will not use the fields
1539  */
1540 #define DF_DSM2 0x10000000L
1541 #define DF_APP2 0x20000000L
1542 
1543 #define DF_DS2 0x40000000L
1544 
1545 #define DG_MASK 0xFFFFL
1546 
1547 /****************************************************************************
1548  * *
1549  ****************************************************************************/
1550 #define DAT_NULL 0x0000
1551 #define DAT_CUSTOMBASE 0x8000
1552 
1553 /* Data Argument Types for the DG_CONTROL Data Group. */
1554 #define DAT_CAPABILITY 0x0001
1555 #define DAT_EVENT 0x0002
1556 #define DAT_IDENTITY 0x0003
1557 #define DAT_PARENT 0x0004
1558 #define DAT_PENDINGXFERS 0x0005
1559 #define DAT_SETUPMEMXFER 0x0006
1560 #define DAT_SETUPFILEXFER 0x0007
1561 #define DAT_STATUS 0x0008
1562 #define DAT_USERINTERFACE 0x0009
1563 #define DAT_XFERGROUP 0x000a
1564 #define DAT_CUSTOMDSDATA 0x000c
1565 #define DAT_DEVICEEVENT 0x000d
1566 #define DAT_FILESYSTEM 0x000e
1567 #define DAT_PASSTHRU 0x000f
1568 #define DAT_CALLBACK 0x0010
1569 #define DAT_STATUSUTF8 0x0011
1570 #define DAT_CALLBACK2 0x0012
1571 #define DAT_METRICS 0x0013
1572 #define DAT_TWAINDIRECT 0x0014
1573 
1574 /* Data Argument Types for the DG_IMAGE Data Group. */
1575 #define DAT_IMAGEINFO 0x0101
1576 #define DAT_IMAGELAYOUT 0x0102
1577 #define DAT_IMAGEMEMXFER 0x0103
1578 #define DAT_IMAGENATIVEXFER 0x0104
1579 #define DAT_IMAGEFILEXFER 0x0105
1580 #define DAT_CIECOLOR 0x0106
1581 #define DAT_GRAYRESPONSE 0x0107
1582 #define DAT_RGBRESPONSE 0x0108
1583 #define DAT_JPEGCOMPRESSION 0x0109
1584 #define DAT_PALETTE8 0x010a
1585 #define DAT_EXTIMAGEINFO 0x010b
1586 #define DAT_FILTER 0x010c
1587 
1588 /* Data Argument Types for the DG_AUDIO Data Group. */
1589 #define DAT_AUDIOFILEXFER 0x0201
1590 #define DAT_AUDIOINFO 0x0202
1591 #define DAT_AUDIONATIVEXFER 0x0203
1592 
1593 /* misplaced */
1594 #define DAT_ICCPROFILE 0x0401
1595 #define DAT_IMAGEMEMFILEXFER 0x0402
1596 #define DAT_ENTRYPOINT 0x0403
1597 
1598 
1599 /****************************************************************************
1600  * Messages *
1601  ****************************************************************************/
1602 
1603 /* All message constants are unique.
1604  * Messages are grouped according to which DATs they are used with.*/
1605 
1606 #define MSG_NULL 0x0000
1607 #define MSG_CUSTOMBASE 0x8000
1608 
1609 /* Generic messages may be used with any of several DATs. */
1610 #define MSG_GET 0x0001
1611 #define MSG_GETCURRENT 0x0002
1612 #define MSG_GETDEFAULT 0x0003
1613 #define MSG_GETFIRST 0x0004
1614 #define MSG_GETNEXT 0x0005
1615 #define MSG_SET 0x0006
1616 #define MSG_RESET 0x0007
1617 #define MSG_QUERYSUPPORT 0x0008
1618 #define MSG_GETHELP 0x0009
1619 #define MSG_GETLABEL 0x000a
1620 #define MSG_GETLABELENUM 0x000b
1621 #define MSG_SETCONSTRAINT 0x000c
1622 
1623 /* Messages used with DAT_NULL */
1624 #define MSG_XFERREADY 0x0101
1625 #define MSG_CLOSEDSREQ 0x0102
1626 #define MSG_CLOSEDSOK 0x0103
1627 #define MSG_DEVICEEVENT 0X0104
1628 
1629 /* Messages used with a pointer to DAT_PARENT data */
1630 #define MSG_OPENDSM 0x0301
1631 #define MSG_CLOSEDSM 0x0302
1632 
1633 /* Messages used with a pointer to a DAT_IDENTITY structure */
1634 #define MSG_OPENDS 0x0401
1635 #define MSG_CLOSEDS 0x0402
1636 #define MSG_USERSELECT 0x0403
1637 
1638 /* Messages used with a pointer to a DAT_USERINTERFACE structure */
1639 #define MSG_DISABLEDS 0x0501
1640 #define MSG_ENABLEDS 0x0502
1641 #define MSG_ENABLEDSUIONLY 0x0503
1642 
1643 /* Messages used with a pointer to a DAT_EVENT structure */
1644 #define MSG_PROCESSEVENT 0x0601
1645 
1646 /* Messages used with a pointer to a DAT_PENDINGXFERS structure */
1647 #define MSG_ENDXFER 0x0701
1648 #define MSG_STOPFEEDER 0x0702
1649 
1650 /* Messages used with a pointer to a DAT_FILESYSTEM structure */
1651 #define MSG_CHANGEDIRECTORY 0x0801
1652 #define MSG_CREATEDIRECTORY 0x0802
1653 #define MSG_DELETE 0x0803
1654 #define MSG_FORMATMEDIA 0x0804
1655 #define MSG_GETCLOSE 0x0805
1656 #define MSG_GETFIRSTFILE 0x0806
1657 #define MSG_GETINFO 0x0807
1658 #define MSG_GETNEXTFILE 0x0808
1659 #define MSG_RENAME 0x0809
1660 #define MSG_COPY 0x080A
1661 #define MSG_AUTOMATICCAPTUREDIRECTORY 0x080B
1662 
1663 /* Messages used with a pointer to a DAT_PASSTHRU structure */
1664 #define MSG_PASSTHRU 0x0901
1665 
1666 /* used with DAT_CALLBACK */
1667 #define MSG_REGISTER_CALLBACK 0x0902
1668 
1669 /* used with DAT_CAPABILITY */
1670 #define MSG_RESETALL 0x0A01
1671 
1672 /* used with DAT_TWAINDIRECT */
1673 #define MSG_SETTASK 0x0B01
1674 
1675 /****************************************************************************
1676  * Capabilities *
1677  ****************************************************************************/
1678 
1679 #define CAP_CUSTOMBASE 0x8000 /* Base of custom capabilities */
1680 
1681 /* all data sources are REQUIRED to support these caps */
1682 #define CAP_XFERCOUNT 0x0001
1683 
1684 /* image data sources are REQUIRED to support these caps */
1685 #define ICAP_COMPRESSION 0x0100
1686 #define ICAP_PIXELTYPE 0x0101
1687 #define ICAP_UNITS 0x0102
1688 #define ICAP_XFERMECH 0x0103
1689 
1690 /* all data sources MAY support these caps */
1691 #define CAP_AUTHOR 0x1000
1692 #define CAP_CAPTION 0x1001
1693 #define CAP_FEEDERENABLED 0x1002
1694 #define CAP_FEEDERLOADED 0x1003
1695 #define CAP_TIMEDATE 0x1004
1696 #define CAP_SUPPORTEDCAPS 0x1005
1697 #define CAP_EXTENDEDCAPS 0x1006
1698 #define CAP_AUTOFEED 0x1007
1699 #define CAP_CLEARPAGE 0x1008
1700 #define CAP_FEEDPAGE 0x1009
1701 #define CAP_REWINDPAGE 0x100a
1702 #define CAP_INDICATORS 0x100b
1703 #define CAP_PAPERDETECTABLE 0x100d
1704 #define CAP_UICONTROLLABLE 0x100e
1705 #define CAP_DEVICEONLINE 0x100f
1706 #define CAP_AUTOSCAN 0x1010
1707 #define CAP_THUMBNAILSENABLED 0x1011
1708 #define CAP_DUPLEX 0x1012
1709 #define CAP_DUPLEXENABLED 0x1013
1710 #define CAP_ENABLEDSUIONLY 0x1014
1711 #define CAP_CUSTOMDSDATA 0x1015
1712 #define CAP_ENDORSER 0x1016
1713 #define CAP_JOBCONTROL 0x1017
1714 #define CAP_ALARMS 0x1018
1715 #define CAP_ALARMVOLUME 0x1019
1716 #define CAP_AUTOMATICCAPTURE 0x101a
1717 #define CAP_TIMEBEFOREFIRSTCAPTURE 0x101b
1718 #define CAP_TIMEBETWEENCAPTURES 0x101c
1719 #define CAP_MAXBATCHBUFFERS 0x101e
1720 #define CAP_DEVICETIMEDATE 0x101f
1721 #define CAP_POWERSUPPLY 0x1020
1722 #define CAP_CAMERAPREVIEWUI 0x1021
1723 #define CAP_DEVICEEVENT 0x1022
1724 #define CAP_SERIALNUMBER 0x1024
1725 #define CAP_PRINTER 0x1026
1726 #define CAP_PRINTERENABLED 0x1027
1727 #define CAP_PRINTERINDEX 0x1028
1728 #define CAP_PRINTERMODE 0x1029
1729 #define CAP_PRINTERSTRING 0x102a
1730 #define CAP_PRINTERSUFFIX 0x102b
1731 #define CAP_LANGUAGE 0x102c
1732 #define CAP_FEEDERALIGNMENT 0x102d
1733 #define CAP_FEEDERORDER 0x102e
1734 #define CAP_REACQUIREALLOWED 0x1030
1735 #define CAP_BATTERYMINUTES 0x1032
1736 #define CAP_BATTERYPERCENTAGE 0x1033
1737 #define CAP_CAMERASIDE 0x1034
1738 #define CAP_SEGMENTED 0x1035
1739 #define CAP_CAMERAENABLED 0x1036
1740 #define CAP_CAMERAORDER 0x1037
1741 #define CAP_MICRENABLED 0x1038
1742 #define CAP_FEEDERPREP 0x1039
1743 #define CAP_FEEDERPOCKET 0x103a
1744 #define CAP_AUTOMATICSENSEMEDIUM 0x103b
1745 #define CAP_CUSTOMINTERFACEGUID 0x103c
1746 #define CAP_SUPPORTEDCAPSSEGMENTUNIQUE 0x103d
1747 #define CAP_SUPPORTEDDATS 0x103e
1748 #define CAP_DOUBLEFEEDDETECTION 0x103f
1749 #define CAP_DOUBLEFEEDDETECTIONLENGTH 0x1040
1750 #define CAP_DOUBLEFEEDDETECTIONSENSITIVITY 0x1041
1751 #define CAP_DOUBLEFEEDDETECTIONRESPONSE 0x1042
1752 #define CAP_PAPERHANDLING 0x1043
1753 #define CAP_INDICATORSMODE 0x1044
1754 #define CAP_PRINTERVERTICALOFFSET 0x1045
1755 #define CAP_POWERSAVETIME 0x1046
1756 #define CAP_PRINTERCHARROTATION 0x1047
1757 #define CAP_PRINTERFONTSTYLE 0x1048
1758 #define CAP_PRINTERINDEXLEADCHAR 0x1049
1759 #define CAP_PRINTERINDEXMAXVALUE 0x104A
1760 #define CAP_PRINTERINDEXNUMDIGITS 0x104B
1761 #define CAP_PRINTERINDEXSTEP 0x104C
1762 #define CAP_PRINTERINDEXTRIGGER 0x104D
1763 #define CAP_PRINTERSTRINGPREVIEW 0x104E
1764 #define CAP_SHEETCOUNT 0x104F
1765 
1766 
1767 
1768 /* image data sources MAY support these caps */
1769 #define ICAP_AUTOBRIGHT 0x1100
1770 #define ICAP_BRIGHTNESS 0x1101
1771 #define ICAP_CONTRAST 0x1103
1772 #define ICAP_CUSTHALFTONE 0x1104
1773 #define ICAP_EXPOSURETIME 0x1105
1774 #define ICAP_FILTER 0x1106
1775 #define ICAP_FLASHUSED 0x1107
1776 #define ICAP_GAMMA 0x1108
1777 #define ICAP_HALFTONES 0x1109
1778 #define ICAP_HIGHLIGHT 0x110a
1779 #define ICAP_IMAGEFILEFORMAT 0x110c
1780 #define ICAP_LAMPSTATE 0x110d
1781 #define ICAP_LIGHTSOURCE 0x110e
1782 #define ICAP_ORIENTATION 0x1110
1783 #define ICAP_PHYSICALWIDTH 0x1111
1784 #define ICAP_PHYSICALHEIGHT 0x1112
1785 #define ICAP_SHADOW 0x1113
1786 #define ICAP_FRAMES 0x1114
1787 #define ICAP_XNATIVERESOLUTION 0x1116
1788 #define ICAP_YNATIVERESOLUTION 0x1117
1789 #define ICAP_XRESOLUTION 0x1118
1790 #define ICAP_YRESOLUTION 0x1119
1791 #define ICAP_MAXFRAMES 0x111a
1792 #define ICAP_TILES 0x111b
1793 #define ICAP_BITORDER 0x111c
1794 #define ICAP_CCITTKFACTOR 0x111d
1795 #define ICAP_LIGHTPATH 0x111e
1796 #define ICAP_PIXELFLAVOR 0x111f
1797 #define ICAP_PLANARCHUNKY 0x1120
1798 #define ICAP_ROTATION 0x1121
1799 #define ICAP_SUPPORTEDSIZES 0x1122
1800 #define ICAP_THRESHOLD 0x1123
1801 #define ICAP_XSCALING 0x1124
1802 #define ICAP_YSCALING 0x1125
1803 #define ICAP_BITORDERCODES 0x1126
1804 #define ICAP_PIXELFLAVORCODES 0x1127
1805 #define ICAP_JPEGPIXELTYPE 0x1128
1806 #define ICAP_TIMEFILL 0x112a
1807 #define ICAP_BITDEPTH 0x112b
1808 #define ICAP_BITDEPTHREDUCTION 0x112c
1809 #define ICAP_UNDEFINEDIMAGESIZE 0x112d
1810 #define ICAP_IMAGEDATASET 0x112e
1811 #define ICAP_EXTIMAGEINFO 0x112f
1812 #define ICAP_MINIMUMHEIGHT 0x1130
1813 #define ICAP_MINIMUMWIDTH 0x1131
1814 #define ICAP_AUTODISCARDBLANKPAGES 0x1134
1815 #define ICAP_FLIPROTATION 0x1136
1816 #define ICAP_BARCODEDETECTIONENABLED 0x1137
1817 #define ICAP_SUPPORTEDBARCODETYPES 0x1138
1818 #define ICAP_BARCODEMAXSEARCHPRIORITIES 0x1139
1819 #define ICAP_BARCODESEARCHPRIORITIES 0x113a
1820 #define ICAP_BARCODESEARCHMODE 0x113b
1821 #define ICAP_BARCODEMAXRETRIES 0x113c
1822 #define ICAP_BARCODETIMEOUT 0x113d
1823 #define ICAP_ZOOMFACTOR 0x113e
1824 #define ICAP_PATCHCODEDETECTIONENABLED 0x113f
1825 #define ICAP_SUPPORTEDPATCHCODETYPES 0x1140
1826 #define ICAP_PATCHCODEMAXSEARCHPRIORITIES 0x1141
1827 #define ICAP_PATCHCODESEARCHPRIORITIES 0x1142
1828 #define ICAP_PATCHCODESEARCHMODE 0x1143
1829 #define ICAP_PATCHCODEMAXRETRIES 0x1144
1830 #define ICAP_PATCHCODETIMEOUT 0x1145
1831 #define ICAP_FLASHUSED2 0x1146
1832 #define ICAP_IMAGEFILTER 0x1147
1833 #define ICAP_NOISEFILTER 0x1148
1834 #define ICAP_OVERSCAN 0x1149
1835 #define ICAP_AUTOMATICBORDERDETECTION 0x1150
1836 #define ICAP_AUTOMATICDESKEW 0x1151
1837 #define ICAP_AUTOMATICROTATE 0x1152
1838 #define ICAP_JPEGQUALITY 0x1153
1839 #define ICAP_FEEDERTYPE 0x1154
1840 #define ICAP_ICCPROFILE 0x1155
1841 #define ICAP_AUTOSIZE 0x1156
1842 #define ICAP_AUTOMATICCROPUSESFRAME 0x1157
1843 #define ICAP_AUTOMATICLENGTHDETECTION 0x1158
1844 #define ICAP_AUTOMATICCOLORENABLED 0x1159
1845 #define ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE 0x115a
1846 #define ICAP_COLORMANAGEMENTENABLED 0x115b
1847 #define ICAP_IMAGEMERGE 0x115c
1848 #define ICAP_IMAGEMERGEHEIGHTTHRESHOLD 0x115d
1849 #define ICAP_SUPPORTEDEXTIMAGEINFO 0x115e
1850 #define ICAP_FILMTYPE 0x115f
1851 #define ICAP_MIRROR 0x1160
1852 #define ICAP_JPEGSUBSAMPLING 0x1161
1853 
1854 /* image data sources MAY support these audio caps */
1855 #define ACAP_XFERMECH 0x1202
1856 
1857 
1858 /***************************************************************************
1859  * Extended Image Info Attributes section Added 1.7 *
1860  ***************************************************************************/
1861 
1862 #define TWEI_BARCODEX 0x1200
1863 #define TWEI_BARCODEY 0x1201
1864 #define TWEI_BARCODETEXT 0x1202
1865 #define TWEI_BARCODETYPE 0x1203
1866 #define TWEI_DESHADETOP 0x1204
1867 #define TWEI_DESHADELEFT 0x1205
1868 #define TWEI_DESHADEHEIGHT 0x1206
1869 #define TWEI_DESHADEWIDTH 0x1207
1870 #define TWEI_DESHADESIZE 0x1208
1871 #define TWEI_SPECKLESREMOVED 0x1209
1872 #define TWEI_HORZLINEXCOORD 0x120A
1873 #define TWEI_HORZLINEYCOORD 0x120B
1874 #define TWEI_HORZLINELENGTH 0x120C
1875 #define TWEI_HORZLINETHICKNESS 0x120D
1876 #define TWEI_VERTLINEXCOORD 0x120E
1877 #define TWEI_VERTLINEYCOORD 0x120F
1878 #define TWEI_VERTLINELENGTH 0x1210
1879 #define TWEI_VERTLINETHICKNESS 0x1211
1880 #define TWEI_PATCHCODE 0x1212
1881 #define TWEI_ENDORSEDTEXT 0x1213
1882 #define TWEI_FORMCONFIDENCE 0x1214
1883 #define TWEI_FORMTEMPLATEMATCH 0x1215
1884 #define TWEI_FORMTEMPLATEPAGEMATCH 0x1216
1885 #define TWEI_FORMHORZDOCOFFSET 0x1217
1886 #define TWEI_FORMVERTDOCOFFSET 0x1218
1887 #define TWEI_BARCODECOUNT 0x1219
1888 #define TWEI_BARCODECONFIDENCE 0x121A
1889 #define TWEI_BARCODEROTATION 0x121B
1890 #define TWEI_BARCODETEXTLENGTH 0x121C
1891 #define TWEI_DESHADECOUNT 0x121D
1892 #define TWEI_DESHADEBLACKCOUNTOLD 0x121E
1893 #define TWEI_DESHADEBLACKCOUNTNEW 0x121F
1894 #define TWEI_DESHADEBLACKRLMIN 0x1220
1895 #define TWEI_DESHADEBLACKRLMAX 0x1221
1896 #define TWEI_DESHADEWHITECOUNTOLD 0x1222
1897 #define TWEI_DESHADEWHITECOUNTNEW 0x1223
1898 #define TWEI_DESHADEWHITERLMIN 0x1224
1899 #define TWEI_DESHADEWHITERLAVE 0x1225
1900 #define TWEI_DESHADEWHITERLMAX 0x1226
1901 #define TWEI_BLACKSPECKLESREMOVED 0x1227
1902 #define TWEI_WHITESPECKLESREMOVED 0x1228
1903 #define TWEI_HORZLINECOUNT 0x1229
1904 #define TWEI_VERTLINECOUNT 0x122A
1905 #define TWEI_DESKEWSTATUS 0x122B
1906 #define TWEI_SKEWORIGINALANGLE 0x122C
1907 #define TWEI_SKEWFINALANGLE 0x122D
1908 #define TWEI_SKEWCONFIDENCE 0x122E
1909 #define TWEI_SKEWWINDOWX1 0x122F
1910 #define TWEI_SKEWWINDOWY1 0x1230
1911 #define TWEI_SKEWWINDOWX2 0x1231
1912 #define TWEI_SKEWWINDOWY2 0x1232
1913 #define TWEI_SKEWWINDOWX3 0x1233
1914 #define TWEI_SKEWWINDOWY3 0x1234
1915 #define TWEI_SKEWWINDOWX4 0x1235
1916 #define TWEI_SKEWWINDOWY4 0x1236
1917 #define TWEI_BOOKNAME 0x1238
1918 #define TWEI_CHAPTERNUMBER 0x1239
1919 #define TWEI_DOCUMENTNUMBER 0x123A
1920 #define TWEI_PAGENUMBER 0x123B
1921 #define TWEI_CAMERA 0x123C
1922 #define TWEI_FRAMENUMBER 0x123D
1923 #define TWEI_FRAME 0x123E
1924 #define TWEI_PIXELFLAVOR 0x123F
1925 #define TWEI_ICCPROFILE 0x1240
1926 #define TWEI_LASTSEGMENT 0x1241
1927 #define TWEI_SEGMENTNUMBER 0x1242
1928 #define TWEI_MAGDATA 0x1243
1929 #define TWEI_MAGTYPE 0x1244
1930 #define TWEI_PAGESIDE 0x1245
1931 #define TWEI_FILESYSTEMSOURCE 0x1246
1932 #define TWEI_IMAGEMERGED 0x1247
1933 #define TWEI_MAGDATALENGTH 0x1248
1934 #define TWEI_PAPERCOUNT 0x1249
1935 #define TWEI_PRINTERTEXT 0x124A
1936 #define TWEI_TWAINDIRECTMETADATA 0x124B
1937 
1938 #define TWEJ_NONE 0x0000
1939 #define TWEJ_MIDSEPARATOR 0x0001
1940 #define TWEJ_PATCH1 0x0002
1941 #define TWEJ_PATCH2 0x0003
1942 #define TWEJ_PATCH3 0x0004
1943 #define TWEJ_PATCH4 0x0005
1944 #define TWEJ_PATCH6 0x0006
1945 #define TWEJ_PATCHT 0x0007
1946 
1947 
1948 /***************************************************************************
1949  * Return Codes and Condition Codes section *
1950  ***************************************************************************/
1951 
1952 #define TWRC_CUSTOMBASE 0x8000
1953 
1954 #define TWRC_SUCCESS 0
1955 #define TWRC_FAILURE 1
1956 #define TWRC_CHECKSTATUS 2
1957 #define TWRC_CANCEL 3
1958 #define TWRC_DSEVENT 4
1959 #define TWRC_NOTDSEVENT 5
1960 #define TWRC_XFERDONE 6
1961 #define TWRC_ENDOFLIST 7
1962 #define TWRC_INFONOTSUPPORTED 8
1963 #define TWRC_DATANOTAVAILABLE 9
1964 #define TWRC_BUSY 10
1965 #define TWRC_SCANNERLOCKED 11
1966 
1967 /* Condition Codes: Application gets these by doing DG_CONTROL DAT_STATUS MSG_GET. */
1968 #define TWCC_CUSTOMBASE 0x8000
1969 
1970 #define TWCC_SUCCESS 0
1971 #define TWCC_BUMMER 1
1972 #define TWCC_LOWMEMORY 2
1973 #define TWCC_NODS 3
1974 #define TWCC_MAXCONNECTIONS 4
1975 #define TWCC_OPERATIONERROR 5
1976 #define TWCC_BADCAP 6
1977 #define TWCC_BADPROTOCOL 9
1978 #define TWCC_BADVALUE 10
1979 #define TWCC_SEQERROR 11
1980 #define TWCC_BADDEST 12
1981 #define TWCC_CAPUNSUPPORTED 13
1982 #define TWCC_CAPBADOPERATION 14
1983 #define TWCC_CAPSEQERROR 15
1984 #define TWCC_DENIED 16
1985 #define TWCC_FILEEXISTS 17
1986 #define TWCC_FILENOTFOUND 18
1987 #define TWCC_NOTEMPTY 19
1988 #define TWCC_PAPERJAM 20
1989 #define TWCC_PAPERDOUBLEFEED 21
1990 #define TWCC_FILEWRITEERROR 22
1991 #define TWCC_CHECKDEVICEONLINE 23
1992 #define TWCC_INTERLOCK 24
1993 #define TWCC_DAMAGEDCORNER 25
1994 #define TWCC_FOCUSERROR 26
1995 #define TWCC_DOCTOOLIGHT 27
1996 #define TWCC_DOCTOODARK 28
1997 #define TWCC_NOMEDIA 29
1998 
1999 /* bit patterns: for query the operation that are supported by the data source on a capability */
2000 /* Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT */
2001 #define TWQC_GET 0x0001
2002 #define TWQC_SET 0x0002
2003 #define TWQC_GETDEFAULT 0x0004
2004 #define TWQC_GETCURRENT 0x0008
2005 #define TWQC_RESET 0x0010
2006 #define TWQC_SETCONSTRAINT 0x0020
2007 #define TWQC_GETHELP 0x0100
2008 #define TWQC_GETLABEL 0x0200
2009 #define TWQC_GETLABELENUM 0x0400
2010 
2011 /****************************************************************************
2012  * Depreciated Items *
2013  ****************************************************************************/
2014 #if defined(WIN32) || defined(WIN64)
2015  #define TW_HUGE
2016 #elif !defined(TWH_CMP_GNU)
2017  #define TW_HUGE huge
2018 #else
2019  #define TW_HUGE
2020 #endif
2021 
2022 typedef BYTE TW_HUGE * HPBYTE;
2023 typedef void TW_HUGE * HPVOID;
2024 
2025 typedef unsigned char TW_STR1024[1026], FAR *pTW_STR1026, FAR *pTW_STR1024;
2026 typedef wchar_t TW_UNI512[512], FAR *pTW_UNI512;
2027 
2028 #define TWTY_STR1024 0x000d
2029 #define TWTY_UNI512 0x000e
2030 
2031 #define TWFF_JPN 12
2032 
2033 #define DAT_TWUNKIDENTITY 0x000b
2034 #define DAT_SETUPFILEXFER2 0x0301
2035 
2036 #define CAP_CLEARBUFFERS 0x101d
2037 #define CAP_SUPPORTEDCAPSEXT 0x100c
2038 #define CAP_FILESYSTEM //0x????
2039 #define CAP_PAGEMULTIPLEACQUIRE 0x1023
2040 #define CAP_PAPERBINDING 0x102f
2041 #define CAP_PASSTHRU 0x1031
2042 #define CAP_POWERDOWNTIME 0x1034
2043 #define ACAP_AUDIOFILEFORMAT 0x1201
2044 
2045 #define MSG_CHECKSTATUS 0x0201
2046 
2047 #define MSG_INVOKE_CALLBACK 0x0903 /* Mac Only, deprecated - use DAT_NULL and MSG_xxx instead */
2048 
2049 #define TWQC_CONSTRAINABLE 0x0040
2050 
2051 #define TWSX_FILE2 3
2052 
2053 /* CAP_FILESYSTEM values (FS_ means file system) */
2054 #define TWFS_FILESYSTEM 0
2055 #define TWFS_RECURSIVEDELETE 1
2056 
2057 /* ICAP_PIXELTYPE values (PT_ means Pixel Type) */
2058 #define TWPT_SRGB64 11
2059 #define TWPT_BGR 12
2060 #define TWPT_CIELAB 13
2061 #define TWPT_CIELUV 14
2062 #define TWPT_YCBCR 15
2063 
2064 /* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */
2065 #define TWSS_B 8
2066 #define TWSS_A4LETTER TWSS_A4
2067 #define TWSS_B3 TWSS_ISOB3
2068 #define TWSS_B4 TWSS_ISOB4
2069 #define TWSS_B6 TWSS_ISOB6
2070 #define TWSS_B5LETTER TWSS_JISB5
2071 
2072 /* ACAP_AUDIOFILEFORMAT values (AF_ means audio format). Added 1.8 */
2073 #define TWAF_WAV 0
2074 #define TWAF_AIFF 1
2075 #define TWAF_AU 3
2076 #define TWAF_SND 4
2077 
2078 /* CAP_CLEARBUFFERS values */
2079 #define TWCB_AUTO 0
2080 #define TWCB_CLEAR 1
2081 #define TWCB_NOCLEAR 2
2082 
2083 /* DAT_SETUPFILEXFER2. Sets up DS to application data transfer via a file. Added 1.9 */
2084 typedef struct {
2085  TW_MEMREF FileName;
2086  TW_UINT16 FileNameType;
2087  TW_UINT16 Format;
2088  TW_INT16 VRefNum;
2089  TW_UINT32 parID;
2091 
2092 /* DAT_TWUNKIDENTITY. Provides DS identity and 'other' information necessary */
2093 /* across thunk link. */
2094 typedef struct {
2095  TW_IDENTITY identity;
2096  TW_STR255 dsPath;
2098 
2099 /* Provides DS_Entry parameters over thunk link. */
2100 typedef struct
2101 {
2102  TW_INT8 destFlag;
2103  TW_IDENTITY dest;
2104  TW_INT32 dataGroup;
2105  TW_INT16 dataArgType;
2106  TW_INT16 message;
2107  TW_INT32 pDataSize;
2108  // TW_MEMREF pData;
2110 
2111 /* Provides DS_Entry results over thunk link. */
2112 typedef struct
2113 {
2114  TW_UINT16 returnCode;
2115  TW_UINT16 conditionCode;
2116  TW_INT32 pDataSize;
2117  // TW_MEMREF pData;
2119 
2120 typedef struct
2121 {
2122  TW_UINT16 Cap;
2123  TW_UINT16 Properties;
2124 } TW_CAPEXT, FAR * pTW_CAPEXT;
2125 
2126 /* DAT_SETUPAUDIOFILEXFER, information required to setup an audio file transfer */
2127 typedef struct {
2128  TW_STR255 FileName; /* full path target file */
2129  TW_UINT16 Format; /* one of TWAF_xxxx */
2130  TW_INT16 VRefNum;
2132 
2133 
2134 /****************************************************************************
2135  * Entry Points *
2136  ****************************************************************************/
2137 
2138 /**********************************************************************
2139  * Function: DSM_Entry, the only entry point into the Data Source Manager.
2140  ********************************************************************/
2141 #ifdef TWH_CMP_MSC
2142  #define TW_CALLINGSTYLE PASCAL
2143 #else
2144  #define TW_CALLINGSTYLE
2145 #endif
2146 
2147 /* Don't mangle the name "DSM_Entry" if we're compiling in C++! */
2148 #ifdef __cplusplus
2149 extern "C" {
2150 #endif /* __cplusplus */
2151 
2152 TW_UINT16 TW_CALLINGSTYLE DSM_Entry( pTW_IDENTITY pOrigin,
2153  pTW_IDENTITY pDest,
2154  TW_UINT32 DG,
2155  TW_UINT16 DAT,
2156  TW_UINT16 MSG,
2157  TW_MEMREF pData);
2158 
2159 typedef TW_UINT16 (TW_CALLINGSTYLE *DSMENTRYPROC)(pTW_IDENTITY pOrigin,
2160  pTW_IDENTITY pDest,
2161  TW_UINT32 DG,
2162  TW_UINT16 DAT,
2163  TW_UINT16 MSG,
2164  TW_MEMREF pData);
2165 #ifdef __cplusplus
2166 }
2167 #endif /* cplusplus */
2168 
2169 
2170 /**********************************************************************
2171  * Function: DS_Entry, the entry point provided by a Data Source.
2172  ********************************************************************/
2173 /* Don't mangle the name "DS_Entry" if we're compiling in C++! */
2174 #ifdef __cplusplus
2175 extern "C" {
2176 #endif /* __cplusplus */
2177 
2178 
2179 TW_UINT16 TW_CALLINGSTYLE DS_Entry(pTW_IDENTITY pOrigin,
2180  TW_UINT32 DG,
2181  TW_UINT16 DAT,
2182  TW_UINT16 MSG,
2183  TW_MEMREF pData);
2184 
2185 typedef TW_UINT16 (FAR PASCAL *DSENTRYPROC)(pTW_IDENTITY pOrigin,
2186  TW_UINT32 DG,
2187  TW_UINT16 DAT,
2188  TW_UINT16 MSG,
2189  TW_MEMREF pData);
2190 
2191 TW_UINT16 TW_CALLINGSTYLE TWAIN_Callback( pTW_IDENTITY pOrigin,
2192  pTW_IDENTITY pDest,
2193  TW_UINT32 DG,
2194  TW_UINT16 DAT,
2195  TW_UINT16 MSG,
2196  TW_MEMREF pData);
2197 typedef TW_UINT16 (TW_CALLINGSTYLE *TWAINCALLBACKPROC)(pTW_IDENTITY pOrigin,
2198  pTW_IDENTITY pDest,
2199  TW_UINT32 DG,
2200  TW_UINT16 DAT,
2201  TW_UINT16 MSG,
2202  TW_MEMREF pData);
2203 
2204 TW_HANDLE TW_CALLINGSTYLE DSM_MemAllocate (TW_UINT32);
2205 typedef TW_HANDLE (TW_CALLINGSTYLE *DSM_MEMALLOCATE)(TW_UINT32 _size);
2206 
2207 void TW_CALLINGSTYLE DSM_MemFree (TW_HANDLE);
2208 typedef void (TW_CALLINGSTYLE *DSM_MEMFREE)(TW_HANDLE _handle);
2209 
2210 TW_MEMREF TW_CALLINGSTYLE DSM_MemLock (TW_HANDLE);
2211 typedef TW_MEMREF (TW_CALLINGSTYLE *DSM_MEMLOCK)(TW_HANDLE _handle);
2212 
2213 void TW_CALLINGSTYLE DSM_MemUnlock (TW_HANDLE);
2214 typedef void (TW_CALLINGSTYLE *DSM_MEMUNLOCK)(TW_HANDLE _handle);
2215 
2216 #ifdef __cplusplus
2217 }
2218 #endif /* __cplusplus */
2219 
2220 /* DAT_ENTRYPOINT. returns essential entry points. */
2221 typedef struct {
2222  TW_UINT32 Size;
2223  DSMENTRYPROC DSM_Entry;
2224  DSM_MEMALLOCATE DSM_MemAllocate;
2225  DSM_MEMFREE DSM_MemFree;
2226  DSM_MEMLOCK DSM_MemLock;
2227  DSM_MEMUNLOCK DSM_MemUnlock;
2228 } TW_ENTRYPOINT, FAR * pTW_ENTRYPOINT;
2229 
2230 /* DAT_FILTER*/
2231 typedef struct {
2232  TW_UINT32 Size;
2233  TW_UINT32 HueStart;
2234  TW_UINT32 HueEnd;
2235  TW_UINT32 SaturationStart;
2236  TW_UINT32 SaturationEnd;
2237  TW_UINT32 ValueStart;
2238  TW_UINT32 ValueEnd;
2239  TW_UINT32 Replacement;
2241 
2242 /* DAT_FILTER */
2243 typedef struct {
2244  TW_UINT32 Size;
2245  TW_UINT32 DescriptorCount;
2246  TW_UINT32 MaxDescriptorCount;
2247  TW_UINT32 Condition;
2248  TW_HANDLE hDescriptors;
2249 } TW_FILTER, *pTW_FILTER;
2250 
2251 
2252 /* Restore the previous packing alignment: this occurs after all structures are defined */
2253 #ifdef TWH_CMP_MSC
2254  #pragma pack (pop, before_twain)
2255 #elif defined(TWH_CMP_GNU)
2256  #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */
2257  #pragma options align = reset
2258  #else
2259  #pragma pack (pop, before_twain)
2260  #endif
2261 #elif defined(TWH_CMP_BORLAND)
2262  #pragma option -a.
2263 #endif
2264 
2265 #endif /* TWAIN */
TW_AUDIOINFO
Definition: twain.h:291
TW_PALETTE8
Definition: twain.h:526
TW_PENDINGXFERS
Definition: twain.h:543
TW_METRICS
Definition: twain.h:513
TW_FILTER_DESCRIPTOR
Definition: twain.h:2231
TW_IMAGEMEMXFER
Definition: twain.h:488
TW_VERSION
Definition: twain.h:434
TW_EVENT
Definition: twain.h:382
TW_IMAGELAYOUT
Definition: twain.h:473
TW_USERINTERFACE
Definition: twain.h:612
TW_TWUNKIDENTITY
Definition: twain.h:2094
TW_FILESYSTEM
Definition: twain.h:405
TW_GRAYRESPONSE
Definition: twain.h:429
TW_IMAGEINFO
Definition: twain.h:459
TW_TWAINDIRECT
Definition: twain.h:602
TW_IDENTITY
Definition: twain.h:443
TW_ENTRYPOINT
Definition: twain.h:2221
TW_MEMORY
Definition: twain.h:481
TW_CALLBACK
Definition: twain.h:297
TW_PASSTHRU
Definition: twain.h:533
TW_CALLBACK2
Definition: twain.h:308
TW_FILTER
Definition: twain.h:2243
DSM_Entry
DSMENTRY DSM_Entry(TW_IDENTITY *_pOrigin, TW_IDENTITY *_pDest, TW_UINT32 _DG, TW_UINT16 _DAT, TW_UINT16 _MSG, TW_MEMREF _pData)
Data Source Manager Entry Point.
Definition: dsm.cpp:314
TW_SETUPMEMXFER
Definition: twain.h:580
TW_FIX32
Definition: twain.h:252
TW_ENUMERATION
Definition: twain.h:373
TW_RANGE
Definition: twain.h:558
TW_SETUPAUDIOFILEXFER
Definition: twain.h:2127
TW_CAPEXT
Definition: twain.h:2121
TW_CIECOLOR
Definition: twain.h:329
TW_FRAME
Definition: twain.h:258
TW_TWUNKDSENTRYPARAMS
Definition: twain.h:2101
TW_CAPABILITY
Definition: twain.h:315
TW_CIEPOINT
Definition: twain.h:322
TW_CUSTOMDSDATA
Definition: twain.h:344
TW_JPEGCOMPRESSION
Definition: twain.h:500
TW_STATUSUTF8
Definition: twain.h:596
TW_SETUPFILEXFER2
Definition: twain.h:2084
TW_TRANSFORMSTAGE
Definition: twain.h:278
TW_INFO
Definition: twain.h:388
TW_RGBRESPONSE
Definition: twain.h:568
TW_TWUNKDSENTRYRETURN
Definition: twain.h:2113
TW_DECODEFUNCTION
Definition: twain.h:266
TW_ONEVALUE
Definition: twain.h:520
TW_STATUS
Definition: twain.h:587
TW_SETUPFILEXFER
Definition: twain.h:573
TW_ELEMENT8
Definition: twain.h:365
TW_ARRAY
Definition: twain.h:284
TW_EXTIMAGEINFO
Definition: twain.h:399
TW_DEVICEEVENT
Definition: twain.h:350