Release 1.1.37.
[wine/gsoc-2012-control.git] / dlls / gphoto2.ds / gphoto2_i.h
blob517f794e18130862100ffcd80125cf999a50b9a7
1 /*
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
20 #ifndef _TWAIN32_H
21 #define _TWAIN32_H
23 #ifndef __WINE_CONFIG_H
24 # error You must include config.h first
25 #endif
27 #if defined(HAVE_GPHOTO2) && !defined(SONAME_LIBJPEG)
28 # warning "gphoto2 support in twain needs jpeg development headers"
29 # undef HAVE_GPHOTO2
30 #endif
32 #ifdef HAVE_GPHOTO2
33 /* Hack for gphoto2, which changes behaviour when WIN32 is set. */
34 #undef WIN32
35 #include <gphoto2/gphoto2-camera.h>
36 #define WIN32
37 #endif
39 #include <stdio.h>
41 #ifdef SONAME_LIBJPEG
42 /* This is a hack, so jpeglib.h does not redefine INT32 and the like*/
43 # define XMD_H
44 # define UINT8 JPEG_UINT8
45 # define UINT16 JPEG_UINT16
46 # undef FAR
47 # undef HAVE_STDLIB_H
48 # include <jpeglib.h>
49 # undef HAVE_STDLIB_H
50 # define HAVE_STDLIB_H 1
51 # undef UINT16
52 #endif
54 #include <stdarg.h>
56 #include "windef.h"
57 #include "winbase.h"
58 #include "twain.h"
60 #include "wine/list.h"
62 extern HINSTANCE GPHOTO2_instance;
64 struct gphoto2_file {
65 struct list entry;
67 char *folder;
68 char *filename;
69 BOOL download; /* flag for downloading, set by GUI or so */
72 /* internal information about an active data source */
73 struct tagActiveDS
75 TW_IDENTITY identity; /* identity */
76 TW_UINT16 currentState; /* current state */
77 TW_EVENT pendingEvent; /* pending event to be sent to
78 application */
79 TW_UINT16 twCC; /* condition code */
80 HWND hwndOwner; /* window handle of the app */
81 HWND progressWnd; /* window handle of the scanning window */
83 #ifdef HAVE_GPHOTO2
84 Camera *camera;
85 GPContext *context;
86 #endif
88 /* Capabilities */
89 TW_UINT32 capXferMech; /* ICAP_XFERMECH */
90 TW_UINT16 pixeltype; /* ICAP_PIXELTYPE */
91 TW_UINT16 pixelflavor; /* ICAP_PIXELFLAVOR */
93 struct list files;
95 /* Download and decode JPEG STATE */
96 #ifdef HAVE_GPHOTO2
97 CameraFile *file;
98 #endif
99 #ifdef SONAME_LIBJPEG
100 struct jpeg_source_mgr xjsm;
101 struct jpeg_decompress_struct jd;
102 struct jpeg_error_mgr jerr;
103 #endif
104 } activeDS;
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);
156 /* UI function */
157 BOOL DoCameraUI(void);
158 HWND TransferringDialogBox(HWND dialog, LONG progress);
160 #ifdef HAVE_GPHOTO2
161 /* Helper function for GUI */
162 TW_UINT16
163 _get_gphoto2_file_as_DIB(
164 const char *folder, const char *filename, CameraFileType type,
165 HWND hwnd, HBITMAP *hDIB
167 #endif
168 #endif