Commit a8c9def0 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

libgimp/gimpbrushmenu.c libgimp/gimpgradientmenu.c libgimp/gimpfontmenu.c

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

	* libgimp/gimpbrushmenu.c
	* libgimp/gimpgradientmenu.c
	* libgimp/gimpfontmenu.c
	* libgimp/gimppatternmenu.c
	* libgimp/gimppalettemenu.c: allocate structs using GSlice.

svn path=/trunk/; revision=22566
parent 114e0d7f
2007-05-22 Sven Neumann <sven@gimp.org>
* libgimp/gimpbrushmenu.c
* libgimp/gimpgradientmenu.c
* libgimp/gimpfontmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimppalettemenu.c: allocate structs using GSlice.
2007-05-22 Sven Neumann <sven@gimp.org>
* libgimp/gimpbrushselect.c
......@@ -31,24 +31,24 @@
#include "gimpbrushmenu.h"
typedef struct _CompatCallbackData CompatCallbackData;
struct _CompatCallbackData
typedef struct
{
GimpRunBrushCallback callback;
gpointer data;
};
} CompatCallbackData;
static void compat_callback (GimpBrushSelectButton *brush_button,
const gchar *brush_name,
gdouble opacity,
gint spacing,
GimpLayerModeEffects paint_mode,
gint width,
gint height,
const guchar *mask_data,
gboolean dialog_closing,
gpointer data);
static void compat_callback (GimpBrushSelectButton *brush_button,
const gchar *brush_name,
gdouble opacity,
gint spacing,
GimpLayerModeEffects paint_mode,
gint width,
gint height,
const guchar *mask_data,
gboolean dialog_closing,
CompatCallbackData *data);
static void compat_callback_data_free (CompatCallbackData *data);
/**
......@@ -84,13 +84,15 @@ gimp_brush_select_widget_new (const gchar *title,
brush_button = gimp_brush_select_button_new (title, brush_name,
opacity, spacing, paint_mode);
compat_data = g_new (CompatCallbackData, 1);
compat_data = g_slice_new (CompatCallbackData);
compat_data->callback = callback;
compat_data->data = data;
compat_data->data = data;
g_signal_connect_data (brush_button, "brush-set",
G_CALLBACK (compat_callback),
compat_data, (GClosureNotify) g_free, 0);
compat_data,
(GClosureNotify) compat_callback_data_free, 0);
return brush_button;
}
......@@ -145,11 +147,14 @@ compat_callback (GimpBrushSelectButton *brush_button,
gint height,
const guchar *mask_data,
gboolean dialog_closing,
gpointer data)
CompatCallbackData *data)
{
CompatCallbackData *compat_data = data;
data->callback (brush_name, opacity, spacing, paint_mode,
width, height, mask_data, dialog_closing, data->data);
}
compat_data->callback (brush_name, opacity, spacing, paint_mode,
width, height, mask_data,
dialog_closing, compat_data->data);
static void
compat_callback_data_free (CompatCallbackData *data)
{
g_slice_free (CompatCallbackData, data);
}
......@@ -31,19 +31,18 @@
#include "gimpfontmenu.h"
typedef struct _CompatCallbackData CompatCallbackData;
struct _CompatCallbackData
typedef struct
{
GimpRunFontCallback callback;
gpointer data;
};
} CompatCallbackData;
static void compat_callback (GimpFontSelectButton *font_button,
const gchar *font_name,
gboolean dialog_closing,
gpointer data);
static void compat_callback (GimpFontSelectButton *font_button,
const gchar *font_name,
gboolean dialog_closing,
CompatCallbackData *data);
static void compat_callback_data_free (CompatCallbackData *data);
/**
......@@ -72,13 +71,15 @@ gimp_font_select_widget_new (const gchar *title,
font_button = gimp_font_select_button_new (title, font_name);
compat_data = g_new (CompatCallbackData, 1);
compat_data = g_slice_new (CompatCallbackData);
compat_data->callback = callback;
compat_data->data = data;
compat_data->data = data;
g_signal_connect_data (font_button, "font-set",
G_CALLBACK (compat_callback),
compat_data, (GClosureNotify) g_free, 0);
compat_data,
(GClosureNotify) compat_callback_data_free, 0);
return font_button;
}
......@@ -116,13 +117,18 @@ gimp_font_select_widget_set (GtkWidget *widget,
font_name);
}
static void
compat_callback (GimpFontSelectButton *font_button,
const gchar *font_name,
gboolean dialog_closing,
gpointer data)
CompatCallbackData *data)
{
CompatCallbackData *compat_data = data;
data->callback (font_name, dialog_closing, data->data);
}
compat_data->callback (font_name, dialog_closing, compat_data->data);
static void
compat_callback_data_free (CompatCallbackData *data)
{
g_slice_free (CompatCallbackData, data);
}
......@@ -31,21 +31,20 @@
#include "gimpgradientmenu.h"
typedef struct _CompatCallbackData CompatCallbackData;
struct _CompatCallbackData
typedef struct
{
GimpRunGradientCallback callback;
gpointer data;
};
} CompatCallbackData;
static void compat_callback (GimpGradientSelectButton *gradient_button,
const gchar *gradient_name,
gint width,
const gdouble *grad_data,
gboolean dialog_closing,
gpointer data);
static void compat_callback (GimpGradientSelectButton *gradient_button,
const gchar *gradient_name,
gint width,
const gdouble *grad_data,
gboolean dialog_closing,
CompatCallbackData *data);
static void compat_callback_data_free (CompatCallbackData *data);
/**
......@@ -76,13 +75,15 @@ gimp_gradient_select_widget_new (const gchar *title,
gradient_button = gimp_gradient_select_button_new (title, gradient_name);
compat_data = g_new (CompatCallbackData, 1);
compat_data = g_slice_new (CompatCallbackData);
compat_data->callback = callback;
compat_data->data = data;
compat_data->data = data;
g_signal_connect_data (gradient_button, "gradient-set",
G_CALLBACK (compat_callback),
compat_data, (GClosureNotify) g_free, 0);
compat_data,
(GClosureNotify) compat_callback_data_free, 0);
return gradient_button;
}
......@@ -120,16 +121,20 @@ gimp_gradient_select_widget_set (GtkWidget *widget,
gradient_name);
}
static void
compat_callback (GimpGradientSelectButton *gradient_button,
const gchar *gradient_name,
gint width,
const gdouble *grad_data,
gboolean dialog_closing,
gpointer data)
CompatCallbackData *data)
{
CompatCallbackData *compat_data = data;
data->callback (gradient_name, width, grad_data, dialog_closing, data->data);
}
compat_data->callback (gradient_name, width, grad_data, dialog_closing,
compat_data->data);
static void
compat_callback_data_free (CompatCallbackData *data)
{
g_slice_free (CompatCallbackData, data);
}
......@@ -31,19 +31,18 @@
#include "gimppalettemenu.h"
typedef struct _CompatCallbackData CompatCallbackData;
struct _CompatCallbackData
typedef struct
{
GimpRunPaletteCallback callback;
gpointer data;
};
} CompatCallbackData;
static void compat_callback (GimpPaletteSelectButton *palette_button,
const gchar *palette_name,
gboolean dialog_closing,
gpointer data);
static void compat_callback (GimpPaletteSelectButton *palette_button,
const gchar *palette_name,
gboolean dialog_closing,
CompatCallbackData *data);
static void compat_callback_data_free (CompatCallbackData *data);
/**
......@@ -74,13 +73,15 @@ gimp_palette_select_widget_new (const gchar *title,
palette_button = gimp_palette_select_button_new (title, palette_name);
compat_data = g_new (CompatCallbackData, 1);
compat_data = g_slice_new (CompatCallbackData);
compat_data->callback = callback;
compat_data->data = data;
compat_data->data = data;
g_signal_connect_data (palette_button, "palette-set",
G_CALLBACK (compat_callback),
compat_data, (GClosureNotify) g_free, 0);
compat_data,
(GClosureNotify) compat_callback_data_free, 0);
return palette_button;
}
......@@ -122,13 +123,18 @@ gimp_palette_select_widget_set (GtkWidget *widget,
palette_name);
}
static void
compat_callback (GimpPaletteSelectButton *palette_button,
const gchar *palette_name,
gboolean dialog_closing,
gpointer data)
CompatCallbackData *data)
{
CompatCallbackData *compat_data = data;
data->callback (palette_name, dialog_closing, data->data);
}
compat_data->callback (palette_name, dialog_closing, compat_data->data);
static void
compat_callback_data_free (CompatCallbackData *data)
{
g_slice_free (CompatCallbackData, data);
}
......@@ -30,22 +30,23 @@
#undef GIMP_DISABLE_DEPRECATED
#include "gimppatternmenu.h"
typedef struct _CompatCallbackData CompatCallbackData;
struct _CompatCallbackData
typedef struct
{
GimpRunPatternCallback callback;
gpointer data;
};
} CompatCallbackData;
static void compat_callback (GimpPatternSelectButton *pattern_button,
const gchar *pattern_name,
gint width,
gint height,
gint bytes,
const guchar *mask_data,
gboolean dialog_closing,
gpointer data);
static void compat_callback (GimpPatternSelectButton *pattern_button,
const gchar *pattern_name,
gint width,
gint height,
gint bytes,
const guchar *mask_data,
gboolean dialog_closing,
CompatCallbackData *data);
static void compat_callback_data_free (CompatCallbackData *data);
/**
......@@ -74,13 +75,15 @@ gimp_pattern_select_widget_new (const gchar *title,
pattern_button = gimp_pattern_select_button_new (title, pattern_name);
compat_data = g_new (CompatCallbackData, 1);
compat_data = g_slice_new (CompatCallbackData);
compat_data->callback = callback;
compat_data->data = data;
compat_data->data = data;
g_signal_connect_data (pattern_button, "pattern-set",
G_CALLBACK (compat_callback),
compat_data, (GClosureNotify) g_free, 0);
compat_data,
(GClosureNotify) compat_callback_data_free, 0);
return pattern_button;
}
......@@ -118,6 +121,7 @@ gimp_pattern_select_widget_set (GtkWidget *widget,
pattern_name);
}
static void
compat_callback (GimpPatternSelectButton *pattern_button,
const gchar *pattern_name,
......@@ -126,10 +130,14 @@ compat_callback (GimpPatternSelectButton *pattern_button,
gint bpp,
const guchar *mask_data,
gboolean dialog_closing,
gpointer data)
CompatCallbackData *data)
{
CompatCallbackData *compat_data = data;
data->callback (pattern_name, width, height, bpp, mask_data,
dialog_closing, data->data);
}
compat_data->callback (pattern_name, width, height, bpp, mask_data,
dialog_closing, compat_data->data);
static void
compat_callback_data_free (CompatCallbackData *data)
{
g_slice_free (CompatCallbackData, data);
}
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