mirror of
https://github.com/soukoku/ntwain.git
synced 2025-04-05 20:59:23 +08:00
Added all DGControl triplets.
This commit is contained in:
parent
890e5680be
commit
b81ab67db1
@ -1,6 +1,6 @@
|
||||
# TWAIN dotnet library
|
||||
|
||||
NOTE: This is a rewrite test that internally uses
|
||||
NOTE: This is a rewrite test that internally uses parts of
|
||||
[twaincs](https://github.com/twain/twain-cs) from
|
||||
the TWAIN Working Group. It doesn't fully work yet.
|
||||
Use V3 branch for the current version.
|
||||
|
@ -119,5 +119,26 @@ namespace NTwain.DSM
|
||||
ref TW_IDENTITY_MACOSX origin, ref TW_IDENTITY_MACOSX dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_SETUPFILEXFER filexfer
|
||||
);
|
||||
|
||||
[DllImport(DsmName, CharSet = CharSet.Ansi)]
|
||||
public static extern ushort DSM_Entry
|
||||
(
|
||||
ref TW_IDENTITY_MACOSX origin, ref TW_IDENTITY_MACOSX dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_PASSTHRU passthru
|
||||
);
|
||||
|
||||
[DllImport(DsmName, CharSet = CharSet.Ansi)]
|
||||
public static extern ushort DSM_Entry
|
||||
(
|
||||
ref TW_IDENTITY_MACOSX origin, ref TW_IDENTITY_MACOSX dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_FILESYSTEM filesystem
|
||||
);
|
||||
|
||||
[DllImport(DsmName, CharSet = CharSet.Ansi)]
|
||||
public static extern ushort DSM_Entry
|
||||
(
|
||||
ref TW_IDENTITY_MACOSX origin, ref TW_IDENTITY_MACOSX dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_CAPABILITY cap
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -119,5 +119,26 @@ namespace NTwain.DSM
|
||||
ref TW_IDENTITY_MACOSX origin, ref TW_IDENTITY_MACOSX dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_SETUPFILEXFER filexfer
|
||||
);
|
||||
|
||||
[DllImport(DsmName, CharSet = CharSet.Ansi)]
|
||||
public static extern ushort DSM_Entry
|
||||
(
|
||||
ref TW_IDENTITY_MACOSX origin, ref TW_IDENTITY_MACOSX dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_PASSTHRU passthru
|
||||
);
|
||||
|
||||
[DllImport(DsmName, CharSet = CharSet.Ansi)]
|
||||
public static extern ushort DSM_Entry
|
||||
(
|
||||
ref TW_IDENTITY_MACOSX origin, ref TW_IDENTITY_MACOSX dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_FILESYSTEM filesystem
|
||||
);
|
||||
|
||||
[DllImport(DsmName, CharSet = CharSet.Ansi)]
|
||||
public static extern ushort DSM_Entry
|
||||
(
|
||||
ref TW_IDENTITY_MACOSX origin, ref TW_IDENTITY_MACOSX dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_CAPABILITY cap
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -119,5 +119,26 @@ namespace NTwain.DSM
|
||||
ref TW_IDENTITY_LEGACY origin, ref TW_IDENTITY_LEGACY dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_SETUPFILEXFER filexfer
|
||||
);
|
||||
|
||||
[DllImport(DsmName, CharSet = CharSet.Ansi)]
|
||||
public static extern ushort DSM_Entry
|
||||
(
|
||||
ref TW_IDENTITY_LEGACY origin, ref TW_IDENTITY_LEGACY dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_PASSTHRU passthru
|
||||
);
|
||||
|
||||
[DllImport(DsmName, CharSet = CharSet.Ansi)]
|
||||
public static extern ushort DSM_Entry
|
||||
(
|
||||
ref TW_IDENTITY_LEGACY origin, ref TW_IDENTITY_LEGACY dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_FILESYSTEM filesystem
|
||||
);
|
||||
|
||||
[DllImport(DsmName, CharSet = CharSet.Ansi)]
|
||||
public static extern ushort DSM_Entry
|
||||
(
|
||||
ref TW_IDENTITY_LEGACY origin, ref TW_IDENTITY_LEGACY dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_CAPABILITY cap
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -119,5 +119,26 @@ namespace NTwain.DSM
|
||||
ref TW_IDENTITY_LEGACY origin, ref TW_IDENTITY_LEGACY dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_SETUPFILEXFER filexfer
|
||||
);
|
||||
|
||||
[DllImport(DsmName, CharSet = CharSet.Ansi)]
|
||||
public static extern ushort DSM_Entry
|
||||
(
|
||||
ref TW_IDENTITY_LEGACY origin, ref TW_IDENTITY_LEGACY dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_PASSTHRU passthru
|
||||
);
|
||||
|
||||
[DllImport(DsmName, CharSet = CharSet.Ansi)]
|
||||
public static extern ushort DSM_Entry
|
||||
(
|
||||
ref TW_IDENTITY_LEGACY origin, ref TW_IDENTITY_LEGACY dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_FILESYSTEM filesystem
|
||||
);
|
||||
|
||||
[DllImport(DsmName, CharSet = CharSet.Ansi)]
|
||||
public static extern ushort DSM_Entry
|
||||
(
|
||||
ref TW_IDENTITY_LEGACY origin, ref TW_IDENTITY_LEGACY dest,
|
||||
DG dg, DAT dat, MSG msg, ref TW_CAPABILITY cap
|
||||
);
|
||||
}
|
||||
}
|
||||
|
62
src/NTwain/Triplets/ControlDATs/Capability.cs
Normal file
62
src/NTwain/Triplets/ControlDATs/Capability.cs
Normal file
@ -0,0 +1,62 @@
|
||||
using NTwain.Data;
|
||||
using NTwain.DSM;
|
||||
|
||||
namespace NTwain.Triplets.ControlDATs
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains calls used with <see cref="DG.CONTROL"/> and <see cref="DAT.CAPABILITY"/>.
|
||||
/// </summary>
|
||||
public class Capability
|
||||
{
|
||||
public STS Get(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, MSG.GET, ref data);
|
||||
public STS GetCurrent(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, MSG.GETCURRENT, ref data);
|
||||
public STS GetDefault(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, MSG.GETDEFAULT, ref data);
|
||||
public STS GetHelp(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, MSG.GETHELP, ref data);
|
||||
public STS GetLabel(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, MSG.GETLABEL, ref data);
|
||||
public STS GetLabelEnum(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, MSG.GETLABELENUM, ref data);
|
||||
public STS QuerySupport(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, MSG.QUERYSUPPORT, ref data);
|
||||
public STS Reset(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, MSG.RESET, ref data);
|
||||
public STS ResetAll(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, MSG.RESETALL, ref data);
|
||||
public STS Set(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, MSG.SET, ref data);
|
||||
|
||||
static STS DoIt(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, MSG msg, ref TW_CAPABILITY data)
|
||||
{
|
||||
var rc = STS.FAILURE;
|
||||
if (TwainPlatform.IsWindows)
|
||||
{
|
||||
if (TwainPlatform.Is32bit && TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)WinLegacyDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.CAPABILITY, msg, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)WinNewDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.CAPABILITY, msg, ref data);
|
||||
}
|
||||
}
|
||||
else if (TwainPlatform.IsMacOSX)
|
||||
{
|
||||
TW_IDENTITY_MACOSX app2 = app;
|
||||
TW_IDENTITY_MACOSX ds2 = ds;
|
||||
if (TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)OSXLegacyDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.CAPABILITY, msg, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)OSXNewDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.CAPABILITY, msg, ref data);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
}
|
62
src/NTwain/Triplets/ControlDATs/CapabilityCustom.cs
Normal file
62
src/NTwain/Triplets/ControlDATs/CapabilityCustom.cs
Normal file
@ -0,0 +1,62 @@
|
||||
using NTwain.Data;
|
||||
using NTwain.DSM;
|
||||
|
||||
namespace NTwain.Triplets.ControlDATs
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains calls used with <see cref="DG.CONTROL"/> and custom capability DAT for certain devices.
|
||||
/// </summary>
|
||||
public class CapabilityCustom
|
||||
{
|
||||
public STS Get(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ushort customDAT, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, customDAT, MSG.GET, ref data);
|
||||
public STS GetCurrent(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ushort customDAT, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, customDAT, MSG.GETCURRENT, ref data);
|
||||
public STS GetDefault(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ushort customDAT, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, customDAT, MSG.GETDEFAULT, ref data);
|
||||
public STS GetHelp(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ushort customDAT, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, customDAT, MSG.GETHELP, ref data);
|
||||
public STS GetLabel(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ushort customDAT, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, customDAT, MSG.GETLABEL, ref data);
|
||||
public STS GetLabelEnum(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ushort customDAT, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, customDAT, MSG.GETLABELENUM, ref data);
|
||||
public STS QuerySupport(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ushort customDAT, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, customDAT, MSG.QUERYSUPPORT, ref data);
|
||||
public STS Reset(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ushort customDAT, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, customDAT, MSG.RESET, ref data);
|
||||
public STS ResetAll(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ushort customDAT, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, customDAT, MSG.RESETALL, ref data);
|
||||
public STS Set(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ushort customDAT, ref TW_CAPABILITY data)
|
||||
=> DoIt(ref app, ref ds, customDAT, MSG.SET, ref data);
|
||||
|
||||
static STS DoIt(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ushort dat, MSG msg, ref TW_CAPABILITY data)
|
||||
{
|
||||
var rc = STS.FAILURE;
|
||||
if (TwainPlatform.IsWindows)
|
||||
{
|
||||
if (TwainPlatform.Is32bit && TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)WinLegacyDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, (DAT)dat, msg, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)WinNewDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, (DAT)dat, msg, ref data);
|
||||
}
|
||||
}
|
||||
else if (TwainPlatform.IsMacOSX)
|
||||
{
|
||||
TW_IDENTITY_MACOSX app2 = app;
|
||||
TW_IDENTITY_MACOSX ds2 = ds;
|
||||
if (TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)OSXLegacyDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, (DAT)dat, msg, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)OSXNewDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, (DAT)dat, msg, ref data);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
}
|
@ -15,11 +15,11 @@ namespace NTwain.Triplets.ControlDATs
|
||||
{
|
||||
if (TwainPlatform.Is32bit && TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)WinLegacyDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.DEVICEEVENT, MSG.PROCESSEVENT, ref data);
|
||||
rc = (STS)WinLegacyDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.EVENT, MSG.PROCESSEVENT, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)WinNewDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.DEVICEEVENT, MSG.PROCESSEVENT, ref data);
|
||||
rc = (STS)WinNewDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.EVENT, MSG.PROCESSEVENT, ref data);
|
||||
}
|
||||
}
|
||||
else if (TwainPlatform.IsMacOSX)
|
||||
@ -28,11 +28,11 @@ namespace NTwain.Triplets.ControlDATs
|
||||
TW_IDENTITY_MACOSX ds2 = ds;
|
||||
if (TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)OSXLegacyDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.DEVICEEVENT, MSG.PROCESSEVENT, ref data);
|
||||
rc = (STS)OSXLegacyDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.EVENT, MSG.PROCESSEVENT, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)OSXNewDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.DEVICEEVENT, MSG.PROCESSEVENT, ref data);
|
||||
rc = (STS)OSXNewDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.EVENT, MSG.PROCESSEVENT, ref data);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
|
64
src/NTwain/Triplets/ControlDATs/FileSystem.cs
Normal file
64
src/NTwain/Triplets/ControlDATs/FileSystem.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using NTwain.Data;
|
||||
using NTwain.DSM;
|
||||
|
||||
namespace NTwain.Triplets.ControlDATs
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains calls used with <see cref="DG.CONTROL"/> and <see cref="DAT.FILESYSTEM"/>.
|
||||
/// </summary>
|
||||
public class FileSystem
|
||||
{
|
||||
public STS AutomaticCaptureDirectory(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_FILESYSTEM data)
|
||||
=> DoIt(ref app, ref ds, MSG.AUTOMATICCAPTUREDIRECTORY, ref data);
|
||||
public STS ChangeDirectory(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_FILESYSTEM data)
|
||||
=> DoIt(ref app, ref ds, MSG.CHANGEDIRECTORY, ref data);
|
||||
public STS Copy(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_FILESYSTEM data)
|
||||
=> DoIt(ref app, ref ds, MSG.COPY, ref data);
|
||||
public STS CreateDirectory(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_FILESYSTEM data)
|
||||
=> DoIt(ref app, ref ds, MSG.CREATEDIRECTORY, ref data);
|
||||
public STS Delete(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_FILESYSTEM data)
|
||||
=> DoIt(ref app, ref ds, MSG.DELETE, ref data);
|
||||
public STS FormatMedia(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_FILESYSTEM data)
|
||||
=> DoIt(ref app, ref ds, MSG.FORMATMEDIA, ref data);
|
||||
public STS GetClose(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_FILESYSTEM data)
|
||||
=> DoIt(ref app, ref ds, MSG.GETCLOSE, ref data);
|
||||
public STS GetFirstFile(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_FILESYSTEM data)
|
||||
=> DoIt(ref app, ref ds, MSG.GETFIRSTFILE, ref data);
|
||||
public STS GetInfo(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_FILESYSTEM data)
|
||||
=> DoIt(ref app, ref ds, MSG.GETINFO, ref data);
|
||||
public STS GetNextFile(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_FILESYSTEM data)
|
||||
=> DoIt(ref app, ref ds, MSG.GETNEXTFILE, ref data);
|
||||
public STS Rename(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_FILESYSTEM data)
|
||||
=> DoIt(ref app, ref ds, MSG.RENAME, ref data);
|
||||
|
||||
static STS DoIt(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, MSG msg, ref TW_FILESYSTEM data)
|
||||
{
|
||||
var rc = STS.FAILURE;
|
||||
if (TwainPlatform.IsWindows)
|
||||
{
|
||||
if (TwainPlatform.Is32bit && TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)WinLegacyDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.FILESYSTEM, msg, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)WinNewDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.FILESYSTEM, msg, ref data);
|
||||
}
|
||||
}
|
||||
else if (TwainPlatform.IsMacOSX)
|
||||
{
|
||||
TW_IDENTITY_MACOSX app2 = app;
|
||||
TW_IDENTITY_MACOSX ds2 = ds;
|
||||
if (TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)OSXLegacyDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.FILESYSTEM, msg, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)OSXNewDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.FILESYSTEM, msg, ref data);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
}
|
41
src/NTwain/Triplets/ControlDATs/Passthru.cs
Normal file
41
src/NTwain/Triplets/ControlDATs/Passthru.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using NTwain.Data;
|
||||
using NTwain.DSM;
|
||||
|
||||
namespace NTwain.Triplets.ControlDATs
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains calls used with <see cref="DG.CONTROL"/> and <see cref="DAT.PASSTHRU"/>.
|
||||
/// </summary>
|
||||
public class Passthru
|
||||
{
|
||||
public STS PassThrough(ref TW_IDENTITY_LEGACY app, ref TW_IDENTITY_LEGACY ds, ref TW_PASSTHRU data)
|
||||
{
|
||||
var rc = STS.FAILURE;
|
||||
if (TwainPlatform.IsWindows)
|
||||
{
|
||||
if (TwainPlatform.Is32bit && TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)WinLegacyDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.PASSTHRU, MSG.PASSTHRU, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)WinNewDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.PASSTHRU, MSG.PASSTHRU, ref data);
|
||||
}
|
||||
}
|
||||
else if (TwainPlatform.IsMacOSX)
|
||||
{
|
||||
TW_IDENTITY_MACOSX app2 = app;
|
||||
TW_IDENTITY_MACOSX ds2 = ds;
|
||||
if (TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)OSXLegacyDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.PASSTHRU, MSG.PASSTHRU, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)OSXNewDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.PASSTHRU, MSG.PASSTHRU, ref data);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
}
|
@ -25,11 +25,11 @@ namespace NTwain.Triplets.ControlDATs
|
||||
{
|
||||
if (TwainPlatform.Is32bit && TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)WinLegacyDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.DEVICEEVENT, msg, ref data);
|
||||
rc = (STS)WinLegacyDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.PENDINGXFERS, msg, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)WinNewDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.DEVICEEVENT, msg, ref data);
|
||||
rc = (STS)WinNewDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.PENDINGXFERS, msg, ref data);
|
||||
}
|
||||
}
|
||||
else if (TwainPlatform.IsMacOSX)
|
||||
@ -38,11 +38,11 @@ namespace NTwain.Triplets.ControlDATs
|
||||
TW_IDENTITY_MACOSX ds2 = ds;
|
||||
if (TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)OSXLegacyDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.DEVICEEVENT, msg, ref data);
|
||||
rc = (STS)OSXLegacyDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.PENDINGXFERS, msg, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)OSXNewDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.DEVICEEVENT, msg, ref data);
|
||||
rc = (STS)OSXNewDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.PENDINGXFERS, msg, ref data);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
|
@ -4,7 +4,7 @@ using NTwain.DSM;
|
||||
namespace NTwain.Triplets.ControlDATs
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains calls used with <see cref="DG.SetupMemXfer"/> and <see cref="DAT.SETUPFILEXFER"/>.
|
||||
/// Contains calls used with <see cref="DG.CONTROL"/> and <see cref="DAT.SETUPFILEXFER"/>.
|
||||
/// </summary>
|
||||
public class SetupFileXfer
|
||||
{
|
||||
@ -25,11 +25,11 @@ namespace NTwain.Triplets.ControlDATs
|
||||
{
|
||||
if (TwainPlatform.Is32bit && TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)WinLegacyDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.DEVICEEVENT, msg, ref data);
|
||||
rc = (STS)WinLegacyDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.SETUPFILEXFER, msg, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)WinNewDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.DEVICEEVENT, msg, ref data);
|
||||
rc = (STS)WinNewDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.SETUPFILEXFER, msg, ref data);
|
||||
}
|
||||
}
|
||||
else if (TwainPlatform.IsMacOSX)
|
||||
@ -38,11 +38,11 @@ namespace NTwain.Triplets.ControlDATs
|
||||
TW_IDENTITY_MACOSX ds2 = ds;
|
||||
if (TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)OSXLegacyDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.DEVICEEVENT, msg, ref data);
|
||||
rc = (STS)OSXLegacyDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.SETUPFILEXFER, msg, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)OSXNewDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.DEVICEEVENT, msg, ref data);
|
||||
rc = (STS)OSXNewDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.SETUPFILEXFER, msg, ref data);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
|
@ -4,7 +4,7 @@ using NTwain.DSM;
|
||||
namespace NTwain.Triplets.ControlDATs
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains calls used with <see cref="DG.SetupMemXfer"/> and <see cref="DAT.SETUPMEMXFER"/>.
|
||||
/// Contains calls used with <see cref="DG.CONTROL"/> and <see cref="DAT.SETUPMEMXFER"/>.
|
||||
/// </summary>
|
||||
public class SetupMemXfer
|
||||
{
|
||||
@ -15,11 +15,11 @@ namespace NTwain.Triplets.ControlDATs
|
||||
{
|
||||
if (TwainPlatform.Is32bit && TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)WinLegacyDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.DEVICEEVENT, MSG.GET, ref data);
|
||||
rc = (STS)WinLegacyDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.SETUPMEMXFER, MSG.GET, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)WinNewDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.DEVICEEVENT, MSG.GET, ref data);
|
||||
rc = (STS)WinNewDSM.DSM_Entry(ref app, ref ds, DG.CONTROL, DAT.SETUPMEMXFER, MSG.GET, ref data);
|
||||
}
|
||||
}
|
||||
else if (TwainPlatform.IsMacOSX)
|
||||
@ -28,11 +28,11 @@ namespace NTwain.Triplets.ControlDATs
|
||||
TW_IDENTITY_MACOSX ds2 = ds;
|
||||
if (TwainPlatform.PreferLegacyDSM)
|
||||
{
|
||||
rc = (STS)OSXLegacyDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.DEVICEEVENT, MSG.GET, ref data);
|
||||
rc = (STS)OSXLegacyDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.SETUPMEMXFER, MSG.GET, ref data);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = (STS)OSXNewDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.DEVICEEVENT, MSG.GET, ref data);
|
||||
rc = (STS)OSXNewDSM.DSM_Entry(ref app2, ref ds2, DG.CONTROL, DAT.SETUPMEMXFER, MSG.GET, ref data);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
|
@ -1,6 +1,4 @@
|
||||
using TWAINWorkingGroup;
|
||||
|
||||
namespace NTwain.Triplets
|
||||
namespace NTwain.Triplets
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains triplet calls starting with <see cref="DG.AUDIO"/>.
|
||||
|
@ -7,31 +7,43 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public static class DGControl
|
||||
{
|
||||
public static readonly Parent Parent = new();
|
||||
public static readonly Callback Callback = new();
|
||||
|
||||
public static readonly EntryPoint EntryPoint = new();
|
||||
public static readonly Callback2 Callback2 = new();
|
||||
|
||||
public static readonly Identity Identity = new();
|
||||
public static readonly Capability Capability = new();
|
||||
|
||||
public static readonly Status Status = new();
|
||||
|
||||
public static readonly StatusUtf8 StatusUtf8 = new();
|
||||
public static readonly CapabilityCustom CapabilityCustom = new();
|
||||
|
||||
public static readonly CustomDsData CustomDsData = new();
|
||||
|
||||
public static readonly DeviceEvent DeviceEvent = new();
|
||||
|
||||
public static readonly Callback Callback = new();
|
||||
|
||||
public static readonly Callback2 Callback2 = new();
|
||||
|
||||
public static readonly XferGroup XferGroup = new();
|
||||
|
||||
public static readonly UserInterface UserInterface = new();
|
||||
public static readonly EntryPoint EntryPoint = new();
|
||||
|
||||
public static readonly Event Event = new();
|
||||
|
||||
public static readonly FileSystem FileSystem = new();
|
||||
|
||||
public static readonly Identity Identity = new();
|
||||
|
||||
public static readonly Parent Parent = new();
|
||||
|
||||
public static readonly Passthru Passthru = new();
|
||||
|
||||
public static readonly PendingXfers PendingXfers = new();
|
||||
|
||||
public static readonly SetupFileXfer SetupFileXfer = new();
|
||||
|
||||
public static readonly SetupMemXfer SetupMemXfer = new();
|
||||
|
||||
public static readonly Status Status = new();
|
||||
|
||||
public static readonly StatusUtf8 StatusUtf8 = new();
|
||||
|
||||
public static readonly UserInterface UserInterface = new();
|
||||
|
||||
public static readonly XferGroup XferGroup = new();
|
||||
|
||||
}
|
||||
}
|
@ -1,6 +1,4 @@
|
||||
using TWAINWorkingGroup;
|
||||
|
||||
namespace NTwain.Triplets
|
||||
namespace NTwain.Triplets
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains triplet calls starting with <see cref="DG.IMAGE"/>.
|
||||
|
@ -110,10 +110,5 @@ namespace NTwain
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user