diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2018-06-26 16:59:26 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2019-06-14 16:36:43 +0100 |
commit | 1237dc0cf6fbdba996840db863dcdaf56f34bdbc (patch) | |
tree | d491158b4b73b43379c6951e9cd4241e5eb24724 | |
parent | daf36c66bbbbadb1fb216537fce7d888dee08f31 (diff) | |
download | atk-1237dc0cf6fbdba996840db863dcdaf56f34bdbc.tar.gz |
Implement propert ctor for AtkSocket
GObject constructors should only ever call g_object_new().
Setting the properties for AtkSocket should be deferred to the instance
initialization code.
-rw-r--r-- | atk/atksocket.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/atk/atksocket.c b/atk/atksocket.c index 2517b52..c8e03f7 100644 --- a/atk/atksocket.c +++ b/atk/atksocket.c @@ -62,7 +62,12 @@ G_DEFINE_TYPE_WITH_CODE (AtkSocket, atk_socket, ATK_TYPE_OBJECT, static void atk_socket_init (AtkSocket* obj) { + AtkObject *accessible = ATK_OBJECT (obj); + obj->embedded_plug_id = NULL; + + accessible->role = ATK_ROLE_FILLER; + accessible->layer = ATK_LAYER_WIDGET; } static void @@ -86,22 +91,22 @@ atk_socket_finalize (GObject *_obj) G_OBJECT_CLASS (atk_socket_parent_class)->finalize (_obj); } -static void atk_component_interface_init (AtkComponentIface *iface) +static void +atk_component_interface_init (AtkComponentIface *iface) { } +/** + * atk_socket_new: + * + * Creates a new #AtkSocket. + * + * Returns: (transfer full): the newly created #AtkSocket instance + */ AtkObject* atk_socket_new (void) { - AtkObject* accessible; - - accessible = g_object_new (ATK_TYPE_SOCKET, 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_SOCKET, NULL); } /** |