diff --git a/NTwain.sln b/NTwain.sln index e9f450b..0bdcc02 100644 --- a/NTwain.sln +++ b/NTwain.sln @@ -7,6 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_common", "_common", "{4CE0 ProjectSection(SolutionItems) = preProject Build.cmd = Build.cmd src\Directory.Build.props = src\Directory.Build.props + global.json = global.json LICENSE.txt = LICENSE.txt README.md = README.md EndProjectSection @@ -22,8 +23,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_twain-doc", "_twain-doc", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NTwain", "src\NTwain\NTwain.csproj", "{3C8A3CF9-A60D-4F21-B866-D291A7AABD4A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NTwain-temp", "src\NTwain-temp\NTwain-temp.csproj", "{A7020B90-5CE4-43EF-A75D-5E1F9B501CAC}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinForm32", "samples\WinForm32\WinForm32.csproj", "{7792A94E-D0B4-440D-8BD5-CA1CA548782C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinForm64", "samples\WinForm64\WinForm64.csproj", "{C9666CB2-C9A6-48C8-AB51-D616A48058A7}" @@ -38,8 +37,6 @@ Global {3C8A3CF9-A60D-4F21-B866-D291A7AABD4A}.Debug|Any CPU.Build.0 = Debug|Any CPU {3C8A3CF9-A60D-4F21-B866-D291A7AABD4A}.Release|Any CPU.ActiveCfg = Release|Any CPU {3C8A3CF9-A60D-4F21-B866-D291A7AABD4A}.Release|Any CPU.Build.0 = Release|Any CPU - {A7020B90-5CE4-43EF-A75D-5E1F9B501CAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A7020B90-5CE4-43EF-A75D-5E1F9B501CAC}.Release|Any CPU.ActiveCfg = Release|Any CPU {7792A94E-D0B4-440D-8BD5-CA1CA548782C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7792A94E-D0B4-440D-8BD5-CA1CA548782C}.Debug|Any CPU.Build.0 = Debug|Any CPU {7792A94E-D0B4-440D-8BD5-CA1CA548782C}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/README.md b/README.md index 8c96338..17f1e80 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ the TWAIN Working Group. V4 of this lib has these features: -* Targets TWAIN version (2.5). +* Targets TWAIN version 2.5. * Runs under supported framework (4.6.2+) and netcore variants (6.0+). * Easier to use than the low-level C API with many dotnet niceties. * Attempt at reducing heap allocations compared to previous versions. @@ -43,7 +43,7 @@ containers and values should be. * All lower-level TWAIN APIs are public instead of hidden away. * `TwainAppSession` longer hosts its own internal message pump. Apps will need to hook -into their UI message loop on Windows (Winform and WPF at the moment). +into their UI message loop on Windows (supports Winform and WPF at the moment). ## Using the lib @@ -58,7 +58,6 @@ provided by this lib. A lower-level abstraction is the triplet calls (under `NTwain.DSM` namespace). You use `TwainAppSession` by subscribing to its events and calling methods to do TWAIN things. -There is a sample winform projects (both 32 and 64 bit variants) on how it can be used. +There is a sample winform project (both 32 and 64 bit variants) on how it can be used. Note that an application process should only have one active (opened) `TwainAppSession` at any time. - diff --git a/samples/Console32/Console32.csproj b/samples/Console32/Console32.csproj deleted file mode 100644 index ed93de7..0000000 --- a/samples/Console32/Console32.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - Exe - net462;net7.0 - enable - x86 - SampleConsole - 11 - - - - - - - diff --git a/samples/Console32/Program.cs b/samples/Console32/Program.cs deleted file mode 100644 index 2733346..0000000 --- a/samples/Console32/Program.cs +++ /dev/null @@ -1,36 +0,0 @@ -using NTwain; -using NTwain.Data; -using System; -using System.Diagnostics; -using System.Reflection; - -namespace SampleConsole -{ - internal class Program - { - // CONSOLE won't work yet until I got a message loop going. - - static void Main(string[] args) - { - TwainPlatform.PreferLegacyDSM = true; - - var twain = new TwainSession(new InPlaceMarshaller(), Assembly.GetExecutingAssembly().Location); - twain.StateChanged += Twain_StateChanged; - - var hwnd = IntPtr.Zero; // required for windows - var rc = twain.OpenDSM(hwnd); - Debug.WriteLine($"OpenDSM={rc}"); - - if (rc == STS.SUCCESS) - { - Debug.WriteLine($"CloseDSM={rc}"); - rc = twain.CloseDSM(); - } - } - - private static void Twain_StateChanged(TwainSession session, STATE state) - { - Console.WriteLine($"State changed to {state}"); - } - } -} \ No newline at end of file diff --git a/samples/Net5Console/Net5Console.csproj b/samples/Net5Console/Net5Console.csproj deleted file mode 100644 index c2ff29c..0000000 --- a/samples/Net5Console/Net5Console.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - Exe - net5.0 - x86 - - - - - - - diff --git a/samples/Net5Console/Program.cs b/samples/Net5Console/Program.cs deleted file mode 100644 index 08059d0..0000000 --- a/samples/Net5Console/Program.cs +++ /dev/null @@ -1,173 +0,0 @@ -using NTwain; -using System; -using System.Collections; -using System.Linq; -using System.Reflection; -using System.Threading; -using TWAINWorkingGroup; -using static TWAINWorkingGroup.TWAIN; - -namespace Net5Console -{ - class Program - { - [STAThread] - static void Main() - { - Console.WriteLine("Starting twain test in console..."); - Console.WriteLine(); - - using (var session = new TwainSession(Assembly.GetExecutingAssembly(), null, IntPtr.Zero)) - using (var hold = new ManualResetEventSlim()) - { - session.DeviceEvent += (sender, e) => - { - Console.WriteLine($"Got device event " + e.Event); - Console.WriteLine(); - }; - session.TransferError += (sender, e) => - { - Console.WriteLine($"Transfer error {e.Code} {e.Exception}."); - }; - session.TransferReady += (sender, e) => - { - Console.WriteLine($"Transfer ready, count={e.PendingCount}."); - }; - session.SourceDisabled += (sender, e) => - { - Console.WriteLine("Disabled device."); - Console.WriteLine(); - hold.Set(); - }; - - if (session.Open() == STS.SUCCESS) - { - Console.WriteLine("Opened DSM"); - Console.WriteLine(); - - Console.WriteLine("Default device:"); - Console.WriteLine($"\t{session.DefaultDataSource}"); - Console.WriteLine(); - - Console.WriteLine("All devices:"); - TW_IDENTITY? dsToUse = null; - foreach (var dev in session.GetDataSources()) - { - Console.WriteLine($"\t{dev}"); - if (dev.ProductName == "TWAIN2 Software Scanner") - { - dsToUse = dev; - } - } - Console.WriteLine(); - - if (!dsToUse.HasValue) - { - Console.WriteLine("Sample scanner not found."); - } - else - { - session.CurrentDataSource = dsToUse.Value; - if (session.CurrentDataSource.HasValue) - { - Console.WriteLine("Current device after opening attempt:"); - Console.WriteLine($"\t{session.CurrentDataSource}"); - Console.WriteLine(); - - var caps = session.Capabilities; - Console.WriteLine("All device caps:"); - foreach (var cap in caps.CAP_SUPPORTEDCAPS.GetValues()) - { - WriteCapInfo(caps, cap); - } - Console.WriteLine(); - - short count = 3; - var sts = caps.CAP_XFERCOUNT.SetOrConstraint(MSG.SET, count); - if (sts == STS.SUCCESS) - { - Console.WriteLine($"Successfully set xfercount to {count}."); - } - else - { - Console.WriteLine($"Failed set xfercount: {sts}."); - } - Console.WriteLine(); - - - sts = caps.ICAP_PIXELTYPE.SetOrConstraint(MSG.SET, TWPT.GRAY); - if (sts == STS.SUCCESS) - { - Console.WriteLine("Successfully set pixel type to GRAY."); - } - else - { - Console.WriteLine($"Failed set pixel type: {sts}."); - } - Console.WriteLine(); - - sts = session.StartCapture(false); - if (sts == STS.SUCCESS) - { - Console.Error.WriteLine("Waiting for capture to complete."); - Console.WriteLine(); - - while (!hold.IsSet) Thread.Sleep(100); - } - else - { - Console.Error.WriteLine("Failed to start capture: " + sts); - Console.WriteLine(); - } - } - else - { - Console.WriteLine("No devices opened."); - Console.WriteLine(); - } - } - } - else - { - Console.Error.WriteLine("Failed to open DSM"); - } - Console.WriteLine("Test Ended"); - } - - } - - private static void Session_SourceDisabled(object sender, EventArgs e) - { - throw new NotImplementedException(); - } - - private static void WriteCapInfo(Capabilities caps, CAP cap) - { - // use reflection due to unknown generics - var propInfo = typeof(Capabilities).GetProperty(cap.ToString()); - if (propInfo == null) return; - - var capWrapper = propInfo.GetValue(caps); - var wrapType = capWrapper.GetType(); - var label = (string)wrapType.GetMethod(nameof(CapWrapper.GetLabel)).Invoke(capWrapper, null); - var supports = (TWQC)wrapType.GetMethod(nameof(CapWrapper.QuerySupport)).Invoke(capWrapper, null); - - Console.WriteLine($"\t{label ?? cap.ToString()}: {supports}"); - Console.WriteLine($"\t\tDefault: {wrapType.GetMethod(nameof(CapWrapper.GetDefault)).Invoke(capWrapper, null)}"); - Console.WriteLine($"\t\tCurrent: {wrapType.GetMethod(nameof(CapWrapper.GetCurrent)).Invoke(capWrapper, null)}"); - bool first = true; - foreach (var val in (IEnumerable)wrapType.GetMethod(nameof(CapWrapper.GetValues)).Invoke(capWrapper, null)) - { - if (first) - { - Console.WriteLine($"\t\tValues:\t{val}"); - first = false; - } - else - { - Console.WriteLine($"\t\t\t{val}"); - } - } - } - } -} diff --git a/src/NTwain-temp/CapWrapper.cs b/src/NTwain-temp/CapWrapper.cs deleted file mode 100644 index 430cc19..0000000 --- a/src/NTwain-temp/CapWrapper.cs +++ /dev/null @@ -1,305 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using TWAINWorkingGroup; -using static TWAINWorkingGroup.TWAIN; - -namespace NTwain -{ - /// - /// Contains operations for a . - /// - /// Individual value type of the cap. Must be one of TWAIN's supported cap value types. - /// You are responsible for using the correct type for a cap. - public class CapWrapper where TValue : struct - { - protected readonly TWAIN _twain; - - public CapWrapper(TWAIN twain, CAP cap) - { - _twain = twain; - Cap = cap; - } - - /// - /// The cap being targeted. - /// - public CAP Cap { get; } - - /// - /// Gets the operations supported by the cap. - /// Not all sources supports this so it may be unknown. - /// - public TWQC QuerySupport() - { - var twCap = new TW_CAPABILITY - { - Cap = Cap - }; - - var sts = _twain.DatCapability(DG.CONTROL, MSG.QUERYSUPPORT, ref twCap); - if (sts == STS.SUCCESS && twCap.ConType == TWON.ONEVALUE) - { - return ValueReader.ReadOneValueContainer(_twain, ref twCap); - } - return TWQC.Unknown; - } - - /// - /// Try to get list of the cap's supported values. - /// - /// - public IList GetValues() - { - var twCap = new TW_CAPABILITY - { - Cap = Cap - }; - - var sts = _twain.DatCapability(DG.CONTROL, MSG.GET, ref twCap); - if (sts == STS.SUCCESS) - { - switch (twCap.ConType) - { - case TWON.ONEVALUE: - return new[] { ValueReader.ReadOneValueContainer(_twain, ref twCap) }; - case TWON.ENUMERATION: - return ValueReader.ReadEnumerationContainer(_twain, ref twCap).Items; - case TWON.ARRAY: - return ValueReader.ReadArrayContainer(_twain, ref twCap); - case TWON.RANGE: - return ValueReader.ReadRangeContainer(_twain, ref twCap).ToList(); - } - } - return EmptyArray.Value; - } - - /// - /// Try to get the cap's current value. - /// - /// - public TValue GetCurrent() - { - var twCap = new TW_CAPABILITY - { - Cap = Cap - }; - - var sts = _twain.DatCapability(DG.CONTROL, MSG.GETCURRENT, ref twCap); - if (sts == STS.SUCCESS) - { - switch (twCap.ConType) - { - case TWON.ONEVALUE: - return ValueReader.ReadOneValueContainer(_twain, ref twCap); - case TWON.ENUMERATION: - var enumeration = ValueReader.ReadEnumerationContainer(_twain, ref twCap); - if (enumeration.CurrentIndex < enumeration.Items.Length) - return enumeration.Items[enumeration.CurrentIndex]; - break; - case TWON.RANGE: - return ValueReader.ReadRangeContainer(_twain, ref twCap).CurrentValue; - } - } - return default; - } - - /// - /// Try to get the cap's default value. - /// - /// - public TValue GetDefault() - { - var twCap = new TW_CAPABILITY - { - Cap = Cap - }; - - var sts = _twain.DatCapability(DG.CONTROL, MSG.GETDEFAULT, ref twCap); - if (sts == STS.SUCCESS) - { - switch (twCap.ConType) - { - case TWON.ONEVALUE: - return ValueReader.ReadOneValueContainer(_twain, ref twCap); - case TWON.ENUMERATION: - var enumeration = ValueReader.ReadEnumerationContainer(_twain, ref twCap); - if (enumeration.DefaultIndex < enumeration.Items.Length) - return enumeration.Items[enumeration.DefaultIndex]; - break; - case TWON.RANGE: - return ValueReader.ReadRangeContainer(_twain, ref twCap).DefaultValue; - } - } - return default; - } - - /// - /// Try to get the cap's label text. - /// - /// - public string GetLabel() - { - var twCap = new TW_CAPABILITY - { - Cap = Cap - }; - - var sts = _twain.DatCapability(DG.CONTROL, MSG.GETLABEL, ref twCap); - if (sts == STS.SUCCESS) - { - return ValueReader.ReadOneValueContainerString(_twain, twCap); - } - return null; - } - - /// - /// Try to get the cap's description text. - /// - /// - public string GetHelp() - { - var twCap = new TW_CAPABILITY - { - Cap = Cap - }; - - var sts = _twain.DatCapability(DG.CONTROL, MSG.GETHELP, ref twCap); - if (sts == STS.SUCCESS) - { - return ValueReader.ReadOneValueContainerString(_twain, twCap); - } - return null; - } - - /// - /// Resets the cap's current value to power-on default. - /// - /// - public STS Reset() - { - var twCap = new TW_CAPABILITY - { - Cap = Cap - }; - - var sts = _twain.DatCapability(DG.CONTROL, MSG.RESET, ref twCap); - return sts; - } - - /// - /// Try to set a one value for the cap. - /// - /// - /// - /// - public STS SetOrConstraint(MSG setMsg, TValue value) - { - if (setMsg != MSG.SET && setMsg != MSG.SETCONSTRAINT) - throw new ArgumentException($"Only {nameof(MSG.SET)} and {nameof(MSG.SETCONSTRAINT)} messages are supported.", nameof(setMsg)); - - var twCap = new TW_CAPABILITY - { - Cap = Cap, - ConType = TWON.ONEVALUE - }; - try - { - ValueWriter.WriteOneValueContainer(_twain, ref twCap, value); - return _twain.DatCapability(DG.CONTROL, setMsg, ref twCap); - } - finally - { - if (twCap.hContainer != IntPtr.Zero) - _twain.DsmMemFree(ref twCap.hContainer); - } - } - - /// - /// Try to set an array value for the cap. - /// - /// - /// - /// - public STS SetOrConstraint(MSG setMsg, TValue[] values) - { - if (setMsg != MSG.SET && setMsg != MSG.SETCONSTRAINT) - throw new ArgumentException($"Only {nameof(MSG.SET)} and {nameof(MSG.SETCONSTRAINT)} messages are supported.", nameof(setMsg)); - if (values == null) throw new ArgumentNullException(nameof(values)); - - var twCap = new TW_CAPABILITY - { - Cap = Cap, - ConType = TWON.ARRAY - }; - try - { - ValueWriter.WriteArrayContainer(_twain, ref twCap, values); - return _twain.DatCapability(DG.CONTROL, setMsg, ref twCap); - } - finally - { - if (twCap.hContainer != IntPtr.Zero) - _twain.DsmMemFree(ref twCap.hContainer); - } - } - - /// - /// Try to set a range value for the cap. - /// - /// - /// - /// - public STS SetOrConstraint(MSG setMsg, Range value) - { - if (setMsg != MSG.SET && setMsg != MSG.SETCONSTRAINT) - throw new ArgumentException($"Only {nameof(MSG.SET)} and {nameof(MSG.SETCONSTRAINT)} messages are supported.", nameof(setMsg)); - if (value == null) throw new ArgumentNullException(nameof(value)); - - var twCap = new TW_CAPABILITY - { - Cap = Cap, - ConType = TWON.RANGE - }; - try - { - ValueWriter.WriteRangeContainer(_twain, ref twCap, value); - return _twain.DatCapability(DG.CONTROL, setMsg, ref twCap); - } - finally - { - if (twCap.hContainer != IntPtr.Zero) - _twain.DsmMemFree(ref twCap.hContainer); - } - } - - /// - /// Try to set an array value for the cap. - /// - /// - /// - /// - public STS SetOrConstraint(MSG setMsg, Enumeration value) - { - if (setMsg != MSG.SET && setMsg != MSG.SETCONSTRAINT) - throw new ArgumentException($"Only {nameof(MSG.SET)} and {nameof(MSG.SETCONSTRAINT)} messages are supported.", nameof(setMsg)); - if (value == null) throw new ArgumentNullException(nameof(value)); - - var twCap = new TW_CAPABILITY - { - Cap = Cap, - ConType = TWON.ENUMERATION - }; - try - { - ValueWriter.WriteEnumContainer(_twain, ref twCap, value); - return _twain.DatCapability(DG.CONTROL, setMsg, ref twCap); - } - finally - { - if (twCap.hContainer != IntPtr.Zero) - _twain.DsmMemFree(ref twCap.hContainer); - } - } - } -} \ No newline at end of file diff --git a/src/NTwain-temp/Capabilities.cs b/src/NTwain-temp/Capabilities.cs deleted file mode 100644 index 6c26635..0000000 --- a/src/NTwain-temp/Capabilities.cs +++ /dev/null @@ -1,1696 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TWAINWorkingGroup; -using static TWAINWorkingGroup.TWAIN; - -namespace NTwain -{ - /// - /// Contains known capabilities for TWAIN 2.4. If a device has own cap or - /// uses different type for the cap then create your own - /// for working with them. - /// - public class Capabilities - { - private readonly TWAIN _twain; - - public Capabilities(TWAIN twain) - { - _twain = twain; - } - - - /// - /// Resets all cap values and constraint to power-on defaults. - /// Not all sources will support this. - /// - /// - public STS ResetAll() - { - var twCap = new TW_CAPABILITY - { - Cap = CAP.CAP_SUPPORTEDCAPS - }; - - var sts = _twain.DatCapability(DG.CONTROL, MSG.RESETALL, ref twCap); - return sts; - } - - - #region audio caps - - private CapWrapper _audXferMech; - public CapWrapper ACAP_XFERMECH - { - get - { - return _audXferMech ?? (_audXferMech = new CapWrapper(_twain, CAP.ACAP_XFERMECH)); - } - } - - #endregion - - #region img caps - - #region mandatory - - private CapWrapper _compression; - public CapWrapper ICAP_COMPRESSION - { - get - { - return _compression ?? (_compression = new CapWrapper(_twain, CAP.ICAP_COMPRESSION)); - } - } - - - private CapWrapper _pixelType; - public CapWrapper ICAP_PIXELTYPE - { - get - { - return _pixelType ?? (_pixelType = new CapWrapper(_twain, CAP.ICAP_PIXELTYPE)); - } - } - - private CapWrapper _imgUnits; - public CapWrapper ICAP_UNITS - { - get - { - return _imgUnits ?? (_imgUnits = new CapWrapper(_twain, CAP.ICAP_UNITS)); - } - } - - private CapWrapper _imgXferMech; - public CapWrapper ICAP_XFERMECH - { - get - { - return _imgXferMech ?? (_imgXferMech = new CapWrapper(_twain, CAP.ICAP_XFERMECH)); - } - } - - #endregion - - private CapWrapper _autoBright; - public CapWrapper ICAP_AUTOBRIGHT - { - get - { - return _autoBright ?? (_autoBright = new CapWrapper(_twain, CAP.ICAP_AUTOBRIGHT)); - } - } - - private CapWrapper _brightness; - public CapWrapper ICAP_BRIGHTNESS - { - get - { - return _brightness ?? (_brightness = new CapWrapper(_twain, CAP.ICAP_BRIGHTNESS)); - } - } - - private CapWrapper _contrast; - public CapWrapper ICAP_CONTRAST - { - get - { - return _contrast ?? (_contrast = new CapWrapper(_twain, CAP.ICAP_CONTRAST)); - } - } - - private CapWrapper _custHalftone; - public CapWrapper ICAP_CUSTHALFTONE - { - get - { - return _custHalftone ?? (_custHalftone = new CapWrapper(_twain, CAP.ICAP_CUSTHALFTONE)); - } - } - - private CapWrapper _exposureTime; - /// - /// Gets the property to work with image exposure time (in seconds) for the current source. - /// - /// - /// The image exposure time. - /// - public CapWrapper ICAP_EXPOSURETIME - { - get - { - return _exposureTime ?? (_exposureTime = new CapWrapper(_twain, CAP.ICAP_EXPOSURETIME)); - } - } - - private CapWrapper _filter; - public CapWrapper ICAP_FILTER - { - get - { - return _filter ?? (_filter = new CapWrapper(_twain, CAP.ICAP_FILTER)); - } - } - - private CapWrapper _gamma; - public CapWrapper ICAP_GAMMA - { - get - { - return _gamma ?? (_gamma = new CapWrapper(_twain, CAP.ICAP_GAMMA)); - } - } - - private CapWrapper _halftones; - public CapWrapper ICAP_HALFTONES - { - get - { - return _halftones ?? (_halftones = new CapWrapper(_twain, CAP.ICAP_HALFTONES)); - } - } - - private CapWrapper _highlight; - public CapWrapper ICAP_HIGHLIGHT - { - get - { - return _highlight ?? (_highlight = new CapWrapper(_twain, CAP.ICAP_HIGHLIGHT)); - } - } - - private CapWrapper _fileFormat; - public CapWrapper ICAP_IMAGEFILEFORMAT - { - get - { - return _fileFormat ?? (_fileFormat = new CapWrapper(_twain, CAP.ICAP_IMAGEFILEFORMAT)); - } - } - - - private CapWrapper _lampState; - public CapWrapper ICAP_LAMPSTATE - { - get - { - return _lampState ?? (_lampState = new CapWrapper(_twain, CAP.ICAP_LAMPSTATE)); - } - } - - private CapWrapper _lightSource; - public CapWrapper ICAP_LIGHTSOURCE - { - get - { - return _lightSource ?? (_lightSource = new CapWrapper(_twain, CAP.ICAP_LIGHTSOURCE)); - } - } - - private CapWrapper _orientation; - public CapWrapper ICAP_ORIENTATION - { - get - { - return _orientation ?? (_orientation = new CapWrapper(_twain, CAP.ICAP_ORIENTATION)); - } - } - - private CapWrapper _physicalWidth; - public CapWrapper ICAP_PHYSICALWIDTH - { - get - { - return _physicalWidth ?? (_physicalWidth = new CapWrapper(_twain, CAP.ICAP_PHYSICALWIDTH)); - } - } - - private CapWrapper _physicalHeight; - public CapWrapper ICAP_PHYSICALHEIGHT - { - get - { - return _physicalHeight ?? (_physicalHeight = new CapWrapper(_twain, CAP.ICAP_PHYSICALHEIGHT)); - } - } - - private CapWrapper _shadow; - public CapWrapper ICAP_SHADOW - { - get - { - return _shadow ?? (_shadow = new CapWrapper(_twain, CAP.ICAP_SHADOW)); - } - } - - private CapWrapper _frames; - public CapWrapper ICAP_FRAMES - { - get - { - return _frames ?? (_frames = new CapWrapper(_twain, CAP.ICAP_FRAMES)); - } - } - - private CapWrapper _nativeXRes; - public CapWrapper ICAP_XNATIVERESOLUTION - { - get - { - return _nativeXRes ?? (_nativeXRes = new CapWrapper(_twain, CAP.ICAP_XNATIVERESOLUTION)); - } - } - - private CapWrapper _nativeYRes; - public CapWrapper ICAP_YNATIVERESOLUTION - { - get - { - return _nativeYRes ?? (_nativeYRes = new CapWrapper(_twain, CAP.ICAP_YNATIVERESOLUTION)); - } - } - - private CapWrapper _xResolution; - public CapWrapper ICAP_XRESOLUTION - { - get - { - return _xResolution ?? (_xResolution = new CapWrapper(_twain, CAP.ICAP_XRESOLUTION)); - } - } - - - private CapWrapper _yResolution; - public CapWrapper ICAP_YRESOLUTION - { - get - { - return _yResolution ?? (_yResolution = new CapWrapper(_twain, CAP.ICAP_YRESOLUTION)); - } - } - - private CapWrapper _maxFrames; - public CapWrapper ICAP_MAXFRAMES - { - get - { - return _maxFrames ?? (_maxFrames = new CapWrapper(_twain, CAP.ICAP_MAXFRAMES)); - } - } - - private CapWrapper _tiles; - public CapWrapper ICAP_TILES - { - get - { - return _tiles ?? (_tiles = new CapWrapper(_twain, CAP.ICAP_TILES)); - } - } - - private CapWrapper _bitOrder; - public CapWrapper ICAP_BITORDER - { - get - { - return _bitOrder ?? (_bitOrder = new CapWrapper(_twain, CAP.ICAP_BITORDER)); - } - } - - private CapWrapper _ccittKFactor; - public CapWrapper ICAP_CCITTKFACTOR - { - get - { - return _ccittKFactor ?? (_ccittKFactor = new CapWrapper(_twain, CAP.ICAP_CCITTKFACTOR)); - } - } - - private CapWrapper _lightPath; - public CapWrapper ICAP_LIGHTPATH - { - get - { - return _lightPath ?? (_lightPath = new CapWrapper(_twain, CAP.ICAP_LIGHTPATH)); - } - } - - private CapWrapper _pixelFlavor; - public CapWrapper ICAP_PIXELFLAVOR - { - get - { - return _pixelFlavor ?? (_pixelFlavor = new CapWrapper(_twain, CAP.ICAP_PIXELFLAVOR)); - } - } - - private CapWrapper _planarChunky; - public CapWrapper ICAP_PLANARCHUNKY - { - get - { - return _planarChunky ?? (_planarChunky = new CapWrapper(_twain, CAP.ICAP_PLANARCHUNKY)); - } - } - - private CapWrapper _rotation; - public CapWrapper ICAP_ROTATION - { - get - { - return _rotation ?? (_rotation = new CapWrapper(_twain, CAP.ICAP_ROTATION)); - } - } - - private CapWrapper _supportSize; - public CapWrapper ICAP_SUPPORTEDSIZES - { - get - { - return _supportSize ?? (_supportSize = new CapWrapper(_twain, CAP.ICAP_SUPPORTEDSIZES)); - } - } - - private CapWrapper _threshold; - public CapWrapper ICAP_THRESHOLD - { - get - { - return _threshold ?? (_threshold = new CapWrapper(_twain, CAP.ICAP_THRESHOLD)); - } - } - - private CapWrapper _xscaling; - public CapWrapper ICAP_XSCALING - { - get - { - return _xscaling ?? (_xscaling = new CapWrapper(_twain, CAP.ICAP_XSCALING)); - } - } - - private CapWrapper _yscaling; - public CapWrapper ICAP_YSCALING - { - get - { - return _yscaling ?? (_yscaling = new CapWrapper(_twain, CAP.ICAP_YSCALING)); - } - } - - private CapWrapper _bitorderCodes; - - /// - /// Gets the property to work with image CCITT compression for the current source. - /// - /// - /// The image bit order for CCITT compression. - /// - public CapWrapper ICAP_BITORDERCODES - { - get - { - return _bitorderCodes ?? (_bitorderCodes = new CapWrapper(_twain, CAP.ICAP_BITORDERCODES)); - } - } - - private CapWrapper _pixelFlavorCodes; - - /// - /// Gets the property to work with image CCITT compression for the current source. - /// - /// - /// The image pixel flavor for CCITT compression. - /// - public CapWrapper ICAP_PIXELFLAVORCODES - { - get - { - return _pixelFlavorCodes ?? (_pixelFlavorCodes = new CapWrapper(_twain, CAP.ICAP_PIXELFLAVORCODES)); - } - } - - private CapWrapper _jpegPixelType; - - /// - /// Gets the property to work with image jpeg compression for the current source. - /// - /// - /// The image pixel type for jpeg compression. - /// - public CapWrapper ICAP_JPEGPIXELTYPE - { - get - { - return _jpegPixelType ?? (_jpegPixelType = new CapWrapper(_twain, CAP.ICAP_JPEGPIXELTYPE)); - } - } - - private CapWrapper _timeFill; - - /// - /// Gets the property to work with image CCITT time fill for the current source. - /// - /// - /// The image CCITT time fill. - /// - public CapWrapper ICAP_TIMEFILL - { - get - { - return _timeFill ?? (_timeFill = new CapWrapper(_twain, CAP.ICAP_TIMEFILL)); - } - } - - private CapWrapper _bitDepth; - public CapWrapper ICAP_BITDEPTH - { - get - { - return _bitDepth ?? (_bitDepth = new CapWrapper(_twain, CAP.ICAP_BITDEPTH)); - } - } - - private CapWrapper _bitDepthReduction; - public CapWrapper ICAP_BITDEPTHREDUCTION - { - get - { - return _bitDepthReduction ?? (_bitDepthReduction = new CapWrapper(_twain, CAP.ICAP_BITDEPTHREDUCTION)); - } - } - - private CapWrapper _undefinedImgSize; - public CapWrapper ICAP_UNDEFINEDIMAGESIZE - { - get - { - return _undefinedImgSize ?? (_undefinedImgSize = new CapWrapper(_twain, CAP.ICAP_UNDEFINEDIMAGESIZE)); - } - } - - private CapWrapper _imgDataSet; - - /// - /// Gets or sets the image indices that will be delivered during the standard image transfer done in - /// States 6 and 7. - /// - /// - /// The image indicies. - /// - public CapWrapper ICAP_IMAGEDATASET - { - get - { - return _imgDataSet ?? (_imgDataSet = new CapWrapper(_twain, CAP.ICAP_IMAGEDATASET)); - } - } - - private CapWrapper _extImgInfo; - public CapWrapper ICAP_EXTIMAGEINFO - { - get - { - return _extImgInfo ?? (_extImgInfo = new CapWrapper(_twain, CAP.ICAP_EXTIMAGEINFO)); - } - } - - private CapWrapper _minHeight; - public CapWrapper ICAP_MINIMUMHEIGHT - { - get - { - return _minHeight ?? (_minHeight = new CapWrapper(_twain, CAP.ICAP_MINIMUMHEIGHT)); - } - } - - private CapWrapper _minWidth; - public CapWrapper ICAP_MINIMUMWIDTH - { - get - { - return _minWidth ?? (_minWidth = new CapWrapper(_twain, CAP.ICAP_MINIMUMWIDTH)); - } - } - - private CapWrapper _autoDiscBlankPg; - public CapWrapper ICAP_AUTODISCARDBLANKPAGES - { - get - { - return _autoDiscBlankPg ?? (_autoDiscBlankPg = new CapWrapper(_twain, CAP.ICAP_AUTODISCARDBLANKPAGES)); - } - } - - private CapWrapper _flipRotation; - public CapWrapper ICAP_FLIPROTATION - { - get - { - return _flipRotation ?? (_flipRotation = new CapWrapper(_twain, CAP.ICAP_FLIPROTATION)); - } - } - - private CapWrapper _barcodeDetectEnabled; - public CapWrapper ICAP_BARCODEDETECTIONENABLED - { - get - { - return _barcodeDetectEnabled ?? (_barcodeDetectEnabled = new CapWrapper(_twain, CAP.ICAP_BARCODEDETECTIONENABLED)); - } - } - - private CapWrapper _barcodeType; - public CapWrapper ICAP_SUPPORTEDBARCODETYPES - { - get - { - return _barcodeType ?? (_barcodeType = new CapWrapper(_twain, CAP.ICAP_SUPPORTEDBARCODETYPES)); - } - } - - private CapWrapper _barcodeMaxPriority; - public CapWrapper ICAP_BARCODEMAXSEARCHPRIORITIES - { - get - { - return _barcodeMaxPriority ?? (_barcodeMaxPriority = new CapWrapper(_twain, CAP.ICAP_BARCODEMAXSEARCHPRIORITIES)); - } - } - - private CapWrapper _barcodeSearchPriority; - public CapWrapper ICAP_BARCODESEARCHPRIORITIES - { - get - { - return _barcodeSearchPriority ?? (_barcodeSearchPriority = new CapWrapper(_twain, CAP.ICAP_BARCODESEARCHPRIORITIES)); - } - } - - private CapWrapper _barcodeSearchMode; - public CapWrapper ICAP_BARCODESEARCHMODE - { - get - { - return _barcodeSearchMode ?? (_barcodeSearchMode = new CapWrapper(_twain, CAP.ICAP_BARCODESEARCHMODE)); - } - } - - private CapWrapper _barcodeMaxRetries; - public CapWrapper ICAP_BARCODEMAXRETRIES - { - get - { - return _barcodeMaxRetries ?? (_barcodeMaxRetries = new CapWrapper(_twain, CAP.ICAP_BARCODEMAXRETRIES)); - } - } - - private CapWrapper _barcodeTimeout; - - /// - /// Gets the property to work with image barcode max search timeout for the current source. - /// - /// - /// The image barcode max search timeout. - /// - public CapWrapper ICAP_BARCODETIMEOUT - { - get - { - return _barcodeTimeout ?? (_barcodeTimeout = new CapWrapper(_twain, CAP.ICAP_BARCODETIMEOUT)); - } - } - - private CapWrapper _zoomFactor; - public CapWrapper ICAP_ZOOMFACTOR - { - get - { - return _zoomFactor ?? (_zoomFactor = new CapWrapper(_twain, CAP.ICAP_ZOOMFACTOR)); - } - } - - private CapWrapper _patchcodeDetectEnabled; - public CapWrapper ICAP_PATCHCODEDETECTIONENABLED - { - get - { - return _patchcodeDetectEnabled ?? (_patchcodeDetectEnabled = new CapWrapper(_twain, CAP.ICAP_PATCHCODEDETECTIONENABLED)); - } - } - - private CapWrapper _patchcodeType; - public CapWrapper ICAP_SUPPORTEDPATCHCODETYPES - { - get - { - return _patchcodeType ?? (_patchcodeType = new CapWrapper(_twain, CAP.ICAP_SUPPORTEDPATCHCODETYPES)); - } - } - - private CapWrapper _patchcodeMaxPriority; - public CapWrapper ICAP_PATCHCODEMAXSEARCHPRIORITIES - { - get - { - return _patchcodeMaxPriority ?? (_patchcodeMaxPriority = new CapWrapper(_twain, CAP.ICAP_PATCHCODEMAXSEARCHPRIORITIES)); - } - } - - private CapWrapper _patchcodeSearchPriority; - public CapWrapper ICAP_PATCHCODESEARCHPRIORITIES - { - get - { - return _patchcodeSearchPriority ?? (_patchcodeSearchPriority = new CapWrapper(_twain, CAP.ICAP_PATCHCODESEARCHPRIORITIES)); - } - } - - private CapWrapper _patchcodeSearchMode; - public CapWrapper ICAP_PATCHCODESEARCHMODE - { - get - { - return _patchcodeSearchMode ?? (_patchcodeSearchMode = new CapWrapper(_twain, CAP.ICAP_PATCHCODESEARCHMODE)); - } - } - - private CapWrapper _patchCodeMaxRetries; - public CapWrapper ICAP_PATCHCODEMAXRETRIES - { - get - { - return _patchCodeMaxRetries ?? (_patchCodeMaxRetries = new CapWrapper(_twain, CAP.ICAP_PATCHCODEMAXRETRIES)); - } - } - - private CapWrapper _patchCodeTimeout; - public CapWrapper ICAP_PATCHCODETIMEOUT - { - get - { - return _patchCodeTimeout ?? (_patchCodeTimeout = new CapWrapper(_twain, CAP.ICAP_PATCHCODETIMEOUT)); - } - } - - private CapWrapper _flashUsed2; - public CapWrapper ICAP_FLASHUSED2 - { - get - { - return _flashUsed2 ?? (_flashUsed2 = new CapWrapper(_twain, CAP.ICAP_FLASHUSED2)); - } - } - - private CapWrapper _imgFilter; - public CapWrapper ICAP_IMAGEFILTER - { - get - { - return _imgFilter ?? (_imgFilter = new CapWrapper(_twain, CAP.ICAP_IMAGEFILTER)); - } - } - - private CapWrapper _noiseFilter; - public CapWrapper ICAP_NOISEFILTER - { - get - { - return _noiseFilter ?? (_noiseFilter = new CapWrapper(_twain, CAP.ICAP_NOISEFILTER)); - } - } - - private CapWrapper _overscan; - public CapWrapper ICAP_OVERSCAN - { - get - { - return _overscan ?? (_overscan = new CapWrapper(_twain, CAP.ICAP_OVERSCAN)); - } - } - - private CapWrapper _borderDetect; - public CapWrapper ICAP_AUTOMATICBORDERDETECTION - { - get - { - return _borderDetect ?? (_borderDetect = new CapWrapper(_twain, CAP.ICAP_AUTOMATICBORDERDETECTION)); - - // this needs to also set undefined size optino - } - } - - private CapWrapper _autoDeskew; - public CapWrapper ICAP_AUTOMATICDESKEW - { - get - { - return _autoDeskew ?? (_autoDeskew = new CapWrapper(_twain, CAP.ICAP_AUTOMATICDESKEW)); - } - } - - private CapWrapper _autoRotate; - public CapWrapper ICAP_AUTOMATICROTATE - { - get - { - return _autoRotate ?? (_autoRotate = new CapWrapper(_twain, CAP.ICAP_AUTOMATICROTATE)); - } - } - - private CapWrapper _jpegQuality; - public CapWrapper ICAP_JPEGQUALITY - { - get - { - //TODO: verify - return _jpegQuality ?? (_jpegQuality = new CapWrapper(_twain, CAP.ICAP_JPEGQUALITY)); - } - } - - private CapWrapper _feederType; - public CapWrapper ICAP_FEEDERTYPE - { - get - { - return _feederType ?? (_feederType = new CapWrapper(_twain, CAP.ICAP_FEEDERTYPE)); - } - } - - private CapWrapper _iccProfile; - public CapWrapper ICAP_ICCPROFILE - { - get - { - return _iccProfile ?? (_iccProfile = new CapWrapper(_twain, CAP.ICAP_ICCPROFILE)); - } - } - - private CapWrapper _autoSize; - public CapWrapper ICAP_AUTOSIZE - { - get - { - return _autoSize ?? (_autoSize = new CapWrapper(_twain, CAP.ICAP_AUTOSIZE)); - } - } - - private CapWrapper _cropUseFrame; - public CapWrapper ICAP_AUTOMATICCROPUSESFRAME - { - get - { - return _cropUseFrame ?? (_cropUseFrame = new CapWrapper(_twain, CAP.ICAP_AUTOMATICCROPUSESFRAME)); - } - } - - private CapWrapper _lengthDetect; - public CapWrapper ICAP_AUTOMATICLENGTHDETECTION - { - get - { - return _lengthDetect ?? (_lengthDetect = new CapWrapper(_twain, CAP.ICAP_AUTOMATICLENGTHDETECTION)); - } - } - - private CapWrapper _autoColor; - public CapWrapper ICAP_AUTOMATICCOLORENABLED - { - get - { - return _autoColor ?? (_autoColor = new CapWrapper(_twain, CAP.ICAP_AUTOMATICCOLORENABLED)); - } - } - - private CapWrapper _autoColorNonPixel; - public CapWrapper ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE - { - get - { - return _autoColorNonPixel ?? (_autoColorNonPixel = new CapWrapper(_twain, CAP.ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE)); - } - } - - private CapWrapper _colorMgmt; - public CapWrapper ICAP_COLORMANAGEMENTENABLED - { - get - { - return _colorMgmt ?? (_colorMgmt = new CapWrapper(_twain, CAP.ICAP_COLORMANAGEMENTENABLED)); - } - } - - private CapWrapper _imgMerge; - public CapWrapper ICAP_IMAGEMERGE - { - get - { - return _imgMerge ?? (_imgMerge = new CapWrapper(_twain, CAP.ICAP_IMAGEMERGE)); - } - } - - private CapWrapper _mergeHeight; - public CapWrapper ICAP_IMAGEMERGEHEIGHTTHRESHOLD - { - get - { - return _mergeHeight ?? (_mergeHeight = new CapWrapper(_twain, CAP.ICAP_IMAGEMERGEHEIGHTTHRESHOLD)); - } - } - - private CapWrapper _supportedExtInfo; - public CapWrapper ICAP_SUPPORTEDEXTIMAGEINFO - { - get - { - return _supportedExtInfo ?? (_supportedExtInfo = new CapWrapper(_twain, CAP.ICAP_SUPPORTEDEXTIMAGEINFO)); - } - } - - private CapWrapper _filmType; - public CapWrapper ICAP_FILMTYPE - { - get - { - return _filmType ?? (_filmType = new CapWrapper(_twain, CAP.ICAP_FILMTYPE)); - } - } - - private CapWrapper _mirror; - public CapWrapper ICAP_MIRROR - { - get - { - return _mirror ?? (_mirror = new CapWrapper(_twain, CAP.ICAP_MIRROR)); - } - } - - private CapWrapper _jpegSubSampling; - public CapWrapper ICAP_JPEGSUBSAMPLING - { - get - { - return _jpegSubSampling ?? (_jpegSubSampling = new CapWrapper(_twain, CAP.ICAP_JPEGSUBSAMPLING)); - } - } - - #endregion - - #region general caps - - #region mandatory - - private CapWrapper _xferCount; - public CapWrapper CAP_XFERCOUNT - { - get - { - return _xferCount ?? (_xferCount = new CapWrapper(_twain, CAP.CAP_XFERCOUNT)); - } - } - - #endregion - - private CapWrapper _author; - public CapWrapper CAP_AUTHOR - { - get - { - return _author ?? (_author = new CapWrapper(_twain, CAP.CAP_AUTHOR)); - } - } - - - private CapWrapper _caption; - public CapWrapper CAP_CAPTION - { - get - { - return _caption ?? (_caption = new CapWrapper(_twain, CAP.CAP_CAPTION)); - } - } - - private CapWrapper _feederEnabled; - public CapWrapper CAP_FEEDERENABLED - { - get - { - return _feederEnabled ?? (_feederEnabled = new CapWrapper(_twain, CAP.CAP_FEEDERENABLED)); - //value => - // { - // var rc = ReturnCode.Failure; - - // var one = new TWOneValue - // { - // Item = (uint)value, - // ItemType = ItemType.Bool - // }; - - // using (TWCapability enabled = new TWCapability(CAP.CapFeederEnabled, one)) - // { - // rc = _source.DGControl.Capability.Set(enabled); - // } - - // // to really use feeder we must also set autofeed or autoscan, but only - // // for one of them since setting autoscan also sets autofeed - // if (CapAutoScan.CanSet) - // { - // rc = CapAutoScan.SetValue(value); - // } - // else if (CapAutoFeed.CanSet) - // { - // rc = CapAutoFeed.SetValue(value); - // } - - // return rc; - // })); - } - } - - private CapWrapper _feederLoaded; - public CapWrapper CAP_FEEDERLOADED - { - get - { - return _feederLoaded ?? (_feederLoaded = new CapWrapper(_twain, CAP.CAP_FEEDERLOADED)); - } - } - - private CapWrapper _timedate; - public CapWrapper CAP_TIMEDATE - { - get - { - return _timedate ?? (_timedate = new CapWrapper(_twain, CAP.CAP_TIMEDATE)); - } - } - - private CapWrapper _supportedCaps; - - /// - /// Gets the supported caps for the current source. This is not supported by all sources. - /// - /// - /// The supported caps. - /// - public CapWrapper CAP_SUPPORTEDCAPS - { - get - { - return _supportedCaps ?? (_supportedCaps = new CapWrapper(_twain, CAP.CAP_SUPPORTEDCAPS)); - } - } - - private CapWrapper _extendedCaps; - - /// - /// Gets the extended caps for the current source. - /// - /// - /// The extended caps. - /// - public CapWrapper CAP_EXTENDEDCAPS - { - get - { - return _extendedCaps ?? (_extendedCaps = new CapWrapper(_twain, CAP.CAP_EXTENDEDCAPS)); - } - } - - private CapWrapper _autoFeed; - public CapWrapper CAP_AUTOFEED - { - get - { - return _autoFeed ?? (_autoFeed = new CapWrapper(_twain, CAP.CAP_AUTOFEED)); - } - } - - private CapWrapper _clearPage; - public CapWrapper CAP_CLEARPAGE - { - get - { - return _clearPage ?? (_clearPage = new CapWrapper(_twain, CAP.CAP_CLEARPAGE)); - } - } - - private CapWrapper _feedPage; - public CapWrapper CAP_FEEDPAGE - { - get - { - return _feedPage ?? (_feedPage = new CapWrapper(_twain, CAP.CAP_FEEDPAGE)); - } - } - - private CapWrapper _rewindPage; - public CapWrapper CAP_REWINDPAGE - { - get - { - return _rewindPage ?? (_rewindPage = new CapWrapper(_twain, CAP.CAP_REWINDPAGE)); - } - } - - private CapWrapper _indicators; - public CapWrapper CAP_INDICATORS - { - get - { - return _indicators ?? (_indicators = new CapWrapper(_twain, CAP.CAP_INDICATORS)); - } - } - - private CapWrapper _paperDetectable; - public CapWrapper CAP_PAPERDETECTABLE - { - get - { - return _paperDetectable ?? (_paperDetectable = new CapWrapper(_twain, CAP.CAP_PAPERDETECTABLE)); - } - } - - private CapWrapper _uiControllable; - public CapWrapper CAP_UICONTROLLABLE - { - get - { - return _uiControllable ?? (_uiControllable = new CapWrapper(_twain, CAP.CAP_UICONTROLLABLE)); - } - } - - private CapWrapper _devOnline; - public CapWrapper CAP_DEVICEONLINE - { - get - { - return _devOnline ?? (_devOnline = new CapWrapper(_twain, CAP.CAP_DEVICEONLINE)); - } - } - - private CapWrapper _autoScan; - public CapWrapper CAP_AUTOSCAN - { - get - { - return _autoScan ?? (_autoScan = new CapWrapper(_twain, CAP.CAP_AUTOSCAN)); - } - } - - private CapWrapper _thumbsEnabled; - public CapWrapper CAP_THUMBNAILSENABLED - { - get - { - return _thumbsEnabled ?? (_thumbsEnabled = new CapWrapper(_twain, CAP.CAP_THUMBNAILSENABLED)); - } - } - - private CapWrapper _duplex; - public CapWrapper CAP_DUPLEX - { - get - { - return _duplex ?? (_duplex = new CapWrapper(_twain, CAP.CAP_DUPLEX)); - } - } - - private CapWrapper _duplexEnabled; - public CapWrapper CAP_DUPLEXENABLED - { - get - { - return _duplexEnabled ?? (_duplexEnabled = new CapWrapper(_twain, CAP.CAP_DUPLEXENABLED)); - } - } - - private CapWrapper _dsUIonly; - - /// - /// Gets the property to see whether device supports UI only flag (no transfer). - /// - /// - /// The UI only flag. - /// - public CapWrapper CAP_ENABLEDSUIONLY - { - get - { - return _dsUIonly ?? (_dsUIonly = new CapWrapper(_twain, CAP.CAP_ENABLEDSUIONLY)); - } - } - - private CapWrapper _dsData; - - /// - /// Gets the property to see whether device supports custom data triplets. - /// - /// - /// The custom data flag. - /// - public CapWrapper CAP_CUSTOMDSDATA - { - get - { - return _dsData ?? (_dsData = new CapWrapper(_twain, CAP.CAP_CUSTOMDSDATA)); - } - } - - private CapWrapper _endorser; - public CapWrapper CAP_ENDORSER - { - get - { - return _endorser ?? (_endorser = new CapWrapper(_twain, CAP.CAP_ENDORSER)); - } - } - - private CapWrapper _jobControl; - public CapWrapper CAP_JOBCONTROL - { - get - { - return _jobControl ?? (_jobControl = new CapWrapper(_twain, CAP.CAP_JOBCONTROL)); - } - } - - private CapWrapper _alarms; - public CapWrapper CAP_ALARMS - { - get - { - return _alarms ?? (_alarms = new CapWrapper(_twain, CAP.CAP_ALARMS)); - } - } - - private CapWrapper _alarmVolume; - public CapWrapper CAP_ALARMVOLUME - { - get - { - return _alarmVolume ?? (_alarmVolume = new CapWrapper(_twain, CAP.CAP_ALARMVOLUME)); - } - } - - private CapWrapper _autoCapture; - public CapWrapper CAP_AUTOMATICCAPTURE - { - get - { - return _autoCapture ?? (_autoCapture = new CapWrapper(_twain, CAP.CAP_AUTOMATICCAPTURE)); - } - } - - private CapWrapper _timeBeforeCap; - - /// - /// Gets the property to work with the time before first capture (milliseconds) for the current source. - /// - /// - /// The time before first capture. - /// - public CapWrapper CAP_TIMEBEFOREFIRSTCAPTURE - { - get - { - return _timeBeforeCap ?? (_timeBeforeCap = new CapWrapper(_twain, CAP.CAP_TIMEBEFOREFIRSTCAPTURE)); - } - } - - private CapWrapper _timeBetweenCap; - - /// - /// Gets the property to work with the time between captures (milliseconds) for the current source. - /// - /// - /// The time between captures. - /// - public CapWrapper CAP_TIMEBETWEENCAPTURES - { - get - { - return _timeBetweenCap ?? (_timeBetweenCap = new CapWrapper(_twain, CAP.CAP_TIMEBETWEENCAPTURES)); - } - } - - // deprecated - //private CapWrapper _clearBuff; - //public CapWrapper CAP_CLEARBUFFERS - //{ - // get - // { - // return _clearBuff ?? (_clearBuff = new CapWrapper(_twain, CAP.CAP_CLEARBUFFERS)); - // } - //} - - private CapWrapper _maxBatchBuff; - - /// - /// Gets the property to work with the max buffered pages for the current source. - /// - /// - /// The max batch buffered pages. - /// - public CapWrapper CAP_MAXBATCHBUFFERS - { - get - { - return _maxBatchBuff ?? (_maxBatchBuff = new CapWrapper(_twain, CAP.CAP_MAXBATCHBUFFERS)); - } - } - - private CapWrapper _devTimeDate; - public CapWrapper CAP_DEVICETIMEDATE - { - get - { - return _devTimeDate ?? (_devTimeDate = new CapWrapper(_twain, CAP.CAP_DEVICETIMEDATE)); - } - } - - private CapWrapper _powerSup; - public CapWrapper CAP_POWERSUPPLY - { - get - { - return _powerSup ?? (_powerSup = new CapWrapper(_twain, CAP.CAP_POWERSUPPLY)); - } - } - - private CapWrapper _camPreviewUI; - public CapWrapper CAP_CAMERAPREVIEWUI - { - get - { - return _camPreviewUI ?? (_camPreviewUI = new CapWrapper(_twain, CAP.CAP_CAMERAPREVIEWUI)); - } - } - - private CapWrapper _devEvent; - - /// - /// Gets the property to work with the reported device events for the current source. - /// - /// - /// The reported device events. - /// - public CapWrapper CAP_DEVICEEVENT - { - get - { - return _devEvent ?? (_devEvent = new CapWrapper(_twain, CAP.CAP_DEVICEEVENT)); - } - } - - private CapWrapper _serialNo; - public CapWrapper CAP_SERIALNUMBER - { - get - { - return _serialNo ?? (_serialNo = new CapWrapper(_twain, CAP.CAP_SERIALNUMBER)); - } - } - - private CapWrapper _printer; - public CapWrapper CAP_PRINTER - { - get - { - return _printer ?? (_printer = new CapWrapper(_twain, CAP.CAP_PRINTER)); - } - } - - private CapWrapper _printerEnabled; - public CapWrapper CAP_PRINTERENABLED - { - get - { - return _printerEnabled ?? (_printerEnabled = new CapWrapper(_twain, CAP.CAP_PRINTERENABLED)); - } - } - - private CapWrapper _printerIndex; - public CapWrapper CAP_PRINTERINDEX - { - get - { - return _printerIndex ?? (_printerIndex = new CapWrapper(_twain, CAP.CAP_PRINTERINDEX)); - } - } - - private CapWrapper _printerMode; - public CapWrapper CAP_PRINTERMODE - { - get - { - return _printerMode ?? (_printerMode = new CapWrapper(_twain, CAP.CAP_PRINTERMODE)); - } - } - - private CapWrapper _printerString; - public CapWrapper CAP_PRINTERSTRING - { - get - { - return _printerString ?? (_printerString = new CapWrapper(_twain, CAP.CAP_PRINTERSTRING)); - } - } - - private CapWrapper _printerSuffix; - public CapWrapper CAP_PRINTERSUFFIX - { - get - { - return _printerSuffix ?? (_printerSuffix = new CapWrapper(_twain, CAP.CAP_PRINTERSUFFIX)); - } - } - - private CapWrapper _language; - public CapWrapper CAP_LANGUAGE - { - get - { - return _language ?? (_language = new CapWrapper(_twain, CAP.CAP_LANGUAGE)); - } - } - - private CapWrapper _feedAlign; - public CapWrapper CAP_FEEDERALIGNMENT - { - get - { - return _feedAlign ?? (_feedAlign = new CapWrapper(_twain, CAP.CAP_FEEDERALIGNMENT)); - } - } - - private CapWrapper _feedOrder; - public CapWrapper CAP_FEEDERORDER - { - get - { - return _feedOrder ?? (_feedOrder = new CapWrapper(_twain, CAP.CAP_FEEDERORDER)); - } - } - - private CapWrapper _reacuireAllow; - public CapWrapper CAP_REACQUIREALLOWED - { - get - { - return _reacuireAllow ?? (_reacuireAllow = new CapWrapper(_twain, CAP.CAP_REACQUIREALLOWED)); - } - } - - private CapWrapper _battMinutes; - public CapWrapper CAP_BATTERYMINUTES - { - get - { - return _battMinutes ?? (_battMinutes = new CapWrapper(_twain, CAP.CAP_BATTERYMINUTES)); - } - } - - private CapWrapper _battPercent; - public CapWrapper CAP_BATTERYPERCENTAGE - { - get - { - return _battPercent ?? (_battPercent = new CapWrapper(_twain, CAP.CAP_BATTERYPERCENTAGE)); - } - } - - private CapWrapper _camSide; - public CapWrapper CAP_CAMERASIDE - { - get - { - return _camSide ?? (_camSide = new CapWrapper(_twain, CAP.CAP_CAMERASIDE)); - } - } - - private CapWrapper _segmented; - public CapWrapper CAP_SEGMENTED - { - get - { - return _segmented ?? (_segmented = new CapWrapper(_twain, CAP.CAP_SEGMENTED)); - } - } - - private CapWrapper _camEnabled; - public CapWrapper CAP_CAMERAENABLED - { - get - { - return _camEnabled ?? (_camEnabled = new CapWrapper(_twain, CAP.CAP_CAMERAENABLED)); - } - } - - private CapWrapper _camOrder; - public CapWrapper CAP_CAMERAORDER - { - get - { - return _camOrder ?? (_camOrder = new CapWrapper(_twain, CAP.CAP_CAMERAORDER)); - } - } - - private CapWrapper _micrEnabled; - public CapWrapper CAP_MICRENABLED - { - get - { - return _micrEnabled ?? (_micrEnabled = new CapWrapper(_twain, CAP.CAP_MICRENABLED)); - } - } - - private CapWrapper _feederPrep; - public CapWrapper CAP_FEEDERPREP - { - get - { - return _feederPrep ?? (_feederPrep = new CapWrapper(_twain, CAP.CAP_FEEDERPREP)); - } - } - - private CapWrapper _feedPocket; - public CapWrapper CAP_FEEDERPOCKET - { - get - { - return _feedPocket ?? (_feedPocket = new CapWrapper(_twain, CAP.CAP_FEEDERPOCKET)); - } - } - - private CapWrapper _autoMedium; - public CapWrapper CAP_AUTOMATICSENSEMEDIUM - { - get - { - return _autoMedium ?? (_autoMedium = new CapWrapper(_twain, CAP.CAP_AUTOMATICSENSEMEDIUM)); - } - } - - private CapWrapper _custGuid; - public CapWrapper CAP_CUSTOMINTERFACEGUID - { - get - { - return _custGuid ?? (_custGuid = new CapWrapper(_twain, CAP.CAP_CUSTOMINTERFACEGUID)); - } - } - - private CapWrapper _supportedCapsUnique; - public CapWrapper CAP_SUPPORTEDCAPSSEGMENTUNIQUE - { - get - { - return _supportedCapsUnique ?? (_supportedCapsUnique = new CapWrapper(_twain, CAP.CAP_SUPPORTEDCAPSSEGMENTUNIQUE)); - } - } - - private CapWrapper _supportedDat; - public CapWrapper CAP_SUPPORTEDDATS - { - get - { - return _supportedDat ?? (_supportedDat = new CapWrapper(_twain, CAP.CAP_SUPPORTEDDATS)); - } - } - - private CapWrapper _dblFeedDetect; - public CapWrapper CAP_DOUBLEFEEDDETECTION - { - get - { - return _dblFeedDetect ?? (_dblFeedDetect = new CapWrapper(_twain, CAP.CAP_DOUBLEFEEDDETECTION)); - } - } - - private CapWrapper _dblFeedLength; - public CapWrapper CAP_DOUBLEFEEDDETECTIONLENGTH - { - get - { - return _dblFeedLength ?? (_dblFeedLength = new CapWrapper(_twain, CAP.CAP_DOUBLEFEEDDETECTIONLENGTH)); - } - } - - private CapWrapper _dblFeedSensitivity; - public CapWrapper CAP_DOUBLEFEEDDETECTIONSENSITIVITY - { - get - { - return _dblFeedSensitivity ?? (_dblFeedSensitivity = new CapWrapper(_twain, CAP.CAP_DOUBLEFEEDDETECTIONSENSITIVITY)); - } - } - - private CapWrapper _dblFeedResp; - public CapWrapper CAP_DOUBLEFEEDDETECTIONRESPONSE - { - get - { - return _dblFeedResp ?? (_dblFeedResp = new CapWrapper(_twain, CAP.CAP_DOUBLEFEEDDETECTIONRESPONSE)); - } - } - - private CapWrapper _paperHandling; - public CapWrapper CAP_PAPERHANDLING - { - get - { - return _paperHandling ?? (_paperHandling = new CapWrapper(_twain, CAP.CAP_PAPERHANDLING)); - } - } - - private CapWrapper _indicatorMode; - public CapWrapper CAP_INDICATORSMODE - { - get - { - return _indicatorMode ?? (_indicatorMode = new CapWrapper(_twain, CAP.CAP_INDICATORSMODE)); - } - } - - private CapWrapper _printVOffset; - public CapWrapper CAP_PRINTERVERTICALOFFSET - { - get - { - return _printVOffset ?? (_printVOffset = new CapWrapper(_twain, CAP.CAP_PRINTERVERTICALOFFSET)); - } - } - - private CapWrapper _powerSaveTime; - - /// - /// Gets the property to work with camera power down time (seconds) for the current source. - /// - /// - /// The camera power down time. - /// - public CapWrapper CAP_POWERSAVETIME - { - get - { - return _powerSaveTime ?? (_powerSaveTime = new CapWrapper(_twain, CAP.CAP_POWERSAVETIME)); - } - } - - private CapWrapper _printCharRot; - public CapWrapper CAP_PRINTERCHARROTATION - { - get - { - return _printCharRot ?? (_printCharRot = new CapWrapper(_twain, CAP.CAP_PRINTERCHARROTATION)); - } - } - - private CapWrapper _printFontStyle; - public CapWrapper CAP_PRINTERFONTSTYLE - { - get - { - return _printFontStyle ?? (_printFontStyle = new CapWrapper(_twain, CAP.CAP_PRINTERFONTSTYLE)); - } - } - - private CapWrapper _printerIdxLeadChar; - - /// - /// Set the character to be used for filling the leading digits before the counter value if the - /// counter digits are fewer than . - /// - /// - /// The printer leading string. - /// - public CapWrapper CAP_PRINTERINDEXLEADCHAR - { - get - { - return _printerIdxLeadChar ?? (_printerIdxLeadChar = new CapWrapper(_twain, CAP.CAP_PRINTERINDEXLEADCHAR)); - } - } - - private CapWrapper _printIdxMax; - public CapWrapper CAP_PRINTERINDEXMAXVALUE - { - get - { - return _printIdxMax ?? (_printIdxMax = new CapWrapper(_twain, CAP.CAP_PRINTERINDEXMAXVALUE)); - } - } - - private CapWrapper _printNumDigit; - public CapWrapper CAP_PRINTERINDEXNUMDIGITS - { - get - { - return _printNumDigit ?? (_printNumDigit = new CapWrapper(_twain, CAP.CAP_PRINTERINDEXNUMDIGITS)); - } - } - - private CapWrapper _printIdxStep; - public CapWrapper CAP_PRINTERINDEXSTEP - { - get - { - return _printIdxStep ?? (_printIdxStep = new CapWrapper(_twain, CAP.CAP_PRINTERINDEXSTEP)); - } - } - - private CapWrapper _printIdxTrig; - public CapWrapper CAP_PRINTERINDEXTRIGGER - { - get - { - return _printIdxTrig ?? (_printIdxTrig = new CapWrapper(_twain, CAP.CAP_PRINTERINDEXTRIGGER)); - } - } - - private CapWrapper _printPreview; - public CapWrapper CAP_PRINTERSTRINGPREVIEW - { - get - { - return _printPreview ?? (_printPreview = new CapWrapper(_twain, CAP.CAP_PRINTERSTRINGPREVIEW)); - } - } - - private CapWrapper _sheetCount; - public CapWrapper CAP_SHEETCOUNT - { - get - { - return _sheetCount ?? (_sheetCount = new CapWrapper(_twain, CAP.CAP_SHEETCOUNT)); - } - } - - - #endregion - } -} diff --git a/src/NTwain-temp/EmptyArray.cs b/src/NTwain-temp/EmptyArray.cs deleted file mode 100644 index 45b7fb1..0000000 --- a/src/NTwain-temp/EmptyArray.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace NTwain -{ - static class EmptyArray - { - public static readonly T[] Value = new T[0]; - } -} diff --git a/src/NTwain-temp/ExtensionMethods.cs b/src/NTwain-temp/ExtensionMethods.cs deleted file mode 100644 index 94662d3..0000000 --- a/src/NTwain-temp/ExtensionMethods.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TWAINWorkingGroup; - -namespace NTwain -{ - /// - /// Some utility extension methods. - /// - static class ExtensionMethods - { - - } -} diff --git a/src/NTwain-temp/Extensions/TWAINH_EXTRAS.cs b/src/NTwain-temp/Extensions/TWAINH_EXTRAS.cs deleted file mode 100644 index 840f367..0000000 --- a/src/NTwain-temp/Extensions/TWAINH_EXTRAS.cs +++ /dev/null @@ -1,459 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using static TWAINWorkingGroup.TWAIN; - -namespace TWAINWorkingGroup -{ - // this contains my additions under the TWAINWorkingGroup namespace - // that makes some twain types easier to work with. - - /// - /// TWAIN's boolean values. - /// - public enum BoolType : ushort - { - /// - /// The false value (0). - /// - False = 0, - /// - /// The true value (1). - /// - True = 1 - } - - /// - /// A more dotnet-friendly representation of . - /// - public struct Metrics - { - /// - /// Return code of querying the metrics. - /// - public STS ReturnCode; - - /// - /// The number of sheets of paper processed by the scanner. - /// - public int Sheets; - - /// - /// The number of images made available for transfer by the driver. This is not - /// necessarily the same as the number of images actually transferred, since the - /// application may opt to skip transfers or to end without transferring all images. - /// - public int Images; - } - - public struct TwainDirectTaskResult - { - /// - /// Return code of task. - /// - public STS ReturnCode; - - /// - /// The response of the task in JSON if successful. - /// - public string ResponseJson; - } - - /// - /// A more dotnet-friendly representation of . - /// - /// - public class Enumeration where TValue : struct - { - public int CurrentIndex; - - public int DefaultIndex; - - public TValue[] Items; - } - - /// - /// A more dotnet-friendly representation of . - /// - /// - public partial class Range : IEnumerable where TValue : struct - { - public TValue MinValue; - public TValue MaxValue; - public TValue StepSize; - public TValue DefaultValue; - public TValue CurrentValue; - - IEnumerator IEnumerable.GetEnumerator() - { - if (!(MinValue is IConvertible)) - throw new NotSupportedException($"The value type {typeof(TValue).Name} is not supported for range enumeration."); - - return new DynamicEnumerator(MinValue, MaxValue, StepSize); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return ((IEnumerable)this).GetEnumerator(); - } - - // dynamic is a cheap hack to sidestep the compiler restrictions if I know TValue is numeric - class DynamicEnumerator : IEnumerator - { - private readonly TValue _min; - private readonly TValue _max; - private readonly TValue _step; - private TValue _cur; - bool started = false; - - public DynamicEnumerator(TValue min, TValue max, TValue step) - { - _min = min; - _max = max; - _step = step; - _cur = min; - } - - public TValue Current => _cur; - - object IEnumerator.Current => this.Current; - - public void Dispose() { } - - public bool MoveNext() - { - if (!started) - { - started = true; - return true; - } - - var next = _cur + (dynamic)_step; - if (next == _cur || next < _min || next > _max) return false; - - _cur = next; - return true; - } - - public void Reset() - { - _cur = _min; - started = false; - } - } - } - - partial class TWAIN - { - partial struct TW_FIX32 : IEquatable, IConvertible - { - // the conversion logic is found in the spec. - - float ToFloat() - { - return Whole + Frac / 65536f; - } - double ToDouble() - { - return Whole + Frac / 65536.0; - } - public TW_FIX32(double value) - { - Whole = (short)value; - Frac = (ushort)((value - Whole) * 65536.0); - } - public TW_FIX32(float value) - { - //int temp = (int)(value * 65536.0 + 0.5); - //Whole = (short)(temp >> 16); - //Fraction = (ushort)(temp & 0x0000ffff); - - // different version from twain faq - bool sign = value < 0; - int temp = (int)(value * 65536.0 + (sign ? (-0.5) : 0.5)); - Whole = (short)(temp >> 16); - Frac = (ushort)(temp & 0x0000ffff); - } - - public override string ToString() - { - return ToFloat().ToString(); - } - - public bool Equals(TW_FIX32 other) - { - return Whole == other.Whole && Frac == other.Frac; - } - public override bool Equals(object obj) - { - if (obj is TW_FIX32 other) - { - return Equals(other); - } - return false; - } - public override int GetHashCode() - { - return Whole ^ Frac; - } - - - #region IConvertable - - TypeCode IConvertible.GetTypeCode() - { - return TypeCode.Single; - } - - bool IConvertible.ToBoolean(IFormatProvider provider) - { - return this != 0; - } - - byte IConvertible.ToByte(IFormatProvider provider) - { - return Convert.ToByte((float)this); - } - - char IConvertible.ToChar(IFormatProvider provider) - { - return Convert.ToChar((float)this); - } - - DateTime IConvertible.ToDateTime(IFormatProvider provider) - { - return Convert.ToDateTime((float)this); - } - - decimal IConvertible.ToDecimal(IFormatProvider provider) - { - return Convert.ToDecimal((float)this); - } - - double IConvertible.ToDouble(IFormatProvider provider) - { - return Convert.ToDouble((float)this); - } - - short IConvertible.ToInt16(IFormatProvider provider) - { - return Convert.ToInt16((float)this); - } - - int IConvertible.ToInt32(IFormatProvider provider) - { - return Convert.ToInt32((float)this); - } - - long IConvertible.ToInt64(IFormatProvider provider) - { - return Convert.ToInt64((float)this); - } - - sbyte IConvertible.ToSByte(IFormatProvider provider) - { - return Convert.ToSByte((float)this); - } - - float IConvertible.ToSingle(IFormatProvider provider) - { - return Convert.ToSingle((float)this); - } - - string IConvertible.ToString(IFormatProvider provider) - { - return this.ToString(); - } - - object IConvertible.ToType(Type conversionType, IFormatProvider provider) - { - return Convert.ChangeType((float)this, conversionType, CultureInfo.InvariantCulture); - } - - ushort IConvertible.ToUInt16(IFormatProvider provider) - { - return Convert.ToUInt16((float)this); - } - - uint IConvertible.ToUInt32(IFormatProvider provider) - { - return Convert.ToUInt32((float)this); - } - - ulong IConvertible.ToUInt64(IFormatProvider provider) - { - return Convert.ToUInt64((float)this); - } - - #endregion - - public static implicit operator float(TW_FIX32 value) => value.ToFloat(); - public static implicit operator TW_FIX32(float value) => new TW_FIX32(value); - - public static implicit operator double(TW_FIX32 value) => value.ToDouble(); - public static implicit operator TW_FIX32(double value) => new TW_FIX32((float)value); - - public static bool operator ==(TW_FIX32 value1, TW_FIX32 value2) => value1.Equals(value2); - public static bool operator !=(TW_FIX32 value1, TW_FIX32 value2) => !value1.Equals(value2); - } - - partial struct TW_FRAME : IEquatable - { - /// - /// Creates from a string representation of it. - /// - /// - public TW_FRAME(string value) : this() - { - var parts = value.Split(','); - if (parts.Length == 4) - { - Left = float.Parse(parts[0]); - Top = float.Parse(parts[1]); - Right = float.Parse(parts[2]); - Bottom = float.Parse(parts[3]); - } - else - { - throw new ArgumentException($"Cannot create frame from \"{value}\"."); - } - } - - /// - /// String representation of Left,Top,Right,Bottom. - /// - /// - public override string ToString() - { - return $"{Left},{Top},{Right},{Bottom}"; - } - - public bool Equals(TW_FRAME other) - { - return Left == other.Left && Top == other.Top && - Right == other.Right && Bottom == other.Bottom; - } - - public override bool Equals(object obj) - { - if (obj is TW_FRAME other) - { - return Equals(other); - } - return false; - } - - public override int GetHashCode() - { - return Left.GetHashCode() ^ Top.GetHashCode() ^ - Right.GetHashCode() ^ Bottom.GetHashCode(); - } - - - public static bool operator ==(TW_FRAME value1, TW_FRAME value2) - { - return value1.Equals(value2); - } - public static bool operator !=(TW_FRAME value1, TW_FRAME value2) - { - return !value1.Equals(value2); - } - } - - partial struct TW_STR32 - { - public const int Size = 34; - - public TW_STR32(string value) : this() - { - Set(value); - } - - public override string ToString() - { - return Get(); - } - - public static implicit operator string(TW_STR32 value) => value.ToString(); - public static explicit operator TW_STR32(string value) => new TW_STR32(value); - - } - - partial struct TW_STR64 - { - public const int Size = 66; - - public TW_STR64(string value) : this() - { - Set(value); - } - - public override string ToString() - { - return Get(); - } - - public static implicit operator string(TW_STR64 value) => value.ToString(); - public static explicit operator TW_STR64(string value) => new TW_STR64(value); - } - - partial struct TW_STR128 - { - public const int Size = 130; - - public TW_STR128(string value) : this() - { - Set(value); - } - - public override string ToString() - { - return Get(); - } - - public static implicit operator string(TW_STR128 value) => value.ToString(); - public static explicit operator TW_STR128(string value) => new TW_STR128(value); - } - - partial struct TW_STR255 - { - public const int Size = 256; - - public TW_STR255(string value) : this() - { - Set(value); - } - - public override string ToString() - { - return Get(); - } - - public static implicit operator string(TW_STR255 value) => value.ToString(); - public static explicit operator TW_STR255(string value) => new TW_STR255(value); - } - - partial struct TW_IDENTITY - { - public override string ToString() - { - return $"{Manufacturer} - {ProductName} {Version} (TWAIN {ProtocolMajor}.{ProtocolMinor})"; - } - } - - partial struct TW_VERSION - { - public override string ToString() - { - return $"{MajorNum}.{MinorNum}"; - } - } - - //partial struct TW_DEVICEEVENT - //{ - // public TWDE Event { get { return (TWDE)_event; } } - // public TWFL FlashUsed2 { get { return (TWFL)_flashUsed2; } } - //} - } -} diff --git a/src/NTwain-temp/NTwain-temp.csproj b/src/NTwain-temp/NTwain-temp.csproj deleted file mode 100644 index c298faf..0000000 --- a/src/NTwain-temp/NTwain-temp.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - NTwain - Library containing the TWAIN API for dotnet. - net462;net6.0;net7.0;netstandard2.0 - true - 11 - - - - - - - - - - diff --git a/src/NTwain-temp/TWAINWorkingGroup/README.md b/src/NTwain-temp/TWAINWorkingGroup/README.md deleted file mode 100644 index ccf8110..0000000 --- a/src/NTwain-temp/TWAINWorkingGroup/README.md +++ /dev/null @@ -1,4 +0,0 @@ -This namespace contains types and utilities from the [twaincs project](https://github.com/twain/twain-cs) -that's been modified with partials. - -Version initially used is 2.5.0.0. diff --git a/src/NTwain-temp/TWAINWorkingGroup/TWAIN CS.rtf b/src/NTwain-temp/TWAINWorkingGroup/TWAIN CS.rtf deleted file mode 100644 index eb6e34d..0000000 --- a/src/NTwain-temp/TWAINWorkingGroup/TWAIN CS.rtf +++ /dev/null @@ -1,1621 +0,0 @@ -{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff45\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};} -{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial{\*\falt Arial};}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New{\*\falt Courier New};} -{\f3\fbidi \froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f4\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Helvetica;}{\f5\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070409020205020404}Courier{\*\falt Courier New};} -{\f10\fbidi \fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;} -{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri{\*\falt Century Gothic};}{\f43\fbidi \froman\fcharset0\fprq2{\*\panose 00000000000000000000}Cambria{\*\falt Palatino Linotype};} -{\f44\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Tahoma;}{\f45\fbidi \froman\fcharset0\fprq2{\*\panose 00000000000000000000}Book Antiqua{\*\falt Book Antiqua};} -{\f46\fbidi \froman\fcharset0\fprq0{\*\panose 00000000000000000000}BookAntiqua{\*\falt Book Antiqua};}{\f47\fbidi \froman\fcharset0\fprq2{\*\panose 00000000000000000000}MS Serif;} -{\f48\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Geneva{\*\falt Arial};}{\f49\fbidi \fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Courier Std;}{\f50\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;} -{\f51\fbidi \froman\fcharset0\fprq0{\*\panose 00000000000000000000}CourierNewPSMT;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};} -{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 00000000000000000000}Cambria{\*\falt Palatino Linotype};} -{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};} -{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri{\*\falt Century Gothic};} -{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times New Roman};}{\f53\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};} -{\f54\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};}{\f56\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\f57\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};} -{\f58\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\f59\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};} -{\f60\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\f61\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}{\f63\fbidi \fswiss\fcharset238\fprq2 Arial CE{\*\falt Arial};} -{\f64\fbidi \fswiss\fcharset204\fprq2 Arial Cyr{\*\falt Arial};}{\f66\fbidi \fswiss\fcharset161\fprq2 Arial Greek{\*\falt Arial};}{\f67\fbidi \fswiss\fcharset162\fprq2 Arial Tur{\*\falt Arial};} -{\f68\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew){\*\falt Arial};}{\f69\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic){\*\falt Arial};}{\f70\fbidi \fswiss\fcharset186\fprq2 Arial Baltic{\*\falt Arial};} -{\f71\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese){\*\falt Arial};}{\f73\fbidi \fmodern\fcharset238\fprq1 Courier New CE{\*\falt Courier New};}{\f74\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr{\*\falt Courier New};} -{\f76\fbidi \fmodern\fcharset161\fprq1 Courier New Greek{\*\falt Courier New};}{\f77\fbidi \fmodern\fcharset162\fprq1 Courier New Tur{\*\falt Courier New};}{\f78\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew){\*\falt Courier New};} -{\f79\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic){\*\falt Courier New};}{\f80\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic{\*\falt Courier New};}{\f81\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese){\*\falt Courier New};} -{\f93\fbidi \fswiss\fcharset238\fprq2 Helvetica CE;}{\f94\fbidi \fswiss\fcharset204\fprq2 Helvetica Cyr;}{\f96\fbidi \fswiss\fcharset161\fprq2 Helvetica Greek;}{\f97\fbidi \fswiss\fcharset162\fprq2 Helvetica Tur;} -{\f98\fbidi \fswiss\fcharset177\fprq2 Helvetica (Hebrew);}{\f99\fbidi \fswiss\fcharset178\fprq2 Helvetica (Arabic);}{\f100\fbidi \fswiss\fcharset186\fprq2 Helvetica Baltic;}{\f101\fbidi \fswiss\fcharset163\fprq2 Helvetica (Vietnamese);} -{\f393\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f394\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f396\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f397\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;} -{\f400\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f401\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f423\fbidi \fswiss\fcharset238\fprq2 Calibri CE{\*\falt Century Gothic};} -{\f424\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr{\*\falt Century Gothic};}{\f426\fbidi \fswiss\fcharset161\fprq2 Calibri Greek{\*\falt Century Gothic};}{\f427\fbidi \fswiss\fcharset162\fprq2 Calibri Tur{\*\falt Century Gothic};} -{\f428\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew){\*\falt Century Gothic};}{\f429\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic){\*\falt Century Gothic};}{\f430\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic{\*\falt Century Gothic};} -{\f431\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese){\*\falt Century Gothic};}{\f483\fbidi \froman\fcharset238\fprq2 Cambria CE{\*\falt Palatino Linotype};}{\f484\fbidi \froman\fcharset204\fprq2 Cambria Cyr{\*\falt Palatino Linotype};} -{\f486\fbidi \froman\fcharset161\fprq2 Cambria Greek{\*\falt Palatino Linotype};}{\f487\fbidi \froman\fcharset162\fprq2 Cambria Tur{\*\falt Palatino Linotype};}{\f490\fbidi \froman\fcharset186\fprq2 Cambria Baltic{\*\falt Palatino Linotype};} -{\f491\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese){\*\falt Palatino Linotype};}{\f493\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f494\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f496\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;} -{\f497\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f498\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f499\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f500\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;} -{\f501\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f502\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f503\fbidi \froman\fcharset238\fprq2 Book Antiqua CE{\*\falt Book Antiqua};} -{\f504\fbidi \froman\fcharset204\fprq2 Book Antiqua Cyr{\*\falt Book Antiqua};}{\f506\fbidi \froman\fcharset161\fprq2 Book Antiqua Greek{\*\falt Book Antiqua};}{\f507\fbidi \froman\fcharset162\fprq2 Book Antiqua Tur{\*\falt Book Antiqua};} -{\f510\fbidi \froman\fcharset186\fprq2 Book Antiqua Baltic{\*\falt Book Antiqua};}{\f553\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f554\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}{\f556\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;} -{\f557\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f560\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f561\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);} -{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};} -{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};} -{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};} -{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};} -{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};} -{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};} -{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};} -{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};} -{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE{\*\falt Palatino Linotype};}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr{\*\falt Palatino Linotype};} -{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek{\*\falt Palatino Linotype};}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur{\*\falt Palatino Linotype};} -{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic{\*\falt Palatino Linotype};}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese){\*\falt Palatino Linotype};} -{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};} -{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};} -{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};} -{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};} -{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};} -{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};} -{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};} -{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};} -{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};} -{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};} -{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};} -{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};} -{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE{\*\falt Century Gothic};}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr{\*\falt Century Gothic};} -{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek{\*\falt Century Gothic};}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur{\*\falt Century Gothic};} -{\fhiminor\f31573\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew){\*\falt Century Gothic};}{\fhiminor\f31574\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic){\*\falt Century Gothic};} -{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic{\*\falt Century Gothic};}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese){\*\falt Century Gothic};} -{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New Roman};}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times New Roman};} -{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New Roman};}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New Roman};} -{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times New Roman};}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times New Roman};} -{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times New Roman};}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times New Roman};}}{\colortbl;\red0\green0\blue0; -\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128; -\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red0\green0\blue0;\red0\green0\blue0;\cfollowedhyperlink\ctint255\cshade255\red128\green0\blue128;\red96\green94\blue92;\red225\green223\blue221; -\red31\green73\blue125;\red0\green176\blue80;}{\*\defchp \fs22 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{ -\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{ -\s1\ql \li0\ri0\sb720\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp120 \wrapdefault\nooverflow\faroman\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \ab\af1\afs36\alang1025 \ltrch\fcs0 \b\f1\fs36\cf9\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 -\sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li720\ri0\sb360\keepn\widctlpar\wrapdefault\nooverflow\faroman\outlinelevel1\rin0\lin720\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 -\b\f1\fs20\cf13\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\s3\ql \li1440\ri0\sb180\keepn\widctlpar\wrapdefault\nooverflow\faroman\outlinelevel2\rin0\lin1440\itap0 \rtlch\fcs1 -\ab\af1\afs20\alang1025 \ltrch\fcs0 \b\f1\fs20\cf10\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 \slink17 \sqformat heading 3;}{\s4\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\outlinelevel3\rin0\lin1440\itap0 -\rtlch\fcs1 \af47\afs24\alang1025 \ltrch\fcs0 \f47\fs24\ul\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 \slink18 \sqformat heading 4;}{ -\s5\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\outlinelevel4\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af47\afs20\alang1025 \ltrch\fcs0 \b\f47\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 \slink19 \sqformat -heading 5;}{\s6\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\outlinelevel5\rin0\lin1440\itap0 \rtlch\fcs1 \af47\afs20\alang1025 \ltrch\fcs0 \f47\fs20\ul\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext24 \slink20 \sqformat heading 6;}{\s7\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\outlinelevel6\rin0\lin1440\itap0 \rtlch\fcs1 \ai\af47\afs20\alang1025 \ltrch\fcs0 -\i\f47\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 \slink21 \sqformat heading 7;}{\s8\ql \li1440\ri0\sb240\sa60\widctlpar\wrapdefault\nooverflow\faroman\outlinelevel7\rin0\lin1440\itap0 \rtlch\fcs1 \ai\af45\afs20\alang1025 -\ltrch\fcs0 \i\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink22 \sqformat heading 8;}{\s9\ql \li1440\ri0\sb240\sa60\widctlpar\wrapdefault\nooverflow\faroman\outlinelevel8\rin0\lin1440\itap0 \rtlch\fcs1 -\ab\ai\af45\afs18\alang1025 \ltrch\fcs0 \b\i\f45\fs18\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink23 \sqformat heading 9;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\* -\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1 -\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused Normal Table;}{\*\cs15 \additive \rtlch\fcs1 -\ab\af0\afs32 \ltrch\fcs0 \b\f43\fs32\kerning32 \sbasedon10 \slink1 \slocked Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0 \b\i\f43\fs28 \sbasedon10 \slink2 \slocked \ssemihidden Heading 2 Char;}{\*\cs17 \additive -\rtlch\fcs1 \ab\af0\afs26 \ltrch\fcs0 \b\f43\fs26 \sbasedon10 \slink3 \slocked \ssemihidden Heading 3 Char;}{\*\cs18 \additive \rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0 \b\f37\fs28 \sbasedon10 \slink4 \slocked \ssemihidden Heading 4 Char;}{\*\cs19 \additive -\rtlch\fcs1 \ab\ai\af0\afs26 \ltrch\fcs0 \b\i\f37\fs26 \sbasedon10 \slink5 \slocked \ssemihidden Heading 5 Char;}{\*\cs20 \additive \rtlch\fcs1 \ab\af0 \ltrch\fcs0 \b\f37 \sbasedon10 \slink6 \slocked \ssemihidden Heading 6 Char;}{\*\cs21 \additive -\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f37\fs24 \sbasedon10 \slink7 \slocked \ssemihidden Heading 7 Char;}{\*\cs22 \additive \rtlch\fcs1 \ai\af0\afs24 \ltrch\fcs0 \i\f37\fs24 \sbasedon10 \slink8 \slocked \ssemihidden Heading 8 Char;}{\*\cs23 \additive -\rtlch\fcs1 \af0 \ltrch\fcs0 \f43 \sbasedon10 \slink9 \slocked \ssemihidden Heading 9 Char;}{\s24\ql \li1800\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1800\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 Normal Indent;}{\s25\ql \li0\ri0\widctlpar\tqr\tx9360\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \ai\af1\afs16\alang1025 \ltrch\fcs0 -\i\f1\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext25 \slink26 footer;}{\*\cs26 \additive \rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink25 \slocked \ssemihidden Footer Char;}{\s27\ql \li0\ri0\widctlpar -\tqr\tx9900\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \ab\ai\af1\afs20\alang1025 \ltrch\fcs0 \b\i\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext27 \slink28 header;}{\*\cs28 \additive \rtlch\fcs1 \af45\afs20 -\ltrch\fcs0 \f45\fs20 \sbasedon10 \slink27 \slocked \ssemihidden Header Char;}{\s29\ql \li2160\ri0\sb40\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin2160\itap0 \rtlch\fcs1 \af2\afs18\alang1025 \ltrch\fcs0 -\f2\fs18\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon30 \snext29 prog indent;}{\s30\ql \li1800\ri0\sb40\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1800\itap0 \rtlch\fcs1 \af2\afs18\alang1025 \ltrch\fcs0 -\f2\fs18\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon31 \snext30 prog;}{\s31\ql \fi-360\li360\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin360\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext31 List;}{\*\cs32 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 page number;}{\s33\ql \fi-216\li2016\ri0\sb40\widctlpar\wrapdefault{\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0 -\pnf5\pnstart1\pnindent216\pnhang {\pntxtb ?}}\nooverflow\faroman\ls2047\ilvl10\rin0\lin2016\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext33 bullet;}{ -\s34\ql \li0\ri0\sb720\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp120 \wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \ab\af1\afs36\alang1025 \ltrch\fcs0 \b\f1\fs36\cf9\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 -\sbasedon1 \snext34 Style1;}{\s35\ql \fi-216\li2016\ri0\sb120\widctlpar\wrapdefault{\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0\pnf5\pnstart1\pnindent216\pnhang {\pntxtb ?}}\nooverflow\faroman\ls2047\ilvl10\rin0\lin2016\itap0 \rtlch\fcs1 \af45\afs20\alang1025 -\ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon33 \snext33 bullet first;}{\s36\ql \li1440\ri0\sb180\widctlpar\tx5220\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 -\b\f1\fs20\cf13\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext38 chapter contents;}{\s37\ql \li1440\ri0\sb40\widctlpar\tx5400\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext37 chapter contents list;}{\s38\ql \li1440\ri0\sb80\widctlpar\tx5400\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext37 chapter contents list first;}{\s39\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \ab\af1\afs200\alang1025 \ltrch\fcs0 -\b\f1\fs200\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 \snext0 chapter num;}{\s40\qr \li0\ri0\sa720\widctlpar\brdrt\brdrs\brdrw60\brsp20 \wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \ab\af1\afs54\alang1025 \ltrch\fcs0 -\b\f1\fs54\cf9\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 \snext36 chapter title;}{\s41\ql \li1800\ri0\sb120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1800\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon31 \snext31 list first;}{\s42\ql \fi-216\li2376\ri0\sb40\widctlpar\wrapdefault{\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0\pnf48\pnstart1\pnindent216\pnhang {\pntxtb ?}} -\nooverflow\faroman\ls2047\ilvl10\rin0\lin2376\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext42 bullet indent;}{ -\s43\ql \li1440\ri0\sb120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 normal after heading 3;}{ -\s44\ql \fi-216\li2376\ri0\sb80\widctlpar\wrapdefault{\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0\pnf48\pnstart1\pnindent216\pnhang {\pntxtb ?}}\nooverflow\faroman\ls2047\ilvl10\rin0\lin2376\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon33 \snext42 bullet indent first;}{\s45\qr \li720\ri0\sa360\sl-1060\slmult0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 \rtlch\fcs1 \ab\ai\af1\afs48\alang1025 \ltrch\fcs0 -\b\i\f1\fs48\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 contents title;}{\s46\ql \li2160\ri0\sb40\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin2160\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon31 \snext46 def;}{\s47\ql \li2160\ri0\sb80\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin2160\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon46 \snext47 def 2;}{\s48\ql \li1080\ri0\sb120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1080\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon41 \snext46 def first;}{\s49\ql \li2160\ri0\sb40\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin2160\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon46 \snext0 def last;}{\s50\ql \li2160\ri0\sb80\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin2160\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon49 \snext0 def last 2;}{\s51\ql \li1800\ri0\sb120\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1800\itap0 \rtlch\fcs1 \ab\af45\afs20\alang1025 \ltrch\fcs0 -\b\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon41 \snext46 def term;}{\s52\ql \li1800\ri0\sb120\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1800\itap0 \rtlch\fcs1 \ab\af45\afs20\alang1025 \ltrch\fcs0 -\b\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon41 \snext52 def term first;}{\s53\qc \li1440\ri0\sb240\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext54 figure;}{\s54\qc \li1440\ri0\sb180\sa240\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 -\b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 figure title;}{\s55\qc \li1440\ri0\sb240\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon53 \snext0 figure after step;}{\s56\qc \li1440\ri0\sb180\sa240\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 -\b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon54 \snext56 figure title after step;}{\s57\qc \li1440\ri0\sb180\sa360\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 -\b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon54 \snext0 figure title continued;}{\*\cs58 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 line number;}{ -\s59\ql \li2160\ri0\sb40\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin2160\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon31 \snext59 list indent;}{ -\s60\ql \li2160\ri0\sb80\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin2160\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon31 \snext59 list indent first;}{ -\s61\ql \fi-360\li2160\ri0\sb120\widctlpar\wrapdefault{\*\pn \pnlvlbody\ilvl11\ls2047\pnrnot0\pndec\pnstart1\pnindent360\pnhang {\pntxta .}}\nooverflow\faroman\ls2047\ilvl11\rin0\lin2160\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext61 List Number;}{\s62\ql \li2160\ri0\sb80\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin2160\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon60 \snext62 list number no number;}{\s63\ql \li720\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext63 normal before table;}{\s64\ql \fi-806\li2246\ri0\sb240\sa120\widctlpar\brdrt\brdrs\brdrw15\brsp100 \brdrb\brdrs\brdrw15\brsp100 -\tx2250\wrapdefault\nooverflow\faroman\rin0\lin2246\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 note;}{ -\s65\qr \li0\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \ai\af1\afs20\alang1025 \ltrch\fcs0 \i\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext65 part number;}{ -\s66\ql \li1800\ri0\sb120\widctlpar\tx4770\wrapdefault\nooverflow\faroman\rin0\lin1800\itap0 \rtlch\fcs1 \af2\afs18\alang1025 \ltrch\fcs0 \f2\fs18\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon41 \snext30 prog first;}{ -\s67\ql \li1800\ri0\sb40\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1800\itap0 \rtlch\fcs1 \af2\afs18\alang1025 \ltrch\fcs0 \f2\fs18\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon31 \snext67 prog last;}{ -\s68\ql \li1800\ri0\sb120\widctlpar\tx4770\wrapdefault\nooverflow\faroman\rin0\lin1800\itap0 \rtlch\fcs1 \af2\afs18\alang1025 \ltrch\fcs0 \f2\fs18\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon66 \snext68 prog single;}{ -\s69\ql \li878\ri144\sl-180\slmult0\widctlpar\brdrt\brdrs\brdrw15\brsp100 \brdrl\brdrs\brdrw15\brsp100 \brdrb\brdrs\brdrw15\brsp100 \brdrr\brdrs\brdrw15\brsp100 -\tx1152\tx1440\tx1728\tx2016\tx2304\tx2592\tx2880\wrapdefault\nooverflow\faroman\rin144\lin878\itap0 \rtlch\fcs1 \af2\afs15\alang1025 \ltrch\fcs0 \f2\fs15\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 \snext69 program text;}{ -\s70\ql \fi-360\li2520\ri0\sb80\widctlpar\wrapdefault{\*\pn \pnlvlbody\ilvl11\ls2047\pnrnot0\pnlcltr\pnb0\pni0\pnf4\pnfs20\pnstart1\pnindent360\pnhang {\pntxta . }}\nooverflow\faroman\ls2047\ilvl11\rin0\lin2520\itap0 \rtlch\fcs1 \af45\afs20\alang1025 -\ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext70 substep;}{\s71\ql \li72\ri72\sb80\sa80\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin72\lin72\itap0 \rtlch\fcs1 \ab\af45\afs20\alang1025 \ltrch\fcs0 -\b\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 table head;}{\s72\ql \li72\ri72\sb80\sa80\widctlpar\wrapdefault\nooverflow\faroman\rin72\lin72\itap0 \rtlch\fcs1 \af45\afs18\alang1025 \ltrch\fcs0 -\f45\fs18\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext72 table text;}{\s73\qc \li1440\ri0\sb300\sa120\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 -\b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext71 table title;}{\s74\qc \li1440\ri0\sb300\sa120\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 -\b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon73 \snext71 table title continued;}{\s75\ql \li1800\ri0\sb120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1800\itap0 \rtlch\fcs1 \af1\afs20\alang1025 \ltrch\fcs0 -\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 triplet single;}{\s76\ql \li720\ri0\sb360\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 -\b\f1\fs20\cf13\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon2 \snext0 triplet heading 2;}{\s77\ql \li0\ri0\sb180\keepn\pagebb\widctlpar\brdrt\brdrs\brdrw30\brsp120 \tqr\tx9893\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 -\ab\af1\afs24\alang1025 \ltrch\fcs0 \b\f1\fs24\cf9\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 \sbasedon1 \snext77 triplet heading;}{\s78\ql \li1080\ri0\sb120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1080\itap0 \rtlch\fcs1 -\af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext79 glossary def;}{\s79\ql \li720\ri0\sb180\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 \rtlch\fcs1 -\ab\af45\afs20\alang1025 \ltrch\fcs0 \b\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon80 \snext78 glossary word;}{\s80\ql \li720\ri0\sb180\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 \rtlch\fcs1 -\ab\af45\afs20\alang1025 \ltrch\fcs0 \b\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext78 glossary word first;}{\s81\ql \li1080\ri0\sb120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1080\itap0 \rtlch\fcs1 -\af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon78 \snext0 glossary def last;}{\s82\ql \fi-216\li2736\ri0\sb80\widctlpar\wrapdefault{\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0 -\pnf5\pnstart1\pnindent216\pnhang {\pntxtb ?}}\nooverflow\faroman\ls2047\ilvl10\rin0\lin2736\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext82 ref bullet 1;}{ -\s83\ql \fi-216\li2736\ri0\sb40\widctlpar\wrapdefault{\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0\pnf5\pnstart1\pnindent216\pnhang {\pntxtb ?}}\nooverflow\faroman\ls2047\ilvl10\rin0\lin2736\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon82 \snext83 ref bullet 2;}{\s84\ql \fi-1440\li2160\ri0\sb180\widctlpar\tx2160\wrapdefault\nooverflow\faroman\rin0\lin2160\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext84 ref para 1;}{\s85\ql \li2160\ri0\sb80\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin2160\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon84 \snext84 ref para 2;}{\s86\ql \li2520\ri0\sb80\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin2520\itap0 \rtlch\fcs1 \af2\afs18\alang1025 \ltrch\fcs0 -\f2\fs18\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 \snext86 ref prog 1;}{\s87\ql \li2520\ri0\sb40\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin2520\itap0 \rtlch\fcs1 \af2\afs18\alang1025 \ltrch\fcs0 -\f2\fs18\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 \sbasedon86 \snext87 ref prog 2;}{\s88\ql \li2160\ri0\sb120\widctlpar\tx4770\wrapdefault\nooverflow\faroman\rin0\lin2160\itap0 \rtlch\fcs1 \af2\afs18\alang1025 \ltrch\fcs0 -\f2\fs18\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon66 \snext88 prog indent first;}{\s89\ql \li2160\ri0\sb40\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin2160\itap0 \rtlch\fcs1 \af2\afs18\alang1025 \ltrch\fcs0 -\f2\fs18\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon67 \snext89 prog indent last;}{\s90\ql \li0\ri0\sb180\keepn\pagebb\widctlpar\brdrt\brdrs\brdrw30\brsp120 \tqr\tx9893\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 -\ab\af1\afs24\alang1025 \ltrch\fcs0 \b\f1\fs24\cf9\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 \sbasedon77 \snext0 ref heading;}{\s91\ql \li720\ri0\sb360\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 \rtlch\fcs1 -\ab\af1\afs20\alang1025 \ltrch\fcs0 \b\f1\fs20\cf13\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon76 \snext0 ref heading 2;}{\s92\ql \li1440\ri0\sb120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 -\af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon41 \snext93 ref list first;}{\s93\ql \li1440\ri0\sb40\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 -\ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon31 \snext93 ref list;}{\s94\ql \fi-2160\li3240\ri0\sb120\widctlpar\tx3240\wrapdefault\nooverflow\faroman\rin0\lin3240\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon43 \snext94 ref subhead first;}{\s95\ql \fi-2160\li3240\ri0\sb40\widctlpar\tx3240\wrapdefault\nooverflow\faroman\rin0\lin3240\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext94 ref subhead last;}{\s96\ql \li1440\ri0\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext96 \slink97 Body Text;}{\*\cs97 \additive \rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink96 \slocked \ssemihidden Body Text Char;}{ -\s98\ql \li1080\ri0\sb120\keepn\widctlpar\tqr\tldot\tx9893\wrapdefault\nooverflow\faroman\rin0\lin1080\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext0 \sautoupd \spriority39 toc 1;}{\s99\ql \li1440\ri1440\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin1440\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext99 Block Text;}{\s100\ql \li360\ri0\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin360\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext100 \slink101 Body Text 2;}{\*\cs101 \additive \rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink100 \slocked \ssemihidden Body Text 2 Char;}{ -\s102\ql \li1440\ri0\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs16\alang1025 \ltrch\fcs0 \f45\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext102 \slink103 Body Text 3;}{\*\cs103 -\additive \rtlch\fcs1 \af45\afs16 \ltrch\fcs0 \f45\fs16 \sbasedon10 \slink102 \slocked \ssemihidden Body Text 3 Char;}{\s104\ql \fi210\li1440\ri0\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 -\ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon96 \snext104 \slink105 Body Text First Indent;}{\*\cs105 \additive \rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon97 \slink104 \slocked \ssemihidden -Body Text First Indent Char;}{\s106\ql \li283\ri0\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin283\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext106 \slink107 Body Text Indent;}{\*\cs107 \additive \rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink106 \slocked \ssemihidden Body Text Indent Char;}{ -\s108\ql \fi210\li360\ri0\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin360\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon100 \snext108 \slink109 -Body Text First Indent 2;}{\*\cs109 \additive \rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon107 \slink108 \slocked \ssemihidden Body Text First Indent 2 Char;}{\s110\ql \li360\ri0\sb180\sa120\sl480\slmult1 -\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin360\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext110 \slink111 Body Text Indent 2;}{\*\cs111 \additive \rtlch\fcs1 -\af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink110 \slocked \ssemihidden Body Text Indent 2 Char;}{\s112\ql \li360\ri0\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin360\itap0 \rtlch\fcs1 \af45\afs16\alang1025 \ltrch\fcs0 -\f45\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext112 \slink113 Body Text Indent 3;}{\*\cs113 \additive \rtlch\fcs1 \af45\afs16 \ltrch\fcs0 \f45\fs16 \sbasedon10 \slink112 \slocked \ssemihidden Body Text Indent 3 Char;}{ -\s114\ql \li1440\ri0\sb120\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af45\afs20\alang1025 \ltrch\fcs0 \b\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sqformat caption;}{ -\s115\ql \li4320\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin4320\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext115 \slink116 Closing;}{\*\cs116 \additive -\rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink115 \slocked \ssemihidden Closing Char;}{\s117\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext117 \slink118 \ssemihidden annotation text;}{\*\cs118 \additive \rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink117 \slocked \ssemihidden Comment Text Char;}{ -\s119\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink120 Date;}{\*\cs120 \additive -\rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink119 \slocked \ssemihidden Date Char;}{\s121\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \cbpat9 \rtlch\fcs1 \af44\afs20\alang1025 \ltrch\fcs0 -\f44\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext121 \slink122 \ssemihidden Document Map;}{\*\cs122 \additive \rtlch\fcs1 \af44\afs16 \ltrch\fcs0 \f44\fs16 \sbasedon10 \slink121 \slocked \ssemihidden Document Map Char;}{ -\s123\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext123 \slink124 \ssemihidden endnote text;}{\* -\cs124 \additive \rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink123 \slocked \ssemihidden Endnote Text Char;}{ -\s125\ql \li2880\ri0\sb180\widctlpar\phpg\posxc\posyb\absh-1980\absw7920\dxfrtext180\dfrmtxtx180\dfrmtxty0\wrapdefault\nooverflow\faroman\rin0\lin2880\itap0 \rtlch\fcs1 \af1\afs24\alang1025 \ltrch\fcs0 -\f1\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext125 envelope address;}{\s126\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af1\afs20\alang1025 \ltrch\fcs0 -\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext126 envelope return;}{\s127\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext127 \slink128 \ssemihidden footnote text;}{\*\cs128 \additive \rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink127 \slocked \ssemihidden Footnote Text Char;}{ -\s129\ql \fi-200\li200\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin200\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden index 1;}{ -\s130\ql \fi-200\li400\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin400\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden index 2;}{ -\s131\ql \fi-200\li600\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin600\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden index 3;}{ -\s132\ql \fi-200\li800\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin800\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden index 4;}{ -\s133\ql \fi-200\li1000\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1000\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden index 5;}{ -\s134\ql \fi-200\li1200\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1200\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden index 6;}{ -\s135\ql \fi-200\li1400\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1400\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden index 7;}{ -\s136\ql \fi-200\li1600\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1600\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden index 8;}{ -\s137\ql \fi-200\li1800\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1800\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden index 9;}{ -\s138\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext129 \ssemihidden index heading;}{ -\s139\ql \fi-360\li720\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext139 List 2;}{ -\s140\ql \fi-360\li1080\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1080\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext140 List 3;}{ -\s141\ql \fi-360\li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext141 List 4;}{ -\s142\ql \fi-360\li1800\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1800\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext142 List 5;}{ -\s143\ql \fi-360\li360\ri0\sb180\widctlpar\jclisttab\tx360\wrapdefault{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\nooverflow\faroman\ls1\rin0\lin360\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext143 \sautoupd List Bullet;}{\s144\ql \fi-360\li720\ri0\sb180\widctlpar\jclisttab\tx720\wrapdefault{\*\pn \pnlvlbody\ilvl0\ls2\pnrnot0\pndec } -\nooverflow\faroman\ls2\rin0\lin720\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext144 \sautoupd List Bullet 2;}{\s145\ql \fi-360\li1080\ri0\sb180\widctlpar -\jclisttab\tx1080\wrapdefault{\*\pn \pnlvlbody\ilvl0\ls3\pnrnot0\pndec }\nooverflow\faroman\ls3\rin0\lin1080\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext145 \sautoupd -List Bullet 3;}{\s146\ql \fi-360\li1440\ri0\sb180\widctlpar\jclisttab\tx1440\wrapdefault{\*\pn \pnlvlbody\ilvl0\ls4\pnrnot0\pndec }\nooverflow\faroman\ls4\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext146 \sautoupd List Bullet 4;}{\s147\ql \fi-360\li1800\ri0\sb180\widctlpar\jclisttab\tx1800\wrapdefault{\*\pn \pnlvlbody\ilvl0\ls5\pnrnot0\pndec } -\nooverflow\faroman\ls5\rin0\lin1800\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext147 \sautoupd List Bullet 5;}{ -\s148\ql \li360\ri0\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin360\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext148 List Continue;}{ -\s149\ql \li720\ri0\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext149 List Continue 2;}{ -\s150\ql \li1080\ri0\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1080\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext150 List Continue 3;}{ -\s151\ql \li1440\ri0\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext151 List Continue 4;}{ -\s152\ql \li1800\ri0\sb180\sa120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1800\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext152 List Continue 5;}{ -\s153\ql \fi-360\li720\ri0\sb180\widctlpar\jclisttab\tx720\wrapdefault{\*\pn \pnlvlbody\ilvl0\ls6\pnrnot0\pndec }\nooverflow\faroman\ls6\rin0\lin720\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext153 List Number 2;}{\s154\ql \fi-360\li1080\ri0\sb180\widctlpar\jclisttab\tx1080\wrapdefault{\*\pn \pnlvlbody\ilvl0\ls7\pnrnot0\pndec }\nooverflow\faroman\ls7\rin0\lin1080\itap0 -\rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext154 List Number 3;}{\s155\ql \fi-360\li1440\ri0\sb180\widctlpar\jclisttab\tx1440\wrapdefault{\*\pn \pnlvlbody\ilvl0\ls8\pnrnot0 -\pndec }\nooverflow\faroman\ls8\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext155 List Number 4;}{\s156\ql \fi-360\li1800\ri0\sb180\widctlpar -\jclisttab\tx1800\wrapdefault{\*\pn \pnlvlbody\ilvl0\ls9\pnrnot0\pndec }\nooverflow\faroman\ls9\rin0\lin1800\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext156 -List Number 5;}{\s157\ql \li1440\ri0\sb180\widctlpar\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin1440\itap0 \rtlch\fcs1 \af2\afs20\alang1025 \ltrch\fcs0 -\f2\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext157 \slink158 \ssemihidden macro;}{\*\cs158 \additive \rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20 \sbasedon10 \slink157 \slocked \ssemihidden Macro Text Char;}{ -\s159\ql \fi-1080\li1080\ri0\sb180\widctlpar\brdrt\brdrs\brdrw15\brsp20 \brdrl\brdrs\brdrw15\brsp20 \brdrb\brdrs\brdrw15\brsp20 \brdrr\brdrs\brdrw15\brsp20 \wrapdefault\nooverflow\faroman\rin0\lin1080\itap0 \shading2000 \rtlch\fcs1 \af1\afs24\alang1025 -\ltrch\fcs0 \f1\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext159 \slink160 Message Header;}{\*\cs160 \additive \rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f43\fs24\chshdng2000\chcfpat0\chcbpat0 -\sbasedon10 \slink159 \slocked \ssemihidden Message Header Char;}{\s161\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink162 Note Heading;}{\*\cs162 \additive \rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink161 \slocked \ssemihidden Note Heading Char;}{ -\s163\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af2\afs20\alang1025 \ltrch\fcs0 \f2\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext163 \slink164 Plain Text;}{\*\cs164 \additive -\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20 \sbasedon10 \slink163 \slocked \ssemihidden Plain Text Char;}{\s165\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 -\f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink166 Salutation;}{\*\cs166 \additive \rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink165 \slocked \ssemihidden Salutation Char;}{ -\s167\ql \li4320\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin4320\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext167 \slink168 Signature;}{\*\cs168 \additive -\rtlch\fcs1 \af45\afs20 \ltrch\fcs0 \f45\fs20 \sbasedon10 \slink167 \slocked \ssemihidden Signature Char;}{\s169\qc \li1440\ri0\sb180\sa60\widctlpar\wrapdefault\nooverflow\faroman\outlinelevel1\rin0\lin1440\itap0 \rtlch\fcs1 \af1\afs24\alang1025 -\ltrch\fcs0 \f1\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext169 \slink170 \sqformat Subtitle;}{\*\cs170 \additive \rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f43\fs24 \sbasedon10 \slink169 \slocked Subtitle Char;}{ -\s171\ql \fi-200\li200\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin200\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \ssemihidden table of authorities;}{ -\s172\ql \fi-400\li400\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin400\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \ssemihidden table of figures;}{ -\s173\qc \li1440\ri0\sb240\sa60\widctlpar\wrapdefault\nooverflow\faroman\outlinelevel0\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af1\afs32\alang1025 \ltrch\fcs0 \b\f1\fs32\lang1033\langfe1033\kerning28\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext173 \slink174 \sqformat Title;}{\*\cs174 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\f43\fs32\kerning28 \sbasedon10 \slink173 \slocked Title Char;}{ -\s175\ql \li1440\ri0\sb120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af1\afs24\alang1025 \ltrch\fcs0 \b\f1\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \ssemihidden toa heading;}{ -\s176\ql \li1440\ri0\sb180\widctlpar\tqr\tldot\tx9883\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \spriority39 -toc 2;}{\s177\ql \li400\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin400\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden toc 3;}{ -\s178\ql \li600\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin600\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden toc 4;}{ -\s179\ql \li800\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin800\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden toc 5;}{ -\s180\ql \li1000\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1000\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden toc 6;}{ -\s181\ql \li1200\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1200\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden toc 7;}{ -\s182\ql \li1400\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1400\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden toc 8;}{ -\s183\ql \li1600\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1600\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \sautoupd \ssemihidden toc 9;}{ -\s184\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af44\afs16\alang1025 \ltrch\fcs0 \f44\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext184 \slink185 \ssemihidden Balloon Text;}{\* -\cs185 \additive \rtlch\fcs1 \af44\afs16 \ltrch\fcs0 \f44\fs16 \sbasedon10 \slink184 \slocked \ssemihidden Balloon Text Char;}{\*\ts186\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh -\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv -\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon11 \snext186 Table Grid;}{\*\cs187 \additive \rtlch\fcs1 \af0 -\ltrch\fcs0 \ul\cf2 \sbasedon10 Hyperlink;}{\*\cs188 \additive \rtlch\fcs1 \af0\afs19 \ltrch\fcs0 \fs19 \sbasedon10 postbody1;}{\s189\ql \li0\ri0\keepn\pagebb\widctlpar\brdrt\brdrs\brdrw30\brsp120 -\wrapdefault\nooverflow\faroman\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \ab\af1\afs24\alang1025 \ltrch\fcs0 \b\f1\fs24\cf9\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 \sbasedon1 \snext189 \slink190 TWAIN Header;}{\*\cs190 \additive -\rtlch\fcs1 \ab\af1\afs24 \ltrch\fcs0 \b\f1\fs24\cf9\lang1024\langfe1024\kerning32\noproof \sbasedon15 \slink189 \slocked TWAIN Header Char;}{\s191\ql \li720\ri0\sb360\sl240\slmult0\widctlpar\tx720\wrapdefault\hyphpar0\faauto\rin0\lin720\itap0 -\rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\cf1\lang1033\langfe1033\charscalex0\cgrid\langnp1033\langfenp1033 \snext191 body;}{\s192\ql \li1440\ri0\sb120\sl240\slmult0\widctlpar -\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\tx5400\tx5760\tx6120\tx6480\tx6840\tx7200\tx7560\tx7920\tx8280\tx8640\tx9000\wrapdefault\hyphpar0\faauto\rin0\lin1440\itap0 \rtlch\fcs1 \af49\afs20\alang1025 -\ltrch\fcs0 \f49\fs20\cf1\lang1033\langfe1033\charscalex0\cgrid\langnp1033\langfenp1033 \snext0 Code;}{\s193\ql \fi-3240\li4680\ri0\sb120\sl240\slmult0\widctlpar\tx4680\tx7400\wrapdefault\hyphpar0\faauto\rin0\lin4680\itap0 \rtlch\fcs1 -\af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\cf1\lang1033\langfe1033\charscalex0\cgrid\langnp1033\langfenp1033 \snext31 twocol;}{\*\cs194 \additive \f2 Code2;}{\s195\ql \li0\ri0\widctlpar\wrapdefault\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 -\af0\afs24\alang1025 \ltrch\fcs0 \fs24\cf1\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext195 Default;}{\*\cs196 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \spriority0 postbody;}{\*\cs197 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 -\ul\cf19 \sbasedon10 \slocked \ssemihidden \sunhideused FollowedHyperlink;}{\s198\ql \li60\ri60\sb80\sa80\sl240\slmult0\widctlpar\tx720\tx2520\wrapdefault\hyphpar0\faauto\rin60\lin60\itap0 \rtlch\fcs1 \af2\afs20\alang1025 \ltrch\fcs0 -\fs20\cf1\lang1033\langfe2052\loch\f2\hich\af2\dbch\af31505\charscalex0\cgrid\langnp1033\langfenp2052 \snext198 table_code;}{\s199\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af37\afs22\alang1025 -\ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext199 \sqformat \spriority34 List Paragraph;}{\*\cs200 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \cf20\chshdng0\chcfpat0\chcbpat21 \sbasedon10 \ssemihidden \sunhideused -Unresolved Mention;}}{\*\listtable{\list\listtemplateid-537102814\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 -\fi-360\li1440\jclisttab\tx1440\lin1440 }{\listname ;}\listid-131}{\list\listtemplateid-241933882\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;} -\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1080\jclisttab\tx1080\lin1080 }{\listname ;}\listid-130}{\list\listtemplateid894471834\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li720\jclisttab\tx720\lin720 }{\listname ;}\listid-129}{\list\listtemplateid-1633241602\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li1800\jclisttab\tx1800\lin1800 }{\listname ;}\listid-128}{\list\listtemplateid-203631750\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listname ;}\listid-127}{\list\listtemplateid360335964\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li1080\jclisttab\tx1080\lin1080 }{\listname ;}\listid-126}{\list\listtemplateid627448582\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li720\jclisttab\tx720\lin720 }{\listname ;}\listid-125}{\list\listtemplateid507960418\listsimple{\listlevel\levelnfc0\levelnfcn0 -\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid-120}{\list\listtemplateid-1407048446\listsimple -{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid-119}{\list\listtemplateid-950138062 -\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-129700622\'01-;}{\levelnumbers;}\loch\af37\hich\af37\dbch\af0\fbias0 \fi-360\li720\lin720 }{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0 -\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689 -\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 -\fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\lin6480 }{\listname -;}\listid162478944}{\list\listtemplateid181715488\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid1324631620\'01-;}{\levelnumbers;} -\loch\af0\hich\af0\dbch\af0\fbias0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 -\fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\lin2160 }{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0 -\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 -\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\lin6480 }{\listname ;}\listid984241419}{\list\listtemplateid81190112\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid1970803460\'02\'00);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fs22\cf22\loch\af37\hich\af37\dbch\af0\fbias0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 -\levelindent0{\leveltext\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698703 -\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;} -\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 -\fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\lin5040 } -{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2 -\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\lin6480 }{\listname ;}\listid2094470365}}{\*\listoverridetable -{\listoverride\listid-120\listoverridecount0\ls1}{\listoverride\listid-119\listoverridecount0\ls2}{\listoverride\listid-125\listoverridecount0\ls3}{\listoverride\listid-126\listoverridecount0\ls4}{\listoverride\listid-127\listoverridecount0\ls5} -{\listoverride\listid-128\listoverridecount0\ls6}{\listoverride\listid-129\listoverridecount0\ls7}{\listoverride\listid-130\listoverridecount0\ls8}{\listoverride\listid-131\listoverridecount0\ls9}{\listoverride\listid2094470365 -\listoverridecount9{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel -\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}\ls10}{\listoverride\listid984241419\listoverridecount0\ls11} -{\listoverride\listid162478944\listoverridecount0\ls12}}{\*\pgptbl {\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0 -\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0} -{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}}{\*\rsidtbl \rsid472724\rsid1196296\rsid6441407\rsid6555766\rsid6896082\rsid8668465}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1 -\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\title Spec 1.9a - Title page}{\author The TWAIN Working Group}{\operator l252353}{\creatim\yr2013\mo11\dy4\hr16\min24}{\revtim\yr2021\mo11\dy8\hr7\min25}{\printim\yr2010\mo7\dy28\hr8\min8}{\version45} -{\edmins182}{\nofpages15}{\nofwords5071}{\nofchars28907}{\*\company JFL Peripheral Solutions Inc.}{\nofcharsws33911}{\vern21}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}} -\paperw12240\paperh15840\margl1260\margr1080\margt1440\margb1080\gutter0\ltrsect\rtlgutter -\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\margmirror -\noextrasprl\cvmme\sprsspbf\brkfrm\swpbdr\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\lytprtmet\hyphcaps0\horzdoc\fracwidth\dghspace180\dgvspace180\dghorigin1701\dgvorigin1984\dghshow0\dgvshow0 -\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\bdrrlswsix\nolnhtadjtbl\rsidroot8668465 \fet0{\*\wgrffmtfilter 013f}\ilfomacatclnup12{\*\ftnsep \ltrpar \pard\plain \ltrpar -\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid6555766 \chftnsep -\par }}{\*\ftnsepc \ltrpar \pard\plain \ltrpar\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af45 -\ltrch\fcs0 \insrsid6555766 \chftnsepc -\par }}{\*\aftnsep \ltrpar \pard\plain \ltrpar\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af45 -\ltrch\fcs0 \insrsid6555766 \chftnsep -\par }}{\*\aftnsepc \ltrpar \pard\plain \ltrpar\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af45 -\ltrch\fcs0 \insrsid6555766 \chftnsepc -\par }}\ltrpar \sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj {\footerr \ltrpar \pard\plain \ltrpar\s25\ql \li0\ri0\widctlpar\tqr\tx9900\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 -\ai\af1\afs16\alang1025 \ltrch\fcs0 \i\f1\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid6441407 TWAIN for C#\tab }{\field{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 \cs32\insrsid6441407 PAGE }}{\fldrslt { -\rtlch\fcs1 \af1 \ltrch\fcs0 \cs32\lang1024\langfe1024\noproof\insrsid6441407 11}}}\sectd \ltrsect\linex0\endnhere\sectdefaultcl\sftnbj {\rtlch\fcs1 \af1 \ltrch\fcs0 \cs32\insrsid6441407 -\par Kodak Alaris Inc.}{\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid6441407 -\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}} -{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8 -\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\sb1440\widctlpar\brdrt\brdrs\brdrw60\brsp20\brdrcf13 -\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af45 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 {\rtlch\fcs1 \af1\afs56 \ltrch\fcs0 \b\f31506\fs56\cf9\insrsid6441407 TWAIN for C# -\par }\pard \ltrpar\ql \li1440\ri0\sb120\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 {\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f31506\fs28\cf13\insrsid6441407 For Version 2.}{\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 -\b\f31506\fs28\cf13\insrsid8668465 5}{\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f31506\fs28\cf13\insrsid6441407 .}{\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f31506\fs28\cf13\insrsid8668465 0}{\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 -\b\f31506\fs28\cf13\insrsid6441407 .0 -\par }\pard \ltrpar\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 {\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f31506\fs28\insrsid8668465 November}{\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f31506\fs28\insrsid6441407 8}{ -\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f31506\fs28\super\insrsid6441407 th}{\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f31506\fs28\insrsid6441407 , 202}{\rtlch\fcs1 \ab\af1\afs28 \ltrch\fcs0 \b\f31506\fs28\insrsid8668465 1}{\rtlch\fcs1 \ab\af1\afs28 -\ltrch\fcs0 \b\f31506\fs28\insrsid6441407 -\par }\pard \ltrpar\ql \li1440\ri0\sb360\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 {\rtlch\fcs1 \af1\afs28 \ltrch\fcs0 \f31506\fs28\insrsid6441407 -\par }\pard \ltrpar\ql \li0\ri0\sb120\widctlpar\brdrt\brdrs\brdrw60\brsp20\brdrcf13 \wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af45 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\ql \li1440\ri0\sb240\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 {\rtlch\fcs1 \af45 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\ql \li1440\ri0\sb360\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 {\rtlch\fcs1 \af45 \ltrch\fcs0 \f31506\insrsid6441407 -\par -\par }\pard \ltrpar\qc \li0\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af45 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\ql \li720\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 {\rtlch\fcs1 \af45\afs40 \ltrch\fcs0 \f31506\fs40\insrsid6441407 \page }{\rtlch\fcs1 \af1\afs36 \ltrch\fcs0 \b\f31506\fs36\cf9\insrsid6441407 -\par }\pard \ltrpar\ql \li720\ri0\sb180\keep\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 {\rtlch\fcs1 \af1\afs36 \ltrch\fcs0 \b\f31506\fs36\cf9\insrsid6441407 Contents -\par }\pard\plain \ltrpar\s98\ql \li1080\ri0\sb120\keepn\widctlpar\tqr\tldot\tx9893\wrapdefault\nooverflow\faroman\rin0\lin1080\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 \b0\f31506\insrsid6441407 TOC \\o "1-3" \\h \\z \\u }}{\fldrslt {\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 } -{\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248710"}{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 -\cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310030000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 -\cs187\f37\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 Purpose}{\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248710 \\h }{\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310030000000}}}{\fldrslt {\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 4}}}\sectd \ltrsect\rtlgutter -\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj {\rtlch\fcs1 \ab0\af31507\afs22 \ltrch\fcs0 -\b0\fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248711"}{\rtlch\fcs1 \af0 -\ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310031000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\f37\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 License}{\rtlch\fcs1 -\af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248711 \\h }{\rtlch\fcs1 \af1 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310031000000}}}{\fldrslt {\rtlch\fcs1 \af1 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 4}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \ab0\af31507\afs22 \ltrch\fcs0 \b0\fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248712"}{\rtlch\fcs1 \af0 -\ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310032000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 Project Repository}{ -\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248712 \\h }{\rtlch\fcs1 \af1 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310032000000}}}{\fldrslt {\rtlch\fcs1 \af1 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 5}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \ab0\af31507\afs22 \ltrch\fcs0 \b0\fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }\pard\plain \ltrpar\s176\ql \li1440\ri0\sb180\widctlpar\tqr\tldot\tx9883\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248713"}{\rtlch\fcs1 \af0 -\ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310033000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 Installation}{\rtlch\fcs1 -\af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248713 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310033000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 5}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248714"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310034000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 Versioning}{\rtlch\fcs1 -\af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248714 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310034000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 5}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }\pard\plain \ltrpar\s98\ql \li1080\ri0\sb120\keepn\widctlpar\tqr\tldot\tx9893\wrapdefault\nooverflow\faroman\rin0\lin1080\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248715"}{\rtlch\fcs1 \af0 -\ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310035000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 Project Layout}{\rtlch\fcs1 -\af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248715 \\h }{\rtlch\fcs1 \af1 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310035000000}}}{\fldrslt {\rtlch\fcs1 \af1 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 6}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \ab0\af31507\afs22 \ltrch\fcs0 \b0\fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }\pard\plain \ltrpar\s176\ql \li1440\ri0\sb180\widctlpar\tqr\tldot\tx9883\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248716"}{\rtlch\fcs1 \af0 -\ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310036000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 -Basic TWAIN C# Definitions and Helper Functions}{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF -_Toc87248716 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310036000000}}}{\fldrslt {\rtlch\fcs1 -\af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 6}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter -\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj {\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248717"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310037000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 -A TWAIN C# Diagnostic Application}{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248717 \\h -}{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310037000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 6}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248718"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310038000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 -A TWAIN C# Sample Application}{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248718 \\h }{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310038000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 7}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248719"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310039000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 -A TWAIN C# Self Certification Application}{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF -_Toc87248719 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700310039000000}}}{\fldrslt {\rtlch\fcs1 -\af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 7}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter -\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj {\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }\pard\plain \ltrpar\s98\ql \li1080\ri0\sb120\keepn\widctlpar\tqr\tldot\tx9893\wrapdefault\nooverflow\faroman\rin0\lin1080\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248720"}{\rtlch\fcs1 \af0 -\ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320030000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 Release Notes}{\rtlch\fcs1 -\af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248720 \\h }{\rtlch\fcs1 \af1 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320030000000}}}{\fldrslt {\rtlch\fcs1 \af1 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 8}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \ab0\af31507\afs22 \ltrch\fcs0 \b0\fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }\pard\plain \ltrpar\s176\ql \li1440\ri0\sb180\widctlpar\tqr\tldot\tx9883\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248721"}{\rtlch\fcs1 \af0 -\ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320031000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.5.0.0 (08-Nov-2021)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248721 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320031000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 8}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248722"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320032000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.11.0 (08-Jul-2020)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248722 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320032000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 8}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248723"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320033000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.10.0 (06-Jun-2020)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248723 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320033000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 8}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248724"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320034000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.9.0 (30-Apr-2020)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248724 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320034000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 8}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248725"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320035000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.8.0 (30-Mar-2020)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248725 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320035000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 9}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248726"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320036000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.6.0 (26-Mar-2020)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248726 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320036000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 9}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248727"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320037000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.5.0 (24-Mar-2020)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248727 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320037000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 9}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248728"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320038000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.4.0 (24-Mar-2020)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248728 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320038000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 9}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248729"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320039000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.3.0 (20-Mar-2020)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248729 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700320039000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 10}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248730"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330030000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.2.0 (13-Mar-2020)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248730 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330030000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 10}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248731"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330031000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.1.0 (30-Jan-2020)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248731 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330031000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 10}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248732"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330032000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.0.3 (13-Mar-2019)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248732 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330032000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 10}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248733"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330033000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.0.2 (25-Jan-2019)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248733 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330033000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 11}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248734"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330034000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.4.0.1 (19-Apr-2018)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248734 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330034000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 11}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248735"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330035000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 -V2.4.0.0 (darned if I know, 2017)}{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248735 \\h -}{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330035000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 11}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248736"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330036000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.3.2.0 (18-Oct-2015)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248736 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330036000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 11}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248737"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330037000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.3.1.2 (13-Sep-2015)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248737 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330037000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 12}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248738"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330038000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.3.1.1 (27-Aug-2015)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248738 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330038000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 12}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248739"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330039000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.3.1.0 (13-Mar-2015)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248739 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700330039000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 12}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248740"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340030000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.3.0.6 (30-Oct-2014)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248740 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340030000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 12}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248741"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340031000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.3.0.5 (19-Oct-2014)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248741 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340031000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 13}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248742"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340032000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.3.0.4 (13-Oct-2014)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248742 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340032000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 13}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248743"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340033000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.2.0 (11-Jul-2014)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248743 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340033000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 13}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248744"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340034000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.1.0 (09-Jul-2014)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248744 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340034000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 14}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248745"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340035000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V2.0.0 (21-May-2014)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248745 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340035000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 14}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248746"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340036000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V1.1.0 (27-Feb-2014)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248746 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340036000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 14}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1196296 HYPERLINK \\l "_Toc87248747"}{\rtlch\fcs1 -\af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 {\*\datafield -08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340037000000}}}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \cs187\b\ul\cf2\lang1024\langfe1024\noproof\insrsid1196296\charrsid12086908 V1.0.0 (05-Nov-2013)}{ -\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 \tab }{\field{\*\fldinst {\rtlch\fcs1 \af45 \ltrch\fcs0 \lang1024\langfe1024\noproof\webhidden\insrsid1196296 PAGEREF _Toc87248747 \\h }{\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 {\*\datafield 08d0c9ea79f9bace118c8200aa004ba90b02000000080000000d0000005f0054006f006300380037003200340038003700340037000000}}}{\fldrslt {\rtlch\fcs1 \af45 \ltrch\fcs0 -\lang1024\langfe1024\noproof\webhidden\insrsid1196296 15}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj }}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \fs22\lang1024\langfe1024\loch\af31506\hich\af31506\dbch\af31505\noproof\insrsid1196296 -\par }\pard\plain \ltrpar\s98\ql \li1440\ri0\sb120\keep\keepn\widctlpar\tqr\tldot\tx9893\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 }} -\pard\plain \ltrpar\s98\ql \li1440\ri0\sb120\keep\keepn\widctlpar\tqr\tldot\tx9893\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \ab\af1\afs20\alang1025 \ltrch\fcs0 \b\f1\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj {\rtlch\fcs1 \af1 \ltrch\fcs0 \f31506\cf9\insrsid6441407 {\*\bkmkstart _Toc234021027} -\par }\pard\plain \ltrpar\ql \li720\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af45 \ltrch\fcs0 -\f31506\insrsid6441407 -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af51 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\ql \li720\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 {\rtlch\fcs1 \af1\afs36 \ltrch\fcs0 \b\f37\fs36\cf9\insrsid6441407 -\par }\pard\plain \ltrpar\s1\ql \li90\ri0\sb720\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp120 \wrapdefault\nooverflow\faroman\outlinelevel0\rin0\lin90\itap0 \rtlch\fcs1 \ab\af1\afs36\alang1025 \ltrch\fcs0 -\b\f1\fs36\cf9\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 {\rtlch\fcs1 \af1 \ltrch\fcs0 \b0\f37\insrsid6441407 \page }{\rtlch\fcs1 \af1 \ltrch\fcs0 \f37\noproof0\insrsid6441407 {\*\bkmkstart _Toc87248710}Purpose{\*\bkmkend _Toc87248710} - -\par }\pard\plain \ltrpar\ql \li1440\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af45\afs22 \ltrch\fcs0 -\f37\fs22\insrsid6441407 This document serves as a brief introduction to the TWAIN CS projects. It assumes familiarity with the C# programming language, and a basic understanding of the TWAIN Specification. -\par The version number supplied in the title is a guide to when the document -was last modified. TWAIN supports feature negotiated interoperability between all versions of TWAIN enabled applications, TWAIN drivers (data sources), and the TWAIN Data Source Manager. -\par }{\rtlch\fcs1 \af45 \ltrch\fcs0 \f37\insrsid6441407 -\par }\pard\plain \ltrpar\s1\ql \li0\ri0\sb720\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp120 \wrapdefault\nooverflow\faroman\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \ab\af1\afs36\alang1025 \ltrch\fcs0 -\b\f1\fs36\cf9\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 {\rtlch\fcs1 \af1 \ltrch\fcs0 \f37\insrsid6441407 {\*\bkmkstart _Toc87248711}License{\*\bkmkend _Toc87248711} -\par }\pard\plain \ltrpar\ql \li1440\ri0\widctlpar\wrapdefault\faauto\rin0\lin1440\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af50 \ltrch\fcs0 \f37\insrsid6441407 -\par }{\rtlch\fcs1 \af50\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 Copyright (C) 2013-202}{\rtlch\fcs1 \af50\afs22 \ltrch\fcs0 \f37\fs22\insrsid8668465 1}{\rtlch\fcs1 \af50\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 Kodak Alaris Inc. -\par -\par Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u -se, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -\par -\par The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -\par -\par THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND N -ONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALIN -GS IN THE SOFTWARE. -\par }\pard \ltrpar\ql \li720\ri0\sb180\keep\keepn\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 {\rtlch\fcs1 \af1\afs36 \ltrch\fcs0 \b\f37\fs36\cf9\insrsid6441407 -\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin720\itap0 {\rtlch\fcs1 \af51 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard\plain \ltrpar\s189\ql \li0\ri0\keepn\pagebb\widctlpar\brdrt\brdrs\brdrw30\brsp120 \wrapdefault\nooverflow\faroman\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \ab\af1\afs24\alang1025 \ltrch\fcs0 -\b\f1\fs24\cf9\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 {\rtlch\fcs1 \af1\afs36 \ltrch\fcs0 \f31506\fs36\noproof0\insrsid6441407 {\*\bkmkstart _Toc87248712}Project Repository{\*\bkmkend _Toc87248712} -\par }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 - -\par }\pard\plain \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\f31506\cf6\insrsid6441407 [Technical Notes]}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \i\v\f31506\fs20\cf6\insrsid6441407 -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\v\f31506\cf6\insrsid6441407 I think we made a mistake here. All of the capabilities that use TW_ARRAY containers only show TW_ONEVALUE as the valid container for MSG_SET. It should be TW_ONEVALUE and TW_ARRAY. -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\f31506\cf6\insrsid6441407 -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 TWAIN for C-Sharp (C#) resides on GitHub at }{\field{\*\fldinst {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 HYPERLINK "https://github.com/twain/twain-cs" }{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\datafield -00d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90b5c000000680074007400700073003a002f002f006700690074006800750062002e0063006f006d002f0074007700610069006e002f0074007700610069006e002d00630073000000795881f43b1d7f48af2c825dc485 -276300000000a5ab00030000001500ef000000ff}}}{\fldrslt {\rtlch\fcs1 \af37 \ltrch\fcs0 \cs187\ul\cf2\insrsid6441407 https://github.com/twain/twain-cs}}}\sectd \ltrsect\rtlgutter\psz1\linex0\endnhere\pgbrdropt32\sectdefaultcl\sectrsid6896082\sftnbj { -\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 . -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248713}Installation{\*\bkmkend _Toc87248713} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 -\par There is a releases folder that contains release and debug copies of the binaries. There is no installation kit, just run them as-is. If running on Linux or macOS it may be necessary to install or upgrade Mono to v4.8 or higher. The certification tool -automatically creates a \lquote TWAIN Self Certification\rquote folder on the user\rquote s desktop, which contains all the stuff needed for certification. -\par -\par -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248714}Versioning{\*\bkmkend _Toc87248714} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 -\par The versioning scheme takes the form: TWAIN-ProtocolMajor.TWAIN-ProtocolMinor.Interface.Build -\par -\par If the TWAIN Specification is at 2.3 then the version will be 2.3.i.b. This is for notational purposes only, TWAIN interoperates at all versions of the protocol, so there is no requirement that a developer has to use any specific version, or i -mmediately upgrade if there is a change to the TWAIN Specification. -\par -\par The interface number rises if there is a modification to the TWAINCS that requires a code change in TWAINCSTest or TWAINCSScan. This lets a developer know that downloading the new versio -n will most likely require some work in their code before they can use it. This assumption always applies when the TWAIN Specification changes, so the interface number resets to 0 when they are modified. -\par -\par The build number tracks releases for a given version of the TWAIN Specification, and always rises until a new version of the spec is adopted. -\par -\par So, for example (fictitious sequence, just to show how it works): -\par -\par 2.3.0.0 \endash initial release to go with TWAIN 2.3 -\par 2.3.0.1 \endash bug fix -\par 2.3.0.2 \endash bug fix -\par 2.3.1.3 \endash interface change -\par 2.3.1.4 \endash bug fix -\par 2.4.0.0 \endash initial release to go with TWAIN 2.4 -\par -\par }\pard\plain \ltrpar\s189\ql \li0\ri0\keepn\pagebb\widctlpar\brdrt\brdrs\brdrw30\brsp120 \wrapdefault\nooverflow\faroman\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \ab\af1\afs24\alang1025 \ltrch\fcs0 -\b\f1\fs24\cf9\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 {\rtlch\fcs1 \af1\afs36 \ltrch\fcs0 \f31506\fs36\noproof0\insrsid6441407 {\*\bkmkstart _Toc87248715}Project Layout{\*\bkmkend _Toc87248715} -\par }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 - -\par }\pard\plain \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\f31506\cf6\insrsid6441407 [Technical Notes]}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \i\v\f31506\fs20\cf6\insrsid6441407 -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\v\f31506\cf6\insrsid6441407 I think we made a mistake here. All of the capabilities that use TW_ARRAY containers only show TW_ONEVALUE as the valid container for MSG_SET. It should be TW_ONEVALUE and TW_ARRAY. -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\f31506\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 -There are five projects in the TWAIN CS repository, with a single solution file to access them all: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 Basic TWAIN C# Definitions and Helper Functions -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}A TWAIN C# Diagnostic Application -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}A TWAIN C# Sample Application -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}{\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 A TWAIN C# Self Certification Application -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid8668465 The}{\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 }{\rtlch\fcs1 \af37 \ltrch\fcs0 -\f31506\insrsid8668465 a}{\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 pplications reference the }{\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid8668465 basic definitions and helper function}{\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 . -}{\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid8668465 Previous versions used a toolkit layer, but this introduced more complexity than it removed}{\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid1196296 , so it was deleted}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\f31506\insrsid6441407 . -\par -\par It\rquote s assumed that application writers will opt t -o pull this source code into a single assembly, the most common selection being the basic definitions and the sample application. Updates will be accomplished by pulling in newer versions of these files. Updates will typically come from the basic defini -tions. -\par -\par If you decide to keep the items as separate projects, then make a note of the inside of each of the .csproj files. Replacing the platform\\configuration folder names with }{\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 $(Platform)\\ -$(Configuration) makes for a much better build experience, since the references correctly track to the current settings. -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\f31506\ul\insrsid6441407 {\*\bkmkstart _Toc87248716}Basic TWAIN C# Definitions and Helper Functions -{\*\bkmkend _Toc87248716} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506\insrsid6441407 -TWAINH.CS contains all of the C/C++ TWAIN.H definitions for the version of TWAIN referenced on the title page of this document. -\par -\par TWAIN.CS contains helper functions designed to hide platform specific details, and to promote best practices when interfacing with the TWAIN Data Source Manager and TWAIN drivers. Best practices cover a few areas: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506\insrsid6441407 Funnel all commands through a single thread -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Automatically collect the condition code when TWRC.Failure is detected -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Automatically resynchronize the TWAIN state if a sequence error is detected -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \f37\fs22\insrsid8668465 \hich\af37\dbch\af0\loch\f37 -\tab}}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506\insrsid8668465 Access}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506\insrsid6441407 - the data through CSV strings -\par }\pard \ltrpar\s199\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506\insrsid6441407 -\par Both files expose their functionality through the TWAIN class in the TWAINWorkingGroup namespace. -\par -\par -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\f31506\ul\insrsid6441407 {\*\bkmkstart _Toc87248717}A TWAIN C# Diagnostic Application -{\*\bkmkend _Toc87248717} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506\insrsid6441407 The code is not intended as seed code for applications. It is a comprehens -ive frontend to the TWAIN API. It allows the selection of any combination of TWAIN triplets, including ones that are illegal or are out of sequence with the current TWAIN state. It is best compared to the TWACKER application, which has long been the mai -n way to exercise TWAIN drivers on Microsoft Windows systems. -\par -\par Data is presented and consumed in the form of CSV strings. Familiarity with the various TWAIN structures is essential, since these strings do not include self-referential metadata, aside from t -he content described by the TWAIN Specification. As mentioned above, }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6441407 it helps to have access to a copy of TWAINH.CS handy when looking at the CSV data.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506\insrsid6441407 - -\par -\par The application tries to reduce mouse clicks for some common operations. For instance, upon successfu -l completion of the DG_CONTROL / DAT_PARENT / MSG_OPENDSM operation, the dropdown values are set to DG_CONTROL / DAT_IDENTITY / MSG_GETFIRST, to enumerate the first TWAIN driver in the list of drivers. After a few uses it\rquote -ll be apparent when the application is trying to help. -\par -\par A @-command system has been added. It doesn\rquote t do much at the moment, but it could be expanded to allow for more complex behavior. For instance, some kind of scripting system that would allow the diagnostic tool to help with automat -ed tests. It becomes available after opening a DSM. Type @help in the text box and press the Send button to get the list of supported commands. -\par -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8668465 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\f31506\ul\insrsid6441407 {\*\bkmkstart _Toc87248718}A TWAIN C# Sample Application -{\*\bkmkend _Toc87248718} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f31506\insrsid6441407 The code is intended as seed code for applications, -and demonstrates the easiest way to access the full range of functionality present in TWAIN. -\par -\par For TWAIN drivers that support DG_CONTROL / DAT_USERINTERFACE / MSG_ENABLEDSUIONLY and DG_CONTROL / DAT_CUSTOMDSDATA / MSG_*, the application supports a \'93snapshot\'94 - system. This allows a user to configure a TWAIN driver and save its setting under a descriptive name that can be used to restore those settings prior to scanning. -\par -\par For drivers that don\rquote t support these operations the application defaults to the older }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6441407 DG_CONTROL / DAT_USERINTERFACE / MSG_ENABLEDS system, with TW_USERINTERFACE.ShowUI set to TRUE. -\par -\par }\pard \ltrpar\s199\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid8668465 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6441407 -An application writer also has the option to programmatically negotiate capabilities. The sample app doesn\rquote t show this path, but it\rquote s relatively easy to add for a small number of configurable items.}{\rtlch\fcs1 \af0 \ltrch\fcs0 -\f31506\insrsid6441407\charrsid8668465 -\par }\pard \ltrpar\s199\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6441407 -\par -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248719}A TWAIN C# Self Certification Application -{\*\bkmkend _Toc87248719} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6441407 -\par }\pard \ltrpar\s199\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6441407 This application serves three purposes. I -t shows a reasonably good way of interfacing with TWAIN from C#. It allows a user to interact directly with a TWAIN driver (with the aid of scripts). And it offers a way to certify that a TWAIN driver is compliant with the specification. -\par -\par Note that the correct binary must be run to interface with 32-bit or 64-bit drivers. This code has been tested on Windows, Linux, and Mac (the last two using Mono 4.8 or later). -\par -\par The tool has help built into it. It also comes with a large collection of scripts. If you use the \lquote runv\rquote command with the script, you\rquote ll get some insight into what arguments are needed for the \lquote dsmentry\rquote command. - -\par -\par It should be a good tool for developers, allowing them to explore the kind of commands they\rquote ll need to issue from other languages, like C++. -\par -\par }\pard \ltrpar\s199\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid8668465 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6441407 If developing with the tool, it\rquote -ll use the data folder located with the binary. The release version normally defaults to the \'93TWAIN Self Certification/data\'94 folder on the desktop.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6441407\charrsid8668465 -\par }\pard\plain \ltrpar\s189\ql \li0\ri0\keepn\pagebb\widctlpar\brdrt\brdrs\brdrw30\brsp120 \wrapdefault\nooverflow\faroman\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \ab\af1\afs24\alang1025 \ltrch\fcs0 -\b\f1\fs24\cf9\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 {\rtlch\fcs1 \af1\afs36 \ltrch\fcs0 \f31506\fs36\noproof0\insrsid6441407 {\*\bkmkstart _Toc87248720}Release Notes{\*\bkmkend _Toc87248720} -\par }\pard\plain \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37 \ltrch\fcs0 -\i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid8668465 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid8668465 {\*\bkmkstart _Toc87248721}V2.5.0.0 (}{\rtlch\fcs1 \af37 -\ltrch\fcs0 \b\ul\insrsid472724 08}{\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid8668465 -Nov-2021)}{\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid8668465 {\*\bkmkend _Toc87248721} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8668465 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid8668465 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid8668465 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid8668465 Updated to version 2.5 of the TWAIN Specification -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid472724 \hich\af37\dbch\af0\loch\f37 -\tab}}{\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid472724 Certification tests for barcode, image address, patch code, printer}{ -\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid8668465 -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid472724 \hich\af37\dbch\af0\loch\f37 -\tab}}{\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid472724 Obsolete toolkit code removed -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8668465 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid8668465 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid8668465 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid8668465 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8668465 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid8668465 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid8668465 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid8668465 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8668465 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid8668465 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid472724 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid472724 Switch}{\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid8668465 - to something other than WinForms -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid8668465 -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248722}V2.4.11.0 (08-Jul-2020)}{\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 {\*\bkmkend _Toc87248722} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Added deprecated }{\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid472724 capabilities}{ -\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 to LookupTable.tc -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Fixed cert to skip deprecated }{\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid472724 capabilities}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Fixed to better handle when a driver isn\rquote t successfully opened (skip the tests) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Want to switch to something other than WinForms, especially for macOS -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Need to add some more certification tests, especially for things like printer, barcode, patch -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248723}V2.4.10.0 (06-Jun-2020)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248723} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Fixed twaincert.exe to run from the releases folder without thinking it\rquote -s a development path, so it correctly creates the \lquote data\rquote folder in the \lquote TWAIN Self Certification\rquote folder on the desktop. -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Want to switch to something other than WinForms, especially for macOS -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Need to add some more certification tests, especially for things like printer, barcode, patch -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248724}V2.4.9.0 (30-Apr-2020)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248724} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 -The MSG_SET certification test was using the MSG_GET container, when the 2.4 spec states that it should only use TW_ONEVALUE or TW_ARRAY (the others being for MSG_SETCONTAINER), so that\rquote s fixed now -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Fixed -TWBP_* values to not return symbolic names, the support for symbolic names with TW_RANGE gets too weird too fast, staying with numbers offers fewer problems -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Want to switch to something other than WinForms, especially for macOS -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Need to add some more certification tests, especially for things like printer, barcode, patch -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248725}V2.4.8.0 (30-Mar-2020)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248725} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Switched almost all of the csv functions to static -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}(yah, skipped 2.4.7, kinda) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Want to switch to something other than WinForms, especially for macOS -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Need to add some more certification tests, especially for things like printer, barcode, patch -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248726}V2.4.6.0 (26-Mar-2020)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248726} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 MSG_XFERREADY wasn\rquote t being handled properly if ShowUI was TRUE -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Want to switch to something other than WinForms, especially for macOS -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Need to add some more certification tests, especially for things like printer, barcode, patch -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248727}V2.4.5.0 (24-Mar-2020)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248727} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Stupid data folder wasn\rquote t being properly created (grrr) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Want to switch to something other than WinForms, especially for macOS -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Need to add some more certification tests, especially for things like printer, barcode, patch -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248728}V2.4.4.0 (24-Mar-2020)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248728} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Fixed issues related to TWAIN Direct support, and added it to certification -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Added makerelease.bat file -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Want to switch to something other than WinForms, especially for macOS -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Need to add some more certification tests, especially for things like printer, barcode, patch -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248729}V2.4.3.0 (20-Mar-2020)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248729} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Switched twaincsscan and twaincstst to directly access TWAIN.CS -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}The toolkit is officially deprecated now, don\rquote t use it -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Fixed an issue where xferready during enableds could be missed -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Want to switch to something other than WinForms, especially for macOS -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Need to add some more certification tests, especially for things like printer, barcode, patch -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248730}V2.4.2.0 (13-Mar-2020)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248730} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Massive update to TWAIN.CS -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}twaincscert is pretty much done -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Too many to count, twaincscert helped scrub the code -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Want to switch to something other than WinForms, especially for macOS -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Need to add some more certification tests, especially for things like printer, barcode, patch -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248731}V2.4.1.0 (30-Jan-2020)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248731} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Added twaincscert project (it\rquote s not done yet, but it is useable) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Fixed reflection to allow use of capability enumerations in the CSV (ex: TWPT_RGB) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Expanded ability to use TWAIN.CS without the toolkit (needed for cert) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (appears to be a WinForms bug) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 64-bit Mono support on Mac OS X (should just work, but needs building / testing) - -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Want to switch to Xamarin -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248732}V2.4.0.3 (13-Mar-2019)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248732} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Fixed an encoding problem, TWAIN -on Windows requires strings in the encoding specified by the driver (either through it\rquote -s TW_IDENTITY.Version.Language or the last successful set of CAP_LANGUAGE). Until this fix TWAIN CS was sending strings as UTF-8. Note that on Linux and macOS UTF-8 is the encoding, that hasn\rquote t changed. -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (appears to be a WinForms bug) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 64-bit Mono support on Mac OS X (should just work, but needs building / testing) - -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Want to switch to Xamarin -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248733}V2.4.0.2 (25-Jan-2019)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248733} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 In sync with TWAIN Direct -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Updated to VS2017 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Fixed problem with FIX32 in TW_RANGE -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Fixed problems with SendDat for custom DAT support -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (appears to be a WinForms bug) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 64-bit Mono support on Mac OS X (should just work, but needs building / testing) - -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Want to switch to Xamarin -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248734}V2.4.0.1 (19-Apr-2018)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248734} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 In sync with TWAIN Direct -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Code analysis with VS2015, fixed up everything, supressed some stuff -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Finally got the Linux 64-bit thing right (lots of edge cases) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (appears to be a WinForms bug) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 64-bit Mono support on Mac OS X (should just work, but needs building / testing) - -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Want to switch to Xamarin, and VS2017 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248735}V2.4.0.0 (darned if I know, 2017)}{\rtlch\fcs1 \af37 -\ltrch\fcs0 \insrsid6441407 {\*\bkmkend _Toc87248735} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Linux 64-bit support, despite the TW_INT32/TW_UINT32 fiasco -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Switched to log file backup scheme -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}In sync with TWAIN Direct -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (appears to be a WinForms bug) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 64-bit Mono support on Mac OS X (should just work, but needs building / testing) - -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248736}V2.3.2.0 (18-Oct-2015)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248736} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Override capability for logging -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Log files are now read shared, so they can be viewed while the code is running -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}RunInGuiThread scheme added to support Windows for bug listed below -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Added thread and state to the log lines, added OS to the title line -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 -DAT_USERINTERFACE and DAT_IMAGE*XFER run on the HWND thread on Windows, this fixes problems with a number of drivers that run their code in the message loop (addresses Ticket #11 and Ticket #14) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}DsmMemLock on the native transfer handle (addresses Ticket #15) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}I\rquote m not closing the tickets until I get feedback, or if I hear nothing for a month or two -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (appears to be a WinForms bug) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 64-bit Mono support on Mac OS X (should just work, but needs building / testing) - -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248737}V2.3.1.2 (13-Sep-2015)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248737} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Solved issues with the DsmMem* functions -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (appears to be a WinForms bug) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 64-bit Mono support on Mac OS X (should just work, but needs building / testing) - -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248738}V2.3.1.1 (27-Aug-2015)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248738} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Log fix and sync with TWAIN Direct -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (appears to be a WinForms bug) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 64-bit Mono support on Mac OS X (should just work, but needs building / testing) - -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248739}V2.3.1.0 (13-Mar-2015)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248739} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Additional arguments to the ReportImage callback -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 -Tested building using MonoDevelop on Ubuntu 14.04 (32-bit) using Mono 3.12.1, fixed two problems -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (appears to be a WinForms bug) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 64-bit Mono support on Mac OS X (should just work, but needs building / testing) - -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248740}V2.3.0.6 (30-Oct-2014)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248740} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Closed Ticket #6: DsmMemFree - Validate -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Ticket #5 has been resisting, this time I got it right\'85 -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Removed embedded tabs -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Confirmed successful tests with other vendors -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Fixed code to better handle when TWAIN DSM isn\rquote t installed -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (appears to be a WinForms bug) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 64-bit Mono support on Mac OS X (should just work, but needs building / testing) - -\par }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f37\cf6\insrsid6441407 - -\par }\pard\plain \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\cf6\insrsid6441407 [Technical Notes]}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \i\v\fs20\cf6\insrsid6441407 -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\v\cf6\insrsid6441407 I think we made a mistake here. All of the capabilities that use TW_ARRAY containers only show TW_ONEVALUE as the valid container for MSG_SET. It should be TW_ONEVALUE and TW_ARRAY. -\par }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f37\cf6\insrsid6441407 - -\par }\pard\plain \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\cf6\insrsid6441407 [Technical Notes]}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \i\v\fs20\cf6\insrsid6441407 -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\v\cf6\insrsid6441407 I think we made a mistake here. All of the capabilities that use TW_ARRAY containers only show TW_ONEVALUE as the valid container for MSG_SET. It should be TW_ONEVALUE and TW_ARRAY. -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248741}V2.3.0.5 (19-Oct-2014)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248741} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Closed Ticket #3: can\'b4t get capabilities; what can i get out of a_szMemref? -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Closed Ticket #4: Setup Scanner does not work in twancsscan (dialog freezes) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Closed Ticket #5: Twain.DatParent - CloseDs should be CloseDsm -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Figured out the message pump issue -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Fixed SetImagePath to impact file transfers -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (looks like a race condition) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Only tested on Kodak Alaris products and the TWAIN Sample Data Source -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Test with other vendors -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}64-bit Mono support on Mac OS X (should just work, but needs building / testing) -\par }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f37\cf6\insrsid6441407 - -\par }\pard\plain \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\cf6\insrsid6441407 [Technical Notes]}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \i\v\fs20\cf6\insrsid6441407 -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\v\cf6\insrsid6441407 I think we made a mistake here. All of the capabilities that use TW_ARRAY containers only show TW_ONEVALUE as the valid container for MSG_SET. It should be TW_ONEVALUE and TW_ARRAY. -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248742}V2.3.0.4 (13-Oct-2014)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248742} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Trackin -g the version number to the TWAIN Specification, so the major and minor will be the protocol value, the third number will call out major changes in the API within a version, and the fourth number will count minor changes to the API (like bug fixes) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Added logging (still some work to do on this) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Added auto JPEG/TIFF option for file transfers -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Fixed DAT_IMAGEMEMFILEXFER for Mac OS X -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (looks like a race condition) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Only tested on Kodak Alaris products and the TWAIN Sample Data Source -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Test with other vendors -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}64-bit Mono support on Mac OS X (should just work, but needs testing) -\par }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f37\cf6\insrsid6441407 - -\par }\pard\plain \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\cf6\insrsid6441407 [Technical Notes]}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \i\v\fs20\cf6\insrsid6441407 -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\v\cf6\insrsid6441407 I think we made a mistake here. All of the capabilities that use TW_ARRAY containers only show TW_ONEVALUE as the valid container for MSG_SET. It should be TW_ONEVALUE and TW_ARRAY. -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248743}V2.2.0 (11-Jul-2014)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248743} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 (none) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Fixed DAT_IMAGEMEMFILEXFER -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (looks like a race condition) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Only tested on Kodak Alaris products and the TWAIN Sample Data Source -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Test with other vendors -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}64-bit Mono support on Mac OS X (should just work, but needs testing) -\par }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 - -\par }\pard\plain \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\f31506\cf6\insrsid6441407 [Technical Notes]}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \i\v\f31506\fs20\cf6\insrsid6441407 -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\v\f31506\cf6\insrsid6441407 I think we made a mistake here. All of the capabilities that use TW_ARRAY containers only show TW_ONEVALUE as the valid container for MSG_SET. It should be TW_ONEVALUE and TW_ARRAY. -\par }{\rtlch\fcs1 \af37 \ltrch\fcs0 \i\f31506\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248744}V2.1.0 (09-Jul-2014)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248744} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 ReportImage\rquote s bitmap no long locks access to the file -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Bug Fixes: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Handles MSG_XFERREADY when issued from MSG_ENABLEDS -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (looks like a race condition) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Only tested on Kodak Alaris products and the TWAIN Sample Data Source -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Test with other vendors -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}64-bit Mono support on Mac OS X (should just work, but needs testing) -\par }\pard \ltrpar\s199\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\f31506\ul\insrsid6441407 {\*\bkmkstart _Toc87248745}V2.0.0 (21-May-2014)}{\rtlch\fcs1 \af37 -\ltrch\fcs0 \f31506\insrsid6441407 {\*\bkmkend _Toc87248745} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 Support for 64-bit Linux (native only, 32-bit on 64-bit is too nasty) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}ShowImage renamed to ReportImage -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (looks like a race condition) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Only tested on Kodak Alaris products -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \f31506\insrsid6441407 Test with other vendors -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}64-bit Mono support on Mac OS X (should just work, but needs testing) -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248746}V1.1.0 (27-Feb-2014)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248746} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Additional arguments in ShowImage -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Code example of CAP_INDICATORS in TWAINCSScan -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Fixed projects to handle conditional references -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Added AnyCPU support -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (looks like a race condition) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Only tested on Kodak Alaris products -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Test with other vendors -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}64-bit Mono support on Linux and Mac OS X -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \i\cf6\insrsid6441407 -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \b\ul\insrsid6441407 {\*\bkmkstart _Toc87248747}V1.0.0 (05-Nov-2013)}{\rtlch\fcs1 \af37 \ltrch\fcs0 -\insrsid6441407 {\*\bkmkend _Toc87248747} -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 New Features: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Initial release -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Known Issues: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Runs rather slowly on Mac OS X -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Setup Dialog sometimes freaks out on Mac OS X (looks like a race condition) -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}Only tested on Kodak Alaris products -\par }\pard \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Wish List: -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}}\pard \ltrpar -\s199\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid6441407 Test with other vendors -\par {\listtext\pard\plain\ltrpar \s199 \rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \f37\fs22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 -\tab}64-bit Mono support on Linux and Mac OS X}{\rtlch\fcs1 \af46 \ltrch\fcs0 \f31506\insrsid6441407 -\par }\pard\plain \ltrpar\s189\ql \li0\ri0\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp120 \wrapdefault\nooverflow\faroman\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \ab\af1\afs24\alang1025 \ltrch\fcs0 -\b\f1\fs24\cf9\lang1024\langfe1024\cgrid\noproof\langnp1033\langfenp1033 {\rtlch\fcs1 \af1 \ltrch\fcs0 \v\f31506\noproof0\insrsid6441407 {\*\bkmkend _Toc234021027}General Comments }{\rtlch\fcs1 \af1 \ltrch\fcs0 \v\f31506\cf6\noproof0\insrsid6441407 [DONE] -}{\rtlch\fcs1 \af1 \ltrch\fcs0 \v\f31506\noproof0\insrsid6441407 -\par }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 - -\par }\pard\plain \ltrpar\s199\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\f31506\cf6\insrsid6441407 [Technical Notes]}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \i\v\f31506\fs20\cf6\insrsid6441407 -\par These are areas of discussion which may or may not lead to changes in the TWAIN Specification. If changes do result, they\rquote ll be moved into their own area. There are no Update Instructions in this section. When we\rquote re done with it, it -\rquote ll be moved to the end of the document and given a status of \'93DONE\'94\'85 -\par }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\insrsid6441407 - -\par -\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 [Note] \endash DONE -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \i\v\f31506\fs22\insrsid6441407 Does a Boolean enumeration have an expected order to the TRUE/FALSE values in the list? - -\par 8-22 (hunt this down and fix it) -\par We don\rquote t want the values ordered, except in the context where the order impacts the UI, but there is no way to know if this is happening or not\'85 -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af46 \ltrch\fcs0 \v\f31506\insrsid6441407 Stores a group of individual values describing a capability. The values are ordered from lowest to -\par highest values, but the step size between each value is probably not uniform. Such a list would be -\par useful to describe the discreet resolutions of a capture device supporting, say, 75, 150, 300, 400, -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af46 \ltrch\fcs0 \v\f31506\insrsid6441407 and 800 dots per inch.}{\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \i\v\f31506\fs22\insrsid6441407 -\par -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 { -\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \i\v\f31506\fs22\insrsid6441407 No, there is no required order for items in an enumeration or an array. Ideally the Data Source would maintain t -he order of items send to it, and display the items in that order in the GUI, but I don\rquote t believe there is anything in the Specification that even suggests that much. -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\insrsid6441407 -\par -\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 [Note] \endash DONE -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \i\v\f31506\fs22\insrsid6441407 In particular, I was working on ICAP_BITDEPTH. If a Data Source only supp -orts a single bitdepth for each specific pixeltype, wouldn\rquote t it make sense to respond that SET and RESET are not supported? There would be no reason to do a set of Bitdepth, since only a single value is supported at a time. -\par -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 { -\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \i\v\f31506\fs22\insrsid6441407 I wonder if there should be a paragraph on this matter. Here\rquote -s my take on it. Applications tend to do one of two things when confronted by an error: they ignore it or they fail (sometimes they crash). With that in mind a driver should always avoid returning an error if it has a val -id alternative that allows it to return success instead. Therefore, MSG_RESET and MSG_SET should always be allowed for capabilities that support a single value, except in those cases where the Specification makes it clear that the value is read only (li -ke CAP_DEVICEONLINE). -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\insrsid6441407 -\par -\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 [Note] \endash DONE -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \i\v\f31506\fs22\insrsid6441407 -Also regarding ICAP_BITDEPTH, am I correct in understanding that a MSG_GET for this capability should only report the available values based on the current setting for PIXELTYPE? Ie. Don\rquote -t report all the bitdepths supported, only those supported for the current pixel type? -\par -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 { -\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \i\v\f31506\fs22\insrsid6441407 This is correct. We know that some drivers show all of the bitdepth values for all of the supported pixeltypes. It doesn\rquote -t look like we have a comment on this in the Legacy Issues section (3-39, PDF 71). -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}Add a test to the self cert to watch out for this\'85 (this has been added to the Proposed Changes doc) -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\insrsid6441407 -\par -\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 \page [Note] \endash DONE -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \i\v\f31506\fs22\insrsid6441407 -I have a question regarding the filename extension used in a File Transfer. The filename is provided in the DG_CONTROL/DAT_SETUPFILEXFER/MSG_SET message. Do I need - to make sure the requested filename extension matches the type of the file I end up creating? -\par }{\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 -\par A couple of examples: -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f37\fs22\cf22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 1)\tab}}\pard \ltrpar -\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls10\adjustright\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 Simple case: if \'93filexfer.tmp\'94 is requested, I\rquote -m guessing I should use the file extension as requested regardless of file type that I create. (ie. Even though I save a tiff/jpg/bmp etc. file, continue using the .tmp extention) Is this correct? -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f37\fs22\cf22\insrsid6441407 \hich\af37\dbch\af0\loch\f37 2)\tab}More complex case: Assume I\rquote m doing auto color detect, and my non-color will be mapped to BW. If \'93filexfer.jpg -\'94 is requested and I detect a non-color image, this will be an *}{\rtlch\fcs1 \ab\af0\afs22 \ltrch\fcs0 \b\v\f31506\fs22\insrsid6441407 incorrect}{\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 -* name in the end since I cannot save a BW image as a JPG file. I will create a BMP file instead. Should I change the requested filename to \'93filexfer.bmp\'94 in this c -ase? Or still use the filename as requested even though it gives the wrong impression of filetype? -\par }\pard \ltrpar\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 If I don\rquote -t use the filename exactly as requested, does the TWAIN app think the transfer failed? They really have no way to know what I saved it as if I make a change, so it seems the filename better not change, even in the case that it is incorrect. -\par -\par Do you know of some TWAIN apps that use FileXfer that I could try this with? -\par -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 { -\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 TWAIN doesn\rquote t recommend or enforce filename extensions for TWFF_* file formats. This means that someone could produce a ridiculous result (like image.bmp for a JPEG image), but that -\rquote s okay, because application writers are free to use whatever naming system they need. -\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 { -\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 The only time a file transfer should fail is in situations where the application\rquote s request can\rquote -t be met. For example, if TWFF_JFIF is requested for a TWPT_BW TWCP_GROUP4 compressed image. -\par }\pard\plain \ltrpar\s199\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\f31506\insrsid6441407 -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard\plain \ltrpar -\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0\afs22 -\ltrch\fcs0 \v\f31506\fs22\insrsid6441407 Note that DAT_IMAGEFILEXFER is still considered optional, so few - drivers support it. It was designed as a low memory transfer option, since the driver is able to transfer the image directly to disk. Most application choose to do this themselves, and using DAT_IMAGEMEMXFER can achieve results that require little memo -ry, though an extra step is often needed to create the finished file, since the metadata that describes the image isn\rquote t available until state 7. -\par }\pard\plain \ltrpar\s199\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\f31506\insrsid6441407 -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard\plain \ltrpar -\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0\afs22 -\ltrch\fcs0 \v\f31506\fs22\insrsid6441407 I don\rquote t know of any commonly used TWAIN applications that use DAT_IMAGEFILEXFER. -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \v\f31506\fs22\cf22\insrsid6441407 -\par }\pard \ltrpar\ql \li0\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\insrsid6441407 \page -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 [Note] \endash DONE -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 For capabil -ities (ch.10 pages), if MSG_GET supports both TW_ONEVALUE and TW_ENUMERATION; should MSG_SET support both as well? Nowhere does the spec include TW_ ENUMERATION as a valid set container, but I think this is allowed. -\par -\par Oh....ICAP_HALFTONETYPES is the only cap I found that lists TW_ENUMERATION as a SET Container type. -\par -\par Do I correctly understand that you could replace MSG_SET with MSG_SETCONSTRAINT, and never use MSG_SET anymore? Ie. If sending a TW_ONEVALUE or TW_ARRAY via the MSG_SETCONSTRAINT, this is equivalent to the MSG_SET functionality. -\par -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 { -\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 I can say with confidence that this part of the Spec hasn\rquote -t exactly turned out as planned. The intention was to separate setting values from setting constraints. However, I would always expect that one can call MSG_G -ET, MSG_GETCURRENT and take the result and pass it into MSG_SET. The difference is that if both the application and the driver report themselves as 2.2 or higher the driver only takes the value from MSG_SET. -\par }\pard \ltrpar\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 { -\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 The situation as described means that MSG_GE -T cannot be used as the input to MSG_SET. I think that results in too much work for applications and drivers, given the radical departure from previous behavior. -\par }\pard\plain \ltrpar\s199\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\f31506\insrsid6441407 -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard\plain \ltrpar -\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0\afs22 -\ltrch\fcs0 \v\f31506\fs22\insrsid6441407 Using TW_ONEVALUE with MSG_SETCONTRAINT should constrain the capability to that one value. Also, the value is always set with MSG_SETCONTRAINT. -\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 { -\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 Therefore, we need to make sure that t -he Spec clearly explains the difference between MSG_SET and MSG_SETCONTRAINT, and then make sure that for all capabilities the allowed containers for both MSG_SET and MSG_SETCONSTRAINT are identical. -\par }\pard\plain \ltrpar\s199\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\f31506\insrsid6441407 -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard\plain \ltrpar -\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0\afs22 -\ltrch\fcs0 \v\f31506\fs22\insrsid6441407 I\rquote m pretty sure that Self-Cert will support this change (meaning that it assumes that a MSG_GET can always be followed by a MSG_SET). I\rquote -d be very surprised if anybody changed the behavior of MSG_SET without asking us what we\rquote re thinking... -\par }\pard\plain \ltrpar\s199\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\f31506\insrsid6441407 -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard\plain \ltrpar -\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0\afs22 -\ltrch\fcs0 \v\f31506\fs22\insrsid6441407 MSG_SET will only impact the current value\'85 -\par }\pard \ltrpar\ql \li0\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\insrsid6441407 -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 \page [Note] \endash DONE -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 ICAP_XFERMECH (ch. 10, pg. 10-197): under Application section it reads, \'93 -The current value of ICAP_XFERMECH must match the data argument type when starting the transfer using the triplet: DG_IMAGE / DAT_IMAGExxxxXFER / MSG_GET.\'94 If it does not match, what should happen? -\par (NOTE: already discussed in the working group meeting on 17 July 2012) -\par -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 { -\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 My recollection from the meeting is as follows: -\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 { -\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 The TWAIN Spec says that apps need to set ICAP_XFERMECH in state 4 to the transfer mechanism that\rquote ll be used in state 6 and 7. However, some apps don\rquote t bother to do this. - -\par }\pard\plain \ltrpar\s199\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 -\v\f31506\insrsid6441407 -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\fs22\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard\plain \ltrpar -\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid6555766 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0\afs22 -\ltrch\fcs0 \v\f31506\fs22\insrsid6441407 The thought is to leave the requirement intact, but add a bit to the Legacy Issues section warning driver writers not to assume this will happen. -\par }\pard \ltrpar\ql \li0\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\insrsid6441407 -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 [Note] \endash DONE -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 (ch. 2, pg. 2-16) I think a couple of string types are missing. It says: \'93There are }{ -\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\ul\insrsid6441407 four}{\rtlch\fcs1 \af0\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 types of TWAIN strings defined for developer use:\'94 -, and then lists TW_STR32, TW_STR64, TW_STR128, and TW_STR256. But in twain.h, there are now TW_STR1024 and a TW_UNI512 types defined. Should these be added, for a total of 6? -\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \v\fs20\insrsid6441407 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\ls11\rin0\lin720\itap0\pararsid6555766 {\rtlch\fcs1 -\af0 \ltrch\fcs0 \v\f31506\insrsid6441407 TW_STR1024 and TW_UNI512 have been deprecated, so the number \lquote four\rquote is right.}{\rtlch\fcs1 \ab\af0\afs22 \ltrch\fcs0 \b\v\f31506\fs22\insrsid6441407 -\par }\pard \ltrpar\ql \li0\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\insrsid6441407 -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 [Note] \endash DONE -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 Do I understand correctly that MSG_GETDEFAULT should return the Source\rquote s *}{ -\rtlch\fcs1 \ab\af37\afs22 \ltrch\fcs0 \b\v\f31506\fs22\insrsid6441407 Preferred}{\rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 * default. But this may *}{\rtlch\fcs1 \ab\af37\afs22 \ltrch\fcs0 \b\v\f31506\fs22\insrsid6441407 not}{ -\rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 * be the value set when calling MSG_RESET, since MSG_RESET resets to the TWAIN default? If there is a Mandatory default, does MSG_GETDEFAULT need to return the mandatory default? -\par }\pard \ltrpar\ql \li0\ri0\sb180\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\insrsid6441407 -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \v\f31506\cf6\insrsid6441407 [Note] \endash DONE -\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af37\afs22 \ltrch\fcs0 \v\f31506\fs22\insrsid6441407 So is MSG_RESET meant to reset to the value listed in Ch. 10 a -lways? (whether or not this is a mandatory default) Only if Ch. 10 says \'93no default\'94 can the source reset it to a preferred or user value? -\par }\pard\plain \ltrpar\s199\ql \li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37 \ltrch\fcs0 -\i\v\f31506\cf6\insrsid6441407 -\par }\pard\plain \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af45\afs20\alang1025 \ltrch\fcs0 \f45\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs22 \ltrch\fcs0 -\v\f31506\fs22\cf23\insrsid6441407 -\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a -9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad -5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 -b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 -0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 -a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f -c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 -0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 -a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 -6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b -4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b -4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f -7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87 -615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad -79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b -5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab -999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9 -699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586 -8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6 -0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f -9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be -15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979 -3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d -32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a -f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86 -e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb -44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a -6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c -3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256 -5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276 -b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8 -c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e -51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95 -b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff -6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6 -9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239 -b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449 -59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8 -2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468 -656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4 -350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624 -52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141 -73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000 -0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000 -000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019 -0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000 -000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027 -00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000} -{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d -617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 -6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 -656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} -{\*\latentstyles\lsdstimax376\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdpriority0 \lsdlocked0 heading 1; -\lsdqformat1 \lsdpriority0 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority0 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority0 \lsdlocked0 heading 4;\lsdqformat1 \lsdpriority0 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority0 \lsdlocked0 heading 6; -\lsdqformat1 \lsdpriority0 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority0 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority0 \lsdlocked0 heading 9;\lsdsemihidden1 \lsdunhideused1 index 1;\lsdsemihidden1 \lsdunhideused1 index 2; -\lsdsemihidden1 \lsdunhideused1 index 3;\lsdsemihidden1 \lsdunhideused1 index 4;\lsdsemihidden1 \lsdunhideused1 index 5;\lsdsemihidden1 \lsdunhideused1 index 6;\lsdsemihidden1 \lsdunhideused1 index 7;\lsdsemihidden1 \lsdunhideused1 index 8; -\lsdsemihidden1 \lsdunhideused1 index 9;\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority0 \lsdlocked0 toc 3;\lsdpriority0 \lsdlocked0 toc 4;\lsdpriority0 \lsdlocked0 toc 5;\lsdpriority0 \lsdlocked0 toc 6; -\lsdpriority0 \lsdlocked0 toc 7;\lsdpriority0 \lsdlocked0 toc 8;\lsdpriority0 \lsdlocked0 toc 9;\lsdsemihidden1 \lsdunhideused1 Normal Indent;\lsdsemihidden1 \lsdunhideused1 footnote text;\lsdsemihidden1 \lsdunhideused1 annotation text; -\lsdsemihidden1 \lsdunhideused1 header;\lsdsemihidden1 \lsdunhideused1 footer;\lsdsemihidden1 \lsdunhideused1 index heading;\lsdqformat1 \lsdpriority0 \lsdlocked0 caption;\lsdsemihidden1 \lsdunhideused1 table of figures; -\lsdsemihidden1 \lsdunhideused1 envelope address;\lsdsemihidden1 \lsdunhideused1 envelope return;\lsdsemihidden1 \lsdunhideused1 footnote reference;\lsdsemihidden1 \lsdunhideused1 annotation reference;\lsdsemihidden1 \lsdunhideused1 line number; -\lsdsemihidden1 \lsdunhideused1 page number;\lsdsemihidden1 \lsdunhideused1 endnote reference;\lsdsemihidden1 \lsdunhideused1 endnote text;\lsdsemihidden1 \lsdunhideused1 table of authorities;\lsdsemihidden1 \lsdunhideused1 macro; -\lsdsemihidden1 \lsdunhideused1 toa heading;\lsdsemihidden1 \lsdunhideused1 List;\lsdsemihidden1 \lsdunhideused1 List Bullet;\lsdsemihidden1 \lsdunhideused1 List Number;\lsdsemihidden1 \lsdunhideused1 List 2;\lsdsemihidden1 \lsdunhideused1 List 3; -\lsdsemihidden1 \lsdunhideused1 List 4;\lsdsemihidden1 \lsdunhideused1 List 5;\lsdsemihidden1 \lsdunhideused1 List Bullet 2;\lsdsemihidden1 \lsdunhideused1 List Bullet 3;\lsdsemihidden1 \lsdunhideused1 List Bullet 4; -\lsdsemihidden1 \lsdunhideused1 List Bullet 5;\lsdsemihidden1 \lsdunhideused1 List Number 2;\lsdsemihidden1 \lsdunhideused1 List Number 3;\lsdsemihidden1 \lsdunhideused1 List Number 4;\lsdsemihidden1 \lsdunhideused1 List Number 5; -\lsdqformat1 \lsdpriority0 \lsdlocked0 Title;\lsdsemihidden1 \lsdunhideused1 Closing;\lsdsemihidden1 \lsdunhideused1 Signature;\lsdpriority0 \lsdlocked0 Default Paragraph Font;\lsdsemihidden1 \lsdunhideused1 Body Text; -\lsdsemihidden1 \lsdunhideused1 Body Text Indent;\lsdsemihidden1 \lsdunhideused1 List Continue;\lsdsemihidden1 \lsdunhideused1 List Continue 2;\lsdsemihidden1 \lsdunhideused1 List Continue 3;\lsdsemihidden1 \lsdunhideused1 List Continue 4; -\lsdsemihidden1 \lsdunhideused1 List Continue 5;\lsdsemihidden1 \lsdunhideused1 Message Header;\lsdqformat1 \lsdpriority0 \lsdlocked0 Subtitle;\lsdsemihidden1 \lsdunhideused1 Salutation;\lsdsemihidden1 \lsdunhideused1 Date; -\lsdsemihidden1 \lsdunhideused1 Body Text First Indent;\lsdsemihidden1 \lsdunhideused1 Body Text First Indent 2;\lsdsemihidden1 \lsdunhideused1 Note Heading;\lsdsemihidden1 \lsdunhideused1 Body Text 2;\lsdsemihidden1 \lsdunhideused1 Body Text 3; -\lsdsemihidden1 \lsdunhideused1 Body Text Indent 2;\lsdsemihidden1 \lsdunhideused1 Body Text Indent 3;\lsdsemihidden1 \lsdunhideused1 Block Text;\lsdsemihidden1 \lsdunhideused1 Hyperlink;\lsdsemihidden1 \lsdunhideused1 FollowedHyperlink; -\lsdqformat1 \lsdpriority0 \lsdlocked0 Strong;\lsdqformat1 \lsdpriority0 \lsdlocked0 Emphasis;\lsdsemihidden1 \lsdunhideused1 Document Map;\lsdsemihidden1 \lsdunhideused1 Plain Text;\lsdsemihidden1 \lsdunhideused1 E-mail Signature; -\lsdsemihidden1 \lsdunhideused1 HTML Top of Form;\lsdsemihidden1 \lsdunhideused1 HTML Bottom of Form;\lsdsemihidden1 \lsdunhideused1 Normal (Web);\lsdsemihidden1 \lsdunhideused1 HTML Acronym;\lsdsemihidden1 \lsdunhideused1 HTML Address; -\lsdsemihidden1 \lsdunhideused1 HTML Cite;\lsdsemihidden1 \lsdunhideused1 HTML Code;\lsdsemihidden1 \lsdunhideused1 HTML Definition;\lsdsemihidden1 \lsdunhideused1 HTML Keyboard;\lsdsemihidden1 \lsdunhideused1 HTML Preformatted; -\lsdsemihidden1 \lsdunhideused1 HTML Sample;\lsdsemihidden1 \lsdunhideused1 HTML Typewriter;\lsdsemihidden1 \lsdunhideused1 HTML Variable;Normal Table;\lsdsemihidden1 \lsdunhideused1 annotation subject;\lsdsemihidden1 \lsdunhideused1 No List; -\lsdsemihidden1 \lsdunhideused1 Outline List 1;\lsdsemihidden1 \lsdunhideused1 Outline List 2;\lsdsemihidden1 \lsdunhideused1 Outline List 3;Table Simple 1;Table Simple 2;Table Simple 3;Table Classic 1;Table Classic 2;Table Classic 3;Table Classic 4; -Table Colorful 1;Table Colorful 2;Table Colorful 3;Table Columns 1;Table Columns 2;Table Columns 3;Table Columns 4;Table Columns 5;Table Grid 1;Table Grid 2;Table Grid 3;Table Grid 4;Table Grid 5;Table Grid 6;Table Grid 7;Table Grid 8;Table List 1; -Table List 2;Table List 3;Table List 4;Table List 5;Table List 6;Table List 7;Table List 8;Table 3D effects 1;Table 3D effects 2;Table 3D effects 3;Table Contemporary;Table Elegant;Table Professional;Table Subtle 1;Table Subtle 2;Table Web 1;Table Web 2; -Table Web 3;\lsdsemihidden1 \lsdunhideused1 Balloon Text;\lsdpriority0 \lsdlocked0 Table Grid;Table Theme;\lsdsemihidden1 \lsdlocked0 Placeholder Text;\lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdpriority60 \lsdlocked0 Light Shading; -\lsdpriority61 \lsdlocked0 Light List;\lsdpriority62 \lsdlocked0 Light Grid;\lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdpriority65 \lsdlocked0 Medium List 1;\lsdpriority66 \lsdlocked0 Medium List 2; -\lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdpriority68 \lsdlocked0 Medium Grid 2;\lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdpriority70 \lsdlocked0 Dark List;\lsdpriority71 \lsdlocked0 Colorful Shading;\lsdpriority72 \lsdlocked0 Colorful List; -\lsdpriority73 \lsdlocked0 Colorful Grid;\lsdpriority60 \lsdlocked0 Light Shading Accent 1;\lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1; -\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdqformat1 \lsdpriority29 \lsdlocked0 Quote; -\lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1; -\lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;\lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdpriority60 \lsdlocked0 Light Shading Accent 2; -\lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 2; -\lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdpriority70 \lsdlocked0 Dark List Accent 2; -\lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdpriority61 \lsdlocked0 Light List Accent 3; -\lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 3; -\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 3; -\lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdpriority62 \lsdlocked0 Light Grid Accent 4; -\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 4; -\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; -\lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdpriority62 \lsdlocked0 Light Grid Accent 5; -\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; -\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 5; -\lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdpriority62 \lsdlocked0 Light Grid Accent 6; -\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 6; -\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 6; -\lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; -\lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdsemihidden1 \lsdunhideused1 \lsdpriority37 \lsdlocked0 Bibliography; -\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;\lsdpriority41 \lsdlocked0 Plain Table 1;\lsdpriority42 \lsdlocked0 Plain Table 2;\lsdpriority43 \lsdlocked0 Plain Table 3;\lsdpriority44 \lsdlocked0 Plain Table 4; -\lsdpriority45 \lsdlocked0 Plain Table 5;\lsdpriority40 \lsdlocked0 Grid Table Light;\lsdpriority46 \lsdlocked0 Grid Table 1 Light;\lsdpriority47 \lsdlocked0 Grid Table 2;\lsdpriority48 \lsdlocked0 Grid Table 3;\lsdpriority49 \lsdlocked0 Grid Table 4; -\lsdpriority50 \lsdlocked0 Grid Table 5 Dark;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 1; -\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 1;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 1;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 1; -\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 1;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 2;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 2; -\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 2;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 2; -\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 3;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 3;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 3;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 3; -\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 3;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 4; -\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 4;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 4;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 4;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 4; -\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 4;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 5; -\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 5;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 5;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 5; -\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 5;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 6;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 6; -\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 6;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 6; -\lsdpriority46 \lsdlocked0 List Table 1 Light;\lsdpriority47 \lsdlocked0 List Table 2;\lsdpriority48 \lsdlocked0 List Table 3;\lsdpriority49 \lsdlocked0 List Table 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark; -\lsdpriority51 \lsdlocked0 List Table 6 Colorful;\lsdpriority52 \lsdlocked0 List Table 7 Colorful;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 List Table 2 Accent 1;\lsdpriority48 \lsdlocked0 List Table 3 Accent 1; -\lsdpriority49 \lsdlocked0 List Table 4 Accent 1;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 1;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 1; -\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 List Table 2 Accent 2;\lsdpriority48 \lsdlocked0 List Table 3 Accent 2;\lsdpriority49 \lsdlocked0 List Table 4 Accent 2; -\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 2;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 3; -\lsdpriority47 \lsdlocked0 List Table 2 Accent 3;\lsdpriority48 \lsdlocked0 List Table 3 Accent 3;\lsdpriority49 \lsdlocked0 List Table 4 Accent 3;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 3; -\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 4;\lsdpriority47 \lsdlocked0 List Table 2 Accent 4; -\lsdpriority48 \lsdlocked0 List Table 3 Accent 4;\lsdpriority49 \lsdlocked0 List Table 4 Accent 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 4;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 4; -\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 List Table 2 Accent 5;\lsdpriority48 \lsdlocked0 List Table 3 Accent 5; -\lsdpriority49 \lsdlocked0 List Table 4 Accent 5;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 5;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 5; -\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 List Table 2 Accent 6;\lsdpriority48 \lsdlocked0 List Table 3 Accent 6;\lsdpriority49 \lsdlocked0 List Table 4 Accent 6; -\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Mention; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hashtag;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Unresolved Mention;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Link;}}{\*\datastore 01050000 -02000000180000004d73786d6c322e534158584d4c5265616465722e362e30000000000000000000000e0000 -d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff0900060000000000000000000000010000000100000000000000001000000200000001000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffdffffff04000000feffffff05000000fefffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffff010000000c6ad98892f1d411a65f0040963251e500000000000000000000000010b7 -95c29bd4d70103000000c0020000000000004d0073006f004400610074006100530074006f0072006500000000000000000000000000000000000000000000000000000000000000000000000000000000001a000101ffffffffffffffff02000000000000000000000000000000000000000000000010b795c29bd4d701 -10b795c29bd4d70100000000000000000000000056003500d00049004400d00043003000ce00c400da0045004f004b0057004c004f0051004400d7003300c0003d003d000000000000000000000000000000000032000101ffffffffffffffff03000000000000000000000000000000000000000000000010b795c29bd4 -d70110b795c29bd4d7010000000000000000000000004900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff04000000ffffffff000000000000000000000000000000000000000000000000 -000000000000000000000000000000000e0100000000000001000000020000000300000004000000feffffff060000000700000008000000090000000a000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e3c623a536f75726365732053656c65637465645374796c653d225c4150412e58534c22205374796c -654e616d653d224150412220786d6c6e733a623d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f6269626c696f6772617068792220786d6c6e733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e -6f72672f6f6666696365446f63756d656e742f323030362f6269626c696f677261706879223e3c2f623a536f75726365733e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f6469 -6e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b30463038464335352d394130302d344542412d383433382d4135384233393030463737367d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70 -656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573500072006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff000000000000 -0000000000000000000000000000000000000000000000000000000000000500000055010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000746f6d586d6c223e3c64733a736368656d61526566733e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f7267 -2f6f6666696365446f63756d656e742f323030362f6269626c696f677261706879222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f72654974656d3e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file diff --git a/src/NTwain-temp/TWAINWorkingGroup/TWAIN.cs b/src/NTwain-temp/TWAINWorkingGroup/TWAIN.cs deleted file mode 100644 index 4517800..0000000 --- a/src/NTwain-temp/TWAINWorkingGroup/TWAIN.cs +++ /dev/null @@ -1,15540 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////// -// -// TwainWorkingGroup.TWAIN -// -// This is a wrapper class for basic TWAIN functionality. It establishes -// behavior that every application should adhere to. It also hides OS -// specific details, so that toolkits or applications can use one unified -// interface to TWAIN. -// -/////////////////////////////////////////////////////////////////////////////////////// -// Author Date TWAIN Comment -// M.McLaughlin 17-May-2021 2.5.0.0 Updated to latest spec -// M.McLaughlin 13-Mar-2019 2.4.0.3 Add language code page support for strings -// M.McLaughlin 13-Nov-2015 2.4.0.0 Updated to latest spec -// M.McLaughlin 13-Sep-2015 2.3.1.2 DsmMem bug fixes -// M.McLaughlin 26-Aug-2015 2.3.1.1 Log fix and sync with TWAIN Direct -// M.McLaughlin 13-Mar-2015 2.3.1.0 Numerous fixes -// M.McLaughlin 13-Oct-2014 2.3.0.4 Added logging -// M.McLaughlin 24-Jun-2014 2.3.0.3 Stability fixes -// M.McLaughlin 21-May-2014 2.3.0.2 64-Bit Linux -// M.McLaughlin 27-Feb-2014 2.3.0.1 AnyCPU support -// M.McLaughlin 21-Oct-2013 2.3.0.0 Initial Release -/////////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2013-2021 Kodak Alaris Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -/////////////////////////////////////////////////////////////////////////////////////// - -using System; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Drawing; -using System.Globalization; -using System.IO; -using System.Runtime.InteropServices; -using System.Security.Permissions; -using System.Threading; - -namespace TWAINWorkingGroup -{ - /// - /// This is the base TWAIN class. It's versioned so that developers can - /// safely make a reference to it, if they don't want to actually include - /// the TWAIN modules in their project. - /// - /// Here are the goals of this class: - /// - /// - Make the interface better than raw TWAIN (like with C/C++), but don't - /// go as far as making a toolkit. Expose as much of TWAIN as possible. - /// Part of this involves making a CSV interface to abstract away some of - /// the pain of the C/C++ structures, especially TW_CAPABILITY. - /// - /// - Use type checking wherever possible. This is why the TWAIN contants - /// tend to be enumerations and why there are multiple entry points into - /// the DSM_Entry function. - /// - /// - Avoid unsafe code. We use marshalling, and we're forced to use some - /// unmanaged memory, but that's it. - /// - /// - Run thread safe. Force as many TWAIN calls into a single thread as - /// possible. The main exceptions are MSG_PROCESSEVENT and any of the - /// calls that unwind the state machine (ex: MSG_DISABLEDS). Otherwise - /// all of the calls are serialized through a single thread. - /// - /// - Avoid use of System.Windows content, so that the TWAIN assembly can be - /// used as broadly as possible (specifically with Mono). - /// - /// - Support all platforms. The code currently works on 32-bit and 64-bit - /// Windows. It's been tested on 32-bit Linux and Mac OS X (using Mono). - /// It should work as 64-bit on those platforms. We're also supporting - /// both TWAIN_32.DLL and TWAINDSM.DLL on Windows, and we'll support both - /// TWAIN.framework and a TWAINDSM.framework (whenever it gets created). - /// - /// - Virtualiaze all public functions so that developers can extended the - /// class with a minimum of fuss. - /// - public partial class TWAIN : IDisposable - { - /////////////////////////////////////////////////////////////////////////////// - // Public Functions, these are the essentials... - /////////////////////////////////////////////////////////////////////////////// - #region Public Functions... - - /// - /// Our constructor... - /// - /// Application manufacturer - /// Application product family - /// Name of the application - /// TWAIN protocol major (doesn't have to match TWAINH.CS) - /// TWAIN protocol minor (doesn't have to match TWAINH.CS) - /// Bitmask of DG_ flags - /// Country code for the application - /// Info about the application - /// Language code for the application - /// Application's major version - /// Application's minor version - /// Use the legacy DSM (like TWAIN_32.DLL) - /// Use callbacks instead of Windows post message - /// Function to receive device events - /// Function to handle scanning - /// Help us run in the GUI thread on Windows - /// window handle - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public TWAIN - ( - string a_szManufacturer, - string a_szProductFamily, - string a_szProductName, - ushort a_u16ProtocolMajor, - ushort a_u16ProtocolMinor, - uint a_u32SupportedGroups, - TWCY a_twcy, - string a_szInfo, - TWLG a_twlg, - ushort a_u16MajorNum, - ushort a_u16MinorNum, - bool a_blUseLegacyDSM, - bool a_blUseCallbacks, - DeviceEventCallback a_deviceeventback, - ScanCallback a_scancallback, - RunInUiThreadDelegate a_runinuithreaddelegate, - IntPtr a_intptrHwnd - ) - { - TW_IDENTITY twidentity; - - // Since we're using P/Invoke in this sample, the DLL - // is implicitly loaded as we access it, so we can - // never go lower than state 2... - m_state = STATE.S2; - - // Register the caller's info... - twidentity = default(TW_IDENTITY); - twidentity.Manufacturer.Set(a_szManufacturer); - twidentity.ProductFamily.Set(a_szProductFamily); - twidentity.ProductName.Set(a_szProductName); - twidentity.ProtocolMajor = a_u16ProtocolMajor; - twidentity.ProtocolMinor = a_u16ProtocolMinor; - twidentity.SupportedGroups = a_u32SupportedGroups; - twidentity.Version.Country = a_twcy; - twidentity.Version.Info.Set(a_szInfo); - twidentity.Version.Language = a_twlg; - twidentity.Version.MajorNum = a_u16MajorNum; - twidentity.Version.MinorNum = a_u16MinorNum; - m_twidentityApp = twidentity; - m_twidentitylegacyApp = TwidentityToTwidentitylegacy(twidentity); - m_twidentitymacosxApp = TwidentityToTwidentitymacosx(twidentity); - m_deviceeventcallback = a_deviceeventback; - m_scancallback = a_scancallback; - m_runinuithreaddelegate = a_runinuithreaddelegate; - m_intptrHwnd = a_intptrHwnd; - - // Help for RunInUiThread... - m_threaddataDatAudiofilexfer = default(ThreadData); - m_threaddataDatAudionativexfer = default(ThreadData); - m_threaddataDatCapability = default(ThreadData); - m_threaddataDatEvent = default(ThreadData); - m_threaddataDatExtimageinfo = default(ThreadData); - m_threaddataDatIdentity = default(ThreadData); - m_threaddataDatImagefilexfer = default(ThreadData); - m_threaddataDatImageinfo = default(ThreadData); - m_threaddataDatImagelayout = default(ThreadData); - m_threaddataDatImagememfilexfer = default(ThreadData); - m_threaddataDatImagememxfer = default(ThreadData); - m_threaddataDatImagenativexfer = default(ThreadData); - m_threaddataDatParent = default(ThreadData); - m_threaddataDatPendingxfers = default(ThreadData); - m_threaddataDatSetupfilexfer = default(ThreadData); - m_threaddataDatSetupmemxfer = default(ThreadData); - m_threaddataDatStatus = default(ThreadData); - m_threaddataDatUserinterface = default(ThreadData); - - // We always go through a discovery process, even on 32-bit... - m_linuxdsm = LinuxDsm.Unknown; - - // Placeholder for our DS identity... - m_twidentityDs = default(TW_IDENTITY); - m_twidentitylegacyDs = default(TW_IDENTITY_LEGACY); - m_twidentitymacosxDs = default(TW_IDENTITY_MACOSX); - - // We'll normally do an automatic get of DAT.STATUS, but if we'd - // like to turn it off, this is the variable to hit... - m_blAutoDatStatus = true; - - // Our helper functions from the DSM... - m_twentrypointdelegates = default(TW_ENTRYPOINT_DELEGATES); - - // Our events... - m_autoreseteventCaller = new AutoResetEvent(false); - m_autoreseteventThread = new AutoResetEvent(false); - m_autoreseteventRollback = new AutoResetEvent(false); - m_autoreseteventThreadStarted = new AutoResetEvent(false); - m_lockTwain = new Object(); - - // Windows only... - if (ms_platform == Platform.WINDOWS) - { - m_blUseLegacyDSM = a_blUseLegacyDSM; - m_blUseCallbacks = a_blUseCallbacks; - m_windowsdsmentrycontrolcallbackdelegate = WindowsDsmEntryCallbackProxy; - } - - // Linux only... - else if (ms_platform == Platform.LINUX) - { - // The user can't set these value, we have to decide automatically - // which DSM to use, and only callbacks are supported... - m_blUseLegacyDSM = false; - m_blUseCallbacks = true; - m_linuxdsmentrycontrolcallbackdelegate = LinuxDsmEntryCallbackProxy; - - // We assume the new DSM for 32-bit systems... - if (GetMachineWordBitSize() == 32) - { - m_blFound020302Dsm64bit = false; - if (File.Exists("/usr/local/lib64/libtwaindsm.so")) - { - m_blFoundLatestDsm64 = true; - } - if (File.Exists("/usr/local/lib/libtwaindsm.so")) - { - m_blFoundLatestDsm = true; - } - } - - // Check for the old DSM, but only on 64-bit systems... - if ((GetMachineWordBitSize() == 64) && File.Exists("/usr/local/lib/libtwaindsm.so.2.3.2")) - { - m_blFound020302Dsm64bit = true; - } - - // Check for any newer DSM, but only on 64-bit systems... - if ((GetMachineWordBitSize() == 64) && (File.Exists("/usr/local/lib/libtwaindsm.so") || File.Exists("/usr/local/lib64/libtwaindsm.so"))) - { - bool blCheckForNewDsm = true; - - // Get the DSMs by their fully decorated names... - string[] aszDsm = Directory.GetFiles("/usr/local/lib64", "libtwaindsm.so.*.*.*"); - if (aszDsm.Length == 0) - { - aszDsm = Directory.GetFiles("/usr/local/lib", "libtwaindsm.so.*.*.*"); - } - if ((aszDsm != null) && (aszDsm.Length > 0)) - { - // Check each name, we only want to launch the process if - // we find an old DSM... - foreach (string szDsm in aszDsm) - { - if ( szDsm.EndsWith("so.2.0") || szDsm.Contains(".so.2.0.") - || szDsm.EndsWith("so.2.1") || szDsm.Contains(".so.2.1.") - || szDsm.EndsWith("so.2.2") || szDsm.Contains(".so.2.2.") - || szDsm.EndsWith("so.2.3") || szDsm.Contains(".so.2.3.")) - { - // If we get a match, see if the symbolic link is - // pointing to old junk... - Process p = new Process(); - p.StartInfo.UseShellExecute = false; - p.StartInfo.RedirectStandardOutput = true; - p.StartInfo.FileName = "readlink"; - p.StartInfo.Arguments = "-e /usr/local/lib/libtwaindsm.so"; - p.Start(); - string szOutput = p.StandardOutput.ReadToEnd(); - p.WaitForExit(); - p.Dispose(); - // We never did any 1.x stuff... - if ( (szOutput != null) - && (szOutput.EndsWith(".so.2.0") || szOutput.Contains(".so.2.0.") - || szOutput.EndsWith(".so.2.1") || szOutput.Contains(".so.2.1.") - || szOutput.EndsWith(".so.2.2") || szOutput.Contains(".so.2.2.") - || szOutput.EndsWith(".so.2.3") || szOutput.Contains(".so.2.3."))) - { - // libtwaindsm.so is pointing to an old DSM... - blCheckForNewDsm = false; - } - break; - } - } - } - - // Is the symbolic link pointing to a new DSM? - if (blCheckForNewDsm && (aszDsm != null) && (aszDsm.Length > 0)) - { - foreach (string szDsm in aszDsm) - { - // I guess this is reasonably future-proof... - if ( szDsm.Contains("so.2.4") - || szDsm.Contains("so.2.5") - || szDsm.Contains("so.2.6") - || szDsm.Contains("so.2.7") - || szDsm.Contains("so.2.8") - || szDsm.Contains("so.2.9") - || szDsm.Contains("so.2.10") - || szDsm.Contains("so.2.11") - || szDsm.Contains("so.2.12") - || szDsm.Contains("so.2.13") - || szDsm.Contains("so.2.14") - || szDsm.Contains("so.3") - || szDsm.Contains("so.4")) - { - // libtwaindsm.so is pointing to a new DSM... - if (szDsm.Contains("lib64")) - { - m_blFoundLatestDsm64 = true; - } - else - { - m_blFoundLatestDsm = true; - } - break; - } - } - } - } - } - - // Mac OS X only... - else if (ms_platform == Platform.MACOSX) - { - m_blUseLegacyDSM = a_blUseLegacyDSM; - m_blUseCallbacks = true; - m_macosxdsmentrycontrolcallbackdelegate = MacosxDsmEntryCallbackProxy; - } - - // Uh-oh, Log will throw an exception for us... - else - { - TWAINWorkingGroup.Log.Assert("Unsupported platform..." + ms_platform); - } - - // Activate our thread... - /* - if (m_threadTwain == null) - { - m_twaincommand = new TwainCommand(); - m_threadTwain = new Thread(Main); - m_threadTwain.Start(); - if (!m_autoreseteventThreadStarted.WaitOne(5000)) - { - try - { - m_threadTwain.Abort(); - m_threadTwain = null; - } - catch (Exception exception) - { - // Log will throw an exception for us... - TWAINWorkingGroup.Log.Assert("Failed to start the TWAIN background thread - " + exception.Message); - } - } - } - */ - } - - /// - /// Cleanup... - /// - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] - [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Report the path to the DSM we're using... - /// - /// full path to the DSM - public string GetDsmPath() - { - string szDsmPath = ""; - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - if (m_blUseLegacyDSM) - { - szDsmPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "twain_32.dll"); - } - else - { - szDsmPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "twaindsm.dll"); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - szDsmPath = "/usr/local/lib64/libtwaindsm.so"; - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - szDsmPath = "/usr/local/lib/libtwaindsm.so"; - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - szDsmPath = "/usr/local/lib/libtwaindsm.so.2.3.2"; - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - if (m_blUseLegacyDSM) - { - szDsmPath = "/System/Library/Frameworks/TWAIN.framework/TWAIN"; - } - else - { - szDsmPath = "/Library/Frameworks/TWAIN.framework/TWAIN"; - } - } - - // If found... - if (File.Exists(szDsmPath)) - { - return (szDsmPath); - } - - // Ruh-roh... - if (string.IsNullOrEmpty(szDsmPath)) - { - return ("(could not identify a DSM candidate for this platform - '" + ms_platform + "')"); - } - - // Hmmm... - return ("(could not find '" + szDsmPath + "')"); - } - - /// - /// Get the identity of the current application... - /// - /// - public string GetAppIdentity() - { - return (IdentityToCsv(m_twidentityApp)); - } - - /// - /// Get the identity of the current driver, if we have one... - /// - /// - public string GetDsIdentity() - { - if (m_state < STATE.S4) - { - return (IdentityToCsv(default(TW_IDENTITY))); - } - return (IdentityToCsv(m_twidentityDs)); - } - - /// - /// Alloc memory used with the data source. - /// - /// Number of bytes to allocate - /// Point to memory - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public IntPtr DsmMemAlloc(uint a_u32Size, bool a_blForcePointer = false) - { - IntPtr intptr; - - // Use the DSM... - if ((m_twentrypointdelegates.DSM_MemAllocate != null) && !a_blForcePointer) - { - intptr = m_twentrypointdelegates.DSM_MemAllocate(a_u32Size); - if (intptr == IntPtr.Zero) - { - TWAINWorkingGroup.Log.Error("DSM_MemAllocate failed..."); - } - return (intptr); - } - - // Do it ourselves, Windows... - if (ms_platform == Platform.WINDOWS) - { - intptr = (IntPtr)NativeMethods.GlobalAlloc((uint)(a_blForcePointer ? 0x0040 /* GPTR */ : 0x0042 /* GHND */), (UIntPtr)a_u32Size); - if (intptr == IntPtr.Zero) - { - TWAINWorkingGroup.Log.Error("GlobalAlloc failed..."); - } - return (intptr); - } - - // Do it ourselves, Linux... - if (ms_platform == Platform.LINUX) - { - intptr = Marshal.AllocHGlobal((int)a_u32Size); - if (intptr == IntPtr.Zero) - { - TWAINWorkingGroup.Log.Error("AllocHGlobal failed..."); - } - return (intptr); - } - - // Do it ourselves, Mac OS X... - if (ms_platform == Platform.MACOSX) - { - IntPtr intptrIndirect = Marshal.AllocHGlobal((int)a_u32Size); - if (intptrIndirect == IntPtr.Zero) - { - TWAINWorkingGroup.Log.Error("AllocHGlobal(indirect) failed..."); - return (intptrIndirect); - } - IntPtr intptrDirect = Marshal.AllocHGlobal(Marshal.SizeOf(intptrIndirect)); - if (intptrDirect == IntPtr.Zero) - { - TWAINWorkingGroup.Log.Error("AllocHGlobal(direct) failed..."); - return (intptrDirect); - } - Marshal.StructureToPtr(intptrIndirect, intptrDirect, true); - return (intptrDirect); - } - - // Trouble, Log will throw an exception for us... - TWAINWorkingGroup.Log.Assert("Unsupported platform..." + ms_platform); - return (IntPtr.Zero); - } - - /// - /// Free memory used with the data source... - /// - /// Pointer to free - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public void DsmMemFree(ref IntPtr a_intptrHandle, bool a_blForcePointer = false) - { - // Validate... - if (a_intptrHandle == IntPtr.Zero) - { - return; - } - - // Use the DSM... - if ((m_twentrypointdelegates.DSM_MemAllocate != null) && !a_blForcePointer) - { - m_twentrypointdelegates.DSM_MemFree(a_intptrHandle); - } - - // Do it ourselves, Windows... - else if (ms_platform == Platform.WINDOWS) - { - NativeMethods.GlobalFree(a_intptrHandle); - } - - // Do it ourselves, Linux... - else if (ms_platform == Platform.LINUX) - { - Marshal.FreeHGlobal(a_intptrHandle); - } - - // Do it ourselves, Mac OS X... - else if (ms_platform == Platform.MACOSX) - { - // Free the indirect pointer... - IntPtr intptr = (IntPtr)Marshal.PtrToStructure(a_intptrHandle, typeof(IntPtr)); - if (intptr != IntPtr.Zero) - { - Marshal.FreeHGlobal(intptr); - } - - // If we free the direct pointer the CLR tells us that we're - // freeing something that was never allocated. We're going - // to believe it and not do a free. But I'm also leaving this - // here as a record of the decision... - //Marshal.FreeHGlobal(a_twcapability.hContainer); - } - - // Make sure the variable is cleared... - a_intptrHandle = IntPtr.Zero; - } - - /// - /// Lock memory used with the data source... - /// - /// Handle to lock - /// Locked pointer - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public IntPtr DsmMemLock(IntPtr a_intptrHandle) - { - // Validate... - if (a_intptrHandle == IntPtr.Zero) - { - return (a_intptrHandle); - } - - // Use the DSM... - if (m_twentrypointdelegates.DSM_MemLock != null) - { - return (m_twentrypointdelegates.DSM_MemLock(a_intptrHandle)); - } - - // Do it ourselves, Windows... - if (ms_platform == Platform.WINDOWS) - { - return (NativeMethods.GlobalLock(a_intptrHandle)); - } - - // Do it ourselves, Linux... - if (ms_platform == Platform.LINUX) - { - return (a_intptrHandle); - } - - // Do it ourselves, Mac OS X... - if (ms_platform == Platform.MACOSX) - { - IntPtr intptr = (IntPtr)Marshal.PtrToStructure(a_intptrHandle, typeof(IntPtr)); - return (intptr); - } - - // Trouble, Log will throw an exception for us... - TWAINWorkingGroup.Log.Assert("Unsupported platform..." + ms_platform); - return (IntPtr.Zero); - } - - /// - /// Unlock memory used with the data source... - /// - /// Handle to unlock - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public void DsmMemUnlock(IntPtr a_intptrHandle) - { - // Validate... - if (a_intptrHandle == IntPtr.Zero) - { - return; - } - - // Use the DSM... - if (m_twentrypointdelegates.DSM_MemUnlock != null) - { - m_twentrypointdelegates.DSM_MemUnlock(a_intptrHandle); - return; - } - - // Do it ourselves, Windows... - if (ms_platform == Platform.WINDOWS) - { - NativeMethods.GlobalUnlock(a_intptrHandle); - return; - } - - // Do it ourselves, Linux... - if (ms_platform == Platform.LINUX) - { - return; - } - - // Do it ourselves, Mac OS X... - if (ms_platform == Platform.MACOSX) - { - return; - } - - // Trouble, Log will throw an exception for us... - TWAINWorkingGroup.Log.Assert("Unsupported platform..." + ms_platform); - } - - /// - /// Report the current TWAIN state as we understand it... - /// - /// The current TWAIN state for the application - public STATE GetState() - { - return (m_state); - } - - /// - /// True if the DSM has the DSM2 flag set... - /// - /// True if we detect the TWAIN Working Group open source DSM - public bool IsDsm2() - { - // Windows... - if (ms_platform == Platform.WINDOWS) - { - return ((m_twidentitylegacyApp.SupportedGroups & (uint)DG.DSM2) != 0); - } - - // Linux... - if (ms_platform == Platform.LINUX) - { - return ((m_twidentitylegacyApp.SupportedGroups & (uint)DG.DSM2) != 0); - } - - // Mac OS X... - if (ms_platform == Platform.MACOSX) - { - return ((m_twidentitymacosxApp.SupportedGroups & (uint)DG.DSM2) != 0); - } - - // Trouble, Log will throw an exception for us... - TWAINWorkingGroup.Log.Assert("Unsupported platform..." + ms_platform); - return (false); - } - - /// - /// Have we seen the first image since MSG.ENABLEDS? - /// - /// True if the driver is ready to transfer images - public bool IsMsgXferReady() - { - return (m_blIsMsgxferready); - } - - /// - /// Has the cancel button been pressed since the last MSG.ENABLEDS? - /// - /// True if the cancel button was pressed - public bool IsMsgCloseDsReq() - { - return (m_blIsMsgclosedsreq); - } - - /// - /// Has the OK button been pressed since the last MSG.ENABLEDS? - /// - /// True if the OK button was pressed - public bool IsMsgCloseDsOk() - { - return (m_blIsMsgclosedsok); - } - - /// - /// Monitor for DAT.NULL / MSG.* stuff... - /// - /// Window handle that we're monitoring - /// A message - /// a parameter for the message - /// another parameter for the message - /// - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public bool PreFilterMessage - ( - IntPtr a_intptrHwnd, - int a_iMsg, - IntPtr a_intptrWparam, - IntPtr a_intptrLparam - ) - { - STS sts; - MESSAGE msg; - - // This is only in effect after MSG.ENABLEDS*, or if we are in - // the middle of processing DAT_USERINTERFACE. We don't want to - // bump to state 5 before processing DAT_USERINTERFACE, but some - // drivers are really eager to get going, and throw MSG_XFERREADY - // before even get a chance to finish the command... - if ((m_state < STATE.S5) && !m_blRunningDatUserinterface) - { - return (false); - } - - // Convert the data... - msg = new MESSAGE(); - msg.hwnd = a_intptrHwnd; - msg.message = (uint)a_iMsg; - msg.wParam = a_intptrWparam; - msg.lParam = a_intptrLparam; - - // Allocate memory that we can give to the driver... - if (m_tweventPreFilterMessage.pEvent == IntPtr.Zero) - { - m_tweventPreFilterMessage.pEvent = Marshal.AllocHGlobal(Marshal.SizeOf(msg) + 65536); - } - Marshal.StructureToPtr(msg, m_tweventPreFilterMessage.pEvent, true); - - // See if the driver wants the event... - m_tweventPreFilterMessage.TWMessage = 0; - sts = DatEvent(DG.CONTROL, MSG.PROCESSEVENT, ref m_tweventPreFilterMessage, true); - if ((sts != STS.DSEVENT) && (sts != STS.NOTDSEVENT)) - { - return (false); - } - - // All done, tell the app we consumed the event if we - // got back a status telling us that... - return (sts == STS.DSEVENT); - } - - /// - /// Rollback the TWAIN state machine to the specified value, with an - /// automatic resync if it detects a sequence error... - /// - /// The TWAIN state that we want to end up at - /// Use the thread (most cases) - static int s_iCloseDsmDelay = 0; - [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] - public TWAIN.STATE Rollback(STATE a_stateTarget, bool a_blUseThread = true) - { - int iRetry; - STS sts; - STATE stateStart; - - // Nothing to do here... - if (m_state <= STATE.S2) - { - return (m_state); - } - - // Submit the work to the TWAIN thread... - if (a_blUseThread) - { - if (m_runinuithreaddelegate != null) - { - lock (m_lockTwain) - { - // No point in continuing... - if (m_twaincommand == null) - { - return (m_state); - } - - // Set the command variables... - ThreadData threaddata = default(ThreadData); - threaddata.blExitThread = true; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply, the delay - // is needed because Mac OS X doesn't gracefully handle - // the loss of a mutex... - s_iCloseDsmDelay = 0; - CallerToThreadSet(); - ThreadToRollbackWaitOne(); - Thread.Sleep(s_iCloseDsmDelay); - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - } - else if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // No point in continuing... - if (m_twaincommand == null) - { - return (m_state); - } - - // Set the command variables... - ThreadData threaddata = default(ThreadData); - threaddata.stateRollback = a_stateTarget; - threaddata.blRollback = true; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply, the delay - // is needed because Mac OS X doesn't gracefully handle - // the loss of a mutex... - s_iCloseDsmDelay = 0; - CallerToThreadSet(); - ThreadToRollbackWaitOne(); - Thread.Sleep(s_iCloseDsmDelay); - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (m_state); - } - } - - // If we get a sequence error, then we'll repeat the loop from - // the highest possible state to see if we can fix the problem... - iRetry = 2; - stateStart = GetState(); - while (iRetry-- > 0) - { - // State 7 --> State 6... - if ((stateStart >= STATE.S7) && (a_stateTarget < STATE.S7)) - { - TW_PENDINGXFERS twpendingxfers = default(TW_PENDINGXFERS); - sts = DatPendingxfers(DG.CONTROL, MSG.ENDXFER, ref twpendingxfers); - if (sts == STS.SEQERROR) - { - stateStart = STATE.S7; - continue; - } - stateStart = STATE.S6; - } - - // State 6 --> State 5... - if ((stateStart >= STATE.S6) && (a_stateTarget < STATE.S6)) - { - TW_PENDINGXFERS twpendingxfers = default(TW_PENDINGXFERS); - sts = DatPendingxfers(DG.CONTROL, MSG.RESET, ref twpendingxfers); - if (sts == STS.SEQERROR) - { - stateStart = STATE.S7; - continue; - } - stateStart = STATE.S5; - } - - // State 5 --> State 4... - if ((stateStart >= STATE.S5) && (a_stateTarget < STATE.S5)) - { - TW_USERINTERFACE twuserinterface = default(TW_USERINTERFACE); - sts = DatUserinterface(DG.CONTROL, MSG.DISABLEDS, ref twuserinterface); - if (sts == STS.SEQERROR) - { - stateStart = STATE.S7; - continue; - } - if (m_tweventPreFilterMessage.pEvent != IntPtr.Zero) - { - Marshal.FreeHGlobal(m_tweventPreFilterMessage.pEvent); - m_tweventPreFilterMessage.pEvent = IntPtr.Zero; - } - stateStart = STATE.S4; - m_blAcceptXferReady = false; - m_blIsMsgclosedsok = false; - m_blIsMsgclosedsreq = false; - m_blIsMsgxferready = false; - } - - // State 4 --> State 3... - if ((stateStart >= STATE.S4) && (a_stateTarget < STATE.S4)) - { - sts = DatIdentity(DG.CONTROL, MSG.CLOSEDS, ref m_twidentityDs); - if (sts == STS.SEQERROR) - { - stateStart = STATE.S7; - continue; - } - stateStart = STATE.S3; - } - - // State 3 --> State 2... - if ((stateStart >= STATE.S3) && (a_stateTarget < STATE.S3)) - { - // Do this to prevent a deadlock on Mac OS X, two seconds - // better be enough to finish up... - if (GetPlatform() == Platform.MACOSX) - { - ThreadToRollbackSet(); - s_iCloseDsmDelay = 2000; - } - - // Now do the rest of it... - sts = DatParent(DG.CONTROL, MSG.CLOSEDSM, ref m_intptrHwnd); - if (sts == STS.SEQERROR) - { - stateStart = STATE.S7; - continue; - } - stateStart = STATE.S2; - } - - // All done... - break; - } - - // How did we do? - return (m_state); - } - - /// - /// Send a command to the currently loaded DSM... - /// - /// tokenized command and anything needed - /// true to quit - public TWAIN.STS Send(string a_szDg, string a_szDat, string a_szMsg, ref string a_szTwmemref, ref string a_szResult) - { - int iDg; - int iDat; - int iMsg; - TWAIN.STS sts; - TWAIN.DG dg = TWAIN.DG.MASK; - TWAIN.DAT dat = TWAIN.DAT.NULL; - TWAIN.MSG msg = TWAIN.MSG.NULL; - - // Init stuff... - iDg = 0; - iDat = 0; - iMsg = 0; - sts = TWAIN.STS.BADPROTOCOL; - a_szResult = ""; - - // Look for DG... - if (!a_szDg.ToLowerInvariant().StartsWith("dg_")) - { - TWAINWorkingGroup.Log.Error("Unrecognized dg - <" + a_szDg + ">"); - return (TWAIN.STS.BADPROTOCOL); - } - else - { - // Look for hex number (take anything)... - if (a_szDg.ToLowerInvariant().StartsWith("dg_0x")) - { - if (!int.TryParse(a_szDg.ToLowerInvariant().Substring(3), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out iDg)) - { - TWAINWorkingGroup.Log.Error("Badly constructed dg - <" + a_szDg + ">"); - return (TWAIN.STS.BADPROTOCOL); - } - } - else - { - if (!Enum.TryParse(a_szDg.ToUpperInvariant().Substring(3), out dg)) - { - TWAINWorkingGroup.Log.Error("Unrecognized dg - <" + a_szDg + ">"); - return (TWAIN.STS.BADPROTOCOL); - } - iDg = (int)dg; - } - } - - // Look for DAT... - if (!a_szDat.ToLowerInvariant().StartsWith("dat_")) - { - TWAINWorkingGroup.Log.Error("Unrecognized dat - <" + a_szDat + ">"); - return (TWAIN.STS.BADPROTOCOL); - } - else - { - // Look for hex number (take anything)... - if (a_szDat.ToLowerInvariant().StartsWith("dat_0x")) - { - if (!int.TryParse(a_szDat.ToLowerInvariant().Substring(4), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out iDat)) - { - TWAINWorkingGroup.Log.Error("Badly constructed dat - <" + a_szDat + ">"); - return (TWAIN.STS.BADPROTOCOL); - } - } - else - { - if (!Enum.TryParse(a_szDat.ToUpperInvariant().Substring(4), out dat)) - { - TWAINWorkingGroup.Log.Error("Unrecognized dat - <" + a_szDat + ">"); - return (TWAIN.STS.BADPROTOCOL); - } - iDat = (int)dat; - } - } - - // Look for MSG... - if (!a_szMsg.ToLowerInvariant().StartsWith("msg_")) - { - TWAINWorkingGroup.Log.Error("Unrecognized msg - <" + a_szMsg + ">"); - return (TWAIN.STS.BADPROTOCOL); - } - else - { - // Look for hex number (take anything)... - if (a_szMsg.ToLowerInvariant().StartsWith("msg_0x")) - { - if (!int.TryParse(a_szMsg.ToLowerInvariant().Substring(4), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out iMsg)) - { - TWAINWorkingGroup.Log.Error("Badly constructed dat - <" + a_szMsg + ">"); - return (TWAIN.STS.BADPROTOCOL); - } - } - else - { - if (!Enum.TryParse(a_szMsg.ToUpperInvariant().Substring(4), out msg)) - { - TWAINWorkingGroup.Log.Error("Unrecognized msg - <" + a_szMsg + ">"); - return (TWAIN.STS.BADPROTOCOL); - } - iMsg = (int)msg; - } - } - - // Send the command... - switch (iDat) - { - // Ruh-roh, since we can't marshal it, we have to return an error, - // it would be nice to have a solution for this, but that will need - // a dynamic marshalling system... - default: - sts = TWAIN.STS.BADPROTOCOL; - break; - - // DAT_AUDIOFILEXFER... - case (int)TWAIN.DAT.AUDIOFILEXFER: - { - sts = DatAudiofilexfer((TWAIN.DG)iDg, (TWAIN.MSG)iMsg); - a_szTwmemref = ""; - } - break; - - // DAT_AUDIOINFO.. - case (int)TWAIN.DAT.AUDIOINFO: - { - TWAIN.TW_AUDIOINFO twaudioinfo = default(TWAIN.TW_AUDIOINFO); - sts = DatAudioinfo((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twaudioinfo); - a_szTwmemref = AudioinfoToCsv(twaudioinfo); - } - break; - - // DAT_AUDIONATIVEXFER.. - case (int)TWAIN.DAT.AUDIONATIVEXFER: - { - IntPtr intptr = IntPtr.Zero; - sts = DatAudionativexfer((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref intptr); - a_szTwmemref = intptr.ToString(); - } - break; - - // DAT_CALLBACK... - case (int)TWAIN.DAT.CALLBACK: - { - TWAIN.TW_CALLBACK twcallback = default(TWAIN.TW_CALLBACK); - CsvToCallback(ref twcallback, a_szTwmemref); - sts = DatCallback((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twcallback); - a_szTwmemref = CallbackToCsv(twcallback); - } - break; - - // DAT_CALLBACK2... - case (int)TWAIN.DAT.CALLBACK2: - { - TWAIN.TW_CALLBACK2 twcallback2 = default(TWAIN.TW_CALLBACK2); - CsvToCallback2(ref twcallback2, a_szTwmemref); - sts = DatCallback2((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twcallback2); - a_szTwmemref = Callback2ToCsv(twcallback2); - } - break; - - // DAT_CAPABILITY... - case (int)TWAIN.DAT.CAPABILITY: - { - // Skip symbols for msg_querysupport, otherwise 0 gets turned into false, also - // if the command fails the return value is whatever was sent into us, which - // matches the experience one should get with C/C++... - string szStatus = ""; - TWAIN.TW_CAPABILITY twcapability = default(TWAIN.TW_CAPABILITY); - CsvToCapability(ref twcapability, ref szStatus, a_szTwmemref); - sts = DatCapability((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twcapability); - if ((sts == TWAIN.STS.SUCCESS) || (sts == TWAIN.STS.CHECKSTATUS)) - { - // Convert the data to CSV... - a_szTwmemref = CapabilityToCsv(twcapability, ((TWAIN.MSG)iMsg != TWAIN.MSG.QUERYSUPPORT)); - // Free the handle if the driver created it... - switch ((TWAIN.MSG)iMsg) - { - default: break; - case TWAIN.MSG.GET: - case TWAIN.MSG.GETCURRENT: - case TWAIN.MSG.GETDEFAULT: - case TWAIN.MSG.QUERYSUPPORT: - case TWAIN.MSG.RESET: - DsmMemFree(ref twcapability.hContainer); - break; - } - } - } - break; - - // DAT_CIECOLOR.. - case (int)TWAIN.DAT.CIECOLOR: - { - //TWAIN.TW_CIECOLOR twciecolor = default(TWAIN.TW_CIECOLOR); - //sts = m_twain.DatCiecolor((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twciecolor); - //a_szTwmemref = m_twain.CiecolorToCsv(twciecolor); - } - break; - - // DAT_CUSTOMDSDATA... - case (int)TWAIN.DAT.CUSTOMDSDATA: - { - TWAIN.TW_CUSTOMDSDATA twcustomdsdata = default(TWAIN.TW_CUSTOMDSDATA); - CsvToCustomdsdata(ref twcustomdsdata, a_szTwmemref); - sts = DatCustomdsdata((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twcustomdsdata); - a_szTwmemref = CustomdsdataToCsv(twcustomdsdata); - } - break; - - // DAT_DEVICEEVENT... - case (int)TWAIN.DAT.DEVICEEVENT: - { - TWAIN.TW_DEVICEEVENT twdeviceevent = default(TWAIN.TW_DEVICEEVENT); - sts = DatDeviceevent((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twdeviceevent); - a_szTwmemref = DeviceeventToCsv(twdeviceevent); - } - break; - - // DAT_ENTRYPOINT... - case (int)TWAIN.DAT.ENTRYPOINT: - { - TWAIN.TW_ENTRYPOINT twentrypoint = default(TWAIN.TW_ENTRYPOINT); - twentrypoint.Size = (uint)Marshal.SizeOf(twentrypoint); - sts = DatEntrypoint((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twentrypoint); - a_szTwmemref = EntrypointToCsv(twentrypoint); - } - break; - - // DAT_EVENT... - case (int)TWAIN.DAT.EVENT: - { - TWAIN.TW_EVENT twevent = default(TWAIN.TW_EVENT); - sts = DatEvent((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twevent); - a_szTwmemref = EventToCsv(twevent); - } - break; - - // DAT_EXTIMAGEINFO... - case (int)TWAIN.DAT.EXTIMAGEINFO: - { - TWAIN.TW_EXTIMAGEINFO twextimageinfo = default(TWAIN.TW_EXTIMAGEINFO); - CsvToExtimageinfo(ref twextimageinfo, a_szTwmemref); - sts = DatExtimageinfo((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twextimageinfo); - a_szTwmemref = ExtimageinfoToCsv(twextimageinfo); - } - break; - - // DAT_FILESYSTEM... - case (int)TWAIN.DAT.FILESYSTEM: - { - TWAIN.TW_FILESYSTEM twfilesystem = default(TWAIN.TW_FILESYSTEM); - CsvToFilesystem(ref twfilesystem, a_szTwmemref); - sts = DatFilesystem((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twfilesystem); - a_szTwmemref = FilesystemToCsv(twfilesystem); - } - break; - - // DAT_FILTER... - case (int)TWAIN.DAT.FILTER: - { - //TWAIN.TW_FILTER twfilter = default(TWAIN.TW_FILTER); - //m_twain.CsvToFilter(ref twfilter, a_szTwmemref); - //sts = m_twain.DatFilter((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twfilter); - //a_szTwmemref = m_twain.FilterToCsv(twfilter); - } - break; - - // DAT_GRAYRESPONSE... - case (int)TWAIN.DAT.GRAYRESPONSE: - { - //TWAIN.TW_GRAYRESPONSE twgrayresponse = default(TWAIN.TW_GRAYRESPONSE); - //m_twain.CsvToGrayresponse(ref twgrayresponse, a_szTwmemref); - //sts = m_twain.DatGrayresponse((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twgrayresponse); - //a_szTwmemref = m_twain.GrayresponseToCsv(twgrayresponse); - } - break; - - // DAT_ICCPROFILE... - case (int)TWAIN.DAT.ICCPROFILE: - { - TWAIN.TW_MEMORY twmemory = default(TWAIN.TW_MEMORY); - sts = DatIccprofile((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twmemory); - a_szTwmemref = IccprofileToCsv(twmemory); - } - break; - - // DAT_IDENTITY... - case (int)TWAIN.DAT.IDENTITY: - { - TWAIN.TW_IDENTITY twidentity = default(TWAIN.TW_IDENTITY); - switch (iMsg) - { - default: - break; - case (int)TWAIN.MSG.SET: - case (int)TWAIN.MSG.OPENDS: - CsvToIdentity(ref twidentity, a_szTwmemref); - break; - } - sts = DatIdentity((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twidentity); - a_szTwmemref = IdentityToCsv(twidentity); - } - break; - - // DAT_IMAGEFILEXFER... - case (int)TWAIN.DAT.IMAGEFILEXFER: - { - sts = DatImagefilexfer((TWAIN.DG)iDg, (TWAIN.MSG)iMsg); - a_szTwmemref = ""; - } - break; - - // DAT_IMAGEINFO... - case (int)TWAIN.DAT.IMAGEINFO: - { - TWAIN.TW_IMAGEINFO twimageinfo = default(TWAIN.TW_IMAGEINFO); - CsvToImageinfo(ref twimageinfo, a_szTwmemref); - sts = DatImageinfo((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twimageinfo); - a_szTwmemref = ImageinfoToCsv(twimageinfo); - } - break; - - // DAT_IMAGELAYOUT... - case (int)TWAIN.DAT.IMAGELAYOUT: - { - TWAIN.TW_IMAGELAYOUT twimagelayout = default(TWAIN.TW_IMAGELAYOUT); - CsvToImagelayout(ref twimagelayout, a_szTwmemref); - sts = DatImagelayout((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twimagelayout); - a_szTwmemref = ImagelayoutToCsv(twimagelayout); - } - break; - - // DAT_IMAGEMEMFILEXFER... - case (int)TWAIN.DAT.IMAGEMEMFILEXFER: - { - TWAIN.TW_IMAGEMEMXFER twimagememxfer = default(TWAIN.TW_IMAGEMEMXFER); - CsvToImagememxfer(ref twimagememxfer, a_szTwmemref); - sts = DatImagememfilexfer((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twimagememxfer); - a_szTwmemref = ImagememxferToCsv(twimagememxfer); - } - break; - - // DAT_IMAGEMEMXFER... - case (int)TWAIN.DAT.IMAGEMEMXFER: - { - TWAIN.TW_IMAGEMEMXFER twimagememxfer = default(TWAIN.TW_IMAGEMEMXFER); - CsvToImagememxfer(ref twimagememxfer, a_szTwmemref); - sts = DatImagememxfer((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twimagememxfer); - a_szTwmemref = ImagememxferToCsv(twimagememxfer); - } - break; - - // DAT_IMAGENATIVEXFER... - case (int)TWAIN.DAT.IMAGENATIVEXFER: - { - IntPtr intptrBitmapHandle = IntPtr.Zero; - sts = DatImagenativexferHandle((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref intptrBitmapHandle); - a_szTwmemref = intptrBitmapHandle.ToString(); - } - break; - - // DAT_JPEGCOMPRESSION... - case (int)TWAIN.DAT.JPEGCOMPRESSION: - { - //TWAIN.TW_JPEGCOMPRESSION twjpegcompression = default(TWAIN.TW_JPEGCOMPRESSION); - //m_twain.CsvToJpegcompression(ref twjpegcompression, a_szTwmemref); - //sts = m_twain.DatJpegcompression((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twjpegcompression); - //a_szTwmemref = m_twain.JpegcompressionToCsv(twjpegcompression); - } - break; - - // DAT_METRICS... - case (int)TWAIN.DAT.METRICS: - { - TWAIN.TW_METRICS twmetrics = default(TWAIN.TW_METRICS); - twmetrics.SizeOf = (uint)Marshal.SizeOf(twmetrics); - sts = DatMetrics((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twmetrics); - a_szTwmemref = MetricsToCsv(twmetrics); - } - break; - - // DAT_PALETTE8... - case (int)TWAIN.DAT.PALETTE8: - { - //TWAIN.TW_PALETTE8 twpalette8 = default(TWAIN.TW_PALETTE8); - //m_twain.CsvToPalette8(ref twpalette8, a_szTwmemref); - //sts = m_twain.DatPalette8((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twpalette8); - //a_szTwmemref = m_twain.Palette8ToCsv(twpalette8); - } - break; - - // DAT_PARENT... - case (int)TWAIN.DAT.PARENT: - { - sts = DatParent((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref m_intptrHwnd); - a_szTwmemref = ""; - } - break; - - // DAT_PASSTHRU... - case (int)TWAIN.DAT.PASSTHRU: - { - TWAIN.TW_PASSTHRU twpassthru = default(TWAIN.TW_PASSTHRU); - CsvToPassthru(ref twpassthru, a_szTwmemref); - sts = DatPassthru((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twpassthru); - a_szTwmemref = PassthruToCsv(twpassthru); - } - break; - - // DAT_PENDINGXFERS... - case (int)TWAIN.DAT.PENDINGXFERS: - { - TWAIN.TW_PENDINGXFERS twpendingxfers = default(TWAIN.TW_PENDINGXFERS); - sts = DatPendingxfers((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twpendingxfers); - a_szTwmemref = PendingxfersToCsv(twpendingxfers); - } - break; - - // DAT_RGBRESPONSE... - case (int)TWAIN.DAT.RGBRESPONSE: - { - //TWAIN.TW_RGBRESPONSE twrgbresponse = default(TWAIN.TW_RGBRESPONSE); - //m_twain.CsvToRgbresponse(ref twrgbresponse, a_szTwmemref); - //sts = m_twain.DatRgbresponse((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twrgbresponse); - //a_szTwmemref = m_twain.RgbresponseToCsv(twrgbresponse); - } - break; - - // DAT_SETUPFILEXFER... - case (int)TWAIN.DAT.SETUPFILEXFER: - { - TWAIN.TW_SETUPFILEXFER twsetupfilexfer = default(TWAIN.TW_SETUPFILEXFER); - CsvToSetupfilexfer(ref twsetupfilexfer, a_szTwmemref); - sts = DatSetupfilexfer((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twsetupfilexfer); - a_szTwmemref = SetupfilexferToCsv(twsetupfilexfer); - } - break; - - // DAT_SETUPMEMXFER... - case (int)TWAIN.DAT.SETUPMEMXFER: - { - TWAIN.TW_SETUPMEMXFER twsetupmemxfer = default(TWAIN.TW_SETUPMEMXFER); - sts = DatSetupmemxfer((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twsetupmemxfer); - a_szTwmemref = SetupmemxferToCsv(twsetupmemxfer); - } - break; - - // DAT_STATUS... - case (int)TWAIN.DAT.STATUS: - { - TWAIN.TW_STATUS twstatus = default(TWAIN.TW_STATUS); - sts = DatStatus((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twstatus); - a_szTwmemref = StatusToCsv(twstatus); - } - break; - - // DAT_STATUSUTF8... - case (int)TWAIN.DAT.STATUSUTF8: - { - TWAIN.TW_STATUSUTF8 twstatusutf8 = default(TWAIN.TW_STATUSUTF8); - sts = DatStatusutf8((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twstatusutf8); - a_szTwmemref = Statusutf8ToCsv(twstatusutf8); - } - break; - - // DAT_TWAINDIRECT... - case (int)TWAIN.DAT.TWAINDIRECT: - { - TWAIN.TW_TWAINDIRECT twtwaindirect = default(TWAIN.TW_TWAINDIRECT); - CsvToTwaindirect(ref twtwaindirect, a_szTwmemref); - sts = DatTwaindirect((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twtwaindirect); - a_szTwmemref = TwaindirectToCsv(twtwaindirect); - } - break; - - // DAT_USERINTERFACE... - case (int)TWAIN.DAT.USERINTERFACE: - { - TWAIN.TW_USERINTERFACE twuserinterface = default(TWAIN.TW_USERINTERFACE); - CsvToUserinterface(ref twuserinterface, a_szTwmemref); - sts = DatUserinterface((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref twuserinterface); - a_szTwmemref = UserinterfaceToCsv(twuserinterface); - } - break; - - // DAT_XFERGROUP... - case (int)TWAIN.DAT.XFERGROUP: - { - uint uXferGroup = 0; - sts = DatXferGroup((TWAIN.DG)iDg, (TWAIN.MSG)iMsg, ref uXferGroup); - a_szTwmemref = string.Format("0x{0:X}", uXferGroup); - } - break; - } - - // All done... - return (sts); - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Public Helper Functions, we're mapping TWAIN structures to strings to - // make it easier for the application to work with the data. All of the - // functions that do that are located here... - /////////////////////////////////////////////////////////////////////////////// - #region Public Helper Functions... - - /// - /// Copy intptr to intptr... - /// - /// - /// - /// - public static void MemCpy(IntPtr dest, IntPtr src, int count) - { - if (TWAIN.GetPlatform() == TWAIN.Platform.WINDOWS) - { - NativeMethods.CopyMemory(dest, src, (uint)count); - } - else - { - NativeMethods.memcpy(dest, src, (IntPtr)count); - } - } - - /// - /// Safely move intptr to intptr... - /// - /// - /// - /// - public static void MemMove(IntPtr dest, IntPtr src, int count) - { - if (TWAIN.GetPlatform() == TWAIN.Platform.WINDOWS) - { - NativeMethods.MoveMemory(dest, src, (uint)count); - } - else - { - NativeMethods.memmove(dest, src, (IntPtr)count); - } - } - - /// - /// Write stuff to a file without having to rebuffer it... - /// - /// - /// - /// - /// - public static int WriteImageFile(string a_szFilename, IntPtr a_intptrPtr, int a_iBytes, out string a_szFinalFilename) - { - // Init stuff... - a_szFinalFilename = ""; - - // Try to write our file... - try - { - // If we don't have an extension, try to add one... - if (!Path.GetFileName(a_szFilename).Contains(".") && (a_iBytes >= 2)) - { - byte[] abData = new byte[2]; - Marshal.Copy(a_intptrPtr, abData, 0, 2); - // BMP - if ((abData[0] == 0x42) && (abData[1] == 0x4D)) // BM - { - a_szFilename += ".bmp"; - } - else if ((abData[0] == 0x49) && (abData[1] == 0x49)) // II - { - a_szFilename += ".tif"; - } - else if ((abData[0] == 0xFF) && (abData[1] == 0xD8)) - { - a_szFilename += ".jpg"; - } - else if ((abData[0] == 0x25) && (abData[1] == 0x50)) // %P - { - a_szFilename += ".pdf"; - } - } - - // For the caller... - a_szFinalFilename = a_szFilename; - - // Handle Windows... - if (TWAIN.GetPlatform() == TWAIN.Platform.WINDOWS) - { - IntPtr intptrFile; - IntPtr intptrBytes = (IntPtr)a_iBytes; - IntPtr intptrCount = (IntPtr)1; - if (NativeMethods._wfopen_s(out intptrFile, a_szFilename, "wb") != 0) - { - return (-1); - } - intptrBytes = NativeMethods.fwriteWin(a_intptrPtr, intptrCount, intptrBytes, intptrFile); - NativeMethods.fcloseWin(intptrFile); - return ((int)intptrBytes); - } - - // Handle everybody else... - else - { - IntPtr intptrFile; - IntPtr intptrBytes; - intptrFile = NativeMethods.fopen(a_szFilename, "w"); - if (intptrFile == IntPtr.Zero) - { - return (-1); - } - intptrBytes = NativeMethods.fwrite(a_intptrPtr, (IntPtr)1, (IntPtr)a_iBytes, intptrFile); - NativeMethods.fclose(intptrFile); - return ((int)intptrBytes); - } - } - catch (Exception exception) - { - Log.Error("Write file failed <" + a_szFilename + "> - " + exception.Message); - return (-1); - } - } - - /// - /// Convert the contents of an audio info to a string that we can show in - /// our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string AudioinfoToCsv(TW_AUDIOINFO a_twaudioinfo) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twaudioinfo.Name.Get()); - csv.Add(a_twaudioinfo.Reserved.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a callback to a string that we can show in - /// our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string CallbackToCsv(TW_CALLBACK a_twcallback) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twcallback.CallBackProc.ToString()); - csv.Add(a_twcallback.RefCon.ToString()); - csv.Add(a_twcallback.Message.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a string to an callback structure... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToCallback(ref TW_CALLBACK a_twcallback, string a_szCallback) - { - // Init stuff... - a_twcallback = default(TW_CALLBACK); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szCallback); - - // Grab the values... - a_twcallback.CallBackProc = (IntPtr)UInt64.Parse(asz[0]); - a_twcallback.RefCon = uint.Parse(asz[1]); - a_twcallback.Message = ushort.Parse(asz[2]); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a callback2 to a string that we can show in - /// our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string Callback2ToCsv(TW_CALLBACK2 a_twcallback2) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twcallback2.CallBackProc.ToString()); - csv.Add(a_twcallback2.RefCon.ToString()); - csv.Add(a_twcallback2.Message.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a string to an callback2 structure... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToCallback2(ref TW_CALLBACK2 a_twcallback2, string a_szCallback2) - { - // Init stuff... - a_twcallback2 = default(TW_CALLBACK2); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szCallback2); - - // Grab the values... - a_twcallback2.CallBackProc = (IntPtr)UInt64.Parse(asz[0]); - a_twcallback2.RefCon = (UIntPtr)UInt64.Parse(asz[1]); - a_twcallback2.Message = ushort.Parse(asz[2]); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a capability to a string that we can show in - /// our simple GUI.... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public string CapabilityToCsv(TW_CAPABILITY a_twcapability, bool a_blUseSymbols) - { - IntPtr intptr; - IntPtr intptrLocked; - TWTY ItemType; - uint NumItems; - - // Handle the container... - switch (a_twcapability.ConType) - { - default: - return ("(unrecognized container)"); - - case TWON.ARRAY: - { - uint uu; - CSV csvArray; - - // Mac has a level of indirection and a different structure (ick)... - if (ms_platform == Platform.MACOSX) - { - // Crack the container... - TW_ARRAY_MACOSX twarraymacosx = default(TW_ARRAY_MACOSX); - intptrLocked = DsmMemLock(a_twcapability.hContainer); - twarraymacosx = (TW_ARRAY_MACOSX)Marshal.PtrToStructure(intptrLocked, typeof(TW_ARRAY_MACOSX)); - ItemType = (TWTY)twarraymacosx.ItemType; - NumItems = twarraymacosx.NumItems; - intptr = (IntPtr)((UInt64)intptrLocked + (UInt64)Marshal.SizeOf(twarraymacosx)); - } - else - { - // Crack the container... - TW_ARRAY twarray = default(TW_ARRAY); - intptrLocked = DsmMemLock(a_twcapability.hContainer); - twarray = (TW_ARRAY)Marshal.PtrToStructure(intptrLocked, typeof(TW_ARRAY)); - ItemType = twarray.ItemType; - NumItems = twarray.NumItems; - intptr = (IntPtr)((UInt64)intptrLocked + (UInt64)Marshal.SizeOf(twarray)); - } - - // Start building the string... - csvArray = Common(a_twcapability.Cap, a_twcapability.ConType, ItemType); - csvArray.Add(NumItems.ToString()); - - // Tack on the stuff from the ItemList... - if (a_blUseSymbols) - { - string szValue; - for (uu = 0; uu < NumItems; uu++) - { - string szItem = GetIndexedItem(a_twcapability, ItemType, intptr, (int)uu); - szValue = CvtCapValueToEnum(a_twcapability.Cap, szItem); - csvArray.Add(szValue); - } - } - else - { - for (uu = 0; uu < NumItems; uu++) - { - csvArray.Add(GetIndexedItem(a_twcapability, ItemType, intptr, (int)uu)); - } - } - - // All done... - DsmMemUnlock(a_twcapability.hContainer); - return (csvArray.Get()); - } - - case TWON.ENUMERATION: - { - uint uu; - CSV csvEnum; - - // Mac has a level of indirection and a different structure (ick)... - if (ms_platform == Platform.MACOSX) - { - // Crack the container... - TW_ENUMERATION_MACOSX twenumerationmacosx = default(TW_ENUMERATION_MACOSX); - intptrLocked = DsmMemLock(a_twcapability.hContainer); - twenumerationmacosx = (TW_ENUMERATION_MACOSX)Marshal.PtrToStructure(intptrLocked, typeof(TW_ENUMERATION_MACOSX)); - ItemType = (TWTY)twenumerationmacosx.ItemType; - NumItems = twenumerationmacosx.NumItems; - intptr = (IntPtr)((UInt64)intptrLocked + (UInt64)Marshal.SizeOf(twenumerationmacosx)); - - // Start building the string... - csvEnum = Common(a_twcapability.Cap, a_twcapability.ConType, ItemType); - csvEnum.Add(NumItems.ToString()); - csvEnum.Add(twenumerationmacosx.CurrentIndex.ToString()); - csvEnum.Add(twenumerationmacosx.DefaultIndex.ToString()); - } - // Windows or the 2.4+ Linux DSM... - else if ((ms_platform == Platform.WINDOWS) || ((m_blFoundLatestDsm || m_blFoundLatestDsm64) && (m_linuxdsm == LinuxDsm.IsLatestDsm))) - { - // Crack the container... - TW_ENUMERATION twenumeration = default(TW_ENUMERATION); - intptrLocked = DsmMemLock(a_twcapability.hContainer); - twenumeration = (TW_ENUMERATION)Marshal.PtrToStructure(intptrLocked, typeof(TW_ENUMERATION)); - ItemType = twenumeration.ItemType; - NumItems = twenumeration.NumItems; - intptr = (IntPtr)((UInt64)intptrLocked + (UInt64)Marshal.SizeOf(twenumeration)); - - // Start building the string... - csvEnum = Common(a_twcapability.Cap, a_twcapability.ConType, ItemType); - csvEnum.Add(NumItems.ToString()); - csvEnum.Add(twenumeration.CurrentIndex.ToString()); - csvEnum.Add(twenumeration.DefaultIndex.ToString()); - } - // The -2.3 Linux DSM... - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - // Crack the container... - TW_ENUMERATION_LINUX64 twenumerationlinux64 = default(TW_ENUMERATION_LINUX64); - intptrLocked = DsmMemLock(a_twcapability.hContainer); - twenumerationlinux64 = (TW_ENUMERATION_LINUX64)Marshal.PtrToStructure(intptrLocked, typeof(TW_ENUMERATION_LINUX64)); - ItemType = twenumerationlinux64.ItemType; - NumItems = (uint)twenumerationlinux64.NumItems; - intptr = (IntPtr)((UInt64)intptrLocked + (UInt64)Marshal.SizeOf(twenumerationlinux64)); - - // Start building the string... - csvEnum = Common(a_twcapability.Cap, a_twcapability.ConType, ItemType); - csvEnum.Add(NumItems.ToString()); - csvEnum.Add(twenumerationlinux64.CurrentIndex.ToString()); - csvEnum.Add(twenumerationlinux64.DefaultIndex.ToString()); - } - // This shouldn't be possible, but what the hey... - else - { - Log.Error("This is serious, you win a cookie for getting here..."); - DsmMemUnlock(a_twcapability.hContainer); - return (""); - } - - // Tack on the stuff from the ItemList... - if (a_blUseSymbols) - { - string szValue; - for (uu = 0; uu < NumItems; uu++) - { - string szItem = GetIndexedItem(a_twcapability, ItemType, intptr, (int)uu); - szValue = CvtCapValueToEnum(a_twcapability.Cap, szItem); - csvEnum.Add(szValue); - } - } - else - { - for (uu = 0; uu < NumItems; uu++) - { - csvEnum.Add(GetIndexedItem(a_twcapability, ItemType, intptr, (int)uu)); - } - } - - // All done... - DsmMemUnlock(a_twcapability.hContainer); - return (csvEnum.Get()); - } - - case TWON.ONEVALUE: - { - CSV csvOnevalue; - - // Mac has a level of indirection and a different structure (ick)... - if (ms_platform == Platform.MACOSX) - { - // Crack the container... - TW_ONEVALUE_MACOSX twonevaluemacosx = default(TW_ONEVALUE_MACOSX); - intptrLocked = DsmMemLock(a_twcapability.hContainer); - twonevaluemacosx = (TW_ONEVALUE_MACOSX)Marshal.PtrToStructure(intptrLocked, typeof(TW_ONEVALUE_MACOSX)); - ItemType = (TWTY)twonevaluemacosx.ItemType; - intptr = (IntPtr)((UInt64)intptrLocked + (UInt64)Marshal.SizeOf(twonevaluemacosx)); - } - else - { - // Crack the container... - TW_ONEVALUE twonevalue = default(TW_ONEVALUE); - intptrLocked = DsmMemLock(a_twcapability.hContainer); - twonevalue = (TW_ONEVALUE)Marshal.PtrToStructure(intptrLocked, typeof(TW_ONEVALUE)); - ItemType = (TWTY)twonevalue.ItemType; - intptr = (IntPtr)((UInt64)intptrLocked + (UInt64)Marshal.SizeOf(twonevalue)); - } - - // Start building the string... - csvOnevalue = Common(a_twcapability.Cap, a_twcapability.ConType, ItemType); - - // Tack on the stuff from the Item... - if (a_blUseSymbols) - { - string szValue; - string szItem = GetIndexedItem(a_twcapability, ItemType, intptr, 0); - szValue = CvtCapValueToEnum(a_twcapability.Cap, szItem); - csvOnevalue.Add(szValue); - } - else - { - csvOnevalue.Add(GetIndexedItem(a_twcapability, ItemType, intptr, 0)); - } - - // All done... - DsmMemUnlock(a_twcapability.hContainer); - return (csvOnevalue.Get()); - } - - case TWON.RANGE: - { - CSV csvRange; - string szTmp; - TW_RANGE twrange; - TW_RANGE_LINUX64 twrangelinux64; - TW_RANGE_MACOSX twrangemacosx; - TW_RANGE_FIX32 twrangefix32; - TW_RANGE_FIX32_MACOSX twrangefix32macosx; - - // Mac has a level of indirection and a different structure (ick)... - twrange = default(TW_RANGE); - if (ms_platform == Platform.MACOSX) - { - intptrLocked = DsmMemLock(a_twcapability.hContainer); - twrangemacosx = (TW_RANGE_MACOSX)Marshal.PtrToStructure(intptrLocked, typeof(TW_RANGE_MACOSX)); - twrangefix32macosx = (TW_RANGE_FIX32_MACOSX)Marshal.PtrToStructure(intptrLocked, typeof(TW_RANGE_FIX32_MACOSX)); - twrange.ItemType = (TWTY)twrangemacosx.ItemType; - twrange.MinValue = twrangemacosx.MinValue; - twrange.MaxValue = twrangemacosx.MaxValue; - twrange.StepSize = twrangemacosx.StepSize; - twrange.DefaultValue = twrangemacosx.DefaultValue; - twrange.CurrentValue = twrangemacosx.CurrentValue; - twrangefix32.ItemType = (TWTY)twrangefix32macosx.ItemType; - twrangefix32.MinValue = twrangefix32macosx.MinValue; - twrangefix32.MaxValue = twrangefix32macosx.MaxValue; - twrangefix32.StepSize = twrangefix32macosx.StepSize; - twrangefix32.DefaultValue = twrangefix32macosx.DefaultValue; - twrangefix32.CurrentValue = twrangefix32macosx.CurrentValue; - } - // Windows or the 2.4+ Linux DSM... - else if ((ms_platform == Platform.WINDOWS) || (m_linuxdsm == LinuxDsm.IsLatestDsm) || ((m_blFoundLatestDsm || m_blFoundLatestDsm64) && (m_linuxdsm == LinuxDsm.IsLatestDsm))) - { - intptrLocked = DsmMemLock(a_twcapability.hContainer); - twrange = (TW_RANGE)Marshal.PtrToStructure(intptrLocked, typeof(TW_RANGE)); - twrangefix32 = (TW_RANGE_FIX32)Marshal.PtrToStructure(intptrLocked, typeof(TW_RANGE_FIX32)); - } - // The -2.3 Linux DSM... - else - { - intptrLocked = DsmMemLock(a_twcapability.hContainer); - twrangelinux64 = (TW_RANGE_LINUX64)Marshal.PtrToStructure(intptrLocked, typeof(TW_RANGE_LINUX64)); - twrangefix32macosx = (TW_RANGE_FIX32_MACOSX)Marshal.PtrToStructure(intptrLocked, typeof(TW_RANGE_FIX32_MACOSX)); - twrange.ItemType = (TWTY)twrangelinux64.ItemType; - twrange.MinValue = (uint)twrangelinux64.MinValue; - twrange.MaxValue = (uint)twrangelinux64.MaxValue; - twrange.StepSize = (uint)twrangelinux64.StepSize; - twrange.DefaultValue = (uint)twrangelinux64.DefaultValue; - twrange.CurrentValue = (uint)twrangelinux64.CurrentValue; - twrangefix32.ItemType = (TWTY)twrangefix32macosx.ItemType; - twrangefix32.MinValue = twrangefix32macosx.MinValue; - twrangefix32.MaxValue = twrangefix32macosx.MaxValue; - twrangefix32.StepSize = twrangefix32macosx.StepSize; - twrangefix32.DefaultValue = twrangefix32macosx.DefaultValue; - twrangefix32.CurrentValue = twrangefix32macosx.CurrentValue; - } - - // Start the string... - csvRange = Common(a_twcapability.Cap, a_twcapability.ConType, twrange.ItemType); - - // Tack on the data... - switch ((TWTY)twrange.ItemType) - { - default: - DsmMemUnlock(a_twcapability.hContainer); - return ("(Get Capability: unrecognized data type)"); - - case TWTY.INT8: - csvRange.Add(((char)(twrange.MinValue)).ToString()); - csvRange.Add(((char)(twrange.MaxValue)).ToString()); - csvRange.Add(((char)(twrange.StepSize)).ToString()); - csvRange.Add(((char)(twrange.DefaultValue)).ToString()); - csvRange.Add(((char)(twrange.CurrentValue)).ToString()); - DsmMemUnlock(a_twcapability.hContainer); - return (csvRange.Get()); - - case TWTY.INT16: - csvRange.Add(((short)(twrange.MinValue)).ToString()); - csvRange.Add(((short)(twrange.MaxValue)).ToString()); - csvRange.Add(((short)(twrange.StepSize)).ToString()); - csvRange.Add(((short)(twrange.DefaultValue)).ToString()); - csvRange.Add(((short)(twrange.CurrentValue)).ToString()); - DsmMemUnlock(a_twcapability.hContainer); - return (csvRange.Get()); - - case TWTY.INT32: - csvRange.Add(((int)(twrange.MinValue)).ToString()); - csvRange.Add(((int)(twrange.MaxValue)).ToString()); - csvRange.Add(((int)(twrange.StepSize)).ToString()); - csvRange.Add(((int)(twrange.DefaultValue)).ToString()); - csvRange.Add(((int)(twrange.CurrentValue)).ToString()); - DsmMemUnlock(a_twcapability.hContainer); - return (csvRange.Get()); - - case TWTY.UINT8: - csvRange.Add(((byte)(twrange.MinValue)).ToString()); - csvRange.Add(((byte)(twrange.MaxValue)).ToString()); - csvRange.Add(((byte)(twrange.StepSize)).ToString()); - csvRange.Add(((byte)(twrange.DefaultValue)).ToString()); - csvRange.Add(((byte)(twrange.CurrentValue)).ToString()); - DsmMemUnlock(a_twcapability.hContainer); - return (csvRange.Get()); - - case TWTY.BOOL: - case TWTY.UINT16: - csvRange.Add(((ushort)(twrange.MinValue)).ToString()); - csvRange.Add(((ushort)(twrange.MaxValue)).ToString()); - csvRange.Add(((ushort)(twrange.StepSize)).ToString()); - csvRange.Add(((ushort)(twrange.DefaultValue)).ToString()); - csvRange.Add(((ushort)(twrange.CurrentValue)).ToString()); - DsmMemUnlock(a_twcapability.hContainer); - return (csvRange.Get()); - - case TWTY.UINT32: - csvRange.Add(((uint)(twrange.MinValue)).ToString()); - csvRange.Add(((uint)(twrange.MaxValue)).ToString()); - csvRange.Add(((uint)(twrange.StepSize)).ToString()); - csvRange.Add(((uint)(twrange.DefaultValue)).ToString()); - csvRange.Add(((uint)(twrange.CurrentValue)).ToString()); - DsmMemUnlock(a_twcapability.hContainer); - return (csvRange.Get()); - - case TWTY.FIX32: - szTmp = ((double)twrangefix32.MinValue.Whole + ((double)twrangefix32.MinValue.Frac / 65536.0)).ToString("0." + new string('#', 339)); - csvRange.Add(szTmp); - szTmp = ((double)twrangefix32.MaxValue.Whole + ((double)twrangefix32.MaxValue.Frac / 65536.0)).ToString("0." + new string('#', 339)); - csvRange.Add(szTmp); - szTmp = ((double)twrangefix32.StepSize.Whole + ((double)twrangefix32.StepSize.Frac / 65536.0)).ToString("0." + new string('#', 339)); - csvRange.Add(szTmp); - szTmp = ((double)twrangefix32.DefaultValue.Whole + ((double)twrangefix32.DefaultValue.Frac / 65536.0)).ToString("0." + new string('#', 339)); - csvRange.Add(szTmp); - szTmp = ((double)twrangefix32.CurrentValue.Whole + ((double)twrangefix32.CurrentValue.Frac / 65536.0)).ToString("0." + new string('#', 339)); - csvRange.Add(szTmp); - DsmMemUnlock(a_twcapability.hContainer); - return (csvRange.Get()); - } - } - } - } - - /// - /// Convert the contents of a string into something we can poke into a - /// TW_CAPABILITY structure... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// The container for this capability - /// True if the conversion is successful - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public bool CsvToCapability(ref TW_CAPABILITY a_twcapability, ref string a_szSetting, string a_szValue) - { - int ii = 0; - TWTY twty = TWTY.BOOL; - uint u32NumItems = 0; - IntPtr intptr = IntPtr.Zero; - string szResult; - string[] asz; - - // We need some protection for this one... - try - { - // Tokenize our values... - asz = CSV.Parse(a_szValue); - if (asz.GetLength(0) < 1) - { - a_szSetting = "Set Capability: (insufficient number of arguments)"; - return (false); - } - - // Set the capability from text or hex... - try - { - // see if it is a custom cap - if ((asz[0][0] == '8') || asz[0].StartsWith("0x8")) - { - a_twcapability.Cap = (CAP)0xFFFF; - } - else if (asz[0].StartsWith("0x")) - { - int iNum = 0; - int.TryParse(asz[0].Substring(2), NumberStyles.AllowHexSpecifier | NumberStyles.HexNumber, CultureInfo.InvariantCulture, out iNum); - a_twcapability.Cap = (CAP)iNum; - } - else - { - a_twcapability.Cap = (CAP)Enum.Parse(typeof(CAP), asz[0], true); - } - } - catch - { - // don't log this exception... - a_twcapability.Cap = (CAP)0xFFFF; - } - if ((a_twcapability.Cap == (CAP)0xFFFF) || !asz[0].Contains("_")) - { - a_twcapability.Cap = (CAP)Convert.ToUInt16(asz[0], 16); - } - - // Set the container from text or decimal... - if (asz.GetLength(0) >= 2) - { - try - { - a_twcapability.ConType = (TWON)Enum.Parse(typeof(TWON), asz[1].Replace("TWON_", "").Replace("twon_", ""), true); - } - catch - { - // don't log this exception... - a_twcapability.ConType = (TWON)ushort.Parse(asz[1]); - } - } - - // Set the item type from text or decimal... - if (asz.GetLength(0) >= 3) - { - try - { - twty = (TWTY)Enum.Parse(typeof(TWTY), asz[2].Replace("TWTY_", "").Replace("twty_", ""), true); - } - catch - { - // don't log this exception... - twty = (TWTY)ushort.Parse(asz[2]); - } - } - - // Assign the new value... - if (asz.GetLength(0) >= 4) - { - switch (a_twcapability.ConType) - { - default: - a_szSetting = "(unrecognized container)"; - return (false); - - case TWON.ARRAY: - // Validate... - if (asz.GetLength(0) < 4) - { - a_szSetting = "Set Capability: (insufficient number of arguments)"; - return (false); - } - - // Get the values... - u32NumItems = uint.Parse(asz[3]); - - // Allocate the container (go for worst case, which is TW_STR255)... - if (ms_platform == Platform.MACOSX) - { - // Allocate... - a_twcapability.hContainer = DsmMemAlloc((uint)(Marshal.SizeOf(default(TW_ARRAY_MACOSX)) + (((int)u32NumItems + 1) * Marshal.SizeOf(default(TW_STR255))))); - intptr = DsmMemLock(a_twcapability.hContainer); - - // Set the meta data... - TW_ARRAY_MACOSX twarraymacosx = default(TW_ARRAY_MACOSX); - twarraymacosx.ItemType = (uint)twty; - twarraymacosx.NumItems = u32NumItems; - Marshal.StructureToPtr(twarraymacosx, intptr, true); - - // Get the pointer to the ItemList... - intptr = (IntPtr)((UInt64)intptr + (UInt64)Marshal.SizeOf(twarraymacosx)); - } - else - { - // Allocate... - a_twcapability.hContainer = DsmMemAlloc((uint)(Marshal.SizeOf(default(TW_ARRAY)) + (((int)u32NumItems + 1) * Marshal.SizeOf(default(TW_STR255))))); - intptr = DsmMemLock(a_twcapability.hContainer); - - // Set the meta data... - TW_ARRAY twarray = default(TW_ARRAY); - twarray.ItemType = twty; - twarray.NumItems = u32NumItems; - Marshal.StructureToPtr(twarray, intptr, true); - - // Get the pointer to the ItemList... - intptr = (IntPtr)((UInt64)intptr + (UInt64)Marshal.SizeOf(twarray)); - } - - // Set the ItemList... - for (ii = 0; (ii < u32NumItems) && ((ii + 4) < asz.Length); ii++) - { - szResult = SetIndexedItem(a_twcapability, twty, intptr, ii, asz[ii + 4]); - if (szResult != "") - { - return (false); - } - } - - // All done... - DsmMemUnlock(a_twcapability.hContainer); - return (true); - - case TWON.ENUMERATION: - // Validate... - if (asz.GetLength(0) < 6) - { - a_szSetting = "Set Capability: (insufficient number of arguments)"; - return (false); - } - - // Get the values... - u32NumItems = uint.Parse(asz[3]); - - // Allocate the container (go for worst case, which is TW_STR255)... - if (ms_platform == Platform.MACOSX) - { - // Allocate... - a_twcapability.hContainer = DsmMemAlloc((uint)(Marshal.SizeOf(default(TW_ENUMERATION_MACOSX)) + (((int)u32NumItems + 1) * Marshal.SizeOf(default(TW_STR255))))); - intptr = DsmMemLock(a_twcapability.hContainer); - - // Set the meta data... - TW_ENUMERATION_MACOSX twenumerationmacosx = default(TW_ENUMERATION_MACOSX); - twenumerationmacosx.ItemType = (uint)twty; - twenumerationmacosx.NumItems = u32NumItems; - twenumerationmacosx.CurrentIndex = uint.Parse(asz[4]); - twenumerationmacosx.DefaultIndex = uint.Parse(asz[5]); - Marshal.StructureToPtr(twenumerationmacosx, intptr, true); - - // Get the pointer to the ItemList... - intptr = (IntPtr)((UInt64)intptr + (UInt64)Marshal.SizeOf(twenumerationmacosx)); - } - // Windows or the 2.4+ Linux DSM... - else if ((ms_platform == Platform.WINDOWS) || ((m_linuxdsm == LinuxDsm.IsLatestDsm) || ((m_blFoundLatestDsm || m_blFoundLatestDsm64) && (m_linuxdsm == LinuxDsm.IsLatestDsm)))) - { - // Allocate... - a_twcapability.hContainer = DsmMemAlloc((uint)(Marshal.SizeOf(default(TW_ENUMERATION)) + (((int)u32NumItems + 1) * Marshal.SizeOf(default(TW_STR255))))); - intptr = DsmMemLock(a_twcapability.hContainer); - - // Set the meta data... - TW_ENUMERATION twenumeration = default(TW_ENUMERATION); - twenumeration.ItemType = twty; - twenumeration.NumItems = u32NumItems; - twenumeration.CurrentIndex = uint.Parse(asz[4]); - twenumeration.DefaultIndex = uint.Parse(asz[5]); - Marshal.StructureToPtr(twenumeration, intptr, true); - - // Get the pointer to the ItemList... - intptr = (IntPtr)((UInt64)intptr + (UInt64)Marshal.SizeOf(twenumeration)); - } - // The -2.3 Linux DSM... - else - { - // Allocate... - a_twcapability.hContainer = DsmMemAlloc((uint)(Marshal.SizeOf(default(TW_ENUMERATION_LINUX64)) + (((int)u32NumItems + 1) * Marshal.SizeOf(default(TW_STR255))))); - intptr = DsmMemLock(a_twcapability.hContainer); - - // Set the meta data... - TW_ENUMERATION_LINUX64 twenumerationlinux64 = default(TW_ENUMERATION_LINUX64); - twenumerationlinux64.ItemType = twty; - twenumerationlinux64.NumItems = u32NumItems; - twenumerationlinux64.CurrentIndex = uint.Parse(asz[4]); - twenumerationlinux64.DefaultIndex = uint.Parse(asz[5]); - Marshal.StructureToPtr(twenumerationlinux64, intptr, true); - - // Get the pointer to the ItemList... - intptr = (IntPtr)((UInt64)intptr + (UInt64)Marshal.SizeOf(twenumerationlinux64)); - } - - // Set the ItemList... - for (ii = 0; ii < u32NumItems; ii++) - { - szResult = SetIndexedItem(a_twcapability, twty, intptr, ii, asz[ii + 6]); - if (szResult != "") - { - return (false); - } - } - - // All done... - DsmMemUnlock(a_twcapability.hContainer); - return (true); - - case TWON.ONEVALUE: - // Validate... - if (asz.GetLength(0) < 4) - { - a_szSetting = "Set Capability: (insufficient number of arguments)"; - return (false); - } - - // Allocate the container (go for worst case, which is TW_STR255)... - if (ms_platform == Platform.MACOSX) - { - // Allocate... - a_twcapability.hContainer = DsmMemAlloc((uint)(Marshal.SizeOf(default(TW_ONEVALUE_MACOSX)) + Marshal.SizeOf(default(TW_STR255)))); - intptr = DsmMemLock(a_twcapability.hContainer); - - // Set the meta data... - TW_ONEVALUE_MACOSX twonevaluemacosx = default(TW_ONEVALUE_MACOSX); - twonevaluemacosx.ItemType = (uint)twty; - Marshal.StructureToPtr(twonevaluemacosx, intptr, true); - - // Get the pointer to the ItemList... - intptr = (IntPtr)((UInt64)intptr + (UInt64)Marshal.SizeOf(twonevaluemacosx)); - } - else - { - // Allocate... - a_twcapability.hContainer = DsmMemAlloc((uint)(Marshal.SizeOf(default(TW_ONEVALUE)) + Marshal.SizeOf(default(TW_STR255)))); - intptr = DsmMemLock(a_twcapability.hContainer); - - // Set the meta data... - TW_ONEVALUE twonevalue = default(TW_ONEVALUE); - twonevalue.ItemType = twty; - Marshal.StructureToPtr(twonevalue, intptr, true); - - // Get the pointer to the ItemList... - intptr = (IntPtr)((UInt64)intptr + (UInt64)Marshal.SizeOf(twonevalue)); - } - - // Set the Item... - szResult = SetIndexedItem(a_twcapability, twty, intptr, 0, asz[3]); - if (szResult != "") - { - return (false); - } - - // All done... - DsmMemUnlock(a_twcapability.hContainer); - return (true); - - case TWON.RANGE: - // Validate... - if (asz.GetLength(0) < 8) - { - a_szSetting = "Set Capability: (insufficient number of arguments)"; - return (false); - } - - // Allocate the container (go for worst case, which is TW_STR255)... - if (ms_platform == Platform.MACOSX) - { - // Allocate... - a_twcapability.hContainer = DsmMemAlloc((uint)(Marshal.SizeOf(default(TW_RANGE_MACOSX)))); - intptr = DsmMemLock(a_twcapability.hContainer); - } - // Windows or the 2.4+ Linux DSM... - else if ((ms_platform == Platform.WINDOWS) || ((m_linuxdsm == LinuxDsm.IsLatestDsm) || ((m_blFoundLatestDsm || m_blFoundLatestDsm64) && (m_linuxdsm == LinuxDsm.IsLatestDsm)))) - { - // Allocate... - a_twcapability.hContainer = DsmMemAlloc((uint)(Marshal.SizeOf(default(TW_RANGE)))); - intptr = DsmMemLock(a_twcapability.hContainer); - } - // The -2.3 Linux DSM... - else - { - // Allocate... - a_twcapability.hContainer = DsmMemAlloc((uint)(Marshal.SizeOf(default(TW_RANGE_LINUX64)))); - intptr = DsmMemLock(a_twcapability.hContainer); - } - - // Set the Item... - szResult = SetRangeItem(twty, intptr, asz); - if (szResult != "") - { - return (false); - } - - // All done... - DsmMemUnlock(a_twcapability.hContainer); - return (true); - } - } - - // All done (this is good for a get where only the cap was specified)... - return (true); - } - catch (Exception exception) - { - Log.Error("CsvToCapability exception - " + exception.Message); - Log.Error("setting=<" + a_szSetting + ">"); - a_szValue = "(data error)"; - return (false); - } - } - - /// - /// Convert the contents of a custom DS data to a string that we can show in - /// our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public string CustomdsdataToCsv(TW_CUSTOMDSDATA a_twcustomdsdata) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twcustomdsdata.InfoLength.ToString()); - IntPtr intptr = DsmMemLock(a_twcustomdsdata.hData); - csv.Add(intptr.ToString()); - DsmMemUnlock(a_twcustomdsdata.hData); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a string to a custom DS data structure... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public bool CsvToCustomdsdata(ref TW_CUSTOMDSDATA a_twcustomdsdata, string a_szCustomdsdata) - { - // Init stuff... - a_twcustomdsdata = default(TW_CUSTOMDSDATA); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szCustomdsdata); - - // Grab the values... - a_twcustomdsdata.InfoLength = uint.Parse(asz[0]); - a_twcustomdsdata.hData = DsmMemAlloc(a_twcustomdsdata.InfoLength); - IntPtr intptr = DsmMemLock(a_twcustomdsdata.hData); - byte[] bProfile = new byte[a_twcustomdsdata.InfoLength]; - Marshal.Copy((IntPtr)UInt64.Parse(asz[1]), bProfile, 0, (int)a_twcustomdsdata.InfoLength); - Marshal.Copy(bProfile, 0, intptr, (int)a_twcustomdsdata.InfoLength); - DsmMemUnlock(a_twcustomdsdata.hData); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a device event to a string that we can show in - /// our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string DeviceeventToCsv(TW_DEVICEEVENT a_twdeviceevent) - { - try - { - CSV csv = new CSV(); - csv.Add(((TWDE)a_twdeviceevent.Event).ToString()); - csv.Add(a_twdeviceevent.DeviceName.Get()); - csv.Add(a_twdeviceevent.BatteryMinutes.ToString()); - csv.Add(a_twdeviceevent.BatteryPercentage.ToString()); - csv.Add(a_twdeviceevent.PowerSupply.ToString()); - csv.Add(((double)a_twdeviceevent.XResolution.Whole + ((double)a_twdeviceevent.XResolution.Frac / 65536.0)).ToString()); - csv.Add(((double)a_twdeviceevent.YResolution.Whole + ((double)a_twdeviceevent.YResolution.Frac / 65536.0)).ToString()); - csv.Add(a_twdeviceevent.FlashUsed2.ToString()); - csv.Add(a_twdeviceevent.AutomaticCapture.ToString()); - csv.Add(a_twdeviceevent.TimeBeforeFirstCapture.ToString()); - csv.Add(a_twdeviceevent.TimeBetweenCaptures.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of an entry point to a string that - /// we can show in our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string EntrypointToCsv(TW_ENTRYPOINT a_twentrypoint) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twentrypoint.Size.ToString()); - csv.Add("0x" + ((a_twentrypoint.DSM_Entry == null)?"0":a_twentrypoint.DSM_Entry.ToString("X"))); - csv.Add("0x" + ((a_twentrypoint.DSM_MemAllocate == null) ? "0" : a_twentrypoint.DSM_MemAllocate.ToString("X"))); - csv.Add("0x" + ((a_twentrypoint.DSM_MemFree == null) ? "0" : a_twentrypoint.DSM_MemFree.ToString("X"))); - csv.Add("0x" + ((a_twentrypoint.DSM_MemLock == null) ? "0" : a_twentrypoint.DSM_MemLock.ToString("X"))); - csv.Add("0x" + ((a_twentrypoint.DSM_MemUnlock == null) ? "0" : a_twentrypoint.DSM_MemUnlock.ToString("X"))); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of an event to a string that - /// we can show in our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string EventToCsv(TW_EVENT a_twevent) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twevent.pEvent.ToString()); - csv.Add(a_twevent.TWMessage.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of an extimageinfo to a string that we can show in - /// our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string ExtimageinfoToCsv(TW_EXTIMAGEINFO a_twextimageinfo) - { - try - { - uint uTwinfo = 0; - CSV csv = new CSV(); - csv.Add(a_twextimageinfo.NumInfos.ToString()); - for (int ii = 0; (ii < a_twextimageinfo.NumInfos) && (ii < 200); ii++) - { - TWEI twei; - TWTY twty; - STS sts; - TW_INFO twinfo = default(TW_INFO); - a_twextimageinfo.Get(uTwinfo, ref twinfo); - twei = (TWEI)twinfo.InfoId; - if (twei.ToString() != twinfo.InfoId.ToString()) - { - csv.Add("TWEI_" + twei.ToString()); - } - else - { - csv.Add(string.Format("0x{0:X}", twinfo.InfoId)); - } - twty = (TWTY)twinfo.ItemType; - if (twty.ToString() != twinfo.ItemType.ToString()) - { - csv.Add("TWTY_" + twty.ToString()); - } - else - { - csv.Add(string.Format("0x{0:X}", twinfo.ItemType)); - } - csv.Add(twinfo.NumItems.ToString()); - sts = (STS)twinfo.ReturnCode; - if (sts.ToString() != twinfo.ReturnCode.ToString()) - { - csv.Add("TWRC_" + sts.ToString()); - } - else - { - csv.Add(string.Format("0x{0:X}", twinfo.ReturnCode)); - } - csv.Add(twinfo.Item.ToString()); - uTwinfo += 1; - } - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a string to an extimageinfo structure, - /// note that we don't have to worry about containers going in this - /// direction... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToExtimageinfo(ref TW_EXTIMAGEINFO a_twextimageinfo, string a_szExtimageinfo) - { - // Init stuff... - a_twextimageinfo = default(TW_EXTIMAGEINFO); - - // Build the string... - try - { - int iField; - uint uTwinfo; - string[] asz = CSV.Parse(a_szExtimageinfo); - - // Set the number of entries (this is the easy bit)... - uint.TryParse(asz[0], out a_twextimageinfo.NumInfos); - if (a_twextimageinfo.NumInfos > 200) - { - Log.Error("***error*** - we're limited to 200 entries, if this is a problem, just add more, and fix this code..."); - return (false); - } - - // Okay, walk all the entries in steps of TW_INFO... - uTwinfo = 0; - for (iField = 1; iField < asz.Length; iField += 5) - { - UInt64 u64; - TWEI twei; - TW_INFO twinfo = default(TW_INFO); - if ((iField + 5) > asz.Length) - { - Log.Error("***error*** - badly constructed list, should be: num,(twinfo),(twinfo)..."); - return (false); - } - if (TWEI.TryParse(asz[iField + 0].Replace("TWEI_", ""), out twei)) - { - twinfo.InfoId = (ushort)twei; - } - else - { - if (asz[iField + 0].ToLowerInvariant().StartsWith("0x")) - { - ushort.TryParse(asz[iField + 0].Substring(2), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out twinfo.InfoId); - } - else - { - ushort.TryParse(asz[iField + 0], out twinfo.InfoId); - } - } - // We really don't care about these... - ushort.TryParse(asz[iField + 1], out twinfo.ItemType); - ushort.TryParse(asz[iField + 2], out twinfo.NumItems); - ushort.TryParse(asz[iField + 3], out twinfo.ReturnCode); - UInt64.TryParse(asz[iField + 4], out u64); - twinfo.Item = (UIntPtr)u64; - a_twextimageinfo.Set(uTwinfo, ref twinfo); - uTwinfo += 1; - } - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a filesystem to a string that we can show in - /// our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string FilesystemToCsv(TW_FILESYSTEM a_twfilesystem) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twfilesystem.InputName.Get()); - csv.Add(a_twfilesystem.OutputName.Get()); - csv.Add(a_twfilesystem.Context.ToString()); - csv.Add(a_twfilesystem.Recursive.ToString()); - csv.Add(a_twfilesystem.FileType.ToString()); - csv.Add(a_twfilesystem.Size.ToString()); - csv.Add(a_twfilesystem.CreateTimeDate.Get()); - csv.Add(a_twfilesystem.ModifiedTimeDate.Get()); - csv.Add(a_twfilesystem.FreeSpace.ToString()); - csv.Add(a_twfilesystem.NewImageSize.ToString()); - csv.Add(a_twfilesystem.NumberOfFiles.ToString()); - csv.Add(a_twfilesystem.NumberOfSnippets.ToString()); - csv.Add(a_twfilesystem.DeviceGroupMask.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a string to a filesystem structure... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToFilesystem(ref TW_FILESYSTEM a_twfilesystem, string a_szFilesystem) - { - // Init stuff... - a_twfilesystem = default(TW_FILESYSTEM); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szFilesystem); - - // Grab the values... - a_twfilesystem.InputName.Set(asz[0]); - a_twfilesystem.OutputName.Set(asz[1]); - a_twfilesystem.Context = (IntPtr)UInt64.Parse(asz[2]); - a_twfilesystem.Recursive = int.Parse(asz[3]); - a_twfilesystem.FileType = int.Parse(asz[4]); - a_twfilesystem.Size = uint.Parse(asz[5]); - a_twfilesystem.CreateTimeDate.Set(asz[6]); - a_twfilesystem.ModifiedTimeDate.Set(asz[7]); - a_twfilesystem.FreeSpace = (uint)UInt64.Parse(asz[8]); - a_twfilesystem.NewImageSize = (uint)UInt64.Parse(asz[9]); - a_twfilesystem.NumberOfFiles = (uint)UInt64.Parse(asz[10]); - a_twfilesystem.NumberOfSnippets = (uint)UInt64.Parse(asz[11]); - a_twfilesystem.DeviceGroupMask = (uint)UInt64.Parse(asz[12]); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of an iccprofile to a string that we can - /// show in our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string IccprofileToCsv(TW_MEMORY a_twmemory) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twmemory.Flags.ToString()); - csv.Add(a_twmemory.Length.ToString()); - csv.Add(a_twmemory.TheMem.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of an identity to a string that we can show in - /// our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string IdentityToCsv(TW_IDENTITY a_twidentity) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twidentity.Id.ToString()); - csv.Add(a_twidentity.Version.MajorNum.ToString()); - csv.Add(a_twidentity.Version.MinorNum.ToString()); - csv.Add(a_twidentity.Version.Language.ToString()); - csv.Add(a_twidentity.Version.Country.ToString()); - csv.Add(a_twidentity.Version.Info.Get()); - csv.Add(a_twidentity.ProtocolMajor.ToString()); - csv.Add(a_twidentity.ProtocolMinor.ToString()); - csv.Add("0x" + a_twidentity.SupportedGroups.ToString("X")); - csv.Add(a_twidentity.Manufacturer.Get()); - csv.Add(a_twidentity.ProductFamily.Get()); - csv.Add(a_twidentity.ProductName.Get()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a string to an identity structure... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToIdentity(ref TW_IDENTITY a_twidentity, string a_szIdentity) - { - // Init stuff... - a_twidentity = default(TW_IDENTITY); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szIdentity); - - // Grab the values... - a_twidentity.Id = ulong.Parse(asz[0]); - a_twidentity.Version.MajorNum = ushort.Parse(asz[1]); - a_twidentity.Version.MinorNum = ushort.Parse(asz[2]); - if (asz[3] != "0") a_twidentity.Version.Language = (TWLG)Enum.Parse(typeof(TWLG), asz[3]); - if (asz[4] != "0") a_twidentity.Version.Country = (TWCY)Enum.Parse(typeof(TWCY), asz[4]); - a_twidentity.Version.Info.Set(asz[5]); - a_twidentity.ProtocolMajor = ushort.Parse(asz[6]); - a_twidentity.ProtocolMinor = ushort.Parse(asz[7]); - a_twidentity.SupportedGroups = asz[8].ToLower().StartsWith("0x") ? Convert.ToUInt32(asz[8].Remove(0, 2), 16) : Convert.ToUInt32(asz[8], 16); - a_twidentity.Manufacturer.Set(asz[9]); - a_twidentity.ProductFamily.Set(asz[10]); - a_twidentity.ProductName.Set(asz[11]); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a image info to a string that we can show in - /// our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string ImageinfoToCsv(TW_IMAGEINFO a_twimageinfo) - { - try - { - CSV csv = new CSV(); - csv.Add(((double)a_twimageinfo.XResolution.Whole + ((double)a_twimageinfo.XResolution.Frac / 65536.0)).ToString()); - csv.Add(((double)a_twimageinfo.YResolution.Whole + ((double)a_twimageinfo.YResolution.Frac / 65536.0)).ToString()); - csv.Add(a_twimageinfo.ImageWidth.ToString()); - csv.Add(a_twimageinfo.ImageLength.ToString()); - csv.Add(a_twimageinfo.SamplesPerPixel.ToString()); - csv.Add(a_twimageinfo.BitsPerSample_0.ToString()); - csv.Add(a_twimageinfo.BitsPerSample_1.ToString()); - csv.Add(a_twimageinfo.BitsPerSample_2.ToString()); - csv.Add(a_twimageinfo.BitsPerSample_3.ToString()); - csv.Add(a_twimageinfo.BitsPerSample_4.ToString()); - csv.Add(a_twimageinfo.BitsPerSample_5.ToString()); - csv.Add(a_twimageinfo.BitsPerSample_6.ToString()); - csv.Add(a_twimageinfo.BitsPerSample_7.ToString()); - csv.Add(a_twimageinfo.Planar.ToString()); - csv.Add("TWPT_" + (TWPT)a_twimageinfo.PixelType); - csv.Add("TWCP_" + (TWCP)a_twimageinfo.Compression); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a string to an callback structure... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToImageinfo(ref TW_IMAGEINFO a_twimageinfo, string a_szImageinfo) - { - // Init stuff... - a_twimageinfo = default(TW_IMAGEINFO); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szImageinfo); - - // Grab the values... - a_twimageinfo.XResolution.Whole = (short)double.Parse(asz[0]); - a_twimageinfo.XResolution.Frac = (ushort)((double.Parse(asz[0]) - (double)a_twimageinfo.XResolution.Whole) * 65536.0); - a_twimageinfo.YResolution.Whole = (short)double.Parse(asz[1]); - a_twimageinfo.YResolution.Frac = (ushort)((double.Parse(asz[1]) - (double)a_twimageinfo.YResolution.Whole) * 65536.0); - a_twimageinfo.ImageWidth = (short)double.Parse(asz[2]); - a_twimageinfo.ImageLength = int.Parse(asz[3]); - a_twimageinfo.SamplesPerPixel = short.Parse(asz[4]); - a_twimageinfo.BitsPerSample_0 = short.Parse(asz[5]); - a_twimageinfo.BitsPerSample_1 = short.Parse(asz[6]); - a_twimageinfo.BitsPerSample_2 = short.Parse(asz[7]); - a_twimageinfo.BitsPerSample_3 = short.Parse(asz[8]); - a_twimageinfo.BitsPerSample_4 = short.Parse(asz[9]); - a_twimageinfo.BitsPerSample_5 = short.Parse(asz[10]); - a_twimageinfo.BitsPerSample_6 = short.Parse(asz[11]); - a_twimageinfo.BitsPerSample_7 = short.Parse(asz[12]); - a_twimageinfo.Planar = ushort.Parse(CvtCapValueFromEnum(CAP.ICAP_PLANARCHUNKY, asz[13])); - a_twimageinfo.PixelType = short.Parse(CvtCapValueFromEnum(CAP.ICAP_PIXELTYPE, asz[14])); - a_twimageinfo.Compression = ushort.Parse(CvtCapValueFromEnum(CAP.ICAP_COMPRESSION, asz[15])); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a image layout to a string that we can show in - /// our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string ImagelayoutToCsv(TW_IMAGELAYOUT a_twimagelayout) - { - try - { - CSV csv = new CSV(); - csv.Add(((double)a_twimagelayout.Frame.Left.Whole + ((double)a_twimagelayout.Frame.Left.Frac / 65536.0)).ToString()); - csv.Add(((double)a_twimagelayout.Frame.Top.Whole + ((double)a_twimagelayout.Frame.Top.Frac / 65536.0)).ToString()); - csv.Add(((double)a_twimagelayout.Frame.Right.Whole + ((double)a_twimagelayout.Frame.Right.Frac / 65536.0)).ToString()); - csv.Add(((double)a_twimagelayout.Frame.Bottom.Whole + ((double)a_twimagelayout.Frame.Bottom.Frac / 65536.0)).ToString()); - csv.Add(a_twimagelayout.DocumentNumber.ToString()); - csv.Add(a_twimagelayout.PageNumber.ToString()); - csv.Add(a_twimagelayout.FrameNumber.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a string to an image layout structure... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToImagelayout(ref TW_IMAGELAYOUT a_twimagelayout, string a_szImagelayout) - { - // Init stuff... - a_twimagelayout = default(TW_IMAGELAYOUT); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szImagelayout); - - // Sort out the frame... - a_twimagelayout.Frame.Left.Whole = (short)double.Parse(asz[0]); - a_twimagelayout.Frame.Left.Frac = (ushort)((double.Parse(asz[0]) - (double)a_twimagelayout.Frame.Left.Whole) * 65536.0); - a_twimagelayout.Frame.Top.Whole = (short)double.Parse(asz[1]); - a_twimagelayout.Frame.Top.Frac = (ushort)((double.Parse(asz[1]) - (double)a_twimagelayout.Frame.Top.Whole) * 65536.0); - a_twimagelayout.Frame.Right.Whole = (short)double.Parse(asz[2]); - a_twimagelayout.Frame.Right.Frac = (ushort)((double.Parse(asz[2]) - (double)a_twimagelayout.Frame.Right.Whole) * 65536.0); - a_twimagelayout.Frame.Bottom.Whole = (short)double.Parse(asz[3]); - a_twimagelayout.Frame.Bottom.Frac = (ushort)((double.Parse(asz[3]) - (double)a_twimagelayout.Frame.Bottom.Whole) * 65536.0); - - // And now the counters... - a_twimagelayout.DocumentNumber = (uint)int.Parse(asz[4]); - a_twimagelayout.PageNumber = (uint)int.Parse(asz[5]); - a_twimagelayout.FrameNumber = (uint)int.Parse(asz[6]); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of an image mem xfer structure to a string that - /// we can show in our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string ImagememxferToCsv(TW_IMAGEMEMXFER a_twimagememxfer) - { - try - { - CSV csv = new CSV(); - csv.Add("TWCP_" + (TWCP)a_twimagememxfer.Compression); - csv.Add(a_twimagememxfer.BytesPerRow.ToString()); - csv.Add(a_twimagememxfer.Columns.ToString()); - csv.Add(a_twimagememxfer.Rows.ToString()); - csv.Add(a_twimagememxfer.XOffset.ToString()); - csv.Add(a_twimagememxfer.YOffset.ToString()); - csv.Add(a_twimagememxfer.BytesWritten.ToString()); - csv.Add(a_twimagememxfer.Memory.Flags.ToString()); - csv.Add(a_twimagememxfer.Memory.Length.ToString()); - csv.Add(a_twimagememxfer.Memory.TheMem.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a string to an image mem xfer structure... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToImagememxfer(ref TW_IMAGEMEMXFER a_twimagememxfer, string a_szImagememxfer) - { - // Init stuff... - a_twimagememxfer = default(TW_IMAGEMEMXFER); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szImagememxfer); - - // Sort out the structure... - a_twimagememxfer.Compression = ushort.Parse(CvtCapValueFromEnum(CAP.ICAP_COMPRESSION, asz[0])); - a_twimagememxfer.BytesPerRow = uint.Parse(asz[1]); - a_twimagememxfer.Columns = uint.Parse(asz[2]); - a_twimagememxfer.Rows = uint.Parse(asz[3]); - a_twimagememxfer.XOffset = uint.Parse(asz[4]); - a_twimagememxfer.YOffset = uint.Parse(asz[5]); - a_twimagememxfer.BytesWritten = uint.Parse(asz[6]); - a_twimagememxfer.Memory.Flags = ushort.Parse(asz[7]); - a_twimagememxfer.Memory.Length = uint.Parse(asz[8]); - a_twimagememxfer.Memory.TheMem = (IntPtr)ulong.Parse(asz[9]); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a metrics structure to a string that - /// we can show in our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string MetricsToCsv(TW_METRICS a_twmetrics) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twmetrics.SizeOf.ToString()); - csv.Add(a_twmetrics.ImageCount.ToString()); - csv.Add(a_twmetrics.SheetCount.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a patthru structure to a string that - /// we can show in our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string PassthruToCsv(TW_PASSTHRU a_twpassthru) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twpassthru.pCommand.ToString()); - csv.Add(a_twpassthru.CommandBytes.ToString()); - csv.Add(a_twpassthru.Direction.ToString()); - csv.Add(a_twpassthru.pData.ToString()); - csv.Add(a_twpassthru.DataBytes.ToString()); - csv.Add(a_twpassthru.DataBytesXfered.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a string to a passthru structure... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToPassthru(ref TW_PASSTHRU a_twpassthru, string a_szPassthru) - { - // Init stuff... - a_twpassthru = default(TW_PASSTHRU); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szPassthru); - - // Sort out the frame... - a_twpassthru.pCommand = (IntPtr)UInt64.Parse(asz[0]); - a_twpassthru.CommandBytes = uint.Parse(asz[1]); - a_twpassthru.Direction = int.Parse(asz[2]); - a_twpassthru.pData = (IntPtr)UInt64.Parse(asz[3]); - a_twpassthru.DataBytes = uint.Parse(asz[4]); - a_twpassthru.DataBytesXfered = uint.Parse(asz[5]); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a pending xfers structure to a string that - /// we can show in our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string PendingxfersToCsv(TW_PENDINGXFERS a_twpendingxfers) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twpendingxfers.Count.ToString()); - csv.Add(a_twpendingxfers.EOJ.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a string to a pendingxfers structure... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToPendingXfers(ref TW_PENDINGXFERS a_twpendingxfers, string a_szPendingxfers) - { - // Init stuff... - a_twpendingxfers = default(TW_PENDINGXFERS); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szPendingxfers); - - // Sort out the frame... - a_twpendingxfers.Count = ushort.Parse(asz[0]); - a_twpendingxfers.EOJ = uint.Parse(asz[1]); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a setup file xfer structure to a string that - /// we can show in our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string SetupfilexferToCsv(TW_SETUPFILEXFER a_twsetupfilexfer) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twsetupfilexfer.FileName.Get()); - csv.Add("TWFF_" + a_twsetupfilexfer.Format); - csv.Add(a_twsetupfilexfer.VRefNum.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert a string to a setupfilexfer... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToSetupfilexfer(ref TW_SETUPFILEXFER a_twsetupfilexfer, string a_szSetupfilexfer) - { - // Init stuff... - a_twsetupfilexfer = default(TW_SETUPFILEXFER); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szSetupfilexfer); - - // Sort out the values... - a_twsetupfilexfer.FileName.Set(asz[0]); - a_twsetupfilexfer.Format = (TWFF)ushort.Parse(CvtCapValueFromEnum(CAP.ICAP_IMAGEFILEFORMAT, asz[1])); - a_twsetupfilexfer.VRefNum = short.Parse(asz[2]); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a setup mem xfer structure to a string that - /// we can show in our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string SetupmemxferToCsv(TW_SETUPMEMXFER a_twsetupmemxfer) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twsetupmemxfer.MinBufSize.ToString()); - csv.Add(a_twsetupmemxfer.MaxBufSize.ToString()); - csv.Add(a_twsetupmemxfer.Preferred.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert a string to a setupmemxfer... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToSetupmemxfer(ref TW_SETUPMEMXFER a_twsetupmemxfer, string a_szSetupmemxfer) - { - // Init stuff... - a_twsetupmemxfer = default(TW_SETUPMEMXFER); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szSetupmemxfer); - - // Sort out the values... - a_twsetupmemxfer.MinBufSize = uint.Parse(asz[0]); - a_twsetupmemxfer.MaxBufSize = uint.Parse(asz[1]); - a_twsetupmemxfer.Preferred = uint.Parse(asz[2]); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a status structure to a string that - /// we can show in our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string StatusToCsv(TW_STATUS a_twstatus) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twstatus.ConditionCode.ToString()); - csv.Add(a_twstatus.Data.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a statusutf8 structure to a string that - /// we can show in our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public string Statusutf8ToCsv(TW_STATUSUTF8 a_twstatusutf8) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twstatusutf8.Status.ConditionCode.ToString()); - csv.Add(a_twstatusutf8.Status.Data.ToString()); - IntPtr intptr = DsmMemLock(a_twstatusutf8.UTF8string); - csv.Add(intptr.ToString()); - DsmMemUnlock(a_twstatusutf8.UTF8string); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert a string to a twaindirect... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToTwaindirect(ref TW_TWAINDIRECT a_twtwaindirect, string a_szTwaindirect) - { - // Init stuff... - a_twtwaindirect = default(TW_TWAINDIRECT); - - // Build the string... - try - { - long lTmp; - string[] asz = CSV.Parse(a_szTwaindirect); - - // Sort out the values... - if (!uint.TryParse(asz[0], out a_twtwaindirect.SizeOf)) - { - return (false); - } - if (!ushort.TryParse(asz[1], out a_twtwaindirect.CommunicationManager)) - { - return (false); - } - if (!long.TryParse(asz[2], out lTmp)) - { - return (false); - } - a_twtwaindirect.Send = new IntPtr(lTmp); - if (!uint.TryParse(asz[3], out a_twtwaindirect.SendSize)) - { - return (false); - } - if (!long.TryParse(asz[4], out lTmp)) - { - return (false); - } - a_twtwaindirect.Receive = new IntPtr(lTmp); - if (!uint.TryParse(asz[5], out a_twtwaindirect.ReceiveSize)) - { - return (false); - } - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a twaindirect structure to a string that - /// we can show in our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string TwaindirectToCsv(TW_TWAINDIRECT a_twtwaindirect) - { - try - { - CSV csv = new CSV(); - csv.Add(a_twtwaindirect.SizeOf.ToString()); - csv.Add(a_twtwaindirect.CommunicationManager.ToString()); - csv.Add(a_twtwaindirect.Send.ToString()); - csv.Add(a_twtwaindirect.SendSize.ToString()); - csv.Add(a_twtwaindirect.Receive.ToString()); - csv.Add(a_twtwaindirect.ReceiveSize.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a userinterface to a string that we can show in - /// our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string UserinterfaceToCsv(TW_USERINTERFACE a_twuserinterface) - { - try - { - CSV csv = new CSV(); - csv.Add(CvtCapValueToEnumHelper(a_twuserinterface.ShowUI.ToString())); - csv.Add(CvtCapValueToEnumHelper(a_twuserinterface.ModalUI.ToString())); - csv.Add(a_twuserinterface.hParent.ToString()); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert a string to a userinterface... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public bool CsvToUserinterface(ref TW_USERINTERFACE a_twuserinterface, string a_szUserinterface) - { - // Init stuff... - a_twuserinterface = default(TW_USERINTERFACE); - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szUserinterface); - - // Init stuff... - a_twuserinterface.ShowUI = 0; - a_twuserinterface.ModalUI = 0; - a_twuserinterface.hParent = IntPtr.Zero; - - // Sort out the values... - ushort.TryParse(CvtCapValueFromEnumHelper(asz[0]), out a_twuserinterface.ShowUI); - ushort.TryParse(CvtCapValueFromEnumHelper(asz[1]), out a_twuserinterface.ModalUI); - - // Really shouldn't have this test, but I'll probably break things if I remove it... - if (asz.Length >= 3) - { - if (asz[2].ToLowerInvariant() == "hwnd") - { - a_twuserinterface.hParent = m_intptrHwnd; - } - else - { - Int64 i64; - if (Int64.TryParse(asz[2], out i64)) - { - a_twuserinterface.hParent = (IntPtr)i64; - } - } - } - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// Convert the contents of a transfer group to a string that we can show in - /// our simple GUI... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - public static string XfergroupToCsv(UInt32 a_u32Xfergroup) - { - try - { - CSV csv = new CSV(); - csv.Add("0x" + a_u32Xfergroup.ToString("X")); - return (csv.Get()); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return ("***error***"); - } - } - - /// - /// Convert the contents of a string to a transfer group... - /// - /// A TWAIN structure - /// A CSV string of the TWAIN structure - /// True if the conversion is successful - public static bool CsvToXfergroup(ref UInt32 a_u32Xfergroup, string a_szXfergroup) - { - // Init stuff... - a_u32Xfergroup = 0; - - // Build the string... - try - { - string[] asz = CSV.Parse(a_szXfergroup); - - // Grab the values... - a_u32Xfergroup = asz[0].ToLower().StartsWith("0x") ? Convert.ToUInt32(asz[0].Remove(0, 2), 16) : Convert.ToUInt32(asz[0], 16); - } - catch (Exception exception) - { - Log.Error("***error*** - " + exception.Message); - return (false); - } - - // All done... - return (true); - } - - /// - /// This mess is what tries to turn numeric constants into something - /// a bit more readable... - /// - /// type for the conversion - /// value to convert - /// - private static string CvtCapValueToEnumHelper(string a_szValue) - { - T t; - Int32 i32 = 0; - UInt32 u32 = 0; - string szCvt = ""; - - // Adjust our value, as needed... - if (a_szValue.StartsWith(typeof(T).Name + "_")) - { - a_szValue = a_szValue.Substring((typeof(T).Name + "_").Length); - } - - // Handle enums with negative numbers... - if (a_szValue.StartsWith("-")) - { - if (Int32.TryParse(a_szValue, out i32)) - { - t = (T)Enum.Parse(typeof(T), a_szValue, true); - szCvt = t.ToString(); - if (szCvt != i32.ToString()) - { - return (typeof(T).ToString().Replace("TWAINWorkingGroup.TWAIN+", "") + "_" + szCvt); - } - } - } - - // Everybody else... - else if (UInt32.TryParse(a_szValue, out u32)) - { - // Handle bool... - if (typeof(T) == typeof(bool)) - { - if ((a_szValue == "1") || (a_szValue.ToLowerInvariant() == "true")) - { - return ("TRUE"); - } - return ("FALSE"); - } - - // Handle DAT (which is a weird one).. - else if (typeof(T) == typeof(DAT)) - { - UInt32 u32Dg = u32 >> 16; - UInt32 u32Dat = u32 & 0xFFFF; - string szDg = ((DG)u32Dg).ToString(); - string szDat = ((DAT)u32Dat).ToString(); - szDg = (szDg != u32Dg.ToString()) ? ("DG_" + szDg) : string.Format("0x{0:X}", u32Dg); - szDat = (szDat != u32Dat.ToString()) ? ("DAT_" + szDat) : string.Format("0x{0:X}", u32Dat); - return (szDg + "|" + szDat); - } - - // Everybody else is on their own... - else - { - // mono hurls on this, .net doesn't, so gonna help... - switch (a_szValue) - { - default: break; - case "65535": a_szValue = "-1"; break; - case "65534": a_szValue = "-2"; break; - case "65533": a_szValue = "-3"; break; - case "65532": a_szValue = "-4"; break; - } - t = (T)Enum.Parse(typeof(T), a_szValue, true); - } - - // Check to see if we changed anything... - szCvt = t.ToString(); - if (szCvt != u32.ToString()) - { - // CAP is in its final form... - if (typeof(T) == typeof(CAP)) - { - return (szCvt); - } - // Everybody else needs the name decoration removed... - else - { - return (typeof(T).ToString().Replace("TWAINWorkingGroup.TWAIN+", "") + "_" + szCvt); - } - } - - // We're probably a custom value... - else - { - return (string.Format("0x{0:X}", u32)); - } - } - - // We're a string... - return (a_szValue); - } - - /// - /// This mess is what tries to turn readable stuff into numeric constants... - /// - /// type for the conversion - /// value to convert - /// - private static string CvtCapValueFromEnumHelper(string a_szValue) - { - // We can figure this one out on our own... - if ((typeof(T).Name == "bool") || (typeof(T).Name == "Boolean")) - { - return (((a_szValue.ToLowerInvariant() == "true") || (a_szValue == "1")) ? "1" : "0"); - } - - // Look for the enum prefix... - if (a_szValue.ToLowerInvariant().StartsWith(typeof(T).Name.ToLowerInvariant() + "_")) - { - return (a_szValue.Substring((typeof(T).Name + "_").Length)); - } - - // Er... - return (a_szValue); - } - - /// - /// This mess is what tries to turn readable stuff into numeric constants... - /// - /// type for the conversion - /// value to convert - /// - private static string CvtCapValueFromTwlg(string a_szValue) - { - // mono goes "hork", probably because the enum is wackadoodle, this - // does work on .net, but what'cha gonna do? - if (a_szValue.ToUpperInvariant().StartsWith("TWLG_")) - { - switch (a_szValue.ToUpperInvariant().Substring(5)) - { - default: break; - case "USERLOCALE": return ("65535"); // -1, kinda... - case "DAN": return ("0"); - case "DUT": return ("1"); - case "ENG": return ("2"); - case "FCF": return ("3"); - case "FIN": return ("4"); - case "FRN": return ("5"); - case "GER": return ("6"); - case "ICE": return ("7"); - case "ITN": return ("8"); - case "NOR": return ("9"); - case "POR": return ("10"); - case "SPA": return ("11"); - case "SWE": return ("12"); - case "USA": return ("13"); - case "AFRIKAANS": return ("14"); - case "ALBANIA": return ("15"); - case "ARABIC": return ("16"); - case "ARABIC_ALGERIA": return ("17"); - case "ARABIC_BAHRAIN": return ("18"); - case "ARABIC_EGYPT": return ("19"); - case "ARABIC_IRAQ": return ("20"); - case "ARABIC_JORDAN": return ("21"); - case "ARABIC_KUWAIT": return ("22"); - case "ARABIC_LEBANON": return ("23"); - case "ARABIC_LIBYA": return ("24"); - case "ARABIC_MOROCCO": return ("25"); - case "ARABIC_OMAN": return ("26"); - case "ARABIC_QATAR": return ("27"); - case "ARABIC_SAUDIARABIA": return ("28"); - case "ARABIC_SYRIA": return ("29"); - case "ARABIC_TUNISIA": return ("30"); - case "ARABIC_UAE": return ("31"); - case "ARABIC_YEMEN": return ("32"); - case "BASQUE": return ("33"); - case "BYELORUSSIAN": return ("34"); - case "BULGARIAN": return ("35"); - case "CATALAN": return ("36"); - case "CHINESE": return ("37"); - case "CHINESE_HONGKONG": return ("38"); - case "CHINESE_PRC": return ("39"); - case "CHINESE_SINGAPORE": return ("40"); - case "CHINESE_SIMPLIFIED": return ("41"); - case "CHINESE_TAIWAN": return ("42"); - case "CHINESE_TRADITIONAL": return ("43"); - case "CROATIA": return ("44"); - case "CZECH": return ("45"); - case "DANISH": return (((int)TWLG.DAN).ToString()); - case "DUTCH": return (((int)TWLG.DUT).ToString()); - case "DUTCH_BELGIAN": return ("46"); - case "ENGLISH": return (((int)TWLG.ENG).ToString()); - case "ENGLISH_AUSTRALIAN": return ("47"); - case "ENGLISH_CANADIAN": return ("48"); - case "ENGLISH_IRELAND": return ("49"); - case "ENGLISH_NEWZEALAND": return ("50"); - case "ENGLISH_SOUTHAFRICA": return ("51"); - case "ENGLISH_UK": return ("52"); - case "ENGLISH_USA": return (((int)TWLG.USA).ToString()); - case "ESTONIAN": return ("53"); - case "FAEROESE": return ("54"); - case "FARSI": return ("55"); - case "FINNISH": return (((int)TWLG.FIN).ToString()); - case "FRENCH": return (((int)TWLG.FRN).ToString()); - case "FRENCH_BELGIAN": return ("56"); - case "FRENCH_CANADIAN": return (((int)TWLG.FCF).ToString()); - case "FRENCH_LUXEMBOURG": return ("57"); - case "FRENCH_SWISS": return ("58"); - case "GERMAN": return (((int)TWLG.GER).ToString()); - case "GERMAN_AUSTRIAN": return ("59"); - case "GERMAN_LUXEMBOURG": return ("60"); - case "GERMAN_LIECHTENSTEIN": return ("61"); - case "GERMAN_SWISS": return ("62"); - case "GREEK": return ("63"); - case "HEBREW": return ("64"); - case "HUNGARIAN": return ("65"); - case "ICELANDIC": return (((int)TWLG.ICE).ToString()); - case "INDONESIAN": return ("66"); - case "ITALIAN": return (((int)TWLG.ITN).ToString()); - case "ITALIAN_SWISS": return ("67"); - case "JAPANESE": return ("68"); - case "KOREAN": return ("69"); - case "KOREAN_JOHAB": return ("70"); - case "LATVIAN": return ("71"); - case "LITHUANIAN": return ("72"); - case "NORWEGIAN": return (((int)TWLG.NOR).ToString()); - case "NORWEGIAN_BOKMAL": return ("73"); - case "NORWEGIAN_NYNORSK": return ("74"); - case "POLISH": return ("75"); - case "PORTUGUESE": return (((int)TWLG.POR).ToString()); - case "PORTUGUESE_BRAZIL": return ("76"); - case "ROMANIAN": return ("77"); - case "RUSSIAN": return ("78"); - case "SERBIAN_LATIN": return ("79"); - case "SLOVAK": return ("80"); - case "SLOVENIAN": return ("81"); - case "SPANISH": return (((int)TWLG.SPA).ToString()); - case "SPANISH_MEXICAN": return ("82"); - case "SPANISH_MODERN": return ("83"); - case "SWEDISH": return (((int)TWLG.SWE).ToString()); - case "THAI": return ("84"); - case "TURKISH": return ("85"); - case "UKRANIAN": return ("86"); - case "ASSAMESE": return ("87"); - case "BENGALI": return ("88"); - case "BIHARI": return ("89"); - case "BODO": return ("90"); - case "DOGRI": return ("91"); - case "GUJARATI": return ("92"); - case "HARYANVI": return ("93"); - case "HINDI": return ("94"); - case "KANNADA": return ("95"); - case "KASHMIRI": return ("96"); - case "MALAYALAM": return ("97"); - case "MARATHI": return ("98"); - case "MARWARI": return ("99"); - case "MEGHALAYAN": return ("100"); - case "MIZO": return ("101"); - case "NAGA": return ("102"); - case "ORISSI": return ("103"); - case "PUNJABI": return ("104"); - case "PUSHTU": return ("105"); - case "SERBIAN_CYRILLIC": return ("106"); - case "SIKKIMI": return ("107"); - case "SWEDISH_FINLAND": return ("108"); - case "TAMIL": return ("109"); - case "TELUGU": return ("110"); - case "TRIPURI": return ("111"); - case "URDU": return ("112"); - case "VIETNAMESE": return ("113"); - } - } - - // Er... - return (a_szValue); - } - - /// - /// Convert a value to the 'friendly' name, based on the capability... - /// - /// capability driving the conversion - /// value to convert - /// - public static string CvtCapValueToEnum(CAP a_cap, string a_szValue) - { - switch (a_cap) - { - default: return (a_szValue); - case CAP.ACAP_XFERMECH: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_ALARMS: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_ALARMVOLUME: return (a_szValue); - case CAP.CAP_AUTHOR: return (a_szValue); - case CAP.CAP_AUTOFEED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_AUTOMATICCAPTURE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_AUTOMATICSENSEMEDIUM: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_AUTOSCAN: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_BATTERYMINUTES: return (a_szValue); - case CAP.CAP_BATTERYPERCENTAGE: return (a_szValue); - case CAP.CAP_CAMERAENABLED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_CAMERAORDER: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_CAMERAPREVIEWUI: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_CAMERASIDE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_CAPTION: return (a_szValue); - case CAP.CAP_CLEARPAGE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_CUSTOMDSDATA: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_CUSTOMINTERFACEGUID: return (a_szValue); - case CAP.CAP_DEVICEEVENT: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_DEVICEONLINE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_DEVICETIMEDATE: return (a_szValue); - case CAP.CAP_DOUBLEFEEDDETECTION: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_DOUBLEFEEDDETECTIONLENGTH: return (a_szValue); - case CAP.CAP_DOUBLEFEEDDETECTIONRESPONSE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_DOUBLEFEEDDETECTIONSENSITIVITY: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_DUPLEX: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_DUPLEXENABLED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_ENABLEDSUIONLY: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_ENDORSER: return (a_szValue); - case CAP.CAP_EXTENDEDCAPS: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_FEEDERALIGNMENT: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_FEEDERENABLED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_FEEDERLOADED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_FEEDERORDER: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_FEEDERPOCKET: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_FEEDERPREP: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_FEEDPAGE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_IAFIELDA_LASTPAGE: return (a_szValue); - case CAP.CAP_IAFIELDB_LASTPAGE: return (a_szValue); - case CAP.CAP_IAFIELDC_LASTPAGE: return (a_szValue); - case CAP.CAP_IAFIELDD_LASTPAGE: return (a_szValue); - case CAP.CAP_IAFIELDA_LEVEL: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_IAFIELDB_LEVEL: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_IAFIELDC_LEVEL: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_IAFIELDD_LEVEL: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_IAFIELDA_PRINTFORMAT: return (a_szValue); - case CAP.CAP_IAFIELDB_PRINTFORMAT: return (a_szValue); - case CAP.CAP_IAFIELDC_PRINTFORMAT: return (a_szValue); - case CAP.CAP_IAFIELDD_PRINTFORMAT: return (a_szValue); - case CAP.CAP_IAFIELDA_VALUE: return (a_szValue); - case CAP.CAP_IAFIELDB_VALUE: return (a_szValue); - case CAP.CAP_IAFIELDC_VALUE: return (a_szValue); - case CAP.CAP_IAFIELDD_VALUE: return (a_szValue); - case CAP.CAP_IMAGEADDRESSENABLED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_INDICATORS: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_INDICATORSMODE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_JOBCONTROL: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_LANGUAGE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_MAXBATCHBUFFERS: return (a_szValue); - case CAP.CAP_MICRENABLED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_PAPERDETECTABLE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_PAPERHANDLING: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_POWERSAVETIME: return (a_szValue); - case CAP.CAP_POWERSUPPLY: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_PRINTER: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_PRINTERCHARROTATION: return (a_szValue); - case CAP.CAP_PRINTERENABLED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_PRINTERFONTSTYLE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_PRINTERINDEX: return (a_szValue); - case CAP.CAP_PRINTERINDEXLEADCHAR: return (a_szValue); - case CAP.CAP_PRINTERINDEXMAXVALUE: return (a_szValue); - case CAP.CAP_PRINTERINDEXNUMDIGITS: return (a_szValue); - case CAP.CAP_PRINTERINDEXSTEP: return (a_szValue); - case CAP.CAP_PRINTERINDEXTRIGGER: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_PRINTERMODE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_PRINTERSTRING: return (a_szValue); - case CAP.CAP_PRINTERSTRINGPREVIEW: return (a_szValue); - case CAP.CAP_PRINTERSUFFIX: return (a_szValue); - case CAP.CAP_PRINTERVERTICALOFFSET: return (a_szValue); - case CAP.CAP_REACQUIREALLOWED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_REWINDPAGE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_SEGMENTED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_SERIALNUMBER: return (a_szValue); - case CAP.CAP_SHEETCOUNT: return (a_szValue); - case CAP.CAP_SUPPORTEDCAPS: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_SUPPORTEDCAPSSEGMENTUNIQUE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_SUPPORTEDDATS: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_THUMBNAILSENABLED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_TIMEBEFOREFIRSTCAPTURE: return (a_szValue); - case CAP.CAP_TIMEBETWEENCAPTURES: return (a_szValue); - case CAP.CAP_TIMEDATE: return (a_szValue); - case CAP.CAP_UICONTROLLABLE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.CAP_XFERCOUNT: return (a_szValue); - case CAP.ICAP_AUTOBRIGHT: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_AUTODISCARDBLANKPAGES: return (a_szValue); - case CAP.ICAP_AUTOMATICBORDERDETECTION: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_AUTOMATICCOLORENABLED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_AUTOMATICCROPUSESFRAME: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_AUTOMATICDESKEW: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_AUTOMATICLENGTHDETECTION: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_AUTOMATICROTATE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_AUTOSIZE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_BARCODEDETECTIONENABLED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_BARCODEMAXRETRIES: return (a_szValue); - case CAP.ICAP_BARCODEMAXSEARCHPRIORITIES: return (a_szValue); - case CAP.ICAP_BARCODESEARCHMODE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_BARCODESEARCHPRIORITIES: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_BARCODETIMEOUT: return (a_szValue); - case CAP.ICAP_BITDEPTH: return (a_szValue); - case CAP.ICAP_BITDEPTHREDUCTION: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_BITORDER: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_BITORDERCODES: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_BRIGHTNESS: return (a_szValue); - case CAP.ICAP_CCITTKFACTOR: return (a_szValue); - case CAP.ICAP_COLORMANAGEMENTENABLED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_COMPRESSION: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_CONTRAST: return (a_szValue); - case CAP.ICAP_CUSTHALFTONE: return (a_szValue); - case CAP.ICAP_EXPOSURETIME: return (a_szValue); - case CAP.ICAP_EXTIMAGEINFO: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_FEEDERTYPE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_FILMTYPE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_FILTER: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_FLASHUSED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_FLASHUSED2: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_FLIPROTATION: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_FRAMES: return (a_szValue); - case CAP.ICAP_GAMMA: return (a_szValue); - case CAP.ICAP_HALFTONES: return (a_szValue); - case CAP.ICAP_HIGHLIGHT: return (a_szValue); - case CAP.ICAP_ICCPROFILE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_IMAGEDATASET: return (a_szValue); - case CAP.ICAP_IMAGEFILEFORMAT: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_IMAGEFILTER: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_IMAGEMERGE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_IMAGEMERGEHEIGHTTHRESHOLD: return (a_szValue); - case CAP.ICAP_JPEGPIXELTYPE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_JPEGQUALITY: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_JPEGSUBSAMPLING: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_LAMPSTATE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_LIGHTPATH: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_LIGHTSOURCE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_MAXFRAMES: return (a_szValue); - case CAP.ICAP_MINIMUMHEIGHT: return (a_szValue); - case CAP.ICAP_MINIMUMWIDTH: return (a_szValue); - case CAP.ICAP_MIRROR: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_NOISEFILTER: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_ORIENTATION: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_OVERSCAN: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_PATCHCODEDETECTIONENABLED: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_PATCHCODEMAXRETRIES: return (a_szValue); - case CAP.ICAP_PATCHCODEMAXSEARCHPRIORITIES: return (a_szValue); - case CAP.ICAP_PATCHCODESEARCHMODE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_PATCHCODESEARCHPRIORITIES: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_PATCHCODETIMEOUT: return (a_szValue); - case CAP.ICAP_PHYSICALHEIGHT: return (a_szValue); - case CAP.ICAP_PHYSICALWIDTH: return (a_szValue); - case CAP.ICAP_PIXELFLAVOR: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_PIXELFLAVORCODES: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_PIXELTYPE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_PLANARCHUNKY: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_ROTATION: return (a_szValue); - case CAP.ICAP_SHADOW: return (a_szValue); - case CAP.ICAP_SUPPORTEDBARCODETYPES: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_SUPPORTEDEXTIMAGEINFO: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_SUPPORTEDPATCHCODETYPES: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_SUPPORTEDSIZES: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_THRESHOLD: return (a_szValue); - case CAP.ICAP_TILES: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_TIMEFILL: return (a_szValue); - case CAP.ICAP_UNDEFINEDIMAGESIZE: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_UNITS: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_XFERMECH: return (CvtCapValueToEnumHelper(a_szValue)); - case CAP.ICAP_XNATIVERESOLUTION: return (a_szValue); - case CAP.ICAP_XRESOLUTION: return (a_szValue); - case CAP.ICAP_XSCALING: return (a_szValue); - case CAP.ICAP_YNATIVERESOLUTION: return (a_szValue); - case CAP.ICAP_YRESOLUTION: return (a_szValue); - case CAP.ICAP_YSCALING: return (a_szValue); - case CAP.ICAP_ZOOMFACTOR: return (a_szValue); - } - } - - /// - /// Convert a 'friendly' name to a numeric value... - /// - /// capability driving the conversion - /// value to convert - /// - public static string CvtCapValueFromEnum(CAP a_cap, string a_szValue) - { - int ii; - - // Turn hex into a decimal... - if (a_szValue.ToLowerInvariant().StartsWith("0x")) - { - return (int.Parse(a_szValue.Substring(2), NumberStyles.HexNumber).ToString()); - } - - // Skip numbers... - if (int.TryParse(a_szValue, out ii)) - { - return (a_szValue); - } - - // Process text... - switch (a_cap) - { - default: return (a_szValue); - case CAP.ACAP_XFERMECH: { TWSX twsx; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twsx) ? ((int)twsx).ToString() : a_szValue); }; - case CAP.CAP_ALARMS: { TWAL twal; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twal) ? ((int)twal).ToString() : a_szValue); }; - case CAP.CAP_ALARMVOLUME: return (a_szValue); - case CAP.CAP_AUTHOR: return (a_szValue); - case CAP.CAP_AUTOFEED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_AUTOMATICCAPTURE: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_AUTOMATICSENSEMEDIUM: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_AUTOSCAN: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_BATTERYMINUTES: return (a_szValue); - case CAP.CAP_BATTERYPERCENTAGE: return (a_szValue); - case CAP.CAP_CAMERAENABLED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_CAMERAORDER: { TWPT twpt; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twpt) ? ((int)twpt).ToString() : a_szValue); }; - case CAP.CAP_CAMERAPREVIEWUI: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_CAMERASIDE: { TWCS twcs; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twcs) ? ((int)twcs).ToString() : a_szValue); }; - case CAP.CAP_CAPTION: return (a_szValue); - case CAP.CAP_CLEARPAGE: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_CUSTOMDSDATA: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_CUSTOMINTERFACEGUID: return (a_szValue); - case CAP.CAP_DEVICEEVENT: { TWDE twde; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twde) ? ((int)twde).ToString() : a_szValue); }; - case CAP.CAP_DEVICEONLINE: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_DEVICETIMEDATE: return (a_szValue); - case CAP.CAP_DOUBLEFEEDDETECTION: { TWDF twdf; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twdf) ? ((int)twdf).ToString() : a_szValue); }; - case CAP.CAP_DOUBLEFEEDDETECTIONLENGTH: return (a_szValue); - case CAP.CAP_DOUBLEFEEDDETECTIONRESPONSE: { TWDP twdp; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twdp) ? ((int)twdp).ToString() : a_szValue); }; - case CAP.CAP_DOUBLEFEEDDETECTIONSENSITIVITY: { TWUS twus; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twus) ? ((int)twus).ToString() : a_szValue); }; - case CAP.CAP_DUPLEX: { TWDX twdx; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twdx) ? ((int)twdx).ToString() : a_szValue); }; - case CAP.CAP_DUPLEXENABLED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_ENABLEDSUIONLY: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_ENDORSER: return (a_szValue); - case CAP.CAP_EXTENDEDCAPS: { CAP cap; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out cap) ? ((int)cap).ToString() : a_szValue); }; - case CAP.CAP_FEEDERALIGNMENT: { TWFA twfa; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twfa) ? ((int)twfa).ToString() : a_szValue); }; - case CAP.CAP_FEEDERENABLED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_FEEDERLOADED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_FEEDERORDER: { TWFO twfo; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twfo) ? ((int)twfo).ToString() : a_szValue); }; - case CAP.CAP_FEEDERPOCKET: { TWFP twfp; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twfp) ? ((int)twfp).ToString() : a_szValue); }; - case CAP.CAP_FEEDERPREP: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_FEEDPAGE: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_IAFIELDA_LASTPAGE: return (a_szValue); - case CAP.CAP_IAFIELDB_LASTPAGE: return (a_szValue); - case CAP.CAP_IAFIELDC_LASTPAGE: return (a_szValue); - case CAP.CAP_IAFIELDD_LASTPAGE: return (a_szValue); - case CAP.CAP_IAFIELDA_LEVEL: { TWIA twia; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twia) ? ((int)twia).ToString() : a_szValue); }; - case CAP.CAP_IAFIELDB_LEVEL: { TWIA twia; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twia) ? ((int)twia).ToString() : a_szValue); }; - case CAP.CAP_IAFIELDC_LEVEL: { TWIA twia; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twia) ? ((int)twia).ToString() : a_szValue); }; - case CAP.CAP_IAFIELDD_LEVEL: { TWIA twia; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twia) ? ((int)twia).ToString() : a_szValue); }; - case CAP.CAP_IAFIELDA_PRINTFORMAT: return (a_szValue); - case CAP.CAP_IAFIELDB_PRINTFORMAT: return (a_szValue); - case CAP.CAP_IAFIELDC_PRINTFORMAT: return (a_szValue); - case CAP.CAP_IAFIELDD_PRINTFORMAT: return (a_szValue); - case CAP.CAP_IAFIELDA_VALUE: return (a_szValue); - case CAP.CAP_IAFIELDB_VALUE: return (a_szValue); - case CAP.CAP_IAFIELDC_VALUE: return (a_szValue); - case CAP.CAP_IAFIELDD_VALUE: return (a_szValue); - case CAP.CAP_IMAGEADDRESSENABLED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_INDICATORS: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_INDICATORSMODE: { TWCI twci; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twci) ? ((int)twci).ToString() : a_szValue); }; - case CAP.CAP_JOBCONTROL: { TWJC twjc; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twjc) ? ((int)twjc).ToString() : a_szValue); }; - case CAP.CAP_LANGUAGE: return(CvtCapValueFromTwlg(a_szValue)); - case CAP.CAP_MAXBATCHBUFFERS: return (a_szValue); - case CAP.CAP_MICRENABLED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_PAPERDETECTABLE: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_PAPERHANDLING: { TWPH twph; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twph) ? ((int)twph).ToString() : a_szValue); }; - case CAP.CAP_POWERSAVETIME: return (a_szValue); - case CAP.CAP_POWERSUPPLY: { TWPS twps; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twps) ? ((int)twps).ToString() : a_szValue); }; - case CAP.CAP_PRINTER: { TWPR twpr; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twpr) ? ((int)twpr).ToString() : a_szValue); }; - case CAP.CAP_PRINTERCHARROTATION: return (a_szValue); - case CAP.CAP_PRINTERENABLED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_PRINTERFONTSTYLE: { TWPF twpf; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twpf) ? ((int)twpf).ToString() : a_szValue); }; - case CAP.CAP_PRINTERINDEX: return (a_szValue); - case CAP.CAP_PRINTERINDEXLEADCHAR: return (a_szValue); - case CAP.CAP_PRINTERINDEXMAXVALUE: return (a_szValue); - case CAP.CAP_PRINTERINDEXNUMDIGITS: return (a_szValue); - case CAP.CAP_PRINTERINDEXSTEP: return (a_szValue); - case CAP.CAP_PRINTERINDEXTRIGGER: { TWCT twct; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twct) ? ((int)twct).ToString() : a_szValue); }; - case CAP.CAP_PRINTERMODE: { TWPM twpm; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twpm) ? ((int)twpm).ToString() : a_szValue); }; - case CAP.CAP_PRINTERSTRING: return (a_szValue); - case CAP.CAP_PRINTERSTRINGPREVIEW: return (a_szValue); - case CAP.CAP_PRINTERSUFFIX: return (a_szValue); - case CAP.CAP_PRINTERVERTICALOFFSET: return (a_szValue); - case CAP.CAP_REACQUIREALLOWED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_REWINDPAGE: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_SEGMENTED: { TWSG twsg; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twsg) ? ((int)twsg).ToString() : a_szValue); }; - case CAP.CAP_SERIALNUMBER: return (a_szValue); - case CAP.CAP_SHEETCOUNT: return (a_szValue); - case CAP.CAP_SUPPORTEDCAPS: { CAP cap; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out cap) ? ((int)cap).ToString() : a_szValue); }; - case CAP.CAP_SUPPORTEDCAPSSEGMENTUNIQUE: { CAP cap; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out cap) ? ((int)cap).ToString() : a_szValue); }; - case CAP.CAP_SUPPORTEDDATS: { DAT dat; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out dat) ? ((int)dat).ToString() : a_szValue); }; - case CAP.CAP_THUMBNAILSENABLED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_TIMEBEFOREFIRSTCAPTURE: return (a_szValue); - case CAP.CAP_TIMEBETWEENCAPTURES: return (a_szValue); - case CAP.CAP_TIMEDATE: return (a_szValue); - case CAP.CAP_UICONTROLLABLE: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.CAP_XFERCOUNT: return (a_szValue); - case CAP.ICAP_AUTOBRIGHT: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_AUTODISCARDBLANKPAGES: { TWBP twbp; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twbp) ? ((int)twbp).ToString() : a_szValue); }; - case CAP.ICAP_AUTOMATICBORDERDETECTION: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_AUTOMATICCOLORENABLED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE: { TWPT twpt; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twpt) ? ((int)twpt).ToString() : a_szValue); }; - case CAP.ICAP_AUTOMATICCROPUSESFRAME: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_AUTOMATICDESKEW: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_AUTOMATICLENGTHDETECTION: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_AUTOMATICROTATE: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_AUTOSIZE: { TWAS twas; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twas) ? ((int)twas).ToString() : a_szValue); }; - case CAP.ICAP_BARCODEDETECTIONENABLED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_BARCODEMAXRETRIES: return (a_szValue); - case CAP.ICAP_BARCODEMAXSEARCHPRIORITIES: return (a_szValue); - case CAP.ICAP_BARCODESEARCHMODE: { TWBD twbd; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twbd) ? ((int)twbd).ToString() : a_szValue); }; - case CAP.ICAP_BARCODESEARCHPRIORITIES: { TWBT twbt; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twbt) ? ((int)twbt).ToString() : a_szValue); }; - case CAP.ICAP_BARCODETIMEOUT: return (a_szValue); - case CAP.ICAP_BITDEPTH: return (a_szValue); - case CAP.ICAP_BITDEPTHREDUCTION: { TWBR twbr; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twbr) ? ((int)twbr).ToString() : a_szValue); }; - case CAP.ICAP_BITORDER: { TWBO twbo; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twbo) ? ((int)twbo).ToString() : a_szValue); }; - case CAP.ICAP_BITORDERCODES: { TWBO twbo; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twbo) ? ((int)twbo).ToString() : a_szValue); }; - case CAP.ICAP_BRIGHTNESS: return (a_szValue); - case CAP.ICAP_CCITTKFACTOR: return (a_szValue); - case CAP.ICAP_COLORMANAGEMENTENABLED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_COMPRESSION: { TWCP twcp; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twcp) ? ((int)twcp).ToString() : a_szValue); }; - case CAP.ICAP_CONTRAST: return (a_szValue); - case CAP.ICAP_CUSTHALFTONE: return (a_szValue); - case CAP.ICAP_EXPOSURETIME: return (a_szValue); - case CAP.ICAP_EXTIMAGEINFO: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_FEEDERTYPE: { TWFE twfe; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twfe) ? ((int)twfe).ToString() : a_szValue); }; - case CAP.ICAP_FILMTYPE: { TWFM twfm; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twfm) ? ((int)twfm).ToString() : a_szValue); }; - case CAP.ICAP_FILTER: { TWFT twft; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twft) ? ((int)twft).ToString() : a_szValue); }; - case CAP.ICAP_FLASHUSED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_FLASHUSED2: { TWFL twfl; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twfl) ? ((int)twfl).ToString() : a_szValue); }; - case CAP.ICAP_FLIPROTATION: { TWFR twfr; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twfr) ? ((int)twfr).ToString() : a_szValue); }; - case CAP.ICAP_FRAMES: return (a_szValue); - case CAP.ICAP_GAMMA: return (a_szValue); - case CAP.ICAP_HALFTONES: return (a_szValue); - case CAP.ICAP_HIGHLIGHT: return (a_szValue); - case CAP.ICAP_ICCPROFILE: { TWIC twic; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twic) ? ((int)twic).ToString() : a_szValue); }; - case CAP.ICAP_IMAGEDATASET: return (a_szValue); - case CAP.ICAP_IMAGEFILEFORMAT: { TWFF twff; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twff) ? ((int)twff).ToString() : a_szValue); }; - case CAP.ICAP_IMAGEFILTER: { TWIF twif; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twif) ? ((int)twif).ToString() : a_szValue); }; - case CAP.ICAP_IMAGEMERGE: { TWIM twim; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twim) ? ((int)twim).ToString() : a_szValue); }; - case CAP.ICAP_IMAGEMERGEHEIGHTTHRESHOLD: return (a_szValue); - case CAP.ICAP_JPEGPIXELTYPE: { TWPT twpt; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twpt) ? ((int)twpt).ToString() : a_szValue); }; - case CAP.ICAP_JPEGQUALITY: { TWJQ twjq; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twjq) ? ((int)twjq).ToString() : a_szValue); }; - case CAP.ICAP_JPEGSUBSAMPLING: { TWJS twjs; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twjs) ? ((int)twjs).ToString() : a_szValue); }; - case CAP.ICAP_LAMPSTATE: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_LIGHTPATH: { TWLP twlp; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twlp) ? ((int)twlp).ToString() : a_szValue); }; - case CAP.ICAP_LIGHTSOURCE: { TWLS twls; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twls) ? ((int)twls).ToString() : a_szValue); }; - case CAP.ICAP_MAXFRAMES: return (a_szValue); - case CAP.ICAP_MINIMUMHEIGHT: return (a_szValue); - case CAP.ICAP_MINIMUMWIDTH: return (a_szValue); - case CAP.ICAP_MIRROR: { TWMR twmr; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twmr) ? ((int)twmr).ToString() : a_szValue); }; - case CAP.ICAP_NOISEFILTER: { TWNF twnf; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twnf) ? ((int)twnf).ToString() : a_szValue); }; - case CAP.ICAP_ORIENTATION: { TWOR twor; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twor) ? ((int)twor).ToString() : a_szValue); }; - case CAP.ICAP_OVERSCAN: { TWOV twov; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twov) ? ((int)twov).ToString() : a_szValue); }; - case CAP.ICAP_PATCHCODEDETECTIONENABLED: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_PATCHCODEMAXRETRIES: return (a_szValue); - case CAP.ICAP_PATCHCODEMAXSEARCHPRIORITIES: return (a_szValue); - case CAP.ICAP_PATCHCODESEARCHMODE: { TWBD twbd; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twbd) ? ((int)twbd).ToString() : a_szValue); }; - case CAP.ICAP_PATCHCODESEARCHPRIORITIES: { TWPCH twpch; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twpch) ? ((int)twpch).ToString() : a_szValue); }; - case CAP.ICAP_PATCHCODETIMEOUT: return (a_szValue); - case CAP.ICAP_PHYSICALHEIGHT: return (a_szValue); - case CAP.ICAP_PHYSICALWIDTH: return (a_szValue); - case CAP.ICAP_PIXELFLAVOR: { TWPF twpf; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twpf) ? ((int)twpf).ToString() : a_szValue); }; - case CAP.ICAP_PIXELFLAVORCODES: { TWPF twpf; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twpf) ? ((int)twpf).ToString() : a_szValue); }; - case CAP.ICAP_PIXELTYPE: { TWPT twpt; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twpt) ? ((int)twpt).ToString() : a_szValue); }; - case CAP.ICAP_PLANARCHUNKY: { TWPC twpc; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twpc) ? ((int)twpc).ToString() : a_szValue); }; - case CAP.ICAP_ROTATION: return (a_szValue); - case CAP.ICAP_SHADOW: return (a_szValue); - case CAP.ICAP_SUPPORTEDBARCODETYPES: { TWBT twbt; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twbt) ? ((int)twbt).ToString() : a_szValue); }; - case CAP.ICAP_SUPPORTEDEXTIMAGEINFO: { TWEI twei; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twei) ? ((int)twei).ToString() : a_szValue); }; - case CAP.ICAP_SUPPORTEDPATCHCODETYPES: { TWPCH twpch; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twpch) ? ((int)twpch).ToString() : a_szValue); }; - case CAP.ICAP_SUPPORTEDSIZES: { TWSS twss; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twss) ? ((int)twss).ToString() : a_szValue); }; - case CAP.ICAP_THRESHOLD: return (a_szValue); - case CAP.ICAP_TILES: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_TIMEFILL: return (a_szValue); - case CAP.ICAP_UNDEFINEDIMAGESIZE: return (CvtCapValueFromEnumHelper(a_szValue)); - case CAP.ICAP_UNITS: { TWUN twun; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twun) ? ((int)twun).ToString() : a_szValue); }; - case CAP.ICAP_XFERMECH: { TWSX twsx; return (Enum.TryParse(CvtCapValueFromEnumHelper(a_szValue), out twsx) ? ((int)twsx).ToString() : a_szValue); }; - case CAP.ICAP_XNATIVERESOLUTION: return (a_szValue); - case CAP.ICAP_XRESOLUTION: return (a_szValue); - case CAP.ICAP_XSCALING: return (a_szValue); - case CAP.ICAP_YNATIVERESOLUTION: return (a_szValue); - case CAP.ICAP_YRESOLUTION: return (a_szValue); - case CAP.ICAP_YSCALING: return (a_szValue); - case CAP.ICAP_ZOOMFACTOR: return (a_szValue); - } - } - - /// - /// Convert a value to the 'friendly' name, based on the TWEI... - /// - /// TWEI driving the conversion - /// value to convert - /// - public static string CvtTweiValueToEnum(TWEI a_twei, string a_szValue) - { - switch (a_twei) - { - default: return (a_szValue); - case TWEI.BARCODECONFIDENCE: return (a_szValue); - case TWEI.BARCODECOUNT: return (a_szValue); - case TWEI.BARCODEROTATION: return (CvtCapValueToEnumHelper(a_szValue)); - case TWEI.BARCODETEXT: return (a_szValue); - case TWEI.BARCODETEXT2: return (a_szValue); - case TWEI.BARCODETEXTLENGTH: return (a_szValue); - case TWEI.BARCODETYPE: return (CvtCapValueToEnumHelper(a_szValue)); - case TWEI.BARCODEX: return (a_szValue); - case TWEI.BARCODEY: return (a_szValue); - case TWEI.BLACKSPECKLESREMOVED: return (a_szValue); - case TWEI.BOOKNAME: return (a_szValue); - case TWEI.CAMERA: return (a_szValue); - case TWEI.CHAPTERNUMBER: return (a_szValue); - case TWEI.DESHADEBLACKCOUNTNEW: return (a_szValue); - case TWEI.DESHADEBLACKCOUNTOLD: return (a_szValue); - case TWEI.DESHADEBLACKRLMAX: return (a_szValue); - case TWEI.DESHADEBLACKRLMIN: return (a_szValue); - case TWEI.DESHADECOUNT: return (a_szValue); - case TWEI.DESHADEHEIGHT: return (a_szValue); - case TWEI.DESHADELEFT: return (a_szValue); - case TWEI.DESHADESIZE: return (a_szValue); - case TWEI.DESHADETOP: return (a_szValue); - case TWEI.DESHADEWHITECOUNTNEW: return (a_szValue); - case TWEI.DESHADEWHITECOUNTOLD: return (a_szValue); - case TWEI.DESHADEWHITERLAVE: return (a_szValue); - case TWEI.DESHADEWHITERLMAX: return (a_szValue); - case TWEI.DESHADEWHITERLMIN: return (a_szValue); - case TWEI.DESHADEWIDTH: return (a_szValue); - case TWEI.DESKEWSTATUS: return (CvtCapValueToEnumHelper(a_szValue)); - case TWEI.DOCUMENTNUMBER: return (a_szValue); - case TWEI.ENDORSEDTEXT: return (a_szValue); - case TWEI.FILESYSTEMSOURCE: return (a_szValue); - case TWEI.FORMCONFIDENCE: return (a_szValue); - case TWEI.FORMHORZDOCOFFSET: return (a_szValue); - case TWEI.FORMTEMPLATEMATCH: return (a_szValue); - case TWEI.FORMTEMPLATEPAGEMATCH: return (a_szValue); - case TWEI.FORMVERTDOCOFFSET: return (a_szValue); - case TWEI.FRAME: return (a_szValue); - case TWEI.FRAMENUMBER: return (a_szValue); - case TWEI.HORZLINECOUNT: return (a_szValue); - case TWEI.HORZLINELENGTH: return (a_szValue); - case TWEI.HORZLINETHICKNESS: return (a_szValue); - case TWEI.HORZLINEXCOORD: return (a_szValue); - case TWEI.HORZLINEYCOORD: return (a_szValue); - case TWEI.IAFIELDA_VALUE: return (a_szValue); - case TWEI.IAFIELDB_VALUE: return (a_szValue); - case TWEI.IAFIELDC_VALUE: return (a_szValue); - case TWEI.IAFIELDD_VALUE: return (a_szValue); - case TWEI.IAFIELDE_VALUE: return (a_szValue); - case TWEI.IALEVEL: return (CvtCapValueToEnumHelper(a_szValue)); - case TWEI.ICCPROFILE: return (a_szValue); - case TWEI.IMAGEMERGED: return (CvtCapValueToEnumHelper(a_szValue)); - case TWEI.LASTSEGMENT: return (CvtCapValueToEnumHelper(a_szValue)); - case TWEI.MAGDATA: return (a_szValue); - case TWEI.MAGDATALENGTH: return (a_szValue); - case TWEI.MAGTYPE: return (CvtCapValueToEnumHelper(a_szValue)); - case TWEI.PAGENUMBER: return (a_szValue); - case TWEI.PAGESIDE: return (a_szValue); - case TWEI.PAPERCOUNT: return (a_szValue); - case TWEI.PATCHCODE: return (CvtCapValueToEnumHelper(a_szValue)); - case TWEI.PIXELFLAVOR: return (CvtCapValueToEnumHelper(a_szValue)); - case TWEI.PRINTER: return (CvtCapValueToEnumHelper(a_szValue)); - case TWEI.PRINTERTEXT: return (a_szValue); - case TWEI.SEGMENTNUMBER: return (a_szValue); - case TWEI.SKEWCONFIDENCE: return (a_szValue); - case TWEI.SKEWFINALANGLE: return (a_szValue); - case TWEI.SKEWORIGINALANGLE: return (a_szValue); - case TWEI.SKEWWINDOWX1: return (a_szValue); - case TWEI.SKEWWINDOWX2: return (a_szValue); - case TWEI.SKEWWINDOWX3: return (a_szValue); - case TWEI.SKEWWINDOWX4: return (a_szValue); - case TWEI.SKEWWINDOWY1: return (a_szValue); - case TWEI.SKEWWINDOWY2: return (a_szValue); - case TWEI.SKEWWINDOWY3: return (a_szValue); - case TWEI.SKEWWINDOWY4: return (a_szValue); - case TWEI.SPECKLESREMOVED: return (a_szValue); - case TWEI.TWAINDIRECTMETADATA: return (a_szValue); - case TWEI.VERTLINECOUNT: return (a_szValue); - case TWEI.VERTLINELENGTH: return (a_szValue); - case TWEI.VERTLINETHICKNESS: return (a_szValue); - case TWEI.VERTLINEXCOORD: return (a_szValue); - case TWEI.VERTLINEYCOORD: return (a_szValue); - case TWEI.WHITESPECKLESREMOVED: return (a_szValue); - } - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Public DSM_Entry calls, most of the DSM_Entry calls are in here. Their - // main contribution is to make sure that they're running within the right - // thread, but they also include the state transitions... - /////////////////////////////////////////////////////////////////////////////// - #region Public DSM_Entry calls... - - /// - /// Generic DSM when the dest must be zero (null)... - /// - /// Data group - /// Data argument type - /// Operation - /// Pointer to data - /// TWAIN status - public STS DsmEntryNullDest(DG a_dg, DAT a_dat, MSG a_msg, IntPtr a_twmemref) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twmemref = a_twmemref; - threaddata.msg = a_msg; - threaddata.dg = a_dg; - threaddata.dat = a_dat; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twmemref = m_twaincommand.Get(lIndex).twmemref; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), a_dat.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryNullDest(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, a_dat, a_msg, a_twmemref); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryNullDest(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, a_dat, a_msg, a_twmemref); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryNullDest(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, a_dat, a_msg, a_twmemref); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryNullDest(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, a_dat, a_msg, a_twmemref); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryNullDest(ref m_twidentityApp, IntPtr.Zero, a_dg, a_dat, a_msg, a_twmemref); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryNullDest(ref m_twidentitymacosxApp, IntPtr.Zero, a_dg, a_dat, a_msg, a_twmemref); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryNullDest(ref m_twidentitymacosxApp, IntPtr.Zero, a_dg, a_dat, a_msg, a_twmemref); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - TWAINWorkingGroup.Log.Assert("Unsupported platform..." + ms_platform); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (sts); - } - - /// - /// Generic DSM when the dest must be a data source... - /// - /// Data group - /// Data argument type - /// Operation - /// Pointer to data - /// TWAIN status - public STS DsmEntry(DG a_dg, DAT a_dat, MSG a_msg, IntPtr a_twmemref) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twmemref = a_twmemref; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = a_dat; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twmemref = m_twaincommand.Get(lIndex).twmemref; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), a_dat.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntry(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, a_dat, a_msg, a_twmemref); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntry(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, a_dat, a_msg, a_twmemref); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntry(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, a_dat, a_msg, a_twmemref); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntry(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, a_dat, a_msg, a_twmemref); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntry(ref m_twidentityApp, ref m_twidentityDs, a_dg, a_dat, a_msg, a_twmemref); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntry(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.AUDIOINFO, a_msg, a_twmemref); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntry(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.AUDIOINFO, a_msg, a_twmemref); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue file audio transfer commands... - /// - /// Data group - /// Operation - /// TWAIN status - private void DatAudiofilexferWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatAudiofilexfer.sts = (STS)NativeMethods.WindowsTwain32DsmEntryAudiofilexfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatAudiofilexfer.dg, - m_threaddataDatAudiofilexfer.dat, - m_threaddataDatAudiofilexfer.msg, - IntPtr.Zero - ); - } - private void DatAudiofilexferWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatAudiofilexfer.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryAudiofilexfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatAudiofilexfer.dg, - m_threaddataDatAudiofilexfer.dat, - m_threaddataDatAudiofilexfer.msg, - IntPtr.Zero - ); - } - public STS DatAudiofilexfer(DG a_dg, MSG a_msg) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (this.m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.AUDIOFILEXFER; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.AUDIOFILEXFER.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatAudiofilexfer.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryAudiofilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.AUDIOFILEXFER, a_msg, IntPtr.Zero); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryAudiofilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.AUDIOFILEXFER, a_msg, IntPtr.Zero); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatAudiofilexfer = default(ThreadData); - m_threaddataDatAudiofilexfer.blIsInuse = true; - m_threaddataDatAudiofilexfer.dg = a_dg; - m_threaddataDatAudiofilexfer.msg = a_msg; - m_threaddataDatAudiofilexfer.dat = DAT.AUDIOFILEXFER; - RunInUiThread(DatAudiofilexferWindowsTwain32); - sts = m_threaddataDatAudiofilexfer.sts; - m_threaddataDatAudiofilexfer = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatAudiofilexfer = default(ThreadData); - m_threaddataDatAudiofilexfer.blIsInuse = true; - m_threaddataDatAudiofilexfer.dg = a_dg; - m_threaddataDatAudiofilexfer.msg = a_msg; - m_threaddataDatAudiofilexfer.dat = DAT.AUDIOFILEXFER; - RunInUiThread(DatAudiofilexferWindowsTwainDsm); - sts = m_threaddataDatAudiofilexfer.sts; - m_threaddataDatAudiofilexfer = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryAudiofilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.AUDIOFILEXFER, a_msg, IntPtr.Zero); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryAudiofilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.AUDIOFILEXFER, a_msg, IntPtr.Zero); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryAudiofilexfer(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.AUDIOFILEXFER, a_msg, IntPtr.Zero); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryAudiofilexfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.AUDIOFILEXFER, a_msg, IntPtr.Zero); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryAudiofilexfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.AUDIOFILEXFER, a_msg, IntPtr.Zero); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // If we had a successful transfer, then change state... - if (sts == STS.XFERDONE) - { - m_state = STATE.S7; - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set audio info information... - /// - /// Data group - /// Operation - /// Audio structure - /// TWAIN status - public STS DatAudioinfo(DG a_dg, MSG a_msg, ref TW_AUDIOINFO a_twaudioinfo) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twaudioinfo = a_twaudioinfo; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.AUDIOINFO; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twaudioinfo = m_twaincommand.Get(lIndex).twaudioinfo; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.AUDIOINFO.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryAudioAudioinfo(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.AUDIOINFO, a_msg, ref a_twaudioinfo); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryAudioAudioinfo(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.AUDIOINFO, a_msg, ref a_twaudioinfo); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryAudioAudioinfo(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.AUDIOINFO, a_msg, ref a_twaudioinfo); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryAudioAudioinfo(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.AUDIOINFO, a_msg, ref a_twaudioinfo); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryAudioAudioinfo(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.AUDIOINFO, a_msg, ref a_twaudioinfo); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryAudioAudioinfo(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.AUDIOINFO, a_msg, ref a_twaudioinfo); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryAudioAudioinfo(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.AUDIOINFO, a_msg, ref a_twaudioinfo); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue native audio transfer commands... - /// - /// Data group - /// Operation - /// handle - /// TWAIN status - private void DatAudionativexferWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatAudionativexfer.sts = (STS)NativeMethods.WindowsTwain32DsmEntryAudionativexfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatAudionativexfer.dg, - m_threaddataDatAudionativexfer.dat, - m_threaddataDatAudionativexfer.msg, - ref m_threaddataDatAudionativexfer.intptrAudio - ); - } - private void DatAudionativexferWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatAudionativexfer.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryAudionativexfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatAudionativexfer.dg, - m_threaddataDatAudionativexfer.dat, - m_threaddataDatAudionativexfer.msg, - ref m_threaddataDatAudionativexfer.intptrAudio - ); - } - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public STS DatAudionativexfer(DG a_dg, MSG a_msg, ref IntPtr a_intptrAudio) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (this.m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.intptrAudio = a_intptrAudio; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.AUDIONATIVEXFER; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_intptrAudio = m_twaincommand.Get(lIndex).intptrAudio; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.AUDIONATIVEXFER.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatAudionativexfer.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryAudionativexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.AUDIONATIVEXFER, a_msg, ref a_intptrAudio); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryAudionativexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.AUDIONATIVEXFER, a_msg, ref a_intptrAudio); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatAudionativexfer = default(ThreadData); - m_threaddataDatAudionativexfer.blIsInuse = true; - m_threaddataDatAudionativexfer.dg = a_dg; - m_threaddataDatAudionativexfer.msg = a_msg; - m_threaddataDatAudionativexfer.dat = DAT.AUDIONATIVEXFER; - RunInUiThread(DatAudionativexferWindowsTwain32); - a_intptrAudio = m_threaddataDatAudionativexfer.intptrAudio; - sts = m_threaddataDatAudionativexfer.sts; - m_threaddataDatAudionativexfer = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatAudionativexfer = default(ThreadData); - m_threaddataDatAudionativexfer.blIsInuse = true; - m_threaddataDatAudionativexfer.dg = a_dg; - m_threaddataDatAudionativexfer.msg = a_msg; - m_threaddataDatAudionativexfer.dat = DAT.AUDIONATIVEXFER; - RunInUiThread(DatAudionativexferWindowsTwainDsm); - a_intptrAudio = m_threaddataDatAudionativexfer.intptrAudio; - sts = m_threaddataDatAudionativexfer.sts; - m_threaddataDatAudionativexfer = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - a_intptrAudio = IntPtr.Zero; - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryAudionativexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.AUDIONATIVEXFER, a_msg, ref a_intptrAudio); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryAudionativexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.AUDIONATIVEXFER, a_msg, ref a_intptrAudio); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryAudionativexfer(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.IMAGENATIVEXFER, a_msg, ref a_intptrAudio); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - a_intptrAudio = IntPtr.Zero; - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryAudionativexfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.AUDIONATIVEXFER, a_msg, ref a_intptrAudio); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryAudionativexfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.AUDIONATIVEXFER, a_msg, ref a_intptrAudio); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // If we had a successful transfer, then change state... - if (sts == STS.XFERDONE) - { - // Bump our state... - m_state = STATE.S7; - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue callback commands... - /// - /// Data group - /// Operation - /// Callback structure - /// TWAIN status - public STS DatCallback(DG a_dg, MSG a_msg, ref TW_CALLBACK a_twcallback) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twcallback = a_twcallback; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.CALLBACK; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twcallback = m_twaincommand.Get(lIndex).twcallback; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.CALLBACK.ToString(), a_msg.ToString(), CallbackToCsv(a_twcallback)); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryCallback(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CALLBACK, a_msg, ref a_twcallback); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryCallback(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CALLBACK, a_msg, ref a_twcallback); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryCallback(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CALLBACK, a_msg, ref a_twcallback); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryCallback(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CALLBACK, a_msg, ref a_twcallback); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryCallback(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.CALLBACK, a_msg, ref a_twcallback); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryCallback(ref m_twidentitymacosxApp, IntPtr.Zero, a_dg, DAT.CALLBACK, a_msg, ref a_twcallback); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryCallback(ref m_twidentitymacosxApp, ref m_twidentityDs, a_dg, DAT.CALLBACK, a_msg, ref a_twcallback); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, CallbackToCsv(a_twcallback)); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue callback2 commands... - /// - /// Data group - /// Operation - /// Callback2 structure - /// TWAIN status - public STS DatCallback2(DG a_dg, MSG a_msg, ref TW_CALLBACK2 a_twcallback2) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twcallback2 = a_twcallback2; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.CALLBACK; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twcallback2 = m_twaincommand.Get(lIndex).twcallback2; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.CALLBACK2.ToString(), a_msg.ToString(), Callback2ToCsv(a_twcallback2)); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryCallback2(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CALLBACK2, a_msg, ref a_twcallback2); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryCallback2(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CALLBACK2, a_msg, ref a_twcallback2); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryCallback2(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CALLBACK2, a_msg, ref a_twcallback2); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryCallback2(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CALLBACK2, a_msg, ref a_twcallback2); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryCallback2(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.CALLBACK2, a_msg, ref a_twcallback2); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryCallback2(ref m_twidentitymacosxApp, IntPtr.Zero, a_dg, DAT.CALLBACK2, a_msg, ref a_twcallback2); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryCallback2(ref m_twidentitymacosxApp, ref m_twidentityDs, a_dg, DAT.CALLBACK2, a_msg, ref a_twcallback2); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, Callback2ToCsv(a_twcallback2)); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue capabilities commands... - /// - /// Data group - /// Operation - /// CAPABILITY structure - /// TWAIN status - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - private void DatCapabilityWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatCapability.sts = (STS)NativeMethods.WindowsTwain32DsmEntryCapability - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatCapability.dg, - m_threaddataDatCapability.dat, - m_threaddataDatCapability.msg, - ref m_threaddataDatCapability.twcapability - ); - } - private void DatCapabilityWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatCapability.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryCapability - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatCapability.dg, - m_threaddataDatCapability.dat, - m_threaddataDatCapability.msg, - ref m_threaddataDatCapability.twcapability - ); - } - public STS DatCapability(DG a_dg, MSG a_msg, ref TW_CAPABILITY a_twcapability) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - ThreadData threaddata = default(ThreadData); - long lIndex = 0; - - // TBD: sometimes this doesn't work! Not sure why - // yet, but a retry takes care of it. - for (int ii = 0; ii < 5; ii++) - { - // Set our command variables... - threaddata = default(ThreadData); - threaddata.twcapability = a_twcapability; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.CAPABILITY; - lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Hmmm... - if ( (a_msg == MSG.GETCURRENT) - && (m_twaincommand.Get(lIndex).sts == STS.SUCCESS) - && (m_twaincommand.Get(lIndex).twcapability.ConType == (TWON)0) - && (m_twaincommand.Get(lIndex).twcapability.hContainer == IntPtr.Zero)) - { - Thread.Sleep(1000); - continue; - } - - // We're done... - break; - } - - // Return the result... - a_twcapability = m_twaincommand.Get(lIndex).twcapability; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - if ((a_msg == MSG.SET) || (a_msg == MSG.SETCONSTRAINT)) - { - Log.LogSendBefore(a_dg.ToString(), DAT.CAPABILITY.ToString(), a_msg.ToString(), CapabilityToCsv(a_twcapability, (a_msg != TWAIN.MSG.QUERYSUPPORT))); - } - else - { - string szCap = a_twcapability.Cap.ToString(); - if (!szCap.Contains("_")) - { - szCap = "0x" + ((ushort)a_twcapability.Cap).ToString("X"); - } - Log.LogSendBefore(a_dg.ToString(), DAT.CAPABILITY.ToString(), a_msg.ToString(), szCap + ",0,0"); - } - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatCapability.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryCapability(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CAPABILITY, a_msg, ref a_twcapability); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryCapability(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CAPABILITY, a_msg, ref a_twcapability); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatCapability = default(ThreadData); - m_threaddataDatCapability.blIsInuse = true; - m_threaddataDatCapability.dg = a_dg; - m_threaddataDatCapability.msg = a_msg; - m_threaddataDatCapability.dat = DAT.CAPABILITY; - m_threaddataDatCapability.twcapability = a_twcapability; - RunInUiThread(DatCapabilityWindowsTwain32); - a_twcapability = m_threaddataDatCapability.twcapability; - sts = m_threaddataDatCapability.sts; - m_threaddataDatCapability = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatCapability = default(ThreadData); - m_threaddataDatCapability.blIsInuse = true; - m_threaddataDatCapability.dg = a_dg; - m_threaddataDatCapability.msg = a_msg; - m_threaddataDatCapability.dat = DAT.CAPABILITY; - m_threaddataDatCapability.twcapability = a_twcapability; - RunInUiThread(DatCapabilityWindowsTwainDsm); - a_twcapability = m_threaddataDatCapability.twcapability; - sts = m_threaddataDatCapability.sts; - m_threaddataDatCapability = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryCapability(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CAPABILITY, a_msg, ref a_twcapability); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryCapability(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CAPABILITY, a_msg, ref a_twcapability); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryCapability(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.CAPABILITY, a_msg, ref a_twcapability); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryCapability(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.CAPABILITY, a_msg, ref a_twcapability); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryCapability(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.CAPABILITY, a_msg, ref a_twcapability); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - if ((a_msg == MSG.RESETALL) || ((sts != STS.SUCCESS) && (sts != STS.CHECKSTATUS))) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - else - { - Log.LogSendAfter(stsRcOrCc, CapabilityToCsv(a_twcapability, (a_msg != TWAIN.MSG.QUERYSUPPORT))); - } - } - - // if MSG_SET/CAP_LANGUAGE, then we want to track it - if ((a_twcapability.Cap == CAP.CAP_LANGUAGE) && (a_msg == MSG.SET) && (a_twcapability.ConType == TWON.ONEVALUE)) - { - string str; - - // if it was successful, then go with what was set. - // otherwise ask the DS what it is currently set to - if (sts == STS.SUCCESS) - { - str = CapabilityToCsv(a_twcapability, (a_msg != TWAIN.MSG.QUERYSUPPORT)); - } - else - { - TW_CAPABILITY twcapability = new TW_CAPABILITY(); - twcapability.Cap = CAP.CAP_LANGUAGE; - twcapability.ConType = TWON.ONEVALUE; - sts = DatCapability(a_dg, MSG.GETCURRENT, ref twcapability); - if (sts == STS.SUCCESS) - { - str = CapabilityToCsv(twcapability, (a_msg != TWAIN.MSG.QUERYSUPPORT)); - } - else - { - // couldn't get the value, so go with English - str = "x," + ((int)TWLG.ENGLISH).ToString(); - } - } - - // get the value from the CSV string - TWLG twlg = TWLG.ENGLISH; - try - { - string[] astr = str.Split(new char[] { ',' }); - int result; - if (int.TryParse(astr[astr.Length - 1], out result)) - { - twlg = (TWLG)result; - } - } - catch - { - twlg = TWLG.ENGLISH; - } - Language.Set(twlg); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set for CIE color... - /// - /// Data group - /// Operation - /// CIECOLOR structure - /// TWAIN status - public STS DatCiecolor(DG a_dg, MSG a_msg, ref TW_CIECOLOR a_twciecolor) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twciecolor = a_twciecolor; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.CIECOLOR; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twciecolor = m_twaincommand.Get(lIndex).twciecolor; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.CIECOLOR.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryCiecolor(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CIECOLOR, a_msg, ref a_twciecolor); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryCiecolor(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CIECOLOR, a_msg, ref a_twciecolor); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryCiecolor(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CIECOLOR, a_msg, ref a_twciecolor); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryCiecolor(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CIECOLOR, a_msg, ref a_twciecolor); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryCiecolor(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.CIECOLOR, a_msg, ref a_twciecolor); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryCiecolor(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.CIECOLOR, a_msg, ref a_twciecolor); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryCiecolor(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.CIECOLOR, a_msg, ref a_twciecolor); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set the custom DS data... - /// - /// Data group - /// Operation - /// CUSTOMDSDATA structure - /// TWAIN status - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public STS DatCustomdsdata(DG a_dg, MSG a_msg, ref TW_CUSTOMDSDATA a_twcustomdsdata) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twcustomdsdata = a_twcustomdsdata; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.CUSTOMDSDATA; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twcustomdsdata = m_twaincommand.Get(lIndex).twcustomdsdata; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.CUSTOMDSDATA.ToString(), a_msg.ToString(), CustomdsdataToCsv(a_twcustomdsdata)); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryCustomdsdata(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CUSTOMDSDATA, a_msg, ref a_twcustomdsdata); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryCustomdsdata(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CUSTOMDSDATA, a_msg, ref a_twcustomdsdata); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryCustomdsdata(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CUSTOMDSDATA, a_msg, ref a_twcustomdsdata); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryCustomdsdata(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.CUSTOMDSDATA, a_msg, ref a_twcustomdsdata); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryCustomdsdata(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.CUSTOMDSDATA, a_msg, ref a_twcustomdsdata); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryCustomdsdata(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.CUSTOMDSDATA, a_msg, ref a_twcustomdsdata); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryCustomdsdata(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.CUSTOMDSDATA, a_msg, ref a_twcustomdsdata); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, CustomdsdataToCsv(a_twcustomdsdata)); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get device events... - /// - /// Data group - /// Operation - /// DEVICEEVENT structure - /// TWAIN status - public STS DatDeviceevent(DG a_dg, MSG a_msg, ref TW_DEVICEEVENT a_twdeviceevent) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twdeviceevent = a_twdeviceevent; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.DEVICEEVENT; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twdeviceevent = m_twaincommand.Get(lIndex).twdeviceevent; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.DEVICEEVENT.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryDeviceevent(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.DEVICEEVENT, a_msg, ref a_twdeviceevent); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryDeviceevent(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.DEVICEEVENT, a_msg, ref a_twdeviceevent); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryDeviceevent(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.DEVICEEVENT, a_msg, ref a_twdeviceevent); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryDeviceevent(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.DEVICEEVENT, a_msg, ref a_twdeviceevent); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryDeviceevent(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.DEVICEEVENT, a_msg, ref a_twdeviceevent); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryDeviceevent(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.DEVICEEVENT, a_msg, ref a_twdeviceevent); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryDeviceevent(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.DEVICEEVENT, a_msg, ref a_twdeviceevent); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, DeviceeventToCsv(a_twdeviceevent)); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get the entrypoint data... - /// - /// Data group - /// Operation - /// ENTRYPOINT structure - /// TWAIN status - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public STS DatEntrypoint(DG a_dg, MSG a_msg, ref TW_ENTRYPOINT a_twentrypoint) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twentrypoint = a_twentrypoint; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.ENTRYPOINT; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twentrypoint = m_twaincommand.Get(lIndex).twentrypoint; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.ENTRYPOINT.ToString(), a_msg.ToString(), EntrypointToCsv(a_twentrypoint)); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryEntrypoint(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.ENTRYPOINT, a_msg, ref a_twentrypoint); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryEntrypoint(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.ENTRYPOINT, a_msg, ref a_twentrypoint); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - // Alright, this is super nasty. The application issues the call to - // DAT_ENTRYPOINT before the call to MSG_OPENDS. We don't know which - // driver they're going to use, so we don't know which DSM they're - // going to end up with. This sucks in all kinds of ways. The only - // reason we can hope for this to work is if all of the DSM's are in - // agreement about the memory functions they're using. Lucky for us - // on Linux it's always been calloc/free. So, we may be in the weird - // situation of using a different DSM for the memory functions, but - // it'l be okay. You can stop breathing in and out of that paper bag... - sts = STS.BUMMER; - if (m_blFoundLatestDsm64) - { - sts = (STS)NativeMethods.Linux64DsmEntryEntrypoint(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.ENTRYPOINT, a_msg, ref a_twentrypoint); - } - else if (m_blFoundLatestDsm) - { - sts = (STS)NativeMethods.LinuxDsmEntryEntrypoint(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.ENTRYPOINT, a_msg, ref a_twentrypoint); - } - else if (m_blFound020302Dsm64bit) - { - TW_ENTRYPOINT_LINUX64 twentrypointlinux64 = default(TW_ENTRYPOINT_LINUX64); - twentrypointlinux64.Size = a_twentrypoint.Size; - twentrypointlinux64.DSM_MemAllocate = a_twentrypoint.DSM_MemAllocate; - twentrypointlinux64.DSM_MemFree = a_twentrypoint.DSM_MemFree; - twentrypointlinux64.DSM_MemLock = a_twentrypoint.DSM_MemLock; - twentrypointlinux64.DSM_MemUnlock = a_twentrypoint.DSM_MemUnlock; - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryEntrypoint(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.ENTRYPOINT, a_msg, ref twentrypointlinux64); - a_twentrypoint = default(TW_ENTRYPOINT); - a_twentrypoint.Size = (uint)(twentrypointlinux64.Size & 0xFFFFFFFF); - a_twentrypoint.DSM_MemAllocate = twentrypointlinux64.DSM_MemAllocate; - a_twentrypoint.DSM_MemFree = twentrypointlinux64.DSM_MemFree; - a_twentrypoint.DSM_MemLock = twentrypointlinux64.DSM_MemLock; - a_twentrypoint.DSM_MemUnlock = twentrypointlinux64.DSM_MemUnlock; - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryEntrypoint(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.ENTRYPOINT, a_msg, ref a_twentrypoint); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryEntrypoint(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.ENTRYPOINT, a_msg, ref a_twentrypoint); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // If we were successful, then squirrel away the data... - if (sts == TWAIN.STS.SUCCESS) - { - m_twentrypointdelegates = default(TWAIN.TW_ENTRYPOINT_DELEGATES); - m_twentrypointdelegates.Size = a_twentrypoint.Size; - m_twentrypointdelegates.DSM_Entry = a_twentrypoint.DSM_Entry; - if (a_twentrypoint.DSM_MemAllocate != null) - { - m_twentrypointdelegates.DSM_MemAllocate = (TWAIN.DSM_MEMALLOC)Marshal.GetDelegateForFunctionPointer(a_twentrypoint.DSM_MemAllocate,typeof(TWAIN.DSM_MEMALLOC)); - } - if (a_twentrypoint.DSM_MemFree != null) - { - m_twentrypointdelegates.DSM_MemFree = (TWAIN.DSM_MEMFREE)Marshal.GetDelegateForFunctionPointer(a_twentrypoint.DSM_MemFree, typeof(TWAIN.DSM_MEMFREE)); - } - if (a_twentrypoint.DSM_MemLock != null) - { - m_twentrypointdelegates.DSM_MemLock = (TWAIN.DSM_MEMLOCK)Marshal.GetDelegateForFunctionPointer(a_twentrypoint.DSM_MemLock, typeof(TWAIN.DSM_MEMLOCK)); - } - if (a_twentrypoint.DSM_MemUnlock != null) - { - m_twentrypointdelegates.DSM_MemUnlock = (TWAIN.DSM_MEMUNLOCK)Marshal.GetDelegateForFunctionPointer(a_twentrypoint.DSM_MemUnlock, typeof(TWAIN.DSM_MEMUNLOCK)); - } - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, EntrypointToCsv(a_twentrypoint)); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue event commands... - /// - /// Data group - /// Operation - /// EVENT structure - /// TWAIN status - private void DatEventWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatEvent.sts = (STS)NativeMethods.WindowsTwain32DsmEntryEvent - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatEvent.dg, - m_threaddataDatEvent.dat, - m_threaddataDatEvent.msg, - ref m_threaddataDatEvent.twevent - ); - } - private void DatEventWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatEvent.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryEvent - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatEvent.dg, - m_threaddataDatEvent.dat, - m_threaddataDatEvent.msg, - ref m_threaddataDatEvent.twevent - ); - } - public STS DatEvent(DG a_dg, MSG a_msg, ref TW_EVENT a_twevent, bool a_blInPreFilter = false) - { - STS sts; - - // Log it... - if (Log.GetLevel() > 1) - { - Log.LogSendBefore(a_dg.ToString(), DAT.EVENT.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (a_blInPreFilter || m_threaddataDatEvent.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryEvent(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.EVENT, a_msg, ref a_twevent); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryEvent(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.EVENT, a_msg, ref a_twevent); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatEvent = default(ThreadData); - m_threaddataDatEvent.blIsInuse = true; - m_threaddataDatEvent.dg = a_dg; - m_threaddataDatEvent.msg = a_msg; - m_threaddataDatEvent.dat = DAT.EVENT; - m_threaddataDatEvent.twevent = a_twevent; - RunInUiThread(DatEventWindowsTwain32); - a_twevent = m_threaddataDatEvent.twevent; - sts = m_threaddataDatEvent.sts; - m_threaddataDatEvent = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatEvent = default(ThreadData); - m_threaddataDatEvent.blIsInuse = true; - m_threaddataDatEvent.dg = a_dg; - m_threaddataDatEvent.msg = a_msg; - m_threaddataDatEvent.dat = DAT.EVENT; - m_threaddataDatEvent.twevent = a_twevent; - RunInUiThread(DatEventWindowsTwainDsm); - a_twevent = m_threaddataDatEvent.twevent; - sts = m_threaddataDatEvent.sts; - m_threaddataDatEvent = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryEvent(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.EVENT, a_msg, ref a_twevent); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryEvent(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.EVENT, a_msg, ref a_twevent); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryEvent(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.EVENT, a_msg, ref a_twevent); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryEvent(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.EVENT, a_msg, ref a_twevent); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryEvent(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.EVENT, a_msg, ref a_twevent); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 1) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // Check the event for anything interesting... - if ((sts == STS.DSEVENT) || (sts == STS.NOTDSEVENT)) - { - ProcessEvent((MSG)a_twevent.TWMessage); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set extended image info information... - /// - /// Data group - /// Operation - /// EXTIMAGEINFO structure - /// TWAIN status - private void DatExtimageinfoWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatExtimageinfo.sts = (STS)NativeMethods.WindowsTwain32DsmEntryExtimageinfo - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatExtimageinfo.dg, - m_threaddataDatExtimageinfo.dat, - m_threaddataDatExtimageinfo.msg, - ref m_threaddataDatExtimageinfo.twextimageinfo - ); - } - private void DatExtimageinfoWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatExtimageinfo.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryExtimageinfo - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatExtimageinfo.dg, - m_threaddataDatExtimageinfo.dat, - m_threaddataDatExtimageinfo.msg, - ref m_threaddataDatExtimageinfo.twextimageinfo - ); - } - public STS DatExtimageinfo(DG a_dg, MSG a_msg, ref TW_EXTIMAGEINFO a_twextimageinfo) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twextimageinfo = a_twextimageinfo; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.EXTIMAGEINFO; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twextimageinfo = m_twaincommand.Get(lIndex).twextimageinfo; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.EXTIMAGEINFO.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatExtimageinfo.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryExtimageinfo(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.EXTIMAGEINFO, a_msg, ref a_twextimageinfo); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryExtimageinfo(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.EXTIMAGEINFO, a_msg, ref a_twextimageinfo); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatExtimageinfo = default(ThreadData); - m_threaddataDatExtimageinfo.blIsInuse = true; - m_threaddataDatExtimageinfo.dg = a_dg; - m_threaddataDatExtimageinfo.msg = a_msg; - m_threaddataDatExtimageinfo.dat = DAT.EXTIMAGEINFO; - m_threaddataDatExtimageinfo.twextimageinfo = a_twextimageinfo; - RunInUiThread(DatExtimageinfoWindowsTwain32); - a_twextimageinfo = m_threaddataDatExtimageinfo.twextimageinfo; - sts = m_threaddataDatExtimageinfo.sts; - m_threaddataDatExtimageinfo = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatExtimageinfo = default(ThreadData); - m_threaddataDatExtimageinfo.blIsInuse = true; - m_threaddataDatExtimageinfo.dg = a_dg; - m_threaddataDatExtimageinfo.msg = a_msg; - m_threaddataDatExtimageinfo.dat = DAT.EXTIMAGEINFO; - m_threaddataDatExtimageinfo.twextimageinfo = a_twextimageinfo; - RunInUiThread(DatExtimageinfoWindowsTwainDsm); - a_twextimageinfo = m_threaddataDatExtimageinfo.twextimageinfo; - sts = m_threaddataDatExtimageinfo.sts; - m_threaddataDatExtimageinfo = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryExtimageinfo(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.EXTIMAGEINFO, a_msg, ref a_twextimageinfo); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryExtimageinfo(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.EXTIMAGEINFO, a_msg, ref a_twextimageinfo); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryExtimageinfo(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.EXTIMAGEINFO, a_msg, ref a_twextimageinfo); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryExtimageinfo(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.EXTIMAGEINFO, a_msg, ref a_twextimageinfo); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryExtimageinfo(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.EXTIMAGEINFO, a_msg, ref a_twextimageinfo); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set the filesystem... - /// - /// Data group - /// Operation - /// FILESYSTEM structure - /// TWAIN status - public STS DatFilesystem(DG a_dg, MSG a_msg, ref TW_FILESYSTEM a_twfilesystem) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twfilesystem = a_twfilesystem; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.FILESYSTEM; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twfilesystem = m_twaincommand.Get(lIndex).twfilesystem; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.FILESYSTEM.ToString(), a_msg.ToString(), FilesystemToCsv(a_twfilesystem)); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryFilesystem(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.FILESYSTEM, a_msg, ref a_twfilesystem); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryFilesystem(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.FILESYSTEM, a_msg, ref a_twfilesystem); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryFilesystem(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.FILESYSTEM, a_msg, ref a_twfilesystem); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryFilesystem(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.FILESYSTEM, a_msg, ref a_twfilesystem); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryFilesystem(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.FILESYSTEM, a_msg, ref a_twfilesystem); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryFilesystem(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.FILESYSTEM, a_msg, ref a_twfilesystem); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryFilesystem(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.FILESYSTEM, a_msg, ref a_twfilesystem); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, FilesystemToCsv(a_twfilesystem)); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set filter information... - /// - /// Data group - /// Operation - /// FILTER structure - /// TWAIN status - public STS DatFilter(DG a_dg, MSG a_msg, ref TW_FILTER a_twfilter) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twfilter = a_twfilter; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.FILTER; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twfilter = m_twaincommand.Get(lIndex).twfilter; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.FILTER.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryFilter(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.FILTER, a_msg, ref a_twfilter); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryFilter(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.FILTER, a_msg, ref a_twfilter); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryFilter(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.FILTER, a_msg, ref a_twfilter); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryFilter(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.FILTER, a_msg, ref a_twfilter); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryFilter(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.FILTER, a_msg, ref a_twfilter); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryFilter(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.FILTER, a_msg, ref a_twfilter); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryFilter(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.FILTER, a_msg, ref a_twfilter); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set for Gray response... - /// - /// Data group - /// Operation - /// GRAYRESPONSE structure - /// TWAIN status - public STS DatGrayresponse(DG a_dg, MSG a_msg, ref TW_GRAYRESPONSE a_twgrayresponse) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twgrayresponse = a_twgrayresponse; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.GRAYRESPONSE; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twgrayresponse = m_twaincommand.Get(lIndex).twgrayresponse; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.GRAYRESPONSE.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryGrayresponse(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.GRAYRESPONSE, a_msg, ref a_twgrayresponse); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryGrayresponse(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.GRAYRESPONSE, a_msg, ref a_twgrayresponse); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryGrayresponse(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.GRAYRESPONSE, a_msg, ref a_twgrayresponse); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryGrayresponse(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.GRAYRESPONSE, a_msg, ref a_twgrayresponse); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryGrayresponse(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.GRAYRESPONSE, a_msg, ref a_twgrayresponse); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryGrayresponse(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.GRAYRESPONSE, a_msg, ref a_twgrayresponse); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryGrayresponse(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.GRAYRESPONSE, a_msg, ref a_twgrayresponse); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set an ICC profile... - /// - /// Data group - /// Operation - /// ICCPROFILE structure - /// TWAIN status - public STS DatIccprofile(DG a_dg, MSG a_msg, ref TW_MEMORY a_twmemory) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twmemory = a_twmemory; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.ICCPROFILE; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twmemory = m_twaincommand.Get(lIndex).twmemory; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.ICCPROFILE.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryIccprofile(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.ICCPROFILE, a_msg, ref a_twmemory); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryIccprofile(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.ICCPROFILE, a_msg, ref a_twmemory); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryIccprofile(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.ICCPROFILE, a_msg, ref a_twmemory); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryIccprofile(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.ICCPROFILE, a_msg, ref a_twmemory); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryIccprofile(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.ICCPROFILE, a_msg, ref a_twmemory); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryIccprofile(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.ICCPROFILE, a_msg, ref a_twmemory); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryIccprofile(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.ICCPROFILE, a_msg, ref a_twmemory); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue identity commands... - /// - /// Data group - /// Operation - /// IDENTITY structure - /// TWAIN status - private void DatIdentityWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - if (GetState() <= STATE.S3) - { - m_threaddataDatIdentity.sts = (STS)NativeMethods.WindowsTwain32DsmEntryIdentity - ( - ref m_twidentitylegacyApp, - IntPtr.Zero, - m_threaddataDatIdentity.dg, - m_threaddataDatIdentity.dat, - m_threaddataDatIdentity.msg, - ref m_threaddataDatIdentity.twidentitylegacy - ); - } - // Man, I'm learning stupid new stuff all the time, so the old DSM - // had to have the destination. Argh... - else - { - m_threaddataDatIdentity.sts = (STS)NativeMethods.WindowsTwain32DsmEntryIdentityState4 - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatIdentity.dg, - m_threaddataDatIdentity.dat, - m_threaddataDatIdentity.msg, - ref m_threaddataDatIdentity.twidentitylegacy - ); - } - } - private void DatIdentityWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatIdentity.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryIdentity - ( - ref m_twidentitylegacyApp, - IntPtr.Zero, - m_threaddataDatIdentity.dg, - m_threaddataDatIdentity.dat, - m_threaddataDatIdentity.msg, - ref m_threaddataDatIdentity.twidentitylegacy - ); - } - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public STS DatIdentity(DG a_dg, MSG a_msg, ref TW_IDENTITY a_twidentity) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twidentity = a_twidentity; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.IDENTITY; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twidentity = m_twaincommand.Get(lIndex).twidentity; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.IDENTITY.ToString(), a_msg.ToString(), ((a_msg == MSG.OPENDS) ? IdentityToCsv(a_twidentity) : "")); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Convert the identity structure... - TW_IDENTITY_LEGACY twidentitylegacy = TwidentityToTwidentitylegacy(a_twidentity); - - // Issue the command... - try - { - if (m_threaddataDatIdentity.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - if (GetState() <= STATE.S3) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryIdentity(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylegacy); - } - else - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryIdentityState4(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IDENTITY, a_msg, ref twidentitylegacy); - } - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryIdentity(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylegacy); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatIdentity = default(ThreadData); - m_threaddataDatIdentity.blIsInuse = true; - m_threaddataDatIdentity.dg = a_dg; - m_threaddataDatIdentity.msg = a_msg; - m_threaddataDatIdentity.dat = DAT.IDENTITY; - m_threaddataDatIdentity.twidentitylegacy = twidentitylegacy; - RunInUiThread(DatIdentityWindowsTwain32); - twidentitylegacy = m_threaddataDatIdentity.twidentitylegacy; - sts = m_threaddataDatIdentity.sts; - m_threaddataDatIdentity = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatIdentity = default(ThreadData); - m_threaddataDatIdentity.blIsInuse = true; - m_threaddataDatIdentity.dg = a_dg; - m_threaddataDatIdentity.msg = a_msg; - m_threaddataDatIdentity.dat = DAT.IDENTITY; - m_threaddataDatIdentity.twidentitylegacy = twidentitylegacy; - RunInUiThread(DatIdentityWindowsTwainDsm); - twidentitylegacy = m_threaddataDatIdentity.twidentitylegacy; - sts = m_threaddataDatIdentity.sts; - m_threaddataDatIdentity = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - a_twidentity = TwidentitylegacyToTwidentity(twidentitylegacy); - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command, we have a serious problem with 64-bit stuff - // because TW_INT32 and TW_UINT32 were defined using long, which - // made them 64-bit values (not a good idea for 32-bit types). This - // was fixed with TWAIN DSM 2.4, but it leaves us with a bit of a - // mess. So, unlike all of the other calls, we're going to allow - // ourselves to access both DSMs from here. This is only an issue - // for 64-bit systems, and we're going to assume that the data source - // is 2.4 or later, since that'll be the long term situation. Note - // that we assume the DSMs are protecting us from talking to the - // wrong data source... - try - { - // Since life is complex, start by assuming failure... - sts = STS.FAILURE; - - // Handle closeds... - if (a_msg == MSG.CLOSEDS) - { - // We've opened this source, and we know it's the new style... - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - TW_IDENTITY_LEGACY twidentitylegacy = TwidentityToTwidentitylegacy(a_twidentity); - sts = (STS)NativeMethods.Linux64DsmEntryIdentity(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylegacy); - a_twidentity = TwidentitylegacyToTwidentity(twidentitylegacy); - } - // We've opened this source, and we know it's the new style... - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - TW_IDENTITY_LEGACY twidentitylegacy = TwidentityToTwidentitylegacy(a_twidentity); - sts = (STS)NativeMethods.LinuxDsmEntryIdentity(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylegacy); - a_twidentity = TwidentitylegacyToTwidentity(twidentitylegacy); - } - // We've opened this source, and we know it's the old style... - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - TW_IDENTITY_LINUX64 twidentitylinux64App = TwidentityToTwidentitylinux64(m_twidentityApp); - TW_IDENTITY_LINUX64 twidentitylinux64 = TwidentityToTwidentitylinux64(a_twidentity); - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryIdentity(ref twidentitylinux64App, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylinux64); - a_twidentity = Twidentitylinux64ToTwidentity(twidentitylinux64); - } - // We can't possibly have opened this source, so this had - // better be a sequence error... - else - { - sts = STS.SEQERROR; - } - } - - // Getfirst always starts with the latest DSM, if it can't find it, - // or if it reports end of list, then go on to the old DSM, if we - // have one. Note that it's up to the caller to handle any errors - // and keep searching. We're not trying to figure out anything - // about the driver at this level... - else if (a_msg == MSG.GETFIRST) - { - m_linux64bitdsmDatIdentity = LinuxDsm.Unknown; - - // Assume end of list for the outcome... - sts = STS.ENDOFLIST; - - // Try to start with the latest DSM... - if (m_blFoundLatestDsm64) - { - m_linux64bitdsmDatIdentity = LinuxDsm.IsLatestDsm; - TW_IDENTITY_LEGACY twidentitylegacy = TwidentityToTwidentitylegacy(a_twidentity); - sts = (STS)NativeMethods.Linux64DsmEntryIdentity(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylegacy); - a_twidentity = TwidentitylegacyToTwidentity(twidentitylegacy); - } - - // Try to start with the latest DSM... - if (m_blFoundLatestDsm) - { - m_linux64bitdsmDatIdentity = LinuxDsm.IsLatestDsm; - TW_IDENTITY_LEGACY twidentitylegacy = TwidentityToTwidentitylegacy(a_twidentity); - sts = (STS)NativeMethods.LinuxDsmEntryIdentity(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylegacy); - a_twidentity = TwidentitylegacyToTwidentity(twidentitylegacy); - } - - // If the lastest DSM didn't work, try the old stuff... - if (m_blFound020302Dsm64bit && (sts == STS.ENDOFLIST)) - { - m_linux64bitdsmDatIdentity = LinuxDsm.Is020302Dsm64bit; - TW_IDENTITY_LINUX64 twidentitylinux64App = TwidentityToTwidentitylinux64(m_twidentityApp); - TW_IDENTITY_LINUX64 twidentitylinux64 = TwidentityToTwidentitylinux64(a_twidentity); - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryIdentity(ref twidentitylinux64App, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylinux64); - a_twidentity = Twidentitylinux64ToTwidentity(twidentitylinux64); - } - } - - // Getnext gets its lead from getfirst, if we have a DSM - // value, we try it out, if we don't have one, we must be - // at the end of list. We'll do the new DSM and then the - // old DSM (if we have one)... - else if (a_msg == MSG.GETNEXT) - { - bool blChangeToGetFirst = false; - - // We're done, they'll have to use MSG_GETFIRST to start again... - if (m_linux64bitdsmDatIdentity == LinuxDsm.Unknown) - { - sts = STS.ENDOFLIST; - } - - // We're working the latest DSM, if we hit end of list, then we'll - // try to switch over to the old DSM... - if (m_blFoundLatestDsm64 && (m_linux64bitdsmDatIdentity == LinuxDsm.IsLatestDsm)) - { - TW_IDENTITY_LEGACY twidentitylegacy = TwidentityToTwidentitylegacy(a_twidentity); - sts = (STS)NativeMethods.Linux64DsmEntryIdentity(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylegacy); - a_twidentity = TwidentitylegacyToTwidentity(twidentitylegacy); - if (sts == STS.ENDOFLIST) - { - m_linux64bitdsmDatIdentity = m_blFound020302Dsm64bit ? LinuxDsm.Is020302Dsm64bit : LinuxDsm.Unknown; - blChangeToGetFirst = true; - } - } - - // We're working the latest DSM, if we hit end of list, then we'll - // try to switch over to the old DSM... - if (m_blFoundLatestDsm && (m_linux64bitdsmDatIdentity == LinuxDsm.IsLatestDsm)) - { - TW_IDENTITY_LEGACY twidentitylegacy = TwidentityToTwidentitylegacy(a_twidentity); - sts = (STS)NativeMethods.LinuxDsmEntryIdentity(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylegacy); - a_twidentity = TwidentitylegacyToTwidentity(twidentitylegacy); - if (sts == STS.ENDOFLIST) - { - m_linux64bitdsmDatIdentity = m_blFound020302Dsm64bit ? LinuxDsm.Is020302Dsm64bit : LinuxDsm.Unknown; - blChangeToGetFirst = true; - } - } - - // We're working the old DSM, if we hit the end of list, then we - // clear the DSM indicator... - if (m_blFound020302Dsm64bit && (m_linux64bitdsmDatIdentity == LinuxDsm.Is020302Dsm64bit)) - { - TW_IDENTITY_LINUX64 twidentitylinux64App = TwidentityToTwidentitylinux64(m_twidentityApp); - TW_IDENTITY_LINUX64 twidentitylinux64 = blChangeToGetFirst ? default(TW_IDENTITY_LINUX64) : TwidentityToTwidentitylinux64(a_twidentity); - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryIdentity(ref twidentitylinux64App, IntPtr.Zero, a_dg, DAT.IDENTITY, blChangeToGetFirst ? MSG.GETFIRST : a_msg, ref twidentitylinux64); - a_twidentity = Twidentitylinux64ToTwidentity(twidentitylinux64); - if (sts == STS.ENDOFLIST) - { - m_linux64bitdsmDatIdentity = LinuxDsm.Unknown; - } - } - } - - // Open always tries the current DSM, and then the older one, if needed... - else if (a_msg == MSG.OPENDS) - { - TW_IDENTITY_LEGACY twidentitylegacy = default(TW_IDENTITY_LEGACY); - - // Prime the pump by assuming we didn't find anything... - sts = STS.NODS; - - // Try with the latest DSM first, if we have one... - if (m_blFoundLatestDsm64) - { - twidentitylegacy = TwidentityToTwidentitylegacy(a_twidentity); - twidentitylegacy.Id = 0; - try - { - sts = (STS)NativeMethods.Linux64DsmEntryIdentity(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylegacy); - } - catch - { - sts = STS.NODS; - } - } - - // Try with the latest DSM first, if we have one... - if (m_blFoundLatestDsm) - { - twidentitylegacy = TwidentityToTwidentitylegacy(a_twidentity); - twidentitylegacy.Id = 0; - try - { - sts = (STS)NativeMethods.LinuxDsmEntryIdentity(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylegacy); - } - catch - { - sts = STS.NODS; - } - } - - // We got it... - if (sts == STS.SUCCESS) - { - a_twidentity = TwidentitylegacyToTwidentity(twidentitylegacy); - m_linuxdsm = LinuxDsm.IsLatestDsm; - } - - // No joy, so try the old DSM... - else if (m_blFound020302Dsm64bit) - { - TW_IDENTITY_LINUX64 twidentitylinux64App = TwidentityToTwidentitylinux64(m_twidentityApp); - TW_IDENTITY_LINUX64 twidentitylinux64 = TwidentityToTwidentitylinux64(a_twidentity); - twidentitylinux64.Id = 0; - try - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryIdentity(ref twidentitylinux64App, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitylinux64); - } - catch - { - sts = STS.NODS; - } - - // We got it... - if (sts == STS.SUCCESS) - { - a_twidentity = Twidentitylinux64ToTwidentity(twidentitylinux64); - m_linuxdsm = LinuxDsm.Is020302Dsm64bit; - } - } - } - - // TBD: figure out how to safely do a set on Linux... - else if (a_msg == MSG.SET) - { - // Just pretend we did it... - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - TW_IDENTITY_MACOSX twidentitymacosx = TwidentityToTwidentitymacosx(a_twidentity); - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryIdentity(ref m_twidentitymacosxApp, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitymacosx); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryIdentity(ref m_twidentitymacosxApp, IntPtr.Zero, a_dg, DAT.IDENTITY, a_msg, ref twidentitymacosx); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - a_twidentity = TwidentitymacosxToTwidentity(twidentitymacosx); - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, IdentityToCsv(a_twidentity)); - } - - // If we opened, go to state 4... - if (a_msg == MSG.OPENDS) - { - if (sts == STS.SUCCESS) - { - // Change our state, and record the identity we picked... - m_state = STATE.S4; - m_twidentityDs = a_twidentity; - m_twidentitylegacyDs = TwidentityToTwidentitylegacy(m_twidentityDs); - m_twidentitymacosxDs = TwidentityToTwidentitymacosx(m_twidentityDs); - - // update language - Language.Set(m_twidentityDs.Version.Language); - - // Register for callbacks... - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - if (m_blUseCallbacks) - { - TW_CALLBACK twcallback = new TW_CALLBACK(); - twcallback.CallBackProc = Marshal.GetFunctionPointerForDelegate(m_windowsdsmentrycontrolcallbackdelegate); - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.CALLBACK.ToString(), a_msg.ToString(), CallbackToCsv(twcallback)); - } - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryCallback(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, DG.CONTROL, DAT.CALLBACK, MSG.REGISTER_CALLBACK, ref twcallback); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryCallback(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, DG.CONTROL, DAT.CALLBACK, MSG.REGISTER_CALLBACK, ref twcallback); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(sts, ""); - } - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - TW_CALLBACK twcallback = new TW_CALLBACK(); - twcallback.CallBackProc = Marshal.GetFunctionPointerForDelegate(m_linuxdsmentrycontrolcallbackdelegate); - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.CALLBACK.ToString(), MSG.REGISTER_CALLBACK.ToString(), CallbackToCsv(twcallback)); - } - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryCallback(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, DG.CONTROL, DAT.CALLBACK, MSG.REGISTER_CALLBACK, ref twcallback); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryCallback(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, DG.CONTROL, DAT.CALLBACK, MSG.REGISTER_CALLBACK, ref twcallback); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryCallback(ref m_twidentityApp, ref m_twidentityDs, DG.CONTROL, DAT.CALLBACK, MSG.REGISTER_CALLBACK, ref twcallback); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(sts, ""); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - IntPtr intptr = IntPtr.Zero; - TW_CALLBACK twcallback = new TW_CALLBACK(); - twcallback.CallBackProc = Marshal.GetFunctionPointerForDelegate(m_macosxdsmentrycontrolcallbackdelegate); - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.CALLBACK.ToString(), a_msg.ToString(), CallbackToCsv(twcallback)); - } - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryCallback(ref m_twidentitymacosxApp, intptr, DG.CONTROL, DAT.CALLBACK, MSG.REGISTER_CALLBACK, ref twcallback); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryCallback(ref m_twidentitymacosxApp, ref m_twidentityDs, DG.CONTROL, DAT.CALLBACK, MSG.REGISTER_CALLBACK, ref twcallback); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(sts, ""); - } - } - } - } - - // If we closed, go to state 3... - else if (a_msg == MSG.CLOSEDS) - { - if (sts == STS.SUCCESS) - { - m_state = STATE.S3; - } - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set image info information... - /// - /// Data group - /// Operation - /// IMAGEINFO structure - /// TWAIN status - private void DatImageinfoWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatImageinfo.sts = (STS)NativeMethods.WindowsTwain32DsmEntryImageinfo - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatImageinfo.dg, - m_threaddataDatImageinfo.dat, - m_threaddataDatImageinfo.msg, - ref m_threaddataDatImageinfo.twimageinfo - ); - } - private void DatImageinfoWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatImageinfo.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryImageinfo - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatImageinfo.dg, - m_threaddataDatImageinfo.dat, - m_threaddataDatImageinfo.msg, - ref m_threaddataDatImageinfo.twimageinfo - ); - } - public STS DatImageinfo(DG a_dg, MSG a_msg, ref TW_IMAGEINFO a_twimageinfo) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twimageinfo = a_twimageinfo; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.IMAGEINFO; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twimageinfo = m_twaincommand.Get(lIndex).twimageinfo; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.IMAGEINFO.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatImageinfo.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryImageinfo(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEINFO, a_msg, ref a_twimageinfo); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryImageinfo(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEINFO, a_msg, ref a_twimageinfo); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatImageinfo = default(ThreadData); - m_threaddataDatImageinfo.blIsInuse = true; - m_threaddataDatImageinfo.dg = a_dg; - m_threaddataDatImageinfo.msg = a_msg; - m_threaddataDatImageinfo.dat = DAT.IMAGEINFO; - m_threaddataDatImageinfo.twimageinfo = a_twimageinfo; - RunInUiThread(DatImageinfoWindowsTwain32); - a_twimageinfo = m_threaddataDatImageinfo.twimageinfo; - sts = m_threaddataDatImageinfo.sts; - m_threaddataDatImageinfo = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatImageinfo = default(ThreadData); - m_threaddataDatImageinfo.blIsInuse = true; - m_threaddataDatImageinfo.dg = a_dg; - m_threaddataDatImageinfo.msg = a_msg; - m_threaddataDatImageinfo.dat = DAT.IMAGEINFO; - m_threaddataDatImageinfo.twimageinfo = a_twimageinfo; - RunInUiThread(DatImageinfoWindowsTwainDsm); - a_twimageinfo = m_threaddataDatImageinfo.twimageinfo; - sts = m_threaddataDatImageinfo.sts; - m_threaddataDatImageinfo = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryImageinfo(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEINFO, a_msg, ref a_twimageinfo); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryImageinfo(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEINFO, a_msg, ref a_twimageinfo); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - TW_IMAGEINFO_LINUX64 twimageinfolinux64 = default(TW_IMAGEINFO_LINUX64); - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryImageinfo(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.IMAGEINFO, a_msg, ref twimageinfolinux64); - a_twimageinfo.XResolution = twimageinfolinux64.XResolution; - a_twimageinfo.YResolution = twimageinfolinux64.YResolution; - a_twimageinfo.ImageWidth = (int)twimageinfolinux64.ImageWidth; - a_twimageinfo.ImageLength = (int)twimageinfolinux64.ImageLength; - a_twimageinfo.SamplesPerPixel = twimageinfolinux64.SamplesPerPixel; - a_twimageinfo.BitsPerSample_0 = twimageinfolinux64.BitsPerSample_0; - a_twimageinfo.BitsPerSample_1 = twimageinfolinux64.BitsPerSample_1; - a_twimageinfo.BitsPerSample_2 = twimageinfolinux64.BitsPerSample_2; - a_twimageinfo.BitsPerSample_3 = twimageinfolinux64.BitsPerSample_3; - a_twimageinfo.BitsPerSample_4 = twimageinfolinux64.BitsPerSample_4; - a_twimageinfo.BitsPerSample_5 = twimageinfolinux64.BitsPerSample_5; - a_twimageinfo.BitsPerSample_6 = twimageinfolinux64.BitsPerSample_6; - a_twimageinfo.BitsPerSample_7 = twimageinfolinux64.BitsPerSample_7; - a_twimageinfo.BitsPerPixel = twimageinfolinux64.BitsPerPixel; - a_twimageinfo.Planar = twimageinfolinux64.Planar; - a_twimageinfo.PixelType = twimageinfolinux64.PixelType; - a_twimageinfo.Compression = twimageinfolinux64.Compression; - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryImageinfo(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.IMAGEINFO, a_msg, ref a_twimageinfo); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryImageinfo(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.IMAGEINFO, a_msg, ref a_twimageinfo); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ImageinfoToCsv(a_twimageinfo)); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set layout information... - /// - /// Data group - /// Operation - /// IMAGELAYOUT structure - /// TWAIN status - private void DatImagelayoutWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatImagelayout.sts = (STS)NativeMethods.WindowsTwain32DsmEntryImagelayout - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatImagelayout.dg, - m_threaddataDatImagelayout.dat, - m_threaddataDatImagelayout.msg, - ref m_threaddataDatImagelayout.twimagelayout - ); - } - private void DatImagelayoutWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatImagelayout.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryImagelayout - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatImagelayout.dg, - m_threaddataDatImagelayout.dat, - m_threaddataDatImagelayout.msg, - ref m_threaddataDatImagelayout.twimagelayout - ); - } - public STS DatImagelayout(DG a_dg, MSG a_msg, ref TW_IMAGELAYOUT a_twimagelayout) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twimagelayout = a_twimagelayout; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.IMAGELAYOUT; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twimagelayout = m_twaincommand.Get(lIndex).twimagelayout; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.IMAGELAYOUT.ToString(), a_msg.ToString(), ImagelayoutToCsv(a_twimagelayout)); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatImagelayout.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryImagelayout(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGELAYOUT, a_msg, ref a_twimagelayout); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryImagelayout(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGELAYOUT, a_msg, ref a_twimagelayout); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatImagelayout = default(ThreadData); - m_threaddataDatImagelayout.blIsInuse = true; - m_threaddataDatImagelayout.dg = a_dg; - m_threaddataDatImagelayout.msg = a_msg; - m_threaddataDatImagelayout.dat = DAT.IMAGELAYOUT; - m_threaddataDatImagelayout.twimagelayout = a_twimagelayout; - RunInUiThread(DatImagelayoutWindowsTwain32); - a_twimagelayout = m_threaddataDatImagelayout.twimagelayout; - sts = m_threaddataDatImagelayout.sts; - m_threaddataDatImagelayout = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatImagelayout = default(ThreadData); - m_threaddataDatImagelayout.blIsInuse = true; - m_threaddataDatImagelayout.dg = a_dg; - m_threaddataDatImagelayout.msg = a_msg; - m_threaddataDatImagelayout.dat = DAT.IMAGELAYOUT; - m_threaddataDatImagelayout.twimagelayout = a_twimagelayout; - RunInUiThread(DatImagelayoutWindowsTwainDsm); - a_twimagelayout = m_threaddataDatImagelayout.twimagelayout; - sts = m_threaddataDatImagelayout.sts; - m_threaddataDatImagelayout = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryImagelayout(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGELAYOUT, a_msg, ref a_twimagelayout); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryImagelayout(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGELAYOUT, a_msg, ref a_twimagelayout); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryImagelayout(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.IMAGELAYOUT, a_msg, ref a_twimagelayout); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryImagelayout(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.IMAGELAYOUT, a_msg, ref a_twimagelayout); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryImagelayout(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.IMAGELAYOUT, a_msg, ref a_twimagelayout); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ImagelayoutToCsv(a_twimagelayout)); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue file image transfer commands... - /// - /// Data group - /// Operation - /// TWAIN status - private void DatImagefilexferWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatImagefilexfer.sts = (STS)NativeMethods.WindowsTwain32DsmEntryImagefilexfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatImagefilexfer.dg, - m_threaddataDatImagefilexfer.dat, - m_threaddataDatImagefilexfer.msg, - IntPtr.Zero - ); - } - private void DatImagefilexferWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatImagefilexfer.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryImagefilexfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatImagefilexfer.dg, - m_threaddataDatImagefilexfer.dat, - m_threaddataDatImagefilexfer.msg, - IntPtr.Zero - ); - } - public STS DatImagefilexfer(DG a_dg, MSG a_msg) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (this.m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.IMAGEFILEXFER; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.IMAGEFILEXFER.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatImagefilexfer.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryImagefilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEFILEXFER, a_msg, IntPtr.Zero); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryImagefilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEFILEXFER, a_msg, IntPtr.Zero); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatImagefilexfer = default(ThreadData); - m_threaddataDatImagefilexfer.blIsInuse = true; - m_threaddataDatImagefilexfer.dg = a_dg; - m_threaddataDatImagefilexfer.msg = a_msg; - m_threaddataDatImagefilexfer.dat = DAT.IMAGEFILEXFER; - RunInUiThread(DatImagefilexferWindowsTwain32); - sts = m_threaddataDatImagefilexfer.sts; - m_threaddataDatImagefilexfer = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatImagefilexfer = default(ThreadData); - m_threaddataDatImagefilexfer.blIsInuse = true; - m_threaddataDatImagefilexfer.dg = a_dg; - m_threaddataDatImagefilexfer.msg = a_msg; - m_threaddataDatImagefilexfer.dat = DAT.IMAGEFILEXFER; - RunInUiThread(DatImagefilexferWindowsTwainDsm); - sts = m_threaddataDatImagefilexfer.sts; - m_threaddataDatImagefilexfer = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryImagefilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEFILEXFER, a_msg, IntPtr.Zero); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryImagefilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEFILEXFER, a_msg, IntPtr.Zero); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryImagefilexfer(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.IMAGEFILEXFER, a_msg, IntPtr.Zero); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryImagefilexfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.IMAGEFILEXFER, a_msg, IntPtr.Zero); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryImagefilexfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.IMAGEFILEXFER, a_msg, IntPtr.Zero); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // If we had a successful transfer, then change state... - if (sts == STS.XFERDONE) - { - m_state = STATE.S7; - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue memory file image transfer commands... - /// - /// Data group - /// Operation - /// IMAGEMEMXFER structure - /// TWAIN status - private void DatImagememfilexferWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatImagememfilexfer.sts = (STS)NativeMethods.WindowsTwain32DsmEntryImagememfilexfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatImagememfilexfer.dg, - m_threaddataDatImagememfilexfer.dat, - m_threaddataDatImagememfilexfer.msg, - ref m_threaddataDatImagememfilexfer.twimagememxfer - ); - } - private void DatImagememfilexferWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatImagememfilexfer.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryImagememfilexfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatImagememfilexfer.dg, - m_threaddataDatImagememfilexfer.dat, - m_threaddataDatImagememfilexfer.msg, - ref m_threaddataDatImagememfilexfer.twimagememxfer - ); - } - public STS DatImagememfilexfer(DG a_dg, MSG a_msg, ref TW_IMAGEMEMXFER a_twimagememxfer) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (this.m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twimagememxfer = a_twimagememxfer; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.IMAGEMEMFILEXFER; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twimagememxfer = m_twaincommand.Get(lIndex).twimagememxfer; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.IMAGEMEMFILEXFER.ToString(), a_msg.ToString(), ImagememxferToCsv(a_twimagememxfer)); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatImagememfilexfer.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryImagememfilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEMEMFILEXFER, a_msg, ref a_twimagememxfer); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryImagememfilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEMEMFILEXFER, a_msg, ref a_twimagememxfer); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatImagememfilexfer = default(ThreadData); - m_threaddataDatImagememfilexfer.blIsInuse = true; - m_threaddataDatImagememfilexfer.dg = a_dg; - m_threaddataDatImagememfilexfer.msg = a_msg; - m_threaddataDatImagememfilexfer.dat = DAT.IMAGEMEMFILEXFER; - m_threaddataDatImagememfilexfer.twimagememxfer = a_twimagememxfer; - RunInUiThread(DatImagememfilexferWindowsTwain32); - a_twimagememxfer = m_threaddataDatImagememfilexfer.twimagememxfer; - sts = m_threaddataDatImagememfilexfer.sts; - m_threaddataDatImagememfilexfer = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatImagememfilexfer = default(ThreadData); - m_threaddataDatImagememfilexfer.blIsInuse = true; - m_threaddataDatImagememfilexfer.dg = a_dg; - m_threaddataDatImagememfilexfer.msg = a_msg; - m_threaddataDatImagememfilexfer.dat = DAT.IMAGEMEMFILEXFER; - m_threaddataDatImagememfilexfer.twimagememxfer = a_twimagememxfer; - RunInUiThread(DatImagememfilexferWindowsTwainDsm); - a_twimagememxfer = m_threaddataDatImagememfilexfer.twimagememxfer; - sts = m_threaddataDatImagememfilexfer.sts; - m_threaddataDatImagememfilexfer = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryImagememfilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEMEMFILEXFER, a_msg, ref a_twimagememxfer); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryImagememfilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEMEMFILEXFER, a_msg, ref a_twimagememxfer); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - TW_IMAGEMEMXFER_LINUX64 twimagememxferlinux64 = default(TW_IMAGEMEMXFER_LINUX64); - twimagememxferlinux64.BytesPerRow = a_twimagememxfer.BytesPerRow; - twimagememxferlinux64.BytesWritten = a_twimagememxfer.BytesWritten; - twimagememxferlinux64.Columns = a_twimagememxfer.Columns; - twimagememxferlinux64.Compression = a_twimagememxfer.Compression; - twimagememxferlinux64.MemoryFlags = a_twimagememxfer.Memory.Flags; - twimagememxferlinux64.MemoryLength = a_twimagememxfer.Memory.Length; - twimagememxferlinux64.MemoryTheMem = a_twimagememxfer.Memory.TheMem; - twimagememxferlinux64.Rows = a_twimagememxfer.Rows; - twimagememxferlinux64.XOffset = a_twimagememxfer.XOffset; - twimagememxferlinux64.YOffset = a_twimagememxfer.YOffset; - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryImagememfilexfer(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.IMAGEMEMFILEXFER, a_msg, ref twimagememxferlinux64); - a_twimagememxfer.BytesPerRow = (uint)twimagememxferlinux64.BytesPerRow; - a_twimagememxfer.BytesWritten = (uint)twimagememxferlinux64.BytesWritten; - a_twimagememxfer.Columns = (uint)twimagememxferlinux64.Columns; - a_twimagememxfer.Compression = (ushort)twimagememxferlinux64.Compression; - a_twimagememxfer.Memory.Flags = (uint)twimagememxferlinux64.MemoryFlags; - a_twimagememxfer.Memory.Length = (uint)twimagememxferlinux64.MemoryLength; - a_twimagememxfer.Memory.TheMem = twimagememxferlinux64.MemoryTheMem; - a_twimagememxfer.Rows = (uint)twimagememxferlinux64.Rows; - a_twimagememxfer.XOffset = (uint)twimagememxferlinux64.XOffset; - a_twimagememxfer.YOffset = (uint)twimagememxferlinux64.YOffset; - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - TW_IMAGEMEMXFER_MACOSX twimagememxfermacosx = default(TW_IMAGEMEMXFER_MACOSX); - twimagememxfermacosx.BytesPerRow = a_twimagememxfer.BytesPerRow; - twimagememxfermacosx.BytesWritten = a_twimagememxfer.BytesWritten; - twimagememxfermacosx.Columns = a_twimagememxfer.Columns; - twimagememxfermacosx.Compression = a_twimagememxfer.Compression; - twimagememxfermacosx.Memory.Flags = a_twimagememxfer.Memory.Flags; - twimagememxfermacosx.Memory.Length = a_twimagememxfer.Memory.Length; - twimagememxfermacosx.Memory.TheMem = a_twimagememxfer.Memory.TheMem; - twimagememxfermacosx.Rows = a_twimagememxfer.Rows; - twimagememxfermacosx.XOffset = a_twimagememxfer.XOffset; - twimagememxfermacosx.YOffset = a_twimagememxfer.YOffset; - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryImagememfilexfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.IMAGEMEMFILEXFER, a_msg, ref twimagememxfermacosx); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryImagememfilexfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.IMAGEMEMFILEXFER, a_msg, ref twimagememxfermacosx); - } - a_twimagememxfer.BytesPerRow = twimagememxfermacosx.BytesPerRow; - a_twimagememxfer.BytesWritten = twimagememxfermacosx.BytesWritten; - a_twimagememxfer.Columns = twimagememxfermacosx.Columns; - a_twimagememxfer.Compression = (ushort)twimagememxfermacosx.Compression; - a_twimagememxfer.Memory.Flags = twimagememxfermacosx.Memory.Flags; - a_twimagememxfer.Memory.Length = twimagememxfermacosx.Memory.Length; - a_twimagememxfer.Memory.TheMem = twimagememxfermacosx.Memory.TheMem; - a_twimagememxfer.Rows = twimagememxfermacosx.Rows; - a_twimagememxfer.XOffset = twimagememxfermacosx.XOffset; - a_twimagememxfer.YOffset = twimagememxfermacosx.YOffset; - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ImagememxferToCsv(a_twimagememxfer)); - } - - // If we had a successful transfer, then change state... - if (sts == STS.XFERDONE) - { - m_state = STATE.S7; - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue memory image transfer commands... - /// - /// Data group - /// Operation - /// IMAGEMEMXFER structure - /// TWAIN status - private void DatImagememxferWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatImagememxfer.sts = (STS)NativeMethods.WindowsTwain32DsmEntryImagememxfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatImagememxfer.dg, - m_threaddataDatImagememxfer.dat, - m_threaddataDatImagememxfer.msg, - ref m_threaddataDatImagememxfer.twimagememxfer - ); - } - private void DatImagememxferWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatImagememxfer.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryImagememxfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatImagememxfer.dg, - m_threaddataDatImagememxfer.dat, - m_threaddataDatImagememxfer.msg, - ref m_threaddataDatImagememxfer.twimagememxfer - ); - } - public STS DatImagememxfer(DG a_dg, MSG a_msg, ref TW_IMAGEMEMXFER a_twimagememxfer) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (this.m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twimagememxfer = a_twimagememxfer; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.IMAGEMEMXFER; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twimagememxfer = m_twaincommand.Get(lIndex).twimagememxfer; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.IMAGEMEMXFER.ToString(), a_msg.ToString(), ImagememxferToCsv(a_twimagememxfer)); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatImagememxfer.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryImagememxfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEMEMXFER, a_msg, ref a_twimagememxfer); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryImagememxfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEMEMXFER, a_msg, ref a_twimagememxfer); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatImagememxfer = default(ThreadData); - m_threaddataDatImagememxfer.blIsInuse = true; - m_threaddataDatImagememxfer.dg = a_dg; - m_threaddataDatImagememxfer.msg = a_msg; - m_threaddataDatImagememxfer.dat = DAT.IMAGEMEMXFER; - m_threaddataDatImagememxfer.twimagememxfer = a_twimagememxfer; - RunInUiThread(DatImagememxferWindowsTwain32); - a_twimagememxfer = m_threaddataDatImagememxfer.twimagememxfer; - sts = m_threaddataDatImagememxfer.sts; - m_threaddataDatImagememxfer = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatImagememxfer = default(ThreadData); - m_threaddataDatImagememxfer.blIsInuse = true; - m_threaddataDatImagememxfer.dg = a_dg; - m_threaddataDatImagememxfer.msg = a_msg; - m_threaddataDatImagememxfer.dat = DAT.IMAGEMEMXFER; - m_threaddataDatImagememxfer.twimagememxfer = a_twimagememxfer; - RunInUiThread(DatImagememxferWindowsTwainDsm); - a_twimagememxfer = m_threaddataDatImagememxfer.twimagememxfer; - sts = m_threaddataDatImagememxfer.sts; - m_threaddataDatImagememxfer = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryImagememxfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEMEMXFER, a_msg, ref a_twimagememxfer); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryImagememxfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGEMEMXFER, a_msg, ref a_twimagememxfer); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - TW_IMAGEMEMXFER_LINUX64 twimagememxferlinux64 = default(TW_IMAGEMEMXFER_LINUX64); - twimagememxferlinux64.BytesPerRow = a_twimagememxfer.BytesPerRow; - twimagememxferlinux64.BytesWritten = a_twimagememxfer.BytesWritten; - twimagememxferlinux64.Columns = a_twimagememxfer.Columns; - twimagememxferlinux64.Compression = a_twimagememxfer.Compression; - twimagememxferlinux64.MemoryFlags = a_twimagememxfer.Memory.Flags; - twimagememxferlinux64.MemoryLength = a_twimagememxfer.Memory.Length; - twimagememxferlinux64.MemoryTheMem = a_twimagememxfer.Memory.TheMem; - twimagememxferlinux64.Rows = a_twimagememxfer.Rows; - twimagememxferlinux64.XOffset = a_twimagememxfer.XOffset; - twimagememxferlinux64.YOffset = a_twimagememxfer.YOffset; - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryImagememxfer(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.IMAGEMEMXFER, a_msg, ref twimagememxferlinux64); - a_twimagememxfer.BytesPerRow = (uint)twimagememxferlinux64.BytesPerRow; - a_twimagememxfer.BytesWritten = (uint)twimagememxferlinux64.BytesWritten; - a_twimagememxfer.Columns = (uint)twimagememxferlinux64.Columns; - a_twimagememxfer.Compression = (ushort)twimagememxferlinux64.Compression; - a_twimagememxfer.Memory.Flags = (uint)twimagememxferlinux64.MemoryFlags; - a_twimagememxfer.Memory.Length = (uint)twimagememxferlinux64.MemoryLength; - a_twimagememxfer.Memory.TheMem = twimagememxferlinux64.MemoryTheMem; - a_twimagememxfer.Rows = (uint)twimagememxferlinux64.Rows; - a_twimagememxfer.XOffset = (uint)twimagememxferlinux64.XOffset; - a_twimagememxfer.YOffset = (uint)twimagememxferlinux64.YOffset; - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - TW_IMAGEMEMXFER_MACOSX twimagememxfermacosx = default(TW_IMAGEMEMXFER_MACOSX); - twimagememxfermacosx.BytesPerRow = a_twimagememxfer.BytesPerRow; - twimagememxfermacosx.BytesWritten = a_twimagememxfer.BytesWritten; - twimagememxfermacosx.Columns = a_twimagememxfer.Columns; - twimagememxfermacosx.Compression = a_twimagememxfer.Compression; - twimagememxfermacosx.Memory.Flags = a_twimagememxfer.Memory.Flags; - twimagememxfermacosx.Memory.Length = a_twimagememxfer.Memory.Length; - twimagememxfermacosx.Memory.TheMem = a_twimagememxfer.Memory.TheMem; - twimagememxfermacosx.Rows = a_twimagememxfer.Rows; - twimagememxfermacosx.XOffset = a_twimagememxfer.XOffset; - twimagememxfermacosx.YOffset = a_twimagememxfer.YOffset; - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryImagememxfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.IMAGEMEMXFER, a_msg, ref twimagememxfermacosx); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryImagememxfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.IMAGEMEMXFER, a_msg, ref twimagememxfermacosx); - } - a_twimagememxfer.BytesPerRow = twimagememxfermacosx.BytesPerRow; - a_twimagememxfer.BytesWritten = twimagememxfermacosx.BytesWritten; - a_twimagememxfer.Columns = twimagememxfermacosx.Columns; - a_twimagememxfer.Compression = (ushort)twimagememxfermacosx.Compression; - a_twimagememxfer.Memory.Flags = twimagememxfermacosx.Memory.Flags; - a_twimagememxfer.Memory.Length = twimagememxfermacosx.Memory.Length; - a_twimagememxfer.Memory.TheMem = twimagememxfermacosx.Memory.TheMem; - a_twimagememxfer.Rows = twimagememxfermacosx.Rows; - a_twimagememxfer.XOffset = twimagememxfermacosx.XOffset; - a_twimagememxfer.YOffset = twimagememxfermacosx.YOffset; - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ImagememxferToCsv(a_twimagememxfer)); - } - - // If we had a successful transfer, then change state... - if (sts == STS.XFERDONE) - { - m_state = STATE.S7; - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue native image transfer commands... - /// - /// Data group - /// Operation - /// BITMAP structure - /// TWAIN status - private void DatImagenativexferWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatImagenativexfer.sts = (STS)NativeMethods.WindowsTwain32DsmEntryImagenativexfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatImagenativexfer.dg, - m_threaddataDatImagenativexfer.dat, - m_threaddataDatImagenativexfer.msg, - ref m_threaddataDatImagenativexfer.intptrBitmap - ); - } - private void DatImagenativexferWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatImagenativexfer.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryImagenativexfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatImagenativexfer.dg, - m_threaddataDatImagenativexfer.dat, - m_threaddataDatImagenativexfer.msg, - ref m_threaddataDatImagenativexfer.intptrBitmap - ); - } - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public STS DatImagenativexfer(DG a_dg, MSG a_msg, ref Bitmap a_bitmap) - { - IntPtr intptrBitmapHandle = IntPtr.Zero; - return (DatImagenativexferBitmap(a_dg, a_msg, ref a_bitmap, ref intptrBitmapHandle, false)); - } - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public STS DatImagenativexferHandle(DG a_dg, MSG a_msg, ref IntPtr a_intptrBitmapHandle) - { - Bitmap bitmap = null; - return (DatImagenativexferBitmap(a_dg, a_msg, ref bitmap, ref a_intptrBitmapHandle, true)); - } - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public STS DatImagenativexferBitmap(DG a_dg, MSG a_msg, ref Bitmap a_bitmap, ref IntPtr a_intptrBitmapHandle, bool a_blUseBitmapHandle) - { - STS sts; - IntPtr intptrBitmap = IntPtr.Zero; - - // Submit the work to the TWAIN thread... - if (this.m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.bitmap = a_bitmap; - threaddata.blUseBitmapHandle = a_blUseBitmapHandle; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.IMAGENATIVEXFER; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_bitmap = m_twaincommand.Get(lIndex).bitmap; - a_intptrBitmapHandle = m_twaincommand.Get(lIndex).intptrBitmap; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.IMAGENATIVEXFER.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatImagenativexfer.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryImagenativexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGENATIVEXFER, a_msg, ref intptrBitmap); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryImagenativexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGENATIVEXFER, a_msg, ref intptrBitmap); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatImagenativexfer = default(ThreadData); - m_threaddataDatImagenativexfer.blIsInuse = true; - m_threaddataDatImagenativexfer.dg = a_dg; - m_threaddataDatImagenativexfer.msg = a_msg; - m_threaddataDatImagenativexfer.dat = DAT.IMAGENATIVEXFER; - RunInUiThread(DatImagenativexferWindowsTwain32); - intptrBitmap = a_intptrBitmapHandle = m_threaddataDatImagenativexfer.intptrBitmap; - sts = m_threaddataDatImagenativexfer.sts; - m_threaddataDatImagenativexfer = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatImagenativexfer = default(ThreadData); - m_threaddataDatImagenativexfer.blIsInuse = true; - m_threaddataDatImagenativexfer.dg = a_dg; - m_threaddataDatImagenativexfer.msg = a_msg; - m_threaddataDatImagenativexfer.dat = DAT.IMAGENATIVEXFER; - RunInUiThread(DatImagenativexferWindowsTwainDsm); - intptrBitmap = a_intptrBitmapHandle = m_threaddataDatImagenativexfer.intptrBitmap; - sts = m_threaddataDatImagenativexfer.sts; - m_threaddataDatImagenativexfer = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryImagenativexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGENATIVEXFER, a_msg, ref intptrBitmap); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryImagenativexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.IMAGENATIVEXFER, a_msg, ref intptrBitmap); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryImagenativexfer(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.IMAGENATIVEXFER, a_msg, ref intptrBitmap); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - intptrBitmap = IntPtr.Zero; - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryImagenativexfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.IMAGENATIVEXFER, a_msg, ref intptrBitmap); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryImagenativexfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.IMAGENATIVEXFER, a_msg, ref intptrBitmap); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // If we had a successful transfer, then convert the data... - if (sts == STS.XFERDONE) - { - if (a_blUseBitmapHandle) - { - a_intptrBitmapHandle = intptrBitmap; - } - else - { - // Bump our state... - m_state = STATE.S7; - - // Turn the DIB into a Bitmap object... - a_bitmap = NativeToBitmap(ms_platform, intptrBitmap); - - // We're done with the data we got from the driver... - Marshal.FreeHGlobal(intptrBitmap); - intptrBitmap = IntPtr.Zero; - } - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set JPEG compression tables... - /// - /// Data group - /// Operation - /// JPEGCOMPRESSION structure - /// TWAIN status - public STS DatJpegcompression(DG a_dg, MSG a_msg, ref TW_JPEGCOMPRESSION a_twjpegcompression) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twjpegcompression = a_twjpegcompression; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.JPEGCOMPRESSION; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twjpegcompression = m_twaincommand.Get(lIndex).twjpegcompression; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.JPEGCOMPRESSION.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryJpegcompression(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.JPEGCOMPRESSION, a_msg, ref a_twjpegcompression); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryJpegcompression(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.JPEGCOMPRESSION, a_msg, ref a_twjpegcompression); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryJpegcompression(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.JPEGCOMPRESSION, a_msg, ref a_twjpegcompression); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryJpegcompression(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.JPEGCOMPRESSION, a_msg, ref a_twjpegcompression); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryJpegcompression(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.JPEGCOMPRESSION, a_msg, ref a_twjpegcompression); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryJpegcompression(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.JPEGCOMPRESSION, a_msg, ref a_twjpegcompression); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryJpegcompression(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.JPEGCOMPRESSION, a_msg, ref a_twjpegcompression); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set metrics... - /// - /// Data group - /// Operation - /// JPEGCOMPRESSION structure - /// TWAIN status - public STS DatMetrics(DG a_dg, MSG a_msg, ref TW_METRICS a_twmetrics) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twmetrics = a_twmetrics; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.METRICS; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twmetrics = m_twaincommand.Get(lIndex).twmetrics; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.METRICS.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryMetrics(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.METRICS, a_msg, ref a_twmetrics); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryMetrics(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.METRICS, a_msg, ref a_twmetrics); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryMetrics(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.METRICS, a_msg, ref a_twmetrics); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryMetrics(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.METRICS, a_msg, ref a_twmetrics); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryMetrics(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.METRICS, a_msg, ref a_twmetrics); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryMetrics(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.METRICS, a_msg, ref a_twmetrics); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryMetrics(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.METRICS, a_msg, ref a_twmetrics); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set for a Pallete8... - /// - /// Data group - /// Operation - /// PALETTE8 structure - /// TWAIN status - public STS DatPalette8(DG a_dg, MSG a_msg, ref TW_PALETTE8 a_twpalette8) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twpalette8 = a_twpalette8; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.PALETTE8; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twpalette8 = m_twaincommand.Get(lIndex).twpalette8; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.PALETTE8.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryPalette8(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PALETTE8, a_msg, ref a_twpalette8); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryPalette8(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PALETTE8, a_msg, ref a_twpalette8); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryPalette8(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PALETTE8, a_msg, ref a_twpalette8); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryPalette8(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PALETTE8, a_msg, ref a_twpalette8); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryPalette8(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.PALETTE8, a_msg, ref a_twpalette8); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryPalette8(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.PALETTE8, a_msg, ref a_twpalette8); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryPalette8(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.PALETTE8, a_msg, ref a_twpalette8); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue DSM commands... - /// - /// Data group - /// Operation - /// PARENT structure - /// TWAIN status - private void DatParentWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatParent.sts = (STS)NativeMethods.WindowsTwain32DsmEntryParent - ( - ref m_twidentitylegacyApp, - IntPtr.Zero, - m_threaddataDatParent.dg, - m_threaddataDatParent.dat, - m_threaddataDatParent.msg, - ref m_threaddataDatParent.intptrHwnd - ); - } - private void DatParentWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatParent.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryParent - ( - ref m_twidentitylegacyApp, - IntPtr.Zero, - m_threaddataDatParent.dg, - m_threaddataDatParent.dat, - m_threaddataDatParent.msg, - ref m_threaddataDatParent.intptrHwnd - ); - } - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public STS DatParent(DG a_dg, MSG a_msg, ref IntPtr a_intptrHwnd) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.intptrHwnd = a_intptrHwnd; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.PARENT; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_intptrHwnd = m_twaincommand.Get(lIndex).intptrHwnd; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.PARENT.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatParent.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryParent(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.PARENT, a_msg, ref a_intptrHwnd); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryParent(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.PARENT, a_msg, ref a_intptrHwnd); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatParent = default(ThreadData); - m_threaddataDatParent.blIsInuse = true; - m_threaddataDatParent.dg = a_dg; - m_threaddataDatParent.msg = a_msg; - m_threaddataDatParent.dat = DAT.PARENT; - m_threaddataDatParent.intptrHwnd = a_intptrHwnd; - RunInUiThread(DatParentWindowsTwain32); - sts = m_threaddataDatParent.sts; - m_threaddataDatParent = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatParent = default(ThreadData); - m_threaddataDatParent.blIsInuse = true; - m_threaddataDatParent.dg = a_dg; - m_threaddataDatParent.msg = a_msg; - m_threaddataDatParent.dat = DAT.PARENT; - m_threaddataDatParent.intptrHwnd = a_intptrHwnd; - RunInUiThread(DatParentWindowsTwainDsm); - sts = m_threaddataDatParent.sts; - m_threaddataDatParent = default(ThreadData); - } - } - } - // Needed for the DF_DSM2 flag... - m_twidentityApp.SupportedGroups = m_twidentitylegacyApp.SupportedGroups; - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - STS stsLatest = STS.BUMMER; - STS sts020302Dsm64bit = STS.BUMMER; - - // We're trying both DSM's... - sts = STS.BUMMER; - - // Load the new DSM, whatever it is, if we found one... - if (m_blFoundLatestDsm64) - { - try - { - stsLatest = (STS)NativeMethods.Linux64DsmEntryParent(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.PARENT, a_msg, ref a_intptrHwnd); - // Needed for the DF_DSM2 flag... - m_twidentityApp.SupportedGroups = m_twidentitylegacyApp.SupportedGroups; - } - catch - { - // Forget this... - m_blFoundLatestDsm64 = false; - } - } - - // Load the new DSM, whatever it is, if we found one... - if (m_blFoundLatestDsm) - { - try - { - stsLatest = (STS)NativeMethods.LinuxDsmEntryParent(ref m_twidentitylegacyApp, IntPtr.Zero, a_dg, DAT.PARENT, a_msg, ref a_intptrHwnd); - // Needed for the DF_DSM2 flag... - m_twidentityApp.SupportedGroups = m_twidentitylegacyApp.SupportedGroups; - } - catch - { - // Forget this... - m_blFoundLatestDsm = false; - } - } - - // Load libtwaindsm.so.2.3.2, if we found it... - if (m_blFound020302Dsm64bit) - { - try - { - sts020302Dsm64bit = (STS)NativeMethods.Linux020302Dsm64bitEntryParent(ref m_twidentityApp, IntPtr.Zero, a_dg, DAT.PARENT, a_msg, ref a_intptrHwnd); - } - catch - { - // Forget this... - m_blFound020302Dsm64bit = false; - } - } - - // We only need one success to get through this... - sts = STS.BUMMER; - if ((stsLatest == STS.SUCCESS) || (sts020302Dsm64bit == STS.SUCCESS)) - { - sts = STS.SUCCESS; - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryParent(ref m_twidentitymacosxApp, IntPtr.Zero, a_dg, DAT.PARENT, a_msg, ref a_intptrHwnd); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryParent(ref m_twidentitymacosxApp, IntPtr.Zero, a_dg, DAT.PARENT, a_msg, ref a_intptrHwnd); - } - // Needed for the DF_DSM2 flag... - m_twidentityApp.SupportedGroups = m_twidentitymacosxApp.SupportedGroups; - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // If we opened, go to state 3, and start tracking - // TWAIN's state in the log file... - if (a_msg == MSG.OPENDSM) - { - if (sts == STS.SUCCESS) - { - m_state = STATE.S3; - Log.RegisterTwain(this); - } - } - - // If we closed, go to state 2, and stop tracking - // TWAIN's state in the log file... - else if (a_msg == MSG.CLOSEDSM) - { - if (sts == STS.SUCCESS) - { - m_state = STATE.S2; - Log.RegisterTwain(null); - } - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set for a raw commands... - /// - /// Data group - /// Operation - /// PASSTHRU structure - /// TWAIN status - public STS DatPassthru(DG a_dg, MSG a_msg, ref TW_PASSTHRU a_twpassthru) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twpassthru = a_twpassthru; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.PASSTHRU; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twpassthru = m_twaincommand.Get(lIndex).twpassthru; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.PASSTHRU.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryPassthru(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PASSTHRU, a_msg, ref a_twpassthru); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryPassthru(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PASSTHRU, a_msg, ref a_twpassthru); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryPassthru(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PASSTHRU, a_msg, ref a_twpassthru); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryPassthru(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PASSTHRU, a_msg, ref a_twpassthru); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryPassthru(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.PASSTHRU, a_msg, ref a_twpassthru); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryPassthru(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.PASSTHRU, a_msg, ref a_twpassthru); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryPassthru(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.PASSTHRU, a_msg, ref a_twpassthru); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue pendingxfers commands... - /// - /// Data group - /// Operation - /// PENDINGXFERS structure - /// TWAIN status - private void DatPendingxfersWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatPendingxfers.sts = (STS)NativeMethods.WindowsTwain32DsmEntryPendingxfers - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatPendingxfers.dg, - m_threaddataDatPendingxfers.dat, - m_threaddataDatPendingxfers.msg, - ref m_threaddataDatPendingxfers.twpendingxfers - ); - } - private void DatPendingxfersWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatPendingxfers.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryPendingxfers - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatPendingxfers.dg, - m_threaddataDatPendingxfers.dat, - m_threaddataDatPendingxfers.msg, - ref m_threaddataDatPendingxfers.twpendingxfers - ); - } - public STS DatPendingxfers(DG a_dg, MSG a_msg, ref TW_PENDINGXFERS a_twpendingxfers) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twpendingxfers = a_twpendingxfers; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.PENDINGXFERS; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twpendingxfers = m_twaincommand.Get(lIndex).twpendingxfers; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.PENDINGXFERS.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatPendingxfers.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryPendingxfers(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PENDINGXFERS, a_msg, ref a_twpendingxfers); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryPendingxfers(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PENDINGXFERS, a_msg, ref a_twpendingxfers); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatPendingxfers = default(ThreadData); - m_threaddataDatPendingxfers.blIsInuse = true; - m_threaddataDatPendingxfers.dg = a_dg; - m_threaddataDatPendingxfers.msg = a_msg; - m_threaddataDatPendingxfers.dat = DAT.PENDINGXFERS; - m_threaddataDatPendingxfers.twpendingxfers = a_twpendingxfers; - RunInUiThread(DatPendingxfersWindowsTwain32); - a_twpendingxfers = m_threaddataDatPendingxfers.twpendingxfers; - sts = m_threaddataDatPendingxfers.sts; - m_threaddataDatPendingxfers = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatPendingxfers = default(ThreadData); - m_threaddataDatPendingxfers.blIsInuse = true; - m_threaddataDatPendingxfers.dg = a_dg; - m_threaddataDatPendingxfers.msg = a_msg; - m_threaddataDatPendingxfers.dat = DAT.PENDINGXFERS; - m_threaddataDatPendingxfers.twpendingxfers = a_twpendingxfers; - RunInUiThread(DatPendingxfersWindowsTwainDsm); - a_twpendingxfers = m_threaddataDatPendingxfers.twpendingxfers; - sts = m_threaddataDatPendingxfers.sts; - m_threaddataDatPendingxfers = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryPendingxfers(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PENDINGXFERS, a_msg, ref a_twpendingxfers); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryPendingxfers(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.PENDINGXFERS, a_msg, ref a_twpendingxfers); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryPendingxfers(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.PENDINGXFERS, a_msg, ref a_twpendingxfers); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryPendingxfers(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.PENDINGXFERS, a_msg, ref a_twpendingxfers); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryPendingxfers(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.PENDINGXFERS, a_msg, ref a_twpendingxfers); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, PendingxfersToCsv(a_twpendingxfers)); - } - - // If we endxfer, go to state 5 or 6... - if (a_msg == MSG.ENDXFER) - { - if (sts == STS.SUCCESS) - { - if (a_twpendingxfers.Count == 0) - { - m_blAcceptXferReady = true; - m_blIsMsgxferready = false; - m_state = STATE.S5; - } - else - { - m_state = STATE.S6; - } - } - } - - // If we reset, go to state 5... - else if (a_msg == MSG.RESET) - { - if (sts == STS.SUCCESS) - { - m_blAcceptXferReady = true; - m_blIsMsgxferready = false; - m_state = STATE.S5; - } - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set for RGB response... - /// - /// Data group - /// Operation - /// RGBRESPONSE structure - /// TWAIN status - public STS DatRgbresponse(DG a_dg, MSG a_msg, ref TW_RGBRESPONSE a_twrgbresponse) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twrgbresponse = a_twrgbresponse; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.RGBRESPONSE; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twrgbresponse = m_twaincommand.Get(lIndex).twrgbresponse; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.RGBRESPONSE.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryRgbresponse(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.RGBRESPONSE, a_msg, ref a_twrgbresponse); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryRgbresponse(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.RGBRESPONSE, a_msg, ref a_twrgbresponse); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryRgbresponse(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.RGBRESPONSE, a_msg, ref a_twrgbresponse); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryRgbresponse(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.RGBRESPONSE, a_msg, ref a_twrgbresponse); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryRgbresponse(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.RGBRESPONSE, a_msg, ref a_twrgbresponse); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryRgbresponse(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.RGBRESPONSE, a_msg, ref a_twrgbresponse); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryRgbresponse(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.RGBRESPONSE, a_msg, ref a_twrgbresponse); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get/Set for a file xfer... - /// - /// Data group - /// Operation - /// SETUPFILEXFER structure - /// TWAIN status - private void DatSetupfilexferWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatSetupfilexfer.sts = (STS)NativeMethods.WindowsTwain32DsmEntrySetupfilexfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatSetupfilexfer.dg, - m_threaddataDatSetupfilexfer.dat, - m_threaddataDatSetupfilexfer.msg, - ref m_threaddataDatSetupfilexfer.twsetupfilexfer - ); - } - private void DatSetupfilexferWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatSetupfilexfer.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntrySetupfilexfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatSetupfilexfer.dg, - m_threaddataDatSetupfilexfer.dat, - m_threaddataDatSetupfilexfer.msg, - ref m_threaddataDatSetupfilexfer.twsetupfilexfer - ); - } - public STS DatSetupfilexfer(DG a_dg, MSG a_msg, ref TW_SETUPFILEXFER a_twsetupfilexfer) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twsetupfilexfer = a_twsetupfilexfer; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.SETUPFILEXFER; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twsetupfilexfer = m_twaincommand.Get(lIndex).twsetupfilexfer; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.SETUPFILEXFER.ToString(), a_msg.ToString(), SetupfilexferToCsv(a_twsetupfilexfer)); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatSetupfilexfer.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntrySetupfilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.SETUPFILEXFER, a_msg, ref a_twsetupfilexfer); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntrySetupfilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.SETUPFILEXFER, a_msg, ref a_twsetupfilexfer); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatSetupfilexfer = default(ThreadData); - m_threaddataDatSetupfilexfer.blIsInuse = true; - m_threaddataDatSetupfilexfer.dg = a_dg; - m_threaddataDatSetupfilexfer.msg = a_msg; - m_threaddataDatSetupfilexfer.dat = DAT.SETUPFILEXFER; - m_threaddataDatSetupfilexfer.twsetupfilexfer = a_twsetupfilexfer; - RunInUiThread(DatSetupfilexferWindowsTwain32); - a_twsetupfilexfer = m_threaddataDatSetupfilexfer.twsetupfilexfer; - sts = m_threaddataDatSetupfilexfer.sts; - m_threaddataDatSetupfilexfer = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatSetupfilexfer = default(ThreadData); - m_threaddataDatSetupfilexfer.blIsInuse = true; - m_threaddataDatSetupfilexfer.dg = a_dg; - m_threaddataDatSetupfilexfer.msg = a_msg; - m_threaddataDatSetupfilexfer.dat = DAT.SETUPFILEXFER; - m_threaddataDatSetupfilexfer.twsetupfilexfer = a_twsetupfilexfer; - RunInUiThread(DatSetupfilexferWindowsTwainDsm); - a_twsetupfilexfer = m_threaddataDatSetupfilexfer.twsetupfilexfer; - sts = m_threaddataDatSetupfilexfer.sts; - m_threaddataDatSetupfilexfer = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntrySetupfilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.SETUPFILEXFER, a_msg, ref a_twsetupfilexfer); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntrySetupfilexfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.SETUPFILEXFER, a_msg, ref a_twsetupfilexfer); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntrySetupfilexfer(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.SETUPFILEXFER, a_msg, ref a_twsetupfilexfer); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntrySetupfilexfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.SETUPFILEXFER, a_msg, ref a_twsetupfilexfer); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntrySetupfilexfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.SETUPFILEXFER, a_msg, ref a_twsetupfilexfer); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, SetupfilexferToCsv(a_twsetupfilexfer)); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get info about the memory xfer... - /// - /// Data group - /// Operation - /// SETUPMEMXFER structure - /// TWAIN status - private void DatSetupmemxferWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatSetupmemxfer.sts = (STS)NativeMethods.WindowsTwain32DsmEntrySetupmemxfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatSetupmemxfer.dg, - m_threaddataDatSetupmemxfer.dat, - m_threaddataDatSetupmemxfer.msg, - ref m_threaddataDatSetupmemxfer.twsetupmemxfer - ); - } - private void DatSetupmemxferWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatSetupmemxfer.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntrySetupmemxfer - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatSetupmemxfer.dg, - m_threaddataDatSetupmemxfer.dat, - m_threaddataDatSetupmemxfer.msg, - ref m_threaddataDatSetupmemxfer.twsetupmemxfer - ); - } - public STS DatSetupmemxfer(DG a_dg, MSG a_msg, ref TW_SETUPMEMXFER a_twsetupmemxfer) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twsetupmemxfer = a_twsetupmemxfer; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.SETUPMEMXFER; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twsetupmemxfer = m_twaincommand.Get(lIndex).twsetupmemxfer; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.SETUPMEMXFER.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatSetupmemxfer.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntrySetupmemxfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.SETUPMEMXFER, a_msg, ref a_twsetupmemxfer); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntrySetupmemxfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.SETUPMEMXFER, a_msg, ref a_twsetupmemxfer); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatSetupmemxfer = default(ThreadData); - m_threaddataDatSetupmemxfer.blIsInuse = true; - m_threaddataDatSetupmemxfer.dg = a_dg; - m_threaddataDatSetupmemxfer.msg = a_msg; - m_threaddataDatSetupmemxfer.dat = DAT.SETUPMEMXFER; - m_threaddataDatSetupmemxfer.twsetupmemxfer = a_twsetupmemxfer; - RunInUiThread(DatSetupmemxferWindowsTwain32); - a_twsetupmemxfer = m_threaddataDatSetupmemxfer.twsetupmemxfer; - sts = m_threaddataDatSetupmemxfer.sts; - m_threaddataDatSetupmemxfer = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatSetupmemxfer = default(ThreadData); - m_threaddataDatSetupmemxfer.blIsInuse = true; - m_threaddataDatSetupmemxfer.dg = a_dg; - m_threaddataDatSetupmemxfer.msg = a_msg; - m_threaddataDatSetupmemxfer.dat = DAT.SETUPMEMXFER; - m_threaddataDatSetupmemxfer.twsetupmemxfer = a_twsetupmemxfer; - RunInUiThread(DatSetupmemxferWindowsTwainDsm); - a_twsetupmemxfer = m_threaddataDatSetupmemxfer.twsetupmemxfer; - sts = m_threaddataDatSetupmemxfer.sts; - m_threaddataDatSetupmemxfer = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntrySetupmemxfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.SETUPMEMXFER, a_msg, ref a_twsetupmemxfer); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntrySetupmemxfer(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.SETUPMEMXFER, a_msg, ref a_twsetupmemxfer); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntrySetupmemxfer(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.SETUPMEMXFER, a_msg, ref a_twsetupmemxfer); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntrySetupmemxfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.SETUPMEMXFER, a_msg, ref a_twsetupmemxfer); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntrySetupmemxfer(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.SETUPMEMXFER, a_msg, ref a_twsetupmemxfer); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, SetupmemxferToCsv(a_twsetupmemxfer)); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get some text for an error... - /// - /// Data group - /// Operation - /// STATUS structure - /// TWAIN status - private void DatStatusWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatStatus.sts = (STS)NativeMethods.WindowsTwain32DsmEntryStatus - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatStatus.dg, - m_threaddataDatStatus.dat, - m_threaddataDatStatus.msg, - ref m_threaddataDatStatus.twstatus - ); - } - private void DatStatusWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatStatus.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryStatus - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatStatus.dg, - m_threaddataDatStatus.dat, - m_threaddataDatStatus.msg, - ref m_threaddataDatStatus.twstatus - ); - } - public STS DatStatus(DG a_dg, MSG a_msg, ref TW_STATUS a_twstatus) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twstatus = a_twstatus; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.STATUS; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twstatus = m_twaincommand.Get(lIndex).twstatus; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.STATUS.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatStatus.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryStatus(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.STATUS, a_msg, ref a_twstatus); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryStatus(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.STATUS, a_msg, ref a_twstatus); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatStatus = default(ThreadData); - m_threaddataDatStatus.blIsInuse = true; - m_threaddataDatStatus.dg = a_dg; - m_threaddataDatStatus.msg = a_msg; - m_threaddataDatStatus.dat = DAT.STATUS; - m_threaddataDatStatus.twstatus = a_twstatus; - RunInUiThread(DatStatusWindowsTwain32); - a_twstatus = m_threaddataDatStatus.twstatus; - sts = m_threaddataDatStatus.sts; - m_threaddataDatStatus = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatStatus = default(ThreadData); - m_threaddataDatStatus.blIsInuse = true; - m_threaddataDatStatus.dg = a_dg; - m_threaddataDatStatus.msg = a_msg; - m_threaddataDatStatus.dat = DAT.STATUS; - m_threaddataDatStatus.twstatus = a_twstatus; - RunInUiThread(DatStatusWindowsTwainDsm); - a_twstatus = m_threaddataDatStatus.twstatus; - sts = m_threaddataDatStatus.sts; - m_threaddataDatStatus = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryStatus(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.STATUS, a_msg, ref a_twstatus); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryStatus(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.STATUS, a_msg, ref a_twstatus); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryStatus(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.STATUS, a_msg, ref a_twstatus); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryStatus(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.STATUS, a_msg, ref a_twstatus); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryStatus(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.STATUS, a_msg, ref a_twstatus); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Skip getting the status... :) - TWAIN.STS stsRcOrCc = sts; - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get some text for an error... - /// - /// Data group - /// Operation - /// STATUSUTF8 structure - /// TWAIN status - public STS DatStatusutf8(DG a_dg, MSG a_msg, ref TW_STATUSUTF8 a_twstatusutf8) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twstatusutf8 = a_twstatusutf8; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.STATUSUTF8; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twstatusutf8 = m_twaincommand.Get(lIndex).twstatusutf8; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.STATUSUTF8.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryStatusutf8(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.STATUSUTF8, a_msg, ref a_twstatusutf8); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryStatusutf8(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.STATUSUTF8, a_msg, ref a_twstatusutf8); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryStatusutf8(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.STATUSUTF8, a_msg, ref a_twstatusutf8); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryStatusutf8(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.STATUSUTF8, a_msg, ref a_twstatusutf8); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryStatusutf8(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.STATUSUTF8, a_msg, ref a_twstatusutf8); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryStatusutf8(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.STATUSUTF8, a_msg, ref a_twstatusutf8); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryStatusutf8(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.STATUSUTF8, a_msg, ref a_twstatusutf8); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Get some text for an error... - /// - /// Data group - /// Operation - /// TWAINDIRECT structure - /// TWAIN status - public STS DatTwaindirect(DG a_dg, MSG a_msg, ref TW_TWAINDIRECT a_twtwaindirect) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twtwaindirect = a_twtwaindirect; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.TWAINDIRECT; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twtwaindirect = m_twaincommand.Get(lIndex).twtwaindirect; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.TWAINDIRECT.ToString(), a_msg.ToString(), ""); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryTwaindirect(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.TWAINDIRECT, a_msg, ref a_twtwaindirect); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryTwaindirect(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.TWAINDIRECT, a_msg, ref a_twtwaindirect); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryTwaindirect(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.TWAINDIRECT, a_msg, ref a_twtwaindirect); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryTwaindirect(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.TWAINDIRECT, a_msg, ref a_twtwaindirect); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryTwaindirect(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.TWAINDIRECT, a_msg, ref a_twtwaindirect); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryTwaindirect(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.TWAINDIRECT, a_msg, ref a_twtwaindirect); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryTwaindirect(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.TWAINDIRECT, a_msg, ref a_twtwaindirect); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // All done... - return (stsRcOrCc); - } - - /// - /// Issue capabilities commands... - /// - /// Data group - /// Operation - /// USERINTERFACE structure - /// TWAIN status - private void DatUserinterfaceWindowsTwain32() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatUserinterface.sts = (STS)NativeMethods.WindowsTwain32DsmEntryUserinterface - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatUserinterface.dg, - m_threaddataDatUserinterface.dat, - m_threaddataDatUserinterface.msg, - ref m_threaddataDatUserinterface.twuserinterface - ); - } - private void DatUserinterfaceWindowsTwainDsm() - { - // If you get a first chance exception, be aware that some drivers - // will do that to you, you can ignore it and they'll keep going... - m_threaddataDatUserinterface.sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryUserinterface - ( - ref m_twidentitylegacyApp, - ref m_twidentitylegacyDs, - m_threaddataDatUserinterface.dg, - m_threaddataDatUserinterface.dat, - m_threaddataDatUserinterface.msg, - ref m_threaddataDatUserinterface.twuserinterface - ); - } - public STS DatUserinterface(DG a_dg, MSG a_msg, ref TW_USERINTERFACE a_twuserinterface) - { - STS sts; - - // Submit the work to the TWAIN thread... - if (this.m_runinuithreaddelegate == null) - { - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twuserinterface = a_twuserinterface; - threaddata.twuserinterface.hParent = m_intptrHwnd; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.USERINTERFACE; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twuserinterface = m_twaincommand.Get(lIndex).twuserinterface; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.USERINTERFACE.ToString(), a_msg.ToString(), UserinterfaceToCsv(a_twuserinterface)); - } - - // We need this to handle data sources that return MSG_XFERREADY in - // the midst of processing MSG_ENABLEDS, otherwise we'll miss it... - m_blAcceptXferReady = (a_msg == MSG.ENABLEDS); - m_blRunningDatUserinterface = (a_msg == MSG.ENABLEDS); - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_threaddataDatUserinterface.blIsInuse || (this.m_runinuithreaddelegate == null)) - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryUserinterface(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.USERINTERFACE, a_msg, ref a_twuserinterface); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryUserinterface(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.USERINTERFACE, a_msg, ref a_twuserinterface); - } - } - else - { - if (m_blUseLegacyDSM) - { - lock (m_lockTwain) - { - m_threaddataDatUserinterface = default(ThreadData); - m_threaddataDatUserinterface.blIsInuse = true; - m_threaddataDatUserinterface.dg = a_dg; - m_threaddataDatUserinterface.msg = a_msg; - m_threaddataDatUserinterface.dat = DAT.USERINTERFACE; - m_threaddataDatUserinterface.twuserinterface = a_twuserinterface; - RunInUiThread(DatUserinterfaceWindowsTwain32); - a_twuserinterface = m_threaddataDatUserinterface.twuserinterface; - sts = m_threaddataDatUserinterface.sts; - m_threaddataDatUserinterface = default(ThreadData); - } - } - else - { - lock (m_lockTwain) - { - m_threaddataDatUserinterface = default(ThreadData); - m_threaddataDatUserinterface.blIsInuse = true; - m_threaddataDatUserinterface.dg = a_dg; - m_threaddataDatUserinterface.msg = a_msg; - m_threaddataDatUserinterface.dat = DAT.USERINTERFACE; - m_threaddataDatUserinterface.twuserinterface = a_twuserinterface; - RunInUiThread(DatUserinterfaceWindowsTwainDsm); - a_twuserinterface = m_threaddataDatUserinterface.twuserinterface; - sts = m_threaddataDatUserinterface.sts; - m_threaddataDatUserinterface = default(ThreadData); - } - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - m_blRunningDatUserinterface = false; - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryUserinterface(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.USERINTERFACE, a_msg, ref a_twuserinterface); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryUserinterface(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.USERINTERFACE, a_msg, ref a_twuserinterface); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryUserinterface(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.USERINTERFACE, a_msg, ref a_twuserinterface); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - m_blRunningDatUserinterface = false; - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryUserinterface(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.USERINTERFACE, a_msg, ref a_twuserinterface); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryUserinterface(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.USERINTERFACE, a_msg, ref a_twuserinterface); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - m_blRunningDatUserinterface = false; - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - m_blRunningDatUserinterface = false; - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, ""); - } - - // If successful, decide which way to jump... - if (sts == STS.SUCCESS) - { - switch (a_msg) - { - // No clue... - default: - break; - - // Jump up... - case MSG.ENABLEDS: - case MSG.ENABLEDSUIONLY: - m_state = STATE.S5; - break; - - // Jump down... - case MSG.DISABLEDS: - m_blIsMsgclosedsreq = false; - m_blIsMsgclosedsok = false; - m_state = STATE.S4; - break; - } - } - - // All done... - m_blRunningDatUserinterface = false; - return (stsRcOrCc); - } - - /// - /// Get/Set the Xfer Group... - /// - /// Data group - /// Operation - /// XFERGROUP structure - /// TWAIN status - public STS DatXferGroup(DG a_dg, MSG a_msg, ref UInt32 a_twuint32) - { - STS sts; - - // Submit the work to the TWAIN thread... - if ((m_threadTwain != null) && (m_threadTwain.ManagedThreadId != Thread.CurrentThread.ManagedThreadId)) - { - lock (m_lockTwain) - { - // Set our command variables... - ThreadData threaddata = default(ThreadData); - threaddata.twuint32 = a_twuint32; - threaddata.dg = a_dg; - threaddata.msg = a_msg; - threaddata.dat = DAT.XFERGROUP; - long lIndex = m_twaincommand.Submit(threaddata); - - // Submit the command and wait for the reply... - CallerToThreadSet(); - ThreadToCallerWaitOne(); - - // Return the result... - a_twuint32 = m_twaincommand.Get(lIndex).twuint32; - sts = m_twaincommand.Get(lIndex).sts; - - // Clear the command variables... - m_twaincommand.Delete(lIndex); - } - return (sts); - } - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendBefore(a_dg.ToString(), DAT.XFERGROUP.ToString(), a_msg.ToString(), XfergroupToCsv(a_twuint32)); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryXfergroup(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.XFERGROUP, a_msg, ref a_twuint32); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryXfergroup(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.XFERGROUP, a_msg, ref a_twuint32); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.Linux64DsmEntryXfergroup(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.XFERGROUP, a_msg, ref a_twuint32); - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - sts = (STS)NativeMethods.LinuxDsmEntryXfergroup(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, a_dg, DAT.XFERGROUP, a_msg, ref a_twuint32); - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryXfergroup(ref m_twidentityApp, ref m_twidentityDs, a_dg, DAT.XFERGROUP, a_msg, ref a_twuint32); - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryXfergroup(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.XFERGROUP, a_msg, ref a_twuint32); - } - else - { - sts = (STS)NativeMethods.MacosxTwaindsmDsmEntryXfergroup(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, a_dg, DAT.XFERGROUP, a_msg, ref a_twuint32); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - Log.LogSendAfter(STS.BUMMER, ""); - return (STS.BUMMER); - } - - // Get DAT_STATUS, if needed... - TWAIN.STS stsRcOrCc = AutoDatStatus(sts); - - // Log it... - if (Log.GetLevel() > 0) - { - Log.LogSendAfter(stsRcOrCc, XfergroupToCsv(a_twuint32)); - } - - // All done... - return (stsRcOrCc); - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Public Definitions, this is where you get the callback definitions for - // handling device events and scanning... - /////////////////////////////////////////////////////////////////////////////// - #region Public Definitions... - - /// - /// The form of the device event callback used by the caller when they are - /// running in states 4, 5, 6 and 7... - /// - /// - public delegate STS DeviceEventCallback(); - - /// - /// The form of the callback used by the caller when they are running - /// in states 5, 6 and 7; anything after DG_CONTROL / DAT_USERINTERFACE / - /// MSG_ENABLEDS* until DG_CONTROL / DAT_USERINTERFACE / MSG_DISABLEDS... - /// - /// - public delegate STS ScanCallback(bool a_blClosing); - - /// - /// We use this to run code in the context of the caller's UI thread... - /// - /// code to run - public delegate void RunInUiThreadDelegate(Action a_action); - - /// - /// Only one DSM can be installed on a Linux system, and it must match - /// the architecture. To handle the legacy problem due to the bad - /// definition of TW_INT32/TW_UINT32, we also support access to the - /// 64-bit 2.3.2 DSM. This is only used if we see a driver that seems - /// to be returning garbage for its TW_IDENTITY... - /// - public enum LinuxDsm - { - Unknown, - IsLatestDsm, - Is020302Dsm64bit - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Private Definitions (TIFF): this stuff should have been here all along to - // make it easier to share. It's only needed when writing out files from - // DAT_IMAGEMEMXFER data. - /////////////////////////////////////////////////////////////////////////////// - #region Private Definitions (TIFF)... - - // A TIFF header is composed of tags... - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TiffTag - { - public TiffTag(ushort a_u16Tag, ushort a_u16Type, uint a_u32Count, uint a_u32Value) - { - u16Tag = a_u16Tag; - u16Type = a_u16Type; - u32Count = a_u32Count; - u32Value = a_u32Value; - } - - public ushort u16Tag; - public ushort u16Type; - public uint u32Count; - public uint u32Value; - } - - // TIFF header for Uncompressed BITONAL images... - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TiffBitonalUncompressed - { - // Constructor... - public TiffBitonalUncompressed(uint a_u32Width, uint a_u32Height, uint a_u32Resolution, uint a_u32Size) - { - // Header... - u16ByteOrder = 0x4949; - u16Version = 42; - u32OffsetFirstIFD = 8; - - // First IFD... - u16IFD = 16; - - // Tags... - tifftagNewSubFileType = new TiffTag(254, 4, 1, 0); - tifftagSubFileType = new TiffTag(255, 3, 1, 1); - tifftagImageWidth = new TiffTag(256, 4, 1, a_u32Width); - tifftagImageLength = new TiffTag(257, 4, 1, a_u32Height); - tifftagBitsPerSample = new TiffTag(258, 3, 1, 1); - tifftagCompression = new TiffTag(259, 3, 1, 1); - tifftagPhotometricInterpretation = new TiffTag(262, 3, 1, 1); - tifftagFillOrder = new TiffTag(266, 3, 1, 1); - tifftagStripOffsets = new TiffTag(273, 4, 1, 222); - tifftagSamplesPerPixel = new TiffTag(277, 3, 1, 1); - tifftagRowsPerStrip = new TiffTag(278, 4, 1, a_u32Height); - tifftagStripByteCounts = new TiffTag(279, 4, 1, a_u32Size); - tifftagXResolution = new TiffTag(282, 5, 1, 206); - tifftagYResolution = new TiffTag(283, 5, 1, 214); - tifftagT4T6Options = new TiffTag(292, 4, 1, 0); - tifftagResolutionUnit = new TiffTag(296, 3, 1, 2); - - // Footer... - u32NextIFD = 0; - u64XResolution = (ulong)0x100000000 + (ulong)a_u32Resolution; - u64YResolution = (ulong)0x100000000 + (ulong)a_u32Resolution; - } - - // Header... - public ushort u16ByteOrder; - public ushort u16Version; - public uint u32OffsetFirstIFD; - - // First IFD... - public ushort u16IFD; - - // Tags... - public TiffTag tifftagNewSubFileType; - public TiffTag tifftagSubFileType; - public TiffTag tifftagImageWidth; - public TiffTag tifftagImageLength; - public TiffTag tifftagBitsPerSample; - public TiffTag tifftagCompression; - public TiffTag tifftagPhotometricInterpretation; - public TiffTag tifftagFillOrder; - public TiffTag tifftagStripOffsets; - public TiffTag tifftagSamplesPerPixel; - public TiffTag tifftagRowsPerStrip; - public TiffTag tifftagStripByteCounts; - public TiffTag tifftagXResolution; - public TiffTag tifftagYResolution; - public TiffTag tifftagT4T6Options; - public TiffTag tifftagResolutionUnit; - - // Footer... - public uint u32NextIFD; - public ulong u64XResolution; - public ulong u64YResolution; - } - - // TIFF header for Group4 BITONAL images... - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TiffBitonalG4 - { - // Constructor... - public TiffBitonalG4(uint a_u32Width, uint a_u32Height, uint a_u32Resolution, uint a_u32Size) - { - // Header... - u16ByteOrder = 0x4949; - u16Version = 42; - u32OffsetFirstIFD = 8; - - // First IFD... - u16IFD = 16; - - // Tags... - tifftagNewSubFileType = new TiffTag(254, 4, 1, 0); - tifftagSubFileType = new TiffTag(255, 3, 1, 1); - tifftagImageWidth = new TiffTag(256, 4, 1, a_u32Width); - tifftagImageLength = new TiffTag(257, 4, 1, a_u32Height); - tifftagBitsPerSample = new TiffTag(258, 3, 1, 1); - tifftagCompression = new TiffTag(259, 3, 1, 4); - tifftagPhotometricInterpretation = new TiffTag(262, 3, 1, 0); - tifftagFillOrder = new TiffTag(266, 3, 1, 1); - tifftagStripOffsets = new TiffTag(273, 4, 1, 222); - tifftagSamplesPerPixel = new TiffTag(277, 3, 1, 1); - tifftagRowsPerStrip = new TiffTag(278, 4, 1, a_u32Height); - tifftagStripByteCounts = new TiffTag(279, 4, 1, a_u32Size); - tifftagXResolution = new TiffTag(282, 5, 1, 206); - tifftagYResolution = new TiffTag(283, 5, 1, 214); - tifftagT4T6Options = new TiffTag(293, 4, 1, 0); - tifftagResolutionUnit = new TiffTag(296, 3, 1, 2); - - // Footer... - u32NextIFD = 0; - u64XResolution = (ulong)0x100000000 + (ulong)a_u32Resolution; - u64YResolution = (ulong)0x100000000 + (ulong)a_u32Resolution; - } - - // Header... - public ushort u16ByteOrder; - public ushort u16Version; - public uint u32OffsetFirstIFD; - - // First IFD... - public ushort u16IFD; - - // Tags... - public TiffTag tifftagNewSubFileType; - public TiffTag tifftagSubFileType; - public TiffTag tifftagImageWidth; - public TiffTag tifftagImageLength; - public TiffTag tifftagBitsPerSample; - public TiffTag tifftagCompression; - public TiffTag tifftagPhotometricInterpretation; - public TiffTag tifftagFillOrder; - public TiffTag tifftagStripOffsets; - public TiffTag tifftagSamplesPerPixel; - public TiffTag tifftagRowsPerStrip; - public TiffTag tifftagStripByteCounts; - public TiffTag tifftagXResolution; - public TiffTag tifftagYResolution; - public TiffTag tifftagT4T6Options; - public TiffTag tifftagResolutionUnit; - - // Footer... - public uint u32NextIFD; - public ulong u64XResolution; - public ulong u64YResolution; - } - - // TIFF header for Uncompressed GRAYSCALE images... - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TiffGrayscaleUncompressed - { - // Constructor... - public TiffGrayscaleUncompressed(uint a_u32Width, uint a_u32Height, uint a_u32Resolution, uint a_u32Size) - { - // Header... - u16ByteOrder = 0x4949; - u16Version = 42; - u32OffsetFirstIFD = 8; - - // First IFD... - u16IFD = 14; - - // Tags... - tifftagNewSubFileType = new TiffTag(254, 4, 1, 0); - tifftagSubFileType = new TiffTag(255, 3, 1, 1); - tifftagImageWidth = new TiffTag(256, 4, 1, a_u32Width); - tifftagImageLength = new TiffTag(257, 4, 1, a_u32Height); - tifftagBitsPerSample = new TiffTag(258, 3, 1, 8); - tifftagCompression = new TiffTag(259, 3, 1, 1); - tifftagPhotometricInterpretation = new TiffTag(262, 3, 1, 1); - tifftagStripOffsets = new TiffTag(273, 4, 1, 198); - tifftagSamplesPerPixel = new TiffTag(277, 3, 1, 1); - tifftagRowsPerStrip = new TiffTag(278, 4, 1, a_u32Height); - tifftagStripByteCounts = new TiffTag(279, 4, 1, a_u32Size); - tifftagXResolution = new TiffTag(282, 5, 1, 182); - tifftagYResolution = new TiffTag(283, 5, 1, 190); - tifftagResolutionUnit = new TiffTag(296, 3, 1, 2); - - // Footer... - u32NextIFD = 0; - u64XResolution = (ulong)0x100000000 + (ulong)a_u32Resolution; - u64YResolution = (ulong)0x100000000 + (ulong)a_u32Resolution; - } - - // Header... - public ushort u16ByteOrder; - public ushort u16Version; - public uint u32OffsetFirstIFD; - - // First IFD... - public ushort u16IFD; - - // Tags... - public TiffTag tifftagNewSubFileType; - public TiffTag tifftagSubFileType; - public TiffTag tifftagImageWidth; - public TiffTag tifftagImageLength; - public TiffTag tifftagBitsPerSample; - public TiffTag tifftagCompression; - public TiffTag tifftagPhotometricInterpretation; - public TiffTag tifftagStripOffsets; - public TiffTag tifftagSamplesPerPixel; - public TiffTag tifftagRowsPerStrip; - public TiffTag tifftagStripByteCounts; - public TiffTag tifftagXResolution; - public TiffTag tifftagYResolution; - public TiffTag tifftagResolutionUnit; - - // Footer... - public uint u32NextIFD; - public ulong u64XResolution; - public ulong u64YResolution; - } - - // TIFF header for Uncompressed COLOR images... - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TiffColorUncompressed - { - // Constructor... - public TiffColorUncompressed(uint a_u32Width, uint a_u32Height, uint a_u32Resolution, uint a_u32Size) - { - // Header... - u16ByteOrder = 0x4949; - u16Version = 42; - u32OffsetFirstIFD = 8; - - // First IFD... - u16IFD = 14; - - // Tags... - tifftagNewSubFileType = new TiffTag(254, 4, 1, 0); - tifftagSubFileType = new TiffTag(255, 3, 1, 1); - tifftagImageWidth = new TiffTag(256, 4, 1, a_u32Width); - tifftagImageLength = new TiffTag(257, 4, 1, a_u32Height); - tifftagBitsPerSample = new TiffTag(258, 3, 3, 182); - tifftagCompression = new TiffTag(259, 3, 1, 1); - tifftagPhotometricInterpretation = new TiffTag(262, 3, 1, 2); - tifftagStripOffsets = new TiffTag(273, 4, 1, 204); - tifftagSamplesPerPixel = new TiffTag(277, 3, 1, 3); - tifftagRowsPerStrip = new TiffTag(278, 4, 1, a_u32Height); - tifftagStripByteCounts = new TiffTag(279, 4, 1, a_u32Size); - tifftagXResolution = new TiffTag(282, 5, 1, 188); - tifftagYResolution = new TiffTag(283, 5, 1, 196); - tifftagResolutionUnit = new TiffTag(296, 3, 1, 2); - - // Footer... - u32NextIFD = 0; - u16XBitsPerSample1 = 8; - u16XBitsPerSample2 = 8; - u16XBitsPerSample3 = 8; - u64XResolution = (ulong)0x100000000 + (ulong)a_u32Resolution; - u64YResolution = (ulong)0x100000000 + (ulong)a_u32Resolution; - } - - // Header... - public ushort u16ByteOrder; - public ushort u16Version; - public uint u32OffsetFirstIFD; - - // First IFD... - public ushort u16IFD; - - // Tags... - public TiffTag tifftagNewSubFileType; - public TiffTag tifftagSubFileType; - public TiffTag tifftagImageWidth; - public TiffTag tifftagImageLength; - public TiffTag tifftagBitsPerSample; - public TiffTag tifftagCompression; - public TiffTag tifftagPhotometricInterpretation; - public TiffTag tifftagStripOffsets; - public TiffTag tifftagSamplesPerPixel; - public TiffTag tifftagRowsPerStrip; - public TiffTag tifftagStripByteCounts; - public TiffTag tifftagXResolution; - public TiffTag tifftagYResolution; - public TiffTag tifftagResolutionUnit; - - // Footer... - public uint u32NextIFD; - public ushort u16XBitsPerSample1; - public ushort u16XBitsPerSample2; - public ushort u16XBitsPerSample3; - public ulong u64XResolution; - public ulong u64YResolution; - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Private Functions, the main thread is in here... - /////////////////////////////////////////////////////////////////////////////// - #region Private Functions... - - /// - /// Cleanup... - /// - /// true if we need to clean up managed resources - [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] - internal void Dispose(bool a_blDisposing) - { - // Free managed resources... - if (a_blDisposing) - { - // Make sure we've closed any drivers... - Rollback(TWAIN.STATE.S2); - - // Make sure that our thread is gone... - if (m_threadTwain != null) - { - m_threadTwain.Join(); - m_threadTwain = null; - } - - // This one too... - if (m_threadRunningDatUserinterface != null) - { - m_threadRunningDatUserinterface.Join(); - m_threadRunningDatUserinterface = null; - } - - // Clean up our communication thingy... - m_twaincommand = null; - - // Cleanup... - if (m_autoreseteventCaller != null) - { - m_autoreseteventCaller.Close(); - m_autoreseteventCaller = null; - } - if (m_autoreseteventThread != null) - { - m_autoreseteventThread.Close(); - m_autoreseteventThread = null; - } - if (m_autoreseteventRollback != null) - { - m_autoreseteventRollback.Close(); - m_autoreseteventRollback = null; - } - if (m_autoreseteventThreadStarted != null) - { - m_autoreseteventThreadStarted.Close(); - m_autoreseteventThreadStarted = null; - } - } - } - - /// - /// This is our main loop where we issue commands to the TWAIN - /// object on behalf of the caller. This function runs in its - /// own thread... - /// - private void Main() - { - bool blRunning; - bool blScanning; - long lIndex; - ThreadData threaddata; - - // Okay, we're ready to run... - m_autoreseteventThreadStarted.Set(); - Log.Info("main>>> thread started..."); - - // - // We have three different ways of driving the TWAIN driver... - // - // First, we can accept a direct command from the user for commands - // that move from state 2 to state 4, and for any commands that are - // issued in state 4. - // - // Second, we have a scanning callback function, that operates when - // we are transferring images; this means that we don't want the - // user making those calls directly. - // - // Third, we have a rollback function, that allows the calls to - // move anywhere from state 7 to state 2; what this means is that we - // don't want the user making those calls directly. - // - // The trick is to move smoothly between these three styles of - // access, and what we find is that the first and second are pretty - // easy to do, but the third one is tricky... - // - blRunning = true; - blScanning = false; - while (blRunning) - { - // Get the next item, if we don't have anything, then we may - // need to wait... - if (!m_twaincommand.GetNext(out lIndex, out threaddata)) - { - // If we're not scanning, then wait for a command to wake - // us up... - if (!blScanning) - { - CallerToThreadWaitOne(); - m_twaincommand.GetNext(out lIndex, out threaddata); - } - } - - // Leave...now... - if (threaddata.blExitThread) - { - m_twaincommand.Complete(lIndex, threaddata); - m_scancallback(true); - ThreadToCallerSet(); - ThreadToRollbackSet(); - return; - } - - // Process device events... - if (IsMsgDeviceEvent()) - { - m_deviceeventcallback(); - } - - // We don't have a direct command, it's either a rollback request, - // a request to run the scan callback, or its a false positive, - // which we can safely ignore... - if (threaddata.dat == default(DAT)) - { - // The caller has asked us to rollback the state machine... - if (threaddata.blRollback) - { - threaddata.blRollback = false; - Rollback(threaddata.stateRollback); - blScanning = (threaddata.stateRollback >= STATE.S5); - blRunning = (threaddata.stateRollback > STATE.S2); - if (!blRunning) - { - m_scancallback(true); - } - ThreadToRollbackSet(); - } - - // Callback stuff here between MSG_ENABLEDS* and MSG_DISABLEDS... - else if (GetState() >= STATE.S5) - { - m_scancallback(false); - blScanning = true; - } - - // We're done scanning... - else - { - blScanning = false; - } - - // Tag the command as complete... - m_twaincommand.Complete(lIndex, threaddata); - - // Go back to the top... - continue; - } - - // Otherwise, directly issue the command... - switch (threaddata.dat) - { - // Unrecognized DAT... - default: - if (m_state < STATE.S4) - { - threaddata.sts = DsmEntryNullDest(threaddata.dg, threaddata.dat, threaddata.msg, threaddata.twmemref); - } - else - { - threaddata.sts = DsmEntry(threaddata.dg, threaddata.dat, threaddata.msg, threaddata.twmemref); - } - break; - - // Audio file xfer... - case DAT.AUDIOFILEXFER: - threaddata.sts = DatAudiofilexfer(threaddata.dg, threaddata.msg); - break; - - // Audio info... - case DAT.AUDIOINFO: - threaddata.sts = DatAudioinfo(threaddata.dg, threaddata.msg, ref threaddata.twaudioinfo); - break; - - // Audio native xfer... - case DAT.AUDIONATIVEXFER: - threaddata.sts = DatAudionativexfer(threaddata.dg, threaddata.msg, ref threaddata.intptrAudio); - break; - - // Negotiation commands... - case DAT.CAPABILITY: - threaddata.sts = DatCapability(threaddata.dg, threaddata.msg, ref threaddata.twcapability); - break; - - // CIE color... - case DAT.CIECOLOR: - threaddata.sts = DatCiecolor(threaddata.dg, threaddata.msg, ref threaddata.twciecolor); - break; - - // Snapshots... - case DAT.CUSTOMDSDATA: - threaddata.sts = DatCustomdsdata(threaddata.dg, threaddata.msg, ref threaddata.twcustomdsdata); - break; - - // Functions... - case DAT.ENTRYPOINT: - threaddata.sts = DatEntrypoint(threaddata.dg, threaddata.msg, ref threaddata.twentrypoint); - break; - - // Image meta data... - case DAT.EXTIMAGEINFO: - threaddata.sts = DatExtimageinfo(threaddata.dg, threaddata.msg, ref threaddata.twextimageinfo); - break; - - // Filesystem... - case DAT.FILESYSTEM: - threaddata.sts = DatFilesystem(threaddata.dg, threaddata.msg, ref threaddata.twfilesystem); - break; - - // Filter... - case DAT.FILTER: - threaddata.sts = DatFilter(threaddata.dg, threaddata.msg, ref threaddata.twfilter); - break; - - // Grayscale... - case DAT.GRAYRESPONSE: - threaddata.sts = DatGrayresponse(threaddata.dg, threaddata.msg, ref threaddata.twgrayresponse); - break; - - // ICC color profiles... - case DAT.ICCPROFILE: - threaddata.sts = DatIccprofile(threaddata.dg, threaddata.msg, ref threaddata.twmemory); - break; - - // Enumerate and Open commands... - case DAT.IDENTITY: - threaddata.sts = DatIdentity(threaddata.dg, threaddata.msg, ref threaddata.twidentity); - break; - - // More meta data... - case DAT.IMAGEINFO: - threaddata.sts = DatImageinfo(threaddata.dg, threaddata.msg, ref threaddata.twimageinfo); - break; - - // File xfer... - case DAT.IMAGEFILEXFER: - threaddata.sts = DatImagefilexfer(threaddata.dg, threaddata.msg); - break; - - // Image layout commands... - case DAT.IMAGELAYOUT: - threaddata.sts = DatImagelayout(threaddata.dg, threaddata.msg, ref threaddata.twimagelayout); - break; - - // Memory file transfer (yes, we're using TW_IMAGEMEMXFER, that's okay)... - case DAT.IMAGEMEMFILEXFER: - threaddata.sts = DatImagememfilexfer(threaddata.dg, threaddata.msg, ref threaddata.twimagememxfer); - break; - - // Memory transfer... - case DAT.IMAGEMEMXFER: - threaddata.sts = DatImagememxfer(threaddata.dg, threaddata.msg, ref threaddata.twimagememxfer); - break; - - // Native transfer... - case DAT.IMAGENATIVEXFER: - if (threaddata.blUseBitmapHandle) - { - threaddata.sts = DatImagenativexferHandle(threaddata.dg, threaddata.msg, ref threaddata.intptrBitmap); - } - else - { - threaddata.sts = DatImagenativexfer(threaddata.dg, threaddata.msg, ref threaddata.bitmap); - } - break; - - // JPEG compression... - case DAT.JPEGCOMPRESSION: - threaddata.sts = DatJpegcompression(threaddata.dg, threaddata.msg, ref threaddata.twjpegcompression); - break; - - // Metrics... - case DAT.METRICS: - threaddata.sts = DatMetrics(threaddata.dg, threaddata.msg, ref threaddata.twmetrics); - break; - - // Palette8... - case DAT.PALETTE8: - threaddata.sts = DatPalette8(threaddata.dg, threaddata.msg, ref threaddata.twpalette8); - break; - - // DSM commands... - case DAT.PARENT: - threaddata.sts = DatParent(threaddata.dg, threaddata.msg, ref threaddata.intptrHwnd); - break; - - // Raw commands... - case DAT.PASSTHRU: - threaddata.sts = DatPassthru(threaddata.dg, threaddata.msg, ref threaddata.twpassthru); - break; - - // Pending transfers... - case DAT.PENDINGXFERS: - threaddata.sts = DatPendingxfers(threaddata.dg, threaddata.msg, ref threaddata.twpendingxfers); - break; - - // RGB... - case DAT.RGBRESPONSE: - threaddata.sts = DatRgbresponse(threaddata.dg, threaddata.msg, ref threaddata.twrgbresponse); - break; - - // Setup file transfer... - case DAT.SETUPFILEXFER: - threaddata.sts = DatSetupfilexfer(threaddata.dg, threaddata.msg, ref threaddata.twsetupfilexfer); - break; - - // Get memory info... - case DAT.SETUPMEMXFER: - threaddata.sts = DatSetupmemxfer(threaddata.dg, threaddata.msg, ref threaddata.twsetupmemxfer); - break; - - // Status... - case DAT.STATUS: - threaddata.sts = DatStatus(threaddata.dg, threaddata.msg, ref threaddata.twstatus); - break; - - // Status text... - case DAT.STATUSUTF8: - threaddata.sts = DatStatusutf8(threaddata.dg, threaddata.msg, ref threaddata.twstatusutf8); - break; - - // TWAIN Direct... - case DAT.TWAINDIRECT: - threaddata.sts = DatTwaindirect(threaddata.dg, threaddata.msg, ref threaddata.twtwaindirect); - break; - - // Scan and GUI commands... - case DAT.USERINTERFACE: - threaddata.sts = DatUserinterface(threaddata.dg, threaddata.msg, ref threaddata.twuserinterface); - if (threaddata.sts == STS.SUCCESS) - { - if ((threaddata.dg == DG.CONTROL) && (threaddata.dat == DAT.USERINTERFACE) && (threaddata.msg == MSG.DISABLEDS)) - { - blScanning = false; - } - else if ((threaddata.dg == DG.CONTROL) && (threaddata.dat == DAT.USERINTERFACE) && (threaddata.msg == MSG.DISABLEDS)) - { - if (threaddata.twuserinterface.ShowUI == 0) - { - blScanning = true; - } - } - } - break; - - // Transfer group... - case DAT.XFERGROUP: - threaddata.sts = DatXferGroup(threaddata.dg, threaddata.msg, ref threaddata.twuint32); - break; - } - - // Report to the caller that we're done, and loop back up for another... - m_twaincommand.Complete(lIndex, threaddata); - ThreadToCallerSet(); - } - - // Some insurance to make sure we loosen up the caller... - m_scancallback(true); - ThreadToCallerSet(); - return; - } - - /// - /// Use an event message to set the appropriate flags... - /// - /// Message to process - private void ProcessEvent(MSG a_msg) - { - switch (a_msg) - { - // Do nothing... - default: - break; - - // If we're in state 5, then go to state 6... - case MSG.XFERREADY: - if (m_blAcceptXferReady) - { - // Protect us from driver's that spam this event... - m_blAcceptXferReady = false; - - // We're still processing DAT_USERINTERFACE, that's a kick the - // teeth. We can't wait for it here, so launch a thread to wait - // for it to finish, so we can go to the next state as soon as - // it's done... - if (m_blRunningDatUserinterface) - { - m_threadRunningDatUserinterface = new Thread(RunningDatUserinterface); - m_threadRunningDatUserinterface.Start(); - return; - } - - // Change our state... - m_state = STATE.S6; - m_blIsMsgxferready = true; - CallerToThreadSet(); - - // Kick off the scan engine... - if (m_scancallback != null) - { - m_scancallback(false); - } - } - break; - - // The cancel button was pressed... - case MSG.CLOSEDSREQ: - m_blIsMsgclosedsreq = true; - CallerToThreadSet(); - if (m_scancallback != null) - { - m_scancallback(false); - } - break; - - // The OK button was pressed... - case MSG.CLOSEDSOK: - m_blIsMsgclosedsok = true; - CallerToThreadSet(); - if (m_scancallback != null) - { - m_scancallback(false); - } - break; - - // A device event arrived... - case MSG.DEVICEEVENT: - m_blIsMsgdeviceevent = true; - CallerToThreadSet(); - break; - } - } - - /// - /// As long as DAT_USERINTERFACE is running we'll spin here... - /// - private void RunningDatUserinterface() - { - // Wait until something kicks us out... - while ((m_state >= STATE.S4) && m_blRunningDatUserinterface) - { - Thread.Sleep(20); - } - - // If we never made it to state 5, then bail... - if (m_state < STATE.S5) - { - return; - } - - // Bump up our state... - m_state = STATE.S6; - m_blIsMsgxferready = true; - CallerToThreadSet(); - - // Kick off the scan engine... - if (m_scancallback != null) - { - m_scancallback(false); - } - } - - /// - /// TWAIN needs help, if we want it to run stuff in our main - /// UI thread... - /// - /// the code to run - private void RunInUiThread(Action a_action) - { - m_runinuithreaddelegate(a_action); - } - - /// - /// The caller is asking the thread to wake-up... - /// - private void CallerToThreadSet() - { - m_autoreseteventCaller.Set(); - } - - /// - /// The thread is waiting for the caller to wake it... - /// - private bool CallerToThreadWaitOne() - { - return (m_autoreseteventCaller.WaitOne()); - } - - /// - /// The common start to every capability csv... - /// - /// Capability number - /// Container - /// Data type - /// - private CSV Common(CAP a_cap, TWON a_twon, TWTY a_twty) - { - CSV csv = new CSV(); - - // Add the capability... - string szCap = a_cap.ToString(); - if (!szCap.Contains("_")) - { - szCap = "0x" + ((ushort)a_cap).ToString("X"); - } - - // Build the CSV... - csv.Add(szCap); - csv.Add("TWON_" + a_twon); - csv.Add("TWTY_" + a_twty); - - // And return it... - return (csv); - } - - /// - /// Has a device event arrived? Make sure to clear it, because - /// we can get many of these. We don't have to worry about a - /// race condition, because the caller is expected to drain the - /// driver of all events. - /// - /// True if a device event is pending - private bool IsMsgDeviceEvent() - { - if (m_blIsMsgdeviceevent) - { - m_blIsMsgdeviceevent = false; - return (true); - } - return (false); - } - - /// - /// The thread is asking the caller to wake-up... - /// - private void ThreadToCallerSet() - { - m_autoreseteventThread.Set(); - } - - /// - /// The caller is waiting for the thread to wake it... - /// - /// Result of the wait - private bool ThreadToCallerWaitOne() - { - return (m_autoreseteventThread.WaitOne()); - } - - /// - /// The thread is asking the rollback to wake-up... - /// - private void ThreadToRollbackSet() - { - m_autoreseteventRollback.Set(); - } - - /// - /// The rollback is waiting for the thread to wake it... - /// - /// Result of the wait - private bool ThreadToRollbackWaitOne() - { - return (m_autoreseteventRollback.WaitOne()); - } - - /// - /// Automatically collect the condition code for TWRC_FAILURE's... - /// - /// The return code from the last operation - /// The return code from the last operation - /// The final statue return - private STS AutoDatStatus(STS a_sts) - { - STS sts; - TW_STATUS twstatus = new TW_STATUS(); - - // Automatic system is off, or the status is not TWRC_FAILURE, so just return the status we got... - if (!m_blAutoDatStatus || (a_sts != STS.FAILURE)) - { - return (a_sts); - } - - // Windows... - if (ms_platform == Platform.WINDOWS) - { - // Issue the command... - try - { - if (m_blUseLegacyDSM) - { - if (GetState() <= STATE.S3) - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryStatusState3(ref m_twidentitylegacyApp, IntPtr.Zero, DG.CONTROL, DAT.STATUS, MSG.GET, ref twstatus); - } - else - { - sts = (STS)NativeMethods.WindowsTwain32DsmEntryStatus(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, DG.CONTROL, DAT.STATUS, MSG.GET, ref twstatus); - } - } - else - { - if (GetState() <= STATE.S3) - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryStatusState3(ref m_twidentitylegacyApp, IntPtr.Zero, DG.CONTROL, DAT.STATUS, MSG.GET, ref twstatus); - } - else - { - sts = (STS)NativeMethods.WindowsTwaindsmDsmEntryStatus(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, DG.CONTROL, DAT.STATUS, MSG.GET, ref twstatus); - } - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - TWAINWorkingGroup.Log.Error("Driver crash..."); - return (STS.BUMMER); - } - } - - // Linux... - else if (ms_platform == Platform.LINUX) - { - // Issue the command... - try - { - if (m_blFoundLatestDsm64 && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - if (GetState() <= STATE.S3) - { - sts = (STS)NativeMethods.Linux64DsmEntryStatusState3(ref m_twidentitylegacyApp, IntPtr.Zero, DG.CONTROL, DAT.STATUS, MSG.GET, ref twstatus); - } - else - { - sts = (STS)NativeMethods.Linux64DsmEntryStatus(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, DG.CONTROL, DAT.STATUS, MSG.GET, ref twstatus); - } - } - else if (m_blFoundLatestDsm && (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - if (GetState() <= STATE.S3) - { - sts = (STS)NativeMethods.LinuxDsmEntryStatusState3(ref m_twidentitylegacyApp, IntPtr.Zero, DG.CONTROL, DAT.STATUS, MSG.GET, ref twstatus); - } - else - { - sts = (STS)NativeMethods.LinuxDsmEntryStatus(ref m_twidentitylegacyApp, ref m_twidentitylegacyDs, DG.CONTROL, DAT.STATUS, MSG.GET, ref twstatus); - } - } - else if (m_blFound020302Dsm64bit && (m_linuxdsm == LinuxDsm.Is020302Dsm64bit)) - { - if (GetState() <= STATE.S3) - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryStatusState3(ref m_twidentityApp, IntPtr.Zero, DG.CONTROL, DAT.STATUS, MSG.GET, ref twstatus); - } - else - { - sts = (STS)NativeMethods.Linux020302Dsm64bitEntryStatus(ref m_twidentityApp, ref m_twidentityDs, DG.CONTROL, DAT.STATUS, MSG.GET, ref twstatus); - } - } - else - { - Log.Error("apparently we don't have a DSM..."); - sts = STS.BUMMER; - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - TWAINWorkingGroup.Log.Error("Driver crash..."); - return (STS.BUMMER); - } - } - - // Mac OS X, which has to be different... - else if (ms_platform == Platform.MACOSX) - { - // Issue the command... - try - { - if (GetState() <= STATE.S3) - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryStatusState3(ref m_twidentitymacosxApp, IntPtr.Zero, DG.CONTROL, DAT.STATUS, MSG.GET, ref twstatus); - } - else - { - sts = (STS)NativeMethods.MacosxTwainDsmEntryStatus(ref m_twidentitymacosxApp, ref m_twidentitymacosxDs, DG.CONTROL, DAT.STATUS, MSG.GET, ref twstatus); - } - } - catch (Exception exception) - { - // The driver crashed... - Log.Error("crash - " + exception.Message); - TWAINWorkingGroup.Log.Error("Driver crash..."); - return (STS.BUMMER); - } - } - - // Uh-oh... - else - { - TWAINWorkingGroup.Log.Assert("Unsupported platform..." + ms_platform); - return (STS.BUMMER); - } - - // Uh-oh, the status call failed... - if (sts != STS.SUCCESS) - { - return (a_sts); - } - - // All done... - return ((STS)(STSCC + twstatus.ConditionCode)); - } - - /// - /// 32-bit or 64-bit... - /// - /// Number of bits in the machine word for this process - public static int GetMachineWordBitSize() - { - return ((IntPtr.Size == 4) ? 32 : 64); - } - - /// - /// Quick access to our platform id... - /// - /// - public static Platform GetPlatform() - { - // First pass... - if (ms_blFirstPassGetPlatform) - { - // Dont'c come in here again... - ms_blFirstPassGetPlatform = false; - - // We're Windows... - if (Environment.OSVersion.ToString().Contains("Microsoft Windows")) - { - ms_platform = Platform.WINDOWS; - ms_processor = (GetMachineWordBitSize() == 64) ? Processor.X86_64 : Processor.X86; - } - - // We're Mac OS X (this has to come before LINUX!!!)... - else if (Directory.Exists("/Library/Application Support")) - { - ms_platform = Platform.MACOSX; - ms_processor = (GetMachineWordBitSize() == 64) ? Processor.X86_64 : Processor.X86; - } - - // We're Linux... - else if (Environment.OSVersion.ToString().Contains("Unix")) - { - string szProcessor = ""; - ms_platform = Platform.LINUX; - try - { - Process process = new Process() - { - StartInfo = new ProcessStartInfo() - { - FileName = "uname", - Arguments = "-m", - UseShellExecute = false, - RedirectStandardOutput = true, - CreateNoWindow = true - } - }; - process.Start(); - process.WaitForExit(); - szProcessor = process.StandardOutput.ReadToEnd(); - process.Close(); - } - catch - { - Console.Out.WriteLine("Oh dear, this isn't good...where's uname?"); - } - if (szProcessor.Contains("mips64")) - { - ms_processor = Processor.MIPS64EL; - } - else - { - ms_processor = (GetMachineWordBitSize() == 64) ? Processor.X86_64 : Processor.X86; - } - } - - // We have a problem, Log will throw for us... - else - { - ms_platform = Platform.UNKNOWN; - ms_processor = Processor.UNKNOWN; - TWAINWorkingGroup.Log.Assert("Unsupported platform..." + ms_platform); - } - } - - // All done... - return (ms_platform); - } - - /// - /// Quick access to our processor id... - /// - /// - public static Processor GetProcessor() - { - // First pass... - if (ms_blFirstPassGetPlatform) - { - GetPlatform(); - } - - // All done... - return (ms_processor); - } - - /// - /// Convert the contents of a capability to a string that we can show in - /// our simple GUI... - /// - /// Data type - /// Pointer to the data - /// Index of the item in the data - /// Data in CSV form - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public string GetIndexedItem(TW_CAPABILITY a_twcapability, TWTY a_twty, IntPtr a_intptr, int a_iIndex) - { - IntPtr intptr; - - // Index by type... - switch (a_twty) - { - default: - return ("Get Capability: (unrecognized item type)..." + a_twty); - - case TWTY.INT8: - { - intptr = (IntPtr)((ulong)a_intptr + (ulong)(1 * a_iIndex)); - sbyte i8Value = (sbyte)Marshal.PtrToStructure(intptr, typeof(sbyte)); - return (i8Value.ToString()); - } - - case TWTY.INT16: - { - intptr = (IntPtr)((ulong)a_intptr + (ulong)(2 * a_iIndex)); - short i16Value = (short)Marshal.PtrToStructure(intptr, typeof(short)); - return (i16Value.ToString()); - } - - case TWTY.INT32: - { - intptr = (IntPtr)((ulong)a_intptr + (ulong)(4 * a_iIndex)); - int i32Value = (int)Marshal.PtrToStructure(intptr, typeof(int)); - return (i32Value.ToString()); - } - - case TWTY.UINT8: - { - intptr = (IntPtr)((ulong)a_intptr + (ulong)(1 * a_iIndex)); - byte u8Value = (byte)Marshal.PtrToStructure(intptr, typeof(byte)); - return (u8Value.ToString()); - } - - case TWTY.BOOL: - case TWTY.UINT16: - { - intptr = (IntPtr)((ulong)a_intptr + (ulong)(2 * a_iIndex)); - ushort u16Value = (ushort)Marshal.PtrToStructure(intptr, typeof(ushort)); - return (u16Value.ToString()); - } - - case TWTY.UINT32: - { - intptr = (IntPtr)((ulong)a_intptr + (ulong)(4 * a_iIndex)); - uint u32Value = (uint)Marshal.PtrToStructure(intptr, typeof(uint)); - return (u32Value.ToString()); - } - - case TWTY.FIX32: - { - intptr = (IntPtr)((ulong)a_intptr + (ulong)(4 * a_iIndex)); - TW_FIX32 twfix32 = (TW_FIX32)Marshal.PtrToStructure(intptr, typeof(TW_FIX32)); - return (((double)twfix32.Whole + ((double)twfix32.Frac / 65536.0)).ToString()); - } - - case TWTY.FRAME: - { - CSV csv = new CSV(); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(16 * a_iIndex)); - TW_FRAME twframe = (TW_FRAME)Marshal.PtrToStructure(intptr, typeof(TW_FRAME)); - csv.Add(((double)twframe.Left.Whole + ((double)twframe.Left.Frac / 65536.0)).ToString()); - csv.Add(((double)twframe.Top.Whole + ((double)twframe.Top.Frac / 65536.0)).ToString()); - csv.Add(((double)twframe.Right.Whole + ((double)twframe.Right.Frac / 65536.0)).ToString()); - csv.Add(((double)twframe.Bottom.Whole + ((double)twframe.Bottom.Frac / 65536.0)).ToString()); - return (csv.Get()); - } - - case TWTY.STR32: - { - intptr = (IntPtr)((ulong)a_intptr + (ulong)(34 * a_iIndex)); - TW_STR32 twstr32 = (TW_STR32)Marshal.PtrToStructure(intptr, typeof(TW_STR32)); - return (twstr32.Get()); - } - - case TWTY.STR64: - { - intptr = (IntPtr)((ulong)a_intptr + (ulong)(66 * a_iIndex)); - TW_STR64 twstr64 = (TW_STR64)Marshal.PtrToStructure(intptr, typeof(TW_STR64)); - return (twstr64.Get()); - } - - case TWTY.STR128: - { - intptr = (IntPtr)((ulong)a_intptr + (ulong)(130 * a_iIndex)); - TW_STR128 twstr128 = (TW_STR128)Marshal.PtrToStructure(intptr, typeof(TW_STR128)); - return (twstr128.Get()); - } - - case TWTY.STR255: - { - intptr = (IntPtr)((ulong)a_intptr + (ulong)(256 * a_iIndex)); - TW_STR255 twstr255 = (TW_STR255)Marshal.PtrToStructure(intptr, typeof(TW_STR255)); - return (twstr255.Get()); - } - } - } - - /// - /// Convert the value of a string into a capability... - /// - /// All info on the capability - /// Data type - /// Point to the data - /// Index for item in the data - /// CSV value to be used to set the data - /// Empty string or an error string - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public string SetIndexedItem(TW_CAPABILITY a_twcapability, TWTY a_twty, IntPtr a_intptr, int a_iIndex, string a_szValue) - { - IntPtr intptr; - - // Index by type... - switch (a_twty) - { - default: - return ("Set Capability: (unrecognized item type)..." + a_twty); - - case TWTY.INT8: - { - // We do this to make sure the entire Item value is overwritten... - if (a_twcapability.ConType == TWON.ONEVALUE) - { - int i32Value = sbyte.Parse(CvtCapValueFromEnum(a_twcapability.Cap, a_szValue)); - Marshal.StructureToPtr(i32Value, a_intptr, true); - return (""); - } - // These items have to be packed on the type sizes... - else - { - sbyte i8Value = sbyte.Parse(CvtCapValueFromEnum(a_twcapability.Cap, a_szValue)); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(1 * a_iIndex)); - Marshal.StructureToPtr(i8Value, intptr, true); - return (""); - } - } - - case TWTY.INT16: - { - // We use i32Value to make sure the entire Item value is overwritten... - if (a_twcapability.ConType == TWON.ONEVALUE) - { - int i32Value = short.Parse(CvtCapValueFromEnum(a_twcapability.Cap, a_szValue)); - Marshal.StructureToPtr(i32Value, a_intptr, true); - return (""); - } - // These items have to be packed on the type sizes... - else - { - short i16Value = short.Parse(CvtCapValueFromEnum(a_twcapability.Cap, a_szValue)); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(2 * a_iIndex)); - Marshal.StructureToPtr(i16Value, intptr, true); - return (""); - } - } - - case TWTY.INT32: - { - // Entire value will always be overwritten, so we don't have to get fancy... - int i32Value = int.Parse(CvtCapValueFromEnum(a_twcapability.Cap, a_szValue)); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(4 * a_iIndex)); - Marshal.StructureToPtr(i32Value, intptr, true); - return (""); - } - - case TWTY.UINT8: - { - // We use u32Value to make sure the entire Item value is overwritten... - if (a_twcapability.ConType == TWON.ONEVALUE) - { - uint u32Value = byte.Parse(CvtCapValueFromEnum(a_twcapability.Cap, a_szValue)); - Marshal.StructureToPtr(u32Value, a_intptr, true); - return (""); - } - // These items have to be packed on the type sizes... - else - { - byte u8Value = byte.Parse(CvtCapValueFromEnum(a_twcapability.Cap, a_szValue)); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(1 * a_iIndex)); - Marshal.StructureToPtr(u8Value, intptr, true); - return (""); - } - } - - case TWTY.BOOL: - case TWTY.UINT16: - { - // We use u32Value to make sure the entire Item value is overwritten... - if (a_twcapability.ConType == TWON.ONEVALUE) - { - uint u32Value = ushort.Parse(CvtCapValueFromEnum(a_twcapability.Cap, a_szValue)); - Marshal.StructureToPtr(u32Value, a_intptr, true); - return (""); - } - else - { - ushort u16Value = ushort.Parse(CvtCapValueFromEnum(a_twcapability.Cap, a_szValue)); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(2 * a_iIndex)); - Marshal.StructureToPtr(u16Value, intptr, true); - return (""); - } - } - - case TWTY.UINT32: - { - // Entire value will always be overwritten, so we don't have to get fancy... - uint u32Value = uint.Parse(CvtCapValueFromEnum(a_twcapability.Cap, a_szValue)); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(4 * a_iIndex)); - Marshal.StructureToPtr(u32Value, intptr, true); - return (""); - } - - case TWTY.FIX32: - { - // Entire value will always be overwritten, so we don't have to get fancy... - TW_FIX32 twfix32 = default(TW_FIX32); - twfix32.Whole = (short)Convert.ToDouble(a_szValue); - twfix32.Frac = (ushort)((Convert.ToDouble(a_szValue) - (double)twfix32.Whole) * 65536.0); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(4 * a_iIndex)); - Marshal.StructureToPtr(twfix32, intptr, true); - return (""); - } - - case TWTY.FRAME: - { - TW_FRAME twframe = default(TW_FRAME); - string[] asz = CSV.Parse(a_szValue); - twframe.Left.Whole = (short)Convert.ToDouble(asz[0]); - twframe.Left.Frac = (ushort)((Convert.ToDouble(asz[0]) - (double)twframe.Left.Whole) * 65536.0); - twframe.Top.Whole = (short)Convert.ToDouble(asz[1]); - twframe.Top.Frac = (ushort)((Convert.ToDouble(asz[1]) - (double)twframe.Top.Whole) * 65536.0); - twframe.Right.Whole = (short)Convert.ToDouble(asz[2]); - twframe.Right.Frac = (ushort)((Convert.ToDouble(asz[2]) - (double)twframe.Right.Whole) * 65536.0); - twframe.Bottom.Whole = (short)Convert.ToDouble(asz[3]); - twframe.Bottom.Frac = (ushort)((Convert.ToDouble(asz[3]) - (double)twframe.Bottom.Whole) * 65536.0); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(16 * a_iIndex)); - Marshal.StructureToPtr(twframe, intptr, true); - return (""); - } - - case TWTY.STR32: - { - TW_STR32 twstr32 = default(TW_STR32); - twstr32.Set(a_szValue); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(34 * a_iIndex)); - Marshal.StructureToPtr(twstr32, intptr, true); - return (""); - } - - case TWTY.STR64: - { - TW_STR64 twstr64 = default(TW_STR64); - twstr64.Set(a_szValue); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(66 * a_iIndex)); - Marshal.StructureToPtr(twstr64, intptr, true); - return (""); - } - - case TWTY.STR128: - { - TW_STR128 twstr128 = default(TW_STR128); - twstr128.Set(a_szValue); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(130 * a_iIndex)); - Marshal.StructureToPtr(twstr128, intptr, true); - return (""); - } - - case TWTY.STR255: - { - TW_STR255 twstr255 = default(TW_STR255); - twstr255.Set(a_szValue); - intptr = (IntPtr)((ulong)a_intptr + (ulong)(256 * a_iIndex)); - Marshal.StructureToPtr(twstr255, intptr, true); - return (""); - } - } - } - - /// - /// Convert strings into a range... - /// - /// Data type - /// Pointer to the data - /// List of strings - /// Empty string or an error string - [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust", Unrestricted = false)] - public string SetRangeItem(TWTY a_twty, IntPtr a_intptr, string[] a_asz) - { - TW_RANGE twrange = default(TW_RANGE); - TW_RANGE_MACOSX twrangemacosx = default(TW_RANGE_MACOSX); - TW_RANGE_LINUX64 twrangelinux64 = default(TW_RANGE_LINUX64); - TW_RANGE_FIX32 twrangefix32 = default(TW_RANGE_FIX32); - TW_RANGE_FIX32_MACOSX twrangefix32macosx = default(TW_RANGE_FIX32_MACOSX); - - // Index by type... - switch (a_twty) - { - default: - return ("Set Capability: (unrecognized item type)..." + a_twty); - - case TWTY.INT8: - { - if (ms_platform == Platform.MACOSX) - { - twrangemacosx.ItemType = (uint)a_twty; - twrangemacosx.MinValue = (uint)sbyte.Parse(a_asz[3]); - twrangemacosx.MaxValue = (uint)sbyte.Parse(a_asz[4]); - twrangemacosx.StepSize = (uint)sbyte.Parse(a_asz[5]); - twrangemacosx.DefaultValue = (uint)sbyte.Parse(a_asz[6]); - twrangemacosx.CurrentValue = (uint)sbyte.Parse(a_asz[7]); - Marshal.StructureToPtr(twrangemacosx, a_intptr, true); - } - else if ((m_linuxdsm == LinuxDsm.Unknown) || (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - twrange.ItemType = a_twty; - twrange.MinValue = (uint)sbyte.Parse(a_asz[3]); - twrange.MaxValue = (uint)sbyte.Parse(a_asz[4]); - twrange.StepSize = (uint)sbyte.Parse(a_asz[5]); - twrange.DefaultValue = (uint)sbyte.Parse(a_asz[6]); - twrange.CurrentValue = (uint)sbyte.Parse(a_asz[7]); - Marshal.StructureToPtr(twrange, a_intptr, true); - } - else - { - twrangelinux64.ItemType = a_twty; - twrangelinux64.MinValue = (uint)sbyte.Parse(a_asz[3]); - twrangelinux64.MaxValue = (uint)sbyte.Parse(a_asz[4]); - twrangelinux64.StepSize = (uint)sbyte.Parse(a_asz[5]); - twrangelinux64.DefaultValue = (uint)sbyte.Parse(a_asz[6]); - twrangelinux64.CurrentValue = (uint)sbyte.Parse(a_asz[7]); - Marshal.StructureToPtr(twrangelinux64, a_intptr, true); - } - return (""); - } - - case TWTY.INT16: - { - if (ms_platform == Platform.MACOSX) - { - twrangemacosx.ItemType = (uint)a_twty; - twrangemacosx.MinValue = (uint)short.Parse(a_asz[3]); - twrangemacosx.MaxValue = (uint)short.Parse(a_asz[4]); - twrangemacosx.StepSize = (uint)short.Parse(a_asz[5]); - twrangemacosx.DefaultValue = (uint)short.Parse(a_asz[6]); - twrangemacosx.CurrentValue = (uint)short.Parse(a_asz[7]); - Marshal.StructureToPtr(twrangemacosx, a_intptr, true); - } - else if ((m_linuxdsm == LinuxDsm.Unknown) || (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - twrange.ItemType = a_twty; - twrange.MinValue = (uint)short.Parse(a_asz[3]); - twrange.MaxValue = (uint)short.Parse(a_asz[4]); - twrange.StepSize = (uint)short.Parse(a_asz[5]); - twrange.DefaultValue = (uint)short.Parse(a_asz[6]); - twrange.CurrentValue = (uint)short.Parse(a_asz[7]); - Marshal.StructureToPtr(twrange, a_intptr, true); - } - else - { - twrangelinux64.ItemType = a_twty; - twrangelinux64.MinValue = (uint)short.Parse(a_asz[3]); - twrangelinux64.MaxValue = (uint)short.Parse(a_asz[4]); - twrangelinux64.StepSize = (uint)short.Parse(a_asz[5]); - twrangelinux64.DefaultValue = (uint)short.Parse(a_asz[6]); - twrangelinux64.CurrentValue = (uint)short.Parse(a_asz[7]); - Marshal.StructureToPtr(twrangelinux64, a_intptr, true); - } - return (""); - } - - case TWTY.INT32: - { - if (ms_platform == Platform.MACOSX) - { - twrangemacosx.ItemType = (uint)a_twty; - twrangemacosx.MinValue = (uint)int.Parse(a_asz[3]); - twrangemacosx.MaxValue = (uint)int.Parse(a_asz[4]); - twrangemacosx.StepSize = (uint)int.Parse(a_asz[5]); - twrangemacosx.DefaultValue = (uint)int.Parse(a_asz[6]); - twrangemacosx.CurrentValue = (uint)int.Parse(a_asz[7]); - Marshal.StructureToPtr(twrangemacosx, a_intptr, true); - } - else if ((m_linuxdsm == LinuxDsm.Unknown) || (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - twrange.ItemType = a_twty; - twrange.MinValue = (uint)int.Parse(a_asz[3]); - twrange.MaxValue = (uint)int.Parse(a_asz[4]); - twrange.StepSize = (uint)int.Parse(a_asz[5]); - twrange.DefaultValue = (uint)int.Parse(a_asz[6]); - twrange.CurrentValue = (uint)int.Parse(a_asz[7]); - Marshal.StructureToPtr(twrange, a_intptr, true); - } - else - { - twrangelinux64.ItemType = a_twty; - twrangelinux64.MinValue = (uint)int.Parse(a_asz[3]); - twrangelinux64.MaxValue = (uint)int.Parse(a_asz[4]); - twrangelinux64.StepSize = (uint)int.Parse(a_asz[5]); - twrangelinux64.DefaultValue = (uint)int.Parse(a_asz[6]); - twrangelinux64.CurrentValue = (uint)int.Parse(a_asz[7]); - Marshal.StructureToPtr(twrangelinux64, a_intptr, true); - } - return (""); - } - - case TWTY.UINT8: - { - if (ms_platform == Platform.MACOSX) - { - twrangemacosx.ItemType = (uint)a_twty; - twrangemacosx.MinValue = (uint)byte.Parse(a_asz[3]); - twrangemacosx.MaxValue = (uint)byte.Parse(a_asz[4]); - twrangemacosx.StepSize = (uint)byte.Parse(a_asz[5]); - twrangemacosx.DefaultValue = (uint)byte.Parse(a_asz[6]); - twrangemacosx.CurrentValue = (uint)byte.Parse(a_asz[7]); - Marshal.StructureToPtr(twrangemacosx, a_intptr, true); - } - else if ((m_linuxdsm == LinuxDsm.Unknown) || (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - twrange.ItemType = a_twty; - twrange.MinValue = (uint)byte.Parse(a_asz[3]); - twrange.MaxValue = (uint)byte.Parse(a_asz[4]); - twrange.StepSize = (uint)byte.Parse(a_asz[5]); - twrange.DefaultValue = (uint)byte.Parse(a_asz[6]); - twrange.CurrentValue = (uint)byte.Parse(a_asz[7]); - Marshal.StructureToPtr(twrange, a_intptr, true); - } - else - { - twrangelinux64.ItemType = a_twty; - twrangelinux64.MinValue = (uint)byte.Parse(a_asz[3]); - twrangelinux64.MaxValue = (uint)byte.Parse(a_asz[4]); - twrangelinux64.StepSize = (uint)byte.Parse(a_asz[5]); - twrangelinux64.DefaultValue = (uint)byte.Parse(a_asz[6]); - twrangelinux64.CurrentValue = (uint)byte.Parse(a_asz[7]); - Marshal.StructureToPtr(twrangelinux64, a_intptr, true); - } - return (""); - } - - case TWTY.BOOL: - case TWTY.UINT16: - { - if (ms_platform == Platform.MACOSX) - { - twrangemacosx.ItemType = (uint)a_twty; - twrangemacosx.MinValue = (uint)ushort.Parse(a_asz[3]); - twrangemacosx.MaxValue = (uint)ushort.Parse(a_asz[4]); - twrangemacosx.StepSize = (uint)ushort.Parse(a_asz[5]); - twrangemacosx.DefaultValue = (uint)ushort.Parse(a_asz[6]); - twrangemacosx.CurrentValue = (uint)ushort.Parse(a_asz[7]); - Marshal.StructureToPtr(twrangemacosx, a_intptr, true); - } - else if ((m_linuxdsm == LinuxDsm.Unknown) || (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - twrange.ItemType = a_twty; - twrange.MinValue = (uint)ushort.Parse(a_asz[3]); - twrange.MaxValue = (uint)ushort.Parse(a_asz[4]); - twrange.StepSize = (uint)ushort.Parse(a_asz[5]); - twrange.DefaultValue = (uint)ushort.Parse(a_asz[6]); - twrange.CurrentValue = (uint)ushort.Parse(a_asz[7]); - Marshal.StructureToPtr(twrange, a_intptr, true); - } - else - { - twrangelinux64.ItemType = a_twty; - twrangelinux64.MinValue = (uint)ushort.Parse(a_asz[3]); - twrangelinux64.MaxValue = (uint)ushort.Parse(a_asz[4]); - twrangelinux64.StepSize = (uint)ushort.Parse(a_asz[5]); - twrangelinux64.DefaultValue = (uint)ushort.Parse(a_asz[6]); - twrangelinux64.CurrentValue = (uint)ushort.Parse(a_asz[7]); - Marshal.StructureToPtr(twrangelinux64, a_intptr, true); - } - return (""); - } - - case TWTY.UINT32: - { - if (ms_platform == Platform.MACOSX) - { - twrangemacosx.ItemType = (uint)a_twty; - twrangemacosx.MinValue = uint.Parse(a_asz[3]); - twrangemacosx.MaxValue = uint.Parse(a_asz[4]); - twrangemacosx.StepSize = uint.Parse(a_asz[5]); - twrangemacosx.DefaultValue = uint.Parse(a_asz[6]); - twrangemacosx.CurrentValue = uint.Parse(a_asz[7]); - Marshal.StructureToPtr(twrangemacosx, a_intptr, true); - } - else if ((m_linuxdsm == LinuxDsm.Unknown) || (m_linuxdsm == LinuxDsm.IsLatestDsm)) - { - twrange.ItemType = a_twty; - twrange.MinValue = uint.Parse(a_asz[3]); - twrange.MaxValue = uint.Parse(a_asz[4]); - twrange.StepSize = uint.Parse(a_asz[5]); - twrange.DefaultValue = uint.Parse(a_asz[6]); - twrange.CurrentValue = uint.Parse(a_asz[7]); - Marshal.StructureToPtr(twrange, a_intptr, true); - } - else - { - twrangelinux64.ItemType = a_twty; - twrangelinux64.MinValue = uint.Parse(a_asz[3]); - twrangelinux64.MaxValue = uint.Parse(a_asz[4]); - twrangelinux64.StepSize = uint.Parse(a_asz[5]); - twrangelinux64.DefaultValue = uint.Parse(a_asz[6]); - twrangelinux64.CurrentValue = uint.Parse(a_asz[7]); - Marshal.StructureToPtr(twrangelinux64, a_intptr, true); - } - return (""); - } - - case TWTY.FIX32: - { - double dMinValue = Convert.ToDouble(a_asz[3]); - double dMaxValue = Convert.ToDouble(a_asz[4]); - double dStepSize = Convert.ToDouble(a_asz[5]); - double dDefaultValue = Convert.ToDouble(a_asz[6]); - double dCurrentValue = Convert.ToDouble(a_asz[7]); - if (ms_platform == Platform.MACOSX) - { - twrangefix32macosx.ItemType = (uint)a_twty; - twrangefix32macosx.MinValue.Whole = (short)dMinValue; - twrangefix32macosx.MinValue.Frac = (ushort)((dMinValue - (double)twrangefix32macosx.MinValue.Whole) * 65536.0); - twrangefix32macosx.MaxValue.Whole = (short)dMaxValue; - twrangefix32macosx.MaxValue.Frac = (ushort)((dMaxValue - (double)twrangefix32macosx.MaxValue.Whole) * 65536.0); - twrangefix32macosx.StepSize.Whole = (short)dStepSize; - twrangefix32macosx.StepSize.Frac = (ushort)((dStepSize - (double)twrangefix32macosx.StepSize.Whole) * 65536.0); - twrangefix32macosx.DefaultValue.Whole = (short)dDefaultValue; - twrangefix32macosx.DefaultValue.Frac = (ushort)((dDefaultValue - (double)twrangefix32macosx.DefaultValue.Whole) * 65536.0); - twrangefix32macosx.CurrentValue.Whole = (short)dCurrentValue; - twrangefix32macosx.CurrentValue.Frac = (ushort)((dCurrentValue - (double)twrangefix32macosx.CurrentValue.Whole) * 65536.0); - Marshal.StructureToPtr(twrangefix32macosx, a_intptr, true); - } - else - { - twrangefix32.ItemType = a_twty; - twrangefix32.MinValue.Whole = (short)dMinValue; - twrangefix32.MinValue.Frac = (ushort)((dMinValue - (double)twrangefix32.MinValue.Whole) * 65536.0); - twrangefix32.MaxValue.Whole = (short)dMaxValue; - twrangefix32.MaxValue.Frac = (ushort)((dMaxValue - (double)twrangefix32.MaxValue.Whole) * 65536.0); - twrangefix32.StepSize.Whole = (short)dStepSize; - twrangefix32.StepSize.Frac = (ushort)((dStepSize - (double)twrangefix32.StepSize.Whole) * 65536.0); - twrangefix32.DefaultValue.Whole = (short)dDefaultValue; - twrangefix32.DefaultValue.Frac = (ushort)((dDefaultValue - (double)twrangefix32.DefaultValue.Whole) * 65536.0); - twrangefix32.CurrentValue.Whole = (short)dCurrentValue; - twrangefix32.CurrentValue.Frac = (ushort)((dCurrentValue - (double)twrangefix32.CurrentValue.Whole) * 65536.0); - Marshal.StructureToPtr(twrangefix32, a_intptr, true); - } - return (""); - } - } - } - - /// - /// Our callback delegate for Windows... - /// - /// Origin of message - /// Message target - /// Data group - /// Data argument type - /// Operation - /// NULL pointer - /// TWAIN status - private UInt16 WindowsDsmEntryCallbackProxy - ( - ref TW_IDENTITY_LEGACY origin, - ref TW_IDENTITY_LEGACY dest, - DG dg, - DAT dat, - MSG msg, - IntPtr twnull - ) - { - ProcessEvent(msg); - return ((UInt16)STS.SUCCESS); - } - - /// - /// Our callback delegate for Linux... - /// - /// Origin of message - /// Message target - /// Data group - /// Data argument type - /// Operation - /// NULL pointer - /// TWAIN status - private UInt16 LinuxDsmEntryCallbackProxy - ( - ref TW_IDENTITY_LEGACY origin, - ref TW_IDENTITY_LEGACY dest, - DG dg, - DAT dat, - MSG msg, - IntPtr twnull - ) - { - ProcessEvent(msg); - return ((UInt16)STS.SUCCESS); - } - - /// - /// Our callback delegate for Mac OS X... - /// - /// Origin of message - /// Message target - /// Data group - /// Data argument type - /// Operation - /// NULL pointer - /// TWAIN status - private UInt16 MacosxDsmEntryCallbackProxy - ( - ref TW_IDENTITY_MACOSX origin, - ref TW_IDENTITY_MACOSX dest, - DG dg, - DAT dat, - MSG msg, - IntPtr twnull - ) - { - ProcessEvent(msg); - return ((UInt16)STS.SUCCESS); - } - - /// - /// Get .NET 'Bitmap' object from memory DIB via stream constructor. - /// This should work for most DIBs. - /// - /// Our operating system - /// The pointer to something (presumably a BITMAP or a TIFF image) - /// C# Bitmap of image - private Bitmap NativeToBitmap(Platform a_platform, IntPtr a_intptrNative) - { - ushort u16Magic; - IntPtr intptrNative; - - // We need the first two bytes to decide if we have a DIB or a TIFF. Don't - // forget to lock the silly thing... - intptrNative = DsmMemLock(a_intptrNative); - u16Magic = (ushort)Marshal.PtrToStructure(intptrNative, typeof(ushort)); - - // Windows uses a DIB, the first usigned short is 40... - if (u16Magic == 40) - { - byte[] bBitmap; - BITMAPFILEHEADER bitmapfileheader; - BITMAPINFOHEADER bitmapinfoheader; - - // Our incoming DIB is a bitmap info header... - bitmapinfoheader = (BITMAPINFOHEADER)Marshal.PtrToStructure(intptrNative, typeof(BITMAPINFOHEADER)); - - // Build our file header... - bitmapfileheader = new BITMAPFILEHEADER(); - bitmapfileheader.bfType = 0x4D42; // "BM" - bitmapfileheader.bfSize - = (uint)Marshal.SizeOf(typeof(BITMAPFILEHEADER)) + - bitmapinfoheader.biSize + - (bitmapinfoheader.biClrUsed * 4) + - bitmapinfoheader.biSizeImage; - bitmapfileheader.bfOffBits - = (uint)Marshal.SizeOf(typeof(BITMAPFILEHEADER)) + - bitmapinfoheader.biSize + - (bitmapinfoheader.biClrUsed * 4); - - // Copy the file header into our byte array... - IntPtr intptr = Marshal.AllocHGlobal(Marshal.SizeOf(bitmapfileheader)); - Marshal.StructureToPtr(bitmapfileheader, intptr, true); - bBitmap = new byte[bitmapfileheader.bfSize]; - Marshal.Copy(intptr, bBitmap, 0, Marshal.SizeOf(bitmapfileheader)); - Marshal.FreeHGlobal(intptr); - intptr = IntPtr.Zero; - - // Copy the rest of the DIB into our byte array...... - Marshal.Copy(intptrNative, bBitmap, Marshal.SizeOf(typeof(BITMAPFILEHEADER)), (int)bitmapfileheader.bfSize - Marshal.SizeOf(typeof(BITMAPFILEHEADER))); - - // Now we can turn the in-memory bitmap file into a Bitmap object... - MemoryStream memorystream = new MemoryStream(bBitmap); - - // Unfortunately the stream has to be kept with the bitmap... - Bitmap bitmapStream = new Bitmap(memorystream); - - // So we make a copy (ick)... - Bitmap bitmap; - switch (bitmapinfoheader.biBitCount) - { - default: - case 24: - bitmap = bitmapStream.Clone(new Rectangle(0, 0, bitmapStream.Width, bitmapStream.Height), System.Drawing.Imaging.PixelFormat.Format24bppRgb); - break; - case 8: - bitmap = bitmapStream.Clone(new Rectangle(0, 0, bitmapStream.Width, bitmapStream.Height), System.Drawing.Imaging.PixelFormat.Format8bppIndexed); - break; - case 1: - bitmap = bitmapStream.Clone(new Rectangle(0, 0, bitmapStream.Width, bitmapStream.Height), System.Drawing.Imaging.PixelFormat.Format1bppIndexed); - break; - } - - // Fix the resolution... - bitmap.SetResolution((int)(bitmap.HorizontalResolution + 0.5), (int)(bitmap.VerticalResolution + 0.5)); - - // Cleanup... - //bitmapStream.Dispose(); - //memorystream.Close(); - bitmapStream = null; - memorystream = null; - bBitmap = null; - - // Return our bitmap... - DsmMemUnlock(a_intptrNative); - return (bitmap); - } - - // Linux and Mac OS X use TIFF. We'll handle a simple Intel TIFF ("II")... - else if (u16Magic == 0x4949) - { - int iTiffSize; - ulong u64; - ulong u64Pointer; - ulong u64TiffHeaderSize; - ulong u64TiffTagSize; - byte[] abTiff; - TIFFHEADER tiffheader; - TIFFTAG tifftag; - - // Init stuff... - tiffheader = new TIFFHEADER(); - tifftag = new TIFFTAG(); - u64TiffHeaderSize = (ulong)Marshal.SizeOf(tiffheader); - u64TiffTagSize = (ulong)Marshal.SizeOf(tifftag); - - // Find the size of the image so we can turn it into a memory stream... - iTiffSize = 0; - tiffheader = (TIFFHEADER)Marshal.PtrToStructure(intptrNative, typeof(TIFFHEADER)); - for (u64 = 0; u64 < 999; u64++) - { - u64Pointer = (ulong)intptrNative + u64TiffHeaderSize + (u64TiffTagSize * u64); - tifftag = (TIFFTAG)Marshal.PtrToStructure((IntPtr)u64Pointer, typeof(TIFFTAG)); - - // StripOffsets... - if (tifftag.u16Tag == 273) - { - iTiffSize += (int)tifftag.u32Value; - } - - // StripByteCounts... - if (tifftag.u16Tag == 279) - { - iTiffSize += (int)tifftag.u32Value; - } - } - - // No joy... - if (iTiffSize == 0) - { - DsmMemUnlock(a_intptrNative); - return (null); - } - - // Copy the data to our byte array... - abTiff = new byte[iTiffSize]; - Marshal.Copy(intptrNative, abTiff, 0, iTiffSize); - - // Move the image into a memory stream... - MemoryStream memorystream = new MemoryStream(abTiff); - - // Turn the memory stream into an in-memory TIFF image... - Image imageTiff = Image.FromStream(memorystream); - - // Convert the in-memory tiff to a Bitmap object... - Bitmap bitmap = new Bitmap(imageTiff); - - // Cleanup... - abTiff = null; - memorystream = null; - imageTiff = null; - - // Return our bitmap... - DsmMemUnlock(a_intptrNative); - return (bitmap); - } - - // Uh-oh... - DsmMemUnlock(a_intptrNative); - return (null); - } - - /// - /// Get .NET 'Bitmap' object from memory DIB via stream constructor. - /// This should work for most DIBs. - /// - /// The pointer to something (presumably a BITMAP or a TIFF image) - /// C# Bitmap of image - public byte[] NativeToByteArray(IntPtr a_intptrNative, bool a_blIsHandle, out int a_iHeaderBytes) - { - ushort u16Magic; - UIntPtr uintptrBytes; - IntPtr intptrNative; - - // Init stuff... - a_iHeaderBytes = 0; - - // Give ourselves what protection we can... - try - { - // We need the first two bytes to decide if we have a DIB or a TIFF. Don't - // forget to lock the silly thing... - intptrNative = a_blIsHandle ? DsmMemLock(a_intptrNative) : a_intptrNative; - u16Magic = (ushort)Marshal.PtrToStructure(intptrNative, typeof(ushort)); - - // Windows uses a DIB, the first unsigned short is 40... - if (u16Magic == 40) - { - byte[] abBitmap; - BITMAPFILEHEADER bitmapfileheader; - BITMAPINFOHEADER bitmapinfoheader; - - // Our incoming DIB is a bitmap info header... - bitmapinfoheader = (BITMAPINFOHEADER)Marshal.PtrToStructure(intptrNative, typeof(BITMAPINFOHEADER)); - - // Build our file header... - bitmapfileheader = new BITMAPFILEHEADER(); - bitmapfileheader.bfType = 0x4D42; // "BM" - bitmapfileheader.bfSize - = (uint)Marshal.SizeOf(typeof(BITMAPFILEHEADER)) + - bitmapinfoheader.biSize + - (bitmapinfoheader.biClrUsed * 4) + - bitmapinfoheader.biSizeImage; - bitmapfileheader.bfOffBits - = (uint)Marshal.SizeOf(typeof(BITMAPFILEHEADER)) + - bitmapinfoheader.biSize + - (bitmapinfoheader.biClrUsed * 4); - - // Copy the file header into our byte array... - IntPtr intptr = Marshal.AllocHGlobal(Marshal.SizeOf(bitmapfileheader)); - Marshal.StructureToPtr(bitmapfileheader, intptr, true); - abBitmap = new byte[bitmapfileheader.bfSize]; - Marshal.Copy(intptr, abBitmap, 0, Marshal.SizeOf(bitmapfileheader)); - Marshal.FreeHGlobal(intptr); - intptr = IntPtr.Zero; - - // Copy the rest of the DIB into our byte array... - a_iHeaderBytes = (int)bitmapfileheader.bfOffBits; - Marshal.Copy(intptrNative, abBitmap, Marshal.SizeOf(typeof(BITMAPFILEHEADER)), (int)bitmapfileheader.bfSize - Marshal.SizeOf(typeof(BITMAPFILEHEADER))); - - // Unlock the handle, and return our byte array... - if (a_blIsHandle) - { - DsmMemUnlock(a_intptrNative); - } - return (abBitmap); - } - - // Linux and Mac OS X use TIFF. We'll handle a simple Intel TIFF ("II")... - else if (u16Magic == 0x4949) - { - int iTiffSize; - ulong u64; - ulong u64Pointer; - ulong u64TiffHeaderSize; - ulong u64TiffTagSize; - byte[] abTiff; - TIFFHEADER tiffheader; - TIFFTAG tifftag; - - // Init stuff... - tiffheader = new TIFFHEADER(); - tifftag = new TIFFTAG(); - u64TiffHeaderSize = (ulong)Marshal.SizeOf(tiffheader); - u64TiffTagSize = (ulong)Marshal.SizeOf(tifftag); - - // Find the size of the image so we can turn it into a byte array... - iTiffSize = 0; - tiffheader = (TIFFHEADER)Marshal.PtrToStructure(intptrNative, typeof(TIFFHEADER)); - for (u64 = 0; u64 < 999; u64++) - { - u64Pointer = (ulong)intptrNative + u64TiffHeaderSize + (u64TiffTagSize * u64); - tifftag = (TIFFTAG)Marshal.PtrToStructure((IntPtr)u64Pointer, typeof(TIFFTAG)); - - // StripOffsets... - if (tifftag.u16Tag == 273) - { - iTiffSize += (int)tifftag.u32Value; - a_iHeaderBytes = (int)tifftag.u32Value; - } - - // StripByteCounts... - if (tifftag.u16Tag == 279) - { - iTiffSize += (int)tifftag.u32Value; - } - } - - // No joy... - if (iTiffSize == 0) - { - if (a_blIsHandle) - { - DsmMemUnlock(a_intptrNative); - } - return (null); - } - - // Copy the data to our byte array... - abTiff = new byte[iTiffSize]; - Marshal.Copy(intptrNative, abTiff, 0, iTiffSize); - - // Unlock the handle, and return our byte array... - if (a_blIsHandle) - { - DsmMemUnlock(a_intptrNative); - } - return (abTiff); - } - - // As long as we're here, let's handle JFIF (JPEG) too, - // this can never be a handle... - else if (u16Magic == 0xFFD8) - { - byte[] abJfif; - - // We need the size of this memory block... - switch (GetPlatform()) - { - default: - Log.Error("Really? <" + GetPlatform() + ">"); - return (null); - case Platform.WINDOWS: - uintptrBytes = NativeMethods._msize(a_intptrNative); - break; - case Platform.LINUX: - uintptrBytes = NativeMethods.malloc_usable_size(a_intptrNative); - break; - case Platform.MACOSX: - uintptrBytes = NativeMethods.malloc_size(a_intptrNative); - break; - } - abJfif = new byte[(int)uintptrBytes]; - Marshal.Copy(a_intptrNative, abJfif, 0, (int)(int)uintptrBytes); - return (abJfif); - } - } - catch (Exception exception) - { - Log.Error("NativeToByteArray threw an exceptions - " + exception.Message); - } - - // Byte-bye... - DsmMemUnlock(a_intptrNative); - return (null); - } - - /// - /// Convert a public identity to a legacy identity... - /// - /// Identity to convert - /// Legacy form of identity - private TW_IDENTITY_LEGACY TwidentityToTwidentitylegacy(TW_IDENTITY a_twidentity) - { - TW_IDENTITY_LEGACY twidentitylegacy = new TW_IDENTITY_LEGACY(); - twidentitylegacy.Id = (uint)a_twidentity.Id; - twidentitylegacy.Manufacturer = a_twidentity.Manufacturer; - twidentitylegacy.ProductFamily = a_twidentity.ProductFamily; - twidentitylegacy.ProductName = a_twidentity.ProductName; - twidentitylegacy.ProtocolMajor = a_twidentity.ProtocolMajor; - twidentitylegacy.ProtocolMinor = a_twidentity.ProtocolMinor; - twidentitylegacy.SupportedGroups = a_twidentity.SupportedGroups; - twidentitylegacy.Version.Country = a_twidentity.Version.Country; - twidentitylegacy.Version.Info = a_twidentity.Version.Info; - twidentitylegacy.Version.Language = a_twidentity.Version.Language; - twidentitylegacy.Version.MajorNum = a_twidentity.Version.MajorNum; - twidentitylegacy.Version.MinorNum = a_twidentity.Version.MinorNum; - return (twidentitylegacy); - } - - /// - /// Convert a public identity to a linux64 identity... - /// - /// Identity to convert - /// Linux64 form of identity - private TW_IDENTITY_LINUX64 TwidentityToTwidentitylinux64(TW_IDENTITY a_twidentity) - { - TW_IDENTITY_LINUX64 twidentitylinux64 = new TW_IDENTITY_LINUX64(); - twidentitylinux64.Id = a_twidentity.Id; - twidentitylinux64.Manufacturer = a_twidentity.Manufacturer; - twidentitylinux64.ProductFamily = a_twidentity.ProductFamily; - twidentitylinux64.ProductName = a_twidentity.ProductName; - twidentitylinux64.ProtocolMajor = a_twidentity.ProtocolMajor; - twidentitylinux64.ProtocolMinor = a_twidentity.ProtocolMinor; - twidentitylinux64.SupportedGroups = a_twidentity.SupportedGroups; - twidentitylinux64.Version.Country = a_twidentity.Version.Country; - twidentitylinux64.Version.Info = a_twidentity.Version.Info; - twidentitylinux64.Version.Language = a_twidentity.Version.Language; - twidentitylinux64.Version.MajorNum = a_twidentity.Version.MajorNum; - twidentitylinux64.Version.MinorNum = a_twidentity.Version.MinorNum; - return (twidentitylinux64); - } - - /// - /// Convert a public identity to a macosx identity... - /// - /// Identity to convert - /// Mac OS X form of identity - public static TW_IDENTITY_MACOSX TwidentityToTwidentitymacosx(TW_IDENTITY a_twidentity) - { - TW_IDENTITY_MACOSX twidentitymacosx = new TW_IDENTITY_MACOSX(); - twidentitymacosx.Id = (uint)a_twidentity.Id; - twidentitymacosx.Manufacturer = a_twidentity.Manufacturer; - twidentitymacosx.ProductFamily = a_twidentity.ProductFamily; - twidentitymacosx.ProductName = a_twidentity.ProductName; - twidentitymacosx.ProtocolMajor = a_twidentity.ProtocolMajor; - twidentitymacosx.ProtocolMinor = a_twidentity.ProtocolMinor; - twidentitymacosx.SupportedGroups = a_twidentity.SupportedGroups; - twidentitymacosx.Version.Country = a_twidentity.Version.Country; - twidentitymacosx.Version.Info = a_twidentity.Version.Info; - twidentitymacosx.Version.Language = a_twidentity.Version.Language; - twidentitymacosx.Version.MajorNum = a_twidentity.Version.MajorNum; - twidentitymacosx.Version.MinorNum = a_twidentity.Version.MinorNum; - return (twidentitymacosx); - } - - /// - /// Convert a legacy identity to a public identity... - /// - /// Legacy identity to convert - /// Regular form of identity - private TW_IDENTITY TwidentitylegacyToTwidentity(TW_IDENTITY_LEGACY a_twidentitylegacy) - { - TW_IDENTITY twidentity = new TW_IDENTITY(); - twidentity.Id = a_twidentitylegacy.Id; - twidentity.Manufacturer = a_twidentitylegacy.Manufacturer; - twidentity.ProductFamily = a_twidentitylegacy.ProductFamily; - twidentity.ProductName = a_twidentitylegacy.ProductName; - twidentity.ProtocolMajor = a_twidentitylegacy.ProtocolMajor; - twidentity.ProtocolMinor = a_twidentitylegacy.ProtocolMinor; - twidentity.SupportedGroups = a_twidentitylegacy.SupportedGroups; - twidentity.Version.Country = a_twidentitylegacy.Version.Country; - twidentity.Version.Info = a_twidentitylegacy.Version.Info; - twidentity.Version.Language = a_twidentitylegacy.Version.Language; - twidentity.Version.MajorNum = a_twidentitylegacy.Version.MajorNum; - twidentity.Version.MinorNum = a_twidentitylegacy.Version.MinorNum; - return (twidentity); - } - - /// - /// Convert a linux64 identity to a public identity... - /// - /// Legacy identity to convert - /// Regular form of identity - private TW_IDENTITY Twidentitylinux64ToTwidentity(TW_IDENTITY_LINUX64 a_twidentitylinux64) - { - TW_IDENTITY twidentity = new TW_IDENTITY(); - twidentity.Id = a_twidentitylinux64.Id; - twidentity.Manufacturer = a_twidentitylinux64.Manufacturer; - twidentity.ProductFamily = a_twidentitylinux64.ProductFamily; - twidentity.ProductName = a_twidentitylinux64.ProductName; - twidentity.ProtocolMajor = a_twidentitylinux64.ProtocolMajor; - twidentity.ProtocolMinor = a_twidentitylinux64.ProtocolMinor; - twidentity.SupportedGroups = (uint)a_twidentitylinux64.SupportedGroups; - twidentity.Version.Country = a_twidentitylinux64.Version.Country; - twidentity.Version.Info = a_twidentitylinux64.Version.Info; - twidentity.Version.Language = a_twidentitylinux64.Version.Language; - twidentity.Version.MajorNum = a_twidentitylinux64.Version.MajorNum; - twidentity.Version.MinorNum = a_twidentitylinux64.Version.MinorNum; - return (twidentity); - } - - /// - /// Convert a macosx identity to a public identity... - /// - /// Mac OS X identity to convert - /// Regular identity - private TW_IDENTITY TwidentitymacosxToTwidentity(TW_IDENTITY_MACOSX a_twidentitymacosx) - { - TW_IDENTITY twidentity = new TW_IDENTITY(); - twidentity.Id = a_twidentitymacosx.Id; - twidentity.Manufacturer = a_twidentitymacosx.Manufacturer; - twidentity.ProductFamily = a_twidentitymacosx.ProductFamily; - twidentity.ProductName = a_twidentitymacosx.ProductName; - twidentity.ProtocolMajor = a_twidentitymacosx.ProtocolMajor; - twidentity.ProtocolMinor = a_twidentitymacosx.ProtocolMinor; - twidentity.SupportedGroups = a_twidentitymacosx.SupportedGroups; - twidentity.Version.Country = a_twidentitymacosx.Version.Country; - twidentity.Version.Info = a_twidentitymacosx.Version.Info; - twidentity.Version.Language = a_twidentitymacosx.Version.Language; - twidentity.Version.MajorNum = a_twidentitymacosx.Version.MajorNum; - twidentity.Version.MinorNum = a_twidentitymacosx.Version.MinorNum; - return (twidentity); - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Private Structures, things we need for the thread, and to support stuff - // like DAT_IMAGENATIVEXFER... - /////////////////////////////////////////////////////////////////////////////// - #region Private Structures... - - /// - /// The data we share with the thread... - /// - [SuppressMessage("Microsoft.Design", "CA1049:TypesThatOwnNativeResourcesShouldBeDisposable")] - private struct ThreadData - { - // The state of the structure... - public bool blIsInuse; - public bool blIsComplete; - public bool blExitThread; - - // Command... - public DG dg; - public DAT dat; - public MSG msg; - public STATE stateRollback; - public bool blRollback; - - // Payload... - public IntPtr intptrHwnd; - public IntPtr intptrBitmap; - public IntPtr intptrAudio; - public IntPtr twmemref; - public Bitmap bitmap; - public bool blUseBitmapHandle; - public UInt32 twuint32; - public TW_AUDIOINFO twaudioinfo; - public TW_CALLBACK twcallback; - public TW_CALLBACK2 twcallback2; - public TW_CAPABILITY twcapability; - public TW_CIECOLOR twciecolor; - public TW_CUSTOMDSDATA twcustomdsdata; - public TW_DEVICEEVENT twdeviceevent; - public TW_ENTRYPOINT twentrypoint; - public TW_EVENT twevent; - public TW_EXTIMAGEINFO twextimageinfo; - public TW_FILESYSTEM twfilesystem; - public TW_FILTER twfilter; - public TW_GRAYRESPONSE twgrayresponse; - public TW_IDENTITY twidentity; - public TW_IDENTITY_LEGACY twidentitylegacy; - public TW_IMAGEINFO twimageinfo; - public TW_IMAGELAYOUT twimagelayout; - public TW_IMAGEMEMXFER twimagememxfer; - public TW_JPEGCOMPRESSION twjpegcompression; - public TW_METRICS twmetrics; - public TW_MEMORY twmemory; - public TW_PALETTE8 twpalette8; - public TW_PASSTHRU twpassthru; - public TW_PENDINGXFERS twpendingxfers; - public TW_RGBRESPONSE twrgbresponse; - public TW_SETUPFILEXFER twsetupfilexfer; - public TW_SETUPMEMXFER twsetupmemxfer; - public TW_STATUS twstatus; - public TW_STATUSUTF8 twstatusutf8; - public TW_TWAINDIRECT twtwaindirect; - public TW_USERINTERFACE twuserinterface; - - // Result... - public STS sts; - } - - /// - /// The Windows Point structure. - /// Needed for the PreFilterMessage function when we're - /// handling DAT_EVENT... - /// - [StructLayout(LayoutKind.Sequential, Pack = 1)] - private struct POINT - { - public int X; - public int Y; - } - - /// - /// The Windows MSG structure. - /// Needed for the PreFilterMessage function when we're - /// handling DAT_EVENT... - /// - [StructLayout(LayoutKind.Sequential)] - private struct MESSAGE - { - public IntPtr hwnd; - public UInt32 message; - public IntPtr wParam; - public IntPtr lParam; - public UInt32 time; - public POINT pt; - } - - /// - /// The header for a Bitmap file. - /// Needed for supporting DAT.IMAGENATIVEXFER... - /// - [StructLayout(LayoutKind.Sequential, Pack = 1)] - private struct BITMAPFILEHEADER - { - public ushort bfType; - public uint bfSize; - public ushort bfReserved1; - public ushort bfReserved2; - public uint bfOffBits; - } - - /// - /// The header for a Device Independent Bitmap (DIB). - /// Needed for supporting DAT.IMAGENATIVEXFER... - /// - [StructLayout(LayoutKind.Sequential, Pack = 1)] - private struct BITMAPINFOHEADER - { - public uint biSize; - public int biWidth; - public int biHeight; - public ushort biPlanes; - public ushort biBitCount; - public uint biCompression; - public uint biSizeImage; - public int biXPelsPerMeter; - public int biYPelsPerMeter; - public uint biClrUsed; - public uint biClrImportant; - - public void Init() - { - biSize = (uint)Marshal.SizeOf(this); - } - } - - /// - /// The TIFF file header. - /// Needed for supporting DAT.IMAGENATIVEXFER... - /// - [StructLayout(LayoutKind.Sequential, Pack = 1)] - private struct TIFFHEADER - { - public ushort u8ByteOrder; - public ushort u16Version; - public uint u32OffsetFirstIFD; - public ushort u16u16IFD; - } - - /// - /// An individual TIFF Tag. - /// Needed for supporting DAT.IMAGENATIVEXFER... - /// - [StructLayout(LayoutKind.Sequential, Pack = 1)] - private struct TIFFTAG - { - public ushort u16Tag; - public ushort u16Type; - public uint u32Count; - public uint u32Value; - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Private Attributes... - /////////////////////////////////////////////////////////////////////////////// - #region Private Attributes... - - /// - /// Our application identity... - /// - private TW_IDENTITY m_twidentityApp; - private TW_IDENTITY_LEGACY m_twidentitylegacyApp; - private TW_IDENTITY_MACOSX m_twidentitymacosxApp; - - /// - /// Our Data Source identity... - /// - internal TW_IDENTITY m_twidentityDs; - private TW_IDENTITY_LEGACY m_twidentitylegacyDs; - private TW_IDENTITY_MACOSX m_twidentitymacosxDs; - - /// - /// Our current TWAIN state... - /// - private STATE m_state; - private bool m_blAcceptXferReady; - - /// - /// DAT_NULL flags that we've seen after entering into - /// state 5 through MSG_ENABLEDS or MSG_ENABLEDSUIONLY, - /// or coming down from DAT_PENDINGXFERS, either - /// MSG_ENDXFER or MSG_RESET... - /// - private bool m_blIsMsgxferready; - private bool m_blIsMsgclosedsreq; - private bool m_blIsMsgclosedsok; - private bool m_blIsMsgdeviceevent; - private bool m_blRunningDatUserinterface; - private Thread m_threadRunningDatUserinterface; - - /// - /// Automatically issue DAT.STATUS on TWRC_FAILURE... - /// - private bool m_blAutoDatStatus; - - /// - /// Windows, pick between TWAIN_32.DLL and TWAINDSM.DLL... - /// Mac OS X, pick between /System/Library/Frameworks/TWAIN.framework and /Library/Frameworks/TWAINDSM.framework - /// - private bool m_blUseLegacyDSM; - - /// - /// Help us pick the right DSM for the current data source, - /// the first one is for the session, the second one is for - /// getfirst/getnext, and allows us to check for drivers - /// using either one or both DSMs, depending on what is - /// available... - /// - internal LinuxDsm m_linuxdsm; - private LinuxDsm m_linux64bitdsmDatIdentity; - internal bool m_blFoundLatestDsm; - internal bool m_blFoundLatestDsm64; - internal bool m_blFound020302Dsm64bit; - - /// - /// Use the callback system (TWAINDSM.DLL only)... - /// - private bool m_blUseCallbacks; - - /// - /// The platform we're running on... - /// - private static Platform ms_platform; - private static Processor ms_processor; - private static bool ms_blFirstPassGetPlatform = true; - - /// - /// Delegates for DAT_CALLBACK... - /// - private NativeMethods.WindowsDsmEntryCallbackDelegate m_windowsdsmentrycontrolcallbackdelegate; - private NativeMethods.LinuxDsmEntryCallbackDelegate m_linuxdsmentrycontrolcallbackdelegate; - private NativeMethods.MacosxDsmEntryCallbackDelegate m_macosxdsmentrycontrolcallbackdelegate; - - /// - /// We only allow one thread at a time to talk to the TWAIN driver... - /// - private Object m_lockTwain; - - /// - /// Use this to wait for commands from the caller... - /// - private AutoResetEvent m_autoreseteventCaller; - - /// - /// Use this to force the user's command to block until TWAIN has - /// a response... - /// - private AutoResetEvent m_autoreseteventThread; - - /// - /// Use this to force the user's rollback to block until TWAIN has - /// a response... - /// - private AutoResetEvent m_autoreseteventRollback; - - /// - /// One can get into a race condition with the thread, so we use - /// this event to confirm that it's started and ready for use... - /// - private AutoResetEvent m_autoreseteventThreadStarted; - - /// - /// The data we share with the thread... - /// - //private ThreadData m_threaddata; - - /// - /// Our callback for device events... - /// - private DeviceEventCallback m_deviceeventcallback; - - /// - /// Our callback function for scanning... - /// - private ScanCallback m_scancallback; - - /// - /// Run stuff in a caller's UI thread... - /// - private RunInUiThreadDelegate m_runinuithreaddelegate; - - /// - /// The event calls don't go through the thread... - /// - private TW_EVENT m_tweventPreFilterMessage; - - // Remember the window handle, so we can reuse it... - private IntPtr m_intptrHwnd; - - /// - /// Our thread... - /// - private Thread m_threadTwain; - - /// - /// How we talk to our thread... - /// - private TwainCommand m_twaincommand; - - /// - /// Indecies for commands that have to do something a - /// bit more fancy, such as running the command in the - /// context of a GUI thread. And flags to help know - /// when we are doing this... - /// - private ThreadData m_threaddataDatAudiofilexfer; - private ThreadData m_threaddataDatAudionativexfer; - private ThreadData m_threaddataDatCapability; - private ThreadData m_threaddataDatEvent; - private ThreadData m_threaddataDatExtimageinfo; - private ThreadData m_threaddataDatIdentity; - private ThreadData m_threaddataDatImagefilexfer; - private ThreadData m_threaddataDatImageinfo; - private ThreadData m_threaddataDatImagelayout; - private ThreadData m_threaddataDatImagememfilexfer; - private ThreadData m_threaddataDatImagememxfer; - private ThreadData m_threaddataDatImagenativexfer; - private ThreadData m_threaddataDatParent; - private ThreadData m_threaddataDatPendingxfers; - private ThreadData m_threaddataDatSetupfilexfer; - private ThreadData m_threaddataDatSetupmemxfer; - private ThreadData m_threaddataDatStatus; - private ThreadData m_threaddataDatUserinterface; - - /// - /// Our helper functions from the DSM... - /// - private TW_ENTRYPOINT_DELEGATES m_twentrypointdelegates; - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // TwainCommand... - /////////////////////////////////////////////////////////////////////////////// - #region TwainCommand... - - /// - /// We have TWAIN commands that can be called by the application from any - /// thread they want. We do a lock, and then build a command and submit - /// it to the Main thread. The Main thread runs without locks, so all it - /// is allowed to do is examine TwainCommands to see if it has work. If - /// it finds an item, it takes care of it, and changes it to complete. - /// - private sealed class TwainCommand - { - /////////////////////////////////////////////////////////////////////////// - // Public Functions... - /////////////////////////////////////////////////////////////////////////// - #region Public Functions... - - /// - /// Initialize an array that we'll be sharing between the TWAIN operations - /// and the Main thread... - /// - public TwainCommand() - { - m_athreaddata = new ThreadData[8]; - } - - /// - /// Complete a command - /// - /// index to update - /// data to use - public void Complete(long a_lIndex, ThreadData a_threaddata) - { - // If we're out of bounds, return an empty structure... - if ((a_lIndex < 0) || (a_lIndex >= m_athreaddata.Length)) - { - return; - } - - // We're not really a command... - if (!m_athreaddata[a_lIndex].blIsInuse) - { - return; - } - - // Do the update and tag it complete... - m_athreaddata[a_lIndex] = a_threaddata; - m_athreaddata[a_lIndex].blIsComplete = true; - } - - /// - /// Delete a command... - /// - /// the requested command - public void Delete(long a_lIndex) - { - // If we're out of bounds, return an empty structure... - if ((a_lIndex < 0) || (a_lIndex >= m_athreaddata.Length)) - { - return; - } - - // Clear the record... - m_athreaddata[a_lIndex] = default(ThreadData); - } - - /// - /// Get a command... - /// - /// the requested command - public ThreadData Get(long a_lIndex) - { - // If we're out of bounds, return an empty structure... - if ((a_lIndex < 0) || (a_lIndex >= m_athreaddata.Length)) - { - return (new ThreadData()); - } - - // Return what we found... - return (m_athreaddata[a_lIndex]); - } - - /// - /// Get the next command in the list... - /// - /// the index of the data - /// the command we'll return - /// true if we found something - public bool GetNext(out long a_lIndex, out ThreadData a_threaddata) - { - long lIndex; - - // Init stuff... - lIndex = m_lIndex; - a_lIndex = 0; - a_threaddata = default(ThreadData); - - // Cycle once through the commands to see if we have any... - for (;;) - { - // We found something, copy it out, point to the next - // item (so we know we're looking at the whole list) - // and return... - if (m_athreaddata[lIndex].blIsInuse && !m_athreaddata[lIndex].blIsComplete) - { - a_threaddata = m_athreaddata[lIndex]; - a_lIndex = lIndex; - m_lIndex = lIndex + 1; - if (m_lIndex >= m_athreaddata.Length) - { - m_lIndex = 0; - } - return (true); - } - - // Next item... - lIndex += 1; - if (lIndex >= m_athreaddata.Length) - { - lIndex = 0; - } - - // We've cycled, and we didn't find anything... - if (lIndex == m_lIndex) - { - a_lIndex = lIndex; - return (false); - } - } - } - - /// - /// Submit a new command... - /// - /// - public long Submit(ThreadData a_threadata) - { - long ll; - - // We won't leave until we've submitted the beastie... - for (;;) - { - // Look for a free slot... - for (ll = 0; ll < m_athreaddata.Length; ll++) - { - if (!m_athreaddata[ll].blIsInuse) - { - m_athreaddata[ll] = a_threadata; - m_athreaddata[ll].blIsInuse = true; - return (ll); - } - } - - // Wait a little... - Thread.Sleep(0); - } - } - - /// - /// Update a command - /// - /// index to update - /// data to use - public void Update(long a_lIndex, ThreadData a_threaddata) - { - // If we're out of bounds, return an empty structure... - if ((a_lIndex < 0) || (a_lIndex >= m_athreaddata.Length)) - { - return; - } - - // We're not really a command... - if (!m_athreaddata[a_lIndex].blIsInuse) - { - return; - } - - // Do the update... - m_athreaddata[a_lIndex] = a_threaddata; - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////// - // Private Attributes... - /////////////////////////////////////////////////////////////////////////// - #region Private Attributes... - - /// - /// The data we're sharing. A null in a position means its available for - /// use. The Main thread only consumes items, it never creates or - /// destroys them, that's done by the various commands. - /// - private ThreadData[] m_athreaddata; - - /// - /// Index for browsing m_athreaddata for work... - /// - private long m_lIndex; - - #endregion - } - - #endregion - } - - /// - /// A quick and dirty CSV reader/writer... - /// - public class CSV - { - /////////////////////////////////////////////////////////////////////////////// - // Public Functions... - /////////////////////////////////////////////////////////////////////////////// - #region Public Functions... - - /// - /// Start with an empty string... - /// - public CSV() - { - m_szCsv = ""; - } - - /// - /// Add an item to a CSV string... - /// - /// Something to add to the CSV string - public void Add(string a_szItem) - { - // If the item has commas, we need to do work... - if (a_szItem.Contains(",")) - { - // If the item has quotes, replace them with paired quotes, then - // quote it and add it... - if (a_szItem.Contains("\"")) - { - m_szCsv += ((m_szCsv != "") ? "," : "") + "\"" + a_szItem.Replace("\"", "\"\"") + "\""; - } - - // Otherwise, just quote it and add it... - else - { - m_szCsv += ((m_szCsv != "") ? "," : "") + "\"" + a_szItem + "\""; - } - } - - // If the item has quotes, replace them with escaped quotes, then - // quote it and add it... - else if (a_szItem.Contains("\"")) - { - m_szCsv += ((m_szCsv != "") ? "," : "") + "\"" + a_szItem.Replace("\"", "\"\"") + "\""; - } - - // Otherwise, just add it... - else - { - m_szCsv += ((m_szCsv != "") ? "," : "") + a_szItem; - } - } - - /// - /// Clear the record... - /// - public void Clear() - { - m_szCsv = ""; - } - - /// - /// Get the current CSV string... - /// - /// The current value of the CSV string - public string Get() - { - return (m_szCsv); - } - - /// - /// Parse a CSV string... - /// - /// A CSV string to parse - /// An array if items (some can be CSV themselves) - public static string[] Parse(string a_szCsv) - { - int ii; - bool blEnd; - string[] aszCsv; - string[] aszLeft; - string[] aszRight; - - // Validate... - if ((a_szCsv == null) || (a_szCsv == "")) - { - return (new string[] { "" }); - } - - // If there are no quotes, then parse it fast... - if (!a_szCsv.Contains("\"")) - { - return (a_szCsv.Split(new char[] { ',' })); - } - - // There's no opening quote, so split and recurse... - if (a_szCsv[0] != '"') - { - aszLeft = new string[] { a_szCsv.Substring(0, a_szCsv.IndexOf(',')) }; - aszRight = Parse(a_szCsv.Remove(0, a_szCsv.IndexOf(',') + 1)); - aszCsv = new string[aszLeft.Length + aszRight.Length]; - aszLeft.CopyTo(aszCsv, 0); - aszRight.CopyTo(aszCsv, aszLeft.Length); - return (aszCsv); - } - - // Handle the quoted string... - else - { - // Find the terminating quote... - blEnd = true; - for (ii = 0; ii < a_szCsv.Length; ii++) - { - if (a_szCsv[ii] == '"') - { - blEnd = !blEnd; - } - else if (blEnd && (a_szCsv[ii] == ',')) - { - break; - } - } - ii -= 1; - - // We have a problem... - if (!blEnd) - { - throw new Exception("Error in CSV string..."); - } - - // This is the last item, remove any escaped quotes and return it... - if (((ii + 1) >= a_szCsv.Length)) - { - return (new string[] { a_szCsv.Substring(1, a_szCsv.Length - 2).Replace("\"\"", "\"") }); - } - - // We have more data... - if (a_szCsv[ii + 1] == ',') - { - aszLeft = new string[] { a_szCsv.Substring(1, ii - 1).Replace("\"\"", "\"") }; - aszRight = Parse(a_szCsv.Remove(0, ii + 2)); - aszCsv = new string[aszLeft.Length + aszRight.Length]; - aszLeft.CopyTo(aszCsv, 0); - aszRight.CopyTo(aszCsv, aszLeft.Length); - return (aszCsv); - } - - // We have a problem... - throw new Exception("Error in CSV string..."); - } - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Private Attributes... - /////////////////////////////////////////////////////////////////////////////// - #region Private Attributes... - - /// - /// Our working string for creating or parsing... - /// - private string m_szCsv; - - #endregion - } - - - /// - /// Our logger. If we bump up to 4.5 (and if mono supports it at compile - /// time), then we'll be able to add the following to our traces, which - /// seems like it should be more than enough to locate log messages. For - /// now we'll leave the log messages undecorated: - /// [CallerFilePath] string file = "", - /// [CallerMemberName] string member = "", - /// [CallerLineNumber] int line = 0 - /// - public static class Log - { - // Public Methods... - #region Public Methods... - - /// - /// Initialize our delegates... - /// - static Log() - { - Close = CloseLocal; - GetLevel = GetLevelLocal; - Open = OpenLocal; - RegisterTwain = RegisterTwainLocal; - SetFlush = SetFlushLocal; - SetLevel = SetLevelLocal; - WriteEntry = WriteEntryLocal; - } - - /// - /// Let the caller override our delegates with their own functions... - /// - /// use this to close the logging session - /// get the current log level - /// open the logging session - /// not needed at this time - /// turn flushing on and off - /// set the new log level - /// the function that actually writes to the log - /// returns a way to get the current TWAIN state - public static void Override - ( - CloseDelegate a_closedelegate, - GetLevelDelegate a_getleveldelegate, - OpenDelegate a_opendelegate, - RegisterTwainDelegate a_registertwaindelegate, - SetFlushDelegate a_setflushdelegate, - SetLevelDelegate a_setleveldelegate, - WriteEntryDelegate a_writeentrydelegate, - out GetStateDelegate a_getstatedelegate - ) - { - Close = (a_closedelegate != null) ? a_closedelegate : CloseLocal; - GetLevel = (a_getleveldelegate != null) ? a_getleveldelegate : GetLevelLocal; - Open = (a_opendelegate != null) ? a_opendelegate : OpenLocal; - RegisterTwain = (a_registertwaindelegate != null) ? a_registertwaindelegate : RegisterTwainLocal; - SetFlush = (a_setflushdelegate != null) ? a_setflushdelegate : SetFlushLocal; - SetLevel = (a_setleveldelegate != null) ? a_setleveldelegate : SetLevelLocal; - WriteEntry = (a_writeentrydelegate != null) ? a_writeentrydelegate : WriteEntryLocal; - a_getstatedelegate = GetStateLocal; - } - - /// - /// Write an assert message, but only throw with a debug build... - /// - /// message to log - public static void Assert(string a_szMessage) - { - WriteEntry("A", a_szMessage, true); - #if DEBUG - throw new Exception(a_szMessage); - #endif - } - - /// - /// Write an error message... - /// - /// message to log - public static void Error(string a_szMessage) - { - WriteEntry("E", a_szMessage, true); - } - - /// - /// Write an informational message... - /// - /// message to log - public static void Info(string a_szMessage) - { - WriteEntry(".", a_szMessage, ms_blFlush); - } - - /// - /// Log after sending to the TWAIN driver... - /// - /// status - /// data - public static void LogSendAfter(TWAIN.STS a_sts, string a_szMemref) - { - // The data argument type (DAT) stuff... - if ((a_szMemref != null) && (a_szMemref != "") && (a_szMemref[0] != '(')) - { - Log.Info("twn> " + a_szMemref); - } - - // TWRC... - if ((int)a_sts < TWAIN.STSCC) - { - Log.Info("twn> " + a_sts); - } - // TWCC... - else - { - Log.Info("twn> FAILURE/" + a_sts); - } - } - - /// - /// Log before sending to the TWAIN driver... - /// - /// data group - /// data argument type - /// message - /// data - public static void LogSendBefore(string a_szDg, string a_szDat, string a_szMsg, string a_szMemref) - { - Log.Info(""); - Log.Info("twn> DG_" + a_szDg + "/DAT_" + a_szDat + "/MSG_" + a_szMsg); - if ((a_szMemref != null) && (a_szMemref != "") && (a_szMemref[0] != '(')) - { - Log.Info("twn> " + a_szMemref); - } - } - - /// - /// Write a verbose message, this is extra info that isn't normally - /// needed to diagnose problems, but may provide insight into what - /// the code is doing... - /// - /// message to log - public static void Verbose(string a_szMessage) - { - WriteEntry("V", a_szMessage, ms_blFlush); - } - - /// - /// Write a verbose data message, this is extra info, specifically - /// data transfers, that isn't normally needed to diagnose problems. - /// Turning this one can really bloat the logs... - /// - /// message to log - public static void VerboseData(string a_szMessage) - { - WriteEntry("D", a_szMessage, ms_blFlush); - } - - /// - /// Write an warning message... - /// - /// message to log - public static void Warn(string a_szMessage) - { - WriteEntry("W", a_szMessage, ms_blFlush); - } - - #endregion - - - // Public Definitions... - #region Public Definitions... - - // The public methods that need attributes, here offered - // as delegates, so that a caller will be able to override - // them... - public delegate void CloseDelegate(); - public delegate int GetLevelDelegate(); - public delegate string GetStateDelegate(); - public delegate void OpenDelegate(string a_szName, string a_szPath, int a_iLevel); - public delegate void RegisterTwainDelegate(TWAIN a_twain); - public delegate void SetFlushDelegate(bool a_blFlush); - public delegate void SetLevelDelegate(int a_iLevel); - public delegate void WriteEntryDelegate(string a_szSeverity, string a_szMessage, bool a_blFlush); - - #endregion - - - // Public Attributes... - #region Public Attributes... - - // The public methods that need attributes, here offered - // as delegates, so that a caller will be able to override - // them... - public static CloseDelegate Close; - public static GetLevelDelegate GetLevel; - public static OpenDelegate Open; - public static RegisterTwainDelegate RegisterTwain; - public static SetFlushDelegate SetFlush; - public static SetLevelDelegate SetLevel; - public static WriteEntryDelegate WriteEntry; - - #endregion - - - // Private Methods... - #region Private Methods... - - /// - /// Close tracing... - /// - private static void CloseLocal() - { - if (!ms_blFirstPass) - { - Trace.Close(); - ms_filestream.Close(); - ms_filestream = null; - } - ms_blFirstPass = true; - ms_blOpened = false; - ms_blFlush = false; - ms_iMessageNumber = 0; - } - - /// - /// Get the debugging level... - /// - /// the level - private static int GetLevelLocal() - { - return (ms_iLevel); - } - - /// - /// Get the state... - /// - /// the level - private static string GetStateLocal() - { - return ((ms_twain == null) ? "S1" : ms_twain.GetState().ToString()); - } - - /// - /// Turn on the listener for our log file... - /// - /// the name of our log - /// the path where we want our log to go - /// debug level - private static void OpenLocal(string a_szName, string a_szPath, int a_iLevel) - { - string szLogFile; - - // Init stuff... - ms_blFirstPass = true; - ms_blOpened = true; - ms_blFlush = false; - ms_iMessageNumber = 0; - ms_iLevel = a_iLevel; - - // Ask for a TWAINDSM log... - if (a_iLevel > 0) - { - Environment.SetEnvironmentVariable("TWAINDSM_LOG", Path.Combine(a_szPath, "twaindsm.log")); - Environment.SetEnvironmentVariable("TWAINDSM_MODE", "w"); - } - - // Backup old stuff... - szLogFile = Path.Combine(a_szPath, a_szName); - try - { - if (File.Exists(szLogFile + "_backup_2.log")) - { - File.Delete(szLogFile + "_backup_2.log"); - } - if (File.Exists(szLogFile + "_backup_1.log")) - { - File.Move(szLogFile + "_backup_1.log", szLogFile + "_backup_2.log"); - } - if (File.Exists(szLogFile + ".log")) - { - File.Move(szLogFile + ".log", szLogFile + "_backup_1.log"); - } - } - catch - { - // Don't care, keep going... - } - - // Turn on the listener... - ms_filestream = File.Open(szLogFile + ".log", FileMode.Append, FileAccess.Write, FileShare.Read); - Trace.Listeners.Add(new TextWriterTraceListener(ms_filestream, a_szName + "Listener")); - } - - /// - /// Register the TWAIN object so we can get some extra info... - /// - /// twain object or null - private static void RegisterTwainLocal(TWAIN a_twain) - { - ms_twain = a_twain; - } - - /// - /// Flush data to the file... - /// - private static void SetFlushLocal(bool a_blFlush) - { - ms_blFlush = a_blFlush; - if (a_blFlush) - { - Trace.Flush(); - } - } - - /// - /// Set the debugging level - /// - /// - private static void SetLevelLocal(int a_iLevel) - { - // Squirrel this value away... - ms_iLevel = a_iLevel; - - // One has to opt out of flushing, since the consequence - // of turning it off often involves losing log data... - if ((a_iLevel & c_iDebugNoFlush) == c_iDebugNoFlush) - { - SetFlush(false); - } - else - { - SetFlush(true); - } - } - - /// - /// Do this for all of them... - /// - /// The message - /// Message severity - /// Flush it to disk - private static void WriteEntryLocal(string a_szSeverity, string a_szMessage, bool a_blFlush) - { - long lThreadId; - - // Filter... - switch (a_szSeverity) - { - // Always log these, and always flush them to disk... - case "A": - case "E": - case "W": - a_blFlush = true; - break; - - // Log informationals when bit-0 is set... - case ".": - if ((ms_iLevel & c_iDebugInfo) != 0) - { - break; - } - return; - - // Log verbose when bit-1 is set... - case "V": - if ((ms_iLevel & c_iDebugVerbose) != 0) - { - a_szSeverity = "."; - break; - } - return; - - // Log verbose data when bit-1 is set... - case "D": - if ((ms_iLevel & c_iDebugVerboseData) != 0) - { - a_szSeverity = "."; - break; - } - return; - } - - // Get our thread id... - if (ms_blIsWindows) - { - lThreadId = NativeMethods.GetCurrentThreadId(); - } - else - { - lThreadId = Thread.CurrentThread.ManagedThreadId; - } - - // First pass... - if (ms_blFirstPass) - { - string szPlatform; - - // We're Windows... - if (Environment.OSVersion.ToString().Contains("Microsoft Windows")) - { - szPlatform = "windows"; - } - - // We're Mac OS X (this has to come before LINUX!!!)... - else if (Directory.Exists("/Library/Application Support")) - { - szPlatform = "macosx"; - } - - // We're Linux... - else if (Environment.OSVersion.ToString().Contains("Unix")) - { - szPlatform = "linux"; - } - - // We have a problem, Log will throw for us... - else - { - szPlatform = "unknown"; - } - if (!ms_blOpened) - { - // We'll assume they want logging, since they didn't tell us... - Open("Twain", ".", 1); - } - Trace.UseGlobalLock = true; - ms_blFirstPass = false; - Trace.WriteLine - ( - string.Format - ( - "{0:D6} {1} {2} T{3:D8} V{4} ts:{5} os:{6}", - ms_iMessageNumber++, - DateTime.Now.ToString("HHmmssffffff"), - (ms_twain != null) ? ms_twain.GetState().ToString() : "S1", - lThreadId, - a_szSeverity.ToString(), - DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.ffffff"), - szPlatform - ) - ); - } - - // And log it... - Trace.WriteLine - ( - string.Format - ( - "{0:D6} {1} {2} T{3:D8} V{4} {5}", - ms_iMessageNumber++, - DateTime.Now.ToString("HHmmssffffff"), - (ms_twain != null) ? ms_twain.GetState().ToString() : "S1", - lThreadId, - a_szSeverity.ToString(), - a_szMessage - ) - ); - - // Flush it... - if (a_blFlush) - { - Trace.Flush(); - } - } - - #endregion - - - // Private Definitions... - #region Private Definitions - - /// - /// LogLevel bitmask... - /// - private const int c_iDebugInfo = 0x0001; - private const int c_iDebugVerbose = 0x0002; - private const int c_iDebugVerboseData = 0x0004; - private const int c_iDebugNoFlush = 0x0008; - - #endregion - - - // Private Attributes... - #region Private Attributes - - private static bool ms_blFirstPass = true; - private static bool ms_blOpened = false; - private static bool ms_blFlush = false; - private static int ms_iMessageNumber = 0; - private static int ms_iLevel = 0; - private static TWAIN ms_twain = null; - private static bool ms_blIsWindows = false; - private static FileStream ms_filestream; - - #endregion - } -} diff --git a/src/NTwain-temp/TWAINWorkingGroup/TWAINH.cs b/src/NTwain-temp/TWAINWorkingGroup/TWAINH.cs deleted file mode 100644 index e60d5b9..0000000 --- a/src/NTwain-temp/TWAINWorkingGroup/TWAINH.cs +++ /dev/null @@ -1,8381 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////// -// -// TwainWorkingGroup.TWAIN -// -// These are the definitions for TWAIN. They're essentially the C/C++ -// TWAIN.H file contents translated to C#, with modifications that -// recognize the differences between Windows, Linux and Mac OS X. -// -/////////////////////////////////////////////////////////////////////////////////////// -// Author Date TWAIN Comment -// M.McLaughlin 17-May-2021 2.5.0.0 Updated to latest spec -// M.McLaughlin 13-Mar-2019 2.4.0.3 Add language code page support for strings -// M.McLaughlin 13-Nov-2015 2.4.0.0 Updated to latest spec -// M.McLaughlin 13-Sep-2015 2.3.1.2 DsmMem bug fixes -// M.McLaughlin 26-Aug-2015 2.3.1.1 Log fix and sync with TWAIN Direct -// M.McLaughlin 13-Mar-2015 2.3.1.0 Numerous fixes -// M.McLaughlin 13-Oct-2014 2.3.0.4 Added logging -// M.McLaughlin 24-Jun-2014 2.3.0.3 Stability fixes -// M.McLaughlin 21-May-2014 2.3.0.2 64-Bit Linux -// M.McLaughlin 27-Feb-2014 2.3.0.1 AnyCPU support -// M.McLaughlin 21-Oct-2013 2.3.0.0 Initial Release -/////////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2013-2021 Kodak Alaris Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -/////////////////////////////////////////////////////////////////////////////////////// - -using System; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.InteropServices; -using System.Text; - -namespace TWAINWorkingGroup -{ - /// - /// This file contains content gleaned from version 2.4 of the C/C++ TWAIN.H - /// header file released by the TWAIN Working Group. It's organized like that - /// file to make it easier to maintain. - /// - /// Please do not add any code to this module, save for the minimum needed to - /// maintain a particular definition (such as TW_STR32)... - /// - public partial class TWAIN - { - /////////////////////////////////////////////////////////////////////////////// - // TWAIN Version... - /////////////////////////////////////////////////////////////////////////////// - #region Protocol Version... - public enum TWON_PROTOCOL - { - MAJOR = 2, - MINOR = 5 // Changed for Version 2.5 - }; - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Type Definitions... - /////////////////////////////////////////////////////////////////////////////// - #region Type Definitions... - - // Follow these rules - /****************************************************************************** - - TW_HANDLE...............IntPtr - TW_MEMREF...............IntPtr - TW_UINTPTR..............UIntPtr - - TW_INT8.................char - TW_INT16................short - TW_INT32................int (was long on Linux 64-bit) - - TW_UINT8................byte - TW_UINT16...............ushort - TW_UINT32...............uint (was ulong on Linux 64-bit) - TW_BOOL.................ushort - - ******************************************************************************/ - - /// - /// Our supported platforms... - /// - public enum Platform - { - UNKNOWN, - WINDOWS, - LINUX, - MACOSX - }; - - /// - /// Our supported processors... - /// - public enum Processor - { - UNKNOWN, - X86, - X86_64, - MIPS64EL - }; - - /// - /// Used for strings that go up to 32-bytes... - /// - [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] - public partial struct TW_STR32 - { - /// - /// We're stuck with this, because marshalling with packed alignment - /// can't handle arrays... - /// - private byte byItem000; private byte byItem001; private byte byItem002; private byte byItem003; - private byte byItem004; private byte byItem005; private byte byItem006; private byte byItem007; - private byte byItem008; private byte byItem009; private byte byItem010; private byte byItem011; - private byte byItem012; private byte byItem013; private byte byItem014; private byte byItem015; - private byte byItem016; private byte byItem017; private byte byItem018; private byte byItem019; - private byte byItem020; private byte byItem021; private byte byItem022; private byte byItem023; - private byte byItem024; private byte byItem025; private byte byItem026; private byte byItem027; - private byte byItem028; private byte byItem029; private byte byItem030; private byte byItem031; - private byte byItem032; private byte byItem033; - - /// - /// The normal get... - /// - /// - public string Get() - { - return (GetValue(true)); - } - - /// - /// Use this on Mac OS X if you have a call that uses a string - /// that doesn't include the prefix byte... - /// - /// - public string GetNoPrefix() - { - return (GetValue(false)); - } - - /// - /// Get our value... - /// - /// - private string GetValue(bool a_blMayHavePrefix) - { - // convert what we have into a byte array - byte[] abyItem = new byte[34]; - abyItem[0] = byItem000; abyItem[1] = byItem001; abyItem[2] = byItem002; abyItem[3] = byItem003; - abyItem[4] = byItem004; abyItem[5] = byItem005; abyItem[6] = byItem006; abyItem[7] = byItem007; - abyItem[8] = byItem008; abyItem[9] = byItem009; abyItem[10] = byItem010; abyItem[11] = byItem011; - abyItem[12] = byItem012; abyItem[13] = byItem013; abyItem[14] = byItem014; abyItem[15] = byItem015; - abyItem[16] = byItem016; abyItem[17] = byItem017; abyItem[18] = byItem018; abyItem[19] = byItem019; - abyItem[20] = byItem020; abyItem[21] = byItem021; abyItem[22] = byItem022; abyItem[23] = byItem023; - abyItem[24] = byItem024; abyItem[25] = byItem025; abyItem[26] = byItem026; abyItem[27] = byItem027; - abyItem[28] = byItem028; abyItem[29] = byItem029; abyItem[30] = byItem030; abyItem[31] = byItem031; - abyItem[32] = byItem032; abyItem[33] = byItem033; - - // Zero anything after the NUL... - bool blNul = false; - for (int ii = 0; ii < abyItem.Length; ii++) - { - if (!blNul && (abyItem[ii] == 0)) - { - blNul = true; - } - else if (blNul) - { - abyItem[ii] = 0; - } - } - - // change encoding of byte array, then convert the bytes array to a string - string sz = Encoding.Unicode.GetString(Encoding.Convert(Language.GetEncoding(), Encoding.Unicode, abyItem)); - - // If the first character is a NUL, then return the empty string... - while ((sz.Length > 0) && (sz[0] == '\0')) - { - sz = sz.Remove(0, 1); - } - - // We have an emptry string... - if (sz.Length == 0) - { - return (""); - } - - // If we're running on a Mac, take off the prefix 'byte'... - if (a_blMayHavePrefix && (TWAIN.GetPlatform() == Platform.MACOSX)) - { - sz = sz.Remove(0, 1); - } - - // If we detect a NUL, then split around it... - if (sz.IndexOf('\0') >= 0) - { - sz = sz.Split(new char[] { '\0' })[0]; - } - - // All done... - return (sz); - } - - /// - /// The normal set... - /// - /// - public void Set(string a_sz) - { - SetValue(a_sz, true); - } - - /// - /// Use this on Mac OS X if you have a call that uses a string - /// that doesn't include the prefix byte... - /// - /// - public void SetNoPrefix(string a_sz) - { - SetValue(a_sz, false); - } - - /// - /// Set our value... - /// - /// - private void SetValue(string a_sz, bool a_blMayHavePrefix) - { - // If we're running on a Mac, tack on the prefix 'byte'... - if (a_sz == null) - { - a_sz = ""; - } - else if (a_blMayHavePrefix && (TWAIN.GetPlatform() == Platform.MACOSX)) - { - a_sz = (char)a_sz.Length + a_sz; - } - - // Make sure that we're NUL padded... - string sz = a_sz + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0"; - if (sz.Length > 34) - { - sz = sz.Remove(34); - } - - // convert string to byte array, then change the encoding of the byte array - byte[] abyItem = Encoding.Convert(Encoding.Unicode, Language.GetEncoding(), Encoding.Unicode.GetBytes(sz)); - - // convert byte array to bytes - if (abyItem.Length > 0) - { - byItem000 = abyItem[0]; byItem001 = abyItem[1]; byItem002 = abyItem[2]; byItem003 = abyItem[3]; - byItem004 = abyItem[4]; byItem005 = abyItem[5]; byItem006 = abyItem[6]; byItem007 = abyItem[7]; - byItem008 = abyItem[8]; byItem009 = abyItem[9]; byItem010 = abyItem[10]; byItem011 = abyItem[11]; - byItem012 = abyItem[12]; byItem013 = abyItem[13]; byItem014 = abyItem[14]; byItem015 = abyItem[15]; - byItem016 = abyItem[16]; byItem017 = abyItem[17]; byItem018 = abyItem[18]; byItem019 = abyItem[19]; - byItem020 = abyItem[20]; byItem021 = abyItem[21]; byItem022 = abyItem[22]; byItem023 = abyItem[23]; - byItem024 = abyItem[24]; byItem025 = abyItem[25]; byItem026 = abyItem[26]; byItem027 = abyItem[27]; - byItem028 = abyItem[28]; byItem029 = abyItem[29]; byItem030 = abyItem[30]; byItem031 = abyItem[31]; - byItem032 = abyItem[32]; byItem033 = abyItem[33]; - } - } - } - - /// - /// Used for strings that go up to 64-bytes... - /// - [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] - public partial struct TW_STR64 - { - /// - /// We're stuck with this, because marshalling with packed alignment - /// can't handle arrays... - /// - private byte byItem000; private byte byItem001; private byte byItem002; private byte byItem003; - private byte byItem004; private byte byItem005; private byte byItem006; private byte byItem007; - private byte byItem008; private byte byItem009; private byte byItem010; private byte byItem011; - private byte byItem012; private byte byItem013; private byte byItem014; private byte byItem015; - private byte byItem016; private byte byItem017; private byte byItem018; private byte byItem019; - private byte byItem020; private byte byItem021; private byte byItem022; private byte byItem023; - private byte byItem024; private byte byItem025; private byte byItem026; private byte byItem027; - private byte byItem028; private byte byItem029; private byte byItem030; private byte byItem031; - private byte byItem032; private byte byItem033; private byte byItem034; private byte byItem035; - private byte byItem036; private byte byItem037; private byte byItem038; private byte byItem039; - private byte byItem040; private byte byItem041; private byte byItem042; private byte byItem043; - private byte byItem044; private byte byItem045; private byte byItem046; private byte byItem047; - private byte byItem048; private byte byItem049; private byte byItem050; private byte byItem051; - private byte byItem052; private byte byItem053; private byte byItem054; private byte byItem055; - private byte byItem056; private byte byItem057; private byte byItem058; private byte byItem059; - private byte byItem060; private byte byItem061; private byte byItem062; private byte byItem063; - private byte byItem064; private byte byItem065; - - /// - /// The normal get... - /// - /// - public string Get() - { - return (GetValue(true)); - } - - /// - /// Use this on Mac OS X if you have a call that uses a string - /// that doesn't include the prefix byte... - /// - /// - public string GetNoPrefix() - { - return (GetValue(false)); - } - - /// - /// Get our value... - /// - /// - private string GetValue(bool a_blMayHavePrefix) - { - // convert what we have into a byte array - byte[] abyItem = new byte[66]; - abyItem[0] = byItem000; abyItem[1] = byItem001; abyItem[2] = byItem002; abyItem[3] = byItem003; - abyItem[4] = byItem004; abyItem[5] = byItem005; abyItem[6] = byItem006; abyItem[7] = byItem007; - abyItem[8] = byItem008; abyItem[9] = byItem009; abyItem[10] = byItem010; abyItem[11] = byItem011; - abyItem[12] = byItem012; abyItem[13] = byItem013; abyItem[14] = byItem014; abyItem[15] = byItem015; - abyItem[16] = byItem016; abyItem[17] = byItem017; abyItem[18] = byItem018; abyItem[19] = byItem019; - abyItem[20] = byItem020; abyItem[21] = byItem021; abyItem[22] = byItem022; abyItem[23] = byItem023; - abyItem[24] = byItem024; abyItem[25] = byItem025; abyItem[26] = byItem026; abyItem[27] = byItem027; - abyItem[28] = byItem028; abyItem[29] = byItem029; abyItem[30] = byItem030; abyItem[31] = byItem031; - abyItem[32] = byItem032; abyItem[33] = byItem033; abyItem[34] = byItem034; abyItem[35] = byItem035; - abyItem[36] = byItem036; abyItem[37] = byItem037; abyItem[38] = byItem038; abyItem[39] = byItem039; - abyItem[40] = byItem040; abyItem[41] = byItem041; abyItem[42] = byItem042; abyItem[43] = byItem043; - abyItem[44] = byItem044; abyItem[45] = byItem045; abyItem[46] = byItem046; abyItem[47] = byItem047; - abyItem[48] = byItem048; abyItem[49] = byItem049; abyItem[50] = byItem050; abyItem[51] = byItem051; - abyItem[52] = byItem052; abyItem[53] = byItem053; abyItem[54] = byItem054; abyItem[55] = byItem055; - abyItem[56] = byItem056; abyItem[57] = byItem057; abyItem[58] = byItem058; abyItem[59] = byItem059; - abyItem[60] = byItem060; abyItem[61] = byItem061; abyItem[62] = byItem062; abyItem[63] = byItem063; - abyItem[64] = byItem064; abyItem[65] = byItem065; - - // Zero anything after the NUL... - bool blNul = false; - for (int ii = 0; ii < abyItem.Length; ii++) - { - if (!blNul && (abyItem[ii] == 0)) - { - blNul = true; - } - else if (blNul) - { - abyItem[ii] = 0; - } - } - - // change encoding of byte array, then convert the bytes array to a string - string sz = Encoding.Unicode.GetString(Encoding.Convert(Language.GetEncoding(), Encoding.Unicode, abyItem)); - - // If the first character is a NUL, then return the empty string... - if (sz[0] == '\0') - { - return (""); - } - - // If we're running on a Mac, take off the prefix 'byte'... - if (a_blMayHavePrefix && (TWAIN.GetPlatform() == Platform.MACOSX)) - { - sz = sz.Remove(0, 1); - } - - // If we detect a NUL, then split around it... - if (sz.IndexOf('\0') >= 0) - { - sz = sz.Split(new char[] { '\0' })[0]; - } - - // All done... - return (sz); - } - - /// - /// The normal set... - /// - /// - public void Set(string a_sz) - { - SetValue(a_sz, true); - } - - /// - /// Use this on Mac OS X if you have a call that uses a string - /// that doesn't include the prefix byte... - /// - /// - public void SetNoPrefix(string a_sz) - { - SetValue(a_sz, false); - } - - /// - /// Set our value... - /// - /// - private void SetValue(string a_sz, bool a_blMayHavePrefix) - { - // If we're running on a Mac, tack on the prefix 'byte'... - if (a_sz == null) - { - a_sz = ""; - } - else if (a_blMayHavePrefix && (TWAIN.GetPlatform() == Platform.MACOSX)) - { - a_sz = (char)a_sz.Length + a_sz; - } - - // Make sure that we're NUL padded... - string sz = - a_sz + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0"; - if (sz.Length > 66) - { - sz = sz.Remove(66); - } - - // convert string to byte array, then change the encoding of the byte array - byte[] abyItem = Encoding.Convert(Encoding.Unicode, Language.GetEncoding(), Encoding.Unicode.GetBytes(sz)); - - // concert byte array to bytes - byItem000 = abyItem[0]; byItem001 = abyItem[1]; byItem002 = abyItem[2]; byItem003 = abyItem[3]; - byItem004 = abyItem[4]; byItem005 = abyItem[5]; byItem006 = abyItem[6]; byItem007 = abyItem[7]; - byItem008 = abyItem[8]; byItem009 = abyItem[9]; byItem010 = abyItem[10]; byItem011 = abyItem[11]; - byItem012 = abyItem[12]; byItem013 = abyItem[13]; byItem014 = abyItem[14]; byItem015 = abyItem[15]; - byItem016 = abyItem[16]; byItem017 = abyItem[17]; byItem018 = abyItem[18]; byItem019 = abyItem[19]; - byItem020 = abyItem[20]; byItem021 = abyItem[21]; byItem022 = abyItem[22]; byItem023 = abyItem[23]; - byItem024 = abyItem[24]; byItem025 = abyItem[25]; byItem026 = abyItem[26]; byItem027 = abyItem[27]; - byItem028 = abyItem[28]; byItem029 = abyItem[29]; byItem030 = abyItem[30]; byItem031 = abyItem[31]; - byItem032 = abyItem[32]; byItem033 = abyItem[33]; byItem034 = abyItem[34]; byItem035 = abyItem[35]; - byItem036 = abyItem[36]; byItem037 = abyItem[37]; byItem038 = abyItem[38]; byItem039 = abyItem[39]; - byItem040 = abyItem[40]; byItem041 = abyItem[41]; byItem042 = abyItem[42]; byItem043 = abyItem[43]; - byItem044 = abyItem[44]; byItem045 = abyItem[45]; byItem046 = abyItem[46]; byItem047 = abyItem[47]; - byItem048 = abyItem[48]; byItem049 = abyItem[49]; byItem050 = abyItem[50]; byItem051 = abyItem[51]; - byItem052 = abyItem[52]; byItem053 = abyItem[53]; byItem054 = abyItem[54]; byItem055 = abyItem[55]; - byItem056 = abyItem[56]; byItem057 = abyItem[57]; byItem058 = abyItem[58]; byItem059 = abyItem[59]; - byItem060 = abyItem[60]; byItem061 = abyItem[61]; byItem062 = abyItem[62]; byItem063 = abyItem[63]; - byItem064 = abyItem[64]; byItem065 = abyItem[65]; - } - } - - /// - /// Used for strings that go up to 128-bytes... - /// - [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] - public partial struct TW_STR128 - { - /// - /// We're stuck with this, because marshalling with packed alignment - /// can't handle arrays... - /// - private byte byItem000; private byte byItem001; private byte byItem002; private byte byItem003; - private byte byItem004; private byte byItem005; private byte byItem006; private byte byItem007; - private byte byItem008; private byte byItem009; private byte byItem010; private byte byItem011; - private byte byItem012; private byte byItem013; private byte byItem014; private byte byItem015; - private byte byItem016; private byte byItem017; private byte byItem018; private byte byItem019; - private byte byItem020; private byte byItem021; private byte byItem022; private byte byItem023; - private byte byItem024; private byte byItem025; private byte byItem026; private byte byItem027; - private byte byItem028; private byte byItem029; private byte byItem030; private byte byItem031; - private byte byItem032; private byte byItem033; private byte byItem034; private byte byItem035; - private byte byItem036; private byte byItem037; private byte byItem038; private byte byItem039; - private byte byItem040; private byte byItem041; private byte byItem042; private byte byItem043; - private byte byItem044; private byte byItem045; private byte byItem046; private byte byItem047; - private byte byItem048; private byte byItem049; private byte byItem050; private byte byItem051; - private byte byItem052; private byte byItem053; private byte byItem054; private byte byItem055; - private byte byItem056; private byte byItem057; private byte byItem058; private byte byItem059; - private byte byItem060; private byte byItem061; private byte byItem062; private byte byItem063; - private byte byItem064; private byte byItem065; private byte byItem066; private byte byItem067; - private byte byItem068; private byte byItem069; private byte byItem070; private byte byItem071; - private byte byItem072; private byte byItem073; private byte byItem074; private byte byItem075; - private byte byItem076; private byte byItem077; private byte byItem078; private byte byItem079; - private byte byItem080; private byte byItem081; private byte byItem082; private byte byItem083; - private byte byItem084; private byte byItem085; private byte byItem086; private byte byItem087; - private byte byItem088; private byte byItem089; private byte byItem090; private byte byItem091; - private byte byItem092; private byte byItem093; private byte byItem094; private byte byItem095; - private byte byItem096; private byte byItem097; private byte byItem098; private byte byItem099; - private byte byItem100; private byte byItem101; private byte byItem102; private byte byItem103; - private byte byItem104; private byte byItem105; private byte byItem106; private byte byItem107; - private byte byItem108; private byte byItem109; private byte byItem110; private byte byItem111; - private byte byItem112; private byte byItem113; private byte byItem114; private byte byItem115; - private byte byItem116; private byte byItem117; private byte byItem118; private byte byItem119; - private byte byItem120; private byte byItem121; private byte byItem122; private byte byItem123; - private byte byItem124; private byte byItem125; private byte byItem126; private byte byItem127; - private byte byItem128; private byte byItem129; - - /// - /// The normal get... - /// - /// - public string Get() - { - return (GetValue(true)); - } - - /// - /// Use this on Mac OS X if you have a call that uses a string - /// that doesn't include the prefix byte... - /// - /// - public string GetNoPrefix() - { - return (GetValue(false)); - } - - /// - /// Get our value... - /// - /// - private string GetValue(bool a_blMayHavePrefix) - { - // convert what we have into a byte array - byte[] abyItem = new byte[130]; - abyItem[0] = byItem000; abyItem[1] = byItem001; abyItem[2] = byItem002; abyItem[3] = byItem003; - abyItem[4] = byItem004; abyItem[5] = byItem005; abyItem[6] = byItem006; abyItem[7] = byItem007; - abyItem[8] = byItem008; abyItem[9] = byItem009; abyItem[10] = byItem010; abyItem[11] = byItem011; - abyItem[12] = byItem012; abyItem[13] = byItem013; abyItem[14] = byItem014; abyItem[15] = byItem015; - abyItem[16] = byItem016; abyItem[17] = byItem017; abyItem[18] = byItem018; abyItem[19] = byItem019; - abyItem[20] = byItem020; abyItem[21] = byItem021; abyItem[22] = byItem022; abyItem[23] = byItem023; - abyItem[24] = byItem024; abyItem[25] = byItem025; abyItem[26] = byItem026; abyItem[27] = byItem027; - abyItem[28] = byItem028; abyItem[29] = byItem029; abyItem[30] = byItem030; abyItem[31] = byItem031; - abyItem[32] = byItem032; abyItem[33] = byItem033; abyItem[34] = byItem034; abyItem[35] = byItem035; - abyItem[36] = byItem036; abyItem[37] = byItem037; abyItem[38] = byItem038; abyItem[39] = byItem039; - abyItem[40] = byItem040; abyItem[41] = byItem041; abyItem[42] = byItem042; abyItem[43] = byItem043; - abyItem[44] = byItem044; abyItem[45] = byItem045; abyItem[46] = byItem046; abyItem[47] = byItem047; - abyItem[48] = byItem048; abyItem[49] = byItem049; abyItem[50] = byItem050; abyItem[51] = byItem051; - abyItem[52] = byItem052; abyItem[53] = byItem053; abyItem[54] = byItem054; abyItem[55] = byItem055; - abyItem[56] = byItem056; abyItem[57] = byItem057; abyItem[58] = byItem058; abyItem[59] = byItem059; - abyItem[60] = byItem060; abyItem[61] = byItem061; abyItem[62] = byItem062; abyItem[63] = byItem063; - abyItem[64] = byItem064; abyItem[65] = byItem065; abyItem[66] = byItem066; abyItem[67] = byItem067; - abyItem[68] = byItem068; abyItem[69] = byItem069; abyItem[70] = byItem070; abyItem[71] = byItem071; - abyItem[72] = byItem072; abyItem[73] = byItem073; abyItem[74] = byItem074; abyItem[75] = byItem075; - abyItem[76] = byItem076; abyItem[77] = byItem077; abyItem[78] = byItem078; abyItem[79] = byItem079; - abyItem[80] = byItem080; abyItem[81] = byItem081; abyItem[82] = byItem082; abyItem[83] = byItem083; - abyItem[84] = byItem084; abyItem[85] = byItem085; abyItem[86] = byItem086; abyItem[87] = byItem087; - abyItem[88] = byItem088; abyItem[89] = byItem089; abyItem[90] = byItem090; abyItem[91] = byItem091; - abyItem[92] = byItem092; abyItem[93] = byItem093; abyItem[94] = byItem094; abyItem[95] = byItem095; - abyItem[96] = byItem096; abyItem[97] = byItem097; abyItem[98] = byItem098; abyItem[99] = byItem099; - abyItem[100] = byItem100; abyItem[101] = byItem101; abyItem[102] = byItem102; abyItem[103] = byItem103; - abyItem[104] = byItem104; abyItem[105] = byItem105; abyItem[106] = byItem106; abyItem[107] = byItem107; - abyItem[108] = byItem108; abyItem[109] = byItem109; abyItem[110] = byItem110; abyItem[111] = byItem111; - abyItem[112] = byItem112; abyItem[113] = byItem113; abyItem[114] = byItem114; abyItem[115] = byItem115; - abyItem[116] = byItem116; abyItem[117] = byItem117; abyItem[118] = byItem118; abyItem[119] = byItem119; - abyItem[120] = byItem120; abyItem[121] = byItem121; abyItem[122] = byItem122; abyItem[123] = byItem123; - abyItem[124] = byItem124; abyItem[125] = byItem125; abyItem[126] = byItem126; abyItem[127] = byItem127; - abyItem[128] = byItem128; abyItem[129] = byItem129; - - // Zero anything after the NUL... - bool blNul = false; - for (int ii = 0; ii < abyItem.Length; ii++) - { - if (!blNul && (abyItem[ii] == 0)) - { - blNul = true; - } - else if (blNul) - { - abyItem[ii] = 0; - } - } - - // change encoding of byte array, then convert the bytes array to a string - string sz = Encoding.Unicode.GetString(Encoding.Convert(Language.GetEncoding(), Encoding.Unicode, abyItem)); - - // If the first character is a NUL, then return the empty string... - if (sz[0] == '\0') - { - return (""); - } - - // If we're running on a Mac, take off the prefix 'byte'... - if (a_blMayHavePrefix && (TWAIN.GetPlatform() == Platform.MACOSX)) - { - sz = sz.Remove(0, 1); - } - - // If we detect a NUL, then split around it... - if (sz.IndexOf('\0') >= 0) - { - sz = sz.Split(new char[] { '\0' })[0]; - } - - // All done... - return (sz); - } - - /// - /// The normal set... - /// - /// - public void Set(string a_sz) - { - SetValue(a_sz, true); - } - - /// - /// Use this on Mac OS X if you have a call that uses a string - /// that doesn't include the prefix byte... - /// - /// - public void SetNoPrefix(string a_sz) - { - SetValue(a_sz, false); - } - - /// - /// Set our value... - /// - /// - private void SetValue(string a_sz, bool a_blMayHavePrefix) - { - // If we're running on a Mac, tack on the prefix 'byte'... - if (a_sz == null) - { - a_sz = ""; - } - else if (a_blMayHavePrefix && (TWAIN.GetPlatform() == Platform.MACOSX)) - { - a_sz = (char)a_sz.Length + a_sz; - } - - // Make sure that we're NUL padded... - string sz = - a_sz + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0"; - if (sz.Length > 130) - { - sz = sz.Remove(130); - } - - // convert string to byte array, then change the encoding of the byte array - byte[] abyItem = Encoding.Convert(Encoding.Unicode, Language.GetEncoding(), Encoding.Unicode.GetBytes(sz)); - - // concert byte array to bytes - byItem000 = abyItem[0]; byItem001 = abyItem[1]; byItem002 = abyItem[2]; byItem003 = abyItem[3]; - byItem004 = abyItem[4]; byItem005 = abyItem[5]; byItem006 = abyItem[6]; byItem007 = abyItem[7]; - byItem008 = abyItem[8]; byItem009 = abyItem[9]; byItem010 = abyItem[10]; byItem011 = abyItem[11]; - byItem012 = abyItem[12]; byItem013 = abyItem[13]; byItem014 = abyItem[14]; byItem015 = abyItem[15]; - byItem016 = abyItem[16]; byItem017 = abyItem[17]; byItem018 = abyItem[18]; byItem019 = abyItem[19]; - byItem020 = abyItem[20]; byItem021 = abyItem[21]; byItem022 = abyItem[22]; byItem023 = abyItem[23]; - byItem024 = abyItem[24]; byItem025 = abyItem[25]; byItem026 = abyItem[26]; byItem027 = abyItem[27]; - byItem028 = abyItem[28]; byItem029 = abyItem[29]; byItem030 = abyItem[30]; byItem031 = abyItem[31]; - byItem032 = abyItem[32]; byItem033 = abyItem[33]; byItem034 = abyItem[34]; byItem035 = abyItem[35]; - byItem036 = abyItem[36]; byItem037 = abyItem[37]; byItem038 = abyItem[38]; byItem039 = abyItem[39]; - byItem040 = abyItem[40]; byItem041 = abyItem[41]; byItem042 = abyItem[42]; byItem043 = abyItem[43]; - byItem044 = abyItem[44]; byItem045 = abyItem[45]; byItem046 = abyItem[46]; byItem047 = abyItem[47]; - byItem048 = abyItem[48]; byItem049 = abyItem[49]; byItem050 = abyItem[50]; byItem051 = abyItem[51]; - byItem052 = abyItem[52]; byItem053 = abyItem[53]; byItem054 = abyItem[54]; byItem055 = abyItem[55]; - byItem056 = abyItem[56]; byItem057 = abyItem[57]; byItem058 = abyItem[58]; byItem059 = abyItem[59]; - byItem060 = abyItem[60]; byItem061 = abyItem[61]; byItem062 = abyItem[62]; byItem063 = abyItem[63]; - byItem064 = abyItem[64]; byItem065 = abyItem[65]; byItem066 = abyItem[66]; byItem067 = abyItem[67]; - byItem068 = abyItem[68]; byItem069 = abyItem[69]; byItem070 = abyItem[70]; byItem071 = abyItem[71]; - byItem072 = abyItem[72]; byItem073 = abyItem[73]; byItem074 = abyItem[74]; byItem075 = abyItem[75]; - byItem076 = abyItem[76]; byItem077 = abyItem[77]; byItem078 = abyItem[78]; byItem079 = abyItem[79]; - byItem080 = abyItem[80]; byItem081 = abyItem[81]; byItem082 = abyItem[82]; byItem083 = abyItem[83]; - byItem084 = abyItem[84]; byItem085 = abyItem[85]; byItem086 = abyItem[86]; byItem087 = abyItem[87]; - byItem088 = abyItem[88]; byItem089 = abyItem[89]; byItem090 = abyItem[90]; byItem091 = abyItem[91]; - byItem092 = abyItem[92]; byItem093 = abyItem[93]; byItem094 = abyItem[94]; byItem095 = abyItem[95]; - byItem096 = abyItem[96]; byItem097 = abyItem[97]; byItem098 = abyItem[98]; byItem099 = abyItem[99]; - byItem100 = abyItem[100]; byItem101 = abyItem[101]; byItem102 = abyItem[102]; byItem103 = abyItem[103]; - byItem104 = abyItem[104]; byItem105 = abyItem[105]; byItem106 = abyItem[106]; byItem107 = abyItem[107]; - byItem108 = abyItem[108]; byItem109 = abyItem[109]; byItem110 = abyItem[110]; byItem111 = abyItem[111]; - byItem112 = abyItem[112]; byItem113 = abyItem[113]; byItem114 = abyItem[114]; byItem115 = abyItem[115]; - byItem116 = abyItem[116]; byItem117 = abyItem[117]; byItem118 = abyItem[118]; byItem119 = abyItem[119]; - byItem120 = abyItem[120]; byItem121 = abyItem[121]; byItem122 = abyItem[122]; byItem123 = abyItem[123]; - byItem124 = abyItem[124]; byItem125 = abyItem[125]; byItem126 = abyItem[126]; byItem127 = abyItem[127]; - byItem128 = abyItem[128]; byItem129 = abyItem[129]; - } - } - - /// - /// Used for strings that go up to 256-bytes... - /// - [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] - public partial struct TW_STR255 - { - /// - /// We're stuck with this, because marshalling with packed alignment - /// can't handle arrays... - /// - private byte byItem000; private byte byItem001; private byte byItem002; private byte byItem003; - private byte byItem004; private byte byItem005; private byte byItem006; private byte byItem007; - private byte byItem008; private byte byItem009; private byte byItem010; private byte byItem011; - private byte byItem012; private byte byItem013; private byte byItem014; private byte byItem015; - private byte byItem016; private byte byItem017; private byte byItem018; private byte byItem019; - private byte byItem020; private byte byItem021; private byte byItem022; private byte byItem023; - private byte byItem024; private byte byItem025; private byte byItem026; private byte byItem027; - private byte byItem028; private byte byItem029; private byte byItem030; private byte byItem031; - private byte byItem032; private byte byItem033; private byte byItem034; private byte byItem035; - private byte byItem036; private byte byItem037; private byte byItem038; private byte byItem039; - private byte byItem040; private byte byItem041; private byte byItem042; private byte byItem043; - private byte byItem044; private byte byItem045; private byte byItem046; private byte byItem047; - private byte byItem048; private byte byItem049; private byte byItem050; private byte byItem051; - private byte byItem052; private byte byItem053; private byte byItem054; private byte byItem055; - private byte byItem056; private byte byItem057; private byte byItem058; private byte byItem059; - private byte byItem060; private byte byItem061; private byte byItem062; private byte byItem063; - private byte byItem064; private byte byItem065; private byte byItem066; private byte byItem067; - private byte byItem068; private byte byItem069; private byte byItem070; private byte byItem071; - private byte byItem072; private byte byItem073; private byte byItem074; private byte byItem075; - private byte byItem076; private byte byItem077; private byte byItem078; private byte byItem079; - private byte byItem080; private byte byItem081; private byte byItem082; private byte byItem083; - private byte byItem084; private byte byItem085; private byte byItem086; private byte byItem087; - private byte byItem088; private byte byItem089; private byte byItem090; private byte byItem091; - private byte byItem092; private byte byItem093; private byte byItem094; private byte byItem095; - private byte byItem096; private byte byItem097; private byte byItem098; private byte byItem099; - private byte byItem100; private byte byItem101; private byte byItem102; private byte byItem103; - private byte byItem104; private byte byItem105; private byte byItem106; private byte byItem107; - private byte byItem108; private byte byItem109; private byte byItem110; private byte byItem111; - private byte byItem112; private byte byItem113; private byte byItem114; private byte byItem115; - private byte byItem116; private byte byItem117; private byte byItem118; private byte byItem119; - private byte byItem120; private byte byItem121; private byte byItem122; private byte byItem123; - private byte byItem124; private byte byItem125; private byte byItem126; private byte byItem127; - private byte byItem128; private byte byItem129; private byte byItem130; private byte byItem131; - private byte byItem132; private byte byItem133; private byte byItem134; private byte byItem135; - private byte byItem136; private byte byItem137; private byte byItem138; private byte byItem139; - private byte byItem140; private byte byItem141; private byte byItem142; private byte byItem143; - private byte byItem144; private byte byItem145; private byte byItem146; private byte byItem147; - private byte byItem148; private byte byItem149; private byte byItem150; private byte byItem151; - private byte byItem152; private byte byItem153; private byte byItem154; private byte byItem155; - private byte byItem156; private byte byItem157; private byte byItem158; private byte byItem159; - private byte byItem160; private byte byItem161; private byte byItem162; private byte byItem163; - private byte byItem164; private byte byItem165; private byte byItem166; private byte byItem167; - private byte byItem168; private byte byItem169; private byte byItem170; private byte byItem171; - private byte byItem172; private byte byItem173; private byte byItem174; private byte byItem175; - private byte byItem176; private byte byItem177; private byte byItem178; private byte byItem179; - private byte byItem180; private byte byItem181; private byte byItem182; private byte byItem183; - private byte byItem184; private byte byItem185; private byte byItem186; private byte byItem187; - private byte byItem188; private byte byItem189; private byte byItem190; private byte byItem191; - private byte byItem192; private byte byItem193; private byte byItem194; private byte byItem195; - private byte byItem196; private byte byItem197; private byte byItem198; private byte byItem199; - private byte byItem200; private byte byItem201; private byte byItem202; private byte byItem203; - private byte byItem204; private byte byItem205; private byte byItem206; private byte byItem207; - private byte byItem208; private byte byItem209; private byte byItem210; private byte byItem211; - private byte byItem212; private byte byItem213; private byte byItem214; private byte byItem215; - private byte byItem216; private byte byItem217; private byte byItem218; private byte byItem219; - private byte byItem220; private byte byItem221; private byte byItem222; private byte byItem223; - private byte byItem224; private byte byItem225; private byte byItem226; private byte byItem227; - private byte byItem228; private byte byItem229; private byte byItem230; private byte byItem231; - private byte byItem232; private byte byItem233; private byte byItem234; private byte byItem235; - private byte byItem236; private byte byItem237; private byte byItem238; private byte byItem239; - private byte byItem240; private byte byItem241; private byte byItem242; private byte byItem243; - private byte byItem244; private byte byItem245; private byte byItem246; private byte byItem247; - private byte byItem248; private byte byItem249; private byte byItem250; private byte byItem251; - private byte byItem252; private byte byItem253; private byte byItem254; private byte byItem255; - - /// - /// The normal get... - /// - /// - public string Get() - { - return (GetValue(true)); - } - - /// - /// Use this on Mac OS X if you have a call that uses a string - /// that doesn't include the prefix byte... - /// - /// - public string GetNoPrefix() - { - return (GetValue(false)); - } - - /// - /// Get our value... - /// - /// - private string GetValue(bool a_blMayHavePrefix) - { - // convert what we have into a byte array - byte[] abyItem = new byte[256]; - abyItem[0] = byItem000; abyItem[1] = byItem001; abyItem[2] = byItem002; abyItem[3] = byItem003; - abyItem[4] = byItem004; abyItem[5] = byItem005; abyItem[6] = byItem006; abyItem[7] = byItem007; - abyItem[8] = byItem008; abyItem[9] = byItem009; abyItem[10] = byItem010; abyItem[11] = byItem011; - abyItem[12] = byItem012; abyItem[13] = byItem013; abyItem[14] = byItem014; abyItem[15] = byItem015; - abyItem[16] = byItem016; abyItem[17] = byItem017; abyItem[18] = byItem018; abyItem[19] = byItem019; - abyItem[20] = byItem020; abyItem[21] = byItem021; abyItem[22] = byItem022; abyItem[23] = byItem023; - abyItem[24] = byItem024; abyItem[25] = byItem025; abyItem[26] = byItem026; abyItem[27] = byItem027; - abyItem[28] = byItem028; abyItem[29] = byItem029; abyItem[30] = byItem030; abyItem[31] = byItem031; - abyItem[32] = byItem032; abyItem[33] = byItem033; abyItem[34] = byItem034; abyItem[35] = byItem035; - abyItem[36] = byItem036; abyItem[37] = byItem037; abyItem[38] = byItem038; abyItem[39] = byItem039; - abyItem[40] = byItem040; abyItem[41] = byItem041; abyItem[42] = byItem042; abyItem[43] = byItem043; - abyItem[44] = byItem044; abyItem[45] = byItem045; abyItem[46] = byItem046; abyItem[47] = byItem047; - abyItem[48] = byItem048; abyItem[49] = byItem049; abyItem[50] = byItem050; abyItem[51] = byItem051; - abyItem[52] = byItem052; abyItem[53] = byItem053; abyItem[54] = byItem054; abyItem[55] = byItem055; - abyItem[56] = byItem056; abyItem[57] = byItem057; abyItem[58] = byItem058; abyItem[59] = byItem059; - abyItem[60] = byItem060; abyItem[61] = byItem061; abyItem[62] = byItem062; abyItem[63] = byItem063; - abyItem[64] = byItem064; abyItem[65] = byItem065; abyItem[66] = byItem066; abyItem[67] = byItem067; - abyItem[68] = byItem068; abyItem[69] = byItem069; abyItem[70] = byItem070; abyItem[71] = byItem071; - abyItem[72] = byItem072; abyItem[73] = byItem073; abyItem[74] = byItem074; abyItem[75] = byItem075; - abyItem[76] = byItem076; abyItem[77] = byItem077; abyItem[78] = byItem078; abyItem[79] = byItem079; - abyItem[80] = byItem080; abyItem[81] = byItem081; abyItem[82] = byItem082; abyItem[83] = byItem083; - abyItem[84] = byItem084; abyItem[85] = byItem085; abyItem[86] = byItem086; abyItem[87] = byItem087; - abyItem[88] = byItem088; abyItem[89] = byItem089; abyItem[90] = byItem090; abyItem[91] = byItem091; - abyItem[92] = byItem092; abyItem[93] = byItem093; abyItem[94] = byItem094; abyItem[95] = byItem095; - abyItem[96] = byItem096; abyItem[97] = byItem097; abyItem[98] = byItem098; abyItem[99] = byItem099; - abyItem[100] = byItem100; abyItem[101] = byItem101; abyItem[102] = byItem102; abyItem[103] = byItem103; - abyItem[104] = byItem104; abyItem[105] = byItem105; abyItem[106] = byItem106; abyItem[107] = byItem107; - abyItem[108] = byItem108; abyItem[109] = byItem109; abyItem[110] = byItem110; abyItem[111] = byItem111; - abyItem[112] = byItem112; abyItem[113] = byItem113; abyItem[114] = byItem114; abyItem[115] = byItem115; - abyItem[116] = byItem116; abyItem[117] = byItem117; abyItem[118] = byItem118; abyItem[119] = byItem119; - abyItem[120] = byItem120; abyItem[121] = byItem121; abyItem[122] = byItem122; abyItem[123] = byItem123; - abyItem[124] = byItem124; abyItem[125] = byItem125; abyItem[126] = byItem126; abyItem[127] = byItem127; - abyItem[128] = byItem128; abyItem[129] = byItem129; abyItem[130] = byItem130; abyItem[131] = byItem131; - abyItem[132] = byItem132; abyItem[133] = byItem133; abyItem[134] = byItem134; abyItem[135] = byItem135; - abyItem[136] = byItem136; abyItem[137] = byItem137; abyItem[138] = byItem138; abyItem[139] = byItem139; - abyItem[140] = byItem140; abyItem[141] = byItem141; abyItem[142] = byItem142; abyItem[143] = byItem143; - abyItem[144] = byItem144; abyItem[145] = byItem145; abyItem[146] = byItem146; abyItem[147] = byItem147; - abyItem[148] = byItem148; abyItem[149] = byItem149; abyItem[150] = byItem150; abyItem[151] = byItem151; - abyItem[152] = byItem152; abyItem[153] = byItem153; abyItem[154] = byItem154; abyItem[155] = byItem155; - abyItem[156] = byItem156; abyItem[157] = byItem157; abyItem[158] = byItem158; abyItem[159] = byItem159; - abyItem[160] = byItem160; abyItem[161] = byItem161; abyItem[162] = byItem162; abyItem[163] = byItem163; - abyItem[164] = byItem164; abyItem[165] = byItem165; abyItem[166] = byItem166; abyItem[167] = byItem167; - abyItem[168] = byItem168; abyItem[169] = byItem169; abyItem[170] = byItem170; abyItem[171] = byItem171; - abyItem[172] = byItem172; abyItem[173] = byItem173; abyItem[174] = byItem174; abyItem[175] = byItem175; - abyItem[176] = byItem176; abyItem[177] = byItem177; abyItem[178] = byItem178; abyItem[179] = byItem179; - abyItem[180] = byItem180; abyItem[181] = byItem181; abyItem[182] = byItem182; abyItem[183] = byItem183; - abyItem[184] = byItem184; abyItem[185] = byItem185; abyItem[186] = byItem186; abyItem[187] = byItem187; - abyItem[188] = byItem188; abyItem[189] = byItem189; abyItem[190] = byItem190; abyItem[191] = byItem191; - abyItem[192] = byItem192; abyItem[193] = byItem193; abyItem[194] = byItem194; abyItem[195] = byItem195; - abyItem[196] = byItem196; abyItem[197] = byItem197; abyItem[198] = byItem198; abyItem[199] = byItem199; - abyItem[200] = byItem200; abyItem[201] = byItem201; abyItem[202] = byItem202; abyItem[203] = byItem203; - abyItem[204] = byItem204; abyItem[205] = byItem205; abyItem[206] = byItem206; abyItem[207] = byItem207; - abyItem[208] = byItem208; abyItem[209] = byItem209; abyItem[210] = byItem210; abyItem[211] = byItem211; - abyItem[212] = byItem212; abyItem[213] = byItem213; abyItem[214] = byItem214; abyItem[215] = byItem215; - abyItem[216] = byItem216; abyItem[217] = byItem217; abyItem[218] = byItem218; abyItem[219] = byItem219; - abyItem[220] = byItem220; abyItem[221] = byItem221; abyItem[222] = byItem222; abyItem[223] = byItem223; - abyItem[224] = byItem224; abyItem[225] = byItem225; abyItem[226] = byItem226; abyItem[227] = byItem227; - abyItem[228] = byItem228; abyItem[229] = byItem229; abyItem[230] = byItem230; abyItem[231] = byItem231; - abyItem[232] = byItem232; abyItem[233] = byItem233; abyItem[234] = byItem234; abyItem[235] = byItem235; - abyItem[236] = byItem236; abyItem[237] = byItem237; abyItem[238] = byItem238; abyItem[239] = byItem239; - abyItem[240] = byItem240; abyItem[241] = byItem241; abyItem[242] = byItem242; abyItem[243] = byItem243; - abyItem[244] = byItem244; abyItem[245] = byItem245; abyItem[246] = byItem246; abyItem[247] = byItem247; - abyItem[248] = byItem248; abyItem[249] = byItem249; abyItem[250] = byItem250; abyItem[251] = byItem251; - abyItem[252] = byItem252; abyItem[253] = byItem253; abyItem[254] = byItem254; abyItem[255] = byItem255; - - // Zero anything after the NUL... - bool blNul = false; - for (int ii = 0; ii < abyItem.Length; ii++) - { - if (!blNul && (abyItem[ii] == 0)) - { - blNul = true; - } - else if (blNul) - { - abyItem[ii] = 0; - } - } - - // change encoding of byte array, then convert the bytes array to a string - string sz = Encoding.Unicode.GetString(Encoding.Convert(Language.GetEncoding(), Encoding.Unicode, abyItem)); - - // If the first character is a NUL, then return the empty string... - if (sz[0] == '\0') - { - return (""); - } - - // If we're running on a Mac, take off the prefix 'byte'... - if (a_blMayHavePrefix && (TWAIN.GetPlatform() == Platform.MACOSX)) - { - sz = sz.Remove(0, 1); - } - - // If we detect a NUL, then split around it... - if (sz.IndexOf('\0') >= 0) - { - sz = sz.Split(new char[] { '\0' })[0]; - } - - // All done... - return (sz); - } - - /// - /// The normal set... - /// - /// - public void Set(string a_sz) - { - SetValue(a_sz, true); - } - - /// - /// Use this on Mac OS X if you have a call that uses a string - /// that doesn't include the prefix byte... - /// - /// - public void SetNoPrefix(string a_sz) - { - SetValue(a_sz, false); - } - - /// - /// Set our value... - /// - /// - private void SetValue(string a_sz, bool a_blMayHavePrefix) - { - // If we're running on a Mac, tack on the prefix 'byte'... - if (a_sz == null) - { - a_sz = ""; - } - else if (a_blMayHavePrefix && (TWAIN.GetPlatform() == Platform.MACOSX)) - { - a_sz = (char)a_sz.Length + a_sz; - } - - // Make sure that we're NUL padded... - string sz = - a_sz + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; - if (sz.Length > 256) - { - sz = sz.Remove(256); - } - - // convert string to byte array, then change the encoding of the byte array - byte[] abyItem = Encoding.Convert(Encoding.Unicode, Language.GetEncoding(), Encoding.Unicode.GetBytes(sz)); - - // concert byte array to bytes - byItem000 = abyItem[0]; byItem001 = abyItem[1]; byItem002 = abyItem[2]; byItem003 = abyItem[3]; - byItem004 = abyItem[4]; byItem005 = abyItem[5]; byItem006 = abyItem[6]; byItem007 = abyItem[7]; - byItem008 = abyItem[8]; byItem009 = abyItem[9]; byItem010 = abyItem[10]; byItem011 = abyItem[11]; - byItem012 = abyItem[12]; byItem013 = abyItem[13]; byItem014 = abyItem[14]; byItem015 = abyItem[15]; - byItem016 = abyItem[16]; byItem017 = abyItem[17]; byItem018 = abyItem[18]; byItem019 = abyItem[19]; - byItem020 = abyItem[20]; byItem021 = abyItem[21]; byItem022 = abyItem[22]; byItem023 = abyItem[23]; - byItem024 = abyItem[24]; byItem025 = abyItem[25]; byItem026 = abyItem[26]; byItem027 = abyItem[27]; - byItem028 = abyItem[28]; byItem029 = abyItem[29]; byItem030 = abyItem[30]; byItem031 = abyItem[31]; - byItem032 = abyItem[32]; byItem033 = abyItem[33]; byItem034 = abyItem[34]; byItem035 = abyItem[35]; - byItem036 = abyItem[36]; byItem037 = abyItem[37]; byItem038 = abyItem[38]; byItem039 = abyItem[39]; - byItem040 = abyItem[40]; byItem041 = abyItem[41]; byItem042 = abyItem[42]; byItem043 = abyItem[43]; - byItem044 = abyItem[44]; byItem045 = abyItem[45]; byItem046 = abyItem[46]; byItem047 = abyItem[47]; - byItem048 = abyItem[48]; byItem049 = abyItem[49]; byItem050 = abyItem[50]; byItem051 = abyItem[51]; - byItem052 = abyItem[52]; byItem053 = abyItem[53]; byItem054 = abyItem[54]; byItem055 = abyItem[55]; - byItem056 = abyItem[56]; byItem057 = abyItem[57]; byItem058 = abyItem[58]; byItem059 = abyItem[59]; - byItem060 = abyItem[60]; byItem061 = abyItem[61]; byItem062 = abyItem[62]; byItem063 = abyItem[63]; - byItem064 = abyItem[64]; byItem065 = abyItem[65]; byItem066 = abyItem[66]; byItem067 = abyItem[67]; - byItem068 = abyItem[68]; byItem069 = abyItem[69]; byItem070 = abyItem[70]; byItem071 = abyItem[71]; - byItem072 = abyItem[72]; byItem073 = abyItem[73]; byItem074 = abyItem[74]; byItem075 = abyItem[75]; - byItem076 = abyItem[76]; byItem077 = abyItem[77]; byItem078 = abyItem[78]; byItem079 = abyItem[79]; - byItem080 = abyItem[80]; byItem081 = abyItem[81]; byItem082 = abyItem[82]; byItem083 = abyItem[83]; - byItem084 = abyItem[84]; byItem085 = abyItem[85]; byItem086 = abyItem[86]; byItem087 = abyItem[87]; - byItem088 = abyItem[88]; byItem089 = abyItem[89]; byItem090 = abyItem[90]; byItem091 = abyItem[91]; - byItem092 = abyItem[92]; byItem093 = abyItem[93]; byItem094 = abyItem[94]; byItem095 = abyItem[95]; - byItem096 = abyItem[96]; byItem097 = abyItem[97]; byItem098 = abyItem[98]; byItem099 = abyItem[99]; - byItem100 = abyItem[100]; byItem101 = abyItem[101]; byItem102 = abyItem[102]; byItem103 = abyItem[103]; - byItem104 = abyItem[104]; byItem105 = abyItem[105]; byItem106 = abyItem[106]; byItem107 = abyItem[107]; - byItem108 = abyItem[108]; byItem109 = abyItem[109]; byItem110 = abyItem[110]; byItem111 = abyItem[111]; - byItem112 = abyItem[112]; byItem113 = abyItem[113]; byItem114 = abyItem[114]; byItem115 = abyItem[115]; - byItem116 = abyItem[116]; byItem117 = abyItem[117]; byItem118 = abyItem[118]; byItem119 = abyItem[119]; - byItem120 = abyItem[120]; byItem121 = abyItem[121]; byItem122 = abyItem[122]; byItem123 = abyItem[123]; - byItem124 = abyItem[124]; byItem125 = abyItem[125]; byItem126 = abyItem[126]; byItem127 = abyItem[127]; - byItem128 = abyItem[128]; byItem129 = abyItem[129]; byItem130 = abyItem[130]; byItem131 = abyItem[131]; - byItem132 = abyItem[132]; byItem133 = abyItem[133]; byItem134 = abyItem[134]; byItem135 = abyItem[135]; - byItem136 = abyItem[136]; byItem137 = abyItem[137]; byItem138 = abyItem[138]; byItem139 = abyItem[139]; - byItem140 = abyItem[140]; byItem141 = abyItem[141]; byItem142 = abyItem[142]; byItem143 = abyItem[143]; - byItem144 = abyItem[144]; byItem145 = abyItem[145]; byItem146 = abyItem[146]; byItem147 = abyItem[147]; - byItem148 = abyItem[148]; byItem149 = abyItem[149]; byItem150 = abyItem[150]; byItem151 = abyItem[151]; - byItem152 = abyItem[152]; byItem153 = abyItem[153]; byItem154 = abyItem[154]; byItem155 = abyItem[155]; - byItem156 = abyItem[156]; byItem157 = abyItem[157]; byItem158 = abyItem[158]; byItem159 = abyItem[159]; - byItem160 = abyItem[160]; byItem161 = abyItem[161]; byItem162 = abyItem[162]; byItem163 = abyItem[163]; - byItem164 = abyItem[164]; byItem165 = abyItem[165]; byItem166 = abyItem[166]; byItem167 = abyItem[167]; - byItem168 = abyItem[168]; byItem169 = abyItem[169]; byItem170 = abyItem[170]; byItem171 = abyItem[171]; - byItem172 = abyItem[172]; byItem173 = abyItem[173]; byItem174 = abyItem[174]; byItem175 = abyItem[175]; - byItem176 = abyItem[176]; byItem177 = abyItem[177]; byItem178 = abyItem[178]; byItem179 = abyItem[179]; - byItem180 = abyItem[180]; byItem181 = abyItem[181]; byItem182 = abyItem[182]; byItem183 = abyItem[183]; - byItem184 = abyItem[184]; byItem185 = abyItem[185]; byItem186 = abyItem[186]; byItem187 = abyItem[187]; - byItem188 = abyItem[188]; byItem189 = abyItem[189]; byItem190 = abyItem[190]; byItem191 = abyItem[191]; - byItem192 = abyItem[192]; byItem193 = abyItem[193]; byItem194 = abyItem[194]; byItem195 = abyItem[195]; - byItem196 = abyItem[196]; byItem197 = abyItem[197]; byItem198 = abyItem[198]; byItem199 = abyItem[199]; - byItem200 = abyItem[200]; byItem201 = abyItem[201]; byItem202 = abyItem[202]; byItem203 = abyItem[203]; - byItem204 = abyItem[204]; byItem205 = abyItem[205]; byItem206 = abyItem[206]; byItem207 = abyItem[207]; - byItem208 = abyItem[208]; byItem209 = abyItem[209]; byItem210 = abyItem[210]; byItem211 = abyItem[211]; - byItem212 = abyItem[212]; byItem213 = abyItem[213]; byItem214 = abyItem[214]; byItem215 = abyItem[215]; - byItem216 = abyItem[216]; byItem217 = abyItem[217]; byItem218 = abyItem[218]; byItem219 = abyItem[219]; - byItem220 = abyItem[220]; byItem221 = abyItem[221]; byItem222 = abyItem[222]; byItem223 = abyItem[223]; - byItem224 = abyItem[224]; byItem225 = abyItem[225]; byItem226 = abyItem[226]; byItem227 = abyItem[227]; - byItem228 = abyItem[228]; byItem229 = abyItem[229]; byItem230 = abyItem[230]; byItem231 = abyItem[231]; - byItem232 = abyItem[232]; byItem233 = abyItem[233]; byItem234 = abyItem[234]; byItem235 = abyItem[235]; - byItem236 = abyItem[236]; byItem237 = abyItem[237]; byItem238 = abyItem[238]; byItem239 = abyItem[239]; - byItem240 = abyItem[240]; byItem241 = abyItem[241]; byItem242 = abyItem[242]; byItem243 = abyItem[243]; - byItem244 = abyItem[244]; byItem245 = abyItem[245]; byItem246 = abyItem[246]; byItem247 = abyItem[247]; - byItem248 = abyItem[248]; byItem249 = abyItem[249]; byItem250 = abyItem[250]; byItem251 = abyItem[251]; - byItem252 = abyItem[252]; byItem253 = abyItem[253]; byItem254 = abyItem[254]; byItem255 = abyItem[255]; - } - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Structure Definitions... - /////////////////////////////////////////////////////////////////////////////// - #region Structure Definitions.. - - /// - /// Fixed point structure type. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public partial struct TW_FIX32 - { - public short Whole; - public ushort Frac; - } - - /// - /// Defines a frame rectangle in ICAP_UNITS coordinates. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public partial struct TW_FRAME - { - public TW_FIX32 Left; - public TW_FIX32 Top; - public TW_FIX32 Right; - public TW_FIX32 Bottom; - } - - /// - /// Defines the parameters used for channel-specific transformation. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_DECODEFUNCTION - { - public TW_FIX32 StartIn; - public TW_FIX32 BreakIn; - public TW_FIX32 EndIn; - public TW_FIX32 StartOut; - public TW_FIX32 BreakOut; - public TW_FIX32 EndOut; - public TW_FIX32 Gamma; - public TW_FIX32 SampleCount; - } - - /// - /// Stores a Fixed point number in two parts, a whole and a fractional part. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_TRANSFORMSTAGE - { - public TW_DECODEFUNCTION Decode_0; - public TW_DECODEFUNCTION Decode_1; - public TW_DECODEFUNCTION Decode_2; - public TW_FIX32 Mix_0_0; - public TW_FIX32 Mix_0_1; - public TW_FIX32 Mix_0_2; - public TW_FIX32 Mix_1_0; - public TW_FIX32 Mix_1_1; - public TW_FIX32 Mix_1_2; - public TW_FIX32 Mix_2_0; - public TW_FIX32 Mix_2_1; - public TW_FIX32 Mix_2_2; - } - - /// - /// Stores a list of values for a capability, the ItemList is commented - /// out so that the caller can collect information about it with a - /// marshalling call... - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_ARRAY - { - public TWTY ItemType; - public uint NumItems; - //public byte[] ItemList; - } - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_ARRAY_MACOSX - { - public uint ItemType; - public uint NumItems; - //public byte[] ItemList; - } - - /// - /// Information about audio data. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_AUDIOINFO - { - public TW_STR255 Name; - public uint Reserved; - } - - /// - /// Used to register callbacks. - /// - [SuppressMessage("Microsoft.Design", "CA1049:TypesThatOwnNativeResourcesShouldBeDisposable")] - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_CALLBACK - { - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr CallBackProc; - public uint RefCon; - public ushort Message; - } - - /// - /// Used to register callbacks. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_CALLBACK2 - { - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr CallBackProc; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public UIntPtr RefCon; - public ushort Message; - } - - /// - /// Used by application to get/set capability from/in a data source. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Ansi)] - public struct TW_CAPABILITY - { - public CAP Cap; - public TWON ConType; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr hContainer; - } - - /// - /// Defines a CIE XYZ space tri-stimulus value. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_CIEPOINT - { - public TW_FIX32 X; - public TW_FIX32 Y; - public TW_FIX32 Z; - } - - /// - /// Defines the mapping from an RGB color space device into CIE 1931 (XYZ) color space. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_CIECOLOR - { - public ushort ColorSpace; - public short LowEndian; - public short DeviceDependent; - public int VersionNumber; - public TW_TRANSFORMSTAGE StageABC; - public TW_TRANSFORMSTAGE StageLNM; - public TW_CIEPOINT WhitePoint; - public TW_CIEPOINT BlackPoint; - public TW_CIEPOINT WhitePaper; - public TW_CIEPOINT BlackInk; - public TW_FIX32 Samples; - } - - /// - /// Allows for a data source and application to pass custom data to each other. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_CUSTOMDSDATA - { - public uint InfoLength; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr hData; - } - - /// - /// Provides information about the Event that was raised by the Source. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_DEVICEEVENT - { - public uint Event; - public TW_STR255 DeviceName; - public uint BatteryMinutes; - public short BatteryPercentage; - public int PowerSupply; - public TW_FIX32 XResolution; - public TW_FIX32 YResolution; - public uint FlashUsed2; - public uint AutomaticCapture; - public uint TimeBeforeFirstCapture; - public uint TimeBetweenCaptures; - } - - /// - /// This structure holds the tri-stimulus color palette information for TW_PALETTE8 structures. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_ELEMENT8 - { - public byte Index; - public byte Channel1; - public byte Channel2; - public byte Channel3; - } - - /// - /// DAT_ENTRYPOINT. returns essential entry points. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_ENTRYPOINT - { - public UInt32 Size; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr DSM_Entry; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr DSM_MemAllocate; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr DSM_MemFree; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr DSM_MemLock; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr DSM_MemUnlock; - } - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_ENTRYPOINT_LINUX64 - { - public long Size; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr DSM_Entry; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr DSM_MemAllocate; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr DSM_MemFree; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr DSM_MemLock; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr DSM_MemUnlock; - } - public struct TW_ENTRYPOINT_DELEGATES - { - public UInt32 Size; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr DSM_Entry; - public DSM_MEMALLOC DSM_MemAllocate; - public DSM_MEMFREE DSM_MemFree; - public DSM_MEMLOCK DSM_MemLock; - public DSM_MEMUNLOCK DSM_MemUnlock; - } - public delegate IntPtr DSM_MEMALLOC(uint size); - public delegate void DSM_MEMFREE(IntPtr handle); - public delegate IntPtr DSM_MEMLOCK(IntPtr handle); - public delegate void DSM_MEMUNLOCK(IntPtr handle); - - /// - /// Stores a group of enumerated values for a capability, the ItemList is - /// commented out so that the caller can collect information about it with - /// a marshalling call... - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_ENUMERATION - { - public TWTY ItemType; - public uint NumItems; - public uint CurrentIndex; - public uint DefaultIndex; - //public byte[] ItemList; - } - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_ENUMERATION_LINUX64 - { - public TWTY ItemType; - public ulong NumItems; - public ulong CurrentIndex; - public ulong DefaultIndex; - //public byte[] ItemList; - } - [StructLayout(LayoutKind.Sequential, Pack = 4)] - public struct TW_ENUMERATION_MACOSX - { - public uint ItemType; - public uint NumItems; - public uint CurrentIndex; - public uint DefaultIndex; - //public byte[] ItemList; - } - - /// - /// Used to pass application events/messages from the application to the Source. - /// - [SuppressMessage("Microsoft.Design", "CA1049:TypesThatOwnNativeResourcesShouldBeDisposable")] - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_EVENT - { - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr pEvent; - public ushort TWMessage; - } - - /// - /// DAT_FILTER... - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_FILTER_DESCRIPTOR - { - public UInt32 Size; - public UInt32 HueStart; - public UInt32 HueEnd; - public UInt32 SaturationStart; - public UInt32 SaturationEnd; - public UInt32 ValueStart; - public UInt32 ValueEnd; - public UInt32 Replacement; - } - - /// - /// DAT_FILTER... - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_FILTER - { - public UInt32 Size; - public UInt32 DescriptorCount; - public UInt32 MaxDescriptorCount; - public UInt32 Condition; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr hDescriptors; - } - - /// - /// This structure is used to pass specific information between the data source and the application. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_INFO - { - public ushort InfoId; - public ushort ItemType; - public ushort NumItems; - public ushort ReturnCode; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public UIntPtr Item; - } - - /// - /// This structure is used to pass specific information between the data source and the application. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_EXTIMAGEINFO - { - public uint NumInfos; - public TW_INFO Info_000; - public TW_INFO Info_001; - public TW_INFO Info_002; - public TW_INFO Info_003; - public TW_INFO Info_004; - public TW_INFO Info_005; - public TW_INFO Info_006; - public TW_INFO Info_007; - public TW_INFO Info_008; - public TW_INFO Info_009; - public TW_INFO Info_010; - public TW_INFO Info_011; - public TW_INFO Info_012; - public TW_INFO Info_013; - public TW_INFO Info_014; - public TW_INFO Info_015; - public TW_INFO Info_016; - public TW_INFO Info_017; - public TW_INFO Info_018; - public TW_INFO Info_019; - public TW_INFO Info_020; - public TW_INFO Info_021; - public TW_INFO Info_022; - public TW_INFO Info_023; - public TW_INFO Info_024; - public TW_INFO Info_025; - public TW_INFO Info_026; - public TW_INFO Info_027; - public TW_INFO Info_028; - public TW_INFO Info_029; - public TW_INFO Info_030; - public TW_INFO Info_031; - public TW_INFO Info_032; - public TW_INFO Info_033; - public TW_INFO Info_034; - public TW_INFO Info_035; - public TW_INFO Info_036; - public TW_INFO Info_037; - public TW_INFO Info_038; - public TW_INFO Info_039; - public TW_INFO Info_040; - public TW_INFO Info_041; - public TW_INFO Info_042; - public TW_INFO Info_043; - public TW_INFO Info_044; - public TW_INFO Info_045; - public TW_INFO Info_046; - public TW_INFO Info_047; - public TW_INFO Info_048; - public TW_INFO Info_049; - public TW_INFO Info_050; - public TW_INFO Info_051; - public TW_INFO Info_052; - public TW_INFO Info_053; - public TW_INFO Info_054; - public TW_INFO Info_055; - public TW_INFO Info_056; - public TW_INFO Info_057; - public TW_INFO Info_058; - public TW_INFO Info_059; - public TW_INFO Info_060; - public TW_INFO Info_061; - public TW_INFO Info_062; - public TW_INFO Info_063; - public TW_INFO Info_064; - public TW_INFO Info_065; - public TW_INFO Info_066; - public TW_INFO Info_067; - public TW_INFO Info_068; - public TW_INFO Info_069; - public TW_INFO Info_070; - public TW_INFO Info_071; - public TW_INFO Info_072; - public TW_INFO Info_073; - public TW_INFO Info_074; - public TW_INFO Info_075; - public TW_INFO Info_076; - public TW_INFO Info_077; - public TW_INFO Info_078; - public TW_INFO Info_079; - public TW_INFO Info_080; - public TW_INFO Info_081; - public TW_INFO Info_082; - public TW_INFO Info_083; - public TW_INFO Info_084; - public TW_INFO Info_085; - public TW_INFO Info_086; - public TW_INFO Info_087; - public TW_INFO Info_088; - public TW_INFO Info_089; - public TW_INFO Info_090; - public TW_INFO Info_091; - public TW_INFO Info_092; - public TW_INFO Info_093; - public TW_INFO Info_094; - public TW_INFO Info_095; - public TW_INFO Info_096; - public TW_INFO Info_097; - public TW_INFO Info_098; - public TW_INFO Info_099; - public TW_INFO Info_100; - public TW_INFO Info_101; - public TW_INFO Info_102; - public TW_INFO Info_103; - public TW_INFO Info_104; - public TW_INFO Info_105; - public TW_INFO Info_106; - public TW_INFO Info_107; - public TW_INFO Info_108; - public TW_INFO Info_109; - public TW_INFO Info_110; - public TW_INFO Info_111; - public TW_INFO Info_112; - public TW_INFO Info_113; - public TW_INFO Info_114; - public TW_INFO Info_115; - public TW_INFO Info_116; - public TW_INFO Info_117; - public TW_INFO Info_118; - public TW_INFO Info_119; - public TW_INFO Info_120; - public TW_INFO Info_121; - public TW_INFO Info_122; - public TW_INFO Info_123; - public TW_INFO Info_124; - public TW_INFO Info_125; - public TW_INFO Info_126; - public TW_INFO Info_127; - public TW_INFO Info_128; - public TW_INFO Info_129; - public TW_INFO Info_130; - public TW_INFO Info_131; - public TW_INFO Info_132; - public TW_INFO Info_133; - public TW_INFO Info_134; - public TW_INFO Info_135; - public TW_INFO Info_136; - public TW_INFO Info_137; - public TW_INFO Info_138; - public TW_INFO Info_139; - public TW_INFO Info_140; - public TW_INFO Info_141; - public TW_INFO Info_142; - public TW_INFO Info_143; - public TW_INFO Info_144; - public TW_INFO Info_145; - public TW_INFO Info_146; - public TW_INFO Info_147; - public TW_INFO Info_148; - public TW_INFO Info_149; - public TW_INFO Info_150; - public TW_INFO Info_151; - public TW_INFO Info_152; - public TW_INFO Info_153; - public TW_INFO Info_154; - public TW_INFO Info_155; - public TW_INFO Info_156; - public TW_INFO Info_157; - public TW_INFO Info_158; - public TW_INFO Info_159; - public TW_INFO Info_160; - public TW_INFO Info_161; - public TW_INFO Info_162; - public TW_INFO Info_163; - public TW_INFO Info_164; - public TW_INFO Info_165; - public TW_INFO Info_166; - public TW_INFO Info_167; - public TW_INFO Info_168; - public TW_INFO Info_169; - public TW_INFO Info_170; - public TW_INFO Info_171; - public TW_INFO Info_172; - public TW_INFO Info_173; - public TW_INFO Info_174; - public TW_INFO Info_175; - public TW_INFO Info_176; - public TW_INFO Info_177; - public TW_INFO Info_178; - public TW_INFO Info_179; - public TW_INFO Info_180; - public TW_INFO Info_181; - public TW_INFO Info_182; - public TW_INFO Info_183; - public TW_INFO Info_184; - public TW_INFO Info_185; - public TW_INFO Info_186; - public TW_INFO Info_187; - public TW_INFO Info_188; - public TW_INFO Info_189; - public TW_INFO Info_190; - public TW_INFO Info_191; - public TW_INFO Info_192; - public TW_INFO Info_193; - public TW_INFO Info_194; - public TW_INFO Info_195; - public TW_INFO Info_196; - public TW_INFO Info_197; - public TW_INFO Info_198; - public TW_INFO Info_199; - - public void Get(uint a_uIndex, ref TW_INFO a_twinfo) - { - switch (a_uIndex) - { - default: return; - case 0: a_twinfo = Info_000; return; - case 1: a_twinfo = Info_001; return; - case 2: a_twinfo = Info_002; return; - case 3: a_twinfo = Info_003; return; - case 4: a_twinfo = Info_004; return; - case 5: a_twinfo = Info_005; return; - case 6: a_twinfo = Info_006; return; - case 7: a_twinfo = Info_007; return; - case 8: a_twinfo = Info_008; return; - case 9: a_twinfo = Info_009; return; - case 10: a_twinfo = Info_010; return; - case 11: a_twinfo = Info_011; return; - case 12: a_twinfo = Info_012; return; - case 13: a_twinfo = Info_013; return; - case 14: a_twinfo = Info_014; return; - case 15: a_twinfo = Info_015; return; - case 16: a_twinfo = Info_016; return; - case 17: a_twinfo = Info_017; return; - case 18: a_twinfo = Info_018; return; - case 19: a_twinfo = Info_019; return; - case 20: a_twinfo = Info_020; return; - case 21: a_twinfo = Info_021; return; - case 22: a_twinfo = Info_022; return; - case 23: a_twinfo = Info_023; return; - case 24: a_twinfo = Info_024; return; - case 25: a_twinfo = Info_025; return; - case 26: a_twinfo = Info_026; return; - case 27: a_twinfo = Info_027; return; - case 28: a_twinfo = Info_028; return; - case 29: a_twinfo = Info_029; return; - case 30: a_twinfo = Info_030; return; - case 31: a_twinfo = Info_031; return; - case 32: a_twinfo = Info_032; return; - case 33: a_twinfo = Info_033; return; - case 34: a_twinfo = Info_034; return; - case 35: a_twinfo = Info_035; return; - case 36: a_twinfo = Info_036; return; - case 37: a_twinfo = Info_037; return; - case 38: a_twinfo = Info_038; return; - case 39: a_twinfo = Info_039; return; - case 40: a_twinfo = Info_040; return; - case 41: a_twinfo = Info_041; return; - case 42: a_twinfo = Info_042; return; - case 43: a_twinfo = Info_043; return; - case 44: a_twinfo = Info_044; return; - case 45: a_twinfo = Info_045; return; - case 46: a_twinfo = Info_046; return; - case 47: a_twinfo = Info_047; return; - case 48: a_twinfo = Info_048; return; - case 49: a_twinfo = Info_049; return; - case 50: a_twinfo = Info_050; return; - case 51: a_twinfo = Info_051; return; - case 52: a_twinfo = Info_052; return; - case 53: a_twinfo = Info_053; return; - case 54: a_twinfo = Info_054; return; - case 55: a_twinfo = Info_055; return; - case 56: a_twinfo = Info_056; return; - case 57: a_twinfo = Info_057; return; - case 58: a_twinfo = Info_058; return; - case 59: a_twinfo = Info_059; return; - case 60: a_twinfo = Info_060; return; - case 61: a_twinfo = Info_061; return; - case 62: a_twinfo = Info_062; return; - case 63: a_twinfo = Info_063; return; - case 64: a_twinfo = Info_064; return; - case 65: a_twinfo = Info_065; return; - case 66: a_twinfo = Info_066; return; - case 67: a_twinfo = Info_067; return; - case 68: a_twinfo = Info_068; return; - case 69: a_twinfo = Info_069; return; - case 70: a_twinfo = Info_070; return; - case 71: a_twinfo = Info_071; return; - case 72: a_twinfo = Info_072; return; - case 73: a_twinfo = Info_073; return; - case 74: a_twinfo = Info_074; return; - case 75: a_twinfo = Info_075; return; - case 76: a_twinfo = Info_076; return; - case 77: a_twinfo = Info_077; return; - case 78: a_twinfo = Info_078; return; - case 79: a_twinfo = Info_079; return; - case 80: a_twinfo = Info_080; return; - case 81: a_twinfo = Info_081; return; - case 82: a_twinfo = Info_082; return; - case 83: a_twinfo = Info_083; return; - case 84: a_twinfo = Info_084; return; - case 85: a_twinfo = Info_085; return; - case 86: a_twinfo = Info_086; return; - case 87: a_twinfo = Info_087; return; - case 88: a_twinfo = Info_088; return; - case 89: a_twinfo = Info_089; return; - case 90: a_twinfo = Info_090; return; - case 91: a_twinfo = Info_091; return; - case 92: a_twinfo = Info_092; return; - case 93: a_twinfo = Info_093; return; - case 94: a_twinfo = Info_094; return; - case 95: a_twinfo = Info_095; return; - case 96: a_twinfo = Info_096; return; - case 97: a_twinfo = Info_097; return; - case 98: a_twinfo = Info_098; return; - case 99: a_twinfo = Info_099; return; - case 100: a_twinfo = Info_100; return; - case 101: a_twinfo = Info_101; return; - case 102: a_twinfo = Info_102; return; - case 103: a_twinfo = Info_103; return; - case 104: a_twinfo = Info_104; return; - case 105: a_twinfo = Info_105; return; - case 106: a_twinfo = Info_106; return; - case 107: a_twinfo = Info_107; return; - case 108: a_twinfo = Info_108; return; - case 109: a_twinfo = Info_109; return; - case 110: a_twinfo = Info_110; return; - case 111: a_twinfo = Info_111; return; - case 112: a_twinfo = Info_112; return; - case 113: a_twinfo = Info_113; return; - case 114: a_twinfo = Info_114; return; - case 115: a_twinfo = Info_115; return; - case 116: a_twinfo = Info_116; return; - case 117: a_twinfo = Info_117; return; - case 118: a_twinfo = Info_118; return; - case 119: a_twinfo = Info_119; return; - case 120: a_twinfo = Info_120; return; - case 121: a_twinfo = Info_121; return; - case 122: a_twinfo = Info_122; return; - case 123: a_twinfo = Info_123; return; - case 124: a_twinfo = Info_124; return; - case 125: a_twinfo = Info_125; return; - case 126: a_twinfo = Info_126; return; - case 127: a_twinfo = Info_127; return; - case 128: a_twinfo = Info_128; return; - case 129: a_twinfo = Info_129; return; - case 130: a_twinfo = Info_130; return; - case 131: a_twinfo = Info_131; return; - case 132: a_twinfo = Info_132; return; - case 133: a_twinfo = Info_133; return; - case 134: a_twinfo = Info_134; return; - case 135: a_twinfo = Info_135; return; - case 136: a_twinfo = Info_136; return; - case 137: a_twinfo = Info_137; return; - case 138: a_twinfo = Info_138; return; - case 139: a_twinfo = Info_139; return; - case 140: a_twinfo = Info_140; return; - case 141: a_twinfo = Info_141; return; - case 142: a_twinfo = Info_142; return; - case 143: a_twinfo = Info_143; return; - case 144: a_twinfo = Info_144; return; - case 145: a_twinfo = Info_145; return; - case 146: a_twinfo = Info_146; return; - case 147: a_twinfo = Info_147; return; - case 148: a_twinfo = Info_148; return; - case 149: a_twinfo = Info_149; return; - case 150: a_twinfo = Info_150; return; - case 151: a_twinfo = Info_151; return; - case 152: a_twinfo = Info_152; return; - case 153: a_twinfo = Info_153; return; - case 154: a_twinfo = Info_154; return; - case 155: a_twinfo = Info_155; return; - case 156: a_twinfo = Info_156; return; - case 157: a_twinfo = Info_157; return; - case 158: a_twinfo = Info_158; return; - case 159: a_twinfo = Info_159; return; - case 160: a_twinfo = Info_160; return; - case 161: a_twinfo = Info_161; return; - case 162: a_twinfo = Info_162; return; - case 163: a_twinfo = Info_163; return; - case 164: a_twinfo = Info_164; return; - case 165: a_twinfo = Info_165; return; - case 166: a_twinfo = Info_166; return; - case 167: a_twinfo = Info_167; return; - case 168: a_twinfo = Info_168; return; - case 169: a_twinfo = Info_169; return; - case 170: a_twinfo = Info_170; return; - case 171: a_twinfo = Info_171; return; - case 172: a_twinfo = Info_172; return; - case 173: a_twinfo = Info_173; return; - case 174: a_twinfo = Info_174; return; - case 175: a_twinfo = Info_175; return; - case 176: a_twinfo = Info_176; return; - case 177: a_twinfo = Info_177; return; - case 178: a_twinfo = Info_178; return; - case 179: a_twinfo = Info_179; return; - case 180: a_twinfo = Info_180; return; - case 181: a_twinfo = Info_181; return; - case 182: a_twinfo = Info_182; return; - case 183: a_twinfo = Info_183; return; - case 184: a_twinfo = Info_184; return; - case 185: a_twinfo = Info_185; return; - case 186: a_twinfo = Info_186; return; - case 187: a_twinfo = Info_187; return; - case 188: a_twinfo = Info_188; return; - case 189: a_twinfo = Info_189; return; - case 190: a_twinfo = Info_190; return; - case 191: a_twinfo = Info_191; return; - case 192: a_twinfo = Info_192; return; - case 193: a_twinfo = Info_193; return; - case 194: a_twinfo = Info_194; return; - case 195: a_twinfo = Info_195; return; - case 196: a_twinfo = Info_196; return; - case 197: a_twinfo = Info_197; return; - case 198: a_twinfo = Info_198; return; - case 199: a_twinfo = Info_199; return; - } - } - - public void Set(uint a_uIndex, ref TW_INFO a_twinfo) - { - switch (a_uIndex) - { - default: return; - case 0: Info_000 = a_twinfo; return; - case 1: Info_001 = a_twinfo; return; - case 2: Info_002 = a_twinfo; return; - case 3: Info_003 = a_twinfo; return; - case 4: Info_004 = a_twinfo; return; - case 5: Info_005 = a_twinfo; return; - case 6: Info_006 = a_twinfo; return; - case 7: Info_007 = a_twinfo; return; - case 8: Info_008 = a_twinfo; return; - case 9: Info_009 = a_twinfo; return; - case 10: Info_010 = a_twinfo; return; - case 11: Info_011 = a_twinfo; return; - case 12: Info_012 = a_twinfo; return; - case 13: Info_013 = a_twinfo; return; - case 14: Info_014 = a_twinfo; return; - case 15: Info_015 = a_twinfo; return; - case 16: Info_016 = a_twinfo; return; - case 17: Info_017 = a_twinfo; return; - case 18: Info_018 = a_twinfo; return; - case 19: Info_019 = a_twinfo; return; - case 20: Info_020 = a_twinfo; return; - case 21: Info_021 = a_twinfo; return; - case 22: Info_022 = a_twinfo; return; - case 23: Info_023 = a_twinfo; return; - case 24: Info_024 = a_twinfo; return; - case 25: Info_025 = a_twinfo; return; - case 26: Info_026 = a_twinfo; return; - case 27: Info_027 = a_twinfo; return; - case 28: Info_028 = a_twinfo; return; - case 29: Info_029 = a_twinfo; return; - case 30: Info_030 = a_twinfo; return; - case 31: Info_031 = a_twinfo; return; - case 32: Info_032 = a_twinfo; return; - case 33: Info_033 = a_twinfo; return; - case 34: Info_034 = a_twinfo; return; - case 35: Info_035 = a_twinfo; return; - case 36: Info_036 = a_twinfo; return; - case 37: Info_037 = a_twinfo; return; - case 38: Info_038 = a_twinfo; return; - case 39: Info_039 = a_twinfo; return; - case 40: Info_040 = a_twinfo; return; - case 41: Info_041 = a_twinfo; return; - case 42: Info_042 = a_twinfo; return; - case 43: Info_043 = a_twinfo; return; - case 44: Info_044 = a_twinfo; return; - case 45: Info_045 = a_twinfo; return; - case 46: Info_046 = a_twinfo; return; - case 47: Info_047 = a_twinfo; return; - case 48: Info_048 = a_twinfo; return; - case 49: Info_049 = a_twinfo; return; - case 50: Info_050 = a_twinfo; return; - case 51: Info_051 = a_twinfo; return; - case 52: Info_052 = a_twinfo; return; - case 53: Info_053 = a_twinfo; return; - case 54: Info_054 = a_twinfo; return; - case 55: Info_055 = a_twinfo; return; - case 56: Info_056 = a_twinfo; return; - case 57: Info_057 = a_twinfo; return; - case 58: Info_058 = a_twinfo; return; - case 59: Info_059 = a_twinfo; return; - case 60: Info_060 = a_twinfo; return; - case 61: Info_061 = a_twinfo; return; - case 62: Info_062 = a_twinfo; return; - case 63: Info_063 = a_twinfo; return; - case 64: Info_064 = a_twinfo; return; - case 65: Info_065 = a_twinfo; return; - case 66: Info_066 = a_twinfo; return; - case 67: Info_067 = a_twinfo; return; - case 68: Info_068 = a_twinfo; return; - case 69: Info_069 = a_twinfo; return; - case 70: Info_070 = a_twinfo; return; - case 71: Info_071 = a_twinfo; return; - case 72: Info_072 = a_twinfo; return; - case 73: Info_073 = a_twinfo; return; - case 74: Info_074 = a_twinfo; return; - case 75: Info_075 = a_twinfo; return; - case 76: Info_076 = a_twinfo; return; - case 77: Info_077 = a_twinfo; return; - case 78: Info_078 = a_twinfo; return; - case 79: Info_079 = a_twinfo; return; - case 80: Info_080 = a_twinfo; return; - case 81: Info_081 = a_twinfo; return; - case 82: Info_082 = a_twinfo; return; - case 83: Info_083 = a_twinfo; return; - case 84: Info_084 = a_twinfo; return; - case 85: Info_085 = a_twinfo; return; - case 86: Info_086 = a_twinfo; return; - case 87: Info_087 = a_twinfo; return; - case 88: Info_088 = a_twinfo; return; - case 89: Info_089 = a_twinfo; return; - case 90: Info_090 = a_twinfo; return; - case 91: Info_091 = a_twinfo; return; - case 92: Info_092 = a_twinfo; return; - case 93: Info_093 = a_twinfo; return; - case 94: Info_094 = a_twinfo; return; - case 95: Info_095 = a_twinfo; return; - case 96: Info_096 = a_twinfo; return; - case 97: Info_097 = a_twinfo; return; - case 98: Info_098 = a_twinfo; return; - case 99: Info_099 = a_twinfo; return; - case 100: Info_100 = a_twinfo; return; - case 101: Info_101 = a_twinfo; return; - case 102: Info_102 = a_twinfo; return; - case 103: Info_103 = a_twinfo; return; - case 104: Info_104 = a_twinfo; return; - case 105: Info_105 = a_twinfo; return; - case 106: Info_106 = a_twinfo; return; - case 107: Info_107 = a_twinfo; return; - case 108: Info_108 = a_twinfo; return; - case 109: Info_109 = a_twinfo; return; - case 110: Info_110 = a_twinfo; return; - case 111: Info_111 = a_twinfo; return; - case 112: Info_112 = a_twinfo; return; - case 113: Info_113 = a_twinfo; return; - case 114: Info_114 = a_twinfo; return; - case 115: Info_115 = a_twinfo; return; - case 116: Info_116 = a_twinfo; return; - case 117: Info_117 = a_twinfo; return; - case 118: Info_118 = a_twinfo; return; - case 119: Info_119 = a_twinfo; return; - case 120: Info_120 = a_twinfo; return; - case 121: Info_121 = a_twinfo; return; - case 122: Info_122 = a_twinfo; return; - case 123: Info_123 = a_twinfo; return; - case 124: Info_124 = a_twinfo; return; - case 125: Info_125 = a_twinfo; return; - case 126: Info_126 = a_twinfo; return; - case 127: Info_127 = a_twinfo; return; - case 128: Info_128 = a_twinfo; return; - case 129: Info_129 = a_twinfo; return; - case 130: Info_130 = a_twinfo; return; - case 131: Info_131 = a_twinfo; return; - case 132: Info_132 = a_twinfo; return; - case 133: Info_133 = a_twinfo; return; - case 134: Info_134 = a_twinfo; return; - case 135: Info_135 = a_twinfo; return; - case 136: Info_136 = a_twinfo; return; - case 137: Info_137 = a_twinfo; return; - case 138: Info_138 = a_twinfo; return; - case 139: Info_139 = a_twinfo; return; - case 140: Info_140 = a_twinfo; return; - case 141: Info_141 = a_twinfo; return; - case 142: Info_142 = a_twinfo; return; - case 143: Info_143 = a_twinfo; return; - case 144: Info_144 = a_twinfo; return; - case 145: Info_145 = a_twinfo; return; - case 146: Info_146 = a_twinfo; return; - case 147: Info_147 = a_twinfo; return; - case 148: Info_148 = a_twinfo; return; - case 149: Info_149 = a_twinfo; return; - case 150: Info_150 = a_twinfo; return; - case 151: Info_151 = a_twinfo; return; - case 152: Info_152 = a_twinfo; return; - case 153: Info_153 = a_twinfo; return; - case 154: Info_154 = a_twinfo; return; - case 155: Info_155 = a_twinfo; return; - case 156: Info_156 = a_twinfo; return; - case 157: Info_157 = a_twinfo; return; - case 158: Info_158 = a_twinfo; return; - case 159: Info_159 = a_twinfo; return; - case 160: Info_160 = a_twinfo; return; - case 161: Info_161 = a_twinfo; return; - case 162: Info_162 = a_twinfo; return; - case 163: Info_163 = a_twinfo; return; - case 164: Info_164 = a_twinfo; return; - case 165: Info_165 = a_twinfo; return; - case 166: Info_166 = a_twinfo; return; - case 167: Info_167 = a_twinfo; return; - case 168: Info_168 = a_twinfo; return; - case 169: Info_169 = a_twinfo; return; - case 170: Info_170 = a_twinfo; return; - case 171: Info_171 = a_twinfo; return; - case 172: Info_172 = a_twinfo; return; - case 173: Info_173 = a_twinfo; return; - case 174: Info_174 = a_twinfo; return; - case 175: Info_175 = a_twinfo; return; - case 176: Info_176 = a_twinfo; return; - case 177: Info_177 = a_twinfo; return; - case 178: Info_178 = a_twinfo; return; - case 179: Info_179 = a_twinfo; return; - case 180: Info_180 = a_twinfo; return; - case 181: Info_181 = a_twinfo; return; - case 182: Info_182 = a_twinfo; return; - case 183: Info_183 = a_twinfo; return; - case 184: Info_184 = a_twinfo; return; - case 185: Info_185 = a_twinfo; return; - case 186: Info_186 = a_twinfo; return; - case 187: Info_187 = a_twinfo; return; - case 188: Info_188 = a_twinfo; return; - case 189: Info_189 = a_twinfo; return; - case 190: Info_190 = a_twinfo; return; - case 191: Info_191 = a_twinfo; return; - case 192: Info_192 = a_twinfo; return; - case 193: Info_193 = a_twinfo; return; - case 194: Info_194 = a_twinfo; return; - case 195: Info_195 = a_twinfo; return; - case 196: Info_196 = a_twinfo; return; - case 197: Info_197 = a_twinfo; return; - case 198: Info_198 = a_twinfo; return; - case 199: Info_199 = a_twinfo; return; - } - } - } - - /// - /// Provides information about the currently selected device. - /// TBD -- need a 32/64 bit solution for this mess - /// - [SuppressMessage("Microsoft.Portability", "CA1900:ValueTypeFieldsShouldBePortable", MessageId = "ModifiedTimeDate")] - [SuppressMessage("Microsoft.Portability", "CA1900:ValueTypeFieldsShouldBePortable", MessageId = "CreateTimeDate")] - [StructLayout(LayoutKind.Explicit, Pack = 2)] - public struct TW_FILESYSTEM - { - [FieldOffset(0)] - public TW_STR255 InputName; - - [FieldOffset(256)] - public TW_STR255 OutputName; - - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - [FieldOffset(512)] - public IntPtr Context; - - [FieldOffset(520)] - public Int32 Recursive; - [FieldOffset(520)] - public UInt16 Subdirectories; - - [FieldOffset(524)] - public Int32 FileType; - [FieldOffset(524)] - public UInt32 FileSystemType; - - [FieldOffset(528)] - public UInt32 Size; - - [FieldOffset(532)] - public TW_STR32 CreateTimeDate; - - [FieldOffset(566)] - public TW_STR32 ModifiedTimeDate; - - [FieldOffset(600)] - public UInt32 FreeSpace; - - [FieldOffset(604)] - public UInt32 NewImageSize; - - [FieldOffset(608)] - public UInt32 NumberOfFiles; - - [FieldOffset(612)] - public UInt32 NumberOfSnippets; - - [FieldOffset(616)] - public UInt32 DeviceGroupMask; - - [FieldOffset(620)] - public byte Reserved; - - [FieldOffset(1127)] // 620 + 508 - 1 - private byte ReservedEnd; - } - [SuppressMessage("Microsoft.Portability", "CA1900:ValueTypeFieldsShouldBePortable", MessageId = "ModifiedTimeDate")] - [StructLayout(LayoutKind.Explicit, Pack = 2)] - public struct TW_FILESYSTEM_LEGACY - { - [FieldOffset(0)] - public TW_STR255 InputName; - - [FieldOffset(256)] - public TW_STR255 OutputName; - - [FieldOffset(512)] - public UInt32 Context; - - [FieldOffset(516)] - public Int32 Recursive; - [FieldOffset(516)] - public UInt16 Subdirectories; - - [FieldOffset(520)] - public Int32 FileType; - [FieldOffset(520)] - public UInt32 FileSystemType; - - [FieldOffset(524)] - public UInt32 Size; - - [FieldOffset(528)] - public TW_STR32 CreateTimeDate; - - [FieldOffset(562)] - public TW_STR32 ModifiedTimeDate; - - [FieldOffset(596)] - public UInt32 FreeSpace; - - [FieldOffset(600)] - public UInt32 NewImageSize; - - [FieldOffset(604)] - public UInt32 NumberOfFiles; - - [FieldOffset(608)] - public UInt32 NumberOfSnippets; - - [FieldOffset(612)] - public UInt32 DeviceGroupMask; - - [FieldOffset(616)] - public byte Reserved; - - [FieldOffset(1123)] // 616 + 508 - 1 - private byte ReservedEnd; - } - - /// - /// This structure is used by the application to specify a set of mapping values to be applied to grayscale data. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_GRAYRESPONSE - { - public TW_ELEMENT8 Response_00; - } - - /// - /// A general way to describe the version of software that is running. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Ansi)] - public partial struct TW_VERSION - { - public ushort MajorNum; - public ushort MinorNum; - public TWLG Language; - public TWCY Country; - public TW_STR32 Info; - } - - /// - /// Provides identification information about a TWAIN entity. - /// The use of Padding is there to allow us to use the structure - /// with Linux 64-bit systems where the TW_INT32 and TW_UINT32 - /// types were long, and therefore 64-bits in size. This should - /// have no impact with well-behaved systems that have these types - /// as 32-bit, but should prevent memory corruption in all other - /// situations... - /// - [StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Ansi)] - public partial struct TW_IDENTITY - { - public ulong Id; - public TW_VERSION Version; - public ushort ProtocolMajor; - public ushort ProtocolMinor; - public uint SupportedGroups; - public TW_STR32 Manufacturer; - public TW_STR32 ProductFamily; - public TW_STR32 ProductName; - } - [StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Ansi)] - public struct TW_IDENTITY_LEGACY - { - public uint Id; - public TW_VERSION Version; - public ushort ProtocolMajor; - public ushort ProtocolMinor; - public uint SupportedGroups; - public TW_STR32 Manufacturer; - public TW_STR32 ProductFamily; - public TW_STR32 ProductName; - private UInt64 Padding; // accounts for Id and SupportedGroups - } - [StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Ansi)] - public struct TW_IDENTITY_LINUX64 - { - public ulong Id; - public TW_VERSION Version; - public ushort ProtocolMajor; - public ushort ProtocolMinor; - public ulong SupportedGroups; - public TW_STR32 Manufacturer; - public TW_STR32 ProductFamily; - public TW_STR32 ProductName; - } - [StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Ansi)] - public struct TW_IDENTITY_MACOSX - { - public uint Id; - public TW_VERSION Version; - public ushort ProtocolMajor; - public ushort ProtocolMinor; - private ushort padding; - public uint SupportedGroups; - public TW_STR32 Manufacturer; - public TW_STR32 ProductFamily; - public TW_STR32 ProductName; - } - - /// - /// Describes the “real” image data, that is, the complete image being transferred between the Source and application. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_IMAGEINFO - { - public TW_FIX32 XResolution; - public TW_FIX32 YResolution; - public int ImageWidth; - public int ImageLength; - public short SamplesPerPixel; - public short BitsPerSample_0; - public short BitsPerSample_1; - public short BitsPerSample_2; - public short BitsPerSample_3; - public short BitsPerSample_4; - public short BitsPerSample_5; - public short BitsPerSample_6; - public short BitsPerSample_7; - public short BitsPerPixel; - public ushort Planar; - public short PixelType; - public ushort Compression; - } - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_IMAGEINFO_LINUX64 - { - public TW_FIX32 XResolution; - public TW_FIX32 YResolution; - public int ImageWidth; - public int ImageLength; - public short SamplesPerPixel; - public short BitsPerSample_0; - public short BitsPerSample_1; - public short BitsPerSample_2; - public short BitsPerSample_3; - public short BitsPerSample_4; - public short BitsPerSample_5; - public short BitsPerSample_6; - public short BitsPerSample_7; - public short BitsPerPixel; - public ushort Planar; - public short PixelType; - public ushort Compression; - } - - /// - /// Involves information about the original size of the acquired image. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_IMAGELAYOUT - { - public TW_FRAME Frame; - public uint DocumentNumber; - public uint PageNumber; - public uint FrameNumber; - } - - /// - /// Provides information for managing memory buffers. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_MEMORY - { - public uint Flags; - public uint Length; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr TheMem; - } - - /// - /// Describes the form of the acquired data being passed from the Source to the application. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_IMAGEMEMXFER - { - public ushort Compression; - public uint BytesPerRow; - public uint Columns; - public uint Rows; - public uint XOffset; - public uint YOffset; - public uint BytesWritten; - public TW_MEMORY Memory; - } - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_IMAGEMEMXFER_LINUX64 - { - public ushort Compression; - public UInt64 BytesPerRow; - public UInt64 Columns; - public UInt64 Rows; - public UInt64 XOffset; - public UInt64 YOffset; - public UInt64 BytesWritten; - public UInt64 MemoryFlags; - public UInt64 MemoryLength; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr MemoryTheMem; - } - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_IMAGEMEMXFER_MACOSX - { - public uint Compression; - public uint BytesPerRow; - public uint Columns; - public uint Rows; - public uint XOffset; - public uint YOffset; - public uint BytesWritten; - public TW_MEMORY Memory; - } - - /// - /// Describes the information necessary to transfer a JPEG-compressed image. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_JPEGCOMPRESSION - { - public ushort ColorSpace; - public uint SubSampling; - public ushort NumComponents; - public ushort QuantMap_0; - public ushort QuantMap_1; - public ushort QuantMap_2; - public ushort QuantMap_3; - public TW_MEMORY QuantTable_0; - public TW_MEMORY QuantTable_1; - public TW_MEMORY QuantTable_2; - public TW_MEMORY QuantTable_3; - public ushort HuffmanMap_0; - public ushort HuffmanMap_1; - public ushort HuffmanMap_2; - public ushort HuffmanMap_3; - public TW_MEMORY HuffmanDC_0; - public TW_MEMORY HuffmanDC_1; - public TW_MEMORY HuffmanAC_0; - public TW_MEMORY HuffmanAC_2; - } - - /// - /// Collects scanning metrics after returning to state 4 - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_METRICS - { - public uint SizeOf; - public uint ImageCount; - public uint SheetCount; - } - - /// - /// Stores a single value (item) which describes a capability. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_ONEVALUE - { - public TWTY ItemType; - // public uint Item; - } - [StructLayout(LayoutKind.Sequential, Pack = 4)] - public struct TW_ONEVALUE_MACOSX - { - public uint ItemType; - // public uint Item; - } - - /// - /// This structure holds the color palette information. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_PALETTE8 - { - public ushort Flags; - public ushort Length; - public TW_ELEMENT8 Colors_000; - } - - /// - /// Used to bypass the TWAIN protocol when communicating with a device. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_PASSTHRU - { - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr pCommand; - public uint CommandBytes; - public int Direction; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr pData; - public uint DataBytes; - public uint DataBytesXfered; - } - - /// - /// This structure tells the application how many more complete transfers the Source currently has available. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_PENDINGXFERS - { - public ushort Count; - public uint EOJ; - } - - /// - /// Stores a range of individual values describing a capability. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_RANGE - { - public TWTY ItemType; - public uint MinValue; - public uint MaxValue; - public uint StepSize; - public uint DefaultValue; - public uint CurrentValue; - } - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_RANGE_LINUX64 - { - public TWTY ItemType; - public ulong MinValue; - public ulong MaxValue; - public ulong StepSize; - public ulong DefaultValue; - public ulong CurrentValue; - } - [StructLayout(LayoutKind.Sequential, Pack = 4)] - public struct TW_RANGE_MACOSX - { - public uint ItemType; - public uint MinValue; - public uint MaxValue; - public uint StepSize; - public uint DefaultValue; - public uint CurrentValue; - } - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_RANGE_FIX32 - { - public TWTY ItemType; - public TW_FIX32 MinValue; - public TW_FIX32 MaxValue; - public TW_FIX32 StepSize; - public TW_FIX32 DefaultValue; - public TW_FIX32 CurrentValue; - } - [StructLayout(LayoutKind.Sequential, Pack = 4)] - public struct TW_RANGE_FIX32_MACOSX - { - public uint ItemType; - public TW_FIX32 MinValue; - public TW_FIX32 MaxValue; - public TW_FIX32 StepSize; - public TW_FIX32 DefaultValue; - public TW_FIX32 CurrentValue; - } - - /// - /// This structure is used by the application to specify a set of mapping values to be applied to RGB color data. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_RGBRESPONSE - { - public TW_ELEMENT8 Response_00; - } - - /// - /// Describes the file format and file specification information for a transfer through a disk file. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_SETUPFILEXFER - { - public TW_STR255 FileName; - public TWFF Format; - public short VRefNum; - } - - /// - /// Provides the application information about the Source’s requirements and preferences regarding allocation of transfer buffer(s). - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_SETUPMEMXFER - { - public uint MinBufSize; - public uint MaxBufSize; - public uint Preferred; - } - - /// - /// Describes the status of a source. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_STATUS - { - public ushort ConditionCode; - public ushort Data; - } - - /// - /// Translates the contents of Status into a localized UTF8string. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2)] - public struct TW_STATUSUTF8 - { - public TW_STATUS Status; - public uint Size; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr UTF8string; - } - - /// - /// Passthru for TWAIN Direct tasks. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Ansi)] - public struct TW_TWAINDIRECT - { - public uint SizeOf; - public ushort CommunicationManager; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr Send; - public uint SendSize; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr Receive; - public uint ReceiveSize; - } - - /// - /// This structure is used to handle the user interface coordination between an application and a Source. - /// - [StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Ansi)] - public struct TW_USERINTERFACE - { - public ushort ShowUI; - public ushort ModalUI; - [SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")] - public IntPtr hParent; - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Generic Constants... - /////////////////////////////////////////////////////////////////////////////// - #region Generic Constants... - - /// - /// Container Types... - /// - public enum TWON : ushort - { - ARRAY = 3, - ENUMERATION = 4, - ONEVALUE = 5, - RANGE = 6, - - ICONID = 962, - DSMID = 461, - DSMCODEID = 63 - } - - /// - /// Don't care values... - /// - public const byte TWON_DONTCARE8 = 0xff; - public const ushort TWON_DONTCARE16 = 0xff; - public const uint TWON_DONTCARE32 = 0xffffffff; - - /// - /// Flags used in TW_MEMORY structure. - /// - public enum TWMF : ushort - { - APPOWNS = 0x0001, - DSMOWNS = 0x0002, - DSOWNS = 0x0004, - POINTER = 0x0008, - HANDLE = 0x0010 - } - - /// - /// Type values... - /// - public enum TWTY : ushort - { - INT8 = 0x0000, - INT16 = 0x0001, - INT32 = 0x0002, - - UINT8 = 0x0003, - UINT16 = 0x0004, - UINT32 = 0x0005, - - BOOL = 0x0006, - - FIX32 = 0x0007, - - FRAME = 0x0008, - - STR32 = 0x0009, - STR64 = 0x000a, - STR128 = 0x000b, - STR255 = 0x000c, - HANDLE = 0x000f - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Capability Constants... - /////////////////////////////////////////////////////////////////////////////// - #region Capability Constants... - - /// - /// CAP_ALARMS values - /// - public enum TWAL : ushort - { - ALARM = 0, - FEEDERERROR = 1, - FEEDERWARNING = 2, - BARCODE = 3, - DOUBLEFEED = 4, - JAM = 5, - PATCHCODE = 6, - POWER = 7, - SKEW = 8 - } - - /// - /// ICAP_AUTOSIZE values - /// - public enum TWAS : ushort - { - NONE = 0, - AUTO = 1, - CURRENT = 2 - } - - /// - /// TWEI_BARCODEROTATION values - /// - public enum TWBCOR : ushort - { - ROT0 = 0, - ROT90 = 1, - ROT180 = 2, - ROT270 = 3, - ROTX = 4 - } - - /// - /// ICAP_BARCODESEARCHMODE values - /// - public enum TWBD : ushort - { - HORZ = 0, - VERT = 1, - HORZVERT = 2, - VERTHORZ = 3 - } - - /// - /// ICAP_BITORDER values - /// - public enum TWBO : ushort - { - LSBFIRST = 0, - MSBFIRST = 1 - } - - /// - /// ICAP_AUTODISCARDBLANKPAGES values - /// - public enum TWBP : short - { - DISABLE = -2, - AUTO = -1 - } - - /// - /// ICAP_BITDEPTHREDUCTION values - /// - public enum TWBR : ushort - { - THRESHOLD = 0, - HALFTONE = 1, - CUSTHALFTONE = 2, - DIFFUSION = 3, - DYNAMICTHRESHOLD = 4 - } - - /// - /// ICAP_SUPPORTEDBARCODETYPES and TWEI_BARCODETYPE values - /// - public enum TWBT : ushort - { - X3OF9 = 0, // 3OF9 in TWAIN.H - X2OF5INTERLEAVED = 1, // 2OF5INTERLEAVED in TWAIN.H - X2OF5NONINTERLEAVED = 2, // 2OF5NONINTERLEAVED in TWAIN.H - CODE93 = 3, - CODE128 = 4, - UCC128 = 5, - CODABAR = 6, - UPCA = 7, - UPCE = 8, - EAN8 = 9, - EAN13 = 10, - POSTNET = 11, - PDF417 = 12, - X2OF5INDUSTRIAL = 13, // 2OF5INDUSTRIAL in TWAIN.H - X2OF5MATRIX = 14, // 2OF5MATRIX in TWAIN.H - X2OF5DATALOGIC = 15, // 2OF5DATALOGIC in TWAIN.H - X2OF5IATA = 16, // 2OF5IATA in TWAIN.H - X3OF9FULLASCII = 17, // 3OF9FULLASCII in TWAIN.H - CODABARWITHSTARTSTOP = 18, - MAXICODE = 19, - QRCODE = 20 - } - - /// - /// ICAP_COMPRESSION values - /// - public enum TWCP : ushort - { - NONE = 0, - PACKBITS = 1, - GROUP31D = 2, - GROUP31DEOL = 3, - GROUP32D = 4, - GROUP4 = 5, - JPEG = 6, - LZW = 7, - JBIG = 8, - PNG = 9, - RLE4 = 10, - RLE8 = 11, - BITFIELDS = 12, - ZIP = 13, - JPEG2000 = 14 - } - - /// - /// CAP_CAMERASIDE and TWEI_PAGESIDE values - /// - public enum TWCS : ushort - { - BOTH = 0, - TOP = 1, - BOTTOM = 2 - } - - /// - /// CAP_CLEARBUFFERS values - /// - public enum TWCB : ushort - { - AUTO = 0, - CLEAR = 1, - NOCLEAR = 2 - } - - /// - /// CAP_DEVICEEVENT values - /// - public enum TWDE : ushort - { - CUSTOMEVENTS = 0x8000, - CHECKAUTOMATICCAPTURE = 0, - CHECKBATTERY = 1, - CHECKDEVICEONLINE = 2, - CHECKFLASH = 3, - CHECKPOWERSUPPLY = 4, - CHECKRESOLUTION = 5, - DEVICEADDED = 6, - DEVICEOFFLINE = 7, - DEVICEREADY = 8, - DEVICEREMOVED = 9, - IMAGECAPTURED = 10, - IMAGEDELETED = 11, - PAPERDOUBLEFEED = 12, - PAPERJAM = 13, - LAMPFAILURE = 14, - POWERSAVE = 15, - POWERSAVENOTIFY = 16 - } - - /// - /// TW_PASSTHRU.Direction values - /// - public enum TWDR : ushort - { - GET = 1, - SET = 2 - } - - /// - /// TWEI_DESKEWSTATUS values - /// - public enum TWDSK : ushort - { - SUCCESS = 0, - REPORTONLY = 1, - FAIL = 2, - DISABLED = 3 - } - - /// - /// CAP_DUPLEX values - /// - public enum TWDX : ushort - { - NONE = 0, - X1PASSDUPLEX = 1, // 1PASSDUPLEX in TWAIN.H - X2PASSDUPLEX = 2 // 2PASSDUPLEX in TWAIN.H - } - - /// - /// CAP_FEEDERALIGNMENT values - /// - public enum TWFA : ushort - { - NONE = 0, - LEFT = 1, - CENTER = 2, - RIGHT = 3 - } - - /// - /// ICAP_FEEDERTYPE values - /// - public enum TWFE : ushort - { - GENERAL = 0, - PHOTO = 1 - } - - /// - /// ICAP_IMAGEFILEFORMAT values - /// - public enum TWFF : ushort - { - TIFF = 0, - PICT = 1, - BMP = 2, - XBM = 3, - JFIF = 4, - FPX = 5, - TIFFMULTI = 6, - PNG = 7, - SPIFF = 8, - EXIF = 9, - PDF = 10, - JP2 = 11, - JPX = 13, - DEJAVU = 14, - PDFA = 15, - PDFA2 = 16, - PDFRASTER = 17 - } - - /// - /// ICAP_FLASHUSED2 values - /// - public enum TWFL : ushort - { - NONE = 0, - OFF = 1, - ON = 2, - AUTO = 3, - REDEYE = 4 - } - - /// - /// CAP_FEEDERORDER values - /// - public enum TWFO : ushort - { - FIRSTPAGEFIRST = 0, - LASTPAGEFIRST = 1 - } - - /// - /// CAP_FEEDERPOCKET values - /// - public enum TWFP : ushort - { - POCKETERROR = 0, - POCKET1 = 1, - POCKET2 = 2, - POCKET3 = 3, - POCKET4 = 4, - POCKET5 = 5, - POCKET6 = 6, - POCKET7 = 7, - POCKET8 = 8, - POCKET9 = 9, - POCKET10 = 10, - POCKET11 = 11, - POCKET12 = 12, - POCKET13 = 13, - POCKET14 = 14, - POCKET15 = 15, - POCKET16 = 16 - } - - /// - /// ICAP_FLIPROTATION values - /// - public enum TWFR : ushort - { - BOOK = 0, - FANFOLD = 1 - } - - /// - /// ICAP_FILTER values - /// - public enum TWFT : ushort - { - RED = 0, - GREEN = 1, - BLUE = 2, - NONE = 3, - WHITE = 4, - CYAN = 5, - MAGENTA = 6, - YELLOW = 7, - BLACK = 8 - } - - /// - /// TW_FILESYSTEM.FileType values - /// - public enum TWFY : ushort - { - CAMERA = 0, - CAMERATOP = 1, - CAMERABOTTOM = 2, - CAMERAPREVIEW = 3, - DOMAIN = 4, - HOST = 5, - DIRECTORY = 6, - IMAGE = 7, - UNKNOWN = 8 - } - - /// - /// CAP_IAFIELD*_LEVEL values - /// - public enum TWIA : ushort - { - UNUSED = 0, - FIXED = 1, - LEVEL1 = 2, - LEVEL2 = 3, - LEVEL3 = 4, - LEVEL4 = 5 - } - - /// - /// ICAP_ICCPROFILE values - /// - public enum TWIC : ushort - { - NONE = 0, - LINK = 1, - EMBED = 2 - } - - /// - /// ICAP_IMAGEFILTER values - /// - public enum TWIF : ushort - { - NONE = 0, - AUTO = 1, - LOWPASS = 2, - BANDPASS = 3, - HIGHPASS = 4, - TEXT = BANDPASS, - FINELINE = HIGHPASS - } - - /// - /// ICAP_IMAGEMERGE values - /// - public enum TWIM : ushort - { - NONE = 0, - FRONTONTOP = 1, - FRONTONBOTTOM = 2, - FRONTONLEFT = 3, - FRONTONRIGHT = 4 - } - - /// - /// CAP_JOBCONTROL values - /// - public enum TWJC : ushort - { - NONE = 0, - JSIC = 1, - JSIS = 2, - JSXC = 3, - JSXS = 4 - } - - /// - /// ICAP_JPEGQUALITY values - /// - public enum TWJQ : short - { - UNKNOWN = -4, - LOW = -3, - MEDIUM = -2, - HIGH = -1 - } - - /// - /// ICAP_LIGHTPATH values - /// - public enum TWLP : ushort - { - REFLECTIVE = 0, - TRANSMISSIVE = 1 - } - - /// - /// ICAP_LIGHTSOURCE values - /// - public enum TWLS : ushort - { - RED = 0, - GREEN = 1, - BLUE = 2, - NONE = 3, - WHITE = 4, - UV = 5, - IR = 6 - } - - /// - /// TWEI_MAGTYPE values - /// - public enum TWMD : ushort - { - MICR = 0, - RAW = 1, - INVALID = 2 - } - - /// - /// ICAP_NOISEFILTER values - /// - public enum TWNF : ushort - { - NONE = 0, - AUTO = 1, - LONEPIXEL = 2, - MAJORITYRULE = 3 - } - - /// - /// ICAP_ORIENTATION values - /// - public enum TWOR : ushort - { - ROT0 = 0, - ROT90 = 1, - ROT180 = 2, - ROT270 = 3, - PORTRAIT = ROT0, - LANDSCAPE = ROT270, - AUTO = 4, - AUTOTEXT = 5, - AUTOPICTURE = 6 - } - - /// - /// ICAP_OVERSCAN values - /// - public enum TWOV : ushort - { - NONE = 0, - AUTO = 1, - TOPBOTTOM = 2, - LEFTRIGHT = 3, - ALL = 4 - } - - /// - /// Palette types for TW_PALETTE8 - /// - public enum TWPA : ushort - { - RGB = 0, - GRAY = 1, - CMY = 2 - } - - /// - /// ICAP_PLANARCHUNKY values - /// - public enum TWPC : ushort - { - CHUNKY = 0, - PLANAR = 1 - } - - /// - /// TWEI_PATCHCODE values - /// - public enum TWPCH : ushort - { - PATCH1 = 0, - PATCH2 = 1, - PATCH3 = 2, - PATCH4 = 3, - PATCH6 = 4, - PATCHT = 5 - } - - /// - /// ICAP_PIXELFLAVOR values - /// - public enum TWPF : ushort - { - CHOCOLATE = 0, - VANILLA = 1 - } - - /// - /// CAP_PRINTERMODE values - /// - public enum TWPM : ushort - { - SINGLESTRING = 0, - MULTISTRING = 1, - COMPOUNDSTRING = 2, - IMAGEADDRESSSTRING = 3 - } - - /// - /// CAP_PRINTER values - /// - public enum TWPR : ushort - { - IMPRINTERTOPBEFORE = 0, - IMPRINTERTOPAFTER = 1, - IMPRINTERBOTTOMBEFORE = 2, - IMPRINTERBOTTOMAFTER = 3, - ENDORSERTOPBEFORE = 4, - ENDORSERTOPAFTER = 5, - ENDORSERBOTTOMBEFORE = 6, - ENDORSERBOTTOMAFTER = 7 - } - - /// - /// CAP_PRINTERFONTSTYLE Added 2.3 (TWPF in TWAIN.H) - /// - public enum TWPFS : ushort - { - NORMAL = 0, - BOLD = 1, - ITALIC = 2, - LARGESIZE = 3, - SMALLSIZE = 4 - } - - /// - /// CAP_PRINTERINDEXTRIGGER Added 2.3 - /// - public enum TWCT : ushort - { - PAGE = 0, - PATCH1 = 1, - PATCH2 = 2, - PATCH3 = 3, - PATCH4 = 4, - PATCHT = 5, - PATCH6 = 6 - } - - /// - /// CAP_POWERSUPPLY values - /// - public enum TWPS : ushort - { - EXTERNAL = 0, - BATTERY = 1 - } - - /// - /// ICAP_PIXELTYPE values (PT_ means Pixel Type) - /// - public enum TWPT : ushort - { - BW = 0, - GRAY = 1, - RGB = 2, - PALETTE = 3, - CMY = 4, - CMYK = 5, - YUV = 6, - YUVK = 7, - CIEXYZ = 8, - LAB = 9, - SRGB = 10, - SCRGB = 11, - INFRARED = 16 - } - - /// - /// CAP_SEGMENTED values - /// - public enum TWSG : ushort - { - NONE = 0, - AUTO = 1, - MANUAL = 2 - } - - /// - /// ICAP_FILMTYPE values - /// - public enum TWFM : ushort - { - POSITIVE = 0, - NEGATIVE = 1 - } - - /// - /// CAP_DOUBLEFEEDDETECTION values - /// - public enum TWDF : ushort - { - ULTRASONIC = 0, - BYLENGTH = 1, - INFRARED = 2 - } - - /// - /// CAP_DOUBLEFEEDDETECTIONSENSITIVITY values - /// - public enum TWUS : ushort - { - LOW = 0, - MEDIUM = 1, - HIGH = 2 - } - - /// - /// CAP_DOUBLEFEEDDETECTIONRESPONSE values - /// - public enum TWDP : ushort - { - STOP = 0, - STOPANDWAIT = 1, - SOUND = 2, - DONOTIMPRINT = 3 - } - - /// - /// ICAP_MIRROR values - /// - public enum TWMR : ushort - { - NONE = 0, - VERTICAL = 1, - HORIZONTAL = 2 - } - - /// - /// ICAP_JPEGSUBSAMPLING values - /// - public enum TWJS : ushort - { - X444YCBCR = 0, // 444YCBCR in TWAIN.H - X444RGB = 1, // 444RGB in TWAIN.H - X422 = 2, // 422 in TWAIN.H - X421 = 3, // 421 in TWAIN.H - X411 = 4, // 411 in TWAIN.H - X420 = 5, // 420 in TWAIN.H - X410 = 6, // 410 in TWAIN.H - X311 = 7 // 311 in TWAIN.H - } - - /// - /// CAP_PAPERHANDLING values - /// - public enum TWPH : ushort - { - NORMAL = 0, - FRAGILE = 1, - THICK = 2, - TRIFOLD = 3, - PHOTOGRAPH = 4 - } - - /// - /// CAP_INDICATORSMODE values - /// - public enum TWCI : ushort - { - INFO = 0, - WARNING = 1, - ERROR = 2, - WARMUP = 3 - } - - /// - /// ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) - /// - public enum TWSS : ushort - { - NONE = 0, - A4 = 1, - JISB5 = 2, - USLETTER = 3, - USLEGAL = 4, - A5 = 5, - ISOB4 = 6, - ISOB6 = 7, - USLEDGER = 9, - USEXECUTIVE = 10, - A3 = 11, - ISOB3 = 12, - A6 = 13, - C4 = 14, - C5 = 15, - C6 = 16, - X4A0 = 17, // 4A0 in TWAIN.H - X2A0 = 18, // 2A0 in TWAIN.H - A0 = 19, - A1 = 20, - A2 = 21, - A7 = 22, - A8 = 23, - A9 = 24, - A10 = 25, - ISOB0 = 26, - ISOB1 = 27, - ISOB2 = 28, - ISOB5 = 29, - ISOB7 = 30, - ISOB8 = 31, - ISOB9 = 32, - ISOB10 = 33, - JISB0 = 34, - JISB1 = 35, - JISB2 = 36, - JISB3 = 37, - JISB4 = 38, - JISB6 = 39, - JISB7 = 40, - JISB8 = 41, - JISB9 = 42, - JISB10 = 43, - C0 = 44, - C1 = 45, - C2 = 46, - C3 = 47, - C7 = 48, - C8 = 49, - C9 = 50, - C10 = 51, - USSTATEMENT = 52, - BUSINESSCARD = 53, - MAXSIZE = 54 - } - - /// - /// ICAP_XFERMECH values (SX_ means Setup XFer) - /// - public enum TWSX : ushort - { - NATIVE = 0, - FILE = 1, - MEMORY = 2, - MEMFILE = 4 - } - - /// - /// ICAP_UNITS values (UN_ means UNits) - /// - public enum TWUN : ushort - { - INCHES = 0, - CENTIMETERS = 1, - PICAS = 2, - POINTS = 3, - TWIPS = 4, - PIXELS = 5, - MILLIMETERS = 6 - } - - /// - /// Country Constants - /// - public enum TWCY : ushort - { - AFGHANISTAN = 1001, - ALGERIA = 213, - AMERICANSAMOA = 684, - ANDORRA = 33, - ANGOLA = 1002, - ANGUILLA = 8090, - ANTIGUA = 8091, - ARGENTINA = 54, - ARUBA = 297, - ASCENSIONI = 247, - AUSTRALIA = 61, - AUSTRIA = 43, - BAHAMAS = 8092, - BAHRAIN = 973, - BANGLADESH = 880, - BARBADOS = 8093, - BELGIUM = 32, - BELIZE = 501, - BENIN = 229, - BERMUDA = 8094, - BHUTAN = 1003, - BOLIVIA = 591, - BOTSWANA = 267, - BRITAIN = 6, - BRITVIRGINIS = 8095, - BRAZIL = 55, - BRUNEI = 673, - BULGARIA = 359, - BURKINAFASO = 1004, - BURMA = 1005, - BURUNDI = 1006, - CAMAROON = 237, - CANADA = 2, - CAPEVERDEIS = 238, - CAYMANIS = 8096, - CENTRALAFREP = 1007, - CHAD = 1008, - CHILE = 56, - CHINA = 86, - CHRISTMASIS = 1009, - COCOSIS = 1009, - COLOMBIA = 57, - COMOROS = 1010, - CONGO = 1011, - COOKIS = 1012, - COSTARICA = 506, - CUBA = 5, - CYPRUS = 357, - CZECHOSLOVAKIA = 42, - DENMARK = 45, - DJIBOUTI = 1013, - DOMINICA = 8097, - DOMINCANREP = 8098, - EASTERIS = 1014, - ECUADOR = 593, - EGYPT = 20, - ELSALVADOR = 503, - EQGUINEA = 1015, - ETHIOPIA = 251, - FALKLANDIS = 1016, - FAEROEIS = 298, - FIJIISLANDS = 679, - FINLAND = 358, - FRANCE = 33, - FRANTILLES = 596, - FRGUIANA = 594, - FRPOLYNEISA = 689, - FUTANAIS = 1043, - GABON = 241, - GAMBIA = 220, - GERMANY = 49, - GHANA = 233, - GIBRALTER = 350, - GREECE = 30, - GREENLAND = 299, - GRENADA = 8099, - GRENEDINES = 8015, - GUADELOUPE = 590, - GUAM = 671, - GUANTANAMOBAY = 5399, - GUATEMALA = 502, - GUINEA = 224, - GUINEABISSAU = 1017, - GUYANA = 592, - HAITI = 509, - HONDURAS = 504, - HONGKONG = 852, - HUNGARY = 36, - ICELAND = 354, - INDIA = 91, - INDONESIA = 62, - IRAN = 98, - IRAQ = 964, - IRELAND = 353, - ISRAEL = 972, - ITALY = 39, - IVORYCOAST = 225, - JAMAICA = 8010, - JAPAN = 81, - JORDAN = 962, - KENYA = 254, - KIRIBATI = 1018, - KOREA = 82, - KUWAIT = 965, - LAOS = 1019, - LEBANON = 1020, - LIBERIA = 231, - LIBYA = 218, - LIECHTENSTEIN = 41, - LUXENBOURG = 352, - MACAO = 853, - MADAGASCAR = 1021, - MALAWI = 265, - MALAYSIA = 60, - MALDIVES = 960, - MALI = 1022, - MALTA = 356, - MARSHALLIS = 692, - MAURITANIA = 1023, - MAURITIUS = 230, - MEXICO = 3, - MICRONESIA = 691, - MIQUELON = 508, - MONACO = 33, - MONGOLIA = 1024, - MONTSERRAT = 8011, - MOROCCO = 212, - MOZAMBIQUE = 1025, - NAMIBIA = 264, - NAURU = 1026, - NEPAL = 977, - NETHERLANDS = 31, - NETHANTILLES = 599, - NEVIS = 8012, - NEWCALEDONIA = 687, - NEWZEALAND = 64, - NICARAGUA = 505, - NIGER = 227, - NIGERIA = 234, - NIUE = 1027, - NORFOLKI = 1028, - NORWAY = 47, - OMAN = 968, - PAKISTAN = 92, - PALAU = 1029, - PANAMA = 507, - PARAGUAY = 595, - PERU = 51, - PHILLIPPINES = 63, - PITCAIRNIS = 1030, - PNEWGUINEA = 675, - POLAND = 48, - PORTUGAL = 351, - QATAR = 974, - REUNIONI = 1031, - ROMANIA = 40, - RWANDA = 250, - SAIPAN = 670, - SANMARINO = 39, - SAOTOME = 1033, - SAUDIARABIA = 966, - SENEGAL = 221, - SEYCHELLESIS = 1034, - SIERRALEONE = 1035, - SINGAPORE = 65, - SOLOMONIS = 1036, - SOMALI = 1037, - SOUTHAFRICA = 27, - SPAIN = 34, - SRILANKA = 94, - STHELENA = 1032, - STKITTS = 8013, - STLUCIA = 8014, - STPIERRE = 508, - STVINCENT = 8015, - SUDAN = 1038, - SURINAME = 597, - SWAZILAND = 268, - SWEDEN = 46, - SWITZERLAND = 41, - SYRIA = 1039, - TAIWAN = 886, - TANZANIA = 255, - THAILAND = 66, - TOBAGO = 8016, - TOGO = 228, - TONGAIS = 676, - TRINIDAD = 8016, - TUNISIA = 216, - TURKEY = 90, - TURKSCAICOS = 8017, - TUVALU = 1040, - UGANDA = 256, - USSR = 7, - UAEMIRATES = 971, - UNITEDKINGDOM = 44, - USA = 1, - URUGUAY = 598, - VANUATU = 1041, - VATICANCITY = 39, - VENEZUELA = 58, - WAKE = 1042, - WALLISIS = 1043, - WESTERNSAHARA = 1044, - WESTERNSAMOA = 1045, - YEMEN = 1046, - YUGOSLAVIA = 38, - ZAIRE = 243, - ZAMBIA = 260, - ZIMBABWE = 263, - ALBANIA = 355, - ARMENIA = 374, - AZERBAIJAN = 994, - BELARUS = 375, - BOSNIAHERZGO = 387, - CAMBODIA = 855, - CROATIA = 385, - CZECHREPUBLIC = 420, - DIEGOGARCIA = 246, - ERITREA = 291, - ESTONIA = 372, - GEORGIA = 995, - LATVIA = 371, - LESOTHO = 266, - LITHUANIA = 370, - MACEDONIA = 389, - MAYOTTEIS = 269, - MOLDOVA = 373, - MYANMAR = 95, - NORTHKOREA = 850, - PUERTORICO = 787, - RUSSIA = 7, - SERBIA = 381, - SLOVAKIA = 421, - SLOVENIA = 386, - SOUTHKOREA = 82, - UKRAINE = 380, - USVIRGINIS = 340, - VIETNAM = 84 - } - - /// - /// Language Constants - /// - public enum TWLG : short - { - USERLOCALE = -1, - DAN = 0, - DUT = 1, - ENG = 2, - FCF = 3, - FIN = 4, - FRN = 5, - GER = 6, - ICE = 7, - ITN = 8, - NOR = 9, - POR = 10, - SPA = 11, - SWE = 12, - USA = 13, - AFRIKAANS = 14, - ALBANIA = 15, - ARABIC = 16, - ARABIC_ALGERIA = 17, - ARABIC_BAHRAIN = 18, - ARABIC_EGYPT = 19, - ARABIC_IRAQ = 20, - ARABIC_JORDAN = 21, - ARABIC_KUWAIT = 22, - ARABIC_LEBANON = 23, - ARABIC_LIBYA = 24, - ARABIC_MOROCCO = 25, - ARABIC_OMAN = 26, - ARABIC_QATAR = 27, - ARABIC_SAUDIARABIA = 28, - ARABIC_SYRIA = 29, - ARABIC_TUNISIA = 30, - ARABIC_UAE = 31, - ARABIC_YEMEN = 32, - BASQUE = 33, - BYELORUSSIAN = 34, - BULGARIAN = 35, - CATALAN = 36, - CHINESE = 37, - CHINESE_HONGKONG = 38, - CHINESE_PRC = 39, - CHINESE_SINGAPORE = 40, - CHINESE_SIMPLIFIED = 41, - CHINESE_TAIWAN = 42, - CHINESE_TRADITIONAL = 43, - CROATIA = 44, - CZECH = 45, - DANISH = DAN, - DUTCH = DUT, - DUTCH_BELGIAN = 46, - ENGLISH = ENG, - ENGLISH_AUSTRALIAN = 47, - ENGLISH_CANADIAN = 48, - ENGLISH_IRELAND = 49, - ENGLISH_NEWZEALAND = 50, - ENGLISH_SOUTHAFRICA = 51, - ENGLISH_UK = 52, - ENGLISH_USA = USA, - ESTONIAN = 53, - FAEROESE = 54, - FARSI = 55, - FINNISH = FIN, - FRENCH = FRN, - FRENCH_BELGIAN = 56, - FRENCH_CANADIAN = FCF, - FRENCH_LUXEMBOURG = 57, - FRENCH_SWISS = 58, - GERMAN = GER, - GERMAN_AUSTRIAN = 59, - GERMAN_LUXEMBOURG = 60, - GERMAN_LIECHTENSTEIN = 61, - GERMAN_SWISS = 62, - GREEK = 63, - HEBREW = 64, - HUNGARIAN = 65, - ICELANDIC = ICE, - INDONESIAN = 66, - ITALIAN = ITN, - ITALIAN_SWISS = 67, - JAPANESE = 68, - KOREAN = 69, - KOREAN_JOHAB = 70, - LATVIAN = 71, - LITHUANIAN = 72, - NORWEGIAN = NOR, - NORWEGIAN_BOKMAL = 73, - NORWEGIAN_NYNORSK = 74, - POLISH = 75, - PORTUGUESE = POR, - PORTUGUESE_BRAZIL = 76, - ROMANIAN = 77, - RUSSIAN = 78, - SERBIAN_LATIN = 79, - SLOVAK = 80, - SLOVENIAN = 81, - SPANISH = TWLG.SPA, - SPANISH_MEXICAN = 82, - SPANISH_MODERN = 83, - SWEDISH = TWLG.SWE, - THAI = 84, - TURKISH = 85, - UKRANIAN = 86, - ASSAMESE = 87, - BENGALI = 88, - BIHARI = 89, - BODO = 90, - DOGRI = 91, - GUJARATI = 92, - HARYANVI = 93, - HINDI = 94, - KANNADA = 95, - KASHMIRI = 96, - MALAYALAM = 97, - MARATHI = 98, - MARWARI = 99, - MEGHALAYAN = 100, - MIZO = 101, - NAGA = 102, - ORISSI = 103, - PUNJABI = 104, - PUSHTU = 105, - SERBIAN_CYRILLIC = 106, - SIKKIMI = 107, - SWEDISH_FINLAND = 108, - TAMIL = 109, - TELUGU = 110, - TRIPURI = 111, - URDU = 112, - VIETNAMESE = 113 - //NOTE: when adding to this list, also update Language->Set() - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Data Groups... - /////////////////////////////////////////////////////////////////////////////// - #region Data Groups... - - /// - /// Data Groups... - /// - public enum DG : uint - { - CONTROL = 0x1, - IMAGE = 0x2, - AUDIO = 0x4, - - // More Data Functionality may be added in the future. - // These are for items that need to be determined before DS is opened. - // NOTE: Supported Functionality constants must be powers of 2 as they are - // used as bitflags when Application asks DSM to present a list of DSs. - // to support backward capability the App and DS will not use the fields - DSM2 = 0x10000000, - APP2 = 0x20000000, - DS2 = 0x40000000, - MASK = 0xFFFF - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Data Argument Types... - /////////////////////////////////////////////////////////////////////////////// - #region Data Argument Types... - - /// - /// Data Argument Types... - /// - public enum DAT : ushort - { - // NULL and Custom Base... - NULL = 0x0, - CUSTOM = 0x8000, - - // Data Argument Types for the DG_CONTROL Data Group. - CAPABILITY = 0x1, - EVENT = 0x2, - IDENTITY = 0x3, - PARENT = 0x4, - PENDINGXFERS = 0x5, - SETUPMEMXFER = 0x6, - SETUPFILEXFER = 0x7, - STATUS = 0x8, - USERINTERFACE = 0x9, - XFERGROUP = 0xa, - CUSTOMDSDATA = 0xc, - DEVICEEVENT = 0xd, - FILESYSTEM = 0xe, - PASSTHRU = 0xf, - CALLBACK = 0x10, - STATUSUTF8 = 0x11, - CALLBACK2 = 0x12, - METRICS = 0x13, - TWAINDIRECT = 0x14, - - // Data Argument Types for the DG_IMAGE Data Group. - IMAGEINFO = 0x0101, - IMAGELAYOUT = 0x0102, - IMAGEMEMXFER = 0x0103, - IMAGENATIVEXFER = 0x0104, - IMAGEFILEXFER = 0x105, - CIECOLOR = 0x106, - GRAYRESPONSE = 0x107, - RGBRESPONSE = 0x108, - JPEGCOMPRESSION = 0x109, - PALETTE8 = 0x10a, - EXTIMAGEINFO = 0x10b, - FILTER = 0x10c, - - /* Data Argument Types for the DG_AUDIO Data Group. */ - AUDIOFILEXFER = 0x201, - AUDIOINFO = 0x202, - AUDIONATIVEXFER = 0x203, - - /* misplaced */ - ICCPROFILE = 0x401, - IMAGEMEMFILEXFER = 0x402, - ENTRYPOINT = 0x403 - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Messages... - /////////////////////////////////////////////////////////////////////////////// - #region Messages... - - /// - /// All message constants are unique. - /// Messages are grouped according to which DATs they are used with. - /// - public enum MSG : ushort - { - // Only used to clear fields... - NULL = 0x0, - - // Generic messages may be used with any of several DATs. - GET = 0x1, - GETCURRENT = 0x2, - GETDEFAULT = 0x3, - GETFIRST = 0x4, - GETNEXT = 0x5, - SET = 0x6, - RESET = 0x7, - QUERYSUPPORT = 0x8, - GETHELP = 0x9, - GETLABEL = 0xa, - GETLABELENUM = 0xb, - SETCONSTRAINT = 0xc, - - // Messages used with DAT_NULL. - XFERREADY = 0x101, - CLOSEDSREQ = 0x102, - CLOSEDSOK = 0x103, - DEVICEEVENT = 0x104, - - // Messages used with a pointer to DAT_PARENT data. - OPENDSM = 0x301, - CLOSEDSM = 0x302, - - // Messages used with a pointer to a DAT_IDENTITY structure. - OPENDS = 0x401, - CLOSEDS = 0x402, - USERSELECT = 0x403, - - // Messages used with a pointer to a DAT_USERINTERFACE structure. - DISABLEDS = 0x501, - ENABLEDS = 0x502, - ENABLEDSUIONLY = 0x503, - - // Messages used with a pointer to a DAT_EVENT structure. - PROCESSEVENT = 0x601, - - // Messages used with a pointer to a DAT_PENDINGXFERS structure - ENDXFER = 0x701, - STOPFEEDER = 0x702, - - // Messages used with a pointer to a DAT_FILESYSTEM structure - CHANGEDIRECTORY = 0x0801, - CREATEDIRECTORY = 0x0802, - DELETE = 0x0803, - FORMATMEDIA = 0x0804, - GETCLOSE = 0x0805, - GETFIRSTFILE = 0x0806, - GETINFO = 0x0807, - GETNEXTFILE = 0x0808, - RENAME = 0x0809, - COPY = 0x080A, - AUTOMATICCAPTUREDIRECTORY = 0x080B, - - // Messages used with a pointer to a DAT_PASSTHRU structure - PASSTHRU = 0x0901, - - // used with DAT_CALLBACK - REGISTER_CALLBACK = 0x0902, - - // used with DAT_CAPABILITY - RESETALL = 0x0A01, - - // used with DAT_TWAINDIRECT - SETTASK = 0x0B01 - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Capabilities... - /////////////////////////////////////////////////////////////////////////////// - #region Capabilities... - - /// - /// The naming convention is a little awkward, but it allows us to - /// achieve a unified capability type... - /// - public enum CAP : ushort - { - // Base of custom capabilities. - CAP_CUSTOMBASE = 0x8000, - - /* all data sources are REQUIRED to support these caps */ - CAP_XFERCOUNT = 0x0001, - - /* image data sources are REQUIRED to support these caps */ - ICAP_COMPRESSION = 0x0100, - ICAP_PIXELTYPE = 0x0101, - ICAP_UNITS = 0x0102, - ICAP_XFERMECH = 0x0103, - - // all data sources MAY support these caps. - CAP_AUTHOR = 0x1000, - CAP_CAPTION = 0x1001, - CAP_FEEDERENABLED = 0x1002, - CAP_FEEDERLOADED = 0x1003, - CAP_TIMEDATE = 0x1004, - CAP_SUPPORTEDCAPS = 0x1005, - CAP_EXTENDEDCAPS = 0x1006, - CAP_AUTOFEED = 0x1007, - CAP_CLEARPAGE = 0x1008, - CAP_FEEDPAGE = 0x1009, - CAP_REWINDPAGE = 0x100a, - CAP_INDICATORS = 0x100b, - CAP_PAPERDETECTABLE = 0x100d, - CAP_UICONTROLLABLE = 0x100e, - CAP_DEVICEONLINE = 0x100f, - CAP_AUTOSCAN = 0x1010, - CAP_THUMBNAILSENABLED = 0x1011, - CAP_DUPLEX = 0x1012, - CAP_DUPLEXENABLED = 0x1013, - CAP_ENABLEDSUIONLY = 0x1014, - CAP_CUSTOMDSDATA = 0x1015, - CAP_ENDORSER = 0x1016, - CAP_JOBCONTROL = 0x1017, - CAP_ALARMS = 0x1018, - CAP_ALARMVOLUME = 0x1019, - CAP_AUTOMATICCAPTURE = 0x101a, - CAP_TIMEBEFOREFIRSTCAPTURE = 0x101b, - CAP_TIMEBETWEENCAPTURES = 0x101c, - CAP_CLEARBUFFERS = 0x101d, - CAP_MAXBATCHBUFFERS = 0x101e, - CAP_DEVICETIMEDATE = 0x101f, - CAP_POWERSUPPLY = 0x1020, - CAP_CAMERAPREVIEWUI = 0x1021, - CAP_DEVICEEVENT = 0x1022, - CAP_SERIALNUMBER = 0x1024, - CAP_PRINTER = 0x1026, - CAP_PRINTERENABLED = 0x1027, - CAP_PRINTERINDEX = 0x1028, - CAP_PRINTERMODE = 0x1029, - CAP_PRINTERSTRING = 0x102a, - CAP_PRINTERSUFFIX = 0x102b, - CAP_LANGUAGE = 0x102c, - CAP_FEEDERALIGNMENT = 0x102d, - CAP_FEEDERORDER = 0x102e, - CAP_REACQUIREALLOWED = 0x1030, - CAP_BATTERYMINUTES = 0x1032, - CAP_BATTERYPERCENTAGE = 0x1033, - CAP_CAMERASIDE = 0x1034, - CAP_SEGMENTED = 0x1035, - CAP_CAMERAENABLED = 0x1036, - CAP_CAMERAORDER = 0x1037, - CAP_MICRENABLED = 0x1038, - CAP_FEEDERPREP = 0x1039, - CAP_FEEDERPOCKET = 0x103a, - CAP_AUTOMATICSENSEMEDIUM = 0x103b, - CAP_CUSTOMINTERFACEGUID = 0x103c, - CAP_SUPPORTEDCAPSSEGMENTUNIQUE = 0x103d, - CAP_SUPPORTEDDATS = 0x103e, - CAP_DOUBLEFEEDDETECTION = 0x103f, - CAP_DOUBLEFEEDDETECTIONLENGTH = 0x1040, - CAP_DOUBLEFEEDDETECTIONSENSITIVITY = 0x1041, - CAP_DOUBLEFEEDDETECTIONRESPONSE = 0x1042, - CAP_PAPERHANDLING = 0x1043, - CAP_INDICATORSMODE = 0x1044, - CAP_PRINTERVERTICALOFFSET = 0x1045, - CAP_POWERSAVETIME = 0x1046, - CAP_PRINTERCHARROTATION = 0x1047, - CAP_PRINTERFONTSTYLE = 0x1048, - CAP_PRINTERINDEXLEADCHAR = 0x1049, - CAP_PRINTERINDEXMAXVALUE = 0x104A, - CAP_PRINTERINDEXNUMDIGITS = 0x104B, - CAP_PRINTERINDEXSTEP = 0x104C, - CAP_PRINTERINDEXTRIGGER = 0x104D, - CAP_PRINTERSTRINGPREVIEW = 0x104E, - CAP_SHEETCOUNT = 0x104F, - CAP_IMAGEADDRESSENABLED = 0x1050, - CAP_IAFIELDA_LEVEL = 0x1051, - CAP_IAFIELDB_LEVEL = 0x1052, - CAP_IAFIELDC_LEVEL = 0x1053, - CAP_IAFIELDD_LEVEL = 0x1054, - CAP_IAFIELDE_LEVEL = 0x1055, - CAP_IAFIELDA_PRINTFORMAT = 0x1056, - CAP_IAFIELDB_PRINTFORMAT = 0x1057, - CAP_IAFIELDC_PRINTFORMAT = 0x1058, - CAP_IAFIELDD_PRINTFORMAT = 0x1059, - CAP_IAFIELDE_PRINTFORMAT = 0x105A, - CAP_IAFIELDA_VALUE = 0x105B, - CAP_IAFIELDB_VALUE = 0x105C, - CAP_IAFIELDC_VALUE = 0x105D, - CAP_IAFIELDD_VALUE = 0x105E, - CAP_IAFIELDE_VALUE = 0x105F, - CAP_IAFIELDA_LASTPAGE = 0x1060, - CAP_IAFIELDB_LASTPAGE = 0x1061, - CAP_IAFIELDC_LASTPAGE = 0x1062, - CAP_IAFIELDD_LASTPAGE = 0x1063, - CAP_IAFIELDE_LASTPAGE = 0x1064, - - // image data sources MAY support these caps. - ICAP_AUTOBRIGHT = 0x1100, - ICAP_BRIGHTNESS = 0x1101, - ICAP_CONTRAST = 0x1103, - ICAP_CUSTHALFTONE = 0x1104, - ICAP_EXPOSURETIME = 0x1105, - ICAP_FILTER = 0x1106, - ICAP_FLASHUSED = 0x1107, - ICAP_GAMMA = 0x1108, - ICAP_HALFTONES = 0x1109, - ICAP_HIGHLIGHT = 0x110a, - ICAP_IMAGEFILEFORMAT = 0x110c, - ICAP_LAMPSTATE = 0x110d, - ICAP_LIGHTSOURCE = 0x110e, - ICAP_ORIENTATION = 0x1110, - ICAP_PHYSICALWIDTH = 0x1111, - ICAP_PHYSICALHEIGHT = 0x1112, - ICAP_SHADOW = 0x1113, - ICAP_FRAMES = 0x1114, - ICAP_XNATIVERESOLUTION = 0x1116, - ICAP_YNATIVERESOLUTION = 0x1117, - ICAP_XRESOLUTION = 0x1118, - ICAP_YRESOLUTION = 0x1119, - ICAP_MAXFRAMES = 0x111a, - ICAP_TILES = 0x111b, - ICAP_BITORDER = 0x111c, - ICAP_CCITTKFACTOR = 0x111d, - ICAP_LIGHTPATH = 0x111e, - ICAP_PIXELFLAVOR = 0x111f, - ICAP_PLANARCHUNKY = 0x1120, - ICAP_ROTATION = 0x1121, - ICAP_SUPPORTEDSIZES = 0x1122, - ICAP_THRESHOLD = 0x1123, - ICAP_XSCALING = 0x1124, - ICAP_YSCALING = 0x1125, - ICAP_BITORDERCODES = 0x1126, - ICAP_PIXELFLAVORCODES = 0x1127, - ICAP_JPEGPIXELTYPE = 0x1128, - ICAP_TIMEFILL = 0x112a, - ICAP_BITDEPTH = 0x112b, - ICAP_BITDEPTHREDUCTION = 0x112c, - ICAP_UNDEFINEDIMAGESIZE = 0x112d, - ICAP_IMAGEDATASET = 0x112e, - ICAP_EXTIMAGEINFO = 0x112f, - ICAP_MINIMUMHEIGHT = 0x1130, - ICAP_MINIMUMWIDTH = 0x1131, - ICAP_AUTODISCARDBLANKPAGES = 0x1134, - ICAP_FLIPROTATION = 0x1136, - ICAP_BARCODEDETECTIONENABLED = 0x1137, - ICAP_SUPPORTEDBARCODETYPES = 0x1138, - ICAP_BARCODEMAXSEARCHPRIORITIES = 0x1139, - ICAP_BARCODESEARCHPRIORITIES = 0x113a, - ICAP_BARCODESEARCHMODE = 0x113b, - ICAP_BARCODEMAXRETRIES = 0x113c, - ICAP_BARCODETIMEOUT = 0x113d, - ICAP_ZOOMFACTOR = 0x113e, - ICAP_PATCHCODEDETECTIONENABLED = 0x113f, - ICAP_SUPPORTEDPATCHCODETYPES = 0x1140, - ICAP_PATCHCODEMAXSEARCHPRIORITIES = 0x1141, - ICAP_PATCHCODESEARCHPRIORITIES = 0x1142, - ICAP_PATCHCODESEARCHMODE = 0x1143, - ICAP_PATCHCODEMAXRETRIES = 0x1144, - ICAP_PATCHCODETIMEOUT = 0x1145, - ICAP_FLASHUSED2 = 0x1146, - ICAP_IMAGEFILTER = 0x1147, - ICAP_NOISEFILTER = 0x1148, - ICAP_OVERSCAN = 0x1149, - ICAP_AUTOMATICBORDERDETECTION = 0x1150, - ICAP_AUTOMATICDESKEW = 0x1151, - ICAP_AUTOMATICROTATE = 0x1152, - ICAP_JPEGQUALITY = 0x1153, - ICAP_FEEDERTYPE = 0x1154, - ICAP_ICCPROFILE = 0x1155, - ICAP_AUTOSIZE = 0x1156, - ICAP_AUTOMATICCROPUSESFRAME = 0x1157, - ICAP_AUTOMATICLENGTHDETECTION = 0x1158, - ICAP_AUTOMATICCOLORENABLED = 0x1159, - ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE = 0x115a, - ICAP_COLORMANAGEMENTENABLED = 0x115b, - ICAP_IMAGEMERGE = 0x115c, - ICAP_IMAGEMERGEHEIGHTTHRESHOLD = 0x115d, - ICAP_SUPPORTEDEXTIMAGEINFO = 0x115e, - ICAP_FILMTYPE = 0x115f, - ICAP_MIRROR = 0x1160, - ICAP_JPEGSUBSAMPLING = 0x1161, - - // image data sources MAY support these audio caps. - ACAP_XFERMECH = 0x1202 - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Extended Image Info Attributes section Added 1.7... - /////////////////////////////////////////////////////////////////////////////// - #region Extended Image Info Attributes section Added 1.7... - - /// - /// Extended Image Info Attributes... - /// - public enum TWEI : ushort - { - BARCODEX = 0x1200, - BARCODEY = 0x1201, - BARCODETEXT = 0x1202, - BARCODETYPE = 0x1203, - DESHADETOP = 0x1204, - DESHADELEFT = 0x1205, - DESHADEHEIGHT = 0x1206, - DESHADEWIDTH = 0x1207, - DESHADESIZE = 0x1208, - SPECKLESREMOVED = 0x1209, - HORZLINEXCOORD = 0x120A, - HORZLINEYCOORD = 0x120B, - HORZLINELENGTH = 0x120C, - HORZLINETHICKNESS = 0x120D, - VERTLINEXCOORD = 0x120E, - VERTLINEYCOORD = 0x120F, - VERTLINELENGTH = 0x1210, - VERTLINETHICKNESS = 0x1211, - PATCHCODE = 0x1212, - ENDORSEDTEXT = 0x1213, - FORMCONFIDENCE = 0x1214, - FORMTEMPLATEMATCH = 0x1215, - FORMTEMPLATEPAGEMATCH = 0x1216, - FORMHORZDOCOFFSET = 0x1217, - FORMVERTDOCOFFSET = 0x1218, - BARCODECOUNT = 0x1219, - BARCODECONFIDENCE = 0x121A, - BARCODEROTATION = 0x121B, - BARCODETEXTLENGTH = 0x121C, - DESHADECOUNT = 0x121D, - DESHADEBLACKCOUNTOLD = 0x121E, - DESHADEBLACKCOUNTNEW = 0x121F, - DESHADEBLACKRLMIN = 0x1220, - DESHADEBLACKRLMAX = 0x1221, - DESHADEWHITECOUNTOLD = 0x1222, - DESHADEWHITECOUNTNEW = 0x1223, - DESHADEWHITERLMIN = 0x1224, - DESHADEWHITERLAVE = 0x1225, - DESHADEWHITERLMAX = 0x1226, - BLACKSPECKLESREMOVED = 0x1227, - WHITESPECKLESREMOVED = 0x1228, - HORZLINECOUNT = 0x1229, - VERTLINECOUNT = 0x122A, - DESKEWSTATUS = 0x122B, - SKEWORIGINALANGLE = 0x122C, - SKEWFINALANGLE = 0x122D, - SKEWCONFIDENCE = 0x122E, - SKEWWINDOWX1 = 0x122F, - SKEWWINDOWY1 = 0x1230, - SKEWWINDOWX2 = 0x1231, - SKEWWINDOWY2 = 0x1232, - SKEWWINDOWX3 = 0x1233, - SKEWWINDOWY3 = 0x1234, - SKEWWINDOWX4 = 0x1235, - SKEWWINDOWY4 = 0x1236, - BOOKNAME = 0x1238, - CHAPTERNUMBER = 0x1239, - DOCUMENTNUMBER = 0x123A, - PAGENUMBER = 0x123B, - CAMERA = 0x123C, - FRAMENUMBER = 0x123D, - FRAME = 0x123E, - PIXELFLAVOR = 0x123F, - ICCPROFILE = 0x1240, - LASTSEGMENT = 0x1241, - SEGMENTNUMBER = 0x1242, - MAGDATA = 0x1243, - MAGTYPE = 0x1244, - PAGESIDE = 0x1245, - FILESYSTEMSOURCE = 0x1246, - IMAGEMERGED = 0x1247, - MAGDATALENGTH = 0x1248, - PAPERCOUNT = 0x1249, - PRINTERTEXT = 0x124A, - TWAINDIRECTMETADATA = 0x124B, - IAFIELDA_VALUE = 0x124C, - IAFIELDB_VALUE = 0x124D, - IAFIELDC_VALUE = 0x124E, - IAFIELDD_VALUE = 0x124F, - IAFIELDE_VALUE = 0x1250, - IALEVEL = 0x1251, - PRINTER = 0x1252, - BARCODETEXT2 = 0x1253 - } - - public enum TWEJ : ushort - { - NONE = 0x0000, - MIDSEPARATOR = 0x0001, - PATCH1 = 0x0002, - PATCH2 = 0x0003, - PATCH3 = 0x0004, - PATCH4 = 0x0005, - PATCH6 = 0x0006, - PATCHT = 0x0007 - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Return Codes and Condition Codes section... - /////////////////////////////////////////////////////////////////////////////// - #region Return Codes and Condition Codes section... - - /// - /// We're departing from a strict translation of TWAIN.H so that - /// we can achieve a unified status return type. - /// - public const int STSCC = 0x10000; // get us past the custom space - public enum STS - { - // Custom base (same for TWRC and TWCC)... - CUSTOMBASE = 0x8000, - - // Return codes... - SUCCESS = 0, - FAILURE = 1, - CHECKSTATUS = 2, - CANCEL = 3, - DSEVENT = 4, - NOTDSEVENT = 5, - XFERDONE = 6, - ENDOFLIST = 7, - INFONOTSUPPORTED = 8, - DATANOTAVAILABLE = 9, - BUSY = 10, - SCANNERLOCKED = 11, - - // Condition codes (always associated with TWRC_FAILURE)... - BUMMER = STSCC + 1, - LOWMEMORY = STSCC + 2, - NODS = STSCC + 3, - MAXCONNECTIONS = STSCC + 4, - OPERATIONERROR = STSCC + 5, - BADCAP = STSCC + 6, - BADPROTOCOL = STSCC + 9, - BADVALUE = STSCC + 10, - SEQERROR = STSCC + 11, - BADDEST = STSCC + 12, - CAPUNSUPPORTED = STSCC + 13, - CAPBADOPERATION = STSCC + 14, - CAPSEQERROR = STSCC + 15, - DENIED = STSCC + 16, - FILEEXISTS = STSCC + 17, - FILENOTFOUND = STSCC + 18, - NOTEMPTY = STSCC + 19, - PAPERJAM = STSCC + 20, - PAPERDOUBLEFEED = STSCC + 21, - FILEWRITEERROR = STSCC + 22, - CHECKDEVICEONLINE = STSCC + 23, - INTERLOCK = STSCC + 24, - DAMAGEDCORNER = STSCC + 25, - FOCUSERROR = STSCC + 26, - DOCTOOLIGHT = STSCC + 27, - DOCTOODARK = STSCC + 28, - NOMEDIA = STSCC + 29 - } - - /// - /// bit patterns: for query the operation that are supported by the data source on a capability - /// Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT - /// - public enum TWQC : ushort - { - Unknown = 0, - GET = 0x0001, - SET = 0x0002, - GETDEFAULT = 0x0004, - GETCURRENT = 0x0008, - RESET = 0x0010, - SETCONSTRAINT = 0x0020, - CONSTRAINABLE = 0x0040 - } - - /// - /// The TWAIN States... - /// - public enum STATE - { - S1 = 1, // Nothing loaded or open - S2 = 2, // DSM loaded - S3 = 3, // DSM open - S4 = 4, // Data Source open, programmatic mode (no GUI) - S5 = 5, // GUI up or waiting to transfer first image - S6 = 6, // ready to start transferring image - S7 = 7 // transferring image or transfer done - } - - #endregion - - - /////////////////////////////////////////////////////////////////////////////// - // Language section... - /////////////////////////////////////////////////////////////////////////////// - #region Language section... - - /// - /// Handle encoding between C# and what the DS is currently set to. - /// NOTE: this is static for users of this object do not have to track - /// the encoding (i.e. let TWAIN.cs deal with all of this). This - /// means there is one language for all open DSes, so the last one wins. - /// - public static class Language - { - /// - /// The encoding to use for strings to/from the DS - /// - /// - public static Encoding GetEncoding() - { - return (m_encoding); - } - - /// - /// The current language of the DS - /// - /// - public static void Set(TWLG a_twlg) - { - switch (a_twlg) - { - default: - // NOTE: can only get here if a TWLG was added, but it wasn't added here - m_encoding = Encoding.GetEncoding(1252); - break; - - case TWLG.USERLOCALE: - // NOTE: this should never come back from the DS. only here for completeness - m_encoding = Encoding.GetEncoding(1252); - break; - - case TWLG.THAI: - m_encoding = Encoding.GetEncoding(874); - break; - - case TWLG.JAPANESE: - m_encoding = Encoding.GetEncoding(932); - break; - - case TWLG.CHINESE: - case TWLG.CHINESE_PRC: - case TWLG.CHINESE_SINGAPORE: - case TWLG.CHINESE_SIMPLIFIED: - m_encoding = Encoding.GetEncoding(936); - break; - - case TWLG.KOREAN: - case TWLG.KOREAN_JOHAB: - m_encoding = Encoding.GetEncoding(949); - break; - - case TWLG.CHINESE_HONGKONG: - case TWLG.CHINESE_TAIWAN: - case TWLG.CHINESE_TRADITIONAL: - m_encoding = Encoding.GetEncoding(950); - break; - - case TWLG.ALBANIA: - case TWLG.CROATIA: - case TWLG.CZECH: - case TWLG.HUNGARIAN: - case TWLG.POLISH: - case TWLG.ROMANIAN: - case TWLG.SERBIAN_LATIN: - case TWLG.SLOVAK: - case TWLG.SLOVENIAN: - m_encoding = Encoding.GetEncoding(1250); - break; - - case TWLG.BYELORUSSIAN: - case TWLG.BULGARIAN: - case TWLG.RUSSIAN: - case TWLG.SERBIAN_CYRILLIC: - case TWLG.UKRANIAN: - m_encoding = Encoding.GetEncoding(1251); - break; - - case TWLG.AFRIKAANS: - case TWLG.BASQUE: - case TWLG.CATALAN: - case TWLG.DAN: // DANISH - case TWLG.DUT: // DUTCH - case TWLG.DUTCH_BELGIAN: - case TWLG.ENG: // ENGLISH - case TWLG.ENGLISH_AUSTRALIAN: - case TWLG.ENGLISH_CANADIAN: - case TWLG.ENGLISH_IRELAND: - case TWLG.ENGLISH_NEWZEALAND: - case TWLG.ENGLISH_SOUTHAFRICA: - case TWLG.ENGLISH_UK: - case TWLG.USA: - case TWLG.FAEROESE: - case TWLG.FIN: // FINNISH - case TWLG.FRN: // FRENCH - case TWLG.FRENCH_BELGIAN: - case TWLG.FCF: // FRENCH_CANADIAN - case TWLG.FRENCH_LUXEMBOURG: - case TWLG.FRENCH_SWISS: - case TWLG.GER: // GERMAN - case TWLG.GERMAN_AUSTRIAN: - case TWLG.GERMAN_LIECHTENSTEIN: - case TWLG.GERMAN_LUXEMBOURG: - case TWLG.GERMAN_SWISS: - case TWLG.ICE: // ICELANDIC - case TWLG.INDONESIAN: - case TWLG.ITN: // ITALIAN - case TWLG.ITALIAN_SWISS: - case TWLG.NOR: // NORWEGIAN - case TWLG.NORWEGIAN_BOKMAL: - case TWLG.NORWEGIAN_NYNORSK: - case TWLG.POR: // PORTUGUESE - case TWLG.PORTUGUESE_BRAZIL: - case TWLG.SPA: // SPANISH - case TWLG.SPANISH_MEXICAN: - case TWLG.SPANISH_MODERN: - case TWLG.SWE: // SWEDISH - case TWLG.SWEDISH_FINLAND: - m_encoding = Encoding.GetEncoding(1252); - break; - - case TWLG.GREEK: - m_encoding = Encoding.GetEncoding(1253); - break; - - case TWLG.TURKISH: - m_encoding = Encoding.GetEncoding(1254); - break; - - case TWLG.HEBREW: - m_encoding = Encoding.GetEncoding(1255); - break; - - case TWLG.ARABIC: - case TWLG.ARABIC_ALGERIA: - case TWLG.ARABIC_BAHRAIN: - case TWLG.ARABIC_EGYPT: - case TWLG.ARABIC_IRAQ: - case TWLG.ARABIC_JORDAN: - case TWLG.ARABIC_KUWAIT: - case TWLG.ARABIC_LEBANON: - case TWLG.ARABIC_LIBYA: - case TWLG.ARABIC_MOROCCO: - case TWLG.ARABIC_OMAN: - case TWLG.ARABIC_QATAR: - case TWLG.ARABIC_SAUDIARABIA: - case TWLG.ARABIC_SYRIA: - case TWLG.ARABIC_TUNISIA: - case TWLG.ARABIC_UAE: - case TWLG.ARABIC_YEMEN: - case TWLG.FARSI: - case TWLG.URDU: - m_encoding = Encoding.GetEncoding(1256); - break; - - case TWLG.ESTONIAN: - case TWLG.LATVIAN: - case TWLG.LITHUANIAN: - m_encoding = Encoding.GetEncoding(1257); - break; - - case TWLG.VIETNAMESE: - m_encoding = Encoding.GetEncoding(1258); - break; - - case TWLG.ASSAMESE: - case TWLG.BENGALI: - case TWLG.BIHARI: - case TWLG.BODO: - case TWLG.DOGRI: - case TWLG.GUJARATI: - case TWLG.HARYANVI: - case TWLG.HINDI: - case TWLG.KANNADA: - case TWLG.KASHMIRI: - case TWLG.MALAYALAM: - case TWLG.MARATHI: - case TWLG.MARWARI: - case TWLG.MEGHALAYAN: - case TWLG.MIZO: - case TWLG.NAGA: - case TWLG.ORISSI: - case TWLG.PUNJABI: - case TWLG.PUSHTU: - case TWLG.SIKKIMI: - case TWLG.TAMIL: - case TWLG.TELUGU: - case TWLG.TRIPURI: - // NOTE: there are no known code pages for these, so we will use English - m_encoding = Encoding.GetEncoding(1252); - break; - } - } - - private static Encoding m_encoding = Encoding.GetEncoding(1252); - } - - #endregion - - } - - - /// - /// All of our DllImports live here... - /// - internal sealed class NativeMethods - { - /////////////////////////////////////////////////////////////////////////////// - // Windows - /////////////////////////////////////////////////////////////////////////////// - #region Windows - - /// - /// Get the ID for the current thread... - /// - /// - [DllImport("kernel32.dll")] - internal static extern uint GetCurrentThreadId(); - - /// - /// Allocate a handle to memory... - /// - /// - /// - /// - [DllImport("kernel32.dll")] - internal static extern IntPtr GlobalAlloc(uint uFlags, UIntPtr dwBytes); - - /// - /// Free a memory handle... - /// - /// - /// - [DllImport("kernel32.dll")] - internal static extern IntPtr GlobalFree(IntPtr hMem); - - /// - /// Lock a memory handle... - /// - /// - /// - [DllImport("kernel32.dll")] - internal static extern IntPtr GlobalLock(IntPtr hMem); - - /// - /// Unlock a memory handle... - /// - /// - /// - [DllImport("kernel32.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool GlobalUnlock(IntPtr hMem); - - [DllImport("kernel32.dll")] - internal static extern UIntPtr GlobalSize(IntPtr hMem); - - [DllImport("msvcrt.dll")] - internal static extern UIntPtr _msize(IntPtr ptr); - - [DllImport("libc.so")] - internal static extern UIntPtr malloc_usable_size(IntPtr ptr); - - [DllImport("libSystem.dylib")] - internal static extern UIntPtr malloc_size(IntPtr ptr); - - [DllImport("kernel32.dll", EntryPoint = "CopyMemory", SetLastError = false)] - internal static extern void CopyMemory(IntPtr dest, IntPtr src, uint count); - - [DllImport("libc", EntryPoint = "memcpy", SetLastError = false)] - internal static extern void memcpy(IntPtr dest, IntPtr src, IntPtr count); - - [DllImport("kernel32.dll", EntryPoint = "MoveMemory", SetLastError = false)] - internal static extern void MoveMemory(IntPtr dest, IntPtr src, uint count); - - [DllImport("libc", EntryPoint = "memmove", SetLastError = false)] - internal static extern void memmove(IntPtr dest, IntPtr src, IntPtr count); - - [DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern Int32 _wfopen_s(out IntPtr pFile, string filename, string mode); - - [DllImport("libc", CharSet = CharSet.Ansi, SetLastError = true, BestFitMapping = false, ThrowOnUnmappableChar = true)] - internal static extern IntPtr fopen([MarshalAs(UnmanagedType.LPStr)] string filename, [MarshalAs(UnmanagedType.LPStr)] string mode); - - [DllImport("msvcrt.dll", EntryPoint = "fwrite", CallingConvention = CallingConvention.Cdecl, SetLastError = true)] - internal static extern IntPtr fwriteWin(IntPtr buffer, IntPtr size, IntPtr number, IntPtr file); - - [DllImport("libc", EntryPoint = "fwrite", SetLastError = true)] - internal static extern IntPtr fwrite(IntPtr buffer, IntPtr size, IntPtr number, IntPtr file); - - [DllImport("msvcrt.dll", EntryPoint = "fclose", CallingConvention = CallingConvention.Cdecl, SetLastError = true)] - internal static extern IntPtr fcloseWin(IntPtr file); - - [DllImport("libc", EntryPoint = "fclose", SetLastError = true)] - internal static extern IntPtr fclose(IntPtr file); - - #endregion - - - // We're supporting every DSM that we can... - - /// - /// Use this entry for generic access to the DSM where the - /// destination must be IntPtr.Zero (null)... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryNullDest - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr zero, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryNullDest - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr zero, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryNullDest - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr zero, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryNullDest - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr zero, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryNullDest - ( - ref TWAIN.TW_IDENTITY origin, - IntPtr zero, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryNullDest - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - IntPtr zero, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryNullDest - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - IntPtr zero, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - - - /// - /// Use for generic access to the DSM where the destination must - /// reference a data source... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntry - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntry - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntry - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntry - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntry - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntry - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntry - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - - - /// - /// Use this for DG_AUDIO / DAT.AUDIOFILEXFER / MSG.GET calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryAudioAudiofilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryAudioAudiofilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryAudioAudiofilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryAudioAudiofilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryAudioAudiofilexfer - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryAudioAudiofilexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryAudioAudiofilexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr memref - ); - - /// - /// Use this for DG_AUDIO / DAT.AUDIOINFO / MSG.GET calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryAudioAudioinfo - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_AUDIOINFO twaudioinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryAudioAudioinfo - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_AUDIOINFO twaudioinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryAudioAudioinfo - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_AUDIOINFO twaudioinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryAudioAudioinfo - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_AUDIOINFO twaudioinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryAudioAudioinfo - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_AUDIOINFO twaudioinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryAudioAudioinfo - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_AUDIOINFO twaudioinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryAudioAudioinfo - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_AUDIOINFO twaudioinfo - ); - - /// - /// Use this for DG_AUDIO / DAT.AUDIONATIVEXFER / MSG.GET... - /// - /// - /// - /// - /// - /// - /// - /// - /// *** We'll add this later...maybe*** - - /// - /// Use this for DG_CONTROL / DAT.CALLBACK / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryCallback - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK twcallback - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryCallback - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK twcallback - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryCallback - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK twcallback - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryCallback - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK twcallback - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryCallback - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK twcallback - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryCallback - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK twcallback - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryCallback - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK twcallback - ); - public delegate UInt16 WindowsDsmEntryCallbackDelegate - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twnull - ); - public delegate UInt16 LinuxDsmEntryCallbackDelegate - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twnull - ); - public delegate UInt16 Linux020302Dsm64bitEntryCallbackDelegate - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twnull - ); - public delegate UInt16 MacosxDsmEntryCallbackDelegate - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twnull - ); - - /// - /// Use this for DG_CONTROL / DAT.CALLBACK2 / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryCallback2 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK2 twcallback2 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryCallback2 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK2 twcallback2 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryCallback2 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK2 twcallback2 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryCallback2 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK2 twcallback2 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryCallback2 - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK2 twcallback2 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryCallback2 - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK2 twcallback - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryCallback2 - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY des, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CALLBACK2 twcallback - ); - private delegate UInt16 WindowsDsmEntryCallback2Delegate - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twnull - ); - private delegate UInt16 LinuxDsmEntryCallback2Delegate - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twnull - ); - private delegate UInt16 Linux020302Dsm64bitEntryCallback2Delegate - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twnull - ); - private delegate UInt16 MacosxDsmEntryCallback2Delegate - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twnull - ); - - /// - /// Use this for DG_CONTROL / DAT.CAPABILITY / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryCapability - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CAPABILITY twcapability - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryCapability - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CAPABILITY twcapability - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryCapability - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CAPABILITY twcapability - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryCapability - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CAPABILITY twcapability - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryCapability - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CAPABILITY twcapability - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryCapability - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CAPABILITY twcapability - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryCapability - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CAPABILITY twcapability - ); - - /// - /// Use this for DG_CONTROL / DAT.CUSTOMDSDATA / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryCustomdsdata - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CUSTOMDSDATA twcustomedsdata - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryCustomdsdata - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CUSTOMDSDATA twcustomdsdata - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryCustomdsdata - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CUSTOMDSDATA twcustomdsdata - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryCustomdsdata - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CUSTOMDSDATA twcustomdsdata - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryCustomdsdata - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CUSTOMDSDATA twcustomdsdata - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryCustomdsdata - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CUSTOMDSDATA twcustomedsdata - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryCustomdsdata - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CUSTOMDSDATA twcustomedsdata - ); - - /// - /// Use this for DG_CONTROL / DAT.DEVICEEVENT / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryDeviceevent - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_DEVICEEVENT twdeviceevent - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryDeviceevent - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_DEVICEEVENT twdeviceevent - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryDeviceevent - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_DEVICEEVENT twdeviceevent - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryDeviceevent - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_DEVICEEVENT twdeviceevent - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryDeviceevent - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_DEVICEEVENT twdeviceevent - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryDeviceevent - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_DEVICEEVENT twdeviceevent - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryDeviceevent - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_DEVICEEVENT twdeviceevent - ); - - /// - /// Use this for DG_CONTROL / DAT.EVENT / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryEvent - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EVENT twevent - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryEvent - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EVENT twevent - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryEvent - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EVENT twevent - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryEvent - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EVENT twevent - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryEvent - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EVENT twevent - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryEvent - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EVENT twevent - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryEvent - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EVENT twevent - ); - - /// - /// Use this for DG_CONTROL / DAT.ENTRYPOINT / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryEntrypoint - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_ENTRYPOINT twentrypoint - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryEntrypoint - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_ENTRYPOINT twentrypoint - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryEntrypoint - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_ENTRYPOINT twentrypoint - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryEntrypoint - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_ENTRYPOINT twentrypoint - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryEntrypoint - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_ENTRYPOINT_LINUX64 twentrypoint - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryEntrypoint - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_ENTRYPOINT twentrypoint - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryEntrypoint - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_ENTRYPOINT twentrypoint - ); - - /// - /// Use this for DG_CONTROL / DAT.FILESYSTEM / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryFilesystem - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILESYSTEM twfilesystem - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryFilesystem - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILESYSTEM twfilesystem - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryFilesystem - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILESYSTEM twfilesystem - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryFilesystem - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILESYSTEM twfilesystem - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryFilesystem - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILESYSTEM twfilesystem - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryFilesystem - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILESYSTEM twfilesystem - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryFilesystem - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILESYSTEM twfilesystem - ); - - /// - /// Use this for DG_CONTROL / DAT.IDENTITY / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryIdentity - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IDENTITY_LEGACY twidentity - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryIdentityState4 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IDENTITY_LEGACY twidentity - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryIdentity - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IDENTITY_LEGACY twidentity - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryIdentity - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IDENTITY_LEGACY twidentity - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryIdentity - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IDENTITY_LEGACY twidentity - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryIdentity - ( - ref TWAIN.TW_IDENTITY_LINUX64 origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IDENTITY_LINUX64 twidentity - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryIdentity - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IDENTITY_MACOSX twidentity - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryIdentity - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IDENTITY_MACOSX twidentity - ); - - /// - /// Use this for DG_CONTROL / DAT.NULL / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - /// ***Only needed for drivers, so we don't have it*** - - /// - /// Use this for DG_CONTROL / DAT.PARENT / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryParent - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr hwnd - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryParent - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr hwnd - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryParent - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr hwnd - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryParent - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr hwnd - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryParent - ( - ref TWAIN.TW_IDENTITY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr hwnd - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryParent - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr hwnd - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryParent - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr hwnd - ); - - /// - /// Use this for DG_CONTROL / DAT.PASSTHRU / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryPassthru - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PASSTHRU twpassthru - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryPassthru - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PASSTHRU twpassthru - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryPassthru - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PASSTHRU twpassthru - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryPassthru - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PASSTHRU twpassthru - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryPassthru - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PASSTHRU twpassthru - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryPassthru - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PASSTHRU twpassthru - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryPassthru - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PASSTHRU twpassthru - ); - - /// - /// Use this for DG_CONTROL / DAT.PENDINGXFERS / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryPendingxfers - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PENDINGXFERS twpendingxfers - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryPendingxfers - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PENDINGXFERS twpendingxfers - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryPendingxfers - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PENDINGXFERS twpendingxfers - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryPendingxfers - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PENDINGXFERS twpendingxfers - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryPendingxfers - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PENDINGXFERS twpendingxfers - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryPendingxfers - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PENDINGXFERS twpendingxfers - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryPendingxfers - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PENDINGXFERS twpendingxfers - ); - - /// - /// Use this for DG_IMAGE / DAT.SETUPFILEXFER / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntrySetupfilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPFILEXFER twsetupfilexfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntrySetupfilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPFILEXFER twsetupfilexfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntrySetupfilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPFILEXFER twsetupfilexfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntrySetupfilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPFILEXFER twsetupfilexfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntrySetupfilexfer - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPFILEXFER twsetupfilexfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntrySetupfilexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPFILEXFER twsetupfilexfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntrySetupfilexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPFILEXFER twsetupfilexfer - ); - - /// - /// Use this for DG_IMAGE / DAT.SETUPMEMXFER / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntrySetupmemxfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPMEMXFER twsetupmemxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntrySetupmemxfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPMEMXFER twsetupmemxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntrySetupmemxfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPMEMXFER twsetupmemxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntrySetupmemxfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPMEMXFER twsetupmemxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntrySetupmemxfer - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPMEMXFER twsetupmemxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntrySetupmemxfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPMEMXFER twsetupmemxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntrySetupmemxfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_SETUPMEMXFER twsetupmemxfer - ); - - /// - /// Use this for DG_CONTROL / DAT.STATUS / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryStatus - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryStatusState3 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryStatus - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryStatusState3 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryStatus - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryStatusState3 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryStatus - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryStatusState3 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryStatus - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryStatusState3 - ( - ref TWAIN.TW_IDENTITY origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryStatus - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryStatusState3 - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryStatus - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryStatusState3 - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - IntPtr dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUS twstatus - ); - - /// - /// Use this for DG_CONTROL / DAT.STATUSUTF8 / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryStatusutf8 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUSUTF8 twstatusutf8 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryStatusutf8 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUSUTF8 twstatusutf8 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryStatusutf8 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUSUTF8 twstatusutf8 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryStatusutf8 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUSUTF8 twstatusutf8 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryStatusutf8 - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUSUTF8 twstatusutf8 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryStatusutf8 - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUSUTF8 twstatusutf8 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryStatusutf8 - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_STATUSUTF8 twstatusutf8 - ); - - /// - /// Use this for DG.CONTROL / DAT.TWAINDIRECT / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryTwaindirect - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_TWAINDIRECT twtwaindirect - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryTwaindirect - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_TWAINDIRECT twtwaindirect - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryTwaindirect - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_TWAINDIRECT twtwaindirect - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryTwaindirect - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_TWAINDIRECT twtwaindirect - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryTwaindirect - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_TWAINDIRECT twtwaindirect - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryTwaindirect - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_TWAINDIRECT twtwaindirect - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryTwaindirect - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_TWAINDIRECT twtwaindirect - ); - - /// - /// Use this for DG_CONTROL / DAT.USERINTERFACE / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryUserinterface - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_USERINTERFACE twuserinterface - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryUserinterface - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_USERINTERFACE twuserinterface - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryUserinterface - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_USERINTERFACE twuserinterface - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryUserinterface - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_USERINTERFACE twuserinterface - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryUserinterface - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_USERINTERFACE twuserinterface - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryUserinterface - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_USERINTERFACE twuserinterface - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryUserinterface - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_USERINTERFACE twuserinterface - ); - - /// - /// Use this for DG_CONTROL / DAT.XFERGROUP / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryXfergroup - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref UInt32 twuint32 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryXfergroup - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref UInt32 twuint32 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryXfergroup - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref UInt32 twuint32 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryXfergroup - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref UInt32 twuint32 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryXfergroup - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref UInt32 twuint32 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryXfergroup - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref UInt32 twuint32 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryXfergroup - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref UInt32 twuint32 - ); - - /// - /// Use this for DG_AUDIO / DAT.AUDIOFILEXFER / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryAudiofilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryAudiofilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryAudiofilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryAudiofilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryAudiofilexfer - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryAudiofilexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryAudiofilexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - - /// - /// Use this for DG_AUDIO / DAT.AUDIONATIVEXFER / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryAudionativexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrWav - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryAudionativexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrWav - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryAudionativexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrWav - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryAudionativexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrWav - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryAudionativexfer - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrWav - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryAudionativexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrAiff - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryAudionativexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrAiff - ); - - /// - /// Use this for DG_IMAGE / DAT.CIECOLOR / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryCiecolor - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CIECOLOR twciecolor - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryCiecolor - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CIECOLOR twciecolor - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryCiecolor - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CIECOLOR twciecolor - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryCiecolor - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CIECOLOR twciecolor - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryCiecolor - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CIECOLOR twciecolor - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryCiecolor - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CIECOLOR twciecolor - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryCiecolor - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_CIECOLOR twciecolor - ); - - /// - /// Use this for DG_IMAGE / DAT.EXTIMAGEINFO / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryExtimageinfo - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EXTIMAGEINFO twextimageinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryExtimageinfo - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EXTIMAGEINFO twextimageinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryExtimageinfo - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EXTIMAGEINFO twextimageinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryExtimageinfo - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EXTIMAGEINFO twextimageinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryExtimageinfo - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EXTIMAGEINFO twextimageinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryExtimageinfo - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EXTIMAGEINFO twextimageinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryExtimageinfo - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_EXTIMAGEINFO twextimageinfo - ); - - /// - /// Use this for DG_IMAGE / DAT.FILTER / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryFilter - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILTER twfilter - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryFilter - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILTER twfilter - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryFilter - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILTER twfilter - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryFilter - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILTER twfilter - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryFilter - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILTER twfilter - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryFilter - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILTER twfilter - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryFilter - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_FILTER twfilter - ); - - /// - /// Use this for DG_IMAGE / DAT.GRAYRESPONSE / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryGrayresponse - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_GRAYRESPONSE twgrayresponse - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryGrayresponse - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_GRAYRESPONSE twgrayresponse - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryGrayresponse - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_GRAYRESPONSE twgrayresponse - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryGrayresponse - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_GRAYRESPONSE twgrayresponse - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryGrayresponse - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_GRAYRESPONSE twgrayresponse - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryGrayresponse - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_GRAYRESPONSE twgrayresponse - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryGrayresponse - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_GRAYRESPONSE twgrayresponse - ); - - /// - /// Use this for DG_IMAGE / DAT.ICCPROFILE / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryIccprofile - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_MEMORY twmemory - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryIccprofile - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_MEMORY twmemory - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryIccprofile - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_MEMORY twmemory - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryIccprofile - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_MEMORY twmemory - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryIccprofile - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_MEMORY twmemory - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryIccprofile - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_MEMORY twmemory - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryIccprofile - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_MEMORY twmemory - ); - - /// - /// Use this for DG_IMAGE / DAT.IMAGEFILEXFER / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryImagefilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryImagefilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryImagefilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryImagefilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryImagefilexfer - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryImagefilexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryImagefilexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - IntPtr twmemref - ); - - /// - /// Use this for DG_IMAGE / DAT.IMAGEINFO / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryImageinfo - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEINFO twimageinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryImageinfo - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEINFO twimageinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryImageinfo - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEINFO twimageinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryImageinfo - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEINFO twimageinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryImageinfo - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEINFO_LINUX64 twimageinfolinux64 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryImageinfo - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEINFO twimageinfo - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryImageinfo - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEINFO twimageinfo - ); - - /// - /// Use this for DG_IMAGE / DAT.IMAGELAYOUT / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryImagelayout - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGELAYOUT twimagelayout - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryImagelayout - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGELAYOUT twimagelayout - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryImagelayout - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGELAYOUT twimagelayout - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryImagelayout - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGELAYOUT twimagelayout - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryImagelayout - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGELAYOUT twimagelayout - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryImagelayout - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGELAYOUT twimagelayout - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryImagelayout - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGELAYOUT twimagelayout - ); - - /// - /// Use this for DG_IMAGE / DAT.IMAGEMEMFILEXFER / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryImagememfilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER twimagememxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryImagememfilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER twimagememxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryImagememfilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER twimagememxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryImagememfilexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER twimagememxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryImagememfilexfer - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER_LINUX64 twimagememxferlinux64 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryImagememfilexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER_MACOSX twimagememxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryImagememfilexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER_MACOSX twimagememxfer - ); - - /// - /// Use this for DG_IMAGE / DAT.IMAGEMEMXFER / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryImagememxfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER twimagememxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryImagememxfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER twimagememxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryImagememxfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER twimagememxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryImagememxfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER twimagememxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryImagememxfer - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER_LINUX64 twimagememxferlinux64 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryImagememxfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER_MACOSX twimagememxfer - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryImagememxfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_IMAGEMEMXFER_MACOSX twimagememxfer - ); - - /// - /// Use this for DG_IMAGE / DAT.IMAGENATIVEXFER / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryImagenativexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrBitmap - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryImagenativexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrBitmap - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryImagenativexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrBitmap - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryImagenativexfer - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrBitmap - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryImagenativexfer - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrBitmap - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryImagenativexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrBitmap - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryImagenativexfer - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref IntPtr intptrBitmap - ); - - /// - /// Use this for DG_IMAGE / DAT.JPEGCOMPRESSION / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryJpegcompression - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_JPEGCOMPRESSION twjpegcompression - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryJpegcompression - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_JPEGCOMPRESSION twjpegcompression - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryJpegcompression - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_JPEGCOMPRESSION twjpegcompression - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryJpegcompression - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_JPEGCOMPRESSION twjpegcompression - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryJpegcompression - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_JPEGCOMPRESSION twjpegcompression - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryJpegcompression - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_JPEGCOMPRESSION twjpegcompression - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryJpegcompression - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_JPEGCOMPRESSION twjpegcompression - ); - - /// - /// Use this for DG_CONTROL / DAT.METRICS / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryMetrics - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_METRICS twmetrics - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryMetrics - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_METRICS twmetrics - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryMetrics - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_METRICS twmetrics - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryMetrics - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_METRICS twmetrics - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryMetrics - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_METRICS twmetrics - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryMetrics - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_METRICS twmetrics - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryMetrics - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_METRICS twmetrics - ); - - /// - /// Use this for DG_IMAGE / DAT.PALETTE8 / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryPalette8 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PALETTE8 twpalette8 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryPalette8 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PALETTE8 twpalette8 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryPalette8 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PALETTE8 twpalette8 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryPalette8 - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PALETTE8 twpalette8 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryPalette8 - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PALETTE8 twpalette8 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryPalette8 - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PALETTE8 twpalette8 - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryPalette8 - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_PALETTE8 twpalette8 - ); - - /// - /// Use this for DG_IMAGE / DAT.RGBRESPONSE / MSG.* calls... - /// - /// - /// - /// - /// - /// - /// - /// - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twain_32.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwain32DsmEntryRgbresponse - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_RGBRESPONSE twrgbresponse - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("twaindsm.dll", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 WindowsTwaindsmDsmEntryRgbresponse - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_RGBRESPONSE twrgbresponse - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 LinuxDsmEntryRgbresponse - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_RGBRESPONSE twrgbresponse - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib64/libtwaindsm.so", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux64DsmEntryRgbresponse - ( - ref TWAIN.TW_IDENTITY_LEGACY origin, - ref TWAIN.TW_IDENTITY_LEGACY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_RGBRESPONSE twrgbresponse - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/usr/local/lib/libtwaindsm.so.2.3.2", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 Linux020302Dsm64bitEntryRgbresponse - ( - ref TWAIN.TW_IDENTITY origin, - ref TWAIN.TW_IDENTITY dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_RGBRESPONSE twrgbresponse - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/System/Library/Frameworks/TWAIN.framework/TWAIN", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwainDsmEntryRgbresponse - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_RGBRESPONSE twrgbresponse - ); - [SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist")] - [DllImport("/Library/Frameworks/TWAINDSM.framework/TWAINDSM", EntryPoint = "DSM_Entry", CharSet = CharSet.Ansi)] - internal static extern UInt16 MacosxTwaindsmDsmEntryRgbresponse - ( - ref TWAIN.TW_IDENTITY_MACOSX origin, - ref TWAIN.TW_IDENTITY_MACOSX dest, - TWAIN.DG dg, - TWAIN.DAT dat, - TWAIN.MSG msg, - ref TWAIN.TW_RGBRESPONSE twrgbresponse - ); - - } -} diff --git a/src/NTwain-temp/ThreadMarshaller.cs b/src/NTwain-temp/ThreadMarshaller.cs deleted file mode 100644 index f8189c1..0000000 --- a/src/NTwain-temp/ThreadMarshaller.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace NTwain -{ - /// - /// Allows work to be marshalled to a different (usually UI) thread if necessary. - /// - public interface IThreadMarshaller - { - /// - /// Starts work asynchronously and returns immediately. - /// - /// - /// - void BeginInvoke(Delegate work, params object[] args); - - /// - /// Starts work synchronously until it returns. - /// - /// - /// - /// - object Invoke(Delegate work, params object[] args); - } - - /// - /// Async calls are marshalled to threadpool thread. - /// Should only be used in non-UI apps. - /// - public class ThreadPoolMarshaller : IThreadMarshaller - { - public bool InvokeRequired => throw new NotImplementedException(); - - public void BeginInvoke(Delegate work, params object[] args) - { - Task.Run(() => work.DynamicInvoke(args)); - } - - public object Invoke(Delegate work, params object[] args) - { - return work.DynamicInvoke(args); - } - } -} diff --git a/src/NTwain-temp/TransferErrorEventArgs.cs b/src/NTwain-temp/TransferErrorEventArgs.cs deleted file mode 100644 index f6f1e4b..0000000 --- a/src/NTwain-temp/TransferErrorEventArgs.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using TWAINWorkingGroup; -using static TWAINWorkingGroup.TWAIN; - -namespace NTwain -{ - /// - /// Contains TWAIN codes and source status when an error is encountered during transfer. - /// - public class TransferErrorEventArgs : EventArgs - { - public TransferErrorEventArgs(STS code, Exception error = null) - { - Code = code; - Exception = error; - } - - /// - /// Gets the error code from the transfer. - /// - public STS Code { get; } - - /// - /// Gets the exception if the error is from some exception. - /// - public Exception Exception { get; } - } -} diff --git a/src/NTwain-temp/TransferReadyEventArgs.cs b/src/NTwain-temp/TransferReadyEventArgs.cs deleted file mode 100644 index 442e356..0000000 --- a/src/NTwain-temp/TransferReadyEventArgs.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TWAINWorkingGroup; -using static TWAINWorkingGroup.TWAIN; - -namespace NTwain -{ - /// - /// Contains event data when a data transfer is ready to be processed. - /// - public class TransferReadyEventArgs : EventArgs - { - public TransferReadyEventArgs(TWAIN twain, int pendingCount, TWEJ endOfJobFlag) - { - _twain = twain; - PendingCount = pendingCount; - EndOfJobFlag = endOfJobFlag; - } - - - /// - /// Gets or sets whether the current transfer should be skipped - /// and continue next transfer if there are more data. - /// - public bool SkipCurrent { get; set; } - - /// - /// Gets or sets whether to cancel the capture phase. - /// - public CancelType CancelCapture { get; set; } - - /// - /// Gets the end of job flag value for this transfer if job control is enabled. - /// - public TWEJ EndOfJobFlag { get; private set; } - - /// - /// Gets the known pending transfer count. This may not be appilicable - /// for certain scanning modes. - /// - public int PendingCount { get; private set; } - - TW_IMAGEINFO? _imgInfo; - private readonly TWAIN _twain; - - /// - /// Gets the tentative image information for the current transfer if applicable. - /// This may differ from the final image depending on the transfer mode used (mostly when doing mem xfer). - /// - public TW_IMAGEINFO? PendingImageInfo - { - get - { - if (!_imgInfo.HasValue) - { - TW_IMAGEINFO info = default; - if (_twain.DatImageinfo(DG.IMAGE, MSG.GET, ref info) == STS.SUCCESS) - { - _imgInfo = info; - } - } - return _imgInfo; - } - } - - } - - public enum CancelType - { - /// - /// No cancel. - /// - None, - /// - /// Stops feeder but continue receiving scanned images. - /// - Graceful, - /// - /// Stops feeder and discard pending images. - /// - Immediate - } -} diff --git a/src/NTwain-temp/TwainSession.cs b/src/NTwain-temp/TwainSession.cs deleted file mode 100644 index 6b70275..0000000 --- a/src/NTwain-temp/TwainSession.cs +++ /dev/null @@ -1,566 +0,0 @@ -// NOTE this is derived from the TWAIN.cs in twaincs - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Threading; -using TWAINWorkingGroup; -using static TWAINWorkingGroup.TWAIN; - -namespace NTwain -{ - /// - /// A wrapper around the low-level object - /// that may be easier to use in dotnet with typical scenarios. - /// - public class TwainSession : IDisposable - { - private TWAIN _twain; - private bool _disposed; - private readonly IThreadMarshaller _threadMarshaller; - private IntPtr _hWnd; - - public TwainSession(Assembly applicationInfo, - IThreadMarshaller threadMarshaller, IntPtr hWnd, - TWLG language = TWLG.ENGLISH_USA, TWCY country = TWCY.USA) : - this(FileVersionInfo.GetVersionInfo(applicationInfo.Location), - threadMarshaller, hWnd, language, country) - { } - public TwainSession(FileVersionInfo applicationInfo, - IThreadMarshaller threadMarshaller, IntPtr hWnd, - TWLG language = TWLG.ENGLISH_USA, TWCY country = TWCY.USA) : - this(applicationInfo.CompanyName, applicationInfo.ProductName, applicationInfo.ProductName, - threadMarshaller, hWnd, language, country) - { } - public TwainSession(string companyName, string productFamily, string productName, - IThreadMarshaller threadMarshaller, IntPtr hWnd, - TWLG language = TWLG.ENGLISH_USA, TWCY country = TWCY.USA) - { - _twain = new TWAIN( - companyName, productFamily, productName, - (ushort)TWON_PROTOCOL.MAJOR, (ushort)TWON_PROTOCOL.MINOR, - (uint)(DG.APP2 | DG.IMAGE), - country, "", language, 2, 4, false, true, - HandleDeviceEvent, - HandleScanEvent, - HandleUIThreadAction, - hWnd); - - _threadMarshaller = threadMarshaller ?? new ThreadPoolMarshaller(); - _hWnd = hWnd; - } - - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (disposing) - { - if (_twain != null) - { - Close(); - _twain.Dispose(); - _twain = null; - } - Log.Close(); - } - _disposed = true; - } - } - - public void Dispose() - { - Dispose(disposing: true); - GC.SuppressFinalize(this); - } - - /// - /// Gets the low-level twain object. - /// Only use it if you know what you're doing. - /// - public TWAIN TWAIN { get { return _twain; } } - - #region event callbacks - - /// - /// Raised when data source has encountered some hardwar event. - /// - public event EventHandler DeviceEvent; - - /// - /// Raised when data source comes down to state 4 from higher. - /// - public event EventHandler SourceDisabled; - - /// - /// Raised when there's some error during transfer. - /// - public event EventHandler TransferError; - - /// - /// Raised when there's a pending transfer. Can be used to cancel transfers. - /// - public event EventHandler TransferReady; - - private void HandleUIThreadAction(Action action) - { - DebugThreadInfo("begin UI thread action"); - - _threadMarshaller.Invoke(action); - } - - private STS HandleDeviceEvent() - { - STS sts; - TW_DEVICEEVENT twdeviceevent; - - // Drain the event queue... - while (true) - { - DebugThreadInfo("in device event loop"); - - // Try to get an event... - twdeviceevent = default; - sts = _twain.DatDeviceevent(DG.CONTROL, MSG.GET, ref twdeviceevent); - if (sts != STS.SUCCESS) - { - break; - } - else - { - try - { - DeviceEvent?.Invoke(this, twdeviceevent); - } - catch { } - } - } - - // Return a status, in case we ever need it for anything... - return STS.SUCCESS; - } - - private STS HandleScanEvent(bool closing) - { - DebugThreadInfo("scan event begin"); - - // the scan event needs to return asap since it can come from msg loop - // so fire off the handling work to another thread - //_threadMarshaller.BeginInvoke(new Action(HandleScanEventReal), closing); - return STS.SUCCESS; - } - - //void HandleScanEventReal(bool closing) - //{ - // DebugThreadInfo("begin"); - - // if (_twain == null || State <= STATE.S4 || closing) return; - - // if (_twain.IsMsgCloseDsReq() || _twain.IsMsgCloseDsOk()) - // { - // _twain.Rollback(STATE.S4); - // return; - // } - - // // all except mem xfer will run this once and raise event. - // // mem xfer will run this multiple times until complete image is assembled - // if (_twain.IsMsgXferReady()) - // { - // TW_PENDINGXFERS pending = default; - // var sts = _twain.DatPendingxfers(DG.CONTROL, MSG.GET, ref pending); - // if (sts != STS.SUCCESS) - // { - // try - // { - // TransferError?.Invoke(this, new TransferErrorEventArgs(sts)); - // } - // catch { } - // return; // do more? - // } - - // var xferMech = Capabilities.ICAP_XFERMECH.GetCurrent(); - - // var readyArgs = new TransferReadyEventArgs(_twain, pending.Count, (TWEJ)pending.EOJ); - // try - // { - // TransferReady?.Invoke(this, readyArgs); - // } - // catch { } - - // if (readyArgs.CancelCapture == CancelType.Immediate) - // { - // sts = _twain.DatPendingxfers(DG.CONTROL, MSG.RESET, ref pending); - // } - // else - // { - // if (readyArgs.CancelCapture == CancelType.Graceful) StopCapture(); - - // if (!readyArgs.SkipCurrent) - // { - // switch (xferMech) - // { - // case TWSX.NATIVE: - // RunImageNativeXfer(); - // break; - // case TWSX.MEMFILE: - // RunImageMemFileXfer(); - // break; - // case TWSX.FILE: - // RunImageFileXfer(); - // break; - // case TWSX.MEMORY: - // RunImageMemoryXfer(); - // break; - // } - // } - // sts = _twain.DatPendingxfers(DG.CONTROL, MSG.ENDXFER, ref pending); - // } - - // // TODO: may be wrong for now - // if (pending.Count == 0 || sts == STS.CANCEL || sts == STS.XFERDONE) - // { - // _twain.Rollback(STATE.S4); - // } - // else - // { - // HandleScanEvent(State <= STATE.S3); - // } - // } - - //} - - [Conditional("DEBUG")] - private void DebugThreadInfo(string description, [CallerMemberName] string callerName = "") - { - var tid = Thread.CurrentThread.ManagedThreadId; - Debug.WriteLine($"[Thread {tid}] {callerName}() {description}"); - } - - private void RunImageMemoryXfer() - { - throw new NotImplementedException(); - - //// Handle DAT_NULL/MSG_XFERREADY... - //if (_twain.IsMsgXferReady() && !_xferReadySent) - //{ - // _xferReadySent = true; - - // // Get the amount of memory needed... - // TW_SETUPMEMXFER m_twsetupmemxfer = default; - // var sts = _twain.DatSetupmemxfer(DG.CONTROL, MSG.GET, ref m_twsetupmemxfer); - // if ((sts != STS.SUCCESS) || (m_twsetupmemxfer.Preferred == 0)) - // { - // _xferReadySent = false; - // if (!_disableDsSent) - // { - // _disableDsSent = true; - // StepDown(STATE.S4); - // } - // } - - // // Allocate the transfer memory (with a little extra to protect ourselves)... - // var m_intptrXfer = Marshal.AllocHGlobal((int)m_twsetupmemxfer.Preferred + 65536); - // if (m_intptrXfer == IntPtr.Zero) - // { - // _disableDsSent = true; - // StepDown(STATE.S4); - // } - //} - - //// This is where the statemachine runs that transfers and optionally - //// saves the images to disk (it also displays them). It'll go back - //// and forth between states 6 and 7 until an error occurs, or until - //// we run out of images... - //if (_xferReadySent && !_disableDsSent) - //{ - // CaptureImages(); - //} - } - - private void RunImageFileXfer() - { - throw new NotImplementedException(); - } - - private void RunImageMemFileXfer() - { - throw new NotImplementedException(); - } - - private void RunImageNativeXfer() - { - - } - - //protected virtual void OnScanEvent(bool closing) { } - //public event EventHandler ScanEvent; - - #endregion - - #region TWAIN operations - - - /// - /// Gets the current TWAIN state. - /// - public STATE State - { - get { return _twain.GetState(); } - } - - /// - /// Opens the TWAIN data source manager. - /// This needs to be done before anything else. - /// - /// - public STS Open() - { - var sts = _twain.DatParent(DG.CONTROL, MSG.OPENDSM, ref _hWnd); - return sts; - } - - /// - /// Closes the TWAIN data source manager. - /// This is called when is invoked. - /// - public void Close() - { - _twain.Rollback(STATE.S2); - } - - /// - /// Gets list of TWAIN data sources. - /// - /// - public IList GetDataSources() - { - var list = new List(); - if (State > STATE.S2) - { - TW_IDENTITY twidentity = default; - STS sts; - - for (sts = _twain.DatIdentity(DG.CONTROL, MSG.GETFIRST, ref twidentity); - sts != STS.ENDOFLIST; - sts = _twain.DatIdentity(DG.CONTROL, MSG.GETNEXT, ref twidentity)) - { - list.Add(twidentity); - } - } - return list; - } - - /// - /// Gets or sets the default data source. - /// - public TW_IDENTITY? DefaultDataSource - { - get - { - TW_IDENTITY twidentity = default; - var sts = _twain.DatIdentity(DG.CONTROL, MSG.GETDEFAULT, ref twidentity); - if (sts == STS.SUCCESS) return twidentity; - return null; - } - set - { - // Make it the default, we don't care if this succeeds... - if (value.HasValue) - { - var twidentity = value.Value; - _twain.DatIdentity(DG.CONTROL, MSG.SET, ref twidentity); - } - } - } - - /// - /// Gets or sets the currently open data source. - /// Setting it will try to open it. - /// - public TW_IDENTITY? CurrentDataSource - { - get - { - if (State > STATE.S3) - { - return _twain.m_twidentityDs; - } - return null; - } - set - { - _twain.Rollback(STATE.S3); - if (value.HasValue) - { - var twidentity = value.Value; - _twain.DatIdentity(DG.CONTROL, MSG.OPENDS, ref twidentity); - } - } - } - - - private Capabilities _caps; - - /// - /// Get current data source's capabilities. Will be null if no data source is open. - /// - /// - public Capabilities Capabilities - { - get - { - if (State >= STATE.S4) - { - return _caps ?? (_caps = new Capabilities(_twain)); - } - return null; - } - } - - /// - /// Gets/sets the current source's settings as opaque data. - /// Returns null if not supported. - /// - public byte[] CustomDsData - { - get - { - TW_CUSTOMDSDATA data = default; - var sts = _twain.DatCustomdsdata(DG.CONTROL, MSG.GET, ref data); - if (sts == STS.SUCCESS) - { - if (data.hData != IntPtr.Zero && data.InfoLength > 0) - { - try - { - var lockedPtr = _twain.DsmMemLock(data.hData); - var bytes = new byte[data.InfoLength]; - Marshal.Copy(lockedPtr, bytes, 0, bytes.Length); - } - finally - { - _twain.DsmMemUnlock(data.hData); - _twain.DsmMemFree(ref data.hData); - } - } - return EmptyArray.Value; - } - return null; - } - set - { - if (value == null || value.Length == 0) return; - - TW_CUSTOMDSDATA data = default; - data.InfoLength = (uint)value.Length; - data.hData = _twain.DsmMemAlloc(data.InfoLength); - try - { - var lockedPtr = _twain.DsmMemLock(data.hData); - Marshal.Copy(value, 0, lockedPtr, value.Length); - _twain.DsmMemUnlock(data.hData); - var sts = _twain.DatCustomdsdata(DG.CONTROL, MSG.SET, ref data); - } - finally - { - // should be freed already if no error but just in case - if (data.hData != IntPtr.Zero) _twain.DsmMemFree(ref data.hData); - } - } - } - - - /// - /// Attempts to show the current data source's settings dialog if supported. - /// - /// - public STS ShowSettings() - { - TW_USERINTERFACE ui = default; - ui.hParent = _hWnd; - ui.ShowUI = 1; - return _twain.DatUserinterface(DG.CONTROL, MSG.ENABLEDSUIONLY, ref ui); - } - - /// - /// Begins the capture process on the current data source. - /// - /// Whether to display settings UI. Not all data sources support this. - /// - public STS StartCapture(bool showUI) - { - TW_USERINTERFACE ui = default; - ui.hParent = _hWnd; - ui.ShowUI = (ushort)(showUI ? 1 : 0); - return _twain.DatUserinterface(DG.CONTROL, MSG.ENABLEDS, ref ui); - } - - /// - /// Stops the data source's automated feeder - /// if is set to true. - /// - /// - public STS StopCapture() - { - TW_PENDINGXFERS pending = default; - return _twain.DatPendingxfers(DG.CONTROL, MSG.STOPFEEDER, ref pending); - } - - /// - /// Reads information relating to the last capture run. - /// Only valid on state 4 after a capture. - /// - public Metrics GetMetrics() - { - TW_METRICS twmetrics = default; - twmetrics.SizeOf = (uint)Marshal.SizeOf(twmetrics); - var sts = _twain.DatMetrics(DG.CONTROL, MSG.GET, ref twmetrics); - if (sts == STS.SUCCESS) - { - return new Metrics - { - ReturnCode = sts, - Images = (int)twmetrics.ImageCount, - Sheets = (int)twmetrics.SheetCount - }; - } - return new Metrics { ReturnCode = sts }; - } - - /// - /// Sends a TWAIN Direct task from the application to the driver. - /// - /// The TWAIN Direct task in JSON. - /// The current system being used to connect the application to the scanner. - /// - public TwainDirectTaskResult SetTwainDirectTask(string taskJson, ushort communicationManager = 0) - { - var result = new TwainDirectTaskResult { ReturnCode = STS.FAILURE }; - TW_TWAINDIRECT task = default; - try - { - task.SizeOf = (uint)Marshal.SizeOf(typeof(TW_TWAINDIRECT)); - task.CommunicationManager = communicationManager; - task.Send = ValueWriter.StringToPtrUTF8(_twain, taskJson, out int length); - task.SendSize = (uint)length; - - result.ReturnCode = _twain.DatTwaindirect(DG.CONTROL, MSG.SETTASK, ref task); - if (result.ReturnCode == STS.SUCCESS && task.ReceiveSize > 0 && task.Receive != IntPtr.Zero) - { - result.ResponseJson = ValueReader.PtrToStringUTF8(task.Receive, (int)task.ReceiveSize); - } - } - finally - { - if (task.Send != IntPtr.Zero) _twain.DsmMemFree(ref task.Send); // just in case - if (task.Receive != IntPtr.Zero) _twain.DsmMemFree(ref task.Receive); - } - return result; - } - - #endregion - } -} diff --git a/twain-doc/Kodak/GettingStarted.htm b/twain-doc/Kodak/GettingStarted.htm deleted file mode 100644 index 2f24c74..0000000 --- a/twain-doc/Kodak/GettingStarted.htm +++ /dev/null @@ -1,1177 +0,0 @@ - - - - - - - - -Kodak Document Scanners - - - - - - - - - - -
- -

Kodak KDS TWAIN Driver

- -

Getting Started

- -

20-June-2012

- -

 

- -

 

- -

Contents

- -

1.     Overview...................................................................................................................... -2

- -

2.     GUI Based Applications (the old -way)........................................................................... -3

- -

3.     Programmatic Based Applications -(the newer way)........................................................ 4

- -

4.     Profile Based Applications (the -best way)...................................................................... -5

- -

5.     Decoupling.................................................................................................................... -6

- -

6.     Logging and the Simulator.............................................................................................. -7

- -

7.     Sample Code................................................................................................................ -8

- -

 

- -

 

- -

 

- -

1.   Overview

- -

Developing an application using any image capture -application programming interfaces (API) is a challenge.  The basic -premise of these systems is that the application discovers a device through its -driver, interrogates it about its capabilities, sets a session up, and then -starts scanning.  The problem is that there are a large number of -capabilities all interacting in a variety of ways (some obvious and some not), -so that getting the driver to do exactly what is desired is not always as -straightforward as could be hoped.  And, as with any API, things usual -work well until errors are encountered, then the amount of code increases -dramatically to accommodate all the possible results for any given operation.

- -

 

- -

TWAIN provides ways to mitigate this work, though it may not -be obvious from reading the specification.  This document will outline -some development strategies designed to create robust, flexible -applications.  It is assumed that the reader has some familiarity with TWAIN, -either from previous coding experience or from reading some of the TWAIN -specification.

- -

 

- -

 

- -

2.   GUI Based Applications (the old way)

- -

When TWAIN was developed in the early 1990s the single -focus of the effort was to bring applications and drivers together.  -Previously an application writer would select a device, like a flatbed scanner, -get the driver for it and write the application code to talk to that -device.  Support for a new device meant getting its driver and writing -code to support it as well.  TWAIN was designed to abstract away that -driver code, hiding it behind a common API.  Now it was possible for an -application to start scanning and capture image data in a way that worked for -any device the came with a TWAIN driver.

- -

 

- -

There was one area that the standard did not try to handle -at first, and that was capability negotiation.  True, TWAIN came with a -selection of programmatic capabilities, so that it was possible to negotiate -some kinds of values, but the selection was small.  Instead drivers came -with internally generated dialogs.  The application invoked these dialogs -and left all the problems of negotiation to the driver.  The benefit was -that an application could realize the full functionality of a device while -writing very little code.  The problem was that scanner vendors all had -very different ideas about what these dialogs should look like, so a user -moving from using one scanner to another was very likely to end up working with -a very different user interface.

- -

 

- -

 

- -

3.   Programmatic Based Applications (the newer way)

- -

Beginning with version 1.7 of the TWAIN specification and -continuing through 1.8 and 1.9 an attempt has been made to allow for more -sophisticated support of scanner capabilities.  In fact the TWAIN -specification doubled in size going from 1.7 to 1.8.  The original 1.5 -description of TWAIN allowed for the following kinds of things:  standard -and custom capability definitions, capabilities using a variety of container -types (enumerations and ranges among them), self-descriptive data types -(integers, strings, etc), and access modes (read-only, read-write, etc).  -1.8 introduced the ability to independently address the image generating -devices (for instance the front and rear cameras, or the color and bitonal cameras).  It made it possible to write -applications that could drive most or all of the features of a scanner without -resorting to the custom user interface provided by the driver.

- -

 

- -

The problem was that most driver writers created their -drivers for specific applications and since these applications didnt -significantly exercise the programmatic interface, the drivers often did not -perform well when accessed in this way.  Improvements in the testing -documentation and the basic specification, and the stated desire from -applications writers has resulted in better programmatic drivers, but that -still leaves another problem.

- -

 

- -

Programmatic interfaces must reflect the abilities of their -drivers.  They must constrain possible values as dictated by the device, -and they must prevent illegal combinations of functionality.  What this -means is that an application may not be limited to just asking what the allowed -values are in a range or an enumeration.  If the application is currently -negotiating on a color camera, then ICAP_THRESHOLDING may not be available -until the camera context is changed to bitonal.  -If the ICAP_XFERMECH is set to allow native mode transfers (bitmaps on Windows -systems) then ICAP_COMPRESSION may only report a possible value of -none.  So the application has to conduct inquiries on permutations of -settings within the driver.

- -

 

- -

The benefit to all this hard work is that the application -can present a single unified interface to the user, regardless of the physical -device currently in use, which means that end users do not need to be retrained -(save maybe for basic functional differences) anytime they operate a new -scanner with the application.  Over the past several years more and more -application writers have been opting to rely on programmatic control, or in -some cases a combination of programmatic control for the most commonly used -features with the ability to raise the driver GUI for the more rarely used -features.

- -

 

- -

 

- -

4.   Profile Based Applications (the best way)

- -

There is a third alternative that was introduced with little -fanfare in the TWAIN 1.7 specification.  The operation DAT_CUSTOMDSDATA -(if supported) can be used to take a snapshot of the current state of the -driver.  It can also be used to restore the settings of the driver using -one of these snapshots.  1.7 also introduced the concept of a settings -only TWAIN GUI through the DG_CONTROL / DAT_USERINTERFACE / -MSG_ENABLEDSUIONLY.  In this mode the user can set whatever features they -want from the TWAIN supplied GUI, but their only finishing option is to select -OK or CANCEL.

- -

 

- -

The application writer creates two programs.  One -program raises the TWAIN GUI, allows the user to set whatever values they want, -then when OK is hit takes a snapshot of the driver using DAT_CUSTOMDSDATA and -saves the result in a file tagged with some useful name or description from the -user, like photo settings or insurance form settings.  The second -program is the scanning application, but all it presents to the user is a list -of these snapshot or profile descriptions.  So the user selects photo -settings, the application reads that file from disk, sends the data to the -driver using DAT_CUSTOMDSDATA, and begins scanning.  Note that it is still -possible to raise the GUI or to programmatically negotiate values; the intention -is to minimize that need.

- -

 

- -

In this way we get full access to the features of the device -without writing a lot of code, and protect the scanner operator from having to -be retrained anytime a new scanner shows up.  All of the Kodak Document -Scanners (5000/7000/9000/3000/4000/i30/i40/i200/i600/i800/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000) -support this command.  Most application writers should give serious -thought to using this technique to drive their scanner.

- -

 

- -

 

- -

5.   Decoupling

- -

One of the most powerful features in TWAIN is its ability to -totally decouple the negotiation phase (state 4/5) from the image capture phase -(state 6/7).  From the earliest versions of the scanner the application -writer has been encouraged to look at the bitmap information for a native -transfer, the header information for a file transfer, or the DAT_IMAGEINFO -information for a memory transfer.  Starting with version 1.7 and -continuing with 1.8 and 1.9 of the TWAIN specification we have supported the -DAT_EXTIMAGEINFO command, which allows for the collection of a block of -metadata associated with an image.

- -

 

- -

The gist of it is: never assume that what was negotiated is -what is going to be captured by the scanner.  This applies to the -following items (there may be more): ICAP_AUTOMATICBORDERDETECTION (custom -ICAP_CROPPINGMODE), ICAP_AUTOMATICDESKEW, and ICAP_PIXELTYPE and all related -capabilities (when using the color toggle patch).  The application should -be ready for anything to come from the scanner.  That does not mean it has -to accept the data it is receiving, if it cannot handle a color image when -waiting for a bitonal image, then it should throw an -error to the user.  However, the application should not ASSUME that the -data coming from the scanner is exactly what it negotiated.  If an -application obeys this basic rule of decoupling then it will be never be -surprised by the behavior of the scanner in a way that results in a failure or -a crash.

- -

 

- -

 

- -

6.   Logging and the Simulator

- -

Other documents in this kit talk about both of these -items.  The purpose of this section is to show how they can be used to aid -in development.  When first writing an application for a Kodak Document -Scanner it might be helpful to see some of the activity that occurs through -TWAIN while the device is being driven by another application.

- -

 

- -

The Scanner Validation Tool (SVT) is not necessarily the -best application in the world for this kind of work, but at least it is -something.  If you go into the CONST.INI file and turn on debugging so -that it traces the TWAIN activity:

- -

 

- -

            -; Versions 2/3/4

- -

            -Debug=1

- -

            -DebugFilter=kdscaps kdsdat

- -

 

- -

            -; Version 5+

- -

            -Debug=1

- -

            -DebugFilter=TWAIN

- -

 

- -

Then when you run the SVT the driver will generate a log of all -the activity that takes place between it and the application.  This -information is written using TWAIN constants that can be found in the -specification and in the TWAIN.H file.  Use this information to understand -what is being done to setup the driver and capture the images.  Please -note that SVT is a GUI Based Application (in fact it is a diagnostic tool), so -its not very sophisticated in its ability to programmatically negotiate -settings.  It is, however, very sophisticated in its ability to drive the -scanner to its maximum throughput speeds.  It also has a variety of error -handling abilities, so it responds well to jams and multifeeds, -among the other things that can happen.

- -

 

- -

You can use the simulator to get exactly the same results -you would with a real scanner, which is especially useful for testing against -all the varied models supported by the driver.

- -

 

- -

 

- -

7.   Sample Code

- -

The TWAIN Working Group website (www.twain.org) has sample application -code.  We will include any sample code with this kit as it seems -appropriate.

- -

 

- -
- - - - diff --git a/twain-doc/Kodak/TWAIN_DualStream.htm b/twain-doc/Kodak/TWAIN_DualStream.htm deleted file mode 100644 index 1e66ff5..0000000 --- a/twain-doc/Kodak/TWAIN_DualStream.htm +++ /dev/null @@ -1,994 +0,0 @@ - - - - - -Single Document Multiple Images - - - - - - - -
- -

Single Document Multiple -Images

- -

25-Aug-2004

-

Updated: 15-Aug-2006

- -

 

-

 

-

Table of Contents

-
-

Overview

-

- ICAP_PIXELTYPE and - DAT_FILESYSTEM Overview

-

- ICAP_PIXELTYPE

-

DAT_FILESYSTEM

-

- DAT_FILESYSTEM vs. ICAP_PIXELTYPE

-

- CAP_CAMERAENABLE vs. CAP_DUPLEXENABLED

-

CAP_CAMERAORDER

-

- Entire session - (i.e. machine) vs. a single "camera"

-

METADATA

-
- -

 

- -

 

- -

Overview

- -

 

- -

This document talks about the Single Document Multiple -Images (SDMI) behavior in TWAIN, describing how it is negotiated and what -additional metadata associated with the image needs to be collected during -image capture.  Since this is a moderately complex subject a number of -other capabilities that have uses beyond SDMI will be discussed as well.

- -

 

- -

SDMI behavior is easy to view graphically:

- -

 

- -

Original -Color Bitonal

- -

Document -Image Image

- -

+-------+ -+-------+ +-------+

- -

| -| | | | |

- -

| R | | R -| | R |

- -

| | -| | | |

- -

| G | ---> | G -| + | G |

- -

| | -| | | |

- -

| B | | B -| | B |

- -

| -| | | | |

- -
+-------+ +-------+ +-------+
 
- -

In this example a color document results in the capture of -two images, one that is color and one that is bitonal (black & white). Configurations of -this form have a variety of applications, but the most common is when the -application needs a faithful replication of the document for archival purposes -and an image suitable for data collection, such as OCR.

- -

 

- -

SDMI puts no limit on the number of images that can result -from a document.

- -

 

- -

SDMI is not the same as image segmentation.  Image -segmentation divides a document into sub-images that are optimized for quality -and compression.  In this example the driver could save the text images as -Group-4 and the picture as JPEG:

- -

 

- -

Original

- -

Document

- -

+-------+

- -

| a -bit | Segment 1 Segment 2 Segment 3

- -

|of -text| Text Picture Text

- -

| $#$#$ | +-------+ +-------+ +-------+

- -

| #$#$# | ---> | a bit | | #$#$# | | more |

- -

| $#$#$ | |of text| + | #$#$# | + | text |

- -

| -more | +-------+ | #$#$# | +-------+

- -

| text -| +-------+

- -
+-------+ 
 
- -

Image segmentation is typically used to efficiently store -images.  SDMI is used to capture images that are then directed to -different parts of the workflow.  It is possible to mix image segmentation -with SDMI (ex: using image segmentation to produce the faithful replication -image).  The two technologies have different goals, though, so its not -advisable to use one to replace the other.

- -
 
-
 
 
ICAP_PIXELTYPE and DAT_FILESYSTEM Overview
- -

 

- -

TWAIN did not start with duplex scanning built into the -standard; this was added in version 1.7.  So prior to 1.7 -ICAP_PIXELTYPE selected the pixel type (i.e. color -vs. grayscale vs. bitonal) for the entire session. This could also be considered -the "color space". An application could configure a driver to output -color or grayscale or bitonal images, but only one of the three, so you can not -get multiple images for a side via ICAP_PIXELTYPE.

-

 

- -

TWAIN 1.8 introduced DAT_FILESYSTEM.  This -allows an application to setup multiple images for a side. It also -helps support setting of different values for the front and rear. For example, -getting color on the front and grayscale on the rear.

-

 

-

To help maintain backwards compatibility, ICAP_PIXELTYPE needs to -continue to apply to the entire session. This means ICAP_PIXELTYPE should -never be negotiated with DAT_FILESYSTEM.

-

 

-

 

-

 

-
ICAP_PIXELTYPE
 
- -

Setting ICAP_PIXELTYPE will set both the front and rear -images to the given TWPT_ value and automatically set CAP_DUPLEXENABLED to true. -Use ICAP_BITDEPTH to determine how many bits make a single pixel, such as 8 for 8-bit -grayscale or 24 for 3-channel/8-bits-per-channel RGB. 

 
-
 
-
 
-
DAT_FILESYSTEM
 
- -

DAT_FILESYSTEM addresses individual cameras.  The term camera doesnt -mean that the image capture device uses a camera; rather its a generic term -for an image capture source.  DAT_FILESYSTEM calls the front side of the -paper as the 'top' "camera", and the rear as 'bottom'. This doesn't have -anything to do with the physical position of the camera, it is being used to describe what the user -considers the top (i.e. front) of the sheet of paper versus the bottom (i.e. rear).

-

 

-

The driver will output images based on CAP_CAMERAENABLED. So -while a "camera" can be individually set via DAT_FILESYSTEM, you must also set -CAP_CAMERAENABLED to true for each "camera" you want the driver to actually -produce.

-

 

-

The values for DAT_FILESYSTEM are typically:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Camera name
Side
Image
/Camera_Color_Top
frontcolor or grayscale
/Camera_Color_Bottom
rearcolor or grayscale
/Camera_Color_Both
front and rearcolor or grayscale
/Camera_Bitonal_Top
frontbitonal
/Camera_Bitonal_Bottom
rearbitonal
/Camera_Bitonal_Both
front and rearbitonal
- -

 

-

Using a camera that ends in '_Both' means future settings -will be applied to both the front and rear images.

-

 

-

Sample source code

- -
 
-
 
-

 

DAT_FILESYSTEM vs. ICAP_PIXELTYPE
 
- -

If DAT_FILESYSTEM is set, then ICAP_PIXELTYPE must -reflect the current value of the "camera".  For instance, if DAT_FILESYSTEM -is set to /Camera_Color_Both, then ICAP_PIXELTYPE should be set to TWPT_RGB -(this is a basic sanity check for the driver to prevent DAT_FILESYSTEM and ICAP_PIXELTYPE from ever reporting conflicting values).

- -

 

- -

However, if ICAP_PIXELTYPE is set, then the following things -must happen to DAT_FILESYSTEM and CAP_CAMERAENABLE:

- -

 

- -

If ICAP_PIXELTYPE is set to -          -              -TWPT_RGB

- -

DAT_FILESYSTEM changes to -            -         /Camera_Color_Both

- -

CAP_CAMERAENABLE changes to:

- -

/Camera_Color_Top:     -        -              -TRUE

- -

/Camera_Color_Bottom:  -                    -TRUE

- -

/Camera_Bitonal_Top:                         FALSE

- -

/Camera_Bitonal_Bottom:        -            FALSE

- -

 

- -

If ICAP_PIXELTYPE is set to -          -              -TWPT_BW

- -

DAT_FILESYSTEM changes to -            -         /Camera_Bitonal_Both

- -

CAP_CAMERAENABLE changes to:

- -

/Camera_Color_Top:     -          -            FALSE

- -

/Camera_Color_Bottom:  -        -            FALSE

- -

/Camera_Bitonal_Top:   -           -           TRUE

- -

/Camera_Bitonal_Bottom:        -            TRUE

- -

 

- -

The behavior guarantees that older applications and newer -applications can work with the same driver.  Application writers need to -decide if they want to use ICAP_PIXELTYPE or DAT_FILESYSTEM -when negotiating with a particular driver, never use both together.  As a -guideline, if DAT_FILESYSTEM are supported by a driver, use them, -since they offer more functionality than ICAP_PIXELTYPE.

- -

 

-

 

-

 

- -
CAP_CAMERAENABLE vs. CAP_DUPLEXENABLED
 
- -

Care needs to be taken when mixing CAP_CAMERAENABLE and -CAP_DUPLEXENABLED. The recommendation is to use one or the other. Here is an -example of the interdependency:

-
-

Table-1 shows an example of creating one color and one - bitonal image from the front of every sheet of paper fed during the scanning - session. In this case, CAP_DUPLEXENABLED would have been set to False.

-
 
-
Table-1
- - - - - - - - - - - - - - - - - - - - - -
-
DAT_FILESYSTEM
-
CAP_CAMERAENABLE
-
/Camera_Color_Top
-
TRUE
-
/Camera_Color_Bottom
-
FALSE
-
/Camera_Bitonal_Top
-
TRUE
-
/Camera_Bitonal_Bottom
-
FALSE
-

 

-

If the application then sets CAP_DUPLEXENABLED to True, we -would expect the table to change to the following:

-
 
-
Table-2
- - - - - - - - - - - - - - - - - - - - - -
-
DAT_FILESYSTEM
-
CAP_CAMERAENABLE
-
/Camera_Color_Top
-
TRUE
-
/Camera_Color_Bottom
-
TRUE
-
/Camera_Bitonal_Top
-
TRUE
-
/Camera_Bitonal_Bottom
-
TRUE
-
- -
 
-

NOTE: Rear only scanning is considered to be a special duplex -operation.  So for the following table CAP_DUPLEXENABLED would be True:

- -
-
Table-3
- - - - - - - - - - - - - - - - - - - - - -
-
DAT_FILESYSTEM
-
CAP_CAMERAENABLE
-
/Camera_Color_Top
-
FALSE
-
/Camera_Color_Bottom
-
TRUE
-
/Camera_Bitonal_Top
-
FALSE
-
/Camera_Bitonal_Bottom
-
TRUE
-
-
 
-
 
-
CAP_CAMERAORDER
 
- -

The output order of the images can be adjusted using -CAP_CAMERAORDER (using the CAP_CAMERA TWCM_*_BOTH values).  This is a TW_ARRAY -container that has the name of each of the cameras in the order they will be -transferred from the driver to the application.  For example, if -CAP_CAMERAORDER is set to TWCM_BW_BOTH TWCM_CL_BOTH, then the bitonal image -will be transferred before the color image.  For a duplex session this -would look like the following:

- -

 

- -

        Bitonal Front

- -

        Color Front

- -

        Bitonal Rear

- -

        Color Rear

- -

 

- -

To simplify the validation rules between CAP_CAMERAENABLED and -CAP_CAMERAORDER do the following:

- -

 

- -

1)    -If CAP_CAMERAORDER includes a "camera" that is set to False, then the -driver will ignore it.

- -

2)    -If CAP_CAMERAORDER does not include a "camera" that is set to True, -then the driver is free to output the images in whatever ordering it wants.

- -

 

-

 

- -
 
-
Entire session (i.e. machine) vs. a single "camera"
 
- -

The addition of independent front and rear capability -negotiation immediately raises the question: which capabilities belong to the -machine (like CAP_DUPLEX) and which ones belong to a "camera" (like CAP_COMPRESSION).  There is no easy answer to this, since the hardware of -the device dictates the capabilities.  For instance scanner ABC may allow -independent selection of ICAP_COMPRESSION for front and rear cameras because -the designers put in dedicated compression chips for each side.  Whereas -scanner XYZ, in an effort to save costs, only used one chip for this operation, -and they have no way to independently set the front from the rear for this one -capability.

- -

 

- -

So, to help figure out where each capability goes, Kodak -scanners have enhancement DG_CONTROL / DAT_CAPABILITY / -MSG_QUERYSUPPORT with additional TWQC_ flags:

- -

 

- -

-#define TWQC_MACHINE  -      0x1000    // applies to -entire session/machine

-

-#define TWQC_BITONAL     -   0x2000    // applies to Bitonal "cameras"

-

-#define TWQC_COLOR       -   0x4000    // applies to Color "cameras"

-
-

A -capability cannot mix TWQC_MACHINE with any of the other items listed above; otherwise all -combinations are valid (e.g. a capability could have TWQC_BITONAL and TWQC_COLOR).

-

 

-

Capabilities -that describe themselves as TWQC_MACHINE are accessible at all times, -regardless of the current setting of DAT_FILESYSTEM.  This -means that a capability like CAP_DUPLEXENABLED can always be negotiated, (i.e., -even if the current camera is set to something like /Camera_Bitonal_Rear).

-
-
 
 
METADATA
 
- -

Metadata is the descriptive data that accompanies an -image.  TWAIN has two primary ways of communicating this information to an -application: DAT_IMAGEINFO and DAT_EXTIMAGEINFO.  Since DAT_EXTIMAGEINFO -is extensible its the only way to introduce new metadata items to the TWAIN -specification without creating a new DAT operation (and we dont really need -any more of those right now).

- -

 

- -

SDMI presents a bit of a problem for the application because -the stream of images makes it difficult to tell which ones go with which -document.  This problem becomes compounded with things like -automatic color detection (imagine not knowing if the -application will get color or bitonal data on the next image).

- -

 

- -

Since the problem takes the form of a lack-of-communication -problem, the solution is more data.  With the Kodak drivers the following -additional items are added to the list of DAT_EXTIMAGEINFO fields:

- -

 

- -

#define -TWEI_HDR_PAGESIDE          0x8001

- -

#define -TWEI_HDR_IMAGENUMBER       0x8017

- -

#define -TWEI_HDR_PAGENUMBER        0x8018

- -

#define TWEI_HDR_PAGEIMAGENUMBER   -0x8019

- -

 

- -

TWEI_HDR_PAGESIDE returns 0 for a front image and 1 for a -rear image.

- -

 

- -

TWEI_HDR_IMAGENUMBER counts from 1 to 2^32-1 the number of -images captured since the application first MSG_OPENDSd the driver.

- -

 

- -

TWEI_HDR_PAGENUMBER counts from 1 to 2^32-1 the number of -pages of paper captures since the application first MSG_OPENDSd the driver.

- -

 

- -

TWEI_HDR_PAGEIMAGENUMBER counts from 1 to the number of -images captured from the document.  For instance, given an SDMI session -where the driver is transferring a color and a bitonal image for the front and -a bitonal image for the rear we get the following sequence:

- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Image

-
-

Page Side

-
-

Image Number

-
-

Page Number

-
-

PageImageNumber

-
-

Color

-
-

Front

-
-

1

-
-

1

-
-

1

-
-

Bitonal

-
-

Front

-
-

2

-
-

1

-
-

2

-
-

Color

-
-

Rear

-
-

3

-
-

1

-
-

3

-
-

Color

-
-

Front

-
-

4

-
-

2

-
-

1

-
-

Bitonal

-
-

Front

-
-

5

-
-

2

-
-

2

-
-

Color

-
-

Rear

-
-

6

-
-

2

-
-

3

-
- -

 

- -
    -
  • - note, if TWAIN standardizes on these names it will most - likely lose the _HDR in the names.
  • -
- -

 

- -
- - - - diff --git a/twain-doc/Kodak/TWAIN_ExtImageInfo.htm b/twain-doc/Kodak/TWAIN_ExtImageInfo.htm deleted file mode 100644 index 48f2fe7..0000000 --- a/twain-doc/Kodak/TWAIN_ExtImageInfo.htm +++ /dev/null @@ -1,5053 +0,0 @@ - - - - - - - - -Kodak KDS TWAIN Driver - Extended Image Info - - - - - - - - - - -
- -

Kodak KDS TWAIN Driver

- -

Extended Image Info (DAT_EXTIMAGEINFO)

- -

17-January-2013

- -

 

- -

 

- -

Contents

- -

1.     Overview...................................................................................................................... -2

- -

2.     CAP_EXTIMAGEINFO.............................................................................................. -3

- -

3.     MSG_GETSPECIAL................................................................................................... -4

- -

4.     Supported -Information................................................................................................... -5

- -

5.     Sample Code................................................................................................................ -7

- -

 

- -

 

- -

 

- -

1.   Overview

- -

One of TWAINs strengths is its ability to decouple the -negotiation phase (state 4/5) from the image capture phase (state 6/7).  -For this to work the application need image meta-data to describe each image so -that it doesnt have to rely on the negotiated values to understand what it is -getting.  Take for example the image width and height, if -ICAP_AUTOMATICBORDERDETECTION is TRUE then these values will vary from image to -image.  Now in this case DAT_IMAGEINFO is sufficient to collect the needed -information, but the TW_IMAGEINFO structure is fixed, and only contains a -fraction of the possible meta-data values that can be associated with an image.

- -

 

- -

Extended Image Info (DAT_EXTIMAGEINFO) was introduced in 1.7 -of the TWAIN specification as a way to collect a tagged list of meta-data for -every captured image.  The Kodak Document Scanners significantly extend -this list with custom data.  The purpose of this document is to detail -what information is present and how to get it.

- -

 

- -

The term All of the Kodak Document Scanners refers to the -following models or families:

- -

 

- -

            -3000/4000

- -

            -5000/7000/9000

- -

            -i30/i40

- -

            -i200

- -

            -i600

- -

            -i700

- -

            -i800

- -

            -i900

- -

            -i1100

- -

            -i1200

- -

            -i1300

- -

            -i1400

- -

            -i1800

- -

            -i2000

- -

            -i2900

- -

            -i3000

- -

            -i4000

- -

            -i5000

- -

            -PS50/PS80

- -

 

- -

2.   CAP_EXTIMAGEINFO

- -

All of the Kodak Document Scanners support DAT_EXTIMAGEINFO, -however a well designed TWAIN application should confirm this by testing that -the capability CAP_EXTIMAGEINFO is TRUE.

- -

 

- -

 

- -

3.   MSG_GETSPECIAL

- -

The TWAIN specification (currently at 2.1) indicates that -DG_IMAGE / DAT_EXTIMAGEINFO / MSG_GET is only supported in state 7, after the -image has been fully transferred (that is after the receipt of TWRC_XFERDONE).  -All of the Kodak Document Scanners are able to report everything there is to -know about an image in state 6, prior to transferring the image (this applies -to DAT_IMAGEINFO, as well).

- -

 

- -

In order to support this behavior without violating the -TWAIN specification we have added a new custom message MSG_GETSPECIAL.  -DG_IMAGE / DAT_EXTIMAGEINFO / MSG_GETSPECIAL can be used in state 6 or 7, and -will report identical information for an image in either state.

- -

 

- -

 

- -

4.   Supported Information

- -

The following Extended Image -Information values are supported by the TWAIN driver.  Those fields -followed by a TWAIN name (such as ICAP_COMPRESSION) indicate that the values -for that field come from that capability (ex: TWCP_GROUP4).

- -

 

- -

Not all fields are supported for -all scanners.  The following codes can be used to figure out which scanner -family/models support a given item.

- -

 

- -

            -g - 5000/7000/9000 -series support

- -

      v - 3000/4000 series -support

- -

p - i800 series support

- -

a - i200 series support

- -

m - i30/i40/i55/i65 series support

- -

f - i1100 series support

- -

o - i600/i700/i1800 series support

- -

h - i1200/i1300/i1400 series -support

- -

d - -i2000/i2900/i3000/i4000/i5000/PS50/PS80 series support

- -

r - i900 series support

- -

 

- -

* - Reference Gemini Integrators Guide for further -information

- -

 

- -

If a field is unsupported, -TWRC_INFONOTSUPPORTED (8) will be returned as the condition code.

- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

TWAIN - Standard

-
-

Type

-
-

Description

-
-

Supported - Models

-
-

TWEI_BOOKNAME

-
-

TWTY_STR255

-
-

- Image - Address fixed field

-
-

g,p,i1800

-
-

TWEI_CAMERA

-
-

TWTY_STR255

-
-

- - DAT_FILESYSTEM camera

-
-

all

-
-

TWEI_CHAPTERNUMBER

-
-

TWTY_UINT32

-
-

- Image - Address level 3

-
-

p,i1800

-
-

TWEI_DESKEWSTATUS

-
-

TWTY_UINT32

-
-

- - Disabled (3), Pass(0), Fail(2)

-
-

all

-
-

TWEI_DOCUMENTNUMBER

-
-

TWTY_UINT32

-
-

- Document - count

-
-

all

-
-

TWEI_FILESYSTEMSOURCE

-
-

TW_STR255

-
-

- The - camera that captured the image data

-
-

d,r

-
-

TWEI_FRAME

-
-

TWTY_FRAME

-
-

- - Similar to ICAP_FRAME

-
-

all

-
-

TWEI_FRAMENUMBER

-
-

TWTY_UINT32

-
-

- - Always 1 (only 1 cropping region per image)

-
-

all

-
-

TWEI_IMAGEMERGED

-
-

TW_BOOL

-
-

- - Indicates that the current image is merged between the front and rear images

-
-

d,r

-
-

TWEI_PAGENUMBER

-
-

TWTY_UINT32

-
-

- Page - count

-
-

all

-
-

TWEI_PAGESIDE

-
-

TWTY_UINT16

-
-

- Page - side TWCS_TOP/TWCS_BOTTOM

-
-

d,r

-
-

TWEI_PIXELFLAVOR

-
-

TWTY_UINT16

-
-

- - Similar to ICAP_PIXELFLAVOR

-
-

all

-
-

TWEI_SKEWORIGINALANGLE

-
-

TWTY_UINT32

-
-

- The - amount of skew in the original image

-
-

all

-
-

 

-
-

 

-
-

 

-
-

 

-
-

Custom - Data

-
-

 

-
-

 

-
-

 

-
-

TWEI_HDR_AUTOCOLORAMOUNT

-
-

TWTY_UINT32

-
-

- Auto color - amount

-
-

all - (except g,v,p,a,m,f)

-
-

TWEI_HDR_AUTOCOLORDETECTED

-
-

TWTY_UINT32

-
-

- Auto - color detected

-
-

all - (except g,v,p,a,m,f)

-
-

TWEI_HDR_AUTOCOLORTHRESHOLD

-
-

TWTY_UINT32

-
-

- Auto - color threshold

-
-

all - (except g,v,p,a,m,f)

-
-

TWEI_HDR_BARCODE

-
-

TWTY_STR255

-
-

- KDIS - formatted barcodes*

-
-

g

-
-

TWEI_HDR_BINARIZATIONQUALITY

-
-

TWTY_UINT32

-
-

- - Conveys the quality level of the binarized image

-
-

d,r

-
-

TWEI_HDR_BITONALCONTRAST

-
-

TWTY_UINT32

-
-

- - Bitonal contrast (0-FFFh)

-
-

o

-
-

TWEI_HDR_BITONALCONTRASTPERCENTAGE

-
-

TWTY_UINT32

-
-

- - Bitonal contrast percentage (0-100d)

-
-

o

-
-

TWEI_HDR_BITONALTHRESHOLD

-
-

TWTY_UINT32

-
-

- - Bitonal threshold (0-255d)

-
-

o

-
-

TWEI_HDR_BITORDER

-
-

TWTY_UINT32

-
-

- - Similar to ICAP_BITORDER (MSB->LSB)

-
-

all

-
-

TWEI_HDR_BOOKNAME_A

-
-

TWTY_STR255

-
-

- Fixed - field A (unsupported unless field A is fixed)

-
-

g,p,i1800

-
-

TWEI_HDR_BOOKNAME_B

-
-

TWTY_STR255

-
-

- Fixed - field B (unsupported unless field B is fixed)

-
-

p,i1800

-
-

TWEI_HDR_BOOKNAME_C

-
-

TWTY_STR255

-
-

- Fixed - field C (unsupported unless field C is fixed)

-
-

p,i1800

-
-

TWEI_HDR_BOOKNAME_D

-
-

TWTY_STR255

-
-

- Fixed - field D (unsupported unless field D is fixed)

-
-

p,i1800

-
-

TWEI_HDR_COMPRESSION

-
-

TWTY_UINT32

-
-

- - Similar to ICAP_COMPRESSION

-
-

all

-
-

TWEI_HDR_DATE

-
-

TWTY_UINT32

-
-

- Date - (YYMMDD)

-
-

all

-
-

TWEI_HDR_DESKEW

-
-

TWTY_UINT32

-
-

- Image - Manager deskew flag: Yes(1), No(0), Disabled(-1).  If -1 check - TWEI_DESKEWSTATUS.

-
-

all

-
-

TWEI_HDR_DESKEWANGLE

-
-

TWTY_UINT32

-
-

- Angle - in 1/10000 degrees - Example: 4.7 degress is represented as 47000

-
-

h,d,r

-
-

TWEI_HDR_DESKEWANGLEACTUAL

-
-

TWTY_INT32

-
-

- Angle - (-450 to 450 degrees, -450,450 = Fail, signed 10ths of a degree)

-
-

o

-
-

TWEI_HDR_DESKEWCONFIDENCEFACTOR

-
-

TWTY_UINT32

-
-

- - Deskew confidence (1-99d, 1%=Fail, 99%=Success)

-
-

o

-
-

TWEI_HDR_DIFFERENCEHISTOGRAM

-
-

TWTY_UINT8

-
-

- - Difference histogram (256 bytes)

-
-

o

-
-

TWEI_HDR_DITHER

-
-

TWTY_STR255

-
-

- - Similar to ICAP_HALFTONES

-
-

g,v,p,a,m,f,o,h

-
-

TWEI_HDR_DOCUMENTCOUNT

-
-

TWTY_UINT32

-
-

- Doc - counter (CAP_PRINTERINDEX for gp, for va only if printer installed))

-
-

all

-
-

TWEI_HDR_DROPOUTSTATUS

-
-

TWTY_INT32

-
-

- ECDO - Algorithm Status (0 = Success, >0 Algorithm Specific Error)

-
-

h,d 

-
-

TWEI_HDR_DUALSTACKINGSTACK

-
-

TWTY_UINT32

-
-

- When - dual stacking is enabled, contains output tray a document was dropped into (1,2)

-
-

d-i5000 - only

-
-

TWEI_HDR_FEATUREPATCH

-
-

TWTY_UINT32

-
-

- - Feature patch value (1,4,6)

-
-

p,a,o,i1400,i3000,i4000,i5000

-
-

TWEI_HDR_FOLDEDCORNERPERCENTAGE

-
-

TWTY_UINT32

-
-

- Folded - corner percentage (0-100d) 0->Not folded, 100->Folded along the - diagonal

-
-

o

-
-

TWEI_HDR_GAMMATABLE

-
-

TWTY_UINT8

-
-

- Gamma - table (256 bytes)

-
-

o

-
-

TWEI_HDR_IMAGEADDRESSDEFS

-
-

TWTY_STR255

-
-

- IA definitions - (ex: FFF.333.222.111) (where each field is and how they are formatted)

-
-

p,i1800

-
-

TWEI_HDR_IMAGEADDRESSSTRING

-
-

TWTY_STR255

-
-

- - Formatted image address string

-
-

p,i1800

-
-

TWEI_HDR_IMAGENUMBER

-
-

TWTY_UINT32

-
-

- Count - of images in this session (since starting the application)

-
-

all

-
-

TWEI_HDR_IMAGESTATUS

-
-

TWTY_UINT32

-
-

- Image - status

-
-

none

-
-

TWEI_HDR_LATCHEDFLAG

-
-

TWTY_UINT32

-
-

- Latch - switch flag*

-
-

g

-
-

TWEI_HDR_LENGTH

-
-

TWTY_UINT32

-
-

- Size of - image data from scanner (bytes)

-
-

all

-
-

TWEI_HDR_LEVEL

-
-

TWTY_UINT32

-
-

- Image - Address Level  (0,1,2,3)

-
-

g,p,i1800

-
-

TWEI_HDR_LINELENGTH

-
-

TWTY_UINT32

-
-

- Image - width (pixels)

-
-

all

-
-

TWEI_HDR_LONGPAPERLASTSEGMENT

-
-

TWTY_UINT32

-
-

- Image - last segment

-
-

a

-
-

TWEI_HDR_LONGPAPERSEGMENTNUMBER

-
-

TWTY_UINT32

-
-

- Image - segment number

-
-

a

-
-

TWEI_HDR_MODE

-
-

TWTY_UINT32

-
-

- Mode* -

-
-

g

-
-

TWEI_HDR_MULTIFEED

-
-

TWTY_UINT32

-
-

- - Multifeed detected: Yes(1), No(0))

-
-

all - (except g,v,p)

-
-

TWEI_HDR_MOMENTARYFLAG

-
-

TWTY_UINT32

-
-

- - Momentary flag*

-
-

g

-
-

TWEI_HDR_PAGEIMAGENUMBER

-
-

TWTY_UINT32

-
-

- Image - count on sheet (1 4)

-
-

all

-
-

TWEI_HDR_PAGELENGTH

-
-

TWTY_UINT32

-
-

- Image - height (pixels)

-
-

all

-
-

TWEI_HDR_PAGENUMBER

-
-

TWTY_UINT32

-
-

- Count - of sheets in this session

-
-

all

-
-

TWEI_HDR_PAGESIDE

-
-

TWTY_UINT32

-
-

- Page - side: Front(0), Rear(1)

-
-

all

-
-

TWEI_HDR_PATCHDETECTED

-
-

TWTY_UINT32

-
-

- Patch - code detected on this sheet

-
-

p,a,o,i1400,i3000,i4000,i5000

-
-

TWEI_HDR_PCARD_HEADER

-
-

TWTY_STR255

-
-

- - Personality-Card Header

-
-

none

-
-

TWEI_HDR_PCARD_FOOTER

-
-

TWTY_STR255

-
-

- - Personality-Card Footer

-
-

none

-
-

TWEI_HDR_POLARITY

-
-

TWTY_UINT32

-
-

- SCSI - RIF value: 0 is White(0), 1 is White(1)

-
-

gvpam

-
-

TWEI_HDR_PRINTERINDEX

-
-

TWTY_UINT32

-
-

- String - Doc counter (CAP_PRINTERINDEX)

-
-

all

-
-

TWEI_HDR_PRINTERSTRING

-
-

TWTY_STR255

-
-

- - String printed on document

-
-

v,p,a,d,i1400

-
-

TWEI_HDR_PROCESSINGSTATUS

-
-

TWTY_UINT32

-
-

- - Processing Status (0 = Disabled, 1 = Success, 2 = Skipped, 4 = Fail)

-
-

none

-
-

TWEI_HDR_RAWIMAGEHEADER

-
-

TWTY_STR255

-
-

- Raw - image header from scanner

-
-

p,o

-
-

TWEI_HDR_REGENERATION

-
-

TWTY_UINT32

-
-

- Retry - count

-
-

none

-
-

TWEI_HDR_RESOLUTION

-
-

TWTY_UINT32

-
-

- - ICAP_RESOLUTION

-
-

all

-
-

TWEI_HDR_ROLL

-
-

TWTY_UINT32

-
-

- Roll - number*

-
-

g-990 - only

-
-

TWEI_HDR_SKEW

-
-

TWTY_UINT32

-
-

- Skew flag detect: Yes(1), No(0)*

-
-

g-5000/7000 only

-
-

TWEI_HDR_SUMHISTOGRAM

-
-

TWTY_UINT8

-
-

- Sum - histogram (256 bytes)

-
-

none

-
-

TWEI_HDR_TIME

-
-

TWTY_UINT32

-
-

- Time - (HHMMSS)

-
-

all

-
-

TWEI_HDR_TOKEN_COUNT

-
-

TWTY_UINT32

-
-

- Token - flag

-
-

none

-
-

TWEI_HDR_XOFFSET

-
-

TWTY_UINT32

-
-

- - X-offset of image (pixels)

-
-

all

-
-

TWEI_HDR_XML

-
-

TWTY_HANDLE

-
-

- - Everything in XML format (<reportimage> data)

-
-

d,r

-
-

TWEI_HDR_YOFFSET

-
-

TWTY_UINT32

-
-

- - Y-offset of image (pixels)

-
-

all

-
- -

 

- -

 

- -

5.   Sample Code

- -

This section shows all the fields being collected in a -single DAT_EXTIMAGEINFO call.  Hopefully this is enough information to get -the information needed by your application.  We strongly recommend against -getting fields you dont need, especially ones that require memory allocations, -as this can impact the performance of the system (especially on the faster -scanners).

- -

 

- -

 

- -

// This function creates a huge string that -has ExtImageData in

- -

// it along with some text headers.  The -main purpose of the

- -

// function is to show how to collect -different kinds of data.

- -

// Real applications should whittle this -function down to exactly

- -

// what they need.

- -

#define cvtf(x) (((float)(x.Whole))+(((float)x.Frac)/65536.0))

- -

#define FI(x) FindIndex(eii,x)

- -

int FindIndex

- -

(

- -

       -TW_EXTIMAGEINFO      *eii,

- -

       -int                  -InfoID

- -

)

- -

{

- -

       -for (int ii=0; -eii->Info[ii].InfoID; ii++)

- -

       -{

- -

              -if -(eii->Info[ii].InfoID == InfoID) return(ii);

- -

       -}

- -

       -return(0);

- -

}

- -

 

- -

void ShowExtImageInfo

- -

(

- -

void

- -

)

- -

{

- -

       int -                 -ii;

- -

       int -                 -sts;

- -

       int -                 -len;

- -

       int -                 -tmpint;

- -

       char -                -*str;

- -

       TW_EXTIMAGEINFO -     *eii;

- -

       TW_FRAME -            *f;

- -

char hdr_titles[8192];

- -

char hdr_data[8192];

- -

 

- -

       // Allocate the string...

- -

       str = -(char*)GlobalAlloc(GPTR,65536);

- -

if (!str)

- -

{

- -

       -// GlobalAlloc failed...

- -

return;

- -

}

- -

 

- -

       // Allocate the table...

- -

       eii = (TW_EXTIMAGEINFO*)GlobalAlloc

- -

(

- -

GPTR,

- -

sizeof(TW_EXTIMAGEINFO)+(sizeof(TW_INFO)*64)

- -

);

- -

if (!eii)

- -

{

- -

       -// GlobalAlloc failed...

- -

return;

- -

}

- -

 

- -

       // Build the table...

- -

       ii = 0;

- -

       -eii->Info[ii++].InfoID  = TWEI_BOOKNAME;

- -

       eii->Info[ii++].InfoID  -= TWEI_CAMERA;

- -

       -eii->Info[ii++].InfoID  -= TWEI_CHAPTERNUMBER;

- -

       -eii->Info[ii++].InfoID  = TWEI_DESKEWSTATUS;

- -

       -eii->Info[ii++].InfoID  = TWEI_DOCUMENTNUMBER;

- -

       -eii->Info[ii++].InfoID  = TWEI_FRAME;

- -

       eii->Info[ii++].InfoID  -= TWEI_FRAMENUMBER;

- -

       -eii->Info[ii++].InfoID  = TWEI_PAGENUMBER;

- -

       -eii->Info[ii++].InfoID  = TWEI_PIXELFLAVOR;

- -

       -eii->Info[ii++].InfoID  = TWEI_SKEWORIGINALANGLE;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_BARCODE;

- -

       eii->Info[ii++].InfoID  -= TWEI_HDR_BITORDER;

- -

       eii->Info[ii++].InfoID  -= TWEI_HDR_COMPRESSION;

- -

       -eii->Info[ii++].InfoID  -= TWEI_HDR_DATE;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_DESKEW;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_DESKEWANGLE;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_DESKEWANGLEACTUAL;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_DOCUMENTCOUNT;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_DUALSTACKINGSTACK;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_FEATUREPATCH;

- -

       eii->Info[ii++].InfoID  -= TWEI_HDR_IMAGEADDRESSSTRING;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_IMAGEADDRESSDEFS;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_IMAGENUMBER;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_LATCHEDFLAG;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_LENGTH;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_LEVEL;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_LINELENGTH;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_LONGPAPERLASTSEGMENT;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_LONGPAPERSEGMENTNUMBER;

- -

       eii->Info[ii++].InfoID  -= TWEI_HDR_MODE;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_MOMENTARYFLAG;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_PAGEIMAGENUMBER;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_PAGELENGTH;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_PAGENUMBER;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_PAGESIDE;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_POLARITY;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_PRINTERSTRING;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_RESOLUTION;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_ROLL;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_SKEW;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_TIME;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_XOFFSET;

- -

       -eii->Info[ii++].InfoID  = TWEI_HDR_YOFFSET;

- -

eii->Info[ii++].InfoID = TWEI_HDR_XML;

- -

       eii->NumInfos = -ii;

- -

 

- -

       // Issue the command to the driver...

- -

       sts = (*pDSM_Entry)

- -

(

- -

&AppId,

- -

&SourceId,

- -

DG_IMAGE,

- -

DAT_EXTIMAGEINFO,

- -

MSG_GETSPECIAL,

- -

(TW_MEMREF)eii

- -

);

- -

if (sts != TWRC_SUCCESS)

- -

{

- -

       -// DAT_EXTIMAGEINFO failed

- -

       -return;

- -

}

- -

 

- -

// Grab the barcode -length (if there is one)

- -

if (eii->Info[FI(TWEI_HDR_BARCODE)].CondCode -== TWRC_SUCCESS)

- -

{

- -

       -len = strlen((char*)eii->Info[FI(TWEI_HDR_BARCODE)].Item);

- -

}

- -

else

- -

{

- -

       -len = 0;

- -

}

- -

 

- -

       // Format the headers...

- -

       str[0] = 0;

- -

       -sprintf(&str[strlen(str)],"Standard Extensions\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_CAMERA:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_FRAME:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_PIXELFLAVOR:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_DESKEWSTATUS:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_SKEWORIGINALANGLE:\n");

- -

       -sprintf(&str[strlen(str)],"\nImage Address\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_BOOKNAME:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_CHAPTERNUMBER:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_DOCUMENTNUMBER:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_PAGENUMBER:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_FRAMENUMBER:\n");

- -

       -sprintf(&str[strlen(str)],"\nCustom Extensions\n");

- -

       if (len < 40) {

- -

              -sprintf(&str[strlen(str)],"TWEI_HDR_BARCODE:\n");

- -

       } else if (len < 80) -{

- -

              -sprintf(&str[strlen(str)],"TWEI_HDR_BARCODE:\n\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"TWEI_HDR_BARCODE:\n\n\n");

- -

       }

- -

       sprintf(&str[strlen(str)],"TWEI_HDR_BITORDER:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_COMPRESSION:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_DATE:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_DESKEW:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_DESKEWANGLE:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_DESKEWANGLEACTUAL:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_DOCUMENTCOUNT:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_DUALSTACKINGSTACK:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_FEATUREPATCH:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_IMAGEADDRESDEFS:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_IMAGEADDRESSTRING:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_IMAGENUMBER:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_LATCHEDFLAG:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_LENGTH:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_LEVEL:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_LINELENGTH:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_LONGPAPERLASTSEGMENT:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_LONGPAPERSEGMENTNUMBER:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_MODE:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_MOMENTARYFLAG:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_PAGEIMAGENUMBER:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_PAGELENGTH:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_PAGENUMBER:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_PAGESIDE:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_POLARITY:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_PRINTERSTRING:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_RESOLUTION:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_ROLL:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_SKEW:\n");

- -

       sprintf(&str[strlen(str)],"TWEI_HDR_TIME:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_XOFFSET:\n");

- -

       -sprintf(&str[strlen(str)],"TWEI_HDR_YOFFSET:\n");

- -

       -strcpy(hdr_titles,str);

- -

 

- -

       // Blank lines...

- -

       str[0] = 0;

- -

       -sprintf(&str[strlen(str)],"\n");

- -

 

- -

       // -Camera...

- -

       -if (eii->Info[ii=FI(TWEI_CAMERA)].CondCode -!= TWRC_SUCCESS)

- -

{

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       }

- -

else

- -

{

- -

              -sprintf(&str[strlen(str)],"<%s>\n",eii->Info[ii].Item);

- -

              -GlobalFree((void*)eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Frame...

- -

       if (eii->Info[ii=FI(TWEI_FRAME)].CondCode != -TWRC_SUCCESS)

- -

{

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       }

- -

else

- -

{

- -

              -f = (TW_FRAME*)eii->Info[ii].Item;

- -

              -sprintf

- -

(

- -

&str[strlen(str)],

- -

"L%.2f  R%.2f  -T%.2f  B%.2f\n",

- -

cvtf(f->Left),

- -

cvtf(f->Top),

- -

cvtf(f->Right),

- -

cvtf(f->Bottom)

- -

);

- -

              -GlobalFree((void*)eii->Info[ii].Item);

- -

       }

- -

 

- -

       // PixelFlavor...

- -

       if (eii->Info[ii=FI(TWEI_PIXELFLAVOR)].CondCode != -TWRC_SUCCESS)

- -

{

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       }

- -

else

- -

{

- -

              -switch (eii->Info[ii].Item)

- -

{

- -

                     -default:

- -

                           -sprintf(&str[strlen(str)],"*** ERROR ***\n");

- -

                           -break;

- -

                     -case TWPF_CHOCOLATE:

- -

                           -sprintf(&str[strlen(str)],"TWPF_CHOCOLATE\n");

- -

                           -break;

- -

                     -case TWPF_VANILLA:

- -

                           -sprintf(&str[strlen(str)],"TWPF_VANILLA\n");

- -

                           -break;

- -

              -}

- -

       }

- -

 

- -

       // DeskewStatus...

- -

       if (eii->Info[ii=FI(TWEI_DESKEWSTATUS)].CondCode -!= TWRC_SUCCESS)

- -

{

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       }

- -

else

- -

{

- -

              -switch (eii->Info[ii].Item)

- -

{

- -

                     -default:

- -

                           -sprintf(&str[strlen(str)],"*** ERROR ***\n");

- -

                           -break;

- -

                     -case TWDSK_SUCCESS:

- -

                           -sprintf(&str[strlen(str)],"TWDSK_SUCCESS\n");

- -

                           -break;

- -

                     -case TWDSK_REPORTONLY:

- -

                           -sprintf(&str[strlen(str)],"TWDSK_REPORTONLY\n");

- -

                           -break;

- -

                     -case TWDSK_FAIL:

- -

                           -sprintf(&str[strlen(str)],"TWDSK_FAIL\n");

- -

                           -break;

- -

                     -case TWDSK_DISABLED:

- -

                           -sprintf(&str[strlen(str)],"TWDSK_DISABLED\n");

- -

                           -break;

- -

              -}

- -

       }

- -

 

- -

       // SkewOriginalAngle...

- -

       if -(eii->Info[ii=FI(TWEI_SKEWORIGINALANGLE)].CondCode != TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Blank lines...

- -

       -sprintf(&str[strlen(str)],"\n\n");

- -

 

- -

       // BookName...

- -

       if (eii->Info[ii=FI(TWEI_BOOKNAME)].CondCode != -TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"<%s>\n",eii->Info[ii].Item);

- -

              -GlobalFree((void*)eii->Info[ii].Item);

- -

       }

- -

 

- -

       // ChapterNumber...

- -

       if (eii->Info[ii=FI(TWEI_CHAPTERNUMBER)].CondCode -!= TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // DocumentNumber...

- -

       if (eii->Info[ii=FI(TWEI_DOCUMENTNUMBER)].CondCode -!= TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // PageNumber...

- -

       if (eii->Info[ii=FI(TWEI_PAGENUMBER)].CondCode != -TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // FrameNumber...

- -

       if (eii->Info[ii=FI(TWEI_FRAMENUMBER)].CondCode != -TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Blank lines...

- -

       -sprintf(&str[strlen(str)],"\n\n");

- -

 

- -

       // Barcode...

- -

       if (eii->Info[ii=FI(TWEI_HDR_BARCODE)].CondCode != -TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -if (len <= 0) {

- -

                     -sprintf(&str[strlen(str)],"<>\n");

- -

              -} else if (len -< 40) {

- -

                     -sprintf(&str[strlen(str)],"<%s>\n",eii->Info[ii].Item);

- -

                     -str[strlen(str)-3] = '$';

- -

              -} else if (len -< 80) {

- -

                     -char xxx[512];

- -

                     -strcpy(xxx,(char*)eii->Info[ii].Item);

- -

                     -xxx[40] = 0;

- -

                     -sprintf(&str[strlen(str)],"<%s\n",xxx);

- -

                     -strcpy(xxx,&((char*)eii->Info[ii].Item)[40]);

- -

                     -sprintf(&str[strlen(str)],"%s>\n",xxx);

- -

                     -str[strlen(str)-3] = '$';

- -

              -} else {

- -

                     -char xxx[512];

- -

                     -strcpy(xxx,(char*)eii->Info[ii].Item);

- -

                     -xxx[40] = 0;

- -

                     -sprintf(&str[strlen(str)],"<%s\n",xxx);

- -

                     -strcpy(xxx,&((char*)eii->Info[ii].Item)[40]);

- -

                     -xxx[40] = 0;

- -

                     -sprintf(&str[strlen(str)],"%s\n",xxx);

- -

                     -strcpy(xxx,&((char*)eii->Info[ii].Item)[80]);

- -

                     -sprintf(&str[strlen(str)],"%s>\n",xxx);

- -

                     -str[strlen(str)-3] = '$';

- -

              -}

- -

              -GlobalFree((void*)eii->Info[ii].Item);

- -

       }

- -

 

- -

       // BitOrder...

- -

       if (eii->Info[ii=FI(TWEI_HDR_BITORDER)].CondCode -!= TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Compression...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_COMPRESSION)].CondCode != TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Date...

- -

       if (eii->Info[ii=FI(TWEI_HDR_DATE)].CondCode != -TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -tmpint = eii->Info[ii].Item;

- -

              -sprintf

- -

(

- -

&str[strlen(str)],

- -

"%02d/%02d/%02d\n",

- -

tmpint/10000,

- -

(tmpint/100)-((tmpint/10000)*100),

- -

tmpint-((tmpint/100)*100)

- -

);

- -

       }

- -

 

- -

       // Deskew...

- -

       if (eii->Info[ii=FI(TWEI_HDR_DESKEW)].CondCode != -TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // DeskewAngle...

- -

       if (eii->Info[ii=FI(TWEI_HDR_DESKEWANGLE)].CondCode -!= TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

// DeskewAngleActual...

- -

if (eii->Info[ii=FI(TWEI_HDR_DESKEWANGLEACTUAL)].CondCode -!= TWRC_SUCCESS) {

- -

       -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

} else -{

- -

       -sprintf(&str[strlen(str)],"%d.%d\n",((TW_INT32)eii->Info[ii].Item)/10,abs(((TW_INT32)eii->Info[ii].Item)) -% 10);

- -

}

- -

 

- -

       // DocumentCount...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_DOCUMENTCOUNT)].CondCode != TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       } 

- -

 

- -

       // Dropout Status...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_DROPOUTSTATUS)].CondCode != TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Dualstackingstack...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_DUALSTACKINGSTACK)].CondCode != TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // FeaturePatch...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_FEATUREPATCH)].CondCode != TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

  

- -

       // ImageAddressDefs...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_IMAGEADDRESSDEFS)].CondCode != TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"<%s>\n",eii->Info[ii].Item);

- -

              -GlobalFree((void*)eii->Info[ii].Item);

- -

       }

- -

 

- -

       // ImageAddressString...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_IMAGEADDRESSSTRING)].CondCode != TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"<%s>\n",eii->Info[ii].Item);

- -

              -GlobalFree((void*)eii->Info[ii].Item);

- -

       }

- -

 

- -

       // ImageNumber...

- -

       if (eii->Info[ii=FI(TWEI_HDR_IMAGENUMBER)].CondCode -!= TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // LatchedFlag...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_LATCHEDFLAG)].CondCode != TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Length...

- -

       if (eii->Info[ii=FI(TWEI_HDR_LENGTH)].CondCode != -TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Level...

- -

       if (eii->Info[ii=FI(TWEI_HDR_LEVEL)].CondCode != -TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // LineLength...

- -

       if (eii->Info[ii=FI(TWEI_HDR_LINELENGTH)].CondCode -!= TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

      

- -

       -// LongPaperLastSegment...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_LONGPAPERLASTSEGMENT)].CondCode != TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       -// LongPaperSegmentNumber...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_LONGPAPERSEGMENTNUMBER].CondCode != TWRC_SUCCESS){

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       -// Mode...

- -

       -if (eii->Info[ii=FI(TWEI_HDR_MODE)].CondCode -!= TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // MomentaryFlag...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_MOMENTARYFLAG)].CondCode != TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // PageImageNumber...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_PAGEIMAGENUMBER)].CondCode != TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // PageLength...

- -

       if (eii->Info[ii=FI(TWEI_HDR_PAGELENGTH)].CondCode -!= TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // PageNumber...

- -

       if (eii->Info[ii=FI(TWEI_HDR_PAGENUMBER)].CondCode -!= TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // PageSide...

- -

       if (eii->Info[ii=FI(TWEI_HDR_PAGESIDE)].CondCode -!= TWRC_SUCCESS) {

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       } else {

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Polarity...

- -

       if (eii->Info[ii=FI(TWEI_HDR_POLARITY)].CondCode -!= TWRC_SUCCESS)

- -

{

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       }

- -

else

- -

{

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // PrinterString...

- -

       if -(eii->Info[ii=FI(TWEI_HDR_PRINTERSTRING)].CondCode != TWRC_SUCCESS)

- -

{

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       }

- -

else

- -

{

- -

              -sprintf(&str[strlen(str)],"<%s>\n",eii->Info[ii].Item);

- -

              -GlobalFree((void*)eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Resolution...

- -

       if (eii->Info[ii=FI(TWEI_HDR_RESOLUTION)].CondCode -!= TWRC_SUCCESS)

- -

{

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       }

- -

else

- -

{

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Roll...

- -

       if (eii->Info[ii=FI(TWEI_HDR_ROLL)].CondCode != TWRC_SUCCESS)

- -

{

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       }

- -

else

- -

{

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Skew...

- -

       if (eii->Info[ii=FI(TWEI_HDR_SKEW)].CondCode != TWRC_SUCCESS)

- -

{

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       }

- -

else

- -

{

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Time...

- -

       if (eii->Info[ii=FI(TWEI_HDR_TIME)].CondCode != TWRC_SUCCESS)

- -

{

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       }

- -

else

- -

{

- -

              -tmpint = eii->Info[ii].Item;

- -

              -sprintf

- -

(

- -

&str[strlen(str)],

- -

"%02d:%02d:%02d\n",

- -

tmpint/10000,

- -

(tmpint/100)-((tmpint/10000)*100),

- -

tmpint-((tmpint/100)*100)

- -

);

- -

       }

- -

 

- -

       // Xoffset...

- -

       if (eii->Info[ii=FI(TWEI_HDR_XOFFSET)].CondCode != -TWRC_SUCCESS)

- -

{

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       }

- -

else

- -

{

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

       // Yoffset...

- -

       if (eii->Info[ii=FI(TWEI_HDR_YOFFSET)].CondCode != -TWRC_SUCCESS)

- -

{

- -

              -sprintf(&str[strlen(str)],"*** unsupported ***\n");

- -

       }

- -

else

- -

{

- -

              -sprintf(&str[strlen(str)],"%d\n",eii->Info[ii].Item);

- -

       }

- -

 

- -

// XML...

- -

if -(eii->Info[ii=FI(TWEI_HDR_XML)].CondCode != TWRC_SUCCESS)

- -

{

- -

sprintf -(&str[strlen(str)],"*** unsupported ***\n");

- -

}

- -

else

- -

{

- -

sprintf -(&str[strlen(str)],"<%s>\n",eii->Info[ii].Item);

- -

GlobalFree((void*)eii->Info[ii].Item);

- -

}

- -

 

- -

strcpy(hdr_data,str);

- -

 

- -

       // At this point hdr_titles is an array of the TWEI* names, -and hdr_data is the array of the data for the TWEI*s

- -

       -// Final cleanup

- -

GlobalFree(eii);

- -

}

- -

 

- -

 

- -
- - - - diff --git a/twain-doc/Kodak/TWAIN_Features.htm b/twain-doc/Kodak/TWAIN_Features.htm deleted file mode 100644 index d5beeb2..0000000 --- a/twain-doc/Kodak/TWAIN_Features.htm +++ /dev/null @@ -1,2707 +0,0 @@ - - - - - - - - -Correct TWAIN Usage - - - - - - - - - -
- -

Background Smoothing:

- -

 

- -

The purpose of Background Smoothing is to remove overall -mottle or discolorations in the background of the scanned image typically -resulting from scanning and/or paper non-uniformity. Background Smoothing improves -overall appearance of the image and also results in higher file compression -ratios. These results are achieved by smoothing up to three background colors -(one neutral and two additional colors). Optionally one or more background -colors may be smoothed to white.

- -

 

- -

Background smoothing is only available for Color/Grayscale -output.

- -

 

- -

The type of background smoothing that is applied to the -image is selected using ICAP_BACKGROUNDADJUSTMODE. Selecting TWBS_AUTOMATIC or -TWBS_AUTOMATICBASIC will smooth up to three background colors. Selecting -TWBS_CHANGETOWHITE will allow one or more background colors to be smoothed to -white.

- -

 

- -

When the TWBS_CHANGETOWHITE adjustment mode is selected, -ICAP_ BACKGROUNDADJUSTAPPLYTO becomes available. ICAP_ BACKGROUNDADJUSTAPPLYTO -is used to select which background colors to smooth -to white.

- -

TWBA_ PREDOMINATE will smooth the predominate background -color to white.

- -

TWBA_NEUTRAL will smooth just the -neutral color to white and also smooth the two additional background colors.

- -

TWBA_ALL will smooth up to three background colors to white.

- -

 

- -

The aggressiveness of the background smoothing is selected -using ICAP_BACKGROUNDADJUSTAGGRESSIVENESS. The more higher the value, the more -likely a pixel will be determined to be background.

- -

This is available when ICAP_BACKGROUNDADJUSTMODE is not set -to TWBS_NONE or TWBS_AUTOMATICBASIC.

- -

 

- -

 

- -

Blank Image Deletion:

- -

 

- -

This -feature allows the user to instruct the driver to remove images that are -considered blank. The driver can determine if an image is blank based on the -content in the image or the final image size after any compression. The driver -determines if it is blank on a per image basis. For example, if a Color and -Black and White images are being created on the Front, it is possible that Front -Color image will not be considered blank, but the Black and White image will be -considered blank.

- -

 

- -

Blank -image deletion, for a camera, can be turned on by setting CAP_BLANKPAGEMODE to -TWBM_CONTENT (content based) or TWBM_COMPSIZE (final image size). It can be -turned off by setting CAP_BLANKPAGEMODE to TWBM_NONE. However, blank page -detection based on content is not available for all scanners.

- -

 

- -

When -TWBM_CONTENT is selected, CAP_BLANKPAGECONTENT becomes available.  -CAP_BLANKPAGECONTENT is used to set the content percentage.  If the image -content is less or equal to the percent specified, the image will be deleted.

- -

 

- -

When -TWBM_COMPSIZE is selected, CAP_BLANKPAGECOMPSIZEBW (Black and White image), -CAP_BLANKPAGECOMPSIZEGRAY (Grayscale image) and CAP_BLANKPAGECOMPSIZERGB (Color -image) are use to set the image size. If the final image size is less that the -corresponding value, the image is deleted. For backward compatibility, the -value CAP_BLANKPAGEMODE will be changed when any CAP_BLANKPAGECOMPSIZExxx -is changed. If any value becomes non-zero, CAP_BLANKPAGEMODE will be set to -TWBM_COMPSIZE. If all three values become zero, CAP_BLANKPAGEMODE well be set -to TWBM_NONE.

- -

 

- -

 

- -

Color Adjustments:

- -

 

- -

There are -adjustments for Color/Grayscale outputs. These adjustments allow users to -modify the overall Brightness, Contrast and Hue (red, green and blue) of their -scanned documents; they are applied after the image has been color corrected. -The user may also turn off color correction, including gamma correction (i.e. -raw scanner image); the other adjustments are still applied.

- -

 

- -

All the -possible adjustments are: Brightness, Contrast, Red, Green, Blue, and Raw. -However, not all scanners support these.

- -

 

- -

Brightness -and Contrast is controlled using ICAP_COLORBRIGHTNESSMODE.

- -

            -TWCBR_NONE means no adjustment is made.

- -

            -TWCBR_MANUAL means the user can adjust Brightness and Contrast (see -ICAP_BRIGHTNESS and ICAP_CONTRAST).

- -

            -TWCBR_AUTOMATICBASIC means the scanner will automatically adjust the image.

- -

 

- -

Brightness -is controlled using ICAP_BRIGHTNESS. Increasing this will make documents appear -to be lighter. This is ignored if ICAP_COLORBRIGHTNESSMODE is not set to -TWCBR_MANUAL.

- -

 

- -

Contrast -is controlled using ICAP_CONTRAST. Increasing this, for Color/Grayscale, will -increase the images tonal range. This is ignored if ICAP_COLORBRIGHTNESSMODE -is not set to TWCBR_MANUAL.

- -

 

- -

Color -Balance is controlled using ICAP_COLORBALANCEMODE.

- -

            -TWCBM_NONE means no adjustment is made.

- -

            -TWCBM_MANUAL means the user can adjust Red, Green and Blue (see -ICAP_COLORBALANCEREAD/GREEN/BLUE)

- -

            -TWCBM_AUTOMATICBASIC means the scanner will automatically adjust the balance to -be white.

- -

            -TWCBM_AUTOMATIC is the same as TWCBM_AUTOMATICBASIC but the user can also -adjust the aggressiveness of the balance (see -ICAP_COLORBALANCEAUTOMATICAGRESSIVENESS)

- -

            -

- -

The -aggressiveness of the auto white is set using ICAP_COLORBALANCEAUTOMATICAGGRESSIVENESS. -The higher the value, the more likely a pixel will be determined to be white.

- -

 

- -

Red, -Green, and Blue are controlled using ICAP_COLORBALANCERED, -ICAP_COLORBALANCEGREEN, and ICAP_COLORBALANCEBLUE; respectively. Increasing -Blue, for example, will make the image appear bluer. This is ignored if -ICAP_COLORBALANCEMODE is not set to TWCBM_MANUAL

- -

 

- -

Raw -(i.e. no color/gamma correction) is controlled using ICAP_GAMMAENABLED.

- -

 

- -

 

- -

Color -Sharpening:

- -

 

- -

Apply ICAP_COLORSHARPEN to color and grayscale -images:  0 indicates no sharpening. 1 is normal, 2 is more sharpening, and -a value of 3 applies a lot of sharpening.

- -

 

- -

 

- -

Document Type

- -

 

- -

If supported by the scanner, Document type indicates the -type of content that is on the document. This is available for all outputs; -however, for some scanners the selection needs to be the same for the Front and -Back.

- -

 

- -

This is controlled using ICAP_DOCUMENTTYPE.

- -

 

- -

 

- -

How to select the type:

- -

------------------------------------------------------

- -

If your documents contain a mix of text and business -graphics (e.g. charts, graphs, etc), then select: TWDT_TEXTWITHGRAPHICS.

- -

 

- -

If your documents contain only text, then select: -TWDT_TEXT.

- -

 

- -

If your documents contain mainly photographs, or you want -the color correction optimized for photographs, then select: TWDT_PHOTO.

- -

 

- -

If, supported by the scanner and, your documents contain a -mix of text and photographs, then select: TWDT_TEXTWITHPHOTO. If not supported, -then TWDT_PHOTO or TWDT_TEXTWITHGRAPHICS is suggested.

- -

 

- -

 

- -

NOTE: refer to the Color Table section of this guide for -information on backward compatibility with color tables

- -

 

- -

 

- -

Media Type

- -

 

- -

If supported by the scanner, Media type indicates the type -of paper being scanned. This is available for all outputs; however, for some scanners -the selection needs to be the same for the Front and Back.

- -

 

- -

This is controlled using ICAP_MEDIATYPE.

- -

 

- -

 

- -

How to select the type:

- -

------------------------------------------------------

- -

If your documents are normal everyday paper (e.g. copier -paper, inkjet paper, etc), then select: TWMT_PLAINPAPER.

- -

 

- -

If your documents are lightweight or thin (e.g. rice paper, -tissue paper, etc), then select: TWMT_THINPAPER.

- -

 

- -

If your documents are glossy (e.g. photographic paper), -then select: TWMT_GLOSSYPAPER.

- -

 

- -

If your documents are magazine articles, then select: -TWMT_MAGAZINE. If not supported, then TWMT_GLOSSYPAPER or TWMT_PLAINPAPER is -suggested.

- -

 

- -

If your documents appear to be normal everyday paper but -are thick (e.g. card stock), then select: TWMT_CARDSTOCK.

- -

 

- -

NOTE: unless otherwise specified, if the desired type is -not supported by the scanner, then select TWMT_PLAINPAPER.

- -

 

- -

 

- -

NOTE: refer to the Color Table section of this guide for -information on backward compatibility with color tables

- -

 

- -

 

- -

Color Tables

- -

 

- -

For scanners than now support Document Type -(ICAP_DOCUMENTTYPE) and Media Type (ICAP_MEDIATYPE), Color Tables is only -supported for backwards compatibility. That means selecting ICAP_COLORTABLE -will still work, however it is highly recommend that code be setup to handle -Document and Media Type.

- -

 

- -

For reference, the mapping between Color Tables and -Document/Media Types is as follows:

- -

--------------------------------------------------------------------------------------------

- -

Mixed and Text with Pictures: TWDT_TEXTWITHGRAPHICS / -TWMT_PLAINPAPER.

- -

 

- -

Photo and Pictures: TWDT_PHOTO / TWMT_GLOSSY.

- -

 

- -

Text: TWDT_TEXT / TWMT_PLAINPAPER

- -

 

- -

 

- -

Electronic -Color Drop-Out (ECDO):

- -

 

- -

There are adjustments for Bitonal/Grayscale -outputs. These adjustments allow users to select the ECDO color of their -scanned documents.

- -

 

- -

The applications should only try to set the TWCD_FILE -values.  The DAT_ECDO operation for a way to map the display strings to -the various ICAP_ECDO values.

- -

 

- -

ICAP_ECDOTREATASCOLOR -allows you to indicate that a color other than black or dark blue ink was used -for the data entered on the form. This not available on all scanner models or -when ECDO is set to (none).

- -

 

- -

NOTE: refer to the ICAP_FILTERENUM -section of this guide for information on backward compatibility with ECDO

- -

 

- -

 

- -

Orthogonal Rotation:
-
-This will rotate an image in 90 degree increments. The rotation occurs after -the image has been cropped and/or deskewed.
-
-This is set using ICAP_ROTATION to indicate the number of degrees.
-
-Some scanners support Automatic orthogonal rotation. When set, the driver will -automatically determine the degrees of rotation based on the content of the -image. This is turned on by setting ICAP_AUTOMATICROTATE to true.
-
-ICAP_ORTHOGONALROTATE is a custom capability. Its a combination of -ICAP_AUTOMATICROTATE and ICAP_ROTATION plus the TWOROT_AUTOMATIC_90 (or 180, -270). When ICAP_ORTHOGONALROTATE sets to TWOROT_AUTOMATIC_90 the driver uses -auto-orient algorithm automatically determine orthogonal rotation. However, if -the orientation cannot be determined, the image will be rotated 90 degrees.
-
-For your reference, the following table shows the mapping between -ICAP_ORTHOGONALROTATE and ICAP_AUTOMATICROTATE and ICAP_ROTATION.

- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ICAP_ORTHOGONALROTATE

-
-

ICAP_AUTOMATICROTATE

-
-

ICAP_ROTATION

-
-

TWOROT_NONE

-
-

False

-
-

0

-
-

TWOROT_90

-
-

False

-
-

90

-
-

TWOROT_180

-
-

False

-
-

180

-
-

TWOROT_270

-
-

False

-
-

270

-
-

TWOROT_AUTOMATIC

-
-

True

-
-

0

-
-

TWOROT_AUTOMATIC_90

-
-

True

-
-

0

-
-

TWOROT_AUTOMATIC_180

-
-

True

-
-

0

-
-

TWOROT_AUTOMATIC_270

-
-

True

-
-

0

-
- -

 
-
-Automatic Rotation:
-
-If Automatic orthogonal rotation is supported (see Orthogonal Rotation) then -the TWAIN feature Automatic Rotate is also supported (ICAP_AUTOMATICROTATE).
-
-If ICAP_AUTOMATICROTATE is set to true, then ICAP_ROTATION is set to 0
-
-ICAP_AUTOMATICROTATE will automatically be updated anytime ICAP_ROTATION is -changed

- -

 

- -

Multifeed UDDS Sensors
-
-The TWAIN driver provides the ability to detect a multifeed -condition by setting the CAP_ULTRASONICSENSITIVITY to TWUS_LOW, TWUS_MEDIUM or -TWUS_HIGH.
-
-When CAP_ULTRASONICSENSITIVITY is not TWUSS_DISABLED, if supported, each sensor -(CAP_ULTRASONICSENSOR*) can be individually turned on (TWUO_ENABLED) or off -(TWUO_DISABLED). For scanners that support the Ignore feature, -TWUO_IGNOREZONE can also be selected.
-NOTE: at least one sensor must remain on.
-
-When TWUO_IGNOREZONE is selected, the height of the area to be ignored is -controlled by CAP_ULTRASONICSENSORZONEHEIGHT. This setting will apply to all -sensors set to TWUO_IGNOREZONE.

- -

 

- -

Multifeed Response:

- -

 

- -

The Multifeed Response is used to -indicate what action to take when a multifeed is -detected by the scanner. This value is only available when multifeed -detection is turned on (i.e. CAP_ULTRASONICSENSITIVITY is not set to -TWUSS_DISABLED, or CAP_PAGESIZELIMIT is not zero).

- -

 

- -

Going forward CAP_MULTIFEEDRESPONSE should be used instead -of the values: CAP_DOUBLEFEEDSTOP and CAP_DOUBLEFEEDENDJOB. These values dont -allow access to all the possible multifeed responses, -but are left in for backwards compatibility. All three values will -automatically be updated, to stay in sync, when any of them are changed.

- -

 

- -

For your reference, the following -table shows the mapping between CAP_MULTIFEEDRESPONSE and CAP_DOUBLEFEEDSTOP and CAP_DOUBLEFEEDENDJOB.

- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

CAP_DOUBLEFEEDSTOP

-
-

CAP_DOUBLEFEEDENDJOB

-
-

CAP_MULTIFEEDRESPONSE

-
-

True

-
-

True

-
-

TWMR_ENDOFJOB

-
-

True

-
-

True

-
-

TWMR_ENDOFJOBLEAVEPAPER

-
-

True

-
-

False

-
-

TWMR_STOPFEEDER

-
-

False

-
-

False

-
-

TWMR_CONTINUE

-
- -

 

- -

 

- -

Image Edge Fill:

- -

 

- -

This feature fills the edges of the final electronic image -by covering the area with the specified color. Use ICAP_IMAGEEDGEFILL to -specify the color to fill with.
-
-If scanner supported TWIE_AUTOMATIC and TWIE_AUTOMATICWITHTEAR the edge of an -image is automatically filled in with the same color space as the image.

- -

 

- -

When TWIE_AUTOMATIC or TWIE_AUTOMATICWITHTEAR is selected -the ICAP_CROPPINGMODE is automatically changed to TWCR_AUTOMATICBORDERDETECTION -and the ICAP_AUTOMATICDESKEW is also changed to TRUE.

- -

 

- -

If the current value of ICAP_IMAGEEDGEFILL is TWIE_AUTOMATIC -or TWIE_AUTOMATICWITHTEAR and ICAP_CROPPINGMODE is changed to not -TWCR_AUTOMATICBORDERDETECTION or ICAP_AUTOMATICDESKEW is changed to FALSE then -ICAP_IMAGEEDGEFILL is automatically changed to TWIE_NONE.
-
-For the TWIE_WHITE and TWIE_BLACK, use ICAP_IMAGEEDGELEFT, ICAP_IMAGEEDGERIGHT, -ICAP_IMAGEEDGETOP and ICAP_IMAGEEDGEBOTTOM to specify the amount of fill for -each edge.
-
-If you want all sides to be forced to have the same amount of fill, then set -ICAP_IMAGEEDGEFILLALLSIDES to True. The driver uses the value for the top edge -(ICAP_IMAGEEDGETOP) as the size of the fill for the other three edges. In -addition, the left (ICAP_ IMAGEEDGELEFT), right (ICAP_ IMAGEEDGERIGHT), and -bottom (ICAP_ IMAGEEDGEBOTTOM) edge will have read-only access since their -values are automatically set to match the top edge.

- -

 

- -

Sides Different:

- -

 

- -

The purpose of Sides Different allows the user to determine -if Front and Rear values need to be the same or not.

- -

 

- -

When CAP_SIDESDIFFERENT is changed to False (i.e. -transitioned from True to False), the driver will make the sides the same by -copying all the Front camera settings to the Rear camera. While CAP_SIDESDIFFERENT -is False, any value that is set on the current camera (e.g. Front) will -automatically be set on the opposite camera (e.g. Rear).

- -

 

- -

When CAP_SIDESDIFFERENT is set to True, the driver would -then allow different values for the Front and Rear camera. Realize that when -CAP_SIDESDIFFERENT has a value of True, the values for Front and Rear may not -actually be different. This would be the case when Sides Different is first set -to True (i.e. transitioned from False to True), and no other values have been -changed.

- -

 

- -

 

- -

Device -Events:

- -

 

- -

Applications can register for device events by issuing a -CAP_DEVICEEVENT for events the driver wants to receive. For a list of supported -events for each scanner model, refer to kdscust.h.

- -

 

- -

Applications are notified of device events via DG_CONTROL -/ DAT_NULL / MSG_DEVICEEVENT.  Upon receiving a MSG_DEVICEEVENT, the -application must immediately issue a DG_CONTROL / MSG_DEVICEEVENT / MSG_GET to -obtain the event information.

- -

 

- -

TWDE_LAMPWARMUP

- -

For version 9.3 drivers and up, the application -can ask the driver to send this custom CAP_DEVICEEVENT if the lamps need to warmup prior to scanning. This event will be issued after a -MSG_ENABLEDS if the lamps are not warmed up. The number of seconds before the -lamps are ready will be in the TimeBeforeFirstCapture -field of the TW_DEVICEVENT structure.

- -

 

- -

NOTE: The number of seconds may be longer than -what it actually take. This could happen because an error occurred (e.g. -opening cover, cancelling) or for models that do not have an accurate warmup value.  Because of this, if your application is -displaying a please wait message for the user, the message needs to be closed -when MSG_XFERREADY is received.

- -

 

- -

 

- -

Blank Image Deletion:

- -

 

- -

This -feature allows the user to instruct the driver to remove images that are -considered blank. The driver can determine if an image is blank based on the -content in the image or the final image size after any compression. The driver -determines if it is blank on a per image basis. For example, if a Color and -Black and White images are being created on the Front, it is possible that -Front Color image will not be considered blank, but the Black and White image -will be considered blank.

- -

 

- -

Blank image -deletion, for a camera, can be turned on by setting CAP_BLANKPAGEMODE to -TWBM_CONTENT (content based) or TWBM_COMPSIZE (final image size). It can be -turned off by setting CAP_BLANKPAGEMODE to TWBM_NONE. However, blank page -detection based on content is not available for all scanners.

- -

 

- -

When -TWBM_CONTENT is selected, CAP_BLANKPAGECONTENT becomes available.  -CAP_BLANKPAGECONTENT is used to set the content percentage.  If the image -content is less or equal to the percent specified, the image will be deleted.

- -

 

- -

When -TWBM_COMPSIZE is selected, CAP_BLANKPAGECOMPSIZEBW (Black and White image), -CAP_BLANKPAGECOMPSIZEGRAY (Grayscale image) and CAP_BLANKPAGECOMPSIZERGB (Color -image) are use to set the image size. If the final image size is less that the -corresponding value, the image is deleted. For backward compatibility, the -value CAP_BLANKPAGEMODE will be changed when any CAP_BLANKPAGECOMPSIZExxx -is changed. If any value becomes non-zero, CAP_BLANKPAGEMODE will be set to -TWBM_COMPSIZE. If all three values become zero, CAP_BLANKPAGEMODE well be set -to TWBM_NONE.

- -

 

- -

 

- -

Getting Logs -Programmatically:

- -

 

- -

This -feature allows the user to retrieve logs. There are text based logs, XML -based logs and EKLOG package files. A log is -retrieved by issuing a DG_CONTROL/DAT_LOG/MSG_GET with a properly filled in -TW_LOG structure. Fill in a TW_LOG structure with the desired log (LogType), the desired device (DeviceType), -and the full path and name of the file (Filename) to store the log data into.

- -

 

- -

For all -scanners, set DeviceType to TWDV_ADF to get the base -scanners information. For those scanners that support the flatbed as an -accessory (e.g. i1200, i1300, i1400), you will need to make a second call, with -DeviceType set to TWDV_FLATBED, to get the flatbeds -information. This is necessary because the flatbed is a separate device.

- -

 

- -

DAT_LOG -will return TWRC_FAILURE/TWCC_OPERATIONERROR if a request is made for a log -that is not supported by the scanner (e.g. not all scanners have an operator -log).

- -

 

- -

DAT_LOG -will return TWRC_FAILURE/TWCC_BADVALUE if the DeviceType -is TWDV_FLATBED and there is no separate flatbed scanner (e.g. i1000A4 & -i1000A3) attached. Since this is the only case when this error code is -returned, applications could make use of this by always issuing the second -DAT_LOG call and let this be the way to know there is no separate flatbed -scanner attached.

- -

 

- -

The -text based logs are ones that can be easily viewed in something like Notepad, -each log entry will be on its own line. These logs contain the same information -as is shown on the driver UI on the Log tab. The language for the translated -text will be based on the current language selected for the driver. The -format of each log entry is not guaranteed, so you should never parse the -entries to get information.

- -

 

- -

The XML -based logs are designed to be flexible across scanners and to allow for future -expansion. The following notes apply to the XML based logs:

- -
    -
  1. Not all fields may be returned for each scanner. For - example, rear lamp-on hours would not be returned for a simplex scanner; - patch counts would not be returned on a scanner that does not support - patch reading; and versions will only be returned for the items that the - scanner actually has. Therefore, it is the responsibility of the - application to handle tags not being there.
  2. -
  3. The order of the tags is not guaranteed. Therefore it - is the responsibility of the application to parse the entire XML.
  4. -
  5. The character format for the entire XML is UTF-8
  6. -
  7. The - spacing shown below is for clarity; it may or may not be as shown. It is - the responsibility of the application to handle variable spacing.
  8. -
- -

 

- -

The -possible logs (LogType) are:

- -
    -
  1. TWGL_GENERAL: this returns the text based log called - General on the driver UI. This log is not common among scanner families.
  2. -
  3. TWGL_OPERATOR: this returns the text based log called - Operator on the driver UI. This log is not common among scanner families.
  4. -
  5. TWGL_GENERAL_XML: this returns a XML based log that - contains information typically found in the General log: model, serial - number, versions, meters, etc.
  6. -
  7. TWGL_EKLOG: returns an EKLOG package file for Service - (the same kind of file that can be generated from the TWAIN User - Interface); when using this type be sure to offer a description of the log - (why its being sent), and set SaveImages to - TRUE if delivering device or application images with the package.  - This is not a viewable log.
  8. -
- -

 

- -

The XML -format of the TWGL_GENERAL_XML log is as follows. Included are examples of what -the tag values could be. The text to the right of the tags is a description of -what the tag is (the numbers in parenthesis refer to the tag notes below. The -descriptions will not appear in the log file:

- -

<tw_log>

- -

    <cdname> -KODAK i1210/i1220 Scanner</cdname>                -Family name from CD

- -

    <modelname>i1220</modelname>                                            -name of scanner model

- -

    -<versioncd>1.25</versioncd>                                                    -CD version

- -

    -<versiontwain>9.64</versiontwain>                                           -TWAIN driver version

- -

    -<versionui>3.23</versionui>                                                      -TWAIN UI version

- -

    -<flatbed>false</flatbed>                                                            -flatbed attached (1)

- -

    -<printer>false</printer>                                                             -printer accessory available (1)

- -

    -<background>black</background>                                           -front cameras background color (2)

- -

    -<backgroundrear>black</backgroundrear>                               -rear cameras background color (2)

- -

    <connection>USBSCAN -2.0</connection>                               -interface scanner is connected to (3)

- -

    -<serialnumber>1234567890</serialnumber>                              -scanners serial number

- -

    -<versionfirmware>1.43</versionfirmware>                                 -scanner firmware version

- -

    -<versionhippo>4.5.1</versionhippo>                                         -image processing version

- -

    -<versiondriver>2.3</versiondriver>                                            -driver.dll version

- -

    -<versiondevice>2.10</versiondevice>                                        -device.dll version

- -

    <versiondevicemanager>1.1</versiondevicemanager>                -devicemanager.dll version

- -

    <meterpower>104</meterpower>                                             -time scanner has been on (4)

- -

    -<metertransport>99</metertransport>                                        -time transport has been on (4)

- -

    -<meterlampfront>104</meterlampfront>                                    -time front lamps have been on (4)

- -

    -<meterlamprear>100</meterlamprear>                                      -time rear lamps have been on (4)

- -

    <meterfirstscan>2008/12/03 -15:58:44.245</meterfirstscan>       -time & date of first scan (5)

- -

    -<meterpagecount>5</meterpagecount>                                      -number of pages scanned

- -

    -<multifeedcount>0</multifeedcount>                                          -# multifeeds seen (6)

- -

    <patchcountfront>0</patchcountfront>                                       -# patches seen on the front (6)

- -

    -<patchcountrear>0</patchcountrear>                                         -# patches seen on the rear (6)

- -

</tw_log>

- -

 

- -

Tag Notes:

- -
    -
  1. The values for this tag are: true and false. If this - tag is not present, then assume the value is false.
  2. -
  3. The values for this tag are: black, white and - switchable. If this tag is not present, then assume the background is - black.
  4. -
  5. Typical values will be: USBSCAN 2.0, USBSCAN 1.1, and - SCSISCAN (for 1394 devices).
  6. -
  7. This tag will contain the number of hours in tenths. - For example, a value of 104 equates to 10.4 hours.
  8. -
  9. This tag will contain a zero-filled date and time with - the format: YYYY/MM/DD[space]HH:MM:SS.mmm
  10. -
  11. This count is based on what occurred during the - previous scan session. This value is reset to zero at the start of every - scan session.
  12. -
- -

 

- -

 

- -

Combine/Merge Front and -Back Images:

- -

 

- -

This feature -allows the user to instruct the driver to combine the front and back images -from a document into a single image. This feature is designed -for use with Duplex scanning from the document feeder, where there is -one image per side and the front and back camera settings are the same. For -example: CAP_DUPLEXENABLED set to True; Sides Different (CAP_SIDESDIFFERENT) is -False; one camera per side has been enabled (i.e. just Color, or just -Grayscale, or just Black and White).

- -

 

- -

This feature -is only available for duplex scanner models. Even if this is turned on, the -images will not be combined if more than one camera per side is enabled or the -flatbed is scanned.

- -

 

- -

When this -feature is on, the application will receive one image that contains both the -front and the back of the page; instead of one image for the front and another -image for the rear. If the final image has the original images one on top of -the other (e.g. front on top of back), then the width of the final image will -be based on the wider of the two original images. If the final image has the -original images one to the left of the other (e.g. front to the left of the -back), then the height of the final image will be based on the taller of the -two original images. Any area that needs to be filled in (i.e. any padding of -the narrower or shorter image) will be based on the color of the cameras -background. For example, if the cameras background is black, then the image -will be padded with black.

- -

 

- -

This feature -can be turned on by setting CAP_IMAGEMERGE to a value other than TWIM_NONE. The -valid choices are: TWIM_FRONTONTOP (front is on top of the back), TWIM_FRONTONBOTTOM -(back is on top of front), TWIM_FRONTONLEFT (front is to the left of the back), -and TWIM_FRONTONRIGHT (back is to the left of the front).

- -

 

- -

 

- -

Feeder Mode

- -

 

- -

This allows -you to select how the scanner transports documents through the scanner. This affects -how the documents are fed into the scanner, how fast they move through the -scanner, and how they are placed in the output tray.

- -

 

- -

The available -enumerations for this capability, ICAP_FEEDERMODE, are different based on -scanner and defined as follows:

- -

            -TWFM_NONE: No additional handling is performed. Best used when all documents -are similar in size.

- -

            -TWFM_STACKINGIMPROVED: Aids in controlling how the documents are -stacked/ordered in the output tray for mixed document sets. This should work -for the majority of mixed sets.

- -

            -TWFM_STACKINGBEST: When your document set contains a great variability in size, -this option provides the best control of how the documents are stacked/ordered -within the output tray.

- -

            -TWFM_SPECIAL: For irregularly shaped documents (e.g., pages with coupons -removed or documents with large holes or cutouts in them).

- -

            -TWFM_FRAGILE: For documents that need extra care as they are transported -through the scanner and placed in the output tray.

- -

            -TWFM_THICK: For thick documents.

- -

  

- -

 

- -

Controlled Dual Stacking -Accessory

- -

 

- -

If you have -the Controlled Dual Stacking Accessory installed, then you can separate -documents into the two stacks of the Dual Stacking Accessory output tray. -Separation of documents will be possible via any combination of document -length, document content (toggle patch), and multifeed detection.

- -

 

- -

The first step -is to turn on the feature by setting the following CAP:

- -

            -CAP_DUALSTACKINGENABLED -- Set to TRUE to enable the Controlled Dual Stacking Accessory

- -

 

- -

Next, -determine which stack of the output tray to place detected documents into by -setting the following CAP.

- -

            -CAP_DUALSTACKINGSTACK -- If CAP_DUALSTACKINGSTACK is set to TWDSS_STACK1, -then documents that match any of the defined detection settings will be -separated from the document set and placed in stack 1. All other documents will -be placed in stack 2.

- -

- If CAP_DUALSTACKINGSTACK -is set to TWDSS_STACK2, then documents -that match any of the defined detection settings will be separated from the -document set and placed in stack 2. All other documents will be placed in stack -1.

- -

 

- -

Next, define -the document detection criteria. Separation of documents will be possible via -any combination of document length, document content (toggle patch), and multifeed detection.

- -

 

- -

If you would -like to select which documents to separate from the document set based on the -document's length, then you would set the following CAPs:

- -

            -CAP_DUALSTACKINGLENGTHMODE - Set to TWDSLM_LESSTHAN, -TWDSLM_GREATERTHAN, or TWDSLM_BETWEEN

- -

            -CAP_DUALSTACKINGLENGTH1 -- If CAP_DUALSTACKINGLENGTHMODE is set to TWDSLM_LESSTHAN, then any -documents shorter than this length will be separated and placed in the -selected CAP_DUALSTACKINGSTACK.

- -

- If CAP_DUALSTACKINGLENGTHMODE is set to -TWDSLM_GREATERTHAN, then any documents longer than this length will be -separated and placed in the selected CAP_DUALSTACKINGSTACK.

- -

- If CAP_DUALSTACKINGLENGTHMODE is set to TWDSLM_BETWEEN, -then any documents whose length falls between -CAP_DUALSTACKINGLENGTH1 and CAP_DUALSTACKINGLENGTH2 will be separated -and placed in the selected CAP_DUALSTACKINGSTACK.

- -

            -CAP_DUALSTACKINGLENGTH2 -- If CAP_DUALSTACKINGLENGTHMODE is "between", then any -documents whose length falls between -CAP_DUALSTACKINGLENGTH1 and CAP_DUALSTACKINGLENGTH2 will be separated -and placed in the selected CAP_DUALSTACKINGSTACK.

- -

 

- -

If you would like -to select which patch sheets, if any, to separate from the document set and -place in the selected stack, then you would set the following CAPs:

- -

            -CAP_DUALSTACKINGPATCHTRANSFER - Set to -TRUE will place Patch Type Transfer sheets in the selected -CAP_DUALSTACKINGSTACK.

- -

            -CAP_DUALSTACKINGPATCHTYPE1 - Set to TRUE will place Patch Type 1 sheets -in the selected CAP_DUALSTACKINGSTACK.

- -

            -CAP_DUALSTACKINGPATCHTYPE2 - -Set to TRUE will place Patch Type 2 sheets in the selected -CAP_DUALSTACKINGSTACK.

- -

            -CAP_DUALSTACKINGPATCHTYPE3 - Set -to TRUE will place Patch Type 3 sheets in the selected CAP_DUALSTACKINGSTACK.

- -

            -CAP_DUALSTACKINGPATCHTYPE4 - -Set to TRUE will place Patch Type 4 sheets in the selected -CAP_DUALSTACKINGSTACK.

- -

            -CAP_DUALSTACKINGPATCHTYPE6 - -Set to TRUE will place Patch Type 6 sheets in the selected -CAP_DUALSTACKINGSTACK.

- -

NOTE: You can -select any combination of the above Patch Types.

- -

 

- -

If you would -like to separate all documents that are determined to have been multifed, then you would set the following CAPs:

- -

            -CAP_DUALSTACKINGMULTIFEED - -Set to TRUE will place documents that are determined to have been multifed in the selected CAP_DUALSTACKINGSTACK

- -

 

- -

 

- -

Background

- -

 

- -

This will -allow the user to select the color of the imaging background. This can be set -differently per side.. The imaging background is what the scanner will see -where there is no paper.

- -

 

- -

Use -CAP_BACKGROUND to set the background color to white (i.e. TWBK_WHITE) or Black -(i.e.TWBK_BLACK),

- -

 

- -

Examples of -when the white background is useful are:

- -

            -Scanning non-rectangular documents and, in the final image, you want the area -outside the document to be White instead of Black.

- -

            -Scanning lightweight or thin paper, with printing on one side, and you do not -want the black background to bleed through the document and appear in the final -image.

- -

 

- -

 

- -

Physical Height Adjust

- -

 

- -

For scanners that support this setting, it is provided as a -way to optimize throughput. It limits the maximum document length that the -scanner can scan. So while the scanner is capable of scanning longer documents, -it will not process any documents that are longer then this setting. Setting -this to larger lengths may reduce the scanners throughput. For example, the -scanner may be able to scan up to an 80 inch long document (i.e. the range -maximum would be 80 inches), but if the default for this setting is 17 inches -then the scanner will stop if something longer than 17 inches is scanned. To -scan something longer than the default, this capability will need to be -modified.

- -

 

- -

The range for this setting is determined by the scanner; -therefore it should be read when connecting to the scanner. An example range is -2.5 to 3 meters.

- -

 

- -

When this -capability, ICAP_PHYSICALHEIGHTADJUST, is modified the maximum paper size (i.e. -ICAP_PHYSICALHEIGHT) will be impacted as well as any settings based on that -(e.g. ICAP_SUPPORTEDSIZES, ICAP_FRAMES, CAP_PRINTERPOSITION, -CAP_PAGESIZELIMIT). Therefore, it is recommended to re-read those values as -appropriate.

- -

 

- -

NOTE: Some -combinations of ICAP_PIXELTYPE and ICAP_XRESOLUTION may not be supported by the -scanner when this capability is set to larger values. Instead of preventing -these values from being set, and to allow for greater flexibility with -applications, the scanner will not generate an error until it scans a document -whose length is not supported.

- -

 

- -

 

- -

OCP Buttons:
-
-This feature allows the application to set the displayed text on the OCP for -each button. The driver may not remember this information. So we recommend that -the application should send the text after successfully MSG_OPENDS. The maximum -number of buttons that are allowed to be configured is 9.

- -


-To configure the number of buttons for the user to scroll through, the App must -send an array of TW_OCPBUTTONS structures which has the number of the buttons -defined plus an extra one that has Text field blank. For example, if the user -wants to setup the text for 3 buttons then define the array of 4 TW_OCPBUTTONS -structures. Set the Text for the first 3 items and set the Text to blank for -the 4th.

- -


-For the scanners that dont have the ability to display the text, the -application still can configure the number of buttons for the user to scroll -through.

- -


-The order of the buttons displayed on the OCP is the same order of the buttons -defined in the array.

- -


-The Text is in the current language. The Ansi code -page which is based on the CAP_LANGUAGE is used for the conversion.

- -

 

- -

NumDataFields indicates how -many fields, after it and before Reserved, are filled in by the application.

- -

 

- -

PaperSource is used to -indicate which Paper Source the button will scan from. Set it to the desired -TWPU_* value. Refer to CAP_PAPERSOURCE for a list of TWPU_* values. For -example, if setting a button to "Color PDF" and the paper source is -"Document Feeder", then set:

- -

Text = "Color PDF"

- -

NumDataFields = 1

- -

PaperSource = TWPU_ADF

- -

NOTE: Not all scanners make use of PaperSource

- -

 

- -

The Reserved -field must be initialized to zero.

- -

 

- -

Hole Fill:

- -

 

- -

The -Hole Fill feature is designed to remove punch holes in the original document -from the resultant image. The output image is the same as the input image with -the identified holes in the document image filled in with background.  -In the Bitonal case the background is white.

- -

 

- -

This feature can be turned on by -setting ICAP_HOLEFILLENABLED to TRUE.

- -

 

- -

 

- -

Streak Filter:

- -

 

- -

The Streak Filter Fill feature is -designed to remove streaks in the original document from the resultant image. -The amount of "aggressiveness" that the Streak Filter algorithm -applies can be adjusted as needed.

- -

 

- -

This feature can be turned on by setting ICAP_STREAKREMOVALENABLED -to TRUE.

- -

 

- -

The amount of aggressiveness can be adjusted by setting -ICAP_STREAKREMOVALAGGRESSIVENESS to a value ranging from -2 to 2 in steps of 1; -the default is 0. This value does not apply if ICAP_STREAKREMOVALENABLED is -FALSE.

- -

 

- -

 

- -

Cropping Mode:

- -

 

- -

This feature allows the user to specify how the scanner will -detect document as it is being fed through the scanner.

- -

 

- -

The available -enumerations for this capability, ICAP_CROPPINGMODE, are different based on -scanner and defined as follows:

- -

            -TWCR_AUTOMATICBORDERDETECTION: The scanner will automatically find each -document (regardless of size).

- -

            -TWCR_TRANSPORT: The scanner will return an image based on the area you specify in -the ICAP_FRAMES or ICAP_FRAMESANGLE. It is suggested that you only use this -option for scan jobs that contain same-sized documents.

- -

            -TWCR_DOCUMENT: The scanner will return an image based on the area you specify -in the ICAP_FRAMES or ICAP_FRAMESANGLE which is relative to entire document.

- -

            -TWCR_AGGRESSIVEAUTOCROP: The scanner will automatically find each document and -will straighten any document that may have been fed crooked.  Its also -eliminating any residual border. Residual border can be caused by variations in -a document edge; for example, when a document is not a perfect rectangle and/or -was fed crooked.

- -

            -TWCR_CONTINUOUS: The scanner will split the document into separate images based -on the area you specify with the ICAP_FRAMES or ICAP_FRAMESANGLE. It is -suggested that you select an area that covers the entire width of the document -and a height around 11 inches (297 mm).

- -

            -TWCR_PHOTO: The scanner will locate the photograph on the document and return -an image that contains just the photograph. If the scanner finds more than one -photograph on a document, one image is still returned which contains all -photographs.

- -

            -TWCR_PHOTOINROI: The scanner will locate the photograph on the area you specify -in the ICAP_FRAMES or ICAP_FRAMESANGLE and return an image that contains just -the photograph. If the scanner finds more than one photograph on a specify -area, one image is still returned which contains all photographs.

- -

 

- -

When -TWIE_AUTOMATIC or TWIE_AUTOMATICWITHTEAR is selected from ICAP_IMAGEEDGEFILL -the ICAP_CROPPINGMODE is automatically changed to TWCR_AUTOMATICBORDERDETECTION -and the ICAP_AUTOMATICDESKEW is also changed to TRUE.

- -

 

- -

When the ICAP_CROPPINGMODE value is changed other -capabilities are also changed. The following table shows the mapping between -ICAP_CROPPINGMODE and ICAP_AUTOMATICDESKEW and ICAP_IMAGEEDGEFILL

- -

 

- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ICAP_CROPPINGMODE

-
-

ICAP_AUTOMATICDESKEW

-
-

ICAP_IMAGEEDGEFILL - (If current value is TWIE_AUTOMATIC or TWIE_AUTOMATICWITHTEAR)

-
-

TWCR_AUTOMATICBORDERDETECTION

-
-

TRUE

-
-

No change

-
-

TWCR_TRANSPORT

-
-

FALSE

-
-

TWIE_NONE

-
-

TWCR_DOCUMENT

-
-

TRUE

-
-

TWIE_NONE

-
-

TWCR_AGGRESSIVEAUTOCROP

-
-

TRUE

-
-

TWIE_NONE

-
-

TWCR_CONTINUOUS

-
-

FALSE

-
-

TWIE_NONE

-
-

TWCR_PHOTO

-
-

TRUE

-
-

TWIE_NONE

-
-

TWCR_PHOTOINROI

-
-

TRUE

-
-

TWIE_NONE

-
- -

 

- -

 

- -

Foreground Boldness:

- -

 

- -

Use this option for documents or forms where you want the -foreground (e.g. text, lines, etc.) to be more prominent.

- -

 

- -

Foreground Boldness is only available for Color/Grayscale -output.

- -

 

- -

The available -enumerations for this capability, ICAP_FOREGROUNDBOLDNESSMODE are defined as -follows:

- -

            -TWFB_NONE: No Foreground Boldness is applied to the image.

- -

TWFB_AUTOMATICBASIC: All -foreground will be bolder.

- -

TWFB_AUTOMATIC: For advanced users -that want to further adjust the aggressiveness of the Foreground Boldness -algorithm.

- -

 

- -

The aggressiveness of the Foreground Boldness algorithm is -selected using ICAP_FOREGROUNDBOLDNESSAGGRESSIVENESS. The higher the value, the -more boldness is applied to the image foreground. This is available only when -ICAP_FOREGROUNDBOLDNESSMODE is set to TWFB_AUTOMATIC.

- -

 

- -
- - - - diff --git a/twain-doc/Kodak/TWAIN_FileSystem.htm b/twain-doc/Kodak/TWAIN_FileSystem.htm deleted file mode 100644 index 1336dc5..0000000 --- a/twain-doc/Kodak/TWAIN_FileSystem.htm +++ /dev/null @@ -1,254 +0,0 @@ - - - - - -Here is some sample code for how to change cameras using the DG_CONTROL -/ DAT_FILESYSTEM operations - - - - - - - -
- -

Here is some sample code -for how to change cameras using the DG_CONTROL / DAT_FILESYSTEM operations.

- -

 

- -

 

- -

TW_FILESYSTEM fs;

- -

TW_STR255 cameraname[3];

- -

 

- -

// For loop used to discover available cameras...

- -

memset(cameraname,0,sizeof(cameraname));

- -

for (rc = (*pDSM_Entry)

- -

(&AppId,&SourceId,

- -

DG_CONTROL,

- -

DAT_FILESYSTEM,

- -

MSG_GETFIRSTFILE,(TW_MEMREF)&fs);

- -

rc == TWRC_SUCCESS;

- -

rc = (*pDSM_Entry)

- -

(&AppId,&SourceId,

- -

DG_CONTROL,

- -

DAT_FILESYSTEM,

- -

MSG_GETNEXTFILE,(TW_MEMREF)&fs)) {

- -

 

- -

// This is the combined front / rear camera...

- -

// In each case, just take the first one we find...

- -

if (fs.FileType == TWFY_CAMERA) {

- -

if (!cameraname[0][0]) -strcpy(cameraname[0],fs.OutputName);

- -

// This is the front camera...

- -

} else if (fs.FileType == TWFY_CAMERA_TOP) {

- -

if (!cameraname[1][0]) -strcpy(cameraname[1],fs.OutputName);

- -

// This is the rear camera...

- -

} else if (fs.FileType == TWFY_CAMERA_BOTTOM) {

- -

if (!cameraname[2][0]) -strcpy(cameraname[2],fs.OutputName);

- -

}

- -

}

- -

 

- -

// Change to the front camera...

- -

strcpy(fs.InputName,cameraname[1]);

- -

rc = (*pDSM_Entry)

- -

(&AppId,&SourceId,

- -

DG_CONTROL,

- -

DAT_FILESYSTEM,

- -

MSG_CHANGEDIRECTORY,(TW_MEMREF)&fs);

- -

// Set some front capabilities, like ICAP_CONTRAST

- -

...

- -

 

- -

// Change to the rear camera...

- -

strcpy(fs.InputName,cameraname[2]);

- -

rc = (*pDSM_Entry)

- -

(&AppId,&SourceId,

- -

DG_CONTROL,

- -

DAT_FILESYSTEM,

- -

MSG_CHANGEDIRECTORY,(TW_MEMREF)&fs);

- -

// Set some rear capabilities, like ICAP_CONTRAST

- -

...

- -

 

- -

// Change back to the combined camera (have to do

- -

// this before scanning starts, but can also do

- -

// this to simultaneously change front and rear

- -

// values). Note that this is the default camera

- -

// when the Source is first started...

- -

strcpy(fs.InputName,cameraname[0]);

- -

rc = (*pDSM_Entry)

- -

(&AppId,&SourceId,

- -

DG_CONTROL,

- -

DAT_FILESYSTEM,

- -

MSG_CHANGEDIRECTORY,(TW_MEMREF)&fs);

- -

...

- -
- - - - diff --git a/twain-doc/Kodak/TWAIN_Internationalization.htm b/twain-doc/Kodak/TWAIN_Internationalization.htm deleted file mode 100644 index b9fa73b..0000000 --- a/twain-doc/Kodak/TWAIN_Internationalization.htm +++ /dev/null @@ -1,1099 +0,0 @@ - - - - - - - - -; Copyright (c) 1998-2004 Eastman Kodak Company, All Rights Reserved - - - - - - - - - - -
- -

Kodak KDS TWAIN Driver

- -

Internationalization

- -

06-Jun-2012

- -

 

- -

 

- -

Overview

- -

TWAIN supports internationalization, making it possible for -an application to negotiate an awareness of the current language and country with -the driver.  This awareness is intended primarily for the drivers GUI, -but it has the potential to influence any textual output.

- -

 

- -

As of this writing fourteen languages are supported: Chinese -Simplified, Chinese Traditional, Czechoslovakian, Dutch, English, French, German, -Italian, Japanese, Korean, Portuguese Brazilian, Russian, Spanish, and Turkish.  -In situations where an unsupported sublanguage seems like the only possible -match for a primary language, the primary language is selected (ex: French is -substituted for French Canadian).  If no match is possible the driver -defaults to English.

- -

 

- -

There are four ways to negotiate the language with the -driver.  This document describes each method.

- -

 

- -

 

- -

 

- -

TW_IDENTITY

- -

This is a part of the TWAIN Specification; please refer to -it for more information.

- -

 

- -

When an application calls the DG_CONTROL / DAT_PARENT / -MSG_OPENDSM message in state 2, it has to send the pointer to a TW_IDENTITY -structure to the TWAIN Data Source Manager.  This structure describes the -application and includes a TW_IDENTITY.Language -field.  If the value of this field is TWLG_USERLOCALE, then the driver -attempts to match the desktop language of the user.  Any other value for -this field will result in the driver attempting to use that language.  For -instance, if the application sets the field to TWLG_FRENCH, then the driver -will load French regardless of the desktop locale.

- -

 

- -

In most cases a value of TWLG_USERLOCALE is preferred for -this field.

- -

 

- -

This technique works for all versions of the driver; it has -the lowest priority (which means it can be overridden by anything else).

- -

 

- -

 

- -

 

- -

CAP_LANGUAGE

- -

This is a part of the TWAIN Specification; please refer to -it for more information.

- -

 

- -

The driver allows the language to be changed in state 4 -(programmatic negotiation).  This may be necessary if the application is -using a TWAIN toolkit.  Some toolkits dont allow the TW_IDENTITY.Language -field to be selected, so the only way to change the language is as a part of -normal negotiation.

- -

 

- -

This technique works for all versions of the driver; it has the -highest priority (which means if you set it then you get it).

- -

 

- -

 

- -

 

- -

DefaultLanguage

- -

This is a custom feature. It is available for 6+ versions of -the driver; it has the third highest priority.

- -

 

- -

In some instances the user may have no control of the application -or the toolkit, so a special CONST.INI setting has been provided to allow the -drivers language to be changed.  Edit the CONST.INI file and add the -following line under the [dsIdentity] section.

- -

 

- -

DefaultLanguage=L_XX_YYY

- -

 

- -

Where L_XX_YYY is one of the following:

- -

 

- -

            -L_CH_CHN    - Chinese Simplified

- -

            -L_CH_TWN   - Chinese Traditional

- -

            -L_CS_CZE     - Czechoslovakian

- -

            -L_DE_DEU     - German

- -

            -L_EN_USA     - English

- -

            -L_ES_ESP       - Spanish

- -

            -L_FR_FRA      - French

- -

            -L_IT_ITA        - Italian

- -

            -L_JA_JPN       - Japanese (for drivers prior -to 11.x)

- -

            -L_JP_JPN        - Japanese (for drivers -11.x+)

- -

            -L_KO_KOR    - Korean

- -

            -L_NL_NLD     - Dutch

- -

            -L_PT_BRA      - Portuguese Brazilian

- -

            -L_RU_RUS     - Russian

- -

            -L_TR_TUR     - Turkish

- -

            -

- -

 

- -

 

- -

KDS_LANGUAGE

- -

This is a custom feature.

- -

 

- -

Older versions of the driver allowed the language to be -selected from an environment variable.  This method is preserved for -backwards compatibility, but this is not the recommended way to negotiate the -language.  The value is numeric and is taken from the TWLG_* entries in -the TWAIN.H header file.

- -

 

- -

            -41        - Chinese Simplified

- -

            -43        - Chinese Traditional

- -

            -45        - Czechoslovakian

- -

            -1          - Dutch

- -

            -2          - English

- -

            -5          - French

- -

            -6          - German

- -

            -8          - Italian

- -

            -68        - Japanese

- -

            -69        - Korean

- -

            -76        - Portuguese Brazilian

- -

            -78        - Russian

- -

            -11        - Spanish

- -

            -85        - Turkish

- -

            -

- -

This technique works for all versions of the driver except -5; it has the second highest priority.

- -

 

- -
- - - - diff --git a/twain-doc/Kodak/TWAIN_ProgrammaticControl.htm b/twain-doc/Kodak/TWAIN_ProgrammaticControl.htm deleted file mode 100644 index 9115f5a..0000000 --- a/twain-doc/Kodak/TWAIN_ProgrammaticControl.htm +++ /dev/null @@ -1,11368 +0,0 @@ - - - - - - - - - -Kodak KDS TWAIN Driver - - - - - - - - - - - - - -
- -

Kodak KDS TWAIN Driver

- -

TWAIN interface

- -

21-January-2013

- -

 

- -

 

- -

Contents

- -

1.     DG_CONTROL.. 2

- -

2.     DG_IMAGE.. 2

- -

3.     DG_CUSTOM.. 2

- -

4.     CAP_Capabilities. 5

- -

5.     ICAP_Capabilities. 14

- -

 

- -

Capabilities and descriptions are color coded for clarity:

- - - - - - - - - - - - - - -
-

GREEN

-
-

Full support

-
-

PURPLE

-
-

Kodak Custom

-
-

RED

-
-

Unsupported

-
- -

 

- -

Values are specified with units (in most cases -inches).  If changing ICAP_UNITS, the allowed values change accordingly.

- -

 

- -
-
- -

1.       -DG_CONTROL

- -

 

- -

DAT_CAPABILITY                                 -Full support.

- -

 

- -

DAT_COLORTABLEMAP                      -Custom: All Models (except for i2000/i2900/i3000/i4000/i5000).

- -

-  -This will allows an application to map the ICAP_COLORTABLE numeric values to -both the English and current language strings.

- -

-  The value of -0xFFFF for ColorTableValue indicates the end of the -array.

- -

-  -Only MSG_GET, MSG_GETCURRENT and MSG_GETDEFAULT are supported.

- -

 

- -

DAT_CUSTOMDSDATA                        -Full support.

- -

-  -Data is Source specific, applications must not parse it.

- -

 

- -

DAT_DEVICEEVENT                              -Full support

- -

 

- -

DAT_DEVICEINFO                      -            -Custom: All Models

- -

-  -This provides additional information about the device that may be useful with -some system message, such as WM_DEVICECHANGE.

- -

-  The dwFields value indicates how many fields are supported by -the driver (the value doesn't include the dwFields, -itself).

- -

-  -Only MSG_GET, MSG_GETCURRENT and MSG_GETDEFAULT are supported.

- -

 

- -

DAT_ECDO                      -                       -Custom: i900/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

-  -This will allows an application to map the ICAP_ECDO numeric values to both the -English and current language strings.

- -

-  The value of -0xFFFF for EcdoValue indicates the end of the array.

- -

-  -Only MSG_GET, MSG_GETCURRENT and MSG_GETDEFAULT are supported.

- -

 

- -

DAT_EVENT                                           -Full support.

- -

 

- -

DAT_FILESYSTEM                                -Supports 'camera' devices.

- -

Default: /Camera_Bitonal_Both

- -

-  -The following devices are supported, depending on the scanner model:

- -

/Camera_Bitonal_Both

- -

/Camera_Bitonal_Top

- -

/Camera_Bitonal_Bottom

- -

/Camera_Color_Both

- -

/Camera_Color_Top

- -

/Camera_Color_Bottom

- -

-  -Image storage is not supported.

- -

 

- -

DAT_IDENTITY                                      -Full support.

- -

  

- -

DAT_LOG -                       -                      Custom: -i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

-  -Used by an application to collect log information from the scanner.

- -

-  Refer to kdscust.h for details about how to use this call.

- -

-  -Only MSG_GET is supported.

- -

 

- -

DAT_NULL                                             -Full support.

- -

-  -MSG_CLOSEDSREQ is sent when the Source's Cancel button is pressed.

- -

-  -MSG_CLOSEDKOK is sent when the Source's OK button is pressed.

- -

-  -MSG_XFERREADY is sent after the first image is scanned.

- -

-  -MSG_DEVICEEVENT is supported.

- -

 

- -

DAT_OCPBUTTONS                              -Custom: i2000/i2900/i3000

- -

-  -This feature allows the application to set the displayed text on the OCP for -each button, as well as to indicate which Paper -Source the button will scan from.

- -

-  -Only MSG_SET is supported.

- -

 

- -

DAT_PARENT                                         -Full support.

- -

-  -This operation only communicates with the Source Manager.

- -

 

- -

DAT_PASSTHRU                                    -Unsupported

- -

 

- -

DAT_PENDINGXFERS                             -Full support.

- -

MSG_STOPFEEDER -is a TWAIN 1.9 operation that may be issued in State 6.  Use it when you -want to stop the transport, but continue transferring any images that are in the -device's buffers.

- -

 

- -

DAT_PROFILES                                       -Custom: i600/i700/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000

- -

-  -This allows an application to manage profiles.

- -

-  -These messages are supported for DAT_PROFILES: MSG_GET, MSG_GETCURRENT, -MSG_GETDEFAULT, MSG_PROFILECREATE, MSG_PROFILEDELETE,

- -

MSG_PROFILESAVE, -MSG_PROFILERENAME, MSG_PROFILERESTORE, MSG_PROFILEEXPORT, MSG_PROFILEIMPORT, -MSG_PROFILESET

- -

 

- -

DAT_SETUPFILEXFER                           -Full support.

- -

-  -Supports TWFF_BMP, TWFF_TIFF.

- -

-  -TWFF_JFIF is not supported on 3500/3510/3520/i810/i830.

- -

-  -TWFF_BMP is not supported for the i600/i700/i800/i1800 Series when ForceAfterburner=1 in the CONST.INI file.

- -

 

- -

DAT_SETUPMEMXFER                          -Full support.

- -

-  -The Source uses the MaxBufSize to pre-allocate a -scratch buffer, which for the 3000/4000 scanners must exceed the size of -the largest image that the application expects to ever scan.  The default -size is sufficient for this, and should not be changed without consulting -Eastman Kodak.

- -

 

- -

DAT_STATUS                                        -Full support.

- -

-  In -some cases the status is returned by the Source Manager.

- -

 

- -

DAT_USERINTERFACE                          -Full support.

- -

-  For -MSG_ENABLEDS the SCAN, STOP and CANCEL buttons are shown.

- -

-  -For MSG_ENABLEDSUIONLY the OK and CANCEL buttons are shown.

- -

ShowUI == FALSE is supported (no UI).

- -

ModalUI == TRUE is supported, but works by issuing an EnableWindow(hParent,FALSE) on the -calling application.

- -

-  -MSG_SETUPDS is a custom command that downloads the current settings to the -scanner, but does not initiate a scanning session.  The Source remains in -state 4.  This command has been added to allow application writers to use -more than one of the Gemini modes.  See also the ForceAcceptMode -variable in const.ini, which can be used to disable mode checking by the -Source.

- -

-  -MSG_ENABLESCANNER is a custom command that starts a scanning session without -downloading any settings.

- -

 

- -

DAT_WINDOW                                        -Custom: i600/i700/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000

- -

-  -This utility allows an application to add and remove windows.

- -

-  A window is an -index to a set of cameras, such as front_bitonal, front_color.

- -

-  -Only MSG_ADDWINDOW and MSG_DELETEWINDOW are supported.

- -

 

- -

DAT_XFERGROUP                                  -Full support.

- -
-
- -

 

- -

2.       -DG_IMAGE

- -

  

- -

DAT_CIECOLOR                                    -Unsupported.

- -

 

- -

DAT_EXTIMAGEINFO                            -Full support.

- -

-  -Please reference TWAIN_ExtImageInfo.htm for a complete -list.

- -

MSG_GETSPECIAL -is a custom feature that allows this command to be issued in state 6, before -the image data is transferred, instead of state 7, after it has been -transferred.

- -

 

- -

DAT_GRAYRESPONSE                          -Unsupported.

- -

 

- -

DAT_IMAGEFILEXFER                           -Full support.

- -

-  Supports scan error -condition codes (ex: TWCC_PAPERJAM).

- -

 

- -

DAT_IMAGEINFO                                   -Full support.

- -

 

- -

DAT_IMAGELAYOUT                            -Full support.

- -

-  -Value is shared with ICAP_FRAMES.

- -

-  -ICAP_SUPPORTEDSIZES will be set to TWSS_NONE if this operation is used with -MSG_SET.

- -

-  -The image width must at a minimum be on a 16-bit boundary.  Color images -must have a length that falls on an 8-bit boundary.  An application can -make these calculations itself when the dimensions are in TWUN_PIXELS -units.  The Source makes any corrections to the settings (on the -application's behalf) just prior to downloading to the device.

- -

-  -Because converting between ICAP_UNITS can result in loss of resolution, -applications are encouraged to use TWUN_PIXELS when getting information, to -guarantee that the dimensions of the image are accurately reported.

- -

 

- -

DAT_IMAGEMEMXFER                          -Full support.

- -

-  -Applications should use the Preferred value from the DAT_SETUPMEMXFER operation -to set the minimum transfer buffer size.  Because of the high performance -of the scanners, memory transfers must move the entire image in one call to -guarantee best throughput.

- -

-  Supports scan error -condition codes (ex: TWCC_PAPERJAM).

- -

 

- -

DAT_IMAGENATIVEXFER                     -Full support.

- -

-  -Applications cannot use native mode transfers for anything other than -uncompressed data.

- -

-  -Native transfers are less efficient than memory transfers, since the Source -must rotate the image around the x-axis to match the BITMAP format, and convert -RGB to BGR in the case of color data.

- -

-  Supports scan error -condition codes (ex: TWCC_PAPERJAM).

- -

 

- -

DAT_JPEGCOMPRESSION                    -Full support.

- -

-  -Supported for all models (except for 5000/7000/9000).

- -

-  -TWPT_YUV is the only pixel type supported.

- -

Chroma and Luma tables may be -replaced.

- -

-  -Huffman tables are reported, but may not be changed.

- -

 

- -

DAT_PALETTE8                                     -Unsupported.

- -

 

- -

DAT_RGBRESPONSE                             -Unsupported.

- -

 

- -

 

- -

 

- -

3.       -DG_CUSTOM

- -

 

- -

DAT_AUTOCOLORLEARN                    -Custom: i600/i700/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000

- -

-  -This utility will determine the proper Color Amount value to use with -the current Color Threshold value, in order to save a representative stack of -color documents as either color or grayscale images.

- -

-  -There is no associated TW_AUTOCOLORLEARN, applications should send NULL for the -data.

- -

-  -Only MSG_SET and MSG_RESET are supported.

- -

-  -This is only available when ICAP_AUTOCOLORCONTENT is set to Custom.

- -

 

- -

DAT_STATUSRAW                                -Custom: All Models

- -

-  -This command may be issued at any time. It reports the raw data for the last -error status report by scanner.

- -

 

- -

4.       -CAP_ Capabilities

- -

 

- -

ACAP_AUDIOFILEFORMAT                  -Unsupported.

- -

 

- -

ACAP_XFERMECH                                 -Unsupported.

- -

 

- -

CAP_ALARMS                                       -Standard: i600/i700/i800/i1800/i5000

- -

                                                                -Allowed: TWAL_PATCHCODE

- -

                                                                -Default: Empty

- -

 

- -

CAP_ALARMVOLUME                          -Standard: i600/i700

- -

                                                                -Allowed: 0 - 3

- -

                                                                -Default: 2

- -

 

- -

CAP_AUTHOR                                        -Standard: All Models (except for i2000/i2900/i3000/i4000/i5000)

- -

                                                                -Allowed: Any TW_STR128 string

- -

                                                                -Default: Eastman Kodak Company

- -

 

- -

CAP_AUTOFEED                                    -Standard: All Models

- -

                                                                -Allowed: TRUE

- -

                                                                -Default: TRUE

- -

-  -This capability is read-only.

- -

 

- -

CAP_AUTOMATICCAPTURE                -Unsupported.

- -

 

- -

CAP_AUTOMATICSENSEMEDIUM       Standard: i2000/i2900/i3000/i5000

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-   Automatically -chooses whether to acquire images from the ADF or from the Flatbed.

- -

 

- -

CAP_AUTOSCAN                                  -Standard: All Models

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: TRUE

- -

3000/4000 -supports TRUE for CAP_XFERCOUNT == -1 and FALSE for CAP_XFERCOUNT > 0.

- -

5000/7000/9000 -only supports TRUE.

- -

-  Other -offer full supports.

- -

 

- -

CAP_BACKGROUND                              -Custom: All Models (except for 3000/4000/5000/7000/9000)

- -

                                                                -Allowed: TWBK_BLACK, TWBK_WHITE

- -

                                                                -Default: scanner dependent

- -

-    Reports -what the scanner background was at the time the scanner was started. This -capability cannot detect a "hot" change.

- -

-  -This is a read-only capability except for i4000/i5000. It allows the -user to select the color of the imaging background. This can be set differently -per side.

- -

 

- -

CAP_BACKGROUNDFRONT                  -Custom: i100/i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: TWBK_BLACK, TWBK_WHITE

- -

                                                                -Default: scanner dependent

- -

-    Reports -what the scanner front background was at the time the scanner was -started.  This capability cannot detect a "hot" change.

- -

-  -This is a read-only capability.

- -

 

- -

CAP_BACKGROUNDREAR                    -Custom: i160/i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: TWBK_BLACK, TWBK_WHITE

- -

                                                                -Default: scanner dependent

- -

-    Reports -what the scanner rear  background was at the time the scanner was -started.  This capability cannot detect a "hot" change.

- -

-  -This is a read-only capability.

- -

 

- -

CAP_BATCHCOUNT                              -Custom: i800/i1800

- -

                                                                -Allowed: 0 32,767

- -

                                                                -Default: 0 (disabled)

- -

-  -Controls the number of batches to be processed before applying the batch end -function.

- -

 

- -

CAP_BATCHENDFUNCTION                  -Custom: i800/i1800

- -

                                                                -Allowed: TWBE_NONE, TWBE_STOPFEEDER, TWBE_ENDOFJOB, TWBE_NEWBATCH

- -

                                                                -Default: TWBE_NONE

- -

-  -Action to be taken when the batch count is complete.

- -

 

- -

CAP_BATCHLEVEL                               -Custom: i800/i1800

- -

                                                                -Allowed: TWPL_LEVEL1, TWPL_LEVEL2, TWPL_LEVEL3

- -

                                                                -Default: TWPL_LEVEL1

- -

-  -Level used to decrement the batch count.

- -

 

- -

CAP_BATCHSTARTFUNCTION            -Custom: i800/i1800

- -

                                                                -Allowed: TWPL_NONE, TWPL_LEVEL1, TWPL_LEVEL2, TWPL_LEVEL3

- -

                                                                -Default: TWPL_NONE

- -

-  -Initial level for the batch.

- -

 

- -

CAP_BATTERYMINUTES                      -Unsupported.

- -

 

- -

CAP_BATTERYPERCENTAGE               -Unsupported.

- -

 

- -

CAP_BINARIZATION                             -Custom: 3590

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  -For use with Multistream(tm), this field must be set -to TRUE to get the TWAIN driver to produce

- -

   -a bitonal image from the color camera.  (see -CAP_CAMERAENABLE).

- -

 

- -

CAP_BLANKPAGE                                 -Custom: All Models (except for 3000/4000/5000/7000/9000)

- -

                                                                -Allowed: TWBP_IMAGE

- -

                                                                -Default: TWBP_IMAGE

- -

-  -Blank page detection.                                                 -

- -

 

- -

CAP_BLANKPAGEMODE                      -Custom: All Models (except for 3000/4000/5000/7000/9000)

- -

                                                                -Allowed: TWBM_NONE, TWBM_COMPSIZE, TWBM_CONTENT

- -

                                                                -Default: TWBM_NONE

- -

-  -Blank image deletion mode. Not all values are supported on all scanners.

- -

 

- -

CAP_BLANKPAGECOMPSIZEBW        -Custom: All Models (except for 3000/4000/5000/7000/9000)

- -

                                                                -Allowed: 0 - 1000 KB

- -

                                                                -Default: 0

- -

-  -Delete Bitonal image if the final size is less than specific -number of KB.

- -

- Value needs to be in -1024 increments.

- -

- The front and rear -values can be different expect for i30/i40/i55/i65.

- -

- When set to a -non-zero value: CAP_BLANKPAGEMODE is automatically set to TWBM_COMPSIZE

- -

  If set zero and -CAP_BLANKPAGECOMPSIZEBW and CAP_BLANKPAGECOMPSIZERGB are zero,

- -

  then -CAP_BLANKPAGEMODE is automatically changed to TWBM_NONE.

- -

 

- -

CAP_BLANKPAGECOMPSIZEGRAY    Custom: All -Models (except for 3000/4000/5000/7000/9000)

- -

                                                                -Allowed: 0 - 1000 KB

- -

                                                                -Default: 0

- -

-  -Delete Gray image if the final size is less than specific number of KB.

- -

- Value needs to be in -1024 increments.

- -

- The front and rear -values can be different except for i30/i40/i55/i65.

- -

- When set to a -non-zero value: CAP_BLANKPAGEMODE is automatically set to TWBM_COMPSIZE

- -

  If set zero and -CAP_BLANKPAGECOMPSIZEBW and CAP_BLANKPAGECOMPSIZERGB are zero,

- -

  then -CAP_BLANKPAGEMODE is automatically changed to TWBM_NONE.

- -

 

- -

CAP_BLANKPAGECOMPSIZERGB      -Custom: All Models (except for 3000/4000/5000/7000/9000)

- -

                                                                -Allowed: 0 - 1000 KB

- -

                                                                -Default: 0

- -

-  -Delete Color image if the final size is less than specific number of KB.

- -

- Value needs to be in -1024 increments.

- -

- The front and rear -values can be different except for i30/i40/i55/i65.

- -

- When set to a -non-zero value: CAP_BLANKPAGEMODE is automatically set to TWBM_COMPSIZE

- -

  If set zero and -CAP_BLANKPAGECOMPSIZEBW and CAP_BLANKPAGECOMPSIZERGB are zero,

- -

  then -CAP_BLANKPAGEMODE is automatically changed to TWBM_NONE.

- -

 

- -

CAP_BLANKPAGECONTENT              -Custom: i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: 0 - 100

- -

                                                                -Default: 0

- -

-  If -the percent of content on the image is less than or equal to this amount, the -image will be deleted.

- -

- This is -only valid when CAP_BLANKPAGEMODE is set to TWBM_CONTENT.

- -

  

- -

CAP_CAMERAENABLE                         -Custom: All Models (except for 5000/7000/9000)

- -

                                                                -Allowed: FALSE, TRUE

- -

Default 3590: Front Bitonal - FALSE, Rear Bitonal - -always TRUE,

- -

                -      Front Color - TRUE

- -

                                                                -Default i55/i65/i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000: Front/Rear Color - FALSE, Front/Rear Bitonal -- TRUE

- -

                                                                -Default Other: Front/Rear Color - TRUE, Front/Rear Bitonal -- FALSE

- -

-  -For use with Multistream(tm), this field must be set -to TRUE to get the TWAIN driver to transfer

- -

   -the image for that camera.  Use DG_CONTROL / DAT_FILESYSTEM / -MSG_CHANGEDIRECTORY

- -

   -to select the camera to set.  If using the 3590, CAP_BINARIZATION -must be set for these fields

- -

   -to have any meaning.

- -

 

- -

CAP_CAMERAORDER                           -Custom: All Models (except for 5000/7000/9000)

- -

Allowed: -TWCM_CL_BOTH/TWCM_BW_BOTH or TWCM_BW_BOTH/TWCM_CL_BOTH

- -

                                                                -Default: TWCM_CL_BOTH/TWCM_BW_BOTH

- -

-  An -array determining which should be transferred first for a side: the color or -the bitonal image.

- -

 

- -

CAP_CAMERAPREVIEWUI                    -Unsupported.

- -

 

- -

CAP_CAPTION                                      -Standard: All Models (except for i2000/i2900/i3000/i4000/i5000)

- -

                                                                -Allowed: Any TW_STR255 string

- -

                                                                -Default: (empty string)

- -

 

- -

CAP_CHECKDIGIT              -                  -Custom: i800/i1800 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  If -set to TRUE the scanner will check image address digit.

- -

 

- -

CAP_CLEARBUFFERS                           -Standard: All Models (except for i2000/i2900/i3000/i4000/i5000)

- -

                                                                -Allowed:  3000/4000/5000/7000/9000:       TWCB_AUTO, -TWCB_CLEAR, TWCB_NOCLEAR

- -

                                                                                -Other:                                         -TWCB_AUTO (Read -Only)                             -

- -

                                                                -Default: TWCB_AUTO

- -

 

- -

CAP_CLEARPAGE                                 -Unsupported.

- -

 

- -

CAP_CUSTOMDSDATA                        -Standard: All Models

- -

                                                                -Allowed: TRUE

- -

                                                                -Default: TRUE

- -

-  -This is a read-only capability.

- -

 

- -

CAP_CUSTOMINTERFACEGUID           -Standard: i2000/i2900/i3000/i5000

- -

                                                                -Allowed: {642881CE-9F18-448c-8FD8-F77A51E0B85A}

- -

                                                                -Default: {642881CE-9F18-448c-8FD8-F77A51E0B85A}

- -

-   Uniquely -identifies an interface for a Data Source, so that an Application can properly -interpret its custom content.

- -

-  -This is a read-only capability.

- -

 

- -

CAP_DEVICEEVENT                              -Standard: All Models

- -

                                                                -Allowed: TWDE_PAPERJAM, TWDE_PAPERDOUBLEFEED

- -

                                                                -Default: (empty TW_ARRAY)

- -

                                                                -- TWDE_PAPERDOUBLEFEED is on all models (except for 5000/7000/9000).

- -

 

- -

CAP_DEVICEONLINE                             -Standard: All Models

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: (none)

- -

-  -This is a read-only capability.

- -

-  To -comply with the TWAIN specification the Source issues a command to the device -to confirm that it is up and communicating (the command used is a SCSI -test-unit-ready command).

- -

 

- -

CAP_DEVICETIMEDATE                        -Standard: All Models (except for 5000/7000/9000)

- -

                                                                -Allowed: TW_STR32 of the form YYYY/MM/DD HH:MM:SS.sss

- -

                                                                -Default: (none)

- -

 

- -

CAP_DOCUMENTCOUNT                      -Custom: 5000/7000/9000 Series

- -

                                                                -Allowed: 0 - 999999999

- -

                                                                -Default: 0

- -

-  -This value overrides CAP_PRINTERINDEX if CAP_DOCUMENTCOUNTENABLED == TRUE

- -

 

- -

CAP_DOCUMENTCOUNTENABLED      -Custom: 5000/7000/9000 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-    Determines -if the CAP_DOCUMENTCOUNT is downloaded to the scanner.

- -

 

- -

CAP_DOUBLEFEEDENDJOB                  -Custom: i600/i700/i800/i1800/i2000/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: TRUE

- -

-  If -set to TRUE the scanner will stop scanning on detection of a multifeed.

- -

 

- -

CAP_DOUBLEFEEDSTOP                      -Custom: All Models (except for 5000/7000/9000)

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: TRUE

- -

-  If -set to TRUE the scanner will stop scanning on detection of a multifeed.  The 3000/4000 scanners will -disable.

- -

 

- -

CAP_DUALSTACKINGENABLED          Custom: i5000 -Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

- If -set to TRUE -the Controlled Dual Stacking Accessory will be enabled.

- -

- It -can only be enabled if the accessory is installed.

- -

 

- -

CAP_DUALSTACKINGLENGTHMODE   Custom: i5000 Series

- -

                                                                -Allowed: TWDSLM_NONE, TWDSLM_LESSTHAN, TWDSLM_GREATERTHAN, -TWDSLM_BETWEEN

- -

                                                                -Default: TWDSLM_NONE

- -

Indicates -the -length method being used to make document separation decisions

- -

for the Controlled Dual Stacking Accessory. The stacking length mode only

- -

has meaning if -CAP_DUALSTACKINGENABLED is TRUE.

- -

 

- -

CAP_DUALSTACKINGLENGTH1            Custom: -i5000 Series

- -

                                                                -Allowed: Scanner -specific

- -

                                                                -Default: Scanner specific

- -

- If -CAP_DUALSTACKINGLENGTHMODE is "less than", then any documents shorter

- -

than this length will be separated and placed -in the selected CAP_DUALSTACKINGSTACK.

- -

- -If CAP_DUALSTACKINGLENGTHMODE is "greater than", then any documents -longer

- -

than this length will be separated and placed -in the selected CAP_DUALSTACKINGSTACK.

- -

- -If CAP_DUALSTACKINGLENGTHMODE is "between", then any documents longer -than

- -

this length and shorter than -CAP_DUALSTACKINGLENGTH2 will be separated and placed in the

- -

selected CAP_DUALSTACKINGSTACK.

- -

- -Only valid if CAP_DUALSTACKINGENABLED is TRUE and CAP_DUALSTACKINGLENGTHMODE

- -

is set to any value other than TWDSLM_NONE.

- -

- -The range is determined by the scanner, so an application might want to

- -

ask what the range is

- -

 

- -

CAP_DUALSTACKINGLENGTH2            Custom: -i5000 Series

- -

                                                                -Allowed: Scanner -specific

- -

                                                                -Default: Scanner specific

- -

- If CAP_DUALSTACKINGLENGTHMODE is "between", then -any documents whose length falls within

- -

the selected range of CAP_DUALSTACKINGLENGTH1 and CAP_DUALSTACKINGLENGTH2 will be

- -

separated and placed -in the selected CAP_DUALSTACKINGSTACK.

- -

- Only valid if CAP_DUALSTACKINGENABLED is TRUE and -CAP_DUALSTACKINGLENGTHMODE

- -

is -set to TWDSLM_BETWEEN.

- -

- The -range is determined by the scanner, so an application might want to

- -

ask what the range is.

- -

 

- -

CAP_DUALSTACKINGMULTIFEED        -Custom: i5000 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

- Indicates if Multifed documents -should be separated and placed in

- -

the -selected CAP_DUALSTACKINGSTACK.

- -

- Only valid if CAP_DUALSTACKINGENABLED is TRUE.

- -

 

- -

CAP_DUALSTACKINGPATCHTRANSFER

- -

Custom: i5000 -Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

- Indicates if Patch Type Transfer documents should be -separated and placed in

- -

the -selected CAP_DUALSTACKINGSTACK.

- -

- Only valid if CAP_DUALSTACKINGENABLED is TRUE.

- -

 

- -

CAP_DUALSTACKINGPATCHTYPE1 -Custom: i5000 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

- Indicates if Patch Type 1 -documents should be separated and placed in

- -

the -selected CAP_DUALSTACKINGSTACK.

- -

- Only valid if CAP_DUALSTACKINGENABLED is TRUE.

- -

 

- -

CAP_DUALSTACKINGPATCHTYPE2 -Custom: i5000 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

- Indicates if Patch Type 2 documents should be separated and -placed in

- -

the -selected CAP_DUALSTACKINGSTACK.

- -

- Only valid if CAP_DUALSTACKINGENABLED is TRUE.

- -

 

- -

CAP_DUALSTACKINGPATCHTYPE3 -Custom: i5000 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

- Indicates if Patch Type 3 documents should be separated and -placed in

- -

the -selected CAP_DUALSTACKINGSTACK.

- -

- Only valid if CAP_DUALSTACKINGENABLED is TRUE.

- -

 

- -

CAP_DUALSTACKINGPATCHTYPE4 -Custom: i5000 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

- Indicates if Patch Type 4 documents should be separated and -placed in

- -

the -selected CAP_DUALSTACKINGSTACK.

- -

- Only valid if CAP_DUALSTACKINGENABLED is TRUE.

- -

 

- -

CAP_DUALSTACKINGPATCHTYPE6 -Custom: i5000 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

- Indicates if Patch Type 6 documents should be separated and -placed in

- -

the -selected CAP_DUALSTACKINGSTACK.

- -

- Only valid if CAP_DUALSTACKINGENABLED is TRUE.

- -

 

- -

CAP_DUALSTACKINGSTACK                -Custom: i5000 Series

- -

                                                                -Allowed: TWDSS_STACK1, TWDSS_STACK2

- -

                                                                -Default: TWDSS_STACK1

- -

Indicates -which stack to put detected documents in when a document matches the

- -

defined stacking criteria (patch type, -length, and/or multifeed).

- -

- -Only valid if CAP_DUALSTACKINGENABLED is TRUE.

- -

 

- -

CAP_DUPLEX                                         -Standard: All Models

- -

                                                                -Allowed: TWDX_NONE, TWDX_1PASSDUPLEX

- -

                                                                -Default: TWDX_NONE for Simplex scanners, and TWDX_1PASSDUPLEX for Duplex scanners

- -

-  -This is a read-only capability.

- -

 

- -

CAP_DUPLEXENABLED                         -Standard: All Models

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: TRUE

- -

-    If -CAP_DUPLEX is TWDX_NONE, then this capability is FALSE.

- -

 

- -

CAP_EASYSTACKING                           -Custom: i600/i700/i1800

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  If set to TRUE then the -scanner makes adjustments to improve the arrangement of the output stack as the -paper exits the transport.

- -

 

- -

CAP_ENABLECOLORPATCHCODE      -Custom: 3590

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  -Controls recognition of the patch code that moves the scanner mirror, letting -it scan bitonal or color on the front camera.

- -

 

- -

CAP_ENABLEDSUIONLY                       -Standard: All Models (except for i2000/i2900/i3000/i4000/i5000)

- -

                                                                -Allowed: TRUE

- -

                                                                -Default: TRUE

- -

-  -This is a read-only capability.

- -

 

- -

CAP_ENDORSER                                    -Unsupported.

- -

 

- -

CAP_ENERGYSTAR                               -Custom: All Models (except for i800/3000/4000/5000/7000/9000)

- -

                                                                -Allowed: i30/i40/i55/i65/i100/i600/i700/i1800:        -0, 5 - 60

- -

                                                                               i200:                                                          -0, 15 - 60

- -

                                                                               -i1100/i1200/i1300/i1400:                         - 0, 5 - 240

- -

                                                                               -i2000/i4000/i5000:                 5 - 240

- -

                                                                               -i900/i2900/i3000:  -               -                     1 - 240

- -

                                                                -Default: 15

- -

-  -Selects the idle time required before the Energy Star power saver is activated.

- -

 

- -

CAP_EXTENDEDCAPS                           -Unsupported.

- -

 

- -

CAP_FEEDERALIGNMENT                     -Standard: All Models (except for 3000/4000/5000/7000/9000)

- -

                                                                -Allowed:  TWFA_CENTER

- -

                                                                -Default:    TWFA_CENTER

- -

                                                                -- This is a read-only capability

- -

 

- -

CAP_FEEDERENABLED                          -Standard: All Models

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: TRUE

- -

i200: -FALSE is only permitted if the flatbed platen is installed.

- -

-  -This is always TRUE for all other models and read only (except for -i2000/i2900/i3000/i4000/i5000).

- -

 

- -

CAP_FEEDERKEEPALIVE                      -Custom: 3000/4000 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  If -TRUE the feeder is kept running forever waiting for the first sheet of paper.

- -

 

- -

CAP_FEEDERLOADED                           -Standard: All Models

- -

                                                                -Allowed: TRUE

- -

                                                                -Default: TRUE

- -

-  -This is a read-only capability.

- -

-  -See CAP_PAPERDETECTABLE.

- -

 

- -

CAP_FEEDERMODE                               -Custom: i280/i1440/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: i280/i1440: TWFM_NONE, TWFM_SPECIAL

- -

                                                                               -Other: Scanner specific

- -

                                                                -Default: i280/i1440: TWFM_NONE

- -

                                                                             -Other: Scanner specific

- -

- -CAP_FEEDERMODE is for Special Document

- -

- For i1440, -TWFM_NONE will show Off on the UI, TWFM _SPECIAL will show On.

- -

 

- -

CAP_FEEDERORDER                              -Unsupported.

- -

 

- -

CAP_FEEDPAGE                                    -Unsupported.

- -

 

- -

CAP_FIXEDDOCUMENTSIZE                 -Custom: 3000/4000 Series (except for 3500)

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  -Set this value to true to speed up scanning.  Note that the speed up can -only occur if all of the documents in the batch are the same size.  -Speed-up is from 75ppm to 85ppm for 8.5x11 documents fed landscape.

- -

 

- -

CAP_FOLDEDCORNER                          -Custom: i600/i700

- -

                                                                -Allowed: TWFC_DISABLED, TWFC_STOP, TWFC_ENDOFJOB

- -

                                                                -Default: TWFC_DISABLED

- -

-    Controls -Folded Corner detection and the action taken if one is discovered during -scanning.

- -

-  -This is TWFC_DISABLED and read-only at this time.

- -

 

- -

CAP_FOLDEDCORNERSENSITIVITY     Custom: i600/i700

- -

                                                                -Allowed: 1 - 100

- -

                                                                -Default: 2

- -

-    Controls -the folded corner sensitivity, if folder corner detection is turned on.

- -

-  -This is a read-only capability at this time.

- -

 

- -

CAP_FUNCTIONKEY1

- -

CAP_FUNCTIONKEY2

- -

CAP_FUNCTIONKEY3                            -Custom: i800/i1800 Series

- -

Allowed: TWFK_NONE, -TWFK_ENDOFJOB, TWFK_TERMINATEBATCH, TWFK_SKIPMULTIFEED, TWFK_SKIPPRINTING, -TWFK_SKIPBATCH

- -

                                                                -Default: TWFK_NONE

- -

-    Controls -the programmable keys on the scanner console.

- -

 

- -

CAP_IMAGEADDRESS                          -Custom: 5000/7000/9000/i800/i1800 Series

- -

                                                                -Allowed: Any valid image address

- -

                                                                -Default:    i800: None. Empty string indicates to use the -current scanner value.

- -

                                                                                -i1800: Current scanner value.  Empty string indicates to use -Scanner defaults (ex: .0.0.1)

- -

                                                                                -Other:  DEFAULT

- -

                                                                --  Specifies the image address used to start this session.

- -

 

- -

CAP_IMAGEADDRESSENABLED          -Custom: 5000/7000/9000 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  -Determines if the CAP_IMAGEADDRESS is downloaded to the scanner.

- -

 

- -

CAP_IMAGEADDRESSTEMPLATES     Custom: i800/i1800 -Series

- -

                                                                -Allowed: TWIA_CUSTOM, TWIA_NONE, TWIA_1 - TWIA_5

- -

                                                                -Default: TWIA_1

- -

-  -Populates the template and level to follow fields.

- -

TWIA_CUSTOM is a read -only value and if CAP_IMAGEADDRESS_A or B, C, D or CAP_LEVELTOFOLLOW1, 2, 3 are changed, then this capability will revert to -TWIA_CUSTOM.

- -

TWIA_NONE is Fix -"FFFFFFFFF"

- -

TWIA_1 is Level 3 -"FFFFFFFFF.333333.222222.111111"

- -

TWIA_2 is Level 2 -"FFFFFFFFF.222222222.111111111"

- -

TWIA_3 is Level 1 -"FFFFFFFFF.111111111"

- -

TWIA_4 is Level 3 -Offset "FFFFFFFFF.333333333.222222222"

- -

TWIA_5 is Level 2 -Offset "FFFFFFFFF.222222222"

- -

 

- -

CAP_IMAGEADDRESS_A

- -

CAP_IMAGEADDRESS_B

- -

CAP_IMAGEADDRESS_C

- -

CAP_IMAGEADDRESS_D                      -Custom: i800/i1800 Series

- -

Allowed: F, 3, 2, 1 or nothing, -according to the image address template rules (see the context sensitive help -for this field for more information)

- -

                                                                -Default: FFFFFFFFF.333333.222222.111111

- -

                                                                --  Specifies the image address template.

- -

 

- -

CAP_IMAGESDIFFERENT                      Custom: -i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: FALSE, TRUE
-                                                                -Default: FALSE

- -

                                                                --  When this is TRUE the user can set different values for the color and bitonal cameras.

- -

                                                                --  When set to FALSE a value set on a color -camera will be matched (if possible) by the bitonal -camera, and vice versa.

- -

 

- -

CAP_IMAGEMAGNIFICATIONFACTOR            -

- -

                                                                -Unsupported.  

- -

 

- -

CAP_IMAGEMERGE                              Custom: -i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000

- -

                                                                -Allowed: TWIM_NONE, TWIM_FRONTONTOP, TWIM_FRONTONBOTTOM, TWIM_FRONTONLEFT, -TWIM_FRONTONRIGHT

- -

                                                                -Default: TWIM_NONE

- -

                                                                --  Merges the front and back images into a single image that is returned -to the application.

- -

 

- -

CAP_INDICATORS                                 -Standard: All Models

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  -The TWAIN default is TRUE, so it is up to the Application to turn the indicator -off if it wants complete UI-less control of the Source.

- -

-  -The Source supports pTW_UIINTERFACE.ShowUI being -FALSE, but CAP_INDICATORS being TRUE.  In this case the Source will -display just the Progress tab.

- -

 

- -

CAP_INDICATORSWARMUP -               -Custom: All Models (except for 3000/4000/5000/7000/9000/i800)

- -

Allowed: TRUE, FALSE

- -

                                                                -Default: TRUE

- -

-          -Controls the appearance of the LampSaver -and Warmup dialogs.  Only turn this off if these -dialogs are interfering with the operation of your application.

- -

 

- -

CAP_INTELLIGENTDOCUMENTPROTECTION          -

- -

                                                                -Custom: i2900/i3000 Series

- -

                                                                -Allowed: TWIDP_NONE, TWIDP_MINIMUM, TWIDP_NORMAL, TWIDP_MAXIMUM

- -

                                                                -Default: TWIDP_NORMAL

- -

                                                                --  Controls the level of document protection.

- -

 

- -

CAP_JOBCONTROL                              -Unsupported.

- -

 

- -

CAP_LANGUAGE                                   -Standard: All Models

- -

Allowed:  -TWLG_ENGLISH*

- -

                                TWLG_CHINESE*

- -

                                TWLG_CZECH

- -

                  -TWLG_DUTCH*

- -

       -                         TWLG_FRENCH*

- -

                                 -TWLG_GERMAN*

- -

       -        -                  -TWLG_ITALIAN*

- -

        -        -                 -TWLG_JAPANESE

- -

                   -              -TWLG_KOREAN*

- -

                      -           -TWLG_PORTUGUESE*

- -

                      -          TWLG_RUSSIAN        -

- -

         -               -          TWLG_SPANISH*

- -

             -              -       TWLG_TURKISH

- -

                                                                -Default: The application's language[1]

- -

 

- -

CAP_LEVELTOFOLLOW1

- -

CAP_LEVELTOFOLLOW2

- -

CAP_LEVELTOFOLLOW3                     -Custom: i800/i1800 Series

- -

                                                                -Allowed: TWPL_LEVEL1, TWPL_LEVEL2, TWPL_LEVEL3

- -

                                                                -Default: TWPL_LEVEL1

- -

                                                                --  Specifies the level to follow rules for the current image address -template.

- -

 

- -

CAP_MAXBATCHBUFFERS                  -Unsupported.

- -

 

- -

CAP_MODE                                            -Custom: 5000/7000/9000 Series

- -

                                                                -Allowed: 1 - 18

- -

                                                                -Default: 1

- -

-  -Allows the selection of the mode to be used during the scanning session.

- -

-  -Only one mode is permitted per session.

- -

 

- -

CAP_MULTIFEEDCOUNT -                     -Custom: All Models (except for i800/3000/4000/5000/7000/9000)

- -

                                                                -Allowed: 0 - 32767

- -

                                                                -Default: 0

- -

                                                                 -- Count of multifeeds per scan session.

- -

                                                                 -- Setting this capability has no effect.

- -

 

- -

CAP_MULTIFEEDRESPONSE                -Custom: i600/i700/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: i1100: -                          -   TWMR_CONTINUE, TWMR_ENDOFJOB

- -

                                                                               -i600/i700/i1800:            -  TWMR_CONTINUE, TWMR_ENDOFJOB, TWMR_STOPFEEDER

- -

                                                                               -i1200/i1300/i1400:         TWMR_CONTINUE, TWMR_ENDOFJOB, -TWMR_ENDOFJOBLEAVEPAPER

- -

                                                                               -i900/i2000:                     TWMR_CONTINUE, TWMR_ENDOFJOB, -TWMR_ENDOFJOBLEAVEPAPER, TWMR_ENDOFJOBGENERATEIMAGE

- -

                                                                               -i2900/i3000/i4000/i5000: TWMR_CONTINUE, -TWMR_ENDOFJOB, TWMR_ENDOFJOBLEAVEPAPER, TWMR_ENDOFJOBGENERATEIMAGE,

- -

                                                                                -                                      TWMR_STOPFEEDER, TWMR_STOPFEEDERLEAVEPAPER

- -

                                                                -Default: TWMR_ENDOFJOB

- -

                                                                 -- Action -taken when the multifeed detected.

- -

                                                                 -- Note: The allowed values may have been changed after the initial release of -the scanner. So it is best to get the list from the TWAIN driver.

- -

 

- -

CAP_MULTIFEEDSOUND -                      -Custom: All Models (except for i800/3000/4000/5000/7000/9000)

- -

                                                                -Allowed: Text

- -

                                                                -Default: "ding.wav"

- -

- Sound -played when detect document multifeeds.

- -

 

- -

CAP_MULTIFEEDTHICKNESSDETECTION

- -

                                                                -Custom: 3000 Series (except for 3500)

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  -Turns multifeed thickness detection on or off.

- -

 

- -

CAP_NOWAIT                                        -Custom: All Models

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  If -set to TRUE then potentially blocking commands (ones that wait for image data -from the scanner) will return TWRC_BUSY if they are not ready.  This -allows the application to poll the command until data does arrive, which -prevents applications from appearing to hang from the user's point of view.

- -

 

- -

CAP_PAGECOUNT                                -Custom: All Models (except for 5000/7000/9000)

- -

                                                                -Allowed: 0 - 32767

- -

                                                                -Default: 0 (disabled)

- -

-  If -CAP_XFERCOUNT is set to -1 and this field is non-zero, then the specified -number of sheets of paper will be scanned.  This keeps the application -from having to figure out how what value of CAP_XFERCOUNT is needed to get a -specific number of sheets of paper scanned.

- -

 

- -

CAP_PAGESIZELIMIT                           -Custom: All Models (except for 5000/7000/9000)

- -

                                                                -Allowed: 0 - ICAP_PHYSICALHEIGHT

- -

                                                                -Default: 0 (disabled)

- -

-  -This is a double document detection system.  If greater than zero then the -scanner will detect an attempt to scan anything larger than the specified -length value.  The AddPageSizeLimit in the -CONST.INI file can be modified to change the fudge factor in identifying multifeeds.

- -

-  -The i30/i40/i55/i65 cannot guarantee multifeed detection -for documents that are 14 in length if allows value is 14.77.

- -

 

- -

CAP_PAPERDETECTABLE                    -Standard: All Models

- -

                                                                -Allowed: FALSE

- -

                                                                -Default: FALSE

- -

-  -Indicates that the scanner cannot detect the presence of paper in the feeder -area.

- -

- This -is a read-only capability.

- -

 

- -

CAP_PAPERSOURCE -                           -Custom: All Models (except for 4000/5000/7000/9000)

- -

                                                                -Allowed:  i30/i40/i100/i900/i1100TWPU_ADF.

- -

                                                                -Allowed:  i55/i65:  TWPU_ADF, TWPU_AUTO, TWPU_PLATEN

- -

Allowed:  i200/i1200/i1300/i1400/i2000TWPU_ADF.  If platen -installed TWPU_AUTO and TWPU_PLATEN also allowed.

- -

                                                                -Allowed:  i600/i700/i1800/i4000: TWPU_ADF, TWPU_ELEVATOR100, TWPU_ELEVATOR250, -TWPU_ELEVATOR500

- -

                                                                -Allowed:  i5000: TWPU_ADF, -TWPU_ELEVATOR100, TWPU_ELEVATOR250, TWPU_ELEVATOR500, TWPU_ELEVATOR750

- -

                                                                -Allowed:  i2900/i3000: TWPU_ADF, -TWPU_ELEVATOR100, TWPU_ELEVATOR250. If platen installed TWPU_AUTO, -TWPU_PLATEN,

- -

-TWPU_ELEVATOR100PLATEN, -TWPU_ELEVATOR250PLATEN also allowed

- -

                                                                -Default:    i30/i40/i100/i200/i900/i1100: TWPU_ADF

- -

                                                                -Default:    i600/i700/i1800/i4000: TWPU_ELEVATOR500

- -

                                                                -Default:   i5000: TWPU_ELEVATOR750

- -

                                                                -Default:    i55/i65i/1200/i1300/i1400/i2000: TWPU_AUTO

- -

-Default:   i2900/i3000: TWPU_ELEVATOR250. If -platen installed TWPU_ELEVATOR250PLATEN.

- -

- -TWPU_ADF-    Selects source of paper (ADF or Platen). TWPU_AUTO. -Selects ADF but changes to platen if the ADF has no paper in it at the start of -the scanning session.

- -

 

- -

CAP_PATCHCOUNT -                             -Custom: i280/i600/i700/i1400/i1800/i4000/i5000

- -

                                                                -Allowed: 0 - 32767

- -

                                                                -Default: 0

- -

                                                                 -- Count of patches per scan session.

- -

                                                                 -- Setting this capability has no effect.

- -

 

- -

CAP_PATCHHEAD1 -                              -Custom: i1800

- -

                                                                -Allowed: TRUE/FALSE

- -

                                                                -Default: TRUE

- -

                                                                 -- Enables/disables -the first patch reader

- -

 

- -

CAP_PATCHHEAD2                               -Custom: i1800

- -

                                                                -Allowed: TRUE/FALSE

- -

                                                                -Default: TRUE

- -

                                                                 -- Enables/disables -the second patch reader

- -

 

- -

CAP_PATCHHEAD3 -                              -Custom: i1800

- -

                                                                -Allowed: TRUE/FALSE

- -

                                                                -Default: TRUE

- -

                                                                 -- Enables/disables -the third patch reader

- -

 

- -

CAP_PATCHHEAD4 -                              -Custom: i1800

- -

                                                                -Allowed: TRUE/FALSE

- -

                                                                -Default: TRUE

- -

                                                                 -- Enables/disables -the fourth patch reader

- -

 

- -

CAP_PCARDENABLED                          -Unsupported.

- -

                                                                -

- -

CAP_POWEROFFTIMEOUT                   -Custom: i2900/i3000 series

- -

                                                                -Allowed: i2900/i3000:   0 - 240

- -

                                                                -Default: 60

- -

-  -Selects the number of minutes to wait after the scanner enters low power mode, -before it powers off

- -

 

- -

CAP_POWERSUPPLY                            -Unsupported.

- -

 

- -

CAP_PRINTER                                        -Standard: 3520/4500/5000/7000/i200/i600/i700/i800/i1400/i1800/i2900/i3000/i4000/i5000 -Series

- -

Allowed:  -TWPR_IMPRINTERTOPBEFORE,

- -

                -TWPR_IMPRINTERBOTTOMBEFORE (except i600/i700/i800/i1800/i4000/i5000),

- -

                -TWPR_IMPRINTERBOTTOMAFTER ( i200/i1400 only).

- -

                                                                -Default 3520/4500: TWPR_IMPRINTERTOPBEFORE

- -

Default 5000/7000: -TWPR_IMPRINTERTOPBEFORE (TWPR_IMPRINTERBOTTOMBEFORE if there is no top printer)

- -

                                                                -Default i200/i1400/i2900/i3000: TWPR_IMPRINTERBOTTOMAFTER

- -

                                                                -Default i600/i700/i800/i1800/i4000/i5000: TWPR_IMPRINTERTOPBEFORE

- -

 

- -

CAP_PRINTERDATE                               -Custom: i600/i700/i1800/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: YYYY/MM/DD      -(YYYY - year, MM - month, DD - day)

- -

                                                                -Default: empty string

- -

                                                                 -- Set to empty string to disable.

- -

                                                                 -- This will set the scanner to a specific date prior to printing.

- -

                                                                 -- The scanner will be returned to the original date afterwards.

- -

 

- -

CAP_PRINTERDATEDELIMITER            -Custom: 3520/4500/5000/7000/i200/i600/i700/i800/i1400/i1800/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed: TWPD_NONE, TWPD_FORWARDSLASH, TWPD_HYPHEN, TWPD_PERIOD, TWPD_BLANK

- -

                                                                -Default i800: TWPD_FORWARDSLASH

- -

                                                                -Default Other: TWPD_NONE

- -

-  -Selects the delimiter between the fields in the date.  The delimiter in -the time field is always a colon (:).

- -

 

- -

CAP_PRINTERDATEFORMAT               -Custom: i600/i700/i800/i1400/i1800/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed: i600/i800/i1400:    TWPE_MMDDYYYY, TWPE_DDMMYYYY, -TWPE_YYYYMMDD,

- -

                                                -                               -Other:                   -TWPE_MMDDYYYY, TWPE_DDMMYYYY, TWPE_YYYYMMDD, TWPE_DDD, TWPE_YYYYDDD

- -

                                                                -Default: i800:    TWPE_MMDDYYYY

- -

                                                                -Default: Other:  TWPE_YYYYMMDD

- -

-  -Selects the format of the date.

- -

 

- -

CAP_PRINTERENABLED                        -Standard: 3520/4500/5000/7000/i200/i600/i700/i800/i1400/i1800/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

- Turns -printing on and off.  Note that printing for the 5000/7000 is side -dependent.

- -

 

- -

CAP_PRINTERFONT                              -Custom: 3520/4500/5000/7000/i200/i600/i700/i800/i1400/i1800/i2900/i3000/i4000/i5000 Series

- -

                -Allowed: 3520/4500/5000/7000/i200/i1400:    -TWPN_LARGECOMIC, TWPN_LARGECINE, TWPN_SMALLCOMIC, TWPN_SMALLCINE

- -

                                                                               -i600/i700/i800/i1800:      TWPN_LARGECOMIC, -TWPN_LARGECINE, TWPN_LARGECOMIC180, TWPN_LARGECINE180, 

- -

                                                                                       -                                -TWPN_SMALLCOMIC, TWPN_SMALLCINE, TWPN_SMALLCOMIC180, TWPN_SMALLCINE180

- -

                                                                               -i2900/i3000/i5000:          -TWPN_LARGECOMIC, TWPN_LARGECINE, TWPN_LARGECOMIC180, TWPN_LARGECINE180,

- -

                                                                                       -                                -TWPN_SMALLCOMIC, TWPN_SMALLCINE, TWPN_SMALLCOMIC180, TWPN_SMALLCINE180,

- -

                                                                                                                       -TWPN_BOLDLARGECOMIC, TWPN_BOLDLARGECINE, -TWPN_BOLDLARGECOMIC180, TWPN_BOLDLARGECINE180

- -

                                                                               -i4000:                             TWPN_LARGECOMIC, TWPN_LARGECINE, -TWPN_LARGECOMIC180, TWPN_LARGECINE180,

- -

                                                                                                                       -TWPN_SMALLCOMIC, TWPN_SMALLCINE, TWPN_SMALLCOMIC180, -TWPN_SMALLCINE180,

- -

                                                                                       -                                -TWPN_BOLDLARGECOMIC, TWPN_BOLDLARGECINE

- -

                                                                -Default:    i800/i2900/i3000/i4000/i5000: TWPN_SMALLCOMIC -

- -

                                                                                -Other:                            TWPN_LARGECOMIC

- -

-    This -selects the printing font.

- -

 

- -

CAP_PRINTERFONTFORMAT               -Custom: i1800

- -

                                                                -Allowed: TWPFF_NORMAL, TWPFF_BLOCK

- -

                                                                -Default: TWPFF_NORMAL

- -

                                                                 -- Elects the printer font format to be used

- -

 

- -

CAP_PRINTERIMAGEADDRESSFORMAT

- -

                                                                -Custom: 5000/7000/i800/i1800 Series

- -

                                                                -Allowed:                  -TWPI_DISPLAYLEADINGZEROS, TWPI_SUPPRESSLEADINGZEROS, TWPI_COMPRESSLEADINGZEROS

- -

                                                                -Default 5000/7000: TWPI_DISPLAYLEADINGZEROS

- -

                                                                -Default i800/i1800: -TWPI_SUPPRESSLEADINGZEROS

- -

-  -This selects the format of the image address, if it is selected for printing.

- -

 

- -

CAP_PRINTERIMAGEADDRESSLEVEL

- -

                                                                -Custom: 5000/7000/i800/i1800 Series

- -

Allowed 5000/7000: -TWPL_ALLLEVELS, TWPL_LEVEL0, TWPL_LEVEL1, TWPL_LEVEL2, TWPL_LEVEL3

- -

                                                                -Allowed i800/i1800: -TWPL_ALLLEVELS, TWPL_LEVEL1, TWPL_LEVEL2, TWPL_LEVEL3

- -

                                                                -Default: TWPL_ALLLEVELS

- -

-  -This selects which level document the described printing will occur upon.

- -

 

- -

CAP_PRINTERINDEX                              -Standard: 3520/4500/5000/7000/i200/i600/i700/i800/i1400/i1800/i2000/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed: 0 - 999999998

- -

                                                                -Default i600/i700/i1800: 1

- -

                                                                -Default Other : 0

- -

-  -This value is shared with CAP_DOCUMENTCOUNT, it CAP_DOCUMENTCOUNTENABLED == -TRUE, then that

- -

                                                                -   value will override this one.

- -

 

- -

CAP_PRINTERINDEXDIGITS                  -Custom: 3520/4500/5000/7000/i200/i600/i700/i800/i1400/i1800/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed: 1 - 9

- -

                                                                -Default: 9

- -

-    Sets the -number of digits of the counter to be printed.  Note that the data will be -truncated if the number of digits in the count exceeds this value.

- -

 

- -

CAP_PRINTERINDEXFORMAT

- -

                                                                -Custom: 3520/4500/5000/7000/i200/i600/i700/i800/i1400/i1800/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed: -                 -TWPI_DISPLAYLEADINGZEROS, TWPI_SUPPRESSLEADINGZEROS, TWPI_COMPRESSLEADINGZEROS

- -

                                                                -Default i800: TWPI_SUPPRESSLEADINGZEROS

- -

                                                                -Default Other: TWPI_DISPLAYLEADINGZEROS

- -

-  -This selects the format of the document count, if it is selected for printing.

- -

 

- -

CAP_PRINTERMODE                           Standard: -5000/7000/i2900/i3000/i4000/i5000 Series

- -

                                                             Allowed: -TWPM_SINGLESTRING, TWPM_COMPOUNDSTRING

- -

                                                             Default: -TWPM_SINGLESTRING

- -

-  -TWPM_SINGLESTRING allows the full range of printer features to be expressed.

- -

-  -TWPM_COMPOUNDSTRING follows the guidelines of the TWAIN 1.8 specification.

- -

 

- -

CAP_PRINTERPOSITION                       -Custom: 3520/4500/5000/7000/i200/i600/i700/i800//i1400/i1800/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed: Scanner -specific

- -

                                                                -Default: Scanner specific

- -

                                                                --  This selects the position from the top of the page where printing is to -begin.

- -

 

- -

CAP_PRINTERSTRING                           -Standard: i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed:  Any -string (up to 40 characters)

- -

                                                                -Default:    111

- -

                                                                --  This capability is the same as CAP_PRINTERWRITESEQUENCEMESSAGE1.

- -

 

- -

CAP_PRINTERSUFFIX                            -Standard: 5000/7000/i200/i600/i700/i1400/i1800/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed:  5000/7000:              -Any string

- -

                                                                                -i600/i700/i1800/i5000:   Any -string (up to 20 characters)

- -

                                                                                -i200/i1400/i2900/i3000/i4000:    Any string (up to -40 characters)

- -

                                                                -Default:    5000/7000:              -(empty string)

- -

                                                                                -i200/i600/i700/i1400:       ABC

- -

                                                                                -i1800/i2900/i3000/i4000/i5000:            111

- -

 

- -

CAP_PRINTERTIME                               -Custom: i600/i700/i1800/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: HH:MM      -(HH - hour (0-23), MM - minutes (0-59), i.e. -00:00->23:59)

- -

                                                                -Default: empty string

- -

                                                                 -- Set to empty string to disable.

- -

                                                                 -- This will set the scanner to a specific time prior to printing.

- -

                                                                 -- The scanner will be returned to the original time afterwards.

- -

 

- -

CAP_PRINTERWRITESEQUENCE          -Custom: 5000/7000/i200/i600/i700/i800/i1400/i1800/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed: refer to kdscust.h

- -

                                                                -Default: TWPW_NONE

- -

                                                                --  Determines what will be printed.

- -

                                                                --  Use CAP_PRINTERWRITESEQUENCEINDEX to move through each of the items.

- -

                                                                --  Use CAP_PRINTERIMAGEADDRESSLEVEL to specify the level being targeted -for printing.

- -

 

- -

CAP_PRINTERWRITESEQUENCEINDEX

- -

                                                                -Custom: 5000/7000 Series

- -

                                                                -Allowed: 1 - 7

- -

                                                                -Default: 1

- -

                                                                --  Selects the current CAP_PRINTERWRITESEQUENCE item being set.

- -

 

- -

CAP_PRINTERWRITESEQUENCEMESSAGE

- -

                                                                -Custom: 3520/4500/5000/7000/i200/i600/i700/i800/i1400/i1800/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed: TWTY_STR32

- -

                                                                -Default: #n, where n is the message number

- -

                                                                --  5000/7000: There are nine of these, -CAP_PRINTERWRITESEQUENCEMESSAGE1 through 9.

- -

                                                                --  3520/4500: There is one of these, -CAP_PRINTERWRITESEQUENCEMESSAGE.

- -

                                                                --  i600/i700/i800/i1800/i5000: There are 6 of these, -CAP_PRINTERWRITESEQUENCEMESSAGE1 through 6.

- -

                                                                --  i200/i1400/i2900/i3000/i4000: There is only one of message, -CAP_PRINTERWRITESEQUENCEMESSAGE1.

- -

                                                                --  The CAP_PRINTERWRITESEQUENCE selects the message number and its position -in the write sequence.

- -

 

- -

CAP_PRINTERWRITESEQUENCEMESSAGEINDEX

- -

                                                                -Custom: i200/i600/i700/i1400/i1800

- -

                                                                -Allowed:  i200/i1400:    1

- -

                                                                                -i600/i700/i1800:    1 - 6

- -

                                                            -    Default: 1

- -

                                                                --  Selects the write sequence message.

- -

                                                                -- This is a read-only capability.

- -

 

- -

CAP_PRINTERWRITESEQUENCESPACE

- -

                                                                -Custom: 5000/7000 Series

- -

                                                                -Allowed: 1 - 38

- -

                                                                -Default: 1

- -

                                                                --  Selects the number of blanks to print at the location selected by -CAP_PRINTERWRITESEQUENCE.

- -

 

- -

CAP_PRINTERWRITESEQUENCESPACESTRING

- -

                                                                -Custom: 5000/7000 Series

- -

                                                                -Allowed: TWTY_STR255

- -

                                                                --  Selects the write sequence count of spaces.

- -

 

- -

CAP_PRINTERWRITESEQUENCESTRING

- -

                                                                -Custom: 5000/7000/i200/i600/i700/i800/i1400/i1800/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed: TWTY_STR255

- -

                                                                --  Selects the write sequence.

- -

 

- -

CAP_PROFILES                                     -Custom: i600/i700/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: TWPO_UNKNOWN, TWPO_DEFAULT, TWPO_FILE01 - 60

- -

                                                                -Default: (determined from the scanner)

- -

                                                                -- THIS IS DEPRECATED TWAIN 10.X+. DAT_PROFILES SHOULD BE USED INSTEAD.

- -

-  -Allows the application to select the profile.  Applications should only -try to set the TWPO_FILE values.  See the DAT_PROFILES operation for a way -to map the display strings to the various CAP_PROFILES values.

- -

 

- -

CAP_REACQUIREALLOWED                 -Unsupported.

- -

 

- -

CAP_REWINDPAGE                               -Unsupported.

- -

 

- -

CAP_SERIALNUMBER                           -Stanard:  All Models -(except for 5000/7000/9000)

- -

                                                                -Allowed: Up to 8 characters

- -

                                                                -Default: (none)

- -

                                                                --  This is a read-only capability.

- -

 

- -

CAP_SIDESDIFFERENT                          Custom: -i600/i700/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  -When this is TRUE the user can set different values for the front and rear -camera. Setting this to FALSE will copy all the front settings to the rear for -the current camera.

- -

This will automatically change to TRUE when the front and -rear no longer match. Note: a value of TRUE does NOT imply that the sides are -different (e.g. if everything matches and this is set to TRUE)

- -

 

- -

CAP_SIMULATING                                -Custom: i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  -Simulate the scanner.

- -

 

- -

CAP_SUPPORTEDCAPS                       -Standard: All Models

- -

                                                                -Allowed: All supported capabilities named in this document

- -

                                                                -Default: (same as allowed)

- -

-  -This is a read-only capability.

- -

 

- -

CAP_SUPPORTEDSIZES                      -Standard: All Models

- -

                                                                -Allowed:  i30/i40/i55/i65/i900/i1100/i1200/i1300/i1400:    -ISO A4 - A7, B5 - B7, C5 - C7; JIS B5 - B8;

- -

                                                                                                                                                    -Legal, Letter, Executive and Statement; TWSS_NONE

- -

                                                                                -i100/i200/i600/i700/i800/i1800/i2000/i2900/i3000/i4000/i5000:     -ISO A3 - A7, B4 - B7, C4 - C7; JIS B4 - B8;

- -

-US Ledger, Legal, Letter, Executive and Statement;

- -

-TWSS_NONE

- -

                                                                                -Other:                          -          ISO A3 - A10, B4 - B10, -C4 - C10; JIS B4 - B10; US Ledger, Legal,      

- -

                                                                                                                                -Letter, Executive and Statement; TWSS_NONE

- -

                                                                -Default: Letter for U.S., ISO A4 for Metric

- -

-  If -ICAP_FRAMES or DAT_IMAGELAYOUT are set, then this capability will revert to -TWSS_NONE.

- -

 

- -

CAP_THUMBNAILSENABLED               -Unsupported.

- -

 

- -

CAP_TIMEBEFOREFIRSTCAPTURE      -Unsupported.

- -

 

- -

CAP_TIMEBETWEENCAPTURES          -Unsupported.

- -

 

- -

CAP_TIMEDATE                                    -Standard: All Models

- -

                                                                -Allowed: TW_STR32 of the form YYYY/MM/DD HH:MM:SS.sss

- -

                                                                -Default: (none)

- -

-  -For reasons of efficiency the Source does not use the scanner clock to supply -this time for the 3000/4000 Series, but instead uses the Host computer's -clock.  This may be changed in future.

- -

 

- -

CAP_TOGGLEPATCH -                          -Custom: i280/i600/i700/i800/i1400/i1800/i3000/i4000/i5000

- -

                                                                -Allowed: TWTP_DISABLED, TWTP_BOTHSIDE, TWTP_FRONTSIDE (except i600/i700), -TWTP_SAMESIDE, TWTP_DETECTONLY

- -

                                                                -Default: TWTP_DISABLED

- -

-  -Controls recognition of the color patch.

- -

-  -For i1800 when in IA mode TWTP_SAMESIDE is unsupported, otherwise -TWTP_FRONTSIDE is unsupported

- -

 

- -

CAP_TRANSPORTAUTOSTART           -Custom: All Models (except for i30/i40/i55/i65/3000/4000/5000/7000/9000)

- -

                                                                -Allowed: i900/i1100/i1200/i1300/i1400/i2000 TRUE (readonly)

- -

                                                                               -Other FALSE, TRUE

- -

                                                                -Default: i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000 TRUE

- -

                                                                             -Other FALSE

- -

-  If -set to TRUE the scanner will automatically begin scanning.  If FALSE the -user must press the start button on the scanner console to begin scanning.

- -

 

- -

CAP_TRANSPORTTIMEOUT                 -Custom: All Models (except for 5000/7000/9000)

- -

                                                                -Allowed i30/i40/i55/i65:                            -1 - 30 seconds

- -

                                                                -Allowed 3000/4000/i100/i200:                  -3 - 30 seconds

- -

                                                                -Allowed i600/i700/i1100/i1200/i1300/i1400/i1800:    -0 (disabled), 1 - 300 seconds

- -

                                                                -Allowed i800:                                            0 (disabled), 5 - 300 seconds

- -

                                                                -Allowed i900/i2000/i2900/i3000/i4000/i5000: 0 -(disabled), 1 - 120 seconds

- -

                                                                -Default i30/i40/i55/i65/i1100/i1200/i1300: 1

- -

                                                                -Default i2900/i3000/i4000/i5000:              5

- -

                                                                -Default 3000/4000/i100/i200/i1400:           -8

- -

                                                                -Default i600/i700/i1800: -                 -         15

- -

                                                                -Default i800:                                             10

- -

                                                                -Default i900/i2000:                                     0

- -

-  -This controls the number of seconds the scanner transport will attempt to feed -paper before it times out and stops.  The 8xx modules will then apply the -timeout response.  The 3xxx/4xxx unconditionally end the session (see -CAP_FEEDERKEEPALIVE).

- -

 

- -

CAP_TRANSPORTTIMEOUTRESPONSE

- -

                                                                -Custom: All Models (except for i30/i40/i55/i65/3000/4000/5000/7000/9000)

- -

                                                                -Allowed i600/i700/i800/i1800/i2900/i3000/i4000/i5000: -TWTR_STOPFEEDER, TWTR_ENDOFJOB

- -

                                                                -Allowed i900/i1100/i1200/i1300/i1400/i2000: -TWTR_ENDOFJOB

- -

                                                                -Default i600/i700/i800/i1800: TWTR_STOPFEEDER

- -

                                                                -Default i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000: -TWTR_ENDOFJOB

- -

                                                                --  Determines the action taken when the scanner transport times out.

- -

 

- -

CAP_UICONTROLLABLE                      -Standard: All Models (Except for i2000/i4000/i5000)

- -

                                                                -Allowed: TRUE

- -

                                                                -Default: TRUE

- -

- - This is a read-only capability.

- -

 

- -

CAP_ULTRASONICSENSITIVITY          -Custom: i100/i200/i600/i700/i800/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000 Series

- -

                                                                -Allowed: TWUSS_DISABLED, TWUSS_LOW, TWUSS_MEDIUM, TWUSS_HIGH

- -

                                                                -Default: TWUSS_DISABLED

- -

                                                                --  Controls the use and sensitivity of the ultrasonic multifeed -detection system.

- -

  

- -

CAP_ULTRASONICSENSORCENTER    Custom: -i600/i700/i1800/i4000/i5000 Series

- -

                                                                -Allowed i600/i700/i1800/i4000: TWUO_DISABLED, -TWUO_ENABLED

- -

                                                                -Allowed i5000: TWUO_DISABLED, TWUO_ENABLED, TWUO_IGNOREZONE

- -

                                                                -Default: TWUO_ENABLED

- -

                                                                --  Controls  the center ultrasonic multifeed -detection sensor.

- -

                                                               - -  If the current value is set to -TWUO_IGNOREZONE then the height of the area to be ignored is controlled by

- -

                                                                -CAP_ULTRASONICSENSORZONEHEIGHT.

- -

 

- -

CAP_ULTRASONICSENSORLEFT         -Custom: i600/i700/i1800/i4000/i5000 Series

- -

                                                                -Allowed i600/i700/i1800/i4000: TWUO_DISABLED, TWUO_ENABLED

- -

                                                                -Allowed i5000: TWUO_DISABLED, TWUO_ENABLED, TWUO_IGNOREZONE

- -

                                                                -Default i600/i700/i1800/i4000: TWUO_ENABLED

- -

                                                                -Default i5000: -TWUO_DISABLED

- -

                                                                --  Controls  the left ultrasonic multifeed -detection sensor.

- -

                                                                --  If the current value is set to TWUO_IGNOREZONE then the height of the -area to be ignored is controlled by

- -

                                                                -CAP_ULTRASONICSENSORZONEHEIGHT.

- -

 

- -

CAP_ULTRASONICSENSORLEFTCENTER

- -

    -                                                            -Custom: i5000 Series

- -

                                                                -Allowed TWUO_DISABLED, TWUO_ENABLED, TWUO_IGNOREZONE

- -

                                                                -Default: TWUO_ENABLED

- -

                                                                --  Controls  the left center ultrasonic multifeed -detection sensor.

- -

                                                                --  If the current value is set to TWUO_IGNOREZONE -then the height of the area to be ignored is controlled by

- -

                                                                -CAP_ULTRASONICSENSORZONEHEIGHT.

- -

 

- -

CAP_ULTRASONICSENSORRIGHT       -Custom: i600/i700/i1800/i4000/i5000 Series

- -

                                                                -Allowed i600/i700/i1800/i4000: TWUO_DISABLED, -TWUO_ENABLED

- -

                                                                -Allowed i5000: TWUO_DISABLED, TWUO_ENABLED, TWUO_IGNOREZONE

- -

                                                                -Default i600/i700/i1800/i4000: TWUO_ENABLED

- -

                                                                -Default i5000: -TWUO_DISABLED

- -

                                                                --  Controls  the right  ultrasonic multifeed -detection sensor.

- -

                                                                --  If the current value is set to -TWUO_IGNOREZONE then the height of the area to be ignored is controlled by

- -

                                                                -CAP_ULTRASONICSENSORZONEHEIGHT.

- -

 

- -

CAP_ULTRASONICSENSORRIGHTCENTER

- -

                                                                -Custom: i5000 Series

- -

                                                               Allowed: TWUO_DISABLED, -TWUO_ENABLED, TWUO_IGNOREZONE

- -

                                                                -Default: TWUO_ENABLED

- -

                                                                --  Controls  the right center  ultrasonic multifeed -detection sensor.

- -

                                                                --  If the current value is set to -TWUO_IGNOREZONE then the height of the area to be ignored is controlled by

- -

                                                                -CAP_ULTRASONICSENSORZONEHEIGHT.

- -

 

- -

CAP_ULTRASONICSENSORZONEHEIGHT     

- -

                                                                -Custom: i5000 -Series

- -

                                                                -Allowed: Scanner specific

- -

                                                                -Default: Scanner specific

- -

                                                                --  Height of zone for CAP_ULTRASONICSENSOR*s that are set to -TWUO_IGNOREZONE. There is one height that applies to all sensors set to

- -

                                                                -TWUO_IGNOREZONE.

- -

 

- -

CAP_WINDOW                -                       -Custom: i600/i700/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: TWWW_BASE

- -

                                                                -Default: TWWW_BASE

- -

-  -(TBD).

- -

 

- -

CAP_WINDOWCAMERA                        -Custom: i600/i700/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: TWWC_BASE_BITONAL_FRONT, TWWC_BASE_BITONAL_REAR, TWWC_BASE_COLOR_FRONT -and TWWC_BASE_COLOR_REAR

- -

                                                                -Default: TWWC_BASE_BITONAL_FRONT

- -

-  -(TBD).

- -

 

- -

CAP_WINDOWPOSITION                       -Custom: All Models (except for i2000/i2900/i3000/i4000/i5000)

- -

                                                                -Allowed: A TW_FRAME value with valid settings for Top and Left

- -

                                                                -Default: 0 0

- -

-  -This controls the location of the Source's GUI on the user's screen.  Only -the location can be selected, the Right and Bottom values are ignored.

- -

 

- -

CAP_XFERCOUNT                                 -Standard: All Models

- -

                                                                -Allowed: 5000/7000/9000: -1

- -

                                                                -Allowed: Other: -1, 1 to 37267

- -

                                                                -Default: -1

- -

-  -This capability indicates the number of images to scan, not the number of -sheets of paper, so in duplex mode a single sheet of paper generates two -images.

- -

-  -When set to -1 the scanner runs in batch mode.

- -

-  When set to 0 -it will reset to 1 since zero is invalid xfercount.

- -

-  -All models (except for 5000/7000/9000):  For values greater than 0, -the scanner uses page on demand mode so that it can get exactly the number of -images requested.  Please note that in this mode the scanner may scans -each page separately, which could reduce its potential throughput.

- -

-  -See CAP_AUTOSCAN.

- -

 

- -
-
- -

5.       -ICAP_ Capabilites

- -

 

- -

 

- -

ICAP_ADDBORDER                                -Custom: All Models (except for i30/i40/i55/i65/3000/4000/5000/7000/9000)

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  If -set to TRUE a 16-pixel border will be added on all sides of the image.

- -

 

- -

ICAP_AUTOBRIGHT                              -Unsupported.

- -

 

- -

ICAP_AUTOCOLORAMOUNT               -Custom: All Models (except for i30/i40/i55/i65/i200/i800/i900/i1100/3000/4000/5000/7000/9000)

- -

                                                                -Allowed: 1 to 200

- -

                                                                -Default: 1

- -

                                                               - -This capability only available for ICAP_AUTOCOLORCONTENT set to Custom.

- -

 

- -

ICAP_AUTOCOLORCONTENT -             -Custom: All Models (except for i30/i40/i55/i65/i200/i800/i900/i1100/3000/4000/5000/7000/9000)

- -

                                                                -Allowed: None, -Low, Medium, High and Custom

- -

                                                                -Default: None

- -

                                                                -- The documents require amount of color to be saved as color.

- -

 

- -

ICAP_AUTOCOLORTHRERSHOLD       -Custom: All Models (except for i30/i40/i55/i65/i200/i800/i900/i1100/3000/4000/5000/7000/9000)

- -

                                                                -Allowed: 0 to 100

- -

                                                                -Default: i2000/i4000/i5000: 50

- -

                                                                            - Other: 20

- -

                                                               - -This capability only available for ICAP_AUTOCOLORCONTENT set to Custom.

- -

 

- -

ICAP_AUTOMATICBORDERDETECTION

- -

                                                                -Standard: All Models

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: TRUE

- -

                                                                -- Setting is machine dependent with the 3520 (not side selectable)

- -

 

- -

ICAP_AUTOMATICCOLORENABLED   Standard: -i2000/i5000

- -

                                                                -Allowed: TRUE, FALSE

- -

                                                                -Default: FALSE

- -

-   Automatically -detects the pixel type of the image and returns either a color image or a -non-color image.

- -

 

- -

ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE

- -

                                                            -    -Standard: i2000/i5000

- -

                                                                -Allowed: TWPT_BW

- -

                                                                -Default: TWPT_BW

- -

-   Specifies -the non-color pixel type to use when automatic color is enabled.

- -

 

- -

ICAP_AUTOMATICDESKEW                 -Standard: All -Models

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: TRUE

- -

                                                                -- Setting is machine dependent with the 3520 (not side selectable)

- -

 

- -

ICAP_AUTOMATICLENGTHDETECTION

- -

                                                             -   -Standard: i2000/i5000

- -

                                                                -Allowed: TRUE

- -

                                                                -Default: TRUE

- -

-   Controls -the automatic detection of the length of a document.

- -

 

- -

ICAP_AUTOMATICROTATE                Standard: i700/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

                                                                -- If Automatic orthogonal rotation is supported (see Orthogonal Rotation), as -well Auto-crop and Deskew (see Cropping),

- -

                                                                -then the TWAIN feature Automatic Rotate is also -supported (ICAP_AUTOMATICROTATE).

- -

 

- -

ICAP_BACKGROUNDADJUSTAGGRESSIVENESS

- -

                                                                -Custom: i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: -10 to 10

- -

                                                                -Default: 0

- -

- The -background color adjustment aggressiveness.

- -

- Only available for color camera.

- -

 

- -

ICAP_BACKGROUNDADJUSTAPPLYTO

- -

                                                                -Custom: i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: TWBA_ALL,TWBA_NEUTRAL,TWBA_PREDOMINATE

- -

                                                                -Default: TWBA_PREDOMINATE

- -

- The -background color adjustment apply to.

- -

- Only available for color camera.

- -

 

- -

ICAP_BACKGROUNDADJUSTMODE

- -

                                                                -Custom: i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: i1200/i1300/i1400:  TWBS_NONE,TWBS_AUTOMATIC,TWBS_CHANGETOWHITE

- -

                                                                               -Other:                   TWBS_NONE,TWBS_AUTOMATICBASIC,TWBS_AUTOMATIC

- -

                                                                -Default: TWCL_NONE

- -

- The -background smoothing mode.

- -

- Only available for color camera.

- -

 

- -

ICAP_BARCODEDETECTIONENABLED

- -

                                                                -Unsupported.

- -

 

- -

ICAP_BARCODEMAXRETRIES              -Unsupported.

- -

 

- -

ICAP_BARCODEMAXSEARCHPRIORITIES

- -

                                                                -Unsupported.

- -

 

- -

ICAP_BARCODESEARCHMODE            -Unsupported.

- -

 

- -

ICAP_BARCODESEARCHPRIORITIES   Unsupported.

- -

 

- -

ICAP_BARCODETIMEOUT                    -Unsupported.

- -

 

- -

ICAP_BITDEPTH                                    -Standard: All Models

- -

                                                                -Allowed: All allow 1, all allow 24 and 8 (except 3500/3510/3520/i610/i810/i830)

- -

                                                                -Default: 24 if color is supported, otherwise 1 (3590 is 1, i610 -is 8)

- -

-  1 -only for /Camera_Bitonal_Both, /Camera_Bitonal_Top, -/Camera_Bitonal_Bottom (ICAP_PIXELTYPE == TWPT_BW).

- -

-  8 -only for /Camera_Color_Both, /Camera_Color_Top, -/Camera_Color_Bottom (ICAP_PIXELTYPE == TWPT_GRAY).

- -

-  24 -only for /Camera_Color_Both, /Camera_Color_Top, -/Camera_Color_Bottom (ICAP_PIXELTYPE == TWPT_RGB).

- -

-  Please -refer to the ICAP_PIXELTYPE section of faq.htm for more -information.

- -

 

- -

ICAP_BITDEPTHREDUCTION                -Standard: All Models

- -

                                                                -Allowed: TWBR_THRESHOLD and TWBR_HALFTONES. TWBR_DIFFUSION (i600 only)

- -

                                                                -Default: TWBR_HALFTONES

- -

-  -Capability is only available for /Camera_Bitonal_Both, -/Camera_Bitonal_Top and /Camera_Bitonal_Bottom -(ICAP_PIXELTYPE == TWPT_BW).

- -

 

- -

ICAP_BITORDER                                    -Standard: All Models

- -

                                                                -Allowed: TWBO_MSBFIRST

- -

                                                                -Default: (same as allowed)

- -

 

- -

ICAP_BITORDERCODES                        -Standard: All Models

- -

                                                                -Allowed: TWBO_MSBFIRST

- -

                                                                -Default: (same as allowed)

- -

 

- -

ICAP_BRIGHTNESS                               -Standard: i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: -1000 -to -1000 step 20

- -

                                                                -Default: 0

- -

- This capability is only available for /Camera_Color_Both, -/Camera_Color_Top and /Camera_Color_Bottom.

- -

- This is ignored if -ICAP_COLORBRIGHTNESSMODE is set to TWCBR_AUTOMATIC

- -

 

- -

ICAP_CCITTKFACTOR                         -Standard: 3000/4000/5000/7000/9000

- -

                                                                -Allowed: 0 to 255

- -

                                                                -Default: 4

- -

-  Capability -is only available if ICAP_COMPRESSION is set to TWCP_GROUP32D.

- -

 

- -

ICAP_COLORBALANCEAUTOMATICAGGRESSIVENESS        Custom: -i900/i2000/i2900/i3000

- -

                                                                -Allowed: -2 to 2 step 1

- -

                                                                -Default: 0

- -

- Indicates -how aggressive the automatic white balance will be.

- -

- This is only available when ICAP_COLORBALANCEMODE set to -TWCBM_AUTOMATICADVANCED.

- -

 

- -

ICAP_COLORBALANCEBLUE              -Custom: i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: -1000 -to 1000 step 20

- -

                                                                -Default: 0

- -

- Allow -the user to adjust the color balance blue.

- -

- Only available for color camera.

- -

 

- -

ICAP_COLORBALANCEGREEN            -Custom: i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: -1000 -to 1000 step 20

- -

                                                                -Default: 0

- -

- Allow -the user to adjust the color balance green.

- -

- Only available for color camera.

- -

 

- -

ICAP_COLORBALANCEMODE             -Custom: i900/i2000/i2900/i3000/i5000

- -

                                                                -Allowed: i5000:        TWCBM_NONE, -TWCBM_MANUAL

- -

                                                                               -Others:     TWCBM_NONE, -TWCBM_MANUAL, TWCBM_AUTOMATICBASIC, TWCBM_AUTOMATIC

- -

                                                                -Default: i5000:           -TWCBM_NONE

- -

                                                                             -Others:        TWCBM_AUTOMATICBASIC

- -

- Allows -the user to select the method for adjusting the color balance of a color image

- -

- Only available for color camera.

- -

 

- -

ICAP_COLORBALANCERED                 -Custom: i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: -1000 -to 1000 step 20

- -

                                                                -Default: 0

- -

- Allow -the user to adjust the color balance red.

- -

- Only available for color camera.

- -

 

- -

ICAP_COLORBRIGHTNESSMODE        Custom: -i900/i2000/i2900/i3000/i5000

- -

                                                                -Allowed: i5000:        TWCBR_NONE, -TWCBR_MANUAL

- -

                                                                               -Others:     TWCBR_NONE, -TWCBR_MANUAL, TWCBR_AUTOMATICBASIC

- -

                                                                -Default: i5000:          -TWCBR_NONE

- -

                                                                             -Others:       -TWCBR_AUTOMATICBASIC

- -

- Allows -the user to select the method for adjusting the brightness and contrast of a -color or grayscale image

- -

- Only available for color camera.

- -

 

- -

ICAP_COLORSHARPEN                      -Custom: i900/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: 0 - 3

- -

                                                                -Default: 1

- -

-  -Apply sharpening to image - 0 indicates no sharpening. 1 is normal, 2 is more -sharpening, and a value of 3 applies a lot of sharpening.

- -

- Only available for color camera.

- -

 

- -

ICAP_COLORSHARPENING                  -Custom: 3590/4500/i820/i840/i1800

- -

                                                                -Allowed: TWCS_NONE, TWCS_3X3FIRFILTER

- -

                                                                -Default: TWCS_3X3FIRFILTER

- -

-  -Capability is only available for ICAP_PIXELTYPE == TWPT_RGB or TWPT_GRAY.

- -

-  -Capability is only available if ICAP_COMPRESSION is TWCP_JPEG.

- -

 

- -

ICAP_COLORTABLE                             -Custom: All Models (except for 5000/7000/9000/i2000/i2900/i3000/i4000/i5000)

- -

                                                                -Allowed: TWCT_UNKNOWN, TWCT_DEFAULT, TWCT_FILE01 - 60

- -

                                                                -Default: (determined from the scanner)

- -

-  -Allows the application to select the color table.  Applications should -only try to set the TWCT_FILE values.  See the DAT_COLORTABLE operation -for a way to map the display strings to the various ICAP_COLORTABLE values.

- -

 

- -

ICAP_COMPRESSION                           -Standard: All Models

- -

                                                                -Allowed: 3000/4000/5000/7000/9000:    -TWCP_NONE, TWCP_GROUP31D, TWCP_GROUP32D, TWCP_GROUP4, TWCP_JPEG

- -

                                                                               -Other:    -                                  -TWCP_NONE, TWCP_GROUP4, TWCP_JPEG

- -

                                                                -Default: TWCP_NONE

- -

-  TWCP_NONE, -TWCP_GROUP31D, TWCP_GROUP32D, TWCP_GROUP4 only for /Camera_Bitonal_Both, -/Camera_Bitonal_Top and /Camera_Bitonal_Bottom -(ICAP_PIXELTYPE == TWPT_BW).

- -

-  -TWCP_NONE, TWCP_JPEG only for /Camera_Color_Top -(ICAP_PIXELTYPE == TWPT_RGB or TWPT_GRAY).

- -

- Please refer to the -ICAP_COMPRESSION section of faq.htm -for more information.

- -

These applications are -known to not support compression while scanning images (though they may support -it in other areas)...

- -

[NoCompression]

- -

N0=Adobe Adam Adobe Acrobat Scan v1.0

- -

N1=Adobe Systems Inc. -Application Division Photoshop v1.0

- -

N2=Adobe Systems Inc. -Application Division Photoshop v1.31

- -

N3=Eastman Software, -Inc. Imaging for Windows Imaging v3.6

- -

N4=Media Cybernetics, -L.P. Scanning Utilities Microsoft Imager v2.0

- -

N5=Wang Laboratories, -Inc. OPEN/image v3.6

- -

N6=Wang Laboratories, -Inc. OPEN/image Imaging v3.6

- -

N7=Xerox PerfectScan API Scanner Diagnostic v1.0

- -

N8=Adobe Adobe v1.0

- -

These applications are -known to support compression while scanning images. Therefore the GUI will -remember the last user settings for them

- -

[YesCompression]

- -

N0=Kodak Digital -Science Scanner Validation Tool v.*

- -

N1=Kodak Digital -Science TWAIN Test Tool v.*

- -

 

- -

ICAP_CONTRAST                                  -Standard: All Models

- -

                                                                -Allowed: 5000/7000/9000:  -980 to 1000 in steps of -10  

- -

                                                                               -Other:              --1000 to --1000 step 20

- -

                                                                -Default: 5000/7000/9000: 240

- -

                                                                             -Other:                 -0

- -

- For -i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000, the -capability is available for all cameras

- -

- For other scanner, the capability is only available for /Camera_Bitonal_Both, /Camera_Bitonal_Top -and /Camera_Bitonal_Bottom (ICAP_PIXELTYPE == -TWPT_BW)

- -

- This is ignored if -ICAP_COLORBRIGHTNESSMODE is set to TWCBR_AUTOMATIC.

- -

 

- -

ICAP_CROPPINGMODE                         -Custom: All Models (except for 3000/4000/5000/7000/9000)

- -

Allowed i200:         TWCR_AUTOMATICBORDERDETECTION, -TWCR_AGGRESSIVE, TWCR_TRANSPORT, TWCR_DOCUMENT,TWCR_CONTINUOUS

- -

i1400/i3000: -TWCR_AUTOMATICBORDERDETECTION, TWCR_AGGRESSIVE, TWCR_TRANSPORT, -TWCR_DOCUMENT,TWCR_CONTINUOUS, TWCR_PHOTO, TWCR_PHOTOINROI

- -

i4000/i5000: -TWCR_AUTOMATICBORDERDETECTION, TWCR_AGGRESSIVE, TWCR_TRANSPORT, TWCR_DOCUMENT, -TWCR_PHOTO,                         -TWCR_PHOTOINROI

- -

             Other:      TWCR_AUTOMATICBORDERDETECTION, -TWCR_AGGRESSIVE, TWCR_TRANSPORT, TWCR_DOCUMENT

- -

                                                                -Default i200:    TWCR_TRANSPORT. (i280- TWCR_AUTOMATICBORDERDETECTION)

- -

                                                                            -Other: TWCR_AUTOMATICBORDERDETECTION

- -

-  -Specifies the mechanism used to crop the image data.

- -

 

- -

ICAP_CUSTHALFTONE                         -Unsupported.

- -

 

- -

ICAP_DOCUMENTTYPE                        -Custom: i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

Allowed: -TWDT_PHOTO, TWDT_TEXTWITHGRAPHICS, TWDT_TEXTWITHPHOTO, TWDT_TEXT

- -

                                                                -Default: TWDT_TEXTWITHGRAPHIC

- -

- Allows -user to select the type of document being scanned.

- -

 

- -

ICAP_ECDO                                            -Custom: i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: TWCD_UNKNOWN, TWCD_NONE, TWCD_FILE01 - 60

- -

                                                                -Default: None

- -

-  -Allows user to select the ECDO color for bitonal/gray -camera.

- -

 

- -

ICAP_ECDOAGGRESSIVENESS            -Custom: i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: -10 -to 10

- -

                                                                -Default: 0

- -

                                                                -- Change the amount of multi-color dropout applied to a bitonal image..

- -

 

- -

ICAP_ECDOTREATASCOLOR              -Custom: i1400

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  -Allows you to indicate that a color other than black or dark blue ink was used -for the data entered on the form.

- -

This is -not available when ECDO is set to (none). This feature is not available for all -models.

- -

 

- -

ICAP_EXPOSURETIME                          -Unsupported.

- -

 

- -

ICAP_EXTIMAGEINFO                           -Standard: All Models

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: TRUE

- -

                                                                - 

- -

ICAP_FILTER                                         -Unsupported.

- -

 

- -

ICAP_FILTERBACKGROUND                 -Custom: All Models (except for 900/3000/5000/7000/9000/i2000/i2900/i3000/i4000/i5000)

- -

                                                                -Allowed: 0 - 255

- -

                                                                -Default: 245

- -

                                                                --  Capability is only available for TWPT_BW or -(on some systems) TWPT_GRAY.

- -

-  -Selects the grayscale value used to replace the filtered color.

- -

 

- -

ICAP_FILTERENUM                               -Custom: All Models (except for 3000/4000/5000/7000/9000)

- -

                                                                -Allowed: TWFT_NONE, TWFT_RED, TWFT_GREEN, TWFT_BLUE

- -

                                                                -Default: TWFT_NONE

- -

                                                                --  Capability is only available for TWPT_BW or -(on some systems) TWPT_GRAY.

- -

-  -Selects the color that will be filtered.

- -

 

- -

ICAP_FILTERPROCESSING                   -Custom: i600 Series

- -

                                                                -Allowed: TWFP_NORMAL, TWFP_LOWRES

- -

                                                                -Default: TWFP_NORMAL

- -

-  If -color dropout at low resolutions results in unwanted artifacts, try changing -this capability to TWFP_LOWRES

- -

 

- -

ICAP_FILTERTHRESHOLD                    -Custom: All Models (except for 900/3000/5000/7000/9000/i2000/i2900/i3000/i4000/i5000)

- -

                                                                -Allowed: 0 - 255

- -

                                                                -Default: 175

- -

                                                                --  Capability is only available for TWPT_BW or -(on some systems) TWPT_GRAY.

- -

-  -Specified the threshold past which color filtering will be applied.

- -

 

- -

ICAP_FLASHUSED                                 -Unsupported.

- -

 

- -

ICAP_FLASHUSED2                               -Unsupported.

- -

 

- -

ICAP_FLIPBACKGROUNDCOLOR        -Custom: 5000/7000

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  If -TRUE then the background color on the left and right of the image will be -reversed from black to white (or white to black).

- -

 

- -

ICAP_FLIPROTATION                           -Unsupported.

- -

 

- -

ICAP_FORCECOMPRESSION                -Custom: 3000/4000/5000/7000/9000/i600/i700/i800/i1800

- -

                                                                -Allowed: TWCP_NONE, TWCP_GROUP4, TWCP_JPEG

- -

                                                                -Default: TWCP_NONE

- -

-  -Force Compression is ignored if the value of ICAP_COMPRESSION for the same -camera is any value but TWCP_NONE.

- -

-  -TWCP_NONE, TWCP_GROUP4 only for /Camera_Bitonal_Both, -/Camera_Bitonal_Top and /Camera_Bitonal_Bottom -(ICAP_PIXELTYPE == TWPT_BW).

- -

-  -TWCP_NONE, TWCP_JPEG only for /Camera_Color_Both, /Camera_Color_Top and /Camera_Color_Bottom -(ICAP_PIXELTYPE == TWPT_RGB or TWPT_GRAY).

- -

 

- -

ICAP_FOREGROUNDBOLDNESSAGGRESSIVENESS

- -

                                                                -Custom: i2900/i3000

- -

                                                                -Allowed: -10 to 10

- -

                                                                -Default: 0

- -

- The -foreground boldness aggressiveness.

- -

- Only available for color/gray cameras.

- -

- Only has -meaning if ICAP_FOREGROUNDBOLDNESSMODE

- -

is TWFB_AUTOMATIC.

- -

 

- -

ICAP_FOREGROUNDBOLDNESSMODE

- -

                                                                -Custom: i2900/i3000

- -

                                                                -Allowed: TWFB_NONE,TWFB_AUTOMATICBASIC,TWFB_AUTOMATIC

- -

                                                                -Default: TWFB_NONE

- -

- The -foreground boldness mode.

- -

- Only available for color/gray cameras.

- -

 

- -

ICAP_FRAMELENGTHCONTROL          -Custom: 5000/7000 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: TRUE

- -

-  -Set to FALSE if scanning documents that have ragged bottom edges that are not -otherwise scanned properly.

- -

 

- -

ICAP_FRAMES                                       -Standard: All Models

- -

                                                                -Allowed: 1 frame per camera within the boundaries set by the min and max width -and length capabilities

- -

                                                                -Default: the values associated with ICAP_SUPPORTEDSIZES TWSS_ISOA4.

- -

                                                              -  - Please refer to the Width and Length Alignment section of faq.htm for more information.

- -

 

- -

ICAP_FRAMESANGLE                           Custom: -i2000/i2900/i3000/i4000/i5000
-Allowed: 1 frame per camera within the boundaries set by the min and max width -and length capabilities
-Default: the values associated with ICAP_SUPPORTEDSIZES TWSS_ISOA4.
-- This capability is the same as ICAP_FRAMES except it includes angle.

- -

 

- -

ICAP_GAMMA                                       -Unsupported.

- -

 

- -

ICAP_GAMMAENABLED -                      -Custom: i600/i700/i800/i1800/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: TRUE

- -

-  A -value of TRUE causes the scanner to apply its gamma table to the image.  -This only has meaning for the grayscale output.

- -

 

- -

ICAP_GRAYSCALE                               -Custom: All Models (except for 3000/4000/5000/7000/9000)

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default:  FALSE

- -

-    Modifies -the output of the associated color camera to be grayscale content only.

- -

-    Only for /Camera_Color_Both, /Camera_Color_Top -and /Camera_Color_Bottom

- -

-    For i610 -this is read only and TRUE.

- -

-    Please see -the ICAP_PIXELTYPE section of faq.htm.

- -

 

- -

ICAP_HALFTONES                                -Standard: All Models

- -

                                                                -Allowed:  -Auto -ATP                              -iThresholding (All -models except for 3000/4000/5000/7000/9000)

- -

      -                                                                          -Adaptive Thresholding         -ATP

- -

                -        -                                                        -Fixed Thresholding

- -

                -        -                                                        -64-Level Bayer Dither

- -

        -                                                                        -64-Level 45-Degree Cluster Dot

- -

        -                                                                        -64-Level Disperse Dot

- -

        -                                                                        -Error -Diffusion                      -(i800 only)

- -

        -                                                                        -ChromaTHR(TM)                   -(3590/4500 only)

- -

        -                                                                        -Diffusion: 3  -Screen             -(i800 only)

- -

        -                                                                        -Diffusion: 16 Screen            (i800 -only)

- -

        -                                                                        -Diffusion: 32 -Screen            (i800 -only)

- -

        -                                                                        -Diffusion: 64 Screen            (i800 -only)

- -

        -                                                                        -Diffusion: 4  Bayer    -           (i800 -only)

- -

        -                                                                        -Diffusion: 16 Bayer    -          (i800 only)

- -

        -                                                                        -Diffusion: 64 Bayer   -           (i800 -only)

- -

        -                                                                        -3-Level Screen

- -

        -                                                                        -16-Level Screen

- -

        -                                                                        -32-Level Screen

- -

        -                                                                        -64-Level Screen

- -

                -        -                                                        -4-Level Bayer Dither

- -

                -        -                                                        -16-Level Bayer Dither

- -

                                                                               - i600/i700/i900/i1100/i1200/i1300/i1400/i1800/i2900/i3000/i4000/i5000:   

- -

-Auto -ATP                              -iThresholding

- -

      -                                                                                                            -Adaptive Thresholding         -ATP

- -

                -        -                                                                                          -Fixed Thresholding

- -

                                                                -Default:   3000/4000/5000/7000/9000:   "Adaptive Thresholding"

- -

                                                                                - Other:                                  -Auto ATP

- -

-  -Halftones are not easily represented within TWAIN since the number of -algorithms is too large and varied to accommodate any simple system of -classification.  To properly represent halftones an application must -present the array of TW_STR32s to the user as-is, with no attempt at interpreting -the data.

- -

-  -Capability is only available for /Camera_Bitonal_Both, -/Camera_Bitonal_Top and /Camera_Bitonal_Bottom -(ICAP_PIXELTYPE == TWPT_BW).

- -

 

- -

ICAP_HALFTONESQUALITY                 -Custom: 3590/4500 Series

- -

                                                                -Allowed (no THR2(tm) card): TWHQ_SOFTWAREFAST, TWHQ_SOFTWAREBEST

- -

                                                                -Allowed (THR2(tm) card): TWHQ_HARDWAREBEST

- -

                                                                -Default (no THR2(tm) card): TWHQ_SOFTWAREFAST

- -

                                                                -Default (THR2(tm) card): TWHQ_HARDWAREBEST

- -

-  -Determiners the ChromaTHR(tm) algorithm to be used to -binarize the color data from the scanner.

- -

 

- -

ICAP_HIGHLIGHT                                  -Unsupported.

- -

 

- -

ICAP_HOLEFILLENABLED                    -Custom: i1200/i1300/i2000/i2900/i3000

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

                                                                -- Hole Fill enabled/disabled. If TRUE, then remove punch holes in the original document from the -resultant image.

- -

 

- -

ICAP_IMAGEDATASET                         -Unsupported.

- -

  

- -

ICAP_IMAGEEDGEBOTTOM                 -Custom: i30/i40/i55/i65/i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000

- -

                                                                -Allowed: 0 to ICAP_PHYSICALHEIGHT

- -

                                                                -Default: 0

- -

-  -Amount of fill for the bottom edge of the image.

- -

 

- -

ICAP_IMAGEEDGEFILL                         -Custom: i30/i40/i55/i65/i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000

- -

                                                                -Allowed: TWIE_NONE, -TWIE_AUTOMATIC, TWIE_AUTOMATICWITHTEAR, TWIE_WHITE, TWIE_BLACK

- -

                                                                -Default: TWIE_AUTOMATIC if the scanner is supported. Otherwise TWIE_NONE is the -default

- -

-  -Fill in each edge of the image with the selected color.

- -

- The TWIE_AUTOMATIC -and TWIE_AUTOMATICWITHTEAR are not available for all scanners.

- -

 

- -

ICAP_IMAGEEDGEFILLALLSIDES        -Custom: i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000

- -

                                                                -Allowed: TRUE/FALSE

- -

                                                                -Default: TRUE

- -

Amount of fill for the -all size the same as top edge of the image.

- -

 

- -

ICAP_IMAGEEDGELEFT                        -Custom: i30/i40/i55/i65/i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000

- -

                                                                -Allowed: 0 to ICAP_PHYSICALWIDTH

- -

                                                                -Default: 0

- -

-  -Amount of fill for the left edge of the image.

- -

 

- -

ICAP_IMAGEEDGERIGHT                      -Custom: i30/i40/i55/i65/i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000

- -

                                                                -Allowed: 0 to ICAP_PHYSICALWIDTH

- -

                                                                -Default: 0

- -

-  -Amount of fill for the right edge of the image.

- -

 

- -

ICAP_IMAGEEDGETOP          -               -Custom: i30/i40/i55/i65/i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000

- -

                                                                -Allowed: 0 to ICAP_PHYSICALHEIGHT

- -

                                                                -Default: 0

- -

-  -Amount of fill for the top edge of the image.

- -

 

- -

ICAP_IMAGEFILEFORMAT                   -Standard: All Models

- -

                                                                -Allowed: TWFF_BMP, TWFF_TIFF, TWFF_JFIF

- -

                                                                -Default: TWFF_BMP

- -

-  -TWFF_BMP, TWFF_TIFF only for /Camera_Bitonal_Both, /Camera_Bitonal_Top and /Camera_Bitonal_Bottom -(ICAP_PIXELTYPE == TWPT_BW).  If compression is used then only TWFF_TIFF -is allowed.

- -

-  -TWFF_BMP, TWFF_TIFF, TWFF_JFIF only for /Camera_Color_Both, -/Camera_Color_Top and /Camera_Color_Bottom -(ICAP_PIXELTYPE == TWPT_RGB or TWPT_GRAY).  If compression is used then -only TWFF_TIFF and TWFF_JFIF are allowed.

- -

-  -TWFF_TIFF uses the following tags: NewSubFileType, SubFileType, ImageWidth, ImageLength, BitsPerSample, -Compression, PhotometricInterpretation, FillOrder, StripOffsets, SamplesPerPixel, RowsPerStrip, StripByteCounts, XResolution, YResolution, T4Options, T6Options, ResolutionUnits.

- -

-  -Please note, TWFF_TIFF with an ICAP_COMPRESSION of TWCP_JPEG results in a JPEG -TIFF file, which is still currently not a well defined or supported format (the -Source is currently following the TIFF 7 guidelines).

- -

 

- -

ICAP_IMAGEFILTER                              -Standard: All Models (except for 3000/4000)

- -

                                                                -Allowed: TWIF_NONE, TWIF_LOWPASS

- -

                                                                -Default: TWIF_NONE

- -

                                                                --  Capability is only available for /Camera_Bitonal_Both, /Camera_Bitonal_Top -and /Camera_Bitonal_Bottom (ICAP_PIXELTYPE == -TWPT_BW).

- -

 

- -

ICAP_IMAGEMERGE                              Standard: -i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000

- -

                                                                -Allowed: TWIM_NONE, TWIM_FRONTONTOP, TWIM_FRONTONBOTTOM, TWIM_FRONTONLEFT, -TWIM_FRONTONRIGHT

- -

                                                                -Default: TWIM_NONE

- -

                                                                --  Merges the front and back images into a single image that is returned -to the application.

- -

 

- -

ICAP_IMAGEMERGEHEIGHTTHRESHOLD    

- -

                                                                -Unsupported.

- -

  

- -

ICAP_JPEGPIXELTYPE                         -Standard: All Models (except for 5000/7000/9000)

- -

                                                                -Allowed: TWPT_YUV

- -

                                                                -Default: TWPT_YUV

- -

-    Capability -is only available for ICAP_PIXELTYPE == TWPT_RGB or TWPT_GRAY and -ICAP_COMPRESSION == TWCP_JPEG.

- -

 

- -

ICAP_JPEGQUALITY                             -Standard: All Models (except for 5000/7000/9000)

- -

                                                                -Allowed: 0 to 100 in steps of 5

- -

                                                                -Default: 50

- -

-  -This is TWAIN 1.9 capability.

- -

-  -Generally speaking, selecting higher values will result in better quality at the -cost of larger compressed JPEG files.

- -

 

- -

ICAP_LAMPSAVER                               -Custom: 3000/4000/i800 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: TRUE

- -

-  -This is a custom capability.

- -

-  -Turning this capability on will allow the scanner to turn off the lamps after -ten minutes of inactivity, which extends lamp life and reduces energy -consumption.

- -

 

- -

ICAP_LAMPSTATE                               -Unsupported.

- -

 

- -

ICAP_LAMPTIMEOUT                           -Custom: 3000/4000/i800 Series

- -

                                                                -Allowed 3000/4000: 0 (disabled), 10

- -

                                                                -Allowed i800: 0 (disabled) - 30

- -

                                                                -Default 3000/4000: 10

- -

                                                                -Default i800: 20

- -

-  -This is a custom capability.

- -

-  -Turning this capability on will allow the scanner to turn off the lamps after -ten minutes of inactivity, which extends lamp life and reduces energy -consumption.

- -

 

- -

ICAP_LIGHTPATH                                 -Unsupported.

- -

 

- -

ICAP_LIGHTSOURCE                            -Unsupported.

- -

 

- -

ICAP_MAXFRAMES                              -Standard: All Models (Except for i2000/i2900/i3000/i4000/i5000)

- -

                                                                -Allowed: 1

- -

                                                                -Default: 1

- -

-  -This is a read-only capability.

- -

 

- -

ICAP_MEDIATYPE                                 -Standard: i900/i1100/i1200/i1300/i1400/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: TWMT_CARDSTOCK, TWMT_GLOSSYPAPER, TWMT_MAGAZINE, -TWMT_PLAINPAPER, TWMT_THINPAPER

- -

                                                                -Default: TWMT_PLAINPAPER

- -

- Allows -user to select type of media being scanned. The front and rear camera setting -must be the same.

- -

 

- -

ICAP_MINIMUMHEIGHT                        -Standard: All Models

- -

                                                                -Allowed: 3000/4000/5000/7000/9000/i800:          -2.5"

- -

                                                                               -Other:                                                    -1                                              -

- -

                                                                -Default: (same as allowed)

- -

-  -This is a read-only capability.

- -

 

- -

ICAP_MINIMUMWIDTH                         -Standard: All Models

- -

                                                               Allowed: -3000/4000/5000/7000/9000/i800:          -2.5"

- -

                                                                              -Other:                                                    -1 

- -

                                                                -Default: (same as allowed)

- -

-  -This is a read-only capability.

- -

 

- -

ICAP_NOISEFILTER                               -Standard: All Models

- -

                                                                -Allowed: TWNF_NONE, TWNF_LONEPIXEL, TWNF_MAJORITYRULE

- -

                                                                -Default: i2000/i2900/i3000/i4000/i5000: TWNF_LONEPIXEL

- -

                                                                             -Other: TWNF_NONE

- -

                                                                -   

- -

                                                                --  Capability is only available for /Camera_Bitonal_Both, /Camera_Bitonal_Top -and /Camera_Bitonal_Bottom (ICAP_PIXELTYPE == -TWPT_BW).

- -

                                                                --  TWNF_MAJORITYRULE is not available on the 9xxx Series.

- -

 

- -

ICAP_ORIENTATION                              -Standard: All Models

- -

                                                                -Allowed: TWOR_PORTRAIT, TWOR_LANDSCAPE

- -

                                                                -Default: TWOR_PORTRAIT

- -

-  -Please note, that as per the specification, ICAP_ORIENTATION does not change -the values of ICAP_FRAMES or DAT_IMAGELAYOUT.  What it does is affect the -interpretation of these values at the time they are downloaded to the -device.  TWOR_PORTRAIT leaves them unmodified.  TWOR_LANDSCAPE flips -the x and y offsets and the width and height.  If ICAP_SUPPORTEDSIZES is -not equal to TWSS_NONE, then the x-offset will be recalculated to center the -landscaped image.

- -

 

- -

ICAP_ORTHOGONALROTATE               Custom: -i2000/i2900/i3000/i5000

- -

Allowed: -TWOROT_NONE, TWOROT_AUTOMATIC, TWOROT_90, TWOROT_180, TWOROT_270,

- -

                -TWOROT_AUTOMATIC_90, TWOROT_AUTOMATIC_180, -TWOROT_AUTOMATIC_270

- -

                                                                -Default: TWOROT_NONE

- -

- Orthogonal -rotation.

- -

 

- -

ICAP_OVERSCAN                                  -Standard: All Models (except for 5000/7000/9000)

- -

                                                                -Allowed: TWOV_NONE, TWOV_TOPBOTTOM, TWOV_LEFTRIGHT, TWOV_ALL

- -

                                                                -Default: TWOV_NONE

- -

 

- -

ICAP_OVERSCANX                               -Custom: All Models (except for 5000/7000/9000)

- -

                                                                -Allowed: see below

- -

                                                                -Default: 0.5" or 0.375"

- -

-  -This capability controls the amount of overscan to -add on the left and right sides of the frame.

- -

-  -3500  supports 0 to 0.5"

- -

-  -All others support 0 to 0.375"

- -

 

- -

ICAP_OVERSCANY                               -Custom: All Models (except for 5000/7000/9000)

- -

                                                                -Allowed: see below

- -

                                                                -Default: 0.5" or 0.375"

- -

-  -This capability controls the amount of overscan to -add on the top and bottom sides of the frame.

- -

-  -3500 supports 0 to 0.5"

- -

-  -All others support 0 to 0.375"

- -

 

- -

ICAP_PATCHCODEDETECTIONENABLED

- -

                                                                -Standard: i800/i1800 Series

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

                                                                -- If TRUE then the requested patch codes will be detected by the scanner.

- -

 

- -

ICAP_PATCHCODEMAXRETRIES         -Standard: i800/i1800 Series

- -

                                                                -Allowed: 1

- -

                                                                -Default: 1

- -

                                                                -- Maximum retries allowed.

- -

                                                                -- This is a read-only capability.

- -

 

- -

ICAP_PATCHCODEMAXSEARCHPRIORITIES

- -

                                                                -Standard: i800/i1800 Series

- -

                                                                -Allowed: 5

- -

                                                                -Default: 5

- -

                                                                -- Number kinds of patch codes detected.

- -

                                                               -- This is a read-only capability.

- -

 

- -

ICAP_PATCHCODESEARCHMODE       -Standard: i800/i1800 Series

- -

                                                                -Allowed: TWBD_VERT

- -

                                                                -Default: TWBD_VERT

- -

                                                                -- Orientation of the patch codes.

- -

                                                                -- This is a read-only capability.

- -

 

- -

ICAP_PATCHCODESEARCHPRIORITIES

- -

                                                                -Standard: i800/i1800 Series

- -

                                                                -Allowed: TWPCH_PATCH1, TWPCH_PATCH2,  TWPCH_PATCH3, TWPCH_PATCH4,

- -

                                                                -  TWPCH_PATCH6, TWPCH_PATCHT2, TWPCH_PATCHT3

- -

                                                                -Default: TWPCH_PATCH2

- -

                                                                -- Patch codes we are searching for.

- -

 

- -

ICAP_PATCHCODETIMEOUT               -Standard: i800/i1800 Series

- -

                                                                -Allowed: 1

- -

                                                                -Default: 1

- -

                                                                -- Amount of time till attempt fails.

- -

                                                                -- This is a read-only capability.

- -

 

- -

ICAP_PHYSICALHEIGHT                       -Standard: All Models

- -

                                                                -Allowed   3000/4000: 26"

- -

                                                                                -5000/7000/9000/i800: 30"

- -

                                                                                -i30/i40: 14.27 or 34''

- -

                                                                -                -i100: 17" w/ 64MB or 128MB, -32" w/ more

- -

                                                                -                -i200: 17" w/ 64MB, 26 w/ 128MB, 32" w/ more or 34'' w/ Long -Document

- -

                                                                -                -i55/i65/i600/i700/i1100/i1200/i1300/i1400/i1800: 34

- -

                                                                                -Other: Scanner specific

- -

                                                                -Default: (same as allowed)

- -

-  -This is a read-only capability.

- -

-  -The driver captures some extra data to reduce clipping, see the product -specification for more information on the scanning dimensions.

- -

 

- -

ICAP_PHYSICALHEIGHTADJUST         Custom: -i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: Scanner specific

- -

                                                                -Default: Scanner specific

- -

Adjusts the value of -ICAP_PHYSICALHEIGHT. Applications must set this value to have access to the -full scan length of the ADF.

- -

 

- -

ICAP_PHYSICALWIDTH                        -Standard: All Models

- -

                                                                -Allowed  i30/i40: 8.767

- -

                                                                               - i55/i65: 8.64''

- -

                                                                                -i1200/i1300: 8.75''

- -

                                                                                -i1100: 8.76''

- -

                                                                                -Other: 12"

- -

                                                                -Default: (same as allowed)

- -

-  -This is a read-only capability.

- -

-  -The driver captures some extra data to reduce clipping, see the product -specification for more information on the scanning dimensions.

- -

 

- -

ICAP_PIXELFLAVOR                             -Standard: All Models

- -

                                                                -Allowed: TWPF_CHOCOLATE, TWPF_VANILLA

- -

                                                                -Default: TWPF_CHOCOLATE

- -

-  -This capability is supported for ICAP_PIXELTYPE == TWPT_RGB or TWPT_GRAY since -it is a required capability in the TWAIN specification, but in the case of the -color camera, the value is ignored.

- -

 

- -

ICAP_PIXELFLAVORCODES                 -Standard: All Models

- -

                                                                -Allowed: TWPF_CHOCOLATE, TWPF_VANILLA

- -

                                                                -Default: TWPF_CHOCOLATE

- -

-  -Specifies whether the compressed codes pixel sense will be inverted from the -Current value of ICAP_PIXELFLAVOR prior to transfer

- -

-    Capability -is only available for ICAP_PIXELTYPE == TWPT_BW and ICAP_COMPRESSION ==TWCP_GROUP4.

- -

 

- -

ICAP_PIXELTYPE                                  -Standard: All Models

- -

                                                                -Allowed: TWPT_BW, TWPT_RGB, TWPT_GRAY

- -

                                                                -Default: TWPT_BW prior to 4.x, after 4.x TWPT_RGB for color cameras, TWPT_BW -for bitonal cameras.

- -

-  -TWPT_BW only for /Camera_Bitonal_Both, /Camera_Bitonal_Top and /Camera_Bitonal_Bottom -(ICAP_PIXELTYPE == TWPT_BW).

- -

-  -TWPT_RGB only for /Camera_Color_Both, /Camera_Color_Top and /Camera_Color_Bottom -(ICAP_PIXELTYPE == TWPT_RGB or TWPT_GRAY).

- -

-  -Prior to 4.x, changing ICAP_PIXELTYPE is the same as using DAT_FILESYSTEM / -MSG_CHANGEDIRECTORY to select between the /Camera_Bitonal_Both -and /Camera_Color_Both cameras.

- -

-    TWPT_RGB -is not available for i610.  Default for this model is TWPT_GRAY.

- -

-  -Please see the ICAP_PIXELTYPE section of faq.htm.

- -

 

- -

ICAP_PLANARCHUNKY                        -Standard: All Models

- -

                                                                -Allowed: TWPC_PLANAR, TWPC_CHUNKY

- -

                                                                -Default: TWPC_CHUNKY

- -

-  -This is kind of a weird capability for a pixel type of TWPT_BW to have to worry -about, but this is listed as a mandatory capability, so here it is.

- -

-  -TWPC_PLANAR or TW_PC_CHUNKY for /Camera_Bitonal_Both, -/Camera_Bitonal_Top and /Camera_Bitonal_Bottom -(ICAP_PIXELTYPE == TWPT_BW).

- -

-  -TW_PC_CHUNKY only for /Camera_Color_Both, /Camera_Color_Top and /Camera_Color_Bottom -(ICAP_PIXELTYPE == TWPT_RGB and ICAP_PIXELTYPE == TWPT_GRAY).

- -

 

- -

ICAP_ROTATION                                   -Standard: All Models (except for i30/i40/i55/i65/3000/4000/5000/7000/9000)

- -

                                                                -Allowed:  0, 90, 180, 270, 360 (except i600)

- -

                                                                -Default:    0

- -

 

- -

ICAP_SHADOW                                      -Unsupported.

- -

 

- -

ICAP_SKEWANGLE                               -Custom: i900/i1100/i1200/i2900/i3000/i1300/i1400/i2000/i4000/i5000

- -

                                                                -Allowed: -360000 -- 360000

- -

                                                                -Default: 0

- -

                                                                -- Selects the deskew angle for fixed cropping.

- -

 

- -

ICAP_STREAKREMOVALAGGRESSIVENESS

- -

                                                            -    Custom: i1200/i1300/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: -2 -to 2

- -

                                                                -Default: 0

- -

                                                                -- Streak removal aggressiveness level. -2 is least aggressive while 2 is -most aggressive.

- -

                                                                -- The aggressiveness level is meaningless if streak -removal enabled is FALSE.

- -

 

- -

ICAP_STREAKREMOVALENABLED     Custom: i1200/i1300/i2000/i2900/i3000/i4000/i5000

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: i1200/i1300: FALSE

- -

                                                                             -Other: TRUE

- -

                                                                -- Streak Removal enabled/disabled. If TRUE, then the streak removal -aggressiveness level has meaning.

- -

 

- -

ICAP_SUPPORTEDBARCODETYPES

- -

                                                                -Unsupported.

- -

 

- -

ICAP_SUPPORTEDEXTIMAGEINFO      -Standard: i2000/i2900/i3000/i5000

- -

                                                                -Allowed: All supported extended image info

- -

                                                                -Default: (same as allowed)

- -

                                                                -- Lists all of the information that the Source is capable of returning from a -call to DAT_EXTIMAGEINFO

- -

                                                                -- This is a read-only capability.

- -

 

- -

ICAP_SUPPORTEDPATCHCODETYPES

- -

                                                                -Standard: i800/i1800 Series

- -

                                                                -Allowed: TWPCH_PATCH1, TWPCH_PATCH2,  TWPCH_PATCH3, TWPCH_PATCH4,

- -

                                                                -  TWPCH_PATCH6, TWPCH_PATCHT2, TWPCH_PATCHT3

- -

                                                                -- This is a read only capability.

- -

 

- -

ICAP_THRESHOLD                                -Standard: All Models

- -

                                                                -Allowed: 0 to 255

- -

                                                                -Default: 90

- -

                                                                --  Capability is only available for /Camera_Bitonal_Both, /Camera_Bitonal_Top -and /Camera_Bitonal_Bottom (ICAP_PIXELTYPE == -TWPT_BW).

- -

 

- -

ICAP_TILES                                           -Unsupported.

- -

 

- -

ICAP_TIMEFILL                                     -Unsupported.

- -

 

- -

ICAP_UNDEFINEDIMAGESIZE               -Standard: All Models (Except for i2000/i2900/i3000/i4000/i5000)

- -

                                                                -Allowed: FALSE, TRUE

- -

                                                                -Default: FALSE

- -

-  -There is no performance benefit from setting this value to TRUE.

- -

 

- -

ICAP_UNITS                                           -Standard: All Models

- -

                                                                -Allowed: TWUN_INCHES, TWUN_CENTIMETERS, TWUN_PICAS, TWUN_POINTS, TWUN_TWIPS, -TWUN_PIXELS

- -

-  It -is advised that ICAP_UNITS be set to TWUN_PIXELS any time the Application -desires to know the exact dimensions of an image.

- -

-  -Selecting TWUN_PIXELS will cause ICAP_XRESOLUTION, ICAP_YRESOLUTION, -ICAP_XNATIVERESOLUTION and ICAP_YNATIVERESOLUTION to report their values as -percentages up from the smallest resolution supported by the current camera.  -For instance, if the current camera supported 200 and 300 DPI, it will report -1.0 and 1.5 when in TWUN_PIXELS.

- -

 

- -

ICAP_XFERMECH                                  -Standard: All Models

- -

                                                                -Allowed: TWSX_NATIVE, TWSX_FILE, TWSX_MEMORY

- -

                                                                -Default: TWSX_NATIVE

- -

-  -The Source is designed so that TWSX_MEMORY is the most efficient transfer -available.  All performance benchmarks apply to this transfer mechanism, -and may be less with the other options.

- -

-  -TWSX_NATIVE transfers are less efficient than TWSX_MEMORY transfers because -they require the Source to flip the image around the x-axis to meet the -requirements of BITMAPs.

- -

-  -TWSX_NATIVE transfers are less efficient with color images than TWSX_MEMORY -transfers because they require the Source to convert each color pixel from RGB -to BGR.

- -

-  -Native transfers cannot be used with CCITT compressions.

- -

-  -Compression is supported for image transfers of TWSX_FILE with an image file -format of TWFF_TIFF.

- -

-  On -JPEG compression is supported for image transfers of TWSX_FILE with an image -file format of TWFF_TIFF (see faq.htm for more info) and TWFF_JFIF.

- -

-  -The Source incorrectly allows CCITT compression with an image transfer of -TWSX_FILE and an image file format of TWFF_BMP.

- -

 

- -

ICAP_XNATIVERESOLUTION                -Standard: All Models

- -

                                                                -Allowed: (scanner specific)

- -

                                                                -Default: (scanner specific)

- -

- - This is a read-only capability.

- -

i100/i200/i600/i700/i800/i1800 support -300 only.

- -

3500/3510/3520 -support 200 and 300, with the current value reflecting the setting of -ICAP_XRESOLUTION.

- -

3590/4500 -supports 200 and 300 for bitonal, and 100 and 150 for -color, with the current value reflecting the setting of ICAP_XRESOLUTION.

- -

Other -support 600 only.

- -

 

- -

ICAP_XRESOLUTION                             -Standard: All Models

- -

                                                                -Allowed: (scanner specific)

- -

                                                                -Default: 200

- -

-  -ICAP_XRESOLUTION always matches the current ICAP_YRESOLUTION value.  -Changing one changes the other.

- -

3500/3510/3520 -support 200 and 300, with the current value reflecting the setting of -ICAP_XRESOLUTION.

- -

3590 -supports 200 and 300 for bitonal, and 100 and 150 -for color, with the current value reflecting the setting of ICAP_XRESOLUTION.

- -

-  On -the 3590/4500 the resolutions for the bitonal -and color cameras are linked because of the transport speed.  This means -that a bitonal resolution of 200 requires a color -resolution of 100, and a bitonal resolution of 300 -requires a color resolution of 150.  The Source enforces this behavior, -changing the bitonal and color resolutions as -appropriate to keep these values in sync.

- -

- 900/500 -support 70 - 400 in steps of 10.

- -

- 990 supports -70 - 200 in steps of 10.

- -

- All -other 5000/7000/9000 Series support 70 - 300 in steps of 10.

- -

- i30/i40/i55/i65/i100/i200 support: 75, 100, 150, -200, 240, 300, 400, 600.

- -

- i600/i700/i1800 support -for color: 100, 150, 200, 240, 300.  And for bitonal: -200, 240, 300, 400.

- -

- i800 support -for color: 100, 150, 200, 300.  And for bitonal: -200, 240, 300, 400.

- -

- i1100/i1200/i1300/i1400 -support: 75, 100, 150, 200, 240, 300, 400, 600,1200.

- -

- i4000/i5000 -support: 100, 150, 200, 240, 300, 400, 600.

- -

- i2000 -support: 75, 100, 150, 200, 240, 250, 300, 400, 600, 1200.

- -

- i900 support: -100, 150, 200, 240, 250, 300, 400, 600, 1200.

- -

- i2900 -support: 100, 150, 200, 240, 250, 300, 400, 600, 1200.

- -

- i3000 -support: 100, 150, 200, 240, 250, 300, 400, 600, 1200.

- -

 

- -

ICAP_XSCALING                                   -Unsupported.

- -

 

- -

ICAP_YNATIVERESOLUTION                -Standard: All Models

- -

                                                                -Allowed: (scanner specific)

- -

                                                                -Default: (scanner specific)

- -

-  -This is a read-only capability.

- -

i100/i200/i600/i700/i800/i1800 support -300 only.

- -

3500/3510/3520 -support 200 and 300, with the current value reflecting the setting of -ICAP_YRESOLUTION.

- -

3590/4500 -supports 200 and 300 for bitonal, and 100 and 150 for -color, with the current value reflecting the setting of ICAP_YRESOLUTION.

- -

Other -support 600 only.

- -

 

- -

ICAP_YRESOLUTION                             -Standard: All Models

- -

                                                                -Allowed: (scanner specific)

- -

                                                                -Default: 200

- -

- - ICAP_XRESOLUTION always matches the current ICAP_YRESOLUTION value.  -Changing one changes the other.

- -

3500/3510/3520 -support 200 and 300, with the current value reflecting the setting of -ICAP_XRESOLUTION.

- -

3590 -supports 200 and 300 for bitonal, and 100 and 150 -for color, with the current value reflecting the setting of ICAP_XRESOLUTION.

- -

-  On -the 3590/4500 the resolutions for the bitonal -and color cameras are linked because of the transport speed.  This means -that a bitonal resolution of 200 requires a color -resolution of 100, and a bitonal resolution of 300 -requires a color resolution of 150.  The Source enforces this behavior, -changing the bitonal and color resolutions as -appropriate to keep these values in sync.

- -

- 900/500 -support 70 - 400 in steps of 10.

- -

- 990 supports -70 - 200 in steps of 10.

- -

- All -other 5000/7000/9000 Series support 70 - 300 in steps of 10.

- -

- i30/i40/i55/i65/i100/i200 support: 75, 100, 150, -200, 240, 300, 400, 600.

- -

- i600/i700/i1800 support -for color: 100, 150, 200, 240, 300.  And for bitonal: -200, 240, 300, 400.

- -

- i800 support -for color: 100, 150, 200, 300.  And for bitonal: -200, 240, 300, 400.

- -

- i1100/i1200/i1300/i1400 -support: 75, 100, 150, 200, 240, 300, 400, 600,1200.

- -

- i4000/i5000 -support: 100, 150, 200, 240, 300, 400, 600.

- -

- i2000 -support: 75, 100, 150, 200, 240, 250, 300, 400, 600, 1200.

- -

- i900 support: -100, 150, 200, 240, 250, 300, 400, 600, 1200.

- -

- i2900 -support: 100, 150, 200, 240, 250, 300, 400, 600, 1200.

- -

- i3000 -support: 100, 150, 200, 240, 250, 300, 400, 600, 1200.

- -

 

- -

ICAP_YSCALING                                   -Unsupported.

- -

 

- -

ICAP_ZOOMFACTOR                            -Unsupported.

- -

 

- -
- - - - diff --git a/twain-doc/Kodak/TWAIN_ProgrammaticPrinting.htm b/twain-doc/Kodak/TWAIN_ProgrammaticPrinting.htm deleted file mode 100644 index 8fd6833..0000000 --- a/twain-doc/Kodak/TWAIN_ProgrammaticPrinting.htm +++ /dev/null @@ -1,2817 +0,0 @@ - - - - - - - - -Abstract - - - - - - - - - -
- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

KDS -TWAIN Source

- -

 

- -

 

- -

 

- -

Programmatic -Printing

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

June 22, 2012

- -

 

- -

Revision 1.13

- -

 

- -

 

- -

Contents

- -

 

- -

Abstract............................................................................................................................................................................. -3

- -

 

- -

Audience.......................................................................................................................................................................... -3

- -

 

- -

Programmatic Discovery of Printing -Functionality.................................................................................................... -3

- -

 

- -

Printer Capabilities -........................................................................................................................................................ -3

- -

 

- -

Sample for i2900/i3000/i4000/i5000 scanners without image -address ........................................................... 10

- -

 

- -

Sample for i800/i1800 scanners with image address -.......................................................................................... -12

- -

 

- -

Sample for i200/i600/i700/i1400 scanners -.............................................................................................................. -13

- -

 

- -

 

- -

Abstract

- -

 

- -

The -following scanners are supported for printer:  i200/i600/i700/i800/i1400/i1800/i2900/i3000/i4000/i5000.  -The level and kind of support differs between the various scanners.  This -document details the methods of programmatic control for document printing and -gives some examples of use.

- -

 

- -

 

- -

Audience

- -

 

- -

It -is assumed that the reader has a basic knowledge of the Kodak line of Document Scanners -and of the TWAIN Specification (version 1.8 or higher).  This document is -intended for use by TWAIN integrators. 

- -

 

- -

 

- -

Programmatic Discovery of Printing Functionality

- -

 

- -

The -CAP_PRINTERENABLED capability is used to determine if a printer is -available.  A DG_CONTROL / DAT_CAPABILITY / MSG_GET operation will return -a failure if printing is not supported.

- -

 

- -

There -is no way for TWAIN to know programmatically if a scanner has a printer -installed.  Its up to the application to know what was done with the Mode -Setup Software, and present that information to the operator.

- -

 

- -

The -i600/i700/i800/i1800/i4000/i5000 scanners only support printing -on the front side of a document. Printing is performed before the image is -scanned.

- -

 

- -

The -i200/i1400/i2900/i3000 scanners only support printing on the rear side -of a document. Printing is performed after image is scanned.

- -

 

- -

Not -all the printer capabilities are supported for every scanner, therefore the -scanner models are specified in every printer capability. The allowed values -and default are specified for each scanner specific.

- -

 

- -

 

- -

Printer -Capabilities

- -

 

- -

                -CAP_PRINTERDATE

- -

                    -Scanners:            i600/i700/i1800/i2900/i3000/i4000/i5000

- -

                -    -Container:            -TWON_ONEVALUE

- -

                -    -Type:                   -TWTY_STR255

- -

                -    -Values:                -YYYY/MM/DD      (YYYY - year, MM - month, DD - day)

- -

                -    -Default:                -empty string

- -

                -    -Standard:             -No, custom capability

- -

                -    -Use:                     -This will set the scanner to a specific date prior to printing. The scanner -will be returned to the original date afterwards.

- -

                                                -Set to empty string to disable.

- -

 

- -

                -CAP_PRINTERDATEDELIMITER

- -

                    -Scanners:            -All

- -

                -    -Container:            -TWON_ENUMERATION

- -

                -    -Type:                   -TWTY_UINT16

- -

                -    -Values:                -TWPD_NONE, TWPD_FORWARDSLASH, TWPD_HYPHEN, TWPD_PERIOD, TWPD_BLANK

- -

                -    -Default:                -i800:         -TWPD_FORWARDSLASH

- -

                                                -Others:    TWPD_NONE

- -

                -    -Standard:             -No, custom capability

- -

                -    -Use:                     -Selects the delimiter used in the date.

- -

 

- -

                -CAP_PRINTERDATEFORMAT

- -

                    -Scanners:            i600/i700/i800/i1400/i1800/i2900/i3000/i4000/i5000

- -

                -    Container:            -TWON_ENUMERATION

- -

                -    -Type:                   -TWTY_UINT16

- -

                -    -Values:                -i600/i800/i1400:    -TWPE_MMDDYYYY, TWPE_DDMMYYYY, TWPE_YYYYMMDD,

- -

                                                -Others:                 -TWPE_MMDDYYYY, TWPE_DDMMYYYY, TWPE_YYYYMMDD, TWPE_DDD, TWPE_YYYYDDD

- -

                -    -Default:                -i800:    -    TWPE_MMDDYYYY

- -

                                                -Others:   TWPE_YYYYMMDD

- -

                -    Standard:             -No, custom capability

- -

                -    -Use:                     -Selects the format of the date.

- -

 

- -

                -CAP_PRINTERENABLED

- -

                -    -Scanners:            All

- -

                    -Container:            -TWON_VALUE

- -

                -    -Type:                   -TWTY_BOOL

- -

                -    -Values:                -TRUE/FALSE

- -

                -    -Default:                -FALSE

- -

                -    -Standard:            Yes

- -

                -    -Use:                     -Turns printing on and off.

- -

 

- -

CAP_PRINTERFONT

- -

                -    -Scanners:            All

- -

                    -Container:            -TWON_ENUMERATION

- -

                -    -Type:                   -TWTY_UINT16

- -

                -    -Values:                -i200/i1400:                     -TWPN_LARGECOMIC, TWPN_LARGECINE, TWPN_SMALLCOMIC, TWPN_SMALLCINE

- -

                                                -i600/i700/i800/i1800:     TWPN_LARGECOMIC, TWPN_LARGECINE, -TWPN_LARGECOMIC180, TWPN_LARGECINE180, 

- -

                                                                                       -TWPN_SMALLCOMIC, TWPN_SMALLCINE, TWPN_SMALLCOMIC180, -TWPN_SMALLCINE180

- -

                                                -i2900/i3000/i5000:         -TWPN_LARGECOMIC, TWPN_LARGECINE, TWPN_LARGECOMIC180, TWPN_LARGECINE180,

- -

                                                                                       -TWPN_SMALLCOMIC, TWPN_SMALLCINE, TWPN_SMALLCOMIC180, -TWPN_SMALLCINE180,

- -

                                                                                       -TWPN_BOLDLARGECOMIC, TWPN_BOLDLARGECINE, -TWPN_BOLDLARGECOMIC180, TWPN_BOLDLARGECINE180

- -

                                                -i4000:                             -TWPN_LARGECOMIC, TWPN_LARGECINE, TWPN_LARGECOMIC180, TWPN_LARGECINE180,

- -

                                                                                       -TWPN_SMALLCOMIC, TWPN_SMALLCINE, TWPN_SMALLCOMIC180, -TWPN_SMALLCINE180,

- -

                                                                                       -TWPN_BOLDLARGECOMIC, TWPN_BOLDLARGECINE

- -

                -    -Default:                -i800/i4000/i5000:    TWPN_SMALLCOMIC

- -

                                                -Others:                  -TWPN_LARGECOMIC

- -

                -    -Standard:             -No, custom capability

- -

                -    -Use:                     -Selects the print font.

- -

 

- -

                -CAP_PRINTERFRONTFORMAT

- -

                -    -Scanners:            i1800

- -

                    -Container:            -TWON_ENUMERATION

- -

                -    Type:                   -TWTY_UINT16

- -

                -    -Values:                -TWPFF_NORMAL, TWPFF_BLOCK

- -

                -    -Default:                -TWPFF_NORMAL

- -

                -    -Standard:            - No, custom capability

- -

                -    -Use:                     -Elects the printer font format to be used.

- -

 

- -

               -CAP_PRINTERIMAGEADDRESSFORMAT

- -

                -    -Scanners:            i800/i1800

- -

                    -Container:            -TWON_ENUMERATION

- -

                -    -Type:                   -TWTY_UINT16

- -

                -    -Values:                -TWPI_DISPLAYLEADINGZEROS, TWPI_SUPPRESSLEADINGZEROS, -TWPI_COMPRESSLEADINGZEROS

- -

                -    -Default:                -TWPI_SUPPRESSLEADINGZEROS

- -

                -    -Standard:            - No, custom capability

- -

                -    -Use:                     -This selects the format of the image address, if it -is selected for printing.

- -

 

- -

                -CAP_PRINTERIMAGEADDRESSLEVEL

- -

                -    -Scanners:            i800/i1800

- -

                    -Container:            -TWON_ENUMERATION

- -

                -    -Type:                   -TWTY_UINT16

- -

                -    -Values:                -TWPL_ALLLEVELS, TWPL_LEVEL1, TWPL_LEVEL2, TWPL_LEVEL3

- -

                -    -Default:                -TWPL_ALLLEVELS

- -

                -    -Standard:            - No, custom capability

- -

                -    -Use:                     -This selects which level document the described -printing will occur upon.

- -

 

- -

                -CAP_PRINTERINDEX

- -

                    -Scanners:            -All

- -

                -    -Container:            -TWON_RANGE

- -

                -    -Type:                   -TWTY_UINT32

- -

                -    -Values:                -0xFFFFFFFF, 0 - 999999999

- -

                -    -Default:                -i600/i700/i1800:   1

- -

                                                -Others: -               -0

- -

                -    -Standard:            Yes -(TWAIN 1.8)

- -

                -    -Use:                     -Sets the print counter.

- -

                -    -Notes:                  -0xFFFFFFFF preserves the current value in the scanner

- -

 

- -

CAP_PRINTERINDEXDIGITS

- -

                -    -Scanners:            All

- -

                    -Container:            -TWON_RANGE

- -

    -Type:                   -TWTY_UINT16

- -

                -    -Values:                -1 - 9

- -

                -    -Default:                -0

- -

                -    -Standard:             -No, custom capability

- -

                -    -Use:                     -Sets the number of digits of the counter to be -printed.  Note that the data will be truncated if the number of digits in -the count exceeds this value.

- -

 

- -

                -CAP_PRINTERINDEXFORMAT

- -

                -    -Scanners:            All

- -

                    -Container:            -TWON_ENUMERATION

- -

    -Type:                   -TWTY_UINT16

- -

                -    Values:                -TWPI_DISPLAYLEADINGZEROS, TWPI_SUPPRESSLEADINGZEROS, -TWPI_COMPRESSLEADINGZEROS

- -

                -    -Default:                -i800:         -TWPI_SUPPRESSLEADINGZEROS

- -

                                                -Others:    TWPI_DISPLAYLEADINGZEROS

- -

                -    -Standard:             -No, custom capability

- -

                -    -Use:                     -Selects the format used to print the counter.

- -

 

- -

               -CAP_PRINTERMODE

- -

                -    -Scanners:            i4000/i5000

- -

                    -Container:            -TWON_ENUMERATION

- -

    -Type:                   -TWTY_UINT16

- -

                -    -Values:                -TWPM_SINGLESTRING, TWPM_COMPOUNDSTRING

- -

                -    -Default:                -TWPM_SINGLESTRING

- -

                -    Standard:             -Yes (TWAIN 1.8)

- -

                -    -Use:                     -TWPM_SINGLESTRING allows the full range of printer -features to be expressed.

- -

                                                -TWPM_COMPOUNDSTRING follows the guidelines of the -TWAIN 1.8 specification.

- -

 

- -

CAP_PRINTERPOSITION

- -

                -    -Scanners:            All

- -

                    -Container:            -TWON_RANGE

- -

    -Type:                   -TWTY_FIX32

- -

                -    -Values:                -Scanner specific

- -

                -    -Default:                -Scanner specific

- -

                -    -Standard:             -No, custom capability

- -

                -    -Use:                     -This selects the position from the top of the page -where printing is to begin.

- -

 

- -

                -CAP_PRINTERSTRING

- -

                -    -Scanners:            i2900/i3000/i4000/i5000

- -

                    -Container:            -TWON_ONEVALUE

- -

    -Type:                   -TWTY_STR255

- -

                -    -Values:                -Any string (up to 40 characters)

- -

                    -Default:                -111

- -

                -    -Standard:            Yes -(TWAIN 1.8)

- -

                -    -Use:                     -This capability is the same as -CAP_PRINTERWRITESEQUENCEMESSAGE1.

- -

 

- -

                -CAP_PRINTERSUFFIX

- -

                    -Scanners:            All

- -

                    -Container:            -TWON_ONEVALUE

- -

    -Type:                   -TWTY_STR255

- -

                -    -Values:                -i600/i700/i1800/i5000:  Any string (up to 20 characters)

- -

                                                -Others:                         -Any string (up to 40 characters)

- -

                -    -Default:                -i200/i600/i700/i1400:   ABC

- -

                                                -Others:                        -111

- -

                -    Standard:             -Yes (TWAIN 1.8)

- -

                -    -Use:                     -Specifies a text string to be printed.

- -

 

- -

                -CAP_PRINTERTIME

- -

                    -Scanners:            i600/i700/i1800/i2900/i3000/i4000/i5000

- -

                    -Container:            -TWON_ONEVALUE

- -

    -Type:                   -TWTY_STR255

- -

                -    -Values:                -HH:MM      (HH - hour -(0-23), MM - minutes (0-59), i.e. 00:00->23:59)

- -

                -    -Default:                -empty string

- -

                -    Standard:             -No, custom capability

- -

                -    -Use:                     -This will set the scanner to a specific time prior to -printing. The scanner will be returned to the original time afterwards.

- -

                                                - Set to empty string to disable.

- -

 

- -

                -CAP_PRINTERWRITESEQUENCE

- -

                -    -Scanners:            All

- -

                    -Container:            -TWON_ENUMERATION

- -

    -Type:                   -TWTY_UINT16

- -

                -    Values:                -i600/i700/i800/i1800/i5000: TWPW_DATE, TWPW_TIME, TWPW_INDEX, TWPW_MESSAGE1 to -6, TWPW_SPACE

- -

                                                -Others:                                -TWPW_DATE, TWPW_TIME, TWPW_INDEX, TWPW_MESSAGE1, TWPW_SPACE

- -

                -    -Default:                -TWPW_INDEX

- -

                -    -Standard:             -No, custom capability

- -

                -    -Use:                     -Determines what will be printed.

- -

 

- -

CAP_PRINTERWRITESEQUENCEMESSAGE1-6

- -

                -    Scanners:            -All

- -

                    -Container:            -TWON_ONEVALUE

- -

    -Type:                   -TWTY_STR255

- -

                -    -Values:                -i600/i700/i1800/i5000:  Any string (up to 20 characters), -CAP_PRINTERWRITESEQUENCEMESSAGE1 through 6

- -

                                                -Others:                         -Any string (up to 40 characters), CAP_PRINTERWRITESEQUENCEMESSAGE1

- -

                -    -Default:                -i200/i600/i700/i1400:   ABC

- -

                                                 -Others:                       -111

- -

                -    -Standard:             -No, custom capability

- -

                -    -Use:                     -Specifies a text string to be printed. 

- -

                -    -Notes:                  -This one text string can be used anywhere in the print sequence, and more than -once.

- -

                                                -Same as CAP_PRINTERSUFFIX (CAP_PRINTERSUFFIX is -CAP_PRINTERWRITESEQUENCEMESSAGE1)

- -

 

- -

CAP_ -PRINTERWRITESEQUENCEMESSAGEINDEX

- -

                -    -Scanners:            i200/i600/i700/i1400/i1800

- -

                    -Container:            -TWON_RANGE

- -

    -Type:                   -TWTY_UINT16

- -

                -    -Values:                i200/i1400:   1

- -

                                               - Others:        -1 - 6

- -

                -    -Default:                -1

- -

                -    -Standard:             -No, custom capability

- -

                -    -Use:                    - Sets the current write sequence message.

- -

                -    -Notes:                 - Setting this value to 1 selects CAP_PRINTERSUFFIX.

- -

 

- -

                -CAP_PRINTERWRITESEQUENCESTRING

- -

                -    -Scanners:            All

- -

                    -Container:            -TWON_ONEVALUE

- -

    -Type:                   -TWTY_STR255

- -

                -    -Values:                -(see the control characters below)

- -

                                                -i200/i600/i700: -Max 20 control characters

- -

                                                -i800/i1800:       Max 80 control -characters

- -

                                                -Others:           Max -40 control characters

- -

                -    -Default:                -"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"

- -

                -    -Standard:             -No, custom capability

- -

                -    -Use:                     -Controls what will be printed.

- -

 

- -

 

- -

The Write Sequence capability -(CAP_PRINTERWRITESEQUENCESTRING) is used to control what is printed by -the scanner, and must adhere to the following rules.

- -

 

- -

          Value must always be -valid, even if disabled

- -

          Embedded Zs are not -allowed

- -

 

- -

The -following list covers the available control characters:

- -

 

- -

For -i800/i1800/i2900/i3000/i4000/i5000 scanners:

- -

          -Z      -- end of write sequence -                               -(This is optional and may fill out the string)

- -

          -A     -- IA field -A                                                      -(based on CAP_PRINTERIMAGEADDRESSFORMAT)

- -

          -B      -- IA field -B                                                      -(based on CAP_PRINTERIMAGEADDRESSFORMAT)

- -

          -C      -- IA field -C                                                      -(based on CAP_PRINTERIMAGEADDRESSFORMAT)

- -

          -D      -- IA field -D                                                      -(based on CAP_PRINTERIMAGEADDRESSFORMAT)

- -

          -Y     -- -Date                                                             -(based on CAP_PRINTERDATEFORMAT and CAP_PRINTERDATEDELIMITER)

- -

          -T      -- -Time HH:MM                                                 -(CAP_PRINTERTIME)

- -

          -S      -- Printer -Index                                                -(CAP_PRINTERINDEX based on CAP_PRINTERINDEXDIGITS and CAP_PRINTERINDEXFORMAT)

- -

          -1      -- Message #1  -               -(level -1,2,3)             -(CAP_PRINTERWRITESEQUENCEMESSAGE1)

- -

          -2      -- Message #2  -               -(level -1,2,3)             -(CAP_PRINTERWRITESEQUENCEMESSAGE2)

- -

          -3      -- Message #3  -               -(level -1,2,3)             -(CAP_PRINTERWRITESEQUENCEMESSAGE3)

- -

          -4      -- Message -#4                 (level -1,2,3)             -(CAP_PRINTERWRITESEQUENCEMESSAGE4)

- -

          -5      -- Message -#5                 (level -1,2,3)             -(CAP_PRINTERWRITESEQUENCEMESSAGE5)

- -

          -6      -- Message #6  -               -(level -1,2,3)             -(CAP_PRINTERWRITESEQUENCEMESSAGE6)

- -

          -1      -- Message -#7                 (all -levels)                -(CAP_PRINTERWRITESEQUENCEMESSAGE7)

- -

          -2      -- Message #8  -               -(all -levels)                -(CAP_PRINTERWRITESEQUENCEMESSAGE8)

- -

          -3      -- Message -#9                 (all -levels)                -(CAP_PRINTERWRITESEQUENCEMESSAGE9)

- -

          -4      -- Message -#10               (all -levels)                -(CAP_PRINTERWRITESEQUENCEMESSAGE10)

- -

          -5      -- Message -#11               (all -levels)                -(CAP_PRINTERWRITESEQUENCEMESSAGE11)

- -

          -6      -- Message -#12               (all -levels)                -(CAP_PRINTERWRITESEQUENCEMESSAGE12)

- -

          - -    - Blank -space                                                  -(1 character)

- -

 

- -

For -i200/i600/i700/i1400 scanners:

- -

          -Z      -- End of write sequence (This is optional and may fill out the string)

- -

          -C     - -Printer -index                  -(CAP_PRINTERINDEX based on CAP_PRINTERINDEXDIGITS and CAP_PRINTERINDEXFORMAT)

- -

          -D     - -Date MMDDYYYY         (based on -CAP_PRINTERDATEDELIMITER)

- -

          -E     -- Date DDMMYYYY         (based on -CAP_PRINTERDATEDELIMITER)

- -

          -F     -- Date YYYYMMDD         (based on -CAP_PRINTERDATEDELIMITER)

- -

          -J     -- Date YYYYDD        -       (based on CAP_PRINTERDATEDELIMITER)

- -

          -H     -- Date DDD        -              -(based on CAP_PRINTERDATEDELIMITER)

- -

          -T     - -Time -HH:MM                   -(CAP_PRINTERTIME)

- -

          -B     -- Blank -space                  -(1 character)

- -

          -S     - -Message #1    -              -(CAP_PRINTERWRITESEQUENCEMESSAGE1 or CAP_ PRINTERSUFFIX)

- -

          -2     - -Message -#2                  -(CAP_PRINTERWRITESEQUENCEMESSAGE2)

- -

          -3     - -Message -#3                  -(CAP_PRINTERWRITESEQUENCEMESSAGE3)

- -

          -4     - -Message -#4                  -(CAP_PRINTERWRITESEQUENCEMESSAGE4)

- -

          -5     - -Message -#5                  -(CAP_PRINTERWRITESEQUENCEMESSAGE5)

- -

          -6     - -Message -#6                  -(CAP_PRINTERWRITESEQUENCEMESSAGE6)

- -

 

- -

 

- -

Sample -for i5000 scanners without image address

- -

 

- -

    -CAP_PRINTERENABLED:                                                     -TRUE

- -

    -CAP_PRINTERDATEFORMAT:                                             -TWPE_MMDDYYYY

- -

    -CAP_PRINTERDATEDELIMITER:                                           -TWPD_FORWARDSLASH

- -

    -CAP_PRINTERFONT:                                                           -TWPN_SMALLCOMIC

- -

    -CAP_PRINTERINDEX:                                                          -20

- -

    -CAP_PRINTERINDEXDIGITS:                                                -5

- -

    -CAP_PRINTERINDEXFORMAT:                                            -TWPI_DISPLAYLEADINGZEROS

- -

    -CAP_PRINTERPOSITION:                                                     -2.5 inches

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE1:                     -Message1

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE2:                     -Message2

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE3:                     -Message3

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE4:                     -Message4

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE5:                     -Message5

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE6:                     -Message6

- -

    -CAP_PRINTERWRITESEQUENCESTRING:                            -Y T 1 2 3 4 5 6 SZZZZZZZZZZZZZZZZZZZZZZZ

- -

 

- -

    -Result:                                                                                 -Top -Printer                               -

- -

                                                                                                -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- -

                                                                                                -12/06/2010 10:25 Message1 Message2 Message3 Message4 Message5 Message6  -00020

- -

                                                                                                -12/06/2010 10:25 Message1 Message2 Message3 Message4 Message5 Message6  -00021

- -

                                                                                                -12/06/2010 10:25 Message1 Message2 Message3 Message4 Message5 Message6  -00022

- -

                                                                                                

- -

 

- -

 Sample -for i2900/i3000/i4000 scanners without image address

- -

 

- -

    -CAP_PRINTERENABLED:                                                     -TRUE

- -

    -CAP_PRINTERDATEFORMAT:                                             -TWPE_MMDDYYYY

- -

    -CAP_PRINTERDATEDELIMITER:                                           -TWPD_FORWARDSLASH

- -

    -CAP_PRINTERFONT:                                                           -TWPN_SMALLCOMIC

- -

    -CAP_PRINTERINDEX:                                                          -20

- -

    -CAP_PRINTERINDEXDIGITS:                                                -5

- -

    -CAP_PRINTERINDEXFORMAT:                                            -TWPI_DISPLAYLEADINGZEROS

- -

    -CAP_PRINTERPOSITION:                                                     -2.5 inches

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE1:                     -Message1

- -

    -CAP_PRINTERWRITESEQUENCESTRING:                            -Y T S 1ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ

- -

 

- -

    -Result:                                                                                 -Top -Printer                               -

- -

                                                                                                -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- -

                                                                                                -06/22/2012 10:25 00020 Message1

- -

                                                                                                -06/22/2012 10:25 00021 Message1

- -

                                                                                                -06/22/2012 10:25 00022 Message1

- -

                                                                                                

- -

 

- -

Sample -for i800/i1800 scanners with image address

- -

 

- -

    CAP_PRINTERENABLED:                                                     -TRUE

- -

    -CAP_PRINTERDATEDELIMITER:                                           -TWPD_HYPHEN

- -

  -  CAP_PRINTERDATEFORMAT:                                             -TWPE_YYYYMMDD

- -

    CAP_PRINTERFONT:                                                           -TWPN_SMALLCOMIC

- -

    -CAP_PRINTERIMAGEADDRESSFORMAT:                           -TWPI_SUPPRESSLEADINGZEROS

- -

    -CAP_PRINTERIMAGEADDRESSLEVEL:                               -TWPL_LEVEL1

- -

    -CAP_PRINTERINDEXDIGITS:                                                -9

- -

  -  CAP_PRINTERINDEXFORMAT:                                            -TWPI_DISPLAYLEADINGZEROS

- -

    -CAP_PRINTERPOSITION:                                                     -0.5 inches

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE1:                     -Level-1

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE2:                     -Level-2

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE3:                     -Level-3

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE4:                     -.

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE5:                     -

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE6:                     -

- -

    -CAP_PRINTERWRITESEQUENCESTRING:                            -1BYZZZZZZZZZZZZZZZZZ

- -

 2BSZZZZZZZZZZZZZZZZZ

- -

 3BA4B4C4DZZZZZZZZZZZ

- -

 ZZZZZZZZZZZZZZZZZZZZ

- -

 ZZZZZZZZZZZZZZZZZZZZ

- -

 

- -

    -Result:                                                                                 -Level       Top -Printer                               -

- -

                                                                                                -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- -

Level-0    -Level-2  000000009

- -

                                                                                                -Level-1    Level-1  2002-02-25

- -

                                                                                                -Level-1    Level-1  2002-02-25 -                            -

- -

                                                                                                -Level-3    Level-3  FIXED.2.1.1 -           

- -

                                                                                                -Level-0    Level-2  000000013 -           

- -

                                                                                                -Level-1    Level-1  2002-02-25 -                            -

- -

                                                                                                -Level-1    Level-1  2002-02-25 -                            -

- -

                                                                                                -Level-3    Level-3  FIXED.3.1.1

- -

                                                                                                -Level-0    Level-2  -000000017         

- -

 

- -

 

- -

Sample -for i200/i600/i700/i1400 scanners

- -

 

- -

    -CAP_PRINTERENABLED:                                     -TRUE

- -

    -CAP_PRINTERFONT:                                           -TWPN_LARGECOMIC

- -

    -CAP_PRINTERWRITESEQUENCESTRING: -           -SBDBTBCZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ

- -

    -CAP_PRINTERWRITESEQUENCEINDEX:              -7

- -

    -CAP_PRINTERSUFFIX:                                         -Test

- -

    CAP_PRINTERDATEDELIMITER:                           -TWPD_FORWARDSLASH

- -

    CAP_PRINTERINDEX:                                           -10

- -

    -CAP_PRINTERINDEXDIGITS:                                -4

- -

    -CAP_PRINTERINDEXFORMAT:                            -TWPI_DISPLAYLEADINGZEROS

- -

    CAP_PRINTERPOSITION:                                     -1 inch

- -

 

- -

    -Result:                 -                                                -Top -Printer                               -

- -

                                                                                -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- -

                                                                -Test 03/19/2001 11:30 0010

- -

                                                                                -Test 03/19/2001 11:30 0011

- -

                                                                                -Test 03/19/2001 11:30 0012

- -

 

- -

 

- -

    -CAP_PRINTERENABLED:                                     -TRUE

- -

    -CAP_PRINTERFONT:                                           -TWPN_LARGECOMIC

- -

    -CAP_PRINTERWRITESEQUENCESTRING: -           -FBSBCB1ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ

- -

    CAP_PRINTERWRITESEQUENCEMESSAGE1:     -Scanner-05

- -

    -CAP_PRINTERWRITESEQUENCEMESSAGE2:     Testing

- -

    CAP_PRINTERDATEDELIMITER:                           -TWPD_NONE

- -

    CAP_PRINTERINDEX:                                           -9

- -

    -CAP_PRINTERINDEXDIGITS:                                -8

- -

    -CAP_PRINTERINDEXFORMAT:                            -TWPI_SUPPRESSLEADINGZEROS

- -

    CAP_PRINTERPOSITION:                                     -1 inch

- -

 

- -

    -Result:                                                                 -Top -Printer                               -

- -

                                                                                -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- -

                                                                                -20010319 Scanner-05 9 Testing

- -

                                                                                -20010319 Scanner-05 10 Testing

- -

                                                                                -20010319 Scanner-05 11 Testing

- -

 

- -

   -

- -

 

- -
- - - - diff --git a/twain-doc/Kodak/TWAIN_ScannerIdentification.htm b/twain-doc/Kodak/TWAIN_ScannerIdentification.htm deleted file mode 100644 index f183272..0000000 --- a/twain-doc/Kodak/TWAIN_ScannerIdentification.htm +++ /dev/null @@ -1,218 +0,0 @@ - - - - - -Correct TWAIN Usage - - - - - - - -
 
 
Correct TWAIN Usage
 
We recommend against applications identifying scanner models.  TWAIN is designed to expose functionality through capability negotiation.  Writing applications that use functionality based on a model number makes it harder to maintain the code as new models come out that mix that functionality.  For example:
 
               Model 100 has features A, B, C
               Model 200 has features A, X, Y
 
               Code is written as follows:
               Always use A
               If (100) use B, C
               If (200) use X, Y
 
               A new model 300 has features D, C, X
               If (100 200) use A
               If (100) use B, C
               If (200) use X, Y
               If (300) use C, X
 
There are other ways to code this, but they all get unwieldy over time.  The preferred method is:
 
               If A is supported use A
               If B is supported use B
               If C is supported use C
               If X is supported use X
               If Y is supported use Y
 
In TWAIN a capability is tested for support using DG_CONTROL / DAT_CAPABILITY / MSG_QUERYSUPPORT.
 
 
 
 
Alternative TWAIN Usage
 
Every effort is made to make sure that the standard TWAIN capabilities are presented in a consistent fashion across all scanner models.  Unfortunately, this same requirement is harder to enforce for the custom driver features.  In situations like this it may be easier to identify a group of functions by associating them with a model number.
 
Before performing any custom operation an application must unambiguously identify the driver.  For all KDS drivers this is done by examining the TW_IDENTITY returned by the DG_CONTROL / DAT_PARENT / MSG_OPENDS, and looking for the following:
 
               Manufacturer            "Eastman Kodak Company"
               Version.Info              "KDS v#.#.# YYYY/MM/DD"
 
This information does not apply to the 1500/2500 or the i50/i60/i80.  These scanner models use different drivers, so one or both of the above fields will be different.
 
KDS Version 5/6.x drivers and higher report a specific scanner model through DG_CONTROL / DAT_DEVICEINFO/ MSG_GET when it is called in State 4 or higher.  The model information is returned in the TW_DEVICEINFO.dwModelNumber or TW_DEVICEINFO.szModelName field.  This is a custom feature of our driver.
 
KDS Version 4.x drivers and higher report a specific scanner model through DG_CONTROL / DAT_IDENTITY / MSG_GET when it is called in State 4 or higher.  The model information is returned in the TW_IDENTITY.ProductName field.  This is a custom feature of our driver.  
 
KDS Version 3.x, 2.x and 1.x drivers do not support this feature, so it is necessary to use another method to identify the scanner model.  The technique involves the systematic examination of standard and custom capabilities.  The pseudo-code for this is provided below.
 
Note that it is not possible in all situations to uniquely identify all models in this way.  However, from the viewpoint of the driver all of the models grouped in a section support exactly the same operations and capabilities, so for the purpose of testing for functionality, this technique is sufficient.
 
 
 
if CAP_MODE supported:  5xx/9xx/5xxx/7xxx/9xxx
    if ICAP_FRAMELENGTHCONTROL supported
               if CAP_PRINTERENABLED supported
                               if ICAP_XRESOLUTION includes 400 dpi
                                              500/7560
                               else
                                              500A/5520/7520
                               endif
               else
                               if ICAP_XRESOLUTION includes 400 dpi
                                              500/7550
                               else
                                              500A/5500/7500
                               endif
               endif
    else
               if ICAP_XRESOLUTION includes 300
                               900/923/9500/9520
               else
                               990
               endif
    endif
 
else if CAP_IMAGEADDRESS supported: 8xx
    if ICAP_PIXELTYPE includes TWPT_RGB
               i820/i840
    else
               if ICAP_XRESOLUTION includes 400 dpi
                               i830
               else
                               i810
               endif
    endif
 
else it must be mid-volume: 3xxx/4xxx
    if CAP_ENABLECOLORPATCHCODE supported
               3590
    else if ICAP_PIXELTYPE includes TWPT_RGB
               4500
    else if CAP_AUTOMATICBORDERDETECTION supported
               3520
    else if CAP_MULTIFEEDTHICKNESSDETECTION supported
               3510
    else
               3500
    endif
 
endif
- -

 

- -
- - - - diff --git a/twain-doc/Kodak/debugging.htm b/twain-doc/Kodak/debugging.htm deleted file mode 100644 index 78f1143..0000000 --- a/twain-doc/Kodak/debugging.htm +++ /dev/null @@ -1,897 +0,0 @@ - - - - - - - - -Kodak KDS TWAIN Driver - - - - - - - - - - - -
- -

Kodak KDS TWAIN Driver

- -

Debugging Guide

- -

03-July-2012

- -

 

- -

 

- -

Contents

- -

          -1.0     Overview

- -

          -2.0     Finding the Driver Files

- -

          -3.0     Configuring the System

- -

          -4.0     Dumping the Data Files

- -

          -5.0     Dumping the Image Files

- -

 

- -

 

- -

 

- -

1.0     -Overview

- -

If sending information to Kodak about the TWAIN driver, we -recommend including log data, which will result in a quicker diagnosis.  -This document should be helpful to select what to send.  If in doubt, send -everything you can.

- -

 

- -

The TWAIN driver debugs most problems through its logging -system.   This logging system is reasonably sophisticated, and can be -configured to focus on specific areas, as needed.  The most common kinds -of logging configurations are as follows:

- -

 

- -

Logging everything: recording all activity.  -Occasionally this is the best way to capture needed information, especially if -the problem is easily reproducible, but not obviously a problem with either the -application or the scanner.  Logs generated this way tend to be very -large, and full of a lot of information. (Debug=1)

- -

 

- -

Flushing to disk: -best when analyzing crashes.  Disk drives rely on caches to boost -performance, however, when programs crash they may strand vital information in -those caches.  If an application crash is easily reproducible, then its -possible to flush every log entry to disk.  This is typically used when -logging everything, so the log files are very large and the application and -driver performance is very slow. (Debug=7)

- -

 

- -

Database Dumping: (5.x only) used to take a snapshot -of the main database elements in the driver.  (Debug=256)

- -

 

- -

Image Dumping: used to capture images as soon as they -are transferred from the scanner, and before they are processed or passed to -the application.

- -

 

- -

 

- -

 

- -

2.0     -Finding the Driver Files

- -

All Kodak TWAIN driver files are accessible through the -following path:

- -

 

- -

%winbootdir%\twain_32\kodak

- -

 

- -

Where %winbootdir% is the -path to the Windows directory, which is usually either C:\WINDOWS or -C:\WINNT.  If you are not sure what this is you can do the following to -find it out.  This works for all versions of Windows.

- -

 

- -

1)      Click on START

- -

2)      Select RUN

- -

3)      Type in COMMAND -and hit the Enter key

- -

4)      Type SET in the -DOS window

- -

5)      Look for -WINBOOTDIR

- -

 

- -

When you look in the %winbootdir%\twain_32\kodak you -may see several directories and files.  Look for anything beginning with -the letters KDS; these contain the Kodak TWAIN drivers.  Pick the one that -matches your scanner.  You can find the version at the top of the readme.txt -file.

- -

 

- -

kds_i30_i40     - Version 6.x i30/i40 driver

- -

 

- -

kds_i100          - Version -6.x i100 driver

- -

 

- -

kds_i200          - Version -4.x i200 driver

- -

 

- -

kds_i600          - Version -5.x or 6.x i600 driver

- -

 

- -

kds_i800          - Version -4.x or 6.x i800 driver

- -

 

- -

            -kds_i1200        - Version 7.x i1200 -driver

- -

 

- -

            -kds_i1300        - Version 7.x i1300 -driver

- -

 

- -

            -kds_i1400        - -Version 9.x i1400 driver

- -

 

- -

            -kds_i1800        - Version 8.x i1800 -driver

- -

 

- -

            -kds_i1100        - Version 9.x i1100 -driver

- -

 

- -

            -kds_i700          - Version 9.x -i700 driver

- -

 

- -

            -kds_i4200_i4600 - Version 10.x i4000 driver

- -

 

- -

            -kds_i5000        - Version 11.x i5000 driver

- -

 

- -

            -kds_i2000        - Version 11.x i2000 driver

- -

 

- -

            -kds_i900          - Version 11.x -i900 driver

- -

 

- -

            -kds_i2900        - Version 12.x i2900 driver

- -

 

- -

            -kds_i3000        - Version 12.x i3000 driver

- -

 

- -

            -kds_pss         -- Version 12.x PS50/PS80 driver

- -

 

- -

 

- -

3.0     -Configuring the System

- -

 

- -

If you are using a 2/3.x driver, then edit the const.ini -file.  If you are using a 4/5/6.x driver, then click on the file called a -shortcut to const.ini to edit the file.

- -

 

- -

Inside of this file you will find two values near the top.

- -

 

- -

            -Debug=0

- -

            -DebugFilter=

- -

 

- -

These are the switches used to configure the Kodak TWAIN -driver logging system.  By default they are turned off, so that the driver -will only record a small amount of information in the event of an error.

- -

 

- -

The recommended values for Debug are as follows:

- -

 

- -

Debug=0         -- record nothing but errors

- -

Debug=1         -- record everything

- -

Debug=7         -- record everything and flush to disk

- -

Debug=64       -- record just the memory usage

- -

Debug=256     -- (5.x only) dump the data files

- -

 

- -

 

- -

4.0     -Dumping the Data Files

- -

This is available with the version 5/6.x drivers.  If -there is doubt about the state of the database or the language files or the -device configuration data, then it is possible to dump those files at the start -of the session.  This is done by setting Debug=256 in the const.ini -file.

- -

 

- -

The files all start with the letters KDS and are -placed in the users temp directory.  Unfortunately, there is no single, -common way to find this directory across all versions of Windows, so rather -than try to describe how its done for each OS, we recommend that you search on -your Windows OS disk (usually C:\) for all occurrences of KDS*.TXT, finding -the files:

- -

 

- -

            -KdsDbFixed.txt

- -

KdsDeviceConfig.txt

- -

KdsLabel.txt

- -

KdsLookupGui.txt

- -

KdsLookupTwain.txt

- -

 

- -

So, if youre looking for everything possible to send when -looking for help, feel free to include these files.

- -

 

- -

 

- -

 

- -

5.0     -Dumping the Image Files

- -

Not all drivers support this, but those that do will show a Dump -tab in the TWAIN GUI when it is run from the Scanner Validation Tool (SVT), if -the user has the right license level.

- -

 

- -

You have to contact Kodak to get a license.

- -

 

- -

For all scanners the tab offers a way to write images to -disk before they are passed up to the application.

- -

 

- -

The first option provides a way to guarantee that the -transfer of the image from the driver to the application did not change it in -any way.

- -

 

- -

The second option dumps the data before it is processed by -the driver.  This raw image is the one that we would want to see if -there are questions about image quality.  Its also the image you need to -use if you want to feed it back into the driver using the simulator.

- -

 

- -

 

- -
- - - - diff --git a/twain-doc/Kodak/faq.htm b/twain-doc/Kodak/faq.htm deleted file mode 100644 index cc500ae..0000000 --- a/twain-doc/Kodak/faq.htm +++ /dev/null @@ -1,4520 +0,0 @@ - - - - - - - - -Kodak Document Scanners - - - - - - - - - - -
- -

Kodak Document -Scanners

- -

TWAIN Driver Frequently Asked Questions (FAQ)

- -

03-July-2012

- -

 

- -

Contents

- -

 

- -

1.0 Installation

- -

1.1 Driver Files

- -

1.2 -Installing Previous Versions

- -

1.3 -Uninstalling the Driver

- -

1.4 -Removing KDSMM

- -

 

- -

2.0 -Troubleshooting

- -

2.1 -Application Cannot Find Source

- -

2.2 -Real-Time Display Problem

- -

2.3 -Application Hangs When Trying To Scan

- -

2.4 TWAIN -Opens Very Slowly

- -

2.5 System -cannot find KDS.DLL

- -

2.6 -1394/SBP2 Issues

- -

2.7 Platen -Autocrop/Deskew

- -

2.8 The -SETUP001.INI File

- -

2.9 ICAP_UNITS -Causing Problem

- -

2.10 -CAP_PRINTERINDEX Persistence

- -

 

- -

 

- -

3.0 -Development

- -

3.1 -Scanner Simulator

- -

3.2 -KDS_HOMEDIR

- -

3.3 DEBUG -/ DEBUGFILTER

- -

3.4 -ICAP_XFERMECH

- -

3.5 -KDSTST.EXE

- -

3.6 Custom -Capabilities

- -

3.7 Force -Compression

- -

3.8 Force -Version (3590 only, 1.x firmware)

- -

3.9 Force -Resolution (3590 only, 1.x firmware)

- -

3.10 -ICAP_PIXELTYPE (3590/4500/i200/i600/i700/i820/i840/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000)

- -

3.11 Width -and Length Alignment

- -

3.12 -Polarity

- -

3.13 -Feeder Keep Alive (3000/4000 Series)

- -

3.14 -Length Detection and Frames (3000/4000 Series)

- -

3.15 -MSG_STOPFEEDER Operation

- -

3.16 JPEG -Quantization (3590/4500/i820/i840/i200/i600/i700/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000)

- -

3.17 -Multiple Modes (5xxx/7xxx/9xxx series)

- -

3.18 -DAT_EXTIMAGEINFO

- -

3.19 -ICAP_FRAMES

- -

3.20 Color -Dropout: Enhanced Processing

- -

3.21 i30/i40 -Button Mapping

- -

3.22 -Displaying Scanner Operator/Info Log

- -

 

- -

 

- -

4.0 Known -Issues

- -

4.1 -Programmatic Constraints

- -

4.1.1 -ICAP_COMPRESSION

- -

4.2 Delay -with MSG_ENDXFER

- -

4.3 Fix -for Overscan (3xxx Series)

- -

4.4 -DEFAULTS button does not affect the following...

- -

4.5 TIFF JPEG -(3590/4500/i820/i840/i600/i700/i200/i900/i1100/i1200/i1300/i1800/i2000/i2900/i3000/i4000/i5000)

- -

4.6 -Scanner Does Not Always Report Jams (5xxx/7xxx/9xxx)

- -

 

- -

5.0 -Acknowledgements

- -

5.1 -Intel(r) JPEG Library

- -

5.2 -Picture Elements(tm) ChromaTHR(tm), 3590/4500, 4.x -only

- -

 

- -

 

- -

1.0 -Installation

- -

The TWAIN drivers are intended for production -use with the following Kodak Digital Document Scanner model numbers:

- -

 

- -

    Model                          Supported -Driver Versions

- -

    i30, -i40                                  6.x  -

- -

    i250, -i260                     4.x

- -

    i620, -i640, -i660                     5.x  -6.x

- -

    -i700                                                        -9.x

- -

    i810, -i820, i830, -i840         4.x        -6.x

- -

    i1100                                                       -9.x

- -

    i1200, -i1300                                    7.x

- -

    -i1400                                                       -9.x

- -

    -i1800                                                 8.x

- -

    i2900, i3000                                                        -12.x

- -

    -i4000                                                             -10.x

- -

    i5000, i2000, -i900                                                       -11.x

- -

    PS50, PS80                                                        -12.x

- -

    

- -

 

- -

If you are developing an Application and do -not have access to a scanner refer to section 3.1 to learn how to use the -Scanner Simulator.  Please note that not all drivers support all -scanners.  Check the ramscan.txt file for the list of supported scanners -for your driver.

- -

 

- -

 

- -

1.1 -Driver Files

- -

The installation places its main files into a -directory of the form "kds_model", for -example: kds_i600.

- -

 

- -

Because of this mechanism multiple KDS TWAIN -drivers can co-exist on a system.  The installation will always make -itself the new default (per the TWAIN spec), but it is up to the user to change -the selection to the most appropriate driver for whatever scanner is in use.

- -

 

- -

For ease of reading the rest of this document -will refer to the 'kds' directory in commentary and -examples, even for installs that may be of the form "kds_i600".

- -

 

- -

A 4.x installation includes the following -files, which are placed in the %win%\twain_32\kodak\kds directory:

- -

 

- -

    a shortcut to -const.ini            ; -shortcut to driver configuration settings

- -

    a shortcut to -kds.log     -         ; shortcut to driver log

- -

    a shortcut to -ramscan.txt          ; shortcut to -simulator settings

- -

    a shortcut to setup001.ini -        ; shortcut to GUI snapshot of last -session

- -

    const.ini                      -    ; link to real const.ini

- -

    hippo.dll                          ; -image processing library

- -

    kds.ds                             ; -the driver

- -

    kdscust.h                          ; -custom TWAIN capabilities

- -

    kdstst.exe                         ; -KODAK diagnostic tool

- -

    l_ch_chn.ini                       ; -Simplified Chinese

- -

    l_ch_twn.ini                       ; -Traditional Chinese

- -

    l_de_deu.ini                       ; -German

- -

    l_en_usa.cnt                       ; -English table of contents

- -

    l_en_usa.hlp   -                    ; -English help file

- -

    l_en_usa.ini                       ; -English

- -

    l_es_esp.ini                       ; -Spanish

- -

    l_fr_fra.ini                       ; -French

- -

    l_it_ita.ini                       ; -Italian

- -

    l_nl_nld.ini                       ; -Dutch

- -

    l_pt_bra.ini                       ; -Portuguese-Brazilian

- -

  -  memgrp.dll                         ; -Group-4 support

- -

    readme.txt                         ; -the old readme file

- -

 

- -

A 5.x installation consists of the following -files, which are placed in the %win%\twain_32\kodak\kds directory:

- -

 

- -

    a shortcut to -const.ini            ; -shortcut to driver configuration settings

- -

    a shortcut to -kds.log     -         ; shortcut to driver log

- -

    a shortcut to -ramscan.txt          ; shortcut to -simulator settings

- -

    a shortcut to setup001.ini -        ; shortcut to GUI snapshot of last -session

- -

    hippo.dll                          ; -image processing library

- -

    kds.ds                             ; -the driver

- -

    kdscust.h                          ; -custom TWAIN capabilities

- -

    kdstst.exe                         ; -KODAK diagnostic tool

- -

    l_en_usa.hlp   -                    ; -English help file

- -

  -  memgrp.dll                         ; -Group-4 support

- -

    readme.txt                         ; -the old readme file

- -

 

- -

 A 6.x installation consists of the -following files, which are placed in the %win%\twain_32\kodak\kds_ixxxx directory:

- -

 

- -

    a shortcut to -const.ini            ; -shortcut to driver configuration settings

- -

    a shortcut to -kds.log     -         ; shortcut to driver log

- -

    a shortcut to ramscan.txt  -        ; shortcut to simulator settings

- -

    a shortcut to setup001.ini -        ; shortcut to GUI snapshot of last -session

- -

    hippo.dll                          ; -image processing library

- -

    -kds.ds                             ; -the driver

- -

    kdscust.h                          ; -custom TWAIN capabilities

- -

    -kdstst.exe                         ; -KODAK diagnostic tool

- -

    l_en_usa.hlp   -                    ; -English help file

- -

    -readme.txt                         ; -the old readme file

- -

 

- -

A 7.x installation consists of the following -files, which are placed in the %win%\twain_32\kodak\kds_ixxxx directory:

- -

 

- -

       help                               -; help directory

- -

        -ch_chn.chm                     ; -Simplified Chinese help file

- -

        ch_twn.chm                     ; -Traditional Chinese -help file

- -

        -de_deu.chm                     ; -German help file

- -

        -en_usa.chm   -                  ; -English help file

- -

        en_usa.chm                     ; -English help -file

- -

        -es_esp.chm                     ; -Spanish help -file

- -

        -fr_fra.chm                     ; -French help file

- -

        -it_ita.chm                     ; -Italian help file

- -

        -nl_nld.chm                     ; -Dutch help file

- -

        -pt_bra.chm                     ; -Portuguese-Brazilian  help file

- -

    lib                                  -; lib directory

- -

        -i1200_i1300.ekpgct             ; -colortable package

- -

        -hippo.dll                      ; -image processing library

- -

        -firmware.dll                   ; -firmware library

- -

        ecdo                           -; ecdo directory

- -

            -GreenDefault.ekpgcd        -; default green color dropout

- -

            -BlueDefault.ekpgcd         -; default blue color dropout

- -

            -RedDefault.ekpgcd          -; default red color dropout

- -

    a shortcut to kds_ixxx     -        ; shortcut to driver log directory

- -

    const.ini    -                      -; driver configuration settings

- -

    -kds.ds                             ; -the driver

- -

    kdscust.h                          ; -custom TWAIN capabilities

- -

    -kdstst.exe                         ; -KODAK diagnostic tool

- -

    -twaingui.exe                       ; -the driver gui

- -

 

- -

A 8/9.x installation consists of the -following files, which are placed in the %win%\twain_32\kodak\kds_ixxxx directory:

- -

 

- -

       help                               -; help directory

- -

        -ch_chn.chm                     ; -Simplified Chinese help file

- -

        ch_twn.chm                     ; -Traditional Chinese -help file

- -

        -cs_cze.chm                     -; Czech help file

- -

        -de_deu.chm                     ; -German help file

- -

        -en_usa.chm   -                  ; -English help file

- -

        es_esp.chm                     ; -Spanish help -file

- -

        -fr_fra.chm                     ; -French help file

- -

        -it_ita.chm                     ; -Italian help file

- -

        -jp_jpn.chm                     -; Japanese help file

- -

        -ko_kor.chm                     -; Korean help file

- -

        -nl_nld.chm                     ; -Dutch help file

- -

        -pt_bra.chm                     ; -Portuguese-Brazilian  help file

- -

        -ru_rus.chm                     ; -Russian help file

- -

        -tr_tur.chm                     ; -Turkish help file

- -

    -install                            -; installation directory

- -

        -install.log                    -; Installations log file

- -

        -UNWISE.EXE                     -; Uninstall executable

- -

    -profiles                           -; Predefined profiles directory

- -

        -<model>                        -; model directory          

- -

    a shortcut to kds_ixxx     -        ; shortcut to driver log directory

- -

    -kds.ds                             ; -the driver

- -

    -kdstst.exe                         ; -KODAK diagnostic tool

- -

    -twaingui.exe                       ; -the driver gui

- -

 

- -

and all the lib files is installed in the -%win%\system32\kodak\kds_ixxxx -directory

- -

 

- -

       wiamini.dll                                         -; WIA -mini-driver (interface layer)

- -

    wiascnrwia.dll                                    -; WIA -mini-driver (scanner layer)

- -

    -lib                                ; -lib directory

- -

        -i1400.ekpgct      -             ; -colortable package

- -

        -hippo.dll                      ; -image processing library

- -

        -firmware.dll                   ; -firmware library

- -

        ecdo                           -; ecdo directory

- -

            -GreenDefault.ekpgcd        -; default green color dropout

- -

            -BlueDefault.ekpgcd         -; default blue color dropout

- -

            -RedDefault.ekpgcd          -; default red color dropout

- -

 

- -

A 10.x installation consists of the following -files, which are placed in the %win%\twain_32\kodak\kds_ixxxx directory:

- -

 

- -

       install

- -

        -install.log                    -; Installations log file

- -

        -installopenmp.log              -; Openmp log file       -

- -

    a shortcut to kds_ixxx     -        ; shortcut to driver log directory

- -

    -kds.ds                             ; -the driver

- -

    -kdstst.exe                         ; -KODAK diagnostic tool

- -

 

- -

and all the lib files is installed in the -%win%\system32\kodak\kds_ixxxx -directory

- -

 

- -

       wiamini.dll                                         -; WIA -mini-driver

- -

    -lib                                ; -lib directory

- -

        device.dll              -       ; device library

- -

        -devicemanager.dll       -       ; device manager library

- -

        -driver.dll              -       ; driver library

- -

        -hippo.dll               -       ; image processing library

- -

        ixxx.ekpgct      -            -  ; colortable package

- -

        -osjit.dll               -       ; Os just in time

- -

        -twaingui.exe            -       ; driver gui -

- -

        ecdo                           -; ecdo directory

- -

            -BlueDefault.ekpgcd         -; default blue color dropout

- -

            -GreenDefault.ekpgcd        -; default green color dropout

- -

            -RedDefault.ekpgcd          -; default red color dropout

- -

             -help                            ; -help directory

- -

            -ch_chn.chm                  -; Simplified Chinese help file

- -

            -ch_twn.chm                  ; -Traditional Chinese -help file

- -

            -cs_cze.chm                  ; -Czech help file

- -

            -de_deu.chm                  ; -German help file

- -

            -en_usa.chm                  ; -English help file

- -

            -es_esp.chm                  ; -Spanish help -file

- -

            -fr_fra.chm                  ; -French help file

- -

            -it_ita.chm                  ; -Italian help file

- -

            -jp_jpn.chm                  ; -Japanese help file

- -

            -ko_kor.chm                  ; -Korean help file

- -

            -nl_nld.chm                  ; -Dutch help file

- -

            -pt_bra.chm                  ; -Portuguese-Brazilian  help file

- -

            -ru_rus.chm                  ; -Russian help file

- -

            -tr_tur.chm                  ; -Turkish help file

- -

        -profiles                        -; Predefined profiles directory

- -

            -20060526175022901.profile   ; Black and White Document

- -

            -20060526175022902.profile   ; Black and White Document (OCR Quality)

- -

            -20060526175022903.profile   ; Color Document

- -

            -20060526175022904.profile   ; Color Document (OCR Quality)

- -

            -20060526175022905.profile   ; Color Photograph

- -

            -bitonaldocument.png         ; Black and -white document graphic file

- -

            -bitonaldocumentocr.png      ; Black and white document OCR -graphic file

- -

            -colordocument.png           ; -Color document graphic file

- -

            -colordocumentocr.png        ; Color document OCR -graphic file

- -

            -colorphoto.png           -   ; Color photograph graphic file

- -

            -default.png              -   ; Default graphic file

- -

        -sounds                          -; Multifeed sounds

- -

            -ding.wav                 -   ; Ding sound

- -

 

- -

A 12.x installation consists of the following -files, which are placed in the %win%\twain_32\kodak\kds_ixxxx directory:

- -

 

- -

       install

- -

        -install.log                    -; Installations log file

- -

        -installopenmp.log              -; Openmp log file       -

- -

    a shortcut to kds_ixxx     -        ; shortcut to driver log directory

- -

    -kds.ds                             ; -the driver

- -

 

- -

and all the lib files is installed in the -%win%\system32\kodak\kds_ixxxx -directory

- -

 

- -

       wia.dll                                          -; WIA driver -file

- -

       wiaentry.dll                                       -; WIA driver -file

- -

    -lib                                ; -lib directory

- -

        -device.dll              -       ; device library

- -

        -devicemanager.dll       -       ; device manager library

- -

        -driver.dll              -       ; driver library

- -

        -hippo.dll               -       ; image processing library

- -

        ixxx.ekpgct      -            -  ; colortable package

- -

        -lexexe.exe              -       ; image processing library file

- -

        -osjit.dll               -       ; Os just in time

- -

        -setup.txt               -       ; versions file

- -

        -twaingui.exe            -       ; driver gui -

- -

        twaingui.exe.config      -      ; driver gui file

- -

        -vcomp100.dll            -       ; image processing library file

- -

        ecdo                           -; ecdo directory

- -

            -BlueDefault.ekpgcd         -; default blue color dropout

- -

            -GreenDefault.ekpgcd        -; default green color dropout

- -

            -RedDefault.ekpgcd          -; default red color dropout

- -

            -McdoKodakMultiColor.ekpgcd ; multi-color dropout

- -

            -McdoKodakSingleColor.ekpgcd; single-color dropout

- -

             -help                            ; -help directory

- -

            -ch_chn.chm                  -; Simplified Chinese help file

- -

            -ch_twn.chm                  ; -Traditional Chinese -help file

- -

            -cs_cze.chm                  ; -Czech help file

- -

            -de_deu.chm                  ; -German help file

- -

            -en_usa.chm   -               ; -English help file

- -

            -es_esp.chm                  ; -Spanish help -file

- -

            -fr_fra.chm                  ; -French help file

- -

            -it_ita.chm                  ; -Italian help file

- -

            -jp_jpn.chm                  ; -Japanese help file

- -

            -ko_kor.chm                  ; -Korean help file

- -

            -nl_nld.chm                  ; -Dutch help file

- -

            -pt_bra.chm                  ; -Portuguese-Brazilian  help file

- -

            -ru_rus.chm                  ; -Russian help file

- -

            -tr_tur.chm                  ; -Turkish help file

- -

        -profiles                        -; Predefined profiles directory

- -

            -20060526175022901.profile   ; Black and White Perfect Page Document

- -

            -20060526175022903.profile   ; Color Perfect Page Document

- -

            -20060526175022905.profile   ; Color Photograph

- -

            -bitonaldocument.png         ; Black and -White Perfect Page Document graphic file

- -

            -colordocument.png           ; -Color Perfect Page Document graphic file

- -

            -colorphoto.png           -   ; Color photograph graphic file

- -

            -default.png              -   ; Default graphic file

- -

        -sounds                          -; Multifeed sounds

- -

            -ding.wav                 -   ; Ding sound

- -

 

- -

The KDS memory manager is installed in the -%win%\system32 directory.

- -

 

- -

    kdsmm.sys                          ; -memory management

- -

 

- -

The following freely distributable file from -Intel is placed in the %win%\system32 directory for Microsoft NT type OS's and -the %win%\system directory for Microsoft Windows 9x OS's.  This library is -built static into version 6.x and greater.

- -

 

- -

    ijl15.dll                          ; -JPEG support

- -

 

- -

 

- -

1.2 -Installing Previous Versions

- -

If for some reason it is necessary to install -a previous version of the Source, the user must remove the current installation -first.  Refer to the section on "Uninstalling the Driver."

- -

 

- -

 

- -

1.3 -Uninstalling the Driver

- -

The preferred method is to go into Add/Remove -Programs under the Control Panel, and remove either Host Diagnostics or -SVT.  Note that if both are installed on a system then uninstalling either -one will result in the removal of the TWAIN driver, making the remaining -application unusable.  For 5.x drivers Add/Remove Programs will list the -individual drivers installed (e.g. Kodak i620/i640/i660 Scanner).  -Removing this from the list will only uninstall the driver and the writeable -data that goes with it.  All other installed Kodak scanner drivers will -remain.  With 5.x, SVT will only be uninstalled when the last Kodak -Scanner driver is uninstalled.

- -

 

- -

If Add/Remove Programs does not exist, or -there is a need to just get rid of TWAIN (perhaps as part of a version -rollback) the quickest way to do this is to go to  %win%\twain_32\kodak and delete the appropriate kds -directory(s).  Do not forget about the writeable data directory.  -Check the shortcuts to see where it is located.

- -

 

- -

 

- -

1.4 -Removing KDSMM

- -

KDSMM is used by the system to allocate the -large blocks of memory needed by the scanners to perform at their maximum -speeds.  If it is absolutely necessary to stop using this driver it can be -turned off by deleting or renaming the KDSMM.SYS in the %win%\system32\drivers -directory.

- -

NOTE: turning this driver off will prevent the -TWAIN driver from running at its maximum speed.

- -

 

- -

 

- -

2.0 -Troubleshooting

- -

This section addresses problems that may come -up when using the driver, and offers some possible actions that users must -attempt before calling for support.

- -

 

- -

 

- -

2.1 -Application Cannot Find Source

- -

There are four reasons that an Application -may be unable to locate the Source.

- -

 

- -

1) The Source must be located in the proper -directory, which is:  %win%\twain_32\kodak\kds

- -

 

- -

2) A needed DLL may be missing.  The -Source relies on the presence of the following DLL's:  kernel.dll, -user32.dll, gdi32.dll, comctl32.dll, comdlg32.dll, advapi32.dll, shlwapi.dll, -shell32.dll, winspool.drv, twain_32.dll, wnaspi32.dll.

- -

 

- -

3) Some or all of %win%\twain_32\kodak\kds is write -protected.  See section 3.2 for a possible way around this.

- -

 

- -

4) The Application may not be setting the appIdentity.SupportedGroups to DG_CONTROL | DG_IMAGE when -looking for the available Sources.  Or the Application may not have set #pragma pack(2) in the correct places.  Consider these -possibilities last, and only if you are writing your own Application.

- -

 

- -

 

- -

2.2 -Real-Time Display Problem

- -

If your application does a real-time display -of images on the fly, it's possible that you may see pauses in the display, -even though the scanner and software are running at rated speed.

- -

 

- -

The Source polls for images on the scanner, -and if none are found it sleeps for a specified period of time, and then tries -again.  This behavior is PC friendly in that it consumes fewer clock -cycles on the PC and issues fewer commands to the scanner.  However, if -the application is displaying each image in real-time, it can result in a display -that appears to start and stop for no apparent reason.

- -

 

- -

One possible solution is to adjust the PollSleep value.  Edit the CONST.INI field, and under -the [dsIdentity] section add the line:

- -

 

- -

            -PollSleep=100

- -

 

- -

This specifies a sleep value of 1/10th of a -second.  Adjusting this value can result in a smoother real-time -display.  Be careful of using low values, since they can impact the -performance of the system.

- -

 

- -

 

- -

2.3 -Application Hangs When Trying To Scan

- -

The TWAIN Working Group specifies that the -Source Manager Files (see Section 1.2) are supposed to reside in the main -Windows directory.  Some Sources and Applications, though, make the -mistake of installing these files in the Windows System directory (System on -Windows 9x/ME, System32 on Windows NT/2K/XP).

- -

 

- -

This can lead to a situation where the Source -and the Application end up accessing different copies of the Source Manager, -which leads to hangs or crashes.  If this situation is suspected, examine the -System and System32 directories for occurrances of -the files listed in Section 1.2, and remove them.

- -

 

- -

The installation of the Source does this -automatically.

- -

 

- -

 

- -

2.4 -TWAIN Opens Very Slowly

- -

We have seen instances with Windows 2000 -running virus scanning software where TWAIN seems to open very slowly.  At -this point we suspect some interaction between the virus checking software, -Windows and the TWAIN DSM (twain_32.dll).  There is no known fix at this -time, other than to turn off the virus scanning software.

- -

 

- -

 

- -

2.5 -System cannot find KDS.DLL

- -

KDS.DLL was used in the 1.x version of the -Source, and is no longer needed.  If you see it or any file in the KDS -directory ending in a .DS extension other than KDS.DS, then a re-install is -recommended.  Manually delete the %win%\twain_32\kodak\kds directory first, and after the install is complete the -problem will be fixed.

- -

 

- -

 

- -

2.6 -1394/SBP2 Issues

- -

During the course of development of the i200 -it was discovered that many OHCI compliant 1394 adapter cards carry a critical -bug that can result in a fatal communication error.

- -

 

- -

This bug appears during scanning, terminating -a session with paper left in the transport and the red light lit.  -Examination of the scanner log will reveal that a "Chipset Error" has -occurred.

- -

 

- -

As of this writing (September 2006) the only -recommended 1394 card for use is the one provided in the box with the -i200/i600/i1800 scanner.  If this error occurs please confirm that the -correct card is installed and in use in the PC before contacting your Kodak -Representative for assistance.

- -

 

- -

If the PC is a Pentium-III with a VIA -chipset, then the use of the 1394 card supplied with the scanner is not enough -to solve the problem.  Please contact your Kodak Service Representative -for more information.

- -

 

- -

Also note that any other information on this -issue that may be provided in the box with your scanner or on the Kodak website -should be considered more current than this section.

- -

 

- -

 

- -

2.7 -Platen Autocrop/Deskew

- -

Performing autocrop -and deskew functionality is somewhat different for -the platen than it is for the transport.  Most notably, the platen is far -more likely to gather dust and dirt that can impact the ability of the system -to locate the real image.  Regular cleaning of the platen is important if using -autocrop and deskew.

- -

 

- -

Also be sure to check the black background on -the platen cover.  This material can be wiped off with glass cleaner.

- -

 

- -

It is also important to perform regular -calibrations of the feeder and platen systems.  Image calibration can be accessed -through the Calibrate... button on the TWAIN driver's Imaging Tab.  If -your application does not give you access to this function, run the Scan -Validation Tool that was installed from the CD that came with your scanner.

- -

 

- -

If you are having problems getting autocrop and deskew to work -properly, or if the feeder (ADF) to flatbed mode is not performing as well as -it should off the platen, then try editing the CONST.INI file and adjusting the -following value:

- -

 

- -

            -ForceBaffleBlackPlatenAdjustment=60

- -

 

- -

Larger values will remove traces of dust and -light scatter that show up as false image data.  Smaller values will do -better at handling images with dark backgrounds.  Valid values are 0 - 255 -(though 128 is really the practical limit).  When experimenting, make sure -that the lamps have warmed up for at least a minute.

- -

 

- -

 

- -

2.8 -The SETUP001.INI File

- -

The TWAIN Specification requires that -applications save their GUI settings, so the user gets a better experience from -session to session.  Unfortunately, little guidance is given in how to -integrate this feature into the rest of the driver behavior.  At the time -of its creation, the following scheme was selected for this driver.

- -

 

- -

SETUP001.INI only records a session if the -drivers GUI is raised by the application, and then only if the user selects -the OK or SCAN button (depending on the kinds of GUI brought up).  The -values saved reflect some, but not all, of the values shown on the GUI.  -The format of the data looks very similar to the output of the DG_CONTROL / -DAT_CUSTOMDSDATA / MSG_SET call, but fewer items are saved.

- -

 

- -

When a new session is started the -SETUP001.INI file is loaded, overriding the power-on defaults for the -driver.  No attempt is made to test which application generated the SETUP001.INI -file, so it is possible to use one application to create the file that is read -by another.  This is deliberate.  When the driver was first created -there was a 50/50 split for application writers to use the GUI versus -programmatic control, and the programmatic applications generally used the -standard TWAIN capabilities, never any custom capabilities.  The intention -of the SETUP001.INI file was to allow an end-user to set custom capabilities -from the GUI and have those values remain intact when working with their -preferred application.

- -

 

- -

This scheme may cause problems with some -programmatic applications, especially if they make assumptions about the -default values.  If you suspect this is happening we recommend editing the -SETUP001.INI file, deleting everything after the first set of comments.  -Save the results, then make the file read-only (this can be done from Windows -Explorer, just right-click the mouse on the name of the file and select -Properties from the menu; the read-only flag will appear on the Properties -dialog); doing this will guarantee that every invocation of the driver will -come up with the power-on defaults.

- -

 

- -

One final note:  the SETUP001.INI is not -a replacement for the DG_CONTROL / DAT_CUSTOMDSDATA / MSG_SET operation.  -If you wish to write an application that sets the driver using profiles, then -you must use DG_CONTROL / DAT_CUSTOMDSDATA / MSG_SET to do it.

- -

  

- -

 

- -

2.9 ICAP_UNITS Causing Problem

- -

Version 9.54 and newer (as well as version -4.x and earlier) drivers will default ICAP_UNITS to TWUN_INCHES. The ForceUnits* overrides mentioned below, will no longer be -supported as they are no longer needed (i.e. skip the rest of this section).

- -

 

- -

Version 5.x through 9.53 drivers will set the -ICAP_UNITS default based on the PCs locale, which means that languages like -French will default to TWUN_CENTIMETERS. If this causes problems, the default -units can be overridden using the ForceUnitsInches=1 -in the const.ini file. This will overwrite the current ICAP_UNITS to inches.

- -

 

- -

Certain applications do not check the units -when acquiring TW_IMAGEINFO->XResolution, and -therefore save the wrong resolution in the image header.  If this causes -problems the units in which TWAIN reports this value can be overridden using -the ForceUnitsBehavior in the const.ini file. This -field has the following values:

- -

 

- -

ForceUnitsBehavior=0    -; negotiate TW_IMAGEINFO->XResolution in the -current driver units (old/default behavior)

- -

ForceUnitsBehavior=1    -; negotiate TW_IMAGEINFO->XResolution in -ICAP_UNITS last set by the application (default TWUN_INCHES)

- -

ForceUnitsBehavior=2    -; negotiate TW_IMAGEINFO->XResolution in -ICAP_UNITS last set or read by the application (default TWUN_INCHES)

- -

 

- -

The application Imaging for Windows never -sets ICAP_UNITS and always expects TW_IMAGEINFO->XResolution -in TWUN_INCHES.  Therefore ForceUnitsBehavior -will default to 1 for this application to force the desired result.

- -

 

- -

2.10 CAP_PRINTERINDEX Persistence

- -

Printer index persists differently depending -on the driver version and scanner.  Versions 5.x and 6.x of the driver -will always remember printer index across scan sessions.  Version 4.x of -the driver should work this way for all scanners but may not in a few -instances.

- -

 

- -

The TWAIN driver will not remember the -printer index across driver sessions.  This value is lost each time the -driver is unloaded.  An exception to this rule is the i800 scanners which -store the printer index internally, so when the driver is reloaded it is able -to acquire the last value from the scanner.

- -

 

- -

3.0 -Development

- -

This section contains details on features -that developers can use to help write applications using this Source.

- -

 

- -

 

- -

3.1 -Scanner Simulator

- -

The Scanner Simulator is a tool that allows -developers to use the TWAIN Source when no physical scanner is available.

- -

 

- -

The previous mechanism for running the RAM -Scanner has been removed from the Source.  If you were using the RAM -Scanner prior to version 1.2.15, please delete any files of the form kds_*ram.ds from your -%win%\twain_32\kodak\kds -directory (the installation should do this for you).

- -

 

- -

The new Scanner Simulator mechanism is driven -from the ramscan.txt found in %win%\twain_32\kodak\kds_*.

- -

 

- -

For 4.x drivers the scanner selection is done -at the top of the ramscan.txt.  For 5.x drivers the scanner selection is -done in the const.ini file.  To enter into simulation mode edit the -appropriate file and change the 'Simulate' line to the desired model number -(ex: i640).

- -

 

- -

To turn off simulation mode, set the -'Simulate' value back to zero.

- -

 

- -

Images generated by the Scanner Simulator -reflect the current settings for ICAP_COMPRESSION (Uncompressed, Group-4 and -JPEG only);       ICAP_PIXELFLAVOR and -ICAP_FRAMES.

- -

 

- -

It is also possible to display images from -files on disk.  The method for doing this is documented in ramscan.txt.

- -

 

- -

The sequence of events in a simulated session -are controlled using the @-commands at the bottom of the file.  These -commands are fully documented in ramscan.txt.

- -

 

- -

 

- -

3.2 -KDS_HOMEDIR

- -

This section should no longer be needed, -since the TWAIN writeable data files are now installed outside of the Windows -directory.  However, KDS_HOMEDIR is still recognized by the system, so -this section is left intact for those users who may have an existing dependency -on it.

- -

 

- -

Environments where the user is prevented from -writing into the %win% directory (such as secure configurations of NT/2K/XP), -require that the following files be moved from the %win%\twain_32\kodak\kds directory, to some -other writeable directory:

- -

 

- -

    const.ini

- -

    l_ch_chn.ini

- -

    l_ch_twn.ini

- -

    l_de_deu.ini

- -

    l_en_usa.cnt

- -

    l_en_usa.hlp

- -

    l_en_usa.ini

- -

    l_es_esp.ini

- -

    l_fr_fra.ini

- -

    l_it_ita.ini

- -

    l_nl_nld.ini

- -

    l_pt_bra.ini

- -

    ramscan.txt

- -

    setup001.ini

- -

 

- -

It is then necessary to create an environment -variable KDS_HOMEDIR, which contains the full path to the new location of these -files.

- -

 

- -

The logfile -(kds.log), if created, will appear in this alternate directory.

- -

 

- -

 

- -

3.3 -DEBUG / DEBUGFILTER

- -

Users must not modify any of the Source's -data files without consulting with Eastman Kodak Company.  However, there -may be times during development when it is advantageous to get a snapshot of -the operation of the Source.  To do this, edit the const.ini file and look -for the Debug variable and set the value to two (2) or one (1) depending on -whether you are trying to catch an intermittent log message, or generate an -exhaustive dump of the operation of the Source.

- -

 

- -

Filtering the log file (kds.log) for occurrances of the string 'kdsdat' -will help to isolate those messages that relate to TWAIN communication between -the Application and the Source.

- -

 

- -

If sending a log to Eastman Kodak Company the -most useful selection is typically the following for a 4.x or earlier version -of the driver:

- -

 

- -

            -Debug=1

- -

            -DebugFilter=kdsdat kdshal kdsprot

- -

 

- -

For 5.x and later, please use the following:

- -

 

- -

            -Debug=1

- -

            -DebugFilter=TWAIN WIRE

- -

 

- -

Please note, the Source is designed to run in -production mode with the Debug variable set to zero (0), two (2), four (4) or -six (6); any other value will adversely affect the performance of the Source -and most likely use a great deal of disk space.

- -

 

- -

 

- -

3.4 -ICAP_XFERMECH

- -

The Source works best with an ICAP_XFERMECH -of TWSX_MEMORY.  TWSX_NATIVE transfers and TWSX_FILE transfers with an -image file format of TWFF_BMP require the Source to flip the image around the -x-axis.  In all cases the Source is able to keep up with the rated speed -of the scanner.  Efficiency is measured in terms of the number of amount -of time left to do work on each image before the application must proceed to -the next image. See ICAP_COMPRESSION for other restrictions.

- -

 

- -

 

- -

3.5 -KDSTST.EXE

- -

This program is not meant for general use, it -is a test tool that Eastman Kodak Company may use in the course of debugging -user problems.  Users should not run this program unless directed to do so -by Eastman Kodak Company. 

- -

 

- -

 

- -

3.6 -Custom Capabilities

- -

The scanner supported by this Source provides -some features and capabilities that go beyond what is described in the TWAIN -Specification.

- -

 

- -

The header file describing these features is kdscust.h, which is installed in the %win%\twain_32\kodak\kds directory.  -Developers should copy this file to their application build location, and use -it to access the Source's custom features.

- -

 

- -

Note: the #include for this file is best -placed immediately after the #include for twain.h

- -

 

- -

 

- -

3.7 -Force Compression

- -

Most older TWAIN applications are only -capable of processing uncompressed data.  The scanner is capable of -delivering uncompressed images at its rated speed, however moving uncompressed -data takes longer than moving compressed data, and there may be times when an -application needs to get all the processing time that it can for its own -operations.

- -

 

- -

Force Compression is a custom -capability.  It is available both programmatically and in the GUI, however -access to the GUI is turned off by default.  To activate it the user must -edit the const.ini file and set the value of ForceCompression -to 1.  This will result in the appearance of the ForceCompression -option on the driver's Compression tab.

- -

 

- -

If ICAP_COMPRESSION is set to TWCP_NONE for a -given camera, then Force Compression may be set to either TWCP_GROUP4 (for bitonal cameras) or TWCP_JPEG (for color cameras).  -When this is done the Source will force the scanner to use the specified -compression, but will internally decompress the image and pass along the -uncompressed data to the application.  If the value of ICAP_COMPRESSION is -set to anything other than TWCP_NONE, then the value of ICAP_FORCECOMPRESSION -is ignored, no matter what its current setting.

- -

 

- -

Users should only activate this option if -they are working with uncompressed data and are seeing the scanner transport -pausing because of buffer full conditions.  Force Compression allows -smaller images to be passed across SCSI, but at the cost of more processing per -image as it decompresses each one before passing it to the application.  -For this reason Force Compression is only recommended for fast machines with a -generous amount of RAM.

- -

 

- -

From the application's point of view the -Source has been set to obtain uncompressed data, and that is what it -delivers.  At no time does an application have to be aware that force -compression is in effect (unless it is driving the use of this feature -programmatically).

- -

 

- -

Also, please note: Group4 compression is -lossless, the decompressed images are exactly the same as if they had been -scanned uncompressed.  JPEG compression is lossy; -the decompressed images are NOT exactly the same as if they had been scanned -uncompressed.

- -

 

- -

i800 series:  These scanner models are -only capable of outputting JPEG compressed images, so ForceCompression -is the only way to get uncompressed images from the Source.  Therefore ForceCompression is activated at all times for these -scanners.  Support for uncompressed images is provided to maximize the -base of supported TWAIN applications, but it is not a recommended mode for use -with the i800 scanners, which are capable of producing huge amounts of large -color images very quickly.

- -

 

- -

 

- -

3.8 -Force Version (3590 only, 1.x firmware)

- -

The JFIF files created by the scanner -currently have an embedded revision of 1.2.  If an application is using an -ICAP_XFERMECH value of TWSX_FILE to transfer the images with a file format of -TWFF_JFIF, then the JFIF files created by the scanner are dumped straight to -disk.  In some rare cases there may be applications that have problems with -the embedded revision value.  If this situation is encountered it is -possible to change the value of the revision to 1.1 through use of ForceVersion.  The value should be added to the -const.ini file after the occurrence of ForceCompression -and should have the value of:  ForceVersion=257

- -

 

- -

 

- -

3.9 -Force Resolution (3590 only, 1.x firmware)

- -

The JFIF files created by the scanner -currently have an embedded unit of 0, with the density fields used to indicate -a square aspect ratio.  If an application is using an ICAP_XFERMECH value -of TWSX_FILE to transfer the images with a file format of TWFF_JFIF, then the -JFIF files created by the scanner are dumped straight to disk.  In some -cases there may be applications that want to know what the scanned resolution -of the image was. If this situation is encountered it is possible to have the -Source tweak the header so that the units field is set to 1 (dots per inch) and -the density fields are set to the value of ICAP_XRESOLUTION/ICAP_YRESOLUTION -for the image.  This alternate behavior may be activated through use of ForceResolution.  The value should be added to the -const.ini file after the occurrence of ForceCompression -and should have the value of:  ForceResolution=1

- -

 

- -

 

- -

3.10 ICAP_PIXELTYPE -(3590/4500/i200/i600/i700/i820/i840/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000)

- -

The 3590C uses ICAP_PIXELTYPE to switch -between the /Camera_Bitonal_Both and the /Camera_Color_Top cameras (it's still possible to do this -with the DAT_FILESYSTEM command, if necessary).  ICAP_PIXELTYPE also -switches the "Start in color mode" flag on the GUI back and forth -(for the 3590 only, TWPT_BW turns it off, TWPT_RGB turns it on).

- -

 

- -

Please note that prior to 4.x ICAP_PIXELTYPE -was not setting the CAP_CAMERAENABLE flag for the affected cameras.  The -result is that the 3590 was the only scanner that performed correctly when -setting ICAP_PIXELTYPE. 

- -

 

- -

Beginning with 4.x CAP_CAMERAENABLE is set -for the affected cameras, and the GUI will reflect the current setting of -ICAP_PIXELTYPE by placing the selection on the appropriate camera.

- -

 

- -

Setting ICAP_PIXELTYPE has the following -affect in 4.x and higher:

- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

ICAP_PIXELTYPE

-
-

Cameras Enabled*

-
-

Cameras Disabled*

-
-

New FileSystem

-
-

ICAP_GRAYSCALE

-
-

ICAP_BITDEPTH

-
-

TWPT_RGB

-
-

Color Front/Rear

-
-

Bitonal Front/Rear

-
-

/Camera_Color_Both

-
-

FALSE

-
-

24

-
-

TWPT_GRAY

-
-

Color Front/Rear

-
-

Bitonal Front/Rear

-
-

/Camera_Color_Both

-
-

TRUE

-
-

8

-
-

TWPT_BW

-
-

Bitonal Front/Rear

-
-

Color Front/Rear

-
-

/Camera_Bitonal_Both

-
-

FALSE

-
-

1

-
- -

*Cameras Enabled -> CAP_CAMERAENABLE = TRUE

- -

 

- -

Do not to mix ICAP_PIXELTYPE with -DAT_FILESYSTEM, CAP_CAMERAENABLE, ICAP_GRAYSCALE.  If the above table -represents desired settings, ICAP_PIXELTYPE is the easiest way to get the desired -outputs.  Otherwise use DAT _FILESYSTEM, CAP_CAMERAENABLE, and -ICAP_GRAYSCALE to negotiate which output streams to receive.

- -

 

- -

Setting ICAP_GRAYSCALE will change the -ICAP_PIXELTYPE and ICAP_BITDEPTH settings for that camera, but not change the -current file system or enable/disable cameras.

- -

Setting ICAP_BITDEPTH will change the -ICAP_PIXELTYPE and ICAP_GRAYSCALE settings for that camera, but not change the -current file system or enable/disable cameras.

- -

Please reference TWAIN_ProgrammaticControl.htm for -which settings are valid on which file systems.

- -

 

- -

 

- -

3.11 -Width and Length Alignment

- -

The Kodak Document Scanners require the width -of all images to be aligned on 16-bit boundaries.  It requires the height -of color images to be aligned on 8-bit boundaries.  The Source provides -this on behalf of the user, but needs to go beyond it to 32-bit width alignment -for some image transfer modes.

- -

 

- -

The table breaks this down, showing the required -alignments for the width and the height for bitonal -and color images for each transfer mode.  Again, the Source will make -these corrections for you, after negotiation, when the values are downloaded to -the scanner.  The width and height dimensions returned by DAT_IMAGEINFO -will reflect the final adjustments:

- -

 

- -

ICAP_XFERMECH -&                -Bitonal -Alignment            -Color Alignment

- -

ICAP_COMPRESSION               -Width x -Height               -Width x Height

- -

TWSX_MEMORY

- -

  -TWCP_NONE                     16 -x -1               -        16 x 8

- -

  -TWCP_GROUP31D                 -16 x -1               -        n/a

- -

  -TWCP_GROUP32D                 -16 x -1                       n/a

- -

  -TWCP_GROUP4                   16 -x -1                       n/a

- -

  -TWCP_JPEG                     n/a                          16 -x 8

- -

 

- -

TWSX_NATIVE

- -

  -TWCP_NONE                     32 -x -1*                      32 -x 8*

- -

 

- -

TWSX_FILE

- -

  BMP

- -

    -TWCP_NONE                   32 -x -1*                      32 -x 8*

- -

  TIFF

- -

    -TWCP_NONE                   32 -x -1**                     32 -x 8**

- -

    -TWCP_GROUP31D               -16 x -1                       n/a

- -

    -TWCP_GROUP32D               -16 x -1               -        n/a

- -

    -TWCP_GROUP4                 16 -x -1                       n/a

- -

    -TWCP_JPEG                   n/a                          16 -x 8

- -

  JFIF

- -

  -  TWCP_JPEG                   n/a                          16 -x 8

- -

 

- -

* - DIBs must be aligned on LONG (32-bit) -boundaries.

- -

 

- -

** - TIFF can handle 16-bit alignment, but -because the image format can be selected after the image is scanned the Source -has to protect itself and default to 32-bit alignment.  This behavior can -be overridden by going into CONST.INI and adding the line:

- -

            - ForceAlignment=1

- -

Under the [dsIdentity] -section.  This will allow for 16-bit aligned TIFF files to be -created.  Note, however, that doing this will result in 16-bit aligned -images if the format is changed to BMP.

- -

 

- -

Note: At 150 DPI it is not possible to get -exactly 12" of width or 26" of height.  And, since it is not -possible to exceed these values, in this case the Source automatically -truncates down to the nearest alignment boundary (as appropriate) in order to -produce correct images.

- -

 

- -

Note: Auto cropped images may result in output -that is 16-bit aligned.  The Source will correct these for uncompressed -data, but will take no action on compressed images.  In this latter case -the necessary correction must be taken by the application.

- -

 

- -

 

- -

3.12 -Polarity

- -

Polarity on the IMAGING tab is a -misnomer.  The field shows the current setting of ICAP_PIXELFLAVOR, with -"Black on White" corresponding to TWPF_CHOCOLATE (the

- -

default), and "White on Black" -corresponding to TWPF_VANILLA.

- -

 

- -

The breakdown of what this means for -uncompressed images is as follows:

- -

 

- -

                                    -white pixel         black pixel

- -

TWCP_CHOCOLATE     -1              -        0

- -

TWCP_VANILLA            -0              -        1

- -

 

- -

Unfortunately, in the case of images -compressed with TWCP_GROUP31D, TWCP_GROUP32D and TWCP_GROUP4, the sense (as -perceived by most viewers) has to be as follows:

- -

 

- -

                                    -white pixel         black pixel

- -

TWCP_CHOCOLATE     -0              -        1

- -

TWCP_VANILLA            -0              -        1

- -

 

- -

This becomes most apparent for images -transferred using TWSX_FILE with an image file format of TWFF_TIFF.  Many -viewers ignore the PhotometricInterpretation tag, so -that a correctly constructed TWCP_CHOCOLATE image is shown as white text on a -black background.

- -

 

- -

The problem goes further.  Developers -who wish to transfer the image in buffered memory mode would like to see the -*decompressed* image reflect the setting they made with ICAP_PIXELFLAVOR.  -The most obvious solution would be to change the behavior of ICAP_PIXELFLAVOR -to do one thing with TWSX_MEMORY transfers and the other with TWSX_FILE -transfers, but this would penalize those viewers capable of correctly handing -the TIFF PhotometricInterpretation tag.

- -

 

- -

The current solution has been to preserve the -legacy behavior, but add a new variable to the CONST.INI file.  This -variable is called OldPolarity, and if set to 0 (OldPolarity=0) it will cause compressed images to support -the use of ICAP_PIXELFLAVOR.

- -

 

- -

Application developers:

- -

The value -to send for ICAP_PIXELFLAVOR is not different based on the compression you desire. If -the desire is to have zero represent black pixels then send TWCP_CHOCOLATE. If the desire is to have zero represent white pixels then -send TWCP_VANILLA.  Of course, that is -just how the raw data is returned to the application. When the application -saves the data to a TIF file, the application needs to make sure it sets the -TIF Photometric tag appropriately. For uncompressed images, the tag always -needs to be one; this will give 'normal' images for Chocolate and inverted -images for Vanilla.  For compressed images, the tag always needs to be -zero; this will give 'normal' images for Chocolate and inverted images for -Vanilla.  This difference has to do with how the Group IV spec says it -interprets the data.

- -

 

- -

  

- -

3.13 -Feeder Keep Alive (3000/4000 Series)

- -

Feeder keep alive addressed the situation of -the transport timing out before any paper was scanned.  With this value -set to TRUE the Source restarts the transport, allowing the session to wait -forever for the first sheet.  Feeder keep alive was set to TRUE by -default.  This was done because the Source had no way of telling the -application that the transport had halted, which meant that the application -would sit forever, waiting for an image that would never come (and thereby -forcing it to implement its own timer mechanism to declare a session ended).

- -

 

- -

Starting with version 1.2.8 there is a -mechanism in place that allows the Source to abort the session.  It works -in the same way as Jam and Multifeed events.  -This new mechanism is only in effect if CAP_FEEDERKEEPALIVE is set to -FALSE.  If it is set to TRUE, then the legacy behavior will occur -(transport running forever).

- -

 

- -

When CAP_FEEDERKEEPALIVE is set to FALSE, the -Source will monitor the feeder, and if it stops, then it will issue a -MSG_XFERREADY to the application, pretending that an image has been -captured.  If the Source issues a request for DAT_IMAGEINFO, then the -Source will make up to info from the negotiated capabilities.  When the -application goes to transfer the image, then the Source will immediately report -TWRC_CANCEL, which aborts the session.

- -

 

- -

 

- -

3.14 -Length Detection and Frames (3000/4000 Series)

- -

Length detection is used to spot multifeeds.  The user selects the size of the document -(off of the Multifeed tab), and if the scanner -detects an attempt to scan anything larger than this value then it will alert -the user.

- -

 

- -

Since TWAIN does not have the concept of -document sizes and frames (it just has frames), there is no standard way for -the Source to know what the size of the paper is going to be.  So it does -the next best thing by preventing the user from selecting a length that cuts -through any of the frames.  Consider three frames (FB, RB, FC) on the -scanning bed (S).  The color frame is the bottommost of the set, so it -determined the minimum non-zero value for length detection, as shown by the -=========.

- -

 

- -

      -+-----+----+---------+

- -

      |S    -|FB  |         |

- -

      -|     |    -|         |

- -

      -|     -+----+         |

- -

      -|                    -|

- -

      |   -+----+           |

- -

      |   -|RB  |           |

- -

      |   -|    -|           |

- -

      |   -+----+           |

- -

      -|                    -|

- -

      -|          +----+    |

- -

      -|          |FC  -|    |

- -

      -|          |    -|    |

- -

      |     -     +----+    |

- -

      -======================

- -

      -|                    -|

- -

      -|                    -|

- -

 

- -

(Please note that the frames are not labeled -in the real GUI, however it is possible to determine which frame goes with -which camera by right clicking on the line of the box and selecting -"What's This?")

- -

            -

- -

The Front Color (FC) frame will prevent the -length line from being less than itself, even if it is not possible to scan -with color (start in color and patch enable are both off).

- -

 

- -

If the user wants to have a length detection -line that reflects the bitonal documents only, and -does not plan to scan in color, then the FC box needs to be moved or made -smaller...

- -

 

- -

      -+-----+----+---------+

- -

      |S    -|FB  |         |

- -

      -|     |    |  +----+ |

- -

      -|     +----+  |FC  | |

- -

      -|             -|    | |

- -

      |   -+----+    +----+ |

- -

      |   -|RB  |           |

- -

      |   -|    -|           |

- -

      |   -+----+           |

- -

      -|                    -|

- -

      -======================

- -

      -|                    -|

- -

      -|                    -|

- -

 

- -

 

- -

3.15 -MSG_STOPFEEDER Operation

- -

TWAIN 1.9 provides a way to abort scanning -without losing images when CAP_AUTOSCAN is TRUE.

- -

 

- -

DG_CONTROL / DAT_PENDINGXFER / MSG_STOPFEEDER -may be issued in State 6.  When called it will cause the device's feeder -to stop running, but it will in no other way affect the session.  With the -feeder stopped, the Source will eventually transfer all the images from the -device's buffers, and then the session will exit normally, dropping back down -to State 5.

- -

 

- -

Note: using DG_CONTROL / DAT_PENDINGXFER / -MSG_RESET will not only cause scanning to stop, it will strand any images -remaining in the scanner's buffers.

- -

 

- -

 

- -

3.16 JPEG Quantization -(3590/4500/i820/i840/i200/i600/i700/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000)

- -

WARNING: This section deals with settings -that can degrade image quality.  Do not use this feature unless you -clearly understand all the implications.

- -

 

- -

There are three ways of selecting the JPEG Quantization.

- -

1) From the Source's GUI

- -

2) Using DAT_JPEGCOMPRESSION

- -

3) Using ICAP_JPEGQUALITY

- -

 

- -

The Source's GUI uses information defaulted -in the driver to select the JPEG Quantization tables downloaded to the -scanner.  These values can be overridden in the CONST.INI file by adding a -line like the following:

- -

 

- -

            -JpegQuantization_Y_50=12121212171E2630121212141921283...

- -

            -JpegQuantization_CbCr_50=1212121214191E2312121417191E...

- -

 

- -

The Y value selects the Luma -value, and the CbCr value selects the Chroma.  40=draft, 50=good, 80=better, 90=best and -100=superior.  The names for these are defined in each of the language .ini files.  If a new entry is created:

- -

 

- -

            -JpegQuantization_Y_10=8888888888888888888888888888888...

- -

            -JpegQuantization_CbCr_10=8888888888888888888888888888...

- -

 

- -

Then it will show up as "10%" -(without the quotes) in the JPEQ Quality dropdown.  The available range of -values is from 0 to 100 in steps of 5.  Note that 100% does not correspond -to a true loss-less JPEG image, though it does select a value that minimizes -the amount of loss.

- -

 

- -

ICAP_JPEGQUALITY uses these same values, so -that the same tables can be obtained programmatically, and will be reflected in -the GUI settings, if the Source's GUI is raised.

- -

 

- -

DAT_JPEGCOMPRESSION is the older method of -controlling JPEG compression.  Instead of selecting an arbitrary 'quality' -number, this operation directly downloads a JPEG Quantization table to the -scanner.  Any time that this happens the Source will set ICAP_JPEGQUALITY -to TWJQ_UNKNOWN, which will show up at "(application)" in the -Source's GUI.  This setting indicates that the Source does not know the -current quality setting for the JPEG Quantization.

- -

 

- -

If the user selects this value from the -Source's GUI, then it will select the values last set by -DAT_JPEGCOMPRESSION.  If there are no values available, then it will leave -the current settings unchanged.

- -

 

- -

 

- -

3.17 Multiple Modes (5xxx/7xxx/9xxx series)

- -

The following information has not been -certified for production use.  It is presented for customers who wish to -experiment with this feature.  It only applies to drivers certified for -use with the 5xxx/7xxx/9xxx scanners.

- -

 

- -

The 'Gemini' scanners -500/500A/900/923/990/5xxx/7xxx/9xxx support 18 modes.  TWAIN in general -has no elegant way of dealing with this kind of complexity, and experience has -shown that the majority of applications do not need it.

- -

 

- -

Still, there may be some users who absolutely -require more than one mode.  The Source provides support for this in a few -ways.

- -

 

- -

CAP_MODE selects which mode will be the -current mode when scanning begins.  In a default configuration the user -can select one of the modes (1 - 18); once selected they are locked into that -mode for that scanning session.  Changing the mode on the scanner console -and scanning paper with it results in the Source generating an error.

- -

 

- -

The ForceAcceptMode -in the CONST.INI file under the [dsIdentity] section -can be used to force the Source to support more than the ICAP_MODE.  The -value is a bit mask with bits 1 - 18 corresponding to those modes that the -Source will be forced to accept images from.  Note, though that forcing -this behavior is not enough.  If the selected mode has not been setup -properly its use can result in unexpected behavior, corrupt images or crashing -of the application.

- -

 

- -

The DG_CONTROL / DAT_USERINTERFACE / -MSG_SETUPDS command can be used to set up multiple modes.  The command -sends the session attributes to the current CAP_MODE, but does not initiate -scanning.  This allows the application to set as many modes as it needs -prior to issuing MSG_ENABLEDS to begin image capture.

- -

 

- -

The DG_CONTROL / DAT_PASSTHRU / MSG_SET and -MSG_GET can be used to control aspects of the scanner that are not explicitly -described by the Source.  Use of this command is not casually -recommended.  Users who believe that this is the only solution should -contact Eastman Kodak Company before attempting to use it.

- -

 

- -

 

- -

3.18 -DAT_EXTIMAGEINFO

- -

Please reference the TWAIN_ExtImageInfo.htm -found in the KODAK directory.

- -

 

- -

3.19 -ICAP_FRAMES

- -

There are no requirements in the TWAIN spec -around when ICAP_FRAMES should be available.  Therefore limiting it at any -time could potentially break customers.  When a custom capability renders -ICAP_FRAMES invalid (e.g. ICAP_CROPPING mode set to -TWCR_AUTOMATICBORDERDETECTION or TWCR_AGGRESSIVEAUTOCROP), MSG_SET and -MSG_RESET will still be available (i.e.  frames will be disabled on the -screen, but allowed full access programmatically).

- -

 

- -

3.20 Color Dropout: -Enhanced Processing

- -

Due to hardware constraints it is not -possible to have enhanced color dropout on one camera and normal color dropout -on another.  Any changes to enhanced processing for one camera will -automatically be effected on the other.

- -

 

- -

3.21 i30/i40 Button -Mapping

- -

In order to add an application to send button -events to, you must add the application to the registry at:

- -

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\StillImage\Registered -Applications

- -

 

- -

3.22 Displaying -Scanner Operator/Info Log

- -

For those scanners that support it, an -application can negotiate the custom CAP_LOG capability, setting it to -TWLH_OPERATOR.

- -

They can then issue a custom DG_CONTROL / -DAT_USERINTERFACE / MSG_ENABLEINFO, which will bring up the UI with just the -INFO tab, set to the Operator Log.

- -

#define CAP_LOG         -      0x8082

- -

#define    -TWLH_OPERATOR      1

- -

#define    -TWLH_INFO          5

- -

 

- -

 

- -

4.0 -Known Issues

- -

This section reports known issues with the -Source.

- -

 

- -

 

- -

4.1 -Programmatic Constraints

- -

The Source does not currently protect itself -from certain combinations of programmatic access.  For instance, it is -possible to set ICAP_CONTRAST and ICAP_THRESHOLD when ICAP_HALFTONES is set to -one of the dithering algorithms.  This behavior does not affect the -ability of the scanner to scan or the quality of its images; however, if an -application is relying on the unavailability of capabilities to control its own -GUI sensitivity, then this problem may become a factor.

- -

 

- -

 

- -

4.1.1 -ICAP_COMPRESSION

- -

Compression is properly constrained based on -the current value of ICAP_XFERMECH:

- -

 

- -

ICAP_XFERMECH        -ICAP_COMPRESSION

- -

TWSX_NATIVE          TWCP_NONE**

- -

 

- -

TWSX_FILE            TWCP_NONE, -TWCP_GROUP31D*,

- -

                     -TWCP_GROUP32D*, TWCP_GROUP4,

- -

                     -TWCP_JPEG

- -

 

- -

TWSX_MEMORY          TWCP_NONE, -TWCP_GROUP31D*,

- -

                     -TWCP_GROUP32D*, TWCP_GROUP4,

- -

                     -TWCP_JPEG

- -

* - i800 only 

- -

** - accepts other valid values but resets to -TWCP_NONE automatically

- -

 

- -

The Source does not currently protect against -compressions other than TWCP_NONE if the TWSX_FILE image format is TWFF_BMP, -(this error test will be added to the DG_CONTROL / DAT_SETUPXFERFILE / MSG_SET -in a later version).

- -

                        -

- -

Because of this dependency, the Source does -not remember the last setting of compression, but will always default to -TWCP_NONE (because the Source's power on default for ICAP_XFERMECH is -TWSX_NATIVE).

- -

 

- -

This can be annoying for users working with -Applications that rely solely on the Source's GUI.  If the user wishes to -use any compression other than TWCP_NONE then they must reset it each time the -Source is restarted.

- -

 

- -

A workaround is available in this -release.  Users wishing to override the default behavior may do so by -editing the const.ini file, going to the [SkipDependency] -section, and changing the value of ICAP_COMPRESSION from 0 to 1.

- -

 

- -

Please note, making this change may cause -unwanted behavior with Applications that do not rely on the Source's GUI.  -If unexpected side-effects occur then reset the value back to 0.

- -

 

- -

The Source protects itself when the -ICAP_XFERMECH is TWSX_NATIVE by always setting the compression to  -TWCP_NONE.

- -

 

- -

 

- -

4.2 -Delay with MSG_ENDXFER

- -

Programmers will notice that if there is no -paper in the scanner's feeder the TWAIN message DG_CONTROL / DAT_PENDINGXFERS / -MSG_ENDXFER will not return until the transport timeout occurs.  This is a -part of the design of the Source, since the scanner cannot properly determine -how to set pTW_PENDINGXFERS.Count until it scans the -next piece of paper or the transport times out.  Users requiring -MSG_ENDXFER to be more responsive must use a smaller transport timeout value.

- -

 

- -

Beginning with version 3.x there is a -programmatic workaround for this problem using the custom CAP_NOWAIT -capability.  Setting this value to TRUE will result in any blocking call -immediately returning TWRC_BUSY until the request is complete.  See the -KDSCUST.H file for more information.

- -

 

- -

 

- -

4.3 -Fix for Overscan (3xxx Series)

- -

Firmware 1.0.21 of the 3500 has a bug in overscan.  If the top and bottom sides are set to overscan and scanning is done, and then the top and bottom -sides are set to no-overscan and scanning is done, -then it will be noticed that the bottom image has done top overscan, -even though the scanner has been set to no top overscan -and reports no top overscan.

- -

 

- -

The Source gets around this problem by -downloading the bottom settings twice.  This behavior is controllable from -the CONST.INI file in the [ICAP_OVERSCAN] section under the FixOverscan -flag.  The default value for the flag is 1, which is what causes the rear -to be downloaded twice.  There is no measurable performance benefit from -setting this flag to 0, so it should remain at 1, even if the user does not use -overscan.

- -

 

- -

Update:  As of firmware (3500 v1.1.4, 3510 -v1.0.10, 3590 v1.0.6) this problem was fixed.  So, starting with version -v1.2.5 of the Source the FixOverscan flag will -default to 0.

- -

 

- -

 

- -

4.4 -DEFAULTS button does not affect the following...

- -

Pressing the DEFAULTS button on the GUI will -reset most of the capabilities to their default settings, with the following -exceptions (note that not all of these values are present in the Source's GUI):

- -

 

- -

CAP_DEVICEEVENT

- -

CAP_DEVICEONLINE

- -

CAP_DEVICETIMEDATE

- -

CAP_DISABLEFIELDINUI

- -

CAP_MAXBATCHBUFFERS

- -

CAP_NOWAIT

- -

CAP_SCSIADAPTERTARGET

- -

CAP_SERIALNUMBER

- -

ICAP_IMAGEFILEFORMAT

- -

ICAP_XFERMECH

- -

 

- -

 

- -

4.5 -TIFF JPEG -(3590/4500/i820/i840/i600/i700/i200/i900/i1100/i1200/i1300/i1400/i1800/i2000/i2900/i3000/i4000/i5000)

- -

This Source provides support for TIFF/JPEG -images (accessed by specifying a value of TWSX_FILE for ICAP_XFERMECH, -specifying TWCP_JPEG for the value of ICAP_COMPRESSION, and requesting -TWFF_TIFF for the file format when calling DAT_SETUPFILEXFER).

- -

 

- -

The resultant image is generated following -the "TIFF Technical Note #2".  The following is a dump of a -sample image created using the scanner simulator.

- -

 

- -

Reading file: i0000002.tif

- -

The file size is 21690 bytes.

- -

Intel (little endian) byte -order

- -

IFD OFFSET = 8

- -

The number of tags = 16

- -

Tag                               Type            Length          Value

- -

254 New Subfile -Type              LONG     -       1               0

- -

255 Subfile -Type            -      SHORT    -       1               1

- -

256 Image -Width            -       LONG     -       1               832

- -

257 Image -Length             -     LONG     -       1               1176

- -

258 Bits Per Sample      -         SHORT    -       3               <206> -8 8 8

- -

259 -Compression           -        SHORT    -       1               7

- -

262 -Photometric            -       SHORT    -       1               6

- -

273 Strip -Offsets            -     LONG     -       1               252

- -

277 Samples Per -Pixel             SHORT    -       1               3

- -

278 Rows Per Strip        -        LONG     -       1               1176

- -

279 Strip Byte -Counts             LONG     -       1               21438

- -

282 X -Resolution            -      RATIONAL        -1               <212> -100 / 1

- -

283 Y -Resolution           -       RATIONAL -       1               <220> -100 / 1

- -

296 Resolution -Unit        -       SHORT    -       1               2

- -

530 YCbCr -Sub-sampling            -SHORT    -       2               2 -2

- -

532 Reference Black -White         -LONG     -       6               <228>

- -

 

- -

Items of note include the following.  -Compression is set to '7', per Note 2.  JPEG Compression in TIFF v6 was -set to a value of '6'.  Photometric interpretation is set to 6, which -indicates YCbCr for the JPEG encoding.  Finally, -the YCbCr Sub-sampling is present, and set to 2 2.

- -

 

- -

Prior to this release the TWAIN Source -attempted to follow the TIFF v6 guidelines for TIFF/JPEG generation.  -Since "Note #2" depreciates that part of the TIFF v6 spec, this -"Note #2" method comprises the only 'standard' way of generating -TIFF/JPEG images.

- -

 

- -

It is still possible to get the TWAIN Source -to create TIFF/JPEG images in the older style.  Please contact your -Eastman Kodak Company representative if you absolutely have to have this -feature.

- -

 

- -

 

- -

4.6 -Scanner Does Not Always Report Jams (5xxx/7xxx/9xxx)

- -

The 5xxx/7xxx/9xxx series of scanners with -Document Image Management may not always report jam conditions to the TWAIN -Source.  Scanners without the Document Image Manager always correctly -report the occurrence of the jam.

- -

 

- -

Pressing the End Of Job button on a 9000 -series scanner will usually flush the jam error to the TWAIN Source.

- -

 

- -

TWAIN sessions with 5000/7000 series scanners -will appear to end normally, as if the session had been terminated by the -operator.

- -

 

- -

Jams are always reported on the scanner -console, so operators are encouraged to go there to learn the reason for -unexpected stoppages during a scanning session.

- -

            -

- -

 

- -

 

- -

5.0 -Acknowledgements

- -

This section acknowledges code used by other -vendors in the development of this TWAIN driver.

- -

 

- -

 

- -

5.1 -Intel(r) JPEG Library

- -

The Intel(r) JPEG Library (IJL) is a high -performance API for compressing/decompressing JPEG images.  Information on -it can be obtained at Intel's website: http://developer.intel.com

- -

 

- -

 

- -

5.2 -Picture Elements(tm) ChromaTHR(tm), 3590/4500, 4.x -only

- -

Picture Elements(tm) software converts color -images to bitonal using their ChromaTHR(tm) -technology.  Hardware support may be purchased from them by customers -requiring higher quality images at production scanner speeds.  For more -information, please refer to the Picture Elements website: http://www.picturel.com

- -

 

- -
- - - - diff --git a/twain-doc/Kodak/kdscust.h b/twain-doc/Kodak/kdscust.h deleted file mode 100644 index 9ff0f3a..0000000 --- a/twain-doc/Kodak/kdscust.h +++ /dev/null @@ -1,3846 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// -// Kodak Document Scanner TWAIN Source -// Custom Stuff... -// -// Copyright (c) 1998-2013 Eastman Kodak Company, All Rights Reserved -// -// Altering the information in this file is not authorized except -// with the express consent of Eastman Kodak Company. The values -// of the constants in this file are set at the discretion of -// Eastman Kodak Company. New constants may be added at any -// time and old ones may be removed or modified at any time. -// -// The capabilities contained in this header file are unique to the -// Kodak Digital Science(tm) Scanners. As such, the application -// has a responsibility to verify that it is communicating with -// this Source before attempting to use them. Verification is -// accomplished by examining the TW_IDENTITY structure returned by -// the Source from the DG_CONTROL / DAT_PARENT / MSG_OPENDS call. -// This Source reports its identity in the following fields: -// -// TW_IDENTITY -// Manufacturer "Eastman Kodak Company" -// Version.Info "KDS v#.#.# YYYY/MM/DD" -// -// By looking at the Manufacturer name, and looking for KDS as the -// first three letters in the Version.Info, it should be possible -// for an application to unambiguously identify this Source. -// -// -// The Family names break down into the following models... -// -// GEMINI (kds): -// 500, 500A, -// 900, 923, 990, -// 5500, 5520, -// 7500, 7520, 7550, 7560, -// 9500, 9520 -// -// VIPER (kds): -// 3500, 3510, 3520, 3590, -// 4500 -// -// PRISM (kds_i800): -// i810, i820, i830, i840 -// -// PHOENIX (kds_i600): -// i610, i620, i640, i660 -// -// ALIEN (kds_i200): -// i250, i260, i280 -// -// Alf (kds_i100): -// i150, i160 -// -// Pony (kds_i30_i40): -// i30, i40, i40T -// -// MUSTANG2 (kds_i55_i65): -// i55, i65 -// -// PIRANHA (kds_i1300): -// i1310, i1320 -// -// PIRANHA1200 (kds_i1200): -// i1210, i1220 -// -// WILDFIRE (kds_i1800): -// i1840, i1860 -// -// A2O2 (kds_i1400): -// i1410, i1420, i1440 -// -// Fosters (kds_i1100): -// i1120 -// -// Inferno (kds_i700): -// i720, i730, i750, i780 -// -// Panther (kds_i4200_i4600): -// i4200, i4600 -// -// Blaze (kds_i5000): -// i5200, i5600, i5800 -// -// Piranha2 (kds_i2000): -// i2400, i2600, i2800 -// -// Rufous (kds_i900): -// i920 -// -// FalconA4 (kds_i2900): -// i2900 -// -// FalconA3 (kds_i3000): -// i3000 -// -// Piranha2stw (kds_pss): [Note: This scanner family supports the same -// PS50, PS80 list of capabilities as the Piranha2 -// (kds_i2000) scanner family.] -// -// For more information about these capabilities and the driver, -// please refer to the Integrator's Guide on the media that came -// with your scanner. -// -// ************************************************************** -// This file does not conform to the 2-byte packing rule for -// TWAIN, it should use the default packing for the compiler... -// ************************************************************** -// -///////////////////////////////////////////////////////////////////////////// - -#ifndef KDSCUST_H -#define KDSCUST_H - - - -//////////////////////////////////////////////////////////////////////////////// -// INCLUDE FILES -//////////////////////////////////////////////////////////////////////////////// - -#ifdef _WIN32 -#include "twain.h" -#endif - - - -//////////////////////////////////////////////////////////////////////////////// -// DEFINES, TYPEDEFS, CONSTS & ENUMS -//////////////////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////////////////// -// CAP Section -//////////////////////////////////////////////////////////////////////////////// - - - -// CAP_BACKGROUND -// Family: A2O2, Alf, Blaze, Falcon, Fosters, Inferno, Mustang2, Panther, -// Phoenix, Piranha, Piranha2, Rufous, Wildfire -// Type: TWTY_INT16 -// Container: Enumeration -// Allowed: TWBK_BLACK, TWBK_WHITE -// Default: (scanner dependent) -// Notes: Reports what the scanner background was at the -// time the scanner was started. This capability -// cannot detect a "hot" change. -// For Blaze and Panther, it allows the user to select the color -// of the imaging background. This can be set differently per side. -#define CAP_BACKGROUND 0x8089 -#define TWBK_BLACK 0 -#define TWBK_WHITE 1 - - -// CAP_BACKGROUNDFRONT -// Family: A2O2, Alf, Blaze, Falcon, Fosters, Panther, Piranha, Piranha2, -// Rufous -// Type: TWTY_INT16 -// Container: Enumeration -// Allowed: TWBF_BLACK, TWBF_WHITE -// Default: (scanner dependent) -// Notes: Reports what the scanner front background was at the -// time the scanner was started. This capability -// cannot detect a "hot" change. -#define CAP_BACKGROUNDFRONT 0x808C -#define TWBF_BLACK 0 -#define TWBF_WHITE 1 - - -// CAP_BACKGROUNDREAR -// Family: A2O2, Alf, Blaze, Falcon, Fosters, Panther, Piranha, Piranha2, -// Rufous -// Type: TWTY_INT16 -// Container: Enumeration -// Allowed: TWBR_BLACK, TWBR_WHITE -// Default: (scanner dependent) -// Notes: Reports what the scanner rear background was at the -// time the scanner was started. This capability -// cannot detect a "hot" change. -#define CAP_BACKGROUNDREAR 0x808D -#define TWBR_BLACK 0 -#define TWBR_WHITE 1 - - -// CAP_BACKGROUNDPLATEN -// Family: n/a -// Type: TWTY_INT16 -// Container: Enumeration -// Allowed: TWBP_BLACK, TWBP_WHITE -// Default: (scanner dependent) -// Notes: Reports what the scanner background was at the -// time the scanner was started. This capability -// cannot detect a "hot" change. -// This capability is not available at this time. -#define CAP_BACKGROUNDPLATEN 0x808E -#define TWBP_BLACK 0 -#define TWBP_WHITE 1 - - -// CAP_BATCHCOUNT -// Family: Prism, Wildfire -// Type: TWTY_FIX32 -// Container: Range -// Allowed: 0 - 32767 -// Default: 0 -// Notes: Count of CAP_BATCHLEVEL's... -#define CAP_BATCHCOUNT 0x802B - - -// CAP_BATCHENDFUNCTION -// Family: Prism, Wildfire -// Type: TWTY_INT16 -// Container: Enumeration (per camera) -// Allowed: TWPL_NONE, TWPL_LEVEL1, TWPL_LEVEL2, TWPL_LEVEL3 -// Default: TWPL_NONE -// Notes: Determines the level that batching will count -// and test against the batch counting value. -#define CAP_BATCHENDFUNCTION 0x804F -#define TWBE_NONE 0 -#define TWBE_STOPFEEDER 1 -#define TWBE_ENDOFJOB 2 -#define TWBE_NEWBATCH 3 - - -// CAP_BATCHLEVEL -// Family: Prism, Wildfire -// Type: TWTY_INT16 -// Container: Enumeration (per camera) -// Allowed: TWPL_LEVEL1, TWPL_LEVEL2, TWPL_LEVEL3 -// Default: TWPL_LEVEL1 -// Notes: Determines the level that batching will count -// and test against the batch counting value. -#define CAP_BATCHLEVEL 0x804E - - -// CAP_BATCHSTARTFUNCTION -// Family: Prism, Wildfire -// Type: TWTY_INT16 -// Container: Enumeration (per camera) -// Allowed: TWPL_NONE, TWPL_LEVEL1, TWPL_LEVEL2, TWPL_LEVEL3 -// Default: TWPL_NONE -// Notes: Level that a batch should start in... -#define CAP_BATCHSTARTFUNCTION 0x803F - - -// CAP_BINARIZATION -// Family: Viper (3590 only) -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Controls the presence of binarization in the -// camera control. It also overrides the value -// of the front bitonal CAP_CAMERAENABLE. -#define CAP_BINARIZATION 0x8030 - - -// CAP_BLANKPAGE -// Family: A2O2, Blaze, Falcon, Fosters, Inferno, Mustang2, Panther, Phoenix, -// Piranha, Piranha2, Pony, Rufous, Wildfire -// Type: TW_UINT16 -// Container: Enumeration -// Allowed: TWBP_IMAGE -// Default: TWBP_IMAGE -// Notes: Blank image deletion (values 0 and 2 can not used, they became obsolete) -#define CAP_BLANKPAGE 0x809A -#define TWBP_IMAGE 1 - - -// CAP_BLANKPAGEMODE -// Family: A2O2, Blaze, Falcon, Fosters, Inferno, Mustang2, Panther, Phoenix, -// Piranha, Piranha2, Pony, Rufous, Wildfire -// Type: TW_UINT16 -// Container: Enumeration -// Allowed: TWBM_NONE, TWBM_COMPSIZE, TWBM_CONTENT -// Default: TWBM_NONE -// Notes: Blank image deletion mode. Not all values are supported on all scanners. -#define CAP_BLANKPAGEMODE 0x809B -#define TWBM_COMPSIZE 0 -#define TWBM_NONE 1 -#define TWBM_CONTENT 2 - - -// CAP_BLANKPAGECOMPSIZEBW -// Family: A2O2, Blaze, Falcon, Fosters, Inferno, Mustang2, Panther, Phoenix, -// Piranha, Piranha2, Pony, Rufous, Wildfire -// Type: TW_UINT32 -// Container: Range -// Allowed: 0 to 1000KB -// Default: 0 -// Notes: Delete Bitonal image if the final size is less than specific amount. -// Value needs to be in 1024 increments -// The front and rear values must be the same on Mustang2 and Pony -// When set to a non-zero value: CAP_BLANKPAGEMODE is automatically -// set to TWBM_COMPSIZE -// If set zero and CAP_BLANKPAGECOMPSIZEBW and CAP_BLANKPAGECOMPSIZEGRAY -// are zero, then CAP_BLANKPAGEMODE is automatically changed to TWBM_NONE -#define CAP_BLANKPAGECOMPSIZEBW 0x809C - - -// CAP_BLANKPAGECOMPSIZEGRAY -// Family: A2O2, Blaze, Falcon, Fosters, Inferno, Mustang2, Panther, Phoenix, -// Piranha, Piranha2, Pony, Rufous, Wildfire -// Type: TW_UINT32 -// Container: Range -// Allowed: 0 to 1000KB -// Default: 0 -// Notes: Delete Gray image if the final size is less than specific amount. -// Value needs to be in 1024 increments -// The front and rear values must be the same on Mustang2 and Pony -// When set to a non-zero value: CAP_BLANKPAGEMODE is automatically -// set to TWBM_COMPSIZE -// If set zero and CAP_BLANKPAGECOMPSIZEBW and CAP_BLANKPAGECOMPSIZEGRAY -// are zero, then CAP_BLANKPAGEMODE is automatically changed to TWBM_NONE -#define CAP_BLANKPAGECOMPSIZEGRAY 0x809D - - -// CAP_BLANKPAGECOMPSIZERGB -// Family: A2O2, Blaze, Falcon, Fosters, Inferno, Mustang2, Panther, Phoenix, -// Piranha, Piranha2, Pony, Rufous, Wildfire -// Type: TW_UINT32 -// Container: Range -// Allowed: 0 to 1000KB -// Default: 0 -// Notes: Delete Color image if the final size is less than specific amount. -// Value needs to be in 1024 increments -// The front and rear values must be the same on Mustang2 and Pony -// When set to a non-zero value: CAP_BLANKPAGEMODE is automatically -// set to TWBM_COMPSIZE -// If set zero and CAP_BLANKPAGECOMPSIZEBW and CAP_BLANKPAGECOMPSIZEGRAY -// are zero, then CAP_BLANKPAGEMODE is automatically changed to TWBM_NONE -#define CAP_BLANKPAGECOMPSIZERGB 0x809E - - -// CAP_BLANKPAGECONTENT -// Family: A2O2, Blaze, Falcon, Panther, Piranha, Piranha2 -// Type: TW_UINT32 -// Container: Range -// Allowed: 0 to 100 -// Default: 0 -// Notes: If the percent of content on the image is less than or equal to -// this amount, the image will be deleted. This is only valid when -// CAP_BLANKPAGEMODE is set to TWBM_CONTENT -#define CAP_BLANKPAGECONTENT 0x80C4 - - -// CAP_CAMERAENABLE -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, Mustang2, -// Panther, Phoenix, Piranha, Piranha2, Pony, Prism, -// Rufous, Wildfire, Viper -// Type: TWTY_BOOL -// Container: OneValue (per camera) -// Allowed: TRUE / FALSE -// Default: TRUE (except for the 3590 front bitonal) -// Notes: Controls the delivery of images. If this capability -// is set to TRUE then the Source will deliver an image -// for this camera during scanning. You need to use -// DAT_FILESYSTEM to address each of the cameras. -#define CAP_CAMERAENABLE 0x801D - - -// CAP_CAMERAORDER -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, -// Mustang2, Panther, Phoenix, Piranha, Piranha2, Pony, -// Prism, Rufous, Wildfire, Viper -// Type: TWTY_UINT16 -// Container: Array -// Allowed: TWCM_BW_BOTH, TWCM_CL_BOTH -// Default: TWCM_CL_BOTH, TWCM_BW_BOTH -// Notes: Selects the ordering of the cameras according to the -// order that they appear in the list. So the default -// indicates that a color front or rear will precede a -// bitonal front or rear. -// -// There is a conflict between the standard TWAIN CAP_CAMERAORDER and -// the Kodak custom CAP_CAMERAORDER. The standard version has a value -// of 0x1037 and uses the TWPT_* values. The Kodak version can be seen -// below. This driver does not support the TWAIN 2.0 version of this -// capability. An application must use the Kodak version to talk to a -// Kodak driver. -#ifdef CAP_CAMERAORDER - #undef CAP_CAMERAORDER -#endif -#define CAP_CAMERAORDERSTANDARD 0x1037 -#define CAP_CAMERAORDER 0x801E -#define TWCM_BW_BOTH 0 -#define TWCM_BW_TOP 1 -#define TWCM_BW_BOTTOM 2 -#define TWCM_CLBW_BOTH 3 -#define TWCM_CL_TOP 4 -#define TWCM_CL_BOTTOM 5 -#define TWCM_CL_BOTH 6 -#define TWCM_GR_TOP 7 -#define TWCM_GR_BOTTOM 8 -#define TWCM_GR_BOTH 9 - - -// CAP_CHECKDIGIT -// Family: Prism, Wildfire -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: To set the check image address digit ON/OFF. -#define CAP_CHECKDIGIT 0x808B - - -// CAP_DOCUMENTCOUNT -// Family: Gemini -// Type: TWTY_STR32 -// Container: OneValue -// Allowed: 0 - 999,999,999 -// Default: 0 -// Notes: 5000/7000/9000 only. Sets the document count, but -// only if CAP_PRINTERENABLED is either undefined or -// set to FALSE. -#define CAP_DOCUMENTCOUNT 0x8017 - - -// CAP_DOCUMENTCOUNTENABLED -// Family: Gemini -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: 5000/7000/9000 only. Determines whether or not -// the CAP_DOCUMENTCOUNT is to be downloaded. -#define CAP_DOCUMENTCOUNTENABLED 0x8018 - - -// CAP_DOUBLEFEEDENDJOB -// Family: Inferno, Blaze, Falcon, Panther, Phoenix, Piranha2, Prism, -// Wildfire -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: Controls the action the scanner takes when a double -// feed is detected. A value of TRUE will cause the -// session to be terminated. A value of FALSE will -// cause the multifeed to be ignored (though an audible -// alarm will still be sounded, if it is turned on). -#define CAP_DOUBLEFEEDENDJOB 0x806E - - -// CAP_DOUBLEFEEDSTOP -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, -// Mustang2, Panther, Phoenix, Piranha, Piranha2, Pony, Prism, -// Rufous, Wildfire, Viper -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: Controls the action the scanner takes when a double -// feed is detected. A value of TRUE will cause the -// session to be terminated. A value of FALSE will -// cause the multifeed to be ignored (though an audible -// alarm will still be sounded, if it is turned on). -#define CAP_DOUBLEFEEDSTOP 0x8056 - - -// CAP_DUALSTACKINGENABLED -// Family: Blaze -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Indicates if the Controlled Dual Stacking Accessory is -// enabled. It can only be enabled if the accessory is -// installed. -#define CAP_DUALSTACKINGENABLED 0x8110 - - -// CAP_DUALSTACKINGLENGTHMODE -// Family: Blaze -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: Scanner specific -// Default: TWDSLM_NONE -// Notes: Indicates the length method being used to make document sorting decisions -// for the Controlled Dual Stacking Accessory. The stacking length mode -// only has meaning if CAP_DUALSTACKINGENABLED is TRUE. -#define CAP_DUALSTACKINGLENGTHMODE 0x8111 -#define TWDSLM_NONE 0 -#define TWDSLM_LESSTHAN 1 -#define TWDSLM_GREATERTHAN 2 -#define TWDSLM_BETWEEN 3 - - -// CAP_DUALSTACKINGLENGTH1 -// Family: Blaze -// Type: TWTY_FIX32 -// Container: Range -// Allowed: Scanner-specific -// Default: Scanner-specific (min range value) -// Notes: Dual stacking length1 (in ICAP_UNITS). -// If CAP_DUALSTACKINGLENGTHMODE is "less than", then any documents shorter -// than this value will be placed in the selected CAP_DUALSTACKINGSTACK. -// If CAP_DUALSTACKINGLENGTHMODE is "greater than", then any documents longer -// than this value will be placed in the selected CAP_DUALSTACKINGSTACK. -// If CAP_DUALSTACKINGLENGTHMODE is "between", then any documents longer than -// this value and shorter than CAP_DUALSTACKINGLENGTH2 will be placed in the -// selected CAP_DUALSTACKINGSTACK. -// Only valid if CAP_DUALSTACKINGENABLED is TRUE and CAP_DUALSTACKINGLENGTHMODE -// is set to any value other than TWDSLM_NONE. -// The range is determined by the scanner, so an application -// might want to ask what the range is. -#define CAP_DUALSTACKINGLENGTH1 0x8112 - - -// CAP_DUALSTACKINGLENGTH2 -// Family: Blaze -// Type: TWTY_FIX32 -// Container: Range -// Allowed: Scanner-specific -// Default: Scanner-specific (min range value) -// Notes: Dual stacking length2 (in ICAP_UNITS). -// If CAP_DUALSTACKINGLENGTHMODE is "between", then any documents longer than -// CAP_DUALSTACKINGLENGTH1 and shorter than CAP_DUALSTACKINGLENGTH2 will be -// placed in the selected CAP_DUALSTACKINGSTACK. -// Only valid if CAP_DUALSTACKINGENABLED is TRUE and CAP_DUALSTACKINGLENGTHMODE -// is set to TWDSLM_BETWEEN. -// The range is determined by the scanner, so an application -// might want to ask what the range is. -#define CAP_DUALSTACKINGLENGTH2 0x8113 - - -// CAP_DUALSTACKINGMULTIFEED -// Family: Blaze -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Indicates if Multifeed documents should be placed in -// the selected CAP_DUALSTACKINGSTACK. -// Only valid if CAP_DUALSTACKINGENABLED is TRUE. -#define CAP_DUALSTACKINGMULTIFEED 0x8114 - - -// CAP_DUALSTACKINGPATCHTRANSFER -// Family: Blaze -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Indicates if Patch Type Transfer documents should be placed in -// the selected CAP_DUALSTACKINGSTACK. -// Only valid if CAP_DUALSTACKINGENABLED is TRUE. -#define CAP_DUALSTACKINGPATCHTRANSFER 0x8115 - - -// CAP_DUALSTACKINGPATCHTYPE1 -// Family: Blaze -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Indicates if Patch Type 1 documents should be placed in -// the selected CAP_DUALSTACKINGSTACK. -// Only valid if CAP_DUALSTACKINGENABLED is TRUE. -#define CAP_DUALSTACKINGPATCHTYPE1 0x8116 - - -// CAP_DUALSTACKINGPATCHTYPE2 -// Family: Blaze -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Indicates if Patch Type 2 documents should be placed in -// the selected CAP_DUALSTACKINGSTACK. -// Only valid if CAP_DUALSTACKINGENABLED is TRUE. -#define CAP_DUALSTACKINGPATCHTYPE2 0x8117 - - -// CAP_DUALSTACKINGPATCHTYPE3 -// Family: Blaze -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Indicates if Patch Type 3 documents should be placed in -// the selected CAP_DUALSTACKINGSTACK. -// Only valid if CAP_DUALSTACKINGENABLED is TRUE. -#define CAP_DUALSTACKINGPATCHTYPE3 0x8118 - - -// CAP_DUALSTACKINGPATCHTYPE4 -// Family: Blaze -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Indicates if Patch Type 4 documents should be placed in -// the selected CAP_DUALSTACKINGSTACK. -// Only valid if CAP_DUALSTACKINGENABLED is TRUE. -#define CAP_DUALSTACKINGPATCHTYPE4 0x8119 - - -// CAP_DUALSTACKINGPATCHTYPE6 -// Family: Blaze -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Indicates if Patch Type 6 documents should be placed in -// the selected CAP_DUALSTACKINGSTACK. -// Only valid if CAP_DUALSTACKINGENABLED is TRUE. -#define CAP_DUALSTACKINGPATCHTYPE6 0x811A - - -// CAP_DUALSTACKINGSTACK -// Family: Blaze -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: Scanner specific -// Default: TWDSS_STACK1 -// Notes: Which stack a document should drop into -// based on stacking criteria. Only valid if -// CAP_DUALSTACKINGENABLED is TRUE. -#define CAP_DUALSTACKINGSTACK 0x811B -#define TWDSS_STACK1 1 -#define TWDSS_STACK2 2 - - -// CAP_EASYSTACKING -// Family: Inferno, Phoenix, Wildfire -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: If set to TRUE then the scanner makes adjustments -// to improve the arrangement of the output stack as -// the paper exits the transport. -#define CAP_EASYSTACKING 0x8075 - - -// CAP_ENABLECOLORPATCHCODE -// Family: Viper (3590) -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Controls recognition of the 3590 patch page. -#define CAP_ENABLECOLORPATCHCODE 0x8054 - - -// CAP_ENERGYSTAR -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, Mustang2, -// Panther, Phoenix, Piranha, Piranha2, Pony, Rufous, Wildfire -// Type: TWTY_INT32 -// Container: Range -// Allowed: Alien: 0, 15 - 60 (minutes) -// Alf/Inferno/Mustang2/Phoenix/Pony/Wildfire: 0, 5 - 60 (minutes) -// A2O2/Fosters/Piranha: 0, 5 - 240 (minutes) -// Blaze/Panther/Piranha2: 5 - 240 (minutes) -// Falcon/Rufous: 1 - 240 (minutes) -// Default: 15 -// Notes: Minutes of idle time before Energy Star kicks in... -#define CAP_ENERGYSTAR 0x802F - - -// CAP_FEEDERKEEPALIVE -// Family: Viper -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Controls the behavior of the feeder in the following way: -// -// State ICAP_XFERCOUNT First Page All Other Pages -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// FALSE -1 Timeout Timeout -// FALSE >0 Timeout Timeout -// TRUE -1 Keep Alive Timeout -// TRUE >0 Keep Alive Timeout -// -// The effect when TRUE from the user's perspective is that if the -// transport times out while waiting for the first sheet of paper, -// the Source will reenable the scanner, and start the transport -// back up again. It will continue to do this until it gets the -// first sheet of paper, or until the user stops the scanner from -// the application. -#define CAP_FEEDERKEEPALIVE 0x8001 - - -// CAP_FEEDERMODE -// Family: A2O2 (i1440), Alien (i280), Blaze, Falcon, Panther, Piranha2 -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: A2O2, Alien: TWFM_NONE, TWFM_SPECIAL -// Others: Scanner specific -// Default: A2O2, Alien: TWFM_NONE -// Others: Scanner specific -// Notes: Selects TWFM_NONE will show Off on the UI -// and TWFM_SPECIAL is On on the UI -// CAP_FEEDERMODE is for Special Document -#define CAP_FEEDERMODE 0x806F -#define TWFM_NONE 0 -#define TWFM_SPECIAL 1 -#define TWFM_STACKINGIMPROVED 2 -#define TWFM_STACKINGBEST 3 -#define TWFM_FRAGILE 4 -#define TWFM_LIGHTWEIGHT 5 -#define TWFM_THICK 6 -#define TWFM_THIN 7 - - -// CAP_FIXEDDOCUMENTSIZE -// Family: Viper (not 3500) -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Controls the scanner speed-up feature. Note that this -// feature cannot be used with overscan. And it does -// require that all the documents in the batch be of the -// same size. -#define CAP_FIXEDDOCUMENTSIZE 0x8055 - - -// CAP_FOLDEDCORNER -// Family: Inferno, Phoenix -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: TWFC_DISABLED, TWFC_STOP, TWFC_ENDOFJOB -// Default: TWFC_DISABLED -// Notes: Controls Folded Corner detection and the action taken -// if one is discovered during scanning... -#define CAP_FOLDEDCORNER 0x8070 -#define TWFC_DISABLED 0 -#define TWFC_STOPFEEDER 1 -#define TWFC_ENDOFJOB 2 -#define TWCC_FOLDEDCORNER 0x8001 -#define TWDE_FOLDEDCORNER 0x8001 - - -// CAP_FOLDEDCORNERSENSITIVITY -// Family: Inferno, Phoenix -// Type: TWTY_UINT16 -// Container: Range -// Allowed: 1 - 100 -// Default: 2 -// Notes: Controls the folded corner sensitivity, if folder -// corner detection is turned on... -#define CAP_FOLDEDCORNERSENSITIVITY 0x8071 - - -// CAP_FUNCTIONKEY* -// Family: Prism, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: (see list below) -// Default: TWFK_NONE -// Notes: i800 series only. Controls the action taken by the -// function keys during a scanning session... -#define CAP_FUNCTIONKEY1 0x8037 -#define CAP_FUNCTIONKEY2 0x8038 -#define CAP_FUNCTIONKEY3 0x8039 -#define CAP_FUNCTIONKEY4 0x803A // not used -#define TWFK_NONE 0 -#define TWFK_ENDOFJOB 1 -#define TWFK_TERMINATEBATCH 2 -#define TWFK_SKIPMULTIFEED 3 -#define TWFK_SKIPPRINTING 4 -#define TWFK_SKIPPATCH 5 -#define TWFK_LOWERELEVATOR 6 - - -// CAP_IMAGEADDRESS -// Family: Gemini, Prism, Wildfire -// Type: TWTY_STR255 -// Container: OneValue -// Allowed: The image address string... -// Default: Scanner Next Image Address (read from device) -// Notes: 800/5000/7000/9000 only. Sets the image address. -#define CAP_IMAGEADDRESS 0x8015 - - -// CAP_IMAGEADDRESSENABLED -// Family: Gemini -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: 5000/7000/9000 only. Determines whether or not -// the CAP_IMAGEADDRESS is to be downloaded. -#define CAP_IMAGEADDRESSENABLED 0x8016 - - -// CAP_IMAGEADDRESSTEMPLATES -// Family: Prism, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: (see below) -// Default: TWIA_1 -// Notes: 800 only. Determines what kind of image address -// format is allowed. See CONST.INI for the user -// selectable list of formats, and the language files -// L_XX_XXX.INI for the associated text in the image -// address presets dropdown list. Note that, like -// with ICAP_HALFTONES and ICAP_SUPPORTEDSIZES, it is -// not really possible for an application to know -// what the user is selecting, it just has to be -// accepted blindly. -#define CAP_IMAGEADDRESSTEMPLATES 0x803E -#define TWIA_CUSTOM -1 -#define TWIA_NONE 0 -#define TWIA_1 1 -#define TWIA_2 2 -#define TWIA_3 3 -#define TWIA_4 4 -#define TWIA_5 5 -#define TWIA_6 6 -#define TWIA_7 7 -#define TWIA_8 8 -#define TWIA_9 9 -#define TWIA_10 10 -#define TWIA_11 11 -#define TWIA_12 12 -#define TWIA_13 13 -#define TWIA_14 14 -#define TWIA_15 15 -#define TWIA_16 16 - - -// CAP_IMAGEADDRESS_A -// CAP_IMAGEADDRESS_B -// CAP_IMAGEADDRESS_C -// CAP_IMAGEADDRESS_D -// Family: Prism, Wildfire -// Type: TWTY_STR255 -// Container: OneValue -// Allowed: The image address template fields... -// Default: (see CAP_IMAGEADDRESSTEMPLATES) -// Notes: 800 only. Specifies the meaning and the maximum sizes -// of the fields in the image address. A value of 'f' -// indicates a fixed field. Values of 1, 2, 3 indicate -// level fields. The number of characters determines the -// maximum allowed in that field. -#define CAP_IMAGEADDRESS_A 0x804A -#define CAP_IMAGEADDRESS_B 0x804B -#define CAP_IMAGEADDRESS_C 0x804C -#define CAP_IMAGEADDRESS_D 0x804D - - -// CAP_IMAGEMERGE -// Family: A2O2, Falcon, Fosters, Panther, Piranha, Piranha2, Rufous -// Type: TW_UINT16 -// Container: Enumeration -// Allowed: TWIM_NONE, TWIM_FRONTONTOP, TWIM_FRONTONBOTTOM, -// TWIM_FRONTONLEFT, TWIM_FRONTONRIGHT -// Default: TWIM_NONE -// Notes: Merges the front and back images into a single image that is -// returned to the application. -#define CAP_IMAGEMERGE 0x80C5 -#define TWIM_NONE 0 -#define TWIM_FRONTONTOP 1 // front is on top of the back -#define TWIM_FRONTONBOTTOM 2 // back is on top of front -#define TWIM_FRONTONLEFT 3 // front is to the left of the back -#define TWIM_FRONTONRIGHT 4 // back is to the left of the front - - -// CAP_IMAGESDIFFERENT -// Family: Blaze, Falcon, Panther, Piranha2 -// Type: TWTY_BOOL -// Container: OneValue (per camera) -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: When this is TRUE the user can set different values for the -// color and bitonal cameras. When set to FALSE a value set -// on a color camera will be matched (if possible) by the bitonal -// camera, and vice versa. -#define CAP_IMAGESDIFFERENT 0x8100 - - -// CAP_INDICATORSWARMUP -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, Mustang2, -// Panther, Phoenix, Piranha, Piranha2, Pony, Rufous, -// Wildfire -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: Controls the appearance of the LampSaver and Warmup -// dialogs. Only turn this off if these dialogs are -// interfering with the operation of your application. -// For version 9.3 drivers and up, if lamps are not -// warmed-up at scan time, your application can be told -// the number of seconds remaining before scanning will -// begin; refer to TWDE_LAMPWARMUP in CAP_DEVICEEVENT -// for more information. -#define CAP_INDICATORSWARMUP 0x806C - - -// CAP_INTELLIGENTDOCUMENTPROTECTION -// Family: Falcon -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: See below... -// Default: TWIDP_NORMAL -// Notes: ADF only. Controls the level of document protection. -#define CAP_INTELLIGENTDOCUMENTPROTECTION 0x810D -#define TWIDP_NONE 0 -#define TWIDP_MINIMUM 1 -#define TWIDP_NORMAL 2 -#define TWIDP_MAXIMUM 3 - - -// CAP_LEVELTOFOLLOW1 -// CAP_LEVELTOFOLLOW2 -// CAP_LEVELTOFOLLOW3 -// Family: Prism, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: TWPL_LEVEL1, TWPL_LEVEL2, TWPL_LEVEL3 -// Default: TWPL_LEVEL1 -// Notes: For Image Addressing, determines dependencies among the -// level counters. -#define CAP_LEVELTOFOLLOW1 0x803B -#define CAP_LEVELTOFOLLOW2 0x803C -#define CAP_LEVELTOFOLLOW3 0x803D - - -// CAP_MODE -// Family: Gemini -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: (see list below) -// Default: TWMO_MODE1 -// Notes: Selects the current mode. -#define CAP_MODE 0x8019 -#define TWMO_MODE1 1 -#define TWMO_MODE2 2 -#define TWMO_MODE3 3 -#define TWMO_MODE4 4 -#define TWMO_MODE5 5 -#define TWMO_MODE6 6 -#define TWMO_MODE7 7 -#define TWMO_MODE8 8 -#define TWMO_MODE9 9 -#define TWMO_MODE10 10 -#define TWMO_MODE11 11 -#define TWMO_MODE12 12 -#define TWMO_MODE13 13 -#define TWMO_MODE14 14 -#define TWMO_MODE15 15 -#define TWMO_MODE16 16 -#define TWMO_MODE17 17 -#define TWMO_MODE18 18 - - -// CAP_MULTIFEEDCOUNT -// Family: A2O2, Falcon, Fosters, Blaze, Inferno, Mustang2, Panther, Phoenix, -// Piranha, Piranha2, Pony, Rufous, Wildfire -// Type: TWTY_INT32 -// Container: OneValue -// Allowed: 0 - 32767 -// Default: 0 -// Notes: Count of multifeeds per scan session -#define CAP_MULTIFEEDCOUNT 0x8086 - - -// CAP_MULTIFEEDRESPONSE -// Family: A2O2, Falcon, Fosters, Blaze, Inferno, Panther, Phoenix, Piranha, -// Piranha2, Rufous, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: Fosters - TWMR_CONTINUE, TWMR_ENDOFJOB -// Inferno/Phoenix/Wildfire - TWMR_CONTINUE, TWMR_ENDOFJOB, TWMR_STOPFEEDER -// A2O2/Piranha - TWMR_CONTINUE, TWMR_ENDOFJOB, TWMR_ENDOFJOBLEAVEPAPER -// Piranha2/Rufous - TWMR_CONTINUE, TWMR_ENDOFJOB, TWMR_ENDOFJOBLEAVEPAPER, -// TWMR_ENDOFJOBGENERATEIMAGE -// Blaze/Falcon/Panther - TWMR_CONTINUE, TWMR_ENDOFJOB, TWMR_ENDOFJOBLEAVEPAPER, -// TWMR_ENDOFJOBGENERATEIMAGE, TWMR_STOPFEEDER, -// TWMR_STOPFEEDERLEAVEPAPER -// Default: TWMR_ENDOFJOB -// Notes: Selects action taken when the multifeed detected. -#define CAP_MULTIFEEDRESPONSE 0x80BA -#define TWMR_CONTINUE 0 -#define TWMR_ENDOFJOB 1 -#define TWMR_ENDOFJOBLEAVEPAPER 2 -#define TWMR_STOPFEEDER 3 -#define TWMR_STOPFEEDERLEAVEPAPER 4 -#define TWMR_ENDOFJOBGENERATEIMAGE 5 - - -// CAP_MULTIFEEDSOUND -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, Mustang2, -// Panther, Phoenix, Piranha, Piranha2, Pony, Rufous, -// Wildfire -// Type: TWTY_STR255 -// Container: OneValue -// Allowed: Text -// Default: "ding.wav" -// Notes: Sound when detect document multifeeds. -#define CAP_MULTIFEEDSOUND 0x802D - - -// CAP_MULTIFEEDTHICKNESSDETECTION -// Family: Viper (not 3500) -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Controls the whether thickness is used to detect -// document multifeeds. -#define CAP_MULTIFEEDTHICKNESSDETECTION 0x8057 - - -// CAP_NOWAIT -// Family: A2O2, Alf, Alien, Blaze, Gemini, Falcon, Fosters, Inferno, -// Mustang2, Panther, Phoenix, Piranha, Piranha2, Pony, Prism, -// Rufous, Wildfire, Viper -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Legacy behavior for this Source is to wait inside -// of the MSG_ENDXFER command until the next image -// is scanned or until the session is terminated, so -// that it can properly set the value of the -// TW_PENDINGXFERS.Count field. This has the unhappy -// side-effect of hanging the application. -// -// This capability allows the application to issue a -// non-blocking call to MSG_ENDXFER. The application -// must NOT move on to the next image until it receives -// a TWRC_SUCCESS from the command. A custom return -// code of TWRC_BUSY will indicate that the Source -// is still waiting on the device. The application can -// end the session by issuing a MSG_STOPFEEDER command. -// -// Note that if CAP_AUTOSCAN is off then this situation -// can happen for any image related command that is -// issued: DAT_IMAGEINFO, DAT_IMAGELAYOUT, -// DAT_IMAGEFILEXFER, DAT_IMAGEMEMXFER, DAT_IMAGEFILEXFER. -// -// TWAIN 2.2 defines TWRC_BUSY. The driver assumes that -// the application's TWAIN protocol corresponds to the -// twain.h file that it was built with. Therefore, for -// applications that report a protocol of 2.1 or less -// the value of TWRC_BUSY will be 0x8001. For apps that -// report a value of 2.2 or higher the value returned -// will match whatever TWRC_BUSY is set to in the twain.h -// file. OBS_TWRC_BUSY is provided for situations where -// an app reports a value of 2.1 or less when it is using -// a 2.2 or greater twain.h. In this case the application -// must make a code change to use OBS_TWRC_BUSY. -// -// Applications must also allow for the protocol reported -// by the TWAIN driver. Drivers reporting 2.1 or less -// will only report a value of 0x8001 for TWRC_BUSY, -// regardless of the protocol reported by the application. -#define CAP_NOWAIT 0x8032 -#define OBS_TWRC_BUSY 0x8001 -#ifndef TWRC_BUSY -#define TWRC_BUSY 0x8001 -#endif - - -// CAP_PAGECOUNT -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, -// Mustang2, Panther, Phoenix, Piranha, Piranha2, Pony, -// Prism, Rufous, Wildfire, Viper -// Type: TWTY_FIX32 -// Container: Range -// Allowed: 0 - 32767 -// Default: 0 -// Notes: Count of pages to transfer. This capability only -// takes effect if CAP_XFERCOUNT is -1. A value of 0 -// disables this capability. -#define CAP_PAGECOUNT 0x8031 - - -// CAP_PAGESIZELIMIT -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, -// Mustang2, Panther, Phoenix, Piranha, Piranha2, Pony, -// Prism, Rufous, Wildfire, Viper -// Type: TWTY_FIX32 -// Container: Range -// Allowed: 0 - ICAP_PHYSICALHEIGHT -// Default: 0 -// Notes: Maximum allowed physical page height (in ICAP_UNITS). -// This is a double document detection feature. -#define CAP_PAGESIZELIMIT 0x8002 - - -// CAP_PAPERSOURCE -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, -// Mustang2, Panther, Phoenix, Piranha, Piranha2, Pony, -// Rufous, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: A2O2, Alien, Piranha, Piranha2 - TWPU_ADF. If platen installed -// TWPU_AUTO and TWPU_PLATEN also allowed. -// Alf, Fosters, Pony, Rufous - TWPU_ADF. -// Mustang2 - TWPU_ADF, TWPU_AUTO, TWPU_PLATEN -// Inferno/Panther/Phoenix/Wildfire - TWPU_ADF, TWPU_ELEVATOR100, -// TWPU_ELEVATOR250, TWPU_ELEVATOR500 -// Blaze - TWPU_ADF, TWPU_ELEVATOR100, TWPU_ELEVATOR250, -// TWPU_ELEVATOR500, TWPU_ELEVATOR750 -// Falcon (if only ADF) - TWPU_ADF, TWPU_ELEVATOR100, TWPU_ELEVATOR250 -// Falcon (if Flatbed available) - add TWPU_AUTO, TWPU_PLATEN, -// TWPU_ELEVATOR100PLATEN, TWPU_ELEVATOR250PLATEN -// Default: Alf, Alien, Fosters, Pony, Rufous - TWPU_ADF -// Inferno/Panther/Phoenix/Wildfire - TWPU_ELEVATOR500 -// Blaze - TWPU_ELEVATOR750 -// A2O2, Mustang2, Piranha, Piranha2 - TWPU_AUTO -// Falcon (if only ADF) - TWPU_ELEVATOR250 -// Falcon (if Flatbed available) - TWPU_ELEVATOR250PLATEN -// Notes: Selects source of paper (ADF or Platen). TWPU_AUTO -// selects ADF but changes to Platen if the ADF has no -// paper in it at the start of the scanning session. -#define CAP_PAPERSOURCE 0x802C -#define TWPU_AUTO 0 -#define TWPU_ADF 1 -#define TWPU_PLATEN 2 -#define TWPU_ELEVATOR500 3 -#define TWPU_ELEVATOR250 4 -#define TWPU_ELEVATOR100 5 -#define TWPU_ELEVATOR750 6 -#define TWPU_ELEVATOR100PLATEN 7 -#define TWPU_ELEVATOR250PLATEN 8 -#define TWPU_ELEVATOR500PLATEN 9 - - -// CAP_PATCHCOUNT -// Family: A2O2 (i1440), Alien(i280), Inferno, Panther, Phoenix, -// Wildfire -// Type: TWTY_INT32 -// Container: OneValue -// Allowed: 0 - 32767 -// Default: 0 -// Notes: Count of patches per scan session -#define CAP_PATCHCOUNT 0x8087 - - -// CAP_PATCHHEAD1 -// Family: Wildfire -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: Enables/disables the first patch reader. -#define CAP_PATCHHEAD1 0x80BF - - -// CAP_PATCHHEAD2 -// Family: Wildfire -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: Enables/disables the second patch reader. -#define CAP_PATCHHEAD2 0x80C0 - - -// CAP_PATCHHEAD3 -// Family: Wildfire -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: Enables/disables the third patch reader. -#define CAP_PATCHHEAD3 0x80C1 - - -// CAP_PATCHHEAD4 -// Family: Wildfire -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: Enables/disables the fourth patch reader. -#define CAP_PATCHHEAD4 0x80C2 - - -// CAP_PCARDENABLED -// Family: n/a -// Type: TWTY_BOOL -// Container: OneValue (per camera) -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: Enables/disables the P-Card (note that this operates -// in tandem with the DAT_PCARD operation, setting this -// value here or there will modify both values). -// This capability is not available at this time. -#define CAP_PCARDENABLED 0x806A - - -// CAP_POWEROFFTIMEOUT -// Family: Falcon -// Type: TWTY_INT32 -// Container: Range -// Allowed: Falcon: 0, 0 - 240 (minutes) -// Default: 60 -// Notes: Minutes of idle time following CAP_ENERGYSTAR -// before device is powered off... -#define CAP_POWEROFFTIMEOUT 0x810C - - -// CAP_PRINTERDATE -// Family: Blaze, Falcon, Inferno, Panther, Phoenix, Wildfire -// Type: TWTY_STR255 -// Container: OneValue -// Allowed: Text -// Default: "" -// Notes: This will set the scanner to a specific date prior to printing. -// The scanner will be returned to the original date afterwards. -// Set to "" to disable. -// Format: YYYY/MM/DD (YYYY - year, MM - month, DD - day) -#define CAP_PRINTERDATE 0x80BC - - -// CAP_PRINTERDATEDELIMITER -// Family: A2O2, Alien, Blaze, Falcon, Inferno, Panther, Phoenix, Prism, -// Wildfire, Viper (3520/4500) -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: (see list below) -// Default: Prism - TWPD_FORWARDSLASH -// Others - TWPD_NONE -// Notes: Selects the delimiter to be used in the date -// (not the time, though, time always uses a -// delimiter of colon ':'). -#define CAP_PRINTERDATEDELIMITER 0x801C -#define TWPD_NONE 0 -#define TWPD_FORWARDSLASH 1 -#define TWPD_HYPHEN 2 -#define TWPD_PERIOD 3 -#define TWPD_BLANK 4 - - -// CAP_PRINTERDATEFORMAT -// Family: A2O2, Blaze, Falcon, Inferno, Panther, Phoenix, Prism, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: A2O2/Phoenix/Prism - TWPE_MMDDYYYY, TWPE_DDMMYYYY, TWPE_YYYYMMDD -// Other - TWPE_MMDDYYYY, TWPE_DDMMYYYY, TWPE_YYYYMMDD, TWPE_DDD, TWPE_YYYYDDD -// Default: Prism - TWPE_MMDDYYYY -// Other - TWPE_YYYYMMDD -// Notes: Selects the format to be used to display -// the date (not the time, though). -#define CAP_PRINTERDATEFORMAT 0x8033 -#define TWPE_MMDDYYYY 0 -#define TWPE_DDMMYYYY 1 -#define TWPE_YYYYMMDD 2 -#define TWPE_DDD 3 -#define TWPE_YYYYDDD 4 - - -// CAP_PRINTERFONT -// Family: A2O2, Alien, Blaze, Falcon, Gemini, Inferno, Panther Phoenix, -// Prism, Wildfire, Viper (3520/4500) -// Type: TWTY_UINT16 -// Allowed: A2O2/Alien/Gemini/Viper - TWPN_LARGECOMIC,TWPN_LARGECINE,TWPN_SMALLCOMIC,TWPN_SMALLCINE -// Inferno/Phoenix/Prism/Wildfire - TWPN_LARGECOMIC,TWPN_LARGECINE,TWPN_LARGECOMIC180,TWPN_LARGECINE180, -// TWPN_SMALLCOMIC,TWPN_SMALLCINE,TWPN_SMALLCOMIC180,TWPN_SMALLCINE180 -// Blaze/Falcon - TWPN_LARGECOMIC,TWPN_LARGECINE,TWPN_LARGECOMIC180,TWPN_LARGECINE180, -// TWPN_SMALLCOMIC,TWPN_SMALLCINE,TWPN_SMALLCOMIC180,TWPN_SMALLCINE180, -// TWPN_BOLDLARGECOMIC,TWPN_BOLDLARGECINE,TWPN_BOLDLARGECOMIC180,TWPN_BOLDLARGECINE180 -// Panther - TWPN_LARGECOMIC,TWPN_LARGECINE,TWPN_LARGECOMIC180,TWPN_LARGECINE180, -// TWPN_SMALLCOMIC,TWPN_SMALLCINE,TWPN_SMALLCOMIC180,TWPN_SMALLCINE180, -// TWPN_BOLDLARGECOMIC,TWPN_BOLDLARGECINE -// Default: Blaze, Falcon, Panther, Prism- TWPN_SMALLCOMIC -// Other- TWPN_LARGECOMIC -// -// -// Notes: elects the printer font to be used. -// Small also means 'Normal'; Large also means 'Bold'; BoldLarge also means 'ExtraBold' -#define CAP_PRINTERFONT 0x8044 -#define TWPN_LARGECOMIC 0 -#define TWPN_LARGECINE 1 -#define TWPN_LARGECOMIC180 2 -#define TWPN_LARGECINE180 3 -#define TWPN_SMALLCOMIC 4 -#define TWPN_SMALLCINE 5 -#define TWPN_SMALLCOMIC180 6 -#define TWPN_SMALLCINE180 7 -#define TWPN_BOLDLARGECOMIC 8 -#define TWPN_BOLDLARGECINE 9 -#define TWPN_BOLDLARGECOMIC180 10 -#define TWPN_BOLDLARGECINE180 11 -#define TWPN_BOLDSMALLCOMIC 12 -#define TWPN_BOLDSMALLCINE 13 -#define TWPN_BOLDSMALLCOMIC180 14 -#define TWPN_BOLDSMALLCINE180 15 - - -// CAP_PRINTERFONTFORMAT -// Family: Wildfire -// Type: TWTY_UINT16 -// Allowed: TWPFF_NORMAL, TWPFF_BLOCK -// Default: TWPFF_NORMAL -// -// Notes: elects the printer font format to be used -#define CAP_PRINTERFONTFORMAT 0x80BE -#define TWPFF_NORMAL 0 -#define TWPFF_BLOCK 1 - - -// CAP_PRINTERIMAGEADDRESSFORMAT -// Family: Gemini, Prism, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: (see list below) -// Default: Gemini-TWPI_DISPLAYLEADINGZEROS -// Prism-TWPI_SUPPRESSLEADINGZEROS -// Wildfire-TWPI_SUPPRESSLEADINGZEROS -// Notes: Selects the print format of leading zeros -// in the image address. -#define CAP_PRINTERIMAGEADDRESSFORMAT 0x8045 -#define TWPI_DISPLAYLEADINGZEROS 0 -#define TWPI_SUPPRESSLEADINGZEROS 1 -#define TWPI_COMPRESSLEADINGZEROS 2 - - -// CAP_PRINTERIMAGEADDRESSLEVEL -// Family: Gemini, Prism, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: Gemini-TWPL_LEVEL0, TWPL_LEVEL1, TWPL_LEVEL2, -// TWPL_LEVEL3, TWPL_ALLLEVELS -// Prism- TWPL_LEVEL1, TWPL_LEVEL2, TWPL_LEVEL3, -// TWPL_ALLLEVELS -// Wildfire-TWPL_LEVEL1, TWPL_LEVEL2, TWPL_LEVEL3, -// TWPL_ALLLEVELS -// Default: TWPL_ALLLEVELS -// Notes: Selects the image address level that printing -// will occur on. A value of TWPL_ALLLEVELS -// overrides any of the others. -#define CAP_PRINTERIMAGEADDRESSLEVEL 0x8047 -#define TWPL_LEVEL0 0 -#define TWPL_LEVEL1 1 -#define TWPL_LEVEL2 2 -#define TWPL_LEVEL3 3 -#define TWPL_ALLLEVELS 4 -#define TWPL_NONE 5 - - -// CAP_PRINTERINDEXDIGITS -// Family: A2O2, Alien, Blaze, Falcon, Inferno, Panther, Phoenix, -// Prism, Wildfire, Viper (3520/4500) -// Type: TWTY_UINT16 -// Container: Range -// Allowed: 1 - 9 -// Default: 9 -// Notes: Sets the number of digits of the counter to be -// printed. Note that the data will be truncated -// if the number of digits in the count exceeds -// this value. -#define CAP_PRINTERINDEXDIGITS 0x801B - - -// CAP_PRINTERINDEXFORMAT -// Family: A2O2, Alien, Blaze, Falcon, Inferno, Panther, Phoenix, -// Prism, Wildfire, Viper (3520/4500) -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: (see CAP_PRINTERIMAGEADDRESSFORMAT) -// Default: Prism-TWPI_SUPPRESSLEADINGZEROS -// Other-TWPI_DISPLAYLEADINGZEROS -// Notes: Selects the use of leading zeros or spaces when -// printing the counter value. -#define CAP_PRINTERINDEXFORMAT 0x801A - - -// CAP_PRINTERPOSITION -// Family A2O2, Alien, Blaze, Falcon, Gemini, Inferno, Panther, Phoenix, -// Prism, Wildfire, Viper (3520/4500) -// Type: TWTY_FIX32 -// Container: Range -// Allowed: Scanner specific -// Default: Scanner specific -// Notes: Selects the printer position (y-offset, in ICAP_UNITS) -// to be used as the starting position for printing. -#define CAP_PRINTERPOSITION 0x8046 - - -// CAP_PRINTERTIME -// Family: Inferno, Blaze, Falcon, Panther, Phoenix, Wildfire -// Type: TWTY_STR255 -// Container: OneValue -// Allowed: Text -// Default: "" -// Notes: This will set the scanner to a specific time prior to printing. -// The scanner will be returned to the original time afterwards. -// Set to "" to disable. -// Format: HH:MM (HH - hour (0-23), MM - minutes (0-59), -// i.e. 00:00->23:59) -#define CAP_PRINTERTIME 0x80BD - - -// CAP_PRINTERWRITESEQUENCE -// Family: A2O2, Alien, Blaze, Falcon, Gemini(5000/7000), Inferno, Panther, -// Phoenix, Prism, Wildfire -// Type: TWTY_UINT16 -// Allowed: All the stuff below (sheesh)... -// Notes: Selects the write sequence. -#define CAP_PRINTERWRITESEQUENCE 0x8049 -#define TWPW_NONE 0 -#define TWPW_FULLIAALLDELIMITERS 1 -#define TWPW_FULLIANODELIMITERS 2 -#define TWPW_FULLIAFIXEDDELIMITERS 3 -#define TWPW_DELIMITER 4 -#define TWPW_FIXEDIA 5 -#define TWPW_INDEXIA 6 -#define TWPW_CURRENTLEVELIA 7 -#define TWPW_DATE 8 -#define TWPW_DAY 9 -#define TWPW_TIME 10 -#define TWPW_DOCUMENTCOUNT 11 -#define TWPW_MESSAGE1 12 -#define TWPW_MESSAGE2 13 -#define TWPW_MESSAGE3 14 -#define TWPW_MESSAGE4 15 -#define TWPW_MESSAGE5 16 -#define TWPW_MESSAGE6 17 -#define TWPW_MESSAGE7 18 -#define TWPW_MESSAGE8 19 -#define TWPW_MESSAGE9 20 -#define TWPW_SPACE 21 -#define TWPW_TEXT 22 -#define TWPW_INDEX 23 -#define TWPW_MMDDYYYY 24 -#define TWPW_DDMMYYYY 25 -#define TWPW_YYYYMMDD 26 -#define TWPW_IMAGEADDRESS_A 27 -#define TWPW_IMAGEADDRESS_B 28 -#define TWPW_IMAGEADDRESS_C 29 -#define TWPW_IMAGEADDRESS_D 30 - - -// CAP_PRINTERWRITESEQUENCEINDEX -// Family: Gemini (5000/7000) -// Type: TWTY_UINT16 -// Allowed: 1 - 7 -// Notes: Selects the write sequence index. -#define CAP_PRINTERWRITESEQUENCEINDEX 0x8048 - - -// CAP_PRINTERWRITESEQUENCEMESSAGE1 - 12 -// Family: A2O2, Blaze, Falcon, Gemini, Inferno, Panther, Phoenix, -// Prism, Wildfire, Viper (3520/4500) -// Type: TWTY_STR255 -// Container: OneValue -// Allowed: A2O2/Falcon/Panther only has one message -// Prism/Phoenix/Wildfire/Inferno: 1 to 6 -// Default: A2O2- ABC -// Gemini-#1 -// Viper- ABC -// Prism- (empty string) -// Inferno/Phoenix- ABC -// Blaze/Falcon/Panther/Wildfire- 111 -// Notes: 5000/7000 only...selects the write sequence -// messages (1 - 9). Prism only...selects the -// write sequence messages 1-6 if the levels -// are independent and 7-12 for 'all' levels. -#define CAP_PRINTERWRITESEQUENCEMESSAGE1 0x800C -#define CAP_PRINTERWRITESEQUENCEMESSAGE2 0x800D -#define CAP_PRINTERWRITESEQUENCEMESSAGE3 0x800E -#define CAP_PRINTERWRITESEQUENCEMESSAGE4 0x800F -#define CAP_PRINTERWRITESEQUENCEMESSAGE5 0x8010 -#define CAP_PRINTERWRITESEQUENCEMESSAGE6 0x8011 -#define CAP_PRINTERWRITESEQUENCEMESSAGE7 0x8012 -#define CAP_PRINTERWRITESEQUENCEMESSAGE8 0x8013 -#define CAP_PRINTERWRITESEQUENCEMESSAGE9 0x8014 -#define CAP_PRINTERWRITESEQUENCEMESSAGE10 0x8034 -#define CAP_PRINTERWRITESEQUENCEMESSAGE11 0x8035 -#define CAP_PRINTERWRITESEQUENCEMESSAGE12 0x8036 - - -// CAP_PRINTERWRITESEQUENCEMESSAGEINDEX -// Family: A2O2, Alien, Inferno, Phoenix, Wildfire -// Type: TWTY_UINT16 -// Container: OneValue -// Allowed: Inferno/Phoenix/Wildfire 1 - 6 -// A2O2, Alien 1 -// Default: 1 -// Notes: Selects the write sequence messages. -#define CAP_PRINTERWRITESEQUENCEMESSAGEINDEX 0x808A - - -// CAP_PRINTERWRITESEQUENCESPACE -// Family: Gemini(5000/7000) -// Type: TWTY_UINT16 -// Allowed: Number of blanks... -// Notes: 5000/7000 only. Blank count for the write sequence. -#define CAP_PRINTERWRITESEQUENCESPACE 0x800A - - -// CAP_PRINTERWRITESEQUENCESPACESTRING -// Family: Gemini(5000/7000) -// Type: TWTY_STR255 -// Allowed: The WriteSequenceSpace string... -// Notes: 5000/7000 only. Selects the write sequence -// count of spaces. -#define CAP_PRINTERWRITESEQUENCESPACESTRING 0x800B - - -// CAP_PRINTERWRITESEQUENCESTRING -// Family: A2O2, Alien, Blaze, Falcon, Gemini (5000/7000), Inferno, -// Panther, Phoenix, Prism, Wildfire -// Type: TWTY_STR255 -// Allowed: The WriteSequence string... -// Notes: 5000/7000 only. Selects the write sequence. -#define CAP_PRINTERWRITESEQUENCESTRING 0x8009 - - -// CAP_PROFILES -// Family: A2O2, Blaze, Falcon, Fosters, Inferno, Panther, Phoenix, Piranha, -// Piranha2, Rufous, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: (see list below) -// Default: TWPO_DEFAULT -// Notes: THIS IS DEPRECATED TWAIN 10.X+. DAT_PROFILES SHOULD BE USED INSTEAD. -// Selects the current profile. This set the current settings from -// the selected profile to the driver. -// Or see the CUSTOMDSDATA that works the same as profile. -// See the MSG_SETUPDS on how to download the settings to the scanner -// without enable the scanning session. -// Also refer to DAT_PROFILES later in this file. -#define CAP_PROFILES 0x809F -#define TWPO_UNKNOWN -1 -#define TWPO_DEFAULT 0 -#define TWPO_FILE01 1 -#define TWPO_FILE02 2 -#define TWPO_FILE03 3 -#define TWPO_FILE04 4 -#define TWPO_FILE05 5 -#define TWPO_FILE06 6 -#define TWPO_FILE07 7 -#define TWPO_FILE08 8 -#define TWPO_FILE09 9 -#define TWPO_FILE10 10 -#define TWPO_FILE11 11 -#define TWPO_FILE12 12 -#define TWPO_FILE13 13 -#define TWPO_FILE14 14 -#define TWPO_FILE15 15 -#define TWPO_FILE16 16 -#define TWPO_FILE17 17 -#define TWPO_FILE18 18 -#define TWPO_FILE19 19 -#define TWPO_FILE20 20 -#define TWPO_FILE21 21 -#define TWPO_FILE22 22 -#define TWPO_FILE23 23 -#define TWPO_FILE24 24 -#define TWPO_FILE25 25 -#define TWPO_FILE26 26 -#define TWPO_FILE27 27 -#define TWPO_FILE28 28 -#define TWPO_FILE29 29 -#define TWPO_FILE30 30 -#define TWPO_FILE31 31 -#define TWPO_FILE32 32 -#define TWPO_FILE33 33 -#define TWPO_FILE34 34 -#define TWPO_FILE35 35 -#define TWPO_FILE36 36 -#define TWPO_FILE37 37 -#define TWPO_FILE38 38 -#define TWPO_FILE39 39 -#define TWPO_FILE40 40 -#define TWPO_FILE41 41 -#define TWPO_FILE42 42 -#define TWPO_FILE43 43 -#define TWPO_FILE44 44 -#define TWPO_FILE45 45 -#define TWPO_FILE46 46 -#define TWPO_FILE47 47 -#define TWPO_FILE48 48 -#define TWPO_FILE49 49 -#define TWPO_FILE50 50 -#define TWPO_FILE51 51 -#define TWPO_FILE52 52 -#define TWPO_FILE53 53 -#define TWPO_FILE54 54 -#define TWPO_FILE55 55 -#define TWPO_FILE56 56 -#define TWPO_FILE57 57 -#define TWPO_FILE58 58 -#define TWPO_FILE59 59 -#define TWPO_FILE60 60 - - -// CAP_SIDESDIFFERENT -// Family: A2O2, Blaze, Falcon, Fosters, Inferno, Panther, Phoenix, Piranha, -// Piranha2, Rufous, Wildfire -// Type: TWTY_BOOL -// Container: OneValue (per camera) -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: When this is TRUE the user can set different values for the -// front and rear camera. -// Setting this to FALSE will copy all the front settings to the -// rear for the current camera. -// This will automatically change to TRUE when the front and -// rear no longer match. Note: a value of TRUE does NOT imply -// that the sides are different (e.g. if everything matches and -// this is set to TRUE) -#define CAP_CAMERALINK 0x80B7 // deprecated after v7.55 -#define CAP_SIDESDIFFERENT 0x80B7 // available since v7.56 - - -// CAP_SIMULATING -// Family: Blaze, Falcon, Panther, Piranha2 -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Simulate the scanner. -#define CAP_SIMULATING 0x810B - - -// CAP_SUPPORTEDSIZES -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Gemini, Inferno, -// Mustang2, Panther, Phoenix, Piranha, Piranha2, Pony, Prism, -// Rufous, Wildfire, Viper -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: (see list below) -// Default: TWSS_A4 -// Notes: This list adds custom values to this standard TWAIN -// capability. The TWSS_USER* values may be set up by -// an end-user through the CONST.INI and appropriate -// language file(s) to add custom sizes to the existing -// list. See the CONST.INI file under the section -// [SupportedSizes] for more info on how to do this. -#define TWSS_6X5 0x8001 -#define TWSS_12X12 0x8002 -#define TWSS_3X5 0x8003 // 3.5 x 5 -#define TWSS_4X6 0x8004 -#define TWSS_5X7 0x8005 -#define TWSS_8X10 0x8006 -#define TWSS_4X7 0x8007 -#define TWSS_4X10 0x8008 -#define TWSS_100X150 0x8009 -#define TWSS_127X177 0x8010 -#define TWSS_90X130 0x8011 -#define TWSS_57X88 0x8012 // 57.17 x 88.9 -#define TWSS_5X3 0x8013 // 3.5 x 5 -#define TWSS_6X4 0x8014 -#define TWSS_7X5 0x8015 -#define TWSS_7X4 0x8016 -#define TWSS_150X100 0x8017 -#define TWSS_177X127 0x8018 -#define TWSS_130X90 0x8019 -#define TWSS_88X57 0x8020 // 57.17 x 88.9 -#define TWSS_USER0 0x8100 -#define TWSS_USER1 0x8101 -#define TWSS_USER2 0x8102 -#define TWSS_USER3 0x8103 -#define TWSS_USER4 0x8104 -#define TWSS_USER5 0x8105 -#define TWSS_USER6 0x8106 -#define TWSS_USER7 0x8107 -#define TWSS_USER8 0x8108 -#define TWSS_USER9 0x8109 - - -// CAP_TOGGLEPATCH -// Family: A2O2 (i1440), Alien (i280), Blaze, Falcon (i3000), Inferno, -// Panther, Phoenix, Prism, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: (see list below) -// Default: TWTP_DISABLED -// Notes: Controls recognition of the color patch. -#define CAP_TOGGLEPATCH 0x806D -#define TWTP_DISABLED 0 -#define TWTP_BOTHSIDE 1 -#define TWTP_FRONTSIDE 2 -#define TWTP_SAMESIDE 4 -#define TWTP_DETECTONLY 7 - - -// CAP_TRANSPORTAUTOSTART -// Family: A2O2, Fosters, Blaze, Inferno, Panther, Phoenix, -// Piranha, Piranha2, Prism, Rufous, Wildfire -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: A2O2, Fosters, Piranha, Piranha2, Rufous: TRUE (readonly) -// Other: TRUE / FALSE -// Default: A2O2, Blaze, Fosters, Panther, Piranha, Piranha2, Rufous: TRUE -// Other: FALSE -// Notes: A value of TRUE will cause the scanner transport to -// start up when the MSG_ENABLEDS command is issued. -#define CAP_TRANSPORTAUTOSTART 0x8029 - - -// CAP_TRANSPORTTIMEOUT -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, -// Mustang2, Panther,Phoenix, Piranha, Piranha2, Pony, -// Prism, Rufous, Wildfire, Viper -// Type: TWTY_INT32 -// Container: Range -// Allowed: Alf/Alien: 3-30 -// Mustang2/Pony: 1-30 -// A2O2/Fosters/Inferno/Phoenix/Piranha/Wildfire: 0,1-300 -// Prism: 0,5-300 -// Viper: 3-30 -// Blaze/Panther/Piranha2/Rufous: 0, 1-120 -// Default: A2O2/Alf/Alien: 8 -// Fosters/Mustang2/Piranha/Pony: 1 -// Inferno/Phoenix/Wildfire: 15 -// Blaze/Panther: 5 -// Prism: 10 -// Viper: 8 -// Piranha2/Rufous: 0 -// Notes: Number of seconds before transport times out. -#define CAP_TRANSPORTTIMEOUT 0x8003 - - -// CAP_TRANSPORTTIMEOUTRESPONSE -// Family: A2O2, Fosters, Blaze, Falcon, Inferno, Panther, Phoenix, -// Piranha, Piranha2, Prism, Rufous, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: A2O2, Fosters, Piranha, Piranha2, Rufous: TWTR_ENDOFJOB -// Other: See below -// Default: A2O2,Falcon,Fosters,Panther,Piranha,Piranha2,Rufous: TWTR_ENDOFJOB -// Other: TWTR_STOPFEEDER -// Notes: Selects action taken when the transport times out. -// If the transport timeout is disabled, then this -// capability is ignored. -#define CAP_TRANSPORTTIMEOUTRESPONSE 0x8028 -#define TWTR_STOPFEEDER 0 -#define TWTR_ENDOFJOB 1 - - -// CAP_ULTRASONICSENSITIVITY -// Family: A2O2, Alf, Alien, Blaze, Falcon, Inferno, Panther, Phoenix, -// Piranha, Piranha2, Prism, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: See below... -// Default: TWUS_DISABLED -// Notes: Controls the sensitivity of the ultrasonic multifeed -// detector. -// -// Please note that there is a conflict with version 2.2 of the -// TWAIN Spec. Previous versions of kds_cust.h defined TWUS_* -// values. This behavior is still supported if used with -// a TWAIN 2.1 twain.h or earlier. -// -// Applications must change to use TWUSS_* with CAP_ULTRASONICSENSITIVITY, -// this will work with any version of the driver. -// -// Only use TWUS_* with the standard CAP_DOUBLEFEEDDETECTIONSENSITIVITY -// capability. -#define CAP_ULTRASONICSENSITIVITY 0x8027 -#ifndef CAP_DOUBLEFEEDDETECTIONSENSITIVITY - #define TWUS_DISABLED 0 - #define TWUS_LOW 1 - #define TWUS_MEDIUM 2 - #define TWUS_HIGH 3 -#endif -#define TWUSS_DISABLED 0 -#define TWUSS_LOW 1 -#define TWUSS_MEDIUM 2 -#define TWUSS_HIGH 3 - - -// CAP_ULTRASONICSENSOR* -// Family: Blaze, Inferno, Panther, Phoenix, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: See below... -// Default: TWUO_ENABLED -// Notes: Controls the individual ultrasonic sensor -// detector. -#define CAP_ULTRASONICSENSORCENTER 0x808F -#define CAP_ULTRASONICSENSORLEFT 0x8090 -#define CAP_ULTRASONICSENSORRIGHT 0x8091 -#define CAP_ULTRASONICSENSORLEFTCENTER 0x8105 -#define CAP_ULTRASONICSENSORRIGHTCENTER 0x8106 -#define TWUO_DISABLED 0 -#define TWUO_ENABLED 1 -#define TWUO_IGNOREZONE 2 - - -// CAP_ULTRASONICSENSORZONEHEIGHT -// Family: Blaze -// Type: TWTY_FIX32 -// Container: Range -// Allowed: Scanner specific -// Default: Scanner specific -// Notes: Height of zone for the CAP_ULTRASONICSENSOR* that -// are set to TWUO_IGNOREZONE -#define CAP_ULTRASONICSENSORZONEHEIGHT 0x8107 - - -// CAP_WINDOW -// Family: A2O2, Blaze, Falcon, Fosters, Inferno, Panther, Phoenix, -// Piranha, Piranha2, Rufous, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: See below.. -// Default: TWWW_BASE -// Notes: Deprecated, use CAP_WINDOWCAMERA or DAT_FILESYSTEM. -#define CAP_WINDOW 0x80AD -#define TWWW_BASE 0 -#define TWWW_1 1 -#define TWWW_2 2 -#define TWWW_3 3 -#define TWWW_4 4 -#define TWWW_5 5 -#define TWWW_6 6 -#define TWWW_7 7 -#define TWWW_8 8 -#define TWWW_9 9 -#define TWWW_10 10 - - -// CAP_WINDOWCAMERA -// Family: A2O2, Blaze, Falcon, Fosters, Inferno, Panther, Phoenix, -// Piranha, Piranha2, Rufous, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: See below.. -// Default: TWWC_BASE_BITONAL_FRONT -// Notes: Allows for direct addressing of windows. Does not -// change CAP_SIDESDIFFERENT like DAT_FILESYSTEM. -#define CAP_WINDOWCAMERA 0x80B4 -#define TWWC_DELETEALL -1 -#define TWWC_BASE_BITONAL_FRONT 0 -#define TWWC_BASE_BITONAL_REAR 1 -#define TWWC_BASE_COLOR_FRONT 2 -#define TWWC_BASE_COLOR_REAR 3 -#define TWWC_1_BITONAL_FRONT 4 -#define TWWC_1_BITONAL_REAR 5 -#define TWWC_1_COLOR_FRONT 6 -#define TWWC_1_COLOR_REAR 7 -#define TWWC_2_BITONAL_FRONT 8 -#define TWWC_2_BITONAL_REAR 9 -#define TWWC_2_COLOR_FRONT 10 -#define TWWC_2_COLOR_REAR 11 -#define TWWC_3_BITONAL_FRONT 12 -#define TWWC_3_BITONAL_REAR 13 -#define TWWC_3_COLOR_FRONT 14 -#define TWWC_3_COLOR_REAR 15 -#define TWWC_4_BITONAL_FRONT 16 -#define TWWC_4_BITONAL_REAR 17 -#define TWWC_4_COLOR_FRONT 18 -#define TWWC_4_COLOR_REAR 19 -#define TWWC_5_BITONAL_FRONT 20 -#define TWWC_5_BITONAL_REAR 21 -#define TWWC_5_COLOR_FRONT 22 -#define TWWC_5_COLOR_REAR 23 -#define TWWC_6_BITONAL_FRONT 24 -#define TWWC_6_BITONAL_REAR 25 -#define TWWC_6_COLOR_FRONT 26 -#define TWWC_6_COLOR_REAR 27 -#define TWWC_7_BITONAL_FRONT 28 -#define TWWC_7_BITONAL_REAR 29 -#define TWWC_7_COLOR_FRONT 30 -#define TWWC_7_COLOR_REAR 31 -#define TWWC_8_BITONAL_FRONT 32 -#define TWWC_8_BITONAL_REAR 33 -#define TWWC_8_COLOR_FRONT 34 -#define TWWC_8_COLOR_REAR 35 -#define TWWC_9_BITONAL_FRONT 36 -#define TWWC_9_BITONAL_REAR 37 -#define TWWC_9_COLOR_FRONT 38 -#define TWWC_9_COLOR_REAR 39 -#define TWWC_10_BITONAL_FRONT 40 -#define TWWC_10_BITONAL_REAR 41 -#define TWWC_10_COLOR_FRONT 42 -#define TWWC_10_COLOR_REAR 43 - - -// CAP_WINDOWPOSITION -// Family: A2O2, Alf, Alien, Fosters, Gemini, Inferno, Mustang2, -// Phoenix, Piranha, Pony, Prism, Wildfire, Viper -// Type: TWTY_FRAME -// Container: OneValue -// Allowed: Anything -// Default: 0,0 (top left of screen) -// Notes: Left and Top position of dialog (Width and Height are -// ignored). Use this to select the location of the -// Source's GUI when it is displayed to the user. -#define CAP_WINDOWPOSITION 0x8004 - - - -//////////////////////////////////////////////////////////////////////////////// -// ICAP Section -//////////////////////////////////////////////////////////////////////////////// - - - -// ICAP_ADDBORDER -// Family: A2O2, Blaze, Falcon, Fosters, Inferno, Panther, Phoenix, -// Piranha, Piranha2, Prism, Rufous, Wildfire -// Type: TWTY_BOOL -// Container: OneValue (per camera) -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Adds a black border around a bitonal document. -#define ICAP_ADDBORDER 0x8023 - - -#define ICAP_ANSELBRIGHTNESS 0x80A0 -#define ICAP_ANSELCONTRAST 0x80A1 -#define ICAP_ANSELHIGHLIGHT 0x80A2 -#define ICAP_ANSELMIDTONE 0x80A3 - - -// ICAP_ANSELREMOVEREDEYE -// Family: Oasis -// Type: TWTY_BOOL -// Container: OneValue (per camera) -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Controls red-eye removal. -#define ICAP_ANSELREMOVEREDEYE 0x80A4 - - -// ICAP_ANSELRESTORECOLOR -// Family: Oasis -// Type: TWTY_BOOL -// Container: OneValue (per camera) -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Adds a black border around a bitonal document. -#define ICAP_ANSELRESTORECOLOR 0x80A5 - - -#define ICAP_ANSELSATURATECOLORS 0x80A6 -#define ICAP_ANSELSHADOW 0x80A7 - - -// ICAP_ANSELSHARPENIMAGE -// Family: Oasis -// Type: TWTY_UINT16 -// Container: Enumeration (per camera) -// Allowed: (see below) -// Default: TWASP_DISABLE -// Notes: Controls picture sharpening. -#define ICAP_ANSELSHARPENIMAGE 0x80A8 -#define TWASP_DISABLE 0 -#define TWASP_NORMAL 1 -#define TWASP_HIGH 2 -#define TWASP_EXAGGERATED 3 - - -// ICAP_ANSELSHASTA -// Family: Oasis -// Type: TWTY_UINT16 -// Container: Enumeration (per camera) -// Allowed: (see below) -// Default: TWASH_DISABLE -// Notes: TBD -#define ICAP_ANSELSHASTA 0x80A9 -#define TWASH_DISABLE 0 -#define TWASH_AUTO 1 -#define TWASH_MANUAL 2 - - -// ICAP_AUTOCOLORAMOUNT -// Family: A2O2, Blaze, Falcon, Inferno, Panther, Phoenix, Piranha, -// Piranha2, Wildfire -// Type: TWTY_INT32 -// Container: Range (per camera) -// Allowed: 1 to 200 -// Default: 1 -// Notes: The amount of color that needs to be present in a document -// before it will be saved as either a color or grayscale image. -#define ICAP_AUTOCOLORAMOUNT 0x8092 - - -// ICAP_AUTOCOLORCONTENT -// Family: A2O2, Blaze, Falcon, Inferno, Panther, Phoenix, Piranha, -// Piranha2, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration (per camera) -// Allowed: TWCL_NONE,TWCL_LOW,TWCL_MEDIUM,TWCL_HIGH,TWCL_CUSTOM -// Default: TWCL_NONE -// Notes: Preset values for AUTOCOLORAMOUNT and AUTOCOLORTHRESHOLD. -// NONE turns autocolor detection off. -// CUSTOM allows amount and threshold to be set. -// When this is not NONE, CAMERAENABLE has no effect on output -// color (rgb/gray/bw). Rather, CAMERAENABLE dictates which -// sides should be scanned (front/rear). -// Enabling both color and bitonal for a side indicates both are -// desired as output, and therefore AUTOCOLORCONTENT will be set -// to TWCL_NONE. -// If both color and bitonal are enabled on a side when -// AUTOCOLORCONTENT is turned on, CAMERAENABLED will be set to -// FALSE for the bitonal camera on that side. -#define ICAP_AUTOCOLORCONTENT 0x8093 -#define TWCL_NONE 0 -#define TWCL_LOW 1 -#define TWCL_MEDIUM 2 -#define TWCL_HIGH 3 -#define TWCL_CUSTOM 4 - - -// ICAP_AUTOCOLORTHRESHOLD -// Family: A2O2, Blaze, Falcon, Inferno, Panther, Phoenix, Piranha, -// Piranha2, Wildfire -// Type: TWTY_INT32 -// Container: Range (per camera) -// Allowed: 0 to 100 -// Default: Falcon, Panther, Piranha2: 20 -// Other: 50 -// Notes: The color threshold or intensity (i.e. pale blue vs. dark blue) -// at which a given a color will be included in the Color Amount -// calculation . A higher value indicates that a more intense color -// is required. -#define ICAP_AUTOCOLORTHRESHOLD 0x8094 - - -// ICAP_BACKGROUNDADJUSTAGGRESSIVENESS -// Family: A2O2, Blaze, Falcon, Panther, Piranha, Piranha2 -// Type: TWTY_INT32 -// Container: Range (per color camera) -// Allowed: -10 to 10 -// Default: 0 -// Notes: The background color adjustment aggressiveness -#define ICAP_BACKGROUNDADJUSTAGGRESSIVENESS 0x80B0 - - -// ICAP_BACKGROUNDADJUSTAPPLYTO -// Family: A2O2, Blaze, Falcon, Panther, Piranha, Piranha2 -// Type: TWTY_UINT16 -// Container: Enumeration (per color camera) -// Allowed: TWBA_ALL,TWBA_NEUTRAL,TWBA_PREDOMINATE -// Default: TWBA_PREDOMINATE -// Notes: The background color adjustment apply to -#define ICAP_BACKGROUNDADJUSTAPPLYTO 0x80AF -#define TWBA_ALL 0 -#define TWBA_NEUTRAL 1 -#define TWBA_PREDOMINATE 2 - - -// ICAP_BACKGROUNDADJUSTMODE -// Family: A2O2, Blaze, Falcon, Panther, Piranha, Piranha2 -// Type: TWTY_UINT16 -// Container: Enumeration (per color camera) -// Allowed: TWBS_NONE,TWBS_AUTO,TWBS_CHANGETOWHITE, TWBS_AUTOMATICBASIC -// Default: TWCL_NONE -// Notes: The background smoothing mode -#define ICAP_BACKGROUNDADJUSTMODE 0x80AE -#define TWBS_NONE 0 -#define TWBS_AUTOMATIC 1 -#define TWBS_CHANGETOWHITE 2 -#define TWBS_AUTOMATICBASIC 3 - - -// ICAP_COLORBALANCEAUTOMATICAGGRESSIVENESS -// Family: Falcon, Piranha2, Rufous -// Type: TWTY_INT32 -// Container: Range (per color camera) -// Allowed: -2 to 2 -// Default: 0 -// Notes: Indicates how aggressive the automatic white balance will be. -// This is only available when ICAP_COLORBALANCEMODE set to -// TWCBM_AUTOMATICADVANCED -#define ICAP_COLORBALANCEAUTOMATICAGGRESSIVENESS 0x810A - - -// ICAP_COLORBALANCEMODE -// Family: Blaze, Falcon, Piranha2, Rufous -// Type: TWTY_UINT16 -// Container: Enumeration (per color camera) -// Allowed: Blaze: TWCBM_NONE, TWCBM_MANUAL -// Others: TWCBM_NONE, TWCBM_MANUAL, TWCBM_AUTOMATIC, -// TWCBM_AUTOMATICBASIC -// Default: Blaze: TWCBM_NONE -// Others: TWCBM_AUTOMATICBASIC -// Notes: Allows the user to select the method for adjusting the color -// balance of a color image. -// TWCBM_NONE means no adjustment is made. -// TWCBM_MANUAL means the user can adjust Red, Green and Blue -// (see ICAP_COLORBALANCEREAD/GREEN/BLUE). -// TWCBM_AUTOMATICBASIC means the scanner will automatically -// adjust the balance to be white. -// TWCBM_AUTOMATIC is the same as TWCBM_AUTOMATICBASIC but -// the user can also adjust the aggressiveness of the balance -// (see ICAP_COLORBALANCEAUTOMATICAGRESSIVENESS). -#define ICAP_COLORBALANCEMODE 0x8109 -#define TWCBM_NONE 0 -#define TWCBM_MANUAL 1 -#define TWCBM_AUTOMATICBASIC 2 -#define TWCBM_AUTOMATIC 3 - - -// ICAP_COLORBALANCEBLUE -// ICAP_COLORBALANCEGREEN -// ICAP_COLORBALANCERED -// Family: A2O2, Blaze, Falcon, Fosters, Panther, Piranha, Piranha2, Rufous -// Type: TWTY_INT32 -// Container: Range (per camera) -// Allowed: -50 to 50 step 1 for the GUI -// -1000 to 1000 step 20 for programmatic -// Default: 0 -// Notes: Allow the user to adjust the color balance. This is ignored -// if ICAP_COLORBALANCEMODE is not set to TWCBM_MANUAL. -#define ICAP_COLORBALANCEBLUE 0x80B1 -#define ICAP_COLORBALANCEGREEN 0x80B2 -#define ICAP_COLORBALANCERED 0x80B3 - - -// CAP_COLORBRIGHTNESSMODE -// Family: Blaze, Falcon, Piranha2 -// Type: TWTY_UINT16 -// Container: Enumeration (per color camera) -// Allowed: Blaze: TWCBR_NONE, TWCBR_MANUAL -// Others: TWCBR_NONE, TWCBR_MANUAL, TWCBR_AUTOMATIC -// Default: Blaze: TWCBR_NONE -// Others: TWCBR_AUTOMATIC -// Notes: Allows the user to select the method for adjusting the -// brightness and contrast of a color or grayscale image. -// TWCBR_NONE means no adjustment is made. -// TWCBR_MANUAL means the user can adjust Brightness and -// Contrast (see ICAP_BRIGHTNESS and ICAP_CONTRAST). -// TWCBR_AUTOMATICBASIC means the scanner will -// automatically adjust the image. -#define ICAP_COLORBRIGHTNESSMODE 0x8108 -#define TWCBR_NONE 0 -#define TWCBR_MANUAL 1 -#define TWCBR_AUTOMATICBASIC 2 - - -// ICAP_COLORSHARPEN -// Family: Blaze, Falcon, Panther, Piranha2, Rufous -// Type: TWTY_UINT32 -// Container: Range (per output stream) -// Allowed: 0 - 3 -// Default: 1 -// Notes: Apply sharpening to image - 0 indicates no sharpening. -// 1 is normal, 2 is more sharpening, and a value of 3 -// applies a lot of sharpening. -#define ICAP_COLORSHARPEN 0x8102 - - -// ICAP_COLORSHARPENING -// Family: Prism, Wildfire, Viper -// Type: TWTY_INT16 -// Container: Enumeration (per camera) -// Allowed: TWCS_NONE, TWCS_3X3FIRFILTER -// Default: TWCS_3X3FIRFILTER -// Notes: Color image sharpening. This setting only has -// meaning if ICAP_COMPRESSION is set to TWCP_JPEG. -#define ICAP_COLORSHARPENING 0x8041 -#define TWCS_NONE 0 -#define TWCS_3X3FIRFILTER 1 - - -// ICAP_COLORTABLE -// Family: A2O2, Alf, Alien, Fosters, Inferno, Mustang2, Phoenix, -// Piranha, Pony, Prism, Wildfire, Viper -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: (see list below) -// Default: (as discovered in scanner) -// Notes: Selects the color table to use. This capability -// is like ICAP_HALFTONES in that there is no -// programmatic way to guarantee the results of a -// given selection. The best tactic is to present -// the data to the user 'as is' and let them select -// what they want. -#define ICAP_COLORTABLE 0x8020 -#define TWCT_UNKNOWN -1 -#define TWCT_DEFAULT 0 -#define TWCT_FILE01 1 -#define TWCT_FILE02 2 -#define TWCT_FILE03 3 -#define TWCT_FILE04 4 -#define TWCT_FILE05 5 -#define TWCT_FILE06 6 -#define TWCT_FILE07 7 -#define TWCT_FILE08 8 -#define TWCT_FILE09 9 -#define TWCT_FILE10 10 -#define TWCT_FILE11 11 -#define TWCT_FILE12 12 -#define TWCT_FILE13 13 -#define TWCT_FILE14 14 -#define TWCT_FILE15 15 -#define TWCT_FILE16 16 -#define TWCT_FILE17 17 -#define TWCT_FILE18 18 -#define TWCT_FILE19 19 -#define TWCT_FILE20 20 -#define TWCT_FILE21 21 -#define TWCT_FILE22 22 -#define TWCT_FILE23 23 -#define TWCT_FILE24 24 -#define TWCT_FILE25 25 -#define TWCT_FILE26 26 -#define TWCT_FILE27 27 -#define TWCT_FILE28 28 -#define TWCT_FILE29 29 -#define TWCT_FILE30 30 -#define TWCT_FILE31 31 -#define TWCT_FILE32 32 -#define TWCT_FILE33 33 -#define TWCT_FILE34 34 -#define TWCT_FILE35 35 -#define TWCT_FILE36 36 -#define TWCT_FILE37 37 -#define TWCT_FILE38 38 -#define TWCT_FILE39 39 -#define TWCT_FILE40 40 -#define TWCT_FILE41 41 -#define TWCT_FILE42 42 -#define TWCT_FILE43 43 -#define TWCT_FILE44 44 -#define TWCT_FILE45 45 -#define TWCT_FILE46 46 -#define TWCT_FILE47 47 -#define TWCT_FILE48 48 -#define TWCT_FILE49 49 -#define TWCT_FILE50 50 -#define TWCT_FILE51 51 -#define TWCT_FILE52 52 -#define TWCT_FILE53 53 -#define TWCT_FILE54 54 -#define TWCT_FILE55 55 -#define TWCT_FILE56 56 -#define TWCT_FILE57 57 -#define TWCT_FILE58 58 -#define TWCT_FILE59 59 -#define TWCT_FILE60 60 - -// ICAP_CROPPINGMODE -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, -// Mustang2, Panther, Phoenix, Piranha, Piranha2, Pony, -// Prism, Rufous, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration (per camera) -// Allowed: See below... -// Default: TWCR_AUTOMATICBORDERDETECTION -// Notes: Selects the mode of cropping. This capability is -// tied to ICAP_AUTOMATICBORDERDETECTION, where FALSE -// equals TWCR_TRANSPORT and TRUE equals -// TWCR_AUTOMATICBORDERDETECTION. -// Continuous cropping mode is also known as Long Paper mode. -// If the user set one of the camera to TWCR_CONTIUOUS -// all the camera force to set cropping to TWCR_CONTIUOUS -// and if all camera in TWCR_CONTIUOUS cropping mode, the -// user change one of the camera to other cropping mode -// then all the camera will force to set the same cropping mode -#define ICAP_CROPPINGMODE 0x8022 -#define TWCR_AUTOMATICBORDERDETECTION 0 -#define TWCR_TRANSPORT 1 -#define TWCR_DOCUMENT 2 -#define TWCR_AGGRESSIVEAUTOCROP 3 -#define TWCR_CONTINUOUS 4 -#define TWCR_MULTIPLEAGGRESSIVE 5 -#define TWCR_PHOTO 6 -#define TWCR_PHOTOINROI 7 - - -// ICAP_DOCUMENTTYPE -// Family: A2O2, Blaze, Falcon, Fosters, Oasis, Panther, Piranha, Piranha2, Rufous -// Type: TWTY_UINT16 -// Container: Enumeration (per camera) -// Allowed: See below -// Default: TWDT_TEXTWITHGRAPHIC -// Oasis: TWDT_PHOTO -// Notes: Allows user to select the type of document being scanned. -#define ICAP_DOCUMENTTYPE 0x80AC -#define TWDT_PHOTO 0 -#define TWDT_TEXTWITHGRAPHICS 1 -#define TWDT_TEXTWITHPHOTO 2 -#define TWDT_TEXT 3 - - -// ICAP_ECDO -// Family: A2O2, Blaze, Falcon, Fosters, Panther, Piranha, Piranha2, Rufous -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: (see list below) -// Default: None -// Notes: Allows user to select the ECDO color for bitonal/gray camera. -// Also refer to DAT_ECDO later in this file. -#define ICAP_ECDO 0x80B8 -#define TWCD_UNKNOWN -1 -#define TWCD_NONE 0 -#define TWCD_FILE01 1 -#define TWCD_FILE02 2 -#define TWCD_FILE03 3 -#define TWCD_FILE04 4 -#define TWCD_FILE05 5 -#define TWCD_FILE06 6 -#define TWCD_FILE07 7 -#define TWCD_FILE08 8 -#define TWCD_FILE09 9 -#define TWCD_FILE10 10 -#define TWCD_FILE11 11 -#define TWCD_FILE12 12 -#define TWCD_FILE13 13 -#define TWCD_FILE14 14 -#define TWCD_FILE15 15 -#define TWCD_FILE16 16 -#define TWCD_FILE17 17 -#define TWCD_FILE18 18 -#define TWCD_FILE19 19 -#define TWCD_FILE20 20 -#define TWCD_FILE21 21 -#define TWCD_FILE22 22 -#define TWCD_FILE23 23 -#define TWCD_FILE24 24 -#define TWCD_FILE25 25 -#define TWCD_FILE26 26 -#define TWCD_FILE27 27 -#define TWCD_FILE28 28 -#define TWCD_FILE29 29 -#define TWCD_FILE30 30 -#define TWCD_FILE31 31 -#define TWCD_FILE32 32 -#define TWCD_FILE33 33 -#define TWCD_FILE34 34 -#define TWCD_FILE35 35 -#define TWCD_FILE36 36 -#define TWCD_FILE37 37 -#define TWCD_FILE38 38 -#define TWCD_FILE39 39 -#define TWCD_FILE40 40 -#define TWCD_FILE41 41 -#define TWCD_FILE42 42 -#define TWCD_FILE43 43 -#define TWCD_FILE44 44 -#define TWCD_FILE45 45 -#define TWCD_FILE46 46 -#define TWCD_FILE47 47 -#define TWCD_FILE48 48 -#define TWCD_FILE49 49 -#define TWCD_FILE50 50 -#define TWCD_FILE51 51 -#define TWCD_FILE52 52 -#define TWCD_FILE53 53 -#define TWCD_FILE54 54 -#define TWCD_FILE55 55 -#define TWCD_FILE56 56 -#define TWCD_FILE57 57 -#define TWCD_FILE58 58 -#define TWCD_FILE59 59 -#define TWCD_FILE60 60 - - -// ICAP_ECDOAGGRESSIVENESS -// Family: Blaze, Falcon, Panther, Piranha2 -// Type: TWTY_INT32 -// Container: Range (per output stream, bitonal only) -// Allowed: -10 to 10 -// Default: 0 -// Notes: Change the amount of multi-color dropout applied to -// a bitonal image. -#define ICAP_ECDOAGGRESSIVENESS 0x8103 - - -// ICAP_ECDOTREATASCOLOR -// Family: A2O2 -// Type: TWTY_BOOL -// Container: OneValue (per camera) -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Allows you to indicate that a color other than black or -// dark blue ink was used for the data entered on the form. -// This is not available when ECDO is set to (none). -// This feature is not available for all models. -#define ICAP_ECDOTREATASCOLOR 0x80C3 - - -// ICAP_FILTERBACKGROUND -// Family: A2O2, Alf, Alien, Fosters, Inferno, Mustang2, Phoenix, -// Piranha, Pony, Prism, Wildfire -// Type: TWTY_UINT16 -// Container: Range -// Allowed: 0 - 255 -// Default: 245 -// Notes: Selects the grayscale color to replace the dropout -// color when capturing bitonal images... -#define ICAP_FILTERBACKGROUND 0x8026 - - -// ICAP_FILTERENUM -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, -// Mustang2, Panther, Phoenix, Piranha, Piranha2, Pony, -// Prism, Rufous, Wildfire -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: See ICAP_FILTER -// Default: TWFT_NONE -// Notes: Tied to ICAP_FILTER... -// ICAP_FILTER is an array...and we need an enum (sigh)... -#define ICAP_FILTERENUM 0x8024 - - -// ICAP_FILTERPROCESSING -// Family: Phoenix -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: TWFP_NORMAL, TWFP_LOWRES -// Default: TWFP_NORMAL -// Notes: If color dropout at low resolutions results in -// unwanted artifacts, try changing this capability -// to TWFP_LOWRES. -#define ICAP_FILTERPROCESSING 0x8088 -#define TWFP_NORMAL 0 -#define TWFP_LOWRES 1 - - -// ICAP_FILTERTHRESHOLD -// Family: A2O2, Alf, Alien, Fosters, Inferno, Mustang2, Phoenix, -// Piranha, Pony, Prism, Wildfire -// Type: TWTY_UINT16 -// Container: Range -// Allowed: 0 - 255 -// Default: 175 -// Notes: Selects the threshold point of the color data when -// capturing bitonal images... -#define ICAP_FILTERTHRESHOLD 0x8025 - - -// ICAP_FLIPBACKGROUNDCOLOR -// Family: Gemini -// Type: TWTY_BOOL -// Container: OneValue (per camera) -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: 5000/7000 only. This is Border Reduction. A feature -// that changes the borders on the left and the right to -// white the opposite pixel flavor 'color'. A value of -// TRUE does the change, a value of FALSE leaves it as is... -#define ICAP_FLIPBACKGROUNDCOLOR 0x8043 - - -// ICAP_FORCECOMPRESSION -// Family: Gemini, Inferno, Phoenix, Prism, Wildfire, Viper -// Type: TWTY_UINT16 -// Container: Enumeration (per camera) -// Allowed: same rules as ICAP_COMPRESSION -// Default: TWCP_NONE -// Notes: A throughput efficiency mechanism. If an application -// requires uncompressed data, but the size of the image -// is more than SCSI can manage, then use this capability -// to force the scanner to compress the data, and the -// Source to decompress in software before transferring -// it to the application. Note that with the Prism -// this value is always TWCP_JPEG for the color cameras. -#define ICAP_FORCECOMPRESSION 0x8008 - - -// ICAP_FOREGROUNDBOLDNESSAGGRESSIVENESS -// Family: Falcon -// Type: TWTY_INT32 -// Container: Range (per color camera) -// Allowed: -10 to 10 -// Default: 0 -// Notes: The foreground boldness aggressiveness setting. -// This setting only has meaning if -// ICAP_FOREGROUNDBOLDNESSMODE is TWFB_AUTOMATIC. -#define ICAP_FOREGROUNDBOLDNESSAGGRESSIVENESS 0x810E - - -// ICAP_FOREGROUNDBOLDNESSMODE -// Family: Falcon -// Type: TWTY_UINT16 -// Container: Enumeration (per color camera) -// Allowed: TWFB_NONE, TWFB_AUTOMATICBASIC, TWFB_AUTOMATIC -// Default: TWFB_NONE -// Notes: The foreground boldness mode -#define ICAP_FOREGROUNDBOLDNESSMODE 0x810F -#define TWFB_NONE 0 -#define TWFB_AUTOMATICBASIC 1 -#define TWFB_AUTOMATIC 2 - - -// ICAP_FRAMELENGTHCONTROL -// Family: Gemini -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: 5000/7000 only. Controls the way the scanner detects -// the end of the document. A value of TRUE reflects the -// way all other scanners work. A value of FALSE should -// be used for documents with ragged bottom edges... -#define ICAP_FRAMELENGTHCONTROL 0x8042 - - -// ICAP_FRAMESANGLE -// Family: Blaze, Falcon, Oasis, Panther, Piranha2 -// Type: TWTY_FRAMEANGLE -// Container: Enumeration -// Allowed: 0,0 - ICAP_PHYSICALWIDTH,ICAP_PHYSICALHEIGHT -// Default: value of ICAP_SUPPORTEDSIZE -// Notes: With the support of angles it becomes necessary to -// provide a way to specify the coordinates and the -// angle simultaneously, otherwise it's impossible to -// provide proper validation. So if you are working -// with non-zero angles, then use this capability -// instead of ICAP_FRAMES or DAT_IMAGELAYOUT. -#define ICAP_FRAMESANGLE 0x80BB - - -// ICAP_GAMMAENABLED -// Family: Blaze, Falcon, Inferno, Panther, Phoenix, Piranha2, Wildfire -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: A value of TRUE causes the scanner to apply -// its gamma table to the image. This only has -// meaning for grayscale output. -#define ICAP_GAMMAENABLED 0x8074 - - -// ICAP_GRAYSCALE -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, -// Mustang2, Panther, Phoenix, Piranha, Piranha2, Pony, -// Prism,, Rufous, Wildfire -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: If set to TRUE then the color output will be -// converted to grayscale. You can also get to -// this mode by setting ICAP_PIXELTYPE to -// TWPT_GRAY, though if you do it that way you -// will get grayscale output for both the front -// and the rear images... -#define ICAP_GRAYSCALE 0x802E - - -// ICAP_HALFTONESQUALITY -// Family: Viper (3590/4500) -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: TWHQ_SOFTWAREFAST and TWHQ_SOFTWAREBEST or -// TWHQ_HARDWAREBEST -// Default: TWHQ_SOFTWAREFAST or TWHQ_HARDWAREBEST -// Notes: Selects the quality/performance of the -// ChromaTHR(tm) software quality settings for -// making bitonal images from color data. If -// a hardware card is present, than it is the -// only option available; otherwise the two -// software options are made available... -#define ICAP_HALFTONESQUALITY 0x801F -#define TWHQ_NONE 0 -#define TWHQ_SOFTWAREFAST 1 -#define TWHQ_SOFTWAREBEST 2 -#define TWHQ_HARDWAREBEST 3 - - -// ICAP_HOLEFILLENABLED -// Family: Falcon, Piranha, Piranha2 -// Type: TWTY_BOOL -// Container: OneValue (per output stream) -// Allowed: TRUE / FALSE -// Default: FALSE -// Notes: Hole Fill enabled/disabled. -#define ICAP_HOLEFILLENABLED 0x8104 - - -// ICAP_IMAGEEDGEFILL -// Family: A2O2, Falcon, Fosters, Mustang2, Panther, Piranha, -// Piranha2, Pony, Rufous -// Type: TWTY_UINT16 -// Container: Enumeration (per camera) -// Allowed: (see list below) -// Default: TWIE_AUTOMATIC if the scanner is supported. -// Otherwise TWIE_NONE is the default -// Notes: Fills in each edge of the image with the selected color. -// The TWIE_AUTOMATIC and TWIE_AUTOMATICWITHTEAR are not available -// for all scanners. -#define ICAP_IMAGEEDGEFILL 0x8095 -#define TWIE_NONE 0 -#define TWIE_WHITE 1 -#define TWIE_BLACK 2 -#define TWIE_AUTOMATIC 3 -#define TWIE_AUTOMATICWITHTEAR 4 - - -// ICAP_IMAGEEDGEFILLALLSIDES -// Family: A2O2, Falcon, Fosters, Panther, Piranha, Piranha2, Rufous -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: Indicates if all of the sides for image edge fill are the same -// value, based on ICAP_IMAGEEDGETOP -#define ICAP_IMAGEEDGEFILLALLSIDES 0x80B9 -#define ICAP_IMAGEEDGEFILLALLSIZE 0x80B9 // Deprecated TWAIN 10.x+ - - -// ICAP_IMAGEEDGE* -// Family: A2O2, Falcon, Fosters, Mustang2, Panther, Piranha, Piranha2, -// Pony, Rufous -// Type: TWTY_FIX32 -// Container: Range (per camera) -// Allowed: 0 to ICAP_PHYSICALWIDTH for left and right -// 0 to ICAP_PHYSICALHEIGHT for the the top and bottom -// Default: 0 -// Notes: Amount of fill for the left/right/top/bottom edge of the image -#define ICAP_IMAGEEDGELEFT 0x8096 -#define ICAP_IMAGEEDGERIGHT 0x8097 -#define ICAP_IMAGEEDGETOP 0x8098 -#define ICAP_IMAGEEDGEBOTTOM 0x8099 - - -// ICAP_IMAGEFILEFORMAT -// Family: (all) -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: TWFF_BMP, TWFF_JFIF, TWFF_TIFF, TWFF_RAW... -// Default: TWFF_BMP -// Notes: This is a standard TWAIN capability, we're just -// adding a custom argument to it -#define TWFF_RAW 0x8001 -#define TWFF_RAWBMP 0x8002 - - -// CAP_IMAGEMAGNIFICATIONFACTOR -// Family: n/a -// Type: TWTY_UINT16 -// Container: Range -// Allowed: 0 - 255 -// Default: 0 -// Notes: Helps the scanner determine the 'real' size of images -// coming from the P-Card. This information is used to -// optimize buffer thresholding. -// This capability is not available at this time. -#define CAP_IMAGEMAGNIFICATIONFACTOR 0x806B - - -// ICAP_LAMPSAVER -// Family: Prism, Viper -// Type: TWTY_BOOL -// Container: OneValue -// Allowed: TRUE / FALSE -// Default: TRUE -// Notes: If TRUE the scanner's lamps will automatically turn off -// after ten minutes of non-use; saving power and extending -// the life of the lamps. -#define ICAP_LAMPSAVER 0x8005 - - -// ICAP_LAMPTIMEOUT -// Family: Prism, Viper -// Type: TWTY_UINT16 -// Container: Range -// Allowed: Viper:0,10 Prism:0-30 (minutes) -// Default: 10, 20 -// Notes: Controls the lamp saver option. Please note that this -// capability should be used instead of ICAP_LAMPSAVER. -#define ICAP_LAMPTIMEOUT 0x802A - - -// ICAP_MEDIATYPE -// Family: A2O2, Blaze, Falcon, Fosters, Panther, Piranha, Piranha2, Rufous -// Type: TWTY_UINT16 -// Container: Enumeration (per camera) -// Allowed: See below -// Default: TWMT_PLAINPAPER -// Notes: Allows user to select type of media being scanned. -// The front and rear camera setting must be the same. -#define ICAP_MEDIATYPE 0x80B6 -#define TWMT_CARDSTOCK 0 -#define TWMT_GLOSSYPAPER 1 -#define TWMT_MAGAZINE 2 -#define TWMT_PLAINPAPER 3 -#define TWMT_THINPAPER 4 - - -// ICAP_ORTHOGONALROTATE -// Family: Blaze, Falcon, Piranha2 -// Type: TWTY_UINT16 -// Container: Enumeration (per camera) -// Allowed: (see below) -// Default: TWOROT_NONE -// Notes: Orthogonal rotation -#define ICAP_ORTHOGONALROTATE 0x80D5 -#define TWOROT_NONE 0 -#define TWOROT_AUTOMATIC 1 -#define TWOROT_90 2 -#define TWOROT_180 3 -#define TWOROT_270 4 -#define TWOROT_AUTOMATIC_90 5 -#define TWOROT_AUTOMATIC_180 6 -#define TWOROT_AUTOMATIC_270 7 - - -// ICAP_OVERSCANX -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, Panther, -// Phoenix, Piranha, Piranha2, Prism, Rufous, Wildfire, Viper -// Type: TWTY_FIX32 -// Container: Range (per camera) -// Allowed: 3500: 0-0.5" All others: 0-0.375" -// Default: 3500: 0.5" All others: 0.375" -// Notes: Amount of overscan (in ICAP_UNITS) on the left and -// right sides of the cropping region. -#define ICAP_OVERSCANX 0x8006 - - -// ICAP_OVERSCANY -// Family: A2O2, Alf, Alien, Blaze, Falcon, Fosters, Inferno, Panther, -// Phoenix, Piranha, Piranha2, Prism, Rufous, Wildfire, Viper -// Type: TWTY_FIX32 -// Container: Range (per camera) -// Allowed: 3500: 0-0.5" All others: 0-0.375" -// Default: 3500: 0.5" All others: 0.375" -// Notes: Amount of overscan (in ICAP_UNITS) on the top and -// bottom sides of the cropping region. -#define ICAP_OVERSCANY 0x8007 - - -// ICAP_PADDING -// Family: n/a -// Type: TWTY_UINT16 -// Container: Enumeration -// Allowed: (see list below) -// Default: TWPG_AUTO -// Notes: Selects the padding to force the bytes-per-row -// (or the stride) to always land on a specific -// boundry... -#define ICAP_PADDING 0x80AA -#define TWPG_AUTO 0 -#define TWPG_NONE 1 -#define TWPG_BYTE 2 -#define TWPG_WORD 3 -#define TWPG_LONGWORD 4 -#define TWPG_OCTAWORD 5 - - -// ICAP_PHYSICALHEIGHTADJUST -// Family: Blaze, Falcon, Panther, Piranha2 -// Type: TWTY_FIX32 -// Container: Range -// Allowed: Scanner specific -// Default: Scanner specific -// Notes: Adjusts the value of ICAP_PHYSICALHEIGHT. Applications must -// set this value to have access to the full scan length of the -// ADF. -#define ICAP_PHYSICALHEIGHTADJUST 0x8101 - - -// ICAP_SKEWANGLE -// Family: A2O2, Blaze, Falcon, Fosters, Panther, Piranha, Piranha2, Rufous -// Type: TWTY_UINT16 -// Container: Range -// Allowed: -360000 - 360000 -// Default: 0 -// Notes: Selects the deskew angle for fixed cropping. -#define ICAP_SKEWANGLE 0x80B5 - - -// ICAP_STREAKREMOVALAGGRESSIVENESS -// Family: Blaze, Falcon, Panther, Piranha, Piranha2 -// Type: TWTY_INT32 -// Container: Range -// Allowed: -2 to 2 -// Default: 0 -// Notes: Streak removal aggressiveness level. -2 is least aggressive -// while 2 is most aggressive. The aggressiveness level is -// meaningless if streak removal enabled is FALSE. -#define ICAP_STREAKREMOVALAGGRESSIVENESS 0x80C7 - - -// ICAP_STREAKREMOVALENABLED -// Family: Blaze, Falcon, Panther, Piranha, Piranha2 -// Type: TWTY_BOOL -// Container: OneValue (per output stream) -// Allowed: TRUE / FALSE -// Default: Piranha: FALSE -// Others: TRUE -// Notes: Streak Removal enabled/disabled. If TRUE, then the -// streak removal aggressiveness level has meaning. -#define ICAP_STREAKREMOVALENABLED 0x80C6 - - -// ICAP_VERTICALBLACKLINEREMOVAL -// Family: Prism (not implemented, ignore this for now) -// Type: TWTY_BOOL -// Container: OneValue (per camera) -// Allowed: TRUE/FALSE -// Default: TRUE -// Notes: Controls vertical black line removal (VBLR). -// Only supported for bitonal with ATP... -#define ICAP_VERTICALBLACKLINEREMOVAL 0x8021 - - - -//////////////////////////////////////////////////////////////////////////////// -// DAT Section -//////////////////////////////////////////////////////////////////////////////// - - - -// -// A2O2/Falcon/Inferno/Phoenix/Piranha/Piranha2/Wildfire auto color learning -// (DG_CONTROL)... -// Notes: This utility will determine the proper Color Amount value -// to use with the current Color Threshold value, in order to -// save a representative stack of color documents as either color -// or grayscale images... -#define DAT_AUTOCOLORLEARN 0x8006 - - -// -// Color Table Map (DG_CONTROL)... -// Notes: This data structure allows an application to -// map the ICAP_COLORTABLE numeric values to -// both the English and current language strings. -// The call allocates the data structure. The -// application parses the items (a value of -// 0xFFFF for ColorTableValue indicates the end -// of the array). -#define DAT_COLORTABLEMAP 0x8003 -typedef struct -{ - TW_UINT16 ColorTableValue; - TW_STR255 szEnglish; - TW_STR255 szCurrent; -} TW_COLORTABLEMAP, *pTW_COLORTABLEMAP; - - -// -// Device Information -// Notes: This data structure provides additional -// information about the device that may be -// useful with some system message, such -// as WM_DEVICECHANGE. The dwFields value -// indicates how many fields are supported -// by the driver (the value doesn't include -// the dwFields, itself)... -// -// dwModelNumber - ex: 200, 990, 3520... -// szModelName - ex: i200, 990... -// szProtocol - ex: ASPI, SCSISCAN... -// dwFirmware - ex: 10427 (1.4.27) -// -// Only if szProtocol is SCSISCAN -// szDeviceName - \\.\Scanner# style -// szDeviceChange - \\?\SBP2... style -// -// Only if szProtocol is ASPI -// dwHostAdapter -// dwTarget -// -#define DAT_DEVICEINFO 0x8005 -#define TWCNST_DEVICEINFOFIELDS 9 -typedef struct -{ - TW_UINT32 dwFields; - TW_UINT32 dwModelNumber; // field 1 - TW_STR255 szModelName; // field 2 - TW_STR255 szProtocol; // field 3 - TW_STR255 szDeviceName; // field 4 - TW_UINT32 dwHostAdapter; // field 5 - TW_UINT32 dwTarget; // field 6 - // put new fields here... - TW_STR255 szDeviceChange; // field 7 + 256 = 256 - TW_UINT32 dwFirmware; // field 8 + 32 = 288 - TW_STR255 szDriverFilename; // field 9 + 256 = 544 - // always reduce this if we add fields... - TW_UINT8 reserved[65536-544]; -} TW_DEVICEINFO, *pTW_DEVICEINFO; - - -// Driver Electronic Color Dropout (for drivers that support ICAP_ECDO) -// -// Notes: Use this structure to explore and manage dropout colors. -// -// This data structure allows an application to map the ICAP_ECDO -// numeric values to both the English and current language strings. -// ICAP_ECDO is used to select a dropout color for the current camera. -// -// The driver will allocate the returned data structure. -// -// To get the list of dropout choices (for when an application wants -// to present the list on its own user interface): -// ----------------------------------------------------------------- -// 1. Application calls DG_CONTROL / DAT_ECDO / MSG_GET to get -// the list of all the choices. -// 2. Driver returns the list of choices (i.e. fills in the -// TW_ECDO structure for each choice). -// 3. Application loops through the returned list until both szEnglish -// and szCurrent are blank (which indicates the end of the list). -// -// To find a dropout choice (for when an application needs to find -// the TWCD_* for use with ICAP_ECDO): -// ----------------------------------------------------------------- -// 1. Application calls DG_CONTROL / DAT_ECDO / MSG_GET to get -// the list of all the choices. -// 2. Driver returns the list of choices (i.e. fills in the -// TW_ECDO structure for each choice). -// 3. Application loops through the returned list until it finds the -// desired English dropout name (use szEnglish because this will -// always be consistent no matter what the language of the driver -// is; where szCurrrent will be based on the driver's current -// language, which may be different then the last time the list -// was returned). -// 4. Application uses the EcdoValue of the desired dropout choice -// as the setting for ICAP_ECDO. This means the EcdoValue -// will be one of the TWCD_* defines (e.g. TWCD_FILE01). -// -#define DAT_ECDO 0x800A -typedef struct -{ - TW_UINT16 EcdoValue; - TW_STR255 szEcdo; - TW_STR255 szText; - TW_UINT8 Reserved[1024]; // Room for more stuff -} TW_ECDO, *pTW_ECDO; - - -// Driver Logs (DG_CONTROL / DAT_LOG / MSG_GET) -// -// This will get a log and save it in the provided file. There are text based logs and XML based -// logs. Some logs are scanner specific, so the content will not be common among all scanner -// families, and some are common so the content can be common among all scanners. -// -// Text based logs are ones that can be easily viewed in something like Notepad, each log entry -// will be on its own line. These logs contain the same information as is shown on the driver UI -// on the Log tab. The language for the translated text will be based on the current language -// selected for the driver. -// -// The XML based logs will contain data in a XML format. For details on the XML format for -// a log, refer to the TWAIN_Features.htm in the Intergrators Guide. -// -// For devices that support the Flatbed as an accessory (e.g. i1300, i1400), the application -// will need to make a second call to get the flatbeds information (see DeviceType below). This -// is necessary because the flatbed is a separate device. -// -// To generate an EKLOG specify a LogType of TWGL_EKLOG. The DeviceType is ignored. The -// Filename specifies the full path and file for the log, and it should end in .eklog. -// The Description is stored with the EKLOG. Use SaveImages to specify if .tif and .jpg -// files should be included (including them may result in a very large EKLOG file). -// -#define DAT_LOG 0x800C -typedef struct { - TW_UINT16 LogType; // log to get (see TWGL_*) - TW_UINT16 DeviceType; // ADF or Flatbed (see TWDV_*) - TW_STR255 Filename; // full path and name to store log into - TW_STR255 Description; // Reason for log (use with TWLG_EKLOG) - TW_BOOL SaveImages; // Save images (use with TWLG_EKLOG) - TW_UINT8 Reserved[254]; // Room for future expansion -} TW_LOG, *pTW_LOG; - -// different logs that can be retrieved via DAT_LOG. The comment indicate whether the -// log is text based or XML base, and whether it is common among all scanner families or not. -#define TWGL_GENERAL 0 // text, not common -#define TWGL_OPERATOR 1 // text, not common -#define TWGL_GENERAL_XML 2 // XML, common -#define TWGL_EKLOG 3 // EKLOG (TWDV_* value is ignored) - - -// different devices, which can be used by multiple CAPs/ICAPs/DATs -#define TWDV_UNKNOWN 0 // unknown/reserved -#define TWDV_ADF 1 // base scanner -#define TWDV_FLATBED 2 // flatbed scanner - - -// OCP buttons (DG_CONTROL / DAT_OCPBUTTONS / MSG_SET) -// -// Scanner supported: Falcon, Piranha2 -// Max number of buttons: 9 -// -// This feature allows the application to set the displayed text on the OCP for -// each button. It also allows the application to set the Paper Source for each -// button. The driver may not remember this information. So we recommand -// that the application should send the text after successfully MSG_OPENDS. -// -// To configure the number of buttons for the user to scroll through, the -// App must send an array of TW_OCPBUTTONS structures which has the number -// of the buttons defined plus an extra one that has Text field blank. -// For example, if the user wants to setup the text for 3 buttons then -// define the array of 4 TW_OCPBUTTONS structures. Set the Text for each -// the first 3 items and set the Text to blank for the 4th. -// -// For the scanners that dont have the ability to display the text, the -// application still can configure the number of buttons for the user -// to scroll through. -// -// The order of the buttons displayed on the OCP is the same order of the -// buttons defined in the array. -// -// The Text is in the current language. The Ansi code page which is based -// on the CAP_LANGUAGE is used for the conversion. -// -// The Paper Source value to pass in is the TWAIN enum value for the Paper -// Source associated with the button. For eaxmple, TWPU_ADF is the enum value -// associated with the "adf" paper source. For the complete list of Paper -// Source enums, look at the TWPU_* definitions under CAP_PAPERSOURCE. -// -// The NumDataFields value refers to the number of data fields to follow. -// If the PaperSource field is being set, then NumDataFields must be set to 1. -// In the future, we could add other data fields, in which case NumDataFields -// would be incremented by the caller. -// -// The Reserved field must be initialized to zero. -// -// For example, if setting a button to "Color PDF" and the paper source is -// "Document Feeder", then: -// Text = "Color PDF" -// NumDataFields = 1 -// PaperSource = TWPU_ADF -// -#define DAT_OCPBUTTONS 0x800E -typedef struct { - TW_STR255 Text; // Displayed text on OCP for a button - TW_UINT32 NumDataFields; // Number of fields of data that follow this field - TW_UINT32 PaperSource; // TWPU_* enum from CAP_PAPERSOURCE - TW_UINT8 Reserved[504]; // Room for future expansion -} TW_OCPBUTTONS, *pTW_OCPBUTTONS; - - -// -// Alien Personality Card (DG_CONTROL)... -// Notes: These represent the common commands that pcards -// may support. Other commands documented by the -// manufacturer of the card may be accessed using -// the DAT_PASSTHRU operation... -#define DAT_PCARD 0x8002 -typedef struct -{ - TW_UINT32 StructSize; - TW_UINT32 Action; - TW_UINT32 DataSize; - TW_MEMREF Data; -} TW_PCARD, *pTW_PCARD; - -// Additional return codes... -#define TWRC_PCARD_CHECKSTATUS 0x8002 // something interesting has happened -#define TWRC_PCARD_FATAL 0x8003 // the card is dead -#define TWRC_PCARD_RETRYIMAGE 0x8004 // the image failed a quality test -#define TWRC_PCARD_NOCARD 0x8005 // no card installed - -// Supported actions... -#define TWPCD_ACTION_INQUIRY 0 -#define TWPCD_ACTION_STATUS 1 -#define TWPCD_ACTION_ATTRIBUTES 2 -#define TWPCD_ACTION_DIAGNOSTIC 3 - -// Support structures for the various actions... -typedef struct -{ - TW_INT8 StructSize[4]; // 0-3 - TW_INT8 VendorId[8]; // 4-11 - TW_INT8 ProductId[16]; // 12-27 - TW_INT8 RevisionNumber[4]; // 28-31 - TW_INT8 BuildNumber[2]; // 32-33 - TW_INT8 Reserved[2048-34]; // 34-2048 -} TW_PCARD_INQUIRY, FAR * pTW_PCARD_INQUIRY; - -typedef struct -{ - TW_INT8 StructSize[4]; // 0-3 - TW_INT8 Code[4]; // 4-7 - TW_INT8 Severity; // 8 - TW_INT8 Text[1011]; // 9-1019 - TW_INT8 Reserved[2048-1020]; // 1020-2048 -} TW_PCARD_STATUS, *pTW_PCARD_STATUS; - -typedef struct -{ - TW_INT8 StructSize[4]; // 0-3 -} TW_PCARD_ATTRIBUTES, *pTW_PCARD_ATTRIBUTES; - -typedef struct -{ - TW_INT8 StructSize[4]; // 0-3 -} TW_PCARD_HEADER, *pTW_PCARD_HEADER; - - -// Driver Profiles (for drivers that support CAP_PROFILES) -// -// Notes: Use this structure to explore and manage profiles. These profiles -// are compatible with DAT_CUSTOMDSDATA. -// -// This data structure allows an application to map the CAP_PROFILES -// numeric values to both the English and current language strings. -// -// To get the list of profiles (for when an application wants to -// present the list on its own user interface): -// ----------------------------------------------------------------- -// 1. Application calls DG_CONTROL / DAT_PROFILES / MSG_GET to get -// the list of all the profiles. -// 2. Driver returns the list of profiles (i.e. fills in the -// TW_PROFILES structure for each profile) -// 3. Application loops through the returned list until both szEnglish -// and szName are blank (which indicates the end of the list) -// -// To find a profile (for when an application needs to find the -// TWPO_* for use with CAP_PROFILES): -// ----------------------------------------------------------------- -// 1. Application calls DG_CONTROL / DAT_PROFILES / MSG_GET to get -// the list of all the profiles. -// 2. Driver returns the list of profiles (i.e. fills in the -// TW_PROFILES structure for each profile) -// 3. Application loops through the returned list until it finds the -// desired English profile name (use szEnglish because this will -// always be consistent no matter what the language of the driver -// is; where szName will be based on the driver's current -// language, which may be different then the last time the list -// was returned) OR ID. The application should use szEnglish name -// if they want to always find a specific profile (i.e. Black and -// White Doc) OR use ID when it doesn't care about specific names, -// but wants to use unique IDs to get the same profile even if the -// user renames it. -// 4. Application uses the ProfilesValue of the desired profile as -// the setting for CAP_PROFILES. This means the ProfilesValue -// will be one of the TWPO_* defines (e.g. TWPO_FILE01). -// -// Unless otherwise specified, start with a structure set to all zeros -// (i.e. memset to 0), then fill in all required fields, and then fill -// in any optional fields as desired -// -// To create a new profile (version 10.x+): -// ----------------------------------------------------------------- -// - Application calls DG_CONTROL / DAT_PROFILES / MSG_PROFILECREATE -// - Required: -// szName - Name of the new profile -// - Optional: -// szFilename - Graphic filename associate with a new profile -// - Errors: -// If the new profile name is already existed then the driver -// driver will return TWCC_BADVALUE -// -// To save the current driver settings (version 10.x+): -// ----------------------------------------------------------------- -// - Application calls DG_CONTROL / DAT_PROFILES / MSG_PROFILESAVE -// - Required: (none) -// - Optional: (none) -// - Errors: (none) -// -// To delete the current profile (version 10.x+): -// ----------------------------------------------------------------- -// - Application calls DG_CONTROL / DAT_PROFILES / MSG_PROFILEDELETE -// - Required: (none) -// - Optional: -// szEnglish - English name of profile that will be selected -// after deletion. If szEnglish is not specified, -// the driver will determine which profile to -// select. If you are deleting the last profile, -// then szEnglish should be blank -// - Error: -// If the profile is readonly or the profile state is -// TWPRF_PROFILESTATE_MODIFIED, the driver will return TWCC_DENIED -// -// To rename the current profile (version 10.x+): -// ----------------------------------------------------------------- -// - Application calls DG_CONTROL / DAT_PROFILES / MSG_PROFILERENAME -// - Required: At least specify one of the option below -// - Optional: (can specify szCurrent or szFilename or both) -// szName - Name of the profile; if not supplied, the name -// will not be changed -// szFilename - Graphic filename associate with a new profile; -// if not supplied, the graphic will not be changed -// - Error: -// If the profile is readonly or the profile state is -// TWPRF_PROFILESTATE_MODIFIED, the driver will return TWCC_DENIED -// -// To restore all the supplied profiles to what was installed (v10.x+): -// ----------------------------------------------------------------- -// - Application calls DG_CONTROL / DAT_PROFILES / MSG_PROFILERESTORE -// - Required: -// blSharedSettings - Include settings shared across profiles -// (e.g. Power Saver) -// - Optional: (none) -// - Error: -// If profile state is TWPRF_PROFILESTATE_MODIFIED for one of the -// profiles, the driver will return TWCC_DENIED -// -// To export profiles (version 10.x+): -// ----------------------------------------------------------------- -// - Application calls DG_CONTROL / DAT_PROFILES / MSG_PROFILEEXPORT -// - Required: -// szFilename - Name of the file to export -// - Optional: (none) -// - Error: -// If profile state is TWPRF_PROFILESTATE_MODIFIED for one of the -// profiles, the driver will return TWCC_DENIED -// -// To import profiles (version 10.x+): -// ----------------------------------------------------------------- -// - Application calls DG_CONTROL / DAT_PROFILES / MSG_PROFILEIMPORT -// This will remove all profiles that have been configured and -// replace them with the imported profiles. -// - Required: -// szFilename - Name of the file to import -// - Optional: (none) -// - Error: -// If profile state is TWPRF_PROFILESTATE_MODIFIED for one of the -// profiles, the driver will return TWCC_DENIED -// -// To set current profile (version 10.x+): -// ----------------------------------------------------------------- -// - Application calls DG_CONTROL / DAT_PROFILES / MSG_PROFILESET -// - Required: -// szEnglish - English name of the profile to be selected -// - Optional: (none) -// - Error: (none) -// -#define DAT_PROFILES 0x8007 -typedef struct -{ - TW_UINT16 ProfilesValue; // CAP_PROFILES TWPO_* value - TW_STR255 szFamily; // Deprecated TWAIN 10.x+ - TW_STR255 szId; // unique profile ID - TW_STR255 szEnglish; // profile name in English - TW_STR255 szCurrent; // Deprecated TWAIN 10.x+ - TW_UINT32 Group; // group type (see TWPRF_GROUP_*) - TW_BOOL Readonly; // cannot be modifed or deleted? - TW_BOOL Default; // a default profile? - TW_UINT32 DriverVersion; // Deprecated TWAIN 10.x+ - TW_STR255 szMethod; // Deprecated TWAIN 10.x+ - - // the following are valid version 10.x+ - - TW_STR255 szName; // profile name in the current language. - // Uses the Ansi code page. The - // language is based on CAP_LANGUAGE - - TW_STR255 szFilename; // Full path and filename to a file - // The filename is either graphic filename - // or profile filename based on the MSG - // See the description above for more details - - TW_BOOL blSharedSettings; // Indicates whether the shared profile - // settings are to be reset as well. - TW_UINT16 ProfileState; // Profile state (see TWPRF_PROFILESTATE_*) - - TW_UINT8 Reserved[508]; // Room for more stuff, always set to 0. - -} TW_PROFILES, *pTW_PROFILES; - - -// group types for TW_PROFILES -#define TWPRF_GROUP_ALL 0 - - -// The profile state. There can only be one profile in the -// profile list that is not normal. -#define TWPRF_PROFILESTATE_NORMAL 0 // Not selected or modified -#define TWPRF_PROFILESTATE_CURRENT 1 // Currently selected profile -#define TWPRF_PROFILESTATE_MODIFIED 2 // Currently selected and has been modified - - -// Notes: This operation is used by the application to -// DG_CONTROL / DAT_QUERYSUPPORT/ MSG_GET or MSG_GETCURRENT or -// MSG_GETDEFAULT. This allows the application to find out if the DAT -// capability is supported or not. -#define DAT_QUERYSUPPORT 0x800B - -typedef struct { - TW_UINT32 DG; - TW_UINT16 DAT; - TW_UINT16 MSG[64]; //Return the array of supported MSG -}TW_QUERYSUPPORT, FAR *pTW_QUERYSUPPORT; - - -// -// Gemini/Viper RAW Status (DG_CONTROL)... -// Notes: This command may be issued at any time. It reports -// the raw data for the last error status reported by -// the scanner. These are device dependent values -// which may be reported for servicing issues, but -// should not be used to drive code... -// -#define DAT_STATUSRAW 0x8001 -typedef struct -{ - TW_INT32 LastToolkitStatus; - TW_INT32 LastSenseData[3]; - TW_STR255 LastText; - TW_INT32 CurrentState; - TW_INT32 LastKDSStatus; -} TW_STATUSRAW, *pTW_STATUSRAW; - - -// -// Window Management -// Notes: Use this structure to add and remove windows. -// A window is an index to a set of cameras, such -// as front_bitonal, front_color, etc... -// -#define DAT_WINDOW 0x8008 -typedef struct -{ - TW_UINT16 WindowCamera; // CAP_WINDOWCAMERA value - TW_UINT8 Reserved[1024]; // Room for more stuff -} TW_WINDOW, *pTW_WINDOW; - - -#define TWTY_FRAMEANGLE 0x8001 -typedef struct { - TW_FIX32 Left; // same as TW_FRAME.Left - TW_FIX32 Top; // same as TW_FRAME.Top - TW_FIX32 Right; // same as TW_FRAME.Right - TW_FIX32 Bottom; // same as TW_FRAME.Bottom - TW_INT32 Angle; // -3600000 to +3600000 -} TW_FRAMEANGLE, FAR * pTW_FRAMEANGLE; - - - -//////////////////////////////////////////////////////////////////////////////// -// MSG Section -//////////////////////////////////////////////////////////////////////////////// - - - -// -// All Disable/Enable UI... -// Notes: This message is added to DG_CONTROL / DAT_USERINTERFACE -// to allow the application to temporarily disable access -// to the Source's GUI. -// -#define MSG_DISABLEUI 0x8003 -#define MSG_ENABLEUI 0x8004 - - -// -// All Enable Scanner... -// Notes: This message is added to DG_CONTROL / DAT_USERINTERFACE -// to allow the user to enable the scanner. The main use -// for this command is to allow a filter writer to split -// a MSG_ENABLEDS into a MSG_SETUPDS followed by a -// MSG_ENABLESCANNER, allowing the filter to interrogate -// the scanner about its current setting before moving paper. -// This command is only permitted in State 4, and if ShowUI -// is set to FALSE... -// -#define MSG_ENABLESCANNER 0x8006 - - -// -// All Special Get... -// Notes: Used to get data out of sequence with the specification. -// The only example at this time is use with DG_IMAGE / -// DAT_EXTIMAGEINFO... -// -#define MSG_GETSPECIAL 0x8005 - - -// -// Profile messages... -// Notes: Use these with DG_CONTROL / DAT_PROFILES. -// -#define MSG_SAVEPROFILE 0x8008 // Deprecated TWAIN 10.x+ -#define MSG_DELETEPROFILE 0x8009 // Deprecated TWAIN 10.x+ -#define MSG_PROFILECREATE 0x8015 -#define MSG_PROFILEDELETE 0x8016 -#define MSG_PROFILESAVE 0x8017 -#define MSG_PROFILERENAME 0x8018 -#define MSG_PROFILERESTORE 0x8019 -#define MSG_PROFILEEXPORT 0x801A -#define MSG_PROFILEIMPORT 0x801B -#define MSG_PROFILESET 0x801C - - -// -// All Setup DS... -// Notes: This message is added to DG_CONTROL / DAT_USERINTERFACE -// to allow the user download the current settings without -// initiating a scanning session. The state remains at 4, -// no matter what the outcome of the command. -// To select the current settings see CAP_PROFILES or CUSTOMDSDATA -// -#define MSG_SETUPDS 0x8002 - - -// -// Window messages... -// Notes: Use these with DG_CONTROL / DAT_WINDOW. -// -#define MSG_ADDWINDOW 0x8011 -#define MSG_DELETEWINDOW 0x8012 - - -// OBS_JPEGQUALITY -// Notes: Same as standard ICAP_JPEGQUALITY, do not use. -#define OBS_JPEGQUALITY 0x8040 - - -// -// All Stop Feeder... -// Notes: This message is added to DG_CONTROL / DAT_PENDINGXFERS -// to allow the user to turn off the transport. -// Do not use this message, use MSG_STOPFEEDER... -// -#define OBS_STOPFEEDER 0x8001 - - - -//////////////////////////////////////////////////////////////////////////////// -// TW Section -//////////////////////////////////////////////////////////////////////////////// - - - -// Filter... -#define TWRC_FILTER_CONTINUE 0x8010 - - -// -// Prism/Wildfire Patchcode extensions... -// Notes: This section extends the patch codes to match those -// supported by the Prism/Wildfire scanner family. Note that -// a transfer patch is interpreted to be a level 2 or -// a level three, so even though it can be set, a -// transfer patch is never received as part of the -// extended image info data... -// -#define TWPCH_PATCHT2 0x8001 -#define TWPCH_PATCHT3 0x8002 -#define TWEJ_PATCHT2 0x8001 -#define TWEJ_PATCHT3 0x8002 - - -// -// QuerySupport extensions... -// -#define TWQC_MACHINE 0x1000 -#define TWQC_BITONAL 0x2000 -#define TWQC_COLOR 0x4000 -#define TWQC_WINDOW 0x8000 - - -// Device Events -// -// The following are the device event supported by all drivers -// prior to version 9.3: TWDE_PAPERDOUBLEFEED and TWDE_PAPERJAM -// -// For version 9.3 drivers and up, the following is a custom -// CAP_DEVICEEVENT the application can ask the driver to send -// it when the lamps need to warmup prior to scanning. This -// event will be issued after a MSG_ENABLEDS if the lamps -// are not warmed up. The number of seconds before the lamps -// are ready will be in the TimeBeforeFirstCapture field of -// the TW_DEVICEVENT structure. -// -// NOTE: The number of seconds may be longer than what it -// actually take. This could happen because an error -// occurred (e.g. opening cover, cancelling) or for -// models that do not have an accurate warmup value. -// Because of this, if your application is displaying -// a please wait message for the user, the message -// needs to be closed when MSG_XFERREADY is received. -#define TWDE_LAMPWARMUP 0x8002 - - -// TWEI_HDR_BINARIZATIONQUALITY -// -// This conveys the quality level of the binarized image -// Some binarization methods can detect if the binarization -// resulted in a noisy (or otherwise suspect) output. -// For those binarization method that don't detect this, -// 'normal' is returned. -#define TWBQ_NORMAL 0 -#define TWBQ_NOISY 1 - - -//////////////////////////////////////////////////////////////////////////////// -// EXTIMAGEINFO Section -//////////////////////////////////////////////////////////////////////////////// - - - -// -// Gemini/Inferno/Phoenix/Prism/Viper/Wildfire Custom TWEI_ fields for DAT_EXTIMAGEINFO... -// Notes: These fields return custom image information -// taken from the image header (or footer)... -// -#define TWEI_HDR_PAGESIDE 0x8001 // 0-front 1-rear -#define TWEI_HDR_DOCUMENTCOUNT 0x8002 // Count of pages (seeded by user) -#define TWEI_HDR_LENGTH 0x8003 // Number of bytes of image data -#define TWEI_HDR_LEVEL 0x8004 // Image Address Level -#define TWEI_HDR_MODE 0x8005 // Gemini Mode (1-18) -#define TWEI_HDR_LINELENGTH 0x8006 // Width -#define TWEI_HDR_PAGELENGTH 0x8007 // Height -#define TWEI_HDR_COMPRESSION 0x8008 // ICAP_COMPRESSION TWCP_* value -#define TWEI_HDR_DATE 0x8009 // YY/MM/DD -#define TWEI_HDR_TIME 0x800A // HH/MM/00 -#define TWEI_HDR_ROLL 0x800B // Imagelink 990 Film Roll Number -#define TWEI_HDR_RESOLUTION 0x800C // Dots Per Inch (DPI) -#define TWEI_HDR_BITORDER 0x800D // Bit order in a byte -#define TWEI_HDR_SKEW 0x800E // (obsolete) -#define TWEI_HDR_MOMENTARYFLAG 0x800F // Gemini Momentary -#define TWEI_HDR_LATCHEDFLAG 0x8010 // Gemini Latched -#define TWEI_HDR_BARCODE 0x8011 // Gemini Barcode(s) -#define TWEI_HDR_DESKEW 0x8012 // Deskew status -#define TWEI_HDR_DESKEWANGLE 0x8013 // Deskew angle -#define TWEI_HDR_POLARITY 0x8014 // ICAP_PIXELFLAVOR TWPF_* value -#define TWEI_HDR_PRINTERSTRING 0x8015 // Viper/Prism/Wildfire printed string -#define TWEI_HDR_PRINTERINDEX 0x8016 // Kinda like the document count -#define TWEI_HDR_IMAGENUMBER 0x8017 // Count images this session -#define TWEI_HDR_PAGENUMBER 0x8018 // Count sheets of paper this session -#define TWEI_HDR_PAGEIMAGENUMBER 0x8019 // Image count on a page (1 - 4) -#define TWEI_HDR_BOOKNAME_A 0x801A // Fixed field Gemini/Prism/Wildfire A -#define TWEI_HDR_BOOKNAME_B 0x801B // Fixed field Prism/Wildfire B -#define TWEI_HDR_BOOKNAME_C 0x801C // Fixed field Prism/Wildfire C -#define TWEI_HDR_BOOKNAME_D 0x801D // Fixed field Prism/Wildfire D -#define TWEI_HDR_IMAGEADDRESSSTRING 0x801E // Prism/Wildfire image address string -#define TWEI_HDR_XOFFSET 0x801F // Left cropping offset -#define TWEI_HDR_YOFFSET 0x8020 // Right cropping offset -#define TWEI_HDR_FEATUREPATCH 0x8021 // Feature patch (only image with patch: i200/i600) -#define TWEI_HDR_IMAGEADDRESSDEFS 0x8022 // Image Address field definitions -#define TWEI_HDR_PCARD_HEADER 0x8023 // Personality-Card Header -#define TWEI_HDR_PCARD_FOOTER 0x8024 // Personality-Card Footer -#define TWEI_HDR_TOKEN_COUNT 0x8025 // Alien token flag -#define TWEI_HDR_REGENERATION 0x8026 // Alien retry count -#define TWEI_HDR_IMAGESTATUS 0x8027 // Alien image status -#define TWEI_HDR_DITHER 0x8028 // Bitonal dithering algorithm used -#define TWEI_HDR_PATCHDETECTED 0x8029 // Patch was found on the document -#define TWEI_HDR_FOLDEDCORNERPERCENTAGE 0x802A // Phoenix folded corner percentage -#define TWEI_HDR_DESKEWCONFIDENCEFACTOR 0x802B // Phoenix deskew confidence factor -#define TWEI_HDR_BITONALCONTRASTPERCENTAGE 0x802C // Phoenix bitonal contrast percentage -#define TWEI_HDR_BITONALCONTRAST 0x802D // Phoenix bitonal contrast -#define TWEI_HDR_BITONALTHRESHOLD 0x802E // Phoenix bitonal threshold -#define TWEI_HDR_SUMHISTOGRAM 0x802F // Phoenix sum historgram -#define TWEI_HDR_DIFFERENCEHISTOGRAM 0x8030 // Phoenix difference histogram -#define TWEI_HDR_GAMMATABLE 0x8031 // Phoenix gamma table -#define TWEI_HDR_MULTIFEED 0x8032 // Multifeed detected -#define TWEI_HDR_DESKEWANGLEACTUAL 0x8033 // Signed deskew angle to scanner precision -#define TWEI_HDR_RAWIMAGEHEADER 0x8034 // Raw image header from scanner -#define TWEI_HDR_LONGPAPERSEGMENT 0x8035 // Long paper segment number -#define TWEI_HDR_LONGPAPERLASTSEGMENT 0x8036 // Long pager last segment -#define TWEI_HDR_AUTOCOLORDETECTED 0x8037 // Auto color detected -#define TWEI_HDR_AUTOCOLORAMOUNT 0x8038 // Auto color amount -#define TWEI_HDR_AUTOCOLORTHRESHOLD 0x8039 // Auto color threshold -#define TWEI_HDR_XML 0x803A // data in XML format (see sample at end of file) -#define TWEI_HDR_DROPOUTSTATUS 0x803B // ECDO Algorithm Status -#define TWEI_HDR_PROCESSINGSTATUS 0x803C // Processing Status -#define TWEI_HDR_BINARIZATIONQUALITY 0x803D // Conveys the quality level of the binarized image -#define TWEI_HDR_DUALSTACKINGSTACK 0x803E // Which output tray a document was dropped into (i5000 only) - // Only valid if dual stacking is enabled; legal values are 1 and 2 - - - -//////////////////////////////////////////////////////////////////////////////// -// List of custom capabilities in numeric order -//////////////////////////////////////////////////////////////////////////////// - - -/* -CAP_FEEDERKEEPALIVE 0x8001 -CAP_PAGESIZELIMIT 0x8002 -CAP_TRANSPORTTIMEOUT 0x8003 -CAP_WINDOWPOSITION 0x8004 -ICAP_LAMPSAVER 0x8005 -ICAP_OVERSCANX 0x8006 -ICAP_OVERSCANY 0x8007 -ICAP_FORCECOMPRESSION 0x8008 -CAP_PRINTERWRITESEQUENCESTRING 0x8009 -CAP_PRINTERWRITESEQUENCESPACE 0x800A -CAP_PRINTERWRITESEQUENCESPACESTRING 0x800B -CAP_PRINTERWRITESEQUENCEMESSAGE1 0x800C -CAP_PRINTERWRITESEQUENCEMESSAGE2 0x800D -CAP_PRINTERWRITESEQUENCEMESSAGE3 0x800E -CAP_PRINTERWRITESEQUENCEMESSAGE4 0x800F -CAP_PRINTERWRITESEQUENCEMESSAGE5 0x8010 -CAP_PRINTERWRITESEQUENCEMESSAGE6 0x8011 -CAP_PRINTERWRITESEQUENCEMESSAGE7 0x8012 -CAP_PRINTERWRITESEQUENCEMESSAGE8 0x8013 -CAP_PRINTERWRITESEQUENCEMESSAGE9 0x8014 -CAP_IMAGEADDRESS 0x8015 -CAP_IMAGEADDRESSENABLED 0x8016 -CAP_DOCUMENTCOUNT 0x8017 -CAP_DOCUMENTCOUNTENABLED 0x8018 -CAP_MODE 0x8019 -CAP_PRINTERINDEXFORMAT 0x801A -CAP_PRINTERINDEXDIGITS 0x801B -CAP_PRINTERDATEDELIMITER 0x801C -CAP_CAMERAENABLE 0x801D -CAP_CAMERAORDER 0x801E -ICAP_HALFTONESQUALITY 0x801F -ICAP_COLORTABLE 0x8020 -ICAP_VERTICALBLACKLINEREMOVAL 0x8021 -ICAP_CROPPINGMODE 0x8022 -ICAP_ADDBORDER 0x8023 -ICAP_FILTERENUM 0x8024 -ICAP_FILTERTHRESHOLD 0x8025 -ICAP_FILTERBACKGROUND 0x8026 -CAP_ULTRASONICSENSITIVITY 0x8027 -CAP_TRANSPORTTIMEOUTRESPONSE 0x8028 -CAP_TRANSPORTAUTOSTART 0x8029 -ICAP_LAMPTIMEOUT 0x802A -CAP_BATCHCOUNT 0x802B -CAP_PAPERSOURCE 0x802C -CAP_MULTIFEEDSOUND 0x802D -ICAP_GRAYSCALE 0x802E -CAP_ENERGYSTAR 0x802F -CAP_BINARIZATION 0x8030 -CAP_PAGECOUNT 0x8031 -CAP_NOWAIT 0x8032 -CAP_PRINTERDATEFORMAT 0x8033 -CAP_PRINTERWRITESEQUENCEMESSAGE10 0x8034 -CAP_PRINTERWRITESEQUENCEMESSAGE11 0x8035 -CAP_PRINTERWRITESEQUENCEMESSAGE12 0x8036 -CAP_FUNCTIONKEY1 0x8037 -CAP_FUNCTIONKEY2 0x8038 -CAP_FUNCTIONKEY3 0x8039 -CAP_FUNCTIONKEY4 0x803A -CAP_LEVELTOFOLLOW1 0x803B -CAP_LEVELTOFOLLOW2 0x803C -CAP_LEVELTOFOLLOW3 0x803D -CAP_IMAGEADDRESSTEMPLATES 0x803E -CAP_BATCHSTARTFUNCTION 0x803F -OBS_JPEGQUALITY 0x8040 -ICAP_COLORSHARPENING 0x8041 -ICAP_FRAMELENGTHCONTROL 0x8042 -ICAP_FLIPBACKGROUNDCOLOR 0x8043 -CAP_PRINTERFONT 0x8044 -CAP_PRINTERIMAGEADDRESSFORMAT 0x8045 -CAP_PRINTERPOSITION 0x8046 -CAP_PRINTERIMAGEADDRESSLEVEL 0x8047 -CAP_PRINTERWRITESEQUENCEINDEX 0x8048 -CAP_PRINTERWRITESEQUENCE 0x8049 -CAP_IMAGEADDRESS_A 0x804A -CAP_IMAGEADDRESS_B 0x804B -CAP_IMAGEADDRESS_C 0x804C -CAP_IMAGEADDRESS_D 0x804D -CAP_BATCHLEVEL 0x804E -CAP_BATCHENDFUNCTION 0x804F -// Reserved 0x8050 - 0x8053 -CAP_ENABLECOLORPATCHCODE 0x8054 -CAP_FIXEDDOCUMENTSIZE 0x8055 -CAP_DOUBLEFEEDSTOP 0x8056 -CAP_MULTIFEEDTHICKNESSDETECTION 0x8057 -// Reserved 0x8058 - 0x8069 -CAP_PCARDENABLED 0x806A -CAP_IMAGEMAGNIFICATIONFACTOR 0x806B -CAP_INDICATORSWARMUP 0x806C -CAP_TOGGLEPATCH 0x806D -CAP_DOUBLEFEEDENDJOB 0x806E -CAP_FEEDERMODE 0x806F -CAP_FOLDEDCORNER 0x8070 -CAP_FOLDEDCORNERSENSITIVITY 0x8071 -ICAP_GAMMAENABLED 0x8074 -CAP_EASYSTACKING 0x8075 -// Reserved 0x8076 - 0x8085 -CAP_MULTIFEEDCOUNT 0x8086 -CAP_PATCHCOUNT 0x8087 -ICAP_FILTERPROCESSING 0x8088 -CAP_BACKGROUND 0x8089 -CAP_PRINTERWRITESEQUENCEMESSAGEINDEX 0x808A -CAP_CHECKDIGIT 0x808B -CAP_BACKGROUNDFRONT 0x808C -CAP_BACKGROUNDREAR 0x808D -CAP_BACKGROUNDPLATEN 0x808E -CAP_ULTRASONICSENSORCENTER 0x808F -CAP_ULTRASONICSENSORLEFT 0x8090 -CAP_ULTRASONICSENSORRIGHT 0x8091 -ICAP_AUTOCOLORAMOUNT 0x8092 -ICAP_AUTOCOLORCONTENT 0x8093 -ICAP_AUTOCOLORTHRESHOLD 0x8094 -ICAP_IMAGEEDGEFILL 0x8095 -ICAP_IMAGEEDGELEFT 0x8096 -ICAP_IMAGEEDGERIGHT 0x8097 -ICAP_IMAGEEDGETOP 0x8098 -ICAP_IMAGEEDGEBOTTOM 0x8099 -CAP_BLANKPAGE 0x809A -CAP_BLANKPAGEMODE 0x809B -CAP_BLANKPAGECOMPSIZEBW 0x809C -CAP_BLANKPAGECOMPSIZEGRAY 0x809D -CAP_BLANKPAGECOMPSIZERGB 0x809E -CAP_PROFILES 0x809F -ICAP_ANSELBRIGHTNESS 0x80A0 -ICAP_ANSELCONTRAST 0x80A1 -ICAP_ANSELHIGHLIGHT 0x80A2 -ICAP_ANSELMIDTONE 0x80A3 -ICAP_ANSELREMOVEREDEYE 0x80A4 -ICAP_ANSELRESTORECOLOR 0x80A5 -ICAP_ANSELSATURATECOLORS 0x80A6 -ICAP_ANSELSHADOW 0x80A7 -ICAP_ANSELSHARPENIMAGE 0x80A8 -ICAP_ANSELSHASTA 0x80A9 -ICAP_PADDING 0x80AA -ICAP_NEWWINDOWSIZE 0x80AB -ICAP_DOCUMENTTYPE 0x80AC -CAP_WINDOW 0x80AD -ICAP_BACKGROUNDADJUSTMODE 0x80AE -ICAP_BACKGROUNDADJUSTAPPLYTO 0x80AF -ICAP_BACKGROUNDADJUSTAGGRESSIVENESS 0x80B0 -ICAP_COLORBALANCEBLUE 0x80B1 -ICAP_COLORBALANCEGREEN 0x80B2 -ICAP_COLORBALANCERED 0x80B3 -CAP_WINDOWCAMERA 0x80B4 -ICAP_SKEWANGLE 0x80B5 -ICAP_MEDIATYPE 0x80B6 -CAP_SIDESDIFFERENT 0x80B7 -ICAP_ECDO 0x80B8 -ICAP_IMAGEEDGEFILLALLSIDES 0x80B9 -CAP_MULTIFEEDRESPONSE 0x80BA -ICAP_FRAMESANGLE 0x80BB -CAP_PRINTERDATE 0x80BC -CAP_PRINTERTIME 0x80BD -CAP_PRINTERFONTFORMAT 0x80BE -CAP_PATCHHEAD1 0x80BF -CAP_PATCHHEAD2 0x80C0 -CAP_PATCHHEAD3 0x80C1 -CAP_PATCHHEAD4 0x80C2 -ICAP_ECDOTREATASCOLOR 0x80C3 -CAP_BLANKPAGECONTENT 0x80C4 -CAP_IMAGEMERGE 0x80C5 -ICAP_STREAKREMOVALENABLED 0x80C6 -ICAP_STREAKREMOVALAGGRESSIVENESS 0x80C7 -// Reserved 0x80C8 - 0x80FF -CAP_IMAGESDIFFERENT 0x8100 -ICAP_PHYSICALHEIGHTADJUST 0x8101 -ICAP_COLORSHARPEN 0x8102 -ICAP_ECDOAGGRESSIVENESS 0x8103 -ICAP_HOLEFILLENABLED 0x8104 -CAP_ULTRASONICSENSORLEFTCENTER 0x8105 -CAP_ULTRASONICSENSORRIGHTCENTER 0x8106 -CAP_ULTRASONICSENSORZONEHEIGHT 0x8107 -ICAP_COLORBRIGHTNESSMODE 0x8108 -ICAP_COLORBALANCEMODE 0x8109 -ICAP_COLORBALANCEAUTOMATICAGGRESSIVENESS 0x810A -CAP_SIMULATING 0x810B -CAP_POWEROFFTIMEOUT 0x810C -CAP_INTELLIGENTDOCUMENTPROTECTION 0x810D -ICAP_FOREGROUNDBOLDNESSAGGRESSIVENESS 0x810E -ICAP_FOREGROUNDBOLDNESSMODE 0x810F -CAP_DUALSTACKINGENABLED 0x8110 -CAP_DUALSTACKINGLENGTHMODE 0x8111 -CAP_DUALSTACKINGLENGTH1 0x8112 -CAP_DUALSTACKINGLENGTH2 0x8113 -CAP_DUALSTACKINGMULTIFEED 0x8114 -CAP_DUALSTACKINGPATCHTRANSFER 0x8115 -CAP_DUALSTACKINGPATCHTYPE1 0x8116 -CAP_DUALSTACKINGPATCHTYPE2 0x8117 -CAP_DUALSTACKINGPATCHTYPE3 0x8118 -CAP_DUALSTACKINGPATCHTYPE4 0x8119 -CAP_DUALSTACKINGPATCHTYPE6 0x811A -CAP_DUALSTACKINGSTACK 0x811B -*/ - -/* -DAT_STATUSRAW 0x8001 -DAT_PCARD 0x8002 -DAT_COLORTABLEMAP 0x8003 -DAT_DEVICEINFO 0x8005 -DAT_AUTOCOLORLEARN 0x8006 -DAT_PROFILES 0x8007 -DAT_WINDOW 0x8008 -DAT_CUSTOMDSDATAGROUP 0x8009 -DAT_ECDO 0x800A -DAT_QUERYSUPPORT 0x800B -DAT_LOG 0x800C -DAT_UTC 0x800D -DAT_OCPBUTTONS 0x800E -*/ - -/* -OBS_STOPFEEDER 0x8001 -MSG_SETUPDS 0x8002 -MSG_DISABLEUI 0x8003 -MSG_ENABLEUI 0x8004 -MSG_GETSPECIAL 0x8005 -MSG_ENABLESCANNER 0x8006 -MSG_SAVEPROFILE 0x8008 // Deprecated TWAIN 10.x+ -MSG_DELETEPROFILE 0x8009 // Deprecated TWAIN 10.x+ -// Reserved 0x8007, 0x800A - 0x8010, 0x8013 - 0x8014 -MSG_ADDWINDOW 0x8011 -MSG_DELETEWINDOW 0x8012 -MSG_PROFILECREATE 0x8015 -MSG_PROFILEDELETE 0x8016 -MSG_PROFILESAVE 0x8017 -MSG_PROFILERENAME 0x8018 -MSG_PROFILERESTORE 0x8019 -MSG_PROFILEEXPORT 0x801A -MSG_PROFILEIMPORT 0x801B -MSG_PROFILESET 0x801C - - -*/ - -/* -TWRC_BUSY 0x8001 -TWRC_PCARD_CHECKSTATUS 0x8002 -TWRC_PCARD_FATAL 0x8003 -TWRC_PCARD_RETRYIMAGE 0x8004 -TWRC_PCARD_NOCARD 0x8005 -TWRC_FILTER_CONTINUE 0x8010 -*/ - -/* -This is a sample of the kind of data that comes back from - DG_IMAGE / DAT_EXTIMAGEINFO / MSG_GET -when asking for TWEI_HDR_XML... - -Results will vary depending on the kind of scanning session, -this example is from MSG_ENABLEDS... - - - - success - - - front - front - window_002 - 000001A.1 - false - 1 - 20 - none - success - C:\ProgramData\kds_kodak\kds_i2900\twain\log.20120622172913994\hippo\tmp\hip631C.tmp - bw - 324 - 1404 - 10296 - 13170 - 471925 - 200_dpi - 2197 - false - normal - -1 - - 324 - 1404 - 10296 - 13170 - 2197 - 0_degrees - - - - - - - 1 - 1 - 1 - - - -*/ - -#endif // KDSCUST_H diff --git a/twain-doc/Kodak/links.htm b/twain-doc/Kodak/links.htm deleted file mode 100644 index 8a2ab43..0000000 --- a/twain-doc/Kodak/links.htm +++ /dev/null @@ -1,719 +0,0 @@ - - - - - - - - -This file contains useful support links - - - - - - - - - - -
- -

This file contains useful support links.

- -

 

- -

 

- -

Kodak Document Imaging:  http://www.kodak.com/go/scanners

- -

This is the scanner product page for Document Imaging.  To -get to the driver downloads and user publications, select your scanner. If your -scanner is not listed, click "Support Center" to find it.

- -

 

- -

 

- -

TWAIN Working Group:  http://www.twain.org/

- -

This is the main page for the TWAIN Working Group.  -Go here to get the latest Specifications and White Papers.  TWAIN also -puts out a newsletter detailing the latest information about the standard, and -provides a mailing list to monitor activity and to facilitate community -assistance on TWAIN issues.

- -

 

- -

You can also go here to access the TWAIN Forum, an online -discussion platform where you can exchange ideas with the TWAIN community.

- -

 

- -
- - - - diff --git a/twain-doc/Kodak/readme.htm b/twain-doc/Kodak/readme.htm deleted file mode 100644 index a736ce5..0000000 --- a/twain-doc/Kodak/readme.htm +++ /dev/null @@ -1,241 +0,0 @@ - - - - - -The contents of this directory provide information about the custom -features of the Kodak TWAIN driver - - - - - - - -
- -

KODAK Directory

- -

Readme File

- -

02-August-2006

- -

 

- -

 

- -

The contents of this directory provide information about -the custom features of the Kodak TWAIN driver.

- -

 

- -

GettingStarted.htm

- -

Some hints for new application writers.  The -information here technically belongs in the FAQ, but were pulling it out to -help jumpstart the development process for someone who is new to the Kodak -Document Scanners, TWAIN or both.

- -

 

- -

links.htm

- -

A list of links pointing to Kodak and TWAIN driver -support resources on the net.

- -

 

- -

faq.htm

- -

A list of hints, help and Frequently Asked Questions -concerning the Kodak TWAIN driver; integrators are strongly encouraged to look -through this file when looking for information about how the driver works, how -to integrate it, and some of the configuration tweaks and tricks that can be -applied to help it work better in specific situations.

- -

 

- -

kdscust.h

- -

This is the C/C++ header file containing (and describing) -all the custom TWAIN capabilities and operations supported by the driver. For -more detail see TWAIN_Features.htm.

- -

 

- -

debugging.htm

- -

This describes the logging system for the Kodak TWAIN -driver, though it also discusses a couple other diagnostic tools.  This is -probably the most important document to read if you are attempting to diagnose -a problem using the driver.  Note that it can be used to analyze the -behavior of the application and the scanner too.

- -

 

- -

simulator.htm

- -

The Kodak TWAIN driver supports a simulation mode that -allows integrators to test scanner models without a physical scanner.  -This document provides information on how to use the simulator.

- -

 

- -

TWAIN_DualStream.htm

- -

This document is a bit of a mix between the current Kodak -DualStream functionality and a proposed Single Document Multiple Images -proposal for the TWAIN Working Group.

- -

 

- -

TWAIN_ExtImageInfo.htm

- -

Applications maximize their flexibility when they collect -the meta-data associated with each image captured by the scanner.  For simple -applications DAT_IMAGEINFO is often enough information.  More complex -applications will want to use DAT_EXTIMAGEINFO.  This document goes into -some detail about how best to use the call, and what information it offers per -image.

- -

 

- -

TWAIN_FileSystem.htm

- -

Theres a bit of source code in here to help uses who -need to negotiate the rear cameras separately from the front cameras (this most -often occurs when trying to set up simultaneous bitonal/color or -bitonal/grayscale scanning using the custom CAP_CAMERAENABLE capability).

- -

 

- -

TWAIN_ProgrammaticControl.htm

- -

This document describes how all TWAIN and custom -capabilities work for each scanner.

- -

 

- -

TWAIN_ProgrammaticPrinting.htm

- -

This document describes how to programmatically drive the -scanner printing functionality through the TWAIN interface, (as opposed to -doing it through the driver GUI).

- -

 

- -

TWAIN_ScannerIdentification.htm

- -

In an ideal world an application should never have to -know the exact model number (save maybe to show the value to a user).  -This is our concession to reality.

- -

 

- -

TWAIN_Internationalization.htm

- -

This section details the various ways that an application -or user can select the language used by the driver.

- -

 

- -
- - - - diff --git a/twain-doc/Kodak/simulator.htm b/twain-doc/Kodak/simulator.htm deleted file mode 100644 index b477343..0000000 --- a/twain-doc/Kodak/simulator.htm +++ /dev/null @@ -1,1808 +0,0 @@ - - - - - - - - -Kodak KDS TWAIN Driver - - - - - - - - - - - -
- -

Kodak KDS TWAIN Driver

- -

Simulator for Virtual Integration

- -

21-June-2012

- -

 

- -

 

- -

Contents

- -

1.     Overview...................................................................................................................... -3

- -

2.     Glossary -of Terms......................................................................................................... -4

- -

3.     Simulate -Setting............................................................................................................. -5

- -

3.1.      Version 2/3/4 TWAIN Drivers.................................................................................. -6

- -

3.2.      Version 5+ TWAIN Drivers...................................................................................... -7

- -

3.2.      Version 9.x+ -TWAIN Drivers................................................................................... -8

- -

4.     RAMSCAN.TXT -File................................................................................................... -9

- -

4.1.      Command -Format..................................................................................................... -10

- -

4.2.      @check.................................................................................................................... -11

- -

4.3.      @delay................................................................................................................... -13

- -

4.4.      @image.................................................................................................................. -14

- -

4.5.      @init....................................................................................................................... -16

- -

4.6.      @jam...................................................................................................................... -17

- -

4.7.      @multifeed.............................................................................................................. -18

- -

4.8.      @nodata................................................................................................................. -19

- -

4.9.      @patch................................................................................................................... -20

- -

4.9.1.       @patch -#............................................................................................................ -21

- -

4.9.2.       @patch toggle..................................................................................................... -22

- -

4.10.        @repeat label count............................................................................................ -23

- -

4.11.        @restart.............................................................................................................. -24

- -

4.12.        @stop................................................................................................................. -25

- -

 

- -

 

- -

 

- -

1.   Overview

- -

The session simulator mimics events that occur in a real -session with a Kodak Document Scanner.  It allows the logging system to -record the exact commands that would be sent to a physical scanner, and as a -result of this allows an application to get a good feeling for how a physical -scanner behaves; especially during the negotiation phase prior to scanning.

- -

 

- -

The simulator is appropriate as a tool to exercise -developing applications without a physical scanner, especially if the -application writer is interested in testing against several models.  Using -the simulator frees the programmer from the bulk of a physical scanner in the -early phases of development.  We always recommend full testing with a -physical scanner, but believe that the integration time will be shorter and the -process more smooth when the simulator is used.

- -

 

- -

The simulator also serves as a diagnostic tool.  It can -be used to precisely recreate specific conditions (like errors) that may be -hard to duplicate with a physical scanner.  When combined with the -debugging features of the driver it becomes possible to easily analyze most -situations.

- -

 

- -

 

- -

2.   Glossary of Terms

- -

Here are some terms used in the document.

- -

 

- -

            -A2O2 -              -- Family name for the i1400 scanners 

- -

            -Gemini              -- Family name for the 500/900/923/990/55xx/75xx/95xx scanners

- -

            -Viper                -- Family name for the 35xx/4500 scanners

- -

            -Phoenix             -- Family name for the i6xx scanners

- -

            -Inferno              -- Family name for the i7xx scanners

- -

            -Prism                -- Family name for the i8xx scanners

- -

            -Alien                - - Family name for the i2xx scanners

- -

            -Mustang            - -Family name for the i30/i40/i50/i60 scanners

- -

            -Fosters              -- Family name for the i1100 scanners  

- -

            -Piranha              -- Family name for the i1200/i1300 scanners 

- -

            -Wildfire             -- Family name for the i1800 scanners 

- -

            -Panther             -- Family name for the i4000 scanners

- -

            -Piranha2           - Family -name for the i2000 scanners  

- -

            -Blaze                -- Family name for the i5000 scanners 

- -

            -Rufous              -- Family name for the i900 scanners 

- -

            -Falcon               -- Family name for the i2900 (FalconA4) and i3000 (FalconA3) scanners 

- -

 

- -

3.   Simulate Setting

- -

 

- -

3.1.                  -Version 2/3/4 -TWAIN Drivers

- -

In the ramscan.txt file, set simulate -to the desired value (ex: simulate i280).

- -

The simulator is activated by -going into the ramscan.txt file, and changing the simulate value to the full -model name of the desired scanner.  The default value is 0.  Valid -values are found in the ramscan.txt file.  Each driver is only intended to -support certain kinds of scanners.  The name of the TWAIN directory is a -good clue about what is supported.  For instance, if the directory path to -the TWAIN driver is %windir%\twain_32\kodak\kds_i800, then the supported scanners -are: i810, i820, i830 and i840.

- -

 

- -

 

- -

3.2.                  -Version 5+ TWAIN -Drivers

- -

In the const.ini file, under [dsIdentity], set simulate to the desired value (ex: -simulate i660).

- -

The simulator is activated by -going into the const.ini file, and changing the simulate value to the model -name of the desired scanner.  The default value is 0.  Valid values -are found in the ramscan.txt file.  Each driver is only capable of -supporting certain kinds of scanners.  The name of the TWAIN directory is -a good clue about what is supported.  For instance, if the directory path -to the TWAIN driver is %windir%\twain_32\kodak\kds_i800, then the support -scanners are: i810, i820, i830 and i840.  The ramscan.txt file is the -final authority on what is supported in simulation mode.

- -

 

- -

 

- -

3.3.                  -Version 9.x+ -TWAIN Drivers

- -

In the const.ini file, under [Simulation], -set simulation to true to enable simulation. Set simmodel to the desired ADF scanner -model (ex: i2900).Set simflatbed -to the desired flatbed accessory (ex: i2000legal).

- -

 

- -

For example to simulate a FalconA3 -scanner with attached KODAK Legal Size Flatbed Accessory:

- -

[Simulation]

- -

simulation=true

- -

simmodel=i3000

- -

simflatbed=i2000legal

- -

 

- -

 

- -

4.   RAMSCAN.TXT File

- -

 

- -

This file owns the configurations that describe the -supported scanners.  For instance, if a user wants to simulate an i260 -without a printer, they can go into this file, find the setting for the printer -accessory and turn it off.  The simulator will then run like an i260 that -has no printer.  By default the virtual scanners are simulated with all -available accessories.

- -

 

- -

The ramscan.txt is also able to simulate a wide range of -scanning behavior, which is accomplished via the @-commands at the end of the -file.  For example:

- -

 

- -

@init

- -

@image

- -

@image

- -

@stop

- -

 

- -

This sequence initializes the simulator and allows two -images to be captured before ending the session.  The word image isnt -ideal, it actually corresponds to a side of a sheet of paper, so if this -particular sequence was used with dualstream settings -(simultaneous output of bitonal/color on the front -and rear) then wed get four images in total from the two @image commands.

- -

 

- -

 

- -

4.1.                  -Command Format

- -

The format of any given command is -as follows:

- -

 

- -

      @command.platform arguments

- -

 

- -

Where

- -

      @command -is the command to be issued.

- -

      .platform -is an optional specifier for one of the following:

- -

                  -Gemini, Viper, Prism, Alien

- -

      arguments -are any data for the command

- -

 

- -

For example:

- -

 

- -

      -@image

- -

      -@jam.Prism

- -

@stop

- -

 

- -

The full list of available -commands follow:

- -

 

- -

 

- -

4.2.                  -@check

- -

This command generates an error -during a session.  Typically the value is dotted with the targeted command.  -If a dot isnt specified, then the check is applied to any command.  -@check is platform dependent, meaning that the error codes have meaning for -particular platforms.  For instance, this is the list of jam conditions -for all the scanner platforms.

- -

 

- -

@check.ReadHeader.Gemini -F0 00 04 00 00 00 00 0A 00 00 00 -09 82 00

- -

@check.ReadHeader.Viper -F0 00 04 00 00 00 00 0A 00 00 00 -09 3B 05

- -

@check.ReadHeader.Prism -F0 00 04 00 00 00 00 0A 00 00 00 -09 3B 05

- -

@check.ReadHeader.Alien -F0 00 04 00 00 00 00 0A 00 00 00 -09 3B 05

- -

 

- -

The underlined values are the only -ones that have any meaning for the simulator.  All numbers are -hexadecimal.  If necessary, an SRB status can be added as an extra number -at the end of the list to simulate errors from the SCSI/SBP2 Class -Drivers.  A list of these codes are wire/protocol specific, and can be -found in ASPIs wnaspi.h file or SCSISCANs scsiscan.h file.  The check codes come from the SCSI -Interface Spec for each of the supported scanner models, usually they will be obtained -from a KDS.LOG.

- -

 

- -

@check has become increasingly -sophisticated as time has gone on.  Most users will not need this -additional behavior, but here it is anyway.

- -

 

- -

@check without a specifier is applied to any attempt to get an image (the -@image command) and is position sensitive in the simulation.  @check with -a specifier is used to target a specific scanner -command and is NOT position specific within the simulation.  Well use -examples to illustrate this.

- -

 

- -

; -Jam with one image in the scanner buffer

- -

@init

- -

@image

- -

@jam

- -

@image

- -

@stop

- -

 

- -

; -Jam with one image in the scanner buffer

- -

@init

- -

@image

- -

@check -F0 00 04 00 00 00 00 0A 00 00 00 -09 3B 05

- -

@image

- -

@stop

- -

 

- -

; -Jam with two images in the scanner buffer

- -

@init

- -

@image

- -

@check.ReadHeader F0 00 04 00 00 00 00 0A 00 00 -00 09 3B 05

- -

@image

- -

@stop

- -

 

- -

Note that the third example will -throw its jam message before reading any images from the scanner.  If we -want to target a specific occurrence of a command, then we have to get somewhat -fancy.  The following example will give us the result we want.  Weve -moved the check conditions to the top, since it doesnt matter where they are -located.

- -

 

- -

; -Jam with two images in the scanner buffer

- -

@init

- -

@check.ReadHeader 00 00 00 00 00 -00 00 00 -00 00 00 -00 00 00

- -

@check.ReadHeader F0 00 04 -00 00 00 00 0A 00 00 00 -09 3B 05

- -

@image

- -

@image

- -

@stop

- -

     

- -

The simulator ignores any check -condition that is all zeros.  Here is a list of the current supported -commands that can be checked.

- -

 

- -

@check                                  -- @image command

- -

@check.Enable                     -- Enable scanner

- -

@check.GetWindow           -- SCSI Get Window

- -

@check.SetWindow            -- SCSI Define Window

- -

@check.ReadHeader           -- Gemini Read Header

- -

@check.ReadImage             -- Read Image

- -

@check.ReadLength           -- Viper Read Length

- -

@check.ReadBitdepth        -- Viper Read Bitdepth

- -

@check.ReadSide                -- Viper Read Side (not currently used)

- -

@check.XX                           -- XX == scanner unique command, like SC for Scan Configuration

- -

 

- -

Not all commands are supported, -but many of them are.  Note that the text is case sensitive, and the -simulator isnt very tolerate of whitespace, so only use single spaces to -separate items.

- -

 

- -

 

- -

4.3.                  -@delay

- -

Pauses the driver for the -specified number of milliseconds; for example:

- -

 

- -

              -@delay 1000

- -

 

- -

 

- -

4.4.                  -@image

- -

Generates or specifies an image to -the simulator.  This command comes in several forms:

- -

 

- -

       @image

- -

@image 1280 1692  1 0 250 -c:\twain\bitonal.tif

- -

@image  640  848 24 -6   0 c:\twain\color.jpg

- -

@image 1280 1692 1 0 250 -c:\twain\bitonal.tif 640 848 24 6 0 c:\twain\color.jpg

- -

 

- -

The first form is the easiest to -use.  The simulator will generate an image meeting the following -characteristics of the negotiated session:  cropping, compression, -polarity (if appropriate) and pixel type.  The image is largely blank with -a horizontal line at the top and the bottom, and with a counting image number -in each of the four corners.  The line is always black.  The first -three digits of the number (reading left to right) should always be -red/green/blue if the image is in color.

- -

 

- -

The second and third forms show -how to use an image file from disk.  The arguments are, in order:

- -

 

- -

                -width                      -- in pixels

- -

                -height                     -- in pixels

- -

                -bitdepth                 -- 1=bitonal, 8=grayscale, 24=color

- -

                -compression         - 0=none, 2=Group -31D, 4=Group 32D, 5=Group 4, 6=JPEG

- -

                -offset                      -- byte offset to the raw image data

- -

                -filename                 -- the full path to the image

- -

 

- -

      -The offset is always 0 for JPEG/JFIF images.  It corresponds to the StripByteOffset for TIFF images, and skips over the file -header, bitmap header, and color table (if any) for bitmap images.  Any -image format is permissible, provided that the data can be handled by the -simulator as a single block for data.  Stripped TIFF images are not -supported.  If for any reason the @image requested doesnt match the image -values negotiated with the driver (for example, if the file is uncompressed, -but ICAP_COMPRESSION is TWCP_JPEG), then the simulator falls back to the first -form, discarding the file info.  The version 4+ drivers report the reason -for the failure in the KDS.LOG file (though it may be necessary to set Debug=1 -to get the information).

- -

 

- -

      -The third form is a combination of bitonal and color, -and can be used to provide two images for dualstream -scanning for i600/i800/i1800.  The order of the images in the @image does -not matter; the simulator will grab the appropriate one needed to match the -requirements of the CAP_CAMERAORDER capability.

- -

 

- -

Note that dualstream -for the 3590/4500/i30/i40/i200 scanners always comes from a single (or -grayscale) color image generated by the scanner.

- -

 

- -

One final note, for most of the -scanners it is possible to generate the input images used by the simulator in a -variety of ways: using image editing packages or scanning them in from other -scanner models.  For instance, it is possible to scan JPEG images on a -Kodak 4500 Scanner and use them in simulations for a Kodak i840 Scanner.  -This is not true for the Kodak i200 Scanners, these devices output image data -in YCC411 format, the simulator must receive the data in this same format to -perform properly.  Likewise the Kodak i600/i1800 Scanners output -uncompressed color in YCC444 format.  In both cases the best way to -generate the needed images is to capture data from an existing scanner.  -The Scanner Validation Tool (SVT) has a raw dump feature on the Dump tab (which -only appears if you have a Level-1 or higher License); it is also possible to -get this tab through the CONST.INI file, please contact Kodak for information -about how to do this.  This dump is capable of generating the needed -images along with a fragment of a ramscan.txt file to help set up the -simulation.

- -

 

- -

 

- -

4.5.                  -@init

- -

This has to be the first command -in any sequence of @-commands in the ramscan.txt file.  The simulator uses -it as the reset point so that it is possible to run multiple scanning sessions -without exiting from the application.

- -

 

- -

 

- -

4.6.                  -@jam

- -

Indicates that a paper jam check -condition is to be thrown before the next command is read, this command is -position sensitive, so the following two lists will throw the check condition -at different points in the simulation.

- -

 

- -

; -Jam with two images still in the scanner buffer.

- -

@init

- -

@jam

- -

@image

- -

@image

- -

@stop

- -

                            -

- -

; -Jam with no images in the scanner buffer.

- -

@init

- -

@image

- -

@image

- -

@jam

- -

@stop

- -

 

- -

 

- -

4.7.                  -@multifeed

- -

Indicates that a multifeed check condition is to be thrown before the next command -is read, this command is position sensitive, so the following two lists will -throw the check condition at different points in the simulation.  Note -that the inclusion of @multifeed will result in the -generation of the check condition no matter what the current settings are on -the TWAIN Multifeed tab.

- -

 

- -

; Multifeed with two images still in the scanner buffer.

- -

@init

- -

@multifeed

- -

@image

- -

@image

- -

@stop

- -

                            -

- -

; Multifeed with no images in the scanner buffer.

- -

@init

- -

@jam

- -

@image

- -

@image

- -

@multifeed

- -

@stop

- -

 

- -

 

- -

4.8.                  -@nodata

- -

The 5000/7000/9000 scanners do not -support a clear buffer command, so the only way to guarantee that the buffers -are empty prior to scanning is to read out any images from the buffers and -discard them.  The i200 requires a test to make sure the camera is -homed.  And the i600/i1800 needs a way to wait until the elevator is -homed.  We use @nodata.Gemini or @nodata.Prism to consume these read image instruction so -that the @image commands are not accidentally included.

- -

 

- -

 

- -

4.9.                  -@patch

- -

The patch page command causes the -simulator to behave as if a patch has been seen by the scanner.

- -

 

- -

 

- -

4.9.1.                     -@patch #

- -

For the 5000/7000/900/i800 this -command causes the scanner to report the presence of a patch page (1 -6).  Since the image address simulation isnt very sophisticated, this -part of the simulation is most useful when trying to generate feature patches -that the application has to handle.

- -

 

- -

 

- -

4.9.2.                     -@patch toggle

- -

For the -3590/4500/i200/i600/i800/i1800 this command tells the simulator to toggle back -and forth between bitonal and grayscale/color output.

- -

 

- -

@init

- -

@image

- -

@patch toggle

- -

@image

- -

@stop

- -

 

- -

 

- -

4.10.            -@repeat label -count

- -

This command is only available for -Version 4+ of the TWAIN driver.  There are times when it is desirable to -repeat a sequence of commands many times.  The typical case is scanning -several hundred or several thousand images.  This command allows the -construction of a repeat loop.

- -

 

- -

@init

- -

@:label

- -

@image

- -

@repeat label 5

- -

@stop

- -

     

- -

This loop will generate five -@image commands to the simulator.  Note the use of the colon ( : ) before -label to mark the topmost point in the loop.  Repeat loops can be -nested.

- -

 

- -

 

- -

4.11.            -@restart

- -

This is the command that preceded -@repeat.  All it does is move the simulation reader back to the top of the -file.  Version 2/3 drivers can use it, newer ones should not.

- -

 

- -

 

- -

4.12.            -@stop

- -

This command indicates the End-Of-Job -condition (for 5000/7000/9000/i30/i40/i200/i600/i800/i1800) and the transport -timeout / disabled state for 3000/4000.  It must be at the end of any -sequence of @image commands.

- -

 

- -
- - - - diff --git a/twain-doc/TWAIN 2.3 Spec.pdf b/twain-doc/TWAIN 2.3 Spec.pdf deleted file mode 100644 index ef940cb..0000000 Binary files a/twain-doc/TWAIN 2.3 Spec.pdf and /dev/null differ diff --git a/twain-doc/TWAIN-2.4-Features.pdf b/twain-doc/TWAIN-2.4-Features.pdf deleted file mode 100644 index 650168d..0000000 Binary files a/twain-doc/TWAIN-2.4-Features.pdf and /dev/null differ diff --git a/twain-doc/TWAIN-2.4-Specification.pdf b/twain-doc/TWAIN-2.4-Specification.pdf deleted file mode 100644 index 1edd836..0000000 Binary files a/twain-doc/TWAIN-2.4-Specification.pdf and /dev/null differ diff --git a/twain-doc/TWAIN19.pdf b/twain-doc/TWAIN19.pdf deleted file mode 100644 index 3c288a8..0000000 Binary files a/twain-doc/TWAIN19.pdf and /dev/null differ diff --git a/twain-doc/TWAIN_2_1_Spec.pdf b/twain-doc/TWAIN_2_1_Spec.pdf deleted file mode 100644 index 90f6568..0000000 Binary files a/twain-doc/TWAIN_2_1_Spec.pdf and /dev/null differ diff --git a/twain-doc/TWAIN_Errata_for_Version_2.2.pdf b/twain-doc/TWAIN_Errata_for_Version_2.2.pdf deleted file mode 100644 index 7d9fb47..0000000 Binary files a/twain-doc/TWAIN_Errata_for_Version_2.2.pdf and /dev/null differ diff --git a/twain-doc/TWAIN_Errata_for_Version_2.4.pdf b/twain-doc/TWAIN_Errata_for_Version_2.4.pdf deleted file mode 100644 index c784b69..0000000 Binary files a/twain-doc/TWAIN_Errata_for_Version_2.4.pdf and /dev/null differ diff --git a/twain-doc/TWAIN_Errata_for_Version_2_1.pdf b/twain-doc/TWAIN_Errata_for_Version_2_1.pdf deleted file mode 100644 index 96bdbfb..0000000 Binary files a/twain-doc/TWAIN_Errata_for_Version_2_1.pdf and /dev/null differ diff --git a/twain-doc/twain 2.2 spec.pdf b/twain-doc/twain 2.2 spec.pdf deleted file mode 100644 index e72d2c2..0000000 Binary files a/twain-doc/twain 2.2 spec.pdf and /dev/null differ diff --git a/twain-doc/twain2.1.h b/twain-doc/twain2.1.h deleted file mode 100644 index 4ea94dc..0000000 --- a/twain-doc/twain2.1.h +++ /dev/null @@ -1,2193 +0,0 @@ -/* ======================================================================== *\ - - Copyright (C) 2007 TWAIN Working Group: Adobe Systems Incorporated, - AnyDoc Software Inc., Eastman Kodak Company, Fujitsu Computer Products - of America, JFL Peripheral Solutions Inc., Ricoh Corporation, and - Xerox Corporation. All rights reserved. - - Copyright (C) 1991, 1992 TWAIN Working Group: Aldus, Caere, Eastman-Kodak, - Hewlett-Packard and Logitech Corporations. All rights reserved. - - Copyright (C) 1997 TWAIN Working Group: Bell+Howell, Canon, DocuMagix, - Fujitsu, Genoa Technology, Hewlett-Packard, Kofax Imaging Products, and - Ricoh Corporation. All rights reserved. - - Copyright 1998 TWAIN Working Group: Adobe Systems Incorporated, - Canon Information Systems, Eastman Kodak Company, - Fujitsu Computer Products of America, Genoa Technology, - Hewlett-Packard Company, Intel Corporation, Kofax Image Products, - JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. - All rights reserved. - - Copyright 2000 TWAIN Working Group: Adobe Systems Incorporated, - Canon Information Systems, Digimarc Corporation, Eastman Kodak Company, - Fujitsu Computer Products of America, Hewlett-Packard Company, - JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. - All rights reserved. - - - TWAIN.h - This is the definitive include file for applications and - data sources written to the TWAIN specification. - It defines constants, data structures, messages etc. - for the public interface to TWAIN. - - Revision History: - version 1.0, March 6, 1992. TWAIN 1.0. - version 1.1, January 1993. Tech Notes 1.1 - version 1.5, June 1993. Specification Update 1.5 - Change DC to TW - Change filename from DC.H to TWAIN.H - version 1.5, July 1993. Remove spaces from country identifiers - - version 1.7, July 1997 Added Capabilities and data structure for - document imaging and digital cameras. - KHL. - version 1.7, July 1997 Inserted Borland compatibile structure packing - directives provided by Mentor. JMH - version 1.7, Aug 1997 Expanded file tabs to spaces. - NOTE: future authors should be sure to have - their editors set to automatically expand tabs - to spaces (original tab setting was 4 spaces). - version 1.7, Sept 1997 Added job control values - Added return codes - version 1.7, Sept 1997 changed definition of pRGBRESPONSE to - pTW_RGBRESPONSE - version 1.7 Aug 1998 Added missing TWEI_BARCODEROTATION values - TWBCOR_ types JMH - version 1.8 August 1998 Added new types and definitions required - for 1.8 Specification JMH - version 1.8 January 1999 Changed search mode from SRCH_ to TWBD_ as - in 1.8 Specification, added TWBT_MAXICODE JMH - version 1.8 January 1999 Removed undocumented duplicate AUTO JMH - version 1.8 March 1999 Removed undocumented 1.8 caps: - CAP_FILESYSTEM - CAP_PAPERBINDING - CAP_PASSTHRU - CAP_POWERDOWNTIME - ICAP_AUTODISCARDBLANKPAGES - * CAP_PAGEMULTIPLEACQUIRE - is CAP_REACQUIREALLOWED, - requires spec change. JMH - Added Mac structure packing modifications JMH - version 1.9 March 2000 Added new types and definations required - for 1.9 Specification MLM - version 1.9 March 2000 Added ICAP_JPEGQUALITY, TWJQ_ values, - updated TWON_PROTOCOLMINOR for Release v1.9 MN - version 1.91 August 2007 Added new types and definitions required - for 1.91 Specification MLM - version 2.0 Sept 2007 Added new types and definitions required - for 2.0 Specification FHH - version 2.0 Mar 2008 Depreciated ICAP_PIXELTYPEs TWPT_SRGB64, TWPT_BGR, - TWPT_CIELAB, TWPT_CIELUV, and TWPT_YCBCR JMW - version 2.0 Mar 2008 Added missing new 2.0 CAP_ definitions JMW - version 2.0 Dec 2008 Updated TW_INFO structure for 64bit JMW - version 2.1 Mar 2009 Added new types and definitions required - for 2.1 Specification JMW -\* ======================================================================== */ - -#ifndef TWAIN -#define TWAIN - -/**************************************************************************** - * TWAIN Version * - ****************************************************************************/ -#define TWON_PROTOCOLMINOR 1 /* Changed for Version 2.1 */ -#define TWON_PROTOCOLMAJOR 2 - -/**************************************************************************** - * Platform Dependent Definitions and Typedefs * - ****************************************************************************/ - -/* Microsoft C/C++ Compiler */ -#if defined(WIN32) || defined(WIN64) || defined (_WINDOWS) - #define TWH_CMP_MSC - #if defined(_WIN64) || defined(WIN64) - #define TWH_64BIT - #elif defined(WIN32) || defined(_WIN32) - #define TWH_32BIT - #endif - -/* Apple Compiler (which is GNU now) */ -#elif defined(__APPLE__) - #define TWH_CMP_XCODE - #define TWH_32BIT - -/* GNU C/C++ Compiler */ -#elif defined(__GNUC__) - #define TWH_CMP_GNU - #if defined(__alpha__)\ - ||defined(__ia64__)\ - ||defined(__ppc64__)\ - ||defined(__s390x__)\ - ||defined(__x86_64__) - #define TWH_64BIT - #else - #define TWH_32BIT - #endif - -/* Borland C/C++ Compiler */ -#elif defined(__BORLAND__) - #define TWH_CMP_BORLAND - #define TWH_32BIT -/* Unrecognized */ -#else - #error Unrecognized compiler -#endif - -/* Win32 and Win64 systems */ -#if defined(TWH_CMP_MSC) | defined(TWH_CMP_BORLAND) - typedef HANDLE TW_HANDLE; - typedef LPVOID TW_MEMREF; - typedef UINT_PTR TW_UINTPTR; - -/* MacOS/X... */ -#elif defined(TWH_CMP_XCODE) - #define PASCAL pascal - #define FAR - typedef Handle TW_HANDLE; - typedef char *TW_MEMREF; - - #ifdef TWH_32BIT - //32 bit GNU - typedef unsigned long TW_UINTPTR; - #else - //64 bit GNU - typedef unsigned long long TW_UINTPTR; - #endif - -/* Everything else... */ -#else - #define PASCAL - #define FAR - typedef void* TW_HANDLE; - typedef void* TW_MEMREF; - typedef unsigned char BYTE; - - #ifdef TWH_32BIT - //32 bit GNU - typedef unsigned long TW_UINTPTR; - #else - //64 bit GNU - typedef unsigned long long TW_UINTPTR; - #endif -#endif - - -/* Set the packing: this occurs before any structures are defined */ -#ifdef TWH_CMP_MSC - #pragma pack (push, before_twain) - #pragma pack (2) -#elif defined(TWH_CMP_GNU) - #pragma pack (push, before_twain) - #pragma pack (2) -#elif defined(TWH_CMP_BORLAND) - #pragma option -a2 -#elif defined(TWH_CMP_XCODE) - #if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k - #elif PRAGMA_STRUCT_PACKPUSH - #pragma pack (push, 2) - #elif PRAGMA_STRUCT_PACK - #pragma pack (2) - #endif -#endif - - -/**************************************************************************** - * Type Definitions * - ****************************************************************************/ - -/* String types. These include room for the strings and a NULL char, * - * or, on the Mac, a length byte followed by the string. * - * TW_STR255 must hold less than 256 chars so length fits in first byte. */ -typedef char TW_STR32[34], FAR *pTW_STR32; -typedef char TW_STR64[66], FAR *pTW_STR64; -typedef char TW_STR128[130], FAR *pTW_STR128; -typedef char TW_STR255[256], FAR *pTW_STR255; - -/* Numeric types. */ -typedef char TW_INT8, FAR *pTW_INT8; -typedef short TW_INT16, FAR *pTW_INT16; -typedef long TW_INT32, FAR *pTW_INT32; -typedef unsigned char TW_UINT8, FAR *pTW_UINT8; -typedef unsigned short TW_UINT16, FAR *pTW_UINT16; -typedef unsigned long TW_UINT32, FAR *pTW_UINT32; -typedef unsigned short TW_BOOL, FAR *pTW_BOOL; - - -/**************************************************************************** - * Structure Definitions * - ****************************************************************************/ - -/* Fixed point structure type. */ -typedef struct { - TW_INT16 Whole; /* maintains the sign */ - TW_UINT16 Frac; -} TW_FIX32, FAR *pTW_FIX32; - -/* No DAT. Defines a frame rectangle in ICAP_UNITS coordinates. */ -typedef struct { - TW_FIX32 Left; - TW_FIX32 Top; - TW_FIX32 Right; - TW_FIX32 Bottom; -} TW_FRAME, FAR * pTW_FRAME; - -/* No DAT needed. */ -typedef struct { - TW_FIX32 StartIn; - TW_FIX32 BreakIn; - TW_FIX32 EndIn; - TW_FIX32 StartOut; - TW_FIX32 BreakOut; - TW_FIX32 EndOut; - TW_FIX32 Gamma; - TW_FIX32 SampleCount; /* if =0 use the gamma */ -} TW_DECODEFUNCTION, FAR * pTW_DECODEFUNCTION; - -/* No DAT needed. */ -typedef struct { - TW_DECODEFUNCTION Decode[3]; - TW_FIX32 Mix[3][3]; -} TW_TRANSFORMSTAGE, FAR * pTW_TRANSFORMSTAGE; - -/* TWON_ARRAY. Container for array of values (a simplified TW_ENUMERATION) */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 NumItems; /* How many items in ItemList */ - TW_UINT8 ItemList[1]; /* Array of ItemType values starts here */ -} TW_ARRAY, FAR * pTW_ARRAY; - -/* DAT_AUDIOINFO, information about audio data */ -typedef struct { - TW_STR255 Name; /* name of audio data */ - TW_UINT32 Reserved; /* reserved space */ -} TW_AUDIOINFO, FAR * pTW_AUDIOINFO; - -/* TW_CALLBACK, used to register callbacks Added 2.0 */ -typedef struct { - TW_MEMREF CallBackProc; - TW_UINT32 RefCon; - TW_INT16 Message; -} TW_CALLBACK, FAR * pTW_CALLBACK; - -/* DAT_CAPABILITY. Used by application to get/set capability from/in a data source. */ -typedef struct { - TW_UINT16 Cap; /* id of capability to set or get, e.g. CAP_BRIGHTNESS */ - TW_UINT16 ConType; /* TWON_ONEVALUE, _RANGE, _ENUMERATION or _ARRAY */ - TW_HANDLE hContainer; /* Handle to container of type Dat */ -} TW_CAPABILITY, FAR * pTW_CAPABILITY; - -/* No DAT needed. */ -typedef struct { - TW_FIX32 X; - TW_FIX32 Y; - TW_FIX32 Z; -} TW_CIEPOINT, FAR * pTW_CIEPOINT; - -/* DAT_CIECOLOR. */ -typedef struct { - TW_UINT16 ColorSpace; - TW_INT16 LowEndian; - TW_INT16 DeviceDependent; - TW_INT32 VersionNumber; - TW_TRANSFORMSTAGE StageABC; - TW_TRANSFORMSTAGE StageLMN; - TW_CIEPOINT WhitePoint; - TW_CIEPOINT BlackPoint; - TW_CIEPOINT WhitePaper; - TW_CIEPOINT BlackInk; - TW_FIX32 Samples[1]; -} TW_CIECOLOR, FAR * pTW_CIECOLOR; - -typedef struct { - TW_UINT32 InfoLength; /* Length of Information in bytes. */ - TW_HANDLE hData; /* Place holder for data, DS Allocates */ -}TW_CUSTOMDSDATA, FAR *pTW_CUSTOMDSDATA; - -/* DAT_DEVICEEVENT, information about events */ -typedef struct { - TW_UINT32 Event; /* One of the TWDE_xxxx values. */ - TW_STR255 DeviceName; /* The name of the device that generated the event */ - TW_UINT32 BatteryMinutes; /* Battery Minutes Remaining */ - TW_INT16 BatteryPercentage; /* Battery Percentage Remaining */ - TW_INT32 PowerSupply; /* Power Supply */ - TW_FIX32 XResolution; /* Resolution */ - TW_FIX32 YResolution; /* Resolution */ - TW_UINT32 FlashUsed2; /* Flash Used2 */ - TW_UINT32 AutomaticCapture; /* Automatic Capture */ - TW_UINT32 TimeBeforeFirstCapture; /* Automatic Capture */ - TW_UINT32 TimeBetweenCaptures; /* Automatic Capture */ -} TW_DEVICEEVENT, FAR * pTW_DEVICEEVENT; - -/* No DAT needed. */ -typedef struct { - TW_UINT8 Index; /* Value used to index into the color table. */ - TW_UINT8 Channel1; /* First tri-stimulus value (e.g Red) */ - TW_UINT8 Channel2; /* Second tri-stimulus value (e.g Green) */ - TW_UINT8 Channel3; /* Third tri-stimulus value (e.g Blue) */ -} TW_ELEMENT8, FAR * pTW_ELEMENT8; - -/* TWON_ENUMERATION. Container for a collection of values. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 NumItems; /* How many items in ItemList */ - TW_UINT32 CurrentIndex; /* Current value is in ItemList[CurrentIndex] */ - TW_UINT32 DefaultIndex; /* Powerup value is in ItemList[DefaultIndex] */ - TW_UINT8 ItemList[1]; /* Array of ItemType values starts here */ -} TW_ENUMERATION, FAR * pTW_ENUMERATION; - -/* DAT_EVENT. For passing events down from the application to the DS. */ -typedef struct { - TW_MEMREF pEvent; /* Windows pMSG or Mac pEvent. */ - TW_UINT16 TWMessage; /* TW msg from data source, e.g. MSG_XFERREADY */ -} TW_EVENT, FAR * pTW_EVENT; - -typedef struct { - TW_UINT16 InfoID; - TW_UINT16 ItemType; - TW_UINT16 NumItems; - union { - TW_UINT16 CondCode; /* Depreciated, use ReturnCode. TWAIN 2.0 and older. */ - TW_UINT16 ReturnCode; /* TWAIN 2.1 and newer */ - }; - TW_UINTPTR Item; -}TW_INFO, FAR* pTW_INFO; - -typedef struct { - TW_UINT32 NumInfos; - TW_INFO Info[1]; -}TW_EXTIMAGEINFO, FAR* pTW_EXTIMAGEINFO; - -/* DAT_FILESYSTEM, information about TWAIN file system */ -typedef struct { - /* DG_CONTROL / DAT_FILESYSTEM / MSG_xxxx fields */ - TW_STR255 InputName; /* The name of the input or source file */ - TW_STR255 OutputName; /* The result of an operation or the name of a destination file */ - TW_MEMREF Context; /* Source specific data used to remember state information */ - /* DG_CONTROL / DAT_FILESYSTEM / MSG_DELETE field */ - int Recursive; /* recursively delete all sub-directories */ - /* DG_CONTROL / DAT_FILESYSTEM / MSG_GETINFO fields */ - TW_INT32 FileType; /* One of the TWFY_xxxx values */ - TW_UINT32 Size; /* Size of current FileType */ - TW_STR32 CreateTimeDate; /* creation date of the file */ - TW_STR32 ModifiedTimeDate; /* last date the file was modified */ - TW_UINT32 FreeSpace; /* bytes of free space on the current device */ - TW_INT32 NewImageSize; /* estimate of the amount of space a new image would take up */ - TW_UINT32 NumberOfFiles; /* number of files, depends on FileType */ - TW_UINT32 NumberOfSnippets; /* number of audio snippets */ - TW_UINT32 DeviceGroupMask; /* used to group cameras (ex: front/rear bitonal, front/rear grayscale...) */ - char Reserved[508]; /**/ -} TW_FILESYSTEM, FAR * pTW_FILESYSTEM; - -/* DAT_GRAYRESPONSE */ -typedef struct { - TW_ELEMENT8 Response[1]; -} TW_GRAYRESPONSE, FAR * pTW_GRAYRESPONSE; - -/* No DAT needed. Describes version of software currently running. */ -typedef struct { - TW_UINT16 MajorNum; /* Major revision number of the software. */ - TW_UINT16 MinorNum; /* Incremental revision number of the software. */ - TW_UINT16 Language; /* e.g. TWLG_SWISSFRENCH */ - TW_UINT16 Country; /* e.g. TWCY_SWITZERLAND */ - TW_STR32 Info; /* e.g. "1.0b3 Beta release" */ -} TW_VERSION, FAR * pTW_VERSION; - -/* DAT_IDENTITY. Identifies the program/library/code resource. */ -typedef struct { - TW_UINT32 Id; /* Unique number. In Windows, application hWnd */ - TW_VERSION Version; /* Identifies the piece of code */ - TW_UINT16 ProtocolMajor; /* Application and DS must set to TWON_PROTOCOLMAJOR */ - TW_UINT16 ProtocolMinor; /* Application and DS must set to TWON_PROTOCOLMINOR */ - TW_UINT32 SupportedGroups; /* Bit field OR combination of DG_ constants */ - TW_STR32 Manufacturer; /* Manufacturer name, e.g. "Hewlett-Packard" */ - TW_STR32 ProductFamily; /* Product family name, e.g. "ScanJet" */ - TW_STR32 ProductName; /* Product name, e.g. "ScanJet Plus" */ -} TW_IDENTITY, FAR * pTW_IDENTITY; - -/* DAT_IMAGEINFO. Application gets detailed image info from DS with this. */ -typedef struct { - TW_FIX32 XResolution; /* Resolution in the horizontal */ - TW_FIX32 YResolution; /* Resolution in the vertical */ - TW_INT32 ImageWidth; /* Columns in the image, -1 if unknown by DS*/ - TW_INT32 ImageLength; /* Rows in the image, -1 if unknown by DS */ - TW_INT16 SamplesPerPixel; /* Number of samples per pixel, 3 for RGB */ - TW_INT16 BitsPerSample[8]; /* Number of bits for each sample */ - TW_INT16 BitsPerPixel; /* Number of bits for each padded pixel */ - TW_BOOL Planar; /* True if Planar, False if chunky */ - TW_INT16 PixelType; /* How to interp data; photo interp (TWPT_) */ - TW_UINT16 Compression; /* How the data is compressed (TWCP_xxxx) */ -} TW_IMAGEINFO, FAR * pTW_IMAGEINFO; - -/* DAT_IMAGELAYOUT. Provides image layout information in current units. */ -typedef struct { - TW_FRAME Frame; /* Frame coords within larger document */ - TW_UINT32 DocumentNumber; - TW_UINT32 PageNumber; /* Reset when you go to next document */ - TW_UINT32 FrameNumber; /* Reset when you go to next page */ -} TW_IMAGELAYOUT, FAR * pTW_IMAGELAYOUT; - -/* No DAT needed. Used to manage memory buffers. */ -typedef struct { - TW_UINT32 Flags; /* Any combination of the TWMF_ constants. */ - TW_UINT32 Length; /* Number of bytes stored in buffer TheMem. */ - TW_MEMREF TheMem; /* Pointer or handle to the allocated memory buffer. */ -} TW_MEMORY, FAR * pTW_MEMORY; - -/* DAT_IMAGEMEMXFER. Used to pass image data (e.g. in strips) from DS to application.*/ -typedef struct { - TW_UINT16 Compression; /* How the data is compressed */ - TW_UINT32 BytesPerRow; /* Number of bytes in a row of data */ - TW_UINT32 Columns; /* How many columns */ - TW_UINT32 Rows; /* How many rows */ - TW_UINT32 XOffset; /* How far from the side of the image */ - TW_UINT32 YOffset; /* How far from the top of the image */ - TW_UINT32 BytesWritten; /* How many bytes written in Memory */ - TW_MEMORY Memory; /* Mem struct used to pass actual image data */ -} TW_IMAGEMEMXFER, FAR * pTW_IMAGEMEMXFER; - -/* Changed in 1.1: QuantTable, HuffmanDC, HuffmanAC TW_MEMREF -> TW_MEMORY */ -/* DAT_JPEGCOMPRESSION. Based on JPEG Draft International Std, ver 10918-1. */ -typedef struct { - TW_UINT16 ColorSpace; /* One of the TWPT_xxxx values */ - TW_UINT32 SubSampling; /* Two word "array" for subsampling values */ - TW_UINT16 NumComponents; /* Number of color components in image */ - TW_UINT16 RestartFrequency; /* Frequency of restart marker codes in MDU's */ - TW_UINT16 QuantMap[4]; /* Mapping of components to QuantTables */ - TW_MEMORY QuantTable[4]; /* Quantization tables */ - TW_UINT16 HuffmanMap[4]; /* Mapping of components to Huffman tables */ - TW_MEMORY HuffmanDC[2]; /* DC Huffman tables */ - TW_MEMORY HuffmanAC[2]; /* AC Huffman tables */ -} TW_JPEGCOMPRESSION, FAR * pTW_JPEGCOMPRESSION; - -/* TWON_ONEVALUE. Container for one value. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 Item; -} TW_ONEVALUE, FAR * pTW_ONEVALUE; - -/* DAT_PALETTE8. Color palette when TWPT_PALETTE pixels xfer'd in mem buf. */ -typedef struct { - TW_UINT16 NumColors; /* Number of colors in the color table. */ - TW_UINT16 PaletteType; /* TWPA_xxxx, specifies type of palette. */ - TW_ELEMENT8 Colors[256]; /* Array of palette values starts here. */ -} TW_PALETTE8, FAR * pTW_PALETTE8; - -/* DAT_PASSTHRU, device dependant data to pass through Data Source */ -typedef struct { - TW_MEMREF pCommand; /* Pointer to Command buffer */ - TW_UINT32 CommandBytes; /* Number of bytes in Command buffer */ - TW_INT32 Direction; /* One of the TWDR_xxxx values. Defines the direction of data flow */ - TW_MEMREF pData; /* Pointer to Data buffer */ - TW_UINT32 DataBytes; /* Number of bytes in Data buffer */ - TW_UINT32 DataBytesXfered; /* Number of bytes successfully transferred */ -} TW_PASSTHRU, FAR * pTW_PASSTHRU; - -/* DAT_PENDINGXFERS. Used with MSG_ENDXFER to indicate additional data. */ -typedef struct { - TW_UINT16 Count; - union { - TW_UINT32 EOJ; - TW_UINT32 Reserved; - }; -} TW_PENDINGXFERS, FAR *pTW_PENDINGXFERS; - -/* TWON_RANGE. Container for a range of values. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 MinValue; /* Starting value in the range. */ - TW_UINT32 MaxValue; /* Final value in the range. */ - TW_UINT32 StepSize; /* Increment from MinValue to MaxValue. */ - TW_UINT32 DefaultValue; /* Power-up value. */ - TW_UINT32 CurrentValue; /* The value that is currently in effect. */ -} TW_RANGE, FAR * pTW_RANGE; - -/* DAT_RGBRESPONSE */ -typedef struct { - TW_ELEMENT8 Response[1]; -} TW_RGBRESPONSE, FAR * pTW_RGBRESPONSE; - -/* DAT_SETUPFILEXFER. Sets up DS to application data transfer via a file. */ -typedef struct { - TW_STR255 FileName; - TW_UINT16 Format; /* Any TWFF_ constant */ - TW_INT16 VRefNum; /* Used for Mac only */ -} TW_SETUPFILEXFER, FAR * pTW_SETUPFILEXFER; - -/* DAT_SETUPMEMXFER. Sets up DS to application data transfer via a memory buffer. */ -typedef struct { - TW_UINT32 MinBufSize; - TW_UINT32 MaxBufSize; - TW_UINT32 Preferred; -} TW_SETUPMEMXFER, FAR * pTW_SETUPMEMXFER; - -/* DAT_STATUS. Application gets detailed status info from a data source with this. */ -typedef struct { - TW_UINT16 ConditionCode; /* Any TWCC_ constant */ - union { - TW_UINT16 Data; /* output (TWAIN 2.1 and newer) This field contains additional data. */ - TW_UINT16 Reserved; /* output (TWAIN 2.0 and older) */ - }; -} TW_STATUS, FAR * pTW_STATUS; - -/* DAT_STATUSUTF8. Application gets detailed UTF8 status info from a data source with this. Added 2.1 */ -typedef struct { - TW_STATUS Status; /* input TW_STATUS data received from a previous call to DG_CONTROL / DAT_STATUS / MSG_GET. */ - TW_UINT32 Size; /* output Total number of bytes in the UTF8string, plus the terminating NUL byte. This is not the same as the total number of characters in the string. */ - TW_HANDLE UTF8string; /* output TW_HANDLE to a UTF-8 encoded localized string (based on TW_IDENTITY.Language or CAP_LANGUAGE). The Source allocates it, the Application frees it. */ -} TW_STATUSUTF8, FAR * pTW_STATUSUTF8; - -/* DAT_USERINTERFACE. Coordinates UI between application and data source. */ -typedef struct { - TW_BOOL ShowUI; /* TRUE if DS should bring up its UI */ - TW_BOOL ModalUI; /* For Mac only - true if the DS's UI is modal */ - TW_HANDLE hParent; /* For windows only - Application window handle */ -} TW_USERINTERFACE, FAR * pTW_USERINTERFACE; - - - -/**************************************************************************** - * Generic Constants * - ****************************************************************************/ - -#define TWON_ARRAY 3 /* indicates TW_ARRAY container */ -#define TWON_ENUMERATION 4 /* indicates TW_ENUMERATION container */ -#define TWON_ONEVALUE 5 /* indicates TW_ONEVALUE container */ -#define TWON_RANGE 6 /* indicates TW_RANGE container */ - -#define TWON_ICONID 962 /* res Id of icon used in USERSELECT lbox */ -#define TWON_DSMID 461 /* res Id of the DSM version num resource */ -#define TWON_DSMCODEID 63 /* res Id of the Mac SM Code resource */ - -#define TWON_DONTCARE8 0xff -#define TWON_DONTCARE16 0xffff -#define TWON_DONTCARE32 0xffffffff - -/* Flags used in TW_MEMORY structure. */ -#define TWMF_APPOWNS 0x1 -#define TWMF_DSMOWNS 0x2 -#define TWMF_DSOWNS 0x4 -#define TWMF_POINTER 0x8 -#define TWMF_HANDLE 0x10 - -/* There are four containers used for capabilities negotiation: - * TWON_ONEVALUE, TWON_RANGE, TWON_ENUMERATION, TWON_ARRAY - * In each container structure ItemType can be TWTY_INT8, TWTY_INT16, etc. - * The kind of data stored in the container can be determined by doing - * DCItemSize[ItemType] where the following is defined in TWAIN glue code: - * DCItemSize[]= { sizeof(TW_INT8), - * sizeof(TW_INT16), - * etc. - * sizeof(TW_UINT32) }; - * - */ - -#define TWTY_INT8 0x0000 /* Means Item is a TW_INT8 */ -#define TWTY_INT16 0x0001 /* Means Item is a TW_INT16 */ -#define TWTY_INT32 0x0002 /* Means Item is a TW_INT32 */ - -#define TWTY_UINT8 0x0003 /* Means Item is a TW_UINT8 */ -#define TWTY_UINT16 0x0004 /* Means Item is a TW_UINT16 */ -#define TWTY_UINT32 0x0005 /* Means Item is a TW_UINT32 */ - -#define TWTY_BOOL 0x0006 /* Means Item is a TW_BOOL */ - -#define TWTY_FIX32 0x0007 /* Means Item is a TW_FIX32 */ - -#define TWTY_FRAME 0x0008 /* Means Item is a TW_FRAME */ - -#define TWTY_STR32 0x0009 /* Means Item is a TW_STR32 */ -#define TWTY_STR64 0x000a /* Means Item is a TW_STR64 */ -#define TWTY_STR128 0x000b /* Means Item is a TW_STR128 */ -#define TWTY_STR255 0x000c /* Means Item is a TW_STR255 */ -#define TWTY_HANDLE 0x000f /* Means Item is a TW_HANDLE */ - - -/**************************************************************************** - * Capability Constants * - ****************************************************************************/ - -/* CAP_ALARMS values (AL_ means alarms) Added 1.8 */ -#define TWAL_ALARM 0 -#define TWAL_FEEDERERROR 1 -#define TWAL_FEEDERWARNING 2 -#define TWAL_BARCODE 3 -#define TWAL_DOUBLEFEED 4 -#define TWAL_JAM 5 -#define TWAL_PATCHCODE 6 -#define TWAL_POWER 7 -#define TWAL_SKEW 8 - -/* ICAP_AUTOSIZE values Added 2.0 */ -#define TWAS_NONE 0 -#define TWAS_AUTO 1 -#define TWAS_CURRENT 2 - -/* TWEI_BARCODEROTATION values (BCOR_ means barcode rotation) Added 1.7 */ -#define TWBCOR_ROT0 0 -#define TWBCOR_ROT90 1 -#define TWBCOR_ROT180 2 -#define TWBCOR_ROT270 3 -#define TWBCOR_ROTX 4 - -/* ICAP_BARCODESEARCHMODE values (TWBD_ means search) */ -#define TWBD_HORZ 0 -#define TWBD_VERT 1 -#define TWBD_HORZVERT 2 -#define TWBD_VERTHORZ 3 - -/* ICAP_BITORDER values (BO_ means Bit Order) */ -#define TWBO_LSBFIRST 0 -#define TWBO_MSBFIRST 1 - -/* ICAP_AUTODISCARDBLANKPAGES values Added 2.0 */ -#define TWBP_DISABLE -2 -#define TWBP_AUTO -1 - -/* ICAP_BITDEPTHREDUCTION values (BR_ means Bitdepth Reduction) Added 1.5 */ -#define TWBR_THRESHOLD 0 -#define TWBR_HALFTONE 1 -#define TWBR_CUSTHALFTONE 2 -#define TWBR_DIFFUSION 3 - -/* ICAP_SUPPORTEDBARCODETYPES and TWEI_BARCODETYPE values Added 1.7 */ -#define TWBT_3OF9 0 -#define TWBT_2OF5INTERLEAVED 1 -#define TWBT_2OF5NONINTERLEAVED 2 -#define TWBT_CODE93 3 -#define TWBT_CODE128 4 -#define TWBT_UCC128 5 -#define TWBT_CODABAR 6 -#define TWBT_UPCA 7 -#define TWBT_UPCE 8 -#define TWBT_EAN8 9 -#define TWBT_EAN13 10 -#define TWBT_POSTNET 11 -#define TWBT_PDF417 12 -#define TWBT_2OF5INDUSTRIAL 13 /* Added 1.8 */ -#define TWBT_2OF5MATRIX 14 /* Added 1.8 */ -#define TWBT_2OF5DATALOGIC 15 /* Added 1.8 */ -#define TWBT_2OF5IATA 16 /* Added 1.8 */ -#define TWBT_3OF9FULLASCII 17 /* Added 1.8 */ -#define TWBT_CODABARWITHSTARTSTOP 18 /* Added 1.8 */ -#define TWBT_MAXICODE 19 /* Added 1.8 */ - -/* ICAP_COMPRESSION values (CP_ means ComPression ) */ -#define TWCP_NONE 0 -#define TWCP_PACKBITS 1 -#define TWCP_GROUP31D 2 /* Follows CCITT spec (no End Of Line) */ -#define TWCP_GROUP31DEOL 3 /* Follows CCITT spec (has End Of Line) */ -#define TWCP_GROUP32D 4 /* Follows CCITT spec (use cap for K Factor) */ -#define TWCP_GROUP4 5 /* Follows CCITT spec */ -#define TWCP_JPEG 6 /* Use capability for more info */ -#define TWCP_LZW 7 /* Must license from Unisys and IBM to use */ -#define TWCP_JBIG 8 /* For Bitonal images -- Added 1.7 KHL */ -#define TWCP_PNG 9 /* Added 1.8 */ -#define TWCP_RLE4 10 /* Added 1.8 */ -#define TWCP_RLE8 11 /* Added 1.8 */ -#define TWCP_BITFIELDS 12 /* Added 1.8 */ - -/* CAP_CAMERASIDE and TWEI_PAGESIDE values (CS_ means camera side) Added 1.91 */ -#define TWCS_BOTH 0 -#define TWCS_TOP 1 -#define TWCS_BOTTOM 2 - -/* CAP_CLEARBUFFERS values (CB_ means clear buffers) */ -#define TWCB_AUTO 0 -#define TWCB_CLEAR 1 -#define TWCB_NOCLEAR 2 - -/* CAP_DEVICEEVENT values (DE_ means device event) */ -#define TWDE_CUSTOMEVENTS 0x8000 -#define TWDE_CHECKAUTOMATICCAPTURE 0 -#define TWDE_CHECKBATTERY 1 -#define TWDE_CHECKDEVICEONLINE 2 -#define TWDE_CHECKFLASH 3 -#define TWDE_CHECKPOWERSUPPLY 4 -#define TWDE_CHECKRESOLUTION 5 -#define TWDE_DEVICEADDED 6 -#define TWDE_DEVICEOFFLINE 7 -#define TWDE_DEVICEREADY 8 -#define TWDE_DEVICEREMOVED 9 -#define TWDE_IMAGECAPTURED 10 -#define TWDE_IMAGEDELETED 11 -#define TWDE_PAPERDOUBLEFEED 12 -#define TWDE_PAPERJAM 13 -#define TWDE_LAMPFAILURE 14 -#define TWDE_POWERSAVE 15 -#define TWDE_POWERSAVENOTIFY 16 - -/* TW_PASSTHRU.Direction values. Added 1.8 */ -#define TWDR_GET 1 -#define TWDR_SET 2 - -/* TWEI_DESKEWSTATUS values Added 1.7 */ -#define TWDSK_SUCCESS 0 -#define TWDSK_REPORTONLY 1 -#define TWDSK_FAIL 2 -#define TWDSK_DISABLED 3 - -/* CAP_DUPLEX values Added 1.7 */ -#define TWDX_NONE 0 -#define TWDX_1PASSDUPLEX 1 -#define TWDX_2PASSDUPLEX 2 - -/* CAP_FEEDERALIGNMENT values (FA_ means feeder alignment) */ -#define TWFA_NONE 0 -#define TWFA_LEFT 1 -#define TWFA_CENTER 2 -#define TWFA_RIGHT 3 - -/* ICAP_FEEDERTYPE */ -#define TWFE_GENERAL 0 -#define TWFE_PHOTO 1 - -/* ICAP_IMAGEFILEFORMAT values (FF_means File Format) */ -#define TWFF_TIFF 0 /* Tagged Image File Format */ -#define TWFF_PICT 1 /* Macintosh PICT */ -#define TWFF_BMP 2 /* Windows Bitmap */ -#define TWFF_XBM 3 /* X-Windows Bitmap */ -#define TWFF_JFIF 4 /* JPEG File Interchange Format */ -#define TWFF_FPX 5 /* Flash Pix */ -#define TWFF_TIFFMULTI 6 /* Multi-page tiff file */ -#define TWFF_PNG 7 -#define TWFF_SPIFF 8 -#define TWFF_EXIF 9 -#define TWFF_PDF 10 /* 1.91 NB: this is not PDF/A */ -#define TWFF_JP2 11 /* 1.91 */ -#define TWFF_JPX 13 /* 1.91 */ -#define TWFF_DEJAVU 14 /* 1.91 */ -#define TWFF_PDFA 15 /* 2.0 Adobe PDF/A, Version 1*/ -#define TWFF_PDFA2 16 /* 2.1 Adobe PDF/A, Version 2*/ - -/* ICAP_FLASHUSED2 values (FL_ means flash) */ -#define TWFL_NONE 0 -#define TWFL_OFF 1 -#define TWFL_ON 2 -#define TWFL_AUTO 3 -#define TWFL_REDEYE 4 - -/* CAP_FEEDERORDER values (FO_ means feeder order) */ -#define TWFO_FIRSTPAGEFIRST 0 -#define TWFO_LASTPAGEFIRST 1 - -/* CAP_FEEDERPOCKET */ -#define TWFP_POCKETERROR 0 -#define TWFP_POCKET1 1 -#define TWFP_POCKET2 2 -#define TWFP_POCKET3 3 -#define TWFP_POCKET4 4 -#define TWFP_POCKET5 5 -#define TWFP_POCKET6 6 -#define TWFP_POCKET7 7 -#define TWFP_POCKET8 8 -#define TWFP_POCKET9 9 -#define TWFP_POCKET10 10 -#define TWFP_POCKET11 11 -#define TWFP_POCKET12 12 -#define TWFP_POCKET13 13 -#define TWFP_POCKET14 14 -#define TWFP_POCKET15 15 -#define TWFP_POCKET16 16 - -/* ICAP_FLIPROTATION values (FR_ means flip rotation) */ -#define TWFR_BOOK 0 -#define TWFR_FANFOLD 1 - -/* ICAP_FILTER values (FT_ means Filter Type) */ -#define TWFT_RED 0 -#define TWFT_GREEN 1 -#define TWFT_BLUE 2 -#define TWFT_NONE 3 -#define TWFT_WHITE 4 -#define TWFT_CYAN 5 -#define TWFT_MAGENTA 6 -#define TWFT_YELLOW 7 -#define TWFT_BLACK 8 - -/* TW_FILESYSTEM.FileType values (FY_ means file type) */ -#define TWFY_CAMERA 0 -#define TWFY_CAMERATOP 1 -#define TWFY_CAMERABOTTOM 2 -#define TWFY_CAMERAPREVIEW 3 -#define TWFY_DOMAIN 4 -#define TWFY_HOST 5 -#define TWFY_DIRECTORY 6 -#define TWFY_IMAGE 7 -#define TWFY_UNKNOWN 8 - -/* ICAP_ICCPROFILE */ -#define TWIC_NONE 0 -#define TWIC_LINK 1 -#define TWIC_EMBED 2 - -/* ICAP_IMAGEFILTER values (IF_ means image filter) */ -#define TWIF_NONE 0 -#define TWIF_AUTO 1 -#define TWIF_LOWPASS 2 -#define TWIF_BANDPASS 3 -#define TWIF_HIGHPASS 4 -#define TWIF_TEXT TWIF_BANDPASS -#define TWIF_FINELINE TWIF_HIGHPASS - -/* ICAP_IMAGEMERGE values (IM_ means image merge) */ -#define TWIM_NONE 0 -#define TWIM_FRONTONTOP 1 -#define TWIM_FRONTONBOTTOM 2 -#define TWIM_FRONTONLEFT 3 -#define TWIM_FRONTONRIGHT 4 - -/* CAP_JOBCONTROL values Added 1.7 */ -#define TWJC_NONE 0 -#define TWJC_JSIC 1 -#define TWJC_JSIS 2 -#define TWJC_JSXC 3 -#define TWJC_JSXS 4 - -/* ICAP_JPEGQUALITY values (JQ_ means jpeg quality) */ -#define TWJQ_UNKNOWN -4 -#define TWJQ_LOW -3 -#define TWJQ_MEDIUM -2 -#define TWJQ_HIGH -1 - -/* ICAP_LIGHTPATH values (LP_ means Light Path) */ -#define TWLP_REFLECTIVE 0 -#define TWLP_TRANSMISSIVE 1 - -/* ICAP_LIGHTSOURCE values (LS_ means Light Source) */ -#define TWLS_RED 0 -#define TWLS_GREEN 1 -#define TWLS_BLUE 2 -#define TWLS_NONE 3 -#define TWLS_WHITE 4 -#define TWLS_UV 5 -#define TWLS_IR 6 - -/* TWEI_MAGTYPE values (MD_ means Mag Type) Added 2.0 */ -#define TWMD_MICR 0 /* Added 2.0 */ -#define TWMD_RAW 1 /* added 2.1 */ -#define TWMD_INVALID 2 /* added 2.1 */ - -/* ICAP_NOISEFILTER values (NF_ means noise filter) */ -#define TWNF_NONE 0 -#define TWNF_AUTO 1 -#define TWNF_LONEPIXEL 2 -#define TWNF_MAJORITYRULE 3 - -/* ICAP_ORIENTATION values (OR_ means ORientation) */ -#define TWOR_ROT0 0 -#define TWOR_ROT90 1 -#define TWOR_ROT180 2 -#define TWOR_ROT270 3 -#define TWOR_PORTRAIT TWOR_ROT0 -#define TWOR_LANDSCAPE TWOR_ROT270 -#define TWOR_AUTO 4 /* 2.0 */ -#define TWOR_AUTOTEXT 5 /* 2.0 */ -#define TWOR_AUTOPICTURE 6 /* 2.0 */ - -/* ICAP_OVERSCAN values (OV_ means overscan) */ -#define TWOV_NONE 0 -#define TWOV_AUTO 1 -#define TWOV_TOPBOTTOM 2 -#define TWOV_LEFTRIGHT 3 -#define TWOV_ALL 4 - -/* Palette types for TW_PALETTE8 */ -#define TWPA_RGB 0 -#define TWPA_GRAY 1 -#define TWPA_CMY 2 - -/* ICAP_PLANARCHUNKY values (PC_ means Planar/Chunky ) */ -#define TWPC_CHUNKY 0 -#define TWPC_PLANAR 1 - -/* TWEI_PATCHCODE values Added 1.7 */ -#define TWPCH_PATCH1 0 -#define TWPCH_PATCH2 1 -#define TWPCH_PATCH3 2 -#define TWPCH_PATCH4 3 -#define TWPCH_PATCH6 4 -#define TWPCH_PATCHT 5 - -/* ICAP_PIXELFLAVOR values (PF_ means Pixel Flavor) */ -#define TWPF_CHOCOLATE 0 /* zero pixel represents darkest shade */ -#define TWPF_VANILLA 1 /* zero pixel represents lightest shade */ - -/* CAP_PRINTERMODE values (PM_ means printer mode) */ -#define TWPM_SINGLESTRING 0 -#define TWPM_MULTISTRING 1 -#define TWPM_COMPOUNDSTRING 2 - -/* CAP_PRINTER values (PR_ means printer) */ -#define TWPR_IMPRINTERTOPBEFORE 0 -#define TWPR_IMPRINTERTOPAFTER 1 -#define TWPR_IMPRINTERBOTTOMBEFORE 2 -#define TWPR_IMPRINTERBOTTOMAFTER 3 -#define TWPR_ENDORSERTOPBEFORE 4 -#define TWPR_ENDORSERTOPAFTER 5 -#define TWPR_ENDORSERBOTTOMBEFORE 6 -#define TWPR_ENDORSERBOTTOMAFTER 7 - -/* CAP_POWERSUPPLY values (PS_ means power supply) */ -#define TWPS_EXTERNAL 0 -#define TWPS_BATTERY 1 - -/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */ -#define TWPT_BW 0 /* Black and White */ -#define TWPT_GRAY 1 -#define TWPT_RGB 2 -#define TWPT_PALETTE 3 -#define TWPT_CMY 4 -#define TWPT_CMYK 5 -#define TWPT_YUV 6 -#define TWPT_YUVK 7 -#define TWPT_CIEXYZ 8 -#define TWPT_LAB 9 -#define TWPT_SRGB 10 /* 1.91 */ -#define TWPT_SCRGB 11 /* 1.91 */ -#define TWPT_INFRARED 16 /* 2.0 */ - -/* CAP_SEGMENTED values (SG_ means segmented) Added 1.91 */ -#define TWSG_NONE 0 -#define TWSG_AUTO 1 - -/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */ -#define TWSS_NONE 0 -#define TWSS_A4 1 -#define TWSS_JISB5 2 -#define TWSS_USLETTER 3 -#define TWSS_USLEGAL 4 -/* Added 1.5 */ -#define TWSS_A5 5 -#define TWSS_ISOB4 6 -#define TWSS_ISOB6 7 -/* Added 1.7 */ -#define TWSS_USLEDGER 9 -#define TWSS_USEXECUTIVE 10 -#define TWSS_A3 11 -#define TWSS_ISOB3 12 -#define TWSS_A6 13 -#define TWSS_C4 14 -#define TWSS_C5 15 -#define TWSS_C6 16 -/* Added 1.8 */ -#define TWSS_4A0 17 -#define TWSS_2A0 18 -#define TWSS_A0 19 -#define TWSS_A1 20 -#define TWSS_A2 21 -#define TWSS_A7 22 -#define TWSS_A8 23 -#define TWSS_A9 24 -#define TWSS_A10 25 -#define TWSS_ISOB0 26 -#define TWSS_ISOB1 27 -#define TWSS_ISOB2 28 -#define TWSS_ISOB5 29 -#define TWSS_ISOB7 30 -#define TWSS_ISOB8 31 -#define TWSS_ISOB9 32 -#define TWSS_ISOB10 33 -#define TWSS_JISB0 34 -#define TWSS_JISB1 35 -#define TWSS_JISB2 36 -#define TWSS_JISB3 37 -#define TWSS_JISB4 38 -#define TWSS_JISB6 39 -#define TWSS_JISB7 40 -#define TWSS_JISB8 41 -#define TWSS_JISB9 42 -#define TWSS_JISB10 43 -#define TWSS_C0 44 -#define TWSS_C1 45 -#define TWSS_C2 46 -#define TWSS_C3 47 -#define TWSS_C7 48 -#define TWSS_C8 49 -#define TWSS_C9 50 -#define TWSS_C10 51 -#define TWSS_USSTATEMENT 52 -#define TWSS_BUSINESSCARD 53 -#define TWSS_MAXSIZE 54 /* Added 2.1 */ - -/* ICAP_XFERMECH values (SX_ means Setup XFer) */ -#define TWSX_NATIVE 0 -#define TWSX_FILE 1 -#define TWSX_MEMORY 2 -#define TWSX_MEMFILE 4 /* added 1.91 */ - -/* ICAP_UNITS values (UN_ means UNits) */ -#define TWUN_INCHES 0 -#define TWUN_CENTIMETERS 1 -#define TWUN_PICAS 2 -#define TWUN_POINTS 3 -#define TWUN_TWIPS 4 -#define TWUN_PIXELS 5 -#define TWUN_MILLIMETERS 6 /* added 1.91 */ - - -/**************************************************************************** - * Country Constants * - ****************************************************************************/ - -#define TWCY_AFGHANISTAN 1001 -#define TWCY_ALGERIA 213 -#define TWCY_AMERICANSAMOA 684 -#define TWCY_ANDORRA 033 -#define TWCY_ANGOLA 1002 -#define TWCY_ANGUILLA 8090 -#define TWCY_ANTIGUA 8091 -#define TWCY_ARGENTINA 54 -#define TWCY_ARUBA 297 -#define TWCY_ASCENSIONI 247 -#define TWCY_AUSTRALIA 61 -#define TWCY_AUSTRIA 43 -#define TWCY_BAHAMAS 8092 -#define TWCY_BAHRAIN 973 -#define TWCY_BANGLADESH 880 -#define TWCY_BARBADOS 8093 -#define TWCY_BELGIUM 32 -#define TWCY_BELIZE 501 -#define TWCY_BENIN 229 -#define TWCY_BERMUDA 8094 -#define TWCY_BHUTAN 1003 -#define TWCY_BOLIVIA 591 -#define TWCY_BOTSWANA 267 -#define TWCY_BRITAIN 6 -#define TWCY_BRITVIRGINIS 8095 -#define TWCY_BRAZIL 55 -#define TWCY_BRUNEI 673 -#define TWCY_BULGARIA 359 -#define TWCY_BURKINAFASO 1004 -#define TWCY_BURMA 1005 -#define TWCY_BURUNDI 1006 -#define TWCY_CAMAROON 237 -#define TWCY_CANADA 2 -#define TWCY_CAPEVERDEIS 238 -#define TWCY_CAYMANIS 8096 -#define TWCY_CENTRALAFREP 1007 -#define TWCY_CHAD 1008 -#define TWCY_CHILE 56 -#define TWCY_CHINA 86 -#define TWCY_CHRISTMASIS 1009 -#define TWCY_COCOSIS 1009 -#define TWCY_COLOMBIA 57 -#define TWCY_COMOROS 1010 -#define TWCY_CONGO 1011 -#define TWCY_COOKIS 1012 -#define TWCY_COSTARICA 506 -#define TWCY_CUBA 005 -#define TWCY_CYPRUS 357 -#define TWCY_CZECHOSLOVAKIA 42 -#define TWCY_DENMARK 45 -#define TWCY_DJIBOUTI 1013 -#define TWCY_DOMINICA 8097 -#define TWCY_DOMINCANREP 8098 -#define TWCY_EASTERIS 1014 -#define TWCY_ECUADOR 593 -#define TWCY_EGYPT 20 -#define TWCY_ELSALVADOR 503 -#define TWCY_EQGUINEA 1015 -#define TWCY_ETHIOPIA 251 -#define TWCY_FALKLANDIS 1016 -#define TWCY_FAEROEIS 298 -#define TWCY_FIJIISLANDS 679 -#define TWCY_FINLAND 358 -#define TWCY_FRANCE 33 -#define TWCY_FRANTILLES 596 -#define TWCY_FRGUIANA 594 -#define TWCY_FRPOLYNEISA 689 -#define TWCY_FUTANAIS 1043 -#define TWCY_GABON 241 -#define TWCY_GAMBIA 220 -#define TWCY_GERMANY 49 -#define TWCY_GHANA 233 -#define TWCY_GIBRALTER 350 -#define TWCY_GREECE 30 -#define TWCY_GREENLAND 299 -#define TWCY_GRENADA 8099 -#define TWCY_GRENEDINES 8015 -#define TWCY_GUADELOUPE 590 -#define TWCY_GUAM 671 -#define TWCY_GUANTANAMOBAY 5399 -#define TWCY_GUATEMALA 502 -#define TWCY_GUINEA 224 -#define TWCY_GUINEABISSAU 1017 -#define TWCY_GUYANA 592 -#define TWCY_HAITI 509 -#define TWCY_HONDURAS 504 -#define TWCY_HONGKONG 852 -#define TWCY_HUNGARY 36 -#define TWCY_ICELAND 354 -#define TWCY_INDIA 91 -#define TWCY_INDONESIA 62 -#define TWCY_IRAN 98 -#define TWCY_IRAQ 964 -#define TWCY_IRELAND 353 -#define TWCY_ISRAEL 972 -#define TWCY_ITALY 39 -#define TWCY_IVORYCOAST 225 -#define TWCY_JAMAICA 8010 -#define TWCY_JAPAN 81 -#define TWCY_JORDAN 962 -#define TWCY_KENYA 254 -#define TWCY_KIRIBATI 1018 -#define TWCY_KOREA 82 -#define TWCY_KUWAIT 965 -#define TWCY_LAOS 1019 -#define TWCY_LEBANON 1020 -#define TWCY_LIBERIA 231 -#define TWCY_LIBYA 218 -#define TWCY_LIECHTENSTEIN 41 -#define TWCY_LUXENBOURG 352 -#define TWCY_MACAO 853 -#define TWCY_MADAGASCAR 1021 -#define TWCY_MALAWI 265 -#define TWCY_MALAYSIA 60 -#define TWCY_MALDIVES 960 -#define TWCY_MALI 1022 -#define TWCY_MALTA 356 -#define TWCY_MARSHALLIS 692 -#define TWCY_MAURITANIA 1023 -#define TWCY_MAURITIUS 230 -#define TWCY_MEXICO 3 -#define TWCY_MICRONESIA 691 -#define TWCY_MIQUELON 508 -#define TWCY_MONACO 33 -#define TWCY_MONGOLIA 1024 -#define TWCY_MONTSERRAT 8011 -#define TWCY_MOROCCO 212 -#define TWCY_MOZAMBIQUE 1025 -#define TWCY_NAMIBIA 264 -#define TWCY_NAURU 1026 -#define TWCY_NEPAL 977 -#define TWCY_NETHERLANDS 31 -#define TWCY_NETHANTILLES 599 -#define TWCY_NEVIS 8012 -#define TWCY_NEWCALEDONIA 687 -#define TWCY_NEWZEALAND 64 -#define TWCY_NICARAGUA 505 -#define TWCY_NIGER 227 -#define TWCY_NIGERIA 234 -#define TWCY_NIUE 1027 -#define TWCY_NORFOLKI 1028 -#define TWCY_NORWAY 47 -#define TWCY_OMAN 968 -#define TWCY_PAKISTAN 92 -#define TWCY_PALAU 1029 -#define TWCY_PANAMA 507 -#define TWCY_PARAGUAY 595 -#define TWCY_PERU 51 -#define TWCY_PHILLIPPINES 63 -#define TWCY_PITCAIRNIS 1030 -#define TWCY_PNEWGUINEA 675 -#define TWCY_POLAND 48 -#define TWCY_PORTUGAL 351 -#define TWCY_QATAR 974 -#define TWCY_REUNIONI 1031 -#define TWCY_ROMANIA 40 -#define TWCY_RWANDA 250 -#define TWCY_SAIPAN 670 -#define TWCY_SANMARINO 39 -#define TWCY_SAOTOME 1033 -#define TWCY_SAUDIARABIA 966 -#define TWCY_SENEGAL 221 -#define TWCY_SEYCHELLESIS 1034 -#define TWCY_SIERRALEONE 1035 -#define TWCY_SINGAPORE 65 -#define TWCY_SOLOMONIS 1036 -#define TWCY_SOMALI 1037 -#define TWCY_SOUTHAFRICA 27 -#define TWCY_SPAIN 34 -#define TWCY_SRILANKA 94 -#define TWCY_STHELENA 1032 -#define TWCY_STKITTS 8013 -#define TWCY_STLUCIA 8014 -#define TWCY_STPIERRE 508 -#define TWCY_STVINCENT 8015 -#define TWCY_SUDAN 1038 -#define TWCY_SURINAME 597 -#define TWCY_SWAZILAND 268 -#define TWCY_SWEDEN 46 -#define TWCY_SWITZERLAND 41 -#define TWCY_SYRIA 1039 -#define TWCY_TAIWAN 886 -#define TWCY_TANZANIA 255 -#define TWCY_THAILAND 66 -#define TWCY_TOBAGO 8016 -#define TWCY_TOGO 228 -#define TWCY_TONGAIS 676 -#define TWCY_TRINIDAD 8016 -#define TWCY_TUNISIA 216 -#define TWCY_TURKEY 90 -#define TWCY_TURKSCAICOS 8017 -#define TWCY_TUVALU 1040 -#define TWCY_UGANDA 256 -#define TWCY_USSR 7 -#define TWCY_UAEMIRATES 971 -#define TWCY_UNITEDKINGDOM 44 -#define TWCY_USA 1 -#define TWCY_URUGUAY 598 -#define TWCY_VANUATU 1041 -#define TWCY_VATICANCITY 39 -#define TWCY_VENEZUELA 58 -#define TWCY_WAKE 1042 -#define TWCY_WALLISIS 1043 -#define TWCY_WESTERNSAHARA 1044 -#define TWCY_WESTERNSAMOA 1045 -#define TWCY_YEMEN 1046 -#define TWCY_YUGOSLAVIA 38 -#define TWCY_ZAIRE 243 -#define TWCY_ZAMBIA 260 -#define TWCY_ZIMBABWE 263 -/* Added for 1.8 */ -#define TWCY_ALBANIA 355 -#define TWCY_ARMENIA 374 -#define TWCY_AZERBAIJAN 994 -#define TWCY_BELARUS 375 -#define TWCY_BOSNIAHERZGO 387 -#define TWCY_CAMBODIA 855 -#define TWCY_CROATIA 385 -#define TWCY_CZECHREPUBLIC 420 -#define TWCY_DIEGOGARCIA 246 -#define TWCY_ERITREA 291 -#define TWCY_ESTONIA 372 -#define TWCY_GEORGIA 995 -#define TWCY_LATVIA 371 -#define TWCY_LESOTHO 266 -#define TWCY_LITHUANIA 370 -#define TWCY_MACEDONIA 389 -#define TWCY_MAYOTTEIS 269 -#define TWCY_MOLDOVA 373 -#define TWCY_MYANMAR 95 -#define TWCY_NORTHKOREA 850 -#define TWCY_PUERTORICO 787 -#define TWCY_RUSSIA 7 -#define TWCY_SERBIA 381 -#define TWCY_SLOVAKIA 421 -#define TWCY_SLOVENIA 386 -#define TWCY_SOUTHKOREA 82 -#define TWCY_UKRAINE 380 -#define TWCY_USVIRGINIS 340 -#define TWCY_VIETNAM 84 - -/**************************************************************************** - * Language Constants * - ****************************************************************************/ -/* Added for 1.8 */ -#define TWLG_USERLOCALE -1 -#define TWLG_DANISH 0 /* Danish */ -#define TWLG_DUTCH 1 /* Dutch */ -#define TWLG_ENGLISH 2 /* International English */ -#define TWLG_FRENCH_CANADIAN 3 /* French Canadian */ -#define TWLG_FINNISH 4 /* Finnish */ -#define TWLG_FRENCH 5 /* French */ -#define TWLG_GERMAN 6 /* German */ -#define TWLG_ICELANDIC 7 /* Icelandic */ -#define TWLG_ITALIAN 8 /* Italian */ -#define TWLG_NORWEGIAN 9 /* Norwegian */ -#define TWLG_PORTUGUESE 10 /* Portuguese */ -#define TWLG_SPANISH 11 /* Spanish */ -#define TWLG_SWEDISH 12 /* Swedish */ -#define TWLG_ENGLISH_USA 13 /* U.S. English */ -#define TWLG_AFRIKAANS 14 -#define TWLG_ALBANIA 15 -#define TWLG_ARABIC 16 -#define TWLG_ARABIC_ALGERIA 17 -#define TWLG_ARABIC_BAHRAIN 18 -#define TWLG_ARABIC_EGYPT 19 -#define TWLG_ARABIC_IRAQ 20 -#define TWLG_ARABIC_JORDAN 21 -#define TWLG_ARABIC_KUWAIT 22 -#define TWLG_ARABIC_LEBANON 23 -#define TWLG_ARABIC_LIBYA 24 -#define TWLG_ARABIC_MOROCCO 25 -#define TWLG_ARABIC_OMAN 26 -#define TWLG_ARABIC_QATAR 27 -#define TWLG_ARABIC_SAUDIARABIA 28 -#define TWLG_ARABIC_SYRIA 29 -#define TWLG_ARABIC_TUNISIA 30 -#define TWLG_ARABIC_UAE 31 /* United Arabic Emirates */ -#define TWLG_ARABIC_YEMEN 32 -#define TWLG_BASQUE 33 -#define TWLG_BYELORUSSIAN 34 -#define TWLG_BULGARIAN 35 -#define TWLG_CATALAN 36 -#define TWLG_CHINESE 37 -#define TWLG_CHINESE_HONGKONG 38 -#define TWLG_CHINESE_PRC 39 /* People's Republic of China */ -#define TWLG_CHINESE_SINGAPORE 40 -#define TWLG_CHINESE_SIMPLIFIED 41 -#define TWLG_CHINESE_TAIWAN 42 -#define TWLG_CHINESE_TRADITIONAL 43 -#define TWLG_CROATIA 44 -#define TWLG_CZECH 45 -#define TWLG_DUTCH_BELGIAN 46 -#define TWLG_ENGLISH_AUSTRALIAN 47 -#define TWLG_ENGLISH_CANADIAN 48 -#define TWLG_ENGLISH_IRELAND 49 -#define TWLG_ENGLISH_NEWZEALAND 50 -#define TWLG_ENGLISH_SOUTHAFRICA 51 -#define TWLG_ENGLISH_UK 52 -#define TWLG_ESTONIAN 53 -#define TWLG_FAEROESE 54 -#define TWLG_FARSI 55 -#define TWLG_FRENCH_BELGIAN 56 -#define TWLG_FRENCH_LUXEMBOURG 57 -#define TWLG_FRENCH_SWISS 58 -#define TWLG_GERMAN_AUSTRIAN 59 -#define TWLG_GERMAN_LUXEMBOURG 60 -#define TWLG_GERMAN_LIECHTENSTEIN 61 -#define TWLG_GERMAN_SWISS 62 -#define TWLG_GREEK 63 -#define TWLG_HEBREW 64 -#define TWLG_HUNGARIAN 65 -#define TWLG_INDONESIAN 66 -#define TWLG_ITALIAN_SWISS 67 -#define TWLG_JAPANESE 68 -#define TWLG_KOREAN 69 -#define TWLG_KOREAN_JOHAB 70 -#define TWLG_LATVIAN 71 -#define TWLG_LITHUANIAN 72 -#define TWLG_NORWEGIAN_BOKMAL 73 -#define TWLG_NORWEGIAN_NYNORSK 74 -#define TWLG_POLISH 75 -#define TWLG_PORTUGUESE_BRAZIL 76 -#define TWLG_ROMANIAN 77 -#define TWLG_RUSSIAN 78 -#define TWLG_SERBIAN_LATIN 79 -#define TWLG_SLOVAK 80 -#define TWLG_SLOVENIAN 81 -#define TWLG_SPANISH_MEXICAN 82 -#define TWLG_SPANISH_MODERN 83 -#define TWLG_THAI 84 -#define TWLG_TURKISH 85 -#define TWLG_UKRANIAN 86 -/* More stuff added for 1.8 */ -#define TWLG_ASSAMESE 87 -#define TWLG_BENGALI 88 -#define TWLG_BIHARI 89 -#define TWLG_BODO 90 -#define TWLG_DOGRI 91 -#define TWLG_GUJARATI 92 -#define TWLG_HARYANVI 93 -#define TWLG_HINDI 94 -#define TWLG_KANNADA 95 -#define TWLG_KASHMIRI 96 -#define TWLG_MALAYALAM 97 -#define TWLG_MARATHI 98 -#define TWLG_MARWARI 99 -#define TWLG_MEGHALAYAN 100 -#define TWLG_MIZO 101 -#define TWLG_NAGA 102 -#define TWLG_ORISSI 103 -#define TWLG_PUNJABI 104 -#define TWLG_PUSHTU 105 -#define TWLG_SERBIAN_CYRILLIC 106 -#define TWLG_SIKKIMI 107 -#define TWLG_SWEDISH_FINLAND 108 -#define TWLG_TAMIL 109 -#define TWLG_TELUGU 110 -#define TWLG_TRIPURI 111 -#define TWLG_URDU 112 -#define TWLG_VIETNAMESE 113 - -/**************************************************************************** - * Data Groups * - ****************************************************************************/ - -/* More Data Groups may be added in the future. - * Possible candidates include text, vector graphics, sound, etc. - * NOTE: Data Group constants must be powers of 2 as they are used - * as bitflags when Application asks DSM to present a list of DSs. - */ - -#define DG_CONTROL 0x0001L /* data pertaining to control */ -#define DG_IMAGE 0x0002L /* data pertaining to raster images */ -/* Added 1.8 */ -#define DG_AUDIO 0x0004L /* data pertaining to audio */ - -/* More Data Functionality may be added in the future. - * These are for items that need to be determined before DS is opened. - * NOTE: Supported Functionality constants must be powers of 2 as they are - * used as bitflags when Application asks DSM to present a list of DSs. - * to support backward capability the App and DS will not use the fields - */ -#define DF_DSM2 0x10000000L /* added to the identity by the DSM */ -#define DF_APP2 0x20000000L /* Set by the App to indicate it would - prefer to use DSM2 */ -#define DF_DS2 0x40000000L /* Set by the DS to indicate it would - prefer to use DSM2 */ -#define DG_MASK 0xFFFFL /* all Data Groups limited to 16 bit. Added for 2.1 */ - -/**************************************************************************** - * * - ****************************************************************************/ -#define DAT_NULL 0x0000 /* No data or structure. */ -#define DAT_CUSTOMBASE 0x8000 /* Base of custom DATs. */ - -/* Data Argument Types for the DG_CONTROL Data Group. */ -#define DAT_CAPABILITY 0x0001 /* TW_CAPABILITY */ -#define DAT_EVENT 0x0002 /* TW_EVENT */ -#define DAT_IDENTITY 0x0003 /* TW_IDENTITY */ -#define DAT_PARENT 0x0004 /* TW_HANDLE, application win handle in Windows */ -#define DAT_PENDINGXFERS 0x0005 /* TW_PENDINGXFERS */ -#define DAT_SETUPMEMXFER 0x0006 /* TW_SETUPMEMXFER */ -#define DAT_SETUPFILEXFER 0x0007 /* TW_SETUPFILEXFER */ -#define DAT_STATUS 0x0008 /* TW_STATUS */ -#define DAT_USERINTERFACE 0x0009 /* TW_USERINTERFACE */ -#define DAT_XFERGROUP 0x000a /* TW_UINT32 */ -#define DAT_CUSTOMDSDATA 0x000c /* TW_CUSTOMDSDATA. */ -#define DAT_DEVICEEVENT 0x000d /* TW_DEVICEEVENT Added 1.8 */ -#define DAT_FILESYSTEM 0x000e /* TW_FILESYSTEM Added 1.8 */ -#define DAT_PASSTHRU 0x000f /* TW_PASSTHRU Added 1.8 */ -#define DAT_CALLBACK 0x0010 /* TW_CALLBACK Added 2.0 */ -#define DAT_STATUSUTF8 0x0011 /* TW_STATUSUTF8 Added 2.1 */ - -/* Data Argument Types for the DG_IMAGE Data Group. */ -#define DAT_IMAGEINFO 0x0101 /* TW_IMAGEINFO */ -#define DAT_IMAGELAYOUT 0x0102 /* TW_IMAGELAYOUT */ -#define DAT_IMAGEMEMXFER 0x0103 /* TW_IMAGEMEMXFER */ -#define DAT_IMAGENATIVEXFER 0x0104 /* TW_UINT32 loword is hDIB, PICHandle */ -#define DAT_IMAGEFILEXFER 0x0105 /* Null data */ -#define DAT_CIECOLOR 0x0106 /* TW_CIECOLOR */ -#define DAT_GRAYRESPONSE 0x0107 /* TW_GRAYRESPONSE */ -#define DAT_RGBRESPONSE 0x0108 /* TW_RGBRESPONSE */ -#define DAT_JPEGCOMPRESSION 0x0109 /* TW_JPEGCOMPRESSION */ -#define DAT_PALETTE8 0x010a /* TW_PALETTE8 */ -#define DAT_EXTIMAGEINFO 0x010b /* TW_EXTIMAGEINFO -- for 1.7 Spec. */ - -/* Data Argument Types for the DG_AUDIO Data Group. */ -#define DAT_AUDIOFILEXFER 0x0201 /* Null data Added 1.8 */ -#define DAT_AUDIOINFO 0x0202 /* TW_AUDIOINFO Added 1.8 */ -#define DAT_AUDIONATIVEXFER 0x0203 /* TW_UINT32 handle to WAV, (AIFF Mac) Added 1.8 */ - -/* misplaced */ -#define DAT_ICCPROFILE 0x0401 /* TW_MEMORY Added 1.91 This Data Argument is misplaced but belongs to the DG_IMAGE Data Group */ -#define DAT_IMAGEMEMFILEXFER 0x0402 /* TW_IMAGEMEMXFER Added 1.91 This Data Argument is misplaced but belongs to the DG_IMAGE Data Group */ -#define DAT_ENTRYPOINT 0x0403 /* TW_ENTRYPOINT Added 2.0 This Data Argument is misplaced but belongs to the DG_CONTROL Data Group */ - - -/**************************************************************************** - * Messages * - ****************************************************************************/ - -/* All message constants are unique. - * Messages are grouped according to which DATs they are used with.*/ - -#define MSG_NULL 0x0000 /* Used in TW_EVENT structure */ -#define MSG_CUSTOMBASE 0x8000 /* Base of custom messages */ - -/* Generic messages may be used with any of several DATs. */ -#define MSG_GET 0x0001 /* Get one or more values */ -#define MSG_GETCURRENT 0x0002 /* Get current value */ -#define MSG_GETDEFAULT 0x0003 /* Get default (e.g. power up) value */ -#define MSG_GETFIRST 0x0004 /* Get first of a series of items, e.g. DSs */ -#define MSG_GETNEXT 0x0005 /* Iterate through a series of items. */ -#define MSG_SET 0x0006 /* Set one or more values */ -#define MSG_RESET 0x0007 /* Set current value to default value */ -#define MSG_QUERYSUPPORT 0x0008 /* Get supported operations on the cap. */ -#define MSG_GETHELP 0x0009 /* Returns help text suitable for use in a GUI Added 2.1 */ -#define MSG_GETLABEL 0x000a /* Returns a label suitable for use in a GUI Added 2.1 */ -#define MSG_GETLABELENUM 0x000b /* Return all of the labels for a capability of type Added 2.1 */ - - -/* Messages used with DAT_NULL */ -#define MSG_XFERREADY 0x0101 /* The data source has data ready */ -#define MSG_CLOSEDSREQ 0x0102 /* Request for Application. to close DS */ -#define MSG_CLOSEDSOK 0x0103 /* Tell the Application. to save the state. */ -#define MSG_DEVICEEVENT 0X0104 /* Some event has taken place Added 1.8 */ - -/* Messages used with a pointer to DAT_PARENT data */ -#define MSG_OPENDSM 0x0301 /* Open the DSM */ -#define MSG_CLOSEDSM 0x0302 /* Close the DSM */ - -/* Messages used with a pointer to a DAT_IDENTITY structure */ -#define MSG_OPENDS 0x0401 /* Open a data source */ -#define MSG_CLOSEDS 0x0402 /* Close a data source */ -#define MSG_USERSELECT 0x0403 /* Put up a dialog of all DS */ - -/* Messages used with a pointer to a DAT_USERINTERFACE structure */ -#define MSG_DISABLEDS 0x0501 /* Disable data transfer in the DS */ -#define MSG_ENABLEDS 0x0502 /* Enable data transfer in the DS */ -#define MSG_ENABLEDSUIONLY 0x0503 /* Enable for saving DS state only. */ - -/* Messages used with a pointer to a DAT_EVENT structure */ -#define MSG_PROCESSEVENT 0x0601 - -/* Messages used with a pointer to a DAT_PENDINGXFERS structure */ -#define MSG_ENDXFER 0x0701 -#define MSG_STOPFEEDER 0x0702 - -/* Messages used with a pointer to a DAT_FILESYSTEM structure */ -#define MSG_CHANGEDIRECTORY 0x0801 /* Added 1.8 */ -#define MSG_CREATEDIRECTORY 0x0802 /* Added 1.8 */ -#define MSG_DELETE 0x0803 /* Added 1.8 */ -#define MSG_FORMATMEDIA 0x0804 /* Added 1.8 */ -#define MSG_GETCLOSE 0x0805 /* Added 1.8 */ -#define MSG_GETFIRSTFILE 0x0806 /* Added 1.8 */ -#define MSG_GETINFO 0x0807 /* Added 1.8 */ -#define MSG_GETNEXTFILE 0x0808 /* Added 1.8 */ -#define MSG_RENAME 0x0809 /* Added 1.8 */ -#define MSG_COPY 0x080A /* Added 1.8 */ -#define MSG_AUTOMATICCAPTUREDIRECTORY 0x080B /* Added 1.8 */ - -/* Messages used with a pointer to a DAT_PASSTHRU structure */ -#define MSG_PASSTHRU 0x0901 - -/* used with DAT_CALLBACK */ -#define MSG_REGISTER_CALLBACK 0x0902 - -/* used with DAT_CAPABILITY */ -#define MSG_RESETALL 0x0A01 /* Added 1.91 */ - -/**************************************************************************** - * Capabilities * - ****************************************************************************/ - -#define CAP_CUSTOMBASE 0x8000 /* Base of custom capabilities */ - -/* all data sources are REQUIRED to support these caps */ -#define CAP_XFERCOUNT 0x0001 - -/* image data sources are REQUIRED to support these caps */ -#define ICAP_COMPRESSION 0x0100 -#define ICAP_PIXELTYPE 0x0101 -#define ICAP_UNITS 0x0102 /* default is TWUN_INCHES */ -#define ICAP_XFERMECH 0x0103 - -/* all data sources MAY support these caps */ -#define CAP_AUTHOR 0x1000 -#define CAP_CAPTION 0x1001 -#define CAP_FEEDERENABLED 0x1002 -#define CAP_FEEDERLOADED 0x1003 -#define CAP_TIMEDATE 0x1004 -#define CAP_SUPPORTEDCAPS 0x1005 -#define CAP_EXTENDEDCAPS 0x1006 -#define CAP_AUTOFEED 0x1007 -#define CAP_CLEARPAGE 0x1008 -#define CAP_FEEDPAGE 0x1009 -#define CAP_REWINDPAGE 0x100a -#define CAP_INDICATORS 0x100b /* Added 1.1 */ -#define CAP_SUPPORTEDCAPSEXT 0x100c /* Added 1.6 */ -#define CAP_PAPERDETECTABLE 0x100d /* Added 1.6 */ -#define CAP_UICONTROLLABLE 0x100e /* Added 1.6 */ -#define CAP_DEVICEONLINE 0x100f /* Added 1.6 */ -#define CAP_AUTOSCAN 0x1010 /* Added 1.6 */ -#define CAP_THUMBNAILSENABLED 0x1011 /* Added 1.7 */ -#define CAP_DUPLEX 0x1012 /* Added 1.7 */ -#define CAP_DUPLEXENABLED 0x1013 /* Added 1.7 */ -#define CAP_ENABLEDSUIONLY 0x1014 /* Added 1.7 */ -#define CAP_CUSTOMDSDATA 0x1015 /* Added 1.7 */ -#define CAP_ENDORSER 0x1016 /* Added 1.7 */ -#define CAP_JOBCONTROL 0x1017 /* Added 1.7 */ -#define CAP_ALARMS 0x1018 /* Added 1.8 */ -#define CAP_ALARMVOLUME 0x1019 /* Added 1.8 */ -#define CAP_AUTOMATICCAPTURE 0x101a /* Added 1.8 */ -#define CAP_TIMEBEFOREFIRSTCAPTURE 0x101b /* Added 1.8 */ -#define CAP_TIMEBETWEENCAPTURES 0x101c /* Added 1.8 */ -#define CAP_CLEARBUFFERS 0x101d /* Added 1.8 */ -#define CAP_MAXBATCHBUFFERS 0x101e /* Added 1.8 */ -#define CAP_DEVICETIMEDATE 0x101f /* Added 1.8 */ -#define CAP_POWERSUPPLY 0x1020 /* Added 1.8 */ -#define CAP_CAMERAPREVIEWUI 0x1021 /* Added 1.8 */ -#define CAP_DEVICEEVENT 0x1022 /* Added 1.8 */ -#define CAP_SERIALNUMBER 0x1024 /* Added 1.8 */ -#define CAP_PRINTER 0x1026 /* Added 1.8 */ -#define CAP_PRINTERENABLED 0x1027 /* Added 1.8 */ -#define CAP_PRINTERINDEX 0x1028 /* Added 1.8 */ -#define CAP_PRINTERMODE 0x1029 /* Added 1.8 */ -#define CAP_PRINTERSTRING 0x102a /* Added 1.8 */ -#define CAP_PRINTERSUFFIX 0x102b /* Added 1.8 */ -#define CAP_LANGUAGE 0x102c /* Added 1.8 */ -#define CAP_FEEDERALIGNMENT 0x102d /* Added 1.8 */ -#define CAP_FEEDERORDER 0x102e /* Added 1.8 */ -#define CAP_REACQUIREALLOWED 0x1030 /* Added 1.8 */ -#define CAP_BATTERYMINUTES 0x1032 /* Added 1.8 */ -#define CAP_BATTERYPERCENTAGE 0x1033 /* Added 1.8 */ -#define CAP_CAMERASIDE 0x1034 /* Added 1.91 */ -#define CAP_SEGMENTED 0x1035 /* Added 1.91 */ -#define CAP_CAMERAENABLED 0x1036 /* Added 2.0 */ -#define CAP_CAMERAORDER 0x1037 /* Added 2.0 */ -#define CAP_MICRENABLED 0x1038 /* Added 2.0 */ -#define CAP_FEEDERPREP 0x1039 /* Added 2.0 */ -#define CAP_FEEDERPOCKET 0x103a /* Added 2.0 */ -#define CAP_AUTOMATICSENSEMEDIUM 0x103b /* Added 2.1 */ -#define CAP_CUSTOMINTERFACEGUID 0x103c /* Added 2.1 */ - - -/* image data sources MAY support these caps */ -#define ICAP_AUTOBRIGHT 0x1100 -#define ICAP_BRIGHTNESS 0x1101 -#define ICAP_CONTRAST 0x1103 -#define ICAP_CUSTHALFTONE 0x1104 -#define ICAP_EXPOSURETIME 0x1105 -#define ICAP_FILTER 0x1106 -#define ICAP_FLASHUSED 0x1107 -#define ICAP_GAMMA 0x1108 -#define ICAP_HALFTONES 0x1109 -#define ICAP_HIGHLIGHT 0x110a -#define ICAP_IMAGEFILEFORMAT 0x110c -#define ICAP_LAMPSTATE 0x110d -#define ICAP_LIGHTSOURCE 0x110e -#define ICAP_ORIENTATION 0x1110 -#define ICAP_PHYSICALWIDTH 0x1111 -#define ICAP_PHYSICALHEIGHT 0x1112 -#define ICAP_SHADOW 0x1113 -#define ICAP_FRAMES 0x1114 -#define ICAP_XNATIVERESOLUTION 0x1116 -#define ICAP_YNATIVERESOLUTION 0x1117 -#define ICAP_XRESOLUTION 0x1118 -#define ICAP_YRESOLUTION 0x1119 -#define ICAP_MAXFRAMES 0x111a -#define ICAP_TILES 0x111b -#define ICAP_BITORDER 0x111c -#define ICAP_CCITTKFACTOR 0x111d -#define ICAP_LIGHTPATH 0x111e -#define ICAP_PIXELFLAVOR 0x111f -#define ICAP_PLANARCHUNKY 0x1120 -#define ICAP_ROTATION 0x1121 -#define ICAP_SUPPORTEDSIZES 0x1122 -#define ICAP_THRESHOLD 0x1123 -#define ICAP_XSCALING 0x1124 -#define ICAP_YSCALING 0x1125 -#define ICAP_BITORDERCODES 0x1126 -#define ICAP_PIXELFLAVORCODES 0x1127 -#define ICAP_JPEGPIXELTYPE 0x1128 -#define ICAP_TIMEFILL 0x112a -#define ICAP_BITDEPTH 0x112b -#define ICAP_BITDEPTHREDUCTION 0x112c /* Added 1.5 */ -#define ICAP_UNDEFINEDIMAGESIZE 0x112d /* Added 1.6 */ -#define ICAP_IMAGEDATASET 0x112e /* Added 1.7 */ -#define ICAP_EXTIMAGEINFO 0x112f /* Added 1.7 */ -#define ICAP_MINIMUMHEIGHT 0x1130 /* Added 1.7 */ -#define ICAP_MINIMUMWIDTH 0x1131 /* Added 1.7 */ -#define ICAP_AUTODISCARDBLANKPAGES 0x1134 /* Added 2.0 */ -#define ICAP_FLIPROTATION 0x1136 /* Added 1.8 */ -#define ICAP_BARCODEDETECTIONENABLED 0x1137 /* Added 1.8 */ -#define ICAP_SUPPORTEDBARCODETYPES 0x1138 /* Added 1.8 */ -#define ICAP_BARCODEMAXSEARCHPRIORITIES 0x1139 /* Added 1.8 */ -#define ICAP_BARCODESEARCHPRIORITIES 0x113a /* Added 1.8 */ -#define ICAP_BARCODESEARCHMODE 0x113b /* Added 1.8 */ -#define ICAP_BARCODEMAXRETRIES 0x113c /* Added 1.8 */ -#define ICAP_BARCODETIMEOUT 0x113d /* Added 1.8 */ -#define ICAP_ZOOMFACTOR 0x113e /* Added 1.8 */ -#define ICAP_PATCHCODEDETECTIONENABLED 0x113f /* Added 1.8 */ -#define ICAP_SUPPORTEDPATCHCODETYPES 0x1140 /* Added 1.8 */ -#define ICAP_PATCHCODEMAXSEARCHPRIORITIES 0x1141 /* Added 1.8 */ -#define ICAP_PATCHCODESEARCHPRIORITIES 0x1142 /* Added 1.8 */ -#define ICAP_PATCHCODESEARCHMODE 0x1143 /* Added 1.8 */ -#define ICAP_PATCHCODEMAXRETRIES 0x1144 /* Added 1.8 */ -#define ICAP_PATCHCODETIMEOUT 0x1145 /* Added 1.8 */ -#define ICAP_FLASHUSED2 0x1146 /* Added 1.8 */ -#define ICAP_IMAGEFILTER 0x1147 /* Added 1.8 */ -#define ICAP_NOISEFILTER 0x1148 /* Added 1.8 */ -#define ICAP_OVERSCAN 0x1149 /* Added 1.8 */ -#define ICAP_AUTOMATICBORDERDETECTION 0x1150 /* Added 1.8 */ -#define ICAP_AUTOMATICDESKEW 0x1151 /* Added 1.8 */ -#define ICAP_AUTOMATICROTATE 0x1152 /* Added 1.8 */ -#define ICAP_JPEGQUALITY 0x1153 /* Added 1.9 */ -#define ICAP_FEEDERTYPE 0x1154 /* Added 1.91 */ -#define ICAP_ICCPROFILE 0x1155 /* Added 1.91 */ -#define ICAP_AUTOSIZE 0x1156 /* Added 2.0 */ -#define ICAP_AUTOMATICCROPUSESFRAME 0x1157 /* Added 2.1 */ -#define ICAP_AUTOMATICLENGTHDETECTION 0x1158 /* Added 2.1 */ -#define ICAP_AUTOMATICCOLORENABLED 0x1159 /* Added 2.1 */ -#define ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE 0x115a /* Added 2.1 */ -#define ICAP_COLORMANAGEMENTENABLED 0x115b /* Added 2.1 */ -#define ICAP_IMAGEMERGE 0x115c /* Added 2.1 */ -#define ICAP_IMAGEMERGEHEIGHTTHRESHOLD 0x115d /* Added 2.1 */ -#define ICAP_SUPPORTEDEXTIMAGEINFO 0x115e /* Added 2.1 */ - -/* image data sources MAY support these audio caps */ -#define ACAP_XFERMECH 0x1202 /* Added 1.8 */ - - -/*************************************************************************** - * Extended Image Info Attributes section Added 1.7 * - ***************************************************************************/ - -#define TWEI_BARCODEX 0x1200 -#define TWEI_BARCODEY 0x1201 -#define TWEI_BARCODETEXT 0x1202 -#define TWEI_BARCODETYPE 0x1203 -#define TWEI_DESHADETOP 0x1204 -#define TWEI_DESHADELEFT 0x1205 -#define TWEI_DESHADEHEIGHT 0x1206 -#define TWEI_DESHADEWIDTH 0x1207 -#define TWEI_DESHADESIZE 0x1208 -#define TWEI_SPECKLESREMOVED 0x1209 -#define TWEI_HORZLINEXCOORD 0x120A -#define TWEI_HORZLINEYCOORD 0x120B -#define TWEI_HORZLINELENGTH 0x120C -#define TWEI_HORZLINETHICKNESS 0x120D -#define TWEI_VERTLINEXCOORD 0x120E -#define TWEI_VERTLINEYCOORD 0x120F -#define TWEI_VERTLINELENGTH 0x1210 -#define TWEI_VERTLINETHICKNESS 0x1211 -#define TWEI_PATCHCODE 0x1212 -#define TWEI_ENDORSEDTEXT 0x1213 -#define TWEI_FORMCONFIDENCE 0x1214 -#define TWEI_FORMTEMPLATEMATCH 0x1215 -#define TWEI_FORMTEMPLATEPAGEMATCH 0x1216 -#define TWEI_FORMHORZDOCOFFSET 0x1217 -#define TWEI_FORMVERTDOCOFFSET 0x1218 -#define TWEI_BARCODECOUNT 0x1219 -#define TWEI_BARCODECONFIDENCE 0x121A -#define TWEI_BARCODEROTATION 0x121B -#define TWEI_BARCODETEXTLENGTH 0x121C -#define TWEI_DESHADECOUNT 0x121D -#define TWEI_DESHADEBLACKCOUNTOLD 0x121E -#define TWEI_DESHADEBLACKCOUNTNEW 0x121F -#define TWEI_DESHADEBLACKRLMIN 0x1220 -#define TWEI_DESHADEBLACKRLMAX 0x1221 -#define TWEI_DESHADEWHITECOUNTOLD 0x1222 -#define TWEI_DESHADEWHITECOUNTNEW 0x1223 -#define TWEI_DESHADEWHITERLMIN 0x1224 -#define TWEI_DESHADEWHITERLAVE 0x1225 -#define TWEI_DESHADEWHITERLMAX 0x1226 -#define TWEI_BLACKSPECKLESREMOVED 0x1227 -#define TWEI_WHITESPECKLESREMOVED 0x1228 -#define TWEI_HORZLINECOUNT 0x1229 -#define TWEI_VERTLINECOUNT 0x122A -#define TWEI_DESKEWSTATUS 0x122B -#define TWEI_SKEWORIGINALANGLE 0x122C -#define TWEI_SKEWFINALANGLE 0x122D -#define TWEI_SKEWCONFIDENCE 0x122E -#define TWEI_SKEWWINDOWX1 0x122F -#define TWEI_SKEWWINDOWY1 0x1230 -#define TWEI_SKEWWINDOWX2 0x1231 -#define TWEI_SKEWWINDOWY2 0x1232 -#define TWEI_SKEWWINDOWX3 0x1233 -#define TWEI_SKEWWINDOWY3 0x1234 -#define TWEI_SKEWWINDOWX4 0x1235 -#define TWEI_SKEWWINDOWY4 0x1236 -#define TWEI_BOOKNAME 0x1238 /* added 1.9 */ -#define TWEI_CHAPTERNUMBER 0x1239 /* added 1.9 */ -#define TWEI_DOCUMENTNUMBER 0x123A /* added 1.9 */ -#define TWEI_PAGENUMBER 0x123B /* added 1.9 */ -#define TWEI_CAMERA 0x123C /* added 1.9 */ -#define TWEI_FRAMENUMBER 0x123D /* added 1.9 */ -#define TWEI_FRAME 0x123E /* added 1.9 */ -#define TWEI_PIXELFLAVOR 0x123F /* added 1.9 */ -#define TWEI_ICCPROFILE 0x1240 /* added 1.91 */ -#define TWEI_LASTSEGMENT 0x1241 /* added 1.91 */ -#define TWEI_SEGMENTNUMBER 0x1242 /* added 1.91 */ -#define TWEI_MAGDATA 0x1243 /* added 2.0 */ -#define TWEI_MAGTYPE 0x1244 /* added 2.0 */ -#define TWEI_PAGESIDE 0x1245 /* added 2.0 */ -#define TWEI_FILESYSTEMSOURCE 0x1246 /* added 2.0 */ -#define TWEI_IMAGEMERGED 0x1247 /* added 2.1 */ -#define TWEI_MAGDATALENGTH 0x1248 /* added 2.1 */ - -#define TWEJ_NONE 0x0000 -#define TWEJ_MIDSEPARATOR 0x0001 -#define TWEJ_PATCH1 0x0002 -#define TWEJ_PATCH2 0x0003 -#define TWEJ_PATCH3 0x0004 -#define TWEJ_PATCH4 0x0005 -#define TWEJ_PATCH6 0x0006 -#define TWEJ_PATCHT 0x0007 - - -/*************************************************************************** - * Return Codes and Condition Codes section * - ***************************************************************************/ - -/* Return Codes: DSM_Entry and DS_Entry may return any one of these values. */ -#define TWRC_CUSTOMBASE 0x8000 - -#define TWRC_SUCCESS 0 -#define TWRC_FAILURE 1 /* Application may get TW_STATUS for info on failure */ -#define TWRC_CHECKSTATUS 2 /* "tried hard"; get status */ -#define TWRC_CANCEL 3 -#define TWRC_DSEVENT 4 -#define TWRC_NOTDSEVENT 5 -#define TWRC_XFERDONE 6 -#define TWRC_ENDOFLIST 7 /* After MSG_GETNEXT if nothing left */ -#define TWRC_INFONOTSUPPORTED 8 -#define TWRC_DATANOTAVAILABLE 9 - -/* Condition Codes: Application gets these by doing DG_CONTROL DAT_STATUS MSG_GET. */ -#define TWCC_CUSTOMBASE 0x8000 - -#define TWCC_SUCCESS 0 /* It worked! */ -#define TWCC_BUMMER 1 /* Failure due to unknown causes */ -#define TWCC_LOWMEMORY 2 /* Not enough memory to perform operation */ -#define TWCC_NODS 3 /* No Data Source */ -#define TWCC_MAXCONNECTIONS 4 /* DS is connected to max possible applications */ -#define TWCC_OPERATIONERROR 5 /* DS or DSM reported error, application shouldn't */ -#define TWCC_BADCAP 6 /* Unknown capability */ -#define TWCC_BADPROTOCOL 9 /* Unrecognized MSG DG DAT combination */ -#define TWCC_BADVALUE 10 /* Data parameter out of range */ -#define TWCC_SEQERROR 11 /* DG DAT MSG out of expected sequence */ -#define TWCC_BADDEST 12 /* Unknown destination Application/Source in DSM_Entry */ -#define TWCC_CAPUNSUPPORTED 13 /* Capability not supported by source */ -#define TWCC_CAPBADOPERATION 14 /* Operation not supported by capability */ -#define TWCC_CAPSEQERROR 15 /* Capability has dependancy on other capability */ -#define TWCC_DENIED 16 /* File System operation is denied (file is protected) Added 1.8 */ -#define TWCC_FILEEXISTS 17 /* Operation failed because file already exists. Added 1.8 */ -#define TWCC_FILENOTFOUND 18 /* File not found Added 1.8 */ -#define TWCC_NOTEMPTY 19 /* Operation failed because directory is not empty Added 1.8 */ -#define TWCC_PAPERJAM 20 /* The feeder is jammed Added 1.8 */ -#define TWCC_PAPERDOUBLEFEED 21 /* The feeder detected multiple pages Added 1.8 */ -#define TWCC_FILEWRITEERROR 22 /* Error writing the file (meant for things like disk full conditions)Added 1.8 */ -#define TWCC_CHECKDEVICEONLINE 23 /* The device went offline prior to or during this operation Added 1.8 */ -#define TWCC_INTERLOCK 24 /* Added 2.0 */ -#define TWCC_DAMAGEDCORNER 25 /* Added 2.0 */ -#define TWCC_FOCUSERROR 26 /* Added 2.0 */ -#define TWCC_DOCTOOLIGHT 27 /* Added 2.0 */ -#define TWCC_DOCTOODARK 28 /* Added 2.0 */ -#define TWCC_NOMEDIA 29 /* Added 2.1 */ - -/* bit patterns: for query the operation that are supported by the data source on a capability */ -/* Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT */ -/* Added 1.6 */ -#define TWQC_GET 0x0001 -#define TWQC_SET 0x0002 -#define TWQC_GETDEFAULT 0x0004 -#define TWQC_GETCURRENT 0x0008 -#define TWQC_RESET 0x0010 - - -/**************************************************************************** - * Depreciated Items * - ****************************************************************************/ -#if defined(WIN32) || defined(WIN64) - #define TW_HUGE -#elif !defined(TWH_CMP_GNU) - #define TW_HUGE huge -#else - #define TW_HUGE -#endif - - - -typedef BYTE TW_HUGE * HPBYTE; -typedef void TW_HUGE * HPVOID; - -typedef unsigned char TW_STR1024[1026], FAR *pTW_STR1026; -typedef wchar_t TW_UNI512[512], FAR *pTW_UNI512; - -#define TWTY_STR1024 0x000d /* Means Item is a TW_STR1024...added 1.9 */ -#define TWTY_UNI512 0x000e /* Means Item is a TW_UNI512...added 1.9 */ - -#define TWFF_JPN 12 /* 1.91 */ - -#define DAT_TWUNKIDENTITY 0x000b /* Additional message required for thunker to request the special identity information. */ -#define DAT_SETUPFILEXFER2 0x0301 /* Data transfer via a file. deprecated - use DAT_SETUPFILEXFER instead*/ - -#define CAP_SUPPORTEDCAPSEXT 0x100c -#define CAP_FILESYSTEM //0x???? -#define CAP_PAGEMULTIPLEACQUIRE 0x1023 /* Added 1.8 */ -#define CAP_PAPERBINDING 0x102f /* Added 1.8 */ -#define CAP_PASSTHRU 0x1031 /* Added 1.8 */ -#define CAP_POWERDOWNTIME 0x1034 /* Added 1.8 */ //0x1034 is reused by CAP_CAMERASIDE -#define ACAP_AUDIOFILEFORMAT 0x1201 /* Added 1.8 */ - -#define MSG_CHECKSTATUS 0x0201 /* Get status information - use MSG_GET instead */ - -#define MSG_INVOKE_CALLBACK 0x0903 /* Mac Only, deprecated - use DAT_NULL and MSG_xxx instead */ - -#define TWSX_FILE2 3 - -/* CAP_FILESYSTEM values (FS_ means file system) */ -#define TWFS_FILESYSTEM 0 -#define TWFS_RECURSIVEDELETE 1 - -/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */ -#define TWPT_SRGB64 11 /* 1.91 */ -#define TWPT_BGR 12 /* 1.91 */ -#define TWPT_CIELAB 13 /* 1.91 */ -#define TWPT_CIELUV 14 /* 1.91 */ -#define TWPT_YCBCR 15 /* 1.91 */ - -/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */ -#define TWSS_B 8 -#define TWSS_A4LETTER TWSS_A4 /* use TWSS_A4 instead */ -#define TWSS_B3 TWSS_ISOB3 /* use TWSS_ISOB3 instead */ -#define TWSS_B4 TWSS_ISOB4 /* use TWSS_ISOB4 instead */ -#define TWSS_B6 TWSS_ISOB6 /* use TWSS_ISOB6 instead */ -#define TWSS_B5LETTER TWSS_JISB5 /* use TWSS_JISB5 instead */ - -/* CAP_LANGUAGE Language Constants */ -#define TWLG_DAN TWLG_DANISH /* use TWLG_DANISH instead */ -#define TWLG_DUT TWLG_DUTCH /* use TWLG_DUTCH instead */ -#define TWLG_ENG TWLG_ENGLISH /* use TWLG_ENGLISH instead */ -#define TWLG_USA TWLG_ENGLISH_USA /* use TWLG_ENGLISH_USA instead */ -#define TWLG_FIN TWLG_FINNISH /* use TWLG_FINNISH instead */ -#define TWLG_FRN TWLG_FRENCH /* use TWLG_FRENCH instead */ -#define TWLG_FCF TWLG_FRENCH_CANADIAN /* use TWLG_FRENCH_CANADIAN instead */ -#define TWLG_GER TWLG_GERMAN /* use TWLG_GERMAN instead */ -#define TWLG_ICE TWLG_ICELANDIC /* use TWLG_ICELANDIC instead */ -#define TWLG_ITN TWLG_ITALIAN /* use TWLG_ITALIAN instead */ -#define TWLG_NOR TWLG_NORWEGIAN /* use TWLG_NORWEGIAN instead */ -#define TWLG_POR TWLG_PORTUGUESE /* use TWLG_PORTUGUESE instead */ -#define TWLG_SPA TWLG_SPANISH /* use TWLG_SPANISH instead */ -#define TWLG_SWE TWLG_SWEDISH /* use TWLG_SWEDISH instead */ - - -/* ACAP_AUDIOFILEFORMAT values (AF_ means audio format). Added 1.8 */ -#define TWAF_WAV 0 -#define TWAF_AIFF 1 -#define TWAF_AU 3 -#define TWAF_SND 4 - - -/* DAT_SETUPFILEXFER2. Sets up DS to application data transfer via a file. Added 1.9 */ -typedef struct { - TW_MEMREF FileName; /* Pointer to file name text */ - TW_UINT16 FileNameType; /* TWTY_STR1024 or TWTY_UNI512 */ - TW_UINT16 Format; /* Any TWFF_ constant */ - TW_INT16 VRefNum; /* Used for Mac only */ - TW_UINT32 parID; /* Used for Mac only */ -} TW_SETUPFILEXFER2, FAR * pTW_SETUPFILEXFER2; - -/* SDH - 03/21/95 - TWUNK */ -/* DAT_TWUNKIDENTITY. Provides DS identity and 'other' information necessary */ -/* across thunk link. */ -typedef struct { - TW_IDENTITY identity; /* Identity of data source. */ - TW_STR255 dsPath; /* Full path and file name of data source. */ -} TW_TWUNKIDENTITY, FAR * pTW_TWUNKIDENTITY; - -/* SDH - 03/21/95 - TWUNK */ -/* Provides DS_Entry parameters over thunk link. */ -/* SDH - 03/23/95 - WATCH */ -/* The thunker requires knowledge about size of data being passed in the */ -/* lpData parameter to DS_Entry (which is not readily available due to */ -/* type LPVOID. Thus, we key off the DAT_ argument to determine the size. */ -/* This has a couple implications: */ -/* 1) Any additional DAT_ features require modifications to the thunk code */ -/* for thunker support. */ -/* 2) Any applications which use the custom capabailites are not supported */ -/* under thunking since we have no way of knowing what size data (if */ -/* any) is being passed. */ -typedef struct -{ - TW_INT8 destFlag; /* TRUE if dest is not NULL */ - TW_IDENTITY dest; /* Identity of data source (if used) */ - TW_INT32 dataGroup; /* DSM_Entry dataGroup parameter */ - TW_INT16 dataArgType; /* DSM_Entry dataArgType parameter */ - TW_INT16 message; /* DSM_Entry message parameter */ - TW_INT32 pDataSize; /* Size of pData (0 if NULL) */ - // TW_MEMREF pData; /* Based on implementation specifics, a */ - /* pData parameter makes no sense in this */ - /* structure, but data (if provided) will be*/ - /* appended in the data block. */ -} TW_TWUNKDSENTRYPARAMS, FAR * pTW_TWUNKDSENTRYPARAMS; - -/* SDH - 03/21/95 - TWUNK */ -/* Provides DS_Entry results over thunk link. */ -typedef struct -{ - TW_UINT16 returnCode; /* Thunker DsEntry return code. */ - TW_UINT16 conditionCode; /* Thunker DsEntry condition code. */ - TW_INT32 pDataSize; /* Size of pData (0 if NULL) */ - // TW_MEMREF pData; /* Based on implementation specifics, a */ - /* pData parameter makes no sense in this */ - /* structure, but data (if provided) will be*/ - /* appended in the data block. */ -} TW_TWUNKDSENTRYRETURN, FAR * pTW_TWUNKDSENTRYRETURN; - -/* WJD - 950818 */ -/* Added for 1.6 Specification */ -/* TWAIN 1.6 CAP_SUPPORTEDCAPSEXT structure */ -typedef struct -{ - TW_UINT16 Cap; /* Which CAP/ICAP info is relevant to */ - TW_UINT16 Properties; /* Messages this CAP/ICAP supports */ -} TW_CAPEXT, FAR * pTW_CAPEXT; - -/* DAT_SETUPAUDIOFILEXFER, information required to setup an audio file transfer */ -typedef struct { - TW_STR255 FileName; /* full path target file */ - TW_UINT16 Format; /* one of TWAF_xxxx */ - TW_INT16 VRefNum; -} TW_SETUPAUDIOFILEXFER, FAR * pTW_SETUPAUDIOFILEXFER; - - -/**************************************************************************** - * Entry Points * - ****************************************************************************/ - -/********************************************************************** - * Function: DSM_Entry, the only entry point into the Data Source Manager. - * - * Parameters: - * pOrigin Identifies the source module of the message. This could - * identify an Application, a Source, or the Source Manager. - * - * pDest Identifies the destination module for the message. - * This could identify an application or a data source. - * If this is NULL, the message goes to the Source Manager. - * - * DG The Data Group. - * Example: DG_IMAGE. - * - * DAT The Data Attribute Type. - * Example: DAT_IMAGEMEMXFER. - * - * MSG The message. Messages are interpreted by the destination module - * with respect to the Data Group and the Data Attribute Type. - * Example: MSG_GET. - * - * pData A pointer to the data structure or variable identified - * by the Data Attribute Type. - * Example: (TW_MEMREF)&ImageMemXfer - * where ImageMemXfer is a TW_IMAGEMEMXFER structure. - * - * Returns: - * ReturnCode - * Example: TWRC_SUCCESS. - * - ********************************************************************/ - -/* Don't mangle the name "DSM_Entry" if we're compiling in C++! */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifdef TWH_CMP_MSC - - TW_UINT16 FAR PASCAL DSM_Entry( pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - - typedef TW_UINT16 (FAR PASCAL *DSMENTRYPROC)(pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -#else - - FAR PASCAL TW_UINT16 DSM_Entry( pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - - typedef TW_UINT16 (*DSMENTRYPROC)(pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -#endif /* TWH_CMP_MSC */ - -#ifdef __cplusplus -} -#endif /* cplusplus */ - - -/********************************************************************** - * Function: DS_Entry, the entry point provided by a Data Source. - * - * Parameters: - * pOrigin Identifies the source module of the message. This could - * identify an application or the Data Source Manager. - * - * DG The Data Group. - * Example: DG_IMAGE. - * - * DAT The Data Attribute Type. - * Example: DAT_IMAGEMEMXFER. - * - * MSG The message. Messages are interpreted by the data source - * with respect to the Data Group and the Data Attribute Type. - * Example: MSG_GET. - * - * pData A pointer to the data structure or variable identified - * by the Data Attribute Type. - * Example: (TW_MEMREF)&ImageMemXfer - * where ImageMemXfer is a TW_IMAGEMEMXFER structure. - * - * Returns: - * ReturnCode - * Example: TWRC_SUCCESS. - * - * Note: - * The DSPROC type is only used by an application when it calls - * a Data Source directly, bypassing the Data Source Manager. - * - ********************************************************************/ -/* Don't mangle the name "DS_Entry" if we're compiling in C++! */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifdef TWH_CMP_MSC - - TW_UINT16 FAR PASCAL DS_Entry(pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - - typedef TW_UINT16 (FAR PASCAL *DSENTRYPROC)(pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -#else - - FAR PASCAL TW_UINT16 DS_Entry(pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - - typedef TW_UINT16 (*DSENTRYPROC)(pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -#endif /* TWH_CMP_MSC */ - - - typedef TW_HANDLE (PASCAL *DSM_MEMALLOCATE)(TW_UINT32 _size); - typedef void (PASCAL *DSM_MEMFREE)(TW_HANDLE _handle); - typedef TW_MEMREF (PASCAL *DSM_MEMLOCK)(TW_HANDLE _handle); - typedef void (PASCAL *DSM_MEMUNLOCK)(TW_HANDLE _handle); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -/* DAT_ENTRYPOINT. returns essential entry points. */ -typedef struct { - TW_UINT32 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; - -/* Restore the previous packing alignment: this occurs after all structures are defined */ -#ifdef TWH_CMP_MSC - #pragma pack (pop, before_twain) -#elif defined(TWH_CMP_GNU) - #pragma pack (pop, before_twain) -#elif defined(TWH_CMP_BORLAND) - #pragma option a. -#elif defined(TWH_CMP_XCODE) - #if PRAGMA_STRUCT_ALIGN - #pragma options align=reset - #elif PRAGMA_STRUCT_PACKPUSH - #pragma pack (pop) - #elif PRAGMA_STRUCT_PACK - #pragma pack() - #endif -#endif - -#endif /* TWAIN */ diff --git a/twain-doc/twain2.2.h b/twain-doc/twain2.2.h deleted file mode 100644 index e86ea64..0000000 --- a/twain-doc/twain2.2.h +++ /dev/null @@ -1,2172 +0,0 @@ -/* ======================================================================== *\ - - Copyright (C) 2007 TWAIN Working Group: Adobe Systems Incorporated, - AnyDoc Software Inc., Eastman Kodak Company, Fujitsu Computer Products - of America, JFL Peripheral Solutions Inc., Ricoh Corporation, and - Xerox Corporation. All rights reserved. - - Copyright (C) 1991, 1992 TWAIN Working Group: Aldus, Caere, Eastman-Kodak, - Hewlett-Packard and Logitech Corporations. All rights reserved. - - Copyright (C) 1997 TWAIN Working Group: Bell+Howell, Canon, DocuMagix, - Fujitsu, Genoa Technology, Hewlett-Packard, Kofax Imaging Products, and - Ricoh Corporation. All rights reserved. - - Copyright 1998 TWAIN Working Group: Adobe Systems Incorporated, - Canon Information Systems, Eastman Kodak Company, - Fujitsu Computer Products of America, Genoa Technology, - Hewlett-Packard Company, Intel Corporation, Kofax Image Products, - JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. - All rights reserved. - - Copyright 2000 TWAIN Working Group: Adobe Systems Incorporated, - Canon Information Systems, Digimarc Corporation, Eastman Kodak Company, - Fujitsu Computer Products of America, Hewlett-Packard Company, - JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. - All rights reserved. - - - TWAIN.h - This is the definitive include file for applications and - data sources written to the TWAIN specification. - It defines constants, data structures, messages etc. - for the public interface to TWAIN. - - Revision History: - version 1.0, March 6, 1992. TWAIN 1.0. - version 1.1, January 1993. Tech Notes 1.1 - version 1.5, June 1993. Specification Update 1.5 - Change DC to TW - Change filename from DC.H to TWAIN.H - version 1.5, July 1993. Remove spaces from country identifiers - - version 1.7, July 1997 Added Capabilities and data structure for - document imaging and digital cameras. - KHL. - version 1.7, July 1997 Inserted Borland compatibile structure packing - directives provided by Mentor. JMH - version 1.7, Aug 1997 Expanded file tabs to spaces. - NOTE: future authors should be sure to have - their editors set to automatically expand tabs - to spaces (original tab setting was 4 spaces). - version 1.7, Sept 1997 Added job control values - Added return codes - version 1.7, Sept 1997 changed definition of pRGBRESPONSE to - pTW_RGBRESPONSE - version 1.7 Aug 1998 Added missing TWEI_BARCODEROTATION values - TWBCOR_ types JMH - version 1.8 August 1998 Added new types and definitions required - for 1.8 Specification JMH - version 1.8 January 1999 Changed search mode from SRCH_ to TWBD_ as - in 1.8 Specification, added TWBT_MAXICODE JMH - version 1.8 January 1999 Removed undocumented duplicate AUTO JMH - version 1.8 March 1999 Removed undocumented 1.8 caps: - CAP_FILESYSTEM - CAP_PAPERBINDING - CAP_PASSTHRU - CAP_POWERDOWNTIME - ICAP_AUTODISCARDBLANKPAGES - * CAP_PAGEMULTIPLEACQUIRE - is CAP_REACQUIREALLOWED, - requires spec change. JMH - Added Mac structure packing modifications JMH - version 1.9 March 2000 Added new types and definations required - for 1.9 Specification MLM - version 1.9 March 2000 Added ICAP_JPEGQUALITY, TWJQ_ values, - updated TWON_PROTOCOLMINOR for Release v1.9 MN - version 1.91 August 2007 Added new types and definitions required - for 1.91 Specification MLM - version 2.0 Sept 2007 Added new types and definitions required - for 2.0 Specification FHH - version 2.0 Mar 2008 Depreciated ICAP_PIXELTYPEs TWPT_SRGB64, TWPT_BGR, - TWPT_CIELAB, TWPT_CIELUV, and TWPT_YCBCR JMW - version 2.0 Mar 2008 Added missing new 2.0 CAP_ definitions JMW - version 2.0 Dec 2008 Updated TW_INFO structure for 64bit JMW - version 2.1 Mar 2009 Added new types and definitions required - for 2.1 Specification JMW - version 2.2 Nov 2010 Added new types and definitions required - for 2.2 Specification MSM -\* ======================================================================== */ - -#ifndef TWAIN -#define TWAIN - -/**************************************************************************** - * TWAIN Version * - ****************************************************************************/ -#define TWON_PROTOCOLMINOR 2 /* Changed for Version 2.2 */ -#define TWON_PROTOCOLMAJOR 2 - -/**************************************************************************** - * Platform Dependent Definitions and Typedefs * - ****************************************************************************/ - -/* Microsoft C/C++ Compiler */ -#if defined(WIN32) || defined(WIN64) || defined (_WINDOWS) - #define TWH_CMP_MSC - #if defined(_WIN64) || defined(WIN64) - #define TWH_64BIT - #elif defined(WIN32) || defined(_WIN32) - #define TWH_32BIT - #endif - -/* GNU C/C++ Compiler */ -#elif defined(__GNUC__) - #define TWH_CMP_GNU - #if defined(__alpha__)\ - ||defined(__ia64__)\ - ||defined(__ppc64__)\ - ||defined(__s390x__)\ - ||defined(__x86_64__) - #define TWH_64BIT - #else - #define TWH_32BIT - #endif - - -/* Borland C/C++ Compiler */ -#elif defined(__BORLAND__) - #define TWH_CMP_BORLAND - #define TWH_32BIT -/* Unrecognized */ -#else - #error Unrecognized compiler -#endif - -/* Apple Compiler (which is GNU now) */ -#if defined(__APPLE__) - #define TWH_CMP_XCODE - #ifdef __MWERKS__ - #include - #else - #include - #endif -#endif - -/* Win32 and Win64 systems */ -#if defined(TWH_CMP_MSC) | defined(TWH_CMP_BORLAND) - typedef HANDLE TW_HANDLE; - typedef LPVOID TW_MEMREF; - typedef UINT_PTR TW_UINTPTR; - -/* MacOS/X... */ -#elif defined(TWH_CMP_XCODE) - #define PASCAL pascal - #define FAR - typedef Handle TW_HANDLE; - typedef char *TW_MEMREF; - typedef unsigned char BYTE; - - #ifdef TWH_32BIT - //32 bit GNU - typedef unsigned long TW_UINTPTR; - #else - //64 bit GNU - typedef unsigned long long TW_UINTPTR; - #endif - -/* Everything else... */ -#else - #define PASCAL - #define FAR - typedef void* TW_HANDLE; - typedef void* TW_MEMREF; - typedef unsigned char BYTE; - - #ifdef TWH_32BIT - //32 bit GNU - typedef unsigned long TW_UINTPTR; - #else - //64 bit GNU - typedef unsigned long long TW_UINTPTR; - #endif -#endif - - -/* Set the packing: this occurs before any structures are defined */ -#ifdef TWH_CMP_MSC - #pragma pack (push, before_twain) - #pragma pack (2) -#elif defined(TWH_CMP_GNU) - #pragma pack (push, before_twain) - #ifdef __APPLE__ - //#pragma pack (4) - #else - #pragma pack (2) - #endif -#elif defined(TWH_CMP_BORLAND) - #pragma option -a2 -#endif - - -/**************************************************************************** - * Type Definitions * - ****************************************************************************/ - -/* String types. These include room for the strings and a NULL char, * - * or, on the Mac, a length byte followed by the string. * - * TW_STR255 must hold less than 256 chars so length fits in first byte. */ -typedef char TW_STR32[34], FAR *pTW_STR32; -typedef char TW_STR64[66], FAR *pTW_STR64; -typedef char TW_STR128[130], FAR *pTW_STR128; -typedef char TW_STR255[256], FAR *pTW_STR255; - -/* Numeric types. */ -typedef char TW_INT8, FAR *pTW_INT8; -typedef short TW_INT16, FAR *pTW_INT16; -typedef long TW_INT32, FAR *pTW_INT32; -typedef unsigned char TW_UINT8, FAR *pTW_UINT8; -typedef unsigned short TW_UINT16, FAR *pTW_UINT16; -typedef unsigned long TW_UINT32, FAR *pTW_UINT32; -typedef unsigned short TW_BOOL, FAR *pTW_BOOL; - - -/**************************************************************************** - * Structure Definitions * - ****************************************************************************/ - -/* Fixed point structure type. */ -typedef struct { - TW_INT16 Whole; - TW_UINT16 Frac; -} TW_FIX32, FAR *pTW_FIX32; - -/* Defines a frame rectangle in ICAP_UNITS coordinates. */ -typedef struct { - TW_FIX32 Left; - TW_FIX32 Top; - TW_FIX32 Right; - TW_FIX32 Bottom; -} TW_FRAME, FAR * pTW_FRAME; - -/* Defines the parameters used for channel-specific transformation. */ -typedef struct { - TW_FIX32 StartIn; - TW_FIX32 BreakIn; - TW_FIX32 EndIn; - TW_FIX32 StartOut; - TW_FIX32 BreakOut; - TW_FIX32 EndOut; - TW_FIX32 Gamma; - TW_FIX32 SampleCount; -} TW_DECODEFUNCTION, FAR * pTW_DECODEFUNCTION; - -/* Stores a Fixed point number in two parts, a whole and a fractional part. */ -typedef struct { - TW_DECODEFUNCTION Decode[3]; - TW_FIX32 Mix[3][3]; -} TW_TRANSFORMSTAGE, FAR * pTW_TRANSFORMSTAGE; - -/* Container for array of values */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 NumItems; - TW_UINT8 ItemList[1]; -} TW_ARRAY, FAR * pTW_ARRAY; - -/* Information about audio data */ -typedef struct { - TW_STR255 Name; - TW_UINT32 Reserved; -} TW_AUDIOINFO, FAR * pTW_AUDIOINFO; - -/* Used to register callbacks. */ -typedef struct { - TW_MEMREF CallBackProc; - TW_UINT32 RefCon; - TW_INT16 Message; -} TW_CALLBACK, FAR * pTW_CALLBACK; - -/* Used to register callbacks. */ -typedef struct { - TW_MEMREF CallBackProc; - TW_UINTPTR RefCon; - TW_INT16 Message; -} TW_CALLBACK2, FAR * pTW_CALLBACK2; - -/* Used by application to get/set capability from/in a data source. */ -typedef struct { - TW_UINT16 Cap; - TW_UINT16 ConType; - TW_HANDLE hContainer; -} TW_CAPABILITY, FAR * pTW_CAPABILITY; - -/* Defines a CIE XYZ space tri-stimulus value. */ -typedef struct { - TW_FIX32 X; - TW_FIX32 Y; - TW_FIX32 Z; -} TW_CIEPOINT, FAR * pTW_CIEPOINT; - -/* Defines the mapping from an RGB color space device into CIE 1931 (XYZ) color space. */ -typedef struct { - TW_UINT16 ColorSpace; - TW_INT16 LowEndian; - TW_INT16 DeviceDependent; - TW_INT32 VersionNumber; - TW_TRANSFORMSTAGE StageABC; - TW_TRANSFORMSTAGE StageLMN; - TW_CIEPOINT WhitePoint; - TW_CIEPOINT BlackPoint; - TW_CIEPOINT WhitePaper; - TW_CIEPOINT BlackInk; - TW_FIX32 Samples[1]; -} TW_CIECOLOR, FAR * pTW_CIECOLOR; - -/* Allows for a data source and application to pass custom data to each other. */ -typedef struct { - TW_UINT32 InfoLength; - TW_HANDLE hData; -}TW_CUSTOMDSDATA, FAR *pTW_CUSTOMDSDATA; - -/* Provides information about the Event that was raised by the Source */ -typedef struct { - TW_UINT32 Event; - TW_STR255 DeviceName; - TW_UINT32 BatteryMinutes; - TW_INT16 BatteryPercentage; - TW_INT32 PowerSupply; - TW_FIX32 XResolution; - TW_FIX32 YResolution; - TW_UINT32 FlashUsed2; - TW_UINT32 AutomaticCapture; - TW_UINT32 TimeBeforeFirstCapture; - TW_UINT32 TimeBetweenCaptures; -} TW_DEVICEEVENT, FAR * pTW_DEVICEEVENT; - -/* This structure holds the tri-stimulus color palette information for TW_PALETTE8 structures.*/ -typedef struct { - TW_UINT8 Index; - TW_UINT8 Channel1; - TW_UINT8 Channel2; - TW_UINT8 Channel3; -} TW_ELEMENT8, FAR * pTW_ELEMENT8; - -/* Stores a group of individual values describing a capability. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 NumItems; - TW_UINT32 CurrentIndex; - TW_UINT32 DefaultIndex; - TW_UINT8 ItemList[1]; -} TW_ENUMERATION, FAR * pTW_ENUMERATION; - -/* Used to pass application events/messages from the application to the Source. */ -typedef struct { - TW_MEMREF pEvent; - TW_UINT16 TWMessage; -} TW_EVENT, FAR * pTW_EVENT; - -/* This structure is used to pass specific information between the data source and the application. */ -typedef struct { - TW_UINT16 InfoID; - TW_UINT16 ItemType; - TW_UINT16 NumItems; - TW_UINT16 ReturnCode; - TW_UINTPTR Item; -}TW_INFO, FAR* pTW_INFO; - -typedef struct { - TW_UINT32 NumInfos; - TW_INFO Info[1]; -}TW_EXTIMAGEINFO, FAR* pTW_EXTIMAGEINFO; - -/* Provides information about the currently selected device */ -typedef struct { - TW_STR255 InputName; - TW_STR255 OutputName; - TW_MEMREF Context; - union { - int Recursive; - TW_BOOL Subdirectories; - }; - union { - TW_INT32 FileType; - TW_UINT32 FileSystemType; - }; - TW_UINT32 Size; - TW_STR32 CreateTimeDate; - TW_STR32 ModifiedTimeDate; - TW_UINT32 FreeSpace; - TW_INT32 NewImageSize; - TW_UINT32 NumberOfFiles; - TW_UINT32 NumberOfSnippets; - TW_UINT32 DeviceGroupMask; - TW_INT8 Reserved[508]; -} TW_FILESYSTEM, FAR * pTW_FILESYSTEM; - -/* This structure is used by the application to specify a set of mapping values to be applied to grayscale data. */ -typedef struct { - TW_ELEMENT8 Response[1]; -} TW_GRAYRESPONSE, FAR * pTW_GRAYRESPONSE; - -/* A general way to describe the version of software that is running. */ -typedef struct { - TW_UINT16 MajorNum; - TW_UINT16 MinorNum; - TW_UINT16 Language; - TW_UINT16 Country; - TW_STR32 Info; -} TW_VERSION, FAR * pTW_VERSION; - -/* Provides identification information about a TWAIN entity.*/ -typedef struct { - TW_UINT32 Id; - TW_VERSION Version; - TW_UINT16 ProtocolMajor; - TW_UINT16 ProtocolMinor; - TW_UINT32 SupportedGroups; - TW_STR32 Manufacturer; - TW_STR32 ProductFamily; - TW_STR32 ProductName; -} TW_IDENTITY, FAR * pTW_IDENTITY; - -/* Describes the real image data, that is, the complete image being transferred between the Source and application. */ -typedef struct { - TW_FIX32 XResolution; - TW_FIX32 YResolution; - TW_INT32 ImageWidth; - TW_INT32 ImageLength; - TW_INT16 SamplesPerPixel; - TW_INT16 BitsPerSample[8]; - TW_INT16 BitsPerPixel; - TW_BOOL Planar; - TW_INT16 PixelType; - TW_UINT16 Compression; -} TW_IMAGEINFO, FAR * pTW_IMAGEINFO; - -/* Involves information about the original size of the acquired image. */ -typedef struct { - TW_FRAME Frame; - TW_UINT32 DocumentNumber; - TW_UINT32 PageNumber; - TW_UINT32 FrameNumber; -} TW_IMAGELAYOUT, FAR * pTW_IMAGELAYOUT; - -/* Provides information for managing memory buffers. */ -typedef struct { - TW_UINT32 Flags; - TW_UINT32 Length; - TW_MEMREF TheMem; -} TW_MEMORY, FAR * pTW_MEMORY; - -/* Describes the form of the acquired data being passed from the Source to the application.*/ -typedef struct { - TW_UINT16 Compression; - TW_UINT32 BytesPerRow; - TW_UINT32 Columns; - TW_UINT32 Rows; - TW_UINT32 XOffset; - TW_UINT32 YOffset; - TW_UINT32 BytesWritten; - TW_MEMORY Memory; -} TW_IMAGEMEMXFER, FAR * pTW_IMAGEMEMXFER; - -/* Describes the information necessary to transfer a JPEG-compressed image. */ -typedef struct { - TW_UINT16 ColorSpace; - TW_UINT32 SubSampling; - TW_UINT16 NumComponents; - TW_UINT16 RestartFrequency; - TW_UINT16 QuantMap[4]; - TW_MEMORY QuantTable[4]; - TW_UINT16 HuffmanMap[4]; - TW_MEMORY HuffmanDC[2]; - TW_MEMORY HuffmanAC[2]; -} TW_JPEGCOMPRESSION, FAR * pTW_JPEGCOMPRESSION; - -/* Stores a single value (item) which describes a capability. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 Item; -} TW_ONEVALUE, FAR * pTW_ONEVALUE; - -/* This structure holds the color palette information. */ -typedef struct { - TW_UINT16 NumColors; - TW_UINT16 PaletteType; - TW_ELEMENT8 Colors[256]; -} TW_PALETTE8, FAR * pTW_PALETTE8; - -/* Used to bypass the TWAIN protocol when communicating with a device */ -typedef struct { - TW_MEMREF pCommand; - TW_UINT32 CommandBytes; - TW_INT32 Direction; - TW_MEMREF pData; - TW_UINT32 DataBytes; - TW_UINT32 DataBytesXfered; -} TW_PASSTHRU, FAR * pTW_PASSTHRU; - -/* This structure tells the application how many more complete transfers the Source currently has available. */ -typedef struct { - TW_UINT16 Count; - union { - TW_UINT32 EOJ; - TW_UINT32 Reserved; - }; -} TW_PENDINGXFERS, FAR *pTW_PENDINGXFERS; - -/* Stores a range of individual values describing a capability. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 MinValue; - TW_UINT32 MaxValue; - TW_UINT32 StepSize; - TW_UINT32 DefaultValue; - TW_UINT32 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. */ -typedef struct { - TW_ELEMENT8 Response[1]; -} TW_RGBRESPONSE, FAR * pTW_RGBRESPONSE; - -/* Describes the file format and file specification information for a transfer through a disk file. */ -typedef struct { - TW_STR255 FileName; - TW_UINT16 Format; - TW_INT16 VRefNum; -} TW_SETUPFILEXFER, FAR * pTW_SETUPFILEXFER; - -/* Provides the application information about the Sources requirements and preferences regarding allocation of transfer buffer(s). */ -typedef struct { - TW_UINT32 MinBufSize; - TW_UINT32 MaxBufSize; - TW_UINT32 Preferred; -} TW_SETUPMEMXFER, FAR * pTW_SETUPMEMXFER; - -/* Describes the status of a source. */ -typedef struct { - TW_UINT16 ConditionCode; - union { - TW_UINT16 Data; - TW_UINT16 Reserved; - }; -} TW_STATUS, FAR * pTW_STATUS; - -/* Translates the contents of Status into a localized UTF8string. */ -typedef struct { - TW_STATUS Status; - TW_UINT32 Size; - TW_HANDLE UTF8string; -} TW_STATUSUTF8, FAR * pTW_STATUSUTF8; - -/* This structure is used to handle the user interface coordination between an application and a Source. */ -typedef struct { - TW_BOOL ShowUI; - TW_BOOL ModalUI; - TW_HANDLE hParent; -} TW_USERINTERFACE, FAR * pTW_USERINTERFACE; - - -/**************************************************************************** - * Generic Constants * - ****************************************************************************/ - -#define TWON_ARRAY 3 -#define TWON_ENUMERATION 4 -#define TWON_ONEVALUE 5 -#define TWON_RANGE 6 - -#define TWON_ICONID 962 -#define TWON_DSMID 461 -#define TWON_DSMCODEID 63 - -#define TWON_DONTCARE8 0xff -#define TWON_DONTCARE16 0xffff -#define TWON_DONTCARE32 0xffffffff - -/* Flags used in TW_MEMORY structure. */ -#define TWMF_APPOWNS 0x0001 -#define TWMF_DSMOWNS 0x0002 -#define TWMF_DSOWNS 0x0004 -#define TWMF_POINTER 0x0008 -#define TWMF_HANDLE 0x0010 - -#define TWTY_INT8 0x0000 -#define TWTY_INT16 0x0001 -#define TWTY_INT32 0x0002 - -#define TWTY_UINT8 0x0003 -#define TWTY_UINT16 0x0004 -#define TWTY_UINT32 0x0005 - -#define TWTY_BOOL 0x0006 - -#define TWTY_FIX32 0x0007 - -#define TWTY_FRAME 0x0008 - -#define TWTY_STR32 0x0009 -#define TWTY_STR64 0x000a -#define TWTY_STR128 0x000b -#define TWTY_STR255 0x000c -#define TWTY_HANDLE 0x000f - - -/**************************************************************************** - * Capability Constants * - ****************************************************************************/ - -/* CAP_ALARMS values */ -#define TWAL_ALARM 0 -#define TWAL_FEEDERERROR 1 -#define TWAL_FEEDERWARNING 2 -#define TWAL_BARCODE 3 -#define TWAL_DOUBLEFEED 4 -#define TWAL_JAM 5 -#define TWAL_PATCHCODE 6 -#define TWAL_POWER 7 -#define TWAL_SKEW 8 - -/* ICAP_AUTOSIZE values */ -#define TWAS_NONE 0 -#define TWAS_AUTO 1 -#define TWAS_CURRENT 2 - -/* TWEI_BARCODEROTATION values */ -#define TWBCOR_ROT0 0 -#define TWBCOR_ROT90 1 -#define TWBCOR_ROT180 2 -#define TWBCOR_ROT270 3 -#define TWBCOR_ROTX 4 - -/* ICAP_BARCODESEARCHMODE values */ -#define TWBD_HORZ 0 -#define TWBD_VERT 1 -#define TWBD_HORZVERT 2 -#define TWBD_VERTHORZ 3 - -/* ICAP_BITORDER values */ -#define TWBO_LSBFIRST 0 -#define TWBO_MSBFIRST 1 - -/* ICAP_AUTODISCARDBLANKPAGES values */ -#define TWBP_DISABLE -2 -#define TWBP_AUTO -1 - -/* ICAP_BITDEPTHREDUCTION values */ -#define TWBR_THRESHOLD 0 -#define TWBR_HALFTONE 1 -#define TWBR_CUSTHALFTONE 2 -#define TWBR_DIFFUSION 3 -#define TWBR_DYNAMICTHRESHOLD 4 - -/* ICAP_SUPPORTEDBARCODETYPES and TWEI_BARCODETYPE values*/ -#define TWBT_3OF9 0 -#define TWBT_2OF5INTERLEAVED 1 -#define TWBT_2OF5NONINTERLEAVED 2 -#define TWBT_CODE93 3 -#define TWBT_CODE128 4 -#define TWBT_UCC128 5 -#define TWBT_CODABAR 6 -#define TWBT_UPCA 7 -#define TWBT_UPCE 8 -#define TWBT_EAN8 9 -#define TWBT_EAN13 10 -#define TWBT_POSTNET 11 -#define TWBT_PDF417 12 -#define TWBT_2OF5INDUSTRIAL 13 -#define TWBT_2OF5MATRIX 14 -#define TWBT_2OF5DATALOGIC 15 -#define TWBT_2OF5IATA 16 -#define TWBT_3OF9FULLASCII 17 -#define TWBT_CODABARWITHSTARTSTOP 18 -#define TWBT_MAXICODE 19 -#define TWBT_QRCODE 20 - -/* ICAP_COMPRESSION values*/ -#define TWCP_NONE 0 -#define TWCP_PACKBITS 1 -#define TWCP_GROUP31D 2 -#define TWCP_GROUP31DEOL 3 -#define TWCP_GROUP32D 4 -#define TWCP_GROUP4 5 -#define TWCP_JPEG 6 -#define TWCP_LZW 7 -#define TWCP_JBIG 8 -#define TWCP_PNG 9 -#define TWCP_RLE4 10 -#define TWCP_RLE8 11 -#define TWCP_BITFIELDS 12 -#define TWCP_ZIP 13 -#define TWCP_JPEG2000 14 - -/* CAP_CAMERASIDE and TWEI_PAGESIDE values */ -#define TWCS_BOTH 0 -#define TWCS_TOP 1 -#define TWCS_BOTTOM 2 - -/* CAP_CLEARBUFFERS values */ -#define TWCB_AUTO 0 -#define TWCB_CLEAR 1 -#define TWCB_NOCLEAR 2 - -/* CAP_DEVICEEVENT values */ -#define TWDE_CUSTOMEVENTS 0x8000 -#define TWDE_CHECKAUTOMATICCAPTURE 0 -#define TWDE_CHECKBATTERY 1 -#define TWDE_CHECKDEVICEONLINE 2 -#define TWDE_CHECKFLASH 3 -#define TWDE_CHECKPOWERSUPPLY 4 -#define TWDE_CHECKRESOLUTION 5 -#define TWDE_DEVICEADDED 6 -#define TWDE_DEVICEOFFLINE 7 -#define TWDE_DEVICEREADY 8 -#define TWDE_DEVICEREMOVED 9 -#define TWDE_IMAGECAPTURED 10 -#define TWDE_IMAGEDELETED 11 -#define TWDE_PAPERDOUBLEFEED 12 -#define TWDE_PAPERJAM 13 -#define TWDE_LAMPFAILURE 14 -#define TWDE_POWERSAVE 15 -#define TWDE_POWERSAVENOTIFY 16 - -/* TW_PASSTHRU.Direction values. */ -#define TWDR_GET 1 -#define TWDR_SET 2 - -/* TWEI_DESKEWSTATUS values. */ -#define TWDSK_SUCCESS 0 -#define TWDSK_REPORTONLY 1 -#define TWDSK_FAIL 2 -#define TWDSK_DISABLED 3 - -/* CAP_DUPLEX values */ -#define TWDX_NONE 0 -#define TWDX_1PASSDUPLEX 1 -#define TWDX_2PASSDUPLEX 2 - -/* CAP_FEEDERALIGNMENT values */ -#define TWFA_NONE 0 -#define TWFA_LEFT 1 -#define TWFA_CENTER 2 -#define TWFA_RIGHT 3 - -/* ICAP_FEEDERTYPE values*/ -#define TWFE_GENERAL 0 -#define TWFE_PHOTO 1 - -/* ICAP_IMAGEFILEFORMAT values */ -#define TWFF_TIFF 0 -#define TWFF_PICT 1 -#define TWFF_BMP 2 -#define TWFF_XBM 3 -#define TWFF_JFIF 4 -#define TWFF_FPX 5 -#define TWFF_TIFFMULTI 6 -#define TWFF_PNG 7 -#define TWFF_SPIFF 8 -#define TWFF_EXIF 9 -#define TWFF_PDF 10 -#define TWFF_JP2 11 -#define TWFF_JPX 13 -#define TWFF_DEJAVU 14 -#define TWFF_PDFA 15 -#define TWFF_PDFA2 16 - -/* ICAP_FLASHUSED2 values */ -#define TWFL_NONE 0 -#define TWFL_OFF 1 -#define TWFL_ON 2 -#define TWFL_AUTO 3 -#define TWFL_REDEYE 4 - -/* CAP_FEEDERORDER values */ -#define TWFO_FIRSTPAGEFIRST 0 -#define TWFO_LASTPAGEFIRST 1 - -/* CAP_FEEDERPOCKET values*/ -#define TWFP_POCKETERROR 0 -#define TWFP_POCKET1 1 -#define TWFP_POCKET2 2 -#define TWFP_POCKET3 3 -#define TWFP_POCKET4 4 -#define TWFP_POCKET5 5 -#define TWFP_POCKET6 6 -#define TWFP_POCKET7 7 -#define TWFP_POCKET8 8 -#define TWFP_POCKET9 9 -#define TWFP_POCKET10 10 -#define TWFP_POCKET11 11 -#define TWFP_POCKET12 12 -#define TWFP_POCKET13 13 -#define TWFP_POCKET14 14 -#define TWFP_POCKET15 15 -#define TWFP_POCKET16 16 - -/* ICAP_FLIPROTATION values */ -#define TWFR_BOOK 0 -#define TWFR_FANFOLD 1 - -/* ICAP_FILTER values */ -#define TWFT_RED 0 -#define TWFT_GREEN 1 -#define TWFT_BLUE 2 -#define TWFT_NONE 3 -#define TWFT_WHITE 4 -#define TWFT_CYAN 5 -#define TWFT_MAGENTA 6 -#define TWFT_YELLOW 7 -#define TWFT_BLACK 8 - -/* TW_FILESYSTEM.FileType values */ -#define TWFY_CAMERA 0 -#define TWFY_CAMERATOP 1 -#define TWFY_CAMERABOTTOM 2 -#define TWFY_CAMERAPREVIEW 3 -#define TWFY_DOMAIN 4 -#define TWFY_HOST 5 -#define TWFY_DIRECTORY 6 -#define TWFY_IMAGE 7 -#define TWFY_UNKNOWN 8 - -/* ICAP_ICCPROFILE values */ -#define TWIC_NONE 0 -#define TWIC_LINK 1 -#define TWIC_EMBED 2 - -/* ICAP_IMAGEFILTER values */ -#define TWIF_NONE 0 -#define TWIF_AUTO 1 -#define TWIF_LOWPASS 2 -#define TWIF_BANDPASS 3 -#define TWIF_HIGHPASS 4 -#define TWIF_TEXT TWIF_BANDPASS -#define TWIF_FINELINE TWIF_HIGHPASS - -/* ICAP_IMAGEMERGE values */ -#define TWIM_NONE 0 -#define TWIM_FRONTONTOP 1 -#define TWIM_FRONTONBOTTOM 2 -#define TWIM_FRONTONLEFT 3 -#define TWIM_FRONTONRIGHT 4 - -/* CAP_JOBCONTROL values */ -#define TWJC_NONE 0 -#define TWJC_JSIC 1 -#define TWJC_JSIS 2 -#define TWJC_JSXC 3 -#define TWJC_JSXS 4 - -/* ICAP_JPEGQUALITY values */ -#define TWJQ_UNKNOWN -4 -#define TWJQ_LOW -3 -#define TWJQ_MEDIUM -2 -#define TWJQ_HIGH -1 - -/* ICAP_LIGHTPATH values */ -#define TWLP_REFLECTIVE 0 -#define TWLP_TRANSMISSIVE 1 - -/* ICAP_LIGHTSOURCE values */ -#define TWLS_RED 0 -#define TWLS_GREEN 1 -#define TWLS_BLUE 2 -#define TWLS_NONE 3 -#define TWLS_WHITE 4 -#define TWLS_UV 5 -#define TWLS_IR 6 - -/* TWEI_MAGTYPE values */ -#define TWMD_MICR 0 -#define TWMD_RAW 1 -#define TWMD_INVALID 2 - -/* ICAP_NOISEFILTER values */ -#define TWNF_NONE 0 -#define TWNF_AUTO 1 -#define TWNF_LONEPIXEL 2 -#define TWNF_MAJORITYRULE 3 - -/* ICAP_ORIENTATION values */ -#define TWOR_ROT0 0 -#define TWOR_ROT90 1 -#define TWOR_ROT180 2 -#define TWOR_ROT270 3 -#define TWOR_PORTRAIT TWOR_ROT0 -#define TWOR_LANDSCAPE TWOR_ROT270 -#define TWOR_AUTO 4 -#define TWOR_AUTOTEXT 5 -#define TWOR_AUTOPICTURE 6 - -/* ICAP_OVERSCAN values */ -#define TWOV_NONE 0 -#define TWOV_AUTO 1 -#define TWOV_TOPBOTTOM 2 -#define TWOV_LEFTRIGHT 3 -#define TWOV_ALL 4 - -/* Palette types for TW_PALETTE8 */ -#define TWPA_RGB 0 -#define TWPA_GRAY 1 -#define TWPA_CMY 2 - -/* ICAP_PLANARCHUNKY values */ -#define TWPC_CHUNKY 0 -#define TWPC_PLANAR 1 - -/* TWEI_PATCHCODE values*/ -#define TWPCH_PATCH1 0 -#define TWPCH_PATCH2 1 -#define TWPCH_PATCH3 2 -#define TWPCH_PATCH4 3 -#define TWPCH_PATCH6 4 -#define TWPCH_PATCHT 5 - -/* ICAP_PIXELFLAVOR values */ -#define TWPF_CHOCOLATE 0 -#define TWPF_VANILLA 1 - -/* CAP_PRINTERMODE values */ -#define TWPM_SINGLESTRING 0 -#define TWPM_MULTISTRING 1 -#define TWPM_COMPOUNDSTRING 2 - -/* CAP_PRINTER values */ -#define TWPR_IMPRINTERTOPBEFORE 0 -#define TWPR_IMPRINTERTOPAFTER 1 -#define TWPR_IMPRINTERBOTTOMBEFORE 2 -#define TWPR_IMPRINTERBOTTOMAFTER 3 -#define TWPR_ENDORSERTOPBEFORE 4 -#define TWPR_ENDORSERTOPAFTER 5 -#define TWPR_ENDORSERBOTTOMBEFORE 6 -#define TWPR_ENDORSERBOTTOMAFTER 7 - -/* CAP_POWERSUPPLY values */ -#define TWPS_EXTERNAL 0 -#define TWPS_BATTERY 1 - -/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */ -#define TWPT_BW 0 -#define TWPT_GRAY 1 -#define TWPT_RGB 2 -#define TWPT_PALETTE 3 -#define TWPT_CMY 4 -#define TWPT_CMYK 5 -#define TWPT_YUV 6 -#define TWPT_YUVK 7 -#define TWPT_CIEXYZ 8 -#define TWPT_LAB 9 -#define TWPT_SRGB 10 -#define TWPT_SCRGB 11 -#define TWPT_INFRARED 16 - -/* CAP_SEGMENTED values */ -#define TWSG_NONE 0 -#define TWSG_AUTO 1 -#define TWSG_MANUAL 2 - -/* ICAP_FILMTYPE values */ -#define TWFM_POSITIVE 0 -#define TWFM_NEGATIVE 1 - -/* CAP_DOUBLEFEEDDETECTION */ -#define TWDF_ULTRASONIC 0 -#define TWDF_BYLENGTH 1 -#define TWDF_INFRARED 2 - -/* CAP_DOUBLEFEEDDETECTIONSENSITIVITY */ -#define TWUS_LOW 0 -#define TWUS_MEDIUM 1 -#define TWUS_HIGH 2 - -/* CAP_DOUBLEFEEDDETECTIONRESPONSE */ -#define TWDP_STOP 0 -#define TWDP_STOPANDWAIT 1 -#define TWDP_SOUND 2 -#define TWDP_DONOTIMPRINT 3 - -/* ICAP_MIRROR values */ -#define TWMR_NONE 0 -#define TWMR_VERTICAL 1 -#define TWMR_HORIZONTAL 2 - -/* ICAP_JPEGSUBSAMPLING values */ -#define TWJS_444YCBCR 0 -#define TWJS_444RGB 1 -#define TWJS_422 2 -#define TWJS_421 3 -#define TWJS_411 4 -#define TWJS_420 5 -#define TWJS_410 6 -#define TWJS_311 7 - -/* CAP_PAPERHANDLING values */ -#define TWPH_NORMAL 0 -#define TWPH_FRAGILE 1 -#define TWPH_THICK 2 -#define TWPH_TRIFOLD 3 -#define TWPH_PHOTOGRAPH 4 - -/* CAP_INDICATORSMODE values */ -#define TWCI_INFO 0 -#define TWCI_WARNING 1 -#define TWCI_ERROR 2 -#define TWCI_WARMUP 3 - -/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */ -#define TWSS_NONE 0 -#define TWSS_A4 1 -#define TWSS_JISB5 2 -#define TWSS_USLETTER 3 -#define TWSS_USLEGAL 4 -#define TWSS_A5 5 -#define TWSS_ISOB4 6 -#define TWSS_ISOB6 7 -#define TWSS_USLEDGER 9 -#define TWSS_USEXECUTIVE 10 -#define TWSS_A3 11 -#define TWSS_ISOB3 12 -#define TWSS_A6 13 -#define TWSS_C4 14 -#define TWSS_C5 15 -#define TWSS_C6 16 -#define TWSS_4A0 17 -#define TWSS_2A0 18 -#define TWSS_A0 19 -#define TWSS_A1 20 -#define TWSS_A2 21 -#define TWSS_A7 22 -#define TWSS_A8 23 -#define TWSS_A9 24 -#define TWSS_A10 25 -#define TWSS_ISOB0 26 -#define TWSS_ISOB1 27 -#define TWSS_ISOB2 28 -#define TWSS_ISOB5 29 -#define TWSS_ISOB7 30 -#define TWSS_ISOB8 31 -#define TWSS_ISOB9 32 -#define TWSS_ISOB10 33 -#define TWSS_JISB0 34 -#define TWSS_JISB1 35 -#define TWSS_JISB2 36 -#define TWSS_JISB3 37 -#define TWSS_JISB4 38 -#define TWSS_JISB6 39 -#define TWSS_JISB7 40 -#define TWSS_JISB8 41 -#define TWSS_JISB9 42 -#define TWSS_JISB10 43 -#define TWSS_C0 44 -#define TWSS_C1 45 -#define TWSS_C2 46 -#define TWSS_C3 47 -#define TWSS_C7 48 -#define TWSS_C8 49 -#define TWSS_C9 50 -#define TWSS_C10 51 -#define TWSS_USSTATEMENT 52 -#define TWSS_BUSINESSCARD 53 -#define TWSS_MAXSIZE 54 - -/* ICAP_XFERMECH values (SX_ means Setup XFer) */ -#define TWSX_NATIVE 0 -#define TWSX_FILE 1 -#define TWSX_MEMORY 2 -#define TWSX_MEMFILE 4 - -/* ICAP_UNITS values (UN_ means UNits) */ -#define TWUN_INCHES 0 -#define TWUN_CENTIMETERS 1 -#define TWUN_PICAS 2 -#define TWUN_POINTS 3 -#define TWUN_TWIPS 4 -#define TWUN_PIXELS 5 -#define TWUN_MILLIMETERS 6 - - -/**************************************************************************** - * Country Constants * - ****************************************************************************/ - -#define TWCY_AFGHANISTAN 1001 -#define TWCY_ALGERIA 213 -#define TWCY_AMERICANSAMOA 684 -#define TWCY_ANDORRA 033 -#define TWCY_ANGOLA 1002 -#define TWCY_ANGUILLA 8090 -#define TWCY_ANTIGUA 8091 -#define TWCY_ARGENTINA 54 -#define TWCY_ARUBA 297 -#define TWCY_ASCENSIONI 247 -#define TWCY_AUSTRALIA 61 -#define TWCY_AUSTRIA 43 -#define TWCY_BAHAMAS 8092 -#define TWCY_BAHRAIN 973 -#define TWCY_BANGLADESH 880 -#define TWCY_BARBADOS 8093 -#define TWCY_BELGIUM 32 -#define TWCY_BELIZE 501 -#define TWCY_BENIN 229 -#define TWCY_BERMUDA 8094 -#define TWCY_BHUTAN 1003 -#define TWCY_BOLIVIA 591 -#define TWCY_BOTSWANA 267 -#define TWCY_BRITAIN 6 -#define TWCY_BRITVIRGINIS 8095 -#define TWCY_BRAZIL 55 -#define TWCY_BRUNEI 673 -#define TWCY_BULGARIA 359 -#define TWCY_BURKINAFASO 1004 -#define TWCY_BURMA 1005 -#define TWCY_BURUNDI 1006 -#define TWCY_CAMAROON 237 -#define TWCY_CANADA 2 -#define TWCY_CAPEVERDEIS 238 -#define TWCY_CAYMANIS 8096 -#define TWCY_CENTRALAFREP 1007 -#define TWCY_CHAD 1008 -#define TWCY_CHILE 56 -#define TWCY_CHINA 86 -#define TWCY_CHRISTMASIS 1009 -#define TWCY_COCOSIS 1009 -#define TWCY_COLOMBIA 57 -#define TWCY_COMOROS 1010 -#define TWCY_CONGO 1011 -#define TWCY_COOKIS 1012 -#define TWCY_COSTARICA 506 -#define TWCY_CUBA 005 -#define TWCY_CYPRUS 357 -#define TWCY_CZECHOSLOVAKIA 42 -#define TWCY_DENMARK 45 -#define TWCY_DJIBOUTI 1013 -#define TWCY_DOMINICA 8097 -#define TWCY_DOMINCANREP 8098 -#define TWCY_EASTERIS 1014 -#define TWCY_ECUADOR 593 -#define TWCY_EGYPT 20 -#define TWCY_ELSALVADOR 503 -#define TWCY_EQGUINEA 1015 -#define TWCY_ETHIOPIA 251 -#define TWCY_FALKLANDIS 1016 -#define TWCY_FAEROEIS 298 -#define TWCY_FIJIISLANDS 679 -#define TWCY_FINLAND 358 -#define TWCY_FRANCE 33 -#define TWCY_FRANTILLES 596 -#define TWCY_FRGUIANA 594 -#define TWCY_FRPOLYNEISA 689 -#define TWCY_FUTANAIS 1043 -#define TWCY_GABON 241 -#define TWCY_GAMBIA 220 -#define TWCY_GERMANY 49 -#define TWCY_GHANA 233 -#define TWCY_GIBRALTER 350 -#define TWCY_GREECE 30 -#define TWCY_GREENLAND 299 -#define TWCY_GRENADA 8099 -#define TWCY_GRENEDINES 8015 -#define TWCY_GUADELOUPE 590 -#define TWCY_GUAM 671 -#define TWCY_GUANTANAMOBAY 5399 -#define TWCY_GUATEMALA 502 -#define TWCY_GUINEA 224 -#define TWCY_GUINEABISSAU 1017 -#define TWCY_GUYANA 592 -#define TWCY_HAITI 509 -#define TWCY_HONDURAS 504 -#define TWCY_HONGKONG 852 -#define TWCY_HUNGARY 36 -#define TWCY_ICELAND 354 -#define TWCY_INDIA 91 -#define TWCY_INDONESIA 62 -#define TWCY_IRAN 98 -#define TWCY_IRAQ 964 -#define TWCY_IRELAND 353 -#define TWCY_ISRAEL 972 -#define TWCY_ITALY 39 -#define TWCY_IVORYCOAST 225 -#define TWCY_JAMAICA 8010 -#define TWCY_JAPAN 81 -#define TWCY_JORDAN 962 -#define TWCY_KENYA 254 -#define TWCY_KIRIBATI 1018 -#define TWCY_KOREA 82 -#define TWCY_KUWAIT 965 -#define TWCY_LAOS 1019 -#define TWCY_LEBANON 1020 -#define TWCY_LIBERIA 231 -#define TWCY_LIBYA 218 -#define TWCY_LIECHTENSTEIN 41 -#define TWCY_LUXENBOURG 352 -#define TWCY_MACAO 853 -#define TWCY_MADAGASCAR 1021 -#define TWCY_MALAWI 265 -#define TWCY_MALAYSIA 60 -#define TWCY_MALDIVES 960 -#define TWCY_MALI 1022 -#define TWCY_MALTA 356 -#define TWCY_MARSHALLIS 692 -#define TWCY_MAURITANIA 1023 -#define TWCY_MAURITIUS 230 -#define TWCY_MEXICO 3 -#define TWCY_MICRONESIA 691 -#define TWCY_MIQUELON 508 -#define TWCY_MONACO 33 -#define TWCY_MONGOLIA 1024 -#define TWCY_MONTSERRAT 8011 -#define TWCY_MOROCCO 212 -#define TWCY_MOZAMBIQUE 1025 -#define TWCY_NAMIBIA 264 -#define TWCY_NAURU 1026 -#define TWCY_NEPAL 977 -#define TWCY_NETHERLANDS 31 -#define TWCY_NETHANTILLES 599 -#define TWCY_NEVIS 8012 -#define TWCY_NEWCALEDONIA 687 -#define TWCY_NEWZEALAND 64 -#define TWCY_NICARAGUA 505 -#define TWCY_NIGER 227 -#define TWCY_NIGERIA 234 -#define TWCY_NIUE 1027 -#define TWCY_NORFOLKI 1028 -#define TWCY_NORWAY 47 -#define TWCY_OMAN 968 -#define TWCY_PAKISTAN 92 -#define TWCY_PALAU 1029 -#define TWCY_PANAMA 507 -#define TWCY_PARAGUAY 595 -#define TWCY_PERU 51 -#define TWCY_PHILLIPPINES 63 -#define TWCY_PITCAIRNIS 1030 -#define TWCY_PNEWGUINEA 675 -#define TWCY_POLAND 48 -#define TWCY_PORTUGAL 351 -#define TWCY_QATAR 974 -#define TWCY_REUNIONI 1031 -#define TWCY_ROMANIA 40 -#define TWCY_RWANDA 250 -#define TWCY_SAIPAN 670 -#define TWCY_SANMARINO 39 -#define TWCY_SAOTOME 1033 -#define TWCY_SAUDIARABIA 966 -#define TWCY_SENEGAL 221 -#define TWCY_SEYCHELLESIS 1034 -#define TWCY_SIERRALEONE 1035 -#define TWCY_SINGAPORE 65 -#define TWCY_SOLOMONIS 1036 -#define TWCY_SOMALI 1037 -#define TWCY_SOUTHAFRICA 27 -#define TWCY_SPAIN 34 -#define TWCY_SRILANKA 94 -#define TWCY_STHELENA 1032 -#define TWCY_STKITTS 8013 -#define TWCY_STLUCIA 8014 -#define TWCY_STPIERRE 508 -#define TWCY_STVINCENT 8015 -#define TWCY_SUDAN 1038 -#define TWCY_SURINAME 597 -#define TWCY_SWAZILAND 268 -#define TWCY_SWEDEN 46 -#define TWCY_SWITZERLAND 41 -#define TWCY_SYRIA 1039 -#define TWCY_TAIWAN 886 -#define TWCY_TANZANIA 255 -#define TWCY_THAILAND 66 -#define TWCY_TOBAGO 8016 -#define TWCY_TOGO 228 -#define TWCY_TONGAIS 676 -#define TWCY_TRINIDAD 8016 -#define TWCY_TUNISIA 216 -#define TWCY_TURKEY 90 -#define TWCY_TURKSCAICOS 8017 -#define TWCY_TUVALU 1040 -#define TWCY_UGANDA 256 -#define TWCY_USSR 7 -#define TWCY_UAEMIRATES 971 -#define TWCY_UNITEDKINGDOM 44 -#define TWCY_USA 1 -#define TWCY_URUGUAY 598 -#define TWCY_VANUATU 1041 -#define TWCY_VATICANCITY 39 -#define TWCY_VENEZUELA 58 -#define TWCY_WAKE 1042 -#define TWCY_WALLISIS 1043 -#define TWCY_WESTERNSAHARA 1044 -#define TWCY_WESTERNSAMOA 1045 -#define TWCY_YEMEN 1046 -#define TWCY_YUGOSLAVIA 38 -#define TWCY_ZAIRE 243 -#define TWCY_ZAMBIA 260 -#define TWCY_ZIMBABWE 263 -#define TWCY_ALBANIA 355 -#define TWCY_ARMENIA 374 -#define TWCY_AZERBAIJAN 994 -#define TWCY_BELARUS 375 -#define TWCY_BOSNIAHERZGO 387 -#define TWCY_CAMBODIA 855 -#define TWCY_CROATIA 385 -#define TWCY_CZECHREPUBLIC 420 -#define TWCY_DIEGOGARCIA 246 -#define TWCY_ERITREA 291 -#define TWCY_ESTONIA 372 -#define TWCY_GEORGIA 995 -#define TWCY_LATVIA 371 -#define TWCY_LESOTHO 266 -#define TWCY_LITHUANIA 370 -#define TWCY_MACEDONIA 389 -#define TWCY_MAYOTTEIS 269 -#define TWCY_MOLDOVA 373 -#define TWCY_MYANMAR 95 -#define TWCY_NORTHKOREA 850 -#define TWCY_PUERTORICO 787 -#define TWCY_RUSSIA 7 -#define TWCY_SERBIA 381 -#define TWCY_SLOVAKIA 421 -#define TWCY_SLOVENIA 386 -#define TWCY_SOUTHKOREA 82 -#define TWCY_UKRAINE 380 -#define TWCY_USVIRGINIS 340 -#define TWCY_VIETNAM 84 - -/**************************************************************************** - * Language Constants * - ****************************************************************************/ -#define TWLG_USERLOCALE -1 -#define TWLG_DAN 0 -#define TWLG_DUT 1 -#define TWLG_ENG 2 -#define TWLG_FCF 3 -#define TWLG_FIN 4 -#define TWLG_FRN 5 -#define TWLG_GER 6 -#define TWLG_ICE 7 -#define TWLG_ITN 8 -#define TWLG_NOR 9 -#define TWLG_POR 10 -#define TWLG_SPA 11 -#define TWLG_SWE 12 -#define TWLG_USA 13 -#define TWLG_AFRIKAANS 14 -#define TWLG_ALBANIA 15 -#define TWLG_ARABIC 16 -#define TWLG_ARABIC_ALGERIA 17 -#define TWLG_ARABIC_BAHRAIN 18 -#define TWLG_ARABIC_EGYPT 19 -#define TWLG_ARABIC_IRAQ 20 -#define TWLG_ARABIC_JORDAN 21 -#define TWLG_ARABIC_KUWAIT 22 -#define TWLG_ARABIC_LEBANON 23 -#define TWLG_ARABIC_LIBYA 24 -#define TWLG_ARABIC_MOROCCO 25 -#define TWLG_ARABIC_OMAN 26 -#define TWLG_ARABIC_QATAR 27 -#define TWLG_ARABIC_SAUDIARABIA 28 -#define TWLG_ARABIC_SYRIA 29 -#define TWLG_ARABIC_TUNISIA 30 -#define TWLG_ARABIC_UAE 31 -#define TWLG_ARABIC_YEMEN 32 -#define TWLG_BASQUE 33 -#define TWLG_BYELORUSSIAN 34 -#define TWLG_BULGARIAN 35 -#define TWLG_CATALAN 36 -#define TWLG_CHINESE 37 -#define TWLG_CHINESE_HONGKONG 38 -#define TWLG_CHINESE_PRC 39 -#define TWLG_CHINESE_SINGAPORE 40 -#define TWLG_CHINESE_SIMPLIFIED 41 -#define TWLG_CHINESE_TAIWAN 42 -#define TWLG_CHINESE_TRADITIONAL 43 -#define TWLG_CROATIA 44 -#define TWLG_CZECH 45 -#define TWLG_DANISH TWLG_DAN -#define TWLG_DUTCH TWLG_DUT -#define TWLG_DUTCH_BELGIAN 46 -#define TWLG_ENGLISH TWLG_ENG -#define TWLG_ENGLISH_AUSTRALIAN 47 -#define TWLG_ENGLISH_CANADIAN 48 -#define TWLG_ENGLISH_IRELAND 49 -#define TWLG_ENGLISH_NEWZEALAND 50 -#define TWLG_ENGLISH_SOUTHAFRICA 51 -#define TWLG_ENGLISH_UK 52 -#define TWLG_ENGLISH_USA TWLG_USA -#define TWLG_ESTONIAN 53 -#define TWLG_FAEROESE 54 -#define TWLG_FARSI 55 -#define TWLG_FINNISH TWLG_FIN -#define TWLG_FRENCH TWLG_FRN -#define TWLG_FRENCH_BELGIAN 56 -#define TWLG_FRENCH_CANADIAN TWLG_FCF -#define TWLG_FRENCH_LUXEMBOURG 57 -#define TWLG_FRENCH_SWISS 58 -#define TWLG_GERMAN TWLG_GER -#define TWLG_GERMAN_AUSTRIAN 59 -#define TWLG_GERMAN_LUXEMBOURG 60 -#define TWLG_GERMAN_LIECHTENSTEIN 61 -#define TWLG_GERMAN_SWISS 62 -#define TWLG_GREEK 63 -#define TWLG_HEBREW 64 -#define TWLG_HUNGARIAN 65 -#define TWLG_ICELANDIC TWLG_ICE -#define TWLG_INDONESIAN 66 -#define TWLG_ITALIAN TWLG_ITN -#define TWLG_ITALIAN_SWISS 67 -#define TWLG_JAPANESE 68 -#define TWLG_KOREAN 69 -#define TWLG_KOREAN_JOHAB 70 -#define TWLG_LATVIAN 71 -#define TWLG_LITHUANIAN 72 -#define TWLG_NORWEGIAN TWLG_NOR -#define TWLG_NORWEGIAN_BOKMAL 73 -#define TWLG_NORWEGIAN_NYNORSK 74 -#define TWLG_POLISH 75 -#define TWLG_PORTUGUESE TWLG_POR -#define TWLG_PORTUGUESE_BRAZIL 76 -#define TWLG_ROMANIAN 77 -#define TWLG_RUSSIAN 78 -#define TWLG_SERBIAN_LATIN 79 -#define TWLG_SLOVAK 80 -#define TWLG_SLOVENIAN 81 -#define TWLG_SPANISH TWLG_SPA -#define TWLG_SPANISH_MEXICAN 82 -#define TWLG_SPANISH_MODERN 83 -#define TWLG_SWEDISH TWLG_SWE -#define TWLG_THAI 84 -#define TWLG_TURKISH 85 -#define TWLG_UKRANIAN 86 -#define TWLG_ASSAMESE 87 -#define TWLG_BENGALI 88 -#define TWLG_BIHARI 89 -#define TWLG_BODO 90 -#define TWLG_DOGRI 91 -#define TWLG_GUJARATI 92 -#define TWLG_HARYANVI 93 -#define TWLG_HINDI 94 -#define TWLG_KANNADA 95 -#define TWLG_KASHMIRI 96 -#define TWLG_MALAYALAM 97 -#define TWLG_MARATHI 98 -#define TWLG_MARWARI 99 -#define TWLG_MEGHALAYAN 100 -#define TWLG_MIZO 101 -#define TWLG_NAGA 102 -#define TWLG_ORISSI 103 -#define TWLG_PUNJABI 104 -#define TWLG_PUSHTU 105 -#define TWLG_SERBIAN_CYRILLIC 106 -#define TWLG_SIKKIMI 107 -#define TWLG_SWEDISH_FINLAND 108 -#define TWLG_TAMIL 109 -#define TWLG_TELUGU 110 -#define TWLG_TRIPURI 111 -#define TWLG_URDU 112 -#define TWLG_VIETNAMESE 113 - - -/**************************************************************************** - * Data Groups * - ****************************************************************************/ -#define DG_CONTROL 0x0001L -#define DG_IMAGE 0x0002L -#define DG_AUDIO 0x0004L - -/* More Data Functionality may be added in the future. - * These are for items that need to be determined before DS is opened. - * NOTE: Supported Functionality constants must be powers of 2 as they are - * used as bitflags when Application asks DSM to present a list of DSs. - * to support backward capability the App and DS will not use the fields - */ -#define DF_DSM2 0x10000000L -#define DF_APP2 0x20000000L - -#define DF_DS2 0x40000000L - -#define DG_MASK 0xFFFFL - -/**************************************************************************** - * * - ****************************************************************************/ -#define DAT_NULL 0x0000 -#define DAT_CUSTOMBASE 0x8000 - -/* Data Argument Types for the DG_CONTROL Data Group. */ -#define DAT_CAPABILITY 0x0001 -#define DAT_EVENT 0x0002 -#define DAT_IDENTITY 0x0003 -#define DAT_PARENT 0x0004 -#define DAT_PENDINGXFERS 0x0005 -#define DAT_SETUPMEMXFER 0x0006 -#define DAT_SETUPFILEXFER 0x0007 -#define DAT_STATUS 0x0008 -#define DAT_USERINTERFACE 0x0009 -#define DAT_XFERGROUP 0x000a -#define DAT_CUSTOMDSDATA 0x000c -#define DAT_DEVICEEVENT 0x000d -#define DAT_FILESYSTEM 0x000e -#define DAT_PASSTHRU 0x000f -#define DAT_CALLBACK 0x0010 -#define DAT_STATUSUTF8 0x0011 -#define DAT_CALLBACK2 0x0012 - -/* Data Argument Types for the DG_IMAGE Data Group. */ -#define DAT_IMAGEINFO 0x0101 -#define DAT_IMAGELAYOUT 0x0102 -#define DAT_IMAGEMEMXFER 0x0103 -#define DAT_IMAGENATIVEXFER 0x0104 -#define DAT_IMAGEFILEXFER 0x0105 -#define DAT_CIECOLOR 0x0106 -#define DAT_GRAYRESPONSE 0x0107 -#define DAT_RGBRESPONSE 0x0108 -#define DAT_JPEGCOMPRESSION 0x0109 -#define DAT_PALETTE8 0x010a -#define DAT_EXTIMAGEINFO 0x010b -#define DAT_FILTER 0x010c - -/* Data Argument Types for the DG_AUDIO Data Group. */ -#define DAT_AUDIOFILEXFER 0x0201 -#define DAT_AUDIOINFO 0x0202 -#define DAT_AUDIONATIVEXFER 0x0203 - -/* misplaced */ -#define DAT_ICCPROFILE 0x0401 -#define DAT_IMAGEMEMFILEXFER 0x0402 -#define DAT_ENTRYPOINT 0x0403 - - -/**************************************************************************** - * Messages * - ****************************************************************************/ - -/* All message constants are unique. - * Messages are grouped according to which DATs they are used with.*/ - -#define MSG_NULL 0x0000 -#define MSG_CUSTOMBASE 0x8000 - -/* Generic messages may be used with any of several DATs. */ -#define MSG_GET 0x0001 -#define MSG_GETCURRENT 0x0002 -#define MSG_GETDEFAULT 0x0003 -#define MSG_GETFIRST 0x0004 -#define MSG_GETNEXT 0x0005 -#define MSG_SET 0x0006 -#define MSG_RESET 0x0007 -#define MSG_QUERYSUPPORT 0x0008 -#define MSG_GETHELP 0x0009 -#define MSG_GETLABEL 0x000a -#define MSG_GETLABELENUM 0x000b -#define MSG_SETCONSTRAINT 0x000c - -/* Messages used with DAT_NULL */ -#define MSG_XFERREADY 0x0101 -#define MSG_CLOSEDSREQ 0x0102 -#define MSG_CLOSEDSOK 0x0103 -#define MSG_DEVICEEVENT 0X0104 - -/* Messages used with a pointer to DAT_PARENT data */ -#define MSG_OPENDSM 0x0301 -#define MSG_CLOSEDSM 0x0302 - -/* Messages used with a pointer to a DAT_IDENTITY structure */ -#define MSG_OPENDS 0x0401 -#define MSG_CLOSEDS 0x0402 -#define MSG_USERSELECT 0x0403 - -/* Messages used with a pointer to a DAT_USERINTERFACE structure */ -#define MSG_DISABLEDS 0x0501 -#define MSG_ENABLEDS 0x0502 -#define MSG_ENABLEDSUIONLY 0x0503 - -/* Messages used with a pointer to a DAT_EVENT structure */ -#define MSG_PROCESSEVENT 0x0601 - -/* Messages used with a pointer to a DAT_PENDINGXFERS structure */ -#define MSG_ENDXFER 0x0701 -#define MSG_STOPFEEDER 0x0702 - -/* Messages used with a pointer to a DAT_FILESYSTEM structure */ -#define MSG_CHANGEDIRECTORY 0x0801 -#define MSG_CREATEDIRECTORY 0x0802 -#define MSG_DELETE 0x0803 -#define MSG_FORMATMEDIA 0x0804 -#define MSG_GETCLOSE 0x0805 -#define MSG_GETFIRSTFILE 0x0806 -#define MSG_GETINFO 0x0807 -#define MSG_GETNEXTFILE 0x0808 -#define MSG_RENAME 0x0809 -#define MSG_COPY 0x080A -#define MSG_AUTOMATICCAPTUREDIRECTORY 0x080B - -/* Messages used with a pointer to a DAT_PASSTHRU structure */ -#define MSG_PASSTHRU 0x0901 - -/* used with DAT_CALLBACK */ -#define MSG_REGISTER_CALLBACK 0x0902 - -/* used with DAT_CAPABILITY */ -#define MSG_RESETALL 0x0A01 - -/**************************************************************************** - * Capabilities * - ****************************************************************************/ - -#define CAP_CUSTOMBASE 0x8000 /* Base of custom capabilities */ - -/* all data sources are REQUIRED to support these caps */ -#define CAP_XFERCOUNT 0x0001 - -/* image data sources are REQUIRED to support these caps */ -#define ICAP_COMPRESSION 0x0100 -#define ICAP_PIXELTYPE 0x0101 -#define ICAP_UNITS 0x0102 -#define ICAP_XFERMECH 0x0103 - -/* all data sources MAY support these caps */ -#define CAP_AUTHOR 0x1000 -#define CAP_CAPTION 0x1001 -#define CAP_FEEDERENABLED 0x1002 -#define CAP_FEEDERLOADED 0x1003 -#define CAP_TIMEDATE 0x1004 -#define CAP_SUPPORTEDCAPS 0x1005 -#define CAP_EXTENDEDCAPS 0x1006 -#define CAP_AUTOFEED 0x1007 -#define CAP_CLEARPAGE 0x1008 -#define CAP_FEEDPAGE 0x1009 -#define CAP_REWINDPAGE 0x100a -#define CAP_INDICATORS 0x100b -#define CAP_PAPERDETECTABLE 0x100d -#define CAP_UICONTROLLABLE 0x100e -#define CAP_DEVICEONLINE 0x100f -#define CAP_AUTOSCAN 0x1010 -#define CAP_THUMBNAILSENABLED 0x1011 -#define CAP_DUPLEX 0x1012 -#define CAP_DUPLEXENABLED 0x1013 -#define CAP_ENABLEDSUIONLY 0x1014 -#define CAP_CUSTOMDSDATA 0x1015 -#define CAP_ENDORSER 0x1016 -#define CAP_JOBCONTROL 0x1017 -#define CAP_ALARMS 0x1018 -#define CAP_ALARMVOLUME 0x1019 -#define CAP_AUTOMATICCAPTURE 0x101a -#define CAP_TIMEBEFOREFIRSTCAPTURE 0x101b -#define CAP_TIMEBETWEENCAPTURES 0x101c -#define CAP_CLEARBUFFERS 0x101d -#define CAP_MAXBATCHBUFFERS 0x101e -#define CAP_DEVICETIMEDATE 0x101f -#define CAP_POWERSUPPLY 0x1020 -#define CAP_CAMERAPREVIEWUI 0x1021 -#define CAP_DEVICEEVENT 0x1022 -#define CAP_SERIALNUMBER 0x1024 -#define CAP_PRINTER 0x1026 -#define CAP_PRINTERENABLED 0x1027 -#define CAP_PRINTERINDEX 0x1028 -#define CAP_PRINTERMODE 0x1029 -#define CAP_PRINTERSTRING 0x102a -#define CAP_PRINTERSUFFIX 0x102b -#define CAP_LANGUAGE 0x102c -#define CAP_FEEDERALIGNMENT 0x102d -#define CAP_FEEDERORDER 0x102e -#define CAP_REACQUIREALLOWED 0x1030 -#define CAP_BATTERYMINUTES 0x1032 -#define CAP_BATTERYPERCENTAGE 0x1033 -#define CAP_CAMERASIDE 0x1034 -#define CAP_SEGMENTED 0x1035 -#define CAP_CAMERAENABLED 0x1036 -#define CAP_CAMERAORDER 0x1037 -#define CAP_MICRENABLED 0x1038 -#define CAP_FEEDERPREP 0x1039 -#define CAP_FEEDERPOCKET 0x103a -#define CAP_AUTOMATICSENSEMEDIUM 0x103b -#define CAP_CUSTOMINTERFACEGUID 0x103c -#define CAP_SUPPORTEDCAPSSEGMENTUNIQUE 0x103d -#define CAP_SUPPORTEDDATS 0x103e -#define CAP_DOUBLEFEEDDETECTION 0x103f -#define CAP_DOUBLEFEEDDETECTIONLENGTH 0x1040 -#define CAP_DOUBLEFEEDDETECTIONSENSITIVITY 0x1041 -#define CAP_DOUBLEFEEDDETECTIONRESPONSE 0x1042 -#define CAP_PAPERHANDLING 0x1043 -#define CAP_INDICATORSMODE 0x1044 -#define CAP_PRINTERVERTICALOFFSET 0x1045 -#define CAP_POWERSAVETIME 0x1046 - - - -/* image data sources MAY support these caps */ -#define ICAP_AUTOBRIGHT 0x1100 -#define ICAP_BRIGHTNESS 0x1101 -#define ICAP_CONTRAST 0x1103 -#define ICAP_CUSTHALFTONE 0x1104 -#define ICAP_EXPOSURETIME 0x1105 -#define ICAP_FILTER 0x1106 -#define ICAP_FLASHUSED 0x1107 -#define ICAP_GAMMA 0x1108 -#define ICAP_HALFTONES 0x1109 -#define ICAP_HIGHLIGHT 0x110a -#define ICAP_IMAGEFILEFORMAT 0x110c -#define ICAP_LAMPSTATE 0x110d -#define ICAP_LIGHTSOURCE 0x110e -#define ICAP_ORIENTATION 0x1110 -#define ICAP_PHYSICALWIDTH 0x1111 -#define ICAP_PHYSICALHEIGHT 0x1112 -#define ICAP_SHADOW 0x1113 -#define ICAP_FRAMES 0x1114 -#define ICAP_XNATIVERESOLUTION 0x1116 -#define ICAP_YNATIVERESOLUTION 0x1117 -#define ICAP_XRESOLUTION 0x1118 -#define ICAP_YRESOLUTION 0x1119 -#define ICAP_MAXFRAMES 0x111a -#define ICAP_TILES 0x111b -#define ICAP_BITORDER 0x111c -#define ICAP_CCITTKFACTOR 0x111d -#define ICAP_LIGHTPATH 0x111e -#define ICAP_PIXELFLAVOR 0x111f -#define ICAP_PLANARCHUNKY 0x1120 -#define ICAP_ROTATION 0x1121 -#define ICAP_SUPPORTEDSIZES 0x1122 -#define ICAP_THRESHOLD 0x1123 -#define ICAP_XSCALING 0x1124 -#define ICAP_YSCALING 0x1125 -#define ICAP_BITORDERCODES 0x1126 -#define ICAP_PIXELFLAVORCODES 0x1127 -#define ICAP_JPEGPIXELTYPE 0x1128 -#define ICAP_TIMEFILL 0x112a -#define ICAP_BITDEPTH 0x112b -#define ICAP_BITDEPTHREDUCTION 0x112c -#define ICAP_UNDEFINEDIMAGESIZE 0x112d -#define ICAP_IMAGEDATASET 0x112e -#define ICAP_EXTIMAGEINFO 0x112f -#define ICAP_MINIMUMHEIGHT 0x1130 -#define ICAP_MINIMUMWIDTH 0x1131 -#define ICAP_AUTODISCARDBLANKPAGES 0x1134 -#define ICAP_FLIPROTATION 0x1136 -#define ICAP_BARCODEDETECTIONENABLED 0x1137 -#define ICAP_SUPPORTEDBARCODETYPES 0x1138 -#define ICAP_BARCODEMAXSEARCHPRIORITIES 0x1139 -#define ICAP_BARCODESEARCHPRIORITIES 0x113a -#define ICAP_BARCODESEARCHMODE 0x113b -#define ICAP_BARCODEMAXRETRIES 0x113c -#define ICAP_BARCODETIMEOUT 0x113d -#define ICAP_ZOOMFACTOR 0x113e -#define ICAP_PATCHCODEDETECTIONENABLED 0x113f -#define ICAP_SUPPORTEDPATCHCODETYPES 0x1140 -#define ICAP_PATCHCODEMAXSEARCHPRIORITIES 0x1141 -#define ICAP_PATCHCODESEARCHPRIORITIES 0x1142 -#define ICAP_PATCHCODESEARCHMODE 0x1143 -#define ICAP_PATCHCODEMAXRETRIES 0x1144 -#define ICAP_PATCHCODETIMEOUT 0x1145 -#define ICAP_FLASHUSED2 0x1146 -#define ICAP_IMAGEFILTER 0x1147 -#define ICAP_NOISEFILTER 0x1148 -#define ICAP_OVERSCAN 0x1149 -#define ICAP_AUTOMATICBORDERDETECTION 0x1150 -#define ICAP_AUTOMATICDESKEW 0x1151 -#define ICAP_AUTOMATICROTATE 0x1152 -#define ICAP_JPEGQUALITY 0x1153 -#define ICAP_FEEDERTYPE 0x1154 -#define ICAP_ICCPROFILE 0x1155 -#define ICAP_AUTOSIZE 0x1156 -#define ICAP_AUTOMATICCROPUSESFRAME 0x1157 -#define ICAP_AUTOMATICLENGTHDETECTION 0x1158 -#define ICAP_AUTOMATICCOLORENABLED 0x1159 -#define ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE 0x115a -#define ICAP_COLORMANAGEMENTENABLED 0x115b -#define ICAP_IMAGEMERGE 0x115c -#define ICAP_IMAGEMERGEHEIGHTTHRESHOLD 0x115d -#define ICAP_SUPPORTEDEXTIMAGEINFO 0x115e -#define ICAP_FILMTYPE 0x115f -#define ICAP_MIRROR 0x1160 -#define ICAP_JPEGSUBSAMPLING 0x1161 - -/* image data sources MAY support these audio caps */ -#define ACAP_XFERMECH 0x1202 - - -/*************************************************************************** - * Extended Image Info Attributes section Added 1.7 * - ***************************************************************************/ - -#define TWEI_BARCODEX 0x1200 -#define TWEI_BARCODEY 0x1201 -#define TWEI_BARCODETEXT 0x1202 -#define TWEI_BARCODETYPE 0x1203 -#define TWEI_DESHADETOP 0x1204 -#define TWEI_DESHADELEFT 0x1205 -#define TWEI_DESHADEHEIGHT 0x1206 -#define TWEI_DESHADEWIDTH 0x1207 -#define TWEI_DESHADESIZE 0x1208 -#define TWEI_SPECKLESREMOVED 0x1209 -#define TWEI_HORZLINEXCOORD 0x120A -#define TWEI_HORZLINEYCOORD 0x120B -#define TWEI_HORZLINELENGTH 0x120C -#define TWEI_HORZLINETHICKNESS 0x120D -#define TWEI_VERTLINEXCOORD 0x120E -#define TWEI_VERTLINEYCOORD 0x120F -#define TWEI_VERTLINELENGTH 0x1210 -#define TWEI_VERTLINETHICKNESS 0x1211 -#define TWEI_PATCHCODE 0x1212 -#define TWEI_ENDORSEDTEXT 0x1213 -#define TWEI_FORMCONFIDENCE 0x1214 -#define TWEI_FORMTEMPLATEMATCH 0x1215 -#define TWEI_FORMTEMPLATEPAGEMATCH 0x1216 -#define TWEI_FORMHORZDOCOFFSET 0x1217 -#define TWEI_FORMVERTDOCOFFSET 0x1218 -#define TWEI_BARCODECOUNT 0x1219 -#define TWEI_BARCODECONFIDENCE 0x121A -#define TWEI_BARCODEROTATION 0x121B -#define TWEI_BARCODETEXTLENGTH 0x121C -#define TWEI_DESHADECOUNT 0x121D -#define TWEI_DESHADEBLACKCOUNTOLD 0x121E -#define TWEI_DESHADEBLACKCOUNTNEW 0x121F -#define TWEI_DESHADEBLACKRLMIN 0x1220 -#define TWEI_DESHADEBLACKRLMAX 0x1221 -#define TWEI_DESHADEWHITECOUNTOLD 0x1222 -#define TWEI_DESHADEWHITECOUNTNEW 0x1223 -#define TWEI_DESHADEWHITERLMIN 0x1224 -#define TWEI_DESHADEWHITERLAVE 0x1225 -#define TWEI_DESHADEWHITERLMAX 0x1226 -#define TWEI_BLACKSPECKLESREMOVED 0x1227 -#define TWEI_WHITESPECKLESREMOVED 0x1228 -#define TWEI_HORZLINECOUNT 0x1229 -#define TWEI_VERTLINECOUNT 0x122A -#define TWEI_DESKEWSTATUS 0x122B -#define TWEI_SKEWORIGINALANGLE 0x122C -#define TWEI_SKEWFINALANGLE 0x122D -#define TWEI_SKEWCONFIDENCE 0x122E -#define TWEI_SKEWWINDOWX1 0x122F -#define TWEI_SKEWWINDOWY1 0x1230 -#define TWEI_SKEWWINDOWX2 0x1231 -#define TWEI_SKEWWINDOWY2 0x1232 -#define TWEI_SKEWWINDOWX3 0x1233 -#define TWEI_SKEWWINDOWY3 0x1234 -#define TWEI_SKEWWINDOWX4 0x1235 -#define TWEI_SKEWWINDOWY4 0x1236 -#define TWEI_BOOKNAME 0x1238 -#define TWEI_CHAPTERNUMBER 0x1239 -#define TWEI_DOCUMENTNUMBER 0x123A -#define TWEI_PAGENUMBER 0x123B -#define TWEI_CAMERA 0x123C -#define TWEI_FRAMENUMBER 0x123D -#define TWEI_FRAME 0x123E -#define TWEI_PIXELFLAVOR 0x123F -#define TWEI_ICCPROFILE 0x1240 -#define TWEI_LASTSEGMENT 0x1241 -#define TWEI_SEGMENTNUMBER 0x1242 -#define TWEI_MAGDATA 0x1243 -#define TWEI_MAGTYPE 0x1244 -#define TWEI_PAGESIDE 0x1245 -#define TWEI_FILESYSTEMSOURCE 0x1246 -#define TWEI_IMAGEMERGED 0x1247 -#define TWEI_MAGDATALENGTH 0x1248 -#define TWEI_PAPERCOUNT 0x1249 - -#define TWEJ_NONE 0x0000 -#define TWEJ_MIDSEPARATOR 0x0001 -#define TWEJ_PATCH1 0x0002 -#define TWEJ_PATCH2 0x0003 -#define TWEJ_PATCH3 0x0004 -#define TWEJ_PATCH4 0x0005 -#define TWEJ_PATCH6 0x0006 -#define TWEJ_PATCHT 0x0007 - - -/*************************************************************************** - * Return Codes and Condition Codes section * - ***************************************************************************/ - -#define TWRC_CUSTOMBASE 0x8000 - -#define TWRC_SUCCESS 0 -#define TWRC_FAILURE 1 -#define TWRC_CHECKSTATUS 2 -#define TWRC_CANCEL 3 -#define TWRC_DSEVENT 4 -#define TWRC_NOTDSEVENT 5 -#define TWRC_XFERDONE 6 -#define TWRC_ENDOFLIST 7 -#define TWRC_INFONOTSUPPORTED 8 -#define TWRC_DATANOTAVAILABLE 9 -#define TWRC_BUSY 10 -#define TWRC_SCANNERLOCKED 11 - -/* Condition Codes: Application gets these by doing DG_CONTROL DAT_STATUS MSG_GET. */ -#define TWCC_CUSTOMBASE 0x8000 - -#define TWCC_SUCCESS 0 -#define TWCC_BUMMER 1 -#define TWCC_LOWMEMORY 2 -#define TWCC_NODS 3 -#define TWCC_MAXCONNECTIONS 4 -#define TWCC_OPERATIONERROR 5 -#define TWCC_BADCAP 6 -#define TWCC_BADPROTOCOL 9 -#define TWCC_BADVALUE 10 -#define TWCC_SEQERROR 11 -#define TWCC_BADDEST 12 -#define TWCC_CAPUNSUPPORTED 13 -#define TWCC_CAPBADOPERATION 14 -#define TWCC_CAPSEQERROR 15 -#define TWCC_DENIED 16 -#define TWCC_FILEEXISTS 17 -#define TWCC_FILENOTFOUND 18 -#define TWCC_NOTEMPTY 19 -#define TWCC_PAPERJAM 20 -#define TWCC_PAPERDOUBLEFEED 21 -#define TWCC_FILEWRITEERROR 22 -#define TWCC_CHECKDEVICEONLINE 23 -#define TWCC_INTERLOCK 24 -#define TWCC_DAMAGEDCORNER 25 -#define TWCC_FOCUSERROR 26 -#define TWCC_DOCTOOLIGHT 27 -#define TWCC_DOCTOODARK 28 -#define TWCC_NOMEDIA 29 - -/* bit patterns: for query the operation that are supported by the data source on a capability */ -/* Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT */ -#define TWQC_GET 0x0001 -#define TWQC_SET 0x0002 -#define TWQC_GETDEFAULT 0x0004 -#define TWQC_GETCURRENT 0x0008 -#define TWQC_RESET 0x0010 -#define TWQC_SETCONSTRAINT 0x0020 -#define TWQC_CONSTRAINABLE 0x0040 - -/**************************************************************************** - * Depreciated Items * - ****************************************************************************/ -#if defined(WIN32) || defined(WIN64) - #define TW_HUGE -#elif !defined(TWH_CMP_GNU) - #define TW_HUGE huge -#else - #define TW_HUGE -#endif - - -typedef BYTE TW_HUGE * HPBYTE; -typedef void TW_HUGE * HPVOID; - -typedef unsigned char TW_STR1024[1026], FAR *pTW_STR1026; -typedef wchar_t TW_UNI512[512], FAR *pTW_UNI512; - -#define TWTY_STR1024 0x000d -#define TWTY_UNI512 0x000e - -#define TWFF_JPN 12 - -#define DAT_TWUNKIDENTITY 0x000b -#define DAT_SETUPFILEXFER2 0x0301 - -#define CAP_SUPPORTEDCAPSEXT 0x100c -#define CAP_FILESYSTEM //0x???? -#define CAP_PAGEMULTIPLEACQUIRE 0x1023 -#define CAP_PAPERBINDING 0x102f -#define CAP_PASSTHRU 0x1031 -#define CAP_POWERDOWNTIME 0x1034 -#define ACAP_AUDIOFILEFORMAT 0x1201 - -#define MSG_CHECKSTATUS - -#define MSG_INVOKE_CALLBACK 0x0903 /* Mac Only, deprecated - use DAT_NULL and MSG_xxx instead */ - -#define TWSX_FILE2 3 - -/* CAP_FILESYSTEM values (FS_ means file system) */ -#define TWFS_FILESYSTEM 0 -#define TWFS_RECURSIVEDELETE 1 - -/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */ -#define TWPT_SRGB64 11 -#define TWPT_BGR 12 -#define TWPT_CIELAB 13 -#define TWPT_CIELUV 14 -#define TWPT_YCBCR 15 - -/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */ -#define TWSS_B 8 -#define TWSS_A4LETTER TWSS_A4 -#define TWSS_B3 TWSS_ISOB3 -#define TWSS_B4 TWSS_ISOB4 -#define TWSS_B6 TWSS_ISOB6 -#define TWSS_B5LETTER TWSS_JISB5 - - -/* ACAP_AUDIOFILEFORMAT values (AF_ means audio format). Added 1.8 */ -#define TWAF_WAV 0 -#define TWAF_AIFF 1 -#define TWAF_AU 3 -#define TWAF_SND 4 - - -/* DAT_SETUPFILEXFER2. Sets up DS to application data transfer via a file. Added 1.9 */ -typedef struct { - TW_MEMREF FileName; - TW_UINT16 FileNameType; - TW_UINT16 Format; - TW_INT16 VRefNum; - TW_UINT32 parID; -} TW_SETUPFILEXFER2, FAR * pTW_SETUPFILEXFER2; - -/* DAT_TWUNKIDENTITY. Provides DS identity and 'other' information necessary */ -/* across thunk link. */ -typedef struct { - TW_IDENTITY identity; - TW_STR255 dsPath; -} TW_TWUNKIDENTITY, FAR * pTW_TWUNKIDENTITY; - -/* Provides DS_Entry parameters over thunk link. */ -typedef struct -{ - TW_INT8 destFlag; - TW_IDENTITY dest; - TW_INT32 dataGroup; - TW_INT16 dataArgType; - TW_INT16 message; - TW_INT32 pDataSize; - // TW_MEMREF pData; -} TW_TWUNKDSENTRYPARAMS, FAR * pTW_TWUNKDSENTRYPARAMS; - -/* Provides DS_Entry results over thunk link. */ -typedef struct -{ - TW_UINT16 returnCode; - TW_UINT16 conditionCode; - TW_INT32 pDataSize; - // TW_MEMREF pData; - - - -} TW_TWUNKDSENTRYRETURN, FAR * pTW_TWUNKDSENTRYRETURN; - -typedef struct -{ - TW_UINT16 Cap; - TW_UINT16 Properties; -} TW_CAPEXT, FAR * pTW_CAPEXT; - -/* DAT_SETUPAUDIOFILEXFER, information required to setup an audio file transfer */ -typedef struct { - TW_STR255 FileName; /* full path target file */ - TW_UINT16 Format; /* one of TWAF_xxxx */ - TW_INT16 VRefNum; -} TW_SETUPAUDIOFILEXFER, FAR * pTW_SETUPAUDIOFILEXFER; - - -/**************************************************************************** - * Entry Points * - ****************************************************************************/ - -/********************************************************************** - * Function: DSM_Entry, the only entry point into the Data Source Manager. - ********************************************************************/ -#ifdef TWH_CMP_MSC - #define TW_CALLINGSTYLE PASCAL -#else - #define TW_CALLINGSTYLE -#endif - -/* Don't mangle the name "DSM_Entry" if we're compiling in C++! */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -TW_UINT16 TW_CALLINGSTYLE DSM_Entry( pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -typedef TW_UINT16 (TW_CALLINGSTYLE *DSMENTRYPROC)(pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); -#ifdef __cplusplus -} -#endif /* cplusplus */ - - -/********************************************************************** - * Function: DS_Entry, the entry point provided by a Data Source. - ********************************************************************/ -/* Don't mangle the name "DS_Entry" if we're compiling in C++! */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -TW_UINT16 TW_CALLINGSTYLE DS_Entry(pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -typedef TW_UINT16 (FAR PASCAL *DSENTRYPROC)(pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -TW_UINT16 TW_CALLINGSTYLE TWAIN_Callback( pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); -typedef TW_UINT16 (TW_CALLINGSTYLE *TWAINCALLBACKPROC)(pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -TW_HANDLE TW_CALLINGSTYLE DSM_MemAllocate (TW_UINT32); -typedef TW_HANDLE (TW_CALLINGSTYLE *DSM_MEMALLOCATE)(TW_UINT32 _size); - -void TW_CALLINGSTYLE DSM_MemFree (TW_HANDLE); -typedef void (TW_CALLINGSTYLE *DSM_MEMFREE)(TW_HANDLE _handle); - -TW_MEMREF TW_CALLINGSTYLE DSM_MemLock (TW_HANDLE); -typedef TW_MEMREF (TW_CALLINGSTYLE *DSM_MEMLOCK)(TW_HANDLE _handle); - -void TW_CALLINGSTYLE DSM_MemUnlock (TW_HANDLE); -typedef void (TW_CALLINGSTYLE *DSM_MEMUNLOCK)(TW_HANDLE _handle); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -/* DAT_ENTRYPOINT. returns essential entry points. */ -typedef struct { - TW_UINT32 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*/ -typedef struct { - TW_UINT32 Size; - TW_UINT32 HueStart; - TW_UINT32 HueEnd; - TW_UINT32 SaturationStart; - TW_UINT32 SaturationEnd; - TW_UINT32 ValueStart; - TW_UINT32 ValueEnd; - TW_UINT32 Replacement; -} TW_FILTER_DESCRIPTOR, *pTW_FILTER_DESCRIPTOR; - -/* DAT_FILTER */ -typedef struct { - TW_UINT32 Size; - TW_UINT32 DescriptorCount; - TW_UINT32 MaxDescriptorCount; - TW_UINT32 Condition; - TW_HANDLE hDescriptors; -} TW_FILTER, *pTW_FILTER; - - -/* Restore the previous packing alignment: this occurs after all structures are defined */ -#ifdef TWH_CMP_MSC - #pragma pack (pop, before_twain) -#elif defined(TWH_CMP_GNU) - #pragma pack (pop, before_twain) -#elif defined(TWH_CMP_BORLAND) - #pragma option a. -#endif - -#endif /* TWAIN */ diff --git a/twain-doc/twain2.3.h b/twain-doc/twain2.3.h deleted file mode 100644 index 365c79e..0000000 --- a/twain-doc/twain2.3.h +++ /dev/null @@ -1,2238 +0,0 @@ -/* ======================================================================== *\ - - Copyright (C) 2007 TWAIN Working Group: Adobe Systems Incorporated, - AnyDoc Software Inc., Eastman Kodak Company, Fujitsu Computer Products - of America, JFL Peripheral Solutions Inc., Ricoh Corporation, and - Xerox Corporation. All rights reserved. - - Copyright (C) 1991, 1992 TWAIN Working Group: Aldus, Caere, Eastman-Kodak, - Hewlett-Packard and Logitech Corporations. All rights reserved. - - Copyright (C) 1997 TWAIN Working Group: Bell+Howell, Canon, DocuMagix, - Fujitsu, Genoa Technology, Hewlett-Packard, Kofax Imaging Products, and - Ricoh Corporation. All rights reserved. - - Copyright (C) 1998 TWAIN Working Group: Adobe Systems Incorporated, - Canon Information Systems, Eastman Kodak Company, - Fujitsu Computer Products of America, Genoa Technology, - Hewlett-Packard Company, Intel Corporation, Kofax Image Products, - JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. - All rights reserved. - - Copyright (C) 2000 TWAIN Working Group: Adobe Systems Incorporated, - Canon Information Systems, Digimarc Corporation, Eastman Kodak Company, - Fujitsu Computer Products of America, Hewlett-Packard Company, - JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. - All rights reserved. - - - TWAIN.h - This is the definitive include file for applications and - data sources written to the TWAIN specification. - It defines constants, data structures, messages etc. - for the public interface to TWAIN. - - Revision History: - version 1.0, March 6, 1992. TWAIN 1.0. - version 1.1, January 1993. Tech Notes 1.1 - version 1.5, June 1993. Specification Update 1.5 - Change DC to TW - Change filename from DC.H to TWAIN.H - version 1.5, July 1993. Remove spaces from country identifiers - - version 1.7, July 1997 Added Capabilities and data structure for - document imaging and digital cameras. - KHL. - version 1.7, July 1997 Inserted Borland compatibile structure packing - directives provided by Mentor. JMH - version 1.7, Aug 1997 Expanded file tabs to spaces. - NOTE: future authors should be sure to have - their editors set to automatically expand tabs - to spaces (original tab setting was 4 spaces). - version 1.7, Sept 1997 Added job control values - Added return codes - version 1.7, Sept 1997 changed definition of pRGBRESPONSE to - pTW_RGBRESPONSE - version 1.7 Aug 1998 Added missing TWEI_BARCODEROTATION values - TWBCOR_ types JMH - version 1.8 August 1998 Added new types and definitions required - for 1.8 Specification JMH - version 1.8 January 1999 Changed search mode from SRCH_ to TWBD_ as - in 1.8 Specification, added TWBT_MAXICODE JMH - version 1.8 January 1999 Removed undocumented duplicate AUTO JMH - version 1.8 March 1999 Removed undocumented 1.8 caps: - CAP_FILESYSTEM - CAP_PAPERBINDING - CAP_PASSTHRU - CAP_POWERDOWNTIME - ICAP_AUTODISCARDBLANKPAGES - * CAP_PAGEMULTIPLEACQUIRE - is CAP_REACQUIREALLOWED, - requires spec change. JMH - Added Mac structure packing modifications JMH - version 1.9 March 2000 Added new types and definations required - for 1.9 Specification MLM - version 1.9 March 2000 Added ICAP_JPEGQUALITY, TWJQ_ values, - updated TWON_PROTOCOLMINOR for Release v1.9 MN - version 1.91 August 2007 Added new types and definitions required - for 1.91 Specification MLM - version 2.0 Sept 2007 Added new types and definitions required - for 2.0 Specification FHH - version 2.0 Mar 2008 Depreciated ICAP_PIXELTYPEs TWPT_SRGB64, TWPT_BGR, - TWPT_CIELAB, TWPT_CIELUV, and TWPT_YCBCR JMW - version 2.0 Mar 2008 Added missing new 2.0 CAP_ definitions JMW - version 2.0 Dec 2008 Updated TW_INFO structure for 64bit JMW - version 2.1 Mar 2009 Added new types and definitions required - for 2.1 Specification JMW - version 2.2 Nov 2010 Added new types and definitions required - for 2.2 Specification MSM - version 2.3 Feb 2013 Added new types and definitions required - for 2.3 Specification MLM -\* ======================================================================== */ - -#ifndef TWAIN -#define TWAIN - -/**************************************************************************** - * TWAIN Version * - ****************************************************************************/ -#define TWON_PROTOCOLMINOR 3 /* Changed for Version 2.3 */ -#define TWON_PROTOCOLMAJOR 2 - -/**************************************************************************** - * Platform Dependent Definitions and Typedefs * - ****************************************************************************/ - -/* Microsoft C/C++ Compiler */ -#if defined(WIN32) || defined(WIN64) || defined (_WINDOWS) - #define TWH_CMP_MSC - #if defined(_WIN64) || defined(WIN64) - #define TWH_64BIT - #elif defined(WIN32) || defined(_WIN32) - #define TWH_32BIT - #endif - -/* GNU C/C++ Compiler */ -#elif defined(__GNUC__) - #define TWH_CMP_GNU - #if defined(__alpha__)\ - ||defined(__ia64__)\ - ||defined(__ppc64__)\ - ||defined(__s390x__)\ - ||defined(__x86_64__) - #define TWH_64BIT - #else - #define TWH_32BIT - #endif - - -/* Borland C/C++ Compiler */ -#elif defined(__BORLAND__) - #define TWH_CMP_BORLAND - #define TWH_32BIT -/* Unrecognized */ -#else - #error Unrecognized compiler -#endif - -/* Apple Compiler (which is GNU now) */ -#if defined(__APPLE__) - #define TWH_CMP_XCODE - #ifdef __MWERKS__ - #include - #else - #include - #endif -#endif - -/* Win32 and Win64 systems */ -#if defined(TWH_CMP_MSC) | defined(TWH_CMP_BORLAND) - typedef HANDLE TW_HANDLE; - typedef LPVOID TW_MEMREF; - typedef UINT_PTR TW_UINTPTR; - -/* MacOS/X... */ -#elif defined(TWH_CMP_XCODE) - #define PASCAL pascal - #define FAR - typedef Handle TW_HANDLE; - typedef char *TW_MEMREF; - typedef unsigned char BYTE; - - #ifdef TWH_32BIT - //32 bit GNU - typedef unsigned long TW_UINTPTR; - #else - //64 bit GNU - typedef unsigned long long TW_UINTPTR; - #endif - -/* Everything else... */ -#else - #define PASCAL - #define FAR - typedef void* TW_HANDLE; - typedef void* TW_MEMREF; - typedef unsigned char BYTE; - - #ifdef TWH_32BIT - //32 bit GNU - typedef unsigned long TW_UINTPTR; - #else - //64 bit GNU - typedef unsigned long long TW_UINTPTR; - #endif -#endif - - -/* Set the packing: this occurs before any structures are defined */ -#ifdef TWH_CMP_MSC - #pragma pack (push, before_twain) - #pragma pack (2) -#elif defined(TWH_CMP_GNU) - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - #pragma options align = power - #else - #pragma pack (push, before_twain) - #pragma pack (2) - #endif -#elif defined(TWH_CMP_BORLAND) - #pragma option -a2 -#endif - - -/**************************************************************************** - * Type Definitions * - ****************************************************************************/ - -/* String types. These include room for the strings and a NULL char, * - * or, on the Mac, a length byte followed by the string. * - * TW_STR255 must hold less than 256 chars so length fits in first byte. */ -#if defined(__APPLE__)/* cf: Mac version of TWAIN.h */ - typedef unsigned char TW_STR32[34], FAR *pTW_STR32; - typedef unsigned char TW_STR64[66], FAR *pTW_STR64; - typedef unsigned char TW_STR128[130], FAR *pTW_STR128; - typedef unsigned char TW_STR255[256], FAR *pTW_STR255; -#else - typedef char TW_STR32[34], FAR *pTW_STR32; - typedef char TW_STR64[66], FAR *pTW_STR64; - typedef char TW_STR128[130], FAR *pTW_STR128; - typedef char TW_STR255[256], FAR *pTW_STR255; -#endif - -/* Numeric types. */ -typedef char TW_INT8, FAR *pTW_INT8; -typedef short TW_INT16, FAR *pTW_INT16; -#if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - typedef int TW_INT32, FAR *pTW_INT32; -#else - typedef long TW_INT32, FAR *pTW_INT32; -#endif -typedef unsigned char TW_UINT8, FAR *pTW_UINT8; -typedef unsigned short TW_UINT16, FAR *pTW_UINT16; -#if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - typedef unsigned int TW_UINT32, FAR *pTW_UINT32; -#else - typedef unsigned long TW_UINT32, FAR *pTW_UINT32; -#endif -typedef unsigned short TW_BOOL, FAR *pTW_BOOL; - - -/**************************************************************************** - * Structure Definitions * - ****************************************************************************/ - -/* Fixed point structure type. */ -typedef struct { - TW_INT16 Whole; - TW_UINT16 Frac; -} TW_FIX32, FAR *pTW_FIX32; - -/* Defines a frame rectangle in ICAP_UNITS coordinates. */ -typedef struct { - TW_FIX32 Left; - TW_FIX32 Top; - TW_FIX32 Right; - TW_FIX32 Bottom; -} TW_FRAME, FAR * pTW_FRAME; - -/* Defines the parameters used for channel-specific transformation. */ -typedef struct { - TW_FIX32 StartIn; - TW_FIX32 BreakIn; - TW_FIX32 EndIn; - TW_FIX32 StartOut; - TW_FIX32 BreakOut; - TW_FIX32 EndOut; - TW_FIX32 Gamma; - TW_FIX32 SampleCount; -} TW_DECODEFUNCTION, FAR * pTW_DECODEFUNCTION; - -/* Stores a Fixed point number in two parts, a whole and a fractional part. */ -typedef struct { - TW_DECODEFUNCTION Decode[3]; - TW_FIX32 Mix[3][3]; -} TW_TRANSFORMSTAGE, FAR * pTW_TRANSFORMSTAGE; - -/* Container for array of values */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 NumItems; - TW_UINT8 ItemList[1]; -} TW_ARRAY, FAR * pTW_ARRAY; - -/* Information about audio data */ -typedef struct { - TW_STR255 Name; - TW_UINT32 Reserved; -} TW_AUDIOINFO, FAR * pTW_AUDIOINFO; - -/* Used to register callbacks. */ -typedef struct { - TW_MEMREF CallBackProc; - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - TW_MEMREF RefCon; - #else - TW_UINT32 RefCon; - #endif - TW_INT16 Message; -} TW_CALLBACK, FAR * pTW_CALLBACK; - -/* Used to register callbacks. */ -typedef struct { - TW_MEMREF CallBackProc; - TW_UINTPTR RefCon; - TW_INT16 Message; -} TW_CALLBACK2, FAR * pTW_CALLBACK2; - -/* Used by application to get/set capability from/in a data source. */ -typedef struct { - TW_UINT16 Cap; - TW_UINT16 ConType; - TW_HANDLE hContainer; -} TW_CAPABILITY, FAR * pTW_CAPABILITY; - -/* Defines a CIE XYZ space tri-stimulus value. */ -typedef struct { - TW_FIX32 X; - TW_FIX32 Y; - TW_FIX32 Z; -} TW_CIEPOINT, FAR * pTW_CIEPOINT; - -/* Defines the mapping from an RGB color space device into CIE 1931 (XYZ) color space. */ -typedef struct { - TW_UINT16 ColorSpace; - TW_INT16 LowEndian; - TW_INT16 DeviceDependent; - TW_INT32 VersionNumber; - TW_TRANSFORMSTAGE StageABC; - TW_TRANSFORMSTAGE StageLMN; - TW_CIEPOINT WhitePoint; - TW_CIEPOINT BlackPoint; - TW_CIEPOINT WhitePaper; - TW_CIEPOINT BlackInk; - TW_FIX32 Samples[1]; -} TW_CIECOLOR, FAR * pTW_CIECOLOR; - -/* Allows for a data source and application to pass custom data to each other. */ -typedef struct { - TW_UINT32 InfoLength; - TW_HANDLE hData; -}TW_CUSTOMDSDATA, FAR *pTW_CUSTOMDSDATA; - -/* Provides information about the Event that was raised by the Source */ -typedef struct { - TW_UINT32 Event; - TW_STR255 DeviceName; - TW_UINT32 BatteryMinutes; - TW_INT16 BatteryPercentage; - TW_INT32 PowerSupply; - TW_FIX32 XResolution; - TW_FIX32 YResolution; - TW_UINT32 FlashUsed2; - TW_UINT32 AutomaticCapture; - TW_UINT32 TimeBeforeFirstCapture; - TW_UINT32 TimeBetweenCaptures; -} TW_DEVICEEVENT, FAR * pTW_DEVICEEVENT; - -/* This structure holds the tri-stimulus color palette information for TW_PALETTE8 structures.*/ -typedef struct { - TW_UINT8 Index; - TW_UINT8 Channel1; - TW_UINT8 Channel2; - TW_UINT8 Channel3; -} TW_ELEMENT8, FAR * pTW_ELEMENT8; - -/* Stores a group of individual values describing a capability. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 NumItems; - TW_UINT32 CurrentIndex; - TW_UINT32 DefaultIndex; - TW_UINT8 ItemList[1]; -} TW_ENUMERATION, FAR * pTW_ENUMERATION; - -/* Used to pass application events/messages from the application to the Source. */ -typedef struct { - TW_MEMREF pEvent; - TW_UINT16 TWMessage; -} TW_EVENT, FAR * pTW_EVENT; - -/* This structure is used to pass specific information between the data source and the application. */ -typedef struct { - TW_UINT16 InfoID; - TW_UINT16 ItemType; - TW_UINT16 NumItems; - union { - TW_UINT16 ReturnCode; - TW_UINT16 CondCode; // Deprecated, do not use - }; - TW_UINTPTR Item; -}TW_INFO, FAR* pTW_INFO; - -typedef struct { - TW_UINT32 NumInfos; - TW_INFO Info[1]; -}TW_EXTIMAGEINFO, FAR* pTW_EXTIMAGEINFO; - -/* Provides information about the currently selected device */ -typedef struct { - TW_STR255 InputName; - TW_STR255 OutputName; - TW_MEMREF Context; - union { - int Recursive; - TW_BOOL Subdirectories; - }; - union { - TW_INT32 FileType; - TW_UINT32 FileSystemType; - }; - TW_UINT32 Size; - TW_STR32 CreateTimeDate; - TW_STR32 ModifiedTimeDate; - TW_UINT32 FreeSpace; - TW_INT32 NewImageSize; - TW_UINT32 NumberOfFiles; - TW_UINT32 NumberOfSnippets; - TW_UINT32 DeviceGroupMask; - TW_INT8 Reserved[508]; -} TW_FILESYSTEM, FAR * pTW_FILESYSTEM; - -/* This structure is used by the application to specify a set of mapping values to be applied to grayscale data. */ -typedef struct { - TW_ELEMENT8 Response[1]; -} TW_GRAYRESPONSE, FAR * pTW_GRAYRESPONSE; - -/* A general way to describe the version of software that is running. */ -typedef struct { - TW_UINT16 MajorNum; - TW_UINT16 MinorNum; - TW_UINT16 Language; - TW_UINT16 Country; - TW_STR32 Info; -} TW_VERSION, FAR * pTW_VERSION; - -/* Provides identification information about a TWAIN entity.*/ -typedef struct { - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - TW_MEMREF Id; - #else - TW_UINT32 Id; - #endif - TW_VERSION Version; - TW_UINT16 ProtocolMajor; - TW_UINT16 ProtocolMinor; - TW_UINT32 SupportedGroups; - TW_STR32 Manufacturer; - TW_STR32 ProductFamily; - TW_STR32 ProductName; -} TW_IDENTITY, FAR * pTW_IDENTITY; - -/* Describes the "real" image data, that is, the complete image being transferred between the Source and application. */ -typedef struct { - TW_FIX32 XResolution; - TW_FIX32 YResolution; - TW_INT32 ImageWidth; - TW_INT32 ImageLength; - TW_INT16 SamplesPerPixel; - TW_INT16 BitsPerSample[8]; - TW_INT16 BitsPerPixel; - TW_BOOL Planar; - TW_INT16 PixelType; - TW_UINT16 Compression; -} TW_IMAGEINFO, FAR * pTW_IMAGEINFO; - -/* Involves information about the original size of the acquired image. */ -typedef struct { - TW_FRAME Frame; - TW_UINT32 DocumentNumber; - TW_UINT32 PageNumber; - TW_UINT32 FrameNumber; -} TW_IMAGELAYOUT, FAR * pTW_IMAGELAYOUT; - -/* Provides information for managing memory buffers. */ -typedef struct { - TW_UINT32 Flags; - TW_UINT32 Length; - TW_MEMREF TheMem; -} TW_MEMORY, FAR * pTW_MEMORY; - -/* Describes the form of the acquired data being passed from the Source to the application.*/ -typedef struct { - TW_UINT16 Compression; - TW_UINT32 BytesPerRow; - TW_UINT32 Columns; - TW_UINT32 Rows; - TW_UINT32 XOffset; - TW_UINT32 YOffset; - TW_UINT32 BytesWritten; - TW_MEMORY Memory; -} TW_IMAGEMEMXFER, FAR * pTW_IMAGEMEMXFER; - -/* Describes the information necessary to transfer a JPEG-compressed image. */ -typedef struct { - TW_UINT16 ColorSpace; - TW_UINT32 SubSampling; - TW_UINT16 NumComponents; - TW_UINT16 RestartFrequency; - TW_UINT16 QuantMap[4]; - TW_MEMORY QuantTable[4]; - TW_UINT16 HuffmanMap[4]; - TW_MEMORY HuffmanDC[2]; - TW_MEMORY HuffmanAC[2]; -} TW_JPEGCOMPRESSION, FAR * pTW_JPEGCOMPRESSION; - -/* Stores a single value (item) which describes a capability. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 Item; -} TW_ONEVALUE, FAR * pTW_ONEVALUE; - -/* This structure holds the color palette information. */ -typedef struct { - TW_UINT16 NumColors; - TW_UINT16 PaletteType; - TW_ELEMENT8 Colors[256]; -} TW_PALETTE8, FAR * pTW_PALETTE8; - -/* Used to bypass the TWAIN protocol when communicating with a device */ -typedef struct { - TW_MEMREF pCommand; - TW_UINT32 CommandBytes; - TW_INT32 Direction; - TW_MEMREF pData; - TW_UINT32 DataBytes; - TW_UINT32 DataBytesXfered; -} TW_PASSTHRU, FAR * pTW_PASSTHRU; - -/* This structure tells the application how many more complete transfers the Source currently has available. */ -typedef struct { - TW_UINT16 Count; - union { - TW_UINT32 EOJ; - TW_UINT32 Reserved; - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - union { - TW_UINT32 EOJ; - TW_UINT32 Reserved; - } TW_JOBCONTROL; - #endif - }; -} TW_PENDINGXFERS, FAR *pTW_PENDINGXFERS; - -/* Stores a range of individual values describing a capability. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 MinValue; - TW_UINT32 MaxValue; - TW_UINT32 StepSize; - TW_UINT32 DefaultValue; - TW_UINT32 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. */ -typedef struct { - TW_ELEMENT8 Response[1]; -} TW_RGBRESPONSE, FAR * pTW_RGBRESPONSE; - -/* Describes the file format and file specification information for a transfer through a disk file. */ -typedef struct { - TW_STR255 FileName; - TW_UINT16 Format; - TW_INT16 VRefNum; -} TW_SETUPFILEXFER, FAR * pTW_SETUPFILEXFER; - -/* Provides the application information about the Source's requirements and preferences regarding allocation of transfer buffer(s). */ -typedef struct { - TW_UINT32 MinBufSize; - TW_UINT32 MaxBufSize; - TW_UINT32 Preferred; -} TW_SETUPMEMXFER, FAR * pTW_SETUPMEMXFER; - -/* Describes the status of a source. */ -typedef struct { - TW_UINT16 ConditionCode; - union { - TW_UINT16 Data; - TW_UINT16 Reserved; - }; -} TW_STATUS, FAR * pTW_STATUS; - -/* Translates the contents of Status into a localized UTF8string. */ -typedef struct { - TW_STATUS Status; - TW_UINT32 Size; - TW_HANDLE UTF8string; -} TW_STATUSUTF8, FAR * pTW_STATUSUTF8; - -/* This structure is used to handle the user interface coordination between an application and a Source. */ -typedef struct { - TW_BOOL ShowUI; - TW_BOOL ModalUI; - TW_HANDLE hParent; -} TW_USERINTERFACE, FAR * pTW_USERINTERFACE; - - -/**************************************************************************** - * Generic Constants * - ****************************************************************************/ - -#define TWON_ARRAY 3 -#define TWON_ENUMERATION 4 -#define TWON_ONEVALUE 5 -#define TWON_RANGE 6 - -#define TWON_ICONID 962 -#define TWON_DSMID 461 -#define TWON_DSMCODEID 63 - -#define TWON_DONTCARE8 0xff -#define TWON_DONTCARE16 0xffff -#define TWON_DONTCARE32 0xffffffff - -/* Flags used in TW_MEMORY structure. */ -#define TWMF_APPOWNS 0x0001 -#define TWMF_DSMOWNS 0x0002 -#define TWMF_DSOWNS 0x0004 -#define TWMF_POINTER 0x0008 -#define TWMF_HANDLE 0x0010 - -#define TWTY_INT8 0x0000 -#define TWTY_INT16 0x0001 -#define TWTY_INT32 0x0002 - -#define TWTY_UINT8 0x0003 -#define TWTY_UINT16 0x0004 -#define TWTY_UINT32 0x0005 - -#define TWTY_BOOL 0x0006 - -#define TWTY_FIX32 0x0007 - -#define TWTY_FRAME 0x0008 - -#define TWTY_STR32 0x0009 -#define TWTY_STR64 0x000a -#define TWTY_STR128 0x000b -#define TWTY_STR255 0x000c -#define TWTY_HANDLE 0x000f - - -/**************************************************************************** - * Capability Constants * - ****************************************************************************/ - -/* CAP_ALARMS values */ -#define TWAL_ALARM 0 -#define TWAL_FEEDERERROR 1 -#define TWAL_FEEDERWARNING 2 -#define TWAL_BARCODE 3 -#define TWAL_DOUBLEFEED 4 -#define TWAL_JAM 5 -#define TWAL_PATCHCODE 6 -#define TWAL_POWER 7 -#define TWAL_SKEW 8 - -/* ICAP_AUTOSIZE values */ -#define TWAS_NONE 0 -#define TWAS_AUTO 1 -#define TWAS_CURRENT 2 - -/* TWEI_BARCODEROTATION values */ -#define TWBCOR_ROT0 0 -#define TWBCOR_ROT90 1 -#define TWBCOR_ROT180 2 -#define TWBCOR_ROT270 3 -#define TWBCOR_ROTX 4 - -/* ICAP_BARCODESEARCHMODE values */ -#define TWBD_HORZ 0 -#define TWBD_VERT 1 -#define TWBD_HORZVERT 2 -#define TWBD_VERTHORZ 3 - -/* ICAP_BITORDER values */ -#define TWBO_LSBFIRST 0 -#define TWBO_MSBFIRST 1 - -/* ICAP_AUTODISCARDBLANKPAGES values */ -#define TWBP_DISABLE -2 -#define TWBP_AUTO -1 - -/* ICAP_BITDEPTHREDUCTION values */ -#define TWBR_THRESHOLD 0 -#define TWBR_HALFTONE 1 -#define TWBR_CUSTHALFTONE 2 -#define TWBR_DIFFUSION 3 -#define TWBR_DYNAMICTHRESHOLD 4 - -/* ICAP_SUPPORTEDBARCODETYPES and TWEI_BARCODETYPE values*/ -#define TWBT_3OF9 0 -#define TWBT_2OF5INTERLEAVED 1 -#define TWBT_2OF5NONINTERLEAVED 2 -#define TWBT_CODE93 3 -#define TWBT_CODE128 4 -#define TWBT_UCC128 5 -#define TWBT_CODABAR 6 -#define TWBT_UPCA 7 -#define TWBT_UPCE 8 -#define TWBT_EAN8 9 -#define TWBT_EAN13 10 -#define TWBT_POSTNET 11 -#define TWBT_PDF417 12 -#define TWBT_2OF5INDUSTRIAL 13 -#define TWBT_2OF5MATRIX 14 -#define TWBT_2OF5DATALOGIC 15 -#define TWBT_2OF5IATA 16 -#define TWBT_3OF9FULLASCII 17 -#define TWBT_CODABARWITHSTARTSTOP 18 -#define TWBT_MAXICODE 19 -#define TWBT_QRCODE 20 - -/* ICAP_COMPRESSION values*/ -#define TWCP_NONE 0 -#define TWCP_PACKBITS 1 -#define TWCP_GROUP31D 2 -#define TWCP_GROUP31DEOL 3 -#define TWCP_GROUP32D 4 -#define TWCP_GROUP4 5 -#define TWCP_JPEG 6 -#define TWCP_LZW 7 -#define TWCP_JBIG 8 -#define TWCP_PNG 9 -#define TWCP_RLE4 10 -#define TWCP_RLE8 11 -#define TWCP_BITFIELDS 12 -#define TWCP_ZIP 13 -#define TWCP_JPEG2000 14 - -/* CAP_CAMERASIDE and TWEI_PAGESIDE values */ -#define TWCS_BOTH 0 -#define TWCS_TOP 1 -#define TWCS_BOTTOM 2 - -/* CAP_CLEARBUFFERS values */ -#define TWCB_AUTO 0 -#define TWCB_CLEAR 1 -#define TWCB_NOCLEAR 2 - -/* CAP_DEVICEEVENT values */ -#define TWDE_CUSTOMEVENTS 0x8000 -#define TWDE_CHECKAUTOMATICCAPTURE 0 -#define TWDE_CHECKBATTERY 1 -#define TWDE_CHECKDEVICEONLINE 2 -#define TWDE_CHECKFLASH 3 -#define TWDE_CHECKPOWERSUPPLY 4 -#define TWDE_CHECKRESOLUTION 5 -#define TWDE_DEVICEADDED 6 -#define TWDE_DEVICEOFFLINE 7 -#define TWDE_DEVICEREADY 8 -#define TWDE_DEVICEREMOVED 9 -#define TWDE_IMAGECAPTURED 10 -#define TWDE_IMAGEDELETED 11 -#define TWDE_PAPERDOUBLEFEED 12 -#define TWDE_PAPERJAM 13 -#define TWDE_LAMPFAILURE 14 -#define TWDE_POWERSAVE 15 -#define TWDE_POWERSAVENOTIFY 16 - -/* TW_PASSTHRU.Direction values. */ -#define TWDR_GET 1 -#define TWDR_SET 2 - -/* TWEI_DESKEWSTATUS values. */ -#define TWDSK_SUCCESS 0 -#define TWDSK_REPORTONLY 1 -#define TWDSK_FAIL 2 -#define TWDSK_DISABLED 3 - -/* CAP_DUPLEX values */ -#define TWDX_NONE 0 -#define TWDX_1PASSDUPLEX 1 -#define TWDX_2PASSDUPLEX 2 - -/* CAP_FEEDERALIGNMENT values */ -#define TWFA_NONE 0 -#define TWFA_LEFT 1 -#define TWFA_CENTER 2 -#define TWFA_RIGHT 3 - -/* ICAP_FEEDERTYPE values*/ -#define TWFE_GENERAL 0 -#define TWFE_PHOTO 1 - -/* ICAP_IMAGEFILEFORMAT values */ -#define TWFF_TIFF 0 -#define TWFF_PICT 1 -#define TWFF_BMP 2 -#define TWFF_XBM 3 -#define TWFF_JFIF 4 -#define TWFF_FPX 5 -#define TWFF_TIFFMULTI 6 -#define TWFF_PNG 7 -#define TWFF_SPIFF 8 -#define TWFF_EXIF 9 -#define TWFF_PDF 10 -#define TWFF_JP2 11 -#define TWFF_JPX 13 -#define TWFF_DEJAVU 14 -#define TWFF_PDFA 15 -#define TWFF_PDFA2 16 - -/* ICAP_FLASHUSED2 values */ -#define TWFL_NONE 0 -#define TWFL_OFF 1 -#define TWFL_ON 2 -#define TWFL_AUTO 3 -#define TWFL_REDEYE 4 - -/* CAP_FEEDERORDER values */ -#define TWFO_FIRSTPAGEFIRST 0 -#define TWFO_LASTPAGEFIRST 1 - -/* CAP_FEEDERPOCKET values*/ -#define TWFP_POCKETERROR 0 -#define TWFP_POCKET1 1 -#define TWFP_POCKET2 2 -#define TWFP_POCKET3 3 -#define TWFP_POCKET4 4 -#define TWFP_POCKET5 5 -#define TWFP_POCKET6 6 -#define TWFP_POCKET7 7 -#define TWFP_POCKET8 8 -#define TWFP_POCKET9 9 -#define TWFP_POCKET10 10 -#define TWFP_POCKET11 11 -#define TWFP_POCKET12 12 -#define TWFP_POCKET13 13 -#define TWFP_POCKET14 14 -#define TWFP_POCKET15 15 -#define TWFP_POCKET16 16 - -/* ICAP_FLIPROTATION values */ -#define TWFR_BOOK 0 -#define TWFR_FANFOLD 1 - -/* ICAP_FILTER values */ -#define TWFT_RED 0 -#define TWFT_GREEN 1 -#define TWFT_BLUE 2 -#define TWFT_NONE 3 -#define TWFT_WHITE 4 -#define TWFT_CYAN 5 -#define TWFT_MAGENTA 6 -#define TWFT_YELLOW 7 -#define TWFT_BLACK 8 - -/* TW_FILESYSTEM.FileType values */ -#define TWFY_CAMERA 0 -#define TWFY_CAMERATOP 1 -#define TWFY_CAMERABOTTOM 2 -#define TWFY_CAMERAPREVIEW 3 -#define TWFY_DOMAIN 4 -#define TWFY_HOST 5 -#define TWFY_DIRECTORY 6 -#define TWFY_IMAGE 7 -#define TWFY_UNKNOWN 8 - -/* ICAP_ICCPROFILE values */ -#define TWIC_NONE 0 -#define TWIC_LINK 1 -#define TWIC_EMBED 2 - -/* ICAP_IMAGEFILTER values */ -#define TWIF_NONE 0 -#define TWIF_AUTO 1 -#define TWIF_LOWPASS 2 -#define TWIF_BANDPASS 3 -#define TWIF_HIGHPASS 4 -#define TWIF_TEXT TWIF_BANDPASS -#define TWIF_FINELINE TWIF_HIGHPASS - -/* ICAP_IMAGEMERGE values */ -#define TWIM_NONE 0 -#define TWIM_FRONTONTOP 1 -#define TWIM_FRONTONBOTTOM 2 -#define TWIM_FRONTONLEFT 3 -#define TWIM_FRONTONRIGHT 4 - -/* CAP_JOBCONTROL values */ -#define TWJC_NONE 0 -#define TWJC_JSIC 1 -#define TWJC_JSIS 2 -#define TWJC_JSXC 3 -#define TWJC_JSXS 4 - -/* ICAP_JPEGQUALITY values */ -#define TWJQ_UNKNOWN -4 -#define TWJQ_LOW -3 -#define TWJQ_MEDIUM -2 -#define TWJQ_HIGH -1 - -/* ICAP_LIGHTPATH values */ -#define TWLP_REFLECTIVE 0 -#define TWLP_TRANSMISSIVE 1 - -/* ICAP_LIGHTSOURCE values */ -#define TWLS_RED 0 -#define TWLS_GREEN 1 -#define TWLS_BLUE 2 -#define TWLS_NONE 3 -#define TWLS_WHITE 4 -#define TWLS_UV 5 -#define TWLS_IR 6 - -/* TWEI_MAGTYPE values */ -#define TWMD_MICR 0 -#define TWMD_RAW 1 -#define TWMD_INVALID 2 - -/* ICAP_NOISEFILTER values */ -#define TWNF_NONE 0 -#define TWNF_AUTO 1 -#define TWNF_LONEPIXEL 2 -#define TWNF_MAJORITYRULE 3 - -/* ICAP_ORIENTATION values */ -#define TWOR_ROT0 0 -#define TWOR_ROT90 1 -#define TWOR_ROT180 2 -#define TWOR_ROT270 3 -#define TWOR_PORTRAIT TWOR_ROT0 -#define TWOR_LANDSCAPE TWOR_ROT270 -#define TWOR_AUTO 4 -#define TWOR_AUTOTEXT 5 -#define TWOR_AUTOPICTURE 6 - -/* ICAP_OVERSCAN values */ -#define TWOV_NONE 0 -#define TWOV_AUTO 1 -#define TWOV_TOPBOTTOM 2 -#define TWOV_LEFTRIGHT 3 -#define TWOV_ALL 4 - -/* Palette types for TW_PALETTE8 */ -#define TWPA_RGB 0 -#define TWPA_GRAY 1 -#define TWPA_CMY 2 - -/* ICAP_PLANARCHUNKY values */ -#define TWPC_CHUNKY 0 -#define TWPC_PLANAR 1 - -/* TWEI_PATCHCODE values*/ -#define TWPCH_PATCH1 0 -#define TWPCH_PATCH2 1 -#define TWPCH_PATCH3 2 -#define TWPCH_PATCH4 3 -#define TWPCH_PATCH6 4 -#define TWPCH_PATCHT 5 - -/* ICAP_PIXELFLAVOR values */ -#define TWPF_CHOCOLATE 0 -#define TWPF_VANILLA 1 - -/* CAP_PRINTERMODE values */ -#define TWPM_SINGLESTRING 0 -#define TWPM_MULTISTRING 1 -#define TWPM_COMPOUNDSTRING 2 - -/* CAP_PRINTER values */ -#define TWPR_IMPRINTERTOPBEFORE 0 -#define TWPR_IMPRINTERTOPAFTER 1 -#define TWPR_IMPRINTERBOTTOMBEFORE 2 -#define TWPR_IMPRINTERBOTTOMAFTER 3 -#define TWPR_ENDORSERTOPBEFORE 4 -#define TWPR_ENDORSERTOPAFTER 5 -#define TWPR_ENDORSERBOTTOMBEFORE 6 -#define TWPR_ENDORSERBOTTOMAFTER 7 - -/* CAP_PRINTERFONTSTYLE Added 2.3 */ -#define TWPF_NORMAL 0 -#define TWPF_BOLD 1 -#define TWPF_ITALIC 2 -#define TWPF_LARGESIZE 3 -#define TWPF_SMALLSIZE 4 - -/* CAP_PRINTERINDEXTRIGGER Added 2.3 */ -#define TWCT_PAGE 0 -#define TWCT_PATCH1 1 -#define TWCT_PATCH2 2 -#define TWCT_PATCH3 3 -#define TWCT_PATCH4 4 -#define TWCT_PATCHT 5 -#define TWCT_PATCH6 6 - -/* CAP_POWERSUPPLY values */ -#define TWPS_EXTERNAL 0 -#define TWPS_BATTERY 1 - -/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */ -#define TWPT_BW 0 -#define TWPT_GRAY 1 -#define TWPT_RGB 2 -#define TWPT_PALETTE 3 -#define TWPT_CMY 4 -#define TWPT_CMYK 5 -#define TWPT_YUV 6 -#define TWPT_YUVK 7 -#define TWPT_CIEXYZ 8 -#define TWPT_LAB 9 -#define TWPT_SRGB 10 -#define TWPT_SCRGB 11 -#define TWPT_INFRARED 16 - -/* CAP_SEGMENTED values */ -#define TWSG_NONE 0 -#define TWSG_AUTO 1 -#define TWSG_MANUAL 2 - -/* ICAP_FILMTYPE values */ -#define TWFM_POSITIVE 0 -#define TWFM_NEGATIVE 1 - -/* CAP_DOUBLEFEEDDETECTION */ -#define TWDF_ULTRASONIC 0 -#define TWDF_BYLENGTH 1 -#define TWDF_INFRARED 2 - -/* CAP_DOUBLEFEEDDETECTIONSENSITIVITY */ -#define TWUS_LOW 0 -#define TWUS_MEDIUM 1 -#define TWUS_HIGH 2 - -/* CAP_DOUBLEFEEDDETECTIONRESPONSE */ -#define TWDP_STOP 0 -#define TWDP_STOPANDWAIT 1 -#define TWDP_SOUND 2 -#define TWDP_DONOTIMPRINT 3 - -/* ICAP_MIRROR values */ -#define TWMR_NONE 0 -#define TWMR_VERTICAL 1 -#define TWMR_HORIZONTAL 2 - -/* ICAP_JPEGSUBSAMPLING values */ -#define TWJS_444YCBCR 0 -#define TWJS_444RGB 1 -#define TWJS_422 2 -#define TWJS_421 3 -#define TWJS_411 4 -#define TWJS_420 5 -#define TWJS_410 6 -#define TWJS_311 7 - -/* CAP_PAPERHANDLING values */ -#define TWPH_NORMAL 0 -#define TWPH_FRAGILE 1 -#define TWPH_THICK 2 -#define TWPH_TRIFOLD 3 -#define TWPH_PHOTOGRAPH 4 - -/* CAP_INDICATORSMODE values */ -#define TWCI_INFO 0 -#define TWCI_WARNING 1 -#define TWCI_ERROR 2 -#define TWCI_WARMUP 3 - -/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */ -#define TWSS_NONE 0 -#define TWSS_A4 1 -#define TWSS_JISB5 2 -#define TWSS_USLETTER 3 -#define TWSS_USLEGAL 4 -#define TWSS_A5 5 -#define TWSS_ISOB4 6 -#define TWSS_ISOB6 7 -#define TWSS_USLEDGER 9 -#define TWSS_USEXECUTIVE 10 -#define TWSS_A3 11 -#define TWSS_ISOB3 12 -#define TWSS_A6 13 -#define TWSS_C4 14 -#define TWSS_C5 15 -#define TWSS_C6 16 -#define TWSS_4A0 17 -#define TWSS_2A0 18 -#define TWSS_A0 19 -#define TWSS_A1 20 -#define TWSS_A2 21 -#define TWSS_A7 22 -#define TWSS_A8 23 -#define TWSS_A9 24 -#define TWSS_A10 25 -#define TWSS_ISOB0 26 -#define TWSS_ISOB1 27 -#define TWSS_ISOB2 28 -#define TWSS_ISOB5 29 -#define TWSS_ISOB7 30 -#define TWSS_ISOB8 31 -#define TWSS_ISOB9 32 -#define TWSS_ISOB10 33 -#define TWSS_JISB0 34 -#define TWSS_JISB1 35 -#define TWSS_JISB2 36 -#define TWSS_JISB3 37 -#define TWSS_JISB4 38 -#define TWSS_JISB6 39 -#define TWSS_JISB7 40 -#define TWSS_JISB8 41 -#define TWSS_JISB9 42 -#define TWSS_JISB10 43 -#define TWSS_C0 44 -#define TWSS_C1 45 -#define TWSS_C2 46 -#define TWSS_C3 47 -#define TWSS_C7 48 -#define TWSS_C8 49 -#define TWSS_C9 50 -#define TWSS_C10 51 -#define TWSS_USSTATEMENT 52 -#define TWSS_BUSINESSCARD 53 -#define TWSS_MAXSIZE 54 - -/* ICAP_XFERMECH values (SX_ means Setup XFer) */ -#define TWSX_NATIVE 0 -#define TWSX_FILE 1 -#define TWSX_MEMORY 2 -#define TWSX_MEMFILE 4 - -/* ICAP_UNITS values (UN_ means UNits) */ -#define TWUN_INCHES 0 -#define TWUN_CENTIMETERS 1 -#define TWUN_PICAS 2 -#define TWUN_POINTS 3 -#define TWUN_TWIPS 4 -#define TWUN_PIXELS 5 -#define TWUN_MILLIMETERS 6 - - -/**************************************************************************** - * Country Constants * - ****************************************************************************/ - -#define TWCY_AFGHANISTAN 1001 -#define TWCY_ALGERIA 213 -#define TWCY_AMERICANSAMOA 684 -#define TWCY_ANDORRA 033 -#define TWCY_ANGOLA 1002 -#define TWCY_ANGUILLA 8090 -#define TWCY_ANTIGUA 8091 -#define TWCY_ARGENTINA 54 -#define TWCY_ARUBA 297 -#define TWCY_ASCENSIONI 247 -#define TWCY_AUSTRALIA 61 -#define TWCY_AUSTRIA 43 -#define TWCY_BAHAMAS 8092 -#define TWCY_BAHRAIN 973 -#define TWCY_BANGLADESH 880 -#define TWCY_BARBADOS 8093 -#define TWCY_BELGIUM 32 -#define TWCY_BELIZE 501 -#define TWCY_BENIN 229 -#define TWCY_BERMUDA 8094 -#define TWCY_BHUTAN 1003 -#define TWCY_BOLIVIA 591 -#define TWCY_BOTSWANA 267 -#define TWCY_BRITAIN 6 -#define TWCY_BRITVIRGINIS 8095 -#define TWCY_BRAZIL 55 -#define TWCY_BRUNEI 673 -#define TWCY_BULGARIA 359 -#define TWCY_BURKINAFASO 1004 -#define TWCY_BURMA 1005 -#define TWCY_BURUNDI 1006 -#define TWCY_CAMAROON 237 -#define TWCY_CANADA 2 -#define TWCY_CAPEVERDEIS 238 -#define TWCY_CAYMANIS 8096 -#define TWCY_CENTRALAFREP 1007 -#define TWCY_CHAD 1008 -#define TWCY_CHILE 56 -#define TWCY_CHINA 86 -#define TWCY_CHRISTMASIS 1009 -#define TWCY_COCOSIS 1009 -#define TWCY_COLOMBIA 57 -#define TWCY_COMOROS 1010 -#define TWCY_CONGO 1011 -#define TWCY_COOKIS 1012 -#define TWCY_COSTARICA 506 -#define TWCY_CUBA 005 -#define TWCY_CYPRUS 357 -#define TWCY_CZECHOSLOVAKIA 42 -#define TWCY_DENMARK 45 -#define TWCY_DJIBOUTI 1013 -#define TWCY_DOMINICA 8097 -#define TWCY_DOMINCANREP 8098 -#define TWCY_EASTERIS 1014 -#define TWCY_ECUADOR 593 -#define TWCY_EGYPT 20 -#define TWCY_ELSALVADOR 503 -#define TWCY_EQGUINEA 1015 -#define TWCY_ETHIOPIA 251 -#define TWCY_FALKLANDIS 1016 -#define TWCY_FAEROEIS 298 -#define TWCY_FIJIISLANDS 679 -#define TWCY_FINLAND 358 -#define TWCY_FRANCE 33 -#define TWCY_FRANTILLES 596 -#define TWCY_FRGUIANA 594 -#define TWCY_FRPOLYNEISA 689 -#define TWCY_FUTANAIS 1043 -#define TWCY_GABON 241 -#define TWCY_GAMBIA 220 -#define TWCY_GERMANY 49 -#define TWCY_GHANA 233 -#define TWCY_GIBRALTER 350 -#define TWCY_GREECE 30 -#define TWCY_GREENLAND 299 -#define TWCY_GRENADA 8099 -#define TWCY_GRENEDINES 8015 -#define TWCY_GUADELOUPE 590 -#define TWCY_GUAM 671 -#define TWCY_GUANTANAMOBAY 5399 -#define TWCY_GUATEMALA 502 -#define TWCY_GUINEA 224 -#define TWCY_GUINEABISSAU 1017 -#define TWCY_GUYANA 592 -#define TWCY_HAITI 509 -#define TWCY_HONDURAS 504 -#define TWCY_HONGKONG 852 -#define TWCY_HUNGARY 36 -#define TWCY_ICELAND 354 -#define TWCY_INDIA 91 -#define TWCY_INDONESIA 62 -#define TWCY_IRAN 98 -#define TWCY_IRAQ 964 -#define TWCY_IRELAND 353 -#define TWCY_ISRAEL 972 -#define TWCY_ITALY 39 -#define TWCY_IVORYCOAST 225 -#define TWCY_JAMAICA 8010 -#define TWCY_JAPAN 81 -#define TWCY_JORDAN 962 -#define TWCY_KENYA 254 -#define TWCY_KIRIBATI 1018 -#define TWCY_KOREA 82 -#define TWCY_KUWAIT 965 -#define TWCY_LAOS 1019 -#define TWCY_LEBANON 1020 -#define TWCY_LIBERIA 231 -#define TWCY_LIBYA 218 -#define TWCY_LIECHTENSTEIN 41 -#define TWCY_LUXENBOURG 352 -#define TWCY_MACAO 853 -#define TWCY_MADAGASCAR 1021 -#define TWCY_MALAWI 265 -#define TWCY_MALAYSIA 60 -#define TWCY_MALDIVES 960 -#define TWCY_MALI 1022 -#define TWCY_MALTA 356 -#define TWCY_MARSHALLIS 692 -#define TWCY_MAURITANIA 1023 -#define TWCY_MAURITIUS 230 -#define TWCY_MEXICO 3 -#define TWCY_MICRONESIA 691 -#define TWCY_MIQUELON 508 -#define TWCY_MONACO 33 -#define TWCY_MONGOLIA 1024 -#define TWCY_MONTSERRAT 8011 -#define TWCY_MOROCCO 212 -#define TWCY_MOZAMBIQUE 1025 -#define TWCY_NAMIBIA 264 -#define TWCY_NAURU 1026 -#define TWCY_NEPAL 977 -#define TWCY_NETHERLANDS 31 -#define TWCY_NETHANTILLES 599 -#define TWCY_NEVIS 8012 -#define TWCY_NEWCALEDONIA 687 -#define TWCY_NEWZEALAND 64 -#define TWCY_NICARAGUA 505 -#define TWCY_NIGER 227 -#define TWCY_NIGERIA 234 -#define TWCY_NIUE 1027 -#define TWCY_NORFOLKI 1028 -#define TWCY_NORWAY 47 -#define TWCY_OMAN 968 -#define TWCY_PAKISTAN 92 -#define TWCY_PALAU 1029 -#define TWCY_PANAMA 507 -#define TWCY_PARAGUAY 595 -#define TWCY_PERU 51 -#define TWCY_PHILLIPPINES 63 -#define TWCY_PITCAIRNIS 1030 -#define TWCY_PNEWGUINEA 675 -#define TWCY_POLAND 48 -#define TWCY_PORTUGAL 351 -#define TWCY_QATAR 974 -#define TWCY_REUNIONI 1031 -#define TWCY_ROMANIA 40 -#define TWCY_RWANDA 250 -#define TWCY_SAIPAN 670 -#define TWCY_SANMARINO 39 -#define TWCY_SAOTOME 1033 -#define TWCY_SAUDIARABIA 966 -#define TWCY_SENEGAL 221 -#define TWCY_SEYCHELLESIS 1034 -#define TWCY_SIERRALEONE 1035 -#define TWCY_SINGAPORE 65 -#define TWCY_SOLOMONIS 1036 -#define TWCY_SOMALI 1037 -#define TWCY_SOUTHAFRICA 27 -#define TWCY_SPAIN 34 -#define TWCY_SRILANKA 94 -#define TWCY_STHELENA 1032 -#define TWCY_STKITTS 8013 -#define TWCY_STLUCIA 8014 -#define TWCY_STPIERRE 508 -#define TWCY_STVINCENT 8015 -#define TWCY_SUDAN 1038 -#define TWCY_SURINAME 597 -#define TWCY_SWAZILAND 268 -#define TWCY_SWEDEN 46 -#define TWCY_SWITZERLAND 41 -#define TWCY_SYRIA 1039 -#define TWCY_TAIWAN 886 -#define TWCY_TANZANIA 255 -#define TWCY_THAILAND 66 -#define TWCY_TOBAGO 8016 -#define TWCY_TOGO 228 -#define TWCY_TONGAIS 676 -#define TWCY_TRINIDAD 8016 -#define TWCY_TUNISIA 216 -#define TWCY_TURKEY 90 -#define TWCY_TURKSCAICOS 8017 -#define TWCY_TUVALU 1040 -#define TWCY_UGANDA 256 -#define TWCY_USSR 7 -#define TWCY_UAEMIRATES 971 -#define TWCY_UNITEDKINGDOM 44 -#define TWCY_USA 1 -#define TWCY_URUGUAY 598 -#define TWCY_VANUATU 1041 -#define TWCY_VATICANCITY 39 -#define TWCY_VENEZUELA 58 -#define TWCY_WAKE 1042 -#define TWCY_WALLISIS 1043 -#define TWCY_WESTERNSAHARA 1044 -#define TWCY_WESTERNSAMOA 1045 -#define TWCY_YEMEN 1046 -#define TWCY_YUGOSLAVIA 38 -#define TWCY_ZAIRE 243 -#define TWCY_ZAMBIA 260 -#define TWCY_ZIMBABWE 263 -#define TWCY_ALBANIA 355 -#define TWCY_ARMENIA 374 -#define TWCY_AZERBAIJAN 994 -#define TWCY_BELARUS 375 -#define TWCY_BOSNIAHERZGO 387 -#define TWCY_CAMBODIA 855 -#define TWCY_CROATIA 385 -#define TWCY_CZECHREPUBLIC 420 -#define TWCY_DIEGOGARCIA 246 -#define TWCY_ERITREA 291 -#define TWCY_ESTONIA 372 -#define TWCY_GEORGIA 995 -#define TWCY_LATVIA 371 -#define TWCY_LESOTHO 266 -#define TWCY_LITHUANIA 370 -#define TWCY_MACEDONIA 389 -#define TWCY_MAYOTTEIS 269 -#define TWCY_MOLDOVA 373 -#define TWCY_MYANMAR 95 -#define TWCY_NORTHKOREA 850 -#define TWCY_PUERTORICO 787 -#define TWCY_RUSSIA 7 -#define TWCY_SERBIA 381 -#define TWCY_SLOVAKIA 421 -#define TWCY_SLOVENIA 386 -#define TWCY_SOUTHKOREA 82 -#define TWCY_UKRAINE 380 -#define TWCY_USVIRGINIS 340 -#define TWCY_VIETNAM 84 - -/**************************************************************************** - * Language Constants * - ****************************************************************************/ -#define TWLG_USERLOCALE -1 -#define TWLG_DAN 0 -#define TWLG_DUT 1 -#define TWLG_ENG 2 -#define TWLG_FCF 3 -#define TWLG_FIN 4 -#define TWLG_FRN 5 -#define TWLG_GER 6 -#define TWLG_ICE 7 -#define TWLG_ITN 8 -#define TWLG_NOR 9 -#define TWLG_POR 10 -#define TWLG_SPA 11 -#define TWLG_SWE 12 -#define TWLG_USA 13 -#define TWLG_AFRIKAANS 14 -#define TWLG_ALBANIA 15 -#define TWLG_ARABIC 16 -#define TWLG_ARABIC_ALGERIA 17 -#define TWLG_ARABIC_BAHRAIN 18 -#define TWLG_ARABIC_EGYPT 19 -#define TWLG_ARABIC_IRAQ 20 -#define TWLG_ARABIC_JORDAN 21 -#define TWLG_ARABIC_KUWAIT 22 -#define TWLG_ARABIC_LEBANON 23 -#define TWLG_ARABIC_LIBYA 24 -#define TWLG_ARABIC_MOROCCO 25 -#define TWLG_ARABIC_OMAN 26 -#define TWLG_ARABIC_QATAR 27 -#define TWLG_ARABIC_SAUDIARABIA 28 -#define TWLG_ARABIC_SYRIA 29 -#define TWLG_ARABIC_TUNISIA 30 -#define TWLG_ARABIC_UAE 31 -#define TWLG_ARABIC_YEMEN 32 -#define TWLG_BASQUE 33 -#define TWLG_BYELORUSSIAN 34 -#define TWLG_BULGARIAN 35 -#define TWLG_CATALAN 36 -#define TWLG_CHINESE 37 -#define TWLG_CHINESE_HONGKONG 38 -#define TWLG_CHINESE_PRC 39 -#define TWLG_CHINESE_SINGAPORE 40 -#define TWLG_CHINESE_SIMPLIFIED 41 -#define TWLG_CHINESE_TAIWAN 42 -#define TWLG_CHINESE_TRADITIONAL 43 -#define TWLG_CROATIA 44 -#define TWLG_CZECH 45 -#define TWLG_DANISH TWLG_DAN -#define TWLG_DUTCH TWLG_DUT -#define TWLG_DUTCH_BELGIAN 46 -#define TWLG_ENGLISH TWLG_ENG -#define TWLG_ENGLISH_AUSTRALIAN 47 -#define TWLG_ENGLISH_CANADIAN 48 -#define TWLG_ENGLISH_IRELAND 49 -#define TWLG_ENGLISH_NEWZEALAND 50 -#define TWLG_ENGLISH_SOUTHAFRICA 51 -#define TWLG_ENGLISH_UK 52 -#define TWLG_ENGLISH_USA TWLG_USA -#define TWLG_ESTONIAN 53 -#define TWLG_FAEROESE 54 -#define TWLG_FARSI 55 -#define TWLG_FINNISH TWLG_FIN -#define TWLG_FRENCH TWLG_FRN -#define TWLG_FRENCH_BELGIAN 56 -#define TWLG_FRENCH_CANADIAN TWLG_FCF -#define TWLG_FRENCH_LUXEMBOURG 57 -#define TWLG_FRENCH_SWISS 58 -#define TWLG_GERMAN TWLG_GER -#define TWLG_GERMAN_AUSTRIAN 59 -#define TWLG_GERMAN_LUXEMBOURG 60 -#define TWLG_GERMAN_LIECHTENSTEIN 61 -#define TWLG_GERMAN_SWISS 62 -#define TWLG_GREEK 63 -#define TWLG_HEBREW 64 -#define TWLG_HUNGARIAN 65 -#define TWLG_ICELANDIC TWLG_ICE -#define TWLG_INDONESIAN 66 -#define TWLG_ITALIAN TWLG_ITN -#define TWLG_ITALIAN_SWISS 67 -#define TWLG_JAPANESE 68 -#define TWLG_KOREAN 69 -#define TWLG_KOREAN_JOHAB 70 -#define TWLG_LATVIAN 71 -#define TWLG_LITHUANIAN 72 -#define TWLG_NORWEGIAN TWLG_NOR -#define TWLG_NORWEGIAN_BOKMAL 73 -#define TWLG_NORWEGIAN_NYNORSK 74 -#define TWLG_POLISH 75 -#define TWLG_PORTUGUESE TWLG_POR -#define TWLG_PORTUGUESE_BRAZIL 76 -#define TWLG_ROMANIAN 77 -#define TWLG_RUSSIAN 78 -#define TWLG_SERBIAN_LATIN 79 -#define TWLG_SLOVAK 80 -#define TWLG_SLOVENIAN 81 -#define TWLG_SPANISH TWLG_SPA -#define TWLG_SPANISH_MEXICAN 82 -#define TWLG_SPANISH_MODERN 83 -#define TWLG_SWEDISH TWLG_SWE -#define TWLG_THAI 84 -#define TWLG_TURKISH 85 -#define TWLG_UKRANIAN 86 -#define TWLG_ASSAMESE 87 -#define TWLG_BENGALI 88 -#define TWLG_BIHARI 89 -#define TWLG_BODO 90 -#define TWLG_DOGRI 91 -#define TWLG_GUJARATI 92 -#define TWLG_HARYANVI 93 -#define TWLG_HINDI 94 -#define TWLG_KANNADA 95 -#define TWLG_KASHMIRI 96 -#define TWLG_MALAYALAM 97 -#define TWLG_MARATHI 98 -#define TWLG_MARWARI 99 -#define TWLG_MEGHALAYAN 100 -#define TWLG_MIZO 101 -#define TWLG_NAGA 102 -#define TWLG_ORISSI 103 -#define TWLG_PUNJABI 104 -#define TWLG_PUSHTU 105 -#define TWLG_SERBIAN_CYRILLIC 106 -#define TWLG_SIKKIMI 107 -#define TWLG_SWEDISH_FINLAND 108 -#define TWLG_TAMIL 109 -#define TWLG_TELUGU 110 -#define TWLG_TRIPURI 111 -#define TWLG_URDU 112 -#define TWLG_VIETNAMESE 113 - - -/**************************************************************************** - * Data Groups * - ****************************************************************************/ -#define DG_CONTROL 0x0001L -#define DG_IMAGE 0x0002L -#define DG_AUDIO 0x0004L - -/* More Data Functionality may be added in the future. - * These are for items that need to be determined before DS is opened. - * NOTE: Supported Functionality constants must be powers of 2 as they are - * used as bitflags when Application asks DSM to present a list of DSs. - * to support backward capability the App and DS will not use the fields - */ -#define DF_DSM2 0x10000000L -#define DF_APP2 0x20000000L - -#define DF_DS2 0x40000000L - -#define DG_MASK 0xFFFFL - -/**************************************************************************** - * * - ****************************************************************************/ -#define DAT_NULL 0x0000 -#define DAT_CUSTOMBASE 0x8000 - -/* Data Argument Types for the DG_CONTROL Data Group. */ -#define DAT_CAPABILITY 0x0001 -#define DAT_EVENT 0x0002 -#define DAT_IDENTITY 0x0003 -#define DAT_PARENT 0x0004 -#define DAT_PENDINGXFERS 0x0005 -#define DAT_SETUPMEMXFER 0x0006 -#define DAT_SETUPFILEXFER 0x0007 -#define DAT_STATUS 0x0008 -#define DAT_USERINTERFACE 0x0009 -#define DAT_XFERGROUP 0x000a -#define DAT_CUSTOMDSDATA 0x000c -#define DAT_DEVICEEVENT 0x000d -#define DAT_FILESYSTEM 0x000e -#define DAT_PASSTHRU 0x000f -#define DAT_CALLBACK 0x0010 -#define DAT_STATUSUTF8 0x0011 -#define DAT_CALLBACK2 0x0012 - -/* Data Argument Types for the DG_IMAGE Data Group. */ -#define DAT_IMAGEINFO 0x0101 -#define DAT_IMAGELAYOUT 0x0102 -#define DAT_IMAGEMEMXFER 0x0103 -#define DAT_IMAGENATIVEXFER 0x0104 -#define DAT_IMAGEFILEXFER 0x0105 -#define DAT_CIECOLOR 0x0106 -#define DAT_GRAYRESPONSE 0x0107 -#define DAT_RGBRESPONSE 0x0108 -#define DAT_JPEGCOMPRESSION 0x0109 -#define DAT_PALETTE8 0x010a -#define DAT_EXTIMAGEINFO 0x010b -#define DAT_FILTER 0x010c - -/* Data Argument Types for the DG_AUDIO Data Group. */ -#define DAT_AUDIOFILEXFER 0x0201 -#define DAT_AUDIOINFO 0x0202 -#define DAT_AUDIONATIVEXFER 0x0203 - -/* misplaced */ -#define DAT_ICCPROFILE 0x0401 -#define DAT_IMAGEMEMFILEXFER 0x0402 -#define DAT_ENTRYPOINT 0x0403 - - -/**************************************************************************** - * Messages * - ****************************************************************************/ - -/* All message constants are unique. - * Messages are grouped according to which DATs they are used with.*/ - -#define MSG_NULL 0x0000 -#define MSG_CUSTOMBASE 0x8000 - -/* Generic messages may be used with any of several DATs. */ -#define MSG_GET 0x0001 -#define MSG_GETCURRENT 0x0002 -#define MSG_GETDEFAULT 0x0003 -#define MSG_GETFIRST 0x0004 -#define MSG_GETNEXT 0x0005 -#define MSG_SET 0x0006 -#define MSG_RESET 0x0007 -#define MSG_QUERYSUPPORT 0x0008 -#define MSG_GETHELP 0x0009 -#define MSG_GETLABEL 0x000a -#define MSG_GETLABELENUM 0x000b -#define MSG_SETCONSTRAINT 0x000c - -/* Messages used with DAT_NULL */ -#define MSG_XFERREADY 0x0101 -#define MSG_CLOSEDSREQ 0x0102 -#define MSG_CLOSEDSOK 0x0103 -#define MSG_DEVICEEVENT 0X0104 - -/* Messages used with a pointer to DAT_PARENT data */ -#define MSG_OPENDSM 0x0301 -#define MSG_CLOSEDSM 0x0302 - -/* Messages used with a pointer to a DAT_IDENTITY structure */ -#define MSG_OPENDS 0x0401 -#define MSG_CLOSEDS 0x0402 -#define MSG_USERSELECT 0x0403 - -/* Messages used with a pointer to a DAT_USERINTERFACE structure */ -#define MSG_DISABLEDS 0x0501 -#define MSG_ENABLEDS 0x0502 -#define MSG_ENABLEDSUIONLY 0x0503 - -/* Messages used with a pointer to a DAT_EVENT structure */ -#define MSG_PROCESSEVENT 0x0601 - -/* Messages used with a pointer to a DAT_PENDINGXFERS structure */ -#define MSG_ENDXFER 0x0701 -#define MSG_STOPFEEDER 0x0702 - -/* Messages used with a pointer to a DAT_FILESYSTEM structure */ -#define MSG_CHANGEDIRECTORY 0x0801 -#define MSG_CREATEDIRECTORY 0x0802 -#define MSG_DELETE 0x0803 -#define MSG_FORMATMEDIA 0x0804 -#define MSG_GETCLOSE 0x0805 -#define MSG_GETFIRSTFILE 0x0806 -#define MSG_GETINFO 0x0807 -#define MSG_GETNEXTFILE 0x0808 -#define MSG_RENAME 0x0809 -#define MSG_COPY 0x080A -#define MSG_AUTOMATICCAPTUREDIRECTORY 0x080B - -/* Messages used with a pointer to a DAT_PASSTHRU structure */ -#define MSG_PASSTHRU 0x0901 - -/* used with DAT_CALLBACK */ -#define MSG_REGISTER_CALLBACK 0x0902 - -/* used with DAT_CAPABILITY */ -#define MSG_RESETALL 0x0A01 - -/**************************************************************************** - * Capabilities * - ****************************************************************************/ - -#define CAP_CUSTOMBASE 0x8000 /* Base of custom capabilities */ - -/* all data sources are REQUIRED to support these caps */ -#define CAP_XFERCOUNT 0x0001 - -/* image data sources are REQUIRED to support these caps */ -#define ICAP_COMPRESSION 0x0100 -#define ICAP_PIXELTYPE 0x0101 -#define ICAP_UNITS 0x0102 -#define ICAP_XFERMECH 0x0103 - -/* all data sources MAY support these caps */ -#define CAP_AUTHOR 0x1000 -#define CAP_CAPTION 0x1001 -#define CAP_FEEDERENABLED 0x1002 -#define CAP_FEEDERLOADED 0x1003 -#define CAP_TIMEDATE 0x1004 -#define CAP_SUPPORTEDCAPS 0x1005 -#define CAP_EXTENDEDCAPS 0x1006 -#define CAP_AUTOFEED 0x1007 -#define CAP_CLEARPAGE 0x1008 -#define CAP_FEEDPAGE 0x1009 -#define CAP_REWINDPAGE 0x100a -#define CAP_INDICATORS 0x100b -#define CAP_PAPERDETECTABLE 0x100d -#define CAP_UICONTROLLABLE 0x100e -#define CAP_DEVICEONLINE 0x100f -#define CAP_AUTOSCAN 0x1010 -#define CAP_THUMBNAILSENABLED 0x1011 -#define CAP_DUPLEX 0x1012 -#define CAP_DUPLEXENABLED 0x1013 -#define CAP_ENABLEDSUIONLY 0x1014 -#define CAP_CUSTOMDSDATA 0x1015 -#define CAP_ENDORSER 0x1016 -#define CAP_JOBCONTROL 0x1017 -#define CAP_ALARMS 0x1018 -#define CAP_ALARMVOLUME 0x1019 -#define CAP_AUTOMATICCAPTURE 0x101a -#define CAP_TIMEBEFOREFIRSTCAPTURE 0x101b -#define CAP_TIMEBETWEENCAPTURES 0x101c -#define CAP_CLEARBUFFERS 0x101d -#define CAP_MAXBATCHBUFFERS 0x101e -#define CAP_DEVICETIMEDATE 0x101f -#define CAP_POWERSUPPLY 0x1020 -#define CAP_CAMERAPREVIEWUI 0x1021 -#define CAP_DEVICEEVENT 0x1022 -#define CAP_SERIALNUMBER 0x1024 -#define CAP_PRINTER 0x1026 -#define CAP_PRINTERENABLED 0x1027 -#define CAP_PRINTERINDEX 0x1028 -#define CAP_PRINTERMODE 0x1029 -#define CAP_PRINTERSTRING 0x102a -#define CAP_PRINTERSUFFIX 0x102b -#define CAP_LANGUAGE 0x102c -#define CAP_FEEDERALIGNMENT 0x102d -#define CAP_FEEDERORDER 0x102e -#define CAP_REACQUIREALLOWED 0x1030 -#define CAP_BATTERYMINUTES 0x1032 -#define CAP_BATTERYPERCENTAGE 0x1033 -#define CAP_CAMERASIDE 0x1034 -#define CAP_SEGMENTED 0x1035 -#define CAP_CAMERAENABLED 0x1036 -#define CAP_CAMERAORDER 0x1037 -#define CAP_MICRENABLED 0x1038 -#define CAP_FEEDERPREP 0x1039 -#define CAP_FEEDERPOCKET 0x103a -#define CAP_AUTOMATICSENSEMEDIUM 0x103b -#define CAP_CUSTOMINTERFACEGUID 0x103c -#define CAP_SUPPORTEDCAPSSEGMENTUNIQUE 0x103d -#define CAP_SUPPORTEDDATS 0x103e -#define CAP_DOUBLEFEEDDETECTION 0x103f -#define CAP_DOUBLEFEEDDETECTIONLENGTH 0x1040 -#define CAP_DOUBLEFEEDDETECTIONSENSITIVITY 0x1041 -#define CAP_DOUBLEFEEDDETECTIONRESPONSE 0x1042 -#define CAP_PAPERHANDLING 0x1043 -#define CAP_INDICATORSMODE 0x1044 -#define CAP_PRINTERVERTICALOFFSET 0x1045 -#define CAP_POWERSAVETIME 0x1046 -#define CAP_PRINTERCHARROTATION 0x1047 -#define CAP_PRINTERFONTSTYLE 0x1048 -#define CAP_PRINTERINDEXLEADCHAR 0x1049 -#define CAP_PRINTERINDEXMAXVALUE 0x104A -#define CAP_PRINTERINDEXNUMDIGITS 0x104B -#define CAP_PRINTERINDEXSTEP 0x104C -#define CAP_PRINTERINDEXTRIGGER 0x104D -#define CAP_PRINTERSTRINGPREVIEW 0x104E - - - -/* image data sources MAY support these caps */ -#define ICAP_AUTOBRIGHT 0x1100 -#define ICAP_BRIGHTNESS 0x1101 -#define ICAP_CONTRAST 0x1103 -#define ICAP_CUSTHALFTONE 0x1104 -#define ICAP_EXPOSURETIME 0x1105 -#define ICAP_FILTER 0x1106 -#define ICAP_FLASHUSED 0x1107 -#define ICAP_GAMMA 0x1108 -#define ICAP_HALFTONES 0x1109 -#define ICAP_HIGHLIGHT 0x110a -#define ICAP_IMAGEFILEFORMAT 0x110c -#define ICAP_LAMPSTATE 0x110d -#define ICAP_LIGHTSOURCE 0x110e -#define ICAP_ORIENTATION 0x1110 -#define ICAP_PHYSICALWIDTH 0x1111 -#define ICAP_PHYSICALHEIGHT 0x1112 -#define ICAP_SHADOW 0x1113 -#define ICAP_FRAMES 0x1114 -#define ICAP_XNATIVERESOLUTION 0x1116 -#define ICAP_YNATIVERESOLUTION 0x1117 -#define ICAP_XRESOLUTION 0x1118 -#define ICAP_YRESOLUTION 0x1119 -#define ICAP_MAXFRAMES 0x111a -#define ICAP_TILES 0x111b -#define ICAP_BITORDER 0x111c -#define ICAP_CCITTKFACTOR 0x111d -#define ICAP_LIGHTPATH 0x111e -#define ICAP_PIXELFLAVOR 0x111f -#define ICAP_PLANARCHUNKY 0x1120 -#define ICAP_ROTATION 0x1121 -#define ICAP_SUPPORTEDSIZES 0x1122 -#define ICAP_THRESHOLD 0x1123 -#define ICAP_XSCALING 0x1124 -#define ICAP_YSCALING 0x1125 -#define ICAP_BITORDERCODES 0x1126 -#define ICAP_PIXELFLAVORCODES 0x1127 -#define ICAP_JPEGPIXELTYPE 0x1128 -#define ICAP_TIMEFILL 0x112a -#define ICAP_BITDEPTH 0x112b -#define ICAP_BITDEPTHREDUCTION 0x112c -#define ICAP_UNDEFINEDIMAGESIZE 0x112d -#define ICAP_IMAGEDATASET 0x112e -#define ICAP_EXTIMAGEINFO 0x112f -#define ICAP_MINIMUMHEIGHT 0x1130 -#define ICAP_MINIMUMWIDTH 0x1131 -#define ICAP_AUTODISCARDBLANKPAGES 0x1134 -#define ICAP_FLIPROTATION 0x1136 -#define ICAP_BARCODEDETECTIONENABLED 0x1137 -#define ICAP_SUPPORTEDBARCODETYPES 0x1138 -#define ICAP_BARCODEMAXSEARCHPRIORITIES 0x1139 -#define ICAP_BARCODESEARCHPRIORITIES 0x113a -#define ICAP_BARCODESEARCHMODE 0x113b -#define ICAP_BARCODEMAXRETRIES 0x113c -#define ICAP_BARCODETIMEOUT 0x113d -#define ICAP_ZOOMFACTOR 0x113e -#define ICAP_PATCHCODEDETECTIONENABLED 0x113f -#define ICAP_SUPPORTEDPATCHCODETYPES 0x1140 -#define ICAP_PATCHCODEMAXSEARCHPRIORITIES 0x1141 -#define ICAP_PATCHCODESEARCHPRIORITIES 0x1142 -#define ICAP_PATCHCODESEARCHMODE 0x1143 -#define ICAP_PATCHCODEMAXRETRIES 0x1144 -#define ICAP_PATCHCODETIMEOUT 0x1145 -#define ICAP_FLASHUSED2 0x1146 -#define ICAP_IMAGEFILTER 0x1147 -#define ICAP_NOISEFILTER 0x1148 -#define ICAP_OVERSCAN 0x1149 -#define ICAP_AUTOMATICBORDERDETECTION 0x1150 -#define ICAP_AUTOMATICDESKEW 0x1151 -#define ICAP_AUTOMATICROTATE 0x1152 -#define ICAP_JPEGQUALITY 0x1153 -#define ICAP_FEEDERTYPE 0x1154 -#define ICAP_ICCPROFILE 0x1155 -#define ICAP_AUTOSIZE 0x1156 -#define ICAP_AUTOMATICCROPUSESFRAME 0x1157 -#define ICAP_AUTOMATICLENGTHDETECTION 0x1158 -#define ICAP_AUTOMATICCOLORENABLED 0x1159 -#define ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE 0x115a -#define ICAP_COLORMANAGEMENTENABLED 0x115b -#define ICAP_IMAGEMERGE 0x115c -#define ICAP_IMAGEMERGEHEIGHTTHRESHOLD 0x115d -#define ICAP_SUPPORTEDEXTIMAGEINFO 0x115e -#define ICAP_FILMTYPE 0x115f -#define ICAP_MIRROR 0x1160 -#define ICAP_JPEGSUBSAMPLING 0x1161 - -/* image data sources MAY support these audio caps */ -#define ACAP_XFERMECH 0x1202 - - -/*************************************************************************** - * Extended Image Info Attributes section Added 1.7 * - ***************************************************************************/ - -#define TWEI_BARCODEX 0x1200 -#define TWEI_BARCODEY 0x1201 -#define TWEI_BARCODETEXT 0x1202 -#define TWEI_BARCODETYPE 0x1203 -#define TWEI_DESHADETOP 0x1204 -#define TWEI_DESHADELEFT 0x1205 -#define TWEI_DESHADEHEIGHT 0x1206 -#define TWEI_DESHADEWIDTH 0x1207 -#define TWEI_DESHADESIZE 0x1208 -#define TWEI_SPECKLESREMOVED 0x1209 -#define TWEI_HORZLINEXCOORD 0x120A -#define TWEI_HORZLINEYCOORD 0x120B -#define TWEI_HORZLINELENGTH 0x120C -#define TWEI_HORZLINETHICKNESS 0x120D -#define TWEI_VERTLINEXCOORD 0x120E -#define TWEI_VERTLINEYCOORD 0x120F -#define TWEI_VERTLINELENGTH 0x1210 -#define TWEI_VERTLINETHICKNESS 0x1211 -#define TWEI_PATCHCODE 0x1212 -#define TWEI_ENDORSEDTEXT 0x1213 -#define TWEI_FORMCONFIDENCE 0x1214 -#define TWEI_FORMTEMPLATEMATCH 0x1215 -#define TWEI_FORMTEMPLATEPAGEMATCH 0x1216 -#define TWEI_FORMHORZDOCOFFSET 0x1217 -#define TWEI_FORMVERTDOCOFFSET 0x1218 -#define TWEI_BARCODECOUNT 0x1219 -#define TWEI_BARCODECONFIDENCE 0x121A -#define TWEI_BARCODEROTATION 0x121B -#define TWEI_BARCODETEXTLENGTH 0x121C -#define TWEI_DESHADECOUNT 0x121D -#define TWEI_DESHADEBLACKCOUNTOLD 0x121E -#define TWEI_DESHADEBLACKCOUNTNEW 0x121F -#define TWEI_DESHADEBLACKRLMIN 0x1220 -#define TWEI_DESHADEBLACKRLMAX 0x1221 -#define TWEI_DESHADEWHITECOUNTOLD 0x1222 -#define TWEI_DESHADEWHITECOUNTNEW 0x1223 -#define TWEI_DESHADEWHITERLMIN 0x1224 -#define TWEI_DESHADEWHITERLAVE 0x1225 -#define TWEI_DESHADEWHITERLMAX 0x1226 -#define TWEI_BLACKSPECKLESREMOVED 0x1227 -#define TWEI_WHITESPECKLESREMOVED 0x1228 -#define TWEI_HORZLINECOUNT 0x1229 -#define TWEI_VERTLINECOUNT 0x122A -#define TWEI_DESKEWSTATUS 0x122B -#define TWEI_SKEWORIGINALANGLE 0x122C -#define TWEI_SKEWFINALANGLE 0x122D -#define TWEI_SKEWCONFIDENCE 0x122E -#define TWEI_SKEWWINDOWX1 0x122F -#define TWEI_SKEWWINDOWY1 0x1230 -#define TWEI_SKEWWINDOWX2 0x1231 -#define TWEI_SKEWWINDOWY2 0x1232 -#define TWEI_SKEWWINDOWX3 0x1233 -#define TWEI_SKEWWINDOWY3 0x1234 -#define TWEI_SKEWWINDOWX4 0x1235 -#define TWEI_SKEWWINDOWY4 0x1236 -#define TWEI_BOOKNAME 0x1238 -#define TWEI_CHAPTERNUMBER 0x1239 -#define TWEI_DOCUMENTNUMBER 0x123A -#define TWEI_PAGENUMBER 0x123B -#define TWEI_CAMERA 0x123C -#define TWEI_FRAMENUMBER 0x123D -#define TWEI_FRAME 0x123E -#define TWEI_PIXELFLAVOR 0x123F -#define TWEI_ICCPROFILE 0x1240 -#define TWEI_LASTSEGMENT 0x1241 -#define TWEI_SEGMENTNUMBER 0x1242 -#define TWEI_MAGDATA 0x1243 -#define TWEI_MAGTYPE 0x1244 -#define TWEI_PAGESIDE 0x1245 -#define TWEI_FILESYSTEMSOURCE 0x1246 -#define TWEI_IMAGEMERGED 0x1247 -#define TWEI_MAGDATALENGTH 0x1248 -#define TWEI_PAPERCOUNT 0x1249 -#define TWEI_PRINTERTEXT 0x124A - -#define TWEJ_NONE 0x0000 -#define TWEJ_MIDSEPARATOR 0x0001 -#define TWEJ_PATCH1 0x0002 -#define TWEJ_PATCH2 0x0003 -#define TWEJ_PATCH3 0x0004 -#define TWEJ_PATCH4 0x0005 -#define TWEJ_PATCH6 0x0006 -#define TWEJ_PATCHT 0x0007 - - -/*************************************************************************** - * Return Codes and Condition Codes section * - ***************************************************************************/ - -#define TWRC_CUSTOMBASE 0x8000 - -#define TWRC_SUCCESS 0 -#define TWRC_FAILURE 1 -#define TWRC_CHECKSTATUS 2 -#define TWRC_CANCEL 3 -#define TWRC_DSEVENT 4 -#define TWRC_NOTDSEVENT 5 -#define TWRC_XFERDONE 6 -#define TWRC_ENDOFLIST 7 -#define TWRC_INFONOTSUPPORTED 8 -#define TWRC_DATANOTAVAILABLE 9 -#define TWRC_BUSY 10 -#define TWRC_SCANNERLOCKED 11 - -/* Condition Codes: Application gets these by doing DG_CONTROL DAT_STATUS MSG_GET. */ -#define TWCC_CUSTOMBASE 0x8000 - -#define TWCC_SUCCESS 0 -#define TWCC_BUMMER 1 -#define TWCC_LOWMEMORY 2 -#define TWCC_NODS 3 -#define TWCC_MAXCONNECTIONS 4 -#define TWCC_OPERATIONERROR 5 -#define TWCC_BADCAP 6 -#define TWCC_BADPROTOCOL 9 -#define TWCC_BADVALUE 10 -#define TWCC_SEQERROR 11 -#define TWCC_BADDEST 12 -#define TWCC_CAPUNSUPPORTED 13 -#define TWCC_CAPBADOPERATION 14 -#define TWCC_CAPSEQERROR 15 -#define TWCC_DENIED 16 -#define TWCC_FILEEXISTS 17 -#define TWCC_FILENOTFOUND 18 -#define TWCC_NOTEMPTY 19 -#define TWCC_PAPERJAM 20 -#define TWCC_PAPERDOUBLEFEED 21 -#define TWCC_FILEWRITEERROR 22 -#define TWCC_CHECKDEVICEONLINE 23 -#define TWCC_INTERLOCK 24 -#define TWCC_DAMAGEDCORNER 25 -#define TWCC_FOCUSERROR 26 -#define TWCC_DOCTOOLIGHT 27 -#define TWCC_DOCTOODARK 28 -#define TWCC_NOMEDIA 29 - -/* bit patterns: for query the operation that are supported by the data source on a capability */ -/* Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT */ -#define TWQC_GET 0x0001 -#define TWQC_SET 0x0002 -#define TWQC_GETDEFAULT 0x0004 -#define TWQC_GETCURRENT 0x0008 -#define TWQC_RESET 0x0010 -#define TWQC_SETCONSTRAINT 0x0020 -#define TWQC_CONSTRAINABLE 0x0040 -#define TWQC_GETHELP 0x0100 -#define TWQC_GETLABEL 0x0200 -#define TWQC_GETLABELENUM 0x0400 - -/**************************************************************************** - * Depreciated Items * - ****************************************************************************/ -#if defined(WIN32) || defined(WIN64) - #define TW_HUGE -#elif !defined(TWH_CMP_GNU) - #define TW_HUGE huge -#else - #define TW_HUGE -#endif - - -typedef BYTE TW_HUGE * HPBYTE; -typedef void TW_HUGE * HPVOID; - -typedef unsigned char TW_STR1024[1026], FAR *pTW_STR1026, FAR *pTW_STR1024; -typedef wchar_t TW_UNI512[512], FAR *pTW_UNI512; - -#define TWTY_STR1024 0x000d -#define TWTY_UNI512 0x000e - -#define TWFF_JPN 12 - -#define DAT_TWUNKIDENTITY 0x000b -#define DAT_SETUPFILEXFER2 0x0301 - -#define CAP_SUPPORTEDCAPSEXT 0x100c -#define CAP_FILESYSTEM //0x???? -#define CAP_PAGEMULTIPLEACQUIRE 0x1023 -#define CAP_PAPERBINDING 0x102f -#define CAP_PASSTHRU 0x1031 -#define CAP_POWERDOWNTIME 0x1034 -#define ACAP_AUDIOFILEFORMAT 0x1201 - -#define MSG_CHECKSTATUS 0x0201 - -#define MSG_INVOKE_CALLBACK 0x0903 /* Mac Only, deprecated - use DAT_NULL and MSG_xxx instead */ - -#define TWSX_FILE2 3 - -/* CAP_FILESYSTEM values (FS_ means file system) */ -#define TWFS_FILESYSTEM 0 -#define TWFS_RECURSIVEDELETE 1 - -/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */ -#define TWPT_SRGB64 11 -#define TWPT_BGR 12 -#define TWPT_CIELAB 13 -#define TWPT_CIELUV 14 -#define TWPT_YCBCR 15 - -/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */ -#define TWSS_B 8 -#define TWSS_A4LETTER TWSS_A4 -#define TWSS_B3 TWSS_ISOB3 -#define TWSS_B4 TWSS_ISOB4 -#define TWSS_B6 TWSS_ISOB6 -#define TWSS_B5LETTER TWSS_JISB5 - - -/* ACAP_AUDIOFILEFORMAT values (AF_ means audio format). Added 1.8 */ -#define TWAF_WAV 0 -#define TWAF_AIFF 1 -#define TWAF_AU 3 -#define TWAF_SND 4 - - -/* DAT_SETUPFILEXFER2. Sets up DS to application data transfer via a file. Added 1.9 */ -typedef struct { - TW_MEMREF FileName; - TW_UINT16 FileNameType; - TW_UINT16 Format; - TW_INT16 VRefNum; - TW_UINT32 parID; -} TW_SETUPFILEXFER2, FAR * pTW_SETUPFILEXFER2; - -/* DAT_TWUNKIDENTITY. Provides DS identity and 'other' information necessary */ -/* across thunk link. */ -typedef struct { - TW_IDENTITY identity; - TW_STR255 dsPath; -} TW_TWUNKIDENTITY, FAR * pTW_TWUNKIDENTITY; - -/* Provides DS_Entry parameters over thunk link. */ -typedef struct -{ - TW_INT8 destFlag; - TW_IDENTITY dest; - TW_INT32 dataGroup; - TW_INT16 dataArgType; - TW_INT16 message; - TW_INT32 pDataSize; - // TW_MEMREF pData; -} TW_TWUNKDSENTRYPARAMS, FAR * pTW_TWUNKDSENTRYPARAMS; - -/* Provides DS_Entry results over thunk link. */ -typedef struct -{ - TW_UINT16 returnCode; - TW_UINT16 conditionCode; - TW_INT32 pDataSize; - // TW_MEMREF pData; - - - -} TW_TWUNKDSENTRYRETURN, FAR * pTW_TWUNKDSENTRYRETURN; - -typedef struct -{ - TW_UINT16 Cap; - TW_UINT16 Properties; -} TW_CAPEXT, FAR * pTW_CAPEXT; - -/* DAT_SETUPAUDIOFILEXFER, information required to setup an audio file transfer */ -typedef struct { - TW_STR255 FileName; /* full path target file */ - TW_UINT16 Format; /* one of TWAF_xxxx */ - TW_INT16 VRefNum; -} TW_SETUPAUDIOFILEXFER, FAR * pTW_SETUPAUDIOFILEXFER; - - -/**************************************************************************** - * Entry Points * - ****************************************************************************/ - -/********************************************************************** - * Function: DSM_Entry, the only entry point into the Data Source Manager. - ********************************************************************/ -#ifdef TWH_CMP_MSC - #define TW_CALLINGSTYLE PASCAL -#else - #define TW_CALLINGSTYLE -#endif - -/* Don't mangle the name "DSM_Entry" if we're compiling in C++! */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -TW_UINT16 TW_CALLINGSTYLE DSM_Entry( pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -typedef TW_UINT16 (TW_CALLINGSTYLE *DSMENTRYPROC)(pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); -#ifdef __cplusplus -} -#endif /* cplusplus */ - - -/********************************************************************** - * Function: DS_Entry, the entry point provided by a Data Source. - ********************************************************************/ -/* Don't mangle the name "DS_Entry" if we're compiling in C++! */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -TW_UINT16 TW_CALLINGSTYLE DS_Entry(pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -typedef TW_UINT16 (FAR PASCAL *DSENTRYPROC)(pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -TW_UINT16 TW_CALLINGSTYLE TWAIN_Callback( pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); -typedef TW_UINT16 (TW_CALLINGSTYLE *TWAINCALLBACKPROC)(pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -TW_HANDLE TW_CALLINGSTYLE DSM_MemAllocate (TW_UINT32); -typedef TW_HANDLE (TW_CALLINGSTYLE *DSM_MEMALLOCATE)(TW_UINT32 _size); - -void TW_CALLINGSTYLE DSM_MemFree (TW_HANDLE); -typedef void (TW_CALLINGSTYLE *DSM_MEMFREE)(TW_HANDLE _handle); - -TW_MEMREF TW_CALLINGSTYLE DSM_MemLock (TW_HANDLE); -typedef TW_MEMREF (TW_CALLINGSTYLE *DSM_MEMLOCK)(TW_HANDLE _handle); - -void TW_CALLINGSTYLE DSM_MemUnlock (TW_HANDLE); -typedef void (TW_CALLINGSTYLE *DSM_MEMUNLOCK)(TW_HANDLE _handle); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -/* DAT_ENTRYPOINT. returns essential entry points. */ -typedef struct { - TW_UINT32 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*/ -typedef struct { - TW_UINT32 Size; - TW_UINT32 HueStart; - TW_UINT32 HueEnd; - TW_UINT32 SaturationStart; - TW_UINT32 SaturationEnd; - TW_UINT32 ValueStart; - TW_UINT32 ValueEnd; - TW_UINT32 Replacement; -} TW_FILTER_DESCRIPTOR, *pTW_FILTER_DESCRIPTOR; - -/* DAT_FILTER */ -typedef struct { - TW_UINT32 Size; - TW_UINT32 DescriptorCount; - TW_UINT32 MaxDescriptorCount; - TW_UINT32 Condition; - TW_HANDLE hDescriptors; -} TW_FILTER, *pTW_FILTER; - - -/* Restore the previous packing alignment: this occurs after all structures are defined */ -#ifdef TWH_CMP_MSC - #pragma pack (pop, before_twain) -#elif defined(TWH_CMP_GNU) - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - #pragma options align = reset - #else - #pragma pack (pop, before_twain) - #endif -#elif defined(TWH_CMP_BORLAND) - #pragma option a. -#endif - -#endif /* TWAIN */ diff --git a/twain-doc/twain2.4.h b/twain-doc/twain2.4.h deleted file mode 100644 index 0d1ce92..0000000 --- a/twain-doc/twain2.4.h +++ /dev/null @@ -1,2265 +0,0 @@ -/* ======================================================================== *\ - - Copyright (C) 2007 TWAIN Working Group: Adobe Systems Incorporated, - AnyDoc Software Inc., Eastman Kodak Company, Fujitsu Computer Products - of America, JFL Peripheral Solutions Inc., Ricoh Corporation, and - Xerox Corporation. All rights reserved. - - Copyright (C) 1991, 1992 TWAIN Working Group: Aldus, Caere, Eastman-Kodak, - Hewlett-Packard and Logitech Corporations. All rights reserved. - - Copyright (C) 1997 TWAIN Working Group: Bell+Howell, Canon, DocuMagix, - Fujitsu, Genoa Technology, Hewlett-Packard, Kofax Imaging Products, and - Ricoh Corporation. All rights reserved. - - Copyright (C) 1998 TWAIN Working Group: Adobe Systems Incorporated, - Canon Information Systems, Eastman Kodak Company, - Fujitsu Computer Products of America, Genoa Technology, - Hewlett-Packard Company, Intel Corporation, Kofax Image Products, - JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. - All rights reserved. - - Copyright (C) 2000 TWAIN Working Group: Adobe Systems Incorporated, - Canon Information Systems, Digimarc Corporation, Eastman Kodak Company, - Fujitsu Computer Products of America, Hewlett-Packard Company, - JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. - All rights reserved. - - - TWAIN.h - This is the definitive include file for applications and - data sources written to the TWAIN specification. - It defines constants, data structures, messages etc. - for the public interface to TWAIN. - - Revision History: - version 1.0, March 6, 1992. TWAIN 1.0. - version 1.1, January 1993. Tech Notes 1.1 - version 1.5, June 1993. Specification Update 1.5 - Change DC to TW - Change filename from DC.H to TWAIN.H - version 1.5, July 1993. Remove spaces from country identifiers - - version 1.7, July 1997 Added Capabilities and data structure for - document imaging and digital cameras. - KHL. - version 1.7, July 1997 Inserted Borland compatibile structure packing - directives provided by Mentor. JMH - version 1.7, Aug 1997 Expanded file tabs to spaces. - NOTE: future authors should be sure to have - their editors set to automatically expand tabs - to spaces (original tab setting was 4 spaces). - version 1.7, Sept 1997 Added job control values - Added return codes - version 1.7, Sept 1997 changed definition of pRGBRESPONSE to - pTW_RGBRESPONSE - version 1.7 Aug 1998 Added missing TWEI_BARCODEROTATION values - TWBCOR_ types JMH - version 1.8 August 1998 Added new types and definitions required - for 1.8 Specification JMH - version 1.8 January 1999 Changed search mode from SRCH_ to TWBD_ as - in 1.8 Specification, added TWBT_MAXICODE JMH - version 1.8 January 1999 Removed undocumented duplicate AUTO JMH - version 1.8 March 1999 Removed undocumented 1.8 caps: - CAP_FILESYSTEM - CAP_PAPERBINDING - CAP_PASSTHRU - CAP_POWERDOWNTIME - ICAP_AUTODISCARDBLANKPAGES - * CAP_PAGEMULTIPLEACQUIRE - is CAP_REACQUIREALLOWED, - requires spec change. JMH - Added Mac structure packing modifications JMH - version 1.9 March 2000 Added new types and definations required - for 1.9 Specification MLM - version 1.9 March 2000 Added ICAP_JPEGQUALITY, TWJQ_ values, - updated TWON_PROTOCOLMINOR for Release v1.9 MN - version 1.91 August 2007 Added new types and definitions required - for 1.91 Specification MLM - version 2.0 Sept 2007 Added new types and definitions required - for 2.0 Specification FHH - version 2.0 Mar 2008 Depreciated ICAP_PIXELTYPEs TWPT_SRGB64, TWPT_BGR, - TWPT_CIELAB, TWPT_CIELUV, and TWPT_YCBCR JMW - version 2.0 Mar 2008 Added missing new 2.0 CAP_ definitions JMW - version 2.0 Dec 2008 Updated TW_INFO structure for 64bit JMW - version 2.1 Mar 2009 Added new types and definitions required - for 2.1 Specification JMW - version 2.2 Nov 2010 Added new types and definitions required - for 2.2 Specification MSM - version 2.3 Feb 2013 Added new types and definitions required - for 2.3 Specification MLM - version 2.3a Apr 2015 Errata fixes to TWCY_ANDORRA and TWCY_CUBA - version 2.4 Aug 2015 Added new types and definitions required - for 2.4 Specification MLM - version 2.4a June 2016 Added TW_INT32 and TW_UINT32 fixes for Linux, - (I just added this comment today) - version 2.4b March 2017 Missing changeset from 2.3 verion (2013/06/20) - - -\* ======================================================================== */ - -#ifndef TWAIN -#define TWAIN - -/**************************************************************************** - * TWAIN Version * - ****************************************************************************/ -#define TWON_PROTOCOLMINOR 4 /* Changed for Version 2.4 */ -#define TWON_PROTOCOLMAJOR 2 - -/**************************************************************************** - * Platform Dependent Definitions and Typedefs * - ****************************************************************************/ - -/* Microsoft C/C++ Compiler */ -#if defined(WIN32) || defined(WIN64) || defined (_WINDOWS) - #define TWH_CMP_MSC - #if defined(_WIN64) || defined(WIN64) - #define TWH_64BIT - #elif defined(WIN32) || defined(_WIN32) - #define TWH_32BIT - #endif - -/* GNU C/C++ Compiler */ -#elif defined(__GNUC__) - #define TWH_CMP_GNU - #if defined(__alpha__)\ - ||defined(__ia64__)\ - ||defined(__ppc64__)\ - ||defined(__s390x__)\ - ||defined(__x86_64__) - #define TWH_64BIT - #else - #define TWH_32BIT - #endif - - -/* Borland C/C++ Compiler */ -#elif defined(__BORLAND__) - #define TWH_CMP_BORLAND - #define TWH_32BIT -/* Unrecognized */ -#else - #error Unrecognized compiler -#endif - -/* Apple Compiler (which is GNU now) */ -#if defined(__APPLE__) - #define TWH_CMP_XCODE - #ifdef __MWERKS__ - #include - #else - #include - #endif -#endif - -/* Win32 and Win64 systems */ -#if defined(TWH_CMP_MSC) | defined(TWH_CMP_BORLAND) - typedef HANDLE TW_HANDLE; - typedef LPVOID TW_MEMREF; - typedef UINT_PTR TW_UINTPTR; - -/* MacOS/X... */ -#elif defined(TWH_CMP_XCODE) - #define PASCAL pascal - #define FAR - typedef Handle TW_HANDLE; - typedef char *TW_MEMREF; - typedef unsigned char BYTE; - - #ifdef TWH_32BIT - //32 bit GNU - typedef unsigned long TW_UINTPTR; - #else - //64 bit GNU - typedef unsigned long long TW_UINTPTR; - #endif - -/* Everything else... */ -#else - #define PASCAL - #define FAR - typedef void* TW_HANDLE; - typedef void* TW_MEMREF; - typedef unsigned char BYTE; - - #ifdef TWH_32BIT - //32 bit GNU - typedef unsigned long TW_UINTPTR; - #else - //64 bit GNU - typedef unsigned long long TW_UINTPTR; - #endif -#endif - - -/* Set the packing: this occurs before any structures are defined */ -#ifdef TWH_CMP_MSC - #pragma pack (push, before_twain) - #pragma pack (2) -#elif defined(TWH_CMP_GNU) - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - #pragma options align = power - #else - #pragma pack (push, before_twain) - #pragma pack (2) - #endif -#elif defined(TWH_CMP_BORLAND) - #pragma option -a2 -#endif - - -/**************************************************************************** - * Type Definitions * - ****************************************************************************/ - -/* String types. These include room for the strings and a NULL char, * - * or, on the Mac, a length byte followed by the string. * - * TW_STR255 must hold less than 256 chars so length fits in first byte. */ -#if defined(__APPLE__)/* cf: Mac version of TWAIN.h */ - typedef unsigned char TW_STR32[34], FAR *pTW_STR32; - typedef unsigned char TW_STR64[66], FAR *pTW_STR64; - typedef unsigned char TW_STR128[130], FAR *pTW_STR128; - typedef unsigned char TW_STR255[256], FAR *pTW_STR255; -#else - typedef char TW_STR32[34], FAR *pTW_STR32; - typedef char TW_STR64[66], FAR *pTW_STR64; - typedef char TW_STR128[130], FAR *pTW_STR128; - typedef char TW_STR255[256], FAR *pTW_STR255; -#endif - -/* Numeric types. */ -typedef char TW_INT8, FAR *pTW_INT8; -typedef short TW_INT16, FAR *pTW_INT16; -#if defined(_WIN32) - typedef long TW_INT32, FAR *pTW_INT32; -#else - typedef int TW_INT32, FAR *pTW_INT32; -#endif -typedef unsigned char TW_UINT8, FAR *pTW_UINT8; -typedef unsigned short TW_UINT16, FAR *pTW_UINT16; -#if defined(_WIN32) - typedef unsigned long TW_UINT32, FAR *pTW_UINT32; -#else - typedef unsigned int TW_UINT32, FAR *pTW_UINT32; -#endif -typedef unsigned short TW_BOOL, FAR *pTW_BOOL; - - -/**************************************************************************** - * Structure Definitions * - ****************************************************************************/ - -/* Fixed point structure type. */ -typedef struct { - TW_INT16 Whole; - TW_UINT16 Frac; -} TW_FIX32, FAR *pTW_FIX32; - -/* Defines a frame rectangle in ICAP_UNITS coordinates. */ -typedef struct { - TW_FIX32 Left; - TW_FIX32 Top; - TW_FIX32 Right; - TW_FIX32 Bottom; -} TW_FRAME, FAR * pTW_FRAME; - -/* Defines the parameters used for channel-specific transformation. */ -typedef struct { - TW_FIX32 StartIn; - TW_FIX32 BreakIn; - TW_FIX32 EndIn; - TW_FIX32 StartOut; - TW_FIX32 BreakOut; - TW_FIX32 EndOut; - TW_FIX32 Gamma; - TW_FIX32 SampleCount; -} TW_DECODEFUNCTION, FAR * pTW_DECODEFUNCTION; - -/* Stores a Fixed point number in two parts, a whole and a fractional part. */ -typedef struct { - TW_DECODEFUNCTION Decode[3]; - TW_FIX32 Mix[3][3]; -} TW_TRANSFORMSTAGE, FAR * pTW_TRANSFORMSTAGE; - -/* Container for array of values */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 NumItems; - TW_UINT8 ItemList[1]; -} TW_ARRAY, FAR * pTW_ARRAY; - -/* Information about audio data */ -typedef struct { - TW_STR255 Name; - TW_UINT32 Reserved; -} TW_AUDIOINFO, FAR * pTW_AUDIOINFO; - -/* Used to register callbacks. */ -typedef struct { - TW_MEMREF CallBackProc; - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - TW_MEMREF RefCon; - #else - TW_UINT32 RefCon; - #endif - TW_INT16 Message; -} TW_CALLBACK, FAR * pTW_CALLBACK; - -/* Used to register callbacks. */ -typedef struct { - TW_MEMREF CallBackProc; - TW_UINTPTR RefCon; - TW_INT16 Message; -} TW_CALLBACK2, FAR * pTW_CALLBACK2; - -/* Used by application to get/set capability from/in a data source. */ -typedef struct { - TW_UINT16 Cap; - TW_UINT16 ConType; - TW_HANDLE hContainer; -} TW_CAPABILITY, FAR * pTW_CAPABILITY; - -/* Defines a CIE XYZ space tri-stimulus value. */ -typedef struct { - TW_FIX32 X; - TW_FIX32 Y; - TW_FIX32 Z; -} TW_CIEPOINT, FAR * pTW_CIEPOINT; - -/* Defines the mapping from an RGB color space device into CIE 1931 (XYZ) color space. */ -typedef struct { - TW_UINT16 ColorSpace; - TW_INT16 LowEndian; - TW_INT16 DeviceDependent; - TW_INT32 VersionNumber; - TW_TRANSFORMSTAGE StageABC; - TW_TRANSFORMSTAGE StageLMN; - TW_CIEPOINT WhitePoint; - TW_CIEPOINT BlackPoint; - TW_CIEPOINT WhitePaper; - TW_CIEPOINT BlackInk; - TW_FIX32 Samples[1]; -} TW_CIECOLOR, FAR * pTW_CIECOLOR; - -/* Allows for a data source and application to pass custom data to each other. */ -typedef struct { - TW_UINT32 InfoLength; - TW_HANDLE hData; -}TW_CUSTOMDSDATA, FAR *pTW_CUSTOMDSDATA; - -/* Provides information about the Event that was raised by the Source */ -typedef struct { - TW_UINT32 Event; - TW_STR255 DeviceName; - TW_UINT32 BatteryMinutes; - TW_INT16 BatteryPercentage; - TW_INT32 PowerSupply; - TW_FIX32 XResolution; - TW_FIX32 YResolution; - TW_UINT32 FlashUsed2; - TW_UINT32 AutomaticCapture; - TW_UINT32 TimeBeforeFirstCapture; - TW_UINT32 TimeBetweenCaptures; -} TW_DEVICEEVENT, FAR * pTW_DEVICEEVENT; - -/* This structure holds the tri-stimulus color palette information for TW_PALETTE8 structures.*/ -typedef struct { - TW_UINT8 Index; - TW_UINT8 Channel1; - TW_UINT8 Channel2; - TW_UINT8 Channel3; -} TW_ELEMENT8, FAR * pTW_ELEMENT8; - -/* Stores a group of individual values describing a capability. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 NumItems; - TW_UINT32 CurrentIndex; - TW_UINT32 DefaultIndex; - TW_UINT8 ItemList[1]; -} TW_ENUMERATION, FAR * pTW_ENUMERATION; - -/* Used to pass application events/messages from the application to the Source. */ -typedef struct { - TW_MEMREF pEvent; - TW_UINT16 TWMessage; -} TW_EVENT, FAR * pTW_EVENT; - -/* This structure is used to pass specific information between the data source and the application. */ -typedef struct { - TW_UINT16 InfoID; - TW_UINT16 ItemType; - TW_UINT16 NumItems; - union { - TW_UINT16 ReturnCode; - TW_UINT16 CondCode; // Deprecated, do not use - }; - TW_UINTPTR Item; -}TW_INFO, FAR* pTW_INFO; - -typedef struct { - TW_UINT32 NumInfos; - TW_INFO Info[1]; -}TW_EXTIMAGEINFO, FAR* pTW_EXTIMAGEINFO; - -/* Provides information about the currently selected device */ -typedef struct { - TW_STR255 InputName; - TW_STR255 OutputName; - TW_MEMREF Context; - union { - int Recursive; - TW_BOOL Subdirectories; - }; - union { - TW_INT32 FileType; - TW_UINT32 FileSystemType; - }; - TW_UINT32 Size; - TW_STR32 CreateTimeDate; - TW_STR32 ModifiedTimeDate; - TW_UINT32 FreeSpace; - TW_INT32 NewImageSize; - TW_UINT32 NumberOfFiles; - TW_UINT32 NumberOfSnippets; - TW_UINT32 DeviceGroupMask; - TW_INT8 Reserved[508]; -} TW_FILESYSTEM, FAR * pTW_FILESYSTEM; - -/* This structure is used by the application to specify a set of mapping values to be applied to grayscale data. */ -typedef struct { - TW_ELEMENT8 Response[1]; -} TW_GRAYRESPONSE, FAR * pTW_GRAYRESPONSE; - -/* A general way to describe the version of software that is running. */ -typedef struct { - TW_UINT16 MajorNum; - TW_UINT16 MinorNum; - TW_UINT16 Language; - TW_UINT16 Country; - TW_STR32 Info; -} TW_VERSION, FAR * pTW_VERSION; - -/* Provides identification information about a TWAIN entity.*/ -typedef struct { - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - TW_MEMREF Id; - #else - TW_UINT32 Id; - #endif - TW_VERSION Version; - TW_UINT16 ProtocolMajor; - TW_UINT16 ProtocolMinor; - TW_UINT32 SupportedGroups; - TW_STR32 Manufacturer; - TW_STR32 ProductFamily; - TW_STR32 ProductName; -} TW_IDENTITY, FAR * pTW_IDENTITY; - -/* Describes the "real" image data, that is, the complete image being transferred between the Source and application. */ -typedef struct { - TW_FIX32 XResolution; - TW_FIX32 YResolution; - TW_INT32 ImageWidth; - TW_INT32 ImageLength; - TW_INT16 SamplesPerPixel; - TW_INT16 BitsPerSample[8]; - TW_INT16 BitsPerPixel; - TW_BOOL Planar; - TW_INT16 PixelType; - TW_UINT16 Compression; -} TW_IMAGEINFO, FAR * pTW_IMAGEINFO; - -/* Involves information about the original size of the acquired image. */ -typedef struct { - TW_FRAME Frame; - TW_UINT32 DocumentNumber; - TW_UINT32 PageNumber; - TW_UINT32 FrameNumber; -} TW_IMAGELAYOUT, FAR * pTW_IMAGELAYOUT; - -/* Provides information for managing memory buffers. */ -typedef struct { - TW_UINT32 Flags; - TW_UINT32 Length; - TW_MEMREF TheMem; -} TW_MEMORY, FAR * pTW_MEMORY; - -/* Describes the form of the acquired data being passed from the Source to the application.*/ -typedef struct { - TW_UINT16 Compression; - TW_UINT32 BytesPerRow; - TW_UINT32 Columns; - TW_UINT32 Rows; - TW_UINT32 XOffset; - TW_UINT32 YOffset; - TW_UINT32 BytesWritten; - TW_MEMORY Memory; -} TW_IMAGEMEMXFER, FAR * pTW_IMAGEMEMXFER; - -/* Describes the information necessary to transfer a JPEG-compressed image. */ -typedef struct { - TW_UINT16 ColorSpace; - TW_UINT32 SubSampling; - TW_UINT16 NumComponents; - TW_UINT16 RestartFrequency; - TW_UINT16 QuantMap[4]; - TW_MEMORY QuantTable[4]; - TW_UINT16 HuffmanMap[4]; - TW_MEMORY HuffmanDC[2]; - TW_MEMORY HuffmanAC[2]; -} TW_JPEGCOMPRESSION, FAR * pTW_JPEGCOMPRESSION; - -/* Collects scanning metrics after returning to state 4 */ -typedef struct { - TW_UINT32 SizeOf; - TW_UINT32 ImageCount; - TW_UINT32 SheetCount; -} TW_METRICS, FAR * pTW_METRICS; - -/* Stores a single value (item) which describes a capability. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 Item; -} TW_ONEVALUE, FAR * pTW_ONEVALUE; - -/* This structure holds the color palette information. */ -typedef struct { - TW_UINT16 NumColors; - TW_UINT16 PaletteType; - TW_ELEMENT8 Colors[256]; -} TW_PALETTE8, FAR * pTW_PALETTE8; - -/* Used to bypass the TWAIN protocol when communicating with a device */ -typedef struct { - TW_MEMREF pCommand; - TW_UINT32 CommandBytes; - TW_INT32 Direction; - TW_MEMREF pData; - TW_UINT32 DataBytes; - TW_UINT32 DataBytesXfered; -} TW_PASSTHRU, FAR * pTW_PASSTHRU; - -/* This structure tells the application how many more complete transfers the Source currently has available. */ -typedef struct { - TW_UINT16 Count; - union { - TW_UINT32 EOJ; - TW_UINT32 Reserved; - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - union { - TW_UINT32 EOJ; - TW_UINT32 Reserved; - } TW_JOBCONTROL; - #endif - }; -} TW_PENDINGXFERS, FAR *pTW_PENDINGXFERS; - -/* Stores a range of individual values describing a capability. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 MinValue; - TW_UINT32 MaxValue; - TW_UINT32 StepSize; - TW_UINT32 DefaultValue; - TW_UINT32 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. */ -typedef struct { - TW_ELEMENT8 Response[1]; -} TW_RGBRESPONSE, FAR * pTW_RGBRESPONSE; - -/* Describes the file format and file specification information for a transfer through a disk file. */ -typedef struct { - TW_STR255 FileName; - TW_UINT16 Format; - TW_INT16 VRefNum; -} TW_SETUPFILEXFER, FAR * pTW_SETUPFILEXFER; - -/* Provides the application information about the Source's requirements and preferences regarding allocation of transfer buffer(s). */ -typedef struct { - TW_UINT32 MinBufSize; - TW_UINT32 MaxBufSize; - TW_UINT32 Preferred; -} TW_SETUPMEMXFER, FAR * pTW_SETUPMEMXFER; - -/* Describes the status of a source. */ -typedef struct { - TW_UINT16 ConditionCode; - union { - TW_UINT16 Data; - TW_UINT16 Reserved; - }; -} TW_STATUS, FAR * pTW_STATUS; - -/* Translates the contents of Status into a localized UTF8string. */ -typedef struct { - TW_STATUS Status; - TW_UINT32 Size; - TW_HANDLE UTF8string; -} TW_STATUSUTF8, FAR * pTW_STATUSUTF8; - -typedef struct { - TW_UINT32 SizeOf; - TW_UINT16 CommunicationManager; - TW_HANDLE Send; - TW_UINT32 SendSize; - TW_HANDLE Receive; - TW_UINT32 ReceiveSize; -} TW_TWAINDIRECT, FAR * pTW_TWAINDIRECT; - -/* This structure is used to handle the user interface coordination between an application and a Source. */ -typedef struct { - TW_BOOL ShowUI; - TW_BOOL ModalUI; - TW_HANDLE hParent; -} TW_USERINTERFACE, FAR * pTW_USERINTERFACE; - - -/**************************************************************************** - * Generic Constants * - ****************************************************************************/ - -#define TWON_ARRAY 3 -#define TWON_ENUMERATION 4 -#define TWON_ONEVALUE 5 -#define TWON_RANGE 6 - -#define TWON_ICONID 962 -#define TWON_DSMID 461 -#define TWON_DSMCODEID 63 - -#define TWON_DONTCARE8 0xff -#define TWON_DONTCARE16 0xffff -#define TWON_DONTCARE32 0xffffffff - -/* Flags used in TW_MEMORY structure. */ -#define TWMF_APPOWNS 0x0001 -#define TWMF_DSMOWNS 0x0002 -#define TWMF_DSOWNS 0x0004 -#define TWMF_POINTER 0x0008 -#define TWMF_HANDLE 0x0010 - -#define TWTY_INT8 0x0000 -#define TWTY_INT16 0x0001 -#define TWTY_INT32 0x0002 - -#define TWTY_UINT8 0x0003 -#define TWTY_UINT16 0x0004 -#define TWTY_UINT32 0x0005 - -#define TWTY_BOOL 0x0006 - -#define TWTY_FIX32 0x0007 - -#define TWTY_FRAME 0x0008 - -#define TWTY_STR32 0x0009 -#define TWTY_STR64 0x000a -#define TWTY_STR128 0x000b -#define TWTY_STR255 0x000c -#define TWTY_HANDLE 0x000f - - -/**************************************************************************** - * Capability Constants * - ****************************************************************************/ - -/* CAP_ALARMS values */ -#define TWAL_ALARM 0 -#define TWAL_FEEDERERROR 1 -#define TWAL_FEEDERWARNING 2 -#define TWAL_BARCODE 3 -#define TWAL_DOUBLEFEED 4 -#define TWAL_JAM 5 -#define TWAL_PATCHCODE 6 -#define TWAL_POWER 7 -#define TWAL_SKEW 8 - -/* ICAP_AUTOSIZE values */ -#define TWAS_NONE 0 -#define TWAS_AUTO 1 -#define TWAS_CURRENT 2 - -/* TWEI_BARCODEROTATION values */ -#define TWBCOR_ROT0 0 -#define TWBCOR_ROT90 1 -#define TWBCOR_ROT180 2 -#define TWBCOR_ROT270 3 -#define TWBCOR_ROTX 4 - -/* ICAP_BARCODESEARCHMODE values */ -#define TWBD_HORZ 0 -#define TWBD_VERT 1 -#define TWBD_HORZVERT 2 -#define TWBD_VERTHORZ 3 - -/* ICAP_BITORDER values */ -#define TWBO_LSBFIRST 0 -#define TWBO_MSBFIRST 1 - -/* ICAP_AUTODISCARDBLANKPAGES values */ -#define TWBP_DISABLE -2 -#define TWBP_AUTO -1 - -/* ICAP_BITDEPTHREDUCTION values */ -#define TWBR_THRESHOLD 0 -#define TWBR_HALFTONE 1 -#define TWBR_CUSTHALFTONE 2 -#define TWBR_DIFFUSION 3 -#define TWBR_DYNAMICTHRESHOLD 4 - -/* ICAP_SUPPORTEDBARCODETYPES and TWEI_BARCODETYPE values*/ -#define TWBT_3OF9 0 -#define TWBT_2OF5INTERLEAVED 1 -#define TWBT_2OF5NONINTERLEAVED 2 -#define TWBT_CODE93 3 -#define TWBT_CODE128 4 -#define TWBT_UCC128 5 -#define TWBT_CODABAR 6 -#define TWBT_UPCA 7 -#define TWBT_UPCE 8 -#define TWBT_EAN8 9 -#define TWBT_EAN13 10 -#define TWBT_POSTNET 11 -#define TWBT_PDF417 12 -#define TWBT_2OF5INDUSTRIAL 13 -#define TWBT_2OF5MATRIX 14 -#define TWBT_2OF5DATALOGIC 15 -#define TWBT_2OF5IATA 16 -#define TWBT_3OF9FULLASCII 17 -#define TWBT_CODABARWITHSTARTSTOP 18 -#define TWBT_MAXICODE 19 -#define TWBT_QRCODE 20 - -/* ICAP_COMPRESSION values*/ -#define TWCP_NONE 0 -#define TWCP_PACKBITS 1 -#define TWCP_GROUP31D 2 -#define TWCP_GROUP31DEOL 3 -#define TWCP_GROUP32D 4 -#define TWCP_GROUP4 5 -#define TWCP_JPEG 6 -#define TWCP_LZW 7 -#define TWCP_JBIG 8 -#define TWCP_PNG 9 -#define TWCP_RLE4 10 -#define TWCP_RLE8 11 -#define TWCP_BITFIELDS 12 -#define TWCP_ZIP 13 -#define TWCP_JPEG2000 14 - -/* CAP_CAMERASIDE and TWEI_PAGESIDE values */ -#define TWCS_BOTH 0 -#define TWCS_TOP 1 -#define TWCS_BOTTOM 2 - -/* CAP_DEVICEEVENT values */ -#define TWDE_CUSTOMEVENTS 0x8000 -#define TWDE_CHECKAUTOMATICCAPTURE 0 -#define TWDE_CHECKBATTERY 1 -#define TWDE_CHECKDEVICEONLINE 2 -#define TWDE_CHECKFLASH 3 -#define TWDE_CHECKPOWERSUPPLY 4 -#define TWDE_CHECKRESOLUTION 5 -#define TWDE_DEVICEADDED 6 -#define TWDE_DEVICEOFFLINE 7 -#define TWDE_DEVICEREADY 8 -#define TWDE_DEVICEREMOVED 9 -#define TWDE_IMAGECAPTURED 10 -#define TWDE_IMAGEDELETED 11 -#define TWDE_PAPERDOUBLEFEED 12 -#define TWDE_PAPERJAM 13 -#define TWDE_LAMPFAILURE 14 -#define TWDE_POWERSAVE 15 -#define TWDE_POWERSAVENOTIFY 16 - -/* TW_PASSTHRU.Direction values. */ -#define TWDR_GET 1 -#define TWDR_SET 2 - -/* TWEI_DESKEWSTATUS values. */ -#define TWDSK_SUCCESS 0 -#define TWDSK_REPORTONLY 1 -#define TWDSK_FAIL 2 -#define TWDSK_DISABLED 3 - -/* CAP_DUPLEX values */ -#define TWDX_NONE 0 -#define TWDX_1PASSDUPLEX 1 -#define TWDX_2PASSDUPLEX 2 - -/* CAP_FEEDERALIGNMENT values */ -#define TWFA_NONE 0 -#define TWFA_LEFT 1 -#define TWFA_CENTER 2 -#define TWFA_RIGHT 3 - -/* ICAP_FEEDERTYPE values*/ -#define TWFE_GENERAL 0 -#define TWFE_PHOTO 1 - -/* ICAP_IMAGEFILEFORMAT values */ -#define TWFF_TIFF 0 -#define TWFF_PICT 1 -#define TWFF_BMP 2 -#define TWFF_XBM 3 -#define TWFF_JFIF 4 -#define TWFF_FPX 5 -#define TWFF_TIFFMULTI 6 -#define TWFF_PNG 7 -#define TWFF_SPIFF 8 -#define TWFF_EXIF 9 -#define TWFF_PDF 10 -#define TWFF_JP2 11 -#define TWFF_JPX 13 -#define TWFF_DEJAVU 14 -#define TWFF_PDFA 15 -#define TWFF_PDFA2 16 -#define TWFF_PDFRASTER 17 - -/* ICAP_FLASHUSED2 values */ -#define TWFL_NONE 0 -#define TWFL_OFF 1 -#define TWFL_ON 2 -#define TWFL_AUTO 3 -#define TWFL_REDEYE 4 - -/* CAP_FEEDERORDER values */ -#define TWFO_FIRSTPAGEFIRST 0 -#define TWFO_LASTPAGEFIRST 1 - -/* CAP_FEEDERPOCKET values*/ -#define TWFP_POCKETERROR 0 -#define TWFP_POCKET1 1 -#define TWFP_POCKET2 2 -#define TWFP_POCKET3 3 -#define TWFP_POCKET4 4 -#define TWFP_POCKET5 5 -#define TWFP_POCKET6 6 -#define TWFP_POCKET7 7 -#define TWFP_POCKET8 8 -#define TWFP_POCKET9 9 -#define TWFP_POCKET10 10 -#define TWFP_POCKET11 11 -#define TWFP_POCKET12 12 -#define TWFP_POCKET13 13 -#define TWFP_POCKET14 14 -#define TWFP_POCKET15 15 -#define TWFP_POCKET16 16 - -/* ICAP_FLIPROTATION values */ -#define TWFR_BOOK 0 -#define TWFR_FANFOLD 1 - -/* ICAP_FILTER values */ -#define TWFT_RED 0 -#define TWFT_GREEN 1 -#define TWFT_BLUE 2 -#define TWFT_NONE 3 -#define TWFT_WHITE 4 -#define TWFT_CYAN 5 -#define TWFT_MAGENTA 6 -#define TWFT_YELLOW 7 -#define TWFT_BLACK 8 - -/* TW_FILESYSTEM.FileType values */ -#define TWFY_CAMERA 0 -#define TWFY_CAMERATOP 1 -#define TWFY_CAMERABOTTOM 2 -#define TWFY_CAMERAPREVIEW 3 -#define TWFY_DOMAIN 4 -#define TWFY_HOST 5 -#define TWFY_DIRECTORY 6 -#define TWFY_IMAGE 7 -#define TWFY_UNKNOWN 8 - -/* ICAP_ICCPROFILE values */ -#define TWIC_NONE 0 -#define TWIC_LINK 1 -#define TWIC_EMBED 2 - -/* ICAP_IMAGEFILTER values */ -#define TWIF_NONE 0 -#define TWIF_AUTO 1 -#define TWIF_LOWPASS 2 -#define TWIF_BANDPASS 3 -#define TWIF_HIGHPASS 4 -#define TWIF_TEXT TWIF_BANDPASS -#define TWIF_FINELINE TWIF_HIGHPASS - -/* ICAP_IMAGEMERGE values */ -#define TWIM_NONE 0 -#define TWIM_FRONTONTOP 1 -#define TWIM_FRONTONBOTTOM 2 -#define TWIM_FRONTONLEFT 3 -#define TWIM_FRONTONRIGHT 4 - -/* CAP_JOBCONTROL values */ -#define TWJC_NONE 0 -#define TWJC_JSIC 1 -#define TWJC_JSIS 2 -#define TWJC_JSXC 3 -#define TWJC_JSXS 4 - -/* ICAP_JPEGQUALITY values */ -#define TWJQ_UNKNOWN -4 -#define TWJQ_LOW -3 -#define TWJQ_MEDIUM -2 -#define TWJQ_HIGH -1 - -/* ICAP_LIGHTPATH values */ -#define TWLP_REFLECTIVE 0 -#define TWLP_TRANSMISSIVE 1 - -/* ICAP_LIGHTSOURCE values */ -#define TWLS_RED 0 -#define TWLS_GREEN 1 -#define TWLS_BLUE 2 -#define TWLS_NONE 3 -#define TWLS_WHITE 4 -#define TWLS_UV 5 -#define TWLS_IR 6 - -/* TWEI_MAGTYPE values */ -#define TWMD_MICR 0 -#define TWMD_RAW 1 -#define TWMD_INVALID 2 - -/* ICAP_NOISEFILTER values */ -#define TWNF_NONE 0 -#define TWNF_AUTO 1 -#define TWNF_LONEPIXEL 2 -#define TWNF_MAJORITYRULE 3 - -/* ICAP_ORIENTATION values */ -#define TWOR_ROT0 0 -#define TWOR_ROT90 1 -#define TWOR_ROT180 2 -#define TWOR_ROT270 3 -#define TWOR_PORTRAIT TWOR_ROT0 -#define TWOR_LANDSCAPE TWOR_ROT270 -#define TWOR_AUTO 4 -#define TWOR_AUTOTEXT 5 -#define TWOR_AUTOPICTURE 6 - -/* ICAP_OVERSCAN values */ -#define TWOV_NONE 0 -#define TWOV_AUTO 1 -#define TWOV_TOPBOTTOM 2 -#define TWOV_LEFTRIGHT 3 -#define TWOV_ALL 4 - -/* Palette types for TW_PALETTE8 */ -#define TWPA_RGB 0 -#define TWPA_GRAY 1 -#define TWPA_CMY 2 - -/* ICAP_PLANARCHUNKY values */ -#define TWPC_CHUNKY 0 -#define TWPC_PLANAR 1 - -/* TWEI_PATCHCODE values*/ -#define TWPCH_PATCH1 0 -#define TWPCH_PATCH2 1 -#define TWPCH_PATCH3 2 -#define TWPCH_PATCH4 3 -#define TWPCH_PATCH6 4 -#define TWPCH_PATCHT 5 - -/* ICAP_PIXELFLAVOR values */ -#define TWPF_CHOCOLATE 0 -#define TWPF_VANILLA 1 - -/* CAP_PRINTERMODE values */ -#define TWPM_SINGLESTRING 0 -#define TWPM_MULTISTRING 1 -#define TWPM_COMPOUNDSTRING 2 - -/* CAP_PRINTER values */ -#define TWPR_IMPRINTERTOPBEFORE 0 -#define TWPR_IMPRINTERTOPAFTER 1 -#define TWPR_IMPRINTERBOTTOMBEFORE 2 -#define TWPR_IMPRINTERBOTTOMAFTER 3 -#define TWPR_ENDORSERTOPBEFORE 4 -#define TWPR_ENDORSERTOPAFTER 5 -#define TWPR_ENDORSERBOTTOMBEFORE 6 -#define TWPR_ENDORSERBOTTOMAFTER 7 - -/* CAP_PRINTERFONTSTYLE Added 2.3 */ -#define TWPF_NORMAL 0 -#define TWPF_BOLD 1 -#define TWPF_ITALIC 2 -#define TWPF_LARGESIZE 3 -#define TWPF_SMALLSIZE 4 - -/* CAP_PRINTERINDEXTRIGGER Added 2.3 */ -#define TWCT_PAGE 0 -#define TWCT_PATCH1 1 -#define TWCT_PATCH2 2 -#define TWCT_PATCH3 3 -#define TWCT_PATCH4 4 -#define TWCT_PATCHT 5 -#define TWCT_PATCH6 6 - -/* CAP_POWERSUPPLY values */ -#define TWPS_EXTERNAL 0 -#define TWPS_BATTERY 1 - -/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */ -#define TWPT_BW 0 -#define TWPT_GRAY 1 -#define TWPT_RGB 2 -#define TWPT_PALETTE 3 -#define TWPT_CMY 4 -#define TWPT_CMYK 5 -#define TWPT_YUV 6 -#define TWPT_YUVK 7 -#define TWPT_CIEXYZ 8 -#define TWPT_LAB 9 -#define TWPT_SRGB 10 -#define TWPT_SCRGB 11 -#define TWPT_INFRARED 16 - -/* CAP_SEGMENTED values */ -#define TWSG_NONE 0 -#define TWSG_AUTO 1 -#define TWSG_MANUAL 2 - -/* ICAP_FILMTYPE values */ -#define TWFM_POSITIVE 0 -#define TWFM_NEGATIVE 1 - -/* CAP_DOUBLEFEEDDETECTION */ -#define TWDF_ULTRASONIC 0 -#define TWDF_BYLENGTH 1 -#define TWDF_INFRARED 2 - -/* CAP_DOUBLEFEEDDETECTIONSENSITIVITY */ -#define TWUS_LOW 0 -#define TWUS_MEDIUM 1 -#define TWUS_HIGH 2 - -/* CAP_DOUBLEFEEDDETECTIONRESPONSE */ -#define TWDP_STOP 0 -#define TWDP_STOPANDWAIT 1 -#define TWDP_SOUND 2 -#define TWDP_DONOTIMPRINT 3 - -/* ICAP_MIRROR values */ -#define TWMR_NONE 0 -#define TWMR_VERTICAL 1 -#define TWMR_HORIZONTAL 2 - -/* ICAP_JPEGSUBSAMPLING values */ -#define TWJS_444YCBCR 0 -#define TWJS_444RGB 1 -#define TWJS_422 2 -#define TWJS_421 3 -#define TWJS_411 4 -#define TWJS_420 5 -#define TWJS_410 6 -#define TWJS_311 7 - -/* CAP_PAPERHANDLING values */ -#define TWPH_NORMAL 0 -#define TWPH_FRAGILE 1 -#define TWPH_THICK 2 -#define TWPH_TRIFOLD 3 -#define TWPH_PHOTOGRAPH 4 - -/* CAP_INDICATORSMODE values */ -#define TWCI_INFO 0 -#define TWCI_WARNING 1 -#define TWCI_ERROR 2 -#define TWCI_WARMUP 3 - -/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */ -#define TWSS_NONE 0 -#define TWSS_A4 1 -#define TWSS_JISB5 2 -#define TWSS_USLETTER 3 -#define TWSS_USLEGAL 4 -#define TWSS_A5 5 -#define TWSS_ISOB4 6 -#define TWSS_ISOB6 7 -#define TWSS_USLEDGER 9 -#define TWSS_USEXECUTIVE 10 -#define TWSS_A3 11 -#define TWSS_ISOB3 12 -#define TWSS_A6 13 -#define TWSS_C4 14 -#define TWSS_C5 15 -#define TWSS_C6 16 -#define TWSS_4A0 17 -#define TWSS_2A0 18 -#define TWSS_A0 19 -#define TWSS_A1 20 -#define TWSS_A2 21 -#define TWSS_A7 22 -#define TWSS_A8 23 -#define TWSS_A9 24 -#define TWSS_A10 25 -#define TWSS_ISOB0 26 -#define TWSS_ISOB1 27 -#define TWSS_ISOB2 28 -#define TWSS_ISOB5 29 -#define TWSS_ISOB7 30 -#define TWSS_ISOB8 31 -#define TWSS_ISOB9 32 -#define TWSS_ISOB10 33 -#define TWSS_JISB0 34 -#define TWSS_JISB1 35 -#define TWSS_JISB2 36 -#define TWSS_JISB3 37 -#define TWSS_JISB4 38 -#define TWSS_JISB6 39 -#define TWSS_JISB7 40 -#define TWSS_JISB8 41 -#define TWSS_JISB9 42 -#define TWSS_JISB10 43 -#define TWSS_C0 44 -#define TWSS_C1 45 -#define TWSS_C2 46 -#define TWSS_C3 47 -#define TWSS_C7 48 -#define TWSS_C8 49 -#define TWSS_C9 50 -#define TWSS_C10 51 -#define TWSS_USSTATEMENT 52 -#define TWSS_BUSINESSCARD 53 -#define TWSS_MAXSIZE 54 - -/* ICAP_XFERMECH values (SX_ means Setup XFer) */ -#define TWSX_NATIVE 0 -#define TWSX_FILE 1 -#define TWSX_MEMORY 2 -#define TWSX_MEMFILE 4 - -/* ICAP_UNITS values (UN_ means UNits) */ -#define TWUN_INCHES 0 -#define TWUN_CENTIMETERS 1 -#define TWUN_PICAS 2 -#define TWUN_POINTS 3 -#define TWUN_TWIPS 4 -#define TWUN_PIXELS 5 -#define TWUN_MILLIMETERS 6 - - -/**************************************************************************** - * Country Constants * - ****************************************************************************/ - -#define TWCY_AFGHANISTAN 1001 -#define TWCY_ALGERIA 213 -#define TWCY_AMERICANSAMOA 684 -#define TWCY_ANDORRA 33 -#define TWCY_ANGOLA 1002 -#define TWCY_ANGUILLA 8090 -#define TWCY_ANTIGUA 8091 -#define TWCY_ARGENTINA 54 -#define TWCY_ARUBA 297 -#define TWCY_ASCENSIONI 247 -#define TWCY_AUSTRALIA 61 -#define TWCY_AUSTRIA 43 -#define TWCY_BAHAMAS 8092 -#define TWCY_BAHRAIN 973 -#define TWCY_BANGLADESH 880 -#define TWCY_BARBADOS 8093 -#define TWCY_BELGIUM 32 -#define TWCY_BELIZE 501 -#define TWCY_BENIN 229 -#define TWCY_BERMUDA 8094 -#define TWCY_BHUTAN 1003 -#define TWCY_BOLIVIA 591 -#define TWCY_BOTSWANA 267 -#define TWCY_BRITAIN 6 -#define TWCY_BRITVIRGINIS 8095 -#define TWCY_BRAZIL 55 -#define TWCY_BRUNEI 673 -#define TWCY_BULGARIA 359 -#define TWCY_BURKINAFASO 1004 -#define TWCY_BURMA 1005 -#define TWCY_BURUNDI 1006 -#define TWCY_CAMAROON 237 -#define TWCY_CANADA 2 -#define TWCY_CAPEVERDEIS 238 -#define TWCY_CAYMANIS 8096 -#define TWCY_CENTRALAFREP 1007 -#define TWCY_CHAD 1008 -#define TWCY_CHILE 56 -#define TWCY_CHINA 86 -#define TWCY_CHRISTMASIS 1009 -#define TWCY_COCOSIS 1009 -#define TWCY_COLOMBIA 57 -#define TWCY_COMOROS 1010 -#define TWCY_CONGO 1011 -#define TWCY_COOKIS 1012 -#define TWCY_COSTARICA 506 -#define TWCY_CUBA 5 -#define TWCY_CYPRUS 357 -#define TWCY_CZECHOSLOVAKIA 42 -#define TWCY_DENMARK 45 -#define TWCY_DJIBOUTI 1013 -#define TWCY_DOMINICA 8097 -#define TWCY_DOMINCANREP 8098 -#define TWCY_EASTERIS 1014 -#define TWCY_ECUADOR 593 -#define TWCY_EGYPT 20 -#define TWCY_ELSALVADOR 503 -#define TWCY_EQGUINEA 1015 -#define TWCY_ETHIOPIA 251 -#define TWCY_FALKLANDIS 1016 -#define TWCY_FAEROEIS 298 -#define TWCY_FIJIISLANDS 679 -#define TWCY_FINLAND 358 -#define TWCY_FRANCE 33 -#define TWCY_FRANTILLES 596 -#define TWCY_FRGUIANA 594 -#define TWCY_FRPOLYNEISA 689 -#define TWCY_FUTANAIS 1043 -#define TWCY_GABON 241 -#define TWCY_GAMBIA 220 -#define TWCY_GERMANY 49 -#define TWCY_GHANA 233 -#define TWCY_GIBRALTER 350 -#define TWCY_GREECE 30 -#define TWCY_GREENLAND 299 -#define TWCY_GRENADA 8099 -#define TWCY_GRENEDINES 8015 -#define TWCY_GUADELOUPE 590 -#define TWCY_GUAM 671 -#define TWCY_GUANTANAMOBAY 5399 -#define TWCY_GUATEMALA 502 -#define TWCY_GUINEA 224 -#define TWCY_GUINEABISSAU 1017 -#define TWCY_GUYANA 592 -#define TWCY_HAITI 509 -#define TWCY_HONDURAS 504 -#define TWCY_HONGKONG 852 -#define TWCY_HUNGARY 36 -#define TWCY_ICELAND 354 -#define TWCY_INDIA 91 -#define TWCY_INDONESIA 62 -#define TWCY_IRAN 98 -#define TWCY_IRAQ 964 -#define TWCY_IRELAND 353 -#define TWCY_ISRAEL 972 -#define TWCY_ITALY 39 -#define TWCY_IVORYCOAST 225 -#define TWCY_JAMAICA 8010 -#define TWCY_JAPAN 81 -#define TWCY_JORDAN 962 -#define TWCY_KENYA 254 -#define TWCY_KIRIBATI 1018 -#define TWCY_KOREA 82 -#define TWCY_KUWAIT 965 -#define TWCY_LAOS 1019 -#define TWCY_LEBANON 1020 -#define TWCY_LIBERIA 231 -#define TWCY_LIBYA 218 -#define TWCY_LIECHTENSTEIN 41 -#define TWCY_LUXENBOURG 352 -#define TWCY_MACAO 853 -#define TWCY_MADAGASCAR 1021 -#define TWCY_MALAWI 265 -#define TWCY_MALAYSIA 60 -#define TWCY_MALDIVES 960 -#define TWCY_MALI 1022 -#define TWCY_MALTA 356 -#define TWCY_MARSHALLIS 692 -#define TWCY_MAURITANIA 1023 -#define TWCY_MAURITIUS 230 -#define TWCY_MEXICO 3 -#define TWCY_MICRONESIA 691 -#define TWCY_MIQUELON 508 -#define TWCY_MONACO 33 -#define TWCY_MONGOLIA 1024 -#define TWCY_MONTSERRAT 8011 -#define TWCY_MOROCCO 212 -#define TWCY_MOZAMBIQUE 1025 -#define TWCY_NAMIBIA 264 -#define TWCY_NAURU 1026 -#define TWCY_NEPAL 977 -#define TWCY_NETHERLANDS 31 -#define TWCY_NETHANTILLES 599 -#define TWCY_NEVIS 8012 -#define TWCY_NEWCALEDONIA 687 -#define TWCY_NEWZEALAND 64 -#define TWCY_NICARAGUA 505 -#define TWCY_NIGER 227 -#define TWCY_NIGERIA 234 -#define TWCY_NIUE 1027 -#define TWCY_NORFOLKI 1028 -#define TWCY_NORWAY 47 -#define TWCY_OMAN 968 -#define TWCY_PAKISTAN 92 -#define TWCY_PALAU 1029 -#define TWCY_PANAMA 507 -#define TWCY_PARAGUAY 595 -#define TWCY_PERU 51 -#define TWCY_PHILLIPPINES 63 -#define TWCY_PITCAIRNIS 1030 -#define TWCY_PNEWGUINEA 675 -#define TWCY_POLAND 48 -#define TWCY_PORTUGAL 351 -#define TWCY_QATAR 974 -#define TWCY_REUNIONI 1031 -#define TWCY_ROMANIA 40 -#define TWCY_RWANDA 250 -#define TWCY_SAIPAN 670 -#define TWCY_SANMARINO 39 -#define TWCY_SAOTOME 1033 -#define TWCY_SAUDIARABIA 966 -#define TWCY_SENEGAL 221 -#define TWCY_SEYCHELLESIS 1034 -#define TWCY_SIERRALEONE 1035 -#define TWCY_SINGAPORE 65 -#define TWCY_SOLOMONIS 1036 -#define TWCY_SOMALI 1037 -#define TWCY_SOUTHAFRICA 27 -#define TWCY_SPAIN 34 -#define TWCY_SRILANKA 94 -#define TWCY_STHELENA 1032 -#define TWCY_STKITTS 8013 -#define TWCY_STLUCIA 8014 -#define TWCY_STPIERRE 508 -#define TWCY_STVINCENT 8015 -#define TWCY_SUDAN 1038 -#define TWCY_SURINAME 597 -#define TWCY_SWAZILAND 268 -#define TWCY_SWEDEN 46 -#define TWCY_SWITZERLAND 41 -#define TWCY_SYRIA 1039 -#define TWCY_TAIWAN 886 -#define TWCY_TANZANIA 255 -#define TWCY_THAILAND 66 -#define TWCY_TOBAGO 8016 -#define TWCY_TOGO 228 -#define TWCY_TONGAIS 676 -#define TWCY_TRINIDAD 8016 -#define TWCY_TUNISIA 216 -#define TWCY_TURKEY 90 -#define TWCY_TURKSCAICOS 8017 -#define TWCY_TUVALU 1040 -#define TWCY_UGANDA 256 -#define TWCY_USSR 7 -#define TWCY_UAEMIRATES 971 -#define TWCY_UNITEDKINGDOM 44 -#define TWCY_USA 1 -#define TWCY_URUGUAY 598 -#define TWCY_VANUATU 1041 -#define TWCY_VATICANCITY 39 -#define TWCY_VENEZUELA 58 -#define TWCY_WAKE 1042 -#define TWCY_WALLISIS 1043 -#define TWCY_WESTERNSAHARA 1044 -#define TWCY_WESTERNSAMOA 1045 -#define TWCY_YEMEN 1046 -#define TWCY_YUGOSLAVIA 38 -#define TWCY_ZAIRE 243 -#define TWCY_ZAMBIA 260 -#define TWCY_ZIMBABWE 263 -#define TWCY_ALBANIA 355 -#define TWCY_ARMENIA 374 -#define TWCY_AZERBAIJAN 994 -#define TWCY_BELARUS 375 -#define TWCY_BOSNIAHERZGO 387 -#define TWCY_CAMBODIA 855 -#define TWCY_CROATIA 385 -#define TWCY_CZECHREPUBLIC 420 -#define TWCY_DIEGOGARCIA 246 -#define TWCY_ERITREA 291 -#define TWCY_ESTONIA 372 -#define TWCY_GEORGIA 995 -#define TWCY_LATVIA 371 -#define TWCY_LESOTHO 266 -#define TWCY_LITHUANIA 370 -#define TWCY_MACEDONIA 389 -#define TWCY_MAYOTTEIS 269 -#define TWCY_MOLDOVA 373 -#define TWCY_MYANMAR 95 -#define TWCY_NORTHKOREA 850 -#define TWCY_PUERTORICO 787 -#define TWCY_RUSSIA 7 -#define TWCY_SERBIA 381 -#define TWCY_SLOVAKIA 421 -#define TWCY_SLOVENIA 386 -#define TWCY_SOUTHKOREA 82 -#define TWCY_UKRAINE 380 -#define TWCY_USVIRGINIS 340 -#define TWCY_VIETNAM 84 - -/**************************************************************************** - * Language Constants * - ****************************************************************************/ -#define TWLG_USERLOCALE -1 -#define TWLG_DAN 0 -#define TWLG_DUT 1 -#define TWLG_ENG 2 -#define TWLG_FCF 3 -#define TWLG_FIN 4 -#define TWLG_FRN 5 -#define TWLG_GER 6 -#define TWLG_ICE 7 -#define TWLG_ITN 8 -#define TWLG_NOR 9 -#define TWLG_POR 10 -#define TWLG_SPA 11 -#define TWLG_SWE 12 -#define TWLG_USA 13 -#define TWLG_AFRIKAANS 14 -#define TWLG_ALBANIA 15 -#define TWLG_ARABIC 16 -#define TWLG_ARABIC_ALGERIA 17 -#define TWLG_ARABIC_BAHRAIN 18 -#define TWLG_ARABIC_EGYPT 19 -#define TWLG_ARABIC_IRAQ 20 -#define TWLG_ARABIC_JORDAN 21 -#define TWLG_ARABIC_KUWAIT 22 -#define TWLG_ARABIC_LEBANON 23 -#define TWLG_ARABIC_LIBYA 24 -#define TWLG_ARABIC_MOROCCO 25 -#define TWLG_ARABIC_OMAN 26 -#define TWLG_ARABIC_QATAR 27 -#define TWLG_ARABIC_SAUDIARABIA 28 -#define TWLG_ARABIC_SYRIA 29 -#define TWLG_ARABIC_TUNISIA 30 -#define TWLG_ARABIC_UAE 31 -#define TWLG_ARABIC_YEMEN 32 -#define TWLG_BASQUE 33 -#define TWLG_BYELORUSSIAN 34 -#define TWLG_BULGARIAN 35 -#define TWLG_CATALAN 36 -#define TWLG_CHINESE 37 -#define TWLG_CHINESE_HONGKONG 38 -#define TWLG_CHINESE_PRC 39 -#define TWLG_CHINESE_SINGAPORE 40 -#define TWLG_CHINESE_SIMPLIFIED 41 -#define TWLG_CHINESE_TAIWAN 42 -#define TWLG_CHINESE_TRADITIONAL 43 -#define TWLG_CROATIA 44 -#define TWLG_CZECH 45 -#define TWLG_DANISH TWLG_DAN -#define TWLG_DUTCH TWLG_DUT -#define TWLG_DUTCH_BELGIAN 46 -#define TWLG_ENGLISH TWLG_ENG -#define TWLG_ENGLISH_AUSTRALIAN 47 -#define TWLG_ENGLISH_CANADIAN 48 -#define TWLG_ENGLISH_IRELAND 49 -#define TWLG_ENGLISH_NEWZEALAND 50 -#define TWLG_ENGLISH_SOUTHAFRICA 51 -#define TWLG_ENGLISH_UK 52 -#define TWLG_ENGLISH_USA TWLG_USA -#define TWLG_ESTONIAN 53 -#define TWLG_FAEROESE 54 -#define TWLG_FARSI 55 -#define TWLG_FINNISH TWLG_FIN -#define TWLG_FRENCH TWLG_FRN -#define TWLG_FRENCH_BELGIAN 56 -#define TWLG_FRENCH_CANADIAN TWLG_FCF -#define TWLG_FRENCH_LUXEMBOURG 57 -#define TWLG_FRENCH_SWISS 58 -#define TWLG_GERMAN TWLG_GER -#define TWLG_GERMAN_AUSTRIAN 59 -#define TWLG_GERMAN_LUXEMBOURG 60 -#define TWLG_GERMAN_LIECHTENSTEIN 61 -#define TWLG_GERMAN_SWISS 62 -#define TWLG_GREEK 63 -#define TWLG_HEBREW 64 -#define TWLG_HUNGARIAN 65 -#define TWLG_ICELANDIC TWLG_ICE -#define TWLG_INDONESIAN 66 -#define TWLG_ITALIAN TWLG_ITN -#define TWLG_ITALIAN_SWISS 67 -#define TWLG_JAPANESE 68 -#define TWLG_KOREAN 69 -#define TWLG_KOREAN_JOHAB 70 -#define TWLG_LATVIAN 71 -#define TWLG_LITHUANIAN 72 -#define TWLG_NORWEGIAN TWLG_NOR -#define TWLG_NORWEGIAN_BOKMAL 73 -#define TWLG_NORWEGIAN_NYNORSK 74 -#define TWLG_POLISH 75 -#define TWLG_PORTUGUESE TWLG_POR -#define TWLG_PORTUGUESE_BRAZIL 76 -#define TWLG_ROMANIAN 77 -#define TWLG_RUSSIAN 78 -#define TWLG_SERBIAN_LATIN 79 -#define TWLG_SLOVAK 80 -#define TWLG_SLOVENIAN 81 -#define TWLG_SPANISH TWLG_SPA -#define TWLG_SPANISH_MEXICAN 82 -#define TWLG_SPANISH_MODERN 83 -#define TWLG_SWEDISH TWLG_SWE -#define TWLG_THAI 84 -#define TWLG_TURKISH 85 -#define TWLG_UKRANIAN 86 -#define TWLG_ASSAMESE 87 -#define TWLG_BENGALI 88 -#define TWLG_BIHARI 89 -#define TWLG_BODO 90 -#define TWLG_DOGRI 91 -#define TWLG_GUJARATI 92 -#define TWLG_HARYANVI 93 -#define TWLG_HINDI 94 -#define TWLG_KANNADA 95 -#define TWLG_KASHMIRI 96 -#define TWLG_MALAYALAM 97 -#define TWLG_MARATHI 98 -#define TWLG_MARWARI 99 -#define TWLG_MEGHALAYAN 100 -#define TWLG_MIZO 101 -#define TWLG_NAGA 102 -#define TWLG_ORISSI 103 -#define TWLG_PUNJABI 104 -#define TWLG_PUSHTU 105 -#define TWLG_SERBIAN_CYRILLIC 106 -#define TWLG_SIKKIMI 107 -#define TWLG_SWEDISH_FINLAND 108 -#define TWLG_TAMIL 109 -#define TWLG_TELUGU 110 -#define TWLG_TRIPURI 111 -#define TWLG_URDU 112 -#define TWLG_VIETNAMESE 113 - - -/**************************************************************************** - * Data Groups * - ****************************************************************************/ -#define DG_CONTROL 0x0001L -#define DG_IMAGE 0x0002L -#define DG_AUDIO 0x0004L - -/* More Data Functionality may be added in the future. - * These are for items that need to be determined before DS is opened. - * NOTE: Supported Functionality constants must be powers of 2 as they are - * used as bitflags when Application asks DSM to present a list of DSs. - * to support backward capability the App and DS will not use the fields - */ -#define DF_DSM2 0x10000000L -#define DF_APP2 0x20000000L - -#define DF_DS2 0x40000000L - -#define DG_MASK 0xFFFFL - -/**************************************************************************** - * * - ****************************************************************************/ -#define DAT_NULL 0x0000 -#define DAT_CUSTOMBASE 0x8000 - -/* Data Argument Types for the DG_CONTROL Data Group. */ -#define DAT_CAPABILITY 0x0001 -#define DAT_EVENT 0x0002 -#define DAT_IDENTITY 0x0003 -#define DAT_PARENT 0x0004 -#define DAT_PENDINGXFERS 0x0005 -#define DAT_SETUPMEMXFER 0x0006 -#define DAT_SETUPFILEXFER 0x0007 -#define DAT_STATUS 0x0008 -#define DAT_USERINTERFACE 0x0009 -#define DAT_XFERGROUP 0x000a -#define DAT_CUSTOMDSDATA 0x000c -#define DAT_DEVICEEVENT 0x000d -#define DAT_FILESYSTEM 0x000e -#define DAT_PASSTHRU 0x000f -#define DAT_CALLBACK 0x0010 -#define DAT_STATUSUTF8 0x0011 -#define DAT_CALLBACK2 0x0012 -#define DAT_METRICS 0x0013 -#define DAT_TWAINDIRECT 0x0014 - -/* Data Argument Types for the DG_IMAGE Data Group. */ -#define DAT_IMAGEINFO 0x0101 -#define DAT_IMAGELAYOUT 0x0102 -#define DAT_IMAGEMEMXFER 0x0103 -#define DAT_IMAGENATIVEXFER 0x0104 -#define DAT_IMAGEFILEXFER 0x0105 -#define DAT_CIECOLOR 0x0106 -#define DAT_GRAYRESPONSE 0x0107 -#define DAT_RGBRESPONSE 0x0108 -#define DAT_JPEGCOMPRESSION 0x0109 -#define DAT_PALETTE8 0x010a -#define DAT_EXTIMAGEINFO 0x010b -#define DAT_FILTER 0x010c - -/* Data Argument Types for the DG_AUDIO Data Group. */ -#define DAT_AUDIOFILEXFER 0x0201 -#define DAT_AUDIOINFO 0x0202 -#define DAT_AUDIONATIVEXFER 0x0203 - -/* misplaced */ -#define DAT_ICCPROFILE 0x0401 -#define DAT_IMAGEMEMFILEXFER 0x0402 -#define DAT_ENTRYPOINT 0x0403 - - -/**************************************************************************** - * Messages * - ****************************************************************************/ - -/* All message constants are unique. - * Messages are grouped according to which DATs they are used with.*/ - -#define MSG_NULL 0x0000 -#define MSG_CUSTOMBASE 0x8000 - -/* Generic messages may be used with any of several DATs. */ -#define MSG_GET 0x0001 -#define MSG_GETCURRENT 0x0002 -#define MSG_GETDEFAULT 0x0003 -#define MSG_GETFIRST 0x0004 -#define MSG_GETNEXT 0x0005 -#define MSG_SET 0x0006 -#define MSG_RESET 0x0007 -#define MSG_QUERYSUPPORT 0x0008 -#define MSG_GETHELP 0x0009 -#define MSG_GETLABEL 0x000a -#define MSG_GETLABELENUM 0x000b -#define MSG_SETCONSTRAINT 0x000c - -/* Messages used with DAT_NULL */ -#define MSG_XFERREADY 0x0101 -#define MSG_CLOSEDSREQ 0x0102 -#define MSG_CLOSEDSOK 0x0103 -#define MSG_DEVICEEVENT 0X0104 - -/* Messages used with a pointer to DAT_PARENT data */ -#define MSG_OPENDSM 0x0301 -#define MSG_CLOSEDSM 0x0302 - -/* Messages used with a pointer to a DAT_IDENTITY structure */ -#define MSG_OPENDS 0x0401 -#define MSG_CLOSEDS 0x0402 -#define MSG_USERSELECT 0x0403 - -/* Messages used with a pointer to a DAT_USERINTERFACE structure */ -#define MSG_DISABLEDS 0x0501 -#define MSG_ENABLEDS 0x0502 -#define MSG_ENABLEDSUIONLY 0x0503 - -/* Messages used with a pointer to a DAT_EVENT structure */ -#define MSG_PROCESSEVENT 0x0601 - -/* Messages used with a pointer to a DAT_PENDINGXFERS structure */ -#define MSG_ENDXFER 0x0701 -#define MSG_STOPFEEDER 0x0702 - -/* Messages used with a pointer to a DAT_FILESYSTEM structure */ -#define MSG_CHANGEDIRECTORY 0x0801 -#define MSG_CREATEDIRECTORY 0x0802 -#define MSG_DELETE 0x0803 -#define MSG_FORMATMEDIA 0x0804 -#define MSG_GETCLOSE 0x0805 -#define MSG_GETFIRSTFILE 0x0806 -#define MSG_GETINFO 0x0807 -#define MSG_GETNEXTFILE 0x0808 -#define MSG_RENAME 0x0809 -#define MSG_COPY 0x080A -#define MSG_AUTOMATICCAPTUREDIRECTORY 0x080B - -/* Messages used with a pointer to a DAT_PASSTHRU structure */ -#define MSG_PASSTHRU 0x0901 - -/* used with DAT_CALLBACK */ -#define MSG_REGISTER_CALLBACK 0x0902 - -/* used with DAT_CAPABILITY */ -#define MSG_RESETALL 0x0A01 - -/* used with DAT_TWAINDIRECT */ -#define MSG_SETTASK 0x0B01 - -/**************************************************************************** - * Capabilities * - ****************************************************************************/ - -#define CAP_CUSTOMBASE 0x8000 /* Base of custom capabilities */ - -/* all data sources are REQUIRED to support these caps */ -#define CAP_XFERCOUNT 0x0001 - -/* image data sources are REQUIRED to support these caps */ -#define ICAP_COMPRESSION 0x0100 -#define ICAP_PIXELTYPE 0x0101 -#define ICAP_UNITS 0x0102 -#define ICAP_XFERMECH 0x0103 - -/* all data sources MAY support these caps */ -#define CAP_AUTHOR 0x1000 -#define CAP_CAPTION 0x1001 -#define CAP_FEEDERENABLED 0x1002 -#define CAP_FEEDERLOADED 0x1003 -#define CAP_TIMEDATE 0x1004 -#define CAP_SUPPORTEDCAPS 0x1005 -#define CAP_EXTENDEDCAPS 0x1006 -#define CAP_AUTOFEED 0x1007 -#define CAP_CLEARPAGE 0x1008 -#define CAP_FEEDPAGE 0x1009 -#define CAP_REWINDPAGE 0x100a -#define CAP_INDICATORS 0x100b -#define CAP_PAPERDETECTABLE 0x100d -#define CAP_UICONTROLLABLE 0x100e -#define CAP_DEVICEONLINE 0x100f -#define CAP_AUTOSCAN 0x1010 -#define CAP_THUMBNAILSENABLED 0x1011 -#define CAP_DUPLEX 0x1012 -#define CAP_DUPLEXENABLED 0x1013 -#define CAP_ENABLEDSUIONLY 0x1014 -#define CAP_CUSTOMDSDATA 0x1015 -#define CAP_ENDORSER 0x1016 -#define CAP_JOBCONTROL 0x1017 -#define CAP_ALARMS 0x1018 -#define CAP_ALARMVOLUME 0x1019 -#define CAP_AUTOMATICCAPTURE 0x101a -#define CAP_TIMEBEFOREFIRSTCAPTURE 0x101b -#define CAP_TIMEBETWEENCAPTURES 0x101c -#define CAP_MAXBATCHBUFFERS 0x101e -#define CAP_DEVICETIMEDATE 0x101f -#define CAP_POWERSUPPLY 0x1020 -#define CAP_CAMERAPREVIEWUI 0x1021 -#define CAP_DEVICEEVENT 0x1022 -#define CAP_SERIALNUMBER 0x1024 -#define CAP_PRINTER 0x1026 -#define CAP_PRINTERENABLED 0x1027 -#define CAP_PRINTERINDEX 0x1028 -#define CAP_PRINTERMODE 0x1029 -#define CAP_PRINTERSTRING 0x102a -#define CAP_PRINTERSUFFIX 0x102b -#define CAP_LANGUAGE 0x102c -#define CAP_FEEDERALIGNMENT 0x102d -#define CAP_FEEDERORDER 0x102e -#define CAP_REACQUIREALLOWED 0x1030 -#define CAP_BATTERYMINUTES 0x1032 -#define CAP_BATTERYPERCENTAGE 0x1033 -#define CAP_CAMERASIDE 0x1034 -#define CAP_SEGMENTED 0x1035 -#define CAP_CAMERAENABLED 0x1036 -#define CAP_CAMERAORDER 0x1037 -#define CAP_MICRENABLED 0x1038 -#define CAP_FEEDERPREP 0x1039 -#define CAP_FEEDERPOCKET 0x103a -#define CAP_AUTOMATICSENSEMEDIUM 0x103b -#define CAP_CUSTOMINTERFACEGUID 0x103c -#define CAP_SUPPORTEDCAPSSEGMENTUNIQUE 0x103d -#define CAP_SUPPORTEDDATS 0x103e -#define CAP_DOUBLEFEEDDETECTION 0x103f -#define CAP_DOUBLEFEEDDETECTIONLENGTH 0x1040 -#define CAP_DOUBLEFEEDDETECTIONSENSITIVITY 0x1041 -#define CAP_DOUBLEFEEDDETECTIONRESPONSE 0x1042 -#define CAP_PAPERHANDLING 0x1043 -#define CAP_INDICATORSMODE 0x1044 -#define CAP_PRINTERVERTICALOFFSET 0x1045 -#define CAP_POWERSAVETIME 0x1046 -#define CAP_PRINTERCHARROTATION 0x1047 -#define CAP_PRINTERFONTSTYLE 0x1048 -#define CAP_PRINTERINDEXLEADCHAR 0x1049 -#define CAP_PRINTERINDEXMAXVALUE 0x104A -#define CAP_PRINTERINDEXNUMDIGITS 0x104B -#define CAP_PRINTERINDEXSTEP 0x104C -#define CAP_PRINTERINDEXTRIGGER 0x104D -#define CAP_PRINTERSTRINGPREVIEW 0x104E -#define CAP_SHEETCOUNT 0x104F - - - -/* image data sources MAY support these caps */ -#define ICAP_AUTOBRIGHT 0x1100 -#define ICAP_BRIGHTNESS 0x1101 -#define ICAP_CONTRAST 0x1103 -#define ICAP_CUSTHALFTONE 0x1104 -#define ICAP_EXPOSURETIME 0x1105 -#define ICAP_FILTER 0x1106 -#define ICAP_FLASHUSED 0x1107 -#define ICAP_GAMMA 0x1108 -#define ICAP_HALFTONES 0x1109 -#define ICAP_HIGHLIGHT 0x110a -#define ICAP_IMAGEFILEFORMAT 0x110c -#define ICAP_LAMPSTATE 0x110d -#define ICAP_LIGHTSOURCE 0x110e -#define ICAP_ORIENTATION 0x1110 -#define ICAP_PHYSICALWIDTH 0x1111 -#define ICAP_PHYSICALHEIGHT 0x1112 -#define ICAP_SHADOW 0x1113 -#define ICAP_FRAMES 0x1114 -#define ICAP_XNATIVERESOLUTION 0x1116 -#define ICAP_YNATIVERESOLUTION 0x1117 -#define ICAP_XRESOLUTION 0x1118 -#define ICAP_YRESOLUTION 0x1119 -#define ICAP_MAXFRAMES 0x111a -#define ICAP_TILES 0x111b -#define ICAP_BITORDER 0x111c -#define ICAP_CCITTKFACTOR 0x111d -#define ICAP_LIGHTPATH 0x111e -#define ICAP_PIXELFLAVOR 0x111f -#define ICAP_PLANARCHUNKY 0x1120 -#define ICAP_ROTATION 0x1121 -#define ICAP_SUPPORTEDSIZES 0x1122 -#define ICAP_THRESHOLD 0x1123 -#define ICAP_XSCALING 0x1124 -#define ICAP_YSCALING 0x1125 -#define ICAP_BITORDERCODES 0x1126 -#define ICAP_PIXELFLAVORCODES 0x1127 -#define ICAP_JPEGPIXELTYPE 0x1128 -#define ICAP_TIMEFILL 0x112a -#define ICAP_BITDEPTH 0x112b -#define ICAP_BITDEPTHREDUCTION 0x112c -#define ICAP_UNDEFINEDIMAGESIZE 0x112d -#define ICAP_IMAGEDATASET 0x112e -#define ICAP_EXTIMAGEINFO 0x112f -#define ICAP_MINIMUMHEIGHT 0x1130 -#define ICAP_MINIMUMWIDTH 0x1131 -#define ICAP_AUTODISCARDBLANKPAGES 0x1134 -#define ICAP_FLIPROTATION 0x1136 -#define ICAP_BARCODEDETECTIONENABLED 0x1137 -#define ICAP_SUPPORTEDBARCODETYPES 0x1138 -#define ICAP_BARCODEMAXSEARCHPRIORITIES 0x1139 -#define ICAP_BARCODESEARCHPRIORITIES 0x113a -#define ICAP_BARCODESEARCHMODE 0x113b -#define ICAP_BARCODEMAXRETRIES 0x113c -#define ICAP_BARCODETIMEOUT 0x113d -#define ICAP_ZOOMFACTOR 0x113e -#define ICAP_PATCHCODEDETECTIONENABLED 0x113f -#define ICAP_SUPPORTEDPATCHCODETYPES 0x1140 -#define ICAP_PATCHCODEMAXSEARCHPRIORITIES 0x1141 -#define ICAP_PATCHCODESEARCHPRIORITIES 0x1142 -#define ICAP_PATCHCODESEARCHMODE 0x1143 -#define ICAP_PATCHCODEMAXRETRIES 0x1144 -#define ICAP_PATCHCODETIMEOUT 0x1145 -#define ICAP_FLASHUSED2 0x1146 -#define ICAP_IMAGEFILTER 0x1147 -#define ICAP_NOISEFILTER 0x1148 -#define ICAP_OVERSCAN 0x1149 -#define ICAP_AUTOMATICBORDERDETECTION 0x1150 -#define ICAP_AUTOMATICDESKEW 0x1151 -#define ICAP_AUTOMATICROTATE 0x1152 -#define ICAP_JPEGQUALITY 0x1153 -#define ICAP_FEEDERTYPE 0x1154 -#define ICAP_ICCPROFILE 0x1155 -#define ICAP_AUTOSIZE 0x1156 -#define ICAP_AUTOMATICCROPUSESFRAME 0x1157 -#define ICAP_AUTOMATICLENGTHDETECTION 0x1158 -#define ICAP_AUTOMATICCOLORENABLED 0x1159 -#define ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE 0x115a -#define ICAP_COLORMANAGEMENTENABLED 0x115b -#define ICAP_IMAGEMERGE 0x115c -#define ICAP_IMAGEMERGEHEIGHTTHRESHOLD 0x115d -#define ICAP_SUPPORTEDEXTIMAGEINFO 0x115e -#define ICAP_FILMTYPE 0x115f -#define ICAP_MIRROR 0x1160 -#define ICAP_JPEGSUBSAMPLING 0x1161 - -/* image data sources MAY support these audio caps */ -#define ACAP_XFERMECH 0x1202 - - -/*************************************************************************** - * Extended Image Info Attributes section Added 1.7 * - ***************************************************************************/ - -#define TWEI_BARCODEX 0x1200 -#define TWEI_BARCODEY 0x1201 -#define TWEI_BARCODETEXT 0x1202 -#define TWEI_BARCODETYPE 0x1203 -#define TWEI_DESHADETOP 0x1204 -#define TWEI_DESHADELEFT 0x1205 -#define TWEI_DESHADEHEIGHT 0x1206 -#define TWEI_DESHADEWIDTH 0x1207 -#define TWEI_DESHADESIZE 0x1208 -#define TWEI_SPECKLESREMOVED 0x1209 -#define TWEI_HORZLINEXCOORD 0x120A -#define TWEI_HORZLINEYCOORD 0x120B -#define TWEI_HORZLINELENGTH 0x120C -#define TWEI_HORZLINETHICKNESS 0x120D -#define TWEI_VERTLINEXCOORD 0x120E -#define TWEI_VERTLINEYCOORD 0x120F -#define TWEI_VERTLINELENGTH 0x1210 -#define TWEI_VERTLINETHICKNESS 0x1211 -#define TWEI_PATCHCODE 0x1212 -#define TWEI_ENDORSEDTEXT 0x1213 -#define TWEI_FORMCONFIDENCE 0x1214 -#define TWEI_FORMTEMPLATEMATCH 0x1215 -#define TWEI_FORMTEMPLATEPAGEMATCH 0x1216 -#define TWEI_FORMHORZDOCOFFSET 0x1217 -#define TWEI_FORMVERTDOCOFFSET 0x1218 -#define TWEI_BARCODECOUNT 0x1219 -#define TWEI_BARCODECONFIDENCE 0x121A -#define TWEI_BARCODEROTATION 0x121B -#define TWEI_BARCODETEXTLENGTH 0x121C -#define TWEI_DESHADECOUNT 0x121D -#define TWEI_DESHADEBLACKCOUNTOLD 0x121E -#define TWEI_DESHADEBLACKCOUNTNEW 0x121F -#define TWEI_DESHADEBLACKRLMIN 0x1220 -#define TWEI_DESHADEBLACKRLMAX 0x1221 -#define TWEI_DESHADEWHITECOUNTOLD 0x1222 -#define TWEI_DESHADEWHITECOUNTNEW 0x1223 -#define TWEI_DESHADEWHITERLMIN 0x1224 -#define TWEI_DESHADEWHITERLAVE 0x1225 -#define TWEI_DESHADEWHITERLMAX 0x1226 -#define TWEI_BLACKSPECKLESREMOVED 0x1227 -#define TWEI_WHITESPECKLESREMOVED 0x1228 -#define TWEI_HORZLINECOUNT 0x1229 -#define TWEI_VERTLINECOUNT 0x122A -#define TWEI_DESKEWSTATUS 0x122B -#define TWEI_SKEWORIGINALANGLE 0x122C -#define TWEI_SKEWFINALANGLE 0x122D -#define TWEI_SKEWCONFIDENCE 0x122E -#define TWEI_SKEWWINDOWX1 0x122F -#define TWEI_SKEWWINDOWY1 0x1230 -#define TWEI_SKEWWINDOWX2 0x1231 -#define TWEI_SKEWWINDOWY2 0x1232 -#define TWEI_SKEWWINDOWX3 0x1233 -#define TWEI_SKEWWINDOWY3 0x1234 -#define TWEI_SKEWWINDOWX4 0x1235 -#define TWEI_SKEWWINDOWY4 0x1236 -#define TWEI_BOOKNAME 0x1238 -#define TWEI_CHAPTERNUMBER 0x1239 -#define TWEI_DOCUMENTNUMBER 0x123A -#define TWEI_PAGENUMBER 0x123B -#define TWEI_CAMERA 0x123C -#define TWEI_FRAMENUMBER 0x123D -#define TWEI_FRAME 0x123E -#define TWEI_PIXELFLAVOR 0x123F -#define TWEI_ICCPROFILE 0x1240 -#define TWEI_LASTSEGMENT 0x1241 -#define TWEI_SEGMENTNUMBER 0x1242 -#define TWEI_MAGDATA 0x1243 -#define TWEI_MAGTYPE 0x1244 -#define TWEI_PAGESIDE 0x1245 -#define TWEI_FILESYSTEMSOURCE 0x1246 -#define TWEI_IMAGEMERGED 0x1247 -#define TWEI_MAGDATALENGTH 0x1248 -#define TWEI_PAPERCOUNT 0x1249 -#define TWEI_PRINTERTEXT 0x124A -#define TWEI_TWAINDIRECTMETADATA 0x124B - -#define TWEJ_NONE 0x0000 -#define TWEJ_MIDSEPARATOR 0x0001 -#define TWEJ_PATCH1 0x0002 -#define TWEJ_PATCH2 0x0003 -#define TWEJ_PATCH3 0x0004 -#define TWEJ_PATCH4 0x0005 -#define TWEJ_PATCH6 0x0006 -#define TWEJ_PATCHT 0x0007 - - -/*************************************************************************** - * Return Codes and Condition Codes section * - ***************************************************************************/ - -#define TWRC_CUSTOMBASE 0x8000 - -#define TWRC_SUCCESS 0 -#define TWRC_FAILURE 1 -#define TWRC_CHECKSTATUS 2 -#define TWRC_CANCEL 3 -#define TWRC_DSEVENT 4 -#define TWRC_NOTDSEVENT 5 -#define TWRC_XFERDONE 6 -#define TWRC_ENDOFLIST 7 -#define TWRC_INFONOTSUPPORTED 8 -#define TWRC_DATANOTAVAILABLE 9 -#define TWRC_BUSY 10 -#define TWRC_SCANNERLOCKED 11 - -/* Condition Codes: Application gets these by doing DG_CONTROL DAT_STATUS MSG_GET. */ -#define TWCC_CUSTOMBASE 0x8000 - -#define TWCC_SUCCESS 0 -#define TWCC_BUMMER 1 -#define TWCC_LOWMEMORY 2 -#define TWCC_NODS 3 -#define TWCC_MAXCONNECTIONS 4 -#define TWCC_OPERATIONERROR 5 -#define TWCC_BADCAP 6 -#define TWCC_BADPROTOCOL 9 -#define TWCC_BADVALUE 10 -#define TWCC_SEQERROR 11 -#define TWCC_BADDEST 12 -#define TWCC_CAPUNSUPPORTED 13 -#define TWCC_CAPBADOPERATION 14 -#define TWCC_CAPSEQERROR 15 -#define TWCC_DENIED 16 -#define TWCC_FILEEXISTS 17 -#define TWCC_FILENOTFOUND 18 -#define TWCC_NOTEMPTY 19 -#define TWCC_PAPERJAM 20 -#define TWCC_PAPERDOUBLEFEED 21 -#define TWCC_FILEWRITEERROR 22 -#define TWCC_CHECKDEVICEONLINE 23 -#define TWCC_INTERLOCK 24 -#define TWCC_DAMAGEDCORNER 25 -#define TWCC_FOCUSERROR 26 -#define TWCC_DOCTOOLIGHT 27 -#define TWCC_DOCTOODARK 28 -#define TWCC_NOMEDIA 29 - -/* bit patterns: for query the operation that are supported by the data source on a capability */ -/* Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT */ -#define TWQC_GET 0x0001 -#define TWQC_SET 0x0002 -#define TWQC_GETDEFAULT 0x0004 -#define TWQC_GETCURRENT 0x0008 -#define TWQC_RESET 0x0010 -#define TWQC_SETCONSTRAINT 0x0020 -#define TWQC_GETHELP 0x0100 -#define TWQC_GETLABEL 0x0200 -#define TWQC_GETLABELENUM 0x0400 - -/**************************************************************************** - * Depreciated Items * - ****************************************************************************/ -#if defined(WIN32) || defined(WIN64) - #define TW_HUGE -#elif !defined(TWH_CMP_GNU) - #define TW_HUGE huge -#else - #define TW_HUGE -#endif - -typedef BYTE TW_HUGE * HPBYTE; -typedef void TW_HUGE * HPVOID; - -typedef unsigned char TW_STR1024[1026], FAR *pTW_STR1026, FAR *pTW_STR1024; -typedef wchar_t TW_UNI512[512], FAR *pTW_UNI512; - -#define TWTY_STR1024 0x000d -#define TWTY_UNI512 0x000e - -#define TWFF_JPN 12 - -#define DAT_TWUNKIDENTITY 0x000b -#define DAT_SETUPFILEXFER2 0x0301 - -#define CAP_CLEARBUFFERS 0x101d -#define CAP_SUPPORTEDCAPSEXT 0x100c -#define CAP_FILESYSTEM //0x???? -#define CAP_PAGEMULTIPLEACQUIRE 0x1023 -#define CAP_PAPERBINDING 0x102f -#define CAP_PASSTHRU 0x1031 -#define CAP_POWERDOWNTIME 0x1034 -#define ACAP_AUDIOFILEFORMAT 0x1201 - -#define MSG_CHECKSTATUS 0x0201 - -#define MSG_INVOKE_CALLBACK 0x0903 /* Mac Only, deprecated - use DAT_NULL and MSG_xxx instead */ - -#define TWQC_CONSTRAINABLE 0x0040 - -#define TWSX_FILE2 3 - -/* CAP_FILESYSTEM values (FS_ means file system) */ -#define TWFS_FILESYSTEM 0 -#define TWFS_RECURSIVEDELETE 1 - -/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */ -#define TWPT_SRGB64 11 -#define TWPT_BGR 12 -#define TWPT_CIELAB 13 -#define TWPT_CIELUV 14 -#define TWPT_YCBCR 15 - -/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */ -#define TWSS_B 8 -#define TWSS_A4LETTER TWSS_A4 -#define TWSS_B3 TWSS_ISOB3 -#define TWSS_B4 TWSS_ISOB4 -#define TWSS_B6 TWSS_ISOB6 -#define TWSS_B5LETTER TWSS_JISB5 - -/* ACAP_AUDIOFILEFORMAT values (AF_ means audio format). Added 1.8 */ -#define TWAF_WAV 0 -#define TWAF_AIFF 1 -#define TWAF_AU 3 -#define TWAF_SND 4 - -/* CAP_CLEARBUFFERS values */ -#define TWCB_AUTO 0 -#define TWCB_CLEAR 1 -#define TWCB_NOCLEAR 2 - -/* DAT_SETUPFILEXFER2. Sets up DS to application data transfer via a file. Added 1.9 */ -typedef struct { - TW_MEMREF FileName; - TW_UINT16 FileNameType; - TW_UINT16 Format; - TW_INT16 VRefNum; - TW_UINT32 parID; -} TW_SETUPFILEXFER2, FAR * pTW_SETUPFILEXFER2; - -/* DAT_TWUNKIDENTITY. Provides DS identity and 'other' information necessary */ -/* across thunk link. */ -typedef struct { - TW_IDENTITY identity; - TW_STR255 dsPath; -} TW_TWUNKIDENTITY, FAR * pTW_TWUNKIDENTITY; - -/* Provides DS_Entry parameters over thunk link. */ -typedef struct -{ - TW_INT8 destFlag; - TW_IDENTITY dest; - TW_INT32 dataGroup; - TW_INT16 dataArgType; - TW_INT16 message; - TW_INT32 pDataSize; - // TW_MEMREF pData; -} TW_TWUNKDSENTRYPARAMS, FAR * pTW_TWUNKDSENTRYPARAMS; - -/* Provides DS_Entry results over thunk link. */ -typedef struct -{ - TW_UINT16 returnCode; - TW_UINT16 conditionCode; - TW_INT32 pDataSize; - // TW_MEMREF pData; -} TW_TWUNKDSENTRYRETURN, FAR * pTW_TWUNKDSENTRYRETURN; - -typedef struct -{ - TW_UINT16 Cap; - TW_UINT16 Properties; -} TW_CAPEXT, FAR * pTW_CAPEXT; - -/* DAT_SETUPAUDIOFILEXFER, information required to setup an audio file transfer */ -typedef struct { - TW_STR255 FileName; /* full path target file */ - TW_UINT16 Format; /* one of TWAF_xxxx */ - TW_INT16 VRefNum; -} TW_SETUPAUDIOFILEXFER, FAR * pTW_SETUPAUDIOFILEXFER; - - -/**************************************************************************** - * Entry Points * - ****************************************************************************/ - -/********************************************************************** - * Function: DSM_Entry, the only entry point into the Data Source Manager. - ********************************************************************/ -#ifdef TWH_CMP_MSC - #define TW_CALLINGSTYLE PASCAL -#else - #define TW_CALLINGSTYLE -#endif - -/* Don't mangle the name "DSM_Entry" if we're compiling in C++! */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -TW_UINT16 TW_CALLINGSTYLE DSM_Entry( pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -typedef TW_UINT16 (TW_CALLINGSTYLE *DSMENTRYPROC)(pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); -#ifdef __cplusplus -} -#endif /* cplusplus */ - - -/********************************************************************** - * Function: DS_Entry, the entry point provided by a Data Source. - ********************************************************************/ -/* Don't mangle the name "DS_Entry" if we're compiling in C++! */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -TW_UINT16 TW_CALLINGSTYLE DS_Entry(pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -typedef TW_UINT16 (FAR PASCAL *DSENTRYPROC)(pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -TW_UINT16 TW_CALLINGSTYLE TWAIN_Callback( pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); -typedef TW_UINT16 (TW_CALLINGSTYLE *TWAINCALLBACKPROC)(pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -TW_HANDLE TW_CALLINGSTYLE DSM_MemAllocate (TW_UINT32); -typedef TW_HANDLE (TW_CALLINGSTYLE *DSM_MEMALLOCATE)(TW_UINT32 _size); - -void TW_CALLINGSTYLE DSM_MemFree (TW_HANDLE); -typedef void (TW_CALLINGSTYLE *DSM_MEMFREE)(TW_HANDLE _handle); - -TW_MEMREF TW_CALLINGSTYLE DSM_MemLock (TW_HANDLE); -typedef TW_MEMREF (TW_CALLINGSTYLE *DSM_MEMLOCK)(TW_HANDLE _handle); - -void TW_CALLINGSTYLE DSM_MemUnlock (TW_HANDLE); -typedef void (TW_CALLINGSTYLE *DSM_MEMUNLOCK)(TW_HANDLE _handle); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -/* DAT_ENTRYPOINT. returns essential entry points. */ -typedef struct { - TW_UINT32 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*/ -typedef struct { - TW_UINT32 Size; - TW_UINT32 HueStart; - TW_UINT32 HueEnd; - TW_UINT32 SaturationStart; - TW_UINT32 SaturationEnd; - TW_UINT32 ValueStart; - TW_UINT32 ValueEnd; - TW_UINT32 Replacement; -} TW_FILTER_DESCRIPTOR, *pTW_FILTER_DESCRIPTOR; - -/* DAT_FILTER */ -typedef struct { - TW_UINT32 Size; - TW_UINT32 DescriptorCount; - TW_UINT32 MaxDescriptorCount; - TW_UINT32 Condition; - TW_HANDLE hDescriptors; -} TW_FILTER, *pTW_FILTER; - - -/* Restore the previous packing alignment: this occurs after all structures are defined */ -#ifdef TWH_CMP_MSC - #pragma pack (pop, before_twain) -#elif defined(TWH_CMP_GNU) - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - #pragma options align = reset - #else - #pragma pack (pop, before_twain) - #endif -#elif defined(TWH_CMP_BORLAND) - #pragma option -a. -#endif - -#endif /* TWAIN */