summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2018-06-26 16:58:16 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2018-06-26 16:58:16 +0100
commit12411dad350838184e8aee4d560ec80f3fbfef07 (patch)
tree6dedae554c039614f114cd3a457ed0bfd6074c67
parent1e7bb7110ba4b28ac8b6df54401a475041f65d2b (diff)
downloadatk-12411dad350838184e8aee4d560ec80f3fbfef07.tar.gz
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.
-rw-r--r--atk/atkplug.c25
1 files 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);
}
/**