Commit 5e4eee46 authored by Michael Natterer's avatar Michael Natterer 😴

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

parent 8d2d16ac
......@@ -47,9 +47,7 @@ enum
/* local function prototypes */
static GObject * gimp_brush_clipboard_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_brush_clipboard_constructed (GObject *object);
static void gimp_brush_clipboard_set_property (GObject *object,
guint property_id,
const GValue *value,
......@@ -79,7 +77,7 @@ gimp_brush_clipboard_class_init (GimpBrushClipboardClass *klass)
GimpDataClass *data_class = GIMP_DATA_CLASS (klass);
#endif
object_class->constructor = gimp_brush_clipboard_constructor;
object_class->constructed = gimp_brush_clipboard_constructed;
object_class->set_property = gimp_brush_clipboard_set_property;
object_class->get_property = gimp_brush_clipboard_get_property;
......@@ -100,17 +98,13 @@ gimp_brush_clipboard_init (GimpBrushClipboard *brush)
brush->gimp = NULL;
}
static GObject *
gimp_brush_clipboard_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_brush_clipboard_constructed (GObject *object)
{
GObject *object;
GimpBrushClipboard *brush;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
GimpBrushClipboard *brush = GIMP_BRUSH_CLIPBOARD (object);
brush = GIMP_BRUSH_CLIPBOARD (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_GIMP (brush->gimp));
......@@ -119,8 +113,6 @@ gimp_brush_clipboard_constructor (GType type,
brush, 0);
gimp_brush_clipboard_buffer_changed (brush->gimp, GIMP_BRUSH (brush));
return object;
}
static void
......
......@@ -28,13 +28,11 @@
#include "gimpchannelpropundo.h"
static GObject * gimp_channel_prop_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_channel_prop_undo_constructed (GObject *object);
static void gimp_channel_prop_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_channel_prop_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
G_DEFINE_TYPE (GimpChannelPropUndo, gimp_channel_prop_undo, GIMP_TYPE_ITEM_UNDO)
......@@ -48,7 +46,7 @@ gimp_channel_prop_undo_class_init (GimpChannelPropUndoClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructor = gimp_channel_prop_undo_constructor;
object_class->constructed = gimp_channel_prop_undo_constructed;
undo_class->pop = gimp_channel_prop_undo_pop;
}
......@@ -58,19 +56,15 @@ gimp_channel_prop_undo_init (GimpChannelPropUndo *undo)
{
}
static GObject *
gimp_channel_prop_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_channel_prop_undo_constructed (GObject *object)
{
GObject *object;
GimpChannelPropUndo *channel_prop_undo;
GimpChannelPropUndo *channel_prop_undo = GIMP_CHANNEL_PROP_UNDO (object);
GimpImage *image;
GimpChannel *channel;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
channel_prop_undo = GIMP_CHANNEL_PROP_UNDO (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_CHANNEL (GIMP_ITEM_UNDO (object)->item));
......@@ -86,8 +80,6 @@ gimp_channel_prop_undo_constructor (GType type,
default:
g_assert_not_reached ();
}
return object;
}
static void
......
......@@ -35,24 +35,22 @@ enum
};
static GObject * gimp_channel_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_channel_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_channel_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint64 gimp_channel_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_channel_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_channel_undo_constructed (GObject *object);
static void gimp_channel_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_channel_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint64 gimp_channel_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_channel_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
G_DEFINE_TYPE (GimpChannelUndo, gimp_channel_undo, GIMP_TYPE_ITEM_UNDO)
......@@ -67,7 +65,7 @@ gimp_channel_undo_class_init (GimpChannelUndoClass *klass)
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructor = gimp_channel_undo_constructor;
object_class->constructed = gimp_channel_undo_constructed;
object_class->set_property = gimp_channel_undo_set_property;
object_class->get_property = gimp_channel_undo_get_property;
......@@ -102,21 +100,13 @@ gimp_channel_undo_init (GimpChannelUndo *undo)
{
}
static GObject *
gimp_channel_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_channel_undo_constructed (GObject *object)
{
GObject *object;
GimpChannelUndo *channel_undo;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
channel_undo = GIMP_CHANNEL_UNDO (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_CHANNEL (GIMP_ITEM_UNDO (object)->item));
return object;
}
static void
......
......@@ -67,9 +67,7 @@ typedef void (* GimpContextCopyPropFunc) (GimpContext *src,
static void gimp_context_config_iface_init (GimpConfigInterface *iface);
static GObject * gimp_context_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_context_constructed (GObject *object);
static void gimp_context_dispose (GObject *object);
static void gimp_context_finalize (GObject *object);
static void gimp_context_set_property (GObject *object,
......@@ -553,7 +551,7 @@ gimp_context_class_init (GimpContextClass *klass)
G_TYPE_NONE, 1,
GIMP_TYPE_TEMPLATE);
object_class->constructor = gimp_context_constructor;
object_class->constructed = gimp_context_constructed;
object_class->set_property = gimp_context_set_property;
object_class->get_property = gimp_context_get_property;
object_class->dispose = gimp_context_dispose;
......@@ -769,16 +767,14 @@ gimp_context_config_iface_init (GimpConfigInterface *iface)
iface->deserialize_property = gimp_context_deserialize_property;
}
static GObject *
gimp_context_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_context_constructed (GObject *object)
{
GObject *object;
Gimp *gimp;
GimpContainer *container;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
gimp = GIMP_CONTEXT (object)->gimp;
......@@ -882,8 +878,6 @@ gimp_context_constructor (GType type,
g_signal_connect_object (gimp->templates, "thaw",
G_CALLBACK (gimp_context_template_list_thaw),
object, 0);
return object;
}
static void
......
......@@ -88,38 +88,35 @@ struct _GimpDataPrivate
G_TYPE_INSTANCE_GET_PRIVATE (data, GIMP_TYPE_DATA, GimpDataPrivate)
static void gimp_data_class_init (GimpDataClass *klass);
static void gimp_data_tagged_iface_init (GimpTaggedInterface *iface);
static void gimp_data_class_init (GimpDataClass *klass);
static void gimp_data_tagged_iface_init (GimpTaggedInterface *iface);
static void gimp_data_init (GimpData *data,
GimpDataClass *data_class);
static void gimp_data_init (GimpData *data,
GimpDataClass *data_class);
static GObject * gimp_data_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_data_constructed (GObject *object);
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_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 gint64 gimp_data_get_memsize (GimpObject *object,
gint64 *gui_size);
static gint64 gimp_data_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_data_real_dirty (GimpData *data);
static void gimp_data_real_dirty (GimpData *data);
static gboolean gimp_data_add_tag (GimpTagged *tagged,
GimpTag *tag);
static gboolean gimp_data_remove_tag (GimpTagged *tagged,
GimpTag *tag);
static GList * gimp_data_get_tags (GimpTagged *tagged);
static gchar * gimp_data_get_identifier (GimpTagged *tagged);
static gchar * gimp_data_get_checksum (GimpTagged *tagged);
static gboolean gimp_data_add_tag (GimpTagged *tagged,
GimpTag *tag);
static gboolean gimp_data_remove_tag (GimpTagged *tagged,
GimpTag *tag);
static GList * gimp_data_get_tags (GimpTagged *tagged);
static gchar * gimp_data_get_identifier (GimpTagged *tagged);
static gchar * gimp_data_get_checksum (GimpTagged *tagged);
static guint data_signals[LAST_SIGNAL] = { 0 };
......@@ -181,7 +178,7 @@ gimp_data_class_init (GimpDataClass *klass)
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->constructor = gimp_data_constructor;
object_class->constructed = gimp_data_constructed;
object_class->finalize = gimp_data_finalize;
object_class->set_property = gimp_data_set_property;
object_class->get_property = gimp_data_get_property;
......@@ -247,18 +244,13 @@ gimp_data_init (GimpData *data,
gimp_data_freeze (data);
}
static GObject *
gimp_data_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_data_constructed (GObject *object)
{
GObject *object;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
gimp_data_thaw (GIMP_DATA (object));
return object;
}
static void
......
......@@ -35,27 +35,24 @@ enum
};
static GObject * gimp_drawable_mod_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_drawable_mod_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_drawable_mod_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint64 gimp_drawable_mod_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_drawable_mod_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_drawable_mod_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
static void gimp_drawable_mod_undo_constructed (GObject *object);
static void gimp_drawable_mod_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_drawable_mod_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint64 gimp_drawable_mod_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_drawable_mod_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_drawable_mod_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
G_DEFINE_TYPE (GimpDrawableModUndo, gimp_drawable_mod_undo, GIMP_TYPE_ITEM_UNDO)
......@@ -70,7 +67,7 @@ gimp_drawable_mod_undo_class_init (GimpDrawableModUndoClass *klass)
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructor = gimp_drawable_mod_undo_constructor;
object_class->constructed = gimp_drawable_mod_undo_constructed;
object_class->set_property = gimp_drawable_mod_undo_set_property;
object_class->get_property = gimp_drawable_mod_undo_get_property;
......@@ -91,19 +88,15 @@ gimp_drawable_mod_undo_init (GimpDrawableModUndo *undo)
{
}
static GObject *
gimp_drawable_mod_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_drawable_mod_undo_constructed (GObject *object)
{
GObject *object;
GimpDrawableModUndo *drawable_mod_undo;
GimpDrawableModUndo *drawable_mod_undo = GIMP_DRAWABLE_MOD_UNDO (object);
GimpItem *item;
GimpDrawable *drawable;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
drawable_mod_undo = GIMP_DRAWABLE_MOD_UNDO (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_DRAWABLE (GIMP_ITEM_UNDO (object)->item));
......@@ -126,8 +119,6 @@ gimp_drawable_mod_undo_constructor (GType type,
gimp_item_get_offset (item,
&drawable_mod_undo->offset_x,
&drawable_mod_undo->offset_y);
return object;
}
static void
......
......@@ -38,37 +38,35 @@ enum
/* local function prototypes */
static GObject * gimp_drawable_stack_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_drawable_stack_finalize (GObject *object);
static void gimp_drawable_stack_add (GimpContainer *container,
GimpObject *object);
static void gimp_drawable_stack_remove (GimpContainer *container,
GimpObject *object);
static void gimp_drawable_stack_reorder (GimpContainer *container,
GimpObject *object,
gint new_index);
static void gimp_drawable_stack_add_node (GimpDrawableStack *stack,
GimpDrawable *drawable);
static void gimp_drawable_stack_remove_node (GimpDrawableStack *stack,
GimpDrawable *drawable);
static void gimp_drawable_stack_update (GimpDrawableStack *stack,
gint x,
gint y,
gint width,
gint height);
static void gimp_drawable_stack_drawable_update (GimpItem *item,
gint x,
gint y,
gint width,
gint height,
GimpDrawableStack *stack);
static void gimp_drawable_stack_drawable_visible (GimpItem *item,
GimpDrawableStack *stack);
static void gimp_drawable_stack_constructed (GObject *object);
static void gimp_drawable_stack_finalize (GObject *object);
static void gimp_drawable_stack_add (GimpContainer *container,
GimpObject *object);
static void gimp_drawable_stack_remove (GimpContainer *container,
GimpObject *object);
static void gimp_drawable_stack_reorder (GimpContainer *container,
GimpObject *object,
gint new_index);
static void gimp_drawable_stack_add_node (GimpDrawableStack *stack,
GimpDrawable *drawable);
static void gimp_drawable_stack_remove_node (GimpDrawableStack *stack,
GimpDrawable *drawable);
static void gimp_drawable_stack_update (GimpDrawableStack *stack,
gint x,
gint y,
gint width,
gint height);
static void gimp_drawable_stack_drawable_update (GimpItem *item,
gint x,
gint y,
gint width,
gint height,
GimpDrawableStack *stack);
static void gimp_drawable_stack_drawable_visible (GimpItem *item,
GimpDrawableStack *stack);
G_DEFINE_TYPE (GimpDrawableStack, gimp_drawable_stack, GIMP_TYPE_ITEM_STACK)
......@@ -97,7 +95,7 @@ gimp_drawable_stack_class_init (GimpDrawableStackClass *klass)
G_TYPE_INT,
G_TYPE_INT);
object_class->constructor = gimp_drawable_stack_constructor;
object_class->constructed = gimp_drawable_stack_constructed;
object_class->finalize = gimp_drawable_stack_finalize;
container_class->add = gimp_drawable_stack_add;
......@@ -110,17 +108,13 @@ gimp_drawable_stack_init (GimpDrawableStack *stack)
{
}
static GObject *
gimp_drawable_stack_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_drawable_stack_constructed (GObject *object)
{
GObject *object;
GimpContainer *container;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
GimpContainer *container = GIMP_CONTAINER (object);
container = GIMP_CONTAINER (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (g_type_is_a (gimp_container_get_children_type (container),
GIMP_TYPE_DRAWABLE));
......@@ -131,8 +125,6 @@ gimp_drawable_stack_constructor (GType type,
gimp_container_add_handler (container, "visibility-changed",
G_CALLBACK (gimp_drawable_stack_drawable_visible),
container);
return object;
}
static void
......
......@@ -42,26 +42,24 @@ enum
};
static GObject * gimp_drawable_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_drawable_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_drawable_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint64 gimp_drawable_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_drawable_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_drawable_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
static void gimp_drawable_undo_constructed (GObject *object);
static void gimp_drawable_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_drawable_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint64 gimp_drawable_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_drawable_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_drawable_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
G_DEFINE_TYPE (GimpDrawableUndo, gimp_drawable_undo, GIMP_TYPE_ITEM_UNDO)
......@@ -76,7 +74,7 @@ gimp_drawable_undo_class_init (GimpDrawableUndoClass *klass)
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructor = gimp_drawable_undo_constructor;
object_class->constructed = gimp_drawable_undo_constructed;
object_class->set_property = gimp_drawable_undo_set_property;
object_class->get_property = gimp_drawable_undo_get_property;
......@@ -127,22 +125,16 @@ gimp_drawable_undo_init (GimpDrawableUndo *undo)
{
}
static GObject *
gimp_drawable_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
static void
gimp_drawable_undo_constructed (GObject *object)
{
GObject *object;
GimpDrawableUndo *drawable_undo;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
GimpDrawableUndo *drawable_undo = GIMP_DRAWABLE_UNDO (object);
drawable_undo = GIMP_DRAWABLE_UNDO (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_DRAWABLE (GIMP_ITEM_UNDO (object)->item));
g_assert (drawable_undo->tiles != NULL);
return object;
}
static void
......
......@@ -52,10 +52,7 @@ typedef struct _MatchParams
} MatchParams;
static GObject * gimp_filtered_container_constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params);
static void gimp_filtered_container_constructed (GObject *object);
static void gimp_filtered_container_dispose (GObject *object);
static void gimp_filtered_container_set_property (GObject *object,
guint property_id,
......@@ -111,7 +108,7 @@ gimp_filtered_container_class_init (GimpFilteredContainerClass *klass)
GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
g_object_class->constructor = gimp_filtered_container_constructor;
g_object_class->constructed = gimp_filtered_container_constructed;
g_object_class->dispose = gimp_filtered_container_dispose;
g_object_class->set_property = gimp_filtered_container_set_property;
g_object_class->get_property = gimp_filtered_container_get_property;
......@@ -147,19 +144,13 @@ gimp_filtered_container_init (GimpFilteredContainer *filtered_container)
filtered_container->tag_count = 0;
}
static GObject*
gimp_filtered_container_constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
static void
gimp_filtered_container_constructed (GObject *object)
{
GObject *object;
GimpFilteredContainer *filtered_container;
object = G_OBJECT_CLASS (parent_class)->constructor (type,
n_construct_params,
construct_params);
GimpFilteredContainer *filtered_container = GIMP_FILTERED_CONTAINER (object);
filtered_container = GIMP_FILTERED_CONTAINER (object);
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
filtered_container->tag_ref_counts =
g_hash_table_new ((GHashFunc) gimp_tag_get_hash,
......@@ -169,8 +160,6 @@ gimp_filtered_container_constructor (GType type,
(GFunc) gimp_filtered_container_tagged_item_added,
filtered_container);
gimp_filtered_container_filter (filtered_container);
return object;
}
static void
......
......@@ -29,13 +29,11 @@
#include "gimplayer-floating-sel.h"
static GObject * gimp_floating_sel_undo_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_floating_sel_undo_constructed (GObject *object);
static void gimp_floating_sel_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_floating_sel_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);</