removed type checking casts from macros which return parts of

2002-03-10  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpwidgets.h: removed type checking casts from
	macros which return parts of pseudo-widgets.

	* app/widgets/gimpbrushfactoryview.c: changed accordingly.

	* app/widgets/gimpdialogfactory.c: added a "dispose"
	implementation used to destroy all dialogs the factory has
	created.

	* app/gui/toolbox.[ch]: removed toolbox_free(), removed the static
	"toolbox_shell" variable, set the active tool correctly on
	creation, don't show the window here (fixes session menagement),
	take the vbox' spacing into account when calculating the window's
	resize hints.

	* app/gui/gui.c: don't include "toolbox.h", don't call
	toolbox_free().

	* app/widgets/gimpfontselection.c: set the width of the entry to
	16 chars on creation so it doesn't fall back to it's insanely
	large default width, minor stuff.

	* app/tools/gimptexttool.c
	* app/tools/selection_options.c: some more scale_entries.
This commit is contained in:
Michael Natterer 2002-03-10 18:31:42 +00:00 committed by Michael Natterer
parent 8b8442e9f4
commit 1f08f9d9d0
13 changed files with 222 additions and 181 deletions

View File

@ -1,3 +1,30 @@
2002-03-10 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpwidgets.h: removed type checking casts from
macros which return parts of pseudo-widgets.
* app/widgets/gimpbrushfactoryview.c: changed accordingly.
* app/widgets/gimpdialogfactory.c: added a "dispose"
implementation used to destroy all dialogs the factory has
created.
* app/gui/toolbox.[ch]: removed toolbox_free(), removed the static
"toolbox_shell" variable, set the active tool correctly on
creation, don't show the window here (fixes session menagement),
take the vbox' spacing into account when calculating the window's
resize hints.
* app/gui/gui.c: don't include "toolbox.h", don't call
toolbox_free().
* app/widgets/gimpfontselection.c: set the width of the entry to
16 chars on creation so it doesn't fall back to it's insanely
large default width, minor stuff.
* app/tools/gimptexttool.c
* app/tools/selection_options.c: some more scale_entries.
2002-03-10 Michael Natterer <mitch@gimp.org>
* app/gui/dialogs-constructors.[ch]

View File

@ -57,7 +57,6 @@
#include "palette-select.h"
#include "pattern-select.h"
#include "session.h"
#include "toolbox.h"
#include "gimprc.h"
@ -308,9 +307,6 @@ gui_exit (Gimp *gimp)
dialogs_exit (gimp);
gimp_devices_exit (gimp);
/* handle this in the dialog factory: */
toolbox_free (gimp);
gimp_help_free ();
gimp_container_remove_handler (gimp->images, image_disconnect_handler_id);

View File

@ -96,7 +96,6 @@ static void toolbox_drop_buffer (GtkWidget *widget,
/* local variables */
static GtkWidget *toolbox_shell = NULL;
static GtkTargetEntry toolbox_target_table[] =
{
@ -226,19 +225,7 @@ toolbox_create (Gimp *gimp)
toolbox_style_set (window, NULL, gimp);
gtk_widget_show (window);
toolbox_shell = window;
return toolbox_shell;
}
void
toolbox_free (Gimp *gimp)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
gtk_widget_destroy (toolbox_shell);
return window;
}
@ -248,9 +235,12 @@ static void
toolbox_create_tools (GtkWidget *wbox,
GimpContext *context)
{
GimpToolInfo *active_tool;
GList *list;
GSList *group = NULL;
active_tool = gimp_context_get_tool (context);
for (list = GIMP_LIST (context->gimp->tool_info_list)->list;
list;
list = g_list_next (list))
@ -275,6 +265,9 @@ toolbox_create_tools (GtkWidget *wbox,
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);
if (tool_info == active_tool)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
g_signal_connect (G_OBJECT (button), "toggled",
G_CALLBACK (toolbox_tool_button_toggled),
tool_info);
@ -380,8 +373,8 @@ toolbox_tool_changed (GimpContext *context,
{
GtkWidget *toolbox_button;
toolbox_button =
g_object_get_data (G_OBJECT (tool_info), "toolbox-button");
toolbox_button = g_object_get_data (G_OBJECT (tool_info),
"toolbox-button");
if (toolbox_button && ! GTK_TOGGLE_BUTTON (toolbox_button)->active)
{
@ -389,7 +382,8 @@ toolbox_tool_changed (GimpContext *context,
toolbox_tool_button_toggled,
tool_info);
gtk_widget_activate (toolbox_button);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toolbox_button),
TRUE);
g_signal_handlers_unblock_by_func (G_OBJECT (toolbox_button),
toolbox_tool_button_toggled,
@ -468,6 +462,7 @@ toolbox_style_set (GtkWidget *window,
GtkRequisition indicator_requisition;
GdkGeometry geometry;
gint border_width;
gint spacing;
GList *children;
children =
@ -491,9 +486,12 @@ toolbox_style_set (GtkWidget *window,
border_width =
gtk_container_get_border_width (GTK_CONTAINER (GTK_BIN (window)->child));
spacing = gtk_box_get_spacing (GTK_BOX (GTK_BIN (window)->child));
geometry.min_width = (2 * border_width +
2 * button_requisition.width);
geometry.min_height = (2 * border_width +
spacing +
button_requisition.height +
menubar_requisition.height +
MAX (color_requisition.height,

View File

@ -21,7 +21,6 @@
GtkWidget * toolbox_create (Gimp *gimp);
void toolbox_free (Gimp *gimp);
#endif /* __TOOLBOX_H__ */

View File

@ -329,7 +329,6 @@ selection_options_init (SelectionOptions *options,
{
GtkWidget *frame;
GtkWidget *vbox2;
GtkWidget *alignment;
GtkWidget *table;
GtkWidget *width_spinbutton;
GtkWidget *height_spinbutton;
@ -378,11 +377,6 @@ selection_options_init (SelectionOptions *options,
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_set_border_width (GTK_CONTAINER (alignment), 2);
gtk_container_add (GTK_CONTAINER (frame), alignment);
gtk_widget_show (alignment);
options->fixed_size_w =
gtk_check_button_new_with_label (_("Fixed Size / Aspect Ratio"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->fixed_size_w),
@ -394,40 +388,37 @@ selection_options_init (SelectionOptions *options,
G_CALLBACK (gimp_toggle_button_update),
&options->fixed_size);
gtk_widget_set_sensitive (alignment, options->fixed_size_d);
g_object_set_data (G_OBJECT (options->fixed_size_w), "set_sensitive",
alignment);
table = gtk_table_new (3, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
table = gtk_table_new (3, 3, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
gtk_container_add (GTK_CONTAINER (alignment), table);
gtk_container_add (GTK_CONTAINER (frame), table);
options->fixed_width_w =
gtk_adjustment_new (options->fixed_width_d, 1e-5, 32767.0,
1.0, 50.0, 0.0);
width_spinbutton =
gtk_spin_button_new (GTK_ADJUSTMENT (options->fixed_width_w), 1.0, 0.0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (width_spinbutton), TRUE);
gtk_widget_set_size_request (width_spinbutton, 75, -1);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Width:"), 1.0, 0.5,
width_spinbutton, 1, FALSE);
gtk_widget_set_sensitive (table, options->fixed_size_d);
g_object_set_data (G_OBJECT (options->fixed_size_w), "set_sensitive",
table);
options->fixed_width_w = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("Width:"), -1, 50,
options->fixed_width_d,
1.0, 100.0, 1.0, 50.0, 1,
FALSE, 1e-5, 32767.0,
NULL, NULL);
width_spinbutton = GIMP_SCALE_ENTRY_SPINBUTTON (options->fixed_width_w);
g_signal_connect (G_OBJECT (options->fixed_width_w), "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
&options->fixed_width);
options->fixed_height_w =
gtk_adjustment_new (options->fixed_height_d, 1e-5, 32767.0,
1.0, 50.0, 0.0);
height_spinbutton =
gtk_spin_button_new (GTK_ADJUSTMENT (options->fixed_height_w), 1.0, 0.0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height_spinbutton), TRUE);
gtk_widget_set_size_request (height_spinbutton, 75, -1);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Height:"), 1.0, 0.5,
height_spinbutton, 1, FALSE);
options->fixed_height_w = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Height:"), -1, 50,
options->fixed_height_d,
1.0, 100.0, 1.0, 50.0, 1,
FALSE, 1e-5, 32767.0,
NULL, NULL);
height_spinbutton = GIMP_SCALE_ENTRY_SPINBUTTON (options->fixed_height_w);
g_signal_connect (G_OBJECT (options->fixed_height_w), "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
@ -435,13 +426,14 @@ selection_options_init (SelectionOptions *options,
options->fixed_unit_w =
gimp_unit_menu_new ("%a", options->fixed_unit_d, TRUE, TRUE, TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Unit:"), 1.0, 0.5,
options->fixed_unit_w, 2, TRUE);
g_object_set_data (G_OBJECT (options->fixed_unit_w), "set_digits",
width_spinbutton);
g_object_set_data (G_OBJECT (width_spinbutton), "set_digits",
height_spinbutton);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Unit:"), 1.0, 0.5,
options->fixed_unit_w, 1, FALSE);
g_signal_connect (G_OBJECT (options->fixed_unit_w), "unit_changed",
G_CALLBACK (gimp_unit_menu_update),

View File

@ -593,6 +593,11 @@ text_tool_options_new (GimpToolInfo *tool_info)
/* the main vbox */
vbox = options->tool_options.main_vbox;
table = gtk_table_new (4, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (table), FALSE, FALSE, 0);
pango_context = pango_ft2_get_context (gimprc.monitor_xres,
gimprc.monitor_yres);
@ -602,51 +607,52 @@ text_tool_options_new (GimpToolInfo *tool_info)
gimp_font_selection_set_fontname
(GIMP_FONT_SELECTION (options->font_selection), DEFAULT_FONT);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (options->font_selection),
FALSE, FALSE, 0);
gtk_widget_show (options->font_selection);
/* the size entries */
table = gtk_table_new (3, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (table), FALSE, FALSE, 0);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Font:"), 1.0, 0.5,
options->font_selection, 2, FALSE);
options->size_w = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Size:"), -1, 50,
options->size_d,
1.0, 256.0, 1.0, 50.0, 1,
FALSE, 1e-5, 32767.0,
NULL, NULL);
size_spinbutton = GIMP_SCALE_ENTRY_SPINBUTTON (options->size_w);
options->size_w = gtk_adjustment_new (options->size_d, 1e-5, 32767.0,
1.0, 50.0, 0.0);
size_spinbutton =
gtk_spin_button_new (GTK_ADJUSTMENT (options->size_w), 1.0, 0.0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (size_spinbutton), TRUE);
g_signal_connect (G_OBJECT (options->size_w), "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
&options->size);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Size:"), 1.0, 0.5,
size_spinbutton, 1, FALSE);
options->border_w = gtk_adjustment_new (options->border_d, 1e-5, 32767.0,
1.0, 50.0, 0.0);
border_spinbutton =
gtk_spin_button_new (GTK_ADJUSTMENT (options->border_w), 1.0, 0.0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (border_spinbutton), TRUE);
options->border_w = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
_("Border:"), -1, 50,
options->border_d,
0.0, 100.0, 1.0, 50.0, 1,
FALSE, 0.0, 32767.0,
NULL, NULL);
border_spinbutton = GIMP_SCALE_ENTRY_SPINBUTTON (options->border_w);
g_signal_connect (G_OBJECT (options->border_w), "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
&options->border);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Border:"), 1.0, 0.5,
border_spinbutton, 1, FALSE);
options->unit_w =
gimp_unit_menu_new ("%a", options->unit_d, TRUE, FALSE, TRUE);
g_signal_connect (G_OBJECT (options->unit_w), "unit_changed",
G_CALLBACK (gimp_unit_menu_update),
&options->unit);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
_("Unit:"), 1.0, 0.5,
options->unit_w, 2, TRUE);
g_object_set_data (G_OBJECT (options->unit_w), "set_digits",
size_spinbutton);
g_object_set_data (G_OBJECT (size_spinbutton), "set_digits",
border_spinbutton);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Unit:"), 1.0, 0.5,
options->unit_w, 1, FALSE);
g_signal_connect (G_OBJECT (options->unit_w), "unit_changed",
G_CALLBACK (gimp_unit_menu_update),
&options->unit);
gtk_widget_show (table);

View File

@ -329,7 +329,6 @@ selection_options_init (SelectionOptions *options,
{
GtkWidget *frame;
GtkWidget *vbox2;
GtkWidget *alignment;
GtkWidget *table;
GtkWidget *width_spinbutton;
GtkWidget *height_spinbutton;
@ -378,11 +377,6 @@ selection_options_init (SelectionOptions *options,
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_set_border_width (GTK_CONTAINER (alignment), 2);
gtk_container_add (GTK_CONTAINER (frame), alignment);
gtk_widget_show (alignment);
options->fixed_size_w =
gtk_check_button_new_with_label (_("Fixed Size / Aspect Ratio"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->fixed_size_w),
@ -394,40 +388,37 @@ selection_options_init (SelectionOptions *options,
G_CALLBACK (gimp_toggle_button_update),
&options->fixed_size);
gtk_widget_set_sensitive (alignment, options->fixed_size_d);
g_object_set_data (G_OBJECT (options->fixed_size_w), "set_sensitive",
alignment);
table = gtk_table_new (3, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
table = gtk_table_new (3, 3, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
gtk_container_add (GTK_CONTAINER (alignment), table);
gtk_container_add (GTK_CONTAINER (frame), table);
options->fixed_width_w =
gtk_adjustment_new (options->fixed_width_d, 1e-5, 32767.0,
1.0, 50.0, 0.0);
width_spinbutton =
gtk_spin_button_new (GTK_ADJUSTMENT (options->fixed_width_w), 1.0, 0.0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (width_spinbutton), TRUE);
gtk_widget_set_size_request (width_spinbutton, 75, -1);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Width:"), 1.0, 0.5,
width_spinbutton, 1, FALSE);
gtk_widget_set_sensitive (table, options->fixed_size_d);
g_object_set_data (G_OBJECT (options->fixed_size_w), "set_sensitive",
table);
options->fixed_width_w = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("Width:"), -1, 50,
options->fixed_width_d,
1.0, 100.0, 1.0, 50.0, 1,
FALSE, 1e-5, 32767.0,
NULL, NULL);
width_spinbutton = GIMP_SCALE_ENTRY_SPINBUTTON (options->fixed_width_w);
g_signal_connect (G_OBJECT (options->fixed_width_w), "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
&options->fixed_width);
options->fixed_height_w =
gtk_adjustment_new (options->fixed_height_d, 1e-5, 32767.0,
1.0, 50.0, 0.0);
height_spinbutton =
gtk_spin_button_new (GTK_ADJUSTMENT (options->fixed_height_w), 1.0, 0.0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height_spinbutton), TRUE);
gtk_widget_set_size_request (height_spinbutton, 75, -1);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Height:"), 1.0, 0.5,
height_spinbutton, 1, FALSE);
options->fixed_height_w = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Height:"), -1, 50,
options->fixed_height_d,
1.0, 100.0, 1.0, 50.0, 1,
FALSE, 1e-5, 32767.0,
NULL, NULL);
height_spinbutton = GIMP_SCALE_ENTRY_SPINBUTTON (options->fixed_height_w);
g_signal_connect (G_OBJECT (options->fixed_height_w), "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
@ -435,13 +426,14 @@ selection_options_init (SelectionOptions *options,
options->fixed_unit_w =
gimp_unit_menu_new ("%a", options->fixed_unit_d, TRUE, TRUE, TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Unit:"), 1.0, 0.5,
options->fixed_unit_w, 2, TRUE);
g_object_set_data (G_OBJECT (options->fixed_unit_w), "set_digits",
width_spinbutton);
g_object_set_data (G_OBJECT (width_spinbutton), "set_digits",
height_spinbutton);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Unit:"), 1.0, 0.5,
options->fixed_unit_w, 1, FALSE);
g_signal_connect (G_OBJECT (options->fixed_unit_w), "unit_changed",
G_CALLBACK (gimp_unit_menu_update),

View File

@ -116,8 +116,7 @@ gimp_brush_factory_view_init (GimpBrushFactoryView *view)
TRUE, 0.0, 0.0,
NULL, NULL));
view->spacing_scale =
GTK_WIDGET (GIMP_SCALE_ENTRY_SCALE (view->spacing_adjustment));
view->spacing_scale = GIMP_SCALE_ENTRY_SCALE (view->spacing_adjustment);
g_signal_connect (G_OBJECT (view->spacing_adjustment), "value_changed",
G_CALLBACK (gimp_brush_factory_view_spacing_update),

View File

@ -61,6 +61,7 @@ typedef enum
static void gimp_dialog_factory_class_init (GimpDialogFactoryClass *klass);
static void gimp_dialog_factory_init (GimpDialogFactory *factory);
static void gimp_dialog_factory_dispose (GObject *object);
static void gimp_dialog_factory_finalize (GObject *object);
static void gimp_dialog_factories_save_foreach (gchar *name,
@ -131,6 +132,7 @@ gimp_dialog_factory_class_init (GimpDialogFactoryClass *klass)
parent_class = g_type_class_peek_parent (klass);
object_class->dispose = gimp_dialog_factory_dispose;
object_class->finalize = gimp_dialog_factory_finalize;
klass->factories = g_hash_table_new (g_str_hash, g_str_equal);
@ -146,6 +148,36 @@ gimp_dialog_factory_init (GimpDialogFactory *factory)
factory->open_dialogs = NULL;
}
static void
gimp_dialog_factory_dispose (GObject *object)
{
GimpDialogFactory *factory;
GList *list;
factory = GIMP_DIALOG_FACTORY (object);
while (factory->open_dialogs)
{
for (list = factory->open_dialogs; list; list = g_list_next (list))
{
if (GTK_WIDGET_TOPLEVEL (list->data))
{
gtk_widget_destroy (GTK_WIDGET (list->data));
break;
}
}
if (! list)
{
g_warning ("%s: stale entries in factory->open_dialogs",
G_GNUC_FUNCTION);
break;
}
}
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
gimp_dialog_factory_finalize (GObject *object)
{
@ -200,7 +232,7 @@ gimp_dialog_factory_new (const gchar *name,
if (g_hash_table_lookup (factory_class->factories, name))
{
g_warning ("%s(): dialog factory \"%s\" already exists",
g_warning ("%s: dialog factory \"%s\" already exists",
G_GNUC_FUNCTION, name);
return NULL;
}
@ -332,14 +364,14 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
if (! entry)
{
g_warning ("%s(): no entry entry registered for \"%s\"",
g_warning ("%s: no entry entry registered for \"%s\"",
G_GNUC_FUNCTION, identifier);
return NULL;
}
if (! entry->new_func)
{
g_warning ("%s(): entry for \"%s\" has no constructor",
g_warning ("%s: entry for \"%s\" has no constructor",
G_GNUC_FUNCTION, identifier);
return NULL;
}
@ -419,7 +451,7 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
}
else
{
g_warning ("%s(): GimpDialogFactory is a dockable factory "
g_warning ("%s: GimpDialogFactory is a dockable factory "
"but constructor for \"%s\" did not return a "
"GimpDockable",
G_GNUC_FUNCTION, identifier);
@ -432,7 +464,7 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
}
else if (dock)
{
g_warning ("%s(): constructor for \"%s\" returned NULL",
g_warning ("%s: constructor for \"%s\" returned NULL",
G_GNUC_FUNCTION, identifier);
gtk_widget_destroy (dock);
@ -626,7 +658,7 @@ gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
if (g_list_find (factory->open_dialogs, dialog))
{
g_warning ("%s(): dialog already registered", G_GNUC_FUNCTION);
g_warning ("%s: dialog already registered", G_GNUC_FUNCTION);
return;
}
@ -636,14 +668,14 @@ gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
if (! (dialog_factory && (entry || GIMP_IS_DOCK (dialog))))
{
g_warning ("%s(): dialog was not created by a GimpDialogFactory",
g_warning ("%s: dialog was not created by a GimpDialogFactory",
G_GNUC_FUNCTION);
return;
}
if (dialog_factory != factory)
{
g_warning ("%s(): dialog was created by a different GimpDialogFactory",
g_warning ("%s: dialog was created by a different GimpDialogFactory",
G_GNUC_FUNCTION);
return;
}
@ -670,7 +702,7 @@ gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
{
if (entry->singleton)
{
g_warning ("%s(): singleton dialog \"%s\" created twice",
g_warning ("%s: singleton dialog \"%s\" created twice",
G_GNUC_FUNCTION, entry->identifier);
g_print ("%s: corrupt session info: %p (widget %p)\n",
@ -780,7 +812,7 @@ gimp_dialog_factory_remove_dialog (GimpDialogFactory *factory,
if (! g_list_find (factory->open_dialogs, dialog))
{
g_warning ("%s(): dialog not registered", G_GNUC_FUNCTION);
g_warning ("%s: dialog not registered", G_GNUC_FUNCTION);
return;
}
@ -792,14 +824,14 @@ gimp_dialog_factory_remove_dialog (GimpDialogFactory *factory,
if (! (dialog_factory && (entry || GIMP_IS_DOCK (dialog))))
{
g_warning ("%s(): dialog was not created by a GimpDialogFactory",
g_warning ("%s: dialog was not created by a GimpDialogFactory",
G_GNUC_FUNCTION);
return;
}
if (dialog_factory != factory)
{
g_warning ("%s(): dialog was created by a different GimpDialogFactory",
g_warning ("%s: dialog was created by a different GimpDialogFactory",
G_GNUC_FUNCTION);
return;
}

View File

@ -99,9 +99,9 @@ gimp_font_selection_get_type (void)
static void
gimp_font_selection_class_init (GimpFontSelectionClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GObjectClass *object_class;
object_class = (GObjectClass *) klass;
object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
@ -133,24 +133,28 @@ gimp_font_selection_init (GimpFontSelection *fontsel)
gtk_widget_show (fontsel->valid);
fontsel->entry = gtk_entry_new ();
gtk_entry_set_width_chars (GTK_ENTRY (fontsel->entry), 16);
gtk_box_pack_start (GTK_BOX (fontsel), fontsel->entry, TRUE, TRUE, 0);
gtk_widget_show (fontsel->entry);
g_signal_connect (G_OBJECT (fontsel->entry), "activate",
G_CALLBACK (gimp_font_selection_entry_callback),
fontsel);
g_signal_connect (G_OBJECT (fontsel->entry), "focus_out_event",
G_CALLBACK (gimp_font_selection_entry_focus_out),
fontsel);
gtk_widget_show (fontsel->entry);
button = gtk_button_new ();
gtk_box_pack_end (GTK_BOX (fontsel), button, FALSE, FALSE, 0);
gtk_widget_show (button);
image = gtk_image_new_from_stock (GTK_STOCK_SELECT_FONT, GTK_ICON_SIZE_MENU);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);
gtk_box_pack_end (GTK_BOX (fontsel), button, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (gimp_font_selection_browse_callback),
fontsel);
gtk_widget_show (button);
}
static void

View File

@ -96,7 +96,6 @@ static void toolbox_drop_buffer (GtkWidget *widget,
/* local variables */
static GtkWidget *toolbox_shell = NULL;
static GtkTargetEntry toolbox_target_table[] =
{
@ -226,19 +225,7 @@ toolbox_create (Gimp *gimp)
toolbox_style_set (window, NULL, gimp);
gtk_widget_show (window);
toolbox_shell = window;
return toolbox_shell;
}
void
toolbox_free (Gimp *gimp)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
gtk_widget_destroy (toolbox_shell);
return window;
}
@ -248,9 +235,12 @@ static void
toolbox_create_tools (GtkWidget *wbox,
GimpContext *context)
{
GimpToolInfo *active_tool;
GList *list;
GSList *group = NULL;
active_tool = gimp_context_get_tool (context);
for (list = GIMP_LIST (context->gimp->tool_info_list)->list;
list;
list = g_list_next (list))
@ -275,6 +265,9 @@ toolbox_create_tools (GtkWidget *wbox,
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);
if (tool_info == active_tool)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
g_signal_connect (G_OBJECT (button), "toggled",
G_CALLBACK (toolbox_tool_button_toggled),
tool_info);
@ -380,8 +373,8 @@ toolbox_tool_changed (GimpContext *context,
{
GtkWidget *toolbox_button;
toolbox_button =
g_object_get_data (G_OBJECT (tool_info), "toolbox-button");
toolbox_button = g_object_get_data (G_OBJECT (tool_info),
"toolbox-button");
if (toolbox_button && ! GTK_TOGGLE_BUTTON (toolbox_button)->active)
{
@ -389,7 +382,8 @@ toolbox_tool_changed (GimpContext *context,
toolbox_tool_button_toggled,
tool_info);
gtk_widget_activate (toolbox_button);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toolbox_button),
TRUE);
g_signal_handlers_unblock_by_func (G_OBJECT (toolbox_button),
toolbox_tool_button_toggled,
@ -468,6 +462,7 @@ toolbox_style_set (GtkWidget *window,
GtkRequisition indicator_requisition;
GdkGeometry geometry;
gint border_width;
gint spacing;
GList *children;
children =
@ -491,9 +486,12 @@ toolbox_style_set (GtkWidget *window,
border_width =
gtk_container_get_border_width (GTK_CONTAINER (GTK_BIN (window)->child));
spacing = gtk_box_get_spacing (GTK_BOX (GTK_BIN (window)->child));
geometry.min_width = (2 * border_width +
2 * button_requisition.width);
geometry.min_height = (2 * border_width +
spacing +
button_requisition.height +
menubar_requisition.height +
MAX (color_requisition.height,

View File

@ -21,7 +21,6 @@
GtkWidget * toolbox_create (Gimp *gimp);
void toolbox_free (Gimp *gimp);
#endif /* __TOOLBOX_H__ */

View File

@ -127,16 +127,16 @@ GtkWidget * gimp_spin_button_new (/* return value: */
guint digits);
#define GIMP_SCALE_ENTRY_LABEL(adj) \
GTK_LABEL (g_object_get_data (G_OBJECT (adj), "label"))
(g_object_get_data (G_OBJECT (adj), "label"))
#define GIMP_SCALE_ENTRY_SCALE(adj) \
GTK_HSCALE (g_object_get_data (G_OBJECT (adj), "scale"))
(g_object_get_data (G_OBJECT (adj), "scale"))
#define GIMP_SCALE_ENTRY_SCALE_ADJ(adj) \
gtk_range_get_adjustment \
(GTK_RANGE (g_object_get_data (G_OBJECT (adj), "scale")))
#define GIMP_SCALE_ENTRY_SPINBUTTON(adj) \
GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (adj), "spinbutton"))
(g_object_get_data (G_OBJECT (adj), "spinbutton"))
#define GIMP_SCALE_ENTRY_SPINBUTTON_ADJ(adj) \
gtk_spin_button_get_adjustment \
(GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (adj), "spinbutton")))
@ -160,13 +160,13 @@ GtkObject * gimp_scale_entry_new (GtkTable *table,
const gchar *help_data);
#define GIMP_RANDOM_SEED_SPINBUTTON(hbox) \
GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (hbox), "spinbutton"))
(g_object_get_data (G_OBJECT (hbox), "spinbutton"))
#define GIMP_RANDOM_SEED_SPINBUTTON_ADJ(hbox) \
gtk_spin_button_get_adjustment \
(GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (hbox), "spinbutton")))
#define GIMP_RANDOM_SEED_TOGGLEBUTTON(hbox) \
GTK_TOGGLE_BUTTON (g_object_get_data (G_OBJECT (hbox), "togglebutton"))
(g_object_get_data (G_OBJECT (hbox), "togglebutton"))
GtkWidget * gimp_random_seed_new (gint *seed,
gint *use_time,
@ -174,8 +174,7 @@ GtkWidget * gimp_random_seed_new (gint *seed,
gint time_false);
#define GIMP_COORDINATES_CHAINBUTTON(sizeentry) \
GIMP_CHAIN_BUTTON (g_object_get_data (G_OBJECT (sizeentry), \
"chainbutton"))
(g_object_get_data (G_OBJECT (sizeentry), "chainbutton"))
GtkWidget * gimp_coordinates_new (GimpUnit unit,
const gchar *unit_format,
@ -204,12 +203,12 @@ GtkWidget * gimp_coordinates_new (GimpUnit unit,
gdouble ysize_100 /* % */);
#define GIMP_MEM_SIZE_ENTRY_SPINBUTTON(memsize) \
GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (memsize), "spinbutton"))
(g_object_get_data (G_OBJECT (memsize), "spinbutton"))
#define GIMP_MEM_SIZE_ENTRY_SPINBUTTON_ADJ(memsize) \
gtk_spin_button_get_adjustment \
(GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (memsize), "spinbutton")))
#define GIMP_MEM_SIZE_ENTRY_OPTIONMENU(memsize) \
GTK_OPTION_MENU (g_object_get_data (G_OBJECT (memsize), "optionmenu"))
(g_object_get_data (G_OBJECT (memsize), "optionmenu"))
GtkWidget * gimp_mem_size_entry_new (GtkAdjustment *adjustment);