StyleProviderProtocol

public protocol StyleProviderProtocol

GtkStyleProvider is an interface for style information used by GtkStyleContext.

See [methodGtk.StyleContext.add_provider] and [funcGtk.StyleContext.add_provider_for_display] for adding GtkStyleProviders.

GTK uses the GtkStyleProvider implementation for CSS in [ifaceGtk.CssProvider].

The StyleProviderProtocol protocol exposes the methods and properties of an underlying GtkStyleProvider 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 StyleProvider. Alternatively, use StyleProviderRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkStyleProvider instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkStyleProvider instance.

    Default Implementation

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

    Declaration

    Swift

    var style_provider_ptr: UnsafeMutablePointer<GtkStyleProvider>! { get }
  • Required Initialiser for types conforming to StyleProviderProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

StyleProvider signals

  • Connect a Swift signal handler to the given, typed StyleProviderSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: StyleProviderSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    handler

    The Swift signal handler (function or callback) to invoke on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • Connect a C signal handler to the given, typed StyleProviderSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: StyleProviderSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • Note

    This represents the underlying gtk-private-changed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onGtkPrivateChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: StyleProviderRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the gtkPrivateChanged signal is emitted

  • gtkPrivateChangedSignal Extension method

    Typed gtk-private-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var gtkPrivateChangedSignal: StyleProviderSignalName { get }