ParamSpecRef

public struct ParamSpecRef : ParamSpecProtocol

The ParamSpecRef type acts as a lightweight Swift reference to an underlying GParamSpec instance. It exposes methods that can operate on this data type through ParamSpecProtocol conformance. Use ParamSpecRef only as an unowned reference to an existing GParamSpec instance.

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

Parameter names #

A property name consists of 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.

  • ptr
    Untyped pointer to the underlying `GParamSpec` instance.
    

    For type-safe access, use the generated, typed pointer param_spec_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

ParamSpec Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GParamSpec>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GParamSpec>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GParamSpec>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GParamSpec>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements ParamSpecProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : ParamSpecProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ParamSpecProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ParamSpecProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ParamSpecProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ParamSpecProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ParamSpecProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Creates a new `GParamSpec` instance.
    

    See 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 associated with them, the nick, which should be suitable for use as a label for the property in a property editor, and the blurb, which should be a somewhat longer description, suitable for e.g. a tooltip. The nick and blurb should ideally be localized.

    Declaration

    Swift

    @inlinable
    static func internal_(paramType: GType, name: UnsafePointer<gchar>!, nick: UnsafePointer<gchar>!, blurb: UnsafePointer<gchar>!, flags: ParamFlags) -> ParamSpecRef!
  • Create a parameter specification reference from a lookup table.

    Declaration

    Swift

    @inlinable
    init?<P>(name: P, from pool: UnsafeMutablePointer<GParamSpecPool>!, ownerType: GType = .object, walkAncestors: Bool = true) where P : PropertyNameProtocol

    Parameters

    name

    property name to look up

    pool

    lookup table to consult

    ownerType

    type of the property owner (defaults to .object)

    walkAncestors

    false to avoid checking ancestors (defaults to true)

  • Create a parameter specification reference from a lookup table.

    Declaration

    Swift

    @inlinable
    init?<N, P>(name: N, from pool: P!, ownerType: GType = .object, walkAncestors: Bool = true) where N : PropertyNameProtocol, P : ParamSpecPoolProtocol

    Parameters

    name

    property name to look up

    pool

    reference to the lookup table to consult

    ownerType

    type of the property owner (defaults to .object)

    walkAncestors

    false to avoid checking ancestors (defaults to true)