gphoto2.ds: Mark internal symbols as hidden.
[wine] / dlls / gphoto2.ds / gphoto2_i.h
1 /*
2  * Copyright 2000 Corel Corporation
3  * Copyright 2006 Marcus Meissner
4  *
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.
9  *
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.
14  *
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
18  */
19
20 #ifndef _TWAIN32_H
21 #define _TWAIN32_H
22
23 #ifndef __WINE_CONFIG_H
24 # error You must include config.h first
25 #endif
26
27 #if defined(HAVE_GPHOTO2) && !defined(SONAME_LIBJPEG)
28 # warning "gphoto2 support in twain needs jpeg development headers"
29 # undef HAVE_GPHOTO2
30 #endif
31
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
38
39 #include <stdio.h>
40
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
53
54 #include <stdarg.h>
55
56 #include "windef.h"
57 #include "winbase.h"
58 #include "twain.h"
59
60 #include "wine/list.h"
61
62 extern HINSTANCE GPHOTO2_instance DECLSPEC_HIDDEN;
63
64 struct gphoto2_file  {
65     struct list entry;
66
67     char        *folder;
68     char        *filename;
69     BOOL        download;       /* flag for downloading, set by GUI or so */
70 };
71
72 /* internal information about an active data source */
73 struct tagActiveDS
74 {
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 */
82
83 #ifdef HAVE_GPHOTO2
84     Camera              *camera;
85     GPContext           *context;
86 #endif
87
88     /* Capabilities */
89     TW_UINT32           capXferMech;            /* ICAP_XFERMECH */
90     TW_UINT16           pixeltype;              /* ICAP_PIXELTYPE */
91     TW_UINT16           pixelflavor;            /* ICAP_PIXELFLAVOR */
92
93     struct list         files;
94
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;
105
106 /* Helper functions */
107 extern TW_UINT16 GPHOTO2_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action) DECLSPEC_HIDDEN;
108
109 /* Implementation of operation triplets
110  * From Application to Source (Image Information) */
111 TW_UINT16 GPHOTO2_CIEColorGet
112     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
113 TW_UINT16 GPHOTO2_ExtImageInfoGet
114     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
115 TW_UINT16 GPHOTO2_GrayResponseReset
116     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
117 TW_UINT16 GPHOTO2_GrayResponseSet
118     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
119 TW_UINT16 GPHOTO2_ImageFileXferGet
120     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
121 TW_UINT16 GPHOTO2_ImageInfoGet
122     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
123 TW_UINT16 GPHOTO2_ImageLayoutGet
124     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
125 TW_UINT16 GPHOTO2_ImageLayoutGetDefault
126     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
127 TW_UINT16 GPHOTO2_ImageLayoutReset
128     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
129 TW_UINT16 GPHOTO2_ImageLayoutSet
130     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
131 TW_UINT16 GPHOTO2_ImageMemXferGet
132     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
133 TW_UINT16 GPHOTO2_ImageNativeXferGet
134     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
135 TW_UINT16 GPHOTO2_JPEGCompressionGet
136     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
137 TW_UINT16 GPHOTO2_JPEGCompressionGetDefault
138     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
139 TW_UINT16 GPHOTO2_JPEGCompressionReset
140     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
141 TW_UINT16 GPHOTO2_JPEGCompressionSet
142     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
143 TW_UINT16 GPHOTO2_Palette8Get
144     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
145 TW_UINT16 GPHOTO2_Palette8GetDefault
146     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
147 TW_UINT16 GPHOTO2_Palette8Reset
148     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
149 TW_UINT16 GPHOTO2_Palette8Set
150     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
151 TW_UINT16 GPHOTO2_RGBResponseReset
152     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
153 TW_UINT16 GPHOTO2_RGBResponseSet
154     (pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
155
156 /* UI function */
157 BOOL DoCameraUI(void) DECLSPEC_HIDDEN;
158 HWND TransferringDialogBox(HWND dialog, LONG progress) DECLSPEC_HIDDEN;
159
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
166 ) DECLSPEC_HIDDEN;
167 #endif
168 #endif