From 12411dad350838184e8aee4d560ec80f3fbfef07 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 26 Jun 2018 16:58:16 +0100 Subject: Implement propert ctor for AtkPlug GObject constructors should only ever call g_object_new(). Setting the properties for AtkPlug should be deferred to the instance initialization code. --- atk/atkplug.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/atk/atkplug.c b/atk/atkplug.c index 4b26b47..764d59d 100644 --- a/atk/atkplug.c +++ b/atk/atkplug.c @@ -42,6 +42,10 @@ G_DEFINE_TYPE_WITH_CODE (AtkPlug, atk_plug, ATK_TYPE_OBJECT, static void atk_plug_init (AtkPlug* obj) { + AtkObject *accessible = ATK_OBJECT (obj); + + accessible->role = ATK_ROLE_FILLER; + accessible->layer = ATK_LAYER_WIDGET; } static void @@ -55,18 +59,19 @@ atk_component_interface_init (AtkComponentIface *iface) { } -AtkObject* +/** + * atk_plug_new: + * + * Creates a new #AtkPlug instance. + * + * Returns: (transfer full): the newly created #AtkPlug + * + * Since: 1.30 + */ +AtkObject * atk_plug_new (void) { - AtkObject* accessible; - - accessible = g_object_new (ATK_TYPE_PLUG, NULL); - g_return_val_if_fail (accessible != NULL, NULL); - - accessible->role = ATK_ROLE_FILLER; - accessible->layer = ATK_LAYER_WIDGET; - - return accessible; + return g_object_new (ATK_TYPE_PLUG, NULL); } /** -- cgit v1.2.1