From cab5b8abd3407bc9a7a32a6fd9b8873799507c74 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Sun, 11 Sep 2011 15:44:39 -0400 Subject: [PATCH] GType tutorial: clarify class struct initialisation Make the information on how the class structure is initialised less confusing to first-time readers. --- docs/reference/gobject/tut_gtype.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/reference/gobject/tut_gtype.xml b/docs/reference/gobject/tut_gtype.xml index f040366f7..2745fd7f8 100644 --- a/docs/reference/gobject/tut_gtype.xml +++ b/docs/reference/gobject/tut_gtype.xml @@ -533,10 +533,11 @@ void g_type_free_instance (GTypeInstance *instance); - If this is the first instance of the object ever created, the type system must create - a class structure: it allocates a buffer to hold the object's class structure and - initializes it. It first copies the parent's class structure over this structure - (if there is no parent, it initializes it to zero). It then invokes the + If this is the first instance of the object ever created, the type system must create a class structure. + It allocates a buffer to hold the object's class structure and initializes it. The first part of the + class structure (ie: the embedded parent class structure) is initialized by copying the contents from + the class structure of the parent class. The rest of class structure is initialized to zero. If there + is no parent, the entire class structure is initialized to zero. The type system then invokes the base_class_initialization functions (GBaseInitFunc) from topmost fundamental object to bottom-most most derived object. The object's class_init (GClassInitFunc) function is invoked afterwards to complete