Commit 3db3dff4 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/base/Makefile.am app/base/base-enums.c app/core/Makefile.am

2002-03-19  Sven Neumann  <sven@gimp.org>

	* app/base/Makefile.am
	* app/base/base-enums.c
	* app/core/Makefile.am
	* app/core/core-enums.c
	* app/widgets/Makefile.am
	* app/widgets/widgets-enums.c: purely cosmetic change.

	* app/paint/Makefile.am
	* app/paint/paint-enums.[ch]: generate paint-enums.c with registered
	enums. Skip GIMP_BRUSH_PRESSURE and GIMP_CUSTOM_CONVOLVE so they
	don't get exported to libgimp and are not registered as enum values.

	* tools/pdbgen/pdb/paint_tools.pdb: removed special casing of
	GimpBrushApplicationMode and GimpConvolveType since the forbidden
	values are now skipped anyway.

	* libgimp/gimpcompat.h: removed compat defines for the forbidden
	enum values. They shouldn't have been used.

	* app/tools/Makefile.am
	* app/tools/tools-enums.[ch]: generate tools-enums.c with registered
	enums.

	* libgimp/gimpenums.h
	* plug-ins/script-fu/script-fu-constants.c
	* tools/pdbgen/enums.pl: regenerated.

	* app/paint/gimpclone.[ch]
	* app/paint/gimpconvolve.h
	* app/paint/gimpdodgeburn.h
	* app/tools/gimpclonetool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpcroptool.[ch]
	* app/tools/gimpdodgeburntool.c
	* app/tools/paint_options.c: changed accordingly. Added more enum
	radio frames and enum option menus.
parent 490e33cc
2002-03-19 Sven Neumann <sven@gimp.org>
* app/base/Makefile.am
* app/base/base-enums.c
* app/core/Makefile.am
* app/core/core-enums.c
* app/widgets/Makefile.am
* app/widgets/widgets-enums.c: purely cosmetic change.
* app/paint/Makefile.am
* app/paint/paint-enums.[ch]: generate paint-enums.c with registered
enums. Skip GIMP_BRUSH_PRESSURE and GIMP_CUSTOM_CONVOLVE so they
don't get exported to libgimp and are not registered as enum values.
* tools/pdbgen/pdb/paint_tools.pdb: removed special casing of
GimpBrushApplicationMode and GimpConvolveType since the forbidden
values are now skipped anyway.
* libgimp/gimpcompat.h: removed compat defines for the forbidden
enum values. They shouldn't have been used.
* app/tools/Makefile.am
* app/tools/tools-enums.[ch]: generate tools-enums.c with registered
enums.
* libgimp/gimpenums.h
* plug-ins/script-fu/script-fu-constants.c
* tools/pdbgen/enums.pl: regenerated.
* app/paint/gimpclone.[ch]
* app/paint/gimpconvolve.h
* app/paint/gimpdodgeburn.h
* app/tools/gimpclonetool.c
* app/tools/gimpconvolvetool.c
* app/tools/gimpcroptool.[ch]
* app/tools/gimpdodgeburntool.c
* app/tools/paint_options.c: changed accordingly. Added more enum
radio frames and enum option menus.
2002-03-19 Sven Neumann <sven@gimp.org>
* ChangeLog.plug-ins
......
......@@ -69,7 +69,7 @@ CLEANFILES = $(gen_sources)
$(srcdir)/base-enums.c: $(srcdir)/base-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"base-enums.h\"\n#include\"libgimp/gimpintl.h\"" \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"base-enums.h\"\n#include \"libgimp/gimpintl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "\nstatic const GEnumValue @enum_name@_enum_values[] =\n{" \
--vprod " { @VALUENAME@, @valuedesc@, \"@valuenick@\" }," \
......
......@@ -4,7 +4,7 @@
#include "config.h"
#include <glib-object.h>
#include "base-enums.h"
#include"libgimp/gimpintl.h"
#include "libgimp/gimpintl.h"
/* enumerations from "./base-enums.h" */
......
......@@ -196,7 +196,7 @@ $(srcdir)/gimpmarshal.c: $(srcdir)/gimpmarshal.h
$(srcdir)/core-enums.c: $(srcdir)/core-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"core-enums.h\"\n#include\"libgimp/gimpintl.h\"" \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"core-enums.h\"\n#include \"libgimp/gimpintl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "\nstatic const GEnumValue @enum_name@_enum_values[] =\n{" \
--vprod " { @VALUENAME@, @valuedesc@, \"@valuenick@\" }," \
......
......@@ -4,7 +4,7 @@
#include "config.h"
#include <glib-object.h>
#include "core-enums.h"
#include"libgimp/gimpintl.h"
#include "libgimp/gimpintl.h"
/* enumerations from "./core-enums.h" */
......
......@@ -4,6 +4,7 @@ noinst_LIBRARIES = libapppaint.a
libapppaint_a_SOURCES = @STRIP_BEGIN@ \
paint-enums.h \
paint-enums.c \
paint-types.h \
paint.c \
paint.h \
......@@ -47,3 +48,21 @@ INCLUDES = @STRIP_BEGIN@ \
$(PANGOFT2_CFLAGS) \
-I$(includedir) \
@STRIP_END@
#
# rules to generate built sources
#
# setup autogeneration dependancies
gen_sources = xgen-pec
CLEANFILES = $(gen_sources)
$(srcdir)/paint-enums.c: $(srcdir)/paint-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"paint-enums.h\"\n#include \"libgimp/gimpintl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "\nstatic const GEnumValue @enum_name@_enum_values[] =\n{" \
--vprod " { @VALUENAME@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n};\n\nGType\n@enum_name@_get_type (void)\n{\n static GType enum_type = 0;\n\n if (!enum_type)\n enum_type = g_enum_register_static (\"@EnumName@\", @enum_name@_enum_values);\n\n return enum_type;\n}\n" \
$(srcdir)/paint-enums.h > xgen-pec \
&& cp xgen-pec $(@F) \
&& rm -f xgen-pec
......@@ -206,7 +206,7 @@ gimp_clone_paint (GimpPaintCore *paint_core,
dest_x = paint_core->cur_coords.x;
dest_y = paint_core->cur_coords.y;
if (options->aligned == ALIGN_REGISTERED)
if (options->aligned == GIMP_CLONE_ALIGN_REGISTERED)
{
offset_x = 0;
offset_y = 0;
......@@ -238,7 +238,7 @@ gimp_clone_paint (GimpPaintCore *paint_core,
clone->src_y = paint_core->cur_coords.y;
first = TRUE;
}
else if (options->aligned == ALIGN_NO)
else if (options->aligned == GIMP_CLONE_ALIGN_NO)
{
first = TRUE;
orig_src_x = clone->src_x;
......@@ -257,7 +257,7 @@ gimp_clone_paint (GimpPaintCore *paint_core,
if (clone->finish_callback)
clone->finish_callback (clone, clone->callback_data);
if (options->aligned == ALIGN_NO && !first)
if (options->aligned == GIMP_CLONE_ALIGN_NO && !first)
{
clone->src_x = orig_src_x;
clone->src_y = orig_src_y;
......@@ -560,7 +560,7 @@ gimp_clone_set_src_drawable (GimpClone *clone,
/* paint options stuff */
#define CLONE_DEFAULT_TYPE GIMP_IMAGE_CLONE
#define CLONE_DEFAULT_ALIGNED ALIGN_NO
#define CLONE_DEFAULT_ALIGNED GIMP_CLONE_ALIGN_NO
GimpCloneOptions *
gimp_clone_options_new (void)
......
......@@ -24,14 +24,6 @@
#include "gimppaintoptions.h"
typedef enum /*< skip >*/ /*< pdb-skip >*/
{
ALIGN_NO,
ALIGN_YES,
ALIGN_REGISTERED
} AlignType;
#define GIMP_TYPE_CLONE (gimp_clone_get_type ())
#define GIMP_CLONE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CLONE, GimpClone))
#define GIMP_CLONE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CLONE, GimpCloneClass))
......@@ -75,15 +67,15 @@ typedef struct _GimpCloneOptions GimpCloneOptions;
struct _GimpCloneOptions
{
GimpPaintOptions paint_options;
GimpPaintOptions paint_options;
GimpCloneType type;
GimpCloneType type_d;
GtkWidget *type_w[2]; /* 2 radio buttons */
GimpCloneType type;
GimpCloneType type_d;
GtkWidget *type_w;
AlignType aligned;
AlignType aligned_d;
GtkWidget *aligned_w[3]; /* 3 radio buttons */
GimpCloneAlignMode aligned;
GimpCloneAlignMode aligned_d;
GtkWidget *aligned_w;
};
......
......@@ -54,7 +54,7 @@ struct _GimpConvolveOptions
GimpConvolveType type;
GimpConvolveType type_d;
GtkWidget *type_w[2];
GtkWidget *type_w;
gdouble rate;
gdouble rate_d;
......
......@@ -396,7 +396,7 @@ gimp_dodgeburn_shadows_lut_func (gpointer user_data,
#define DODGEBURN_DEFAULT_EXPOSURE 50.0
#define DODGEBURN_DEFAULT_TYPE GIMP_DODGE
#define DODGEBURN_DEFAULT_MODE GIMP_HIGHLIGHTS
#define DODGEBURN_DEFAULT_MODE GIMP_MIDTONES
GimpDodgeBurnOptions *
gimp_dodgeburn_options_new (void)
......
......@@ -53,7 +53,7 @@ struct _GimpDodgeBurnOptions
GimpDodgeBurnType type;
GimpDodgeBurnType type_d;
GtkWidget *type_w[2];
GtkWidget *type_w;
GimpTransferMode mode; /*highlights, midtones, shadows*/
GimpTransferMode mode_d;
......
......@@ -206,7 +206,7 @@ gimp_clone_paint (GimpPaintCore *paint_core,
dest_x = paint_core->cur_coords.x;
dest_y = paint_core->cur_coords.y;
if (options->aligned == ALIGN_REGISTERED)
if (options->aligned == GIMP_CLONE_ALIGN_REGISTERED)
{
offset_x = 0;
offset_y = 0;
......@@ -238,7 +238,7 @@ gimp_clone_paint (GimpPaintCore *paint_core,
clone->src_y = paint_core->cur_coords.y;
first = TRUE;
}
else if (options->aligned == ALIGN_NO)
else if (options->aligned == GIMP_CLONE_ALIGN_NO)
{
first = TRUE;
orig_src_x = clone->src_x;
......@@ -257,7 +257,7 @@ gimp_clone_paint (GimpPaintCore *paint_core,
if (clone->finish_callback)
clone->finish_callback (clone, clone->callback_data);
if (options->aligned == ALIGN_NO && !first)
if (options->aligned == GIMP_CLONE_ALIGN_NO && !first)
{
clone->src_x = orig_src_x;
clone->src_y = orig_src_y;
......@@ -560,7 +560,7 @@ gimp_clone_set_src_drawable (GimpClone *clone,
/* paint options stuff */
#define CLONE_DEFAULT_TYPE GIMP_IMAGE_CLONE
#define CLONE_DEFAULT_ALIGNED ALIGN_NO
#define CLONE_DEFAULT_ALIGNED GIMP_CLONE_ALIGN_NO
GimpCloneOptions *
gimp_clone_options_new (void)
......
......@@ -24,14 +24,6 @@
#include "gimppaintoptions.h"
typedef enum /*< skip >*/ /*< pdb-skip >*/
{
ALIGN_NO,
ALIGN_YES,
ALIGN_REGISTERED
} AlignType;
#define GIMP_TYPE_CLONE (gimp_clone_get_type ())
#define GIMP_CLONE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CLONE, GimpClone))
#define GIMP_CLONE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CLONE, GimpCloneClass))
......@@ -75,15 +67,15 @@ typedef struct _GimpCloneOptions GimpCloneOptions;
struct _GimpCloneOptions
{
GimpPaintOptions paint_options;
GimpPaintOptions paint_options;
GimpCloneType type;
GimpCloneType type_d;
GtkWidget *type_w[2]; /* 2 radio buttons */
GimpCloneType type;
GimpCloneType type_d;
GtkWidget *type_w;
AlignType aligned;
AlignType aligned_d;
GtkWidget *aligned_w[3]; /* 3 radio buttons */
GimpCloneAlignMode aligned;
GimpCloneAlignMode aligned_d;
GtkWidget *aligned_w;
};
......
/* Generated data (by gimp-mkenums) */
#include "config.h"
#include <glib-object.h>
#include "paint-enums.h"
#include "libgimp/gimpintl.h"
/* enumerations from "./paint-enums.h" */
static const GEnumValue gimp_clone_type_enum_values[] =
{
{ GIMP_IMAGE_CLONE, N_("Image Source"), "image-clone" },
{ GIMP_PATTERN_CLONE, N_("Pattern Source"), "pattern-clone" },
{ 0, NULL, NULL }
};
GType
gimp_clone_type_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpCloneType", gimp_clone_type_enum_values);
return enum_type;
}
static const GEnumValue gimp_clone_align_mode_enum_values[] =
{
{ GIMP_CLONE_ALIGN_NO, N_("Non Aligned"), "no" },
{ GIMP_CLONE_ALIGN_YES, N_("Aligned"), "yes" },
{ GIMP_CLONE_ALIGN_REGISTERED, N_("Registered"), "registered" },
{ 0, NULL, NULL }
};
GType
gimp_clone_align_mode_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpCloneAlignMode", gimp_clone_align_mode_enum_values);
return enum_type;
}
static const GEnumValue gimp_dodge_burn_type_enum_values[] =
{
{ GIMP_DODGE, N_("Dodge"), "dodge" },
{ GIMP_BURN, N_("Burn"), "burn" },
{ 0, NULL, NULL }
};
GType
gimp_dodge_burn_type_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpDodgeBurnType", gimp_dodge_burn_type_enum_values);
return enum_type;
}
static const GEnumValue gimp_gradient_paint_mode_enum_values[] =
{
{ GIMP_GRADIENT_ONCE_FORWARD, N_("Once Forward"), "once-forward" },
{ GIMP_GRADIENT_ONCE_BACKWARD, N_("Once Backward"), "once-backward" },
{ GIMP_GRADIENT_LOOP_SAWTOOTH, N_("Loop Sawtooth"), "loop-sawtooth" },
{ GIMP_GRADIENT_LOOP_TRIANGLE, N_("Loop Triangle"), "loop-triangle" },
{ 0, NULL, NULL }
};
GType
gimp_gradient_paint_mode_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpGradientPaintMode", gimp_gradient_paint_mode_enum_values);
return enum_type;
}
static const GEnumValue gimp_convolve_type_enum_values[] =
{
{ GIMP_BLUR_CONVOLVE, N_("Blur"), "blur-convolve" },
{ GIMP_SHARPEN_CONVOLVE, N_("Sharpen"), "sharpen-convolve" },
{ 0, NULL, NULL }
};
GType
gimp_convolve_type_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpConvolveType", gimp_convolve_type_enum_values);
return enum_type;
}
/* Generated data ends here */
......@@ -32,49 +32,85 @@
#endif
/*
* non-registered enums; register them if needed
/*
* these enums that are registered with the type system
*/
typedef enum /*< skip >*/
#define GIMP_TYPE_CLONE_TYPE (gimp_clone_type_get_type ())
GType gimp_clone_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_BRUSH_HARD, /* pencil */
GIMP_BRUSH_SOFT, /* paintbrush */
GIMP_BRUSH_PRESSURE /* paintbrush with variable pressure */
} GimpBrushApplicationMode;
GIMP_IMAGE_CLONE, /*< desc="Image Source" >*/
GIMP_PATTERN_CLONE /*< desc="Pattern Source" >*/
} GimpCloneType;
typedef enum /*< skip >*/
#define GIMP_TYPE_CLONE_ALIGN_MODE (gimp_clone_align_mode_get_type ())
GType gimp_clone_align_mode_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_PAINT_CONSTANT, /* pencil, paintbrush, airbrush, clone */
GIMP_PAINT_INCREMENTAL /* convolve, smudge */
} GimpPaintApplicationMode;
GIMP_CLONE_ALIGN_NO, /*< desc="Non Aligned" >*/
GIMP_CLONE_ALIGN_YES, /*< desc="Aligned" >*/
GIMP_CLONE_ALIGN_REGISTERED /*< desc="Registered" >*/
} GimpCloneAlignMode;
typedef enum /*< skip >*/
#define GIMP_TYPE_DODGE_BURN_TYPE (gimp_dodge_burn_type_get_type ())
GType gimp_dodge_burn_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_GRADIENT_ONCE_FORWARD,
GIMP_GRADIENT_ONCE_BACKWARD,
GIMP_GRADIENT_LOOP_SAWTOOTH,
GIMP_GRADIENT_LOOP_TRIANGLE
GIMP_DODGE, /*< desc="Dodge" >*/
GIMP_BURN /*< desc="Burn" >*/
} GimpDodgeBurnType;
#define GIMP_TYPE_GRADIENT_PAINT_MODE (gimp_gradient_paint_mode_get_type ())
GType gimp_gradient_paint_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_GRADIENT_ONCE_FORWARD, /*< desc="Once Forward" >*/
GIMP_GRADIENT_ONCE_BACKWARD, /*< desc="Once Backward" >*/
GIMP_GRADIENT_LOOP_SAWTOOTH, /*< desc="Loop Sawtooth" >*/
GIMP_GRADIENT_LOOP_TRIANGLE /*< desc="Loop Triangle" >*/
} GimpGradientPaintMode;
typedef enum /*< skip >*/
#define GIMP_TYPE_CONVOLVE_TYPE (gimp_convolve_type_get_type ())
GType gimp_convolve_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_DODGE,
GIMP_BURN
} GimpDodgeBurnType;
GIMP_BLUR_CONVOLVE, /*< desc="Blur" >*/
GIMP_SHARPEN_CONVOLVE, /*< desc="Sharpen" >*/
GIMP_CUSTOM_CONVOLVE /*< skip >*/
} GimpConvolveType;
/*
* non-registered enums; register them if needed
*/
typedef enum /*< skip >*/
{
GIMP_BLUR_CONVOLVE,
GIMP_SHARPEN_CONVOLVE,
GIMP_CUSTOM_CONVOLVE
} GimpConvolveType;
GIMP_BRUSH_HARD,
GIMP_BRUSH_SOFT,
GIMP_BRUSH_PRESSURE /*< skip >*/
} GimpBrushApplicationMode;
typedef enum /*< skip >*/
{
GIMP_IMAGE_CLONE,
GIMP_PATTERN_CLONE
} GimpCloneType;
GIMP_PAINT_CONSTANT,
GIMP_PAINT_INCREMENTAL
} GimpPaintApplicationMode;
#endif /* __PAINT_ENUMS_H__ */
......@@ -4,6 +4,7 @@ noinst_LIBRARIES = libapptools.a
libapptools_a_SOURCES = @STRIP_BEGIN@ \
tools-enums.h \
tools-enums.c \
tools-types.h \
tools.c \
tools.h \
......@@ -137,3 +138,21 @@ INCLUDES = @STRIP_BEGIN@ \
$(PANGOFT2_CFLAGS) \
-I$(includedir) \
@STRIP_END@
#
# rules to generate built sources
#
# setup autogeneration dependancies
gen_sources = xgen-tec
CLEANFILES = $(gen_sources)
$(srcdir)/tools-enums.c: $(srcdir)/tools-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"tools-enums.h\"\n#include \"libgimp/gimpintl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "\nstatic const GEnumValue @enum_name@_enum_values[] =\n{" \
--vprod " { @VALUENAME@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n};\n\nGType\n@enum_name@_get_type (void)\n{\n static GType enum_type = 0;\n\n if (!enum_type)\n enum_type = g_enum_register_static (\"@EnumName@\", @enum_name@_enum_values);\n\n return enum_type;\n}\n" \
$(srcdir)/tools-enums.h > xgen-tec \
&& cp xgen-tec $(@F) \
&& rm -f xgen-tec
......@@ -33,6 +33,8 @@
#include "display/gimpdisplay.h"
#include "widgets/gimpenummenu.h"
#include "gimpclonetool.h"
#include "paint_options.h"
......@@ -367,42 +369,26 @@ clone_options_new (GimpToolInfo *tool_info)
/* the main vbox */
vbox = ((GimpToolOptions *) options)->main_vbox;
frame = gimp_radio_group_new2 (TRUE, _("Source"),
G_CALLBACK (gimp_radio_button_update),
&options->type,
GINT_TO_POINTER (options->type),
_("Image Source"),
GINT_TO_POINTER (GIMP_IMAGE_CLONE),
&options->type_w[0],
_("Pattern Source"),
GINT_TO_POINTER (GIMP_PATTERN_CLONE),
&options->type_w[1],
NULL);
frame = gimp_enum_radio_frame_new (GIMP_TYPE_CLONE_TYPE,
gtk_label_new (_("Source")),
2,
G_CALLBACK (gimp_radio_button_update),
&options->type,
&options->type_w);
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w),
GINT_TO_POINTER (options->type));
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
frame = gimp_radio_group_new2 (TRUE, _("Alignment"),
G_CALLBACK (gimp_radio_button_update),
&options->aligned,
GINT_TO_POINTER (options->aligned),
_("Non Aligned"),
GINT_TO_POINTER (ALIGN_NO),
&options->aligned_w[0],
_("Aligned"),
GINT_TO_POINTER (ALIGN_YES),
&options->aligned_w[1],
_("Registered"),
GINT_TO_POINTER (ALIGN_REGISTERED),
&options->aligned_w[2],
NULL);
frame = gimp_enum_radio_frame_new (GIMP_TYPE_CLONE_ALIGN_MODE,
gtk_label_new (_("Alignment")),
2,
G_CALLBACK (gimp_radio_button_update),
&options->aligned,
&options->aligned_w);
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->aligned_w),
GINT_TO_POINTER (options->aligned));
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
......@@ -419,8 +405,8 @@ clone_options_reset (GimpToolOptions *tool_options)
paint_options_reset (tool_options);
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w[0]),
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w),
GINT_TO_POINTER (options->type_d));
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->aligned_w[0]),
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->aligned_w),
GINT_TO_POINTER (options->aligned_d));
}
......@@ -39,6 +39,8 @@
#include "paint/gimpconvolve.h"
#include "widgets/gimpenummenu.h"
#include "gimpconvolvetool.h"
#include "paint_options.h"
......@@ -167,11 +169,11 @@ gimp_convolve_tool_modifier_key (GimpTool *tool,
switch (options->type)
{
case GIMP_BLUR_CONVOLVE:
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w[0]),
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w),
GINT_TO_POINTER (GIMP_SHARPEN_CONVOLVE));
break;
case GIMP_SHARPEN_CONVOLVE:
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w[0]),
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w),
GINT_TO_POINTER (GIMP_BLUR_CONVOLVE));
break;
default:
......@@ -215,20 +217,14 @@ convolve_options_new (GimpToolInfo *tool_info)
/* the main vbox */
vbox = ((GimpToolOptions *) options)->main_vbox;
frame = gimp_radio_group_new2 (TRUE, _("Convolve Type (<Ctrl>)"),
G_CALLBACK (gimp_radio_button_update),
&options->type,
GINT_TO_POINTER (options->type),
_("Blur"),
GINT_TO_POINTER (GIMP_BLUR_CONVOLVE),
&options->type_w[0],
_("Sharpen"),
GINT_TO_POINTER (GIMP_SHARPEN_CONVOLVE),
&options->type_w[1],
NULL);
frame = gimp_enum_radio_frame_new (GIMP_TYPE_CONVOLVE_TYPE,
gtk_label_new (_("Convolve Type (<Ctrl>)")),
2,
G_CALLBACK (gimp_radio_button_update),
&options->type,
&options->type_w);
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w),
GINT_TO_POINTER (options->type));
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
......@@ -265,6 +261,6 @@ convolve_options_reset (GimpToolOptions *tool_options)
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->rate_w),
options->rate_d);
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w[0]),
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w),
GINT_TO_POINTER (options->type_d));
}
......@@ -40,6 +40,8 @@
#include "gui/info-dialog.h"
#include "widgets/gimpenummenu.h"
#include "gimpcroptool.h"
#include "tool_manager.h"
#include "tool_options.h"
......@@ -70,17 +72,17 @@ struct _CropOptions
{
GimpToolOptions tool_options;
gboolean layer_only;
gboolean layer_only_d;
GtkWidget *layer_only_w;
gboolean layer_only;
gboolean layer_only_d;
GtkWidget *layer_only_w;
gboolean allow_enlarge;
gboolean allow_enlarge_d;
GtkWidget *allow_enlarge_w;
gboolean allow_enlarge;
gboolean allow_enlarge_d;
GtkWidget *allow_enlarge_w;
CropType type;
CropType type_d;
GtkWidget *type_w[2];
GimpCropType type;
GimpCropType type_d;
GtkWidget *type_w;
};
......@@ -414,7 +416,7 @@ gimp_crop_tool_button_release (GimpTool *tool,
{
if (crop->function == CROPPING)
{
if (options->type == CROP_CROP)
if (options->type == GIMP_CROP)
crop_tool_crop_image (gdisp->gimage,
crop->x1, crop->y1,
crop->x2, crop->y2,
......@@ -691,13 +693,13 @@ gimp_crop_tool_modifier_key (GimpTool *tool,
{
switch (options->type)
{
case CROP_CROP:
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w[0]),
GINT_TO_POINTER (RESIZE_CROP));
case GIMP_CROP:
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w),
GINT_TO_POINTER (GIMP_RESIZE));
break;
case RESIZE_CROP:
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w[0]),
GINT_TO_POINTER (CROP_CROP));
case GIMP_RESIZE:
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w),
GINT_TO_POINTER (GIMP_CROP));
break;
default: