Commit f1b0a883 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

app/airbrush.c app/bezier_select.c app/blend.c app/brightness_contrast.c

1999-04-08  Michael Natterer  <mitschel@cs.tu-berlin.de>

	* app/airbrush.c
	* app/bezier_select.c
	* app/blend.c
	* app/brightness_contrast.c
	* app/bucket_fill.c
	* app/by_color_select.c
	* app/clone.c
	* app/color_balance.c
	* app/color_picker.c
	* app/convolve.c
	* app/crop.[ch]
	* app/curves.c
	* app/ellipse_select.c
	* app/eraser.c
	* app/flip_tool.c
	* app/free_select.c
	* app/fuzzy_select.c
	* app/histogram_tool.c
	* app/hue_saturation.c
	* app/ink.c
	* app/iscissors.c
	* app/levels.c
	* app/magnify.c
	* app/move.c
	* app/paintbrush.c
	* app/pencil.c
	* app/posterize.c
	* app/rect_select.[ch]
	* app/text_tool.[ch]
	* app/threshold.c
	* app/transform_tool.c

	* app/tools.[ch]
	* app/toolsF.h: in other words: all tools

	Implemented the "reset tool options" feature.
	- All tools register with a title string and a reset function now.
	- The tool options' variables have two related <var>_d (default)
	  and <var>_w (widget) variables to restore the default values.

	"Standardized" the tool options UI:
	- Put the stuff info a frame to give a hint that the dialog's
	  contents will change.
	- table layout, sensitive setting, spacings, borders, ...

	As I had them all in my emacs simultaneously, I couldn't resist to
	standardize the tools' *.c files declaration parts ;) Ansi stuff.
parent 7739ffb3
1999-04-08 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/airbrush.c
* app/bezier_select.c
* app/blend.c
* app/brightness_contrast.c
* app/bucket_fill.c
* app/by_color_select.c
* app/clone.c
* app/color_balance.c
* app/color_picker.c
* app/convolve.c
* app/crop.[ch]
* app/curves.c
* app/ellipse_select.c
* app/eraser.c
* app/flip_tool.c
* app/free_select.c
* app/fuzzy_select.c
* app/histogram_tool.c
* app/hue_saturation.c
* app/ink.c
* app/iscissors.c
* app/levels.c
* app/magnify.c
* app/move.c
* app/paintbrush.c
* app/pencil.c
* app/posterize.c
* app/rect_select.[ch]
* app/text_tool.[ch]
* app/threshold.c
* app/transform_tool.c
* app/tools.[ch]
* app/toolsF.h: in other words: all tools
Implemented the "reset tool options" feature.
- All tools register with a title string and a reset function now.
- The tool options' variables have two related <var>_d (default)
and <var>_w (widget) variables to restore the default values.
"Standardized" the tool options UI:
- Put the stuff info a frame to give a hint that the dialog's
contents will change.
- table layout, sensitive setting, spacings, borders, ...
As I had them all in my emacs simultaneously, I couldn't resist to
standardize the tools' *.c files declaration parts ;) Ansi stuff.
Thu Apr 8 21:19:05 BST 1999 Andy Thomas <alt@gimp.org>
Changed:-
......
......@@ -31,40 +31,51 @@
#include "libgimp/gimpintl.h"
typedef struct _AirbrushTimeout AirbrushTimeout;
/* The maximum amount of pressure that can be exerted */
#define MAX_PRESSURE 0.075
#define OFF 0
#define ON 1
/* the airbrush structures */
typedef struct _AirbrushTimeout AirbrushTimeout;
struct _AirbrushTimeout
{
PaintCore *paint_core;
GimpDrawable *drawable;
};
/* forward function declarations */
static void airbrush_motion (PaintCore *, GimpDrawable *, double);
static gint airbrush_time_out (gpointer);
static Argument * airbrush_invoker (Argument *);
static double non_gui_pressure;
/* The maximum amount of pressure that can be exerted */
#define MAX_PRESSURE 0.075
#define OFF 0
#define ON 1
typedef struct _AirbrushOptions AirbrushOptions;
struct _AirbrushOptions
{
double rate;
double pressure;
double rate;
double rate_d;
GtkObject *rate_w;
double pressure;
double pressure_d;
GtkObject *pressure_w;
};
/* airbrush tool options */
static AirbrushOptions *airbrush_options = NULL;
/* local variables */
static gint timer; /* timer for successive paint applications */
static int timer_state = OFF; /* state of airbrush tool */
static gint timer; /* timer for successive paint applications */
static int timer_state = OFF; /* state of airbrush tool */
static AirbrushTimeout airbrush_timeout;
static AirbrushOptions *airbrush_options = NULL;
static double non_gui_pressure;
/* forward function declarations */
static void airbrush_motion (PaintCore *, GimpDrawable *, double);
static gint airbrush_time_out (gpointer);
static Argument * airbrush_invoker (Argument *);
/* functions */
static void
airbrush_scale_update (GtkAdjustment *adjustment,
......@@ -73,69 +84,78 @@ airbrush_scale_update (GtkAdjustment *adjustment,
*scale_val = adjustment->value;
}
static void
reset_airbrush_options (void)
{
AirbrushOptions *options = airbrush_options;
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->rate_w),
options->rate_d);
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->pressure_w),
options->pressure_d);
}
static AirbrushOptions *
create_airbrush_options (void)
{
AirbrushOptions *options;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *label;
GtkWidget *rate_scale;
GtkWidget *pressure_scale;
GtkObject *rate_scale_data;
GtkObject *pressure_scale_data;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *label;
GtkWidget *scale;
/* the new options structure */
options = (AirbrushOptions *) g_malloc (sizeof (AirbrushOptions));
options->rate = 80.0;
options->pressure = 10.0;
options->rate = options->rate_d = 80.0;
options->pressure = options->pressure_d = 10.0;
/* the main vbox */
vbox = gtk_vbox_new (FALSE, 1);
/* the main label */
label = gtk_label_new (_("Airbrush Options"));
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
vbox = gtk_vbox_new (FALSE, 2);
/* the rate scale */
hbox = gtk_hbox_new (FALSE, 1);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
label = gtk_label_new (_("Rate: "));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
table = gtk_table_new (2, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
label = gtk_label_new (_("Rate:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (label);
rate_scale_data = gtk_adjustment_new (80.0, 0.0, 150.0, 1.0, 1.0, 0.0);
rate_scale = gtk_hscale_new (GTK_ADJUSTMENT (rate_scale_data));
gtk_box_pack_start (GTK_BOX (hbox), rate_scale, TRUE, TRUE, 0);
gtk_scale_set_value_pos (GTK_SCALE (rate_scale), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (rate_scale), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (rate_scale_data), "value_changed",
options->rate_w =
gtk_adjustment_new (options->rate_d, 0.0, 150.0, 1.0, 1.0, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (options->rate_w));
gtk_table_attach_defaults (GTK_TABLE (table), scale, 1, 2, 0, 1);
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) airbrush_scale_update, &options->rate);
gtk_widget_show (rate_scale);
gtk_widget_show (scale);
/* the pressure scale */
hbox = gtk_hbox_new (FALSE, 1);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
label = gtk_label_new (_("Pressure: "));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
label = gtk_label_new (_("Pressure:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (label);
pressure_scale_data = gtk_adjustment_new (10.0, 0.0, 100.0, 1.0, 1.0, 0.0);
pressure_scale = gtk_hscale_new (GTK_ADJUSTMENT (pressure_scale_data));
gtk_box_pack_start (GTK_BOX (hbox), pressure_scale, TRUE, TRUE, 0);
gtk_scale_set_value_pos (GTK_SCALE (pressure_scale), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (pressure_scale), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (pressure_scale_data), "value_changed",
options->pressure_w =
gtk_adjustment_new (options->pressure_d, 0.0, 100.0, 1.0, 1.0, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (options->pressure_w));
gtk_table_attach_defaults (GTK_TABLE (table), scale, 1, 2, 1, 2);
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) airbrush_scale_update, &options->pressure);
gtk_widget_show (pressure_scale);
gtk_widget_show (scale);
gtk_widget_show (table);
/* Register this selection options widget with the main tools options dialog */
tools_register_options (AIRBRUSH, vbox);
/* Register this selection options widget with the main tools options dialog
*/
tools_register (AIRBRUSH, vbox, _("Airbrush Options"), reset_airbrush_options);
return options;
}
......
......@@ -45,15 +45,15 @@
#define YB_TEXT 0x20
#define ALL 0xFF
typedef struct _ColorBalance ColorBalance;
/* the color balance structures */
typedef struct _ColorBalance ColorBalance;
struct _ColorBalance
{
int x, y; /* coords for last mouse click */
};
typedef struct _ColorBalanceDialog ColorBalanceDialog;
struct _ColorBalanceDialog
{
GtkWidget *shell;
......@@ -80,8 +80,14 @@ struct _ColorBalanceDialog
gint application_mode;
};
/* color balance action functions */
/* the color balance tool options */
static void *color_balance_options = NULL; /* dummy */
/* the color balance dialog */
static ColorBalanceDialog *color_balance_dialog = NULL;
/* color balance action functions */
static void color_balance_button_press (Tool *, GdkEventButton *, gpointer);
static void color_balance_button_release (Tool *, GdkEventButton *, gpointer);
static void color_balance_motion (Tool *, GdkEventMotion *, gpointer);
......@@ -106,9 +112,6 @@ static void color_balance_cr_text_update (GtkWidget *, gpo
static void color_balance_mg_text_update (GtkWidget *, gpointer);
static void color_balance_yb_text_update (GtkWidget *, gpointer);
static void *color_balance_options = NULL;
static ColorBalanceDialog *color_balance_dialog = NULL;
static void color_balance (PixelRegion *, PixelRegion *, void *);
static Argument * color_balance_invoker (Argument *);
......@@ -248,7 +251,10 @@ tools_new_color_balance ()
/* The tool options */
if (!color_balance_options)
color_balance_options = tools_register_no_options (COLOR_BALANCE, _("Color Balance Options"));
{
tools_register (COLOR_BALANCE, NULL, _("Color Balance Options"), NULL);
color_balance_options = (void *) 1;
}
tool = (Tool *) g_malloc (sizeof (Tool));
private = (ColorBalance *) g_malloc (sizeof (ColorBalance));
......@@ -258,6 +264,7 @@ tools_new_color_balance ()
tool->scroll_lock = 1; /* Disallow scrolling */
tool->private = (void *) private;
tool->auto_snap_to = TRUE;
tool->button_press_func = color_balance_button_press;
tool->button_release_func = color_balance_button_release;
tool->motion_func = color_balance_motion;
......
......@@ -66,15 +66,15 @@
GDK_BUTTON_RELEASE_MASK | \
GDK_BUTTON1_MOTION_MASK
typedef struct _Curves Curves;
/* the curves structures */
typedef struct _Curves Curves;
struct _Curves
{
int x, y; /* coords for last mouse click */
};
typedef struct _CurvesDialog CurvesDialog;
struct _CurvesDialog
{
GtkWidget * shell;
......@@ -104,8 +104,22 @@ struct _CurvesDialog
typedef double CRMatrix[4][4];
/* curves action functions */
/* the curves tool options */
static void *curves_options = NULL; /* dummy */
/* the curves dialog */
static CurvesDialog *curves_dialog = NULL;
static CRMatrix CR_basis =
{
{ -0.5, 1.5, -1.5, 0.5 },
{ 1.0, -2.5, 2.0, -0.5 },
{ -0.5, 0.0, 0.5, 0.0 },
{ 0.0, 1.0, 0.0, 0.0 },
};
/* curves action functions */
static void curves_button_press (Tool *, GdkEventButton *, gpointer);
static void curves_button_release (Tool *, GdkEventButton *, gpointer);
static void curves_motion (Tool *, GdkEventMotion *, gpointer);
......@@ -134,20 +148,10 @@ static gint curves_yrange_events (GtkWidget *, GdkEvent *,
static gint curves_graph_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static void curves_CR_compose (CRMatrix, CRMatrix, CRMatrix);
static void *curves_options = NULL;
static CurvesDialog *curves_dialog = NULL;
static CRMatrix CR_basis =
{
{ -0.5, 1.5, -1.5, 0.5 },
{ 1.0, -2.5, 2.0, -0.5 },
{ -0.5, 0.0, 0.5, 0.0 },
{ 0.0, 1.0, 0.0, 0.0 },
};
static Argument * curves_spline_invoker (Argument *);
static Argument * curves_explicit_invoker (Argument *);
/* curves machinery */
static float
......@@ -354,7 +358,10 @@ tools_new_curves ()
/* The tool options */
if (!curves_options)
curves_options = tools_register_no_options (CURVES, _("Curves Options"));
{
tools_register (CURVES, NULL, _("Curves Options"), NULL);
curves_options = (void *) 1;
}
tool = (Tool *) g_malloc (sizeof (Tool));
private = (Curves *) g_malloc (sizeof (Curves));
......@@ -364,6 +371,7 @@ tools_new_curves ()
tool->scroll_lock = 1; /* Disallow scrolling */
tool->auto_snap_to = TRUE;
tool->private = (void *) private;
tool->button_press_func = curves_button_press;
tool->button_release_func = curves_button_release;
tool->motion_func = curves_motion;
......
......@@ -50,15 +50,15 @@
#define DRAW 0x40
#define ALL 0xFF
typedef struct _HueSaturation HueSaturation;
/* the hue-saturation structures */
typedef struct _HueSaturation HueSaturation;
struct _HueSaturation
{
int x, y; /* coords for last mouse click */
};
typedef struct _HueSaturationDialog HueSaturationDialog;
struct _HueSaturationDialog
{
GtkWidget *shell;
......@@ -82,8 +82,28 @@ struct _HueSaturationDialog
gint preview;
};
/* hue saturation action functions */
/* the hue-saturation tool options */
static void *hue_saturation_options = NULL; /* dummy */
/* the hue-saturation tool dialog */
static HueSaturationDialog *hue_saturation_dialog = NULL;
/* Local variables */
static int hue_transfer[6][256];
static int lightness_transfer[6][256];
static int saturation_transfer[6][256];
static int default_colors[6][3] =
{
{ 255, 0, 0 },
{ 255, 255, 0 },
{ 0, 255, 0 },
{ 0, 255, 255 },
{ 0, 0, 255 },
{ 255, 0, 255 }
};
/* hue saturation action functions */
static void hue_saturation_button_press (Tool *, GdkEventButton *, gpointer);
static void hue_saturation_button_release (Tool *, GdkEventButton *, gpointer);
static void hue_saturation_motion (Tool *, GdkEventMotion *, gpointer);
......@@ -112,25 +132,9 @@ static void hue_saturation_lightness_text_update (GtkWidget *, gpointer);
static void hue_saturation_saturation_text_update (GtkWidget *, gpointer);
static gint hue_saturation_hue_partition_events (GtkWidget *, GdkEvent *, HueSaturationDialog *);
static void *hue_saturation_options = NULL;
static HueSaturationDialog *hue_saturation_dialog = NULL;
static void hue_saturation (PixelRegion *, PixelRegion *, void *);
static Argument * hue_saturation_invoker (Argument *);
/* Local variables */
static int hue_transfer[6][256];
static int lightness_transfer[6][256];
static int saturation_transfer[6][256];
static int default_colors[6][3] =
{
{ 255, 0, 0 },
{ 255, 255, 0 },
{ 0, 255, 0 },
{ 0, 255, 255 },
{ 0, 0, 255 },
{ 255, 0, 255 }
};
/* hue saturation machinery */
......@@ -321,7 +325,10 @@ tools_new_hue_saturation ()
/* The tool options */
if (!hue_saturation_options)
hue_saturation_options = tools_register_no_options (HUE_SATURATION, _("Hue-Saturation Options"));
{
tools_register (HUE_SATURATION, NULL, _("Hue-Saturation Options"), NULL);
hue_saturation_options = (void *) 1;
}
tool = (Tool *) g_malloc (sizeof (Tool));
private = (HueSaturation *) g_malloc (sizeof (HueSaturation));
......@@ -331,6 +338,7 @@ tools_new_hue_saturation ()
tool->scroll_lock = 1; /* Disallow scrolling */
tool->auto_snap_to = TRUE;
tool->private = (void *) private;
tool->button_press_func = hue_saturation_button_press;
tool->button_release_func = hue_saturation_button_release;
tool->motion_func = hue_saturation_motion;
......@@ -468,7 +476,7 @@ hue_saturation_new_dialog ()
hsd);
main_vbox = gtk_vbox_new (FALSE, 2);
gtk_container_border_width (GTK_CONTAINER (main_vbox), 2);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 2);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (hsd->shell)->vbox), main_vbox, TRUE, TRUE, 0);
/* The main hbox containing hue partitions and sliders */
......
......@@ -34,15 +34,15 @@
#define HISTOGRAM_WIDTH 256
#define HISTOGRAM_HEIGHT 150
typedef struct _Threshold Threshold;
/* the threshold structures */
typedef struct _Threshold Threshold;
struct _Threshold
{
int x, y; /* coords for last mouse click */
};
typedef struct _ThresholdDialog ThresholdDialog;
struct _ThresholdDialog
{
GtkWidget *shell;
......@@ -60,8 +60,14 @@ struct _ThresholdDialog
gint preview;
};
/* threshold action functions */
/* the threshold tool options */
static void *threshold_options = NULL; /* dummy */
/* the threshold tool dialog */
static ThresholdDialog *threshold_dialog = NULL;
/* threshold action functions */
static void threshold_button_press (Tool *, GdkEventButton *, gpointer);
static void threshold_button_release (Tool *, GdkEventButton *, gpointer);
static void threshold_motion (Tool *, GdkEventMotion *, gpointer);
......@@ -78,14 +84,12 @@ static void threshold_preview_update (GtkWidget *, gpo
static void threshold_low_threshold_text_update (GtkWidget *, gpointer);
static void threshold_high_threshold_text_update (GtkWidget *, gpointer);
static void *threshold_options = NULL;
static ThresholdDialog *threshold_dialog = NULL;
static void threshold (PixelRegion *, PixelRegion *, void *);
static void threshold_histogram_range (HistogramWidget *, int, int,
void*);
static Argument * threshold_invoker (Argument *);
/* threshold machinery */
static void
......@@ -246,7 +250,10 @@ tools_new_threshold ()
/* The tool options */
if (!threshold_options)
threshold_options = tools_register_no_options (THRESHOLD, _("Threshold Options"));
{
tools_register (THRESHOLD, NULL, _("Threshold Options"), NULL);
threshold_options = (void *) 1;
}
/* The threshold dialog */
if (!threshold_dialog)
......
......@@ -163,6 +163,12 @@ static DrawCore * curCore;
static int ModeEdit = EXTEND_NEW;
static void
bezier_select_reset_options ()
{
reset_selection_options (bezier_options);
}
Tool*
tools_new_bezier_select ()
{
......@@ -171,7 +177,8 @@ tools_new_bezier_select ()
/* The tool options */
if (!bezier_options)
bezier_options = create_selection_options (BEZIER_SELECT);
bezier_options = create_selection_options (BEZIER_SELECT,
bezier_select_reset_options);
tool = g_malloc (sizeof (Tool));
......
This diff is collapsed.
......@@ -219,8 +219,11 @@ tools_new_brightness_contrast ()
/* The tool options */
if (!brightness_contrast_options)
brightness_contrast_options = tools_register_no_options (BRIGHTNESS_CONTRAST,
_("Brightness-Contrast Options"));
{
tools_register (BRIGHTNESS_CONTRAST, NULL,
_("Brightness-Contrast Options"), NULL);
brightness_contrast_options = (void *) 1;
}
tool = (Tool *) g_malloc (sizeof (Tool));
private = (BrightnessContrast *) g_malloc (sizeof (BrightnessContrast));
......@@ -230,6 +233,7 @@ tools_new_brightness_contrast ()
tool->scroll_lock = 1; /* Disallow scrolling */
tool->auto_snap_to = TRUE;
tool->private = (void *) private;
tool->button_press_func = brightness_contrast_button_press;
tool->button_release_func = brightness_contrast_button_release;
tool->motion_func = brightness_contrast_motion;
......@@ -325,7 +329,7 @@ brightness_contrast_new_dialog ()
bcd);
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_border_width (GTK_CONTAINER (vbox), 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (bcd->shell)->vbox), vbox, TRUE, TRUE, 0);
/* The table containing sliders */
......
......@@ -34,7 +34,8 @@
#include "libgimp/gimpintl.h"
/* the Bucket Fill structures */
/* the bucket fill structures */
typedef enum
{
FgColorFill,
......@@ -43,13 +44,40 @@ typedef enum
} FillMode;
typedef struct _BucketTool BucketTool;
struct _BucketTool
{
int target_x; /* starting x coord */
int target_y; /* starting y coord */
};
typedef struct _BucketOptions BucketOptions;
struct _BucketOptions
{
double opacity;
double opacity_d;
GtkObject *opacity_w;
double threshold;
double threshold_d;
GtkObject *threshold_w;
FillMode fill_mode;
FillMode fill_mode_d;
GtkWidget *fill_mode_w;
int paint_mode;
int paint_mode_d;
GtkWidget *paint_mode_w;
int sample_merged;
int sample_merged_d;
GtkWidget *sample_merged_w;
};
/* bucket fill tool options */
static BucketOptions *bucket_options = NULL;
/* local function prototypes */
static void bucket_fill_button_press (Tool *, GdkEventButton *, gpointer);
static void bucket_fill_button_release (Tool *, GdkEventButton *, gpointer);
......@@ -70,20 +98,7 @@ static void bucket_fill_line_pattern (unsigned char *, unsigned char *,
static Argument *bucket_fill_invoker (Argument *);
typedef struct _BucketOptions BucketOptions;
struct _BucketOptions
{
double opacity;
double threshold;
FillMode fill_mode;
int paint_mode;
int sample_merged;
};
/* local variables */
static BucketOptions *bucket_options = NULL;
/* functions */
static void
bucket_fill_toggle_update (GtkWidget *widget,
......@@ -123,24 +138,37 @@ bucket_fill_paint_mode_callback (GtkWidget *w,
bucket_options->paint_mode = (long) client_data;
}
static void
reset_bucket_options (void)
{
BucketOptions *options = bucket_options;
options->paint_mode = options->paint_mode_d;
gtk_option_menu_set_history (GTK_OPTION_MENU (options->paint_mode_w), 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->sample_merged_w),
options->sample_merged_d);
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->opacity_w),
options->opacity_d);