Your warranties manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2239 lines
78 KiB

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