Commit 114e0d7f authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

libgimp/gimpbrushselect.c libgimp/gimpgradientselect.c

2007-05-22  Sven Neumann  <sven@gimp.org>

	* libgimp/gimpbrushselect.c
	* libgimp/gimpgradientselect.c
	* libgimp/gimpfontselect.c
	* libgimp/gimppatternselect.c
	* libgimp/gimppaletteselect.c: allocate structs using GSlice.

svn path=/trunk/; revision=22565
parent 203930da
2007-05-22 Sven Neumann <sven@gimp.org>
* libgimp/gimpbrushselect.c
* libgimp/gimpgradientselect.c
* libgimp/gimpfontselect.c
* libgimp/gimppatternselect.c
* libgimp/gimppaletteselect.c: allocate structs using GSlice.
2007-05-22 Sven Neumann <sven@gimp.org>
* libgimpbase/gimpprotocol.c: allocate structs using GSlice.
......@@ -24,9 +24,7 @@
#include "gimp.h"
typedef struct _GimpBrushData GimpBrushData;
struct _GimpBrushData
typedef struct
{
gchar *brush_callback;
guint idle_id;
......@@ -40,11 +38,13 @@ struct _GimpBrushData
GimpRunBrushCallback callback;
gboolean closing;
gpointer data;
};
} GimpBrushData;
/* local function prototypes */
static void gimp_brush_data_free (GimpBrushData *data);
static void gimp_temp_brush_run (const gchar *name,
gint nparams,
const GimpParam *param,
......@@ -107,10 +107,14 @@ gimp_brush_select_new (const gchar *title,
/* Now add to hash table so we can find it again */
if (! gimp_brush_select_ht)
gimp_brush_select_ht = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_free);
{
gimp_brush_select_ht =
g_hash_table_new_full (g_str_hash, g_str_equal,
g_free,
(GDestroyNotify) gimp_brush_data_free);
}
brush_data = g_new0 (GimpBrushData, 1);
brush_data = g_slice_new0 (GimpBrushData);
brush_data->brush_callback = brush_callback;
brush_data->callback = callback;
......@@ -160,6 +164,12 @@ gimp_brush_select_destroy (const gchar *brush_callback)
/* private functions */
static void
gimp_brush_data_free (GimpBrushData *data)
{
g_slice_free (GimpBrushData, data);
}
static void
gimp_temp_brush_run (const gchar *name,
gint nparams,
......
......@@ -24,9 +24,7 @@
#include "gimp.h"
typedef struct _GimpFontData GimpFontData;
struct _GimpFontData
typedef struct
{
gchar *font_callback;
guint idle_id;
......@@ -34,11 +32,13 @@ struct _GimpFontData
GimpRunFontCallback callback;
gboolean closing;
gpointer data;
};
} GimpFontData;
/* local function prototypes */
static void gimp_font_data_free (GimpFontData *data);
static void gimp_temp_font_run (const gchar *name,
gint nparams,
const GimpParam *param,
......@@ -90,10 +90,14 @@ gimp_font_select_new (const gchar *title,
/* Now add to hash table so we can find it again */
if (! gimp_font_select_ht)
gimp_font_select_ht = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_free);
{
gimp_font_select_ht =
g_hash_table_new_full (g_str_hash, g_str_equal,
g_free,
(GDestroyNotify) gimp_font_data_free);
}
font_data = g_new0 (GimpFontData, 1);
font_data = g_slice_new0 (GimpFontData);
font_data->font_callback = font_callback;
font_data->callback = callback;
......@@ -142,6 +146,12 @@ gimp_font_select_destroy (const gchar *font_callback)
/* private functions */
static void
gimp_font_data_free (GimpFontData *data)
{
g_slice_free (GimpFontData, data);
}
static void
gimp_temp_font_run (const gchar *name,
gint nparams,
......
......@@ -24,9 +24,7 @@
#include "gimp.h"
typedef struct _GimpGradientData GimpGradientData;
struct _GimpGradientData
typedef struct
{
gchar *gradient_callback;
guint idle_id;
......@@ -36,11 +34,13 @@ struct _GimpGradientData
GimpRunGradientCallback callback;
gboolean closing;
gpointer data;
};
} GimpGradientData;
/* local function prototypes */
static void gimp_gradient_data_free (GimpGradientData *data);
static void gimp_temp_gradient_run (const gchar *name,
gint nparams,
const GimpParam *param,
......@@ -96,11 +96,14 @@ gimp_gradient_select_new (const gchar *title,
/* Now add to hash table so we can find it again */
if (! gimp_gradient_select_ht)
gimp_gradient_select_ht = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free, g_free);
{
gimp_gradient_select_ht =
g_hash_table_new_full (g_str_hash, g_str_equal,
g_free,
(GDestroyNotify) gimp_gradient_data_free);
}
gradient_data = g_new0 (GimpGradientData, 1);
gradient_data = g_slice_new0 (GimpGradientData);
gradient_data->gradient_callback = gradient_callback;
gradient_data->callback = callback;
......@@ -152,6 +155,12 @@ gimp_gradient_select_destroy (const gchar *gradient_callback)
/* private functions */
static void
gimp_gradient_data_free (GimpGradientData *data)
{
g_slice_free (GimpGradientData, data);
}
static void
gimp_temp_gradient_run (const gchar *name,
gint nparams,
......
......@@ -24,9 +24,7 @@
#include "gimp.h"
typedef struct _GimpPaletteData GimpPaletteData;
struct _GimpPaletteData
typedef struct
{
gchar *palette_callback;
guint idle_id;
......@@ -35,11 +33,13 @@ struct _GimpPaletteData
GimpRunPaletteCallback callback;
gboolean closing;
gpointer data;
};
} GimpPaletteData;
/* local function prototypes */
static void gimp_palette_data_free (GimpPaletteData *data);
static void gimp_temp_palette_run (const gchar *name,
gint nparams,
const GimpParam *param,
......@@ -92,10 +92,14 @@ gimp_palette_select_new (const gchar *title,
/* Now add to hash table so we can find it again */
if (! gimp_palette_select_ht)
gimp_palette_select_ht = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_free);
{
gimp_palette_select_ht =
g_hash_table_new_full (g_str_hash, g_str_equal,
g_free,
(GDestroyNotify) gimp_palette_data_free);
}
palette_data = g_new0 (GimpPaletteData, 1);
palette_data = g_slice_new0 (GimpPaletteData);
palette_data->palette_callback = palette_callback;
palette_data->callback = callback;
......@@ -145,6 +149,12 @@ gimp_palette_select_destroy (const gchar *palette_callback)
/* private functions */
static void
gimp_palette_data_free (GimpPaletteData *data)
{
g_slice_free (GimpPaletteData, data);
}
static void
gimp_temp_palette_run (const gchar *name,
gint nparams,
......
......@@ -24,9 +24,7 @@
#include "gimp.h"
typedef struct _GimpPatternData GimpPatternData;
struct _GimpPatternData
typedef struct
{
gchar *pattern_callback;
guint idle_id;
......@@ -38,11 +36,13 @@ struct _GimpPatternData
GimpRunPatternCallback callback;
gboolean closing;
gpointer data;
};
} GimpPatternData;
/* local function prototypes */
static void gimp_pattern_data_free (GimpPatternData *data);
static void gimp_temp_pattern_run (const gchar *name,
gint nparams,
const GimpParam *param,
......@@ -99,10 +99,14 @@ gimp_pattern_select_new (const gchar *title,
/* Now add to hash table so we can find it again */
if (! gimp_pattern_select_ht)
gimp_pattern_select_ht = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_free);
{
gimp_pattern_select_ht =
g_hash_table_new_full (g_str_hash, g_str_equal,
g_free,
(GDestroyNotify) gimp_pattern_data_free);
}
pattern_data = g_new0 (GimpPatternData, 1);
pattern_data = g_slice_new0 (GimpPatternData);
pattern_data->pattern_callback = pattern_callback;
pattern_data->callback = callback;
......@@ -154,6 +158,12 @@ gimp_pattern_select_destroy (const gchar *pattern_callback)
/* private functions */
static void
gimp_pattern_data_free (GimpPatternData *data)
{
g_slice_free (GimpPatternData, data);
}
static void
gimp_temp_pattern_run (const gchar *name,
gint nparams,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment