#include <stdapis/glib-2.0/gobject/gobject.h>
struct _GObjectClass |
Public Attributes | |
---|---|
GSList * | construct_properties |
void(* | constructed |
GObject *(* | constructor |
void(* | dispatch_properties_changed |
void(* | dispose |
void(* | finalize |
GTypeClass | g_type_class |
void(* | get_property |
void(* | notify |
gpointer | pdummy |
void(* | set_property |
GObjectClass: : the parent class : the function is called by g_object_new () to complete the object initialization after all the construction properties are set. The first thing a implementation must do is chain up to the of the parent class. Overriding should be rarely needed, e.g. to handle construct properties, or to implement singletons. : the generic setter for all properties of this type. Should be overridden for every type with properties. Implementations of don't need to emit property change notification explicitly, this is handled by the type system. : the generic getter for all properties of this type. Should be overridden for every type with properties. : the function is supposed to drop all references to other objects, but keep the instance otherwise intact, so that client method invocations still work. It may be run multiple times (due to reference loops). Before returning, should chain up to the method of the parent class. : instance finalization function, should finish the finalization of the instance begun in and chain up to the method of the parent class. : emits property change notification for a bunch of properties. Overriding should be rarely needed. : the class closure for the notify signal : the function is called by g_object_new() as the final step of the object creation process. At the point of the call, all construction properties have been set on the object. The purpose of this call is to allow for object initialisation steps that can only be performed after construction properties have been set. implementors should chain up to the call of their parent class to allow it to complete its initialisation.
The class structure for the <structname>GObject</structname> type.
<title>Implementing singletons using a constructor</title> <programlisting> static MySingleton *the_singleton = NULL;
static GObject* my_singleton_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) { GObject *object;
if (!the_singleton) { object = G_OBJECT_CLASS (parent_class)->constructor (type, n_construct_params, construct_params); the_singleton = MY_SINGLETON (object); } else object = g_object_ref (G_OBJECT (the_singleton));
return object; } </programlisting>
GSList * | construct_properties |
void(* | constructed |
GObject *(* | constructor |
void(* | dispatch_properties_changed |
void(* | dispose |