| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.GObject.Objects.ParamSpec
Description
GParamSpec encapsulates the metadata required to specify parameters, such as GObject properties.
Parameter names
A property name consists of one or more 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 GObject.signal_new).
When creating and looking up a GParamSpec, 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
- type family ResolveParamSpecMethod (t :: Symbol) o where ...
- data ParamSpecGetBlurbMethodInfo
- paramSpecGetBlurb :: (HasCallStack, MonadIO m) => GParamSpec -> m (Maybe Text)
- data ParamSpecGetDefaultValueMethodInfo
- paramSpecGetDefaultValue :: (HasCallStack, MonadIO m) => GParamSpec -> m GValue
- data ParamSpecGetNameMethodInfo
- paramSpecGetName :: (HasCallStack, MonadIO m) => GParamSpec -> m Text
- data ParamSpecGetNameQuarkMethodInfo
- paramSpecGetNameQuark :: (HasCallStack, MonadIO m) => GParamSpec -> m Word32
- data ParamSpecGetNickMethodInfo
- paramSpecGetNick :: (HasCallStack, MonadIO m) => GParamSpec -> m Text
- data ParamSpecGetQdataMethodInfo
- paramSpecGetQdata :: (HasCallStack, MonadIO m) => GParamSpec -> Word32 -> m (Ptr ())
- data ParamSpecGetRedirectTargetMethodInfo
- paramSpecGetRedirectTarget :: (HasCallStack, MonadIO m) => GParamSpec -> m (Maybe GParamSpec)
- paramSpecIsValidName :: (HasCallStack, MonadIO m) => Text -> m Bool
- data ParamSpecSetQdataMethodInfo
- paramSpecSetQdata :: (HasCallStack, MonadIO m) => GParamSpec -> Word32 -> Ptr () -> m ()
- data ParamSpecSinkMethodInfo
- paramSpecSink :: (HasCallStack, MonadIO m) => GParamSpec -> m ()
- data ParamSpecStealQdataMethodInfo
- paramSpecStealQdata :: (HasCallStack, MonadIO m) => GParamSpec -> Word32 -> m (Ptr ())
Exported types
Memory-managed wrapper type.
Constructors
| ParamSpec (ManagedPtr ParamSpec) |
Instances
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
Click to display all available methods, including inherited ones
Methods
Getters
getBlurb, getDefaultValue, getName, getNameQuark, getNick, getQdata, getRedirectTarget.
Setters
type family ResolveParamSpecMethod (t :: Symbol) o where ... Source #
Equations
| ResolveParamSpecMethod "sink" o = ParamSpecSinkMethodInfo | |
| ResolveParamSpecMethod "stealQdata" o = ParamSpecStealQdataMethodInfo | |
| ResolveParamSpecMethod "getBlurb" o = ParamSpecGetBlurbMethodInfo | |
| ResolveParamSpecMethod "getDefaultValue" o = ParamSpecGetDefaultValueMethodInfo | |
| ResolveParamSpecMethod "getName" o = ParamSpecGetNameMethodInfo | |
| ResolveParamSpecMethod "getNameQuark" o = ParamSpecGetNameQuarkMethodInfo | |
| ResolveParamSpecMethod "getNick" o = ParamSpecGetNickMethodInfo | |
| ResolveParamSpecMethod "getQdata" o = ParamSpecGetQdataMethodInfo | |
| ResolveParamSpecMethod "getRedirectTarget" o = ParamSpecGetRedirectTargetMethodInfo | |
| ResolveParamSpecMethod "setQdata" o = ParamSpecSetQdataMethodInfo | |
| ResolveParamSpecMethod l o = MethodResolutionFailed l o :: Type |
getBlurb
data ParamSpecGetBlurbMethodInfo Source #
Instances
| (signature ~ m (Maybe Text), MonadIO m) => OverloadedMethod ParamSpecGetBlurbMethodInfo GParamSpec signature Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods overloadedMethod :: GParamSpec -> signature # | |
| OverloadedMethodInfo ParamSpecGetBlurbMethodInfo GParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GParamSpec |
|
| -> m (Maybe Text) | Returns: the short description of |
Get the short description of a ParamSpec.
getDefaultValue
data ParamSpecGetDefaultValueMethodInfo Source #
Instances
| (signature ~ m GValue, MonadIO m) => OverloadedMethod ParamSpecGetDefaultValueMethodInfo GParamSpec signature Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods overloadedMethod :: GParamSpec -> signature # | |
| OverloadedMethodInfo ParamSpecGetDefaultValueMethodInfo GParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods | |
paramSpecGetDefaultValue Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GParamSpec |
|
| -> m GValue | Returns: a pointer to a |
getName
data ParamSpecGetNameMethodInfo Source #
Instances
| (signature ~ m Text, MonadIO m) => OverloadedMethod ParamSpecGetNameMethodInfo GParamSpec signature Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods overloadedMethod :: GParamSpec -> signature # | |
| OverloadedMethodInfo ParamSpecGetNameMethodInfo GParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods | |
Arguments
| :: (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
data ParamSpecGetNameQuarkMethodInfo Source #
Instances
| (signature ~ m Word32, MonadIO m) => OverloadedMethod ParamSpecGetNameQuarkMethodInfo GParamSpec signature Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods overloadedMethod :: GParamSpec -> signature # | |
| OverloadedMethodInfo ParamSpecGetNameQuarkMethodInfo GParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods | |
paramSpecGetNameQuark Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GParamSpec |
|
| -> m Word32 | Returns: the GQuark for |
Gets the GQuark for the name.
Since: 2.46
getNick
data ParamSpecGetNickMethodInfo Source #
Instances
| (signature ~ m Text, MonadIO m) => OverloadedMethod ParamSpecGetNickMethodInfo GParamSpec signature Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods overloadedMethod :: GParamSpec -> signature # | |
| OverloadedMethodInfo ParamSpecGetNickMethodInfo GParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GParamSpec |
|
| -> m Text | Returns: the nickname of |
Get the nickname of a ParamSpec.
getQdata
data ParamSpecGetQdataMethodInfo Source #
Instances
| (signature ~ (Word32 -> m (Ptr ())), MonadIO m) => OverloadedMethod ParamSpecGetQdataMethodInfo GParamSpec signature Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods overloadedMethod :: GParamSpec -> signature # | |
| OverloadedMethodInfo ParamSpecGetQdataMethodInfo GParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GParamSpec |
|
| -> Word32 |
|
| -> m (Ptr ()) | Returns: the user data pointer set, or |
Gets back user data pointers stored via paramSpecSetQdata.
getRedirectTarget
data ParamSpecGetRedirectTargetMethodInfo Source #
Instances
| (signature ~ m (Maybe GParamSpec), MonadIO m) => OverloadedMethod ParamSpecGetRedirectTargetMethodInfo GParamSpec signature Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods overloadedMethod :: GParamSpec -> signature # | |
| OverloadedMethodInfo ParamSpecGetRedirectTargetMethodInfo GParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods | |
paramSpecGetRedirectTarget Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GParamSpec |
|
| -> m (Maybe 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
isValidName
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Bool | Returns: |
Validate a property name for a ParamSpec. This can be useful for
dynamically-generated properties which need to be validated at run-time
before actually trying to create them.
See [canonical parameter names][classgObject.ParamSpecparameter-names]
for details of the rules for valid names.
Since: 2.66
setQdata
data ParamSpecSetQdataMethodInfo Source #
Instances
| (signature ~ (Word32 -> Ptr () -> m ()), MonadIO m) => OverloadedMethod ParamSpecSetQdataMethodInfo GParamSpec signature Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods overloadedMethod :: GParamSpec -> signature # | |
| OverloadedMethodInfo ParamSpecSetQdataMethodInfo GParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods | |
Arguments
| :: (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
data ParamSpecSinkMethodInfo Source #
Instances
| (signature ~ m (), MonadIO m) => OverloadedMethod ParamSpecSinkMethodInfo GParamSpec signature Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods overloadedMethod :: GParamSpec -> signature # | |
| OverloadedMethodInfo ParamSpecSinkMethodInfo GParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods | |
Arguments
| :: (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
data ParamSpecStealQdataMethodInfo Source #
Instances
| (signature ~ (Word32 -> m (Ptr ())), MonadIO m) => OverloadedMethod ParamSpecStealQdataMethodInfo GParamSpec signature Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods overloadedMethod :: GParamSpec -> signature # | |
| OverloadedMethodInfo ParamSpecStealQdataMethodInfo GParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec Methods | |
Arguments
| :: (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.