mirror of
https://github.com/soukoku/ntwain.git
synced 2025-12-01 10:54:08 +08:00
Road to v1 begins!
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
using NTwain.Data;
|
||||
using NTwain.Values;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace NTwain.Triplets
|
||||
{
|
||||
@@ -12,33 +10,6 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
static partial class Dsm
|
||||
{
|
||||
// Change pinvoke base on where running in 64bit mode.
|
||||
// Theoretically [DllImport("twaindsm", EntryPoint = "#1")]
|
||||
// works on both 32 and 64 bit
|
||||
// but it's not installed on either system by default.
|
||||
// A proper 64 bit twain driver would've installed it so
|
||||
// in essence it only exists in 64 bit systems and thus
|
||||
// the 2 sets of identical pinvokes for windows :(
|
||||
|
||||
internal static readonly bool UseNewDSM = CheckIfCanUseNewDSM();
|
||||
|
||||
private static bool CheckIfCanUseNewDSM()
|
||||
{
|
||||
#if DEBUG
|
||||
return IntPtr.Size == 8;
|
||||
#else
|
||||
var path = Path.Combine(Environment.SystemDirectory, "twaindsm.dll");
|
||||
// if 64bit or the new dll exists use it
|
||||
return IntPtr.Size == 8 || File.Exists(path);
|
||||
#endif
|
||||
}
|
||||
internal static readonly bool IsOnMono = Type.GetType("Mono.Runtime") != null;
|
||||
|
||||
internal static readonly bool IsWin = Environment.OSVersion.Platform == PlatformID.Win32NT;
|
||||
static readonly bool IsLinux = Environment.OSVersion.Platform == PlatformID.Unix;
|
||||
|
||||
// define sig for each different data type since "object" doesn't work
|
||||
|
||||
#region wrapped calls
|
||||
|
||||
public static ReturnCode DsmEntry(
|
||||
@@ -49,12 +20,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
ref IntPtr data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, dg, dat, msg, ref data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, dg, dat, msg, ref data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, dg, dat, msg, ref data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, dg, dat, msg, ref data);
|
||||
}
|
||||
@@ -69,12 +40,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
ref DataGroups data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, dg, dat, msg, ref data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, dg, dat, msg, ref data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, dg, dat, msg, ref data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, dg, dat, msg, ref data);
|
||||
}
|
||||
@@ -87,12 +58,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWAudioInfo data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Audio, DataArgumentType.AudioInfo, msg, data);
|
||||
}
|
||||
@@ -106,12 +77,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWCapability data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.Capability, msg, data);
|
||||
}
|
||||
@@ -125,12 +96,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWCustomDSData data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data);
|
||||
}
|
||||
@@ -144,12 +115,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWDeviceEvent data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.DeviceEvent, msg, data);
|
||||
}
|
||||
@@ -163,12 +134,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWCallback data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data);
|
||||
}
|
||||
@@ -182,12 +153,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWCallback2 data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.Callback, msg, data);
|
||||
}
|
||||
@@ -201,12 +172,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWEntryPoint data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.EntryPoint, msg, data);
|
||||
}
|
||||
@@ -220,12 +191,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWEvent data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.Event, msg, data);
|
||||
}
|
||||
@@ -239,12 +210,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWFileSystem data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.FileSystem, msg, data);
|
||||
}
|
||||
@@ -256,12 +227,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWIdentity data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, IntPtr.Zero, DataGroups.Control, DataArgumentType.Identity, msg, data);
|
||||
}
|
||||
@@ -275,12 +246,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWPassThru data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.PassThru, msg, data);
|
||||
}
|
||||
@@ -294,12 +265,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWPendingXfers data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.PendingXfers, msg, data);
|
||||
}
|
||||
@@ -313,12 +284,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWSetupFileXfer data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.SetupFileXfer, msg, data);
|
||||
}
|
||||
@@ -332,12 +303,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWSetupMemXfer data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.SetupMemXfer, msg, data);
|
||||
}
|
||||
@@ -351,12 +322,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWStatusUtf8 data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.StatusUtf8, msg, data);
|
||||
}
|
||||
@@ -370,12 +341,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWUserInterface data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.UserInterface, msg, data);
|
||||
}
|
||||
@@ -389,12 +360,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWCieColor data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.CieColor, msg, data);
|
||||
}
|
||||
@@ -408,12 +379,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWExtImageInfo data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.ExtImageInfo, msg, data);
|
||||
}
|
||||
@@ -426,12 +397,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWFilter data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.Filter, msg, data);
|
||||
}
|
||||
@@ -444,12 +415,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWGrayResponse data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.GrayResponse, msg, data);
|
||||
}
|
||||
@@ -463,12 +434,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWImageInfo data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.ImageInfo, msg, data);
|
||||
}
|
||||
@@ -482,12 +453,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWImageLayout data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.ImageLayout, msg, data);
|
||||
}
|
||||
@@ -501,12 +472,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWImageMemXfer data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.ImageMemXfer, msg, data);
|
||||
}
|
||||
@@ -520,12 +491,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWJpegCompression data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.JpegCompression, msg, data);
|
||||
}
|
||||
@@ -539,12 +510,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWPalette8 data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.Palette8, msg, data);
|
||||
}
|
||||
@@ -558,12 +529,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWRgbResponse data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Image, DataArgumentType.RgbResponse, msg, data);
|
||||
}
|
||||
@@ -577,12 +548,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
TWStatus data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.Status, msg, data);
|
||||
}
|
||||
@@ -597,12 +568,12 @@ namespace NTwain.Triplets
|
||||
Message msg,
|
||||
ref TWMemory data)
|
||||
{
|
||||
if (IsWin)
|
||||
if (Platform.IsWin)
|
||||
{
|
||||
if (UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, dat, msg, ref data); }
|
||||
if (Platform.UseNewDSM) { return NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, dat, msg, ref data); }
|
||||
else { return NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, dat, msg, ref data); }
|
||||
}
|
||||
else if (IsLinux)
|
||||
else if (Platform.IsLinux)
|
||||
{
|
||||
return NativeMethods.DsmLinux(origin, destination, DataGroups.Control, dat, msg, ref data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user