2006-05-08 20:09:37 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2000 Corel Corporation
|
|
|
|
* Copyright 2006 Marcus Meissner
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2006-05-08 20:09:37 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _TWAIN32_H
|
|
|
|
#define _TWAIN32_H
|
|
|
|
|
|
|
|
#ifndef __WINE_CONFIG_H
|
|
|
|
# error You must include config.h first
|
|
|
|
#endif
|
|
|
|
|
2007-07-02 19:53:14 +02:00
|
|
|
#if defined(HAVE_GPHOTO2) && !defined(SONAME_LIBJPEG)
|
2006-05-14 11:38:52 +02:00
|
|
|
# warning "gphoto2 support in twain needs jpeg development headers"
|
2006-05-08 20:09:37 +02:00
|
|
|
# undef HAVE_GPHOTO2
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_GPHOTO2
|
2006-05-14 11:38:52 +02:00
|
|
|
/* Hack for gphoto2, which changes behaviour when WIN32 is set. */
|
2006-05-08 20:09:37 +02:00
|
|
|
#undef WIN32
|
|
|
|
#include <gphoto2/gphoto2-camera.h>
|
|
|
|
#define WIN32
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2007-07-02 19:53:14 +02:00
|
|
|
#ifdef SONAME_LIBJPEG
|
2006-05-08 20:09:37 +02:00
|
|
|
/* This is a hack, so jpeglib.h does not redefine INT32 and the like*/
|
|
|
|
# define XMD_H
|
|
|
|
# define UINT8 JPEG_UINT8
|
|
|
|
# define UINT16 JPEG_UINT16
|
|
|
|
# undef FAR
|
2009-06-15 18:10:46 +02:00
|
|
|
# undef HAVE_STDLIB_H
|
2006-05-08 20:09:37 +02:00
|
|
|
# include <jpeglib.h>
|
2009-06-15 18:10:46 +02:00
|
|
|
# undef HAVE_STDLIB_H
|
|
|
|
# define HAVE_STDLIB_H 1
|
2011-09-05 17:22:33 +02:00
|
|
|
# undef UINT8
|
2006-05-08 20:09:37 +02:00
|
|
|
# undef UINT16
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "twain.h"
|
|
|
|
|
|
|
|
#include "wine/list.h"
|
|
|
|
|
2011-04-26 10:51:31 +02:00
|
|
|
extern HINSTANCE GPHOTO2_instance DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
|
|
|
|
struct gphoto2_file {
|
|
|
|
struct list entry;
|
|
|
|
|
|
|
|
char *folder;
|
|
|
|
char *filename;
|
|
|
|
BOOL download; /* flag for downloading, set by GUI or so */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* internal information about an active data source */
|
|
|
|
struct tagActiveDS
|
|
|
|
{
|
2017-11-21 22:48:27 +01:00
|
|
|
TW_IDENTITY identity; /* identity of the data source */
|
|
|
|
TW_IDENTITY appIdentity; /* identity of the app */
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 currentState; /* current state */
|
|
|
|
TW_UINT16 twCC; /* condition code */
|
|
|
|
HWND progressWnd; /* window handle of the scanning window */
|
|
|
|
|
|
|
|
#ifdef HAVE_GPHOTO2
|
|
|
|
Camera *camera;
|
|
|
|
GPContext *context;
|
|
|
|
#endif
|
|
|
|
|
2008-04-03 19:10:30 +02:00
|
|
|
/* Capabilities */
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT32 capXferMech; /* ICAP_XFERMECH */
|
|
|
|
TW_UINT16 pixeltype; /* ICAP_PIXELTYPE */
|
|
|
|
TW_UINT16 pixelflavor; /* ICAP_PIXELFLAVOR */
|
|
|
|
|
|
|
|
struct list files;
|
|
|
|
|
|
|
|
/* Download and decode JPEG STATE */
|
|
|
|
#ifdef HAVE_GPHOTO2
|
|
|
|
CameraFile *file;
|
|
|
|
#endif
|
2007-07-02 19:53:14 +02:00
|
|
|
#ifdef SONAME_LIBJPEG
|
2006-05-08 20:09:37 +02:00
|
|
|
struct jpeg_source_mgr xjsm;
|
|
|
|
struct jpeg_decompress_struct jd;
|
|
|
|
struct jpeg_error_mgr jerr;
|
|
|
|
#endif
|
2020-01-24 00:05:21 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct tagActiveDS activeDS DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
|
|
|
|
/* Helper functions */
|
2011-04-26 10:51:31 +02:00
|
|
|
extern TW_UINT16 GPHOTO2_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
|
|
|
|
/* Implementation of operation triplets
|
|
|
|
* From Application to Source (Image Information) */
|
|
|
|
TW_UINT16 GPHOTO2_CIEColorGet
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_ExtImageInfoGet
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_GrayResponseReset
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_GrayResponseSet
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_ImageFileXferGet
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_ImageInfoGet
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_ImageLayoutGet
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_ImageLayoutGetDefault
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_ImageLayoutReset
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_ImageLayoutSet
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_ImageMemXferGet
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_ImageNativeXferGet
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_JPEGCompressionGet
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_JPEGCompressionGetDefault
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_JPEGCompressionReset
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_JPEGCompressionSet
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_Palette8Get
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_Palette8GetDefault
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_Palette8Reset
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_Palette8Set
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_RGBResponseReset
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
TW_UINT16 GPHOTO2_RGBResponseSet
|
2011-04-26 10:51:31 +02:00
|
|
|
(pTW_IDENTITY pOrigin, TW_MEMREF pData) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
|
|
|
|
/* UI function */
|
2011-04-26 10:51:31 +02:00
|
|
|
BOOL DoCameraUI(void) DECLSPEC_HIDDEN;
|
|
|
|
HWND TransferringDialogBox(HWND dialog, LONG progress) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
|
|
|
|
#ifdef HAVE_GPHOTO2
|
|
|
|
/* Helper function for GUI */
|
|
|
|
TW_UINT16
|
|
|
|
_get_gphoto2_file_as_DIB(
|
|
|
|
const char *folder, const char *filename, CameraFileType type,
|
|
|
|
HWND hwnd, HBITMAP *hDIB
|
2011-04-26 10:51:31 +02:00
|
|
|
) DECLSPEC_HIDDEN;
|
2006-05-08 20:09:37 +02:00
|
|
|
#endif
|
|
|
|
#endif
|