stash
[wine/wine64.git] / dlls / gphoto2.ds / gphoto2_i.h
blob2af61f4e5d8e84fe5c07a205deff061860fdedb6
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 # include <jpeglib.h>
48 # undef UINT16
49 #endif
51 #include <stdarg.h>
53 #include "windef.h"
54 #include "winbase.h"
55 #include "twain.h"
57 #include "wine/list.h"
59 extern HINSTANCE GPHOTO2_instance;
61 struct gphoto2_file {
62 struct list entry;
64 char *folder;
65 char *filename;
66 BOOL download; /* flag for downloading, set by GUI or so */
69 /* internal information about an active data source */
70 struct tagActiveDS
72 TW_IDENTITY identity; /* identity */
73 TW_UINT16 currentState; /* current state */
74 TW_EVENT pendingEvent; /* pending event to be sent to
75 application */
76 TW_UINT16 twCC; /* condition code */
77 HWND hwndOwner; /* window handle of the app */
78 HWND progressWnd; /* window handle of the scanning window */
80 #ifdef HAVE_GPHOTO2
81 Camera *camera;
82 GPContext *context;
83 #endif
85 /* Capabilities */
86 TW_UINT32 capXferMech; /* ICAP_XFERMECH */
87 TW_UINT16 pixeltype; /* ICAP_PIXELTYPE */
88 TW_UINT16 pixelflavor; /* ICAP_PIXELFLAVOR */
90 struct list files;
92 /* Download and decode JPEG STATE */
93 #ifdef HAVE_GPHOTO2
94 CameraFile *file;
95 #endif
96 #ifdef SONAME_LIBJPEG
97 struct jpeg_source_mgr xjsm;
98 struct jpeg_decompress_struct jd;
99 struct jpeg_error_mgr jerr;
100 #endif
101 } activeDS;
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);
153 /* UI function */
154 BOOL DoCameraUI(void);
155 HWND TransferringDialogBox(HWND dialog, LONG progress);
157 #ifdef HAVE_GPHOTO2
158 /* Helper function for GUI */
159 TW_UINT16
160 _get_gphoto2_file_as_DIB(
161 const char *folder, const char *filename, CameraFileType type,
162 HWND hwnd, HBITMAP *hDIB
164 #endif
165 #endif