ObjectClass

The class structure for the GObject type.

// Example of implementing a singleton using a constructor.
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;
}

Constructors

this
this(GObjectClass* gObjectClass, bool ownedRef)

Sets our main struct and passes it to the parent class.

Members

Functions

findProperty
ParamSpec findProperty(string propertyName)

Looks up the gobject.ParamSpec for a property of a class.

getObjectClassStruct
GObjectClass* getObjectClassStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

installProperties
void installProperties(ParamSpec[] pspecs)

Installs new properties from an array of gobject.ParamSpecs

installProperty
void installProperty(uint propertyId, ParamSpec pspec)

Installs a new property.

listProperties
ParamSpec[] listProperties()

Get an array of gobject.ParamSpec* for all properties of a class.

overrideProperty
void overrideProperty(uint propertyId, string name)

Registers property_id as referring to a property with the name name in a parent class or in an interface implemented by oclass. This allows this class to "override" a property implementation in a parent class or to provide the implementation of a property from an interface.

Variables

gObjectClass
GObjectClass* gObjectClass;

the main Gtk struct