Commit 6b0720f5 authored by Shi Quan He's avatar Shi Quan He Committed by Alexandre Julliard

Started TWAIN implementation.

Marcus Meissner <marcus@jet.franken.de> Merged into WineHQ, made sure it works without SANE.
parent 1cefed81
...@@ -360,6 +360,30 @@ AC_CHECK_LIB(cups,cupsGetPPD, ...@@ -360,6 +360,30 @@ AC_CHECK_LIB(cups,cupsGetPPD,
) )
AC_SUBST(CUPSLIBS) AC_SUBST(CUPSLIBS)
dnl **** Check for SANE ****
AC_CHECK_PROG(sane_devel,sane-config,sane-config,no)
if test "$sane_devel" = "no"
then
SANELIBS=""
SANEINCL=""
else
SANELIBS="`$sane_devel --libs`"
SANEINCL="`$sane_devel --cflags`"
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $SANEINCL"
LIBS="$LIBS $SANELIBS"
AC_CHECK_HEADER(sane/sane.h,[
AC_CHECK_LIB(sane,sane_open,[AC_DEFINE(HAVE_SANE, 1, [Define if we have SANE development environment])],
SANELIBS=""
])
)
LIBS="$ac_save_LIBS"
CPPFLAGS="$ac_save_CPPFLAGS"
fi
AC_SUBST(SANELIBS)
AC_SUBST(SANEINCL)
dnl **** Check for FreeType 2 **** dnl **** Check for FreeType 2 ****
AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no,$X_LIBS) AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no,$X_LIBS)
if test "$ft_lib" = "no" if test "$ft_lib" = "no"
...@@ -1330,6 +1354,7 @@ dlls/shlwapi/Makefile ...@@ -1330,6 +1354,7 @@ dlls/shlwapi/Makefile
dlls/sti/Makefile dlls/sti/Makefile
dlls/tapi32/Makefile dlls/tapi32/Makefile
dlls/ttydrv/Makefile dlls/ttydrv/Makefile
dlls/twain/Makefile
dlls/url/Makefile dlls/url/Makefile
dlls/urlmon/Makefile dlls/urlmon/Makefile
dlls/user/Makefile dlls/user/Makefile
......
...@@ -69,6 +69,7 @@ SUBDIRS = \ ...@@ -69,6 +69,7 @@ SUBDIRS = \
sti \ sti \
tapi32 \ tapi32 \
ttydrv \ ttydrv \
twain \
url \ url \
urlmon \ urlmon \
user \ user \
...@@ -195,6 +196,7 @@ all: \ ...@@ -195,6 +196,7 @@ all: \
tapi32.dll$(DLLEXT) \ tapi32.dll$(DLLEXT) \
toolhelp.dll$(DLLEXT) \ toolhelp.dll$(DLLEXT) \
ttydrv.dll$(DLLEXT) \ ttydrv.dll$(DLLEXT) \
twain_32.dll$(DLLEXT) \
typelib.dll$(DLLEXT) \ typelib.dll$(DLLEXT) \
url.dll$(DLLEXT) \ url.dll$(DLLEXT) \
urlmon.dll$(DLLEXT) \ urlmon.dll$(DLLEXT) \
...@@ -426,6 +428,9 @@ tapi32.dll$(DLLEXT): tapi32/tapi32.dll$(DLLEXT) ...@@ -426,6 +428,9 @@ tapi32.dll$(DLLEXT): tapi32/tapi32.dll$(DLLEXT)
ttydrv.dll$(DLLEXT): ttydrv/ttydrv.dll$(DLLEXT) ttydrv.dll$(DLLEXT): ttydrv/ttydrv.dll$(DLLEXT)
$(RM) $@ && $(LN_S) ttydrv/ttydrv.dll$(DLLEXT) $@ $(RM) $@ && $(LN_S) ttydrv/ttydrv.dll$(DLLEXT) $@
twain_32.dll$(DLLEXT): twain/twain_32.dll$(DLLEXT)
$(RM) $@ && $(LN_S) twain/twain_32.dll$(DLLEXT) $@
url.dll$(DLLEXT): url/url.dll$(DLLEXT) url.dll$(DLLEXT): url/url.dll$(DLLEXT)
$(RM) $@ && $(LN_S) url/url.dll$(DLLEXT) $@ $(RM) $@ && $(LN_S) url/url.dll$(DLLEXT) $@
...@@ -690,6 +695,10 @@ ttydrv/ttydrv.dll$(DLLEXT): dummy user32.dll$(DLLEXT) gdi32.dll$(DLLEXT) \ ...@@ -690,6 +695,10 @@ ttydrv/ttydrv.dll$(DLLEXT): dummy user32.dll$(DLLEXT) gdi32.dll$(DLLEXT) \
libkernel32.dll.$(LIBEXT) libntdll.dll.$(LIBEXT) libkernel32.dll.$(LIBEXT) libntdll.dll.$(LIBEXT)
@cd ttydrv && $(MAKE) ttydrv.dll$(DLLEXT) @cd ttydrv && $(MAKE) ttydrv.dll$(DLLEXT)
twain/twain_32.dll$(DLLEXT): dummy user32.dll$(DLLEXT) gdi32.dll$(DLLEXT) \
kernel32.dll$(DLLEXT) ntdll.dll$(DLLEXT)
@cd twain && $(MAKE) twain_32.dll$(DLLEXT)
url/url.dll$(DLLEXT): dummy ntdll.dll$(DLLEXT) url/url.dll$(DLLEXT): dummy ntdll.dll$(DLLEXT)
@cd url && $(MAKE) url.dll$(DLLEXT) @cd url && $(MAKE) url.dll$(DLLEXT)
......
Makefile
twain_32.spec.c
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = twain_32.dll
EXTRALIBS = @SANELIBS@
EXTRAINCL = @SANEINCL@
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
C_SRCS = \
capability.c \
ds_audio.c \
ds_ctrl.c \
ds_image.c \
dsm_ctrl.c \
twain32_main.c
@MAKE_DLL_RULES@
### Dependencies:
----- Old Corel README, probably outdated ----------------------------------
1. INTRODUCTION
This library (twain32.dll) is an implementation of TWAIN API for providing image acquisition devices (scanner or digital camera) support. It uses SANE drivers as the backend and translates TWAIN API calls into SANE API calls. Unlike the twain32 library on Windows platform, it combines the Data Source Manager and Data Sources into a single library. Thus it is our responsiblity to provide a graphical user interface and capability negotiation, which usually are performed by data sources.
2. WHAT'S IMPLEMENTED
- Functions that dispatch operations specified by the operation triplets to the coresponding function.
- All the operation triplets related to the Data Source Manager are implemented. Appplication is able to enumerate data sources and open them.
- The operation triplets that deal with the UI (such as DG_CONTROL/DAT_USERINTERFACE/MSG_ENABLEDS, MSG_DISABLEDS and MSG_ENABLEDSUIONLY) are partially implemented although it does not really do much.
- The operation triplets that deal with native image transfering (DG_IMAGE/DAT_IMAGENATIVEXFER/MSG_GET) are also partially implemented. Still need to figure out how to convert the image data obtained from sane to the Windows DIB format.
- Only the CAP_ICAPXFERMECH capability is implemented.
3. TO-DO
- Image native transfer is not working correctly right now. It crashed the application due to the invalid DIB created. We need to fix this.
- Implement other image transfer mode such as file transfer and memory transfer.
- Support all required TWAIN capabilities that have not been implemented currently. There are a fixed number of capabilities specified by the TWAIN Specification. However, device capabilities are dynamic in SANE and there isn't a standard about the capability names. It would be difficult to negotiate capabilities in TWAIN given that we don't know what capabilities a SANE driver would provide. One possible solution to use a device configuration file to describe the mapping between capabilities supported by a SANE driver and those specified by TWAIN.
- Build a dynamic user interface that reflects the capabilities of different scanner devices. According to the TWAIN specification, each TWAIN driver need to provide its own user interface. However the SANE drivers do not have graphical frontends. Building a frontend for each SANE driver is a huge task. It is possible to have a dynamic frontend similar to xscanimage or xsane that works for all the devices. This is possibly the most difficult part.
- check into legal issues regarding:
- TWAIN header file
- linking to SANE (maybe should dynamically link at run time?)
- add autoconf rules for enabling based on whether sane is installed
4. FILE LISTING
twain32_main.c Functions to regconize operation tripets and dispatch
the requests to the corresponding functions.
dsm_ctrl.c Implementation of DG_CONTROL group operation triplets
destinated for source manager.
ds_ctrl.c Implementation of DG_CONTROL group operation triplets
destinated for data source.
ds_image.c Implementation of DG_IMAGE group operation triplets
destinated for data source.
ds_audio.c Implementation of DG_AUDIO group operation triplets
destinated for data source
capability.c Functions for negotiating capabilities
twain.h The original TWAIN header file
twain_i.h Header file for the internal twain functions
--
Shi Quan He
shiquan@cyberdude.com
Requirements to be a TWAIN-Compliant Source
Requirements
TWAIN-compliant Sources must support the following:
Operations
----------
DG_CONTROL / DAT_CAPABILITY / MSG_GET
DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT
DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT
DG_CONTROL / DAT_CAPABILITY / MSG_RESET
DG_CONTROL / DAT_CAPABILITY / MSG_SET
DG_CONTROL / DAT_EVENT / MSG_PROCESSEVENT
DG_CONTROL / DAT_IDENTITY / MSG_GET
DG_CONTROL / DAT_IDENTITY / MSG_OPENDS
DG_CONTROL / DAT_IDENTITY / MSG_CLOSEDS
DG_CONTROL / DAT_PENDINGXFERS / MSG_ENDXFER
DG_CONTROL / DAT_PENDINGXFERS / MSG_GET
DG_CONTROL / DAT_PENDINGXFERS / MSG_RESET
DG_CONTROL / DAT_SETUPMEMXFER / MSG_GET
DG_CONTROL / DAT_STATUS / MSG_GET
DG_CONTROL / DAT_USERINTERFACE / MSG_DISABLEDS
DG_CONTROL / DAT_USERINTERFACE / MSG_ENABLEDS
DG_CONTROL / DAT_XFERGROUP / MSG_GET
DG_IMAGE / DAT_IMAGEINFO / MSG_GET
DG_IMAGE / DAT_IMAGELAYOUT / MSG_GET
DG_IMAGE / DAT_IMAGELAYOUT / MSG_GETDEFAULT
DG_IMAGE / DAT_IMAGELAYOUT / MSG_RESET
DG_IMAGE / DAT_IMAGELAYOUT / MSG_SET
DG_IMAGE / DAT_IMAGEMEMXFER / MSG_GET
DG_IMAGE / DAT_IMAGENATIVEXFER / MSG_GET
Capabilities
------------
Every Source must support all five DG_CONTROL / DAT_CAPABILITY operations on:
CAP_XFERCOUNT
Every Source must support DG_CONTROL / DAT_CAPABILITY MSG_GET on:
CAP_SUPPORTEDCAPS
CAP_UICONTROLLABLE
Sources that supply image information must support DG_CONTROL / DAT_CAPABILITY /
MSG_GET, MSG_GETCURRENT, MSG_GETDEFAULT on:
ICAP_COMPRESSION
ICAP_PLANARCHUNKY
ICAP_PHYSICALHEIGHT
ICAP_PHYSICALWIDTH
ICAP_PIXELFLAVOR
Sources that supply image information must support DG_CONTROL / DAT_CAPABILITY /
MSG_GET, MSG_GETCURRENT, MSG_GETDEFAULT, MSG_RESET and MSG_SET on:
ICAP_BITDEPTH
ICAP_BITORDER
ICAP_PIXELTYPE
ICAP_UNITS
ICAP_XFERMECH
ICAP_XRESOLUTION
ICAP_YRESOLUTION
All Sources must implement the advertised features supported by their devices. They must
make these features available to applications via the TWAIN protocol. For example, a Source
thats connected to a device that has an ADF must support DG_CONTROL /
DAT_CAPABILITY / MSG_GET, MSG_GETCURRENT, MSG_GETDEFAULT on:
CAP_FEEDERENABLED
CAP_FEEDERLOADED
and DG_CONTROL / DAT_CAPABILITY / MSG_GET, MSG_GETCURRENT,
MSG_GETDEFAULT, MSG_RESET and MSG_SET on:
CAP_AUTOFEED
If the ADF also supports ejecting and rewinding of pages then the Source should also support
DG_CONTROL / DAT_CAPABILITY / MSG_GET, MSG_GETCURRENT,
MSG_GETDEFAULT, MSG_RESET and MSG_SET on:
CAP_CLEARPAGE
CAP_REWINDPAGE
*******************************************************************************
From Application to Source Manager (Control Information)
Data Group Data Argument Type Message
DG_CONTROL DAT_IDENTITY MSG_CLOSEDS
MSG_GETDEFAULT
MSG_GETFIRST
MSG_GETNEXT
MSG_OPENDS
MSG_USERSELECT
DG_CONTROL DAT_PARENT MSG_CLOSEDSM
MSG_OPENDSM
DG_CONTROL DAT_STATUS MSG_GET
From Application to Source (Control Information)
Data Group Data Argument Type Message
DG_CONTROL DAT_CAPABILITY MSG_GET
MSG_GETCURRENT
MSG_GETDEFAULT
MSG_QUERYSUPPORT
MSG_RESET
MSG_SET
DG_CONTROL DAT_CUSTOMDSDATA MSG_GET
MSG_SET
DG_CONTROL DAT_FILESYSTEM MSG_AUTOMATICCAPTURE
DIRECTORY
MSG_CHANGEDIRECTORY
MSG_COPY
MSG_CREATEDIRECTORY
MSG_DELETE
MSG_FORMATMEDIA
MSG_GETCLOSE
MSG_GETFIRSTFILE
MSG_GETINFO
MSG_GETNEXTFILE
MSG_RENAME
DG_CONTROL DAT_EVENT MSG_PROCESSEVENT
DG_CONTROL DAT_PASSTHRU MSG_PASSTHRU
DG_CONTROL DAT_PENDINGXFERS MSG_ENDXFER
MSG_GET
MSG_RESET
MSG_STOPFEEDER
DG_CONTROL DAT_SETUPFILEXFER MSG_GET
MSG_GETDEFAULT
MSG_RESET
MSG_SET
DG_CONTROL DAT_SETUPFILEXFER2 MSG_GET
MSG_GETDEFAULT
MSG_RESET
MSG_SET
DG_CONTROL DAT_SETUPMEMXFER MSG_GET
DG_CONTROL DAT_STATUS MSG_GET
DG_CONTROL DAT_USERINTERFACE MSG_DISABLEDS
MSG_ENABLEDS
MSG_ENABLEDSUIONLY
DG_CONTROL DAT_XFERGROUP MSG_GET
MSG_SET
From Application to Source (Image Information)
Data Group Data Argument Type Message
DG_IMAGE DAT_CIECOLOR MSG_GET
DG_IMAGE DAT_EXTIMAGEINFO MSG_GET
DG_IMAGE DAT_GRAYRESPONSE MSG_RESET
MSG_SET
DG_IMAGE DAT_IMAGEFILEXFER MSG_GET
DG_IMAGE DAT_IMAGEINFO MSG_GET
DG_IMAGE DAT_IMAGELAYOUT MSG_GET
MSG_GETDEFAULT
MSG_RESET
MSG_SET
DG_IMAGE DAT_IMAGEMEMXFER MSG_GET
DG_IMAGE DAT_IMAGENATIVEXFER MSG_GET
DG_IMAGE DAT_JPEGCOMPRESSION MSG_GET
MSG_GETDEFAULT
MSG_RESET
MSG_SET
DG_IMAGE DAT_PALETTE8 MSG_GET
MSG_GETDEFAULT
MSG_RESET
MSG_SET
DG_IMAGE DAT_RGBRESPONSE MSG_RESET
MSG_SET
From Application to Source (Audio Information)
Data Group Data Argument Type Message
DG_AUDIO DAT_AUDIOFILEXFER MSG_GET
DG_AUDIO DAT_AUDIOINFO MSG_GET
DG_AUDIO DAT_AUDIONATIVEXFER MSG_GET
From Source Manager to Source (Control Information)
Data Group Data Argument Type Message
DG_CONTROL DAT_IDENTITY MSG_CLOSEDS
MSG_GET
MSG_OPENDS
From Source to Application (Control Information via the Source Manager)
(Used by Windows Sources only)
Data Group Data Argument Type Message
DG_CONTROL DAT_NULL MSG_CLOSEDSOK
MSG_CLOSEDSREQ
MSG_DEVICEEVENT
MSG_XFERREADY
/*
* Copyright 2000 Corel Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "winbase.h"
#include "twain.h"
#include "twain_i.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(twain);
TW_UINT16 TWAIN_SaneCapability (activeDS *pSource, pTW_CAPABILITY pCapability,
TW_UINT16 action)
{
TW_UINT16 twCC = TWCC_SUCCESS;
TRACE("capability=%d action=%d\n", pCapability->Cap, action);
switch (pCapability->Cap)
{
case CAP_DEVICEEVENT:
case CAP_ALARMS:
case CAP_ALARMVOLUME:
case ACAP_AUDIOFILEFORMAT:
case ACAP_XFERMECH:
case ICAP_AUTOMATICBORDERDETECTION:
case ICAP_AUTOMATICDESKEW:
case ICAP_AUTODISCARDBLANKPAGES:
case ICAP_AUTOMATICROTATE:
case ICAP_FLIPROTATION:
case CAP_AUTOMATICCAPTURE:
case CAP_TIMEBEFOREFIRSTCAPTURE:
case CAP_TIMEBETWEENCAPTURES:
case CAP_AUTOSCAN:
case CAP_CLEARBUFFERS:
case CAP_MAXBATCHBUFFERS:
case ICAP_BARCODEDETECTIONENABLED:
case ICAP_SUPPORTEDBARCODETYPES:
case ICAP_BARCODEMAXSEARCHPRIORITIES:
case ICAP_BARCODESEARCHPRIORITIES:
case ICAP_BARCODESEARCHMODE:
case ICAP_BARCODEMAXRETRIES:
case ICAP_BARCODETIMEOUT:
case CAP_EXTENDEDCAPS:
case CAP_SUPPORTEDCAPS:
case ICAP_FILTER:
case ICAP_GAMMA:
case ICAP_PLANARCHUNKY:
case ICAP_BITORDERCODES:
case ICAP_CCITTKFACTOR:
case ICAP_COMPRESSION:
case ICAP_JPEGPIXELTYPE:
/*case ICAP_JPEGQUALITY:*/
case ICAP_PIXELFLAVORCODES:
case ICAP_TIMEFILL:
case CAP_DEVICEONLINE:
case CAP_DEVICETIMEDATE:
case CAP_SERIALNUMBER:
case ICAP_EXPOSURETIME:
case ICAP_FLASHUSED2:
case ICAP_IMAGEFILTER:
case ICAP_LAMPSTATE:
case ICAP_LIGHTPATH:
case ICAP_NOISEFILTER:
case ICAP_OVERSCAN:
case ICAP_PHYSICALHEIGHT:
case ICAP_PHYSICALWIDTH:
case ICAP_UNITS:
case ICAP_ZOOMFACTOR:
case CAP_PRINTER:
case CAP_PRINTERENABLED:
case CAP_PRINTERINDEX:
case CAP_PRINTERMODE:
case CAP_PRINTERSTRING:
case CAP_PRINTERSUFFIX:
case CAP_AUTHOR:
case CAP_CAPTION:
case CAP_TIMEDATE:
case ICAP_AUTOBRIGHT:
case ICAP_BRIGHTNESS:
case ICAP_CONTRAST:
case ICAP_HIGHLIGHT:
case ICAP_ORIENTATION:
case ICAP_ROTATION:
case ICAP_SHADOW:
case ICAP_XSCALING:
case ICAP_YSCALING:
case ICAP_BITDEPTH:
case ICAP_BITDEPTHREDUCTION:
case ICAP_BITORDER:
case ICAP_CUSTHALFTONE:
case ICAP_HALFTONES:
case ICAP_PIXELFLAVOR:
case ICAP_PIXELTYPE:
case ICAP_THRESHOLD:
case CAP_LANGUAGE:
case ICAP_FRAMES:
case ICAP_MAXFRAMES:
case ICAP_SUPPORTEDSIZES:
case CAP_AUTOFEED:
case CAP_CLEARPAGE:
case CAP_FEEDERALIGNMENT:
case CAP_FEEDERENABLED:
case CAP_FEEDERLOADED:
case CAP_FEEDERORDER:
case CAP_FEEDPAGE:
case CAP_PAPERBINDING:
case CAP_PAPERDETECTABLE:
case CAP_REACQUIREALLOWED:
case CAP_REWINDPAGE:
case ICAP_PATCHCODEDETECTIONENABLED:
case ICAP_SUPPORTEDPATCHCODETYPES:
case ICAP_PATCHCODEMAXSEARCHPRIORITIES:
case ICAP_PATCHCODESEARCHPRIORITIES:
case ICAP_PATCHCODESEARCHMODE:
case ICAP_PATCHCODEMAXRETRIES:
case ICAP_PATCHCODETIMEOUT:
case CAP_BATTERYMINUTES:
case CAP_BATTERYPERCENTAGE:
case CAP_POWERDOWNTIME:
case CAP_POWERSUPPLY:
case ICAP_XNATIVERESOLUTION:
case ICAP_XRESOLUTION:
case ICAP_YNATIVERESOLUTION:
case ICAP_YRESOLUTION:
twCC = TWCC_CAPUNSUPPORTED;
break;
case CAP_XFERCOUNT:
/* This is a required capability that every source need to
support but we havev't implemented yet. */
twCC = TWCC_SUCCESS;
break;
/*case ICAP_COMPRESSION:*/
case ICAP_IMAGEFILEFORMAT:
case ICAP_TILES:
twCC = TWCC_CAPUNSUPPORTED;
break;
case ICAP_XFERMECH:
twCC = TWAIN_ICAPXferMech (pSource, pCapability, action);
break;
case ICAP_UNDEFINEDIMAGESIZE:
case CAP_CAMERAPREVIEWUI:
case CAP_ENABLEDSUIONLY:
case CAP_INDICATORS:
case CAP_UICONTROLLABLE:
twCC = TWCC_CAPUNSUPPORTED;
break;
default:
twCC = TWRC_FAILURE;
}
return twCC;
}
TW_BOOL TWAIN_OneValueSet (pTW_CAPABILITY pCapability, TW_UINT32 value)
{
pCapability->hContainer = (TW_HANDLE)GlobalAlloc (0, sizeof(TW_ONEVALUE));
if (pCapability->hContainer)
{
pTW_ONEVALUE pVal = GlobalLock ((HGLOBAL) pCapability->hContainer);
pVal->ItemType = TWTY_UINT32;
pVal->Item = value;
GlobalUnlock ((HGLOBAL) pCapability->hContainer);
return TRUE;
}
else
return FALSE;
}
TW_BOOL TWAIN_OneValueGet (pTW_CAPABILITY pCapability, TW_UINT32 *pValue)
{
pTW_ONEVALUE pVal = GlobalLock ((HGLOBAL) pCapability->hContainer);
if (pVal)
{
*pValue = pVal->Item;
GlobalUnlock ((HGLOBAL) pCapability->hContainer);
return TRUE;
}
else
return FALSE;
}
/* ICAP_XFERMECH */
TW_UINT16 TWAIN_ICAPXferMech (activeDS *pSource, pTW_CAPABILITY pCapability,
TW_UINT16 action)
{
TRACE("ICAP_XFERMECH\n");
switch (action)
{
case MSG_GET:
if (pCapability->ConType == TWON_ONEVALUE)
{
if (!TWAIN_OneValueSet (pCapability, pSource->capXferMech))
return TWCC_LOWMEMORY;
}
break;
case MSG_SET:
if (pCapability->ConType == TWON_ONEVALUE)
{
TW_UINT32 xfermechtemp;
if (!TWAIN_OneValueGet (pCapability, &xfermechtemp))
return TWCC_LOWMEMORY;
pSource->capXferMech = xfermechtemp;
}
else if (pCapability->ConType == TWON_ENUMERATION)
{
}
break;
case MSG_GETCURRENT:
if (!TWAIN_OneValueSet (pCapability, pSource->capXferMech))
return TWCC_LOWMEMORY;
break;
case MSG_GETDEFAULT:
if (!TWAIN_OneValueSet (pCapability, TWSX_NATIVE))
return TWCC_LOWMEMORY;
break;
case MSG_RESET:
pSource->capXferMech = TWSX_NATIVE;
break;
}
return TWCC_SUCCESS;
}
/*
* Copyright 2000 Corel Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "twain.h"
#include "twain_i.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(twain);
/* DG_AUDIO/DAT_AUDIOFILEXFER/MSG_GET */
TW_UINT16 TWAIN_AudioFileXferGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest,
TW_MEMREF pData)
{
FIXME ("stub!\n");
return TWRC_FAILURE;
}
/* DG_AUDIO/DAT_AUDIOINFO/MSG_GET */
TW_UINT16 TWAIN_AudioInfoGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest,
TW_MEMREF pData)
{
FIXME ("stub!\n");
return TWRC_FAILURE;
}
/* DG_AUDIO/DAT_AUDIONATIVEXFER/MSG_GET */
TW_UINT16 TWAIN_AudioNativeXferGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest,
TW_MEMREF pData)
{
FIXME ("stub!\n");
return TWRC_FAILURE;
}
name twain_32
type win32
init TWAIN_LibMain
import user32.dll
import gdi32.dll
import kernel32.dll
import ntdll.dll
debug_channels (twain)
@ stdcall DSM_Entry(ptr ptr long long long ptr) DSM_Entry
...@@ -334,6 +334,9 @@ ...@@ -334,6 +334,9 @@
/* Define if you have the `rfork' function. */ /* Define if you have the `rfork' function. */
#undef HAVE_RFORK #undef HAVE_RFORK
/* Define if we have SANE development environment */
#undef HAVE_SANE
/* Define if you have the <sched.h> header file. */ /* Define if you have the <sched.h> header file. */
#undef HAVE_SCHED_H #undef HAVE_SCHED_H
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment