]> git.pld-linux.org Git - packages/xsane.git/blob - xsane-gimp1.3.patch
- better version based on patch from Debian
[packages/xsane.git] / xsane-gimp1.3.patch
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
4 @@ -18,9 +18,9 @@
5  SANE_V_MAJOR=1
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])
14  AC_SUBST(PACKAGE)
15  AC_SUBST(VERSION)
16  AC_SUBST(PACKAGE_VERSION)
17 @@ -33,7 +33,13 @@
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])
25 +    USE_GIMP="no"
26 +else
27 +    AC_MSG_RESULT([$USE_GIMP, GIMP 2.0])
28 +fi
29  
30  dnl Check for jpeg support
31  AC_MSG_CHECKING([whether JPEG support is requested])
32 @@ -100,7 +106,7 @@
33  fi
34  
35  dnl Checks for library functions.
36 -AM_FUNC_ALLOCA
37 +AC_FUNC_ALLOCA
38  AC_FUNC_MMAP
39  AC_CHECK_FUNCS(atexit mkdir sigprocmask strdup strndup strftime strstr strsep strtod snprintf usleep strcasecmp strncasecmp lstat)
40  
41 @@ -125,11 +131,28 @@
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 ***])
47 +    USE_GIMP = no
48 +    USE_GIMP12 = yes
49 +  else
50 +    AC_MSG_WARN([*** GTK+ 2.0 not found, falling back to GTK+ < 2.0 if possible ***])
51 +  fi
52    AM_PATH_GTK(1.2.0, HAVE_GTK=yes, )
53 +else
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.])
58 +    fi
59 +  fi
60  fi
61  
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])
67 +    fi
68  fi
69   
70  
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
74 @@ -67,8 +67,13 @@
75  #include <libgimp/gimp.h>
76   
77  static void xsane_gimp_query(void);
78 +
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);
81 +#else
82  static void xsane_gimp_run(char *name, int nparams, GimpParam * param, int *nreturn_vals, GimpParam ** return_vals);
83
84 +#endif /* !ENABLE_GIMP_1_2 */
85 +
86  GimpPlugInInfo PLUG_IN_INFO =
87  {
88    NULL,                         /* init_proc */
89 @@ -3845,10 +3850,18 @@
90  
91  /* ---------------------------------------------------------------------------------------------------------------------- */
92  
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)
95 +#else
96  static void xsane_gimp_run(char *name, int nparams, GimpParam * param, int *nreturn_vals, GimpParam ** return_vals)
97 +#endif /* !ENABLE_GIMP_1_2 */
98  {
99   static GimpParam values[2];
100 +#ifndef ENABLE_GIMP_1_2
101 + GimpRunMode run_mode;
102 +#else
103   GimpRunModeType run_mode;
104 +#endif /* !ENABLE_GIMP_1_2 */
105   char devname[1024];
106   char *args[2];
107   int nargs;
108 @@ -3881,6 +3894,9 @@
109    switch (run_mode)
110    {
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;
117        break;
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());
124  
125 +# ifdef ENABLE_GIMP_1_2
126    gdk_set_use_xshm(gimp_use_xshm());
127 +# endif /* !ENABLE_GIMP_1_2 */
128  #endif
129  
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);
133  #endif
134      /* gimp_main() returns 1 if xsane wasn't invoked by GIMP */
135 +
136 +#ifndef ENABLE_GIMP_1_2
137 +    result = gimp_main(&PLUG_IN_INFO, argc, argv);
138 +#else
139      result = gimp_main(argc, argv);
140 +#endif /* !ENABLE_GIMP_1_2 */
141  
142  #if 0
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
147 @@ -290,7 +290,7 @@
148  
149  # ifdef HAVE_LIBGIMP_GIMPFEATURES_H
150  #  include <libgimp/gimpfeatures.h>
151 -# else
152 +# elif defined (ENABLE_GIMP_1_2)
153  #  define GIMP_CHECK_VERSION(major, minor, micro) 0
154  # endif /* HAVE_LIBGIMP_GIMPFEATURES_H */
155  
156 @@ -302,12 +302,18 @@
157  #   include "xsane-gimp-1_0-compat.h" 
158  #  endif
159  # else
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 */
165  # endif
166  
167    extern GimpPlugInInfo PLUG_IN_INFO; /* needed for win32 */
168  
169 +#ifndef ENABLE_GIMP_1_2
170 +# define GIMP_HAVE_RESOLUTION_INFO
171 +#endif /* !ENABLE_GIMP_1_2 */
172 +
173  #endif /* HAVE_LIBGIMP_GIMP_H */
174  
175  /* ---------------------------------------------------------------------------------------------------------------------- */
This page took 0.067996 seconds and 3 git commands to generate.