SignalListItemFactoryProtocol
public protocol SignalListItemFactoryProtocol : ListItemFactoryProtocol
GtkSignalListItemFactory is a GtkListItemFactory that emits signals
to to manage listitems.
Signals are emitted for every listitem in the same order:
[signal
Gtk.SignalListItemFactory::setup] is emitted to set up permanent things on the listitem. This usually means constructing the widgets used in the row and adding them to the listitem.[signal
Gtk.SignalListItemFactory::bind] is emitted to bind the item passed via [propertyGtk.ListItem:item] to the widgets that have been created in step 1 or to add item-specific widgets. Signals are connected to listen to changes - both to changes in the item to update the widgets or to changes in the widgets to update the item. After this signal has been called, the listitem may be shown in a list widget.[signal
Gtk.SignalListItemFactory::unbind] is emitted to undo everything done in step 2. Usually this means disconnecting signal handlers. Once this signal has been called, the listitem will no longer be used in a list widget.[signal
Gtk.SignalListItemFactory::bind] and [signalGtk.SignalListItemFactory::unbind] may be emitted multiple times again to bind the listitem for use with new items. By reusing listitems, potentially costly setup can be avoided. However, it means code needs to make sure to properly clean up the listitem in step 3 so that no information from the previous use leaks into the next use.- [signal
Gtk.SignalListItemFactory::teardown] is emitted to allow undoing the effects of [signalGtk.SignalListItemFactory::setup]. After this signal was emitted on a listitem, the listitem will be destroyed and not be used again.
- [signal
Note that during the signal emissions, changing properties on the
GtkListItems passed will not trigger notify signals as the listitem’s
notifications are frozen. See g_object_freeze_notify() for details.
For tracking changes in other properties in the GtkListItem, the
notify signal is recommended. The signal can be connected in the
[signalGtk.SignalListItemFactory::setup] signal and removed again during
[signalGtk.SignalListItemFactory::teardown].
The SignalListItemFactoryProtocol protocol exposes the methods and properties of an underlying GtkSignalListItemFactory 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 SignalListItemFactory.
Alternatively, use SignalListItemFactoryRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkSignalListItemFactoryinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
signal_list_item_factory_ptrDefault implementationTyped pointer to the underlying
GtkSignalListItemFactoryinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkSignalListItemFactoryinstance.Declaration
Swift
var signal_list_item_factory_ptr: UnsafeMutablePointer<GtkSignalListItemFactory>! { get } -
Required Initialiser for types conforming to
SignalListItemFactoryProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
SignalListItemFactorySignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: SignalListItemFactorySignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe 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
SignalListItemFactorySignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: SignalListItemFactorySignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onBind(flags:Extension methodhandler: ) Emitted when a new [property
Gtk.ListItem:item] has been set on thelistitemand should be bound for use.After this signal was emitted, the listitem might be shown in a [class
Gtk.ListView] or other list widget.The [signal
Gtk.SignalListItemFactory::unbind] signal is the opposite of this signal and can be used to undo everything done in this signal.Note
This represents the underlyingbindsignalDeclaration
Swift
@discardableResult @inlinable func onBind(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SignalListItemFactoryRef, _ listitem: ListItemRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
listitemThe
GtkListItemto bindhandlerThe signal handler to call Run the given callback whenever the
bindsignal is emitted -
bindSignalExtension methodTyped
bindsignal for using theconnect(signal:)methodsDeclaration
Swift
static var bindSignal: SignalListItemFactorySignalName { get } -
onSetup(flags:Extension methodhandler: ) Emitted when a new listitem has been created and needs to be setup for use.
It is the first signal emitted for every listitem.
The [signal
Gtk.SignalListItemFactory::teardown] signal is the opposite of this signal and can be used to undo everything done in this signal.Note
This represents the underlyingsetupsignalDeclaration
Swift
@discardableResult @inlinable func onSetup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SignalListItemFactoryRef, _ listitem: ListItemRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
listitemThe
GtkListItemto set uphandlerThe signal handler to call Run the given callback whenever the
setupsignal is emitted -
setupSignalExtension methodTyped
setupsignal for using theconnect(signal:)methodsDeclaration
Swift
static var setupSignal: SignalListItemFactorySignalName { get } -
onTeardown(flags:Extension methodhandler: ) Emitted when a listitem is about to be destroyed.
It is the last signal ever emitted for this
listitem.This signal is the opposite of the [signal
Gtk.SignalListItemFactory::setup] signal and should be used to undo everything done in that signal.Note
This represents the underlyingteardownsignalDeclaration
Swift
@discardableResult @inlinable func onTeardown(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SignalListItemFactoryRef, _ listitem: ListItemRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
listitemThe
GtkListItemto teardownhandlerThe signal handler to call Run the given callback whenever the
teardownsignal is emitted -
teardownSignalExtension methodTyped
teardownsignal for using theconnect(signal:)methodsDeclaration
Swift
static var teardownSignal: SignalListItemFactorySignalName { get } -
onUnbind(flags:Extension methodhandler: ) Emitted when a listitem has been removed from use in a list widget and its new [property
Gtk.ListItem:item] is about to be unset.This signal is the opposite of the [signal
Gtk.SignalListItemFactory::bind] signal and should be used to undo everything done in that signal.Note
This represents the underlyingunbindsignalDeclaration
Swift
@discardableResult @inlinable func onUnbind(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SignalListItemFactoryRef, _ listitem: ListItemRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
listitemThe
GtkListItemto unbindhandlerThe signal handler to call Run the given callback whenever the
unbindsignal is emitted -
unbindSignalExtension methodTyped
unbindsignal for using theconnect(signal:)methodsDeclaration
Swift
static var unbindSignal: SignalListItemFactorySignalName { get }
View on GitHub
Install in Dash
SignalListItemFactoryProtocol Protocol Reference