TWAIN for Mac OS X provides support for the TWAIN standard under Mac OS X, version 10.1.3 or later. Due to several of the issues discussed below, TWAIN for Mac OS X does not provide backwards compatibility with previous versions of TWAIN for Macintosh.
The TWAIN Working Group has worked closely with Apple on this release to provide the best experience for TWAIN users on Mac OS X. Apple plans to ship the DSM as part of the system software beginning with Jaguar.
The TWAIN DSM is no longer packaged as a Code Fragment Manager (CFM) shared library, but as a system framework (TWAIN.framework) linked against Carbon.framework. TWAIN.framework should be located in /System/Library/Frameworks.
TWAIN.h is public header of TWAIN.framework. The Data Argument Type, DAT_CALLBACK,
was added to the DG_CONTROL Data Group. The Messages, MSG_REGISTER_CALLBACK
and MSG_INVOKE_CALLBACK, were added for use with DAT_CALLBACK.
These additions are currently Mac OS X specific, but may be used on other
platforms in future versions.
68k alignment pragma's have been removed from the TWAIN.h header file. PowerPC alignment should be used for both Sources and applications.
Applications which have already integrated TWAIN for Mac OS X should function without modification due to the CFM glue shared library (TWAIN Source Manager.shlb). CFM applications should not use the CFBundle APIs to load TWAIN.framework. When designing future revisions packaged using the Mach-0 executable format, application manufacturers should plan to implement the preferred callback mechanism and load TWAIN.framework directly (bypass the glue).
While current applications will continue to function, Data Source manufacturers must make the following modifications.
To be recognized by the DSM, Data Sources must use the extension ".ds" and be packaged as either a CFM or Mach-O loadable bundle.
Data Sources using WaitNextEvent() must implement Carbon event handlers.
The existing polling mechanism is deprecated (A Data Source will no longer
receive MSG_PROCESSEVENT messages) and Sources without support
for Carbon Event processing will fail to work as expected.
Direct communication from the DS to the application is accomplished
through a callback mechanism for the messages, MSG_XFERREADY
and MSG_CLOSEDSREQ. Since the MSG_PROCESSEVENT
loop no longer carries these messages, the application needs to implement
and register a callback using the TW_CALLBACK structure.
typedef struct TW_CALLBACK
{
TW_MEMREF CallBackProc;
TW_UINT32 RefCon;
TW_INT16 Message;
} TW_CALLBACK, FAR * pTW_CALLBACK;
The current TWAIN Specification strongly recommends that Data Sources
allow themselves to be enabled without showing their user interface. All Data
Sources must honor ShowUI set to FALSE and report
such via the CAP_UICONTROLLABLE capability.
The DSM will no longer automatically open and close the resource fork of the current Data Source, nor will it track the current resource fork. A Data Source storing information in its resource fork must use Resource Manager calls to open, close, and set the current resource file.
Data Sources now reside in /Library/Image Capture/TWAIN Data Sources/.
Description forthcoming. Optional.
For CFM Sources, link against CarbonLib instead of InterfaceLib and do not globally share data sections.
None.
Final Release - 24 August 2002
Public Preview 4 - 31 May 2002
Please direct comments to twain-mac@twain.org
Last modified: 06 August 2002