Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- paramSpecGetBlurb :: (HasCallStack, MonadIO m) => GParamSpec -> m (Maybe 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 (Maybe GParamSpec)
- paramSpecIsValidName :: (HasCallStack, MonadIO m) => Text -> m Bool
- 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 # | |
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 toManagedPtr :: ParamSpec -> ManagedPtr ParamSpec | |
TypedObject ParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec | |
HasParentTypes ParamSpec Source # | |
Defined in GI.GObject.Objects.ParamSpec | |
IsGValue (Maybe ParamSpec) Source # | Convert |
Defined in GI.GObject.Objects.ParamSpec gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe ParamSpec -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe 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
Click to display all available methods, including inherited ones
Methods
Getters
getBlurb, getDefaultValue, getName, getNameQuark, getNick, getQdata, getRedirectTarget.
Setters
getBlurb
:: (HasCallStack, MonadIO m) | |
=> GParamSpec |
|
-> m (Maybe 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 (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
:: (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][canonical-parameter-names] for details of the rules for valid names.
Since: 2.66
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.