From 80a40f0b9654173d598d787cea5fbbcee621704b Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 28 Jul 2004 00:04:13 +0000 Subject: [PATCH] libgimp/gimpbrushselect.c libgimp/gimpfontselect.c 2004-07-28 Michael Natterer * libgimp/gimpbrushselect.c * libgimp/gimpfontselect.c * libgimp/gimpgradientselect.c * libgimp/gimppalettemenu.c * libgimp/gimppaletteselect.c * libgimp/gimppatternselect.c (gimp_*_select_destroy): don't leak the selected object's name and its data (brush mask etc). * libgimp/gimpfontmenu.c: moved the icon to the left side of the button. * libgimp/gimppalettemenu.c: ditto. Added "Since: GIMP 2.2" to API docs. --- ChangeLog | 16 ++++++++++++++++ libgimp/gimpbrushselect.c | 9 ++++----- libgimp/gimpfontmenu.c | 8 ++++---- libgimp/gimpfontselect.c | 7 +++---- libgimp/gimpfontselectbutton.c | 8 ++++---- libgimp/gimpgradientselect.c | 9 ++++----- libgimp/gimppalettemenu.c | 14 ++++++++++---- libgimp/gimppaletteselect.c | 7 +++---- libgimp/gimppatternselect.c | 9 ++++----- 9 files changed, 52 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index 58c2a077a0..7210f75923 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2004-07-28 Michael Natterer + + * libgimp/gimpbrushselect.c + * libgimp/gimpfontselect.c + * libgimp/gimpgradientselect.c + * libgimp/gimppalettemenu.c + * libgimp/gimppaletteselect.c + * libgimp/gimppatternselect.c (gimp_*_select_destroy): don't + leak the selected object's name and its data (brush mask etc). + + * libgimp/gimpfontmenu.c: moved the icon to the left side of the + button. + + * libgimp/gimppalettemenu.c: ditto. Added "Since: GIMP 2.2" to + API docs. + 2004-07-28 Michael Natterer * app/widgets/gimpactiongroup.c diff --git a/libgimp/gimpbrushselect.c b/libgimp/gimpbrushselect.c index be8a0f6a59..af96f01891 100644 --- a/libgimp/gimpbrushselect.c +++ b/libgimp/gimpbrushselect.c @@ -144,11 +144,10 @@ gimp_brush_select_destroy (const gchar *brush_callback) } if (brush_data->idle_id) - { - g_source_remove (brush_data->idle_id); - g_free (brush_data->brush_name); - g_free (brush_data->brush_mask_data); - } + g_source_remove (brush_data->idle_id); + + g_free (brush_data->brush_name); + g_free (brush_data->brush_mask_data); if (brush_data->brush_callback) gimp_brushes_close_popup (brush_data->brush_callback); diff --git a/libgimp/gimpfontmenu.c b/libgimp/gimpfontmenu.c index c3f3a9922a..66dcd09474 100644 --- a/libgimp/gimpfontmenu.c +++ b/libgimp/gimpfontmenu.c @@ -109,14 +109,14 @@ gimp_font_select_widget_new (const gchar *title, gtk_container_add (GTK_CONTAINER (font_sel->button), hbox); gtk_widget_show (hbox); + image = gtk_image_new_from_stock (GIMP_STOCK_FONT, GTK_ICON_SIZE_BUTTON); + gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); + gtk_widget_show (image); + font_sel->label = gtk_label_new (font_name); gtk_box_pack_start (GTK_BOX (hbox), font_sel->label, TRUE, TRUE, 4); gtk_widget_show (font_sel->label); - image = gtk_image_new_from_stock (GIMP_STOCK_FONT, GTK_ICON_SIZE_BUTTON); - gtk_box_pack_end (GTK_BOX (hbox), image, FALSE, FALSE, 4); - gtk_widget_show (image); - g_object_set_data (G_OBJECT (font_sel->button), FONT_SELECT_DATA_KEY, font_sel); diff --git a/libgimp/gimpfontselect.c b/libgimp/gimpfontselect.c index 4a0fbcb467..c329182b13 100644 --- a/libgimp/gimpfontselect.c +++ b/libgimp/gimpfontselect.c @@ -127,10 +127,9 @@ gimp_font_select_destroy (const gchar *font_callback) } if (font_data->idle_id) - { - g_source_remove (font_data->idle_id); - g_free (font_data->font_name); - } + g_source_remove (font_data->idle_id); + + g_free (font_data->font_name); if (font_data->font_callback) gimp_fonts_close_popup (font_data->font_callback); diff --git a/libgimp/gimpfontselectbutton.c b/libgimp/gimpfontselectbutton.c index c3f3a9922a..66dcd09474 100644 --- a/libgimp/gimpfontselectbutton.c +++ b/libgimp/gimpfontselectbutton.c @@ -109,14 +109,14 @@ gimp_font_select_widget_new (const gchar *title, gtk_container_add (GTK_CONTAINER (font_sel->button), hbox); gtk_widget_show (hbox); + image = gtk_image_new_from_stock (GIMP_STOCK_FONT, GTK_ICON_SIZE_BUTTON); + gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); + gtk_widget_show (image); + font_sel->label = gtk_label_new (font_name); gtk_box_pack_start (GTK_BOX (hbox), font_sel->label, TRUE, TRUE, 4); gtk_widget_show (font_sel->label); - image = gtk_image_new_from_stock (GIMP_STOCK_FONT, GTK_ICON_SIZE_BUTTON); - gtk_box_pack_end (GTK_BOX (hbox), image, FALSE, FALSE, 4); - gtk_widget_show (image); - g_object_set_data (G_OBJECT (font_sel->button), FONT_SELECT_DATA_KEY, font_sel); diff --git a/libgimp/gimpgradientselect.c b/libgimp/gimpgradientselect.c index cd5cdc808b..1bb6d01033 100644 --- a/libgimp/gimpgradientselect.c +++ b/libgimp/gimpgradientselect.c @@ -136,11 +136,10 @@ gimp_gradient_select_destroy (const gchar *gradient_callback) } if (gradient_data->idle_id) - { - g_source_remove (gradient_data->idle_id); - g_free (gradient_data->gradient_name); - g_free (gradient_data->gradient_data); - } + g_source_remove (gradient_data->idle_id); + + g_free (gradient_data->gradient_name); + g_free (gradient_data->gradient_data); if (gradient_data->gradient_callback) gimp_gradients_close_popup (gradient_data->gradient_callback); diff --git a/libgimp/gimppalettemenu.c b/libgimp/gimppalettemenu.c index 68e5c1eadd..95905e6c7d 100644 --- a/libgimp/gimppalettemenu.c +++ b/libgimp/gimppalettemenu.c @@ -72,6 +72,8 @@ static void gimp_palette_select_widget_destroy (GtkWidget *widget, * plug-in dialog. * * Returns: A #GtkWidget that you can use in your UI. + * + * Since: GIMP 2.2 */ GtkWidget * gimp_palette_select_widget_new (const gchar *title, @@ -109,14 +111,14 @@ gimp_palette_select_widget_new (const gchar *title, gtk_container_add (GTK_CONTAINER (palette_sel->button), hbox); gtk_widget_show (hbox); + image = gtk_image_new_from_stock (GIMP_STOCK_PALETTE, GTK_ICON_SIZE_BUTTON); + gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); + gtk_widget_show (image); + palette_sel->label = gtk_label_new (palette_name); gtk_box_pack_start (GTK_BOX (hbox), palette_sel->label, TRUE, TRUE, 4); gtk_widget_show (palette_sel->label); - image = gtk_image_new_from_stock (GIMP_STOCK_PALETTE, GTK_ICON_SIZE_BUTTON); - gtk_box_pack_end (GTK_BOX (hbox), image, FALSE, FALSE, 4); - gtk_widget_show (image); - g_object_set_data (G_OBJECT (palette_sel->button), PALETTE_SELECT_DATA_KEY, palette_sel); @@ -128,6 +130,8 @@ gimp_palette_select_widget_new (const gchar *title, * @widget: A palette select widget. * * Closes the popup window associated with @widget. + * + * Since: GIMP 2.2 */ void gimp_palette_select_widget_close (GtkWidget *widget) @@ -153,6 +157,8 @@ gimp_palette_select_widget_close (GtkWidget *widget) * Sets the current palette for the palette select widget. Calls the * callback function if one was supplied in the call to * gimp_palette_select_widget_new(). + * + * Since: GIMP 2.2 */ void gimp_palette_select_widget_set (GtkWidget *widget, diff --git a/libgimp/gimppaletteselect.c b/libgimp/gimppaletteselect.c index 6a33323062..ca70aa8d3d 100644 --- a/libgimp/gimppaletteselect.c +++ b/libgimp/gimppaletteselect.c @@ -128,10 +128,9 @@ gimp_palette_select_destroy (const gchar *palette_callback) } if (palette_data->idle_id) - { - g_source_remove (palette_data->idle_id); - g_free (palette_data->palette_name); - } + g_source_remove (palette_data->idle_id); + + g_free (palette_data->palette_name); if (palette_data->palette_callback) gimp_palettes_close_popup (palette_data->palette_callback); diff --git a/libgimp/gimppatternselect.c b/libgimp/gimppatternselect.c index 639bbb88e0..39e17c3d6e 100644 --- a/libgimp/gimppatternselect.c +++ b/libgimp/gimppatternselect.c @@ -138,11 +138,10 @@ gimp_pattern_select_destroy (const gchar *pattern_callback) } if (pattern_data->idle_id) - { - g_source_remove (pattern_data->idle_id); - g_free (pattern_data->pattern_name); - g_free (pattern_data->pattern_mask_data); - } + g_source_remove (pattern_data->idle_id); + + g_free (pattern_data->pattern_name); + g_free (pattern_data->pattern_mask_data); if (pattern_data->pattern_callback) gimp_patterns_close_popup (pattern_data->pattern_callback);