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