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

app/Makefile.am removed.

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

	* app/Makefile.am
	* app/tool_options_ui.h: removed.

	* app/tool_options.c
	* libgimp/gimpwidgets.[ch]: moved some more ui utility functions
	to libgimp.

	* app/airbrush.c
	* app/blend.c
	* app/bucket_fill.c
	* app/channel_ops.c
	* app/clone.c
	* app/color_picker.c
	* app/convolve.c
	* app/crop.c
	* app/dodgeburn.c
	* app/eraser.c
	* app/file_new_dialog.[ch]
	* app/flip_tool.c
	* app/image_new.[ch]
	* app/ink.c
	* app/layers_dialog.c
	* app/magnify.c
	* app/measure.c
	* app/paintbrush.c
	* app/pencil.c
	* app/smudge.c
	* app/text_tool.c
	* app/tool_options.c
	* app/transform_tool.c
	* app/xinput_airbrush.c: use the libgimp functions (esp. the radio
	button group constructor), some code cleanup.

	* plug-ins/common/csource.c
	* plug-ins/common/despeckle.c
	* plug-ins/common/diffraction.c
	* plug-ins/common/jpeg.c
	* plug-ins/common/png.c
	* plug-ins/unsharp/unsharp.c: more plugin ui tuning.

	* plug-ins/unsharp/Makefile.am
	* plug-ins/unsharp/dialog_f.[ch]
	* plug-ins/unsharp/dialog_i.[ch]: removed.
parent 8c1d97b7
2000-01-14 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
* app/tool_options_ui.h: removed.
* app/tool_options.c
* libgimp/gimpwidgets.[ch]: moved some more ui utility functions
to libgimp.
* app/airbrush.c
* app/blend.c
* app/bucket_fill.c
* app/channel_ops.c
* app/clone.c
* app/color_picker.c
* app/convolve.c
* app/crop.c
* app/dodgeburn.c
* app/eraser.c
* app/file_new_dialog.[ch]
* app/flip_tool.c
* app/image_new.[ch]
* app/ink.c
* app/layers_dialog.c
* app/magnify.c
* app/measure.c
* app/paintbrush.c
* app/pencil.c
* app/smudge.c
* app/text_tool.c
* app/tool_options.c
* app/transform_tool.c
* app/xinput_airbrush.c: use the libgimp functions (esp. the radio
button group constructor), some code cleanup.
* plug-ins/common/csource.c
* plug-ins/common/despeckle.c
* plug-ins/common/diffraction.c
* plug-ins/common/jpeg.c
* plug-ins/common/png.c
* plug-ins/unsharp/unsharp.c: more plugin ui tuning.
* plug-ins/unsharp/Makefile.am
* plug-ins/unsharp/dialog_f.[ch]
* plug-ins/unsharp/dialog_i.[ch]: removed.
Thu Jan 13 16:35:44 PST 2000 Manish Singh <yosh@gimp.org>
* Made 1.1.15 release
......
......@@ -419,7 +419,6 @@ gimp_SOURCES = \
tips_dialog.h \
tool_options.c \
tool_options.h \
tool_options_ui.h \
tools.c \
tools.h \
toolsF.h \
......
......@@ -30,7 +30,6 @@
#include "paint_core.h"
#include "paint_options.h"
#include "selection.h"
#include "tool_options_ui.h"
#include "tools.h"
#include "libgimp/gimpintl.h"
......@@ -114,7 +113,7 @@ airbrush_options_new (void)
GtkWidget *scale;
/* the new airbrush tool options structure */
options = (AirbrushOptions *) g_malloc (sizeof (AirbrushOptions));
options = g_new (AirbrushOptions, 1);
paint_options_init ((PaintOptions *) options,
AIRBRUSH,
airbrush_options_reset);
......@@ -136,7 +135,7 @@ airbrush_options_new (void)
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->rate_w), "value_changed",
(GtkSignalFunc) tool_options_double_adjustment_update,
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->rate);
gimp_table_attach_aligned (GTK_TABLE (table), 0,
_("Rate:"), 1.0, 1.0,
......@@ -149,7 +148,7 @@ airbrush_options_new (void)
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->pressure_w), "value_changed",
(GtkSignalFunc) tool_options_double_adjustment_update,
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->pressure);
gimp_table_attach_aligned (GTK_TABLE (table), 1,
_("Pressure:"), 1.0, 1.0,
......
......@@ -34,7 +34,6 @@
#include "interface.h"
#include "paint_options.h"
#include "selection.h"
#include "tool_options_ui.h"
#include "tools.h"
#include "undo.h"
......@@ -53,28 +52,30 @@
/* the blend structures */
typedef double (*RepeatFunc)(double);
typedef gdouble (* RepeatFunc) (gdouble);
typedef struct _BlendTool BlendTool;
struct _BlendTool
{
DrawCore * core; /* Core select object */
DrawCore *core; /* Core select object */
int startx; /* starting x coord */
int starty; /* starting y coord */
gint startx; /* starting x coord */
gint starty; /* starting y coord */
int endx; /* ending x coord */
int endy; /* ending y coord */
gint endx; /* ending x coord */
gint endy; /* ending y coord */
guint context_id; /* for the statusbar */
};
typedef struct _BlendOptions BlendOptions;
struct _BlendOptions
{
PaintOptions paint_options;
double offset;
double offset_d;
gdouble offset;
gdouble offset_d;
GtkObject *offset_w;
BlendMode blend_mode;
......@@ -89,37 +90,37 @@ struct _BlendOptions
RepeatMode repeat_d;
GtkWidget *repeat_w;
int supersample;
int supersample_d;
gint supersample;
gint supersample_d;
GtkWidget *supersample_w;
int max_depth;
int max_depth_d;
gint max_depth;
gint max_depth_d;
GtkObject *max_depth_w;
double threshold;
double threshold_d;
gdouble threshold;
gdouble threshold_d;
GtkObject *threshold_w;
};
typedef struct
{
double offset;
double sx, sy;
gdouble offset;
gdouble sx, sy;
BlendMode blend_mode;
GradientType gradient_type;
color_t fg, bg;
double dist;
double vec[2];
gdouble dist;
gdouble vec[2];
RepeatFunc repeat_func;
} RenderBlendData;
typedef struct
{
PixelRegion *PR;
unsigned char *row_data;
int bytes;
int width;
guchar *row_data;
gint bytes;
gint width;
} PutPixelData;
......@@ -302,7 +303,7 @@ blend_options_new ()
};
/* the new blend tool options structure */
options = (BlendOptions *) g_malloc (sizeof (BlendOptions));
options = g_new (BlendOptions, 1);
paint_options_init ((PaintOptions *) options,
BLEND,
blend_options_reset);
......@@ -333,7 +334,7 @@ blend_options_new ()
_("Offset:"), 1.0, 1.0,
scale, FALSE);
gtk_signal_connect (GTK_OBJECT (options->offset_w), "value_changed",
(GtkSignalFunc) tool_options_double_adjustment_update,
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->offset);
/* the blend mode menu */
......@@ -380,7 +381,7 @@ blend_options_new ()
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->supersample_w),
options->supersample_d);
gtk_signal_connect (GTK_OBJECT (options->supersample_w), "toggled",
(GtkSignalFunc) tool_options_toggle_update,
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&options->supersample);
gtk_box_pack_start (GTK_BOX (vbox), options->supersample_w, FALSE, FALSE, 0);
gtk_widget_show (options->supersample_w);
......@@ -407,7 +408,7 @@ blend_options_new ()
_("Max Depth:"), 1.0, 1.0,
scale, FALSE);
gtk_signal_connect (GTK_OBJECT(options->max_depth_w), "value_changed",
(GtkSignalFunc) tool_options_int_adjustment_update,
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
&options->max_depth);
/* threshold scale */
......@@ -420,7 +421,7 @@ blend_options_new ()
_("Threshold:"), 1.0, 1.0,
scale, FALSE);
gtk_signal_connect (GTK_OBJECT(options->threshold_w), "value_changed",
(GtkSignalFunc) tool_options_double_adjustment_update,
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->threshold);
/* show the table */
......
......@@ -16,7 +16,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdlib.h>
#include "gdk/gdkkeysyms.h"
#include <gdk/gdkkeysyms.h>
#include "appenv.h"
#include "bucket_fill.h"
#include "cursorutil.h"
......@@ -24,11 +26,11 @@
#include "fuzzy_select.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpui.h"
#include "interface.h"
#include "paint_funcs.h"
#include "paint_options.h"
#include "selection.h"
#include "tool_options_ui.h"
#include "tools.h"
#include "undo.h"
......@@ -104,12 +106,6 @@ bucket_options_new (void)
GtkWidget *label;
GtkWidget *scale;
GtkWidget *frame;
gchar* fill_mode_label[3] = { N_("FG Color Fill"),
N_("BG Color Fill"),
N_("Pattern Fill") };
gint fill_mode_value[3] = { FG_BUCKET_FILL,
BG_BUCKET_FILL,
PATTERN_BUCKET_FILL };
/* the new bucket fill tool options structure */
options = (BucketOptions *) g_malloc (sizeof (BucketOptions));
......@@ -139,7 +135,7 @@ bucket_options_new (void)
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->threshold_w), "value_changed",
(GtkSignalFunc) tool_options_double_adjustment_update,
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->threshold);
gtk_widget_show (scale);
......@@ -149,19 +145,29 @@ bucket_options_new (void)
options->sample_merged_w =
gtk_check_button_new_with_label (_("Sample Merged"));
gtk_signal_connect (GTK_OBJECT (options->sample_merged_w), "toggled",
(GtkSignalFunc) tool_options_toggle_update,
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&options->sample_merged);
gtk_box_pack_start (GTK_BOX (vbox), options->sample_merged_w, FALSE, FALSE, 0);
gtk_widget_show (options->sample_merged_w);
/* fill type */
frame = tool_options_radio_buttons_new (_("Fill Type"),
&options->fill_mode,
options->fill_mode_w,
fill_mode_label,
fill_mode_value,
3);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->fill_mode_w[options->fill_mode_d]), TRUE);
frame =
gimp_radio_group_new2 (TRUE, _("Fill Type"),
gimp_radio_button_update,
&options->fill_mode, (gpointer) options->fill_mode,
_("FG Color Fill"),
(gpointer) FG_BUCKET_FILL,
&options->fill_mode_w[0],
_("BG Color Fill"),
(gpointer) BG_BUCKET_FILL,
&options->fill_mode_w[1],
_("Pattern Fill"),
(gpointer) PATTERN_BUCKET_FILL,
&options->fill_mode_w[2],
NULL);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
......
......@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "channel_ops.h"
#include "cursorutil.h"
......@@ -28,6 +28,7 @@
#include "interface.h"
#include "libgimp/gimpsizeentry.h"
#include "libgimp/gimpmath.h"
#include "libgimp/gimpintl.h"
#include "channel_pvt.h"
......@@ -43,8 +44,6 @@ struct _OffsetDialog
GtkWidget *off_se;
gboolean wrap_around;
GtkWidget *fill_options;
ChannelOffsetType fill_type;
GimpImage *gimage;
......@@ -54,8 +53,6 @@ struct _OffsetDialog
static void offset_ok_callback (GtkWidget *, gpointer);
static void offset_cancel_callback (GtkWidget *, gpointer);
static void offset_wraparound_update (GtkWidget *, gpointer);
static void offset_fill_type_update (GtkWidget *, gpointer);
static void offset_halfheight_callback (GtkWidget *, gpointer);
......@@ -70,9 +67,8 @@ channel_ops_offset (GimpImage* gimage)
GtkWidget *table;
GtkObject *adjustment;
GtkWidget *spinbutton;
GtkWidget *radio_box;
GtkWidget *frame;
GtkWidget *radio_button;
GSList *group = NULL;
GimpDrawable *drawable;
......@@ -167,39 +163,22 @@ channel_ops_offset (GimpImage* gimage)
gtk_widget_show (check);
/* The fill options */
off_d->fill_options = gtk_frame_new (_("Fill Options"));
gtk_box_pack_start (GTK_BOX (vbox), off_d->fill_options, FALSE, FALSE, 0);
radio_box = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (radio_box), 2);
gtk_container_add (GTK_CONTAINER (off_d->fill_options), radio_box);
radio_button = gtk_radio_button_new_with_label (group, _("Background"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
gtk_box_pack_start (GTK_BOX (radio_box), radio_button, FALSE, FALSE, 0);
gtk_object_set_data (GTK_OBJECT (radio_button), "fill_type",
(gpointer) OFFSET_BACKGROUND);
gtk_signal_connect (GTK_OBJECT (radio_button), "toggled",
(GtkSignalFunc) offset_fill_type_update,
off_d);
gtk_widget_show (radio_button);
radio_button = gtk_radio_button_new_with_label (group, _("Transparent"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
gtk_box_pack_start (GTK_BOX (radio_box), radio_button, FALSE, FALSE, 0);
gtk_object_set_data (GTK_OBJECT (radio_button), "fill_type",
(gpointer) OFFSET_TRANSPARENT);
gtk_signal_connect (GTK_OBJECT (radio_button), "toggled",
(GtkSignalFunc) offset_fill_type_update,
off_d);
gtk_widget_show (radio_button);
if (drawable_has_alpha (drawable))
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_button), TRUE);
else
gtk_widget_set_sensitive (radio_button, FALSE);
frame =
gimp_radio_group_new2 (TRUE, _("Fill Options"),
gimp_radio_button_update,
&off_d->fill_type, (gpointer) off_d->fill_type,
_("Background"), (gpointer) OFFSET_BACKGROUND, NULL,
_("Transparent"), (gpointer) OFFSET_TRANSPARENT,
&radio_button,
gtk_widget_show (radio_box);
gtk_widget_show (off_d->fill_options);
NULL);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
if (!drawable_has_alpha (drawable))
gtk_widget_set_sensitive (radio_button, FALSE);
/* The by half height and half width option */
push = gtk_button_new_with_label (_("Offset by (x/2),(y/2)"));
......@@ -209,8 +188,9 @@ channel_ops_offset (GimpImage* gimage)
/* Hook up the wrap around */
gtk_signal_connect (GTK_OBJECT (check), "toggled",
(GtkSignalFunc) offset_wraparound_update,
off_d);
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&off_d->wrap_around);
gtk_object_set_data (GTK_OBJECT (check), "inverse_sensitive", frame);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), off_d->wrap_around);
/* Hook up the by half */
......@@ -505,32 +485,6 @@ offset_cancel_callback (GtkWidget *widget,
g_free (off_d);
}
static void
offset_wraparound_update (GtkWidget *widget,
gpointer data)
{
OffsetDialog *off_d;
off_d = (OffsetDialog *) data;
off_d->wrap_around = GTK_TOGGLE_BUTTON (widget)->active ? TRUE : FALSE;
gtk_widget_set_sensitive (off_d->fill_options, !off_d->wrap_around);
}
static void
offset_fill_type_update (GtkWidget *widget,
gpointer data)
{
OffsetDialog *off_d;
off_d = (OffsetDialog *) data;
if (GTK_TOGGLE_BUTTON (widget)->active)
off_d->fill_type =
(ChannelOffsetType) gtk_object_get_data (GTK_OBJECT (widget), "fill_type");
}
static void
offset_halfheight_callback (GtkWidget *widget,
gpointer data)
......
/* The GIMP -- an image manipulation program
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
......@@ -15,13 +15,17 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "appenv.h"
#include "drawable.h"
#include "errors.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpui.h"
#include "interface.h"
#include "paint_funcs.h"
#include "paint_core.h"
......@@ -50,6 +54,7 @@ typedef enum
} AlignType;
typedef struct _CloneOptions CloneOptions;
struct _CloneOptions
{
PaintOptions paint_options;
......@@ -98,20 +103,6 @@ static void clone_line_pattern (GImage *, GimpDrawable *, GPattern *,
/* functions */
static void
clone_type_callback (GtkWidget *widget,
gpointer data)
{
clone_options->type = (CloneType) data;
}
static void
align_type_callback (GtkWidget *widget,
gpointer data)
{
clone_options->aligned = (AlignType) data;
}
static void
clone_options_reset (void)
{
......@@ -127,31 +118,11 @@ static CloneOptions *
clone_options_new (void)
{
CloneOptions *options;
GtkWidget *vbox;
GSList *group = NULL;
GtkWidget *radio_frame;
GtkWidget *radio_box;
GtkWidget *radio_button;
int i;
static gchar *source_names[] =
{
N_("Image Source"),
N_("Pattern Source")
};
static gint n_source_names = sizeof (source_names) / sizeof (source_names[0]);
static gchar *align_names[] =
{
N_("Non Aligned"),
N_("Aligned"),
N_("Registered")
};
static gint n_align_names = sizeof (align_names) / sizeof (align_names[0]);
GtkWidget *frame;
/* the new clone tool options structure */
options = (CloneOptions *) g_malloc (sizeof (CloneOptions));
options = g_new (CloneOptions, 1);
paint_options_init ((PaintOptions *) options,
CLONE,
clone_options_reset);
......@@ -161,56 +132,35 @@ clone_options_new (void)
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
/* the radio frame and box */
radio_frame = gtk_frame_new (_("Source"));
gtk_box_pack_start (GTK_BOX (vbox), radio_frame, FALSE, FALSE, 0);
frame = gimp_radio_group_new2 (TRUE, _("Source"),
gimp_radio_button_update,
&options->type, (gpointer) options->type,
radio_box = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (radio_box), 2);
gtk_container_add (GTK_CONTAINER (radio_frame), radio_box);
_("Image Source"), (gpointer) IMAGE_CLONE,
&options->type_w[0],
_("Pattern Source"), (gpointer) PATTERN_CLONE,
&options->type_w[1],
/* the radio buttons */
for (i = 0; i < n_source_names; i++)
{
radio_button = gtk_radio_button_new_with_label (group,
gettext(source_names[i]));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
gtk_signal_connect (GTK_OBJECT (radio_button), "toggled",
(GtkSignalFunc) clone_type_callback,
(void *)((long) i));
gtk_box_pack_start (GTK_BOX (radio_box), radio_button, FALSE, FALSE, 0);
gtk_widget_show (radio_button);
options->type_w[i] = radio_button;
}
gtk_widget_show (radio_box);
gtk_widget_show (radio_frame);
NULL);
/* the radio frame and box */
radio_frame = gtk_frame_new (_("Alignment"));
gtk_box_pack_start (GTK_BOX (vbox), radio_frame, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
radio_box = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (radio_box), 2);
gtk_container_add (GTK_CONTAINER (radio_frame), radio_box);
frame = gimp_radio_group_new2 (TRUE, _("Alignment"),
gimp_radio_button_update,
&options->aligned, (gpointer) options->aligned,
/* the radio buttons */
group = NULL;
for (i = 0; i < n_align_names; i++)