Commit d8d2dcbf authored by Kevin Cozens's avatar Kevin Cozens Committed by Kevin Cozens
Browse files

Updated due to change in API CVS version of GIMP. Use replacements for

2006-06-27  Kevin Cozens  <kcozens@cvs.gnome.org>

	* tiny-fu/tiny-fu-interface.c: Updated due to change in API CVS
	version of GIMP. Use replacements for gimp_foo_select widgets,
	akin to GimpFontSelectButton. Based on changes made by Manish
	Singh to Script-Fu.

	* tiny-fu/ts-wrapper.c: Updated now that INT8 is an unsigned data
	type. Moved 'success' test when parsing arguments to 'for' loop.

	* configure.in: Updated to require version 2.3.10 of GIMP.

	* autogen.sh: Updated to require newer versions of build tools.
parent 1476f571
......@@ -14,10 +14,15 @@ PROJECT="GIMP Tiny-Fu"
TEST_TYPE=-f
FILE=tiny-fu/tiny-fu.c
ACLOCAL=${ACLOCAL-aclocal-1.9}
AUTOCONF=${AUTOCONF-autoconf}
AUTOHEADER=${AUTOHEADER-autoheader}
AUTOMAKE=${AUTOMAKE-automake-1.9}
AUTOCONF_REQUIRED_VERSION=2.54
AUTOMAKE_REQUIRED_VERSION=1.6
AUTOMAKE_REQUIRED_VERSION=1.8.3
GLIB_REQUIRED_VERSION=2.2.0
INTLTOOL_REQUIRED_VERSION=0.17
INTLTOOL_REQUIRED_VERSION=0.31
srcdir=`dirname $0`
......@@ -75,8 +80,8 @@ DIE=0
echo -n "checking for autoconf >= $AUTOCONF_REQUIRED_VERSION ... "
if (autoconf --version) < /dev/null > /dev/null 2>&1; then
VER=`autoconf --version \
if ($AUTOCONF --version) < /dev/null > /dev/null 2>&1; then
VER=`$AUTOCONF --version | head -n 1 \
| grep -iw autoconf | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
check_version $VER $AUTOCONF_REQUIRED_VERSION
else
......@@ -90,22 +95,18 @@ fi
echo -n "checking for automake >= $AUTOMAKE_REQUIRED_VERSION ... "
if (automake-1.7 --version) < /dev/null > /dev/null 2>&1; then
AUTOMAKE=automake-1.7
ACLOCAL=aclocal-1.7
elif (automake-1.8 --version) < /dev/null > /dev/null 2>&1; then
AUTOMAKE=automake-1.8
ACLOCAL=aclocal-1.8
AUTOMAKE_REQUIRED_VERSION=1.8.3
if ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1; then
AUTOMAKE=$AUTOMAKE
ACLOCAL=$ACLOCAL
elif (automake-1.9 --version) < /dev/null > /dev/null 2>&1; then
AUTOMAKE=automake-1.9
ACLOCAL=aclocal-1.9
elif (automake-1.6 --version) < /dev/null > /dev/null 2>&1; then
AUTOMAKE=automake-1.6
ACLOCAL=aclocal-1.6
elif (automake-1.8 --version) < /dev/null > /dev/null 2>&1; then
AUTOMAKE=automake-1.8
ACLOCAL=aclocal-1.8
else
echo
echo " You must have automake 1.6 or newer installed to compile $PROJECT."
echo " You must have automake $AUTOMAKE_REQUIRED_VERSION or newer installed to compile $PROJECT."
echo " Download the appropriate package for your distribution,"
echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
echo
......@@ -148,35 +149,6 @@ else
DIE=1
fi
# Special test for problematic versions of intltool. Details at:
# http://bugzilla.gnome.org/show_bug.cgi?id=137502
# Print a warning message, but do not exit.
INTLTOOL_BUG_MIN_VERSION=0.28
INTLTOOL_BUG_MAX_VERSION=0.31
echo -n "checking for intltool < $INTLTOOL_BUG_MIN_VERSION or > $INTLTOOL_BUG_MAX_VERSION ... "
if (intltoolize --version) < /dev/null > /dev/null 2>&1; then
VER=`intltoolize --version \
| grep intltoolize | sed "s/.* \([0-9.]*\)/\1/"`
if expr $VER \>= $INTLTOOL_BUG_MIN_VERSION > /dev/null; then
if expr $VER \<= $INTLTOOL_BUG_MAX_VERSION > /dev/null; then
echo "no"
echo
echo " Versions of intltool between 0.28 and 0.31 are known to"
echo " generate incorrect XML output. Please consider using an"
echo " earlier version of intltool in order to avoid these"
echo " problems until a newer version of intltool is released."
echo
echo " This problem is harmless, you may continue the build."
echo
else
echo "yes"
fi
else
echo "yes"
fi
else
echo "not found"
fi
if test "$DIE" -eq 1; then
echo
......@@ -220,9 +192,9 @@ if test -z "$ACLOCAL_FLAGS"; then
echo "WARNING: aclocal's directory is $acdir, but..."
echo " no file $acdir/$file"
echo " You may see fatal macro warnings below."
echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
echo " environment variable to \"-I /some/dir\", or install"
echo " $acdir/$file."
echo " If these files are installed in /some/dir, set the "
echo " ACLOCAL_FLAGS environment variable to \"-I /some/dir\""
echo " or install $acdir/$file."
echo
fi
done
......@@ -238,10 +210,10 @@ if test $RC -ne 0; then
fi
# optionally feature autoheader
(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader || exit 1
($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 && $AUTOHEADER || exit 1
$AUTOMAKE --add-missing || exit $?
autoconf || exit $?
$AUTOCONF || exit $?
glib-gettextize --force || exit $?
intltoolize --force --automake || exit $?
......
......@@ -16,7 +16,7 @@ m4_define([plugin_version],
dnl required versions of other packages
m4_define([glib_required_version], [2.4.5])
m4_define([gtk_required_version], [2.4.4])
m4_define([gimp_required_version], [2.2.0])
m4_define([gimp_required_version], [2.3.10])
AC_INIT([plugin_name], [plugin_version])
......
......@@ -76,33 +76,33 @@ static void tiny_fu_file_callback (GtkWidget *widget,
SFFilename *file);
static void tiny_fu_combo_callback (GtkWidget *widget,
SFOption *option);
static void tiny_fu_pattern_callback (const gchar *name,
static void tiny_fu_pattern_callback (gpointer data,
const gchar *name,
gint width,
gint height,
gint bytes,
const guchar *mask_data,
gboolean closing,
gpointer data);
static void tiny_fu_gradient_callback (const gchar *name,
gboolean closing);
static void tiny_fu_gradient_callback (gpointer data,
const gchar *name,
gint width,
const gdouble *mask_data,
gboolean closing,
gpointer data);
gboolean closing);
static void tiny_fu_font_callback (gpointer data,
const gchar *name,
gboolean closing);
static void tiny_fu_palette_callback (const gchar *name,
gboolean closing,
gpointer data);
static void tiny_fu_brush_callback (const gchar *name,
static void tiny_fu_palette_callback (gpointer data,
const gchar *name,
gboolean closing);
static void tiny_fu_brush_callback (gpointer data,
const gchar *name,
gdouble opacity,
gint spacing,
GimpLayerModeEffects paint_mode,
gint width,
gint height,
const guchar *mask_data,
gboolean closing,
gpointer data);
gboolean closing);
/*
......@@ -458,37 +458,41 @@ tiny_fu_interface (SFScript *script)
break;
case SF_PALETTE:
widget = gimp_palette_select_widget_new (_("Tiny-Fu Palette Selection"),
script->arg_values[i].sfa_palette,
tiny_fu_palette_callback,
&script->arg_values[i].sfa_palette);
widget = gimp_palette_select_button_new (_("Tiny-Fu Palette Selection"),
script->arg_values[i].sfa_palette);
g_signal_connect_swapped (widget, "palette-set",
G_CALLBACK (tiny_fu_palette_callback),
&script->arg_values[i].sfa_palette);
break;
case SF_PATTERN:
left_align = TRUE;
widget = gimp_pattern_select_widget_new (_("Tiny-Fu Pattern Selection"),
script->arg_values[i].sfa_pattern,
tiny_fu_pattern_callback,
&script->arg_values[i].sfa_pattern);
widget = gimp_pattern_select_button_new (_("Tiny-Fu Pattern Selection"),
script->arg_values[i].sfa_pattern);
g_signal_connect_swapped (widget, "pattern-set",
G_CALLBACK (tiny_fu_pattern_callback),
&script->arg_values[i].sfa_pattern);
break;
case SF_GRADIENT:
left_align = TRUE;
widget = gimp_gradient_select_widget_new (_("Tiny-Fu Gradient Selection"),
script->arg_values[i].sfa_gradient,
tiny_fu_gradient_callback,
&script->arg_values[i].sfa_gradient);
widget = gimp_gradient_select_button_new (_("Tiny-Fu Gradient Selection"),
script->arg_values[i].sfa_gradient);
g_signal_connect_swapped (widget, "gradient-set",
G_CALLBACK (tiny_fu_gradient_callback),
&script->arg_values[i].sfa_gradient);
break;
case SF_BRUSH:
left_align = TRUE;
widget = gimp_brush_select_widget_new (_("Tiny-Fu Brush Selection"),
widget = gimp_brush_select_button_new (_("Tiny-Fu Brush Selection"),
script->arg_values[i].sfa_brush.name,
script->arg_values[i].sfa_brush.opacity,
script->arg_values[i].sfa_brush.spacing,
script->arg_values[i].sfa_brush.paint_mode,
tiny_fu_brush_callback,
&script->arg_values[i].sfa_brush);
script->arg_values[i].sfa_brush.paint_mode);
g_signal_connect_swapped (widget, "brush-set",
G_CALLBACK (tiny_fu_brush_callback),
&script->arg_values[i].sfa_brush);
break;
case SF_OPTION:
......@@ -588,24 +592,12 @@ tiny_fu_interface_quit (SFScript *script)
switch (script->arg_types[i])
{
case SF_FONT:
gimp_font_select_button_close_popup
(GIMP_FONT_SELECT_BUTTON (sf_interface->widgets[i]));
break;
case SF_PALETTE:
gimp_palette_select_widget_close (sf_interface->widgets[i]);
break;
case SF_PATTERN:
gimp_pattern_select_widget_close (sf_interface->widgets[i]);
break;
case SF_GRADIENT:
gimp_gradient_select_widget_close (sf_interface->widgets[i]);
break;
case SF_BRUSH:
gimp_brush_select_widget_close (sf_interface->widgets[i]);
gimp_select_button_close_popup
(GIMP_SELECT_BUTTON (sf_interface->widgets[i]));
break;
default:
......@@ -655,23 +647,23 @@ tiny_fu_string_update (gchar **dest,
}
static void
tiny_fu_pattern_callback (const gchar *name,
tiny_fu_pattern_callback (gpointer data,
const gchar *name,
gint width,
gint height,
gint bytes,
const guchar *mask_data,
gboolean closing,
gpointer data)
gboolean closing)
{
tiny_fu_string_update (data, name);
}
static void
tiny_fu_gradient_callback (const gchar *name,
tiny_fu_gradient_callback (gpointer data,
const gchar *name,
gint width,
const gdouble *mask_data,
gboolean closing,
gpointer data)
gboolean closing)
{
tiny_fu_string_update (data, name);
}
......@@ -685,23 +677,23 @@ tiny_fu_font_callback (gpointer data,
}
static void
tiny_fu_palette_callback (const gchar *name,
gboolean closing,
gpointer data)
tiny_fu_palette_callback (gpointer data,
const gchar *name,
gboolean closing)
{
tiny_fu_string_update (data, name);
}
static void
tiny_fu_brush_callback (const gchar *name,
tiny_fu_brush_callback (gpointer data,
const gchar *name,
gdouble opacity,
gint spacing,
GimpLayerModeEffects paint_mode,
gint width,
gint height,
const guchar *mask_data,
gboolean closing,
gpointer data)
gboolean closing)
{
SFBrush *brush = data;
......@@ -953,26 +945,30 @@ tiny_fu_reset (SFScript *script)
break;
case SF_PALETTE:
gimp_palette_select_widget_set (widget,
script->arg_defaults[i].sfa_palette);
gimp_palette_select_button_set_palette_name
(GIMP_PALETTE_SELECT_BUTTON (widget),
script->arg_defaults[i].sfa_palette);
break;
case SF_PATTERN:
gimp_pattern_select_widget_set (widget,
script->arg_defaults[i].sfa_pattern);
gimp_pattern_select_button_set_pattern_name
(GIMP_PATTERN_SELECT_BUTTON (widget),
script->arg_defaults[i].sfa_pattern);
break;
case SF_GRADIENT:
gimp_gradient_select_widget_set (widget,
script->arg_defaults[i].sfa_gradient);
gimp_gradient_select_button_set_gradient_name
(GIMP_GRADIENT_SELECT_BUTTON (widget),
script->arg_defaults[i].sfa_gradient);
break;
case SF_BRUSH:
gimp_brush_select_widget_set (widget,
script->arg_defaults[i].sfa_brush.name,
script->arg_defaults[i].sfa_brush.opacity,
script->arg_defaults[i].sfa_brush.spacing,
script->arg_defaults[i].sfa_brush.paint_mode);
gimp_brush_select_button_set_brush
(GIMP_BRUSH_SELECT_BUTTON (widget),
script->arg_defaults[i].sfa_brush.name,
script->arg_defaults[i].sfa_brush.opacity,
script->arg_defaults[i].sfa_brush.spacing,
script->arg_defaults[i].sfa_brush.paint_mode);
break;
case SF_OPTION:
......
......@@ -637,7 +637,7 @@ char *ret_types[] = {
"GIMP_PDB_STRINGARRAY", "GIMP_PDB_COLOR", "GIMP_PDB_REGION",
"GIMP_PDB_DISPLAY", "GIMP_PDB_IMAGE", "GIMP_PDB_LAYER",
"GIMP_PDB_CHANNEL", "GIMP_PDB_DRAWABLE", "GIMP_PDB_SELECTION",
"GIMP_PDB_BOUNDARY", "GIMP_PDB_VECTORS", "GIMP_PDB_PARASITE",
"GIMP_PDB_BOUNDARY", "GIMP_PDB_VECTORS", "GIMP_PDB_PARASITE",
"GIMP_PDB_STATUS", "GIMP_PDB_END"
};
......@@ -732,7 +732,7 @@ fprintf (stderr, " Invalid number of arguments (expected %d but received %d)",
/* The checks on 'if (success)' below stop some code execution */
/* when the first error in the argument list is encountered. */
for (i = 0; i < nparams; i++)
for (i = 0; i < nparams && success; i++)
{
a = sc->vptr->pair_cdr (a);
......@@ -785,7 +785,7 @@ fprintf (stderr, " int16 arg is '%d'\n", args[i].data.d_int16);
success = FALSE;
if (success)
{
args[i].data.d_int8 = (gint8) sc->vptr->ivalue (sc->vptr->pair_car (a));
args[i].data.d_int8 = (guint8) sc->vptr->ivalue (sc->vptr->pair_car (a));
#if DEBUG_MARSHALL
fprintf (stderr, " int8 arg is '%d'\n", args[i].data.d_int8);
#endif
......@@ -920,12 +920,12 @@ fprintf (stderr, "\n");
return my_err (error_str, sc->NIL);
}
args[i].data.d_int8array = (gint8*) arrayvalue (array);
args[i].data.d_int8array = (guint8*) arrayvalue (array);
#if DEBUG_MARSHALL
{
gint8 *data;
guint8 *data;
int j;
data = (gint8*) arrayvalue (array);
data = (guint8*) arrayvalue (array);
fprintf (stderr, " int8 array has %d elements\n", n_elements);
fprintf (stderr, " ");
for (j = 0; j < n_elements; ++j)
......@@ -1151,9 +1151,6 @@ fprintf (stderr, " data '%s'\n", (char *)args[i].data.d_parasite.data);
i+1, proc_name);
return my_err (error_str, sc->NIL);
}
if (!success)
break;
}
if (success)
......@@ -1294,11 +1291,11 @@ fprintf (stderr, " value %d is type %s (%d)\n",
*/
{
gint32 num_int8s = values[i].data.d_int32;
gint8 *array = (gint8 *) values[i + 1].data.d_int8array;
guint8 *array = (guint8 *) values[i + 1].data.d_int8array;
pointer int_cell = sc->vptr->mk_array (sc, num_int8s, array_int8);
gint8 *avalue = (gint8 *) arrayvalue (int_cell);
guint8 *avalue = (guint8 *) arrayvalue (int_cell);
g_memmove(avalue, array, num_int8s*sizeof(gint8));
g_memmove(avalue, array, num_int8s*sizeof(guint8));
return_val = sc->vptr->cons (sc, int_cell, return_val);
}
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment