;" & _**************************************************************************** ;" & _* Structure Definitions * ;" & _**************************************************************************** ;" & _* Container for array of values;" & _*/ Global $tagTW_ARRAY = _ "word ItemType;" & _ "uint NumItems;" & _ "byte ItemList[1];" ;" & _* Used by application to get/set capability from/in a data source.;" & _*/ Global $tagTW_CAPABILITY = _ "word Cap;" & _ "word ConType;" & _ "handle hContainer;" ;" & _* Stores a group of individual values describing a capability.;" & _*/ Global $tagTW_ENUMERATION = _ "word ItemType;" & _ "uint NumItems;" & _ "uint CurrentIndex;" & _ "uint DefaultIndex;" & _ "byte ItemList[1];" ;" & _* This structure is used to pass specific information between the data source and the application.;" & _*/ Global $tagTW_INFO = _ "word InfoID;" & _ "word ItemType;" & _ "word NumItems;" & _ "word ReturnCode;" & _ "word CondCode;" & _ "uint_ptr Item;" ;" & _* Provides information about the currently selected device;" & _*/ Global $tagTW_FILESYSTEM = _ "char InputName[256];" & _ "char OutputName[256];" & _ "ptr Context;" & _ "int Recursive;" & _ "boolean Subdirectories;" & _ "int FileType;" & _ "uint FileSystemType;" & _ "uint Size;" & _ "char CreateTimeDate[34];" & _ "char ModifiedTimeDate[34];" & _ "uint FreeSpace;" & _ "int NewImageSize;" & _ "uint NumberOfFiles;" & _ "uint NumberOfSnippets;" & _ "uint DeviceGroupMask;" & _ "byte Reserved[508];" ;" & _* A general way to describe the version of software that is running.;" & _*/ Global $tagTW_VERSION = _ "word MajorNum;" & _ "word MinorNum;" & _ "word Language;" & _ "word Country;" & _ "char Info[34];" ;" & _* Provides identification information about a TWAIN entity.*/ Global $tagTW_IDENTITY = _ "uint Id;" & _ $tagTW_VERSION & _ ;"ptr Version;" & _ ;must verify since it is as a $tagTW_VERSION structure "word ProtocolMajor;" & _ "word ProtocolMinor;" & _ "word SupportedGroups;" & _ "word Reserved;" & _ "char Manufacturer[34];" & _ "char ProductFamily[34];" & _ "char ProductName[34];" ;" & _* Describes the "real" image data, that is, the complete image being transferred between the Source and application.;" & _*/ ;double EZTAPI TWAIN_Fix32ToFloat(long nfix) ;{ ; "long fix32 fix; ; TW_INT32 val; ; *(long*)&fix = nfix; ; val = ((TW_INT32)fix.Whole << 16) | ((TW_UINT32)fix.Frac & 0xffff); ; return val / 65536.0; ;} // TWAIN_Fix32ToFloat Global $tagTW_IMAGEINFO = _ "long fix32XResolution;" & _ ;"long fix32 XResolution;" & _ used long but must be converted to get value "long fix32YResolution;" & _ "word fYResolution;" & _ "int ImageWidth;" & _ "int ImageLength;" & _ "short SamplesPerPixel;" & _ "short BitsPerSample;" & _ "short BitsPerPixel;" & _ "boolean Planar;" & _ "short PixelType;" & _ "word Compression;" ;" & _* Fixed point structure type.;" & _*/ Global $tagTW_FIX32 = _ "short Whole;" & _ ; short is 16 bits and word is 16bits could use long "word Frac;" ;" & _* Defines a frame rectangle in ICAP_UNITS coordinates.;" & _*/ Global $tagTW_FRAME = _ "long fix32Left;" & _ "long fix32Top;" & _ "long fix32Right;" & _ "long fix32Bottom;" ;" & _* Describes the "real" image data, that is, the complete image being transferred between the Source and application.;" & _*/ Global $tagTW_IMAGEINFO = _ "long fix32XResolution;" & _ "long fix32YResolution;" & _ "int ImageWidth;" & _ "int ImageLength;" & _ "short SamplesPerPixel;" & _ "short BitsPerSample[8];" & _ "short BitsPerPixel;" & _ "boolean Planar;" & _ "short PixelType;" & _ "word Compression;" ;" & _* Describes the form of the acquired data being passed from the Source to the application.*/ Global $tagTW_IMAGEMEMXFER = _ "word Compression;" & _ "uint BytesPerRow;" & _ "uint Columns;" & _ "uint Rows;" & _ "uint XOffset;" & _ "uint YOffset;" & _ "uint BytesWritten;" & _ "uint Flags;" & _ "uint Length;" & _ "ptr TheMem;" ;" & _* Stores a single value (item) which describes a capability.;" & _*/ Global $tagTW_ONEVALUE = _ "word ItemType;" & _ "uint Item;" ;" & _* This structure is used to handle the user interface coordination between an application and a Source.;" & _*/ Global $tagTW_USERINTERFACE = _ "boolean ShowUI;" & _ "boolean ModalUI;" & _ "handle hParent;" Global $tagTW_STATUS = _ "word ConditionCode;" & _ "word Data;" & _ "word Reserved;" #comments-Start ;" & _* Describes the information necessary to transfer a JPEG-compressed image.;" & _*/ Global $tagTW_JPEGCOMPRESSION = _ "word ColorSpace;" & _ "uint SubSampling;" & _ "word NumComponents;" & _ "word RestartFrequency;" & _ "word QuantMap[4];" & _ TW_MEMORY QuantTable[4];" & _ "word HuffmanMap[4];" & _ TW_MEMORY HuffmanDC[2];" & _ TW_MEMORY HuffmanAC[2];" ;" & _* Defines the parameters used for channel-specific transformation.;" & _*/ Global $tag = _ "long fix32 StartIn;" & _ "long fix32 BreakIn;" & _ "long fix32 EndIn;" & _ "long fix32 StartOut;" & _ "long fix32 BreakOut;" & _ "long fix32 EndOut;" & _ "long fix32 Gamma;" & _ "long fix32 SampleCount;" & _ } TW_DECODEFUNCTION, FAR;" & _* pTW_DECODEFUNCTION;" & _ ;" & _* Stores a Fixed point number in two parts, a whole and a fractional part.;" & _*/ Global $tag = _ TW_DECODEFUNCTION Decode[3];" & _ "long fix32 Mix[3][3];" & _ } TW_TRANSFORMSTAGE, FAR;" & _* pTW_TRANSFORMSTAGE;" & _ ;" & _* Information about audio data;" & _*/ Global $tag = _ TW_STR255 Name;" & _ "uint Reserved;" & _ } TW_AUDIOINFO, FAR;" & _* pTW_AUDIOINFO;" & _ ;" & _* Used to register callbacks.;" & _*/ Global $tag = _ TW_MEMREF CallBackProc;" & _ #if defined(__APPLE__) ;" & _* cf: Mac version of TWAIN.h;" & _*/ TW_MEMREF RefCon;" & _ #else "uint RefCon;" & _ #endif "short Message;" & _ } TW_CALLBACK, FAR;" & _* pTW_CALLBACK;" & _ ;" & _* Used to register callbacks.;" & _*/ Global $tag = _ TW_MEMREF CallBackProc;" & _ "uint_ptr RefCon;" & _ "short Message;" & _ } TW_CALLBACK2, FAR;" & _* pTW_CALLBACK2;" & _ ;" & _* Defines a CIE XYZ space tri-stimulus value.;" & _*/ Global $tag = _ "long fix32 X;" & _ "long fix32 Y;" & _ "long fix32 Z;" & _ } TW_CIEPOINT, FAR;" & _* pTW_CIEPOINT;" & _ ;" & _* Defines the mapping from an RGB color space device into CIE 1931 (XYZ) color space.;" & _*/ Global $tag = _ "word ColorSpace;" & _ "short LowEndian;" & _ "short DeviceDependent;" & _ "int VersionNumber;" & _ TW_TRANSFORMSTAGE StageABC;" & _ TW_TRANSFORMSTAGE StageLMN;" & _ TW_CIEPOINT WhitePoint;" & _ TW_CIEPOINT BlackPoint;" & _ TW_CIEPOINT WhitePaper;" & _ TW_CIEPOINT BlackInk;" & _ "long fix32 Samples[1];" & _ } TW_CIECOLOR, FAR;" & _* pTW_CIECOLOR;" & _ ;" & _* Allows for a data source and application to pass custom data to each other.;" & _*/ Global $tag = _ "uint InfoLength;" & _ "handle hData;" & _ }TW_CUSTOMDSDATA, FAR;" & _*pTW_CUSTOMDSDATA;" & _ ;" & _* Provides information about the Event that was raised by the Source;" & _*/ Global $tag = _ "uint Event;" & _ TW_STR255 DeviceName;" & _ "uint BatteryMinutes;" & _ "short BatteryPercentage;" & _ "int PowerSupply;" & _ "long fix32 XResolution;" & _ "long fix32 YResolution;" & _ "uint FlashUsed2;" & _ "uint AutomaticCapture;" & _ "uint TimeBeforeFirstCapture;" & _ "uint TimeBetweenCaptures;" & _ } TW_DEVICEEVENT, FAR;" & _* pTW_DEVICEEVENT;" & _ ;" & _* This structure holds the tri-stimulus color palette information for TW_PALETTE8 structures.*/ Global $tag = _ "byte Index;" & _ "byte Channel1;" & _ "byte Channel2;" & _ "byte Channel3;" & _ } TW_ELEMENT8, FAR;" & _* pTW_ELEMENT8;" & _ ;" & _* Used to pass application events/messages from the application to the Source.;" & _*/ Global $tag = _ TW_MEMREF pEvent;" & _ "word TWMessage;" & _ } TW_EVENT, FAR;" & _* pTW_EVENT;" & _ Global $tag = _ "uint NumInfos;" & _ TW_INFO Info[1];" & _ }TW_EXTIMAGEINFO, FAR* pTW_EXTIMAGEINFO;" & _ ;" & _* This structure is used by the application to specify a set of mapping values to be applied to grayscale data.;" & _*/ Global $tag = _ TW_ELEMENT8 Response[1];" & _ } TW_GRAYRESPONSE, FAR;" & _* pTW_GRAYRESPONSE;" & _ ;" & _* Involves information about the original size of the acquired image.;" & _*/ Global $tag = _ TW_FRAME Frame;" & _ "uint DocumentNumber;" & _ "uint PageNumber;" & _ "uint FrameNumber;" & _ } TW_IMAGELAYOUT, FAR;" & _* pTW_IMAGELAYOUT;" & _ ;" & _* Provides information for managing memory buffers.;" & _*/ Global $tag = _ "uint Flags;" & _ "uint Length;" & _ TW_MEMREF TheMem;" & _ } TW_MEMORY, FAR;" & _* pTW_MEMORY;" & _ ;" & _* Describes the information necessary to transfer a JPEG-compressed image.;" & _*/ Global $tag = _ "word ColorSpace;" & _ "uint SubSampling;" & _ "word NumComponents;" & _ "word RestartFrequency;" & _ "word QuantMap[4];" & _ TW_MEMORY QuantTable[4];" & _ "word HuffmanMap[4];" & _ TW_MEMORY HuffmanDC[2];" & _ TW_MEMORY HuffmanAC[2];" & _ } TW_JPEGCOMPRESSION, FAR;" & _* pTW_JPEGCOMPRESSION;" & _ ;" & _* Collects scanning metrics after returning to state 4;" & _*/ Global $tag = _ "uint SizeOf;" & _ "uint ImageCount;" & _ "uint SheetCount;" & _ } TW_METRICS, FAR;" & _* pTW_METRICS;" & _ ;" & _* This structure holds the color palette information.;" & _*/ Global $tag = _ "word NumColors;" & _ "word PaletteType;" & _ TW_ELEMENT8 Colors[256];" & _ } TW_PALETTE8, FAR;" & _* pTW_PALETTE8;" & _ ;" & _* Used to bypass the TWAIN protocol when communicating with a device;" & _*/ Global $tag = _ TW_MEMREF pCommand;" & _ "uint CommandBytes;" & _ "int Direction;" & _ TW_MEMREF pData;" & _ "uint DataBytes;" & _ "uint DataBytesXfered;" & _ } TW_PASSTHRU, FAR;" & _* pTW_PASSTHRU;" & _ ;" & _* This structure tells the application how many more complete transfers the Source currently has available.;" & _*/ Global $tag = _ "word Count;" & _ union = _ "uint EOJ;" & _ "uint Reserved;" & _ #if defined(__APPLE__) ;" & _* cf: Mac version of TWAIN.h;" & _*/ union = _ "uint EOJ;" & _ "uint Reserved;" & _ } TW_JOBCONTROL;" & _ #endif };" & _ } TW_PENDINGXFERS, FAR;" & _*pTW_PENDINGXFERS;" & _ ;" & _* Stores a range of individual values describing a capability.;" & _*/ Global $tag = _ "word ItemType;" & _ "uint MinValue;" & _ "uint MaxValue;" & _ "uint StepSize;" & _ "uint DefaultValue;" & _ "uint CurrentValue;" & _ } TW_RANGE, FAR;" & _* pTW_RANGE;" & _ ;" & _* This structure is used by the application to specify a set of mapping values to be applied to RGB color data.;" & _*/ Global $tag = _ TW_ELEMENT8 Response[1];" & _ } TW_RGBRESPONSE, FAR;" & _* pTW_RGBRESPONSE;" & _ ;" & _* Describes the file format and file specification information for a transfer through a disk file.;" & _*/ Global $tag = _ TW_STR255 FileName;" & _ "word Format;" & _ "short VRefNum;" & _ } TW_SETUPFILEXFER, FAR;" & _* pTW_SETUPFILEXFER;" & _ ;" & _* Provides the application information about the Source's requirements and preferences regarding allocation of transfer buffer(s).;" & _*/ Global $tag = _ "uint MinBufSize;" & _ "uint MaxBufSize;" & _ "uint Preferred;" & _ } TW_SETUPMEMXFER, FAR;" & _* pTW_SETUPMEMXFER;" & _ ;" & _* Describes the status of a source.;" & _*/ Global $tag = _ "word ConditionCode;" & _ union = _ "word Data;" & _ "word Reserved;" & _ };" & _ } TW_STATUS, FAR;" & _* pTW_STATUS;" & _ ;" & _* Translates the contents of Status into a localized UTF8string.;" & _*/ Global $tag = _ TW_STATUS Status;" & _ "uint Size;" & _ "handle UTF8string;" & _ } TW_STATUSUTF8, FAR;" & _* pTW_STATUSUTF8;" & _ Global $tag = _ "uint SizeOf;" & _ "word CommunicationManager;" & _ "handle Send;" & _ "uint SendSize;" & _ "handle Receive;" & _ "uint ReceiveSize;" & _ } TW_TWAINDIRECT, FAR;" & _* pTW_TWAINDIRECT;" & _ ;" & _* This structure is used to handle the user interface coordination between an application and a Source.;" & _*/ Global $tag = _ "boolean ShowUI;" & _ "boolean ModalUI;" & _ "handle hParent;" & _ } TW_USERINTERFACE, FAR;" & _* pTW_USERINTERFACE;" & _ ;" & _* DAT_SETUPFILEXFER2. Sets up DS to application data transfer via a file. Added 1.9;" & _*/ Global $tag = _ TW_MEMREF FileName;" & _ "word FileNameType;" & _ "word Format;" & _ "short VRefNum;" & _ "uint parID;" & _ } TW_SETUPFILEXFER2, FAR;" & _* pTW_SETUPFILEXFER2;" & _ ;" & _* DAT_TWUNKIDENTITY. Provides DS identity and 'other' information necessary;" & _*/ ;" & _* across thunk link.;" & _*/ Global $tag = _ TW_IDENTITY identity;" & _ TW_STR255 dsPath;" & _ } TW_TWUNKIDENTITY, FAR;" & _* pTW_TWUNKIDENTITY;" & _ ;" & _* Provides DS_Entry parameters over thunk link.;" & _*/ Global $tag = _ "byte destFlag;" & _ TW_IDENTITY dest;" & _ "int dataGroup;" & _ "short dataArgType;" & _ "short message;" & _ "int pDataSize;" & _ // TW_MEMREF pData;" & _ } TW_TWUNKDSENTRYPARAMS, FAR;" & _* pTW_TWUNKDSENTRYPARAMS;" & _ ;" & _* Provides DS_Entry results over thunk link.;" & _*/ Global $tag = _ "word returnCode;" & _ "word conditionCode;" & _ "int pDataSize;" & _ // TW_MEMREF pData;" & _ } TW_TWUNKDSENTRYRETURN, FAR;" & _* pTW_TWUNKDSENTRYRETURN;" & _ Global $tag = _ "word Cap;" & _ "word Properties;" & _ } TW_CAPEXT, FAR;" & _* pTW_CAPEXT;" & _ ;" & _* DAT_SETUPAUDIOFILEXFER, information required to setup an audio file transfer;" & _*/ Global $tag = _ TW_STR255 FileName;" & _ ;" & _* full path target file;" & _*/ "word Format;" & _ * one of TWAF_xxxx;" & _*/ "short VRefNum;" & _ } TW_SETUPAUDIOFILEXFER, FAR;" & _* pTW_SETUPAUDIOFILEXFER;" & _ ;" & _* DAT_ENTRYPOINT. returns essential entry points.;" & _*/ Global $tag = _ "uint Size;" & _ DSMENTRYPROC DSM_Entry;" & _ DSM_MEMALLOCATE DSM_MemAllocate;" & _ DSM_MEMFREE DSM_MemFree;" & _ DSM_MEMLOCK DSM_MemLock;" & _ DSM_MEMUNLOCK DSM_MemUnlock;" & _ } TW_ENTRYPOINT, FAR;" & _* pTW_ENTRYPOINT;" & _ ;" & _* DAT_FILTER*/ Global $tag = _ "uint Size;" & _ "uint HueStart;" & _ "uint HueEnd;" & _ "uint SaturationStart;" & _ "uint SaturationEnd;" & _ "uint ValueStart;" & _ "uint ValueEnd;" & _ "uint Replacement;" & _ } TW_FILTER_DESCRIPTOR,;" & _*pTW_FILTER_DESCRIPTOR;" & _ ;" & _* DAT_FILTER;" & _*/ Global $tag = _ "uint Size;" & _ "uint DescriptorCount;" & _ "uint MaxDescriptorCount;" & _ "uint Condition;" & _ "handle hDescriptors;" & _ } TW_FILTER,;" & _*pTW_FILTER;" & _ #comments-End