TypeInstanceProtocol

public protocol TypeInstanceProtocol

An opaque structure used as the base of all type instances.

The TypeInstanceProtocol protocol exposes the methods and properties of an underlying GTypeInstance instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see TypeInstance. Alternatively, use TypeInstanceRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GTypeInstance instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • _ptr Default implementation

    Typed pointer to the underlying GTypeInstance instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GTypeInstance instance.

    Declaration

    Swift

    var _ptr: UnsafeMutablePointer<GTypeInstance>! { get }
  • Required Initialiser for types conforming to TypeInstanceProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

TypeInstance Record: TypeInstanceProtocol extension (methods and fields)

  • getPrivate(privateType:) Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    func getPrivate(privateType: GType) -> gpointer?
  • This is similar to g_signal_connect_data(), but uses a closure which ensures that the gobject stays alive during the call to c_handler by temporarily adding a reference count to gobject.

    When the gobject is destroyed the signal handler will be automatically disconnected. Note that this is not currently threadsafe (ie: emitting a signal while gobject is being destroyed in another thread is not safe).

    Declaration

    Swift

    @inlinable
    func signalConnectObject(detailedSignal: UnsafePointer<gchar>!, cHandler: @escaping GCallback, gobject: ObjectRef? = nil, connectFlags: ConnectFlags) -> Int
  • This is similar to g_signal_connect_data(), but uses a closure which ensures that the gobject stays alive during the call to c_handler by temporarily adding a reference count to gobject.

    When the gobject is destroyed the signal handler will be automatically disconnected. Note that this is not currently threadsafe (ie: emitting a signal while gobject is being destroyed in another thread is not safe).

    Declaration

    Swift

    @inlinable
    func signalConnectObject<ObjectT>(detailedSignal: UnsafePointer<gchar>!, cHandler: @escaping GCallback, gobject: ObjectT?, connectFlags: ConnectFlags) -> Int where ObjectT : ObjectProtocol
  • Emits a signal. Signal emission is done synchronously. The method will only return control after all handlers are called or signal emission was stopped.

    Note that g_signal_emit_valist() resets the return value to the default if no handlers are connected, in contrast to g_signal_emitv().

    Declaration

    Swift

    @inlinable
    func signalEmitValist(signalID: Int, detail: GQuark, varArgs: CVaListPointer)
  • typeCheckInstance() Extension method

    Private helper function to aid implementation of the G_TYPE_CHECK_INSTANCE() macro.

    Declaration

    Swift

    @inlinable
    func typeCheckInstance() -> Bool
  • Undocumented

    Declaration

    Swift

    @inlinable
    func typeCheckInstanceCast(ifaceType: GType) -> GLibObject.TypeInstanceRef!
  • Undocumented

    Declaration

    Swift

    @inlinable
    func typeCheckInstanceIsA(ifaceType: GType) -> Bool
  • Undocumented

    Declaration

    Swift

    @inlinable
    func typeCheckInstanceIsFundamentallyA(fundamentalType: GType) -> Bool
  • typeFreeInstance() Extension method

    Frees an instance of a type, returning it to the instance pool for the type, if there is one.

    Like g_type_create_instance(), this function is reserved for implementors of fundamental types.

    Declaration

    Swift

    @inlinable
    func typeFreeInstance()
  • typeNameFromInstance() Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    func typeNameFromInstance() -> String!