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

use gimp_brush_generated_new() to create the brush object. Removed

2005-11-01  Sven Neumann  <sven@gimp.org>

	* app/core/gimpbrushgenerated.c (gimp_brush_generated_load): use
	gimp_brush_generated_new() to create the brush object. Removed
	redundant calls to gimp_data_dirty().

	* app/core/gimpdata.c: freeze the data object during construction.
parent 6ad8c740
2005-11-01 Sven Neumann <sven@gimp.org>
* app/core/gimpbrushgenerated.c (gimp_brush_generated_load): use
gimp_brush_generated_new() to create the brush object. Removed
redundant calls to gimp_data_dirty().
* app/core/gimpdata.c: freeze the data object during construction.
2005-11-01 Sven Neumann <sven@gimp.org>
* app/actions/data-commands.c
......
......@@ -559,9 +559,6 @@ gimp_brush_generated_new (const gchar *name,
GIMP_BRUSH (brush)->spacing = 20;
/* render brush mask */
gimp_data_dirty (GIMP_DATA (brush));
return GIMP_DATA (brush);
}
......@@ -709,23 +706,12 @@ gimp_brush_generated_load (const gchar *filename,
fclose (file);
/* create new brush */
brush = g_object_new (GIMP_TYPE_BRUSH_GENERATED,
"name", name,
"shape", shape,
"radius", radius,
"spikes", spikes,
"hardness", hardness,
"aspect-ratio", aspect_ratio,
"angle", angle,
NULL);
brush = gimp_brush_generated_new (name, shape, radius, spikes,
hardness, aspect_ratio, angle);
g_free (name);
GIMP_BRUSH (brush)->spacing = spacing;
/* render brush mask */
gimp_data_dirty (GIMP_DATA (brush));
return g_list_prepend (NULL, brush);
failed:
......
......@@ -559,9 +559,6 @@ gimp_brush_generated_new (const gchar *name,
GIMP_BRUSH (brush)->spacing = 20;
/* render brush mask */
gimp_data_dirty (GIMP_DATA (brush));
return GIMP_DATA (brush);
}
......@@ -709,23 +706,12 @@ gimp_brush_generated_load (const gchar *filename,
fclose (file);
/* create new brush */
brush = g_object_new (GIMP_TYPE_BRUSH_GENERATED,
"name", name,
"shape", shape,
"radius", radius,
"spikes", spikes,
"hardness", hardness,
"aspect-ratio", aspect_ratio,
"angle", angle,
NULL);
brush = gimp_brush_generated_new (name, shape, radius, spikes,
hardness, aspect_ratio, angle);
g_free (name);
GIMP_BRUSH (brush)->spacing = spacing;
/* render brush mask */
gimp_data_dirty (GIMP_DATA (brush));
return g_list_prepend (NULL, brush);
failed:
......
......@@ -559,9 +559,6 @@ gimp_brush_generated_new (const gchar *name,
GIMP_BRUSH (brush)->spacing = 20;
/* render brush mask */
gimp_data_dirty (GIMP_DATA (brush));
return GIMP_DATA (brush);
}
......@@ -709,23 +706,12 @@ gimp_brush_generated_load (const gchar *filename,
fclose (file);
/* create new brush */
brush = g_object_new (GIMP_TYPE_BRUSH_GENERATED,
"name", name,
"shape", shape,
"radius", radius,
"spikes", spikes,
"hardness", hardness,
"aspect-ratio", aspect_ratio,
"angle", angle,
NULL);
brush = gimp_brush_generated_new (name, shape, radius, spikes,
hardness, aspect_ratio, angle);
g_free (name);
GIMP_BRUSH (brush)->spacing = spacing;
/* render brush mask */
gimp_data_dirty (GIMP_DATA (brush));
return g_list_prepend (NULL, brush);
failed:
......
......@@ -61,25 +61,29 @@ enum
};
static void gimp_data_class_init (GimpDataClass *klass);
static void gimp_data_init (GimpData *data,
GimpDataClass *data_class);
static void gimp_data_class_init (GimpDataClass *klass);
static void gimp_data_init (GimpData *data,
GimpDataClass *data_class);
static void gimp_data_finalize (GObject *object);
static void gimp_data_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_data_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static GObject * gimp_data_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_data_name_changed (GimpObject *object);
static gint64 gimp_data_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_data_finalize (GObject *object);
static void gimp_data_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_data_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_data_real_dirty (GimpData *data);
static void gimp_data_name_changed (GimpObject *object);
static gint64 gimp_data_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_data_real_dirty (GimpData *data);
static guint data_signals[LAST_SIGNAL] = { 0 };
......@@ -132,6 +136,7 @@ gimp_data_class_init (GimpDataClass *klass)
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->constructor = gimp_data_constructor;
object_class->finalize = gimp_data_finalize;
object_class->set_property = gimp_data_set_property;
object_class->get_property = gimp_data_get_property;
......@@ -184,6 +189,9 @@ gimp_data_init (GimpData *data,
*/
if (! data_class->save)
data->writable = FALSE;
/* freeze the data object during construction */
gimp_data_freeze (data);
}
static void
......@@ -270,6 +278,20 @@ gimp_data_get_property (GObject *object,
}
}
static GObject *
gimp_data_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
{
GObject *object;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
gimp_data_thaw (GIMP_DATA (object));
return object;
}
static void
gimp_data_name_changed (GimpObject *object)
{
......
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