Package ch.bailu.gtk.gobject
Class ParamSpec
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.ParamSpec
- All Implemented Interfaces:
PointerInterface
- Direct Known Subclasses:
ParamSpecBoolean
,ParamSpecBoxed
,ParamSpecChar
,ParamSpecDouble
,ParamSpecEnum
,ParamSpecExpression
,ParamSpecFlags
,ParamSpecFloat
,ParamSpecGType
,ParamSpecInt
,ParamSpecInt64
,ParamSpecLong
,ParamSpecObject
,ParamSpecOverride
,ParamSpecParam
,ParamSpecPointer
,ParamSpecString
,ParamSpecUChar
,ParamSpecUInt
,ParamSpecUInt64
,ParamSpecULong
,ParamSpecUnichar
,ParamSpecValueArray
,ParamSpecVariant
#GParamSpec is an object structure that encapsulates the metadata
required to specify parameters, such as e.g. #GObject properties.
## Parameter names # {#canonical-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 g_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.
required to specify parameters, such as e.g. #GObject properties.
## Parameter names # {#canonical-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 g_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.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetBlurb()
Get the short description of a #GParamSpec.static ClassHandler
Gets the default value of @pspec as a pointer to a #GValue.static int
getName()
Get the name of a #GParamSpec.int
Gets the GQuark for the name.getNick()
Get the nickname of a #GParamSpec.static long
static TypeSystem.TypeSize
getQdata
(int quark) Gets back user data pointers stored via g_param_spec_set_qdata().If the paramspec redirects operations to another paramspec,
returns that paramspec.static long
static TypeSystem.TypeSize
static Pointer
Creates a new #GParamSpec instance.static boolean
isValidName
(Str name) Validate a property name for a #GParamSpec.ref()
Increments the reference count of @pspec.refSink()
Convenience function to ref and sink a #GParamSpec.void
Sets an opaque, named pointer on a #GParamSpec.void
setQdataFull
(int quark, Pointer data, ParamSpec.OnDestroyNotify destroy) This function works like g_param_spec_set_qdata(), but in addition,
a `void (*destroy) (gpointer)` function may be
specified which is called with @data as argument when the @pspec is
finalized, or the data is being overwritten by a call to
g_param_spec_set_qdata() with the same @quark.void
sink()
The initial reference count of a newly created #GParamSpec is 1,
even though no one has explicitly called g_param_spec_ref() on it
yet.stealQdata
(int quark) Gets back user data pointers stored via g_param_spec_set_qdata()
and removes the @data from @pspec without invoking its destroy()
function (if any was set).void
unref()
Decrements the reference count of a @pspec.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
ParamSpec
-
-
Method Details
-
getClassHandler
-
getBlurb
Get the short description of a #GParamSpec.- Returns:
- the short description of @pspec.
-
getDefaultValue
Gets the default value of @pspec as a pointer to a #GValue.
The #GValue will remain valid for the life of @pspec.- Returns:
- a pointer to a #GValue which must not be modified
-
getName
Get the name of a #GParamSpec.
The name is always an "interned" string (as per g_intern_string()).
This allows for pointer-value comparisons.- Returns:
- the name of @pspec.
-
getNameQuark
public int getNameQuark()Gets the GQuark for the name.- Returns:
- the GQuark for @pspec->name.
-
getNick
Get the nickname of a #GParamSpec.- Returns:
- the nickname of @pspec.
-
getQdata
Gets back user data pointers stored via g_param_spec_set_qdata().- Parameters:
quark
- a #GQuark, naming the user data pointer- Returns:
- the user data pointer set, or %NULL
-
getRedirectTarget
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 #GParamSpecOverride. See g_object_class_override_property()
for an example of the use of this capability.- Returns:
- paramspec to which requests on this paramspec should be redirected, or %NULL if none.
-
ref
Increments the reference count of @pspec.- Returns:
- the #GParamSpec that was passed into this function
-
refSink
Convenience function to ref and sink a #GParamSpec.- Returns:
- the #GParamSpec that was passed into this function
-
setQdata
Sets an opaque, named pointer on a #GParamSpec. The name is
specified through a #GQuark (retrieved e.g. via
g_quark_from_static_string()), and the pointer can be gotten back
from the @pspec with g_param_spec_get_qdata(). Setting a
previously set user data pointer, overrides (frees) the old pointer
set, using %NULL as pointer essentially removes the data stored.- Parameters:
quark
- a #GQuark, naming the user data pointerdata
- an opaque user data pointer
-
setQdataFull
This function works like g_param_spec_set_qdata(), but in addition,
a `void (*destroy) (gpointer)` function may be
specified which is called with @data as argument when the @pspec is
finalized, or the data is being overwritten by a call to
g_param_spec_set_qdata() with the same @quark.- Parameters:
quark
- a #GQuark, naming the user data pointerdata
- an opaque user data pointerdestroy
- function to invoke with @data as argument, when @data needs to be freed
-
sink
public void sink()The initial reference count of a newly created #GParamSpec 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
Gets back user data pointers stored via g_param_spec_set_qdata()
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.- Parameters:
quark
- a #GQuark, naming the user data pointer- Returns:
- the user data pointer set, or %NULL
-
unref
public void unref()Decrements the reference count of a @pspec. -
internal
public static Pointer internal(long param_type, @Nonnull Str name, @Nullable Str nick, @Nullable Str blurb, int flags) Creates a new #GParamSpec instance.
See [canonical parameter names][canonical-parameter-names] for details of
the rules for @name. Names which violate these rules lead to undefined
behaviour.
Beyond the name, #GParamSpecs have two more descriptive strings, the
@nick and @blurb, which may be used as a localized label and description.
For GTK and related libraries these are considered deprecated and may be
omitted, while for other libraries such as GStreamer and its plugins they
are essential. When in doubt, follow the conventions used in the
surrounding code and supporting libraries.- Parameters:
param_type
- the #GType for the property; must be derived from %G_TYPE_PARAMname
- the canonical name of the propertynick
- the nickname of the propertyblurb
- a short description of the propertyflags
- a combination of #GParamFlags- Returns:
- (transfer floating): a newly allocated #GParamSpec instance, which is initially floating
-
isValidName
Validate a property name for a #GParamSpec. 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.- Parameters:
name
- the canonical name of the property- Returns:
- %TRUE if @name is a valid property name, %FALSE otherwise.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-