Class 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

public class ParamSpec extends Pointer
#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.

https://docs.gtk.org/gobject/class.ParamSpec.html

  • Constructor Details

  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getBlurb

      public Str getBlurb()
      Get the short description of a #GParamSpec.
      Returns:
      the short description of @pspec.
    • getDefaultValue

      public Value 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

      public Str 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

      public Str getNick()
      Get the nickname of a #GParamSpec.
      Returns:
      the nickname of @pspec.
    • getQdata

      public Pointer getQdata(int quark)
      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

      public ParamSpec 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

      public ParamSpec ref()
      Increments the reference count of @pspec.
      Returns:
      the #GParamSpec that was passed into this function
    • refSink

      public ParamSpec refSink()
      Convenience function to ref and sink a #GParamSpec.
      Returns:
      the #GParamSpec that was passed into this function
    • setQdata

      public void setQdata(int quark, @Nullable Pointer data)
      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 pointer
      data - an opaque user data pointer
    • setQdataFull

      public void setQdataFull(int quark, @Nullable 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.
      Parameters:
      quark - a #GQuark, naming the user data pointer
      data - an opaque user data pointer
      destroy - 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

      public Pointer 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). 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_PARAM
      name - the canonical name of the property
      nick - the nickname of the property
      blurb - a short description of the property
      flags - a combination of #GParamFlags
      Returns:
      (transfer floating): a newly allocated #GParamSpec instance, which is initially floating
    • isValidName

      public static boolean isValidName(@Nonnull Str name)
      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

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()