Commit f10b06a3 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

configure.in plug-ins/Makefile.am removed.

2000-01-11  Michael Natterer  <mitch@gimp.org>

	* configure.in
	* plug-ins/Makefile.am
	* plug-ins/gpc/*: removed.

	* plug-ins/common/Makefile.am
	* plug-ins/common/plugin-defs.pl
	* plug-ins/common/blur.c
	* plug-ins/common/randomize.c: removed all calls to gpc functions.

	* plug-ins/common/edge.c: applied standard ui stuff.
parent a62cf428
2000-01-11 Michael Natterer <mitch@gimp.org>
* configure.in
* plug-ins/Makefile.am
* plug-ins/gpc/*: removed.
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/blur.c
* plug-ins/common/randomize.c: removed all calls to gpc functions.
* plug-ins/common/edge.c: applied standard ui stuff.
Tue Jan 11 19:31:30 CET 2000 Stanislav Brabec <utx@penguin.cz>
* tips/Makefile.am: Czech added.
......
......@@ -692,7 +692,6 @@ plug-ins/perl/config.pl
plug-ins/libgck/Makefile
plug-ins/libgck/gck/Makefile
plug-ins/megawidget/Makefile
plug-ins/gpc/Makefile
plug-ins/dbbrowser/Makefile
plug-ins/script-fu/Makefile
plug-ins/script-fu/scripts/Makefile
......
......@@ -30,7 +30,6 @@ endif
SUBDIRS = \
libgck \
megawidget \
gpc \
dbbrowser \
script-fu \
$(GIMP_PERL) \
......
......@@ -248,7 +248,6 @@ blur_SOURCES = \
blur.c
blur_LDADD = \
$(top_builddir)/plug-ins/gpc/libgpc.a \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
......@@ -924,7 +923,6 @@ randomize_SOURCES = \
randomize.c
randomize_LDADD = \
$(top_builddir)/plug-ins/gpc/libgpc.a \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
......
......@@ -65,8 +65,6 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include <plug-ins/gpc/gpc.h>
#include "libgimp/stdplugins-intl.h"
/*********************************
......@@ -96,26 +94,30 @@
*
********************************/
typedef struct {
gdouble blur_pct; /* likelihood of randomization (as %age) */
gdouble blur_rcount; /* repeat count */
gint seed_type; /* seed init. type - current time or user value */
gint blur_seed; /* seed value for rand() function */
typedef struct
{
gdouble blur_pct; /* likelihood of randomization (as %age) */
gdouble blur_rcount; /* repeat count */
gint seed_type; /* seed init. type - current time or user value */
gint blur_seed; /* seed value for rand() function */
} BlurVals;
static BlurVals pivals = {
100.0,
1.0,
SEED_TIME,
0,
static BlurVals pivals =
{
100.0,
1.0,
SEED_TIME,
0,
};
typedef struct {
gint run;
typedef struct
{
gint run;
} BlurInterface;
static BlurInterface blur_int = {
FALSE /* have we run? */
static BlurInterface blur_int =
{
FALSE /* have we run? */
};
......@@ -126,10 +128,10 @@ static BlurInterface blur_int = {
********************************/
static void query (void);
static void run (char *name,
int nparams,
GParam *param,
int *nreturn_vals,
static void run (gchar *name,
gint nparams,
GParam *param,
gint *nreturn_vals,
GParam **return_vals);
GPlugInInfo PLUG_IN_INFO =
......@@ -148,11 +150,16 @@ static inline void blur_prepare_row (GPixelRgn *pixel_rgn,
int y,
int w);
static gint blur_dialog (void);
static void blur_ok_callback (GtkWidget *widget,
gpointer data);
static gint blur_dialog (void);
static void blur_ok_callback (GtkWidget *widget,
gpointer data);
static void blur_text_update (GtkWidget *widget,
gpointer data);
static void blur_toggle_update (GtkWidget *widget,
gpointer data);
static void blur_scale_update (GtkAdjustment *adjustment,
gdouble *scale_val);
/************************************ Guts ***********************************/
......@@ -235,10 +242,10 @@ query (void)
********************************/
static void
run (char *name,
int nparams,
run (gchar *name,
gint nparams,
GParam *param,
int *nreturn_vals,
gint *nreturn_vals,
GParam **return_vals)
{
GDrawable *drawable;
......@@ -458,10 +465,10 @@ blur (GDrawable *drawable)
/*
* allocate row buffers
*/
prev_row = (guchar *) malloc((x2 - x1 + 2) * bytes);
cur_row = (guchar *) malloc((x2 - x1 + 2) * bytes);
next_row = (guchar *) malloc((x2 - x1 + 2) * bytes);
dest = (guchar *) malloc((x2 - x1) * bytes);
prev_row = g_new (guchar, (x2 - x1 + 2) * bytes);
cur_row = g_new (guchar, (x2 - x1 + 2) * bytes);
next_row = g_new (guchar, (x2 - x1 + 2) * bytes);
dest = g_new (guchar, (x2 - x1) * bytes);
/*
* initialize the pixel regions
......@@ -592,10 +599,10 @@ blur (GDrawable *drawable)
/*
* clean up after ourselves.
*/
free(prev_row);
free(cur_row);
free(next_row);
free(dest);
g_free (prev_row);
g_free (cur_row);
g_free (next_row);
g_free (dest);
}
/*********************************
......@@ -612,7 +619,10 @@ blur_dialog (void)
GtkWidget *seed_hbox;
GtkWidget *seed_vbox;
GtkWidget *table;
GSList *seed_group = NULL;
GtkWidget *scale;
GtkObject *scale_data;
GtkWidget *radio_button;
GSList *group = NULL;
gchar **argv;
gint argc;
gchar buffer[10];
......@@ -659,7 +669,7 @@ blur_dialog (void)
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);
gpc_setup_tooltips (table);
gimp_help_init ();
label = gtk_label_new (_("Randomization Seed:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
......@@ -672,37 +682,58 @@ blur_dialog (void)
seed_vbox = gtk_vbox_new (FALSE, 2);
gtk_table_attach (GTK_TABLE (table), seed_vbox, 1, 2, 1, 2,
GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
gtk_widget_show (seed_vbox);
/*
* Time button
*/
gpc_add_radio_button (&seed_group, _("Current Time"), seed_vbox, &do_time,
_("Seed random number generator from the current "
"time - this guarantees a reasonable randomization"));
radio_button = gtk_radio_button_new_with_label (NULL, _("Current Time"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
gtk_box_pack_start (GTK_BOX (seed_vbox), radio_button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (radio_button), "toggled",
GTK_SIGNAL_FUNC (blur_toggle_update),
&do_time);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_button), do_time);
gtk_widget_show (radio_button);
gimp_help_set_help_data (radio_button,
_("Seed random number generator from the current "
"time - this guarantees a reasonable "
"randomization"), NULL);
/*
* Box to hold seed user initialization controls
*/
seed_hbox = gtk_hbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (seed_vbox), seed_hbox, FALSE, FALSE, 0);
gtk_widget_show (seed_hbox);
/*
* User button
*/
gpc_add_radio_button (&seed_group, _("Other Value"), seed_hbox, &do_user,
_("Enable user-entered value for random number "
"generator seed - this allows you to repeat a "
"given \"random\" operation"));
radio_button = gtk_radio_button_new_with_label (group, _("Other Value"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
gtk_box_pack_start (GTK_BOX (seed_hbox), radio_button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (radio_button), "toggled",
GTK_SIGNAL_FUNC (blur_toggle_update),
&do_user);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_button), do_user);
gtk_widget_show (radio_button);
gimp_help_set_help_data (radio_button,
_("Enable user-entered value for random number "
"generator seed - this allows you to repeat a "
"given \"random\" operation"), NULL);
/*
* Randomization seed number (text)
*/
entry = gtk_entry_new ();
gtk_widget_set_usize (entry, ENTRY_WIDTH, 0);
gtk_box_pack_start(GTK_BOX(seed_hbox), entry, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX (seed_hbox), entry, FALSE, FALSE, 0);
g_snprintf (buffer, sizeof (buffer), "%d", pivals.blur_seed);
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
gtk_signal_connect (GTK_OBJECT (entry), "changed",
(GtkSignalFunc) gpc_text_update,
GTK_SIGNAL_FUNC (blur_text_update),
&pivals.blur_seed);
gtk_widget_show (entry);
gpc_set_tooltip (entry, _("Value for seeding the random number generator"));
gimp_help_set_help_data (entry,
_("Value for seeding the random number generator"),
NULL);
gtk_widget_show (seed_hbox);
/*
* Randomization percentage label & scale (1 to 100)
......@@ -712,10 +743,20 @@ blur_dialog (void)
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 2, 3);
gtk_widget_show (label);
gpc_add_hscale (table, SCALE_WIDTH,
1.0, 100.0, &pivals.blur_pct, 1, 2, 2, 3,
_("Percentage of pixels to be filtered"));
scale_data = gtk_adjustment_new (pivals.blur_pct, 1.0, 100.0, 1.0, 1.0, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (scale_data));
gtk_widget_set_usize (scale, SCALE_WIDTH, -1);
gtk_table_attach (GTK_TABLE (table), scale, 1, 2, 2, 3,
GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
GTK_SIGNAL_FUNC (blur_scale_update),
&pivals.blur_pct);
gtk_widget_show (scale);
gimp_help_set_help_data (scale,
_("Percentage of pixels to be filtered"), NULL);
/*
* Repeat count label & scale (1 to 100)
*/
......@@ -724,10 +765,20 @@ blur_dialog (void)
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 3, 4);
gtk_widget_show (label);
gpc_add_hscale (table, SCALE_WIDTH,
1.0, 100.0, &pivals.blur_rcount, 1, 2, 3, 4,
_("Number of times to apply filter"));
scale_data = gtk_adjustment_new (pivals.blur_rcount, 1.0, 100.0,
1.0, 1.0, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (scale_data));
gtk_widget_set_usize (scale, SCALE_WIDTH, -1);
gtk_table_attach (GTK_TABLE (table), scale, 1, 2, 3, 4,
GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_scale_set_digits (GTK_SCALE (scale), 0);
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
GTK_SIGNAL_FUNC (blur_scale_update),
&pivals.blur_rcount);
gtk_widget_show (scale);
gimp_help_set_help_data (scale, _("Number of times to apply filter"), NULL);
/*
* Display everything.
*/
......@@ -735,6 +786,7 @@ blur_dialog (void)
gtk_widget_show (dlg);
gtk_main ();
gimp_help_free ();
gdk_flush ();
/*
......@@ -761,3 +813,35 @@ blur_ok_callback (GtkWidget *widget,
gtk_widget_destroy (GTK_WIDGET (data));
}
static void
blur_text_update (GtkWidget *widget,
gpointer data)
{
gint *text_val;
text_val = (gint *) data;
*text_val = atoi (gtk_entry_get_text (GTK_ENTRY (widget)));
}
static void
blur_toggle_update (GtkWidget *widget,
gpointer data)
{
gint *toggle_val;
toggle_val = (gint *) data;
if (GTK_TOGGLE_BUTTON (widget)->active)
*toggle_val = TRUE;
else
*toggle_val = FALSE;
}
static void
blur_scale_update (GtkAdjustment *adjustment,
gdouble *scale_val)
{
*scale_val = adjustment->value;
}
......@@ -50,12 +50,13 @@
#include <gtk/gtk.h>
#include "libgimp/gimp.h"
#include "libgimp/gimpui.h"
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "libgimp/stdplugins-intl.h"
#ifdef RCSID
static char rcsid[] = "$Id$";
static gchar rcsid[] = "$Id$";
#endif
/* Some useful macros */
......@@ -619,24 +620,23 @@ edge_dialog (GDrawable *drawable)
GtkWidget *frame;
GtkWidget *table;
GtkWidget *hbox;
GtkWidget *hbbox;
GtkWidget *button;
GtkWidget *toggle;
GtkWidget *label;
GtkWidget *scale;
GtkObject *scale_data;
GtkWidget *entry;
gchar buffer[256];
GSList *group = NULL;
gchar **argv;
gint argc;
gint use_wrap = (evals.wrapmode == WRAP);
gint use_smear = (evals.wrapmode == SMEAR);
gint use_black = (evals.wrapmode == BLACK);
gdouble init_val;
argc = 1;
argv = g_new (gchar *, 1);
gchar buffer[256];
GSList *group = NULL;
gchar **argv;
gint argc;
gint use_wrap = (evals.wrapmode == WRAP);
gint use_smear = (evals.wrapmode == SMEAR);
gint use_black = (evals.wrapmode == BLACK);
gdouble init_val;
argc = 1;
argv = g_new (gchar *, 1);
argv[0] = g_strdup ("edge");
gtk_init (&argc, &argv);
......@@ -659,21 +659,21 @@ edge_dialog (GDrawable *drawable)
NULL);
/* parameter settings */
frame = gtk_frame_new ( _("Edge Detection Options"));
frame = gtk_frame_new (_("Parameter Settings"));
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_container_border_width (GTK_CONTAINER (frame), 10);
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);
table = gtk_table_new (2, 3, FALSE);
gtk_container_border_width (GTK_CONTAINER (table), 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
gtk_container_add (GTK_CONTAINER (frame), table);
/*
Label, scale, entry for evals.amount
*/
/* Label, scale, entry for evals.amount */
label = gtk_label_new ( _("Amount:"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
label = gtk_label_new (_("Amount:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_widget_show (label);
/* This prevents annoying change of adjustment */
......@@ -697,16 +697,16 @@ edge_dialog (GDrawable *drawable)
gtk_widget_show (entry);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
GTK_FILL, 0, 5, 0);
GTK_FILL, 0, 0, 0);
gtk_table_attach (GTK_TABLE (table), scale, 2, 3, 0, 1,
GTK_EXPAND | GTK_FILL, 0, 5, 0);
GTK_EXPAND | GTK_FILL, 0, 0, 0);
gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1,
GTK_FILL, 0, 0, 0);
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
(GtkSignalFunc) edge_scale_update,
&evals.amount);
sprintf (buffer, "%0.1f", evals.amount);
g_snprintf (buffer, sizeof (buffer), "%0.1f", evals.amount);
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
gtk_signal_connect (GTK_OBJECT (entry), "changed",
(GtkSignalFunc) edge_entry_update,
......@@ -714,14 +714,10 @@ edge_dialog (GDrawable *drawable)
gtk_object_set_user_data (GTK_OBJECT (entry), scale_data);
gtk_object_set_user_data (scale_data, entry);
/*
Radio buttons WRAP, SMEAR, BLACK ...
*/
/* Radio buttons WRAP, SMEAR, BLACK */
hbox = gtk_hbox_new (FALSE, 5);
gtk_container_border_width (GTK_CONTAINER (hbox), 5);
hbox = gtk_hbox_new (FALSE, 4);
gtk_table_attach (GTK_TABLE (table), hbox, 0, 3, 1, 2,
GTK_FILL, GTK_FILL, 0, 0);
......
......@@ -9,7 +9,7 @@
'autocrop' => { libdep => 'glib' },
'autostretch_hsv' => { libdep => 'glib' },
'blinds' => { libdep => 'gtk', ui => 1 },
'blur' => { libdep => 'gtk', ui => 1, libsupp => 'gpc' },
'blur' => { libdep => 'gtk', ui => 1 },
'bumpmap' => { libdep => 'gtk', ui => 1 },
'bz2' => { libdep => 'glib' },
'c_astretch' => { libdep => 'glib' },
......@@ -84,7 +84,7 @@
'ps' => { libdep => 'gtk', ui => 1 },
'psd' => { libdep => 'glib' },
'psp' => { libdep => 'gtk', ui => 1, optional => 1, libopt => 'z' },
'randomize' => { libdep => 'gtk', libsupp => 'gpc', ui => 1 },
'randomize' => { libdep => 'gtk', ui => 1 },
'ripple' => { libdep => 'gtk', ui => 1 },
'rotate' => { libdep => 'glib' },
'sample_colorize' => { libdep => 'gtk', ui => 1 },
......
......@@ -81,8 +81,6 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include <plug-ins/gpc/gpc.h>
#include "libgimp/stdplugins-intl.h"
/*********************************
......@@ -91,18 +89,20 @@
*
********************************/
/*
* progress meter update frequency
*/
#define PROG_UPDATE_TIME ((row % 10) == 0)
char *PLUG_IN_NAME[] = {
"plug_in_randomize_hurl",
"plug_in_randomize_pick",
"plug_in_randomize_slur",
gchar *PLUG_IN_NAME[] =
{
"plug_in_randomize_hurl",
"plug_in_randomize_pick",
"plug_in_randomize_slur",
};
char *RNDM_VERSION[] = {
gchar *RNDM_VERSION[] =
{
N_("Random Hurl 1.7"),
N_("Random Pick 1.7"),
N_("Random Slur 1.7"),
......@@ -126,26 +126,30 @@ gint rndm_type = RNDM_HURL; /* hurl, pick, etc. */
*
********************************/
typedef struct {
gdouble rndm_pct; /* likelihood of randomization (as %age) */
gdouble rndm_rcount; /* repeat count */
gint seed_type; /* seed init. type - current time or user value */
gint rndm_seed; /* seed value for rand() function */
typedef struct
{
gdouble rndm_pct; /* likelihood of randomization (as %age) */
gdouble rndm_rcount; /* repeat count */
gint seed_type; /* seed init. type - current time or user value */
gint rndm_seed; /* seed value for rand() function */
} RandomizeVals;
static RandomizeVals pivals = {
50.0,
1.0,
SEED_TIME,
0,
static RandomizeVals pivals =
{
50.0,
1.0,
SEED_TIME,
0,
};
typedef struct {
gint run;
typedef struct
{
gint run;
} RandomizeInterface;
static RandomizeInterface rndm_int = {
FALSE /* have we run? */
static RandomizeInterface rndm_int =
{
FALSE /* have we run? */
};
......@@ -156,17 +160,18 @@ static RandomizeInterface rndm_int = {
********************************/
static void query (void);
static void run (char *name,
int nparams,
GParam *param,
int *nreturn_vals,
static void run (gchar *name,
gint nparams,
GParam *param,
gint *nreturn_vals,
GParam **return_vals);
GPlugInInfo PLUG_IN_INFO = {
NULL, /* init_proc */
NULL, /* quit_proc */
query, /* query_proc */
run, /* run_proc */
GPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
query, /* query_proc */
run, /* run_proc */
};
static void randomize (GDrawable *drawable);
......@@ -177,11 +182,16 @@ static inline void randomize_prepare_row (GPixelRgn *pixel_rgn,
int y,
int w);
static gint randomize_dialog (void);
static void randomize_ok_callback (GtkWidget *widget,
gpointer data);
static gint randomize_dialog (void);
static void randomize_ok_callback (GtkWidget *widget,
gpointer data);
static void randomize_text_update (GtkWidget *widget,
gpointer data);
static void randomize_toggle_update (GtkWidget *widget,