simplified everything a lot by merging the public GimpContextPropType enum

2003-02-09  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpcontext.[ch]: simplified everything a lot by
	merging the public GimpContextPropType enum with the internal
	anonymous object property id enum. Removed the internal copy_prop
	functions and handle property copying in a big switch() in
	gimp_context_copy_property(). Removed the separate signal
	connections for each property of the parent context and do the
	same using a single "notify" handler. Emit "notify" signals all
	over the place.  Removed internal arrays which are no longer
	needed due to enum merge and copy_property simplification.
	Removed the array of signal names and use g_signal_name().
	Removed gimp_context_unset_parent() and allow "parent" being NULL
	in gimp_context_set_parent().

	* app/tools/tool_manager.c
	* app/widgets/gimpdevices.c: changed accordingly.

	* libgimptool/gimptooltypes.h: changed GimpToolOptionsGUIFunc to
	return a GtkWidget (the created tool options widget).

	* libgimptool/gimptoolmodule.c: #include <gtk/gtk.h>

	* app/tools/tool_options.[ch]: removed the "main_vbox" from the
	GimpToolOptions struct. Changed gimp_tool_options_gui() to create
	and return the main_vbox.

	* app/tools/tool_manager.c: create the "This Tool has no Options"
	label here if NULL was passed as "options_gui_func". Attach the
	options widget to the tool_options object using
	g_object_set_data().

	* app/gui/tool-options-dialog.c: changed accordingly.

	* app/tools/gimpairbrushtool.c
	* app/tools/gimpblendoptions.[ch]
	* app/tools/gimpbucketfilloptions.[ch]
	* app/tools/gimpclonetool.c
	* app/tools/gimpcolorpickeroptions.[ch]
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpcropoptions.[ch]
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimperasertool.c
	* app/tools/gimpflipoptions.[ch]
	* app/tools/gimpinkoptions.[ch]
	* app/tools/gimpmagnifyoptions.[ch]
	* app/tools/gimpmeasureoptions.[ch]
	* app/tools/gimpmoveoptions.[ch]
	* app/tools/gimpselectionoptions.[ch]
	* app/tools/gimpsmudgetool.c
	* app/tools/gimptextoptions.[ch]
	* app/tools/gimptransformoptions.[ch]
	* app/tools/gimpvectoroptions.[ch]
	* app/tools/paint_options.[ch]: return the options vbox from
	all tool_options_gui functions.
This commit is contained in:
Michael Natterer
2003-02-09 17:32:52 +00:00
committed by Michael Natterer
parent 91abc8caf5
commit eb6e907b36
54 changed files with 597 additions and 597 deletions

View File

@ -1,3 +1,59 @@
2003-02-09 Michael Natterer <mitch@gimp.org>
* app/core/gimpcontext.[ch]: simplified everything a lot by
merging the public GimpContextPropType enum with the internal
anonymous object property id enum. Removed the internal copy_prop
functions and handle property copying in a big switch() in
gimp_context_copy_property(). Removed the separate signal
connections for each property of the parent context and do the
same using a single "notify" handler. Emit "notify" signals all
over the place. Removed internal arrays which are no longer
needed due to enum merge and copy_property simplification.
Removed the array of signal names and use g_signal_name().
Removed gimp_context_unset_parent() and allow "parent" being NULL
in gimp_context_set_parent().
* app/tools/tool_manager.c
* app/widgets/gimpdevices.c: changed accordingly.
* libgimptool/gimptooltypes.h: changed GimpToolOptionsGUIFunc to
return a GtkWidget (the created tool options widget).
* libgimptool/gimptoolmodule.c: #include <gtk/gtk.h>
* app/tools/tool_options.[ch]: removed the "main_vbox" from the
GimpToolOptions struct. Changed gimp_tool_options_gui() to create
and return the main_vbox.
* app/tools/tool_manager.c: create the "This Tool has no Options"
label here if NULL was passed as "options_gui_func". Attach the
options widget to the tool_options object using
g_object_set_data().
* app/gui/tool-options-dialog.c: changed accordingly.
* app/tools/gimpairbrushtool.c
* app/tools/gimpblendoptions.[ch]
* app/tools/gimpbucketfilloptions.[ch]
* app/tools/gimpclonetool.c
* app/tools/gimpcolorpickeroptions.[ch]
* app/tools/gimpconvolvetool.c
* app/tools/gimpcropoptions.[ch]
* app/tools/gimpdodgeburntool.c
* app/tools/gimperasertool.c
* app/tools/gimpflipoptions.[ch]
* app/tools/gimpinkoptions.[ch]
* app/tools/gimpmagnifyoptions.[ch]
* app/tools/gimpmeasureoptions.[ch]
* app/tools/gimpmoveoptions.[ch]
* app/tools/gimpselectionoptions.[ch]
* app/tools/gimpsmudgetool.c
* app/tools/gimptextoptions.[ch]
* app/tools/gimptransformoptions.[ch]
* app/tools/gimpvectoroptions.[ch]
* app/tools/paint_options.[ch]: return the options vbox from
all tool_options_gui functions.
2003-02-08 Sven Neumann <sven@gimp.org> 2003-02-08 Sven Neumann <sven@gimp.org>
* app/text/gimptext.c * app/text/gimptext.c

File diff suppressed because it is too large Load Diff

View File

@ -28,37 +28,40 @@
typedef enum typedef enum
{ {
GIMP_CONTEXT_PROP_IMAGE, GIMP_CONTEXT_FIRST_PROP = 2,
GIMP_CONTEXT_PROP_DISPLAY,
GIMP_CONTEXT_PROP_TOOL, GIMP_CONTEXT_PROP_IMAGE = GIMP_CONTEXT_FIRST_PROP,
GIMP_CONTEXT_PROP_FOREGROUND, GIMP_CONTEXT_PROP_DISPLAY = 3,
GIMP_CONTEXT_PROP_BACKGROUND, GIMP_CONTEXT_PROP_TOOL = 4,
GIMP_CONTEXT_PROP_OPACITY, GIMP_CONTEXT_PROP_FOREGROUND = 5,
GIMP_CONTEXT_PROP_PAINT_MODE, GIMP_CONTEXT_PROP_BACKGROUND = 6,
GIMP_CONTEXT_PROP_BRUSH, GIMP_CONTEXT_PROP_OPACITY = 7,
GIMP_CONTEXT_PROP_PATTERN, GIMP_CONTEXT_PROP_PAINT_MODE = 8,
GIMP_CONTEXT_PROP_GRADIENT, GIMP_CONTEXT_PROP_BRUSH = 9,
GIMP_CONTEXT_PROP_PALETTE, GIMP_CONTEXT_PROP_PATTERN = 10,
GIMP_CONTEXT_PROP_BUFFER, GIMP_CONTEXT_PROP_GRADIENT = 11,
GIMP_CONTEXT_PROP_IMAGEFILE, GIMP_CONTEXT_PROP_PALETTE = 12,
GIMP_CONTEXT_NUM_PROPS GIMP_CONTEXT_PROP_BUFFER = 13,
GIMP_CONTEXT_PROP_IMAGEFILE = 14,
GIMP_CONTEXT_LAST_PROP = GIMP_CONTEXT_PROP_IMAGEFILE
} GimpContextPropType; } GimpContextPropType;
typedef enum typedef enum
{ {
GIMP_CONTEXT_IMAGE_MASK = 1 << 0, GIMP_CONTEXT_IMAGE_MASK = 1 << 2,
GIMP_CONTEXT_DISPLAY_MASK = 1 << 1, GIMP_CONTEXT_DISPLAY_MASK = 1 << 3,
GIMP_CONTEXT_TOOL_MASK = 1 << 2, GIMP_CONTEXT_TOOL_MASK = 1 << 4,
GIMP_CONTEXT_FOREGROUND_MASK = 1 << 3, GIMP_CONTEXT_FOREGROUND_MASK = 1 << 5,
GIMP_CONTEXT_BACKGROUND_MASK = 1 << 4, GIMP_CONTEXT_BACKGROUND_MASK = 1 << 6,
GIMP_CONTEXT_OPACITY_MASK = 1 << 5, GIMP_CONTEXT_OPACITY_MASK = 1 << 7,
GIMP_CONTEXT_PAINT_MODE_MASK = 1 << 6, GIMP_CONTEXT_PAINT_MODE_MASK = 1 << 8,
GIMP_CONTEXT_BRUSH_MASK = 1 << 7, GIMP_CONTEXT_BRUSH_MASK = 1 << 9,
GIMP_CONTEXT_PATTERN_MASK = 1 << 8, GIMP_CONTEXT_PATTERN_MASK = 1 << 10,
GIMP_CONTEXT_GRADIENT_MASK = 1 << 9, GIMP_CONTEXT_GRADIENT_MASK = 1 << 11,
GIMP_CONTEXT_PALETTE_MASK = 1 << 10, GIMP_CONTEXT_PALETTE_MASK = 1 << 12,
GIMP_CONTEXT_BUFFER_MASK = 1 << 11, GIMP_CONTEXT_BUFFER_MASK = 1 << 13,
GIMP_CONTEXT_IMAGEFILE_MASK = 1 << 12, GIMP_CONTEXT_IMAGEFILE_MASK = 1 << 14,
/* aliases */ /* aliases */
GIMP_CONTEXT_PAINT_PROPS_MASK = (GIMP_CONTEXT_FOREGROUND_MASK | GIMP_CONTEXT_PAINT_PROPS_MASK = (GIMP_CONTEXT_FOREGROUND_MASK |
@ -174,7 +177,6 @@ void gimp_context_set_name (GimpContext *context,
GimpContext * gimp_context_get_parent (const GimpContext *context); GimpContext * gimp_context_get_parent (const GimpContext *context);
void gimp_context_set_parent (GimpContext *context, void gimp_context_set_parent (GimpContext *context,
GimpContext *parent); GimpContext *parent);
void gimp_context_unset_parent (GimpContext *context);
/* define / undefinine context properties /* define / undefinine context properties
* *

View File

@ -113,7 +113,6 @@ static void
gimp_tool_options_init (GimpToolOptions *options) gimp_tool_options_init (GimpToolOptions *options)
{ {
options->tool_info = NULL; options->tool_info = NULL;
options->main_vbox = gtk_vbox_new (FALSE, 2);
} }
static void static void
@ -226,13 +225,12 @@ gimp_tool_options_deserialize (GimpToolOptions *tool_options,
return retval; return retval;
} }
void gpointer
gimp_tool_options_gui (GimpToolOptions *tool_options) gimp_tool_options_gui (GimpToolOptions *tool_options)
{ {
GtkWidget *label; GtkWidget *vbox;
label = gtk_label_new (_("This tool has no options.")); vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (tool_options->main_vbox), label,
FALSE, FALSE, 6); return vbox;
gtk_widget_show (label);
} }

View File

@ -38,8 +38,6 @@ struct _GimpToolOptions
GimpContext parent_instance; GimpContext parent_instance;
GimpToolInfo *tool_info; GimpToolInfo *tool_info;
gpointer main_vbox;
}; };
struct _GimpToolOptionsClass struct _GimpToolOptionsClass
@ -59,7 +57,7 @@ gboolean gimp_tool_options_serialize (GimpToolOptions *tool_options,
gboolean gimp_tool_options_deserialize (GimpToolOptions *tool_options, gboolean gimp_tool_options_deserialize (GimpToolOptions *tool_options,
GError **error); GError **error);
void gimp_tool_options_gui (GimpToolOptions *tool_options); gpointer gimp_tool_options_gui (GimpToolOptions *tool_options);
#endif /* __TOOL_OPTIONS_H__ */ #endif /* __TOOL_OPTIONS_H__ */

View File

@ -186,22 +186,30 @@ tool_options_dialog_tool_changed (GimpContext *context,
GimpToolInfo *tool_info, GimpToolInfo *tool_info,
gpointer data) gpointer data)
{ {
GtkWidget *options_gui;
if (visible_tool_options && if (visible_tool_options &&
(! tool_info || tool_info->tool_options != visible_tool_options)) (! tool_info || tool_info->tool_options != visible_tool_options))
{ {
gtk_widget_hide (visible_tool_options->main_vbox); options_gui = g_object_get_data (G_OBJECT (visible_tool_options),
"gimp-tool-options-gui");
if (options_gui)
gtk_widget_hide (options_gui);
visible_tool_options = NULL; visible_tool_options = NULL;
} }
if (tool_info && tool_info->tool_options) if (tool_info && tool_info->tool_options)
{ {
if (! GTK_WIDGET (tool_info->tool_options->main_vbox)->parent) options_gui = g_object_get_data (G_OBJECT (tool_info->tool_options),
gtk_box_pack_start (GTK_BOX (options_vbox), "gimp-tool-options-gui");
tool_info->tool_options->main_vbox,
if (! options_gui->parent)
gtk_box_pack_start (GTK_BOX (options_vbox), options_gui,
FALSE, FALSE, 0); FALSE, FALSE, 0);
gtk_widget_show (tool_info->tool_options->main_vbox); gtk_widget_show (options_gui);
visible_tool_options = tool_info->tool_options; visible_tool_options = tool_info->tool_options;

View File

@ -240,7 +240,7 @@ gimp_ink_options_get_property (GObject *object,
} }
} }
void GtkWidget *
gimp_ink_options_gui (GimpToolOptions *tool_options) gimp_ink_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -252,9 +252,7 @@ gimp_ink_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
gimp_paint_options_gui (tool_options); vbox = gimp_paint_options_gui (tool_options);
vbox = tool_options->main_vbox;
/* adjust sliders */ /* adjust sliders */
frame = gtk_frame_new (_("Adjustment")); frame = gtk_frame_new (_("Adjustment"));
@ -371,6 +369,8 @@ gimp_ink_options_gui (GimpToolOptions *tool_options)
brush = brush_widget_new (GIMP_INK_OPTIONS (tool_options)); brush = brush_widget_new (GIMP_INK_OPTIONS (tool_options));
gtk_container_add (GTK_CONTAINER (frame), brush); gtk_container_add (GTK_CONTAINER (frame), brush);
gtk_widget_show (brush); gtk_widget_show (brush);
return vbox;
} }

View File

@ -53,7 +53,7 @@ struct _GimpInkOptions
GType gimp_ink_options_get_type (void) G_GNUC_CONST; GType gimp_ink_options_get_type (void) G_GNUC_CONST;
void gimp_ink_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_ink_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_INK_OPTIONS_H__ */ #endif /* __GIMP_INK_OPTIONS_H__ */

View File

@ -42,7 +42,7 @@
static void gimp_airbrush_tool_class_init (GimpAirbrushToolClass *klass); static void gimp_airbrush_tool_class_init (GimpAirbrushToolClass *klass);
static void gimp_airbrush_tool_init (GimpAirbrushTool *airbrush); static void gimp_airbrush_tool_init (GimpAirbrushTool *airbrush);
static void gimp_airbrush_options_gui (GimpToolOptions *tool_options); static GtkWidget * gimp_airbrush_options_gui (GimpToolOptions *tool_options);
static GimpPaintToolClass *parent_class = NULL; static GimpPaintToolClass *parent_class = NULL;
@ -123,7 +123,7 @@ gimp_airbrush_tool_init (GimpAirbrushTool *airbrush)
/* tool options stuff */ /* tool options stuff */
static void static GtkWidget *
gimp_airbrush_options_gui (GimpToolOptions *tool_options) gimp_airbrush_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -132,9 +132,7 @@ gimp_airbrush_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
gimp_paint_options_gui (tool_options); vbox = gimp_paint_options_gui (tool_options);
vbox = tool_options->main_vbox;
table = gtk_table_new (2, 3, FALSE); table = gtk_table_new (2, 3, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2); gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2);
@ -152,4 +150,6 @@ gimp_airbrush_options_gui (GimpToolOptions *tool_options)
_("Pressure:"), _("Pressure:"),
1.0, 1.0, 1, 1.0, 1.0, 1,
FALSE, 0.0, 0.0); FALSE, 0.0, 0.0);
return vbox;
} }

View File

@ -232,7 +232,7 @@ gimp_blend_options_get_property (GObject *object,
} }
} }
void GtkWidget *
gimp_blend_options_gui (GimpToolOptions *tool_options) gimp_blend_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -244,9 +244,7 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
gimp_paint_options_gui (tool_options); vbox = gimp_paint_options_gui (tool_options);
vbox = tool_options->main_vbox;
gimp_dnd_viewable_dest_add (vbox, gimp_dnd_viewable_dest_add (vbox,
GIMP_TYPE_GRADIENT, GIMP_TYPE_GRADIENT,
@ -350,6 +348,8 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
_("Threshold:"), _("Threshold:"),
0.01, 0.1, 2, 0.01, 0.1, 2,
FALSE, 0.0, 0.0); FALSE, 0.0, 0.0);
return vbox;
} }
static void static void

View File

@ -50,7 +50,7 @@ struct _GimpBlendOptions
GType gimp_blend_options_get_type (void) G_GNUC_CONST; GType gimp_blend_options_get_type (void) G_GNUC_CONST;
void gimp_blend_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_blend_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_BLEND_OPTIONS_H__ */ #endif /* __GIMP_BLEND_OPTIONS_H__ */

View File

@ -217,7 +217,7 @@ gimp_bucket_fill_options_reset (GimpToolOptions *tool_options)
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options); GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
} }
void GtkWidget *
gimp_bucket_fill_options_gui (GimpToolOptions *tool_options) gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -230,9 +230,7 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
gimp_paint_options_gui (tool_options); vbox = gimp_paint_options_gui (tool_options);
vbox = tool_options->main_vbox;
/* fill type */ /* fill type */
str = g_strdup_printf (_("Fill Type %s"), gimp_get_mod_name_control ()); str = g_strdup_printf (_("Fill Type %s"), gimp_get_mod_name_control ());
@ -278,4 +276,6 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
FALSE, 0.0, 0.0); FALSE, 0.0, 0.0);
gimp_bucket_fill_options_reset (tool_options); gimp_bucket_fill_options_reset (tool_options);
return vbox;
} }

View File

@ -47,7 +47,7 @@ struct _GimpBucketFillOptions
GType gimp_bucket_fill_options_get_type (void) G_GNUC_CONST; GType gimp_bucket_fill_options_get_type (void) G_GNUC_CONST;
void gimp_bucket_fill_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_bucket_fill_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_BUCKET_FILL_OPTIONS_H__ */ #endif /* __GIMP_BUCKET_FILL_OPTIONS_H__ */

View File

@ -76,7 +76,7 @@ static void gimp_clone_pretrace_callback (GimpClone *clone,
static void gimp_clone_posttrace_callback (GimpClone *clone, static void gimp_clone_posttrace_callback (GimpClone *clone,
gpointer data); gpointer data);
static void gimp_clone_options_gui (GimpToolOptions *tool_options); static GtkWidget * gimp_clone_options_gui (GimpToolOptions *tool_options);
static GimpPaintToolClass *parent_class; static GimpPaintToolClass *parent_class;
@ -362,7 +362,7 @@ gimp_clone_posttrace_callback (GimpClone *clone,
/* tool options stuff */ /* tool options stuff */
static void static GtkWidget *
gimp_clone_options_gui (GimpToolOptions *tool_options) gimp_clone_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -371,9 +371,7 @@ gimp_clone_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
gimp_paint_options_gui (tool_options); vbox = gimp_paint_options_gui (tool_options);
vbox = tool_options->main_vbox;
frame = gimp_prop_enum_radio_frame_new (config, "clone-type", frame = gimp_prop_enum_radio_frame_new (config, "clone-type",
_("Source"), _("Source"),
@ -386,4 +384,6 @@ gimp_clone_options_gui (GimpToolOptions *tool_options)
0, 0); 0, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame); gtk_widget_show (frame);
return vbox;
} }

View File

@ -182,7 +182,7 @@ gimp_color_picker_options_get_property (GObject *object,
} }
} }
void GtkWidget *
gimp_color_picker_options_gui (GimpToolOptions *tool_options) gimp_color_picker_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -193,7 +193,7 @@ gimp_color_picker_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
vbox = tool_options->main_vbox; vbox = gimp_tool_options_gui (tool_options);
/* the sample merged toggle button */ /* the sample merged toggle button */
button = gimp_prop_check_button_new (config, "sample-merged", button = gimp_prop_check_button_new (config, "sample-merged",
@ -233,4 +233,6 @@ gimp_color_picker_options_gui (GimpToolOptions *tool_options)
_("Update Active Color")); _("Update Active Color"));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
return vbox;
} }

View File

@ -47,7 +47,7 @@ struct _GimpColorPickerOptions
GType gimp_color_picker_options_get_type (void) G_GNUC_CONST; GType gimp_color_picker_options_get_type (void) G_GNUC_CONST;
void gimp_color_picker_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_color_picker_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_COLOR_PICKER_OPTIONS_H__ */ #endif /* __GIMP_COLOR_PICKER_OPTIONS_H__ */

View File

@ -69,7 +69,7 @@ static void gimp_convolve_tool_cursor_update (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_convolve_options_gui (GimpToolOptions *options); static GtkWidget * gimp_convolve_options_gui (GimpToolOptions *options);
static GimpPaintToolClass *parent_class; static GimpPaintToolClass *parent_class;
@ -210,7 +210,7 @@ gimp_convolve_tool_cursor_update (GimpTool *tool,
/* tool options stuff */ /* tool options stuff */
static void static GtkWidget *
gimp_convolve_options_gui (GimpToolOptions *tool_options) gimp_convolve_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -221,9 +221,7 @@ gimp_convolve_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
gimp_paint_options_gui (tool_options); vbox = gimp_paint_options_gui (tool_options);
vbox = tool_options->main_vbox;
/* the type radio box */ /* the type radio box */
str = g_strdup_printf (_("Convolve Type %s"), str = g_strdup_printf (_("Convolve Type %s"),
@ -247,4 +245,6 @@ gimp_convolve_options_gui (GimpToolOptions *tool_options)
_("Rate:"), _("Rate:"),
1.0, 10.0, 1, 1.0, 10.0, 1,
FALSE, 0.0, 0.0); FALSE, 0.0, 0.0);
return vbox;
} }

View File

@ -173,7 +173,7 @@ gimp_crop_options_get_property (GObject *object,
} }
} }
void GtkWidget *
gimp_crop_options_gui (GimpToolOptions *tool_options) gimp_crop_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -184,7 +184,7 @@ gimp_crop_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
vbox = tool_options->main_vbox; vbox = gimp_tool_options_gui (tool_options);
/* tool toggle */ /* tool toggle */
str = g_strdup_printf (_("Tool Toggle %s"), gimp_get_mod_name_control ()); str = g_strdup_printf (_("Tool Toggle %s"), gimp_get_mod_name_control ());
@ -210,4 +210,6 @@ gimp_crop_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (button); gtk_widget_show (button);
g_free (str); g_free (str);
return vbox;
} }

View File

@ -46,7 +46,7 @@ struct _GimpCropOptions
GType gimp_crop_options_get_type (void) G_GNUC_CONST; GType gimp_crop_options_get_type (void) G_GNUC_CONST;
void gimp_crop_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_crop_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_CROP_OPTIONS_H__ */ #endif /* __GIMP_CROP_OPTIONS_H__ */

View File

@ -51,7 +51,7 @@ static void gimp_dodgeburn_tool_cursor_update (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_dodge_burn_options_gui (GimpToolOptions *tool_options); static GtkWidget * gimp_dodge_burn_options_gui (GimpToolOptions *tool_options);
static GimpPaintToolClass *parent_class = NULL; static GimpPaintToolClass *parent_class = NULL;
@ -183,7 +183,7 @@ gimp_dodgeburn_tool_cursor_update (GimpTool *tool,
/* tool options stuff */ /* tool options stuff */
static void static GtkWidget *
gimp_dodge_burn_options_gui (GimpToolOptions *tool_options) gimp_dodge_burn_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -194,9 +194,7 @@ gimp_dodge_burn_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
gimp_paint_options_gui (tool_options); vbox = gimp_paint_options_gui (tool_options);
vbox = tool_options->main_vbox;
/* the type (dodge or burn) */ /* the type (dodge or burn) */
str = g_strdup_printf (_("Type %s"), gimp_get_mod_name_control ()); str = g_strdup_printf (_("Type %s"), gimp_get_mod_name_control ());
@ -225,4 +223,6 @@ gimp_dodge_burn_options_gui (GimpToolOptions *tool_options)
_("Exposure:"), _("Exposure:"),
1.0, 10.0, 1, 1.0, 10.0, 1,
FALSE, 0.0, 0.0); FALSE, 0.0, 0.0);
return vbox;
} }

View File

@ -51,7 +51,7 @@ static void gimp_eraser_tool_cursor_update (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *gdisp); GimpDisplay *gdisp);
static void gimp_eraser_options_gui (GimpToolOptions *tool_options); static GtkWidget * gimp_eraser_options_gui (GimpToolOptions *tool_options);
static GimpPaintToolClass *parent_class = NULL; static GimpPaintToolClass *parent_class = NULL;
@ -172,7 +172,7 @@ gimp_eraser_tool_cursor_update (GimpTool *tool,
/* tool options stuff */ /* tool options stuff */
static void static GtkWidget *
gimp_eraser_options_gui (GimpToolOptions *tool_options) gimp_eraser_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -182,9 +182,7 @@ gimp_eraser_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
gimp_paint_options_gui (tool_options); vbox = gimp_paint_options_gui (tool_options);
vbox = tool_options->main_vbox;
/* the anti_erase toggle */ /* the anti_erase toggle */
str = g_strdup_printf (_("Anti Erase %s"), gimp_get_mod_name_control ()); str = g_strdup_printf (_("Anti Erase %s"), gimp_get_mod_name_control ());
@ -199,4 +197,6 @@ gimp_eraser_options_gui (GimpToolOptions *tool_options)
button = gimp_prop_check_button_new (config, "hard", _("Hard Edge")); button = gimp_prop_check_button_new (config, "hard", _("Hard Edge"));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
return vbox;
} }

View File

@ -153,7 +153,7 @@ gimp_flip_options_get_property (GObject *object,
} }
} }
void GtkWidget *
gimp_flip_options_gui (GimpToolOptions *tool_options) gimp_flip_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -163,7 +163,7 @@ gimp_flip_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
vbox = tool_options->main_vbox; vbox = gimp_tool_options_gui (tool_options);
/* tool toggle */ /* tool toggle */
str = g_strdup_printf (_("Tool Toggle %s"), gimp_get_mod_name_control ()); str = g_strdup_printf (_("Tool Toggle %s"), gimp_get_mod_name_control ());
@ -176,4 +176,6 @@ gimp_flip_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (frame); gtk_widget_show (frame);
g_free (str); g_free (str);
return vbox;
} }

View File

@ -44,7 +44,7 @@ struct _GimpFlipOptions
GType gimp_flip_options_get_type (void) G_GNUC_CONST; GType gimp_flip_options_get_type (void) G_GNUC_CONST;
void gimp_flip_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_flip_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_FLIP_OPTIONS_H__ */ #endif /* __GIMP_FLIP_OPTIONS_H__ */

View File

@ -240,7 +240,7 @@ gimp_ink_options_get_property (GObject *object,
} }
} }
void GtkWidget *
gimp_ink_options_gui (GimpToolOptions *tool_options) gimp_ink_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -252,9 +252,7 @@ gimp_ink_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
gimp_paint_options_gui (tool_options); vbox = gimp_paint_options_gui (tool_options);
vbox = tool_options->main_vbox;
/* adjust sliders */ /* adjust sliders */
frame = gtk_frame_new (_("Adjustment")); frame = gtk_frame_new (_("Adjustment"));
@ -371,6 +369,8 @@ gimp_ink_options_gui (GimpToolOptions *tool_options)
brush = brush_widget_new (GIMP_INK_OPTIONS (tool_options)); brush = brush_widget_new (GIMP_INK_OPTIONS (tool_options));
gtk_container_add (GTK_CONTAINER (frame), brush); gtk_container_add (GTK_CONTAINER (frame), brush);
gtk_widget_show (brush); gtk_widget_show (brush);
return vbox;
} }

View File

@ -53,7 +53,7 @@ struct _GimpInkOptions
GType gimp_ink_options_get_type (void) G_GNUC_CONST; GType gimp_ink_options_get_type (void) G_GNUC_CONST;
void gimp_ink_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_ink_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_INK_OPTIONS_H__ */ #endif /* __GIMP_INK_OPTIONS_H__ */

View File

@ -240,7 +240,7 @@ gimp_ink_options_get_property (GObject *object,
} }
} }
void GtkWidget *
gimp_ink_options_gui (GimpToolOptions *tool_options) gimp_ink_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -252,9 +252,7 @@ gimp_ink_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
gimp_paint_options_gui (tool_options); vbox = gimp_paint_options_gui (tool_options);
vbox = tool_options->main_vbox;
/* adjust sliders */ /* adjust sliders */
frame = gtk_frame_new (_("Adjustment")); frame = gtk_frame_new (_("Adjustment"));
@ -371,6 +369,8 @@ gimp_ink_options_gui (GimpToolOptions *tool_options)
brush = brush_widget_new (GIMP_INK_OPTIONS (tool_options)); brush = brush_widget_new (GIMP_INK_OPTIONS (tool_options));
gtk_container_add (GTK_CONTAINER (frame), brush); gtk_container_add (GTK_CONTAINER (frame), brush);
gtk_widget_show (brush); gtk_widget_show (brush);
return vbox;
} }

View File

@ -53,7 +53,7 @@ struct _GimpInkOptions
GType gimp_ink_options_get_type (void) G_GNUC_CONST; GType gimp_ink_options_get_type (void) G_GNUC_CONST;
void gimp_ink_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_ink_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_INK_OPTIONS_H__ */ #endif /* __GIMP_INK_OPTIONS_H__ */

View File

@ -200,7 +200,7 @@ gimp_magnify_options_reset (GimpToolOptions *tool_options)
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options); GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
} }
void GtkWidget *
gimp_magnify_options_gui (GimpToolOptions *tool_options) gimp_magnify_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -212,7 +212,7 @@ gimp_magnify_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
vbox = tool_options->main_vbox; vbox = gimp_tool_options_gui (tool_options);
/* the allow_resize toggle button */ /* the allow_resize toggle button */
button = gimp_prop_check_button_new (config, "allow-resize", button = gimp_prop_check_button_new (config, "allow-resize",
@ -243,4 +243,6 @@ gimp_magnify_options_gui (GimpToolOptions *tool_options)
FALSE, 0.0, 0.0); FALSE, 0.0, 0.0);
gimp_magnify_options_reset (tool_options); gimp_magnify_options_reset (tool_options);
return vbox;
} }

View File

@ -46,7 +46,7 @@ struct _GimpMagnifyOptions
GType gimp_magnify_options_get_type (void) G_GNUC_CONST; GType gimp_magnify_options_get_type (void) G_GNUC_CONST;
void gimp_magnify_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_magnify_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_MAGNIFY_OPTIONS_H__ */ #endif /* __GIMP_MAGNIFY_OPTIONS_H__ */

View File

@ -154,7 +154,7 @@ gimp_measure_options_get_property (GObject *object,
} }
} }
void GtkWidget *
gimp_measure_options_gui (GimpToolOptions *tool_options) gimp_measure_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -163,11 +163,13 @@ gimp_measure_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
vbox = tool_options->main_vbox; vbox = gimp_tool_options_gui (tool_options);
/* the use_info_window toggle button */ /* the use_info_window toggle button */
button = gimp_prop_check_button_new (config, "use-info-window", button = gimp_prop_check_button_new (config, "use-info-window",
_("Use Info Window")); _("Use Info Window"));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
return vbox;
} }

View File

@ -44,7 +44,7 @@ struct _GimpMeasureOptions
GType gimp_measure_options_get_type (void) G_GNUC_CONST; GType gimp_measure_options_get_type (void) G_GNUC_CONST;
void gimp_measure_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_measure_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_MEASURE_OPTIONS_H__ */ #endif /* __GIMP_MEASURE_OPTIONS_H__ */

View File

@ -163,7 +163,7 @@ gimp_move_options_get_property (GObject *object,
} }
} }
void GtkWidget *
gimp_move_options_gui (GimpToolOptions *tool_options) gimp_move_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -173,7 +173,7 @@ gimp_move_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
vbox = tool_options->main_vbox; vbox = gimp_tool_options_gui (tool_options);
/* tool toggle */ /* tool toggle */
str = g_strdup_printf (_("Tool Toggle %s"), gimp_get_mod_name_control ()); str = g_strdup_printf (_("Tool Toggle %s"), gimp_get_mod_name_control ());
@ -198,4 +198,6 @@ gimp_move_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (frame); gtk_widget_show (frame);
g_free (str); g_free (str);
return vbox;
} }

View File

@ -45,7 +45,7 @@ struct _GimpMoveOptions
GType gimp_move_options_get_type (void) G_GNUC_CONST; GType gimp_move_options_get_type (void) G_GNUC_CONST;
void gimp_move_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_move_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_MOVE_OPTIONS_H__ */ #endif /* __GIMP_MOVE_OPTIONS_H__ */

View File

@ -74,7 +74,7 @@ static void paint_options_brush_clicked (GtkWidget *widget,
gpointer data); gpointer data);
void GtkWidget *
gimp_paint_options_gui (GimpToolOptions *tool_options) gimp_paint_options_gui (GimpToolOptions *tool_options)
{ {
GimpPaintOptions *options; GimpPaintOptions *options;
@ -91,7 +91,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
context = GIMP_CONTEXT (tool_options); context = GIMP_CONTEXT (tool_options);
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
vbox = tool_options->main_vbox; vbox = gimp_tool_options_gui (tool_options);
/* the main table */ /* the main table */
table = gtk_table_new (3, 3, FALSE); table = gtk_table_new (3, 3, FALSE);
@ -203,6 +203,8 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame); gtk_widget_show (frame);
} }
return vbox;
} }

View File

@ -20,7 +20,7 @@
#define __PAINT_OPTIONS_H__ #define __PAINT_OPTIONS_H__
void gimp_paint_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_paint_options_gui (GimpToolOptions *tool_options);
#endif /* __PAINT_OPTIONS_H__ */ #endif /* __PAINT_OPTIONS_H__ */

View File

@ -366,7 +366,7 @@ gimp_selection_options_reset (GimpToolOptions *tool_options)
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options); GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
} }
void GtkWidget *
gimp_selection_options_gui (GimpToolOptions *tool_options) gimp_selection_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -377,7 +377,7 @@ gimp_selection_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
options = GIMP_SELECTION_OPTIONS (tool_options); options = GIMP_SELECTION_OPTIONS (tool_options);
vbox = tool_options->main_vbox; vbox = gimp_tool_options_gui (tool_options);
/* the selection operation radio buttons */ /* the selection operation radio buttons */
{ {
@ -593,6 +593,8 @@ gimp_selection_options_gui (GimpToolOptions *tool_options)
} }
gimp_selection_options_reset (tool_options); gimp_selection_options_reset (tool_options);
return vbox;
} }

View File

@ -65,7 +65,7 @@ struct _GimpSelectionOptions
GType gimp_selection_options_get_type (void) G_GNUC_CONST; GType gimp_selection_options_get_type (void) G_GNUC_CONST;
void gimp_selection_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_selection_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_SELCTION_OPTIONS_H__ */ #endif /* __GIMP_SELCTION_OPTIONS_H__ */

View File

@ -40,7 +40,7 @@
static void gimp_smudge_tool_class_init (GimpSmudgeToolClass *klass); static void gimp_smudge_tool_class_init (GimpSmudgeToolClass *klass);
static void gimp_smudge_tool_init (GimpSmudgeTool *tool); static void gimp_smudge_tool_init (GimpSmudgeTool *tool);
static void gimp_smudge_options_gui (GimpToolOptions *tool_options); static GtkWidget * gimp_smudge_options_gui (GimpToolOptions *tool_options);
static GimpPaintToolClass *parent_class = NULL; static GimpPaintToolClass *parent_class = NULL;
@ -121,7 +121,7 @@ gimp_smudge_tool_init (GimpSmudgeTool *smudge)
/* tool options stuff */ /* tool options stuff */
static void static GtkWidget *
gimp_smudge_options_gui (GimpToolOptions *tool_options) gimp_smudge_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -130,9 +130,7 @@ gimp_smudge_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
gimp_paint_options_gui (tool_options); vbox = gimp_paint_options_gui (tool_options);
vbox = tool_options->main_vbox;
/* the rate scale */ /* the rate scale */
table = gtk_table_new (1, 3, FALSE); table = gtk_table_new (1, 3, FALSE);
@ -145,4 +143,6 @@ gimp_smudge_options_gui (GimpToolOptions *tool_options)
_("Rate:"), _("Rate:"),
1.0, 10.0, 1, 1.0, 10.0, 1,
FALSE, 0.0, 0.0); FALSE, 0.0, 0.0);
return vbox;
} }

View File

@ -76,7 +76,7 @@ static void gimp_clone_pretrace_callback (GimpClone *clone,
static void gimp_clone_posttrace_callback (GimpClone *clone, static void gimp_clone_posttrace_callback (GimpClone *clone,
gpointer data); gpointer data);
static void gimp_clone_options_gui (GimpToolOptions *tool_options); static GtkWidget * gimp_clone_options_gui (GimpToolOptions *tool_options);
static GimpPaintToolClass *parent_class; static GimpPaintToolClass *parent_class;
@ -362,7 +362,7 @@ gimp_clone_posttrace_callback (GimpClone *clone,
/* tool options stuff */ /* tool options stuff */
static void static GtkWidget *
gimp_clone_options_gui (GimpToolOptions *tool_options) gimp_clone_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -371,9 +371,7 @@ gimp_clone_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
gimp_paint_options_gui (tool_options); vbox = gimp_paint_options_gui (tool_options);
vbox = tool_options->main_vbox;
frame = gimp_prop_enum_radio_frame_new (config, "clone-type", frame = gimp_prop_enum_radio_frame_new (config, "clone-type",
_("Source"), _("Source"),
@ -386,4 +384,6 @@ gimp_clone_options_gui (GimpToolOptions *tool_options)
0, 0); 0, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame); gtk_widget_show (frame);
return vbox;
} }

View File

@ -115,7 +115,7 @@ gimp_text_options_reset (GimpToolOptions *tool_options)
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options); GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
} }
void GtkWidget *
gimp_text_options_gui (GimpToolOptions *tool_options) gimp_text_options_gui (GimpToolOptions *tool_options)
{ {
GimpTextOptions *options; GimpTextOptions *options;
@ -130,7 +130,7 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
options = GIMP_TEXT_OPTIONS (tool_options); options = GIMP_TEXT_OPTIONS (tool_options);
vbox = tool_options->main_vbox; vbox = gimp_tool_options_gui (tool_options);
table = gtk_table_new (4, 6, FALSE); table = gtk_table_new (4, 6, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2); gtk_table_set_col_spacings (GTK_TABLE (table), 2);
@ -184,4 +184,6 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
gimp_table_attach_stock (GTK_TABLE (table), 5, gimp_table_attach_stock (GTK_TABLE (table), 5,
_("Line\nSpacing:"), 0.0, spinbutton, _("Line\nSpacing:"), 0.0, spinbutton,
GIMP_STOCK_LINE_SPACING); GIMP_STOCK_LINE_SPACING);
return vbox;
} }

View File

@ -45,7 +45,7 @@ struct _GimpTextOptions
GType gimp_text_options_get_type (void) G_GNUC_CONST; GType gimp_text_options_get_type (void) G_GNUC_CONST;
void gimp_text_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_text_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_TEXT_OPTIONS_H__ */ #endif /* __GIMP_TEXT_OPTIONS_H__ */

View File

@ -269,7 +269,7 @@ gimp_transform_options_reset (GimpToolOptions *tool_options)
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options); GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
} }
void GtkWidget *
gimp_transform_options_gui (GimpToolOptions *tool_options) gimp_transform_options_gui (GimpToolOptions *tool_options)
{ {
GObject *config; GObject *config;
@ -285,7 +285,7 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
options = GIMP_TRANSFORM_OPTIONS (tool_options); options = GIMP_TRANSFORM_OPTIONS (tool_options);
vbox = tool_options->main_vbox; vbox = gimp_tool_options_gui (tool_options);
frame = gimp_prop_enum_radio_frame_new (config, "direction", frame = gimp_prop_enum_radio_frame_new (config, "direction",
_("Transform Direction"), 0, 0); _("Transform Direction"), 0, 0);
@ -402,6 +402,8 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
} }
gimp_transform_options_reset (tool_options); gimp_transform_options_reset (tool_options);
return vbox;
} }

View File

@ -51,7 +51,7 @@ struct _GimpTransformOptions
GType gimp_transform_options_get_type (void) G_GNUC_CONST; GType gimp_transform_options_get_type (void) G_GNUC_CONST;
void gimp_transform_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_transform_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_TRANSFORM_OPTIONS_H__ */ #endif /* __GIMP_TRANSFORM_OPTIONS_H__ */

View File

@ -76,7 +76,7 @@ gimp_vector_options_init (GimpVectorOptions *options)
{ {
} }
void GtkWidget *
gimp_vector_options_gui (GimpToolOptions *tool_options) gimp_vector_options_gui (GimpToolOptions *tool_options)
{ {
GimpVectorOptions *options; GimpVectorOptions *options;
@ -84,7 +84,7 @@ gimp_vector_options_gui (GimpToolOptions *tool_options)
options = GIMP_VECTOR_OPTIONS (tool_options); options = GIMP_VECTOR_OPTIONS (tool_options);
gimp_selection_options_gui (tool_options); vbox = gimp_selection_options_gui (tool_options);
vbox = tool_options->main_vbox; return vbox;
} }

View File

@ -42,7 +42,7 @@ struct _GimpVectorOptions
GType gimp_vector_options_get_type (void) G_GNUC_CONST; GType gimp_vector_options_get_type (void) G_GNUC_CONST;
void gimp_vector_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_vector_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_VECTOR_OPTIONS_H__ */ #endif /* __GIMP_VECTOR_OPTIONS_H__ */

View File

@ -74,7 +74,7 @@ static void paint_options_brush_clicked (GtkWidget *widget,
gpointer data); gpointer data);
void GtkWidget *
gimp_paint_options_gui (GimpToolOptions *tool_options) gimp_paint_options_gui (GimpToolOptions *tool_options)
{ {
GimpPaintOptions *options; GimpPaintOptions *options;
@ -91,7 +91,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
context = GIMP_CONTEXT (tool_options); context = GIMP_CONTEXT (tool_options);
config = G_OBJECT (tool_options); config = G_OBJECT (tool_options);
vbox = tool_options->main_vbox; vbox = gimp_tool_options_gui (tool_options);
/* the main table */ /* the main table */
table = gtk_table_new (3, 3, FALSE); table = gtk_table_new (3, 3, FALSE);
@ -203,6 +203,8 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame); gtk_widget_show (frame);
} }
return vbox;
} }

View File

@ -20,7 +20,7 @@
#define __PAINT_OPTIONS_H__ #define __PAINT_OPTIONS_H__
void gimp_paint_options_gui (GimpToolOptions *tool_options); GtkWidget * gimp_paint_options_gui (GimpToolOptions *tool_options);
#endif /* __PAINT_OPTIONS_H__ */ #endif /* __PAINT_OPTIONS_H__ */

View File

@ -170,6 +170,7 @@ tool_manager_restore (Gimp *gimp)
list = g_list_next (list)) list = g_list_next (list))
{ {
GimpToolOptionsGUIFunc options_gui_func; GimpToolOptionsGUIFunc options_gui_func;
GtkWidget *options_gui;
tool_info = GIMP_TOOL_INFO (list->data); tool_info = GIMP_TOOL_INFO (list->data);
@ -177,7 +178,22 @@ tool_manager_restore (Gimp *gimp)
"gimp-tool-options-gui-func"); "gimp-tool-options-gui-func");
if (options_gui_func) if (options_gui_func)
options_gui_func (tool_info->tool_options); {
options_gui = options_gui_func (tool_info->tool_options);
}
else
{
GtkWidget *label;
options_gui = gimp_tool_options_gui (tool_info->tool_options);
label = gtk_label_new (_("This tool has no options."));
gtk_box_pack_start (GTK_BOX (options_gui), label, FALSE, FALSE, 6);
gtk_widget_show (label);
}
g_object_set_data (G_OBJECT (tool_info->tool_options),
"gimp-tool-options-gui", options_gui);
} }
} }
@ -506,11 +522,8 @@ tool_manager_register_tool (GType tool_type,
g_return_if_fail (tool_options_type == G_TYPE_NONE || g_return_if_fail (tool_options_type == G_TYPE_NONE ||
g_type_is_a (tool_options_type, GIMP_TYPE_TOOL_OPTIONS)); g_type_is_a (tool_options_type, GIMP_TYPE_TOOL_OPTIONS));
if (tool_options_type == G_TYPE_NONE && options_gui_func == NULL) if (tool_options_type == G_TYPE_NONE)
{
tool_options_type = GIMP_TYPE_TOOL_OPTIONS; tool_options_type = GIMP_TYPE_TOOL_OPTIONS;
options_gui_func = gimp_tool_options_gui;
}
if (tool_type == GIMP_TYPE_PENCIL_TOOL) if (tool_type == GIMP_TYPE_PENCIL_TOOL)
{ {
@ -731,7 +744,7 @@ tool_manager_tool_changed (GimpContext *user_context,
old_tool_info = tool_manager->active_tool->tool_info; old_tool_info = tool_manager->active_tool->tool_info;
gimp_context_unset_parent (GIMP_CONTEXT (old_tool_info->tool_options)); gimp_context_set_parent (GIMP_CONTEXT (old_tool_info->tool_options), NULL);
} }
/* connect the new tool's context */ /* connect the new tool's context */

View File

@ -113,7 +113,6 @@ static void
gimp_tool_options_init (GimpToolOptions *options) gimp_tool_options_init (GimpToolOptions *options)
{ {
options->tool_info = NULL; options->tool_info = NULL;
options->main_vbox = gtk_vbox_new (FALSE, 2);
} }
static void static void
@ -226,13 +225,12 @@ gimp_tool_options_deserialize (GimpToolOptions *tool_options,
return retval; return retval;
} }
void gpointer
gimp_tool_options_gui (GimpToolOptions *tool_options) gimp_tool_options_gui (GimpToolOptions *tool_options)
{ {
GtkWidget *label; GtkWidget *vbox;
label = gtk_label_new (_("This tool has no options.")); vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (tool_options->main_vbox), label,
FALSE, FALSE, 6); return vbox;
gtk_widget_show (label);
} }

View File

@ -38,8 +38,6 @@ struct _GimpToolOptions
GimpContext parent_instance; GimpContext parent_instance;
GimpToolInfo *tool_info; GimpToolInfo *tool_info;
gpointer main_vbox;
}; };
struct _GimpToolOptionsClass struct _GimpToolOptionsClass
@ -59,7 +57,7 @@ gboolean gimp_tool_options_serialize (GimpToolOptions *tool_options,
gboolean gimp_tool_options_deserialize (GimpToolOptions *tool_options, gboolean gimp_tool_options_deserialize (GimpToolOptions *tool_options,
GError **error); GError **error);
void gimp_tool_options_gui (GimpToolOptions *tool_options); gpointer gimp_tool_options_gui (GimpToolOptions *tool_options);
#endif /* __TOOL_OPTIONS_H__ */ #endif /* __TOOL_OPTIONS_H__ */

View File

@ -220,7 +220,7 @@ gimp_devices_select_device (Gimp *gimp,
g_return_if_fail (GIMP_IS_DEVICE_INFO (current_device_info)); g_return_if_fail (GIMP_IS_DEVICE_INFO (current_device_info));
g_return_if_fail (GIMP_IS_DEVICE_INFO (new_device_info)); g_return_if_fail (GIMP_IS_DEVICE_INFO (new_device_info));
gimp_context_unset_parent (GIMP_CONTEXT (current_device_info)); gimp_context_set_parent (GIMP_CONTEXT (current_device_info), NULL);
manager->current_device = new_device; manager->current_device = new_device;

View File

@ -186,22 +186,30 @@ tool_options_dialog_tool_changed (GimpContext *context,
GimpToolInfo *tool_info, GimpToolInfo *tool_info,
gpointer data) gpointer data)
{ {
GtkWidget *options_gui;
if (visible_tool_options && if (visible_tool_options &&
(! tool_info || tool_info->tool_options != visible_tool_options)) (! tool_info || tool_info->tool_options != visible_tool_options))
{ {
gtk_widget_hide (visible_tool_options->main_vbox); options_gui = g_object_get_data (G_OBJECT (visible_tool_options),
"gimp-tool-options-gui");
if (options_gui)
gtk_widget_hide (options_gui);
visible_tool_options = NULL; visible_tool_options = NULL;
} }
if (tool_info && tool_info->tool_options) if (tool_info && tool_info->tool_options)
{ {
if (! GTK_WIDGET (tool_info->tool_options->main_vbox)->parent) options_gui = g_object_get_data (G_OBJECT (tool_info->tool_options),
gtk_box_pack_start (GTK_BOX (options_vbox), "gimp-tool-options-gui");
tool_info->tool_options->main_vbox,
if (! options_gui->parent)
gtk_box_pack_start (GTK_BOX (options_vbox), options_gui,
FALSE, FALSE, 0); FALSE, FALSE, 0);
gtk_widget_show (tool_info->tool_options->main_vbox); gtk_widget_show (options_gui);
visible_tool_options = tool_info->tool_options; visible_tool_options = tool_info->tool_options;

View File

@ -18,7 +18,7 @@
#include "config.h" #include "config.h"
#include <glib-object.h> #include <gtk/gtk.h>
#include "libgimpproxy/gimpproxytypes.h" #include "libgimpproxy/gimpproxytypes.h"
#include "gimptooltypes.h" #include "gimptooltypes.h"

View File

@ -39,7 +39,7 @@ typedef struct _GimpTransformTool GimpTransformTool;
/* functions */ /* functions */
typedef void (* GimpToolOptionsGUIFunc) (GimpToolOptions *tool_options); typedef GtkWidget * (* GimpToolOptionsGUIFunc) (GimpToolOptions *tool_options);
typedef void (* GimpToolRegisterCallback) (GType tool_type, typedef void (* GimpToolRegisterCallback) (GType tool_type,
GType tool_option_type, GType tool_option_type,