ntdll: Fill the handle attributes in System(Extended)HandleInformation.
[wine.git] / dlls / sane.ds / sane_i.h
blob9351bdc2229b43a3177a21ec35c034ac992bb87b
1 /*
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef _TWAIN32_H
20 #define _TWAIN32_H
22 #ifndef __WINE_CONFIG_H
23 # error You must include config.h first
24 #endif
26 #include <stdarg.h>
28 #ifdef SONAME_LIBSANE
29 # include <sane/sane.h>
30 # include <sane/saneopts.h>
31 #endif
33 #include "windef.h"
34 #include "winbase.h"
35 #include "winuser.h"
36 #include "twain.h"
38 #ifdef SONAME_LIBSANE
39 #define MAKE_FUNCPTR(f) extern typeof(f) * p##f DECLSPEC_HIDDEN;
40 MAKE_FUNCPTR(sane_init)
41 MAKE_FUNCPTR(sane_exit)
42 MAKE_FUNCPTR(sane_get_devices)
43 MAKE_FUNCPTR(sane_open)
44 MAKE_FUNCPTR(sane_close)
45 MAKE_FUNCPTR(sane_get_option_descriptor)
46 MAKE_FUNCPTR(sane_control_option)
47 MAKE_FUNCPTR(sane_get_parameters)
48 MAKE_FUNCPTR(sane_start)
49 MAKE_FUNCPTR(sane_read)
50 MAKE_FUNCPTR(sane_cancel)
51 MAKE_FUNCPTR(sane_set_io_mode)
52 MAKE_FUNCPTR(sane_get_select_fd)
53 MAKE_FUNCPTR(sane_strstatus)
54 #undef MAKE_FUNCPTR
55 #endif
57 extern HINSTANCE SANE_instance DECLSPEC_HIDDEN;
59 #define TWCC_CHECKSTATUS (TWCC_CUSTOMBASE + 1)
61 /* internal information about an active data source */
62 struct tagActiveDS
64 struct tagActiveDS *next; /* next active DS */
65 TW_IDENTITY identity; /* identity of the DS */
66 TW_UINT16 currentState; /* current state */
67 TW_UINT16 twCC; /* condition code */
68 TW_IDENTITY appIdentity; /* identity of the app */
69 HWND hwndOwner; /* window handle of the app */
70 HWND progressWnd; /* window handle of the scanning window */
71 #ifdef SONAME_LIBSANE
72 SANE_Handle deviceHandle; /* device handle */
73 SANE_Parameters sane_param; /* parameters about the image
74 transferred */
75 BOOL sane_param_valid; /* true if valid sane_param*/
76 BOOL sane_started; /* If sane_start has been called */
77 INT deviceIndex; /* index of the current device */
78 #endif
79 /* Capabilities */
80 TW_UINT16 capXferMech; /* ICAP_XFERMECH */
81 BOOL PixelTypeSet;
82 TW_UINT16 defaultPixelType; /* ICAP_PIXELTYPE */
83 BOOL XResolutionSet;
84 TW_FIX32 defaultXResolution;
85 BOOL YResolutionSet;
86 TW_FIX32 defaultYResolution;
89 extern struct tagActiveDS activeDS DECLSPEC_HIDDEN;
91 /* Helper functions */
92 extern TW_UINT16 SANE_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action) DECLSPEC_HIDDEN;
93 extern TW_UINT16 SANE_SaneSetDefaults (void) DECLSPEC_HIDDEN;
94 extern void SANE_Notify (TW_UINT16 message) DECLSPEC_HIDDEN;
96 /* Implementation of operation triplets
97 * From Application to Source (Control Information) */
98 TW_UINT16 SANE_CapabilityGet (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
99 TW_UINT16 SANE_CapabilityGetCurrent
100 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
101 TW_UINT16 SANE_CapabilityGetDefault
102 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
103 TW_UINT16 SANE_CapabilityQuerySupport
104 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
105 TW_UINT16 SANE_CapabilityReset
106 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
107 TW_UINT16 SANE_CapabilitySet
108 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
109 TW_UINT16 SANE_CustomDSDataGet
110 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
111 TW_UINT16 SANE_CustomDSDataSet
112 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
113 TW_UINT16 SANE_AutomaticCaptureDirectory
114 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
115 TW_UINT16 SANE_ChangeDirectory
116 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
117 TW_UINT16 SANE_FileSystemCopy
118 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
119 TW_UINT16 SANE_CreateDirectory
120 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
121 TW_UINT16 SANE_FileSystemDelete
122 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
123 TW_UINT16 SANE_FormatMedia
124 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
125 TW_UINT16 SANE_FileSystemGetClose
126 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
127 TW_UINT16 SANE_FileSystemGetFirstFile
128 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
129 TW_UINT16 SANE_FileSystemGetInfo
130 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
131 TW_UINT16 SANE_FileSystemGetNextFile
132 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
133 TW_UINT16 SANE_FileSystemRename
134 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
135 TW_UINT16 SANE_ProcessEvent
136 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
137 TW_UINT16 SANE_PassThrough
138 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
139 TW_UINT16 SANE_PendingXfersEndXfer
140 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
141 TW_UINT16 SANE_PendingXfersGet
142 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
143 TW_UINT16 SANE_PendingXfersReset
144 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
145 TW_UINT16 SANE_PendingXfersStopFeeder
146 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
147 TW_UINT16 SANE_SetupFileXferGet
148 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
149 TW_UINT16 SANE_SetupFileXferGetDefault
150 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
151 TW_UINT16 SANE_SetupFileXferReset
152 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
153 TW_UINT16 SANE_SetupFileXferSet
154 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
155 TW_UINT16 SANE_SetupFileXfer2Get
156 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
157 TW_UINT16 SANE_SetupFileXfer2GetDefault
158 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
159 TW_UINT16 SANE_SetupFileXfer2Reset
160 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
161 TW_UINT16 SANE_SetupFileXfer2Set
162 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
163 TW_UINT16 SANE_SetupMemXferGet
164 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
165 TW_UINT16 SANE_GetDSStatus
166 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
167 TW_UINT16 SANE_DisableDSUserInterface
168 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
169 TW_UINT16 SANE_EnableDSUserInterface
170 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
171 TW_UINT16 SANE_EnableDSUIOnly
172 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
173 TW_UINT16 SANE_XferGroupGet
174 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
175 TW_UINT16 SANE_XferGroupSet
176 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
178 /* Implementation of operation triplets
179 * From Application to Source (Image Information) */
180 TW_UINT16 SANE_CIEColorGet
181 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
182 TW_UINT16 SANE_ExtImageInfoGet
183 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
184 TW_UINT16 SANE_GrayResponseReset
185 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
186 TW_UINT16 SANE_GrayResponseSet
187 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
188 TW_UINT16 SANE_ImageFileXferGet
189 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
190 TW_UINT16 SANE_ImageInfoGet
191 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
192 TW_UINT16 SANE_ImageLayoutGet
193 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
194 TW_UINT16 SANE_ImageLayoutGetDefault
195 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
196 TW_UINT16 SANE_ImageLayoutReset
197 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
198 TW_UINT16 SANE_ImageLayoutSet
199 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
200 TW_UINT16 SANE_ImageMemXferGet
201 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
202 TW_UINT16 SANE_ImageNativeXferGet
203 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
204 TW_UINT16 SANE_JPEGCompressionGet
205 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
206 TW_UINT16 SANE_JPEGCompressionGetDefault
207 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
208 TW_UINT16 SANE_JPEGCompressionReset
209 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
210 TW_UINT16 SANE_JPEGCompressionSet
211 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
212 TW_UINT16 SANE_Palette8Get
213 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
214 TW_UINT16 SANE_Palette8GetDefault
215 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
216 TW_UINT16 SANE_Palette8Reset
217 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
218 TW_UINT16 SANE_Palette8Set
219 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
220 TW_UINT16 SANE_RGBResponseReset
221 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
222 TW_UINT16 SANE_RGBResponseSet
223 (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
225 /* UI function */
226 BOOL DoScannerUI(void) DECLSPEC_HIDDEN;
227 HWND ScanningDialogBox(HWND dialog, LONG progress) DECLSPEC_HIDDEN;
229 /* Option functions */
230 #ifdef SONAME_LIBSANE
231 SANE_Status sane_option_get_int(SANE_Handle h, const char *option_name, SANE_Int *val) DECLSPEC_HIDDEN;
232 SANE_Status sane_option_set_int(SANE_Handle h, const char *option_name, SANE_Int val, SANE_Int *status) DECLSPEC_HIDDEN;
233 SANE_Status sane_option_get_str(SANE_Handle h, const char *option_name, SANE_String val, size_t len, SANE_Int *status) DECLSPEC_HIDDEN;
234 SANE_Status sane_option_set_str(SANE_Handle h, const char *option_name, SANE_String val, SANE_Int *status) DECLSPEC_HIDDEN;
235 SANE_Status sane_option_probe_resolution(SANE_Handle h, const char *option_name, SANE_Int *minval, SANE_Int *maxval, SANE_Int *quant) DECLSPEC_HIDDEN;
236 SANE_Status sane_option_probe_mode(SANE_Handle h, SANE_String_Const **choices, char *current, int current_size) DECLSPEC_HIDDEN;
237 SANE_Status sane_option_probe_scan_area(SANE_Handle h, const char *option_name, SANE_Fixed *val,
238 SANE_Unit *unit, SANE_Fixed *min, SANE_Fixed *max, SANE_Fixed *quant) DECLSPEC_HIDDEN;
239 SANE_Status sane_option_get_bool(SANE_Handle h, const char *option_name, SANE_Bool *val, SANE_Int *status) DECLSPEC_HIDDEN;
240 SANE_Status sane_option_set_bool(SANE_Handle h, const char *option_name, SANE_Bool val, SANE_Int *status) DECLSPEC_HIDDEN;
241 SANE_Status sane_option_set_fixed(SANE_Handle h, const char *option_name, SANE_Fixed val, SANE_Int *status) DECLSPEC_HIDDEN;
242 TW_UINT16 sane_status_to_twcc(SANE_Status rc) DECLSPEC_HIDDEN;
243 BOOL convert_sane_res_to_twain(double sane_res, SANE_Unit unit, TW_FIX32 *twain_res, TW_UINT16 twtype) DECLSPEC_HIDDEN;
244 #endif
247 #endif