1 diff -ru xsane-0.92.orig/configure.in xsane-0.92/configure.in
2 --- xsane-0.92.orig/configure.in 2003-05-13 14:29:10.000000000 +0200
3 +++ xsane-0.92/configure.in 2004-04-11 16:27:20.000000000 +0200
6 VERSION=${V_MAJOR}.${V_MINOR}
7 PACKAGE_VERSION="$PACKAGE-$VERSION"
8 -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
9 -AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
10 -AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION")
11 +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of the distribution])
12 +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define to the version of the distribution])
13 +AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION", [Define to the name and version of the distribution])
16 AC_SUBST(PACKAGE_VERSION)
18 AC_MSG_CHECKING([whether GIMP plugin is requested])
19 dnl Default is enabled GIMP plugin
20 AC_ARG_ENABLE(gimp, [ --disable-gimp do not include GIMP plugin mode], USE_GIMP=$enableval, USE_GIMP=yes)
21 -AC_MSG_RESULT($USE_GIMP)
22 +AC_ARG_ENABLE(gimp12, [ --enable-gimp12 include GIMP 1.2 plugin mode (defaults to GIMP 2.0)], USE_GIMP12=$enableval, USE_GIMP12="no")
23 +if test "${USE_GIMP12}" = "yes"; then
24 + AC_MSG_RESULT([yes, GIMP 1.2])
27 + AC_MSG_RESULT([$USE_GIMP, GIMP 2.0])
30 dnl Check for jpeg support
31 AC_MSG_CHECKING([whether JPEG support is requested])
35 dnl Checks for library functions.
39 AC_CHECK_FUNCS(atexit mkdir sigprocmask strdup strndup strftime strstr strsep strtod snprintf usleep strcasecmp strncasecmp lstat)
42 dnl *** gimp support we need the test for gtk
43 AM_PATH_GTK2(2.0.0, HAVE_GTK=yes, )
44 if test "x${HAVE_GTK}" = "x"; then
45 + if test "${USE_GIMP}" = "yes"; then
46 + AC_MSG_WARN([*** GIMP 2.0 plugin requested, but GTK+ 2.0 not found, falling back to GIMP/GTK < 2.0 if possible ***])
50 + AC_MSG_WARN([*** GTK+ 2.0 not found, falling back to GTK+ < 2.0 if possible ***])
52 AM_PATH_GTK(1.2.0, HAVE_GTK=yes, )
54 + if test "${USE_GIMP}" = "yes"; then
55 + AM_PATH_GIMP_2_0(1.3.23, HAVE_GIMP=yes)
56 + if test "${HAVE_GIMP}" = "yes"; then
57 + AC_DEFINE([HAVE_LIBGIMP_GIMP_H], 1, [Define to 1 if you have the <libgimp/gimp.h> header file.])
62 -if test "${USE_GIMP}" = "yes"; then
63 +if test "${USE_GIMP12}" = "yes"; then
64 AM_PATH_GIMP(1.0.0, HAVE_GIMP=yes)
65 + if test "${HAVE_GIMP}" = "yes"; then
66 + AC_DEFINE([ENABLE_GIMP_1_2], 1, [Define to 1 if GIMP 1.2 support wanted])
71 diff -ru xsane-0.92.orig/src/xsane-save.c xsane-0.92/src/xsane-save.c
72 --- xsane-0.92.orig/src/xsane-save.c 2003-07-28 21:34:35.000000000 +0200
73 +++ xsane-0.92/src/xsane-save.c 2004-04-11 16:25:27.000000000 +0200
75 #include <libgimp/gimp.h>
77 static void xsane_gimp_query(void);
79 +#ifndef ENABLE_GIMP_1_2
80 +static void xsane_gimp_run(const gchar *name, gint nparams, const GimpParam * param, gint *nreturn_vals, GimpParam ** return_vals);
82 static void xsane_gimp_run(char *name, int nparams, GimpParam * param, int *nreturn_vals, GimpParam ** return_vals);
84 +#endif /* !ENABLE_GIMP_1_2 */
86 GimpPlugInInfo PLUG_IN_INFO =
89 @@ -3845,10 +3850,18 @@
91 /* ---------------------------------------------------------------------------------------------------------------------- */
93 +#ifndef ENABLE_GIMP_1_2
94 +static void xsane_gimp_run(const gchar *name, gint nparams, const GimpParam * param, gint *nreturn_vals, GimpParam ** return_vals)
96 static void xsane_gimp_run(char *name, int nparams, GimpParam * param, int *nreturn_vals, GimpParam ** return_vals)
97 +#endif /* !ENABLE_GIMP_1_2 */
99 static GimpParam values[2];
100 +#ifndef ENABLE_GIMP_1_2
101 + GimpRunMode run_mode;
103 GimpRunModeType run_mode;
104 +#endif /* !ENABLE_GIMP_1_2 */
108 @@ -3881,6 +3894,9 @@
111 case GIMP_RUN_INTERACTIVE:
112 +#ifndef ENABLE_GIMP_1_2
113 + gimp_extension_ack();
114 +#endif /* !ENABLE_GIMP_1_2 */
115 xsane_interface(nargs, args);
116 values[0].data.d_status = GIMP_PDB_SUCCESS;
118 diff -ru xsane-0.92.orig/src/xsane.c xsane-0.92/src/xsane.c
119 --- xsane-0.92.orig/src/xsane.c 2003-07-28 22:48:20.000000000 +0200
120 +++ xsane-0.92/src/xsane.c 2004-04-11 16:25:27.000000000 +0200
121 @@ -7595,7 +7595,9 @@
122 #ifdef HAVE_LIBGIMP_GIMP_H
123 gtk_rc_parse(gimp_gtkrc());
125 +# ifdef ENABLE_GIMP_1_2
126 gdk_set_use_xshm(gimp_use_xshm());
127 +# endif /* !ENABLE_GIMP_1_2 */
130 /* before we open any windows we have to read the style file */
131 @@ -8112,7 +8114,12 @@
132 set_gimp_PLUG_IN_INFO(&PLUG_IN_INFO);
134 /* gimp_main() returns 1 if xsane wasn't invoked by GIMP */
136 +#ifndef ENABLE_GIMP_1_2
137 + result = gimp_main(&PLUG_IN_INFO, argc, argv);
139 result = gimp_main(argc, argv);
140 +#endif /* !ENABLE_GIMP_1_2 */
143 /* this is the old version that seems to use the compatibility functions */
144 diff -ru xsane-0.92.orig/src/xsane.h xsane-0.92/src/xsane.h
145 --- xsane-0.92.orig/src/xsane.h 2003-05-19 18:59:13.000000000 +0200
146 +++ xsane-0.92/src/xsane.h 2004-04-11 16:25:27.000000000 +0200
149 # ifdef HAVE_LIBGIMP_GIMPFEATURES_H
150 # include <libgimp/gimpfeatures.h>
152 +# elif defined (ENABLE_GIMP_1_2)
153 # define GIMP_CHECK_VERSION(major, minor, micro) 0
154 # endif /* HAVE_LIBGIMP_GIMPFEATURES_H */
156 @@ -302,12 +302,18 @@
157 # include "xsane-gimp-1_0-compat.h"
160 +# ifdef ENABLE_GIMP_1_2
161 /* we have the old gimp interface and need the compatibility header file */
162 -# include "xsane-gimp-1_0-compat.h"
163 +# include "xsane-gimp-1_0-compat.h"
164 +# endif /* ENABLE_GIMP_1_2 */
167 extern GimpPlugInInfo PLUG_IN_INFO; /* needed for win32 */
169 +#ifndef ENABLE_GIMP_1_2
170 +# define GIMP_HAVE_RESOLUTION_INFO
171 +#endif /* !ENABLE_GIMP_1_2 */
173 #endif /* HAVE_LIBGIMP_GIMP_H */
175 /* ---------------------------------------------------------------------------------------------------------------------- */