2 * Copyright 2000 Corel Corporation
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __WINE_CONFIG_H
23 # error You must include config.h first
27 # include <sane/sane.h>
35 /* internal information about an active data source */
36 typedef struct tagActiveDS
38 struct tagActiveDS
*next
; /* next active DS */
39 TW_IDENTITY identity
; /* identity */
40 TW_UINT16 currentState
; /* current state */
41 TW_EVENT pendingEvent
; /* pending event to be sent to
43 TW_UINT16 twCC
; /* condition code */
44 HWND hwndOwner
; /* window handle of the app */
46 SANE_Handle deviceHandle
; /* device handle */
47 SANE_Parameters sane_param
; /* parameters about the image
51 TW_UINT16 capXferMech
; /* ICAP_XFERMECH */
54 TW_UINT16 DSM_initialized
; /* whether Source Manager is initialized */
55 TW_UINT16 DSM_currentState
; /* current state of Source Manager */
56 TW_UINT16 DSM_twCC
; /* current condition code of Source Manager */
57 TW_HANDLE DSM_parentHWND
; /* window handle of the Source's "parent" */
58 TW_UINT32 DSM_sourceId
; /* source id generator */
59 TW_UINT16 DSM_currentDevice
; /* keep track of device during enumeration */
61 const SANE_Device
**device_list
;/* a list of all sane devices */
63 activeDS
*activeSources
; /* list of active data sources */
65 /* Helper functions */
66 extern activeDS
*TWAIN_LookupSource (pTW_IDENTITY pDest
);
67 extern TW_UINT16
TWAIN_SaneCapability (activeDS
*pSource
,
68 pTW_CAPABILITY pCapability
, TW_UINT16 action
);
71 extern TW_UINT16
TWAIN_ControlGroupHandler (
72 pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
,
73 TW_UINT16 DAT
, TW_UINT16 MSG
, TW_MEMREF pData
);
74 extern TW_UINT16
TWAIN_ImageGroupHandler (
75 pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
,
76 TW_UINT16 DAT
, TW_UINT16 MSG
, TW_MEMREF pData
);
77 extern TW_UINT16
TWAIN_AudioGroupHandler (
78 pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
,
79 TW_UINT16 DAT
, TW_UINT16 MSG
, TW_MEMREF pData
);
80 extern TW_UINT16
TWAIN_SourceManagerHandler (
81 pTW_IDENTITY pOrigin
, TW_UINT16 DAT
, TW_UINT16 MSG
, TW_MEMREF pData
);
83 /* Implementation of operation triplets (From Application to Source Manager) */
84 extern TW_UINT16 TWAIN_CloseDS
85 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
);
86 extern TW_UINT16 TWAIN_IdentityGetDefault
87 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
);
88 extern TW_UINT16 TWAIN_IdentityGetFirst
89 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
);
90 extern TW_UINT16 TWAIN_IdentityGetNext
91 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
);
92 extern TW_UINT16 TWAIN_OpenDS
93 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
);
94 extern TW_UINT16 TWAIN_UserSelect
95 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
);
96 extern TW_UINT16 TWAIN_CloseDSM
97 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
);
98 extern TW_UINT16 TWAIN_OpenDSM
99 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
);
100 extern TW_UINT16 TWAIN_GetDSMStatus
101 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
);
103 /* Implementation of operation triplets
104 * From Application to Source (Control Information) */
105 TW_UINT16 TWAIN_CapabilityGet
106 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
107 TW_UINT16 TWAIN_CapabilityGetCurrent
108 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
,TW_MEMREF pData
);
109 TW_UINT16 TWAIN_CapabilityGetDefault
110 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
111 TW_UINT16 TWAIN_CapabilityQuerySupport
112 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
113 TW_UINT16 TWAIN_CapabilityReset
114 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
115 TW_UINT16 TWAIN_CapabilitySet
116 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
117 TW_UINT16 TWAIN_CustomDSDataGet
118 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
119 TW_UINT16 TWAIN_CustomDSDataSet
120 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
121 TW_UINT16 TWAIN_AutomaticCaptureDirectory
122 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
123 TW_UINT16 TWAIN_ChangeDirectory
124 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
125 TW_UINT16 TWAIN_FileSystemCopy
126 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
127 TW_UINT16 TWAIN_CreateDirectory
128 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
129 TW_UINT16 TWAIN_FileSystemDelete
130 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
131 TW_UINT16 TWAIN_FormatMedia
132 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
133 TW_UINT16 TWAIN_FileSystemGetClose
134 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
135 TW_UINT16 TWAIN_FileSystemGetFirstFile
136 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
137 TW_UINT16 TWAIN_FileSystemGetInfo
138 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
139 TW_UINT16 TWAIN_FileSystemGetNextFile
140 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
141 TW_UINT16 TWAIN_FileSystemRename
142 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
143 TW_UINT16 TWAIN_ProcessEvent
144 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
145 TW_UINT16 TWAIN_PassThrough
146 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
147 TW_UINT16 TWAIN_PendingXfersEndXfer
148 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
149 TW_UINT16 TWAIN_PendingXfersGet
150 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
151 TW_UINT16 TWAIN_PendingXfersReset
152 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
153 TW_UINT16 TWAIN_PendingXfersStopFeeder
154 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
155 TW_UINT16 TWAIN_SetupFileXferGet
156 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
157 TW_UINT16 TWAIN_SetupFileXferGetDefault
158 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
159 TW_UINT16 TWAIN_SetupFileXferReset
160 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
161 TW_UINT16 TWAIN_SetupFileXferSet
162 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
163 TW_UINT16 TWAIN_SetupFileXfer2Get
164 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
165 TW_UINT16 TWAIN_SetupFileXfer2GetDefault
166 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
167 TW_UINT16 TWAIN_SetupFileXfer2Reset
168 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
169 TW_UINT16 TWAIN_SetupFileXfer2Set
170 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
171 TW_UINT16 TWAIN_SetupMemXferGet
172 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
173 TW_UINT16 TWAIN_GetDSStatus
174 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
175 TW_UINT16 TWAIN_DisableDSUserInterface
176 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
177 TW_UINT16 TWAIN_EnableDSUserInterface
178 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
179 TW_UINT16 TWAIN_EnableDSUIOnly
180 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
181 TW_UINT16 TWAIN_XferGroupGet
182 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
183 TW_UINT16 TWAIN_XferGroupSet
184 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
186 /* Implementation of operation triplets
187 * From Application to Source (Image Information) */
188 TW_UINT16 TWAIN_CIEColorGet
189 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
190 TW_UINT16 TWAIN_ExtImageInfoGet
191 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
192 TW_UINT16 TWAIN_GrayResponseReset
193 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
194 TW_UINT16 TWAIN_GrayResponseSet
195 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
196 TW_UINT16 TWAIN_ImageFileXferGet
197 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
198 TW_UINT16 TWAIN_ImageInfoGet
199 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
200 TW_UINT16 TWAIN_ImageLayoutGet
201 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
202 TW_UINT16 TWAIN_ImageLayoutGetDefault
203 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
204 TW_UINT16 TWAIN_ImageLayoutReset
205 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
206 TW_UINT16 TWAIN_ImageLayoutSet
207 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
208 TW_UINT16 TWAIN_ImageMemXferGet
209 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
210 TW_UINT16 TWAIN_ImageNativeXferGet
211 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
212 TW_UINT16 TWAIN_JPEGCompressionGet
213 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
214 TW_UINT16 TWAIN_JPEGCompressionGetDefault
215 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
216 TW_UINT16 TWAIN_JPEGCompressionReset
217 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
218 TW_UINT16 TWAIN_JPEGCompressionSet
219 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
220 TW_UINT16 TWAIN_Palette8Get
221 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
222 TW_UINT16 TWAIN_Palette8GetDefault
223 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
224 TW_UINT16 TWAIN_Palette8Reset
225 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
226 TW_UINT16 TWAIN_Palette8Set
227 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
228 TW_UINT16 TWAIN_RGBResponseReset
229 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
230 TW_UINT16 TWAIN_RGBResponseSet
231 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
233 /* Implementation of operation triplets
234 * From Application to Source (Audio Information) */
235 TW_UINT16 TWAIN_AudioFileXferGet
236 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
237 TW_UINT16 TWAIN_AudioInfoGet
238 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
239 TW_UINT16 TWAIN_AudioNativeXferGet
240 (pTW_IDENTITY pOrigin
, pTW_IDENTITY pDest
, TW_MEMREF pData
);
242 /* Implementation of TWAIN capabilities */
243 TW_UINT16 TWAIN_ICAPXferMech
244 (activeDS
*pSource
, pTW_CAPABILITY pCapability
, TW_UINT16 action
);