mirror of
https://github.com/soukoku/ntwain.git
synced 2025-12-29 02:05:04 +08:00
Updated struct mapping for TWAIN 2.3
This commit is contained in:
@@ -1,26 +1,39 @@
|
|||||||
// This file contains all the structs defined in the twain.h file.
|
// This file contains all the structs defined in the twain.h file.
|
||||||
|
|
||||||
// The TWAIN numeric types are mapped with "using"
|
|
||||||
// to aid in mapping against the twin.h file (copy/paste!).
|
|
||||||
// It also makes it easy to change all the types that
|
|
||||||
// uses it if I made a mistake in the mapped value type.
|
|
||||||
// Consumers will not see those names.
|
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
using TW_BOOL = System.UInt16;
|
|
||||||
// use HandleRef instead?
|
|
||||||
using TW_HANDLE = System.IntPtr;
|
|
||||||
using TW_INT16 = System.Int16;
|
|
||||||
using TW_INT32 = System.Int32;
|
|
||||||
using TW_MEMREF = System.IntPtr;
|
|
||||||
using TW_UINT16 = System.UInt16;
|
|
||||||
using TW_UINT32 = System.UInt32;
|
|
||||||
using TW_UINT8 = System.Byte;
|
|
||||||
// iffy
|
|
||||||
using TW_UINTPTR = System.UIntPtr;
|
|
||||||
using NTwain.Values;
|
using NTwain.Values;
|
||||||
|
|
||||||
|
// The following TWAIN basic types are mapped with "using"
|
||||||
|
// to aid in mapping against the twain.h file using copy-paste.
|
||||||
|
// Consumers will not see those names.
|
||||||
|
|
||||||
|
#if WIN32
|
||||||
|
|
||||||
|
// use HandleRef instead?
|
||||||
|
using TW_HANDLE = System.IntPtr; // HANDLE
|
||||||
|
using TW_MEMREF = System.IntPtr; // LPVOID
|
||||||
|
// iffy
|
||||||
|
using TW_UINTPTR = System.UIntPtr; // UINT_PTR
|
||||||
|
|
||||||
|
using TW_INT8 = System.SByte; // char
|
||||||
|
using TW_INT16 = System.Int16; // short
|
||||||
|
using TW_INT32 = System.Int32; // long
|
||||||
|
|
||||||
|
using TW_UINT8 = System.Byte; // unsigned char
|
||||||
|
using TW_UINT16 = System.UInt16; // unsigned short
|
||||||
|
using TW_UINT32 = System.UInt32; // unsigned long
|
||||||
|
|
||||||
|
using TW_BOOL = System.UInt16; // unsigned short
|
||||||
|
|
||||||
|
#elif GNUC
|
||||||
|
|
||||||
|
#elif APPLE
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// This mono doc is awesome. An interop must-read
|
// This mono doc is awesome. An interop must-read
|
||||||
// http://www.mono-project.com/Interop_with_Native_Libraries
|
// http://www.mono-project.com/Interop_with_Native_Libraries
|
||||||
|
|
||||||
@@ -37,20 +50,14 @@ using NTwain.Values;
|
|||||||
namespace NTwain.Data
|
namespace NTwain.Data
|
||||||
{
|
{
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial struct TWFix32
|
partial struct TWFix32
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// The Whole part of the floating point number. This number is signed.
|
|
||||||
/// </summary>
|
|
||||||
TW_INT16 _whole;
|
TW_INT16 _whole;
|
||||||
/// <summary>
|
|
||||||
/// The Fractional part of the floating point number. This number is unsigned.
|
|
||||||
/// </summary>
|
|
||||||
TW_UINT16 _frac;
|
TW_UINT16 _frac;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial struct TWFrame
|
partial struct TWFrame
|
||||||
{
|
{
|
||||||
TWFix32 _left;
|
TWFix32 _left;
|
||||||
TWFix32 _top;
|
TWFix32 _top;
|
||||||
@@ -59,7 +66,7 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial struct TWDecodeFunction
|
partial struct TWDecodeFunction
|
||||||
{
|
{
|
||||||
TWFix32 _startIn;
|
TWFix32 _startIn;
|
||||||
TWFix32 _breakIn;
|
TWFix32 _breakIn;
|
||||||
@@ -72,17 +79,18 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial struct TWTransformStage
|
partial struct TWTransformStage
|
||||||
{
|
{
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||||
TWDecodeFunction[] _decode;
|
TWDecodeFunction[] _decode;
|
||||||
// TODO: research jagged aray mapping. maybe use ptr?
|
// TODO: research jagged aray mapping (3x3).
|
||||||
[MarshalAs(UnmanagedType.ByValArray)]
|
// maybe can only have 1-D
|
||||||
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
|
||||||
TWFix32[][] _mix;
|
TWFix32[][] _mix;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWArray
|
partial class TWArray
|
||||||
{
|
{
|
||||||
TW_UINT16 _itemType;
|
TW_UINT16 _itemType;
|
||||||
TW_UINT32 _numItems;
|
TW_UINT32 _numItems;
|
||||||
@@ -91,15 +99,14 @@ namespace NTwain.Data
|
|||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2),
|
[StructLayout(LayoutKind.Sequential, Pack = 2),
|
||||||
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
||||||
public partial class TWAudioInfo
|
partial class TWAudioInfo
|
||||||
{
|
{
|
||||||
|
// TODO: this may be wrong
|
||||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String255)]
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String255)]
|
||||||
string _name;
|
string _name;
|
||||||
TW_UINT32 _reserved;
|
TW_UINT32 _reserved;
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate ReturnCode CallbackDelegate(TWIdentity origin, TWIdentity destination,
|
|
||||||
DataGroups dg, DataArgumentType dat, Message msg, TW_MEMREF data);
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
partial class TWCallback
|
partial class TWCallback
|
||||||
@@ -121,15 +128,15 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWCapability
|
partial class TWCapability
|
||||||
{
|
{
|
||||||
TW_UINT16 _cap;
|
TW_UINT16 _cap;
|
||||||
TW_UINT16 _conType;
|
TW_UINT16 _conType;
|
||||||
IntPtr _hContainer;
|
TW_HANDLE _hContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial struct TWCiePoint
|
partial struct TWCiePoint
|
||||||
{
|
{
|
||||||
TWFix32 _x;
|
TWFix32 _x;
|
||||||
TWFix32 _y;
|
TWFix32 _y;
|
||||||
@@ -137,7 +144,7 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWCieColor
|
partial class TWCieColor
|
||||||
{
|
{
|
||||||
TW_UINT16 _colorSpace;
|
TW_UINT16 _colorSpace;
|
||||||
TW_INT16 _lowEndian;
|
TW_INT16 _lowEndian;
|
||||||
@@ -148,12 +155,14 @@ namespace NTwain.Data
|
|||||||
TWCiePoint _whitePoint;
|
TWCiePoint _whitePoint;
|
||||||
TWCiePoint _blackPoint;
|
TWCiePoint _blackPoint;
|
||||||
TWCiePoint _whitePaper;
|
TWCiePoint _whitePaper;
|
||||||
TWCiePoint _whiteInk;
|
TWCiePoint _blackInk;
|
||||||
|
// TODO: may be totally wrong
|
||||||
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
|
||||||
TWFix32[] _samples;
|
TWFix32[] _samples;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWCustomDSData
|
partial class TWCustomDSData
|
||||||
{
|
{
|
||||||
TW_UINT32 _infoLength;
|
TW_UINT32 _infoLength;
|
||||||
TW_HANDLE _hData;
|
TW_HANDLE _hData;
|
||||||
@@ -161,9 +170,10 @@ namespace NTwain.Data
|
|||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2),
|
[StructLayout(LayoutKind.Sequential, Pack = 2),
|
||||||
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
||||||
public partial class TWDeviceEvent
|
partial class TWDeviceEvent
|
||||||
{
|
{
|
||||||
TW_UINT32 _event;
|
TW_UINT32 _event;
|
||||||
|
// TODO: may be wrong
|
||||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String255)]
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String255)]
|
||||||
string _deviceName;
|
string _deviceName;
|
||||||
TW_UINT32 _batteryMinutes;
|
TW_UINT32 _batteryMinutes;
|
||||||
@@ -178,29 +188,7 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
partial class TWEntryPoint
|
partial struct TWElement8
|
||||||
{
|
|
||||||
TW_UINT32 _size;
|
|
||||||
// this is not a delegate cuz it's not used by the app
|
|
||||||
IntPtr _dSM_Entry;
|
|
||||||
|
|
||||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
|
||||||
MemAllocateDelegate _dSM_MemAllocate;
|
|
||||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
|
||||||
MemFreeDelegate _dSM_MemFree;
|
|
||||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
|
||||||
MemLockDelegate _dSM_MemLock;
|
|
||||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
|
||||||
MemUnlockDelegate _dSM_MemUnlock;
|
|
||||||
|
|
||||||
public delegate IntPtr MemAllocateDelegate(uint size);
|
|
||||||
public delegate void MemFreeDelegate(IntPtr handle);
|
|
||||||
public delegate IntPtr MemLockDelegate(IntPtr handle);
|
|
||||||
public delegate void MemUnlockDelegate(IntPtr handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
|
||||||
public partial struct TWElement8
|
|
||||||
{
|
{
|
||||||
TW_UINT8 _index;
|
TW_UINT8 _index;
|
||||||
TW_UINT8 _channel1;
|
TW_UINT8 _channel1;
|
||||||
@@ -209,7 +197,7 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWEnumeration
|
partial class TWEnumeration
|
||||||
{
|
{
|
||||||
TW_UINT16 _itemType;
|
TW_UINT16 _itemType;
|
||||||
TW_UINT32 _numItems;
|
TW_UINT32 _numItems;
|
||||||
@@ -219,78 +207,104 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWEvent
|
partial class TWEvent
|
||||||
{
|
{
|
||||||
TW_MEMREF _pEvent;
|
TW_MEMREF _pEvent;
|
||||||
TW_UINT16 _tWMessage;
|
TW_UINT16 _tWMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Explicit, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial struct TWInfo
|
partial struct TWInfo
|
||||||
{
|
{
|
||||||
[FieldOffset(0)]
|
|
||||||
TW_UINT16 _infoID;
|
TW_UINT16 _infoID;
|
||||||
[FieldOffset(2)]
|
|
||||||
TW_UINT16 _itemType;
|
TW_UINT16 _itemType;
|
||||||
[FieldOffset(4)]
|
|
||||||
TW_UINT16 _numItems;
|
TW_UINT16 _numItems;
|
||||||
|
|
||||||
[FieldOffset(6)]
|
TW_UINT16 _returnCode;
|
||||||
TW_UINT16 _condCode;
|
|
||||||
[FieldOffset(6)]
|
|
||||||
TW_UINT16 _returnCode; /* TWAIN 2.1 and newer */
|
|
||||||
|
|
||||||
[FieldOffset(8)]
|
TW_UINTPTR _item;
|
||||||
TW_UINTPTR Item;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWExtImageInfo
|
partial class TWExtImageInfo
|
||||||
{
|
{
|
||||||
TW_UINT32 _numInfos;
|
TW_UINT32 _numInfos;
|
||||||
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 200)]
|
||||||
TWInfo[] _info;
|
TWInfo[] _info;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2),
|
[StructLayout(LayoutKind.Explicit, Pack = 2),
|
||||||
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
||||||
public partial class TWFileSystem
|
partial class TWFileSystem
|
||||||
{
|
{
|
||||||
/* DG_CONTROL / DAT_FILESYSTEM / MSG_xxxx fields */
|
// TODO: verify all field offset #s
|
||||||
|
|
||||||
|
[FieldOffset(0)]
|
||||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String255)]
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String255)]
|
||||||
string _inputName;
|
string _inputName;
|
||||||
|
|
||||||
|
[FieldOffset(TwainConst.String255)]
|
||||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String255)]
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String255)]
|
||||||
string _outputName;
|
string _outputName;
|
||||||
|
|
||||||
|
[FieldOffset(512)]
|
||||||
TW_MEMREF _context;
|
TW_MEMREF _context;
|
||||||
/* DG_CONTROL / DAT_FILESYSTEM / MSG_DELETE field */
|
|
||||||
//TODO: verify this field
|
//TODO: verify this field offset in 64bit
|
||||||
short _recursive; /* recursively delete all sub-directories */
|
[FieldOffset(520)]
|
||||||
/* DG_CONTROL / DAT_FILESYSTEM / MSG_GETInfo fields */
|
short _recursive;
|
||||||
TW_INT32 _fileType; /* One of the TWFY_xxxx values */
|
[FieldOffset(520)]
|
||||||
TW_UINT32 _size; /* Size of current FileType */
|
TW_BOOL _subdirectories;
|
||||||
|
|
||||||
|
[FieldOffset(524)]
|
||||||
|
TW_INT32 _fileType;
|
||||||
|
[FieldOffset(524)]
|
||||||
|
TW_UINT32 _fileSystemType;
|
||||||
|
|
||||||
|
[FieldOffset(528)]
|
||||||
|
TW_UINT32 _size;
|
||||||
|
|
||||||
|
[FieldOffset(532)]
|
||||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String32)]
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String32)]
|
||||||
string _createTimeDate;
|
string _createTimeDate;
|
||||||
|
|
||||||
|
[FieldOffset(566)]
|
||||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String32)]
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String32)]
|
||||||
string _modifiedTimeDate;
|
string _modifiedTimeDate;
|
||||||
|
|
||||||
|
[FieldOffset(600)]
|
||||||
TW_UINT32 _freeSpace;
|
TW_UINT32 _freeSpace;
|
||||||
|
|
||||||
|
[FieldOffset(604)]
|
||||||
TW_INT32 _newImageSize;
|
TW_INT32 _newImageSize;
|
||||||
|
|
||||||
|
[FieldOffset(608)]
|
||||||
TW_UINT32 _numberOfFiles;
|
TW_UINT32 _numberOfFiles;
|
||||||
|
|
||||||
|
[FieldOffset(612)]
|
||||||
TW_UINT32 _numberOfSnippets;
|
TW_UINT32 _numberOfSnippets;
|
||||||
|
|
||||||
|
[FieldOffset(616)]
|
||||||
TW_UINT32 _deviceGroupMask;
|
TW_UINT32 _deviceGroupMask;
|
||||||
|
|
||||||
//TODO: verify this field, check if can just not use it
|
//TODO: verify this field, check if can just not use it
|
||||||
//char _reserved[508]; /**/
|
//char _reserved[508]; /**/
|
||||||
|
[FieldOffset(620)]
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 508)]
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 508)]
|
||||||
byte[] _reserved;
|
TW_INT8[] _reserved;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWGrayResponse
|
partial class TWGrayResponse
|
||||||
{
|
{
|
||||||
|
// TODO: may be totally wrong
|
||||||
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
|
||||||
TWElement8[] _response;
|
TWElement8[] _response;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2),
|
[StructLayout(LayoutKind.Sequential, Pack = 2),
|
||||||
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
||||||
public partial struct TWVersion
|
partial struct TWVersion
|
||||||
{
|
{
|
||||||
TW_UINT16 _majorNum;
|
TW_UINT16 _majorNum;
|
||||||
TW_UINT16 _minorNum;
|
TW_UINT16 _minorNum;
|
||||||
@@ -302,7 +316,7 @@ namespace NTwain.Data
|
|||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2),
|
[StructLayout(LayoutKind.Sequential, Pack = 2),
|
||||||
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
||||||
public partial class TWIdentity
|
partial class TWIdentity
|
||||||
{
|
{
|
||||||
TW_UINT32 _id;
|
TW_UINT32 _id;
|
||||||
TWVersion _version;
|
TWVersion _version;
|
||||||
@@ -318,7 +332,7 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWImageInfo
|
partial class TWImageInfo
|
||||||
{
|
{
|
||||||
TWFix32 _xResolution;
|
TWFix32 _xResolution;
|
||||||
TWFix32 _yResolution;
|
TWFix32 _yResolution;
|
||||||
@@ -334,7 +348,7 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWImageLayout
|
partial class TWImageLayout
|
||||||
{
|
{
|
||||||
TWFrame _frame;
|
TWFrame _frame;
|
||||||
TW_UINT32 _documentNumber;
|
TW_UINT32 _documentNumber;
|
||||||
@@ -343,7 +357,7 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial struct TWMemory
|
partial struct TWMemory
|
||||||
{
|
{
|
||||||
// not a class due to embedded
|
// not a class due to embedded
|
||||||
|
|
||||||
@@ -353,7 +367,7 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWImageMemXfer
|
partial class TWImageMemXfer
|
||||||
{
|
{
|
||||||
TW_UINT16 _compression;
|
TW_UINT16 _compression;
|
||||||
TW_UINT32 _bytesPerRow;
|
TW_UINT32 _bytesPerRow;
|
||||||
@@ -366,33 +380,38 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWJpegCompression
|
partial class TWJpegCompression
|
||||||
{
|
{
|
||||||
TW_UINT16 _colorSpace;
|
TW_UINT16 _colorSpace;
|
||||||
TW_UINT32 _subSampling;
|
TW_UINT32 _subSampling;
|
||||||
TW_UINT16 _numComponents;
|
TW_UINT16 _numComponents;
|
||||||
TW_UINT16 _restartFrequency;
|
TW_UINT16 _restartFrequency;
|
||||||
|
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||||
TW_UINT16[] _quantMap;
|
TW_UINT16[] _quantMap;
|
||||||
|
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||||
TWMemory[] _quantTable;
|
TWMemory[] _quantTable;
|
||||||
|
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||||
TW_UINT16[] _huffmanMap;
|
TW_UINT16[] _huffmanMap;
|
||||||
|
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||||
TWMemory[] _huffmanDC;
|
TWMemory[] _huffmanDC;
|
||||||
|
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||||
TWMemory[] _huffmanAC;
|
TWMemory[] _huffmanAC;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWOneValue
|
partial class TWOneValue
|
||||||
{
|
{
|
||||||
TW_UINT16 _itemType;
|
TW_UINT16 _itemType;
|
||||||
TW_UINT32 _item;
|
TW_UINT32 _item;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWPalette8
|
partial class TWPalette8
|
||||||
{
|
{
|
||||||
TW_UINT16 _numColors;
|
TW_UINT16 _numColors;
|
||||||
TW_UINT16 _paletteType;
|
TW_UINT16 _paletteType;
|
||||||
@@ -401,7 +420,7 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWPassThru
|
partial class TWPassThru
|
||||||
{
|
{
|
||||||
TW_MEMREF _pCommand;
|
TW_MEMREF _pCommand;
|
||||||
TW_UINT32 _commandBytes;
|
TW_UINT32 _commandBytes;
|
||||||
@@ -427,7 +446,7 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWRange
|
partial class TWRange
|
||||||
{
|
{
|
||||||
TW_UINT16 _itemType;
|
TW_UINT16 _itemType;
|
||||||
TW_UINT32 _minValue;
|
TW_UINT32 _minValue;
|
||||||
@@ -438,14 +457,15 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWRgbResponse
|
partial class TWRgbResponse
|
||||||
{
|
{
|
||||||
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
|
||||||
TWElement8[] _response;
|
TWElement8[] _response;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2),
|
[StructLayout(LayoutKind.Sequential, Pack = 2),
|
||||||
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
||||||
public partial class TWSetupFileXfer
|
partial class TWSetupFileXfer
|
||||||
{
|
{
|
||||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String255)]
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String255)]
|
||||||
string _fileName;
|
string _fileName;
|
||||||
@@ -454,46 +474,36 @@ namespace NTwain.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWSetupMemXfer
|
partial class TWSetupMemXfer
|
||||||
{
|
{
|
||||||
TW_UINT32 _minBufSize;
|
TW_UINT32 _minBufSize;
|
||||||
TW_UINT32 _maxBufSize;
|
TW_UINT32 _maxBufSize;
|
||||||
TW_UINT32 _preferred;
|
TW_UINT32 _preferred;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Explicit, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWStatus
|
partial class TWStatus
|
||||||
{
|
{
|
||||||
[FieldOffset(0)]
|
//[FieldOffset(0)]
|
||||||
TW_UINT16 _conditionCode;
|
TW_UINT16 _conditionCode;
|
||||||
[FieldOffset(2)]
|
//[FieldOffset(2)]
|
||||||
TW_UINT16 _data;
|
TW_UINT16 _data;
|
||||||
[FieldOffset(2)]
|
//[FieldOffset(2)]
|
||||||
TW_UINT16 _reserved;
|
//TW_UINT16 _reserved;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Explicit, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
public partial class TWStatusUtf8
|
partial class TWStatusUtf8
|
||||||
{
|
{
|
||||||
// rather than embedding the twstatus directly use its fields instead
|
// NOTE: rather than embedding the twstatus directly use its fields instead
|
||||||
// so the twstatus could become an object. If twstatus changes
|
// so the twstatus could become a class object. If twstatus changes
|
||||||
// definition remember to change it here
|
// definition remember to change it here
|
||||||
|
TW_UINT16 _conditionCode;
|
||||||
|
TW_UINT16 _data;
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// <see cref="TWStatus"/> data received from a previous call.
|
|
||||||
///// </summary>
|
|
||||||
//TWStatus Status;
|
|
||||||
[FieldOffset(0)]
|
|
||||||
TW_UINT16 _statusConditionCode;
|
|
||||||
[FieldOffset(2)]
|
|
||||||
TW_UINT16 _statusData;
|
|
||||||
[FieldOffset(2)]
|
|
||||||
TW_UINT16 _status_reserved;
|
|
||||||
|
|
||||||
[FieldOffset(4)]
|
|
||||||
TW_UINT32 _size;
|
TW_UINT32 _size;
|
||||||
[FieldOffset(8)]
|
|
||||||
TW_HANDLE _uTF8string;
|
TW_HANDLE _uTF8string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,4 +515,30 @@ namespace NTwain.Data
|
|||||||
TW_HANDLE _hParent;
|
TW_HANDLE _hParent;
|
||||||
//HandleRef _hParent;
|
//HandleRef _hParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delegate ReturnCode CallbackDelegate(TWIdentity origin, TWIdentity destination,
|
||||||
|
DataGroups dg, DataArgumentType dat, Message msg, TW_MEMREF data);
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||||
|
partial class TWEntryPoint
|
||||||
|
{
|
||||||
|
TW_UINT32 _size;
|
||||||
|
// this is not a delegate cuz it's not used by the app
|
||||||
|
IntPtr _dSM_Entry;
|
||||||
|
|
||||||
|
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||||
|
MemAllocateDelegate _dSM_MemAllocate;
|
||||||
|
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||||
|
MemFreeDelegate _dSM_MemFree;
|
||||||
|
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||||
|
MemLockDelegate _dSM_MemLock;
|
||||||
|
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||||
|
MemUnlockDelegate _dSM_MemUnlock;
|
||||||
|
|
||||||
|
public delegate IntPtr MemAllocateDelegate(uint size);
|
||||||
|
public delegate void MemFreeDelegate(IntPtr handle);
|
||||||
|
public delegate IntPtr MemLockDelegate(IntPtr handle);
|
||||||
|
public delegate void MemUnlockDelegate(IntPtr handle);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,7 @@
|
|||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>TRACE;DEBUG;WIN32</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<!--<iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>-->
|
<!--<iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>-->
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<description>$description$</description>
|
<description>$description$</description>
|
||||||
<releaseNotes></releaseNotes>
|
<releaseNotes>This release is updated for TWAIN 2.3.</releaseNotes>
|
||||||
<copyright>$copyright$</copyright>
|
<copyright>$copyright$</copyright>
|
||||||
<tags>TWAIN</tags>
|
<tags>TWAIN</tags>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|||||||
@@ -306,16 +306,16 @@
|
|||||||
PdfA2 = 16
|
PdfA2 = 16
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// Audio file format values.
|
///// Audio file format values.
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public enum AudioFileFormat : ushort
|
//public enum AudioFileFormat : ushort
|
||||||
{
|
//{
|
||||||
Wav = 0,
|
// Wav = 0,
|
||||||
Aiff = 1,
|
// Aiff = 1,
|
||||||
AU = 3,
|
// AU = 3,
|
||||||
Snd = 4,
|
// Snd = 4,
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ICapImageFilter values.
|
/// ICapImageFilter values.
|
||||||
@@ -360,7 +360,7 @@
|
|||||||
CieXYZ = 8,
|
CieXYZ = 8,
|
||||||
Lab = 9,
|
Lab = 9,
|
||||||
SRGB = 10,
|
SRGB = 10,
|
||||||
ScRGB = 11,
|
//ScRGB = 11,
|
||||||
Infrared = 16
|
Infrared = 16
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ namespace NTwain.Values
|
|||||||
CapFeedPage = 0x1009,
|
CapFeedPage = 0x1009,
|
||||||
CapRewindPage = 0x100a,
|
CapRewindPage = 0x100a,
|
||||||
CapIndicators = 0x100b, /* Added 1.1 */
|
CapIndicators = 0x100b, /* Added 1.1 */
|
||||||
CapSupportedCapsExt = 0x100c, /* Added 1.6 */
|
//CapSupportedCapsExt = 0x100c, /* Added 1.6 */
|
||||||
CapPaperDetectable = 0x100d, /* Added 1.6 */
|
CapPaperDetectable = 0x100d, /* Added 1.6 */
|
||||||
CapUIControllable = 0x100e, /* Added 1.6 */
|
CapUIControllable = 0x100e, /* Added 1.6 */
|
||||||
CapDeviceOnline = 0x100f, /* Added 1.6 */
|
CapDeviceOnline = 0x100f, /* Added 1.6 */
|
||||||
@@ -705,8 +705,8 @@ namespace NTwain.Values
|
|||||||
/// Means Item is a char string shorter than 255.
|
/// Means Item is a char string shorter than 255.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
String255 = 0xc,
|
String255 = 0xc,
|
||||||
String1024 = 0xd,
|
//String1024 = 0xd,
|
||||||
Unicode512 = 0xe,
|
//Unicode512 = 0xe,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Means Item is a handle (pointer).
|
/// Means Item is a handle (pointer).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -25,7 +25,8 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const int String255 = 256;
|
public const int String255 = 256;
|
||||||
|
|
||||||
public const int String1024 = 1026;
|
// deprecated
|
||||||
|
//public const int String1024 = 1026;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Don't care value for 8 bit types.
|
/// Don't care value for 8 bit types.
|
||||||
@@ -47,7 +48,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The minor version number of TWAIN supported by this library.
|
/// The minor version number of TWAIN supported by this library.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const short ProtocolMinor = 2;
|
public const short ProtocolMinor = 3;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Value for false where applicable.
|
/// Value for false where applicable.
|
||||||
|
|||||||
Reference in New Issue
Block a user