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
57 #include "wine/list.h"
59 extern HINSTANCE GPHOTO2_instance;
66 BOOL download; /* flag for downloading, set by GUI or so */
69 /* internal information about an active data source */
72 TW_IDENTITY identity; /* identity */
73 TW_UINT16 currentState; /* current state */
74 TW_EVENT pendingEvent; /* pending event to be sent to
76 TW_UINT16 twCC; /* condition code */
77 HWND hwndOwner; /* window handle of the app */
78 HWND progressWnd; /* window handle of the scanning window */
86 TW_UINT32 capXferMech; /* ICAP_XFERMECH */
87 TW_UINT16 pixeltype; /* ICAP_PIXELTYPE */
88 TW_UINT16 pixelflavor; /* ICAP_PIXELFLAVOR */
92 /* Download and decode JPEG STATE */
97 struct jpeg_source_mgr xjsm;
98 struct jpeg_decompress_struct jd;
99 struct jpeg_error_mgr jerr;
103 /* Helper functions */
104 extern TW_UINT16 GPHOTO2_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action);
106 /* Implementation of operation triplets
107 * From Application to Source (Image Information) */
108 TW_UINT16 GPHOTO2_CIEColorGet
109 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
110 TW_UINT16 GPHOTO2_ExtImageInfoGet
111 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
112 TW_UINT16 GPHOTO2_GrayResponseReset
113 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
114 TW_UINT16 GPHOTO2_GrayResponseSet
115 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
116 TW_UINT16 GPHOTO2_ImageFileXferGet
117 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
118 TW_UINT16 GPHOTO2_ImageInfoGet
119 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
120 TW_UINT16 GPHOTO2_ImageLayoutGet
121 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
122 TW_UINT16 GPHOTO2_ImageLayoutGetDefault
123 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
124 TW_UINT16 GPHOTO2_ImageLayoutReset
125 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
126 TW_UINT16 GPHOTO2_ImageLayoutSet
127 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
128 TW_UINT16 GPHOTO2_ImageMemXferGet
129 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
130 TW_UINT16 GPHOTO2_ImageNativeXferGet
131 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
132 TW_UINT16 GPHOTO2_JPEGCompressionGet
133 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
134 TW_UINT16 GPHOTO2_JPEGCompressionGetDefault
135 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
136 TW_UINT16 GPHOTO2_JPEGCompressionReset
137 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
138 TW_UINT16 GPHOTO2_JPEGCompressionSet
139 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
140 TW_UINT16 GPHOTO2_Palette8Get
141 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
142 TW_UINT16 GPHOTO2_Palette8GetDefault
143 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
144 TW_UINT16 GPHOTO2_Palette8Reset
145 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
146 TW_UINT16 GPHOTO2_Palette8Set
147 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
148 TW_UINT16 GPHOTO2_RGBResponseReset
149 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
150 TW_UINT16 GPHOTO2_RGBResponseSet
151 (pTW_IDENTITY pOrigin, TW_MEMREF pData);
154 BOOL DoCameraUI(void);
155 HWND TransferringDialogBox(HWND dialog, LONG progress);
158 /* Helper function for GUI */
160 _get_gphoto2_file_as_DIB(
161 const char *folder, const char *filename, CameraFileType type,
162 HWND hwnd, HBITMAP *hDIB