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 |
ParamSpec
is an object structure that encapsulates the metadata
required to specify parameters, such as e.g. Object
properties.
A property name consists of segments consisting of ASCII letters and
digits, separated by either the -
or _
character. The first
character of a property name must be a letter. These are the same rules as
for signal naming (see g_signal_new()
).
When creating and looking up a ParamSpec
, either separator can be
used, but they cannot be mixed. Using -
is considerably more
efficient, and is the ‘canonical form’. Using _
is discouraged.
Synopsis
- newtype ParamSpec = ParamSpec (ManagedPtr ParamSpec)
- class (BoxedPtr o, TypedObject o, IsDescendantOf ParamSpec o) => IsParamSpec o
- toParamSpec :: (MonadIO m, IsParamSpec o) => o -> m ParamSpec
- paramSpecGetBlurb :: (HasCallStack, MonadIO m) => GParamSpec -> m Text
- paramSpecGetDefaultValue :: (HasCallStack, MonadIO m) => GParamSpec -> m GValue
- paramSpecGetName :: (HasCallStack, MonadIO m) => GParamSpec -> m Text
- paramSpecGetNameQuark :: (HasCallStack, MonadIO m) => GParamSpec -> m Word32
- paramSpecGetNick :: (HasCallStack, MonadIO m) => GParamSpec -> m Text
- paramSpecGetQdata :: (HasCallStack, MonadIO m) => GParamSpec -> Word32 -> m (Ptr ())
- paramSpecGetRedirectTarget :: (HasCallStack, MonadIO m) => GParamSpec -> m GParamSpec
- paramSpecSetQdata :: (HasCallStack, MonadIO m) => GParamSpec -> Word32 -> Ptr () -> m ()
- paramSpecSink :: (HasCallStack, MonadIO m) => GParamSpec -> m ()
- paramSpecStealQdata :: (HasCallStack, MonadIO m) => GParamSpec -> Word32 -> m (Ptr ())
Exported types
Memory-managed wrapper type.
Instances
Eq ParamSpec Source # | |
TypedObject ParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec | |
BoxedPtr ParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec boxedPtrCopy :: ParamSpec -> IO ParamSpec # boxedPtrFree :: ParamSpec -> IO () # | |
ManagedPtrNewtype ParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec | |
HasParentTypes ParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec | |
type ParentTypes ParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec |
class (BoxedPtr o, TypedObject o, IsDescendantOf ParamSpec o) => IsParamSpec o Source #
Type class for types which can be safely cast to ParamSpec
, for instance with toParamSpec
.
Instances
(BoxedPtr o, TypedObject o, IsDescendantOf ParamSpec o) => IsParamSpec o Source # | |
Defined in GI.GObject.Objects.ParamSpec |
toParamSpec :: (MonadIO m, IsParamSpec o) => o -> m ParamSpec Source #
Methods
Overloaded methods
getBlurb
:: (HasCallStack, MonadIO m) | |
=> GParamSpec |
|
-> m Text | Returns: the short description of |
Get the short description of a ParamSpec
.
getDefaultValue
paramSpecGetDefaultValue Source #
:: (HasCallStack, MonadIO m) | |
=> GParamSpec |
|
-> m GValue | Returns: a pointer to a |
getName
:: (HasCallStack, MonadIO m) | |
=> GParamSpec |
|
-> m Text | Returns: the name of |
Get the name of a ParamSpec
.
The name is always an "interned" string (as per internString
).
This allows for pointer-value comparisons.
getNameQuark
paramSpecGetNameQuark Source #
:: (HasCallStack, MonadIO m) | |
=> GParamSpec |
|
-> m Word32 | Returns: the GQuark for |
Gets the GQuark for the name.
Since: 2.46
getNick
:: (HasCallStack, MonadIO m) | |
=> GParamSpec |
|
-> m Text | Returns: the nickname of |
Get the nickname of a ParamSpec
.
getQdata
:: (HasCallStack, MonadIO m) | |
=> GParamSpec |
|
-> Word32 |
|
-> m (Ptr ()) | Returns: the user data pointer set, or |
Gets back user data pointers stored via paramSpecSetQdata
.
getRedirectTarget
paramSpecGetRedirectTarget Source #
:: (HasCallStack, MonadIO m) | |
=> GParamSpec |
|
-> m GParamSpec | Returns: paramspec to which requests on this
paramspec should be redirected, or |
If the paramspec redirects operations to another paramspec,
returns that paramspec. Redirect is used typically for
providing a new implementation of a property in a derived
type while preserving all the properties from the parent
type. Redirection is established by creating a property
of type ParamSpecOverride
. See objectClassOverrideProperty
for an example of the use of this capability.
Since: 2.4
setQdata
:: (HasCallStack, MonadIO m) | |
=> GParamSpec |
|
-> Word32 |
|
-> Ptr () |
|
-> m () |
Sets an opaque, named pointer on a ParamSpec
. The name is
specified through a GQuark
(retrieved e.g. via
quarkFromStaticString
), and the pointer can be gotten back
from the pspec
with paramSpecGetQdata
. Setting a
previously set user data pointer, overrides (frees) the old pointer
set, using Nothing
as pointer essentially removes the data stored.
sink
:: (HasCallStack, MonadIO m) | |
=> GParamSpec |
|
-> m () |
The initial reference count of a newly created ParamSpec
is 1,
even though no one has explicitly called g_param_spec_ref()
on it
yet. So the initial reference count is flagged as "floating", until
someone calls g_param_spec_ref (pspec); g_param_spec_sink
(pspec);
in sequence on it, taking over the initial
reference count (thus ending up with a pspec
that has a reference
count of 1 still, but is not flagged "floating" anymore).
stealQdata
:: (HasCallStack, MonadIO m) | |
=> GParamSpec |
|
-> Word32 |
|
-> m (Ptr ()) | Returns: the user data pointer set, or |
Gets back user data pointers stored via paramSpecSetQdata
and removes the data
from pspec
without invoking its destroy()
function (if any was set). Usually, calling this function is only
required to update user data pointers with a destroy notifier.