GParamSpec

G-Golf GObject GParamSpec low level API.
GParamSpec — Metadata for parameter specifications.

Procedures

gi-g-param-spec-show
g-param-spec-type
g-param-spec-type-name
g-param-spec-get-default-value
g-param-spec-get-name
g-param-spec-get-nick
g-param-spec-get-blurb
g-param-spec-get-flags

Types and Values

%g-param-flags

Description

GParamSpec is an object structure that encapsulates the metadata required to specify parameters, such as e.g. GObject properties.

Procedures

Note: in this section, the p-spec argument is [must be] a pointer to a GParamSpec.

Procedure: gi-g-param-spec-show p-spec

Returns nothing.

Obtains and displays the following informations about the interface pointed to by p-spec:

,use (g-golf)
(g-irepository-require "Gtk" #:version "4.0")
⇒ $2 = #<pointer 0x55ae43d74a60>

(gi-import-by-name "Gtk" "Label")
⇒ $3 = #<<gobject-class> <gtk-label> 7f1a75436a50>

(!g-class <gtk-label>)
⇒ $4 = #<pointer 0x55ae43deb0c0>

(g-object-class-find-property $4 "css-classes")
⇒ $5 = #<pointer 0x55ae43d9d510>

(gi-g-param-spec-show $5)
-|
-| #<pointer 0x55ae43d9d510> is a (pointer to a) GParamSpec:
-|
-|                name: "css-classes"
-|                nick: "CSS Style Classes"
-|               blurb: "List of CSS classes"
-|              g-type: 94206951022032
-|         g-type-name: "GStrv"
-|           type-name: g-strv
-|

Note that the last item, type-name: g-strv is not part of the GParamSpec structure. It is obtained (and used by G-Golf internally by calling (g-name->name g-type-name).

Procedure: g-param-spec-type p-spec
Procedure: g-param-spec-type-name p-spec

Returns an integer or a (symbol) name, respectively.

Obtains and returns the GType or the GType (symbol) name for p-spec, respectively.

Procedure: g-param-spec-get-default-value p-spec

Returns a pointer.

Obtains and returns the p-spec default value as pointer to a GValue, which will remain valid for the life of p-spec and must not be modified.

Procedure: g-param-spec-get-name p-spec
Procedure: g-param-spec-get-nick p-spec
Procedure: g-param-spec-get-blurb p-spec

Returns a string.

Obtains and returns the name, nickname or short description for p-spec, respectively.

Procedure: g-param-spec-get-flags p-spec

Returns a (possibly empty) list.

Obtains and returns a list of the combination of %g-param-flags that applies to p-spec.

Types and Values

Instance Variable of <gi-enum>: %g-param-flags

An instance of <gi-enum>, who’s members are the scheme representation of the GParamFlags:

type-name: GParamFlags
name: g-param-flags
enum-set:

readable

the parameter is readable

writable

the parameter is writable

readwrite

alas for readable writable

construct

the parameter will be set upon object construction

construct-only

the parameter can only be set upon object construction

lax-validation

upon parameter conversion, strict validation is not required

static-name

the string used as name when constructing the parameter is guaranteed to remain valid and unmodified for the lifetime of the parameter. Since 2.8

private

internal

static-nick

the string used as nick when constructing the parameter is guaranteed to remain valid and unmmodified for the lifetime of the parameter. Since 2.8

static-blurb

the string used as blurb when constructing the parameter is guaranteed to remain valid and unmodified for the lifetime of the parameter. Since 2.8

explicit-notify

calls to g_object_set_property for this property will not automatically result in a ‘notify’ signal being emitted: the implementation must call g_object_notify themselves in case the property actually changes. Since: 2.42

deprecated

the parameter is deprecated and will be removed in a future version. A warning will be generated if it is used while running with G_ENABLE_DIAGNOSTIC=1. Since 2.26