perl support for COMPAT_CRUFT

* configure.in: perl support for COMPAT_CRUFT

* plug-ins/gap/gap_decode_mpeg_main.c: removed COMPAT_CRUFT

-Yosh
This commit is contained in:
Manish Singh 2000-08-24 00:33:11 +00:00
parent 38faf34c48
commit 114d5567c5
10 changed files with 265 additions and 7 deletions

View File

@ -1,3 +1,9 @@
Wed Aug 23 17:31:35 PDT 2000 Manish Singh <yosh@gimp.org>
* configure.in: perl support for COMPAT_CRUFT
* plug-ins/gap/gap_decode_mpeg_main.c: removed COMPAT_CRUFT
2000-08-24 Sven Neumann <sven@gimp.org>
* plug-ins/gap/iter_ALT/*/*.inc: removed COMPAT_CRUFT

View File

@ -24,6 +24,7 @@
#include <time.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "about_dialog.h"
#include "appenv.h"
@ -55,6 +56,9 @@ static gint about_dialog_logo_expose (GtkWidget *widget,
static gint about_dialog_button (GtkWidget *widget,
GdkEventButton *event,
gpointer data);
static gint about_dialog_key (GtkWidget *widget,
GdkEventKey *event,
gpointer data);
static void about_dialog_tool_drop (GtkWidget *widget,
ToolType tool,
gpointer data);
@ -77,6 +81,7 @@ static gint scroll_state = 0;
static gint frame = 0;
static gint offset = 0;
static gint timer = 0;
static gint hadja_state = 0;
static gchar **scroll_text = authors;
static gint nscroll_texts = sizeof (authors) / sizeof (authors[0]);
static gint scroll_text_widths[sizeof (authors) / sizeof (authors[0])];
@ -99,6 +104,12 @@ static gchar *drop_text[] =
"Resistance is futile."
};
static gchar *hadja_text[] =
{
"Hadjaha!",
"Nej!",
"Tvärtom!"
};
void
about_dialog_create (void)
@ -133,7 +144,10 @@ about_dialog_create (void)
gtk_signal_connect (GTK_OBJECT (about_dialog), "button_press_event",
GTK_SIGNAL_FUNC (about_dialog_button),
NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "key_press_event",
GTK_SIGNAL_FUNC (about_dialog_key),
NULL);
/* dnd stuff */
gtk_drag_dest_set (about_dialog,
GTK_DEST_DEFAULT_MOTION |
@ -222,6 +236,11 @@ about_dialog_create (void)
max_width = MAX (max_width,
gdk_string_width (aboutframe->style->font, drop_text[i]));
}
for (i = 0; i < (sizeof (hadja_text) / sizeof (hadja_text[0])); i++)
{
max_width = MAX (max_width,
gdk_string_width (aboutframe->style->font, hadja_text[i]));
}
scroll_area = gtk_drawing_area_new ();
gtk_drawing_area_size (GTK_DRAWING_AREA (scroll_area),
max_width + 10,
@ -281,7 +300,6 @@ about_dialog_create (void)
}
}
static gboolean
about_dialog_load_logo (GtkWidget *window)
{
@ -442,6 +460,70 @@ about_dialog_button (GtkWidget *widget,
return FALSE;
}
static gint
about_dialog_key (GtkWidget *widget,
GdkEventKey *event,
gpointer data)
{
gint i;
switch (event->keyval)
{
case GDK_h:
case GDK_H:
if (hadja_state == 0 || hadja_state == 5)
hadja_state++;
else
hadja_state = 1;
break;
case GDK_a:
case GDK_A:
if (hadja_state == 1 || hadja_state == 4 || hadja_state == 6)
hadja_state++;
else
hadja_state = 0;
break;
case GDK_d:
case GDK_D:
if (hadja_state == 2)
hadja_state++;
else
hadja_state = 0;
break;
case GDK_j:
case GDK_J:
if (hadja_state == 3)
hadja_state++;
else
hadja_state = 0;
break;
default:
hadja_state = 0;
}
if (hadja_state == 7)
{
scroll_text = hadja_text;
nscroll_texts = sizeof (hadja_text) / sizeof (hadja_text[0]);
for (i = 0; i < nscroll_texts; i++)
{
shuffle_array[i] = i;
scroll_text_widths[i] = gdk_string_width (scroll_area->style->font,
scroll_text[i]);
}
scroll_state = 0;
cur_scroll_index = 0;
cur_scroll_text = 0;
offset = 0;
double_speed = TRUE;
}
return FALSE;
}
static void
about_dialog_tool_drop (GtkWidget *widget,
ToolType tool,

View File

@ -24,6 +24,7 @@
#include <time.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "about_dialog.h"
#include "appenv.h"
@ -55,6 +56,9 @@ static gint about_dialog_logo_expose (GtkWidget *widget,
static gint about_dialog_button (GtkWidget *widget,
GdkEventButton *event,
gpointer data);
static gint about_dialog_key (GtkWidget *widget,
GdkEventKey *event,
gpointer data);
static void about_dialog_tool_drop (GtkWidget *widget,
ToolType tool,
gpointer data);
@ -77,6 +81,7 @@ static gint scroll_state = 0;
static gint frame = 0;
static gint offset = 0;
static gint timer = 0;
static gint hadja_state = 0;
static gchar **scroll_text = authors;
static gint nscroll_texts = sizeof (authors) / sizeof (authors[0]);
static gint scroll_text_widths[sizeof (authors) / sizeof (authors[0])];
@ -99,6 +104,12 @@ static gchar *drop_text[] =
"Resistance is futile."
};
static gchar *hadja_text[] =
{
"Hadjaha!",
"Nej!",
"Tvärtom!"
};
void
about_dialog_create (void)
@ -133,7 +144,10 @@ about_dialog_create (void)
gtk_signal_connect (GTK_OBJECT (about_dialog), "button_press_event",
GTK_SIGNAL_FUNC (about_dialog_button),
NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "key_press_event",
GTK_SIGNAL_FUNC (about_dialog_key),
NULL);
/* dnd stuff */
gtk_drag_dest_set (about_dialog,
GTK_DEST_DEFAULT_MOTION |
@ -222,6 +236,11 @@ about_dialog_create (void)
max_width = MAX (max_width,
gdk_string_width (aboutframe->style->font, drop_text[i]));
}
for (i = 0; i < (sizeof (hadja_text) / sizeof (hadja_text[0])); i++)
{
max_width = MAX (max_width,
gdk_string_width (aboutframe->style->font, hadja_text[i]));
}
scroll_area = gtk_drawing_area_new ();
gtk_drawing_area_size (GTK_DRAWING_AREA (scroll_area),
max_width + 10,
@ -281,7 +300,6 @@ about_dialog_create (void)
}
}
static gboolean
about_dialog_load_logo (GtkWidget *window)
{
@ -442,6 +460,70 @@ about_dialog_button (GtkWidget *widget,
return FALSE;
}
static gint
about_dialog_key (GtkWidget *widget,
GdkEventKey *event,
gpointer data)
{
gint i;
switch (event->keyval)
{
case GDK_h:
case GDK_H:
if (hadja_state == 0 || hadja_state == 5)
hadja_state++;
else
hadja_state = 1;
break;
case GDK_a:
case GDK_A:
if (hadja_state == 1 || hadja_state == 4 || hadja_state == 6)
hadja_state++;
else
hadja_state = 0;
break;
case GDK_d:
case GDK_D:
if (hadja_state == 2)
hadja_state++;
else
hadja_state = 0;
break;
case GDK_j:
case GDK_J:
if (hadja_state == 3)
hadja_state++;
else
hadja_state = 0;
break;
default:
hadja_state = 0;
}
if (hadja_state == 7)
{
scroll_text = hadja_text;
nscroll_texts = sizeof (hadja_text) / sizeof (hadja_text[0]);
for (i = 0; i < nscroll_texts; i++)
{
shuffle_array[i] = i;
scroll_text_widths[i] = gdk_string_width (scroll_area->style->font,
scroll_text[i]);
}
scroll_state = 0;
cur_scroll_index = 0;
cur_scroll_text = 0;
offset = 0;
double_speed = TRUE;
}
return FALSE;
}
static void
about_dialog_tool_drop (GtkWidget *widget,
ToolType tool,

View File

@ -24,6 +24,7 @@
#include <time.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "about_dialog.h"
#include "appenv.h"
@ -55,6 +56,9 @@ static gint about_dialog_logo_expose (GtkWidget *widget,
static gint about_dialog_button (GtkWidget *widget,
GdkEventButton *event,
gpointer data);
static gint about_dialog_key (GtkWidget *widget,
GdkEventKey *event,
gpointer data);
static void about_dialog_tool_drop (GtkWidget *widget,
ToolType tool,
gpointer data);
@ -77,6 +81,7 @@ static gint scroll_state = 0;
static gint frame = 0;
static gint offset = 0;
static gint timer = 0;
static gint hadja_state = 0;
static gchar **scroll_text = authors;
static gint nscroll_texts = sizeof (authors) / sizeof (authors[0]);
static gint scroll_text_widths[sizeof (authors) / sizeof (authors[0])];
@ -99,6 +104,12 @@ static gchar *drop_text[] =
"Resistance is futile."
};
static gchar *hadja_text[] =
{
"Hadjaha!",
"Nej!",
"Tvärtom!"
};
void
about_dialog_create (void)
@ -133,7 +144,10 @@ about_dialog_create (void)
gtk_signal_connect (GTK_OBJECT (about_dialog), "button_press_event",
GTK_SIGNAL_FUNC (about_dialog_button),
NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "key_press_event",
GTK_SIGNAL_FUNC (about_dialog_key),
NULL);
/* dnd stuff */
gtk_drag_dest_set (about_dialog,
GTK_DEST_DEFAULT_MOTION |
@ -222,6 +236,11 @@ about_dialog_create (void)
max_width = MAX (max_width,
gdk_string_width (aboutframe->style->font, drop_text[i]));
}
for (i = 0; i < (sizeof (hadja_text) / sizeof (hadja_text[0])); i++)
{
max_width = MAX (max_width,
gdk_string_width (aboutframe->style->font, hadja_text[i]));
}
scroll_area = gtk_drawing_area_new ();
gtk_drawing_area_size (GTK_DRAWING_AREA (scroll_area),
max_width + 10,
@ -281,7 +300,6 @@ about_dialog_create (void)
}
}
static gboolean
about_dialog_load_logo (GtkWidget *window)
{
@ -442,6 +460,70 @@ about_dialog_button (GtkWidget *widget,
return FALSE;
}
static gint
about_dialog_key (GtkWidget *widget,
GdkEventKey *event,
gpointer data)
{
gint i;
switch (event->keyval)
{
case GDK_h:
case GDK_H:
if (hadja_state == 0 || hadja_state == 5)
hadja_state++;
else
hadja_state = 1;
break;
case GDK_a:
case GDK_A:
if (hadja_state == 1 || hadja_state == 4 || hadja_state == 6)
hadja_state++;
else
hadja_state = 0;
break;
case GDK_d:
case GDK_D:
if (hadja_state == 2)
hadja_state++;
else
hadja_state = 0;
break;
case GDK_j:
case GDK_J:
if (hadja_state == 3)
hadja_state++;
else
hadja_state = 0;
break;
default:
hadja_state = 0;
}
if (hadja_state == 7)
{
scroll_text = hadja_text;
nscroll_texts = sizeof (hadja_text) / sizeof (hadja_text[0]);
for (i = 0; i < nscroll_texts; i++)
{
shuffle_array[i] = i;
scroll_text_widths[i] = gdk_string_width (scroll_area->style->font,
scroll_text[i]);
}
scroll_state = 0;
cur_scroll_index = 0;
cur_scroll_text = 0;
offset = 0;
double_speed = TRUE;
}
return FALSE;
}
static void
about_dialog_tool_drop (GtkWidget *widget,
ToolType tool,

View File

@ -617,6 +617,7 @@ if test "x$enable_perl" != xno; then
GIMP_LIBS="$GIMP_LIBS_NOUI -lgimpui"
GIMPTOOL="../../gimptool"
IN_GIMP=1
PERL_COMPAT_CRUFT="-DGIMP_ENABLE_COMPAT_CRUFT"
EXTENSIVE_TESTS=0
dnl include the autoconf fragment from there

View File

@ -520,7 +520,7 @@ load_image (char *filename,
/* ignore frames before first_frame */
if (framenumber >= first_frame )
{
image_ID = gimp_image_new (wwidth, wheight, RGB);
image_ID = gimp_image_new (wwidth, wheight, GIMP_RGB);
gimp_image_set_filename (image_ID, framename);
if(framenumber == first_frame)

View File

@ -16,6 +16,7 @@ Revision history for Gimp-Perl extension.
buggy perl version that causes pxgettext to not work!
- do yet another compile/link flags rotation.
- replaced find -path by grep 'Cause -path seems to be a gnu extension.
- add -DGIMP_ENABLE_COMPAT_CRUFT to build with latest source (Yosh)
1.2 Thu May 11 18:55:13 CEST 2000
- image types updated to reflect gimp's reality.

View File

@ -38,6 +38,7 @@ $^W=0;
_EXTENSIVE_TESTS => q[@EXTENSIVE_TESTS@],
IN_GIMP => q[@IN_GIMP@],
COMPAT_CRUFT => q[@PERL_COMPAT_CRUFT@],
pdl_inc => '',
pdl_typemaps => '',

View File

@ -21,6 +21,7 @@ AC_SUBST(LDFLAGS)
AC_SUBST(prefix)
AC_SUBST(IN_GIMP)
AC_SUBST(PERL_COMPAT_CRUFT)
AC_SUBST(GIMP_CFLAGS)
AC_SUBST(GIMP_CFLAGS_NOUI)

View File

@ -47,6 +47,8 @@ if test $gimptool_major_version -lt 2 && test $gimptool_minor_version -lt 1 ; th
echo '** released 1.0.x versions of the gimp, many scripts will not, since they'
echo '** already use the new API.'
echo
else
PERL_COMPAT_CRUFT="-DGIMP_ENABLE_COMPAT_CRUFT"
fi