app: implement GObject::constructed() instead of ::constructor()

This commit is contained in:
Michael Natterer 2011-01-12 23:06:03 +01:00
parent 5e4eee4653
commit c1b3575648
7 changed files with 105 additions and 164 deletions

View File

@ -116,9 +116,7 @@ struct _GimpDisplayShellOverlay
static void gimp_color_managed_iface_init (GimpColorManagedInterface *iface);
static GObject * gimp_display_shell_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_display_shell_constructed (GObject *object);
static void gimp_display_shell_dispose (GObject *object);
static void gimp_display_shell_finalize (GObject *object);
static void gimp_display_shell_set_property (GObject *object,
@ -214,7 +212,7 @@ gimp_display_shell_class_init (GimpDisplayShellClass *klass)
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->constructor = gimp_display_shell_constructor;
object_class->constructed = gimp_display_shell_constructed;
object_class->dispose = gimp_display_shell_dispose;
object_class->finalize = gimp_display_shell_finalize;
object_class->set_property = gimp_display_shell_set_property;
@ -339,13 +337,10 @@ gimp_display_shell_init (GimpDisplayShell *shell)
GIMP_HELP_IMAGE_WINDOW, NULL);
}
static GObject *
gimp_display_shell_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_display_shell_constructed (GObject *object)
{
GObject *object;
GimpDisplayShell *shell;
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (object);
GimpDisplayConfig *config;
GimpImage *image;
GimpColorDisplayStack *filter;
@ -361,9 +356,8 @@ gimp_display_shell_constructor (GType type,
gint shell_width;
gint shell_height;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
shell = GIMP_DISPLAY_SHELL (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_UI_MANAGER (shell->popup_manager));
g_assert (GIMP_IS_DISPLAY (shell->display));
@ -742,8 +736,6 @@ gimp_display_shell_constructor (GType type,
/* make sure the information is up-to-date */
gimp_display_shell_scale_changed (shell);
return object;
}
static void

View File

@ -28,15 +28,13 @@
#include "gimpinkundo.h"
static GObject * gimp_ink_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_ink_undo_constructed (GObject *object);
static void gimp_ink_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_ink_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
static void gimp_ink_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_ink_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
G_DEFINE_TYPE (GimpInkUndo, gimp_ink_undo, GIMP_TYPE_PAINT_CORE_UNDO)
@ -50,7 +48,7 @@ gimp_ink_undo_class_init (GimpInkUndoClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructor = gimp_ink_undo_constructor;
object_class->constructed = gimp_ink_undo_constructed;
undo_class->pop = gimp_ink_undo_pop;
undo_class->free = gimp_ink_undo_free;
@ -61,18 +59,14 @@ gimp_ink_undo_init (GimpInkUndo *undo)
{
}
static GObject *
gimp_ink_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_ink_undo_constructed (GObject *object)
{
GObject *object;
GimpInkUndo *ink_undo;
GimpInkUndo *ink_undo = GIMP_INK_UNDO (object);
GimpInk *ink;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
ink_undo = GIMP_INK_UNDO (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_INK (GIMP_PAINT_CORE_UNDO (ink_undo)->paint_core));
@ -80,8 +74,6 @@ gimp_ink_undo_constructor (GType type,
if (ink->start_blob)
ink_undo->last_blob = gimp_blob_duplicate (ink->start_blob);
return object;
}
static void

View File

@ -32,23 +32,21 @@ enum
};
static GObject * gimp_paint_core_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_paint_core_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_paint_core_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_paint_core_undo_constructed (GObject *object);
static void gimp_paint_core_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_paint_core_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_paint_core_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_paint_core_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
static void gimp_paint_core_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_paint_core_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
G_DEFINE_TYPE (GimpPaintCoreUndo, gimp_paint_core_undo, GIMP_TYPE_UNDO)
@ -62,7 +60,7 @@ gimp_paint_core_undo_class_init (GimpPaintCoreUndoClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructor = gimp_paint_core_undo_constructor;
object_class->constructed = gimp_paint_core_undo_constructed;
object_class->set_property = gimp_paint_core_undo_set_property;
object_class->get_property = gimp_paint_core_undo_get_property;
@ -81,17 +79,13 @@ gimp_paint_core_undo_init (GimpPaintCoreUndo *undo)
{
}
static GObject *
gimp_paint_core_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_paint_core_undo_constructed (GObject *object)
{
GObject *object;
GimpPaintCoreUndo *paint_core_undo;
GimpPaintCoreUndo *paint_core_undo = GIMP_PAINT_CORE_UNDO (object);
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
paint_core_undo = GIMP_PAINT_CORE_UNDO (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_PAINT_CORE (paint_core_undo->paint_core));
@ -99,8 +93,6 @@ gimp_paint_core_undo_constructor (GType type,
g_object_add_weak_pointer (G_OBJECT (paint_core_undo->paint_core),
(gpointer) &paint_core_undo->paint_core);
return object;
}
static void

View File

@ -39,26 +39,24 @@ enum
};
static GObject * gimp_text_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_text_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_text_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_text_undo_constructed (GObject *object);
static void gimp_text_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_text_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint64 gimp_text_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static gint64 gimp_text_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_text_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_text_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
static void gimp_text_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_text_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
G_DEFINE_TYPE (GimpTextUndo, gimp_text_undo, GIMP_TYPE_ITEM_UNDO)
@ -73,7 +71,7 @@ gimp_text_undo_class_init (GimpTextUndoClass *klass)
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructor = gimp_text_undo_constructor;
object_class->constructed = gimp_text_undo_constructed;
object_class->set_property = gimp_text_undo_set_property;
object_class->get_property = gimp_text_undo_get_property;
@ -94,18 +92,14 @@ gimp_text_undo_init (GimpTextUndo *undo)
{
}
static GObject *
gimp_text_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_text_undo_constructed (GObject *object)
{
GObject *object;
GimpTextUndo *text_undo;
GimpTextUndo *text_undo = GIMP_TEXT_UNDO (object);
GimpTextLayer *layer;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
text_undo = GIMP_TEXT_UNDO (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_TEXT_LAYER (GIMP_ITEM_UNDO (text_undo)->item));
@ -137,8 +131,6 @@ gimp_text_undo_constructor (GType type,
default:
g_assert_not_reached ();
}
return object;
}
static void

View File

@ -25,18 +25,16 @@
#include "gimpvectorsmodundo.h"
static GObject * gimp_vectors_mod_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_vectors_mod_undo_constructed (GObject *object);
static gint64 gimp_vectors_mod_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static gint64 gimp_vectors_mod_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_vectors_mod_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_vectors_mod_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
static void gimp_vectors_mod_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_vectors_mod_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
G_DEFINE_TYPE (GimpVectorsModUndo, gimp_vectors_mod_undo, GIMP_TYPE_ITEM_UNDO)
@ -51,7 +49,7 @@ gimp_vectors_mod_undo_class_init (GimpVectorsModUndoClass *klass)
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructor = gimp_vectors_mod_undo_constructor;
object_class->constructed = gimp_vectors_mod_undo_constructed;
gimp_object_class->get_memsize = gimp_vectors_mod_undo_get_memsize;
@ -64,18 +62,14 @@ gimp_vectors_mod_undo_init (GimpVectorsModUndo *undo)
{
}
static GObject *
gimp_vectors_mod_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_vectors_mod_undo_constructed (GObject *object)
{
GObject *object;
GimpVectorsModUndo *vectors_mod_undo;
GimpVectorsModUndo *vectors_mod_undo = GIMP_VECTORS_MOD_UNDO (object);
GimpVectors *vectors;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
vectors_mod_undo = GIMP_VECTORS_MOD_UNDO (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_VECTORS (GIMP_ITEM_UNDO (object)->item));
@ -84,8 +78,6 @@ gimp_vectors_mod_undo_constructor (GType type,
vectors_mod_undo->vectors =
GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
G_TYPE_FROM_INSTANCE (vectors)));
return object;
}
static gint64

View File

@ -27,13 +27,11 @@
#include "gimpvectorspropundo.h"
static GObject * gimp_vectors_prop_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_vectors_prop_undo_constructed (GObject *object);
static void gimp_vectors_prop_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_vectors_prop_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
G_DEFINE_TYPE (GimpVectorsPropUndo, gimp_vectors_prop_undo, GIMP_TYPE_ITEM_UNDO)
@ -47,7 +45,7 @@ gimp_vectors_prop_undo_class_init (GimpVectorsPropUndoClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructor = gimp_vectors_prop_undo_constructor;
object_class->constructed = gimp_vectors_prop_undo_constructed;
undo_class->pop = gimp_vectors_prop_undo_pop;
}
@ -57,19 +55,14 @@ gimp_vectors_prop_undo_init (GimpVectorsPropUndo *undo)
{
}
static GObject *
gimp_vectors_prop_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_vectors_prop_undo_constructed (GObject *object)
{
GObject *object;
GimpVectorsPropUndo *vectors_prop_undo;
GimpImage *image;
GimpVectors *vectors;
GimpImage *image;
GimpVectors *vectors;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
vectors_prop_undo = GIMP_VECTORS_PROP_UNDO (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_VECTORS (GIMP_ITEM_UNDO (object)->item));
@ -81,8 +74,6 @@ gimp_vectors_prop_undo_constructor (GType type,
default:
g_assert_not_reached ();
}
return object;
}
static void

View File

@ -36,24 +36,22 @@ enum
};
static GObject * gimp_vectors_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_vectors_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_vectors_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_vectors_undo_constructed (GObject *object);
static void gimp_vectors_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_vectors_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint64 gimp_vectors_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static gint64 gimp_vectors_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_vectors_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_vectors_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
G_DEFINE_TYPE (GimpVectorsUndo, gimp_vectors_undo, GIMP_TYPE_ITEM_UNDO)
@ -68,7 +66,7 @@ gimp_vectors_undo_class_init (GimpVectorsUndoClass *klass)
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructor = gimp_vectors_undo_constructor;
object_class->constructed = gimp_vectors_undo_constructed;
object_class->set_property = gimp_vectors_undo_set_property;
object_class->get_property = gimp_vectors_undo_get_property;
@ -101,21 +99,13 @@ gimp_vectors_undo_init (GimpVectorsUndo *undo)
{
}
static GObject *
gimp_vectors_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_vectors_undo_constructed (GObject *object)
{
GObject *object;
GimpVectorsUndo *vectors_undo;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
vectors_undo = GIMP_VECTORS_UNDO (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_VECTORS (GIMP_ITEM_UNDO (object)->item));
return object;
}
static void