Class (GI Class)

GObject-2.0GObjectParamSpecAbstract

A GObject parameter specification that defines property characteristics. See https://gjs.guide/guides/gobject/basics.html#properties for more details.

Type Parameters

  • A = unknown
Index

Constructors

Properties

flags: ParamFlags
name: string
owner_type: GType
value_type: GType
$gtype: GType<GObject.ParamSpec<unknown>>

Methods

  • Gets back user data pointers stored via g_param_spec_set_qdata().

    Parameters

    • quark: number

      a GLib.Quark, naming the user data pointer

    Returns any

    the user data pointer set, or null

  • 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 GObject.ParamSpecOverride. See g_object_class_override_property() for an example of the use of this capability.

    Returns GObject.ParamSpec<unknown>

    paramspec to which requests on this paramspec should be redirected, or null if none.

  • Registers a property override for a property introduced in a parent class or inherited interface.

    Parameters

    • name: string

      The name of the property to override

    • oclass: Function | GObject.Object | GType<unknown>

      The object class or type that contains the property to override

    Returns void

  • Sets an opaque, named pointer on a GObject.ParamSpec. The name is specified through a GLib.Quark (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: number

      a GLib.Quark, naming the user data pointer

    • Optionaldata: any

      an opaque user data pointer

    Returns void

  • The initial reference count of a newly created GObject.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).

    Returns void

  • 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: number

      a GLib.Quark, naming the user data pointer

    Returns any

    the user data pointer set, or null

  • The instance finalization function (optional), should chain up to the finalize method of the parent class.

    Returns void

  • Checks if contents of value comply with the specifications set out by this type, without modifying the value. This vfunc is optional. If it isn't set, GObject will use value_validate. Since 2.74

    Parameters

    • value: any

    Returns boolean

  • Resets a value to the default value for this type (recommended, the default is g_value_reset()), see g_param_value_set_default().

    Parameters

    • value: any

    Returns void

  • Ensures that the contents of value comply with the specifications set out by this type (optional), see g_param_value_validate().

    Parameters

    • value: any

    Returns boolean

  • Compares value1 with value2 according to this type (recommended, the default is memcmp()), see g_param_values_cmp().

    Parameters

    • value1: any
    • value2: any

    Returns number

  • Creates a new GParamSpecBoolean instance specifying a G_TYPE_BOOLEAN property. In many cases, it may be more appropriate to use an enum with g_param_spec_enum(), both to improve code clarity by using explicitly named values, and to allow for more values to be added in future without breaking API.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • OptionaldefaultValue: boolean

      The default value for this property (optional)

    Returns GObject.ParamSpec<boolean>

  • Creates a new GParamSpecBoxed instance specifying a G_TYPE_BOXED derived property.

    Type Parameters

    • T

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • boxedType: GType<T> | { $gtype: GType<T> }

      The GType for this property

    Returns GObject.ParamSpec<T>

  • Creates a new GParamSpecChar instance specifying a G_TYPE_CHAR property.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • minimum: number

      The minimum value for this property

    • maximum: number

      The maximum value for this property

    • OptionaldefaultValue: number

      The default value for this property (optional)

    Returns GObject.ParamSpec<number>

  • Creates a new GParamSpecDouble instance specifying a G_TYPE_DOUBLE property.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • minimum: number

      The minimum value for this property

    • maximum: number

      The maximum value for this property

    • OptionaldefaultValue: number

      The default value for this property (optional)

    Returns GObject.ParamSpec<number>

  • Creates a new GParamSpecEnum instance specifying a G_TYPE_ENUM property.

    Type Parameters

    • T

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • enumType: GType<T> | { $gtype: GType<T> }

      The GType for this property

    • OptionaldefaultValue: any

      The default value for this property (optional)

    Returns GObject.ParamSpec<T>

  • Creates a new GParamSpecFloat instance specifying a G_TYPE_FLOAT property.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • minimum: number

      The minimum value for this property

    • maximum: number

      The maximum value for this property

    • OptionaldefaultValue: number

      The default value for this property (optional)

    Returns GObject.ParamSpec<number>

  • Creates a new GParamSpecInt instance specifying a G_TYPE_INT property.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • minimum: number

      The minimum value for this property

    • maximum: number

      The maximum value for this property

    • OptionaldefaultValue: number

      The default value for this property (optional)

    Returns GObject.ParamSpec<number>

  • Creates a new GParamSpecInt64 instance specifying a G_TYPE_INT64 property.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • minimum: number

      The minimum value for this property

    • maximum: number

      The maximum value for this property

    • OptionaldefaultValue: number

      The default value for this property (optional)

    Returns GObject.ParamSpec<number>

  • Validate a property name for a GObject.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][class@GObject.ParamSpec#parameter-names] for details of the rules for valid names.

    Parameters

    • name: string

      the canonical name of the property

    Returns boolean

  • Creates a new ParamSpec instance for JavaScript object properties.

    Type Parameters

    • T

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    Returns GObject.ParamSpec<T>

  • Creates a new GParamSpecLong instance specifying a G_TYPE_LONG property.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • minimum: number

      The minimum value for this property

    • maximum: number

      The maximum value for this property

    • OptionaldefaultValue: number

      The default value for this property (optional)

    Returns GObject.ParamSpec<number>

  • Creates a new GParamSpecObject instance specifying a property holding object references.

    Type Parameters

    • T

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • OptionalobjectType: GType<T> | { $gtype: GType<T> }

      The GType of the object (optional)

    Returns GObject.ParamSpec<T>

  • Creates a new GParamSpecParam instance specifying a G_TYPE_PARAM property.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • paramType: any

      The GType for this property

    Returns GObject.ParamSpec

  • Creates a new GParamSpecString instance specifying a G_TYPE_STRING property.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • OptionaldefaultValue: string

      The default value for this property (optional, defaults to null if not provided)

    Returns GObject.ParamSpec<string>

  • Creates a new GParamSpecUChar instance specifying a G_TYPE_UCHAR property.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • minimum: number

      The minimum value for this property

    • maximum: number

      The maximum value for this property

    • OptionaldefaultValue: number

      The default value for this property (optional)

    Returns GObject.ParamSpec<number>

  • Creates a new GParamSpecUInt instance specifying a G_TYPE_UINT property.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • minimum: number

      The minimum value for this property

    • maximum: number

      The maximum value for this property

    • OptionaldefaultValue: number

      The default value for this property (optional)

    Returns GObject.ParamSpec<number>

  • Creates a new GParamSpecUInt64 instance specifying a G_TYPE_UINT64 property.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • minimum: number

      The minimum value for this property

    • maximum: number

      The maximum value for this property

    • OptionaldefaultValue: number

      The default value for this property (optional)

    Returns GObject.ParamSpec<number>

  • Creates a new GParamSpecULong instance specifying a G_TYPE_ULONG property.

    Parameters

    • name: string

      The name of the property

    • nick: string

      A human readable name for the property (can be null)

    • blurb: string

      A longer description of the property (can be null)

    • flags: number | ParamFlags

      The flags for this property (e.g. READABLE, WRITABLE)

    • minimum: number

      The minimum value for this property

    • maximum: number

      The maximum value for this property

    • OptionaldefaultValue: number

      The default value for this property (optional)

    Returns GObject.ParamSpec<number>

Interfaces

SignalSignatures