WidgetClassProtocol
public protocol WidgetClassProtocol
The WidgetClassProtocol protocol exposes the methods and properties of an underlying GtkWidgetClass 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 WidgetClass.
Alternatively, use WidgetClassRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkWidgetClassinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
_ptrDefault implementationTyped pointer to the underlying
GtkWidgetClassinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkWidgetClassinstance.Declaration
Swift
var _ptr: UnsafeMutablePointer<GtkWidgetClass>! { get } -
Required Initialiser for types conforming to
WidgetClassProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bindTemplateCallbackFull(callbackName:Extension methodcallbackSymbol: ) Declares a
callback_symbolto handlecallback_namefrom the template XML defined forwidget_type. Seegtk_builder_add_callback_symbol().Note that this must be called from a composite widget classes class initializer after calling
gtk_widget_class_set_template().Declaration
Swift
@inlinable func bindTemplateCallbackFull(callbackName: UnsafePointer<gchar>!, callbackSymbol: GCallback?) -
bindTemplateChildFull(name:Extension methodinternalChild: structOffset: ) Automatically assign an object declared in the class template XML to be set to a location on a freshly built instance’s private data, or alternatively accessible via
gtk_widget_get_template_child().The struct can point either into the public instance, then you should use
G_STRUCT_OFFSET(WidgetType, member)forstruct_offset, or in the private struct, then you should useG_PRIVATE_OFFSET(WidgetType, member).An explicit strong reference will be held automatically for the duration of your instance’s life cycle, it will be released automatically when
GObjectClass.dispose()runs on your instance and if astruct_offsetthat is != 0 is specified, then the automatic location in your instance public or private data will be set tonil. You can however access an automated child pointer the first time your classesGObjectClass.dispose()runs, or alternatively inGtkWidgetClass.destroy().If
internal_childis specified,GtkBuildableIface.get_internal_child()will be automatically implemented by theGtkWidgetclass so there is no need to implement it manually.The wrapper macros
gtk_widget_class_bind_template_child(),gtk_widget_class_bind_template_child_internal(),gtk_widget_class_bind_template_child_private()andgtk_widget_class_bind_template_child_internal_private()might be more convenient to use.Note that this must be called from a composite widget classes class initializer after calling
gtk_widget_class_set_template().Declaration
Swift
@inlinable func bindTemplateChildFull(name: UnsafePointer<gchar>!, internalChild: Bool, structOffset: gssize) -
findStyleProperty(propertyName:Extension method) Finds a style property of a widget class by name.
Declaration
Swift
@inlinable func findStyleProperty(propertyName: UnsafePointer<gchar>!) -> GLibObject.ParamSpecRef! -
getCssName()Extension methodGets the name used by this class for matching in CSS code. See
gtk_widget_class_set_css_name()for details.Declaration
Swift
@inlinable func getCssName() -> String! -
installStyleProperty(pspec:Extension method) Installs a style property on a widget class. The parser for the style property is determined by the value type of
pspec.Declaration
Swift
@inlinable func installStyleProperty<ParamSpecT>(pspec: ParamSpecT) where ParamSpecT : ParamSpecProtocol -
installStylePropertyParser(pspec:Extension methodparser: ) Installs a style property on a widget class.
Declaration
Swift
@inlinable func installStylePropertyParser<ParamSpecT>(pspec: ParamSpecT, parser: @escaping GtkRcPropertyParser) where ParamSpecT : ParamSpecProtocol -
listStyleProperties(nProperties:Extension method) Returns all style properties of a widget class.
Declaration
Swift
@inlinable func listStyleProperties(nProperties: UnsafeMutablePointer<guint>!) -> UnsafeMutablePointer<UnsafeMutablePointer<GParamSpec>?>! -
setAccessible(role:Extension method) Sets the default
AtkRoleto be set on accessibles created for widgets ofwidget_class. Accessibles may decide to not honor this setting if their role reporting is more refined. Calls togtk_widget_class_set_accessible_type()will reset this value.In cases where you want more fine-grained control over the role of accessibles created for
widget_class, you should provide your own accessible type and usegtk_widget_class_set_accessible_type()instead.If
roleisATK_ROLE_INVALID, the default role will not be changed and the accessible’s default role will be used instead.This function should only be called from class init functions of widgets.
Declaration
Swift
@inlinable func setAccessible(role: AtkRole) -
setAccessible(type:Extension method) Sets the type to be used for creating accessibles for widgets of
widget_class. The giventypemust be a subtype of the type used for accessibles of the parent class.This function should only be called from class init functions of widgets.
Declaration
Swift
@inlinable func setAccessible(type: GType) -
set(connectFunc:Extension methodconnectData: connectDataDestroy: ) For use in language bindings, this will override the default
GtkBuilderConnectFuncto be used when parsing GtkBuilder XML from this class’s template data.Note that this must be called from a composite widget classes class initializer after calling
gtk_widget_class_set_template().Declaration
Swift
@inlinable func set(connectFunc: GtkBuilderConnectFunc?, connectData: gpointer! = nil, connectDataDestroy: GDestroyNotify?) -
setCss(name:Extension method) Sets the name to be used for CSS matching of widgets.
If this function is not called for a given class, the name of the parent class is used.
Declaration
Swift
@inlinable func setCss(name: UnsafePointer<CChar>!) -
setTemplate(templateBytes:Extension method) This should be called at class initialization time to specify the GtkBuilder XML to be used to extend a widget.
For convenience,
gtk_widget_class_set_template_from_resource()is also provided.Note that any class that installs templates must call
gtk_widget_init_template()in the widget’s instance initializer.Declaration
Swift
@inlinable func setTemplate<BytesT>(templateBytes: BytesT) where BytesT : BytesProtocol -
setTemplateFrom(resourceName:Extension method) A convenience function to call
gtk_widget_class_set_template().Note that any class that installs templates must call
gtk_widget_init_template()in the widget’s instance initializer.Declaration
Swift
@inlinable func setTemplateFrom(resourceName: UnsafePointer<gchar>!) -
cssNameExtension methodGets the name used by this class for matching in CSS code. See
gtk_widget_class_set_css_name()for details.Declaration
Swift
@inlinable var cssName: String! { get nonmutating set } -
parentClassExtension methodThe object class structure needs to be the first element in the widget class structure in order for the class mechanism to work correctly. This allows a GtkWidgetClass pointer to be cast to a GObjectClass pointer.
Declaration
Swift
@inlinable var parentClass: GInitiallyUnownedClass { get } -
activateSignalExtension methodThe signal to emit when a widget of this class is activated,
gtk_widget_activate()handles the emission. Implementation of this signal is optional.Declaration
Swift
@inlinable var activateSignal: guint { get }
View on GitHub
Install in Dash
WidgetClassProtocol Protocol Reference