diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2018-06-26 16:58:16 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2019-06-14 16:36:43 +0100 |
commit | daf36c66bbbbadb1fb216537fce7d888dee08f31 (patch) | |
tree | 91b237d17ea16a0efdcc58f89343420ef375aa5e | |
parent | d272faf325fdfe32ec4eb696f61f23fdd5957178 (diff) | |
download | atk-daf36c66bbbbadb1fb216537fce7d888dee08f31.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.c | 25 |
1 files 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); } /** |