source: trunk/include/win/twain.h@ 10367

Last change on this file since 10367 was 2320, checked in by sandervl, 26 years ago

Added twain header

File size: 76.5 KB
Line 
1/* $Id: twain.h,v 1.2 2000-01-04 22:18:19 sandervl Exp $ */
2/* ======================================================================== *\
3
4 Copyright (C) 1991, 1992 TWAIN Working Group: Aldus, Caere, Eastman-Kodak,
5 Hewlett-Packard and Logitech Corporations. All rights reserved.
6
7 Copyright (C) 1997 TWAIN Working Group: Bell+Howell, Canon, DocuMagix,
8 Fujitsu, Genoa Technology, Hewlett-Packard, Kofax Imaging Products, and
9 Ricoh Corporation. All rights reserved.
10
11 Copyright © 1998 TWAIN Working Group: Adobe Systems Incorporated,
12 Canon Information Systems, Eastman Kodak Company,
13 Fujitsu Computer Products of America, Genoa Technology,
14 Hewlett-Packard Company, Intel Corporation, Kofax Image Products,
15 JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation.
16 All rights reserved.
17
18 TWAIN.h - This is the definitive include file for applications and
19 data sources written to the TWAIN specification.
20 It defines constants, data structures, messages etc.
21 for the public interface to TWAIN.
22
23 Revision History:
24 version 1.0, March 6, 1992. TWAIN 1.0.
25 version 1.1, January 1993. Tech Notes 1.1
26 version 1.5, June 1993. Specification Update 1.5
27 Change DC to TW
28 Change filename from DC.H to TWAIN.H
29 version 1.5, July 1993. Remove spaces from country identifiers
30
31 version 1.7, July 1997 Added Capabilities and data structure for
32 document imaging and digital cameras.
33 KHL.
34 version 1.7, July 1997 Inserted Borland compatibile structure packing
35 directives provided by Mentor. JMH
36 version 1.7, Aug 1997 Expanded file tabs to spaces.
37 NOTE: future authors should be sure to have
38 their editors set to automatically expand tabs
39 to spaces (original tab setting was 4 spaces).
40 version 1.7, Sept 1997 Added job control values
41 Added return codes
42 version 1.7, Sept 1997 changed definition of pRGBRESPONSE to
43 pTW_RGBRESPONSE
44 version 1.7 Aug 1998 Added missing TWEI_BARCODEROTATION values
45 TWBCOR_ types JMH
46 version 1.8 August 1998 Added new types and definitions required
47 for 1.8 Specification JMH
48 version 1.8 January 1999 Changed search mode from SRCH_ to TWBD_ as
49 in 1.8 Specification, added TWBT_MAXICODE JMH
50 version 1.8 January 1999 Removed undocumented duplicate AUTO<cap> JMH
51\* ======================================================================== */
52
53#define FAR
54#define NEAR
55#define __RPC_FAR
56
57#undef PASCAL
58#define PASCAL __stdcall
59
60#ifndef TWAIN
61#define TWAIN
62
63/* SDH - 02/08/95 - TWUNK */
64/* Force 32-bit twain to use same packing of twain structures as existing */
65/* 16-bit twain. This allows 16/32-bit thunking. */
66#ifdef WIN32
67 #ifdef __BORLANDC__ //(Mentor June 13, 1996) if using a Borland compiler
68 #pragma option -a2 //(Mentor June 13, 1996) switch to word alignment
69 #else //(Mentor June 13, 1996) if we're using some other compiler
70// #pragma pack (push, before_twain)
71 #pragma pack (2)
72 #endif //(Mentor June 13, 1996)
73#else /* WIN32 */
74#endif /* WIN32 */
75
76/****************************************************************************
77 * TWAIN Version *
78 ****************************************************************************/
79// #define TWON_PROTOCOLMINOR 8 /* Changed for Version 1.8 */
80#define TWON_PROTOCOLMINOR 7 /* Changed for Version 1.8 */
81#define TWON_PROTOCOLMAJOR 1
82
83/****************************************************************************
84 * Platform Dependent Definitions and Typedefs *
85 ****************************************************************************/
86
87/* Define one of the following, depending on the platform */
88/* #define _MAC_ */
89/* #define _UNIX_ */
90#define _MSWIN_
91
92#ifdef _MSWIN_
93 typedef HANDLE TW_HANDLE;
94 typedef LPVOID TW_MEMREF;
95
96 /* SDH - 05/05/95 - TWUNK */
97 /* For common code between 16 and 32 bits. */
98 #ifdef WIN32
99 #define TW_HUGE
100 #else /* WIN32 */
101 #define TW_HUGE huge
102 #endif /* WIN32 */
103 typedef BYTE TW_HUGE * HPBYTE;
104 typedef void TW_HUGE * HPVOID;
105#endif /* _MSWIN_ */
106
107#ifdef _MAC_
108 #define PASCAL pascal
109 #define FAR
110 typedef Handle TW_HANDLE;
111 typedef char *TW_MEMREF;
112#endif /* _MAC_ */
113
114#ifdef _UNIX_
115 #define PASCAL pascal
116 typedef unsigned char *TW_HANDLE;
117 typedef unsigned char *TW_MEMREF;
118#endif /* _UNIX_ */
119
120/****************************************************************************
121 * Type Definitions *
122 ****************************************************************************/
123
124/* String types. These include room for the strings and a NULL char, *
125 * or, on the Mac, a length byte followed by the string. *
126 * TW_STR255 must hold less than 256 chars so length fits in first byte. */
127typedef char TW_STR32[34], FAR *pTW_STR32;
128typedef char TW_STR64[66], FAR *pTW_STR64;
129typedef char TW_STR128[130], FAR *pTW_STR128;
130typedef char TW_STR255[256], FAR *pTW_STR255;
131
132/* Numeric types. */
133typedef char TW_INT8, FAR *pTW_INT8;
134typedef short TW_INT16, FAR *pTW_INT16;
135typedef long TW_INT32, FAR *pTW_INT32;
136typedef unsigned char TW_UINT8, FAR *pTW_UINT8;
137typedef unsigned short TW_UINT16, FAR *pTW_UINT16;
138typedef unsigned long TW_UINT32, FAR *pTW_UINT32;
139typedef unsigned short TW_BOOL, FAR *pTW_BOOL;
140
141/* Fixed point structure type. */
142typedef struct {
143 TW_INT16 Whole; /* maintains the sign */
144 TW_UINT16 Frac;
145} TW_FIX32, FAR *pTW_FIX32;
146
147/****************************************************************************
148 * Structure Definitions *
149 ****************************************************************************/
150
151/* No DAT needed. */
152typedef struct {
153 TW_FIX32 X;
154 TW_FIX32 Y;
155 TW_FIX32 Z;
156} TW_CIEPOINT, FAR * pTW_CIEPOINT;
157
158/* No DAT needed. */
159typedef struct {
160 TW_FIX32 StartIn;
161 TW_FIX32 BreakIn;
162 TW_FIX32 EndIn;
163 TW_FIX32 StartOut;
164 TW_FIX32 BreakOut;
165 TW_FIX32 EndOut;
166 TW_FIX32 Gamma;
167 TW_FIX32 SampleCount; /* if =0 use the gamma */
168} TW_DECODEFUNCTION, FAR * pTW_DECODEFUNCTION;
169
170/* No DAT needed. */
171typedef struct {
172 TW_UINT8 Index; /* Value used to index into the color table. */
173 TW_UINT8 Channel1; /* First tri-stimulus value (e.g Red) */
174 TW_UINT8 Channel2; /* Second tri-stimulus value (e.g Green) */
175 TW_UINT8 Channel3; /* Third tri-stimulus value (e.g Blue) */
176} TW_ELEMENT8, FAR * pTW_ELEMENT8;
177
178/* No DAT. Defines a frame rectangle in ICAP_UNITS coordinates. */
179typedef struct {
180 TW_FIX32 Left;
181 TW_FIX32 Top;
182 TW_FIX32 Right;
183 TW_FIX32 Bottom;
184} TW_FRAME, FAR * pTW_FRAME;
185
186/* No DAT needed. Used to manage memory buffers. */
187typedef struct {
188 TW_UINT32 Flags; /* Any combination of the TWMF_ constants. */
189 TW_UINT32 Length; /* Number of bytes stored in buffer TheMem. */
190 TW_MEMREF TheMem; /* Pointer or handle to the allocated memory buffer. */
191} TW_MEMORY, FAR * pTW_MEMORY;
192
193/* No DAT needed. */
194typedef struct {
195 TW_DECODEFUNCTION Decode[3];
196 TW_FIX32 Mix[3][3];
197} TW_TRANSFORMSTAGE, FAR * pTW_TRANSFORMSTAGE;
198
199/* No DAT needed. Describes version of software currently running. */
200typedef struct {
201 TW_UINT16 MajorNum; /* Major revision number of the software. */
202 TW_UINT16 MinorNum; /* Incremental revision number of the software. */
203 TW_UINT16 Language; /* e.g. TWLG_SWISSFRENCH */
204 TW_UINT16 Country; /* e.g. TWCY_SWITZERLAND */
205 TW_STR32 Info; /* e.g. "1.0b3 Beta release" */
206} TW_VERSION, FAR * pTW_VERSION;
207
208/* TWON_ARRAY. Container for array of values (a simplified TW_ENUMERATION) */
209typedef struct {
210 TW_UINT16 ItemType;
211 TW_UINT32 NumItems; /* How many items in ItemList */
212 TW_UINT8 ItemList[1]; /* Array of ItemType values starts here */
213} TW_ARRAY, FAR * pTW_ARRAY;
214
215/* TWON_ENUMERATION. Container for a collection of values. */
216typedef struct {
217 TW_UINT16 ItemType;
218 TW_UINT32 NumItems; /* How many items in ItemList */
219 TW_UINT32 CurrentIndex; /* Current value is in ItemList[CurrentIndex] */
220 TW_UINT32 DefaultIndex; /* Powerup value is in ItemList[DefaultIndex] */
221 TW_UINT8 ItemList[1]; /* Array of ItemType values starts here */
222} TW_ENUMERATION, FAR * pTW_ENUMERATION;
223
224/* TWON_ONEVALUE. Container for one value. */
225typedef struct {
226 TW_UINT16 ItemType;
227 TW_UINT32 Item;
228} TW_ONEVALUE, FAR * pTW_ONEVALUE;
229
230/* TWON_RANGE. Container for a range of values. */
231typedef struct {
232 TW_UINT16 ItemType;
233 TW_UINT32 MinValue; /* Starting value in the range. */
234 TW_UINT32 MaxValue; /* Final value in the range. */
235 TW_UINT32 StepSize; /* Increment from MinValue to MaxValue. */
236 TW_UINT32 DefaultValue; /* Power-up value. */
237 TW_UINT32 CurrentValue; /* The value that is currently in effect. */
238} TW_RANGE, FAR * pTW_RANGE;
239
240/* DAT_CAPABILITY. Used by application to get/set capability from/in a data source. */
241typedef struct {
242 TW_UINT16 Cap; /* id of capability to set or get, e.g. CAP_BRIGHTNESS */
243 TW_UINT16 ConType; /* TWON_ONEVALUE, _RANGE, _ENUMERATION or _ARRAY */
244 TW_HANDLE hContainer; /* Handle to container of type Dat */
245} TW_CAPABILITY, FAR * pTW_CAPABILITY;
246
247/* DAT_CIECOLOR. */
248typedef struct {
249 TW_UINT16 ColorSpace;
250 TW_INT16 LowEndian;
251 TW_INT16 DeviceDependent;
252 TW_INT32 VersionNumber;
253 TW_TRANSFORMSTAGE StageABC;
254 TW_TRANSFORMSTAGE StageLMN;
255 TW_CIEPOINT WhitePoint;
256 TW_CIEPOINT BlackPoint;
257 TW_CIEPOINT WhitePaper;
258 TW_CIEPOINT BlackInk;
259 TW_FIX32 Samples[1];
260} TW_CIECOLOR, FAR * pTW_CIECOLOR;
261
262/* DAT_EVENT. For passing events down from the application to the DS. */
263typedef struct {
264 TW_MEMREF pEvent; /* Windows pMSG or Mac pEvent. */
265 TW_UINT16 TWMessage; /* TW msg from data source, e.g. MSG_XFERREADY */
266} TW_EVENT, FAR * pTW_EVENT;
267
268/* DAT_GRAYRESPONSE */
269typedef struct {
270 TW_ELEMENT8 Response[1];
271} TW_GRAYRESPONSE, FAR * pTW_GRAYRESPONSE;
272
273/* DAT_IDENTITY. Identifies the program/library/code resource. */
274typedef struct {
275 TW_UINT32 Id; /* Unique number. In Windows, application hWnd */
276 TW_VERSION Version; /* Identifies the piece of code */
277 TW_UINT16 ProtocolMajor; /* Application and DS must set to TWON_PROTOCOLMAJOR */
278 TW_UINT16 ProtocolMinor; /* Application and DS must set to TWON_PROTOCOLMINOR */
279 TW_UINT32 SupportedGroups; /* Bit field OR combination of DG_ constants */
280 TW_STR32 Manufacturer; /* Manufacturer name, e.g. "Hewlett-Packard" */
281 TW_STR32 ProductFamily; /* Product family name, e.g. "ScanJet" */
282 TW_STR32 ProductName; /* Product name, e.g. "ScanJet Plus" */
283} TW_IDENTITY, FAR * pTW_IDENTITY;
284
285/* DAT_IMAGEINFO. Application gets detailed image info from DS with this. */
286typedef struct {
287 TW_FIX32 XResolution; /* Resolution in the horizontal */
288 TW_FIX32 YResolution; /* Resolution in the vertical */
289 TW_INT32 ImageWidth; /* Columns in the image, -1 if unknown by DS*/
290 TW_INT32 ImageLength; /* Rows in the image, -1 if unknown by DS */
291 TW_INT16 SamplesPerPixel; /* Number of samples per pixel, 3 for RGB */
292 TW_INT16 BitsPerSample[8]; /* Number of bits for each sample */
293 TW_INT16 BitsPerPixel; /* Number of bits for each padded pixel */
294 TW_BOOL Planar; /* True if Planar, False if chunky */
295 TW_INT16 PixelType; /* How to interp data; photo interp (TWPT_) */
296 TW_UINT16 Compression; /* How the data is compressed (TWCP_xxxx) */
297} TW_IMAGEINFO, FAR * pTW_IMAGEINFO;
298
299/* DAT_IMAGELAYOUT. Provides image layout information in current units. */
300typedef struct {
301 TW_FRAME Frame; /* Frame coords within larger document */
302 TW_UINT32 DocumentNumber;
303 TW_UINT32 PageNumber; /* Reset when you go to next document */
304 TW_UINT32 FrameNumber; /* Reset when you go to next page */
305} TW_IMAGELAYOUT, FAR * pTW_IMAGELAYOUT;
306
307/* DAT_IMAGEMEMXFER. Used to pass image data (e.g. in strips) from DS to application.*/
308typedef struct {
309 TW_UINT16 Compression; /* How the data is compressed */
310 TW_UINT32 BytesPerRow; /* Number of bytes in a row of data */
311 TW_UINT32 Columns; /* How many columns */
312 TW_UINT32 Rows; /* How many rows */
313 TW_UINT32 XOffset; /* How far from the side of the image */
314 TW_UINT32 YOffset; /* How far from the top of the image */
315 TW_UINT32 BytesWritten; /* How many bytes written in Memory */
316 TW_MEMORY Memory; /* Mem struct used to pass actual image data */
317} TW_IMAGEMEMXFER, FAR * pTW_IMAGEMEMXFER;
318
319/* Changed in 1.1: QuantTable, HuffmanDC, HuffmanAC TW_MEMREF -> TW_MEMORY */
320/* DAT_JPEGCOMPRESSION. Based on JPEG Draft International Std, ver 10918-1. */
321typedef struct {
322 TW_UINT16 ColorSpace; /* One of the TWPT_xxxx values */
323 TW_UINT32 SubSampling; /* Two word "array" for subsampling values */
324 TW_UINT16 NumComponents; /* Number of color components in image */
325 TW_UINT16 RestartFrequency; /* Frequency of restart marker codes in MDU's */
326 TW_UINT16 QuantMap[4]; /* Mapping of components to QuantTables */
327 TW_MEMORY QuantTable[4]; /* Quantization tables */
328 TW_UINT16 HuffmanMap[4]; /* Mapping of components to Huffman tables */
329 TW_MEMORY HuffmanDC[2]; /* DC Huffman tables */
330 TW_MEMORY HuffmanAC[2]; /* AC Huffman tables */
331} TW_JPEGCOMPRESSION, FAR * pTW_JPEGCOMPRESSION;
332
333/* DAT_PALETTE8. Color palette when TWPT_PALETTE pixels xfer'd in mem buf. */
334typedef struct {
335 TW_UINT16 NumColors; /* Number of colors in the color table. */
336 TW_UINT16 PaletteType; /* TWPA_xxxx, specifies type of palette. */
337 TW_ELEMENT8 Colors[256]; /* Array of palette values starts here. */
338} TW_PALETTE8, FAR * pTW_PALETTE8;
339
340/* DAT_PENDINGXFERS. Used with MSG_ENDXFER to indicate additional data. */
341typedef struct {
342 TW_UINT16 Count;
343 union {
344 TW_UINT32 EOJ;
345 TW_UINT32 Reserved;
346 };
347} TW_PENDINGXFERS, FAR *pTW_PENDINGXFERS;
348
349/* DAT_RGBRESPONSE */
350typedef struct {
351 TW_ELEMENT8 Response[1];
352} TW_RGBRESPONSE, FAR * pTW_RGBRESPONSE;
353
354/* DAT_SETUPFILEXFER. Sets up DS to application data transfer via a file. */
355typedef struct {
356 TW_STR255 FileName;
357 TW_UINT16 Format; /* Any TWFF_ constant */
358 TW_INT16 VRefNum; /* Used for Mac only */
359} TW_SETUPFILEXFER, FAR * pTW_SETUPFILEXFER;
360
361/* DAT_SETUPMEMXFER. Sets up DS to application data transfer via a memory buffer. */
362typedef struct {
363 TW_UINT32 MinBufSize;
364 TW_UINT32 MaxBufSize;
365 TW_UINT32 Preferred;
366} TW_SETUPMEMXFER, FAR * pTW_SETUPMEMXFER;
367
368/* DAT_STATUS. Application gets detailed status info from a data source with this. */
369typedef struct {
370 TW_UINT16 ConditionCode; /* Any TWCC_ constant */
371 TW_UINT16 Reserved; /* Future expansion space */
372} TW_STATUS, FAR * pTW_STATUS;
373
374/* DAT_USERINTERFACE. Coordinates UI between application and data source. */
375typedef struct {
376 TW_BOOL ShowUI; /* TRUE if DS should bring up its UI */
377 TW_BOOL ModalUI; /* For Mac only - true if the DS's UI is modal */
378 TW_HANDLE hParent; /* For windows only - Application window handle */
379} TW_USERINTERFACE, FAR * pTW_USERINTERFACE;
380
381/* SDH - 03/21/95 - TWUNK */
382/* DAT_TWUNKIDENTITY. Provides DS identity and 'other' information necessary */
383/* across thunk link. */
384typedef struct {
385 TW_IDENTITY identity; /* Identity of data source. */
386 TW_STR255 dsPath; /* Full path and file name of data source. */
387} TW_TWUNKIDENTITY, FAR * pTW_TWUNKIDENTITY;
388
389/* SDH - 03/21/95 - TWUNK */
390/* Provides DS_Entry parameters over thunk link. */
391typedef struct
392{
393 TW_INT8 destFlag; /* TRUE if dest is not NULL */
394 TW_IDENTITY dest; /* Identity of data source (if used) */
395 TW_INT32 dataGroup; /* DSM_Entry dataGroup parameter */
396 TW_INT16 dataArgType; /* DSM_Entry dataArgType parameter */
397 TW_INT16 message; /* DSM_Entry message parameter */
398 TW_INT32 pDataSize; /* Size of pData (0 if NULL) */
399 // TW_MEMREF pData; /* Based on implementation specifics, a */
400 /* pData parameter makes no sense in this */
401 /* structure, but data (if provided) will be*/
402 /* appended in the data block. */
403 } TW_TWUNKDSENTRYPARAMS, FAR * pTW_TWUNKDSENTRYPARAMS;
404
405/* SDH - 03/21/95 - TWUNK */
406/* Provides DS_Entry results over thunk link. */
407typedef struct
408{
409 TW_UINT16 returnCode; /* Thunker DsEntry return code. */
410 TW_UINT16 conditionCode; /* Thunker DsEntry condition code. */
411 TW_INT32 pDataSize; /* Size of pData (0 if NULL) */
412 // TW_MEMREF pData; /* Based on implementation specifics, a */
413 /* pData parameter makes no sense in this */
414 /* structure, but data (if provided) will be*/
415 /* appended in the data block. */
416} TW_TWUNKDSENTRYRETURN, FAR * pTW_TWUNKDSENTRYRETURN;
417
418/* WJD - 950818 */
419/* Added for 1.6 Specification */
420/* TWAIN 1.6 CAP_SUPPORTEDCAPSEXT structure */
421typedef struct
422{
423 TW_UINT16 Cap; /* Which CAP/ICAP info is relevant to */
424 TW_UINT16 Properties; /* Messages this CAP/ICAP supports */
425} TW_CAPEXT, FAR * pTW_CAPEXT;
426
427/* ----------------------------------------------------------------------- *\
428
429 Version 1.7: Added Following data structure for Document Imaging
430 July 1997 Enhancement.
431 KHL TW_CUSTOMDSDATA -- For Saving and Restoring Source's
432 state.
433 TW_INFO -- Each attribute for extended image
434 information.
435 TW_EXTIMAGEINFO -- Extended image information structure.
436
437\* ----------------------------------------------------------------------- */
438
439typedef struct {
440 TW_UINT32 InfoLength; /* Length of Information in bytes. */
441 TW_HANDLE hData; /* Place holder for data, DS Allocates */
442}TW_CUSTOMDSDATA, FAR *pTW_CUSTOMDSDATA;
443
444typedef struct {
445 TW_UINT16 InfoID;
446 TW_UINT16 ItemType;
447 TW_UINT16 NumItems;
448 TW_UINT16 CondCode;
449 TW_UINT32 Item;
450}TW_INFO, FAR* pTW_INFO;
451
452typedef struct {
453 TW_UINT32 NumInfos;
454 TW_INFO Info[1];
455}TW_EXTIMAGEINFO, FAR* pTW_EXTIMAGEINFO;
456
457/* Added 1.8 */
458
459/* DAT_AUDIOINFO, information about audio data */
460typedef struct {
461 TW_STR255 Name; /* name of audio data */
462 TW_UINT32 Reserved; /* reserved space */
463} TW_AUDIOINFO, FAR * pTW_AUDIOINFO;
464
465/* DAT_DEVICEEVENT, information about events */
466typedef struct {
467 TW_UINT32 Event; /* One of the TWDE_xxxx values. */
468 TW_STR255 DeviceName; /* The name of the device that generated the event */
469 TW_UINT32 BatteryMinutes; /* Battery Minutes Remaining */
470 TW_INT16 BatteryPercentage; /* Battery Percentage Remaining */
471 TW_INT32 PowerSupply; /* Power Supply */
472 TW_FIX32 XResolution; /* Resolution */
473 TW_FIX32 YResolution; /* Resolution */
474 TW_UINT32 FlashUsed2; /* Flash Used2 */
475 TW_UINT32 AutomaticCapture; /* Automatic Capture */
476 TW_UINT32 TimeBeforeFirstCapture; /* Automatic Capture */
477 TW_UINT32 TimeBetweenCaptures; /* Automatic Capture */
478} TW_DEVICEEVENT, FAR * pTW_DEVICEEVENT;
479
480/* DAT_FILESYSTEM, information about TWAIN file system */
481typedef struct {
482 /* DG_CONTROL / DAT_FILESYSTEM / MSG_xxxx fields */
483 TW_STR255 InputName; /* The name of the input or source file */
484 TW_STR255 OutputName; /* The result of an operation or the name of a destination file */
485 TW_MEMREF Context; /* Source specific data used to remember state information */
486 /* DG_CONTROL / DAT_FILESYSTEM / MSG_DELETE field */
487 int Recursive; /* recursively delete all sub-directories */
488 /* DG_CONTROL / DAT_FILESYSTEM / MSG_GETINFO fields */
489 TW_INT32 FileType; /* One of the TWFT_xxxx values */
490 TW_UINT32 Size; /* Size of current FileType */
491 TW_STR32 CreateTimeDate; /* creation date of the file */
492 TW_STR32 ModifiedTimeDate; /* last date the file was modified */
493 TW_UINT32 FreeSpace; /* bytes of free space on the current device */
494 TW_INT32 NewImageSize; /* estimate of the amount of space a new image would take up */
495 TW_UINT32 NumberOfFiles; /* number of files, depends on FileType */
496 TW_UINT32 NumberOfSnippets; /**/
497 char Reserved[512]; /**/
498} TW_FILESYSTEM, FAR * pTW_FILESYSTEM;
499
500/* DAT_PASSTHRU, device dependant data to pass through Data Source */
501typedef struct {
502 TW_MEMREF pCommand; /* Pointer to Command buffer */
503 TW_UINT32 CommandBytes; /* Number of bytes in Command buffer */
504 TW_INT32 Direction; /* One of the TWDR_xxxx values. Defines the direction of data flow */
505 TW_MEMREF pData; /* Pointer to Data buffer */
506 TW_UINT32 DataBytes; /* Number of bytes in Data buffer */
507 TW_UINT32 DataBytesXfered; /* Number of bytes successfully transferred */
508} TW_PASSTHRU, FAR * pTW_PASSTHRU;
509
510/* DAT_SETUPAUDIOFILEXFER, information required to setup an audio file transfer */
511typedef struct {
512 TW_STR255 FileName; /* full path target file */
513 TW_UINT16 Format; /* one of TWAF_xxxx */
514 TW_INT16 VRefNum;
515} TW_SETUPAUDIOFILEXFER, FAR * pTW_SETUPAUDIOFILEXFER;
516
517/****************************************************************************
518 * Generic Constants *
519 ****************************************************************************/
520
521#define TWON_ARRAY 3 /* indicates TW_ARRAY container */
522#define TWON_ENUMERATION 4 /* indicates TW_ENUMERATION container */
523#define TWON_ONEVALUE 5 /* indicates TW_ONEVALUE container */
524#define TWON_RANGE 6 /* indicates TW_RANGE container */
525
526#define TWON_ICONID 962 /* res Id of icon used in USERSELECT lbox */
527#define TWON_DSMID 461 /* res Id of the DSM version num resource */
528#define TWON_DSMCODEID 63 /* res Id of the Mac SM Code resource */
529
530#define TWON_DONTCARE8 0xff
531#define TWON_DONTCARE16 0xffff
532#define TWON_DONTCARE32 0xffffffff
533
534/* Flags used in TW_MEMORY structure. */
535#define TWMF_APPOWNS 0x1
536#define TWMF_DSMOWNS 0x2
537#define TWMF_DSOWNS 0x4
538#define TWMF_POINTER 0x8
539#define TWMF_HANDLE 0x10
540
541/* Palette types for TW_PALETTE8 */
542#define TWPA_RGB 0
543#define TWPA_GRAY 1
544#define TWPA_CMY 2
545
546/* There are four containers used for capabilities negotiation:
547 * TWON_ONEVALUE, TWON_RANGE, TWON_ENUMERATION, TWON_ARRAY
548 * In each container structure ItemType can be TWTY_INT8, TWTY_INT16, etc.
549 * The kind of data stored in the container can be determined by doing
550 * DCItemSize[ItemType] where the following is defined in TWAIN glue code:
551 * DCItemSize[]= { sizeof(TW_INT8),
552 * sizeof(TW_INT16),
553 * etc.
554 * sizeof(TW_UINT32) };
555 *
556 */
557
558#define TWTY_INT8 0x0000 /* Means Item is a TW_INT8 */
559#define TWTY_INT16 0x0001 /* Means Item is a TW_INT16 */
560#define TWTY_INT32 0x0002 /* Means Item is a TW_INT32 */
561
562#define TWTY_UINT8 0x0003 /* Means Item is a TW_UINT8 */
563#define TWTY_UINT16 0x0004 /* Means Item is a TW_UINT16 */
564#define TWTY_UINT32 0x0005 /* Means Item is a TW_UINT32 */
565
566#define TWTY_BOOL 0x0006 /* Means Item is a TW_BOOL */
567
568#define TWTY_FIX32 0x0007 /* Means Item is a TW_FIX32 */
569
570#define TWTY_FRAME 0x0008 /* Means Item is a TW_FRAME */
571
572#define TWTY_STR32 0x0009 /* Means Item is a TW_STR32 */
573#define TWTY_STR64 0x000a /* Means Item is a TW_STR64 */
574#define TWTY_STR128 0x000b /* Means Item is a TW_STR128 */
575#define TWTY_STR255 0x000c /* Means Item is a TW_STR255 */
576
577/****************************************************************************
578 * Capability Constants *
579 ****************************************************************************/
580
581/* ICAP_BITORDER values (BO_ means Bit Order) */
582#define TWBO_LSBFIRST 0
583#define TWBO_MSBFIRST 1
584
585/* ICAP_COMPRESSION values (CP_ means ComPression ) */
586#define TWCP_NONE 0
587#define TWCP_PACKBITS 1
588#define TWCP_GROUP31D 2 /* Follows CCITT spec (no End Of Line) */
589#define TWCP_GROUP31DEOL 3 /* Follows CCITT spec (has End Of Line) */
590#define TWCP_GROUP32D 4 /* Follows CCITT spec (use cap for K Factor) */
591#define TWCP_GROUP4 5 /* Follows CCITT spec */
592#define TWCP_JPEG 6 /* Use capability for more info */
593#define TWCP_LZW 7 /* Must license from Unisys and IBM to use */
594#define TWCP_JBIG 8 /* For Bitonal images -- Added 1.7 KHL */
595/* Added 1.8 */
596#define TWCP_PNG 9
597#define TWCP_RLE4 10
598#define TWCP_RLE8 11
599#define TWCP_BITFIELDS 12
600
601
602/* ICAP_IMAGEFILEFORMAT values (FF_means File Format) */
603#define TWFF_TIFF 0 /* Tagged Image File Format */
604#define TWFF_PICT 1 /* Macintosh PICT */
605#define TWFF_BMP 2 /* Windows Bitmap */
606#define TWFF_XBM 3 /* X-Windows Bitmap */
607#define TWFF_JFIF 4 /* JPEG File Interchange Format */
608#define TWFF_FPX 5 /* Flash Pix */
609#define TWFF_TIFFMULTI 6 /* Multi-page tiff file */
610#define TWFF_PNG 7
611#define TWFF_SPIFF 8
612#define TWFF_EXIF 9
613
614
615/* ICAP_FILTER values (FT_ means Filter Type) */
616#define TWFT_RED 0
617#define TWFT_GREEN 1
618#define TWFT_BLUE 2
619#define TWFT_NONE 3
620#define TWFT_WHITE 4
621#define TWFT_CYAN 5
622#define TWFT_MAGENTA 6
623#define TWFT_YELLOW 7
624#define TWFT_BLACK 8
625
626/* ICAP_LIGHTPATH values (LP_ means Light Path) */
627#define TWLP_REFLECTIVE 0
628#define TWLP_TRANSMISSIVE 1
629
630/* ICAP_LIGHTSOURCE values (LS_ means Light Source) */
631#define TWLS_RED 0
632#define TWLS_GREEN 1
633#define TWLS_BLUE 2
634#define TWLS_NONE 3
635#define TWLS_WHITE 4
636#define TWLS_UV 5
637#define TWLS_IR 6
638
639/* ICAP_ORIENTATION values (OR_ means ORientation) */
640#define TWOR_ROT0 0
641#define TWOR_ROT90 1
642#define TWOR_ROT180 2
643#define TWOR_ROT270 3
644#define TWOR_PORTRAIT TWOR_ROT0
645#define TWOR_LANDSCAPE TWOR_ROT270
646
647/* ICAP_PLANARCHUNKY values (PC_ means Planar/Chunky ) */
648#define TWPC_CHUNKY 0
649#define TWPC_PLANAR 1
650
651/* ICAP_PIXELFLAVOR values (PF_ means Pixel Flavor) */
652#define TWPF_CHOCOLATE 0 /* zero pixel represents darkest shade */
653#define TWPF_VANILLA 1 /* zero pixel represents lightest shade */
654
655/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */
656#define TWPT_BW 0 /* Black and White */
657#define TWPT_GRAY 1
658#define TWPT_RGB 2
659#define TWPT_PALETTE 3
660#define TWPT_CMY 4
661#define TWPT_CMYK 5
662#define TWPT_YUV 6
663#define TWPT_YUVK 7
664#define TWPT_CIEXYZ 8
665
666/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */
667#define TWSS_NONE 0
668#define TWSS_A4LETTER 1
669#define TWSS_B5LETTER 2
670#define TWSS_USLETTER 3
671#define TWSS_USLEGAL 4
672/* Added 1.5 */
673#define TWSS_A5 5
674#define TWSS_B4 6
675#define TWSS_B6 7
676//#define TWSS_B 8
677/* Added 1.7 */
678#define TWSS_USLEDGER 9
679#define TWSS_USEXECUTIVE 10
680#define TWSS_A3 11
681#define TWSS_B3 12
682#define TWSS_A6 13
683#define TWSS_C4 14
684#define TWSS_C5 15
685#define TWSS_C6 16
686/* Added 1.8 */
687#define TWSS_4A0 17
688#define TWSS_2A0 18
689#define TWSS_A0 19
690#define TWSS_A1 20
691#define TWSS_A2 21
692#define TWSS_A4 TWSS_A4LETTER
693#define TWSS_A7 22
694#define TWSS_A8 23
695#define TWSS_A9 24
696#define TWSS_A10 25
697#define TWSS_ISOB0 26
698#define TWSS_ISOB1 27
699#define TWSS_ISOB2 28
700#define TWSS_ISOB3 TWSS_B3
701#define TWSS_ISOB4 TWSS_B4
702#define TWSS_ISOB5 29
703#define TWSS_ISOB6 TWSS_B6
704#define TWSS_ISOB7 30
705#define TWSS_ISOB8 31
706#define TWSS_ISOB9 32
707#define TWSS_ISOB10 33
708#define TWSS_JISB0 34
709#define TWSS_JISB1 35
710#define TWSS_JISB2 36
711#define TWSS_JISB3 37
712#define TWSS_JISB4 38
713#define TWSS_JISB5 TWSS_B5LETTER
714#define TWSS_JISB6 39
715#define TWSS_JISB7 40
716#define TWSS_JISB8 41
717#define TWSS_JISB9 42
718#define TWSS_JISB10 43
719#define TWSS_C0 44
720#define TWSS_C1 45
721#define TWSS_C2 46
722#define TWSS_C3 47
723#define TWSS_C7 48
724#define TWSS_C8 49
725#define TWSS_C9 50
726#define TWSS_C10 51
727#define TWSS_USSTATEMENT 52
728#define TWSS_BUSINESSCARD 53
729
730/* ICAP_XFERMECH values (SX_ means Setup XFer) */
731#define TWSX_NATIVE 0
732#define TWSX_FILE 1
733#define TWSX_MEMORY 2
734
735/* ICAP_UNITS values (UN_ means UNits) */
736#define TWUN_INCHES 0
737#define TWUN_CENTIMETERS 1
738#define TWUN_PICAS 2
739#define TWUN_POINTS 3
740#define TWUN_TWIPS 4
741#define TWUN_PIXELS 5
742
743/* Added 1.5 */
744/* ICAP_BITDEPTHREDUCTION values (BR_ means Bitdepth Reduction) */
745#define TWBR_THRESHOLD 0
746#define TWBR_HALFTONE 1
747#define TWBR_CUSTHALFTONE 2
748#define TWBR_DIFFUSION 3
749
750/* Added 1.7 */
751/* ICAP_DUPLEX values */
752#define TWDX_NONE 0
753#define TWDX_1PASSDUPLEX 1
754#define TWDX_2PASSDUPLEX 2
755
756/* Added 1.7 */
757/* TWEI_BARCODETYPE values */
758#define TWBT_3OF9 0
759#define TWBT_2OF5INTERLEAVED 1
760#define TWBT_2OF5NONINTERLEAVED 2
761#define TWBT_CODE93 3
762#define TWBT_CODE128 4
763#define TWBT_UCC128 5
764#define TWBT_CODABAR 6
765#define TWBT_UPCA 7
766#define TWBT_UPCE 8
767#define TWBT_EAN8 9
768#define TWBT_EAN13 10
769#define TWBT_POSTNET 11
770#define TWBT_PDF417 12
771/* Added 1.8 */
772#define TWBT_2OF5INDUSTRIAL 13
773#define TWBT_2OF5MATRIX 14
774#define TWBT_2OF5DATALOGIC 15
775#define TWBT_2OF5IATA 16
776#define TWBT_3OF9FULLASCII 17
777#define TWBT_CODABARWITHSTARTSTOP 18
778#define TWBT_MAXICODE 19
779
780/* Added 1.7 */
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/* Added 1.7 */
788/* TWEI_PATCHCODE values */
789#define TWPCH_PATCH1 0
790#define TWPCH_PATCH2 1
791#define TWPCH_PATCH3 2
792#define TWPCH_PATCH4 3
793#define TWPCH_PATCH6 4
794#define TWPCH_PATCHT 5
795
796/* Added 1.7 */
797/* CAP_JOBCONTROL values */
798#define TWJC_NONE 0
799#define TWJC_JSIC 1
800#define TWJC_JSIS 2
801#define TWJC_JSXC 3
802#define TWJC_JSXS 4
803
804/* Added 1.7 */
805/* TWEI_BARCODEROTATION values (BCOR_ means barcode rotation) */
806#define TWBCOR_ROT0 0
807#define TWBCOR_ROT90 1
808#define TWBCOR_ROT180 2
809#define TWBCOR_ROT270 3
810#define TWBCOR_ROTX 4
811
812/* Added 1.8 */
813/* ACAP_AUDIOFILEFORMAT values (AF_ means audio format) */
814#define TWAF_WAV 0
815#define TWAF_AIFF 1
816#define TWAF_AU 3
817#define TWAF_SND 4
818
819/* CAP_ALARMS values (AL_ means alarms) */
820#define TWAL_ALARM 0
821#define TWAL_FEEDERERROR 1
822#define TWAL_FEEDERWARNING 2
823#define TWAL_BARCODE 3
824#define TWAL_DOUBLEFEED 4
825#define TWAL_JAM 5
826#define TWAL_PATCHCODE 6
827#define TWAL_POWER 7
828#define TWAL_SKEW 8
829
830/* CAP_CLEARBUFFERS values (CB_ means clear buffers) */
831#define TWCB_AUTO 0
832#define TWCB_CLEAR 1
833#define TWCB_NOCLEAR 2
834
835/* CAP_DEVICEEVENT values (DE_ means device event) */
836#define TWDE_CUSTOMEVENTS 0x8000
837#define TWDE_CHECKAUTOMATICCAPTURE 0
838#define TWDE_CHECKBATTERY 1
839#define TWDE_CHECKDEVICEONLINE 2
840#define TWDE_CHECKFLASH 3
841#define TWDE_CHECKPOWERSUPPLY 4
842#define TWDE_CHECKRESOLUTION 5
843#define TWDE_DEVICEADDED 6
844#define TWDE_DEVICEOFFLINE 7
845#define TWDE_DEVICEREADY 8
846#define TWDE_DEVICEREMOVED 9
847#define TWDE_IMAGECAPTURED 10
848#define TWDE_IMAGEDELETED 11
849#define TWDE_PAPERDOUBLEFEED 12
850#define TWDE_PAPERJAM 13
851#define TWDE_LAMPFAILURE 14
852#define TWDE_POWERSAVE 15
853#define TWDE_POWERSAVENOTIFY 16
854
855/* CAP_FEEDERALIGNMENT values (FA_ means feeder alignment) */
856#define TWFA_NONE 0
857#define TWFA_LEFT 1
858#define TWFA_CENTER 2
859#define TWFA_RIGHT 3
860
861/* CAP_FEEDERORDER values (FO_ means feeder order) */
862#define TWFO_FIRSTPAGEFIRST 0
863#define TWFO_LASTPAGEFIRST 1
864
865/* CAP_FILESYSTEM values (FS_ means file system) */
866#define TWFS_FILESYSTEM 0
867#define TWFS_RECURSIVEDELETE 1
868
869/* CAP_POWERSUPPLY values (PS_ means power supply) */
870#define TWPS_EXTERNAL 0
871#define TWPS_BATTERY 1
872
873/* CAP_PRINTER values (PR_ means printer) */
874#define TWPR_IMPRINTERTOPBEFORE 0
875#define TWPR_IMPRINTERTOPAFTER 1
876#define TWPR_IMPRINTERBOTTOMBEFORE 2
877#define TWPR_IMPRINTERBOTTOMAFTER 3
878#define TWPR_ENDORSERTOPBEFORE 4
879#define TWPR_ENDORSERTOPAFTER 5
880#define TWPR_ENDORSERBOTTOMBEFORE 6
881#define TWPR_ENDORSERBOTTOMAFTER 7
882
883/* CAP_PRINTERMODE values (PM_ means printer mode) */
884#define TWPM_SINGLESTRING 0
885#define TWPM_MULTISTRING 1
886#define TWPM_COMPOUNDSTRING 2
887
888/* ICAP_BARCODESEARCHMODE values (TWBD_ means search) */
889#define TWBD_HORZ 0
890#define TWBD_VERT 1
891#define TWBD_HORZVERT 2
892#define TWBD_VERTHORZ 3
893
894/* ICAP_FLASHUSED2 values (FL_ means flash) */
895#define TWFL_NONE 0
896#define TWFL_OFF 1
897#define TWFL_ON 2
898#define TWFL_AUTO 3
899#define TWFL_REDEYE 4
900
901/* ICAP_FLIPROTATION values (FR_ means flip rotation) */
902#define TWFR_BOOK 0
903#define TWFR_FANFOLD 1
904
905/* ICAP_IMAGEFILTER values (IF_ means image filter) */
906#define TWIF_NONE 0
907#define TWIF_AUTO 1
908#define TWIF_LOWPASS 2
909#define TWIF_BANDPASS 3
910#define TWIF_HIGHPASS 4
911#define TWIF_TEXT TWIF_BANDPASS
912#define TWIF_FINELINE TWIF_HIGHPASS
913
914/* ICAP_NOISEFILTER values (NF_ means noise filter) */
915#define TWNF_NONE 0
916#define TWNF_AUTO 1
917#define TWNF_LONEPIXEL 2
918#define TWNF_MAJORITYRULE 3
919
920/* ICAP_OVERSCAN values (OV_ means overscan) */
921#define TWOV_NONE 0
922#define TWOV_AUTO 1
923#define TWOV_TOPBOTTOM 2
924#define TWOV_LEFTRIGHT 3
925#define TWOV_ALL 4
926
927/* TW_FILESYSTEM.FileType values (FT_ means file type) */
928#define TWFY_CAMERA 0
929#define TWFY_CAMERATOP 1
930#define TWFY_CAMERABOTTOM 2
931#define TWFY_CAMERAPREVIEW 3
932#define TWFY_DOMAIN 4
933#define TWFY_HOST 5
934#define TWFY_DIRECTORY 6
935#define TWFY_IMAGE 7
936#define TWFY_UNKNOWN 8
937
938/****************************************************************************
939 * Country Constants *
940 ****************************************************************************/
941
942#define TWCY_AFGHANISTAN 1001
943#define TWCY_ALGERIA 213
944#define TWCY_AMERICANSAMOA 684
945#define TWCY_ANDORRA 033
946#define TWCY_ANGOLA 1002
947#define TWCY_ANGUILLA 8090
948#define TWCY_ANTIGUA 8091
949#define TWCY_ARGENTINA 54
950#define TWCY_ARUBA 297
951#define TWCY_ASCENSIONI 247
952#define TWCY_AUSTRALIA 61
953#define TWCY_AUSTRIA 43
954#define TWCY_BAHAMAS 8092
955#define TWCY_BAHRAIN 973
956#define TWCY_BANGLADESH 880
957#define TWCY_BARBADOS 8093
958#define TWCY_BELGIUM 32
959#define TWCY_BELIZE 501
960#define TWCY_BENIN 229
961#define TWCY_BERMUDA 8094
962#define TWCY_BHUTAN 1003
963#define TWCY_BOLIVIA 591
964#define TWCY_BOTSWANA 267
965#define TWCY_BRITAIN 6
966#define TWCY_BRITVIRGINIS 8095
967#define TWCY_BRAZIL 55
968#define TWCY_BRUNEI 673
969#define TWCY_BULGARIA 359
970#define TWCY_BURKINAFASO 1004
971#define TWCY_BURMA 1005
972#define TWCY_BURUNDI 1006
973#define TWCY_CAMAROON 237
974#define TWCY_CANADA 2
975#define TWCY_CAPEVERDEIS 238
976#define TWCY_CAYMANIS 8096
977#define TWCY_CENTRALAFREP 1007
978#define TWCY_CHAD 1008
979#define TWCY_CHILE 56
980#define TWCY_CHINA 86
981#define TWCY_CHRISTMASIS 1009
982#define TWCY_COCOSIS 1009
983#define TWCY_COLOMBIA 57
984#define TWCY_COMOROS 1010
985#define TWCY_CONGO 1011
986#define TWCY_COOKIS 1012
987#define TWCY_COSTARICA 506
988#define TWCY_CUBA 005
989#define TWCY_CYPRUS 357
990#define TWCY_CZECHOSLOVAKIA 42
991#define TWCY_DENMARK 45
992#define TWCY_DJIBOUTI 1013
993#define TWCY_DOMINICA 8097
994#define TWCY_DOMINCANREP 8098
995#define TWCY_EASTERIS 1014
996#define TWCY_ECUADOR 593
997#define TWCY_EGYPT 20
998#define TWCY_ELSALVADOR 503
999#define TWCY_EQGUINEA 1015
1000#define TWCY_ETHIOPIA 251
1001#define TWCY_FALKLANDIS 1016
1002#define TWCY_FAEROEIS 298
1003#define TWCY_FIJIISLANDS 679
1004#define TWCY_FINLAND 358
1005#define TWCY_FRANCE 33
1006#define TWCY_FRANTILLES 596
1007#define TWCY_FRGUIANA 594
1008#define TWCY_FRPOLYNEISA 689
1009#define TWCY_FUTANAIS 1043
1010#define TWCY_GABON 241
1011#define TWCY_GAMBIA 220
1012#define TWCY_GERMANY 49
1013#define TWCY_GHANA 233
1014#define TWCY_GIBRALTER 350
1015#define TWCY_GREECE 30
1016#define TWCY_GREENLAND 299
1017#define TWCY_GRENADA 8099
1018#define TWCY_GRENEDINES 8015
1019#define TWCY_GUADELOUPE 590
1020#define TWCY_GUAM 671
1021#define TWCY_GUANTANAMOBAY 5399
1022#define TWCY_GUATEMALA 502
1023#define TWCY_GUINEA 224
1024#define TWCY_GUINEABISSAU 1017
1025#define TWCY_GUYANA 592
1026#define TWCY_HAITI 509
1027#define TWCY_HONDURAS 504
1028#define TWCY_HONGKONG 852
1029#define TWCY_HUNGARY 36
1030#define TWCY_ICELAND 354
1031#define TWCY_INDIA 91
1032#define TWCY_INDONESIA 62
1033#define TWCY_IRAN 98
1034#define TWCY_IRAQ 964
1035#define TWCY_IRELAND 353
1036#define TWCY_ISRAEL 972
1037#define TWCY_ITALY 39
1038#define TWCY_IVORYCOAST 225
1039#define TWCY_JAMAICA 8010
1040#define TWCY_JAPAN 81
1041#define TWCY_JORDAN 962
1042#define TWCY_KENYA 254
1043#define TWCY_KIRIBATI 1018
1044#define TWCY_KOREA 82
1045#define TWCY_KUWAIT 965
1046#define TWCY_LAOS 1019
1047#define TWCY_LEBANON 1020
1048#define TWCY_LIBERIA 231
1049#define TWCY_LIBYA 218
1050#define TWCY_LIECHTENSTEIN 41
1051#define TWCY_LUXENBOURG 352
1052#define TWCY_MACAO 853
1053#define TWCY_MADAGASCAR 1021
1054#define TWCY_MALAWI 265
1055#define TWCY_MALAYSIA 60
1056#define TWCY_MALDIVES 960
1057#define TWCY_MALI 1022
1058#define TWCY_MALTA 356
1059#define TWCY_MARSHALLIS 692
1060#define TWCY_MAURITANIA 1023
1061#define TWCY_MAURITIUS 230
1062#define TWCY_MEXICO 3
1063#define TWCY_MICRONESIA 691
1064#define TWCY_MIQUELON 508
1065#define TWCY_MONACO 33
1066#define TWCY_MONGOLIA 1024
1067#define TWCY_MONTSERRAT 8011
1068#define TWCY_MOROCCO 212
1069#define TWCY_MOZAMBIQUE 1025
1070#define TWCY_NAMIBIA 264
1071#define TWCY_NAURU 1026
1072#define TWCY_NEPAL 977
1073#define TWCY_NETHERLANDS 31
1074#define TWCY_NETHANTILLES 599
1075#define TWCY_NEVIS 8012
1076#define TWCY_NEWCALEDONIA 687
1077#define TWCY_NEWZEALAND 64
1078#define TWCY_NICARAGUA 505
1079#define TWCY_NIGER 227
1080#define TWCY_NIGERIA 234
1081#define TWCY_NIUE 1027
1082#define TWCY_NORFOLKI 1028
1083#define TWCY_NORWAY 47
1084#define TWCY_OMAN 968
1085#define TWCY_PAKISTAN 92
1086#define TWCY_PALAU 1029
1087#define TWCY_PANAMA 507
1088#define TWCY_PARAGUAY 595
1089#define TWCY_PERU 51
1090#define TWCY_PHILLIPPINES 63
1091#define TWCY_PITCAIRNIS 1030
1092#define TWCY_PNEWGUINEA 675
1093#define TWCY_POLAND 48
1094#define TWCY_PORTUGAL 351
1095#define TWCY_QATAR 974
1096#define TWCY_REUNIONI 1031
1097#define TWCY_ROMANIA 40
1098#define TWCY_RWANDA 250
1099#define TWCY_SAIPAN 670
1100#define TWCY_SANMARINO 39
1101#define TWCY_SAOTOME 1033
1102#define TWCY_SAUDIARABIA 966
1103#define TWCY_SENEGAL 221
1104#define TWCY_SEYCHELLESIS 1034
1105#define TWCY_SIERRALEONE 1035
1106#define TWCY_SINGAPORE 65
1107#define TWCY_SOLOMONIS 1036
1108#define TWCY_SOMALI 1037
1109#define TWCY_SOUTHAFRICA 27
1110#define TWCY_SPAIN 34
1111#define TWCY_SRILANKA 94
1112#define TWCY_STHELENA 1032
1113#define TWCY_STKITTS 8013
1114#define TWCY_STLUCIA 8014
1115#define TWCY_STPIERRE 508
1116#define TWCY_STVINCENT 8015
1117#define TWCY_SUDAN 1038
1118#define TWCY_SURINAME 597
1119#define TWCY_SWAZILAND 268
1120#define TWCY_SWEDEN 46
1121#define TWCY_SWITZERLAND 41
1122#define TWCY_SYRIA 1039
1123#define TWCY_TAIWAN 886
1124#define TWCY_TANZANIA 255
1125#define TWCY_THAILAND 66
1126#define TWCY_TOBAGO 8016
1127#define TWCY_TOGO 228
1128#define TWCY_TONGAIS 676
1129#define TWCY_TRINIDAD 8016
1130#define TWCY_TUNISIA 216
1131#define TWCY_TURKEY 90
1132#define TWCY_TURKSCAICOS 8017
1133#define TWCY_TUVALU 1040
1134#define TWCY_UGANDA 256
1135#define TWCY_USSR 7
1136#define TWCY_UAEMIRATES 971
1137#define TWCY_UNITEDKINGDOM 44
1138#define TWCY_USA 1
1139#define TWCY_URUGUAY 598
1140#define TWCY_VANUATU 1041
1141#define TWCY_VATICANCITY 39
1142#define TWCY_VENEZUELA 58
1143#define TWCY_WAKE 1042
1144#define TWCY_WALLISIS 1043
1145#define TWCY_WESTERNSAHARA 1044
1146#define TWCY_WESTERNSAMOA 1045
1147#define TWCY_YEMEN 1046
1148#define TWCY_YUGOSLAVIA 38
1149#define TWCY_ZAIRE 243
1150#define TWCY_ZAMBIA 260
1151#define TWCY_ZIMBABWE 263
1152/* Added for 1.8 */
1153#define TWCY_ALBANIA 355
1154#define TWCY_ARMENIA 374
1155#define TWCY_AZERBAIJAN 994
1156#define TWCY_BELARUS 375
1157#define TWCY_BOSNIAHERZGO 387
1158#define TWCY_CAMBODIA 855
1159#define TWCY_CROATIA 385
1160#define TWCY_CZECHREPUBLIC 420
1161#define TWCY_DIEGOGARCIA 246
1162#define TWCY_ERITREA 291
1163#define TWCY_ESTONIA 372
1164#define TWCY_GEORGIA 995
1165#define TWCY_LATVIA 371
1166#define TWCY_LESOTHO 266
1167#define TWCY_LITHUANIA 370
1168#define TWCY_MACEDONIA 389
1169#define TWCY_MAYOTTEIS 269
1170#define TWCY_MOLDOVA 373
1171#define TWCY_MYANMAR 95
1172#define TWCY_NORTHKOREA 850
1173#define TWCY_PUERTORICO 787
1174#define TWCY_RUSSIA 7
1175#define TWCY_SERBIA 381
1176#define TWCY_SLOVAKIA 421
1177#define TWCY_SLOVENIA 386
1178#define TWCY_SOUTHKOREA 82
1179#define TWCY_UKRAINE 380
1180#define TWCY_USVIRGINIS 340
1181#define TWCY_VIETNAM 84
1182
1183/****************************************************************************
1184 * Language Constants *
1185 ****************************************************************************/
1186
1187#define TWLG_DAN 0 /* Danish */
1188#define TWLG_DUT 1 /* Dutch */
1189#define TWLG_ENG 2 /* International English */
1190#define TWLG_FCF 3 /* French Canadian */
1191#define TWLG_FIN 4 /* Finnish */
1192#define TWLG_FRN 5 /* French */
1193#define TWLG_GER 6 /* German */
1194#define TWLG_ICE 7 /* Icelandic */
1195#define TWLG_ITN 8 /* Italian */
1196#define TWLG_NOR 9 /* Norwegian */
1197#define TWLG_POR 10 /* Portuguese */
1198#define TWLG_SPA 11 /* Spanish */
1199#define TWLG_SWE 12 /* Swedish */
1200#define TWLG_USA 13 /* U.S. English */
1201/* Added for 1.8 */
1202#define TWLG_USERLOCALE -1
1203#define TWLG_AFRIKAANS 14
1204#define TWLG_ALBANIA 15
1205#define TWLG_ARABIC 16
1206#define TWLG_ARABIC_ALGERIA 17
1207#define TWLG_ARABIC_BAHRAIN 18
1208#define TWLG_ARABIC_EGYPT 19
1209#define TWLG_ARABIC_IRAQ 20
1210#define TWLG_ARABIC_JORDAN 21
1211#define TWLG_ARABIC_KUWAIT 22
1212#define TWLG_ARABIC_LEBANON 23
1213#define TWLG_ARABIC_LIBYA 24
1214#define TWLG_ARABIC_MOROCCO 25
1215#define TWLG_ARABIC_OMAN 26
1216#define TWLG_ARABIC_QATAR 27
1217#define TWLG_ARABIC_SAUDIARABIA 28
1218#define TWLG_ARABIC_SYRIA 29
1219#define TWLG_ARABIC_TUNISIA 30
1220#define TWLG_ARABIC_UAE 31 /* United Arabic Emirates */
1221#define TWLG_ARABIC_YEMEN 32
1222#define TWLG_BASQUE 33
1223#define TWLG_BYELORUSSIAN 34
1224#define TWLG_BULGARIAN 35
1225#define TWLG_CATALAN 36
1226#define TWLG_CHINESE 37
1227#define TWLG_CHINESE_HONGKONG 38
1228#define TWLG_CHINESE_PRC 39 /* People's Republic of China */
1229#define TWLG_CHINESE_SINGAPORE 40
1230#define TWLG_CHINESE_SIMPLIFIED 41
1231#define TWLG_CHINESE_TAIWAN 42
1232#define TWLG_CHINESE_TRADITIONAL 43
1233#define TWLG_CROATIA 44
1234#define TWLG_CZECH 45
1235#define TWLG_DANISH TWLG_DAN
1236#define TWLG_DUTCH TWLG_DUT
1237#define TWLG_DUTCH_BELGIAN 46
1238#define TWLG_ENGLISH TWLG_ENG
1239#define TWLG_ENGLISH_AUSTRALIAN 47
1240#define TWLG_ENGLISH_CANADIAN 48
1241#define TWLG_ENGLISH_IRELAND 49
1242#define TWLG_ENGLISH_NEWZEALAND 50
1243#define TWLG_ENGLISH_SOUTHAFRICA 51
1244#define TWLG_ENGLISH_UK 52
1245#define TWLG_ENGLISH_USA TWLG_USA
1246#define TWLG_ESTONIAN 53
1247#define TWLG_FAEROESE 54
1248#define TWLG_FARSI 55
1249#define TWLG_FINNISH TWLG_FIN
1250#define TWLG_FRENCH TWLG_FRN
1251#define TWLG_FRENCH_BELGIAN 56
1252#define TWLG_FRENCH_CANADIAN TWLG_FCF
1253#define TWLG_FRENCH_LUXEMBOURG 57
1254#define TWLG_FRENCH_SWISS 58
1255#define TWLG_GERMAN TWLG_GER
1256#define TWLG_GERMAN_AUSTRIAN 59
1257#define TWLG_GERMAN_LUXEMBOURG 60
1258#define TWLG_GERMAN_LIECHTENSTEIN 61
1259#define TWLG_GERMAN_SWISS 62
1260#define TWLG_GREEK 63
1261#define TWLG_HEBREW 64
1262#define TWLG_HUNGARIAN 65
1263#define TWLG_ICELANDIC TWLG_ICE
1264#define TWLG_INDONESIAN 66
1265#define TWLG_ITALIAN TWLG_ITN
1266#define TWLG_ITALIAN_SWISS 67
1267#define TWLG_JAPANESE 68
1268#define TWLG_KOREAN 69
1269#define TWLG_KOREAN_JOHAB 70
1270#define TWLG_LATVIAN 71
1271#define TWLG_LITHUANIAN 72
1272#define TWLG_NORWEGIAN TWLG_NOR
1273#define TWLG_NORWEGIAN_BOKMAL 73
1274#define TWLG_NORWEGIAN_NYNORSK 74
1275#define TWLG_POLISH 75
1276#define TWLG_PORTUGUESE TWLG_POR
1277#define TWLG_PORTUGUESE_BRAZIL 76
1278#define TWLG_ROMANIAN 77
1279#define TWLG_RUSSIAN 78
1280#define TWLG_SERBIAN_LATIN 79
1281#define TWLG_SLOVAK 80
1282#define TWLG_SLOVENIAN 81
1283#define TWLG_SPANISH TWLG_SPA
1284#define TWLG_SPANISH_MEXICAN 82
1285#define TWLG_SPANISH_MODERN 83
1286#define TWLG_SWEDISH TWLG_SWE
1287#define TWLG_THAI 84
1288#define TWLG_TURKISH 85
1289#define TWLG_UKRANIAN 86
1290/* More stuff added for 1.8 */
1291#define TWLG_ASSAMESE 87
1292#define TWLG_BENGALI 88
1293#define TWLG_BIHARI 89
1294#define TWLG_BODO 90
1295#define TWLG_DOGRI 91
1296#define TWLG_GUJARATI 92
1297#define TWLG_HARYANVI 93
1298#define TWLG_HINDI 94
1299#define TWLG_KANNADA 95
1300#define TWLG_KASHMIRI 96
1301#define TWLG_MALAYALAM 97
1302#define TWLG_MARATHI 98
1303#define TWLG_MARWARI 99
1304#define TWLG_MEGHALAYAN 100
1305#define TWLG_MIZO 101
1306#define TWLG_NAGA 102
1307#define TWLG_ORISSI 103
1308#define TWLG_PUNJABI 104
1309#define TWLG_PUSHTU 105
1310#define TWLG_SERBIAN_CYRILLIC 106
1311#define TWLG_SIKKIMI 107
1312#define TWLG_SWEDISH_FINLAND 108
1313#define TWLG_TAMIL 109
1314#define TWLG_TELUGU 110
1315#define TWLG_TRIPURI 111
1316#define TWLG_URDU 112
1317#define TWLG_VIETNAMESE 113
1318
1319/****************************************************************************
1320 * Data Groups *
1321 ****************************************************************************/
1322
1323/* More Data Groups may be added in the future.
1324 * Possible candidates include text, vector graphics, sound, etc.
1325 * NOTE: Data Group constants must be powers of 2 as they are used
1326 * as bitflags when Application asks DSM to present a list of DSs.
1327 */
1328
1329#define DG_CONTROL 0x0001L /* data pertaining to control */
1330#define DG_IMAGE 0x0002L /* data pertaining to raster images */
1331/* Added 1.8 */
1332#define DG_AUDIO 0x0004L /* data pertaining to audio */
1333
1334/****************************************************************************
1335 * Data Argument Types *
1336 ****************************************************************************/
1337
1338/* SDH - 03/23/95 - WATCH */
1339/* The thunker requires knowledge about size of data being passed in the */
1340/* lpData parameter to DS_Entry (which is not readily available due to */
1341/* type LPVOID. Thus, we key off the DAT_ argument to determine the size. */
1342/* This has a couple implications: */
1343/* 1) Any additional DAT_ features require modifications to the thunk code */
1344/* for thunker support. */
1345/* 2) Any applications which use the custom capabailites are not supported */
1346/* under thunking since we have no way of knowing what size data (if */
1347/* any) is being passed. */
1348
1349#define DAT_NULL 0x0000 /* No data or structure. */
1350#define DAT_CUSTOMBASE 0x8000 /* Base of custom DATs. */
1351
1352/* Data Argument Types for the DG_CONTROL Data Group. */
1353#define DAT_CAPABILITY 0x0001 /* TW_CAPABILITY */
1354#define DAT_EVENT 0x0002 /* TW_EVENT */
1355#define DAT_IDENTITY 0x0003 /* TW_IDENTITY */
1356#define DAT_PARENT 0x0004 /* TW_HANDLE, application win handle in Windows */
1357#define DAT_PENDINGXFERS 0x0005 /* TW_PENDINGXFERS */
1358#define DAT_SETUPMEMXFER 0x0006 /* TW_SETUPMEMXFER */
1359#define DAT_SETUPFILEXFER 0x0007 /* TW_SETUPFILEXFER */
1360#define DAT_STATUS 0x0008 /* TW_STATUS */
1361#define DAT_USERINTERFACE 0x0009 /* TW_USERINTERFACE */
1362#define DAT_XFERGROUP 0x000a /* TW_UINT32 */
1363/* SDH - 03/21/95 - TWUNK */
1364/* Additional message required for thunker to request the special */
1365/* identity information. */
1366#define DAT_TWUNKIDENTITY 0x000b /* TW_TWUNKIDENTITY */
1367#define DAT_CUSTOMDSDATA 0x000c /* TW_CUSTOMDSDATA. */
1368/* Added 1.8 */
1369#define DAT_DEVICEEVENT 0x000d /* TW_DEVICEEVENT */
1370#define DAT_FILESYSTEM 0x000e /* TW_FILESYSTEM */
1371#define DAT_PASSTHRU 0x000f /* TW_PASSTHRU */
1372
1373/* Data Argument Types for the DG_IMAGE Data Group. */
1374#define DAT_IMAGEINFO 0x0101 /* TW_IMAGEINFO */
1375#define DAT_IMAGELAYOUT 0x0102 /* TW_IMAGELAYOUT */
1376#define DAT_IMAGEMEMXFER 0x0103 /* TW_IMAGEMEMXFER */
1377#define DAT_IMAGENATIVEXFER 0x0104 /* TW_UINT32 loword is hDIB, PICHandle */
1378#define DAT_IMAGEFILEXFER 0x0105 /* Null data */
1379#define DAT_CIECOLOR 0x0106 /* TW_CIECOLOR */
1380#define DAT_GRAYRESPONSE 0x0107 /* TW_GRAYRESPONSE */
1381#define DAT_RGBRESPONSE 0x0108 /* TW_RGBRESPONSE */
1382#define DAT_JPEGCOMPRESSION 0x0109 /* TW_JPEGCOMPRESSION */
1383#define DAT_PALETTE8 0x010a /* TW_PALETTE8 */
1384#define DAT_EXTIMAGEINFO 0x010b /* TW_EXTIMAGEINFO -- for 1.7 Spec. */
1385
1386/* Added 1.8 */
1387/* Data Argument Types for the DG_AUDIO Data Group. */
1388#define DAT_AUDIOFILEXFER 0x0201 /* Null data */
1389#define DAT_AUDIOINFO 0x0202 /* TW_AUDIOINFO */
1390#define DAT_AUDIONATIVEXFER 0x0203 /* TW_UINT32 handle to WAV, (AIFF Mac) */
1391
1392/****************************************************************************
1393 * Messages *
1394 ****************************************************************************/
1395
1396/* All message constants are unique.
1397 * Messages are grouped according to which DATs they are used with.*/
1398
1399#define MSG_NULL 0x0000 /* Used in TW_EVENT structure */
1400#define MSG_CUSTOMBASE 0x8000 /* Base of custom messages */
1401
1402/* Generic messages may be used with any of several DATs. */
1403#define MSG_GET 0x0001 /* Get one or more values */
1404#define MSG_GETCURRENT 0x0002 /* Get current value */
1405#define MSG_GETDEFAULT 0x0003 /* Get default (e.g. power up) value */
1406#define MSG_GETFIRST 0x0004 /* Get first of a series of items, e.g. DSs */
1407#define MSG_GETNEXT 0x0005 /* Iterate through a series of items. */
1408#define MSG_SET 0x0006 /* Set one or more values */
1409#define MSG_RESET 0x0007 /* Set current value to default value */
1410#define MSG_QUERYSUPPORT 0x0008 /* Get supported operations on the cap. */
1411
1412/* Messages used with DAT_NULL */
1413#define MSG_XFERREADY 0x0101 /* The data source has data ready */
1414#define MSG_CLOSEDSREQ 0x0102 /* Request for Application. to close DS */
1415#define MSG_CLOSEDSOK 0x0103 /* Tell the Application. to save the state. */
1416/* Added 1.8 */
1417#define MSG_DEVICEEVENT 0X0104 /* Some event has taken place */
1418
1419/* Messages used with a pointer to a DAT_STATUS structure */
1420#define MSG_CHECKSTATUS 0x0201 /* Get status information */
1421
1422/* Messages used with a pointer to DAT_PARENT data */
1423#define MSG_OPENDSM 0x0301 /* Open the DSM */
1424#define MSG_CLOSEDSM 0x0302 /* Close the DSM */
1425
1426/* Messages used with a pointer to a DAT_IDENTITY structure */
1427#define MSG_OPENDS 0x0401 /* Open a data source */
1428#define MSG_CLOSEDS 0x0402 /* Close a data source */
1429#define MSG_USERSELECT 0x0403 /* Put up a dialog of all DS */
1430
1431/* Messages used with a pointer to a DAT_USERINTERFACE structure */
1432#define MSG_DISABLEDS 0x0501 /* Disable data transfer in the DS */
1433#define MSG_ENABLEDS 0x0502 /* Enable data transfer in the DS */
1434#define MSG_ENABLEDSUIONLY 0x0503 /* Enable for saving DS state only. */
1435
1436/* Messages used with a pointer to a DAT_EVENT structure */
1437#define MSG_PROCESSEVENT 0x0601
1438
1439/* Messages used with a pointer to a DAT_PENDINGXFERS structure */
1440#define MSG_ENDXFER 0x0701
1441
1442/* Added 1.8 */
1443/* Messages used with a pointer to a DAT_FILESYSTEM structure */
1444#define MSG_CHANGEDIRECTORY 0x0801
1445#define MSG_CREATEDIRECTORY 0x0802
1446#define MSG_DELETE 0x0803
1447#define MSG_FORMATMEDIA 0x0804
1448#define MSG_GETCLOSE 0x0805
1449#define MSG_GETFIRSTFILE 0x0806
1450#define MSG_GETINFO 0x0807
1451#define MSG_GETNEXTFILE 0x0808
1452#define MSG_RENAME 0x0809
1453
1454/* Messages used with a pointer to a DAT_PASSTHRU structure */
1455#define MSG_PASSTHRU 0x0901
1456
1457/****************************************************************************
1458 * Capabilities *
1459 ****************************************************************************/
1460
1461#define CAP_CUSTOMBASE 0x8000 /* Base of custom capabilities */
1462
1463/* all data sources are REQUIRED to support these caps */
1464#define CAP_XFERCOUNT 0x0001
1465
1466/* image data sources are REQUIRED to support these caps */
1467#define ICAP_COMPRESSION 0x0100
1468#define ICAP_PIXELTYPE 0x0101
1469#define ICAP_UNITS 0x0102 /* default is TWUN_INCHES */
1470#define ICAP_XFERMECH 0x0103
1471
1472/* all data sources MAY support these caps */
1473#define CAP_AUTHOR 0x1000
1474#define CAP_CAPTION 0x1001
1475#define CAP_FEEDERENABLED 0x1002
1476#define CAP_FEEDERLOADED 0x1003
1477#define CAP_TIMEDATE 0x1004
1478#define CAP_SUPPORTEDCAPS 0x1005
1479#define CAP_EXTENDEDCAPS 0x1006
1480#define CAP_AUTOFEED 0x1007
1481#define CAP_CLEARPAGE 0x1008
1482#define CAP_FEEDPAGE 0x1009
1483#define CAP_REWINDPAGE 0x100a
1484#define CAP_INDICATORS 0x100b /* Added 1.1 */
1485#define CAP_SUPPORTEDCAPSEXT 0x100c /* Added 1.6 */
1486#define CAP_PAPERDETECTABLE 0x100d /* Added 1.6 */
1487#define CAP_UICONTROLLABLE 0x100e /* Added 1.6 */
1488#define CAP_DEVICEONLINE 0x100f /* Added 1.6 */
1489#define CAP_AUTOSCAN 0x1010 /* Added 1.6 */
1490#define CAP_THUMBNAILSENABLED 0x1011 /* Added 1.7 */
1491#define CAP_DUPLEX 0x1012 /* Added 1.7 */
1492#define CAP_DUPLEXENABLED 0x1013 /* Added 1.7 */
1493#define CAP_ENABLEDSUIONLY 0x1014 /* Added 1.7 */
1494#define CAP_CUSTOMDSDATA 0x1015 /* Added 1.7 */
1495#define CAP_ENDORSER 0x1016 /* Added 1.7 */
1496#define CAP_JOBCONTROL 0x1017 /* Added 1.7 */
1497#define CAP_ALARMS 0x1018 /* Added 1.8 */
1498#define CAP_ALARMVOLUME 0x1019 /* Added 1.8 */
1499#define CAP_AUTOMATICCAPTURE 0x101a /* Added 1.8 */
1500#define CAP_TIMEBEFOREFIRSTCAPTURE 0x101b /* Added 1.8 */
1501#define CAP_TIMEBETWEENCAPTURES 0x101c /* Added 1.8 */
1502#define CAP_CLEARBUFFERS 0x101d /* Added 1.8 */
1503#define CAP_MAXBATCHBUFFERS 0x101e /* Added 1.8 */
1504#define CAP_DEVICETIMEDATE 0x101f /* Added 1.8 */
1505#define CAP_POWERSUPPLY 0x1020 /* Added 1.8 */
1506#define CAP_CAMERAPREVIEWUI 0x1021 /* Added 1.8 */
1507#define CAP_DEVICEEVENT 0x1022 /* Added 1.8 */
1508#define CAP_PAGEMULTIPLEACQUIRE 0x1023 /* Added 1.8 */
1509#define CAP_SERIALNUMBER 0x1024 /* Added 1.8 */
1510#define CAP_FILESYSTEM 0x1025 /* Added 1.8 */
1511#define CAP_PRINTER 0x1026 /* Added 1.8 */
1512#define CAP_PRINTERENABLED 0x1027 /* Added 1.8 */
1513#define CAP_PRINTERINDEX 0x1028 /* Added 1.8 */
1514#define CAP_PRINTERMODE 0x1029 /* Added 1.8 */
1515#define CAP_PRINTERSTRING 0x102a /* Added 1.8 */
1516#define CAP_PRINTERSUFFIX 0x102b /* Added 1.8 */
1517#define CAP_LANGUAGE 0x102c /* Added 1.8 */
1518#define CAP_FEEDERALIGNMENT 0x102d /* Added 1.8 */
1519#define CAP_FEEDERORDER 0x102e /* Added 1.8 */
1520#define CAP_PAPERBINDING 0x102f /* Added 1.8 */
1521#define CAP_REACQUIREALLOWED 0x1030 /* Added 1.8 */
1522#define CAP_PASSTHRU 0x1031 /* Added 1.8 */
1523#define CAP_BATTERYMINUTES 0x1032 /* Added 1.8 */
1524#define CAP_BATTERYPERCENTAGE 0x1033 /* Added 1.8 */
1525#define CAP_POWERDOWNTIME 0x1034 /* Added 1.8 */
1526
1527/* image data sources MAY support these caps */
1528#define ICAP_AUTOBRIGHT 0x1100
1529#define ICAP_BRIGHTNESS 0x1101
1530#define ICAP_CONTRAST 0x1103
1531#define ICAP_CUSTHALFTONE 0x1104
1532#define ICAP_EXPOSURETIME 0x1105
1533#define ICAP_FILTER 0x1106
1534#define ICAP_FLASHUSED 0x1107
1535#define ICAP_GAMMA 0x1108
1536#define ICAP_HALFTONES 0x1109
1537#define ICAP_HIGHLIGHT 0x110a
1538#define ICAP_IMAGEFILEFORMAT 0x110c
1539#define ICAP_LAMPSTATE 0x110d
1540#define ICAP_LIGHTSOURCE 0x110e
1541#define ICAP_ORIENTATION 0x1110
1542#define ICAP_PHYSICALWIDTH 0x1111
1543#define ICAP_PHYSICALHEIGHT 0x1112
1544#define ICAP_SHADOW 0x1113
1545#define ICAP_FRAMES 0x1114
1546#define ICAP_XNATIVERESOLUTION 0x1116
1547#define ICAP_YNATIVERESOLUTION 0x1117
1548#define ICAP_XRESOLUTION 0x1118
1549#define ICAP_YRESOLUTION 0x1119
1550#define ICAP_MAXFRAMES 0x111a
1551#define ICAP_TILES 0x111b
1552#define ICAP_BITORDER 0x111c
1553#define ICAP_CCITTKFACTOR 0x111d
1554#define ICAP_LIGHTPATH 0x111e
1555#define ICAP_PIXELFLAVOR 0x111f
1556#define ICAP_PLANARCHUNKY 0x1120
1557#define ICAP_ROTATION 0x1121
1558#define ICAP_SUPPORTEDSIZES 0x1122
1559#define ICAP_THRESHOLD 0x1123
1560#define ICAP_XSCALING 0x1124
1561#define ICAP_YSCALING 0x1125
1562#define ICAP_BITORDERCODES 0x1126
1563#define ICAP_PIXELFLAVORCODES 0x1127
1564#define ICAP_JPEGPIXELTYPE 0x1128
1565#define ICAP_TIMEFILL 0x112a
1566#define ICAP_BITDEPTH 0x112b
1567#define ICAP_BITDEPTHREDUCTION 0x112c /* Added 1.5 */
1568#define ICAP_UNDEFINEDIMAGESIZE 0x112d /* Added 1.6 */
1569#define ICAP_IMAGEDATASET 0x112e /* Added 1.7 */
1570#define ICAP_EXTIMAGEINFO 0x112f /* Added 1.7 */
1571#define ICAP_MINIMUMHEIGHT 0x1130 /* Added 1.7 */
1572#define ICAP_MINIMUMWIDTH 0x1131 /* Added 1.7 */
1573#define ICAP_AUTODISCARDBLANKPAGES 0x1134 /* Added 1.8 */
1574#define ICAP_FLIPROTATION 0x1136 /* Added 1.8 */
1575#define ICAP_BARCODEDETECTIONENABLED 0x1137 /* Added 1.8 */
1576#define ICAP_SUPPORTEDBARCODETYPES 0x1138 /* Added 1.8 */
1577#define ICAP_BARCODEMAXSEARCHPRIORITIES 0x1139 /* Added 1.8 */
1578#define ICAP_BARCODESEARCHPRIORITIES 0x113a /* Added 1.8 */
1579#define ICAP_BARCODESEARCHMODE 0x113b /* Added 1.8 */
1580#define ICAP_BARCODEMAXRETRIES 0x113c /* Added 1.8 */
1581#define ICAP_BARCODETIMEOUT 0x113d /* Added 1.8 */
1582#define ICAP_ZOOMFACTOR 0x113e /* Added 1.8 */
1583#define ICAP_PATCHCODEDETECTIONENABLED 0x113f /* Added 1.8 */
1584#define ICAP_SUPPORTEDPATCHCODETYPES 0x1140 /* Added 1.8 */
1585#define ICAP_PATCHCODEMAXSEARCHPRIORITIES 0x1141 /* Added 1.8 */
1586#define ICAP_PATCHCODESEARCHPRIORITIES 0x1142 /* Added 1.8 */
1587#define ICAP_PATCHCODESEARCHMODE 0x1143 /* Added 1.8 */
1588#define ICAP_PATCHCODEMAXRETRIES 0x1144 /* Added 1.8 */
1589#define ICAP_PATCHCODETIMEOUT 0x1145 /* Added 1.8 */
1590#define ICAP_FLASHUSED2 0x1146 /* Added 1.8 */
1591#define ICAP_IMAGEFILTER 0x1147 /* Added 1.8 */
1592#define ICAP_NOISEFILTER 0x1148 /* Added 1.8 */
1593#define ICAP_OVERSCAN 0x1149 /* Added 1.8 */
1594#define ICAP_AUTOMATICBORDERDETECTION 0x1150 /* Added 1.8 */
1595#define ICAP_AUTOMATICDESKEW 0x1151 /* Added 1.8 */
1596#define ICAP_AUTOMATICROTATE 0x1152 /* Added 1.8 */
1597
1598/* image data sources MAY support these audio caps */
1599#define ACAP_AUDIOFILEFORMAT 0x1201 /* Added 1.8 */
1600#define ACAP_XFERMECH 0x1202 /* Added 1.8 */
1601
1602/* ----------------------------------------------------------------------- *\
1603
1604 Version 1.7: Following is Extended Image Info Attributes.
1605 July 1997
1606 KHL
1607
1608\* ----------------------------------------------------------------------- */
1609
1610#define TWEI_BARCODEX 0x1200
1611#define TWEI_BARCODEY 0x1201
1612#define TWEI_BARCODETEXT 0x1202
1613#define TWEI_BARCODETYPE 0x1203
1614#define TWEI_DESHADETOP 0x1204
1615#define TWEI_DESHADELEFT 0x1205
1616#define TWEI_DESHADEHEIGHT 0x1206
1617#define TWEI_DESHADEWIDTH 0x1207
1618#define TWEI_DESHADESIZE 0x1208
1619#define TWEI_SPECKLESREMOVED 0x1209
1620#define TWEI_HORZLINEXCOORD 0x120A
1621#define TWEI_HORZLINEYCOORD 0x120B
1622#define TWEI_HORZLINELENGTH 0x120C
1623#define TWEI_HORZLINETHICKNESS 0x120D
1624#define TWEI_VERTLINEXCOORD 0x120E
1625#define TWEI_VERTLINEYCOORD 0x120F
1626#define TWEI_VERTLINELENGTH 0x1210
1627#define TWEI_VERTLINETHICKNESS 0x1211
1628#define TWEI_PATCHCODE 0x1212
1629#define TWEI_ENDORSEDTEXT 0x1213
1630#define TWEI_FORMCONFIDENCE 0x1214
1631#define TWEI_FORMTEMPLATEMATCH 0x1215
1632#define TWEI_FORMTEMPLATEPAGEMATCH 0x1216
1633#define TWEI_FORMHORZDOCOFFSET 0x1217
1634#define TWEI_FORMVERTDOCOFFSET 0x1218
1635#define TWEI_BARCODECOUNT 0x1219
1636#define TWEI_BARCODECONFIDENCE 0x121A
1637#define TWEI_BARCODEROTATION 0x121B
1638#define TWEI_BARCODETEXTLENGTH 0x121C
1639#define TWEI_DESHADECOUNT 0x121D
1640#define TWEI_DESHADEBLACKCOUNTOLD 0x121E
1641#define TWEI_DESHADEBLACKCOUNTNEW 0x121F
1642#define TWEI_DESHADEBLACKRLMIN 0x1220
1643#define TWEI_DESHADEBLACKRLMAX 0x1221
1644#define TWEI_DESHADEWHITECOUNTOLD 0x1222
1645#define TWEI_DESHADEWHITECOUNTNEW 0x1223
1646#define TWEI_DESHADEWHITERLMIN 0x1224
1647#define TWEI_DESHADEWHITERLAVE 0x1225
1648#define TWEI_DESHADEWHITERLMAX 0x1226
1649#define TWEI_BLACKSPECKLESREMOVED 0x1227
1650#define TWEI_WHITESPECKLESREMOVED 0x1228
1651#define TWEI_HORZLINECOUNT 0x1229
1652#define TWEI_VERTLINECOUNT 0x122A
1653#define TWEI_DESKEWSTATUS 0x122B
1654#define TWEI_SKEWORIGINALANGLE 0x122C
1655#define TWEI_SKEWFINALANGLE 0x122D
1656#define TWEI_SKEWCONFIDENCE 0x122E
1657#define TWEI_SKEWWINDOWX1 0x122F
1658#define TWEI_SKEWWINDOWY1 0x1230
1659#define TWEI_SKEWWINDOWX2 0x1231
1660#define TWEI_SKEWWINDOWY2 0x1232
1661#define TWEI_SKEWWINDOWX3 0x1233
1662#define TWEI_SKEWWINDOWY3 0x1234
1663#define TWEI_SKEWWINDOWX4 0x1235
1664#define TWEI_SKEWWINDOWY4 0x1236
1665
1666#define TWEJ_NONE 0x0000
1667#define TWEJ_MIDSEPARATOR 0x0001
1668#define TWEJ_PATCH1 0x0002
1669#define TWEJ_PATCH2 0x0003
1670#define TWEJ_PATCH3 0x0004
1671#define TWEJ_PATCH4 0x0005
1672#define TWEJ_PATCH6 0x0006
1673#define TWEJ_PATCHT 0x0007
1674
1675/***************************************************************************
1676 * Return Codes and Condition Codes section *
1677 ***************************************************************************/
1678
1679/* Return Codes: DSM_Entry and DS_Entry may return any one of these values. */
1680#define TWRC_CUSTOMBASE 0x8000
1681
1682#define TWRC_SUCCESS 0
1683#define TWRC_FAILURE 1 /* Application may get TW_STATUS for info on failure */
1684#define TWRC_CHECKSTATUS 2 /* "tried hard"; get status */
1685#define TWRC_CANCEL 3
1686#define TWRC_DSEVENT 4
1687#define TWRC_NOTDSEVENT 5
1688#define TWRC_XFERDONE 6
1689#define TWRC_ENDOFLIST 7 /* After MSG_GETNEXT if nothing left */
1690#define TWRC_INFONOTSUPPORTED 8
1691#define TWRC_DATANOTAVAILABLE 9
1692
1693/* Condition Codes: Application gets these by doing DG_CONTROL DAT_STATUS MSG_GET. */
1694#define TWCC_CUSTOMBASE 0x8000
1695
1696#define TWCC_SUCCESS 0 /* It worked! */
1697#define TWCC_BUMMER 1 /* Failure due to unknown causes */
1698#define TWCC_LOWMEMORY 2 /* Not enough memory to perform operation */
1699#define TWCC_NODS 3 /* No Data Source */
1700#define TWCC_MAXCONNECTIONS 4 /* DS is connected to max possible applications */
1701#define TWCC_OPERATIONERROR 5 /* DS or DSM reported error, application shouldn't */
1702#define TWCC_BADCAP 6 /* Unknown capability */
1703#define TWCC_BADPROTOCOL 9 /* Unrecognized MSG DG DAT combination */
1704#define TWCC_BADVALUE 10 /* Data parameter out of range */
1705#define TWCC_SEQERROR 11 /* DG DAT MSG out of expected sequence */
1706#define TWCC_BADDEST 12 /* Unknown destination Application/Source in DSM_Entry */
1707#define TWCC_CAPUNSUPPORTED 13 /* Capability not supported by source */
1708#define TWCC_CAPBADOPERATION 14 /* Operation not supported by capability */
1709#define TWCC_CAPSEQERROR 15 /* Capability has dependancy on other capability */
1710/* Added 1.8 */
1711#define TWCC_DENIED 16 /* File System operation is denied (file is protected) */
1712#define TWCC_FILEEXISTS 17 /* Operation failed because file already exists. */
1713#define TWCC_FILENOTFOUND 18 /* File not found */
1714#define TWCC_NOTEMPTY 19 /* Operation failed because directory is not empty */
1715#define TWCC_PAPERJAM 20 /* The feeder is jammed */
1716#define TWCC_PAPERDOUBLEFEED 21 /* The feeder detected multiple pages */
1717#define TWCC_FILEWRITEERROR 22 /* Error writing the file (meant for things like disk full conditions) */
1718#define TWCC_CHECKDEVICEONLINE 23 /* The device went offline prior to or during this operation */
1719
1720
1721/* bit patterns: for query the operation that are supported by the data source on a capability */
1722/* Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT */
1723/* Added 1.6 */
1724#define TWQC_GET 0x0001
1725#define TWQC_SET 0x0002
1726#define TWQC_GETDEFAULT 0x0004
1727#define TWQC_GETCURRENT 0x0008
1728#define TWQC_RESET 0x0010
1729
1730
1731/****************************************************************************
1732 * Entry Points *
1733 ****************************************************************************/
1734
1735/**********************************************************************
1736 * Function: DSM_Entry, the only entry point into the Data Source Manager.
1737 *
1738 * Parameters:
1739 * pOrigin Identifies the source module of the message. This could
1740 * identify an Application, a Source, or the Source Manager.
1741 *
1742 * pDest Identifies the destination module for the message.
1743 * This could identify an application or a data source.
1744 * If this is NULL, the message goes to the Source Manager.
1745 *
1746 * DG The Data Group.
1747 * Example: DG_IMAGE.
1748 *
1749 * DAT The Data Attribute Type.
1750 * Example: DAT_IMAGEMEMXFER.
1751 *
1752 * MSG The message. Messages are interpreted by the destination module
1753 * with respect to the Data Group and the Data Attribute Type.
1754 * Example: MSG_GET.
1755 *
1756 * pData A pointer to the data structure or variable identified
1757 * by the Data Attribute Type.
1758 * Example: (TW_MEMREF)&ImageMemXfer
1759 * where ImageMemXfer is a TW_IMAGEMEMXFER structure.
1760 *
1761 * Returns:
1762 * ReturnCode
1763 * Example: TWRC_SUCCESS.
1764 *
1765 ********************************************************************/
1766
1767/* Don't mangle the name "DSM_Entry" if we're compiling in C++! */
1768#ifdef __cplusplus
1769extern "C" {
1770#endif /* __cplusplus */
1771
1772#ifdef _MSWIN_
1773TW_UINT16 FAR PASCAL DSM_Entry( pTW_IDENTITY pOrigin,
1774 pTW_IDENTITY pDest,
1775 TW_UINT32 DG,
1776 TW_UINT16 DAT,
1777 TW_UINT16 MSG,
1778 TW_MEMREF pData);
1779
1780typedef TW_UINT16 (FAR PASCAL *DSMENTRYPROC)(pTW_IDENTITY, pTW_IDENTITY,
1781 TW_UINT32, TW_UINT16,
1782 TW_UINT16, TW_MEMREF);
1783#else /* _MSWIN_ */
1784
1785FAR PASCAL TW_UINT16 DSM_Entry( pTW_IDENTITY pOrigin,
1786 pTW_IDENTITY pDest,
1787 TW_UINT32 DG,
1788 TW_UINT16 DAT,
1789 TW_UINT16 MSG,
1790 TW_MEMREF pData);
1791
1792typedef TW_UINT16 (*DSMENTRYPROC)(pTW_IDENTITY, pTW_IDENTITY,
1793 TW_UINT32, TW_UINT16,
1794 TW_UINT16, TW_MEMREF);
1795#endif /* _MSWIN_ */
1796
1797#ifdef __cplusplus
1798}
1799#endif /* cplusplus */
1800
1801
1802/**********************************************************************
1803 * Function: DS_Entry, the entry point provided by a Data Source.
1804 *
1805 * Parameters:
1806 * pOrigin Identifies the source module of the message. This could
1807 * identify an application or the Data Source Manager.
1808 *
1809 * DG The Data Group.
1810 * Example: DG_IMAGE.
1811 *
1812 * DAT The Data Attribute Type.
1813 * Example: DAT_IMAGEMEMXFER.
1814 *
1815 * MSG The message. Messages are interpreted by the data source
1816 * with respect to the Data Group and the Data Attribute Type.
1817 * Example: MSG_GET.
1818 *
1819 * pData A pointer to the data structure or variable identified
1820 * by the Data Attribute Type.
1821 * Example: (TW_MEMREF)&ImageMemXfer
1822 * where ImageMemXfer is a TW_IMAGEMEMXFER structure.
1823 *
1824 * Returns:
1825 * ReturnCode
1826 * Example: TWRC_SUCCESS.
1827 *
1828 * Note:
1829 * The DSPROC type is only used by an application when it calls
1830 * a Data Source directly, bypassing the Data Source Manager.
1831 *
1832 ********************************************************************/
1833/* Don't mangle the name "DS_Entry" if we're compiling in C++! */
1834#ifdef __cplusplus
1835extern "C" {
1836#endif /* __cplusplus */
1837
1838#ifdef _MSWIN_
1839 #ifdef _WIN32
1840 __declspec(dllexport) TW_UINT16 FAR PASCAL DS_Entry (pTW_IDENTITY pOrigin,
1841 TW_UINT32 DG,
1842 TW_UINT16 DAT,
1843 TW_UINT16 MSG,
1844 TW_MEMREF pData);
1845 #else /* _WIN32 */
1846 TW_UINT16 FAR PASCAL DS_Entry (pTW_IDENTITY pOrigin,
1847 TW_UINT32 DG,
1848 TW_UINT16 DAT,
1849 TW_UINT16 MSG,
1850 TW_MEMREF pData);
1851 #endif /* _WIN32 */
1852
1853 typedef TW_UINT16 (FAR PASCAL *DSENTRYPROC) (pTW_IDENTITY pOrigin,
1854 TW_UINT32 DG,
1855 TW_UINT16 DAT,
1856 TW_UINT16 MSG,
1857 TW_MEMREF pData);
1858#else /* _MSWIN_ */
1859FAR PASCAL TW_UINT16 DS_Entry( pTW_IDENTITY pOrigin,
1860 TW_UINT32 DG,
1861 TW_UINT16 DAT,
1862 TW_UINT16 MSG,
1863 TW_MEMREF pData);
1864
1865typedef TW_UINT16 (*DSENTRYPROC)(pTW_IDENTITY,
1866 TW_UINT32, TW_UINT16,
1867 TW_UINT16, TW_MEMREF);
1868#endif /* _MSWIN_ */
1869
1870#ifdef __cplusplus
1871}
1872#endif /* cplusplus */
1873
1874/* SDH - 02/08/95 - TWUNK */
1875/* Force 32-bit twain to use same packing of twain structures as existing */
1876/* 16-bit twain. This allows 16/32-bit thunking. */
1877#ifdef WIN32
1878 #ifdef __BORLANDC__ //(Mentor June 13, 1996) if we're using a Borland compiler
1879 #pragma option -a. //(Mentor October 30, 1996) switch back to original alignment
1880 #else //(Mentor June 13, 1996) if NOT using a Borland compiler
1881// #pragma pack (pop, before_twain)
1882 #pragma pack ()
1883 #endif //(Mentor June 13, 1996)
1884#else /* WIN32 */
1885#endif /* WIN32 */
1886
1887#endif /* TWAIN */
Note: See TracBrowser for help on using the repository browser.