[atk/docs-fixes: 43/56] Implement propert ctor for AtkPlug



commit daf36c66bbbbadb1fb216537fce7d888dee08f31
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Jun 26 16:58:16 2018 +0100

    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 ba6f122..ceb3e5d 100644
--- a/atk/atkplug.c
+++ b/atk/atkplug.c
@@ -40,6 +40,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
@@ -53,18 +57,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);
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]