gi-gobject-2.0.26: GObject bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GObject.Structs.ObjectClass

Description

The class structure for the GObject type.

C code

// 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;
}
Synopsis

Exported types

newtype ObjectClass Source #

Memory-managed wrapper type.

Constructors

ObjectClass (ManagedPtr ObjectClass) 

Instances

Instances details
Eq ObjectClass Source # 
Instance details

Defined in GI.GObject.Structs.ObjectClass

BoxedPtr ObjectClass Source # 
Instance details

Defined in GI.GObject.Structs.ObjectClass

CallocPtr ObjectClass Source # 
Instance details

Defined in GI.GObject.Structs.ObjectClass

ManagedPtrNewtype ObjectClass Source # 
Instance details

Defined in GI.GObject.Structs.ObjectClass

Methods

toManagedPtr :: ObjectClass -> ManagedPtr ObjectClass

tag ~ 'AttrSet => Constructible ObjectClass tag Source # 
Instance details

Defined in GI.GObject.Structs.ObjectClass

Methods

new :: MonadIO m => (ManagedPtr ObjectClass -> ObjectClass) -> [AttrOp ObjectClass tag] -> m ObjectClass

newZeroObjectClass :: MonadIO m => m ObjectClass Source #

Construct a ObjectClass struct initialized to zero.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

findProperty, installProperty, overrideProperty.

Getters

None.

Setters

None.

findProperty

objectClassFindProperty Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ObjectClass

oclass: a ObjectClass

-> Text

propertyName: the name of the property to look up

-> m GParamSpec

Returns: the ParamSpec for the property, or Nothing if the class doesn't have a property of that name

Looks up the ParamSpec for a property of a class.

installProperty

objectClassInstallProperty Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ObjectClass

oclass: a ObjectClass

-> Word32

propertyId: the id for the new property

-> GParamSpec

pspec: the ParamSpec for the new property

-> m () 

Installs a new property.

All properties should be installed during the class initializer. It is possible to install properties after that, but doing so is not recommend, and specifically, is not guaranteed to be thread-safe vs. use of properties on the same type on other threads.

Note that it is possible to redefine a property in a derived class, by installing a property with the same name. This can be useful at times, e.g. to change the range of allowed values or the default value.

overrideProperty

objectClassOverrideProperty Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ObjectClass

oclass: a ObjectClass

-> Word32

propertyId: the new property ID

-> Text

name: the name of a property registered in a parent class or in an interface of this class.

-> m () 

Registers propertyId 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.

Internally, overriding is implemented by creating a property of type ParamSpecOverride; generally operations that query the properties of the object class, such as objectClassFindProperty or objectClassListProperties will return the overridden property. However, in one case, the constructProperties argument of the constructor virtual function, the ParamSpecOverride is passed instead, so that the paramId field of the ParamSpec will be correct. For virtually all uses, this makes no difference. If you need to get the overridden property, you can call paramSpecGetRedirectTarget.

Since: 2.4

Properties

constructed

No description available in the introspection data.

clearObjectClassConstructed :: MonadIO m => ObjectClass -> m () Source #

Set the value of the “constructed” field to Nothing. When overloading is enabled, this is equivalent to

clear #constructed

getObjectClassConstructed :: MonadIO m => ObjectClass -> m (Maybe ObjectClassConstructedFieldCallback) Source #

Get the value of the “constructed” field. When overloading is enabled, this is equivalent to

get objectClass #constructed

setObjectClassConstructed :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassConstructedFieldCallback -> m () Source #

Set the value of the “constructed” field. When overloading is enabled, this is equivalent to

set objectClass [ #constructed := value ]

dispatchPropertiesChanged

No description available in the introspection data.

clearObjectClassDispatchPropertiesChanged :: MonadIO m => ObjectClass -> m () Source #

Set the value of the “dispatch_properties_changed” field to Nothing. When overloading is enabled, this is equivalent to

clear #dispatchPropertiesChanged

getObjectClassDispatchPropertiesChanged :: MonadIO m => ObjectClass -> m (Maybe ObjectClassDispatchPropertiesChangedFieldCallback) Source #

Get the value of the “dispatch_properties_changed” field. When overloading is enabled, this is equivalent to

get objectClass #dispatchPropertiesChanged

setObjectClassDispatchPropertiesChanged :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassDispatchPropertiesChangedFieldCallback -> m () Source #

Set the value of the “dispatch_properties_changed” field. When overloading is enabled, this is equivalent to

set objectClass [ #dispatchPropertiesChanged := value ]

dispose

No description available in the introspection data.

clearObjectClassDispose :: MonadIO m => ObjectClass -> m () Source #

Set the value of the “dispose” field to Nothing. When overloading is enabled, this is equivalent to

clear #dispose

getObjectClassDispose :: MonadIO m => ObjectClass -> m (Maybe ObjectClassDisposeFieldCallback) Source #

Get the value of the “dispose” field. When overloading is enabled, this is equivalent to

get objectClass #dispose

setObjectClassDispose :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassDisposeFieldCallback -> m () Source #

Set the value of the “dispose” field. When overloading is enabled, this is equivalent to

set objectClass [ #dispose := value ]

finalize

No description available in the introspection data.

clearObjectClassFinalize :: MonadIO m => ObjectClass -> m () Source #

Set the value of the “finalize” field to Nothing. When overloading is enabled, this is equivalent to

clear #finalize

getObjectClassFinalize :: MonadIO m => ObjectClass -> m (Maybe ObjectClassFinalizeFieldCallback) Source #

Get the value of the “finalize” field. When overloading is enabled, this is equivalent to

get objectClass #finalize

setObjectClassFinalize :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassFinalizeFieldCallback -> m () Source #

Set the value of the “finalize” field. When overloading is enabled, this is equivalent to

set objectClass [ #finalize := value ]

gTypeClass

the parent class

getObjectClassGTypeClass :: MonadIO m => ObjectClass -> m TypeClass Source #

Get the value of the “g_type_class” field. When overloading is enabled, this is equivalent to

get objectClass #gTypeClass

getProperty

No description available in the introspection data.

clearObjectClassGetProperty :: MonadIO m => ObjectClass -> m () Source #

Set the value of the “get_property” field to Nothing. When overloading is enabled, this is equivalent to

clear #getProperty

getObjectClassGetProperty :: MonadIO m => ObjectClass -> m (Maybe ObjectClassGetPropertyFieldCallback) Source #

Get the value of the “get_property” field. When overloading is enabled, this is equivalent to

get objectClass #getProperty

setObjectClassGetProperty :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassGetPropertyFieldCallback -> m () Source #

Set the value of the “get_property” field. When overloading is enabled, this is equivalent to

set objectClass [ #getProperty := value ]

notify

No description available in the introspection data.

clearObjectClassNotify :: MonadIO m => ObjectClass -> m () Source #

Set the value of the “notify” field to Nothing. When overloading is enabled, this is equivalent to

clear #notify

getObjectClassNotify :: MonadIO m => ObjectClass -> m (Maybe ObjectClassNotifyFieldCallback) Source #

Get the value of the “notify” field. When overloading is enabled, this is equivalent to

get objectClass #notify

setObjectClassNotify :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassNotifyFieldCallback -> m () Source #

Set the value of the “notify” field. When overloading is enabled, this is equivalent to

set objectClass [ #notify := value ]

setProperty

No description available in the introspection data.

clearObjectClassSetProperty :: MonadIO m => ObjectClass -> m () Source #

Set the value of the “set_property” field to Nothing. When overloading is enabled, this is equivalent to

clear #setProperty

getObjectClassSetProperty :: MonadIO m => ObjectClass -> m (Maybe ObjectClassSetPropertyFieldCallback) Source #

Get the value of the “set_property” field. When overloading is enabled, this is equivalent to

get objectClass #setProperty

setObjectClassSetProperty :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassSetPropertyFieldCallback -> m () Source #

Set the value of the “set_property” field. When overloading is enabled, this is equivalent to

set objectClass [ #setProperty := value ]