1 /*
2    SANE EPSON backend
3    Copyright (C) 2001 SEIKO EPSON Corporation
4 
5    Date         Author      Reason
6    06/01/2001   N.Sasaki    New
7 
8    This file is part of the `iscan' program.
9 
10    This program is free software; you can redistribute it and/or modify
11    it under the terms of the GNU General Public License as published by
12    the Free Software Foundation; either version 2 of the License, or
13    (at your option) any later version.
14 
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License for more details.
19 
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 
24    As a special exception, the copyright holders give permission
25    to link the code of this program with the esmod library and
26    distribute linked combinations including the two.  You must obey
27    the GNU General Public License in all respects for all of the
28    code used other then esmod.
29 */
30 
31 #ifndef ___PISA_GIMP_H
32 #define ___PISA_GIMP_H
33 
34 #include <config.h>
35 #include <gtk/gtk.h>
36 
37 #ifdef HAVE_ANY_GIMP
38 #include <libgimp/gimp.h>
39 #include "gimp-plugin.h"
40 
41 #ifndef HAVE_GIMP_2
42 #ifdef HAVE_LIBGIMP_GIMPFEATURES_H
43 #include <libgimp/gimpfeatures.h>
44 #else
45 #define GIMP_CHECK_VERSION(major, minor, micro) 0
46 #endif /* HAVE_LIBGIMP_GIMPFEATURES_H */
47 
48 #ifdef GIMP_CHECK_VERSION
49 #if GIMP_CHECK_VERSION(1,1,25)
50 	/* ok, we have the new gimp interface */
51 #else
52 	/* we have the old gimp interface and need the compatibility header file */
53 #include "pisa_gimp_1_0_patch.h"
54 #endif
55 #else
56 	/* we have the old gimp interface and need the compatibility header file */
57 #include "pisa_gimp_1_0_patch.h"
58 #endif /*GIMP_CHECK_VERSION*/
59 #endif	/* HAVE_GIMP_2 */
60 #endif /* HAVE_ANY_GIMP */
61 
62 gint pisa_gimp_main ( gint argc, gchar * argv [ ] );
63 void pisa_gimp_quit ( void );
64 
65 #ifdef HAVE_ANY_GIMP
66 
67 gchar * pisa_gimp_gtkrc ( void );
68 gboolean pisa_gimp_use_xshm ( void );
69 
70 class gimp_scan
71 {
72  public:
73 
74   // operation
75   int	create_gimp_image ( int width,
76 							int height,
77 							int pixeltype,
78 							int depth );
79 
80   unsigned char *		get_next_buf ( void );
81   int	set_image_rect ( void );
82   int	finish_scan ( int cancel );
83 
84  private:
85 
86   // operation
87   int bw2gray ( void );
88 
89   // attribute
90   int			m_rows;
91 
92   int			m_width;
93   int			m_height;
94   int			m_pixeltype;
95   int			m_depth;
96   int			m_rowbytes;
97 
98   int			m_image_id;
99   int			m_layer_id;
100   guchar		* m_tile;
101   GimpDrawable	* m_drawable;
102   GimpPixelRgn	m_region;
103 
104 };
105 
106 #endif // HAVE_ANY_GIMP
107 
108 
109 #endif // ___PISA_GIMP_H
110