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.
-
Untyped pointer to the underlying
GtkStyleProvider
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
style_provider_ptr
Default implementationTyped 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)
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
StyleProviderSignalName
signalDeclaration
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 byuserData
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(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
StyleProviderSignalName
signalDeclaration
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 byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onGtkPrivateChanged(flags:
Extension methodhandler: ) Note
This represents the underlyinggtk-private-changed
signalDeclaration
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 methodTyped
gtk-private-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var gtkPrivateChangedSignal: StyleProviderSignalName { get }