2 * Copyright 2000 Corel Corporation
3 * Copyright 2006 Marcus Meissner
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #ifndef __WINE_CONFIG_H
24 # error You must include config.h first
27 #if defined(HAVE_GPHOTO2) && !defined(SONAME_LIBJPEG)
28 # warning "gphoto2 support in twain needs jpeg development headers"
33 /* Hack for gphoto2, which changes behaviour when WIN32 is set. */
35 #include <gphoto2/gphoto2-camera.h>
42 /* This is a hack, so jpeglib.h does not redefine INT32 and the like*/
44 # define UINT8 JPEG_UINT8
45 # define UINT16 JPEG_UINT16
50 # define HAVE_STDLIB_H 1
61 #include "wine/list.h"
63 extern HINSTANCE GPHOTO2_instance DECLSPEC_HIDDEN
;
70 BOOL download
; /* flag for downloading, set by GUI or so */
73 /* internal information about an active data source */
76 TW_IDENTITY identity
; /* identity of the data source */
77 TW_IDENTITY appIdentity
; /* identity of the app */
78 TW_UINT16 currentState
; /* current state */
79 TW_UINT16 twCC
; /* condition code */
80 HWND progressWnd
; /* window handle of the scanning window */
88 TW_UINT32 capXferMech
; /* ICAP_XFERMECH */
89 TW_UINT16 pixeltype
; /* ICAP_PIXELTYPE */
90 TW_UINT16 pixelflavor
; /* ICAP_PIXELFLAVOR */
94 /* Download and decode JPEG STATE */
99 struct jpeg_source_mgr xjsm
;
100 struct jpeg_decompress_struct jd
;
101 struct jpeg_error_mgr jerr
;
105 extern struct tagActiveDS activeDS DECLSPEC_HIDDEN
;
107 /* Helper functions */
108 extern TW_UINT16
GPHOTO2_SaneCapability (pTW_CAPABILITY pCapability
, TW_UINT16 action
) DECLSPEC_HIDDEN
;
110 /* Implementation of operation triplets
111 * From Application to Source (Image Information) */
112 TW_UINT16 GPHOTO2_CIEColorGet
113 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
114 TW_UINT16 GPHOTO2_ExtImageInfoGet
115 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
116 TW_UINT16 GPHOTO2_GrayResponseReset
117 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
118 TW_UINT16 GPHOTO2_GrayResponseSet
119 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
120 TW_UINT16 GPHOTO2_ImageFileXferGet
121 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
122 TW_UINT16 GPHOTO2_ImageInfoGet
123 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
124 TW_UINT16 GPHOTO2_ImageLayoutGet
125 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
126 TW_UINT16 GPHOTO2_ImageLayoutGetDefault
127 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
128 TW_UINT16 GPHOTO2_ImageLayoutReset
129 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
130 TW_UINT16 GPHOTO2_ImageLayoutSet
131 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
132 TW_UINT16 GPHOTO2_ImageMemXferGet
133 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
134 TW_UINT16 GPHOTO2_ImageNativeXferGet
135 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
136 TW_UINT16 GPHOTO2_JPEGCompressionGet
137 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
138 TW_UINT16 GPHOTO2_JPEGCompressionGetDefault
139 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
140 TW_UINT16 GPHOTO2_JPEGCompressionReset
141 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
142 TW_UINT16 GPHOTO2_JPEGCompressionSet
143 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
144 TW_UINT16 GPHOTO2_Palette8Get
145 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
146 TW_UINT16 GPHOTO2_Palette8GetDefault
147 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
148 TW_UINT16 GPHOTO2_Palette8Reset
149 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
150 TW_UINT16 GPHOTO2_Palette8Set
151 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
152 TW_UINT16 GPHOTO2_RGBResponseReset
153 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
154 TW_UINT16 GPHOTO2_RGBResponseSet
155 (pTW_IDENTITY pOrigin
, TW_MEMREF pData
) DECLSPEC_HIDDEN
;
158 BOOL
DoCameraUI(void) DECLSPEC_HIDDEN
;
159 HWND
TransferringDialogBox(HWND dialog
, LONG progress
) DECLSPEC_HIDDEN
;
162 /* Helper function for GUI */
164 _get_gphoto2_file_as_DIB(
165 const char *folder
, const char *filename
, CameraFileType type
,
166 HWND hwnd
, HBITMAP
*hDIB