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
30 extern HINSTANCE SANE_instance DECLSPEC_HIDDEN
;
32 #define TWCC_CHECKSTATUS (TWCC_CUSTOMBASE + 1)
34 /* internal information about an active data source */
37 TW_IDENTITY identity
; /* identity of the DS */
38 TW_UINT16 currentState
; /* current state */
39 TW_UINT16 twCC
; /* condition code */
40 TW_IDENTITY appIdentity
; /* identity of the app */
41 HWND hwndOwner
; /* window handle of the app */
42 HWND progressWnd
; /* window handle of the scanning window */
44 struct frame_parameters frame_params
; /* parameters about the image transferred */
47 TW_UINT16 capXferMech
; /* ICAP_XFERMECH */
49 TW_UINT16 defaultPixelType
; /* ICAP_PIXELTYPE */
51 TW_FIX32 defaultXResolution
;
53 TW_FIX32 defaultYResolution
;
56 extern struct tagActiveDS activeDS DECLSPEC_HIDDEN
;
58 /* Helper functions */
59 extern TW_UINT16
SANE_SaneCapability (pTW_CAPABILITY pCapability
, TW_UINT16 action
) DECLSPEC_HIDDEN
;
60 extern TW_UINT16
SANE_SaneSetDefaults (void) DECLSPEC_HIDDEN
;
61 extern void SANE_Notify (TW_UINT16 message
) DECLSPEC_HIDDEN
;
63 /* Implementation of operation triplets
64 * From Application to Source (Control Information) */
65 TW_UINT16
SANE_CapabilityGet (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
66 TW_UINT16 SANE_CapabilityGetCurrent
67 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
68 TW_UINT16 SANE_CapabilityGetDefault
69 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
70 TW_UINT16 SANE_CapabilityQuerySupport
71 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
72 TW_UINT16 SANE_CapabilityReset
73 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
74 TW_UINT16 SANE_CapabilitySet
75 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
76 TW_UINT16 SANE_CustomDSDataGet
77 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
78 TW_UINT16 SANE_CustomDSDataSet
79 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
80 TW_UINT16 SANE_AutomaticCaptureDirectory
81 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
82 TW_UINT16 SANE_ChangeDirectory
83 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
84 TW_UINT16 SANE_FileSystemCopy
85 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
86 TW_UINT16 SANE_CreateDirectory
87 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
88 TW_UINT16 SANE_FileSystemDelete
89 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
90 TW_UINT16 SANE_FormatMedia
91 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
92 TW_UINT16 SANE_FileSystemGetClose
93 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
94 TW_UINT16 SANE_FileSystemGetFirstFile
95 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
96 TW_UINT16 SANE_FileSystemGetInfo
97 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
98 TW_UINT16 SANE_FileSystemGetNextFile
99 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
100 TW_UINT16 SANE_FileSystemRename
101 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
102 TW_UINT16 SANE_ProcessEvent
103 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
104 TW_UINT16 SANE_PassThrough
105 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
106 TW_UINT16 SANE_PendingXfersEndXfer
107 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
108 TW_UINT16 SANE_PendingXfersGet
109 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
110 TW_UINT16 SANE_PendingXfersReset
111 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
112 TW_UINT16 SANE_PendingXfersStopFeeder
113 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
114 TW_UINT16 SANE_SetupFileXferGet
115 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
116 TW_UINT16 SANE_SetupFileXferGetDefault
117 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
118 TW_UINT16 SANE_SetupFileXferReset
119 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
120 TW_UINT16 SANE_SetupFileXferSet
121 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
122 TW_UINT16 SANE_SetupFileXfer2Get
123 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
124 TW_UINT16 SANE_SetupFileXfer2GetDefault
125 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
126 TW_UINT16 SANE_SetupFileXfer2Reset
127 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
128 TW_UINT16 SANE_SetupFileXfer2Set
129 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
130 TW_UINT16 SANE_SetupMemXferGet
131 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
132 TW_UINT16 SANE_GetDSStatus
133 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
134 TW_UINT16 SANE_DisableDSUserInterface
135 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
136 TW_UINT16 SANE_EnableDSUserInterface
137 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
138 TW_UINT16 SANE_EnableDSUIOnly
139 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
140 TW_UINT16 SANE_XferGroupGet
141 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
142 TW_UINT16 SANE_XferGroupSet
143 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
145 /* Implementation of operation triplets
146 * From Application to Source (Image Information) */
147 TW_UINT16 SANE_CIEColorGet
148 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
149 TW_UINT16 SANE_ExtImageInfoGet
150 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
151 TW_UINT16 SANE_GrayResponseReset
152 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
153 TW_UINT16 SANE_GrayResponseSet
154 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
155 TW_UINT16 SANE_ImageFileXferGet
156 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
157 TW_UINT16 SANE_ImageInfoGet
158 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
159 TW_UINT16 SANE_ImageLayoutGet
160 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
161 TW_UINT16 SANE_ImageLayoutGetDefault
162 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
163 TW_UINT16 SANE_ImageLayoutReset
164 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
165 TW_UINT16 SANE_ImageLayoutSet
166 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
167 TW_UINT16 SANE_ImageMemXferGet
168 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
169 TW_UINT16 SANE_ImageNativeXferGet
170 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
171 TW_UINT16 SANE_JPEGCompressionGet
172 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
173 TW_UINT16 SANE_JPEGCompressionGetDefault
174 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
175 TW_UINT16 SANE_JPEGCompressionReset
176 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
177 TW_UINT16 SANE_JPEGCompressionSet
178 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
179 TW_UINT16 SANE_Palette8Get
180 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
181 TW_UINT16 SANE_Palette8GetDefault
182 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
183 TW_UINT16 SANE_Palette8Reset
184 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
185 TW_UINT16 SANE_Palette8Set
186 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
187 TW_UINT16 SANE_RGBResponseReset
188 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
189 TW_UINT16 SANE_RGBResponseSet
190 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
193 BOOL
DoScannerUI(void) DECLSPEC_HIDDEN
;
194 HWND
ScanningDialogBox(HWND dialog
, LONG progress
) DECLSPEC_HIDDEN
;
196 /* Option functions */
197 TW_UINT16
sane_option_get_value( int optno
, void *val
) DECLSPEC_HIDDEN
;
198 TW_UINT16
sane_option_set_value( int optno
, void *val
, BOOL
*reload
) DECLSPEC_HIDDEN
;
199 TW_UINT16
sane_option_get_int( const char *option_name
, int *val
) DECLSPEC_HIDDEN
;
200 TW_UINT16
sane_option_set_int( const char *option_name
, int val
, BOOL
*reload
) DECLSPEC_HIDDEN
;
201 TW_UINT16
sane_option_get_str( const char *option_name
, char *val
, int len
) DECLSPEC_HIDDEN
;
202 TW_UINT16
sane_option_set_str( const char *option_name
, char *val
, BOOL
*reload
) DECLSPEC_HIDDEN
;
203 TW_UINT16
sane_option_probe_resolution( const char *option_name
, int *minval
, int *maxval
, int *quant
) DECLSPEC_HIDDEN
;
204 TW_UINT16
sane_option_probe_mode(TW_UINT16
*current
, TW_UINT32
*choices
, int *count
) DECLSPEC_HIDDEN
;
205 TW_UINT16
sane_option_get_bool( const char *option_name
, BOOL
*val
) DECLSPEC_HIDDEN
;
206 TW_UINT16
sane_option_set_bool( const char *option_name
, BOOL val
) DECLSPEC_HIDDEN
;
207 TW_UINT16
sane_option_get_scan_area( int *tlx
, int *tly
, int *brx
, int *bry
) DECLSPEC_HIDDEN
;
208 TW_UINT16
sane_option_get_max_scan_area( int *tlx
, int *tly
, int *brx
, int *bry
) DECLSPEC_HIDDEN
;
209 TW_UINT16
sane_option_set_scan_area( int tlx
, int tly
, int brx
, int bry
, BOOL
*reload
) DECLSPEC_HIDDEN
;
210 TW_FIX32
convert_sane_res_to_twain( int res
) DECLSPEC_HIDDEN
;
211 TW_UINT16
get_sane_params( struct frame_parameters
*params
) DECLSPEC_HIDDEN
;