Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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
- newtype ObjectClass = ObjectClass (ManagedPtr ObjectClass)
- newZeroObjectClass :: MonadIO m => m ObjectClass
- noObjectClass :: Maybe ObjectClass
- objectClassFindProperty :: (HasCallStack, MonadIO m) => ObjectClass -> Text -> m GParamSpec
- objectClassInstallProperty :: (HasCallStack, MonadIO m) => ObjectClass -> Word32 -> GParamSpec -> m ()
- objectClassOverrideProperty :: (HasCallStack, MonadIO m) => ObjectClass -> Word32 -> Text -> m ()
- clearObjectClassConstructed :: MonadIO m => ObjectClass -> m ()
- getObjectClassConstructed :: MonadIO m => ObjectClass -> m (Maybe ObjectClassConstructedFieldCallback)
- setObjectClassConstructed :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassConstructedFieldCallback -> m ()
- clearObjectClassDispatchPropertiesChanged :: MonadIO m => ObjectClass -> m ()
- getObjectClassDispatchPropertiesChanged :: MonadIO m => ObjectClass -> m (Maybe ObjectClassDispatchPropertiesChangedFieldCallback)
- setObjectClassDispatchPropertiesChanged :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassDispatchPropertiesChangedFieldCallback -> m ()
- clearObjectClassDispose :: MonadIO m => ObjectClass -> m ()
- getObjectClassDispose :: MonadIO m => ObjectClass -> m (Maybe ObjectClassDisposeFieldCallback)
- setObjectClassDispose :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassDisposeFieldCallback -> m ()
- clearObjectClassFinalize :: MonadIO m => ObjectClass -> m ()
- getObjectClassFinalize :: MonadIO m => ObjectClass -> m (Maybe ObjectClassFinalizeFieldCallback)
- setObjectClassFinalize :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassFinalizeFieldCallback -> m ()
- getObjectClassGTypeClass :: MonadIO m => ObjectClass -> m TypeClass
- clearObjectClassGetProperty :: MonadIO m => ObjectClass -> m ()
- getObjectClassGetProperty :: MonadIO m => ObjectClass -> m (Maybe ObjectClassGetPropertyFieldCallback)
- setObjectClassGetProperty :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassGetPropertyFieldCallback -> m ()
- clearObjectClassNotify :: MonadIO m => ObjectClass -> m ()
- getObjectClassNotify :: MonadIO m => ObjectClass -> m (Maybe ObjectClassNotifyFieldCallback)
- setObjectClassNotify :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassNotifyFieldCallback -> m ()
- clearObjectClassSetProperty :: MonadIO m => ObjectClass -> m ()
- getObjectClassSetProperty :: MonadIO m => ObjectClass -> m (Maybe ObjectClassSetPropertyFieldCallback)
- setObjectClassSetProperty :: MonadIO m => ObjectClass -> FunPtr C_ObjectClassSetPropertyFieldCallback -> m ()
Exported types
newtype ObjectClass Source #
Memory-managed wrapper type.
Instances
Eq ObjectClass Source # | |
Defined in GI.GObject.Structs.ObjectClass (==) :: ObjectClass -> ObjectClass -> Bool # (/=) :: ObjectClass -> ObjectClass -> Bool # | |
WrappedPtr ObjectClass Source # | |
Defined in GI.GObject.Structs.ObjectClass | |
tag ~ 'AttrSet => Constructible ObjectClass tag Source # | |
Defined in GI.GObject.Structs.ObjectClass new :: MonadIO m => (ManagedPtr ObjectClass -> ObjectClass) -> [AttrOp ObjectClass tag] -> m ObjectClass # |
newZeroObjectClass :: MonadIO m => m ObjectClass Source #
Construct a ObjectClass
struct initialized to zero.
noObjectClass :: Maybe ObjectClass Source #
A convenience alias for Nothing
:: Maybe
ObjectClass
.
Methods
Overloaded methods
findProperty
objectClassFindProperty Source #
:: (HasCallStack, MonadIO m) | |
=> ObjectClass |
|
-> Text |
|
-> m GParamSpec | Returns: the |
Looks up the ParamSpec
for a property of a class.
installProperty
objectClassInstallProperty Source #
:: (HasCallStack, MonadIO m) | |
=> ObjectClass |
|
-> Word32 |
|
-> GParamSpec |
|
-> 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 #
:: (HasCallStack, MonadIO m) | |
=> ObjectClass |
|
-> Word32 |
|
-> Text |
|
-> 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 ]